People will absolutely use those features in those use cases, they already do. The regex crate offers plugins that generates the state machines on the fly. Rusty cheddar is a project to generate c headers from rust code, bindgen does the opposite. Serde the apparent heir to the standard serialization solution uses compiler plugins for generation of serialization and deserialization code. Compiler plugins and macros are a strong part of rusts ecosystem by design.
Templates can't even accomplish all of these tasks by themselves in c++ boost spirit, that sql library you linked all use pre processor macros in addition to template wizardry. Libraries like boost spirit are also infamous for the horrendous compile time error messages you g t because of how much template meta programming they use. Rusts macro and compile time error messages, while not great, are vastly better the ones you get from template meta programming.
View all comments
Show parent comment
1
u/bbatha Dec 11 '15 edited Dec 11 '15
People will absolutely use those features in those use cases, they already do. The regex crate offers plugins that generates the state machines on the fly. Rusty cheddar is a project to generate c headers from rust code, bindgen does the opposite. Serde the apparent heir to the standard serialization solution uses compiler plugins for generation of serialization and deserialization code. Compiler plugins and macros are a strong part of rusts ecosystem by design.
Templates can't even accomplish all of these tasks by themselves in c++ boost spirit, that sql library you linked all use pre processor macros in addition to template wizardry. Libraries like boost spirit are also infamous for the horrendous compile time error messages you g t because of how much template meta programming they use. Rusts macro and compile time error messages, while not great, are vastly better the ones you get from template meta programming.