3 ms·
It turned out that for most cases, there is no gain by using an interpreter. Most code that does make any sense on a C64/6502 is compiled into a smaller and fa
by drmortalwombat 3y ago
It turned out that for most cases, there is no gain by using an interpreter. Most code that does make any sense on a C64/6502 is compiled into a smaller and faster native version. For some code e.g. heavy floating point or many pointer indirection the interpreter wins on the memory size - but this is not a good use of a C64.
- soegaard 3y agoThe idea of using an interpreter to save space is sound. Wozniack used that idea in SWEET16 for the Apple II (also 6502 based). https://en.wikipedia.org/wiki/SWEET16 https://en.wikipedia.org/wiki/SWEET16 https://www.youtube.com/watch?v=vGdEN9Z7owg https://www.youtube.com/watch?v=vGdEN9Z7owg
- drmortalwombat 3y agoThis was my assumption as well, when I started this compiler. It just did not play out this way with most code that I have written for it. The native code optimizer is able to reduce 16bit arithmetic to 8bit in many cases, where it can prove that the value range is small, and also avoid many pointer/stack operations by global call chain analysis. Both benefit the native code path