Full Lua Crash Course 💥 2.5 Hours 🖥️⌨️ Beginner's Programming Fundamentals Guide for Developers

Published 2024-03-11
Lua is a high level, cross-platform programming language that can be embedded in various software products. For example, Lua is used as a scripting language inside of popular networking software tools including Wireshark and nmap. Lua has also been used to script actions inside of games such as Roblox.

Similar to other high level languages, Lua uses a "virtual machine" layer to interpret instructions, and handle memory management (garbage collection).

In this video, we will be taking a look at how to write Lua code completely from scratch. After watching this video, and practicing some of the code samples, you should be equipped to write Lua code yourself. You should install the development tools that we present in this video, including Microsoft Visual Studio Code, and the Lua and Code Runner extensions for VSCode.

Lua probably isn't the best choice for general purpose programming, although it could be used for that purpose if you chose to. Even though Lua doesn't support the notion of structs and classes, you can still construct custom types of objects by using the "table" data type.

🚨📦 Help support this channel — shop through my Amazon storefront!
⬇️⬇️⬇️
www.amazon.com/shop/trevorsullivan
⬆️⬆️⬆️

Visual Studio Code ➡️ code.visualstudio.com/
Lua Website ➡️ lua.org/

Please follow me on these other social channels!

➡️ trevorsullivan.net/
➡️ github.com/pcgeek86
➡️ twitter.com/pcgeek86
➡️ youtube.com/trevorsullivan
➡️ facebook.com/trevorsoftware
➡️ tiktok.com/pcgeek86

All trademarks, logos and brand names are the property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names,trademarks and brands does not imply endorsement.

#opensource #software #linux #devops #programming #coding #codinglife #code #coder #ubuntu #ubuntulinux #appdev #developer #lua #luascript

All Comments (20)
  • @Im_Ninooo
    === Timestamps === 0:00:00 Intro 0:00:34 What is Lua 0:01:02 Where is Lua used 0:02:12 How Lua works 0:04:35 What's included in this course 0:04:55 Other places to learn Lua 0:07:08 How to install and run Lua 0:08:11 Lua shell (REPL) vs interpreter 0:10:04 Installing Lua on Ubuntu (apt) 0:10:45 Installing Lua on Windows (scoop) 0:12:06 Installing Lua on MacOS (homebrew) 0:13:16 Installing and setting up VSCode 0:15:16 Extensions 0:16:25 Creating a new Lua script 0:17:15 Using the Lua shell (REPL) 0:18:03 Variables 0:20:47 Multiple statements on the same line 0:21:46 Block definitions (do...end) 0:23:13 Back to VSCode 0:24:21 Code Runner extension 0:26:04 nil type 0:26:46 Booleans 0:27:36 Variable naming conventions 0:29:58 Strings 0:30:12 Numbers 0:33:25 String concatenation 0:36:41 Multi-line strings 0:40:19 Comments 0:42:07 Tables 1 0:44:02 type() function 0:45:15 Tables 2 (indexing, types) 0:47:13 Length operator 0:48:58 Tables 3 (key-value pairs) 0:51:06 Variable naming limitations 0:52:40 Math operations 0:54:00 Math module 0:55:59 abs() 0:57:09 ceil() 0:57:55 floor() 0:58:32 random() 0:59:17 randomseed() 1:01:07 min(), max() 1:02:52 More Strings 1:03:47 String module 1:04:07 sub() 1:07:22 find() 1:09:01 Functions 1:35:08 For loop 1:40:55 If statements 1:47:31 While loop 1:49:46 Repeat loop 1:51:43 User input 1:52:14 io.read() 1:57:05 Table module 1:58:50 sort() 2:02:21 concat() 2:04:07 remove() 2:06:33 OS module 1 2:08:11 remove() 2:09:18 execute() 2:10:07 getenv() 2:12:10 IO module (writing to file) 2:12:39 output() 2:14:00 write() 2:15:31 open() 2:18:05 OS module 2 2:18:15 time() 2:21:27 Modules
  • @LouisWeiser
    The quality of your video is amazing, and you are such a good teacher. i'm still at half of the course but i hope there will be more of lua ! thanks alot !
  • @alijavidi2503
    I watched the whole video. Great and Smooth! Keep up the good work :))
  • @k2c2
    Good to see you back ;)
  • @nederui
    this video was such a great finding! I've been learning lua myself by trial and error, and I got stuck not knowing how to structure my code properly. (ah, so that's how Lua modules work!) thanks a lot for your time and valuable info. you are an amazing teacher.
  • @thescottallen
    This is great! I use Lua in an audio/visual/control system called QSYS by the audio company QSC. Lua is used to control automation, build plugins to connect to other devices or extend stock functionality of the system. This video is helpful for me to fill in some gaps, where I sometimes find it difficult to read the manual, having someone explain it in a different way is awesome. Much appreciated!
  • @BlackistedGod
    Thank you for this, it would be nice if you could do Luau also, its like a Typescript version of Lua that is being use by Roblox
  • @nederui
    I feel there's not many informative, in-depth videos on YT about Lua; specially for OOP. (I know that's not Lua's strongest suit but, in the environment I'm currently working in, it's either Lua or C) if you ever have the time to tackle more advanced concepts like how to use Lua modules to do composition or how to make use of mixins with Lua, that would be wonderful. either way, you've got a new subscriber!
  • @B52-ge8qy
    Hi Trevor ! It's a very awesome topic, because I'm going to learn Lua to configure NeoVim😆
  • @XYZ-gr2iu
    Hi Trevor, which theme are you using in the video? I like your purple theme.
  • 1:02 And various entirely non useful things like my game mods 😂 And it is like Java imo. It and HTML are the only languages of any kind even had passing knowledge of before picked up Lua to mod the total wars games beyond texture swapping etc. It felt familiar to me, and wasn’t until dipping my toes into other programming languages, let’s say more mature languages, that I realized how they differ
  • @reevesremo4576
    when i use the run code command in the promt and execute it it says "lua' is not recognized as an internal or external command, operable program or batch file.
  • @JMiiahYT
    Hey, Just learning lua (programming in general as im trying to make a FiveM server) and my output says : 'lua' is not recognized as an internal or external command, operable program or batch file." every time I CTRL + Alt + N sorry if this is a stupid question to ask but would you know why this is happening??
  • @gdev251
    can you make Advance lua tut sir?