https://github.com/glycerine/riscv-emu-golang
which is a RISC-V cpu emulator in pure Go.
With it you can run RV64 ELF binaries (or just snippets of RV64 assembly) fully inside your Go host program.
It includes a JIT compiler to translate RISC-V to amd64 at
runtime for a nice 8x speedup. With that JIT-ing we are only
about 6x slower than native C compiled to amd64.
Not bad for a fun side project.
Enjoy,
Jason
JIT COMPARISON (rv8 vs abjit) — 2026-05-29 04:16 [macos]
cpu: Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
Strategy MIPS
──────────────────────────────────────────────────
Go JIT — rv8 Fixed Static Mapping (native): 3367 MIPS
Go JIT — abjit (native): 3396 MIPS
Go interpreter (no JIT): 432 MIPS
libriscv — JIT (TCC): 3517 MIPS
libriscv — interpreter (no JIT): 846 MIPS
libriscv — full binary translation - N/A, claims 50% native
native x86-64 (-O3 -march=native): 16833 MIPS (150ms)
wazero wasm aot-and-run 8555 MIPS (but linux is near native)