4 ms·
I haven't really had to use lifetime annotations yet, but again, they are just a formalization of the way I already think. I forgot that I had also written a s
by peterfirefly 3y ago
I haven't really had to use lifetime annotations yet, but again, they are just a formalization of the way I already think.
I forgot that I had also written a small cycle-by-cycle emulator of a simple CPU (8-bit data bus, 16-bit addr bus, 8 16-bit GPRs + a 16-bit PC + a single condition flag + an interrupt flag, timer interrupts, conditional jumps, call, ret, iret, mov, add, terminal I/O). That was also surprisingly easy.
I would like to use generators or something similar for a more realistic cycle-by-cycle emulator but I haven't gotten around to playing with that yet.
Generators and various kinds of coroutines are, yet again, just formalizations of the way I have been thinking for years.
Maybe other domains would be more challenging but I seriously doubt it. I do know that it will take me a couple more months before I'm really proficient in Rust -- including multi-threading -- and no longer fear macros.