Show HN: A virtual machine in the Rust type system
2 points
2 hours ago
| 0 comments
| github.com
| HN
As a follow-up to a CTF challenge I wrote, I created a small proof-of-concept virtual machine embedded in the Rust type system. Trait resolution and in particular associated types are used to "execute" a program, represented as a type, to its final state. (The "execution" happens during Rust compilation.)

The VM architecture is simple: two 8-bit registers, a stack, a small number of instructions, including conditional control flow. However, other than patience and hitting the recursion limits, more useful/realistic architectures could be embedded as well.

I wrote a blog post that goes into more depth about how this was developed and how it all works: https://www.thenet.sk/blog0011

No one has commented on this post.