What Lua version to learn

I recently decided to pick up some again Lua while learning back-end development. I wanted to know what Lua version is recommended to study.

I understand that Luau is based off Lua 5.1, but they also support 5.2 up to 5.4.

3 Likes

Luau. It’s the version which Roblox uses.

1 Like

To learn Lua, it’s recommended to study Lua 5.1. Luau, which is a popular version of Lua, is based on Lua 5.1, and it supports versions 5.2 to 5.4 as well.

1 Like

Unfortunately, both of you restated exactly what I already said…

I understand that Luau is based off Lua 5.1, but they also support 5.2 up to 5.4.

I guess in the long run it doesn’t really matter whether I choose 5.1 or 5.4 but I would still like opinions of those who utilize the features of the updated versions.

2 Likes

The problem is that you don’t get to pick which version of Lua you get to use. It is almost exclusively a scripting language and you will be forced to use whatever version the game or software has implemented. Among those, 5.1 is one of the most popular and I’d probably pick it for that reason.

Luau Is Basically a sub language (or originated from) Lua
Roblox initially began with Lua 5.1 but was modified over the Years which is what became Luau

You Should learn a version of any kind (preferably more recent ones between 5.1 - 5.4), and view updates and new implementations of Newer Versions, generally function Updates or Syntax Updates.

You should Also view the Roblox Version with their revisions as they are also trying to make the recent revisions compatible with Luau.

4 Likes

I think there is a misunderstanding of what Luau is. Luau isn’t some update of Lua, it’s a dialect of Lua, so it’s very close to Lua but has features which Lua doesn’t, namely typechecking. Typechecking is not present in either Lua 5.1 or 5.4. When I say you should just learn Luau, I mean this Luau.

3 Likes

5.1 but take a look at the official luau website as well.

1 Like

It kind of does. Since Luau is based off Lua 5.1, most features are going to be from there.

Only a few features were backported from newer versions.

What I recommend is, learn 5.1, then Luau from https://luau-lang.org

2 Likes

Doesn’t matter. Once you’ve learned 5.1, just spend 20 minutes reading the “change log” for versions 5.2 through 5.4 and congrats now you know all the versions. They’re not that different, and a lot of the changes are only relevant if you’re doing interop with C (which you might TBH).

If you’ll be writing code where performance matters then you’ll probably be targeting LuaJIT which AFAICT only works for up to 5.1 (Status).

4 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.