šŸ‘©ā€šŸ’» chrismanbrown.gitlab.io

Lua is probably rated correctly actually

Not over and not under but just right

2024-12-27

Contents

  1. Introduction
  2. There Are Two Luas
  3. Lua Is Overrated Maybe
  4. Lua Is Underrated Maybe
  5. Learning Lua
  6. Not Lua
  7. Conclusion

Introduction

This post is inspired by and in response to Lua is so underrated by nflatrea1 because I don’t think the original post went into quite enough detail about why Lua is great. (Which it surely is!)

There Are Two Luas

When people talk about Lua they usually talk about two different things:

  1. Lua the embedded scripting runtime, and

  2. Lua the language: its syntax and semantics.

Lua Is Overrated Maybe

Lua has such a large share of the embedded scripting runtime market, it is possible to consider it overrated in this area. Not that I do. But it is possible.

Caveat: I don’t really do much ā€œsystems programming.ā€ So I haven’t tried embedding a scripting language into a compiled language before. But my understanding from 1) effusive blog posts I’ve seen over the years, and 2) it’s ubiquity, is that Lua is one of the most popular embedded scripting languages in the entire multiverse. In fact, if you add scripting support to your program, the onus is probably on you to defend NOT using Lua.

Off the top of my head, here are a few of my favorite programs and projects that use Lua for scripting:

Honorable mention: Roblox. I have never played roblox but it famously uses Lua for scripting and annecdotally I have heard of many a programmer who cut their teeth with Lua-on-roblox. Oh yeah, also World of Warcraft too.

More: https://en.wikipedia.org/wiki/List_of_applications_using_Lua

Lua Is Underrated Maybe

Lua is a great little language. I like its syntax and design.

Here are some language features that deserve attention.

The Good

The Bad

The Ugly

These are things that are neither good nor bad, but are just kinda weird about Lua.

Honorable Mention

Learning Lua

Want to learn Lua? That’s great! Here’s what I recommend:

Not Lua

Need Lua but want the regularity and simplicity of a lisp syntax? Try fennel! https://fennel-lang.org/ I love fennel in its own right and am likely to use it anytime Lua is called for.

Need Lua but want types? Teal is a typed dialect of Lua! https://github.com/teal-language/tl/blob/master/docs/tutorial.md

Need Lua but wish it was TypeScript? Try TypeScript To Lua! https://typescripttolua.github.io/

Need Lua but wish it was a little bit more like Python? Try Moonscript! https://moonscript.org/

More: https://github.com/hengestone/lua-languages

Conclusion

Lua is neat!

I don’t think it is overrated at all. But nor do I think it is really underrated either. It’s just, rated. And that’s okay!


  1. original: https://nflatrea.bearblog.dev/Lua-is-so-underrated/
    comments: https://lobste.rs/s/jf4in1/Lua_is_so_underratedā†©ļøŽ

  2. https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ā†©ļøŽ

  3. https://github.com/rxi/lume/
    https://github.com/luafun/luafun
    https://lunarmodules.github.io/Penlight/ā†©ļøŽ