3 ms·
This is from servo codebase - https://github.com/servo/servo/blob/master/components/domobject_derive/lib.rs#L37-L46 https://github.com/servo/servo/blob/master
by mundanevoice 10y ago
This is from servo codebase
- https://github.com/servo/servo/blob/master/components/domobject_derive/lib.rs#L37-L46 https://github.com/servo/servo/blob/master/components/domobj...
Take a look at this. It isn't as simple and clear as C/C++ for example and requires significant investment in parsing and understanding the code.
- pcwalton 10y agoYou quoted a macro definition. The equivalent in C++ would be heavy preprocessor use, which is usually much worse.
- mkawia 10y agoThat's quote ,a library that generates code for you at compile time ,it takes code as input,has it's own syntax. It's like compile-time reflection. It's not code rust programmers would normally write, I'm one of those programmers. I'm glad some libraries like serde,rocket and diesel are using it to generate code instead of doing run-time analysis.