00:00 🚀 Lua ranks second in the fastest-growing programming languages for open source projects, closely following Rust. 1:49 📋 Lua is an efficient, lightweight, and dynamically typed scripting language with 22 keywords and 8 basic types. 2:49 🔄 Lua is dynamically typed, with variables not having types; only values do. Local variables are preferred for performance and scoping reasons. 3:48 ⚖ Lua's control flow includes if-then-else, while loops, and repeat-until loops, with numeric or generic for statements for table iteration. 4:18 🗃 Lua's table is the sole data structuring mechanism, versatile for records, dictionaries, arrays, and more. 5:04 🧠 Lua's automatic memory management, with a garbage collector, simplifies memory handling, while metatables enhance table flexibility. 6:04 📚 Lua's standard library, implemented in C, includes coroutine support for non-preemptive multitasking. 6:39 🚀 Lua's efficiency is attributed to its C implementation, making it portable and easily embeddable in C-based applications. 7:24 🌐 Lua's ecosystem is supported by a module system and the LuaRocks package manager, with various libraries, frameworks, and community involvement.
I used Lua already 20 years ago in an embedded realtime machine contol system. All known requirements for funcionality were hardcoded in C but lua allowed us to implement and try new functionality quickly. Once the requirements were known the lua code was ported to c code. I also added a terminal to add and execute lua code while the machine was running. This saved us soo much debug time. The combo LUA and C (Later C++) is absolutely fantastic! Great to see it is becoming so populair.
Even though recent popluarity is due to neovim, it is a really popular lang, from pandoc and mpv, vlc to even adobe photoshop interface is written in lua....
I would like to correct you slightly, it's so simple, that presuming you have no programming experience (like me), you can learn the basics in a couple of hours. it really is incredibly simple, I use it almost daily now
Not only that. I would say because it's that simple it's one of the few languages where you ( I ) can claim to "know" the language as a whole. Most languages have some rarely used obscure syntax or features you may have never heard of since you never used it. Just reading through the lua specs is really fun. The meta functions alone offer so much potential. Multi-value support for return types and assignments haven't been mentioned. But lua allows things like a,b = b,a which would swap the content of a and b. A multi value return can also be simply wrapped in a new table t = {someMethod()} Coroutines are even more awesome compared to other languages which may also have some sort of coroutines. First of all you can yield even in nested methods which would still suspend the next upper coroutine. You could think of it like an exception handller, though it actually preserves the callstack and resumes at the yield call. The yield call is much more than just an execution yielding operation. You can actually pass arbitrary data (multi value) to the yield method. Those parameters are actually returned to the caller who called coroutine.resume on your coroutine. Likewise the yield call will return values which are passed to the resume method by the caller. So it's allows two way communication between the caller and the coroutine. Implementations like in the Minecraft mod Computercraft use this mechanic to implement messages. So every program you run in CC is actually a coroutine and the game passes events that way. So the yield instruction is essentially the message pump. You can actually pass a string to the yield function and the game would interpret that as a message filter. So this coroutine would not be resumed unless the specified message comes along. That's how things like sleep is implemented. This mechanic allows incredible flexibility as you can even implement your own scheduler inside lua to further distribute events. The game actually ships is a very simple "parallel" api which allows you to simply have several coroutines run in "parallel". I'm mainly a C# programmer, but lua has been my favourite scripting language for years. MoonSharp is a pure .NET implementation of lua. Since the Unity game engine can build your project to WebGL / javascript I successfully have lua support in a game running inside a browser, which is awesome ^^. Of course inside the browser we don't really have threading support and having a scripting language that can dead-lock / busy-spin is not good. Though the interpreter already has a built-in way to issue a special yield every x instructions, so even an infinite loop is not really an issue and with some extra work this mechanic can be used as a load balancer and dead-lock detector. Another great thing abour lua is because it's that simple and doesn't really have custom data types, code can easily be re-used even if some library is missing as long as you can provide the necessary methods. I often use lua to explain to others how OOP and classes in other languages actually work under the hood. In most compiled languages (C,C++,C#,....) all methods are technically static methods. So code never "lives" in an object instance but only the class. The trick is that when you do obj.SomeMethod(123, "abc") the compiler actually calls the static method and passes the object as first argument. So the call above becomes SomeClass.SomeMethod(obj, 123, "abc") Of course dynamic dispatch (virtual methods / polymorphism) adds another layer of indirection, but the code is still static. Lua has a neat extra operator that helps with implementing the concept of OOP. Instead of using a dot, you can use a colon to call a method. This does exactly what I just described. So when doing someTable:method(42) it actually does someTable.method(someTable, 42) since you can simply "map" methods into a table via meta tables, you can call a method that doesn't exist in the table itself but is defined in the "class" of that object and when using the colon operator, you can implicitly pass the object itself to the method, so the method can mutate / use the object. I started programming "almost" 30 years ago with pascal. That's why I don't mind the "if then" and "end" syntax. At least lua doesn't require a "begin" :) I could talk for hours about lua, but I just realised that I'm just writing a comment on YT and I should probably stop now ^^
I love lua. The fact that it is a tiny language, is the very reason it is so nice: It makes code very easy to follow, since there isn't a myriad different ways to implement things.
How is that easy to follow? A programme can just call a function out of the aether of global variables, but the call gives you absolutely no idea where it's actually defined. That strikes me as being impossible to follow.
@@Malidictus It is easy to follow since the language is tiny. There isn't a myriad different ways to implement things. That means that if you are looking at code from another programmer, it is easier to understand usually. For any larger scripting language code-base you need to be more strict with code Also only use Globals rarely in very specific cases. than if you have a typed language. Of course you will sometimes do a spelling mistake, and call something void. But those bugs are almost always trivial to find and fix...
Eu tive o prazer de estudar com uma das professoras que estavam no projeto da linguagem lua quando ela foi criada Sinto muito orgulho dela ser uma linguagem Brasileira!
in case anyone doesn´t have the function to translate "I had the pleasure of studying with one of the professors that were in the Lua Language Project when it was created. I am very proud of it being a brazilian language.
Simplicity, small (130 KB), uses a virtual machine, few instructions, easily linked to C libraries, easy to embed in any other language, Engine or other type of software
This is why I use at my company. I’ve written code to call LUA from Java, Swift, and of course C++ to embed it into our mobile apps. Also made it so Java, Swift and C++ can call LUA. It’s just so easy to embed because you can compile it with any C compiler and gluing it to any other language is just a matter of writing some C code.
@@Chara556Lua is only designed to be used as a embedding language (to be used on top of C, C++, etc). Therefore, it’s fast, minimal but also limited and lacks a lot of stuffs.
This video is great. I've been programming in Lua for years and years now, and I've grown to really like the Lua language. I think a very important thing to mention when talking about Lua is LuaJIT. LuaJIT is fully compatible with Lua 5.1 and is so fast that it can regularly out-perform my hand-written C code with some trivial Lua code(Lua code is usually shorter and more readable as well). It's not only fast during the runtime running the JITed code, but also when interpreting non-JITed code thanks to it's hand-optimized interpreter and data structures. And it's startup time and binary size(~500K on my machine) is also tiny compared to other scripting languages. Not to mention the FFI, which not only allows you to call C functions from Lua, but also exposes the C data types for your convenience. The FFI data types are integrated into LuaJITs optimization passes, and so using the FFI can actually speed up regular Lua code as well, by enabling C-style arrays, pointers, manual memory management, structs, etc. to be used directly from Lua when needed, at the cost of memory safety(can't be avoided when working with C APIs).
Apparently it's a little known fact, but you can compile vanilla Vim with support for Lua and I do every time I update the one I have installed. As an extra tidbit, you could also build it with support for Perl, Python, Ruby, TCL and a few other languages I can't remember.
This gives me nostalgia. It was the first programming lanugage I learned and completed a tutorial of when I was like 12 or 13. I tired to write a mod for Minetest at the time and it actually kinda worked. Sadly I don't have the files anymore.
I still play minecraft to this very day (with some down time in between) and I almost always play with mods and ComputerCraft / CCTweaked is almost always included :) Currently I'm back at SkyFactory3 which unfortunately doesn't have CC but instead OpenComputers. It also uses lua but is a bit more bulky. Those 95% of the code could be reused anyways :D I actually host all my lua code on my raspberry pi and I load them from the webserver it runs.
I discovered LUA with Tabletop Simulator. Is a "game" that let's you spawn custom models and textures so you can prototype boardgames. The thing is that instead of prototyping your own games you can "rip" popular games and... it has LUA integrated to make scripts, like could be set the game for different players or to keep score. It's really neat, and as you said, is small enough you can embed it in other apps. I really liked working with it. Array 1 is based.
@@awesome-coding It might have a snowball effect. If you want your game to be scriptable you may look into other games that did that or you got directly inspired by a game you played. I wonder who set the trend in that. In any case, seems like LUA has some attributes that makes it prone to help in that. LUA is good. Most likely not the most performant or "complete" language, but you don't always need that. That's also why JS and Python are so popular.
I learned Lua recently and absolutely loved it. Learning curve is minimal, fast compilation, very easy python like syntax, what not to love about it. You can even make games using the tiny Löve framework. Overall experience was very good.
"very easy python like syntax" Very easy... what?? I can see why Python syntax seems easy at first - everything is very low entry barrier. But having to constantly stress about whitespaces will eventually take a toll on your soul. I'll take the "end" keyword any day of the week.
@@hctiBelttiL Stress about whitespace? It is something you need to pay attention to, yes... but no more than brackets in other languages. And unless you are exceedingly sloppy in your coding, the whitespace will take care of itself anyway. In either case it's more of a boon rather than a drawback. Very peculiar. 🤔
@@herrpez the brackets are set before and after a block, anything you do in between is fair game. With whitespace you can easily lose track of scope if you fatfinger the wrong key, cat climbs on your keyboard, etc. Also, assume that you want to move or paste a block of code inside a different scope, you then have to adjust the indentation instead of simply pressing the hotkey for the format code option in your IDE. Refactoring - made hard, courtesy of whitespace. Also, maybe you have a huge expression that you want to divide between multiple lines, or a hardcoded string, Python has you jumping through hoops just to do a simple thing like that, and it's ugly to boot. Let me put it another way - In other languages code blocks are defined, and remain defined until that definition is acted upon. In Python code blocks define themselves, and that's a recipe for mistakes.
@@herrpez the problem with using whitespace in the way python does is that it is virtually invisible, but absolutely crucial to running the code. if the amount of indents is not exactly the same between two lines of code, python will not like it. this basically forces you to use tabs or to have your code writing software to auto indent a specific number of spaces for you, and for that software to have some kind of visualization to easily tell how many spaces you have.
@@Templarfreak Any half decent editor will automatically indent things correctly for you. It's honestly a struggle to screw up the code in the first place. And when you do, either the interpreter tells you, or the LSP (should you have one) does long before it even becomes an issue. As for using tabs... there's nothing wrong with it, but it is unusual. Nevertheless- no good editor, that I know, of lacks a setting to turn a tab press into any given number of spaces.
I see a lot of potential in Lua and I love its simplicity...just a data structure? Wow it's so cool. There is also an implementation of the Lua language with a just-in-time compiler, called LuaJIT, which is stupidly fast, sometimes as fast as C 🤯
Having coroutines like Ruby technically makes it better suited for a backend web server than Python or Javascript ever were, but much like Ruby it got shoehorned into a specific niche. Most likely because Lua's standard library is not batteries included
I never tried Lua outside of scripting for nginx, so I don't feel the same love for it as others in the comments. However, I don't ever recall our Lua scripts being the cause of any performance issues, even with 50K requests/s and some complex scripts. Considering it was designed to be an embedded language it is certainly fit for purpose when it comes to nginx.
Lua has god tier concurrency primitives thanks to coroutines (async await like perf without colored functions) and openresty makes full use of it by binding lua coroutines to nginx events. It's just a shame that the standard library isn't more batteries included.
while Lua's standard library is quite small, it's quite easy to implement a lot of different libraries, and there is a huuuuuge amount of libraries available. it is very easy for tables to represent virtually any other kind of data object, so it's extremely easy to implement a variety of data structures a well, ranging from priorities queues to binary trees to linked lists. there are libraries available to parse json or xml files into tables in a way that still feels very intuitive and natural (or at least definitely for json). local scoping can also be done in a file as well, and because of that, closures, and metatables, you not only can _completely_ follow oop principles with private methods and fields or static private methods and fields, but you have multiple different ways you can do it with different advantages and disadvantages if your concern is speed, memory, or readability / maintainability. in Lua 5.3 and up, you also have explicit integers, ie with no decimal, which has some advantages that Lua's numbers did not have before (namely accuracy), and in 5.4 you have the const keyword.
About Lua arrays starting with 1. Seems obvious, since it's based on tables and for common users, so I guess common users having experience with spreadsheets like Lotus, Excel and Quattro Pro. "Lua's choice for 1-based indexing is not arbitrary, though. It was influenced by its design goals of simplicity and its roots in the Petrobras company in Brazil, where Lua was developed. The choice aligns with human counting conventions (starting from 1) and some mathematical and engineering applications where 1-based indexing is the norm. "
Unless one is using a syntactic sugar language over op codes, e.g., C, 0-based indexing NEVER makes sense or would be a valid design decision. C is a RAM level language and is designed around partitioning RAM to manage a state machine. Interpreted languages abstract away all of that. The goal should be problem-solving and not computer programming. We count by 1 from 1. We list by 1 from 1. We count and list to solve problems.
The LuaTeX compiler allows you to use it in LaTeX. I don't know anything about Lua and I'm just as lost now as when i started the video, but it's still the best compiler even if you don't use Lua, along with XeTeX especially if you're writing in a language that's nothing like English, such as Arabic or Japanese.
Not developing with it myself, but I have touched it sometimes the past in for a bit of scripting inside a simulator program. Syntax looks a lot like Pascal/Delphi, with very similar if, for, while and repeat syntax, and the indexing from 1 instead of 0. Maybe also a bit of VB like. But all with a really strong JS sense inside it. All objects are associative arrays, hash tables (hence the name, tables). And everything dynamic. Lua is older than JS though. Also very interesting to see that JS was really not the first language which came up with this whole associative array based objects concept! It looks like numbers in Lua work a lot better than in JS though, because i do not see so many floating point precision issues. It also looks like Lua actually has some distinction between integers and floating points, because when I type 5.0 I am getting 5.0 back from the interpreter, while when I type 5, I am actually getting 5 back. So I do not really believe that Lua has only one numeric type.
Yes, Lua under the hood dynamically uses either ints or floats to represent numbers, both 64 bit by default, though you can compile it to use 32 bit ones. Rules are sanely described in section 3.4.3 of the manual (of 5.4, the latest version). Section 2.1, where it introduces them, also states that NaN, unique of all non-nil values cannot be a table index... still better than JS though Haven't heard of Delphi in a while (though I do hear about Pascal every now and then) I find Lua to be a rather elegantly minimal embedding language, though I personally think programs should really just use a Lisp dialect or something instead.
@@MH_VOIDThanks for clarifying. That makes it clear. When it comes to Lisp, I have never written in it, but I know two things. One is that some people are really positive about it. Another thing I know is that it has a lot of parentheses. :P Maybe I will look at it some day.
Lua's popularity is almost certainly due to its use in MMORPGs and other games that allow UI mods. World of Warcraft is the single most popular online game of all time and it allows addons written in Lua. Many games have followed suit.
Recently restarted using it ,I made a small tic tac toe in love2d and even added a min max ai all in one day, I even ended up using it for the backend with teal (the equivalent of typescript for Lua) of a personal project I had in mind for months (now I just need to find where I can host it 😂😂)
Love2D is… lovely. And so easy to pick up. I hadn’t really looked at it or Lua beyond a few basic tutorials before taking part in the official Love2D game jam in 2022, and I managed to make and complete a fairly complex clicker/godsim/puzzle game in 7 days, including making all the graphics from scratch. I came 21st out of 63 participants, which I count as a win for my first ever game jam using a language and framework I was learning as I took part! Unfortunately, I’ve not followed it up in my game dev hobby, and wandered back to Godot and then Unity. However, I’m considering switching to the lightweight Lua-based game engine Defold as it now offers free access to building for PlayStation & Nintendo Switch consoles :)
Another cool use case for Lua is writing games and mods for the Minetest game engine - the one AntVenom used to trick people into believing he was playing Minecraft. :)
Lua is a lot like PHP, except lightweight and embeddable... and functional. Which basically makes it very good as a configuration scripting language as part of something important in your system that isn't dynamic ..like nginx.
It's easy, fast, flexible, free, supports old and modern coding, and is compatible with about everything. What more could you possibly ask from a script language? If you work with Java then you have the option to use LuaJ, which is capable of compiling Lua code directly into JVM bytecode, so you get maximum performance after the JIT is done with it.
@@awesome-coding Ha, me too! I haven't thought of Pascal in years, since my first job out of school. That's definitely why I have this persistent aversion of it to this day :D
I can understand why it is like that, by the context it was created. it was invented at Rio de Janeiro, for regular people do some scriptings. probably people had problems with arrays starting at zero so. to avoid confusion to them they just did it.
@@christopheroliver148 i have not the faintest intention. And yeah I know when I wrote my very very first programs in ZX Spectrum BASIC and later Pascal 30ish years ago, it also seemed more natural to lean on 1 based arrays, you can just specify how you want them case by case in Pascal, but eventually 0 based ones grew on me after playing around with them some more.
At 7:15, in this code example, is it normal Point struct definition contains integers but new_point function uses double number type ? Is that a mistake ? If yes, will it crash at compilation time, execution time ?
Well, I actually looked it up (haven't tried it as my C days are a thing of the past). It seems C actually converts double automatically to int in this case. So in modern languages it would be an error and would require an explicit cast. In lua itself numbers are always doubles which can be a bit of a pain sometimes. Though a double can represent 32 bit integers without any issues. Only bitwise operations need a bit extra work. But there are usually libraries in lua that can handle that. I've actually seen many libraries written in pure lua. That includes zip, deflate and even SSL, AES and SHA.
@@waltermelo1033 well, it's even in the logo. And Terra also means Earth in Portuguese (before anyone thing it's Latin... well, it IS Latin, but also Portuguese)
Lua is implemented into many games including World of Warcraft and Garry's Mod. Because you don't really have to be all that smart to read it it is quite easy to learn. Lighttpd also has a plugin to use Lua which makes certain tasks a lot easier to do. That is why Lua is so popular.
Lua + C is a pure magic, although calling lua from C is a minefield. Calling C from lua is much more fun - unless you want to read a lua table from the C code hehehe, good luck with this. And watch out for nils that pop up from every direction in a most unexpected moment. Nevertheless, it totally changed my outlook on software design, - just put all the logic into a lua script and use the native code as a glue.
Lua was my first programming language! 17 years ago i created a drawing application for the PSP, there is a few demo videos on my channel if anyone wants to see.
Thanks for mentioning this. I'm never thinking about captions when editing a video, but you are making a great point. I'll keep it in mind moving forward.
@@awesome-coding Here's the answer from the man himself: "This is a very funny question, because if you think about any programming language, but Python, they are all kind of non-local by default. For instance, if you see a function in C, you don't see the whole code, because there are a lot of 'includes' there. So you see one function, and if a variable is not declared in the function, it is global by default. That's what happens in C; that's what happens in Java. That's what happens in a lot of programming languages. So I think it's funny that people learn Python and then come to Lua and say "Oh, Lua is non-local" and think we invented that, that it was something completely radical. And there are so many wrong things with local by default because you cannot define the scope you want the variable to be. It's very common. For instance, you have a variable that you must initialize inside a 'then' or an 'else' in an 'if,' so if it's local by block, it would be restricted to the block inside the 'if' so otherwise you only have locals and in the function scope, which is not good, too. So it's much nicer to have local. You can have a local that is really local to the block where you need it. The standard in programming languages is not local by default. So Python created that slice for some very small things, but for anything more complex, you start to get problems around that. I can understand the question and it's reasonable to ask why do we have non-local as default, that is not to accept undeclared variables and all variables should be declared. Having the option of local by default, for me, is something very strange."
I have considered forking BAR (Beyond All Reason) to create a fantasy version of the game. Never did any research yet, so not sure how YT knew I might be interested in learning Lua though. Looks close enough to 'C' though that I should be proficient in it in just a few days.
@@awesome-codingI only wrote scripts in lua but I think there’s inconsistencies in indexing which makes you make a lot of off-by-one errors, native lua tables and lua libraries assume 1-based indexing but external libraries written in C for example assume 0-based indexing
@@Om4r37the lua C API uses 1 based arrays when you pass them into a C function, so the dev would have to account for that anyways so it isn't really an issue
I'm surprised at the large number of people commenting their assumed reasons for Lua's popularity, as if the channel owner actually wanted an answer. Did people never learn what a rhetorical question is? Great video, btw. Lua is the Brazilian language, so I'm proud that it exists despite never writing a single line of it.
haha.. ran into lua a while back when looking into custom backend code for a 'fat-client app' leveraging it for its 'scripting' engine, nearly vomited, and successfully avoided returning to it until this week Now sitting down with it out of necessity...( all the while mumbling to myself and cursing it as a crusty old weekly-typed 'slanguage'...) and then I run into this video & see that impossible metrics chart... On the one hand, it evokes despair at the prospect I might have to use it one day for a paycheck On the other, GREAT to know I'm not completely wasting my time learning something for a one-off purpose. Signed, -Bash_Lova (oh the irony!) P.S. Thanks for breaking my heart, then healing it in the first 90s... P.S.S. Love the video edits: making the uber-dry... entertaining
The one core mistake in a Lua was starting tables shifted off-by-one by default, complicating all your math with extra +1's here and -1's there 🤦. Otherwise it's pretty great, and I'd prefer it over Python.
Why isn't Lua so popular? Well, the language was designed to be embedded and almost invisible to the application. Romantically, I think her not being popular kind of confirms her goal.
Umm... no. The rate of growth of a language does NOT mean it's popular. If something goes from one person using it to TWO people using it, it's popularity DOUBLES!! But that don't make it popular.
00:00 🚀 Lua ranks second in the fastest-growing programming languages for open source projects, closely following Rust.
1:49 📋 Lua is an efficient, lightweight, and dynamically typed scripting language with 22 keywords and 8 basic types.
2:49 🔄 Lua is dynamically typed, with variables not having types; only values do. Local variables are preferred for performance and scoping reasons.
3:48 ⚖ Lua's control flow includes if-then-else, while loops, and repeat-until loops, with numeric or generic for statements for table iteration.
4:18 🗃 Lua's table is the sole data structuring mechanism, versatile for records, dictionaries, arrays, and more.
5:04 🧠 Lua's automatic memory management, with a garbage collector, simplifies memory handling, while metatables enhance table flexibility.
6:04 📚 Lua's standard library, implemented in C, includes coroutine support for non-preemptive multitasking.
6:39 🚀 Lua's efficiency is attributed to its C implementation, making it portable and easily embeddable in C-based applications.
7:24 🌐 Lua's ecosystem is supported by a module system and the LuaRocks package manager, with various libraries, frameworks, and community involvement.
Thank you!
Dude this reads like the readme of the latest "blazingly fast" javascript framework
I used Lua already 20 years ago in an embedded realtime machine contol system. All known requirements for funcionality were hardcoded in C but lua allowed us to implement and try new functionality quickly. Once the requirements were known the lua code was ported to c code. I also added a terminal to add and execute lua code while the machine was running. This saved us soo much debug time. The combo LUA and C (Later C++) is absolutely fantastic! Great to see it is becoming so populair.
doing exactly this for work 20 years later :) We use LuaJIT for the FFI which makes C interop so damn simple.
Neovim plugins obviously
Yeah 😅
Even though recent popluarity is due to neovim,
it is a really popular lang, from pandoc and mpv, vlc to even adobe photoshop interface is written in lua....
Roblox is also very big
@@unendlicherping318 roblox uses luau
Good one😂
Lua is so simple that, presuming you have some programming experience, you can learn the basics in a couple of hours
Yep!
Yeah. I learned it to write a homebrew PSP game back in 2010. Very strange to see it so popular considering it was created back in 1993!
I would like to correct you slightly, it's so simple, that presuming you have no programming experience (like me), you can learn the basics in a couple of hours. it really is incredibly simple, I use it almost daily now
The point is where to use that knowledge. I learned it but i am not have any work that using Lua
Not only that. I would say because it's that simple it's one of the few languages where you ( I ) can claim to "know" the language as a whole. Most languages have some rarely used obscure syntax or features you may have never heard of since you never used it. Just reading through the lua specs is really fun. The meta functions alone offer so much potential. Multi-value support for return types and assignments haven't been mentioned. But lua allows things like
a,b = b,a
which would swap the content of a and b. A multi value return can also be simply wrapped in a new table
t = {someMethod()}
Coroutines are even more awesome compared to other languages which may also have some sort of coroutines. First of all you can yield even in nested methods which would still suspend the next upper coroutine. You could think of it like an exception handller, though it actually preserves the callstack and resumes at the yield call. The yield call is much more than just an execution yielding operation. You can actually pass arbitrary data (multi value) to the yield method. Those parameters are actually returned to the caller who called coroutine.resume on your coroutine. Likewise the yield call will return values which are passed to the resume method by the caller. So it's allows two way communication between the caller and the coroutine. Implementations like in the Minecraft mod Computercraft use this mechanic to implement messages. So every program you run in CC is actually a coroutine and the game passes events that way. So the yield instruction is essentially the message pump. You can actually pass a string to the yield function and the game would interpret that as a message filter. So this coroutine would not be resumed unless the specified message comes along. That's how things like sleep is implemented. This mechanic allows incredible flexibility as you can even implement your own scheduler inside lua to further distribute events. The game actually ships is a very simple "parallel" api which allows you to simply have several coroutines run in "parallel".
I'm mainly a C# programmer, but lua has been my favourite scripting language for years. MoonSharp is a pure .NET implementation of lua. Since the Unity game engine can build your project to WebGL / javascript I successfully have lua support in a game running inside a browser, which is awesome ^^. Of course inside the browser we don't really have threading support and having a scripting language that can dead-lock / busy-spin is not good. Though the interpreter already has a built-in way to issue a special yield every x instructions, so even an infinite loop is not really an issue and with some extra work this mechanic can be used as a load balancer and dead-lock detector.
Another great thing abour lua is because it's that simple and doesn't really have custom data types, code can easily be re-used even if some library is missing as long as you can provide the necessary methods.
I often use lua to explain to others how OOP and classes in other languages actually work under the hood. In most compiled languages (C,C++,C#,....) all methods are technically static methods. So code never "lives" in an object instance but only the class. The trick is that when you do
obj.SomeMethod(123, "abc")
the compiler actually calls the static method and passes the object as first argument. So the call above becomes
SomeClass.SomeMethod(obj, 123, "abc")
Of course dynamic dispatch (virtual methods / polymorphism) adds another layer of indirection, but the code is still static.
Lua has a neat extra operator that helps with implementing the concept of OOP. Instead of using a dot, you can use a colon to call a method. This does exactly what I just described. So when doing
someTable:method(42)
it actually does
someTable.method(someTable, 42)
since you can simply "map" methods into a table via meta tables, you can call a method that doesn't exist in the table itself but is defined in the "class" of that object and when using the colon operator, you can implicitly pass the object itself to the method, so the method can mutate / use the object.
I started programming "almost" 30 years ago with pascal. That's why I don't mind the "if then" and "end" syntax. At least lua doesn't require a "begin" :)
I could talk for hours about lua, but I just realised that I'm just writing a comment on YT and I should probably stop now ^^
I love lua.
The fact that it is a tiny language, is the very reason it is so nice:
It makes code very easy to follow, since there isn't a myriad different ways to implement things.
How is that easy to follow? A programme can just call a function out of the aether of global variables, but the call gives you absolutely no idea where it's actually defined. That strikes me as being impossible to follow.
@@Malidictus It is easy to follow since the language is tiny. There isn't a myriad different ways to implement things. That means that if you are looking at code from another programmer, it is easier to understand usually.
For any larger scripting language code-base you need to be more strict with code Also only use Globals rarely in very specific cases. than if you have a typed language. Of course you will sometimes do a spelling mistake, and call something void. But those bugs are almost always trivial to find and fix...
Eu tive o prazer de estudar com uma das professoras que estavam no projeto da linguagem lua quando ela foi criada
Sinto muito orgulho dela ser uma linguagem Brasileira!
👏🏻👏🏻👏🏻
in case anyone doesn´t have the function to translate
"I had the pleasure of studying with one of the professors that were in the Lua Language Project when it was created. I am very proud of it being a brazilian language.
que foda
Simplicity, small (130 KB), uses a virtual machine, few instructions, easily linked to C libraries, easy to embed in any other language, Engine or other type of software
This is why I use at my company. I’ve written code to call LUA from Java, Swift, and of course C++ to embed it into our mobile apps. Also made it so Java, Swift and C++ can call LUA. It’s just so easy to embed because you can compile it with any C compiler and gluing it to any other language is just a matter of writing some C code.
I love lua so much it's unreal, I write everything in lua, and I am also writing an operating system based around Lua. Favourite language of all time
Operating system? IS this even possible? Tell me abt everything Im excited to know
@@Chara556well lua interop with C quite easily, so you can a Lot of stuff with It. Adobe Photoshop interface is written in Lua for example
@@PamellaCardoso-pp5tr why isnt lua só famous RN like python etc
@@Chara556index starts at 1 🤣
@@Chara556Lua is only designed to be used as a embedding language (to be used on top of C, C++, etc). Therefore, it’s fast, minimal but also limited and lacks a lot of stuffs.
This video is great. I've been programming in Lua for years and years now, and I've grown to really like the Lua language.
I think a very important thing to mention when talking about Lua is LuaJIT.
LuaJIT is fully compatible with Lua 5.1 and is so fast that it can regularly out-perform my hand-written C code with some trivial Lua code(Lua code is usually shorter and more readable as well). It's not only fast during the runtime running the JITed code, but also when interpreting non-JITed code thanks to it's hand-optimized interpreter and data structures. And it's startup time and binary size(~500K on my machine) is also tiny compared to other scripting languages.
Not to mention the FFI, which not only allows you to call C functions from Lua, but also exposes the C data types for your convenience. The FFI data types are integrated into LuaJITs optimization passes, and so using the FFI can actually speed up regular Lua code as well, by enabling C-style arrays, pointers, manual memory management, structs, etc. to be used directly from Lua when needed, at the cost of memory safety(can't be avoided when working with C APIs).
I thought not having binary distribution was bad, but found it's so easy to compile it on windows.
I use and love Lua since around 2008, for me personally there is no better language and paired with C to me it's unbeatable.
Apparently it's a little known fact, but you can compile vanilla Vim with support for Lua and I do every time I update the one I have installed. As an extra tidbit, you could also build it with support for Perl, Python, Ruby, TCL and a few other languages I can't remember.
Thanks, but I build my Vim with Elisp support.
Wait, no... I'm a dum-dum... I build my Elisp platform with Vim support. 😉
Neovim is better
@@gustavojoaquin_arch What's your empirical reasoning? Is it better defaults? If so, does that mean you do less configuration?
@@anon_y_mousse idk exactly how much is the difference in configuration options, but in neovim I find much more plugins than vim
This gives me nostalgia. It was the first programming lanugage I learned and completed a tutorial of when I was like 12 or 13. I tired to write a mod for Minetest at the time and it actually kinda worked. Sadly I don't have the files anymore.
I still play minecraft to this very day (with some down time in between) and I almost always play with mods and ComputerCraft / CCTweaked is almost always included :) Currently I'm back at SkyFactory3 which unfortunately doesn't have CC but instead OpenComputers. It also uses lua but is a bit more bulky. Those 95% of the code could be reused anyways :D I actually host all my lua code on my raspberry pi and I load them from the webserver it runs.
I discovered LUA with Tabletop Simulator. Is a "game" that let's you spawn custom models and textures so you can prototype boardgames. The thing is that instead of prototyping your own games you can "rip" popular games and... it has LUA integrated to make scripts, like could be set the game for different players or to keep score. It's really neat, and as you said, is small enough you can embed it in other apps. I really liked working with it. Array 1 is based.
Interesting. I'm finding out Lua is available in way more games than I initially thought.
@@awesome-coding It might have a snowball effect. If you want your game to be scriptable you may look into other games that did that or you got directly inspired by a game you played. I wonder who set the trend in that. In any case, seems like LUA has some attributes that makes it prone to help in that. LUA is good. Most likely not the most performant or "complete" language, but you don't always need that. That's also why JS and Python are so popular.
Lua isn't an acronym, it's the Portuguese word for moon
@@Mark-kt5mh Mmm, like the luna, interesting.
@@SRG-Learn-Code Exactly like luna; they share the same etymological roots!
I learned Lua recently and absolutely loved it. Learning curve is minimal, fast compilation, very easy python like syntax, what not to love about it. You can even make games using the tiny Löve framework. Overall experience was very good.
"very easy python like syntax"
Very easy... what?? I can see why Python syntax seems easy at first - everything is very low entry barrier. But having to constantly stress about whitespaces will eventually take a toll on your soul. I'll take the "end" keyword any day of the week.
@@hctiBelttiL Stress about whitespace? It is something you need to pay attention to, yes... but no more than brackets in other languages. And unless you are exceedingly sloppy in your coding, the whitespace will take care of itself anyway. In either case it's more of a boon rather than a drawback.
Very peculiar. 🤔
@@herrpez the brackets are set before and after a block, anything you do in between is fair game. With whitespace you can easily lose track of scope if you fatfinger the wrong key, cat climbs on your keyboard, etc. Also, assume that you want to move or paste a block of code inside a different scope, you then have to adjust the indentation instead of simply pressing the hotkey for the format code option in your IDE. Refactoring - made hard, courtesy of whitespace.
Also, maybe you have a huge expression that you want to divide between multiple lines, or a hardcoded string, Python has you jumping through hoops just to do a simple thing like that, and it's ugly to boot.
Let me put it another way -
In other languages code blocks are defined, and remain defined until that definition is acted upon. In Python code blocks define themselves, and that's a recipe for mistakes.
@@herrpez the problem with using whitespace in the way python does is that it is virtually invisible, but absolutely crucial to running the code. if the amount of indents is not exactly the same between two lines of code, python will not like it. this basically forces you to use tabs or to have your code writing software to auto indent a specific number of spaces for you, and for that software to have some kind of visualization to easily tell how many spaces you have.
@@Templarfreak Any half decent editor will automatically indent things correctly for you. It's honestly a struggle to screw up the code in the first place. And when you do, either the interpreter tells you, or the LSP (should you have one) does long before it even becomes an issue.
As for using tabs... there's nothing wrong with it, but it is unusual. Nevertheless- no good editor, that I know, of lacks a setting to turn a tab press into any given number of spaces.
I see a lot of potential in Lua and I love its simplicity...just a data structure? Wow it's so cool. There is also an implementation of the Lua language with a just-in-time compiler, called LuaJIT, which is stupidly fast, sometimes as fast as C 🤯
Lua is great and simple language, I mostly used it with game dev and a few times with neovim, but never with web dev or something like that
Having coroutines like Ruby technically makes it better suited for a backend web server than Python or Javascript ever were, but much like Ruby it got shoehorned into a specific niche. Most likely because Lua's standard library is not batteries included
Well done! This video lays out right the language and in under 10 minutes.
Thank you! Glad you liked it!
Your videos are quick and straight to the point while still easy to follow along, subscribed!
Thank you! I really appreciate it!
I never tried Lua outside of scripting for nginx, so I don't feel the same love for it as others in the comments. However, I don't ever recall our Lua scripts being the cause of any performance issues, even with 50K requests/s and some complex scripts. Considering it was designed to be an embedded language it is certainly fit for purpose when it comes to nginx.
Interesting! Thanks for your input!
Lua has god tier concurrency primitives thanks to coroutines (async await like perf without colored functions) and openresty makes full use of it by binding lua coroutines to nginx events. It's just a shame that the standard library isn't more batteries included.
while Lua's standard library is quite small, it's quite easy to implement a lot of different libraries, and there is a huuuuuge amount of libraries available. it is very easy for tables to represent virtually any other kind of data object, so it's extremely easy to implement a variety of data structures a well, ranging from priorities queues to binary trees to linked lists. there are libraries available to parse json or xml files into tables in a way that still feels very intuitive and natural (or at least definitely for json). local scoping can also be done in a file as well, and because of that, closures, and metatables, you not only can _completely_ follow oop principles with private methods and fields or static private methods and fields, but you have multiple different ways you can do it with different advantages and disadvantages if your concern is speed, memory, or readability / maintainability.
in Lua 5.3 and up, you also have explicit integers, ie with no decimal, which has some advantages that Lua's numbers did not have before (namely accuracy), and in 5.4 you have the const keyword.
About Lua arrays starting with 1.
Seems obvious, since it's based on tables and for common users, so I guess common users having experience with spreadsheets like Lotus, Excel and Quattro Pro.
"Lua's choice for 1-based indexing is not arbitrary, though. It was influenced by its design goals of simplicity and its roots in the Petrobras company in Brazil, where Lua was developed. The choice aligns with human counting conventions (starting from 1) and some mathematical and engineering applications where 1-based indexing is the norm. "
Lua wasn't developed in petrobras, Lua was developed by PUC-RJ to be used in a Petrobras project. PUC-RJ still maintains the project as well
Unless one is using a syntactic sugar language over op codes, e.g., C, 0-based indexing NEVER makes sense or would be a valid design decision.
C is a RAM level language and is designed around partitioning RAM to manage a state machine.
Interpreted languages abstract away all of that. The goal should be problem-solving and not computer programming.
We count by 1 from 1. We list by 1 from 1. We count and list to solve problems.
The LuaTeX compiler allows you to use it in LaTeX. I don't know anything about Lua and I'm just as lost now as when i started the video, but it's still the best compiler even if you don't use Lua, along with XeTeX especially if you're writing in a language that's nothing like English, such as Arabic or Japanese.
Made a full game with lua, but this cleared somethings.
Not developing with it myself, but I have touched it sometimes the past in for a bit of scripting inside a simulator program.
Syntax looks a lot like Pascal/Delphi, with very similar if, for, while and repeat syntax, and the indexing from 1 instead of 0. Maybe also a bit of VB like.
But all with a really strong JS sense inside it. All objects are associative arrays, hash tables (hence the name, tables). And everything dynamic. Lua is older than JS though.
Also very interesting to see that JS was really not the first language which came up with this whole associative array based objects concept!
It looks like numbers in Lua work a lot better than in JS though, because i do not see so many floating point precision issues.
It also looks like Lua actually has some distinction between integers and floating points, because when I type 5.0 I am getting 5.0 back from the interpreter, while when I type 5, I am actually getting 5 back. So I do not really believe that Lua has only one numeric type.
Yes, Lua under the hood dynamically uses either ints or floats to represent numbers, both 64 bit by default, though you can compile it to use 32 bit ones. Rules are sanely described in section 3.4.3 of the manual (of 5.4, the latest version). Section 2.1, where it introduces them, also states that NaN, unique of all non-nil values cannot be a table index... still better than JS though
Haven't heard of Delphi in a while (though I do hear about Pascal every now and then)
I find Lua to be a rather elegantly minimal embedding language, though I personally think programs should really just use a Lisp dialect or something instead.
@@MH_VOIDThanks for clarifying. That makes it clear.
When it comes to Lisp, I have never written in it, but I know two things. One is that some people are really positive about it. Another thing I know is that it has a lot of parentheses. :P
Maybe I will look at it some day.
To me (and some others) it's basically Scheme with Pascal syntax.
Warframe has been using Lua for over 10yrs. Soulframe is being developed and is using Lua in it's development.
lovely video montage makes it enjoyable to learn new information by watching your video ❤
Glad you enjoyed!
I think Lua is popular due to it's inherit Brazilian charisma. Same thing as Elixir...
😂 100% accurate
Lua's popularity is almost certainly due to its use in MMORPGs and other games that allow UI mods. World of Warcraft is the single most popular online game of all time and it allows addons written in Lua. Many games have followed suit.
Recently restarted using it ,I made a small tic tac toe in love2d and even added a min max ai all in one day, I even ended up using it for the backend with teal (the equivalent of typescript for Lua) of a personal project I had in mind for months (now I just need to find where I can host it 😂😂)
Thanks for the love2d suggestion. Didn't know about it, but it looks really interesting.
Love2D is… lovely. And so easy to pick up. I hadn’t really looked at it or Lua beyond a few basic tutorials before taking part in the official Love2D game jam in 2022, and I managed to make and complete a fairly complex clicker/godsim/puzzle game in 7 days, including making all the graphics from scratch.
I came 21st out of 63 participants, which I count as a win for my first ever game jam using a language and framework I was learning as I took part!
Unfortunately, I’ve not followed it up in my game dev hobby, and wandered back to Godot and then Unity.
However, I’m considering switching to the lightweight Lua-based game engine Defold as it now offers free access to building for PlayStation & Nintendo Switch consoles :)
I seem to recall that Lua is used in Roblox? Might be another factor for its popularity?
And Roblox is mentioned in the video. I should really watch the video before commenting...
I think its the only major factor in its popularity lol
It's also used in World of Warcraft and neovim so those two add to its popularity
@@Devilhunter69 You forgot GTA mods
Lua is used by a lot of games, usually not being talked about too much. Really the most underestimated language of all time.
Very helpful. Thank you.
Glad it was helpful!
Great to see so much love for Lua as atm I’m trying to sell a Dashboard UI engine based on C+Lua to Mercedes
You can do it!
This is very helpful. Thank you!
You're very welcome!
Another cool use case for Lua is writing games and mods for the Minetest game engine - the one AntVenom used to trick people into believing he was playing Minecraft. :)
Lua is a lot like PHP, except lightweight and embeddable... and functional. Which basically makes it very good as a configuration scripting language as part of something important in your system that isn't dynamic ..like nginx.
It's easy, fast, flexible, free, supports old and modern coding, and is compatible with about everything. What more could you possibly ask from a script language?
If you work with Java then you have the option to use LuaJ, which is capable of compiling Lua code directly into JVM bytecode, so you get maximum performance after the JIT is done with it.
4:43 "with indexes starting at 1, just as God intended" LOL😂
I did 4 years of Pascal (which also starts from 1) in high school so all the languages starting from 0 are the ones being wrong in my opinion 😂
1-based indexing is the only correct indexing
@@awesome-coding Ha, me too! I haven't thought of Pascal in years, since my first job out of school. That's definitely why I have this persistent aversion of it to this day :D
@@gmdrandom6287Based indexing!
It's a very smart and capable language and JavaScript wishes it was this elegant.
However 1 based array addressing drives me up the wall!
😅
I can understand why it is like that, by the context it was created.
it was invented at Rio de Janeiro, for regular people do some scriptings. probably people had problems with arrays starting at zero so. to avoid confusion to them they just did it.
Remind yourself never to mess around with Smalltalk then. (Smalltalk arrays too are origin 1.)
@@christopheroliver148 i have not the faintest intention.
And yeah I know when I wrote my very very first programs in ZX Spectrum BASIC and later Pascal 30ish years ago, it also seemed more natural to lean on 1 based arrays, you can just specify how you want them case by case in Pascal, but eventually 0 based ones grew on me after playing around with them some more.
great video! thank you!
Glad you liked it!
At 7:15, in this code example, is it normal Point struct definition contains integers but new_point function uses double number type ? Is that a mistake ? If yes, will it crash at compilation time, execution time ?
Well, I actually looked it up (haven't tried it as my C days are a thing of the past). It seems C actually converts double automatically to int in this case. So in modern languages it would be an error and would require an explicit cast. In lua itself numbers are always doubles which can be a bit of a pain sometimes. Though a double can represent 32 bit integers without any issues. Only bitwise operations need a bit extra work. But there are usually libraries in lua that can handle that. I've actually seen many libraries written in pure lua. That includes zip, deflate and even SSL, AES and SHA.
I think it is used in a lot of games. As a scripting language
Is used for modding for games that werent made in unity or godot
world of warcraft and minecraft plugins also heavily rely on lua
Lua has Terra and WASM support. It’s incredibly fast when paired with Terra and C.
fun fact, is that Lua is actually Moon in portuguese.
@@waltermelo1033 well, it's even in the logo. And Terra also means Earth in Portuguese (before anyone thing it's Latin... well, it IS Latin, but also Portuguese)
I wasn't expecting it at all.
Can you explain how you make the code images in these videos?
Hey! I'm doing it using Photoshop & Adobe Premiere
Thank you!. fyi will use lua basics elements.
Thank you!
Man, where I could find those charts you was talking about?
Hey!
Check out state of the Octoverse - github.blog/2023-11-08-the-state-of-open-source-and-ai/
It discusses Lua's status in Open Source last year.
@@awesome-coding Thank you very much!
Lua is implemented into many games including World of Warcraft and Garry's Mod. Because you don't really have to be all that smart to read it it is quite easy to learn.
Lighttpd also has a plugin to use Lua which makes certain tasks a lot easier to do.
That is why Lua is so popular.
I use a software that benefits from users using that. And I think that's the reason for its newfound popularity
Is anyone know any reference for learning ....how to use lua for UI development along with javascript and html
Fengari
This language was created in brazil. I so proud of if
00:05 what's the source for the graph?
State of the Octoverse - github.blog/2023-11-08-the-state-of-open-source-and-ai/
@@awesome-coding thanks
Lua was created at the Catholic University in Rio, Brazil. Lua means Moon in Portuguese.
In Lua, index starts from one.
People underestimate how much of the Lua userbase is just roblox Luau devs, probably like 90%
thank you man
Qt creator now also has lua support for plugins
Lua + C is a pure magic, although calling lua from C is a minefield. Calling C from lua is much more fun - unless you want to read a lua table from the C code hehehe, good luck with this. And watch out for nils that pop up from every direction in a most unexpected moment. Nevertheless, it totally changed my outlook on software design, - just put all the logic into a lua script and use the native code as a glue.
Lua was my first programming language!
17 years ago i created a drawing application for the PSP, there is a few demo videos on my channel if anyone wants to see.
Nice!
The modern remake of "Defender" for the PlayStation 2 used lua!
EP2: Introduction of Lua | Programming
ua-cam.com/users/liveAW8s8iugADs?feature=share
You have a tendency to put important code under the UA-cam captions
Thanks for mentioning this. I'm never thinking about captions when editing a video, but you are making a great point. I'll keep it in mind moving forward.
Redis and ScyllaDB stored procedures - but don't be to greedy : be aware of garbage collection costs.
Thanks for mentioning Redis - I wasn't aware of that.
Also beware of the stack. If you put too many things on it. It can get really slow whenever it has to reorder the stack
why not make local the default ?
good question
@@awesome-coding Here's the answer from the man himself:
"This is a very funny question, because if you think about any programming language, but Python, they are all kind of non-local by default. For instance, if you see a function in C, you don't see the whole code, because there are a lot of 'includes' there. So you see one function, and if a variable is not declared in the function, it is global by default. That's what happens in C; that's what happens in Java. That's what happens in a lot of programming languages. So I think it's funny that people learn Python and then come to Lua and say "Oh, Lua is non-local" and think we invented that, that it was something completely radical. And there are so many wrong things with local by default because you cannot define the scope you want the variable to be. It's very common. For instance, you have a variable that you must initialize inside a 'then' or an 'else' in an 'if,' so if it's local by block, it would be restricted to the block inside the 'if' so otherwise you only have locals and in the function scope, which is not good, too. So it's much nicer to have local. You can have a local that is really local to the block where you need it. The standard in programming languages is not local by default. So Python created that slice for some very small things, but for anything more complex, you start to get problems around that. I can understand the question and it's reasonable to ask why do we have non-local as default, that is not to accept undeclared variables and all variables should be declared. Having the option of local by default, for me, is something very strange."
I have considered forking BAR (Beyond All Reason) to create a fantasy version of the game. Never did any research yet, so not sure how YT knew I might be interested in learning Lua though. Looks close enough to 'C' though that I should be proficient in it in just a few days.
I have written some WoW addons and plenty Redis scripts (both are Lua hosts), and developer experience is just horrible.
Curious to find out why if you are willing to share :)
@@awesome-codingI only wrote scripts in lua but I think there’s inconsistencies in indexing which makes you make a lot of off-by-one errors, native lua tables and lua libraries assume 1-based indexing but external libraries written in C for example assume 0-based indexing
@@Om4r37the lua C API uses 1 based arrays when you pass them into a C function, so the dev would have to account for that anyways so it isn't really an issue
4:41 "just as God intended"😂😂 is funny asf
Anyone old enough to remember using Lua as a scripting language for GTA games? 😄
Anyone old enough to remember GTA games?
GTA 5 is 10 years old btw. And SanAndreas (the one I played A LOT) is 20 years old 😑
MTA ;)
ah yes the top programming languages like SQL, makefile, and shell...
You forgot HTML which is by far the most popular.
I'm surprised at the large number of people commenting their assumed reasons for Lua's popularity, as if the channel owner actually wanted an answer. Did people never learn what a rhetorical question is?
Great video, btw. Lua is the Brazilian language, so I'm proud that it exists despite never writing a single line of it.
Lua is the second best thing that came out of Brazil :D
How can you mention it's embedded in Roblox and not WoW?
haha.. ran into lua a while back when looking into custom backend code for a 'fat-client app' leveraging it for its 'scripting' engine, nearly vomited, and successfully avoided returning to it until this week
Now sitting down with it out of necessity...( all the while mumbling to myself and cursing it as a crusty old weekly-typed 'slanguage'...) and then I run into this video & see that impossible metrics chart...
On the one hand, it evokes despair at the prospect I might have to use it one day for a paycheck
On the other, GREAT to know I'm not completely wasting my time learning something for a one-off purpose.
Signed,
-Bash_Lova (oh the irony!)
P.S. Thanks for breaking my heart, then healing it in the first 90s...
P.S.S. Love the video edits: making the uber-dry... entertaining
😂 Amazing comment!
Lua is popular! Am I living in a alternative universe?
I Lua in my dreams at night wish I could get it out of my head but tables and meta tables with c interop is addictive.
i always have to re-learn how tf closures work
😂
Nice video but please tone down on the meme displays and powerpoint fade ins. It makes your video look like a 80s cartoon network series at times.
Thanks for the feedback!
awesomewm :D
print = "u ar the best this video"
-- increase subscript "
end
Thank you!
6:35 you don't need to resume coroutines in a loop
Surely you don't need the nil type when you have { }
Lua does what Python dreams to do
😂 nice
Lua does what Python't
The one core mistake in a Lua was starting tables shifted off-by-one by default, complicating all your math with extra +1's here and -1's there 🤦. Otherwise it's pretty great, and I'd prefer it over Python.
not a mistake, but a quality that most other languages lack
Why isn't Lua so popular? Well, the language was designed to be embedded and almost invisible to the application.
Romantically, I think her not being popular kind of confirms her goal.
And then there are all the Lua variants - Luau(Roblox), MoonScript, Agena, etc..
Don't forget xkcd 1102
that's fair :)
do anyone is using lua at Web?
with HTMX maybe?
I learned Lua because of AutoTouch (scriptable auto clicker for iOS)
lua seems like sister of javascript
Lua in web dev is true let let the LuaHerasy begin
Roblox kids growing up
Garris mod*
I learned lua through computercraft.
Ty :)
Index starts at 1 in lua 😭
First time I hear of it. Sigh... It never ends...
Array and hash map in the same syntax...
Remind me of php
Ha! I didn't make the connection until now.
Computercraft!
I had to search what this is 😅 I'm getting old...
Lua forever!
Takes 20 minutes to learn lua. But Roblox has its own language "Luau" and luau makes Lua feel like hell.
3 reasons Lua is so popular. Free, free and free. Not so complicated a reason.
Umm... no. The rate of growth of a language does NOT mean it's popular. If something goes from one person using it to TWO people using it, it's popularity DOUBLES!! But that don't make it popular.
It’s so popular that no one has heard of it