luajit2 icon indicating copy to clipboard operation
luajit2 copied to clipboard

Move openresty-specific language extensions under a special configuration?

Open siddhesh opened this issue 5 years ago • 7 comments

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 avatar Jul 02 '19 15:07 siddhesh

@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 avatar Jul 02 '19 17:07 agentzh

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

agentzh avatar Jul 02 '19 17:07 agentzh

Pull requests welcome!

agentzh avatar Jul 02 '19 17:07 agentzh

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

XVilka avatar Jan 15 '20 09:01 XVilka

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.

siddhesh avatar Jan 15 '20 09:01 siddhesh

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

agentzh avatar Jan 16 '20 02:01 agentzh

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

agentzh avatar Jan 16 '20 05:01 agentzh