lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, Mar 13, 2019 at 5:03 PM Egor Skriptunoff <egor.skriptunoff@gmail.com> wrote:
Lua is claimed to be extremely portable, hence the questions:
  Does Lua support mixed-endian platforms?

I suspect that pack and unpack are the only things that would break, and those might not even fail too obscenely as long as you didn't try to migrate the data across architectures. The C compiler ought to abstract away the rest. If you REALLY wanted to sidestep that, then you could use hton*() and ntoh*() and trust that the C library knows how to deal with it.
 
  Should Lua support them?

Probably not. Mixed-endian systems went the way of the dinosaur long ago. VAX and the PDP series are the only architectures I can find that were mixed-endian and also had any meaningful amount of penetration, and basically nobody uses those outside of retrocomputing enthusiasts anymore. I don't think the target audience would be worth putting ANY effort into it.

/s/ Adam