3 ms·
Pascal got a very nice property - it can be compiled in one pass, literally, by spitting out code while parsing. Nothing can be simpler than that. Interpretatio
by sklogic 11y ago
Pascal got a very nice property - it can be compiled in one pass, literally, by spitting out code while parsing. Nothing can be simpler than that. Interpretation is significantly more complicated.
- agumonkey 11y agoIIRC tcc, Bellard's tiny c compiler, works this way. It emits very naive native code, but it chomps source code fast enough to boot linux 2.4 from source under 10 seconds years ago.
- watmough 11y agoIdeally it does one pass, except under the following conditions: For initialized arrays with unknown size, a first pass is done to count the number of elements. For architectures where arguments are evaluated in reverse order, a first pass is done to reverse the argument order. From: http://bellard.org/tcc/tcc-doc.html http://bellard.org/tcc/tcc-doc.html This great code to read. I need to get back to playing with it again.
- agumonkey 11y agoHa, I tried to poke inside tcc, aiming at booting linux 3.x, and missed that link. ps: it's also still under development http://lists.nongnu.org/archive/html/tinycc-devel/ http://lists.nongnu.org/archive/html/tinycc-devel/ .. impressive. ---- "tcc still compiles around 10x faster but runs x3.5 times slower." from tcc homepage 3rd benchmark URL http://lists.nongnu.org/archive/html/tinycc-devel/2013-02/msg00043.html http://lists.nongnu.org/archive/html/tinycc-devel/2013-02/ms...
- watmough 11y agoThat's a good little mailing list. The biggest issue seems to be keeping tcc working across all supported platforms when changing stuff for a single platform. tcc can actually be made to build Windows executables in the 'old-school' "Programming Windows" way, which is quite fun.