gnu-libjit 0.9.0

A safe rust wrapper around the libjit just in time compiler
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use gnu_libjit::{Abi, Context};

fn main() {
    let mut context = Context::new();
    context.build_start();
    let mut func = context.function(Abi::Cdecl, Context::float64_type(), vec![]).unwrap();
    let zero = func.create_float64_constant(0.0);
    func.insn_return(&zero);
    func.compile();
    context.build_end();
    let function: fn() -> f64  = func.to_closure();
    println!("{}", function());
}