luajit2
luajit2 copied to clipboard
Move openresty-specific language extensions under a special configuration?
I was thinking of ways to incorporate the openresty-specific language extensions such as thread.exdata and the various table.* functions and it seems to me that the best way would be to put it under a conditional build flag (-DOPENRESTY_EXTENSIONS or similar). This would be set by default in luajit2 and disabled by default in my fork.
Does that sound like a reasonable approach? If yes then I'll first post patches to put the bits under conditional macros and then incorporate these features into my fork.
@siddhesh I'm fine with that though I think LJ_OR_EXT
is a better name (shorter and more informative). And yes, LJ_OR_EXT
should be enabled by default in this repo.
We may also need to adapt the openresty/luajit2-test-suite repo to support both modes similar to the existing LUA52 mode.
Pull requests welcome!
Just an update - was done by @siddhesh in MoonJIT 2.2.0 - see "OpenResty Extensions" section in the release notes https://github.com/moonjit/moonjit/releases/tag/2.2.0
Yeah those are only a subset of the extensions that I thought were safe enough (i.e. won't collide with the namespace of future lua features) to incorporate without the flag. There are many more that need to go in under the special configuration. I just haven't found time to do that.
Yes, we can go with the OPENRESTY_EXT
macro (shorter) :)
Ah it seems like I proposed an even better name: LJ_OR_EXT
:)