Re:Rust's Type System Is Turing-Complete: Type-Level Program...
by Manishearth on Friday March 10, 2017 @10:17PM
(#13844007)
Generics in Rust are supposed to be used as generics, not really for metaprogramming like this (but you can, but it won't be pleasant).
But Rust has a hygenic higher-level macro system that helps.
On top of that, Rust is getting procedural macros. Right now this is limited to `#[derive()]` macros, but we want it to cover all cases. This means that you can write a macro that runs arbitrary rust code at compile time.
(While it currently is limited to `#[derive()]` macros you can abuse the API to make it work for inline bang-macros as well)
But Rust has a hygenic higher-level macro system that helps.
On top of that, Rust is getting procedural macros. Right now this is limited to `#[derive()]` macros, but we want it to cover all cases. This means that you can write a macro that runs arbitrary rust code at compile time.
(While it currently is limited to `#[derive()]` macros you can abuse the API to make it work for inline bang-macros as well)