4 ms·
Sure! The host side of things is Python/wxWidgets. It compiles down to a ST80-style VM. It follows the blue book design pretty closely, except for changes here
by rng 17y ago
Sure! The host side of things is Python/wxWidgets. It compiles down to a ST80-style VM. It follows the blue book design pretty closely, except for changes here and there to work better on the target hardware (ARM7, 16K RAM, 64K flash). Bytecodes are a little more compact (under 3K bytecodes for the entire system), a compacting collector instead of a 2-space (8K of heap), classes and literals are immutable (they're stored in flash).
The VM talks the host via simple debug protocol (usb to real hardware, tcp on simulator). The debug protocol can download code, start/stop execution, and request serialised objects. The stacktrace (which is as far as the "debugger" goes currently) is implemented by requesting the root context on the stack, which then lets you get all the other frames, as well as inspect instance vars / temps.
There's no floating point support at the moment, but it can do a really bad rendition of the Mario theme song on the little piezo beeper (I've got an attempt at a 2 channel sound synthesizer in the VM, but the speaker on my hardware just mangles it)!