Discussion:
Luajit 1.0.8 question
Dibyendu Majumdar
2014-08-19 21:20:10 UTC
Permalink
Hi,

I was looking at Luajit 1.0.8 out of curiosity and realised that it is
closer to standard Lua in its implementation - i.e. uses the same bytecode
as standard Lua. The question I have is - would it be easy to merge Lua 5.2
with 1.0.8? I can try doing this simply for fun (and to gain better
understanding of DynASM - I am not very familiar with assembly programming)
- but wanted to check here whether this is not possible or very hard to do,
or indeed if someone else has already attempted.

Regards

Dibyendu
Javier Guerra Giraldez
2014-08-19 21:46:30 UTC
Permalink
On Tue, Aug 19, 2014 at 4:20 PM, Dibyendu Majumdar
The question I have is - would it be easy to merge Lua 5.2 with 1.0.8?
what would that merge mean?

Lua + (LuaJIT things) = Lua+(LuaJIT-Lua) = LuaJIT
--
Javier
Coda Highland
2014-08-19 21:51:45 UTC
Permalink
On Tue, Aug 19, 2014 at 2:46 PM, Javier Guerra Giraldez
Post by Javier Guerra Giraldez
On Tue, Aug 19, 2014 at 4:20 PM, Dibyendu Majumdar
The question I have is - would it be easy to merge Lua 5.2 with 1.0.8?
what would that merge mean?
Lua + (LuaJIT things) = Lua+(LuaJIT-Lua) = LuaJIT
It'd mean a version of Lua that's fast but not as fast as LuaJIT 2 but
with the features of Lua 5.2.

/s/ Adam
Javier Guerra Giraldez
2014-08-19 21:58:42 UTC
Permalink
Post by Coda Highland
It'd mean a version of Lua that's fast but not as fast as LuaJIT 2 but
with the features of Lua 5.2.
ah, of course. i wasn't thinking about the 5.1-5.2 differences.
--
Javier
Dibyendu Majumdar
2014-08-19 23:14:24 UTC
Permalink
To me it means a version of Luajit that I can hope to understand, and
maintain if needed - Luajit 2.0 is significantly more complex and certainly
beyond my ability to fully understand.
Of course upgrading to 5.2 is not essential for this.

Anyway I did a diff between 1.0.8 and 5.2 - there are quite a lot of
differences. So merging may not be trivial.

A related question is can the latest DynASM version be used with 1.0.8.

Regards
Post by Coda Highland
On Tue, Aug 19, 2014 at 2:46 PM, Javier Guerra Giraldez
Post by Javier Guerra Giraldez
On Tue, Aug 19, 2014 at 4:20 PM, Dibyendu Majumdar
The question I have is - would it be easy to merge Lua 5.2 with 1.0.8?
what would that merge mean?
Lua + (LuaJIT things) = Lua+(LuaJIT-Lua) = LuaJIT
It'd mean a version of Lua that's fast but not as fast as LuaJIT 2 but
with the features of Lua 5.2.
/s/ Adam
Karel Tuma
2014-08-20 19:46:45 UTC
Permalink
Hi,
Post by Dibyendu Majumdar
To me it means a version of Luajit that I can hope to understand, and
Also rather inferior one, compared to current tracing JIT.

LJ1 is very naive (but simple) method at a time, only ~1.5x
faster than Lua. But it might be a good starting point to try and make it
better. Mike simply scrapped the project and wrote tracing JIT from
scratch, but exploring method at a time might be still worthy endeavor assuming
you implement some advanced features (on stack replacement, guard hoisting
via runtime type annotations, perhaps even hidden classes...).
Post by Dibyendu Majumdar
maintain if needed - Luajit 2.0 is significantly more complex and certainly
beyond my ability to fully understand.
Give 2.x a try. The codebase is vast, but not ugly.
Post by Dibyendu Majumdar
Of course upgrading to 5.2 is not essential for this.
There are some patches around, and one fork implementing full LJ 5.2.
Post by Dibyendu Majumdar
Anyway I did a diff between 1.0.8 and 5.2 - there are quite a lot of
differences. So merging may not be trivial.
A related question is can the latest DynASM version be used with 1.0.8.
What you outlined above amounts to far more than mere code refactoring
and resolving merge conflicts.
Post by Dibyendu Majumdar
Regards
-- k

Dibyendu Majumdar
2014-08-20 08:21:15 UTC
Permalink
A diff between Luajit 1.0.8 and Lua 5.1.5 is more informative. I guess a
better approach would be to reimplement the Jit functionality for 5.2.

Sent from my Windows Phone
------------------------------
From: Dibyendu Majumdar <mobile-1p2sgsrg2aWtmTQ+***@public.gmane.org>
Sent: ‎20/‎08/‎2014 00:14
To: luajit-***@public.gmane.org
Subject: Re: Luajit 1.0.8 question

To me it means a version of Luajit that I can hope to understand, and
maintain if needed - Luajit 2.0 is significantly more complex and certainly
beyond my ability to fully understand.
Of course upgrading to 5.2 is not essential for this.

Anyway I did a diff between 1.0.8 and 5.2 - there are quite a lot of
differences. So merging may not be trivial.

A related question is can the latest DynASM version be used with 1.0.8.

Regards
Post by Coda Highland
On Tue, Aug 19, 2014 at 2:46 PM, Javier Guerra Giraldez
Post by Javier Guerra Giraldez
On Tue, Aug 19, 2014 at 4:20 PM, Dibyendu Majumdar
The question I have is - would it be easy to merge Lua 5.2 with 1.0.8?
what would that merge mean?
Lua + (LuaJIT things) = Lua+(LuaJIT-Lua) = LuaJIT
It'd mean a version of Lua that's fast but not as fast as LuaJIT 2 but
with the features of Lua 5.2.
/s/ Adam
Vadim A. Misbakh-Soloviov
2014-08-20 11:51:57 UTC
Permalink
Post by Dibyendu Majumdar
A diff between Luajit 1.0.8 and Lua 5.1.5 is more informative. I guess a
better approach would be to reimplement the Jit functionality for 5.2.
Don't you want to try LuaJIT- 2.1?

There was 5.2-compat layer, afaik.
--
Best regards,
mva
Dibyendu Majumdar
2014-08-20 13:11:10 UTC
Permalink
Hi, I already use 2.1. I am looking at 1.0.8 as it appears to have a
simpler design that I can more easily understand.

Sent from my Windows Phone From: Vadim A. Misbakh-Soloviov
Sent: ‎20/‎08/‎2014 12:54
To: luajit-***@public.gmane.org
Subject: Re: Luajit 1.0.8 question
Post by Dibyendu Majumdar
A diff between Luajit 1.0.8 and Lua 5.1.5 is more informative. I guess a
better approach would be to reimplement the Jit functionality for 5.2.
Don't you want to try LuaJIT- 2.1?

There was 5.2-compat layer, afaik.
--
Best regards,
mva
Karel Tuma
2014-08-20 13:27:29 UTC
Permalink
Post by Vadim A. Misbakh-Soloviov
Post by Dibyendu Majumdar
A diff between Luajit 1.0.8 and Lua 5.1.5 is more informative. I guess a
better approach would be to reimplement the Jit functionality for 5.2.
Have to agree. Porting 5.2 was *very* informative about LuaJIT internals,
at least for me. The guts are usually documented well in-line, but sometimes
there are dark corners (complex with no documentation).
Post by Vadim A. Misbakh-Soloviov
There was 5.2-compat layer, afaik.
Only very shallow one.
Loading...