4 ms·
In summary: someone with a GitHub account discovered that you can hijack the C pre-processor (give or take some GNU language extensions) to transpile BASIC/PASC
by st_goliath 2y ago
In summary: someone with a GitHub account discovered that you can hijack the C pre-processor (give or take some GNU language extensions) to transpile BASIC/PASCAL/ALGOL like languages to C. They call their macro collection "evil" and ramble about destroying C, trying to create some form of mystique I guess.
The idea by itself is nothing new and pretty much any novice C programmer eventually stumbles across it. Famously, the original Bourne Shell was written in a variant of ALGOL68, fed through a C compiler using macro based translation[1][2], which helped spark the idea for the IOCCC[2].
[1] https://en.wikipedia.org/wiki/Bourne_shell#History https://en.wikipedia.org/wiki/Bourne_shell#History
[2] https://en.wikipedia.org/wiki/International_Obfuscated_C_Code_Contest#History https://en.wikipedia.org/wiki/International_Obfuscated_C_Cod...
- deleted 2y ago[deleted]
- tpmoney 2y ago>They call their macro collection "evil" and ramble about destroying C, trying to create some form of mystique I guess. It read to me more like a tongue in cheek statement in the same way that a car enthusiast might joke that they're about to destroy a Honda Civic by putting in a V8 engine and installing a body kit.
- shakna 2y agoYeah, it was just some fun. It's 'evil' because it should never be used for business. And yes, Bournegol was an inspiration and I mention it in a few places on the gist. I did also take it too far and wrapped it with tcc [0] into a "language". [0] https://git.sr.ht/~shakna/ogw https://git.sr.ht/~shakna/ogw
- musicale 2y agoCrazed hacker DESTROYS C language on github! If there were a novelty requirement to push to github (or to publish on HN for that matter) it would be much less fun. On the other hand, it is also fun to hear about the history. Personally I always enjoy abusing the C preprocessor for fun and profit. Just yesterday I was contemplating the potential amusement of using cpp (and cc) to generate custom assemblers, customized assembly language syntax, and assembly language interpreters.