fn main() {
#[cfg(all(target_arch = "x86_64", not(target_os = "windows")))]
logicaffeine_jit::segv_trace_install();
#[cfg(all(target_arch = "x86_64", not(target_os = "windows")))]
if std::env::var_os("LOGOS_NO_JIT").is_none() {
logicaffeine_jit::install();
}
let stack_bytes = logicaffeine_language::ast_depth::max_ast_depth()
.saturating_mul(40 * 1024)
.max(16 * 1024 * 1024);
let outcome = std::thread::Builder::new()
.name("largo".into())
.stack_size(stack_bytes)
.spawn(|| {
match logicaffeine_cli::run_cli() {
Ok(()) => 0,
Err(e) => logicaffeine_cli::ui::render_error(e.as_ref()),
}
})
.expect("spawn the largo worker")
.join();
match outcome {
Ok(0) => {}
Ok(code) => std::process::exit(code),
Err(_) => std::process::exit(101),
}
}