4 ms·
You can write the compile time generation as a separate Rust program. It has the added advantage that you only need to run it if the program itself changes and
by vlovich123 3y ago
You can write the compile time generation as a separate Rust program. It has the added advantage that you only need to run it if the program itself changes and otherwise check in the generated code.
The main advantage is that you don’t have to generate Rust code as a string. You’re just generating Rust data structures in Rust and that is convenient. Not sure if there’s any tricks for that.