2025-03-22 21:58:27 -04:00
|
|
|
use core::{panic::set_panic_hook, repl::setup, splash, workspace};
|
2024-12-01 16:02:06 -05:00
|
|
|
|
2024-12-21 14:35:55 -05:00
|
|
|
use colored::Colorize;
|
|
|
|
use tokio::runtime;
|
2025-03-24 19:42:32 -04:00
|
|
|
#[allow(unused_imports)]
|
|
|
|
use tracing::{debug, error, info, warn};
|
2025-02-04 05:10:53 -05:00
|
|
|
use winit::event_loop::EventLoop;
|
2024-12-19 20:54:46 -05:00
|
|
|
pub mod core;
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2025-03-22 18:19:01 -04:00
|
|
|
#[tokio::main(flavor = "current_thread")]
|
|
|
|
async fn main() -> anyhow::Result<()> {
|
2024-12-21 14:35:55 -05:00
|
|
|
if !cfg!(debug_assertions) {
|
|
|
|
println!("{}", "Debug mode disabled".bright_blue());
|
|
|
|
set_panic_hook();
|
|
|
|
}
|
2025-03-22 18:19:01 -04:00
|
|
|
setup();
|
|
|
|
splash::print_splash();
|
|
|
|
info!("Type 'help' for a list of commands.");
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2025-03-22 18:19:01 -04:00
|
|
|
let repl_thread = std::thread::spawn(|| {
|
2025-03-22 21:58:27 -04:00
|
|
|
let rt = runtime::Builder::new_current_thread()
|
|
|
|
.enable_all()
|
|
|
|
.build()
|
|
|
|
.unwrap();
|
2025-03-22 18:19:01 -04:00
|
|
|
rt.block_on(core::repl::input::handle_repl())
|
|
|
|
});
|
2025-02-04 05:10:53 -05:00
|
|
|
|
2025-03-22 18:19:01 -04:00
|
|
|
let event_loop = EventLoop::new().unwrap();
|
|
|
|
core::render::init_renderer(event_loop);
|
2024-12-02 11:51:39 -06:00
|
|
|
|
2025-03-22 18:19:01 -04:00
|
|
|
if let Err(_) = repl_thread.join() {
|
|
|
|
eprintln!("REPL thread panicked");
|
|
|
|
}
|
2024-12-01 16:02:06 -05:00
|
|
|
Ok(())
|
|
|
|
}
|