4 ms·
I'm a huge fan of tcc. I use it on embedded systems -- a good trick is to pre-process any headers you need via cpp preprocessor, 'compress' them in a single fil
by buserror 9y ago
I'm a huge fan of tcc. I use it on embedded systems -- a good trick is to pre-process any headers you need via cpp preprocessor, 'compress' them in a single file, and add your .c to that. That way you don't need to cart around all the -dev packages etc.
The 'hidden gem' of tcc is libtcc (the backend), which you can use as a JIT subsystem in your own code. For example I've written a full JIT translator for simavr [0] like that. The code translates each AVR opcode into it's own little piece of C, then compile the whole 'firmware' and runs it.
[0]: https://github.com/buserror/simavr/tree/wip/jit https://github.com/buserror/simavr/tree/wip/jit