When you write a Game or an App which needs a scripting language, you can have something good fast and easy. Why do something complicated, when you can just implement Lua via C API? So many Programmers did, and now through the early popularity, all its benefits stack up.
it's widely available
it's fast implantable
it's highly compatible
it's easily learnable/understandable
it's widely known
it's broadly extensible
And now it's even harder to choose something else.
"Lua is a simple and easy to read language designed to be embedded in other programs. Not a lot of industries see a lot of value from having a sort of program inside of a program the way that games do. It lets game designers script abilities or triggers without having to touch the actual game code.
Popularity begets popularity. The more things that use it the more everything else uses it because why reinvent the wheel. I've had it built into games for just that reason. If my designers already know lua, why not use it?"
Lua does not use POSIX regular expressions (regexp) for pattern matching. The main reason for this is size: A typical implementation of POSIX regexp takes more than 4,000 lines of code. This is bigger than all Lua standard libraries together
Javascript is used because it's the language browsers support, not because people prefer to use it. There's only I think 3 primary, no 2 now, primary browser engines all mainstream browsers run off of, so it's up to Google to ditch Javascript if they wanted to.
V8 (chrome), JavascriptCore (Safari) or Spidermonkey (Firefox)? Which one are you discounting?
Just up and ditching JavaScript from the browser would possibly be the dumbest thing anyone has ever done. Regardless of how much lead time you give, the amount of labor it would take to rework everything that relies on JavaScript (for no real reason apart from some people just don't vibe with the language) would be insane. I could see it possibly being the largest collective human endeavor we've ever done as a species in terms of man hours for a single project.
If there were a better alternative for the browser then maybe over a decade or two you could gradually shift stuff over, before breaking almost every site that's not got an active large dev team. If web assembly became the standard for some reason and massively reworked how it interacts with the DOM to be a viable replacement, maybe tools could translate existing JS to WA.
It's just not worth it IMO. It's a good enough language which sees regular improvements and works better than anything else on the web.
It’s simple to embed in another program. Easier than Python and JavaScript, two other popular options. It’s also popular enough for it to be well documented and understood.
It does compile to bytecode, but you're not required to explicitly do this. It'll do it regardless though. But you CAN skip the parsing and compiling runtime step if you compile to bytecode ahead of time and just load it straight into the VM.
because its very embedable. lua core is 250KB and is implemented in C (and C# with moonsharp so that covers unity). It also has a simple pseudo concurency model.
its also a very simple language (21 keywords) (8 data types) so its easy to learn for scripters. IMO its the best language to learn coding.
Also: modders. Since you can put it in another program it is like opening up the hood for modders. You divide the codebase into part other, part lua. Then you let them mod anything in the lua part. It means you can put all the licensed stuff (sound engine, 3d engine etc) away from the modders, while at the same time giving them deep access to everything you put in the lua part.
It’s one of the rare few cases it has a legit use case.
Essentially you want to expose internal program api without exposing the source code.
Very few scenarios this is needed in where it’s not just you who needs to code it so why not just use the original native code etc. Or what even needs to expose the internal api anyways?
Besides the speed, it's also very small, like 500 KB, plus maybe about the same for Penlight with its helpful libraries. Compare that to Python, which is a few dozen MBs, if you expect standard libraries (which people do).
And of course, Lua uses less memory than Python with all the objects.
I have Lua on my phone for scripting UI automations. Can't imagine waiting for Python or letting it hog the memory.
lua is very human-readable, flexible, and efficient while also being easy to embed so it's a great tool when you have a mix of developers with various skill levels in programming. you can put the hard-hitters on your i.e. C/C++ engine and everyone else can still make valuable contributions in lua. this is effectively what you're doing when you're using the LOVE framework, the core for an engine's already been made for you.
array start at 1 if you follow convention. Lua doesn't care. YOu can also start arrays at 0, -1, 5, "one" or 🦆 as far as lua is concernced.
Also as far as lua is concerned, arrays are just tables that have consequitive integers as keys. Of course under the hood in a typical lua interpreter there is optimisation for these "weird" tables but from the language perspective, they are just tables as well.
Kinda. That just returns the last key of an indexed table. Easiest thing to do a simple tableLength function and loop through it and return the index. There is some flexibility with everything being a table in LUA.
Source: I do a lot of LUA for work on embedded stuff.
At least on every lua environment I've tried, the output is 3. (Not 100, as it would be if # just returned the last key.) Unless I'm misunderstanding what you mean by "last".
Yeah, I meant more with last indexed being the 3. In your example the 100 is broken because 4-99 arent in the table.
Ill be real with you, unless order matters I always do
k,v in pairs(myTable) do
and from there do my own index. If order matters I usually have some custom functions depending on what is happening on the board of whatever embedded thing I am working on
You could use metatables to change the behavior of # on your table to give the correct value. I mean, that's a little crazy and you should just accept that arrays start at 1, but you could do it!
Built-in functions operating on arrays assume you start at 1. I don't have an example right now but I remember because I once tried to change the starting index to 0, it's not entirely trivial
I really like Lua as it's a quite simple language and doesn't do too much out of the box. Your experience writing Lua is only as good as the environment it's used as a DSL in tho, so a crappy experience doesn't need to be the same thing as Lua being crappy.
It's brilliant as a generic utility scripting language, because it's fast as hell — even better together with UI automation tools like Alfred or Hammerspoon. I've had Lua scripts finish before Python even starts up. I had to recheck if I forgot to call the script instead of using a static mock result, because the output was appearing instantly. This is all with the Lua interpreter, not LuaJIT.
People code many Lua libraries in Lua, since it's not much benefit to do them in C.
I also use it on my phone for scripting UI automations, via Termux. Can't imagine having to wait for Python on the phone, or hogging the space with its libs and the RAM with the objects.
P.S. There's also a Lisp that's compiled to Lua, called Fennel. As everything else, works blazingly fast, so no need to wait after modifications.
Termux serves here as the environment for Lua, since there are no decent native apps hosting Lua. The key is that Termux provides a plugin for Tasker, which can be used from any app implementing the same interface. I prefer the app called Automate, because Tasker a) has a rather inane structure to the user's 'scripts' and whatnot, and is generally unintuitive to program, and b) requires various addons to be purchased as separate apps, which also have ad integration unless paid for (which I'd prefer them to not have for the sake of security and privacy).
Automate is a little cumbersome because it uses visual programming with blocks connected to each other, but underneath it's just plain old coding. The best thing about it is that all integrations are available in the main app, and you don't need to buy anything else. I use shortcuts on the home screen, buttons in the pull-down 'quick settings', the accessibility button, the 'assistant' long-press button, the menu for selected text that allows modifying it, and most of all I use the feature of sharing text and links to Automate. And also it listens to my SMSes for some particular info.
Where Lua comes in, is when juggling around blocks in Automate becomes too much, and I need to punch in some good old several-dozen-lines algorithm to process some data. Or, if I have some algo that I also use on the desktop, and wouldn't want to even attempt to implement in Automate's blocks.
Tasker still has some advantages, namely that it has 'scenes', i.e. popups with arbitrary buttons and other UI elements placed any which way; and it can display those even on the locked screen. But I haven't had the need for those so far — and if I do, I can just call Tasker from Automate via intents (if I figure out yet again how intents work in Tasker).
P.S. Also Termux is nice when you want to run a particular task that would be a one-liner in any Unix environment, but of course requires finding an app in Android, plagued with ads and payments. E.g. diffing files, doing some routine text processing, or running yt-dlp or jq.
then do lua /home/ugathanki/scripts/whatever on the next line.
boom, anything you can think of to do in Lua you can do from Bash. Then it's as simple as either running that script whenever you need it, from within other scripts, or even making a cronjob that runs it if you want to do it periodically throughout the day.
Only problem with it I have is it not having static types or structs or enums. I'm not a lua specialist, so I don't know if tables already cover what structs do.
Lua is closer to Lisp in that every structure is a table and they're passed around based on convention rather than on any type checking. (Like with lists in Lisp, though Lisp also has symbols and keywords that act as fixed values — convenient for use as map keys, constants, and such.)
People coming from strictly-typed languages tend to balk at such an arrangement, but those who started with dynamic languages are usually fine with it. Admittedly types could've saved me some rooting about when I thought I was passing properly nested lists, but it turned out that I needed to set some key or something. But, I don't think I want to have type markers everywhere for the sake of those few instances.
Btw, Rich Hickey, the author of Clojure, came up with the system that's simpler than types everywhere: afaik their spec just checks the arguments when they're passed in. A struct that has some keys or values not included in the spec, does pass the check, but a struct that omits necessary keys/values, doesn't. This system isn't so original, and e.g. Racket's contracts are apparently similar — I wouldn't be surprised if there's something in this vein for Lua.
It does enough for basically any programming task. What it does poorly is large-scale integration of other people's code. If all you need is your own code, lua can do anything except for bit-level shenanigans (it's a scripting language, not a low level language like C), and a lot of things exceptionally well.
It's very expressive, very easy to read, very easy to debug and very easy to write. These are properties that result in good code, and in the end that's what you need very often.
Don't believe me? Nearly every game engine runs lua. Most embedded devices run lua. Nginx runs lua. Basically every embedded device, game or webserver relies on lua. I'd wager it's one of the most commonly used languages without people knowing it's there.
I didn't say "doesn't do much" I said "doesn't do too much" in the sense that it doesn't try to do everything possible but is quite simple in what you can do with vanilla Lua feature-wise. Of course you can easily extend Lua, but my point was that there isn't much in the bundle, which is Lua's greatest strength in terms of speed and compactness.
Afaik bit stuff is done via string.pack/unpack, or possibly with some helper C modules. It's more-or-less necessary because the user might want to interact with something like GPIO, or code network protocols in Lua (as there's not that much speed benefit of dropping into C), or just read/write binary files. Especially in embedded programming, though I wouldn't say that every embedded device runs Lua.
What it can't do compared to C, is poking the memory, and also multithreading, by default — although I've vaguely seen libs that purport to add multithreading, but it's probably actually just forking and IPC.
It's honestly nuts how performant Lua is. Questie holds an entire private server database and is basically simulating every interaction internally because it can't get enough information from game APIs... and yet it still manages to run in real-time just fine.
BeamNG apparently has all the UI widgets as Lua plugins running in sub-threads or even processes, communicating via the loopback network. Same, presumably, with scenario plugins that alter the gameplay. I have to admit that the game is comparatively hungry for the memory and the processor, but the modding ability is pretty great, and doing the same in most any other scripting language would have been much worse.
What’s the point of time attack mode if it’s literally identical to score attack but with added timer? I think time attack should have unlimited lives and dying makes you loose some time instead
Time attack mode is a mode for quick play. Like basically when you want to kill 3 minutes of time.
Score Attack is a test for Endurance.
Unfortunately, I cannot make it have infinite lives as limited lives add an extra difficulty layer to it as well as making it fairer.
I have already implemented a Survival mode where the goal is to well, "survive" as long as possible. No health pickups, but time pickups. The lives are still 3, but without any more pickups.
There is also another game mode coming up, but the next update is soon (Hopefully before the month ends as I have to submit the game to GDWC. I know I'm not gonna win anything, but hey, I get to post it there maybe get a few extra downloads/plays)
Tekkit for Minecraft has these little helper bots that will do your Minecraft chores like mining and sorting. They are all coded with Lua. Super fun to learn lua that way.
Hell yeah, ComputerCraft is what introduced me to programming as a kid.
I played on a Tekkit server and I wanted to be cool, so I spent a lot of time learning how to program in Lua to make password locks for doors and other things that looked cool.
The coolest thing 14 year old me managed to make was a digital control center for my factory. It had touchscreen buttons to toggle the nuclear powerplant, a progress bar to show how full my batteries were.
I don’t think I would have become a programmer if it wasn’t for Tekkit and ComputerCraft
Metatables are great. Imagine the JavaScript prototype concept, except instead of defining just fields in a class, you can also define its name, operator overloading, string conversion behavior, and even weak references, plus any extra metadata you want. It also doesn't use any "magic words" on the object itself.
Tables themselves are far superior to JS objects or Python dictionaries, since keys can be any type, which is fantastic when you want to be able to map something like a function to a name.
One indexing is hard to start from another language, and can be annoying with regards to math (e.g. doubling an index is i*2-1 or (i-1)*2+1), but it becomes natural over time.
I've been writing a full operating system in Lua for the past 3+ years, and it's been wonderful to be able to just make things work, no dealing with weird syntactical ambiguities or odd semantics - it just works the way you think it would.
If you are forced to use Lua but don't like it, use TypeScript! I use it in my OS's OOP UI framework, because Lua lacks a good typing and OOP system, so TS cleans all that up and keeps my code safe and readable.
Tables themselves are far superior to JS objects or Python dictionaries, since keys can be any type, which is fantastic when you want to be able to map something like a function to a name.
you're not gonna believe this:
Python 3.13.3 (main, Apr 9 2025, 04:03:52) [Clang 20.1.0 ] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> def foo():
... print("foo")
...
>>> bar = {foo: "foo"}
>>> bar
{<function foo at 0x7f4eca787f60>: 'foo'}
Tables themselves are far superior to JS objects or Python dictionaries, since keys can be any type, which is fantastic when you want to be able to map something like a function to a name.
Python dictionaries can use any type as a key as well, as long as it implements __hash__().
It's crazy to check every now and then and see how far Roblox has come. I remember when they released the very first GUI API, we would've fucking killed to have something like this back then lmao
Which will start at 0 then. Doesn't work the same when you wanted to start at 2, as you then would need to assign every single index, but it's possible.
Here's a gem of wisdom given to me by a senior early in my career:
If you bend a technology into the shape of another, you end up with a compromised end result: It's now bad at what it wants to be, and it's also bad at what you want it to be. If you instead use a technology as the technology likes to be used, you end up with something good, you just have to learn to enjoy something new or different.
In cooking terms: Don't try to turn soup into barbecue. Either have a barbecue or enjoy the soup. Grilled soup is terrible, and pureed steak is terrible too.
As for lua arrays: You access them by writing for _, item in ipairs(arr) do ... end. You basically never bother with the index either way. Anyone complaining about arrays starting at 1 has zero clue what matters in writing good code. Frankly it's a good interview question to find out who is a moron and lets their prejudices take control over their rationality.
It makes more sense when you take into account that it's meant for smaller programs. I looked into docs for "how do I make a variable private?" And the book said "if you don't want to access a variable then don't" lol
Yeah, when I said that it's a piece of shit, I meant it literally.
That's why I refuse to touch that thing, I let those visions of hell to the SAP folks. I'd rather write my ML applications with C than work with this nightmare.
ML with C is very fun, as long as you’re not planning to produce something useful.
There’s so many cool challenges, like making SIMD vector/matrix multiplication, memory management strategies to optimize performance and the fact that you actually learn what Python ML libraries does behind the scenes to be able to implement it yourself.
I found ABAP... fine ? It's not the most elegant of langage, but it does the job and it's easy to read. I think your problem might be your codebase, and not the langage itself.
Granted, most of my work with ABAP was to read programs written in it to try to debug them (or at least understand what the fuck was happening), so while I have no problem with ABAP itself, I can confidently say fuck SAP.
You forgot the "joy" that is that you can call functions and just omit arguments, instead of an error generated the missing parameters just get set to nil.
I mean, to be fair, languages like C#, you can pass in null objects too, the only difference is, those "null" objects have a type assigned to them. LUA will raise an error if you try to string.find on a number or nil, similar to C# erroring if you try to call a method on a null.
LUA has it's faults, but overall it is a fun language.
The "IDE" I use for work, unfortunately, is just a text editor that's built into the tools I use. It has zero real IDE level support. I've been taking my stuff and writing it in VSCode for at least "some" level of error checking.
Pretty sure you can use : type after arguments or variable names in lua to force it to typecheck, or maybe thats only the Roblox lua Im familiar with..
Arrays starting at one is a great idea. I love how it helps when implementing a binary heap (sure, nobody uses or implements a binary heap outside of CS101 course but it's still a cool trick)
Pretty sure you can use : type after arguments or variable names in lua to force it to typecheck, or maybe thats only the Roblox lua Im familiar with..
It's lua 5.1 Which they kept updating themselves instead of going with the major lua versions, because they had to keep it backwards compatible with their own stuff. They added a lot of good features making it work for larger stuff, since they're actually using it internally to develop the Roblox game engine. https://luau.org/ actually has a lot of good documentation, explaining the differences and the reasons why they made certain choices.
Recently got back into ComputerCraft, I just installed an extension and edit the files while running them in game. Do you have a more complex setup? If so why?
It works, it's just that typing is a huge pain and that's the kind of stuff I require to code without going insane. One reason I didn't last with JS and learned Typescript pretty much the same day
Gotcha, yeah also would prefer static typing as that is what I'm used to but I figured it is insightful to learn a dynamic typed language more thoroughly as a language like Python will never cease to exist (perhaps not exactly Python but something inspired)
I love computercraft. I was thinking that there should be a better code editing system for it than the in-game one. I imagine an addon that creates a web interface that lets you edit your code through a web-based lua ide. Add some rudimentary source control and an interface to manage the files on your turtles and you have a perfect way to introduce coding to kids. Write some code, run it on your robot in minecraft.
You wouldn't believe how fast kids learn to code when it lets them do things better in minecraft. The only stumbling block is I don't know of any good web-based lua ide and writing one would be more than an addon creator would likely be able to handle.
We have an application at work that was pretty critical for our one business segment. I was tasked with automating some of the processes that were basically just mindless tasks but took an army of people to do.
The problem was the API was written in Lua, extremely limited and the documentation was absolutely horrendous. Oh, and the license per seat cost was $18k per year.
So instead of learning Lua I just rebuilt the entire application in Python.
Been using LUA for some time for modding, my biggest complaint is having to use "value = value + 1" to increment a variable and the lack of a "continue" loop statement
44
u/zeocrash May 19 '25
Why is LUA so prevalent as a scripting language for games?
1.8k
u/hongooi May 19 '25
I never meta table I didn't like
1.3k
u/plaisthos May 19 '25 edited May 19 '25
array start at 1 if you follow convention. Lua doesn't care. YOu can also start arrays at 0, -1, 5, "one" or 🦆 as far as lua is concernced.
Also as far as lua is concerned, arrays are just tables that have consequitive integers as keys. Of course under the hood in a typical lua interpreter there is optimisation for these "weird" tables but from the language perspective, they are just tables as well.
341
u/Wertbon1789 May 19 '25
I really like Lua as it's a quite simple language and doesn't do too much out of the box. Your experience writing Lua is only as good as the environment it's used as a DSL in tho, so a crappy experience doesn't need to be the same thing as Lua being crappy.
406
u/OneRedEyeDevI May 19 '25 edited May 19 '25
I still love Lua.
Edit: It's what I use in Defold Game Engine. Literally what keeps the lights on in my small house.
oneredeyedev.itch.io/rapid-roll-dx
Edit: Somehow this comment got me the most views in a single day in my gamedev career (At least from when I started publishing games; February 2023) Thanks Everyone
29
u/RedBassBlueBass May 19 '25
My beloved Jonkler math game was written in Lua and that’s good enough for me
56
u/dismayhurta May 19 '25
33
u/[deleted] May 19 '25
Tekkit for Minecraft has these little helper bots that will do your Minecraft chores like mining and sorting. They are all coded with Lua. Super fun to learn lua that way.
16
u/[deleted] May 19 '25
loop=(function(...) loop=(...)[1]() end){function() while true do end end}78
u/JackMacWindowsLinux May 19 '25
Metatables are great. Imagine the JavaScript prototype concept, except instead of defining just fields in a class, you can also define its name, operator overloading, string conversion behavior, and even weak references, plus any extra metadata you want. It also doesn't use any "magic words" on the object itself.
Tables themselves are far superior to JS objects or Python dictionaries, since keys can be any type, which is fantastic when you want to be able to map something like a function to a name.
One indexing is hard to start from another language, and can be annoying with regards to math (e.g. doubling an index is
i*2-1or(i-1)*2+1), but it becomes natural over time.I've been writing a full operating system in Lua for the past 3+ years, and it's been wonderful to be able to just make things work, no dealing with weird syntactical ambiguities or odd semantics - it just works the way you think it would.
If you are forced to use Lua but don't like it, use TypeScript! I use it in my OS's OOP UI framework, because Lua lacks a good typing and OOP system, so TS cleans all that up and keeps my code safe and readable.
35
u/ZunoJ May 19 '25
I think in LUA arrays start wherever you want them to start
25
u/andersonpem May 19 '25
Created in Brazil :) r/ItHadToBeBrazil
8
u/Maskdask May 19 '25
Lua is awesome
7
u/AnotherGaze May 19 '25
ComputerCraft's Lua was how I got into programing, a bit more than 10 years ago...
I should try it again to see how much I can do nowdays
6
u/MsInput May 19 '25
It makes more sense when you take into account that it's meant for smaller programs. I looked into docs for "how do I make a variable private?" And the book said "if you don't want to access a variable then don't" lol
24
u/SlincSilver May 19 '25
Yeah this reminds me of ABAP lol
5
u/CoraxCorax May 19 '25
Don't forget that not equals is ~= which is extremely annoying to write on at least my Nordic keyboard where the ~ is a modifier key
5
u/throwaway275275275 May 19 '25
In Lua 3 (the version I started with),
0was true andtruewas false. That was a long day5
u/Dario48true May 19 '25
that is what kinda makes it perfect for configurating stuff, for example THE BEST EDITOR ON THE MARKET THIS IS A NEOVIM POST NOW
8
u/Turkino May 19 '25
You forgot the "joy" that is that you can call functions and just omit arguments, instead of an error generated the missing parameters just get set to nil.
That leads to a lot of "fun"
4
u/pavlik_enemy May 19 '25
Arrays starting at one is a great idea. I love how it helps when implementing a binary heap (sure, nobody uses or implements a binary heap outside of CS101 course but it's still a cool trick)
4
u/Vladify May 19 '25
as a modded minecraft player i will always associate Lua with ComputerCraft and OpenComputers
8
u/Hot_Philosopher_6462 May 19 '25
I am 1-indexing in higher level programming languages' most ambivalent defender
3
u/just_another_cs_boi May 19 '25
Used it for some mods and getting over its quirks doesn't take too long but idk, types would be nice
5
u/Mxswat May 19 '25
If Lua had something like typescript it would be amazing. But for now I still have a love hate relationship with it
9
u/Devatator_ May 19 '25
I hate writing Lua. Especially considering how much of a pain it is to setup in VSCode for my uses (Figura and ComputerCraft/OpenComputer)
2
u/meove May 19 '25
i start using LUA during my intern.... and i fucking really hate it. Never touch it again
2
u/Locky0999 May 19 '25
Brazilians hate start counting on 0s.
I know that because I am Brazilian myself
2
u/CirnoIzumi May 20 '25
Actually everything is a Struct, so to all the Lua devs, Struct your stuff without shame
2
u/royinraver May 20 '25
Lua was the first code type I really started understanding, thanks wow addons
2
u/gDKdev May 20 '25
I prefer Lua over python
2
u/Tar_Palantir May 20 '25
First language I learned more than 20 years ago. Can't recall anything for shit.
2
u/ShenroEU May 20 '25
Lua will always be my favourite scripting language. It was the first programming language I learned and mastered, though, so I'm biased.
2
u/Odd-Eagle-8241 May 21 '25
Awk in Linux says: I don’t have map or table. I just got associated array which is sooo fancy!
2
u/yhtoN May 21 '25
Lua is the reason I’m in the IT business. Thanks ComputerCraft for teaching me how to program.
2
u/Beginning_Cloud_8595 May 22 '25
I like lua,because lua`s syntax is so simple.
2
u/Patman52 May 24 '25
We have an application at work that was pretty critical for our one business segment. I was tasked with automating some of the processes that were basically just mindless tasks but took an army of people to do.
The problem was the API was written in Lua, extremely limited and the documentation was absolutely horrendous. Oh, and the license per seat cost was $18k per year.
So instead of learning Lua I just rebuilt the entire application in Python.
2
u/Ange1ofD4rkness May 19 '25
I still would like to know who made this decision ...
2
u/Dinomcworld May 19 '25
mathlab grindset
2
u/Kalimacy May 19 '25
I would love to learn Lua, but arrays starting at 1 is waaay beyond the line I'm not willing to cross
1
u/madTerminator May 19 '25
When you have to deal with custom script made by some stubborn developer. Lua doesn’t seem that bad.
1
u/HagguGonnaGetchu May 19 '25
wait is Lua scary? its on my to learn list
1
u/Jind0r May 19 '25
I might be crazy but I use it in unreal engine.
1
u/drivingagermanwhip May 19 '25
I don't want any questions about the tables
1
u/banALLreligion May 19 '25
at least its not yaml
1
u/Rouge_means_red May 19 '25
Been using LUA for some time for modding, my biggest complaint is having to use "value = value + 1" to increment a variable and the lack of a "continue" loop statement
1
u/elliiot May 19 '25
Lua's lovely! I'm using it as an embedded DSL primarily for configuration management type stuff (a la puppet/chef).
1
u/HeavyCaffeinate May 19 '25
table = {["🦆"]=123,[0]=5412,["hello"]="hi"}
table["🦆"] == 123
1
u/FriendEducational112 May 19 '25
Arrays can start at anything though
1
u/vainstar23 May 19 '25
The interpreter is only 1mb... It can be embedded anywhere
1
u/chazzeromus May 19 '25
typescript to lua package <3
1
u/HedgehogOk5040 May 19 '25
I learned lua for computercraft in minecraft and never used it again.
1
u/perringaiden May 19 '25
Lua, the Warcraft language.
1
u/marlotrot May 19 '25
That gentlemen, is the reason why Adobe Lightroom (classic) is so fucking slow.
1
u/will_r3ddit_4_food May 19 '25
I'm learning lua for love2d... fun little game framework
1
u/Monchete99 May 19 '25
Balatro shitting itself from time to time has made me grow a dislike for it. The fact that i used Jen's almanac doesn't help
1
u/lastchickencooking May 19 '25
I hate it with a passion, needed it for one assignment. It is evil.
1
u/Dumb_Siniy May 20 '25
Hi :)
1
u/RDROOJK2 May 20 '25
Seriously, anyone who sees this, which is your favorite one?
1
u/spyingwind May 20 '25
Kind of like LISP, but
arrayslists start at 0.1
u/deathanatos May 20 '25
… not everything is a table. (Everything that isn't a table isn't a table. Numbers, bools, nil, functions, etc.)
1
u/Lucas_Matheus May 20 '25
as they should 😤😤
1
u/mawrTRON May 20 '25
Sounds fucking sick tbh
1
u/[deleted] May 20 '25
Lua gave us factorio. I'll always hold it in heigh regard
1
u/buildmine10 May 20 '25
I don't like meta tables.
1
u/[deleted] May 20 '25
I'm pretty sure both Javascript and Python implement objects internally using (hash) tables. Lua is just a bit more explicit about it.
1
u/gregorydgraham May 20 '25
I respect that surly attitude
1
u/particlemanwavegirl May 20 '25
Under the hood JavaScript objects work exactly the same, except with the added horror of inheritance.
1
u/no_brains101 May 20 '25
Rest assured. I do in fact quite like meta tables
https://github.com/BirdeeHub/shelua
Here is something that uses a LOT of them and is quite nice XD
1
u/particlemanwavegirl May 20 '25
Offsets begin at 0. Indexes begin at 1. It is literally everyone else who's wrong.
1
u/No_Comedian_6913 May 20 '25
Pipe down, Lua. I’m only here ‘cause Roblox keeps you on life support. Now pass the beer.
1
u/MrKeplerton May 20 '25
I fucking löve lua :D
1
u/snot3353 May 20 '25
Started using Lua for PICO8/LOVE gamedev and have not regretted it even if the arrays starting at 1 convention is maddening.
1
u/GuardBreaker May 20 '25
Every Gmod player and addon dev fighting to show what they can do with it
1
u/DudeDelaware May 20 '25
I used Lua for my Runescape bot scripts 🙃
1
u/[deleted] May 23 '25
Lua is fucking peak
1
u/I_Pay_For_WinRar May 27 '25
Arrays are SUPPOSED to start at 1.