Compiler Preprocessing Optimization

⚓ Rust    📅 2026-04-13    👤 surdeus    👁️ 6      

surdeus

I have written a simple library for implementing compile time calculations (such as simple calculations of compilation time, etc.). My feeling is that it can only remain as a demo and cannot be used for production, but I don't know where the problem lies. I need you to provide some suggestions for me to further develop or abandon this idea. Thank you for your attention

repo: https://github.com/fawdlstty/preprocessor

example code:

fn main() {
    let time = preprocessor::op!(
        chrono::Local::now()
            .naive_local()
            .format("%Y-%m-%d %H:%M:%S")
            .to_string()
    );
    println!("build_time: {time}");
}

1 post - 1 participant

Read full topic

🏷️ Rust_feed