Our great sponsors
minivm | ubpf | |
---|---|---|
13 | 5 | |
1,552 | 743 | |
0.3% | 1.7% | |
8.9 | 8.5 | |
6 days ago | 4 days ago | |
C | C | |
MIT License | Apache License 2.0 |
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].
- 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
ubpf
-
Rust-Written Linux Scheduler Showing Promising Results for Gaming Performance
eBPF doesn't run in user space in the context of eBPF in the linux kernel. It's verified so that the kernel can be sure it won't loop forever and then gets JIT'ed and run in kernel space.
There are some user space BPF vms like https://github.com/iovisor/ubpf and Solana.
-
bpftime: Extending eBPF from Kernel to Userspace
ubpf: https://github.com/iovisor/ubpf
-
Ask HN: Recommendation for general purpose JIT compiler
The usual recommendation have been given. Now for more touristic approach what I would like to use if given excuse and time. All those options are mostly written in C:
- QBE [1] - small compiler backend with nice IL
- DynASM [2] - IIUC the laujit's backend, that can and is used by other languages
- uBPF - Userspace eBPF VM. Depending on your DSL the eBPF toolchain could fit your use-case, but this would probably be the biggest excursion.
-
how to build eBPF learning env on my Mac
There are eBPF-specific userspace implementations you can consider looking into but right now the best support for bpf would be the linux kernel so if the goal is learning you'll most likely want to run linux in a proper virtual machine (e.g. Qemu, VirtualBox, Parallels, etc.)
-
Bytecode for a Register Machine
This may be entirely irrelevant to what you are looking for, but a good widely used finite register-based VM is the eBPF VM in the Linux Kernel. The IOVisor uBPF project (https://github.com/iovisor/ubpf) is a version of the VM in user space.
What are some alternatives?
privacytests.org - Source code for privacytests.org. Includes browser testing code and site rendering.
qbe-rs - QBE IR in natural Rust data structures
sljit - Platform independent low-level JIT compiler
LjTools - LuaJIT 2.0 bytecode parser, viewer, assembler and test VM. Lua 5.1 parser, IDE and debugger.
LuaJIT - Mirror of the LuaJIT git repository
paka - Paka language
Befunge - lang befunge 93 fast
wasm3 - 🚀 A fast WebAssembly interpreter and the most universal WASM runtime
Som - Parser, code model, navigable browser and VM for the SOM Smalltalk dialect
asmjit - Low-latency machine code generation
MAD-NG.docs - MAD documentation