Before we begin our journey, there is one important thing that needs to taken care of. That is to install zuko.
You can run basic zuko programs in your browser as mentioned in the previous topic. But zuko running
in your web browser has very limited functionality. It's better and strongly recommended to install zuko on your system. Zuko is easy to install. The total download size isn’t much either.
This document covers installation for Windows only. Binaries are avaialable for windows only. Linux users can build from source code.
You will need a good
text editor to write zuko programs. We will be using visual studio code.
Enough talk let’s begin! First of all go to the downloads page.
Download the zuko zip archive(plutonium-win64.zip
for 64 bit Windows and win32 for 32 bit Windows).
Extract the zip archive you would get a folder named "pluotnium"
Copy this folder to C:\
Add C:\plutonium to PATH environment variable
That’s it! The interpreter is in place. Also install
visual studio code if you haven’t already. Launch vscode and search for “plutonium
programming language” in extensions tab. Install this extension,it provides syntax
highlighting support for zuko in vscode.
Now let's write our first zuko program.
In vs code create a new file and write the following code:
println("hello world!")
Save the file(make sure the extension is .plt).You can run programs using cmd(or terminal incase you are using linux). cd to the folder where you
saved the file and use command:
zuko filename.plt
It will run your program and show the output.
Output:
hello world!
Congratulations you have successfully written your first program in Zuko . But what is
this println? println is a builtin function used to print something to the screen.
For now all you need to know is that if you want to output something just call println and
provide some arguments inside the parenthesis. The println function can take multiple
arguments and all of these will be printed. Arguments should be comma separated if they
are more than one.
In the above example “hello world!” is an argument given to the
println function.
Functions will be discussed in detail in later. You can use the println function to print
numbers and floats as well.
The .plt is simply an extension for zuko program.
As Zuko is an interpreted language which means the interpreter reads these text files
and executes them. No executable is generated