Quickstart awa5x Tutorial
Table of contents
Obtaining the awa5x suite
The awa5x suite of tools can be downloaded from the GitHub repository. Visit the homepage for more details.
The archive to download has the form: awa5x-[VERSION]-tools-[PLATFORM]-[ARCH].zip
.
On Microsoft® Windows® systems, download the archive whose [PLATFORM]
component is windows.
On POSIX™ and UNIX®-like systems, download the archive whose [PLATFORM]
component is unix.
If you have particular hardware, please ensure that [ARCH]
matches your processor type.
Once you have downloaded the archive, create a directory and unpack the archive inside it. You might want to call the directory awa5x
for simplicity. After unpacking, this directory should contain at least two programs to progress with this tutorial: awa5 and awa5c.
Development environment
Once you have downloaded the tools, you only need two more programs which are usually provided by your operating system: a text editor and a command-line terminal.
Usually systems come with a text editor already installed: it can be Notepad, gedit or nano; power users might have other editors installed like Emacs, Vim or ed.
awa5x programs can be written using any editor, as long as the file is in plain text, usually indicated with the txt
extension.
Command-line terminals are also usually already installed: on Windows® it's recommended to use PowerShell; on other systems there might be multiple programs available with different names, but looking for a program called “terminal” or “console” will usually yield results.
More complex tools, like integrated development environments (IDE), can also provide their own built-in command-line terminal.
Compiling an awa5x program
Create a folder for your programs. For example, it can be C:\Users\MyUser\Desktop\awa5-programs
or /home/myuser/awa5-programs
, just make sure you can reach it through its full path.
Inside your text editor, type the following (you can copy and paste it):
awa awa awawa awawa awa awawawawawawawa awa awawa awawa awa awa awa awa awa awa awa awa awa awawa awawa awa awa awa awa awa awa awawa awa awawa awawa awa awa awa awa awa awa awa awa awawa awa awawa awa awa awa awa awawa awa awa awa awa awa awawa
Save this file inside the folder you just created. The name is not important, but for simplicity let's call it myprogram.txt.
Open your terminal and navigate inside the folder with your awa5x tools. Let's say it's on your desktop, so you can enter it for example with the command:
cd C:\Users\MyUser\Desktop\awa5x
or
cd /home/myuser/Desktop/awa5x
according to your system.
Now, compile the program by executing the compiler tool:
./awa5c C:\Users\MyUser\Desktop\awa5-programs\myprogram.txt > C:\Users\MyUser\Desktop\awa5-programs\myprogram.awa
Make sure you give the proper paths to your file.
The name of myprogram.awa is once again not important, you are free to change it to anything you want.
Executing the compiled program
Ensure the myprogram.awa file exists and its size is not zero bytes. You might want to check that you did everything correctly before moving on.
Now run this command in your terminal:
./awa5 C:\Users\MyUser\Desktop\awa5-programs\myprogram.awa
You should see the text AWA
printed below the command you just executed.
Going further
awa5x is an extension of the AWA5.0 language, providing more features and commands, which this tutorial can't possibly cover extensively.
Make sure to read the included user manual to learn more about each tool and feature.