Wrangling Untrusted File Formats Safely
Tom Duff's device was doing that because he's doing MMIO, you should not [I know you're not suggesting it, but just in case anybody reading thinks it's clever] do this today when you don't want MMIO, your compiler is very capable of just doing an actual copy quickly, so tell it that's what you want, don't write gymnastics like Duff's device.
However, expressing these partially unrolled loops nicely is a nice performance-not-safety feature of WUFFS called "Iterate loops":
Well, I say performance not safety, as always they want both, but you could safely just write the never unrolled case, while the existence of Iterate loops allows you to express a much faster special case but know the compiler will fix things up properly no matter what.
Ivy: Rob Pike's APL-Like Language / Desk Calculator
3 projects | news.ycombinator.com | 7 Aug 2022
A fake job offer took down the world’s most popular crypto game
1 project | news.ycombinator.com | 6 Jul 2022
Memory Safety for the World’s Largest Software Project
1 project | reddit.com/r/rust | 24 Jun 2022
About compile time overflow prevention...
1 project | reddit.com/r/ProgrammingLanguages | 19 Jun 2022
Emulating memory in an interpreted language
2 projects | reddit.com/r/ProgrammingLanguages | 3 Apr 2022