asmjit
minivm
Our great sponsors
asmjit | minivm | |
---|---|---|
8 | 13 | |
3,766 | 1,549 | |
1.6% | 0.5% | |
8.2 | 8.9 | |
19 days ago | 4 days ago | |
C++ | C | |
zlib License | MIT License |
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.
asmjit
-
30 years of DOOM: new code, new bugs
The attentive reader may notice that this code is from a third-party library. So, we didn't want to include it in the article at first. However, we found something interesting. In 2017, somebody opened an issue in the asmjit project: the GCC 7.2 compiler issued a warning to the code above. The project authors fixed it:
- Ask HN: Recommendation for general purpose JIT compiler
-
Compiler Design in C++
But an easy to create a JIT would be to use https://github.com/asmjit/asmjit, which is used in RPCS3.
-
Are there any low level, cross platform assembly languages that allow jumping to non labels?
You could go the way of https://asmjit.com (or forth) and make it your assembler DSL on top of the low-level call.
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...
I made Web49 because there are not many good tools for WebAssembly out there. WABT is close, but the interpreter is too slow and the tools megabytes in size each. Wasm3 is a bit faster but only contains an interpreter, nothing else.
Tooling for WebAssembly is held mostly by the browser vendors. It is such a nice format to work with when one removes all the fluff. WebAssembly tooling should not take seconds to do what should take milliseconds, and it should be able to be used as a library, not just a command line program.
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. Web49 started as a way to compile WebAssembly to MiniVM, but soon pivoted into its own Interpreter and tooling. I could not be happier with it in its current form and am excited to see what else It can do, with more work.
-
Ask HN: Recommendation for general purpose JIT compiler
Maybe take a look at MiniVM[0]? It was on HN a couple months ago[1].
- 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
The disclaimer at the top of the benchmark section - https://github.com/FastVM/minivm#benchmarks - seemed pretty reasonable to me.
It's very clear that microbenchmarks don't tell the whole story, and that whole application benchmarks to give more real results will be desirable later.
I mean, I agree these benchmarks don't mean that much except for being a useful way to verify that the core code is working and reasonably performant - but they're up front about that fact so calling it 'benchmark-gaming' seems a trifle unfair.
What are some alternatives?
fasmg - flat assembler g - adaptable assembly engine
mir - A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
privacytests.org - Source code for privacytests.org. Includes browser testing code and site rendering.
oneDNN - oneAPI Deep Neural Network Library (oneDNN)
mlibc - Portable C standard library
sljit - Platform independent low-level JIT compiler
dynarmic - An ARM dynamic recompiler.
LuaJIT - Mirror of the LuaJIT git repository
Cwerg - The best C-like language that can be implemented in 10kLOC.
paka - Paka language
ChrysaLisp - Parallel OS, with GUI, Terminal, OO Assembler, Class libraries, C-Script compiler, Lisp interpreter and more...
wasm3 - 🚀 A fast WebAssembly interpreter and the most universal WASM runtime