lua-users home
lua-l archive

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

On 05/08/2011 13.45, Luiz Henrique de Figueiredo wrote:
I was wondering whether "porting" Lua to C99, i.e. using C99 features to
enhance it, would allow some real advantages over C90.

What C99 features would enhance Lua? Some interesting ones, like complex
numbers and a larger math library are available as external Lua libraries
at . I think there is even
a patch to make lua_Numbers complex.

Good to know! thanks!

What other libraries could be written? What C99 *language* features could
enhance Lua?

As I said, I'm not an expert of C. I read some articles about the new features of C99 and was curious whether effectively there *could* be some advantages, in the long run, by converting the codebase to C99.

For example, since I read that C99 supports types with a precise bit width (int64_t? or the like), I thought it was something that could (?) ease some of the problems related to integer wrapping we discussed recently (or not? As I said it is a very speculative thread).

It is also a way (for me) to understand better the "C ecosystem" in which Lua more or less appears to live in. As I said to Steve Donovan off list, since I "was exposed" to Lua, I've been struck by how C programs can be made "higher level" and somewhat even fun, and I revamped a bit my very old (and basic) C knowledge.

The C90 vs C99 thing is also a way to improve my knowledge on C applied to Lua, and to better understand the design decisions behind Lua's implementation. Sort of "hey C99 is a decade old, why didn't it make its way into Lua codebase? What's wrong with it? Does it suck? Doesn't it give real advantages to Lua? It would be good, but it is not widespread enough and will restrict Lua's audience too much?" and many other questions like these that come to my mind when scratching my head thinking of the implementation of Lua :-)

-- Lorenzo