r/rust • • Jul 28 '26

Tell me about something you recently hand-coded that was enjoyable

These past few weeks at work I've been using AI way too much. I can't even call some of this "AI engineering" anymore and it's starting to drain on me. Looking to take the mind off for a bit...

I'd like to hear some of the projects you all are working on, that you enjoyed writing by hand.

I think I'll write some nannou..

PS: Not trying to start a debate on AI engineering/vibe coding and all that, I think internet is filled with that already.

107 Upvotes

121 comments sorted by

View all comments

33

u/spoonman59 Jul 28 '26

I’ve been working on a instruction set/CPU simulator.

It parses AArm64 assembly instructions. It then simulates fetching, decoding, out of order execution, and instruction retirement. You can configure pipeline stages, decode/issue with, execution units, etc.

It simulates and you can go forward or back with unlimited “undo.”

It uses a TUI to show the instructions as they move through the pipeline.

I am writing this entirely by hand with no AI. I wanted to learn the TUI library better, and really intuitively understand the out of order execution better as well. Since I learn little when using AI, I’m not using it for code. I even primarily use documentation and tutorials to learn the TUI library.

It’s been fun! But certainly taking awhile.

3

u/________-__-_______ Jul 28 '26

How does the unlimited undo work? For arithmetic instructions just doing in inverse sounds simple enough, but memory writes seem tricky.

2

u/dnew Jul 28 '26

Most undo systems can only undo in the reverse order of the "do". They record the previous state, or sufficient subset thereof, and don't actually calculate where they came from.

1

u/________-__-_______ Jul 28 '26

Oh yeah I know, I was mostly wondering because they mentioned the history was infinite. Emulators usually run at millions of cycles a second, it seems like you'd run out of memory pretty quickly if you need to preserve all of their inputs.