5 ms·
Lua is tied with C as my favourite languages. I personally DO use Lua sometimes to code general purpose stuff. Still, I don't see Lua ever having "batteries",
by speeder 6y ago
Lua is tied with C as my favourite languages.
I personally DO use Lua sometimes to code general purpose stuff.
Still, I don't see Lua ever having "batteries", the language wasn't invented for that purpose, and the original sponsor of the language wouldn't want it changing in that direction (I dunno if they still sponsor it though).
Lua was invented by PUC-Rio (Catholic University, Rio de Janeiro campus) at the request of PETROBRAS, its purpose was "describe" stuff, and replace another language that they already had, plus being turing complete, because they got tired of hacking things endlessy whenever they needed to describe something "new" in their systems.
So to "describe" stuff, Lua doesn't need libraries.
That said... currently Lua most popular use is add some kind of scripting environment to other software, still that often means a library would be useless, and even then sometimes that usage is still to describe things, for example the game "Crusader Kings 2", use Lua to read a file named "defines.lua", and all it does is set some constants, another use of Lua that I find interesting is "xmake", Lua programs in it are very descriptive, using Lua syntax features to "tell" things to the system, instead of looking like anything resembling a normal imperative program.
EDIT: about community size... yeah, it is tiny :( I never found a Lua job, companies that use Lua often hire a programmer of other languages and teach him Lua, I am also currently using PUC-Rio official GUI library (iup) and never found anyone else using it to ask questions about it, I've been in PUC-Rio during a tech event, and when I asked around if anyone knew where Lua authors were, the people that study and work there, didn't knew they had anything to do with Lua in first place!!!
- nerpderp82 6y agoHave I got a treat for you! http://terralang.org/ http://terralang.org/ https://github.com/pallene-lang/pallene https://github.com/pallene-lang/pallene
- karlmcguire 6y agoThanks for the pallene link! Terra was fun to play with but I've always wanted a simple compiled Lua.
- himujjal 6y agoNice info there. I recently started using xmake and for someone who is spoilt by npm, cargo and nimble i was really impressed by xmake. I finally dont have to write Makefiles. Lua is a very good choice for config files. Wezterm uses lua for configs. Lite editor uses lua only plugins and configs. And many more. Maybe someone/group of people can step up and declare an universal config format using lua for everyone. As for batteries, I would love to have that but wouldnt that again defeat the whole purpose of Lua as embeddable? But of course people would love to have it.
- centimeter 6y agoCheck out https://dhall-lang.org https://dhall-lang.org . It's kind of like a new approach to Lua, but strongly typed and turing-incomplete.
- Buttons840 6y agoCan it be used outside of the Haskell ecosystem?
- centimeter 6y agoYeah, there are interpreters for many languages and the output can be written to json (assuming it contains no functions).
- gugagore 6y ago> So to "describe" stuff, Lua doesn't need libraries. Maybe you can clarify what "describe" means. It reminds me of the subtle-possibly-false dichotomy between a program and a configuration. Turing-completeness could be one way to think about that dichotomy it, but in this case Lua is definitely Turing complete. In any case, if there's commonality to the stuff being described, then that's the kind of thing that is "batteries". Sequences, associative arrays, etc. come up all the time, and that's available. Surely there are some things that come up a bit less often when describing systems, though I don't have a concrete example on hand. My main question is, since any program is a description of a computation, then what kind of distinction are you making?
- hisham_hm 6y ago> I personally DO use Lua sometimes to code general purpose stuff. Speaking of general purpose application programming, you might be interested in my new(ish) project Teal: https://github.com/teal-language/tl https://github.com/teal-language/tl It's a statically typed dialect of Lua, which is compatible with all modern Lua versions. The core compiler itself is one tl.lua file which can be added to any Lua project, and includes a Lua package loader that makes Lua's `require()` support .tl files, and there's also a tl CLI for generating .lua from .tl files.