5 unstable releases

0.3.2 May 26, 2023
0.3.1 Nov 11, 2022
0.3.0 Nov 3, 2022
0.2.0 Oct 25, 2022
0.1.0 Oct 22, 2022

#617 in Procedural macros

MIT/Apache

9KB
69 lines

antlion

A magical meta function that evaluate (at compile-time if used inside a macro which is the point of taking a TokenStream input) any Rust expr!

Example

use antlion::Sandbox;
use quote::quote;

let test = Sandbox::new("calc").unwrap();
let x: u32 = test.eval(quote! { 2 + 2 }).unwrap();
assert!(x == 4);

This library indeed is not what would benefit the most your crate build time, but it was still design in mind with the will of caching sandbox compilation.

Acknowledgments

⚠️ This is still a working experiment, not yet production ready.

This project was part of a work assignment as an IOG contractor.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~83KB