hslua icon indicating copy to clipboard operation
hslua copied to clipboard

Lua 5.1 / LuaJIT support

Open sol opened this issue 1 year ago • 8 comments

Apparently Lua 5.1 and LuaJIT were supported at some point, and apparently there used to be a luajit flag.

CI only seems to test Lua 5.4 and the luajit flag seems to be gone by now. I did not see any corresponding change log entries (at least nothing that is grep-able). Is LuaJIT still supported?

sol avatar Jun 19 '24 03:06 sol

The relevant line in the changelog (for version 1.0.0):

Removed Features

  • Support for Lua versions before 5.3 has been dropped.

I had made that decision because it proved to be too cumbersome to work around all the differences.

tarleb avatar Jun 19 '24 06:06 tarleb

@tarleb thanks for your reply, that's interesting.

I'm puzzled how I would use Lua (via hslua) as an extension language and have the guarantee that extensions that I write today will still work in, say, 10 years.

Neovim guarantees that by effectively freezing the Lua version [to 5.1], but from what I understand, that's not really an option with hslua (that is, right now hslua includes 5.4, before it included 5.3, and I assume at some point in the future, it will include 5.5).

sol avatar Jun 19 '24 10:06 sol

I'm not sure what to answer, as that's a very general software maintenance issue. In this specific case it's probably more of a question about the evolution of Lua than about this library.

FWIW: I still accept patches to the hslua-0.x branch, and am willing to release new 0.x version.

tarleb avatar Jun 19 '24 11:06 tarleb

Just to add a small case-study: all pandoc Lua filters written 7 years ago still work, and most custom Lua writers written 14 years ago continue to work either without changes or with minimal changes.

Changes in the host program are a bigger issue than changes in Lua. At least in my experience.

tarleb avatar Jun 19 '24 12:06 tarleb

The idea of somehow supporting luajit is very tempting. I'll keep it in mind for when I have some time.

tarleb avatar Jun 21 '24 13:06 tarleb

The idea of somehow supporting luajit is very tempting.

I definitely agree.

Lua 5.1 / LuaJIT offers a very tempting value proposition. You get a stable language + JIT compilation on supported platforms.

I guess that's the reason why it's so popular.

What are the downsides? True, you miss out on the latest Lua features, but do you really need them? Or is stability and JIT more useful?

sol avatar Jun 25 '24 01:06 sol

Also, as a side note, it kind of alienates me that a simple scripting language like Lua still "evolves" in breaking ways. I would rather have something, where the language is basically frozen.

Improvements to the interpreter/GC or the standard library are of course welcome improvements. But breaking changes to a language that is so simple, I just don't see how to justify this. I imagine that's possibly one reason why the LuaJIT author is unwilling to follow mainline.

sol avatar Jun 25 '24 01:06 sol

Apparently Luau is also mostly a superset of Lua 5.1.

sol avatar Jul 06 '24 01:07 sol