[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Follow-on from does Lua need a JIT - making Lua's interpreter faster
- From: Dibyendu Majumdar <mobile@...>
- Date: Thu, 23 Feb 2017 13:26:46 +0000
On 23 February 2017 at 12:59, Sergey Rozhenko <email@example.com> wrote:
> What I also love about LuaJIT is that it's the golden standard of Lua in
> terms of language design. Lua 5.3 has suffered a huge degradation in that
> area due to its combined int64/double type.
I would have to disagree with you here. LuaJIT is a Lua 5.1/5.2 clone
so perhaps you mean that you prefer Lua 5.2 or 5.1 to 5.3 as Lua
rather than LuaJIT is the standard.
I think 5.3 is a better language (although I dislike incompatibilities
between the language versions as I think it is important to maintain
backward compatibility in language design). The integer subtype is
very useful; it enables 64-bit integers which otherwise would not be
possible in Lua, and also allows more efficient operations (in Ravi)
for various integer and bitwise operations. In JIT mode the generated
code can be close to C when type annotations are used.
I agree that for some operations there is a potential performance
impact - e.g. when adding numbers now extra type checks are needed.
This impacts the generated code in Ravi as well - although using type
annotations removes the type checks and the extra branching.
I also realise that the 64-bit integer support prevents use of the NaN
trick in representing values, and this has a performance impact due to
inability to use 8-byte values.
But still on the whole it is better that there is an integer sub-type
in my view.