#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

#2275 in Procedural macros

Download history 1/week @ 2024-10-20 1/week @ 2024-11-17 12/week @ 2024-12-08 112/week @ 2025-01-12 15/week @ 2025-01-19 1/week @ 2025-02-02

128 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