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

macro ijzer_macro

Macro for using IJzer in a rust project

2 releases

0.1.1 Jan 14, 2025
0.1.0 Sep 23, 2024

#2213 in Procedural macros

Download history 9/week @ 2024-10-02 5/week @ 2024-10-09 2/week @ 2024-10-16 1/week @ 2024-11-13 6/week @ 2024-12-04 6/week @ 2024-12-11 71/week @ 2025-01-08 56/week @ 2025-01-15

127 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