2 releases
new 0.1.1 | Jan 14, 2025 |
---|---|
0.1.0 | Sep 23, 2024 |
#2222 in Procedural macros
88 downloads per month
Used in ijzer
405KB
10K
SLoC
Macro wrapper for the IJzer compiler.
This allows using IJzer in a rust project.
Example:
use ijzer_macro::ijzer;
use ijzer_lib::tensor::Tensor;
#[ijzer]
fn square_tensor(x: Tensor<f32>) -> Tensor<f32> {
r#"
* x x
"#
}
let x: Tensor<f32> = Tensor::new(vec![1.0, 2.0, 3.0]);
let y: Tensor<f32> = square_tensor(x);
Because the ijzer
language is not valid rust, the body must be wrapped in a (raw) string. The signature of the function is not parsed, and only the body is parsed to the IJzer compiler.
Dependencies
~71MB
~1M SLoC