xuejie
Joined 11 years ago
Joined 11 years ago
I've spent 8 years working on RISC-V VMs for blockchains, recently also contributing to ZK VMs. Modern blockchain VMs are drastically more powerful, and I'm curious how far we can push them. I started porting real game logic to blockchain VMs, running game loop, physics simulation, collision detection, etc., on blockchain VMs. So far I have:
* Teeworlds to CKB-VM: https://xuejie.space/2026_06_16_teeworlds_on_ckb/
* One Hour One Life to CKB-VM: https://xuejie.space/2026_06_29_porting_one_hour_one_life_ga...
* A small ray tracer to Jolt ZK VM: https://xuejie.space/2026_07_10_cpp_ray_tracer_on_jolt_zk_vm...
Source is available for 2 of the 3, I need to clean up the OHOL one.
Some context: CKB-VM [1] is a RISC-V virtual machine I designed for Nervos starting in 2018. Jolt ZK VM [2] is a zero-knowledge virtual machine developed by a16z. Both execute RISC-V code, but due to different design, Jolt ZK VM is a much faster CPU than CKB-VM.
Technically this is a fun challenge. Many techniques I used resemble game development tricks from the 90s on game consoles: fixed point math, banked memory in ROMs, aggressively inlining tricks, etc. I want to push to see where the ceiling is. Right now I'm trying to get a Godot [3] + JoltPhysics [4] game loop running on Jolt ZK VM.
Happy to answer questions about the VM internals, the porting process, or anything in general.
[1] https://github.com/nervosnetwork/ckb-vm
That being said, I've been recently employing comby (https://comby.dev/) in my workflow, which solves similar problem, but understands certain languages to simplify the usage.
Can you expand on this one? I was curious why you think there probably will not be a cheaper one in the future with similar or better specs.
* A fanless Chromebook with decent screen for travel use
* An Intel NUC that is hooked to a big monitor, which is also the device I'm typing this on
* A beefy Ryzen desktop that sits in the corner of my balcony, which I usually connect via ssh and perform all the heavy tasks
To me I'm getting all the benefits of each computer, and the combined cost is still less than a so-called macbook pro :)
Aren't macros, especially proc macros these days in Rust having the same effect? Personally I feel like this is a tradeoff every language has to play with: you either limit to a special way of writing, or adding some sort of ad-hoc system that enables rewriting syntax and even to a degree, semantics.
> Idris 1 is implemented in Haskell, but that has little (if anything) to do with the difference.
But latter they also go on to say:
> Idris 2 benefits from a robust, well-engineered and optimised run time system, by compiling to Chez Scheme.
I must say I'm slightly confused here. Yes a rewrite might also enable to avoid all the legacy part that might slow down the code, but what is also possible, is that a new language and a new runtime could enable new optimizations that are not possible before. The author did mention Chez's profiling tools help a lot in the rewrite. So I was curious: is it really true, that we cannot attribute some part of the speedup to language differences?
Also I was interested in the rationale behind using Scheme to replace Haskell, but I failed to find some reasoning behind this, anyone can shed some light on this?
Disclaimer: I'm never a Rust zealot, I do understand Rust has its tradeoffs, and it's not the panacea for every problem. In fact I do have side projects which are perfectly suited and written in Go. I'm just saying Rust's design turns out to be suitable for such a deterministic testing structure, and Rust's target for system programming, can also benefit A LOT from this style of testing.
And also a shameless plug: I do have some initial work exploring this area: https://github.com/xxuejie/diviner. It's still quite rough and a lot of work is needed but I do believe this is something that is worth exploring.