#macro #language #tensor #ijzer #i-jzer

macro ijzer_macro

Macro for using IJzer in a rust project

2 releases

new 0.1.1 Jan 14, 2025
0.1.0 Sep 23, 2024

#2222 in Procedural macros

Download history 31/week @ 2024-09-27 6/week @ 2024-10-04 5/week @ 2024-10-11 1/week @ 2024-10-18 1/week @ 2024-11-15 11/week @ 2024-12-06 1/week @ 2024-12-13 88/week @ 2025-01-10

88 downloads per month
Used in ijzer

MIT license

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