← Back to context

Comment by bogwog

1 year ago

I am in the "Lua sucks" camp. I also found it weird how clunky it is to embed, but my biggest gripe is with the language itself. It just sucks, as its barely a programming language at all. Every Lua project ends up reinventing its own class system or other language feature to get anything done.

I've also never seen a clean (non trivial) Lua codebase before. They're all spaghetti messes and difficult to follow. On the contrary, some of the worst, least maintainable and difficult to read code I've seen has been in Lua.

For configuration (what it was originally designed for) or for very small, non-critical stuff, then it can be a good choice.

With that said, I know some people are very productive with it, and have made impressive things in Lua. It's just not for me.

> It just sucks, as it's barely a programming language at all.

I remember when I thought like this when I was first learning C++ and thought it was awesome because of all the features built into the language. Since then, I've learned that things that are "barely a programming language at all" like Lua—where you can easily learn the whole language and then write, if necessary, reflective object-oriented effortlessly parametrically polymorphic code—are actually the best languages of all. (Such extreme liberalism does require a compensating amount of discipline, as you say.)

Lua has its flaws (implicit nils, the nil/# interaction, default global, 1-based indexing, etc.) but minimalism is one of its major virtues.

  • Then you get hold of a language that doesn’t have all this mess as a foundation and it feels like you stopped self-suffocating.

    you can easily learn the whole language and then write, if necessary, reflective object-oriented effortlessly parametrically polymorphic code

    This is all you can do in these languages. Anything above it will share the fragility and ad-hocness of this meaningless language para-olympics.

    • Nope, that's completely wrong, to the point that you cannot have possibly thought it was correct. You can avoid using reflection, object orientation, and parametric polymorphism in Lua, just as you can in almost any other language, and stick to simple imperative code. And most of the time you should.

      4 replies →

I enjoyed writing a small module for the Prosody XMPP server, which is written in Lua. Everytime I had to look into the internals I found what I was looking for pretty easily.