News for hackers. Stuff that matters.
Re:Zig's Comptime Is Bonkers Good by modernerd on Tuesday January 07, 2025 @03:11AM (#42620402)
Yes, this is the same approach Ryan Fleury and others advocate, and it's perfectly good:

> Arbitrary compile-time execution in C:

> cl /nologo /Zi metaprogram.c && metaprogram.exe

> cl /nologo /Zi program.c

> Compile-time code runs at native speed, can be debugged, and is completely procedural & arbitrary

> You do not need your compiler to execute code for you

https://x.com/ryanjfleury/status/1875824288487571873

Re:Zig's Comptime Is Bonkers Good by chikere232 on Tuesday January 07, 2025 @04:27AM (#42620805)
MS DOS choice of / for commandline arguments and \ for paths always hurts my eyes
Re:Zig's Comptime Is Bonkers Good by zamalek on Tuesday January 07, 2025 @04:40AM (#42620876)
The only benefit that some (certainly more rare) compilers can provide is type metadata/compile-time reflection. Otherwise, totally.
Re:Zig's Comptime Is Bonkers Good by account42 on Tuesday January 14, 2025 @12:16PM (#42700308)
This gets unwieldy quick as soon as your compiler host and target are different platforms.