Roblox began by using Lua 5.1 in its platform, to enable players to be able to develop and share their own games in a safe environment. But as Roblox’s internal codebase grew and its users’ needs became more sophisticated, the company decided to give Lua an upgrade. Instead of rewriting and changing the main language, Roblox debuted a successor: Luau. In November 2021, Roblox chose to open source Luau in order to promote collaboration and encourage other communities to participate.
Since Roblox is marketed towards kids, it’s naturally assumed that its programming language Luau is easy to learn. However, what’s easy for one person may be surprisingly tricky for the next. For those who are just starting to get their feet wet with programming, is Luau a good choice? Genevieve Johnson, a senior instructional designer at Roblox, gave The New Stack some insight into Roblox’s educational gaming style.
“Roblox Studio and Lua is a great base language for students new to coding or looking for a bigger challenge than visual coding environments such as MIT Scratch,” said Johnson. “Lua is very similar to Python, it’s really lightweight and really readable, but Lua is even more forgiving than Python. White space, or indentation, is often the bane of new coders. One indent wrong in Python and your script doesn’t run. With Lua, you still always want to use good organization with your code, but you’re not punished for just missing an indent.”
Roblox started off with Lua 5.1 for good reason. It’s forgiving, simple, and straight forward. But what about Luau?
“For beginner programmers, learning Luau-the-language is easy,” said Johnson. “We have small quality of life extensions to Lua 5.1, but the experience overall is similar. The bigger difference comes for programmers that already learned the language. For more experienced coders, Luau provides extra features to make it easier to write correct code.”
“That said,” she continued, “one big factor that makes it easier for beginners and experienced coders alike is that we have rich tooling that automatically flags common errors as you write your code. This is integrated into Roblox Studio, but can also be integrated in other editors. So even if the language is easy to learn, having a great integrated environment that helps you write correct code makes it easier.”
Roblox Studio; via Roblox devforum
The key difference between scripting in Roblox and Minecraft is the way both games are constructed. With Roblox, you can share your creations and access other players’ games. Minecraft is more of a solo play master game, in which you can script mods that add more dimensions to the playing environment.
Not only is creating and sharing games fun for beginners, it helps them learn too. Roblox’s commitment to teaching kids and novices to learn to code should come as no surprise, seeing as its founder Dave Baszucki once had an educational coding platform business geared towards children called Knowledge Revolution. Knowledge Revolution was acquired by MSC Software in 1998, but that was just the beginning for Baszucki, known as “builderman” by Roblox users.
“Roblox is on a mission to support 100 million students learning on our platform by 2030.”
-Genevieve Johnson, Senior Instructional Designer, Roblox
In 2006, Roblox was born. There have been countless studies on how important it is for children to learn through play, and it’s safe to say that adults can benefit from the same learning model.
On the topic of teaching through entertainment, Genevieve Johnson told us that this has always been a primary goal for Roblox. “Roblox is on a mission to support 100 million students learning on our platform by 2030,” she said. She also had a few thoughts about why Roblox is so beneficial for kids learning to code.
“I really think it’s the visual cause and effect of getting to see a still, lifeless world instantly come to life through code. With just a few lines of code, a boring gray part becomes a confetti bomb, or a button that can call an elevator, or a jump pad. These are the sorts of things that let beginners see that coding can be an outlet for their creativity and an activity that inspires experimentation.”
Johnson added that with Roblox Studio, “anyone can jump in and start creating, and you can invite your friends to join you in a collaborative real-time environment.”
It’s no surprise that Roblox is loved by beginners learning to code. After all, it’s much easier to retain information when you’re actively engaged. Furthermore, when it comes to coding, you can never start too early. A whopping 77% of American parents wish they learned to code while they were still in school.
Lua is commonly regarded as the perfect programming language for kids, simplistic and still powerful. Roblox’s Luau is simply a continuation of an already beginner-friendly and easy-to-use scripting language, with even more security and sophistication.
The New Stack is a wholly owned subsidiary of Insight Partners, an investor in the following companies mentioned in this article: turing.
Featured image via Roblox.com.
Note that any programming tips and code writing requires some knowledge of computer programming. Please, be careful if you do not know what you are doing…