LuaJIT borrowed from 5.2 and 5.3 (PUC-Rio's Lua) what it could without breaking compatibility, as I understand it. LuaJIT 3.0 adds some feature of its own.
All the Lua 5.x versions that I have seen have small compatibility issues, and that's why many projects stick with what it's compatible with 5.1 only.
C++ doesn't have any "native json support" either, and that's fine. I don't think JSON is that critical. You can use a library for the kind of serialization that you want. Neovim uses JSON and Lua extensively, and it just uses a C library inside.
It's true that `{}` doubles down as an empty array or an empty map. It is not a problem that often, IME. You also can't signal that a certain key in a map is `nil`, but you can use a sentinel for it. You can do the same to disambiguate between these two.
Different features hit differently to different people. I agree that global by default seems so wrong, but I just go used to it, and I don't care anymore. To me, the main deal is not that Lua doesn't have this features by default, is more that, when I want them, there is no generally agreed library/framework that can plug all the features in a unified, coherent way. Penlight should be that, but I don't like it that much.
This is something that personally hits me the most, because I'm used to Qt. With Qt, I have tons and tons of functionality and a well established community and practices.
Pluto is a fork of Lua 5.5 which is “Lua with a bunch of standard libraries” and other features like more mainstream classes. Yes, Pluto does have built-in JSON support.
> All the Lua 5.x versions that I have seen have small compatibility issues, and that's why many projects stick with what it's compatible with 5.1 only.
But you see how "why isn't Lua more popular" is answered with that? Do I start with 5.5? 5.3 and below seems is EoL already per the official site, they only have 5.4 bug fixes. It's a bit like C++ I guess, use only a small subset of features perhaps?
> C++ doesn't have any "native json support" either, and that's fine.
Unlike C++ Lua posits itself as an easy data representation and configuration language but it doesn't have a built-in way to load one of the most popular serialization formats out there these day.
> Different features hit differently to different people.
Definitely, I am just explaining why it doesn't appeal to me and the reason I heard other people didn't start or continue using it.
Oh, I definitely agree that the issues of version compatibility are a problem for wider adoption. I have written a few small Lua projects, and I always struggle to decide which versions to support.
If it had a few changes and perhaps some optional additions (while keeping a "classic" or "standalone" version), it would probably be more popular.
> Unlike C++ Lua posits itself as an easy data representation and configuration language but it doesn't have a built-in way to load one of the most popular serialization formats out there these day.
But that's the thing: if you want to represent data or configure something, wouldn't you prefer to do it in Lua? Seems the history of the language was using Lua syntax for the data representation, which is a bit more convenient than JSON for a few schemas. JSON is useful for interoperability, but it's far from my favorite for making a configuration file. The next project I'm working on is a small Lua script that will let the user configure itself via Lua, because that's more convenient than a static config format.
All the Lua 5.x versions that I have seen have small compatibility issues, and that's why many projects stick with what it's compatible with 5.1 only.
C++ doesn't have any "native json support" either, and that's fine. I don't think JSON is that critical. You can use a library for the kind of serialization that you want. Neovim uses JSON and Lua extensively, and it just uses a C library inside.
It's true that `{}` doubles down as an empty array or an empty map. It is not a problem that often, IME. You also can't signal that a certain key in a map is `nil`, but you can use a sentinel for it. You can do the same to disambiguate between these two.
Different features hit differently to different people. I agree that global by default seems so wrong, but I just go used to it, and I don't care anymore. To me, the main deal is not that Lua doesn't have this features by default, is more that, when I want them, there is no generally agreed library/framework that can plug all the features in a unified, coherent way. Penlight should be that, but I don't like it that much.
This is something that personally hits me the most, because I'm used to Qt. With Qt, I have tons and tons of functionality and a well established community and practices.
Replies (2)
https://pluto-lang.org
But you see how "why isn't Lua more popular" is answered with that? Do I start with 5.5? 5.3 and below seems is EoL already per the official site, they only have 5.4 bug fixes. It's a bit like C++ I guess, use only a small subset of features perhaps?
> C++ doesn't have any "native json support" either, and that's fine.
Unlike C++ Lua posits itself as an easy data representation and configuration language but it doesn't have a built-in way to load one of the most popular serialization formats out there these day.
> Different features hit differently to different people.
Definitely, I am just explaining why it doesn't appeal to me and the reason I heard other people didn't start or continue using it.
Replies (1)
If it had a few changes and perhaps some optional additions (while keeping a "classic" or "standalone" version), it would probably be more popular.
> Unlike C++ Lua posits itself as an easy data representation and configuration language but it doesn't have a built-in way to load one of the most popular serialization formats out there these day.
But that's the thing: if you want to represent data or configure something, wouldn't you prefer to do it in Lua? Seems the history of the language was using Lua syntax for the data representation, which is a bit more convenient than JSON for a few schemas. JSON is useful for interoperability, but it's far from my favorite for making a configuration file. The next project I'm working on is a small Lua script that will let the user configure itself via Lua, because that's more convenient than a static config format.