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.
minivm
-
Show HN: I wrote a WebAssembly Interpreter and Toolkit in C
> I developed a unique way to write interpreters based on threaded code jumps and basic block versioning when I made MiniVM (https://github.com/FastVM/minivm). It was both larger and more dynamic than WebAssembly.
I'd be very interested to read more about this. It looks like you are using "one big function" with computed goto (https://github.com/FastVM/Web49/blob/main/src/interp/interp....). My experience working on this problem led me to the same conclusion as Mike Pall, which is that compilers do not do well with this pattern (particularly when it comes to register allocation): http://lua-users.org/lists/lua-l/2011-02/msg00742.html
I'm curious how you worked around the problem of poor register allocation in the compiler. I've come to the conclusion that tail calls are the best solution to this problem: https://blog.reverberate.org/2021/04/21/musttail-efficient-i...
-
Ask HN: Recommendation for general purpose JIT compiler
Maybe take a look at MiniVM[0]? It was on HN a couple months ago[1].
[0]: https://github.com/fastvm/minivm
- MiniVM: “Minivm Port to Dlang”
- MiniVM: A zero-dependency cross-language runtime on par with LuaJIT and C
-
Hacker News top posts: Jan 8, 2022
MiniVM: A zero-dependency cross-language runtime on par with LuaJIT and C\ (19 comments)
- MiniVM: A minimal cross-language runtime that beats C/luajit on some benchmarks
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?
privacytests.org - Source code for privacytests.org. Includes browser testing code and site rendering.
android-luajit-launcher - Android NativeActivity based launcher for LuaJIT, implementing the main loop within Lua land via FFI
sljit - Platform independent low-level JIT compiler
lc3-vm - A LC3 virtual machine implementation in a few lines of C code
LuaJIT - Mirror of the LuaJIT git repository
paka - Paka language
asmjit - Low-latency machine code generation
gigatron-rom - System, apps and tooling for the Gigatron TTL microcomputer
qbe-rs - QBE IR in natural Rust data structures
os49 - basically minivm os