Getting started with Lua (Part 2)

Basic programming constructs — printing output, variables and comments

Lars Nielsen
3 min readSep 25, 2020

In case you want to get started from Part 1 — here is the link .

Instead of the normal A-Z mode of learning a programming language , we will try it a little differently. Let’s just assume that you are trying to make a lateral shift from python to lua — Lets try to relate to another scripting language and make it easier and faster to learn Lua .

Why ? Because if you know Python, Lua is a breeze . Lets just do it.

But before the comparison with Python , lets do some basics right.

1. Installation ( Ah not now please ! )

We will cover the installation later sometime — once we are sure we understand the basic notations, syntax and the philosophy that makes Lua simple.

2. Basic rules of the interpreter

First things first — we need to understand how the interpreter thinks — just so that we do not waste time wondering why our code didn’t run as we wanted !

Rule 1 : If a line is just spaces ( white spaces), the interpreter ignores it .

Rule 2 : Lua is case sensitive .

cat is different from Cat is different from CAT

3. Basic constructs ( level 1 )

--

--

Lars Nielsen

Making ML and AI available to everyone. One commit at a time. | Quantitative programming | Python | Arduino | Comp Vision | pythoslabs@gmail.com / @PythosL