The most basic expressions in Scaly are literals. A literal simply returns a value that is written literally into a program. So our first program is not the famous Hello World version in Scaly (which comes later because it is obligatory), instead we write up the shortest non-empty Scaly program imaginable:
0
Use your favorite text editor and type that lone zero digit into a file, give it a name
like shortest.scaly
, and compile it to an executable. As you might expect,
the program does exactly nothing useful. Immediately after startup, it returns a 0
value
to the operating system just to indicate that everything went fine. If a program is to return 0
as the last action at the end of it, that 0
literal can be omitted. That’s why the shortest
Scaly program actually is the empty program which contains nothing and does exactly the same
as the above version - just returning 0
. Try it by deleting the zero digit, compiling and
running the program.
There are also string literals like "Hello World!"
, the two bool literals true
and false
,
and more.