Elektrine lite

← Feed

@zwol@masto.hackers.town

Post #3788833

2026-07-13 15:44 UTC

@david_chisnall@infosec.exchange Because of this, my thought is we bake into machine language the principle that registers *have no byte order*, byte order is a thing that happens when data moves in or out of memory, and you have to make an explicit choice every single time you do that. And then that gives us the leverage to insist on the same principle at all higher levels. It's a rebuild-the-world idea but that's where all these polls are anyway.

Replies (1)

  • @zwol@masto.hackers.town That's more or less what Arm and PowerPC did (PowerPC made it a mode switch, since it needed to run x86 and M68k code cheaply), but it turns out that most programs don't care: unless you're serialising data (to disk or over a network), almost nothing cares what the in-memory representation of an integer is beyond its width. What they do care about is that two components (compilation units, shared libraries, whatever) in the same program agree. Pick one or the other and it's fine. So even if the ISA makes it explicit, most software won't care and will just pick whatever the default is. Things that do serialisation should provide a layer that ensures that the loaded or stored data is in the correct layout. Erlang does this well. I think Pandas lets you specify that a lazily loaded table needs byte swapping on import, but I could be wrong (the machinery is there, but maybe no one has wired it up?).

    Open ##3788829