logoalt Hacker News

markhermeling • yesterday at 7:30 PM • 1 reply • view on HN

I was specifically thinking about register access. That you can make safe if you provide a way to describe what the hardware needs.

Something like this: https://en.wikibooks.org/wiki/Ada_Programming/Representation...


Replies

viraptor • yesterday at 8:45 PM

You cannot make it safe. The data representation part is already mostly covered by packed!, enum and ranged_integers. But that doesn't make register access safe.

Any time you touch hardware, all guarantees Rust makes disappear. And anything you place in mapped io can change when you don't expect it.