Hello World in Lua was written by:
This article was written by:
If you see anything you'd like to change or update, please consider contributing.
Let's get down to business.
As we'll quickly notice, Hello World in Lua is not that exciting. In fact, there are only a handful of languages with this boring of an implementation. For instance, both Ruby and Python can perform Hello World in a similar fashion. As a result, there's not a ton of explaining that needs to be done.
Essentially, Lua has a native printing function which can be used to write a
string to stdout. In this case, it's called
As usual, we pass a string to the
Well, perhaps running the script will be more interesting. Fortunately for us, there's an online REPL for Lua, so we don't have to worry about downloading anything. Once inside, drop the code snippet from above into the editor and hit run. That's it!
Alternatively, we could download a copy of Lua, and run the solution locally. Even better, we could build a Docker image, so we don't clutter our machine with dependencies. If you want to help with the Docker initiative, head on over to the Sample Programs repository and fork it. We appreciate the help!