openresty / luajit2

OpenResty's Branch of LuaJIT 2
https://luajit.org/luajit.html
Other
1.23k stars 199 forks source link

Move openresty-specific language extensions under a special configuration? #63

Open siddhesh opened 5 years ago

siddhesh commented 5 years ago

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.

agentzh commented 5 years ago

@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.

agentzh commented 5 years ago

We may also need to adapt the openresty/luajit2-test-suite repo to support both modes similar to the existing LUA52 mode.

agentzh commented 5 years ago

Pull requests welcome!

XVilka commented 4 years ago

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

siddhesh commented 4 years ago

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.

agentzh commented 4 years ago

Yes, we can go with the OPENRESTY_EXT macro (shorter) :)

agentzh commented 4 years ago

Ah it seems like I proposed an even better name: LJ_OR_EXT :)