3 ms·
Show HN: C Injection Compiler – Program your text files in C
It's very early in development but it has just reached a working state so I'm
actually using it now to generate content for my website.
The idea is that it should be useful both for generating static files and for
generating responses live in a server, which it should be able to do very fast
since it all compiles to C code and one memory mapped file.
- klyrs 4y agoSo this is PHP-like but for C? What could possibly go wrong?
- kazinator 4y agoActual "PHP for C" exists: for example, the Klone web server. http://www.koanlogic.com/klone/ http://www.koanlogic.com/klone/ In Klone, you write .kl1 (and .inc) files that contain HTML/CSS/JS mixed with C. C is introduced with <% ... %> blocks, and can itself generate parts of the text using a function io_printf, which takes a request output stream handle, and printf-like arguments.
- JaDogg 4y agoInteresting. I did something similar few years ago. (https://github.com/JaDogg/ExpressGenGen https://github.com/JaDogg/ExpressGenGen)