logoalt Hacker News

ernst_klimlast Tuesday at 11:09 AM1 replyview on HN

Tcc even supports that with `#!/usr/local/bin/tcc -run`, although I don't understand people who use c or go for "scripting", when python, ruby, TCL or perl have much superior ergonomics.


Replies

w4rh4wk5last Tuesday at 11:21 AM

This was a relatively old project that used a C program as build system / meta generator. All you needed was a working C compiler (and your shell to execute the first line). From there, it built and ran a program that generated various tables and some source code, followed by compiling the actual program. The final program used a runtime reflection system, which was set up by the generated tables and code from the first stage.

The main reason was to do all this without any dependencies beyond a C compiler and some POSIX standard library.