Building an x86-64 instruction encoder in Rust Posted by chrischtel on Wednesday October 08, 2025 @02:51AM from the github.com dept. https://github.com/chrischtel/rask/blob/7370370229e42e5e98eb6816317c57f69e219dd6/docs/posts/hacker-news-announcement.md ( 1 comment | 2 points | on HN )
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.