4 ms·
It is great to see other languages getting the same compile-time meta programming features as C ;-) https://godbolt.org/z/P1r49nTWo https://godbolt.org/z/P1r49
by uecker 1y ago
It is great to see other languages getting the same compile-time meta programming features as C ;-)
https://godbolt.org/z/P1r49nTWo https://godbolt.org/z/P1r49nTWo
- deleted 1y ago[deleted]
- loeg 1y agoI didn't know godbolt let you include URLs. Fascinating: https://raw.githubusercontent.com/uecker/noplate/main/src/core.h https://raw.githubusercontent.com/uecker/noplate/main/src/co... I think Zig gets some points here for legibility ;-).
- uecker 1y agoNote that only one or two lines of this file is needed here, the rest is for other experiments... And a user would simply use the "literal" macro. I also do not think the Zig version is really that much clearer or obvious. I would not recommend to write such code anyway, neither in C nor in Zig. The "unreachable" version is far better.