5 ms·
It's possible to write tools that generate code instead of building it into the language too. I wonder if it can be done better than building it into the langua
by shurcooL 14y ago
It's possible to write tools that generate code instead of building it into the language too. I wonder if it can be done better than building it into the language.
- dchest 14y agoHere's one https://github.com/droundy/gotgo https://github.com/droundy/gotgo
- frou_dh 14y agoYou could contrast achieving generics using C preprocessor gymnastics versus C++ templates.
- shurcooL 14y agoC preprocessor stuff works with text and text only. That's why it's quite hard to make things elegant. Tools can work with text and anything else you can think of. So they can potentially be better. But I don't know what could be done at this point (in fact, this might be a good problem to be analyzed from a theoretical side).