hlua icon indicating copy to clipboard operation
hlua copied to clipboard

[Enhancement] Support for Lua 5.3

Open mystise opened this issue 10 years ago • 4 comments

Integers and bitwise operators are useful for stuff I want to use Lua for.

Not sure how feasible this is, but I thought I'd throw it out there.

mystise avatar Mar 03 '15 01:03 mystise

Additionally, 5.1 support for LuaJIT would be neato.

JustAPerson avatar Mar 03 '15 05:03 JustAPerson

Both of these would be really cool. Imagine if all it took to move from lua versions was a cargo feature!

TyOverby avatar Mar 03 '15 07:03 TyOverby

Cargo features are only designed to add optional features, they are different from flags that change the library.

For example:

  • Library A depends on hlua
  • Library B depends on hlua
  • Program depends on both libraries A and B

When you compile the program, if library B requires a Cargo feature in hlua, the same Cargo feature will also be active when compiling library A. This is obviously bad if you use that for lua versions, as it could result in bugs in library A.

tomaka avatar Mar 03 '15 08:03 tomaka

I thought a bit about this.

Cargo features can be appropriate, since Lua 5.3 is backward compatible with Lua 5.1.

By default hlua would link to luajit, but if you activate a Cargo feature it links to Lua 5.3 instead. This would make the library slower, but the essential thing is that it would continue to work.

Regular flags would still be more appropriate for this, but using a Cargo feature can be used for the moment.

tomaka avatar Jul 13 '15 16:07 tomaka