4 ms·
Cool stuff: 1) Introduction: Density Is King (With a Tiny VM) 2) Indirect Threaded 16-bit FORTH: Not Great For Density 3) Naive Lisp: Terrible for
by karmakaze 5y ago
Cool stuff:
1) Introduction: Density Is King (With a Tiny VM)
2) Indirect Threaded 16-bit FORTH: Not Great For Density
3) Naive Lisp: Terrible for Density
4) Lua's VM: Four-Byte Register-Based Instructions
5) The MuP21 and F21 instruction sets
6) Local Variables: Registers Or Stacks?
7) Adapting the MuP21 Instruction Set to a Smalltalk-Like System
8) Speculative Case Study: An F21-like Squeak
9) Steve Wozniak's SWEET 16 Dream Machine
10) NanoVM: Java Bytecodes on the AVR
11) Code-Compact Data Structures
12) Library Design
13) Other Existing Small Interpreters
14) Conclusions: Squeak Rules, We Should Be Able To Do Python In A Few K
- buescher 5y agoDoesn't the SWEET16 make it straightforward to drop in and out of straight 6502 machine code? Making it more like a library or virtual coprocessor? Did anyone ever target it with a compiler? Yes, though, cool stuff!
- throwaway81523 5y agoYeah Sweet16 was just a way to get denser code on a 6502, by giving you a 16 bit register VM so you could do 16 bit operations without having to expand out multiple 8 bit instructions. For a compiler target you might be better off with bytecode. I remember looking at the sweet16 description and thinking it would be hard to compile to, though partly because the docs I looked at weren't very complete. It was architecturally odd too though.
- spc476 5y agoWikipedia has a page on it: <https://en.wikipedia.org/wiki/SWEET16 https://en.wikipedia.org/wiki/SWEET16>. It's architecturally odd because it was designed to run on a 6502 with as small as footprint as possible (about 300 bytes of code, 32 bytes of RAM) and only did a few operations (add, sub, cmp, call, return, inc, dec, load, store, branch-on-condition).
- kragen 5y agoI'm glad you liked it!