News for hackers. Stuff that matters.

chrischtel

Re:Building an x86-64 instruction encoder in Rust on Wednesday October 08, 2025 @02:51AM (#45512915)
I’ve been working on Rask, a small x86-64 instruction encoder written in Rust.

It’s designed for people who want to understand how compilers emit machine code — without the complexity of LLVM or Cranelift.

It currently supports mov/add/sub/ret with correct REX and ModR/M encoding, and includes tests verifying the byte output.

Repo: https://github.com/chrischtel/rask

Feedback welcome, especially from anyone who’s worked on compiler backends or JITs.