Skip to content

Latest commit

 

History

History
27 lines (26 loc) · 638 Bytes

sarus_language_doc.md.skt.md

File metadata and controls

27 lines (26 loc) · 638 Bytes
use sarus::*;
use std::mem;
fn main() {{
    let code = r#"fn main() -> () {{ {}
}}
"#;
    let mut jit = default_std_jit_from_code(code, false).unwrap();
    let func_ptr = jit.get_func("main").unwrap();
    let func = unsafe {{ mem::transmute::<_, extern "C" fn()>(func_ptr) }};
    func();
}}
use sarus::*;
use std::mem;
fn main() {{
    let code = r#"
{}
"#;
    let mut jit = default_std_jit_from_code(code, false).unwrap();
    let func_ptr = jit.get_func("main").unwrap();
    let func = unsafe {{ mem::transmute::<_, extern "C" fn()>(func_ptr) }};
    func();
}}