Our great sponsors
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.
paka
-
MiniVM: A zero-dependency cross-language runtime on par with LuaJIT and C
I think bins/boot.bc in the paka repo is a minivm binary file that does bootstrapping for paka.
-
MiniVM: A minimal cross-language runtime that beats C/luajit on some benchmarks
Personally, I find it pretty impressive that it performs as well as these runtimes despite not having a JIT compiler. I'm pretty sure Shaw's written more benchmarks, but as the README explains, it's really hard to tell what the performance characteristics of a language are without writing a larger application. So far the largest applications written with MiniVM is Paka[0], a self-hosted language similar to Lua that targets MiniVM; os49[1], an operating system built on Paka/MiniVM in the spirit of lisp machines; and xori[2], an online playground for the language.
[0]: https://github.com/FastVM/paka
-
Feedback on my pet language SIMPL
Some similar languages from this community: my Paka (even down to the println), and someone else's Cthulhu.
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?
minivm - A VM That is Dynamic and Fast
android-luajit-launcher - Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
awesome-jit - A curated list of awesome JIT frameworks, libraries, software and resources
lc3-vm - A LC3 virtual machine implementation in a few lines of C code
purr - Purr VM and Paka language [Moved to: https://github.com/ShawSumma/paka]
LuaJIT - Mirror of the LuaJIT git repository
passerine - A small extensible programming language designed for concise expression with little code.
gigatron-rom - System, apps and tooling for the Gigatron TTL microcomputer
os49 - basically minivm os