lc3-vm
Papers
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
lc3-vm
- Quick question: Care e faza cu a fi crab?
-
Writing a register based VM in less than 125 lines of C code
I haven't read the whole article yet, I just want to report what seems to be a small error:
> The code is written in C11, and it will probably compile on most operating systems. The repo can be found here, and the exact source code is vm.c:
The link on "here" is broken, it's https://github.com/,nomemory/lc3-vm (with a comma before your github username) instead of (I think) https://github.com/nomemory/lc3-vm.
-
Writing a simple 16 bit VM in less than 125 lines of C
What are you talking about?. The full implementation is even smaller: https://github.com/nomemory/lc3-vm/blob/main/vm.c
Papers
- MiniVM: A minimal cross-language runtime that beats C/luajit on some benchmarks
-
Writing a register based VM in less than 125 lines of C code
Further to this: this kind of thing is something the Forth community takes seriously. They call these threaded code techniques. [0] (The Gforth interpreter, for instance, gives you the choice of various different techniques.)
Anton Ertl of Gforth fame published a microbenchmark performance comparison of toy interpreters, written in C, run on various CPUs. [1] As you say, the approach using function pointers (call threading) scores poorly.
Interestingly, direct threading and indirect threading are extremely close, with the winner seeming to depend on the specific CPU. [1] Branch-prediction differences seem to be the main reason. There was a 2001 paper on this. [2]
[0] https://www.complang.tuwien.ac.at/forth/threaded-code.html
[1] https://www.complang.tuwien.ac.at/forth/threading/
[2] https://github.com/ForthPapersMirror/Papers/blob/master/Conv...
What are some alternatives?
lc3-in-lc3 - A metacircular LC3 implementation
android-luajit-launcher - Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
integers-snake
minivm - A VM That is Dynamic and Fast
neat-matrix-library - nml is a "simple" matrix/numerical analysis library written in pure C. The scope of the library is to highlight various algorithm implementations related to matrices. Code readability was a major concern.
paka - Paka language
gigatron-rom - System, apps and tooling for the Gigatron TTL microcomputer
LuaJIT - Mirror of the LuaJIT git repository
lc3as.py - An assembler for the LC-3 fictitious computer.
os49 - basically minivm os
awesome-jit - A curated list of awesome JIT frameworks, libraries, software and resources