lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
> I do not see how this proposal is simpler than the current
> one.

Let me clarify- by "simple" I ment (compared to any proposal that
would integrate int64s more tightly with Lua-numbers):
 - only minimal grammar/parser changes needed
 - tersest coercion-ruleset possible (afaict)
 - minimal implementation effort (e.g. the bit* functions for the
int64 type would be optional and could be added later)

> Moreover, it does not address the other part of the current proposal:
> to make Lua better for small platforms with no hardware support for
> doubles.

That's right.
I never intended to discredit exploration of ways to seamlessly
integrate ints/bitwise operators/int64s- but I believe those to be
much more drastic and long-term changes than the proposition I made;
some approaches might even turn out to be complete dead ends.

What I wanted was merely to point out an easy-to-implement alternative
that could quickly satisfy some repeatedly stated needs: a *standard*
(64bit) integer representation + arithmetic + literals.

> In Lua, we usually accept small incompatibilites to keep the language small
I appreciate this- the attitude of throwing cluttter out and
completely overhauling features when beneficial (_ENV) makes me like
the language so much :)

Related: I think that LuaJIT's ffi-types (read: the data types, not
the ffi-extension per se) are a valuable addition to the core
language, because they grant standardized access to low-level
primitives: sometimes, a byte array is simply more suitable than a
Lua-string (or one *needs* an uint64, not just a "number"). C also
gave way after denying that explicit choice of underlying type in the
beginning (and we got <stdint.h>). Having (standardized) access to
such types from the Lua core language would be very nice in some
situations, but I don't really see that happening (for various good
reasons: e.g. *most* of those underlying types are of very limited use
in Lua when not interfacing with C code that needs them). /rant

PS: I hope my original post did not come across as "just do things the
LuaJIT way and every problem goes away". I sincerely apologize if
that's how it was received.

--Wolfgang