lua-users home
lua-l archive

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


Roberto wrote:

> Yes. Maybe we will give up 16 bit instructions. (Or, to avoid longs, maybe
> an instruction can be used as a record with two ints, instead of a long).

I may be misunderstanding you, but why do you mix talk of word sizes and C
types like this?  Not using 16-bit instructions doesn't imply using longs,
it means using 32-bit or some other word size.  What C type that word size
maps to is platform dependent and best made a build option.

To be clear, I'm not trying to avoid longs, just 64-bit data types.  A long
is what happens to map to a 64-bit word on my platform.

I'm not suggesting Lua use C99 features or anything, but you may want to
take a peek at the C99 stdint.h and inttypes.h headers.  For example there
is a type int_fast32_t that means "the fastest integer type that has at
least 32 bits".  There are also macros that define print and scan format
strings for each type.

-John