lua-users home
lua-l archive

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


On Monday, February 13, 2023 at 07:17:42 AM CST, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote: 

> Lua is designed with ISO C in mind as its host. Any bit specific for
> Windows/Unix should be explicitly turned on by some macro. It should
> compile and run in *any* hosted implementation of C that satisfies
> either the C 89 standard or the C 99 standard. (C 99 out of the box,
> C 89 with the macro LUA_USE_C89 defined.)

Which raises the question: is there a guide or written standard for maximally portable code and/or "clean C" that Lua's written in? Beyond C 99 and C 89, I mean. I'm sure there are some things in C *can* do that you shouldn't because, for example, some hosted environment's memory model will throw a fit. (Just like Java's "write once run anywhere" was wildly optimistic.)

Anyone can jump in.

Thanks,
Frank Mitchell