-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LuaJIT Compiler - Getting wrong bytecode when JIT is off. #146
Comments
The generated bytecode from LuaJIT is not compatible with Lua. From https://luajit.org/extensions.html#string_dump |
we usually use |
Hey guys, as he said, LuaJIT bytecode isn't compatible with Lua and won't compile for Lua. But I'm disabling LuaJIT so it's suppose to use Lua, right? Could you tell me more about PUC Lua Library? Thanks. |
There are two totally different Lua implementations. LuaJIT and PUC Lua (can be found here https://www.lua.org/versions.html). These are two libraries both implementing Lua and the Lua C API but use different internals. This means that when disabling the JIT in LuaJIT one still uses LuaJIT but with the JIT disabled. Disabling the JIT will not switch to a different library (PUC Lua). To use PUC Lua one would need to link against this different library instead of LuaJIT. |
Hey guys, I would like to know how I can compile to bytecode via C, but I don't want to with JIT. I have tried several ways to disable JIT, but it still seems to be always on.
I have this snippet code to work with Lua C.
And the bytecode result I get is:

And if I do with the command luac, I get this:

Maybe this is related to JIT, or not? Please correct me if I am wrong, I want to understand what I am doing wrong to get those results.
The text was updated successfully, but these errors were encountered: