katlogic / ljx Goto Github PK
View Code? Open in Web Editor NEWLuaJIT with native 5.2 and 5.3 support
License: Other
LuaJIT with native 5.2 and 5.3 support
License: Other
LuaJIT experimental 5.2/5.3 port -------------------------------- * i386/x64 only (other archs adhoc, ported per demand) * Some C API calls may be still missing, the frequently used ones are all there The code is not yet suitable for "long running" production. The changes made are substantial, there *will be* bugs - and not much testing has been done yet. Still, lot of smaller single-shot scripts written for 5.2/5.3 work as expected, and a bug in the interpreter can be usually easily spotted.
local function bug()
local var=9
local a=setmetatable({},{
__index=function(t,i)
return setmetatable({},{
__len=function() return var end
})
end
})
print(var, #a.a)
end
bug()
What's expected is 9, 9
But instead you get out 9, table: 0xADDRESS
The table itself appears to be _ENV
Is it planned?
I understand that fully supporting 64-bit integers in LJX is probably a major undertaking, but I guess a lot of people would like to have integers and bitwise operators in a JIT compiler for Lua.
Sometimes experiencing weird oddities such as this:
in 5.1, 5.2, 5.3, luajit: local i=1 while i do print(i) break end -> 1
in ljx: local i=1 while i do print(i) break end -> nil
But it works fine in any other kind of block like for loops, repeat until, do-end, etc.
Why do while loops specifically seem to break?
The original LJ project has LuaJIT VM + Lua 5.1 parser. Just add a Lua 5.2 parser to it and a Lua 5.2 environment which can be used with require"5.2"
. Then add command line flags: -5.1
, -5.2
, etc. The Lua 5.2 environment would have a load
function that can compile Lua 5.2 source code into LuaJIT bytecode, for example.
LuaJIT also supports 64-bit integer literals thru "xxxLL", so you can just use that.
All you really need is to add on to the stdlib.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.