AMOS 2 Articles

Quick Start guide

Posted 134 days ago ago by Admin     0 Comments

0 Great article! Great article! I'm neutral on this

Quick start


The current version is still in development, I have not yet programmed an installer.

  • Download the latest version for your platform : Windows / MacOS / Linux
  • Unzip the whole amos-2 directory on your hard-drive. Note: do not put it in 'Program files' or 'Programs (x86)' as they are write protected folders.

Structure of the amos-2 directory

The amos-2 directory contains a series of sub-directories:

  • runtime : contains the source-code of the AMOS 2 runtime engine
  • default : contains the default resources and filesystem folders as well as the default compiler manifest (see later)
  • demos : contains a set of demos of the various parts of the system
  • docs : contains this doc, note that you need to install Docsify to be able to read it in a browser locally
  • application : contains an empty application to be copied as a template ... and maybe remaining test applications (like the 'debugging' application)...

Your first application, "Hello world"

To create a new application :

  • Copy the "empty_application" folder, preferably in the same folder.

  • Rename the new folder to "hello_world". The path to the new application's folder should now be "amos-2/applications/hello_world"

  • Open your favorite source-code editor (I strongly suggest Visual Studio Code from Microsoft, free and cross-platform download here)

  • Load the file "amos-2/applications/hello_world/main.amos" in the editor

  • Type the magic words:

    Print "Hello world!"

  • Save the file

  • Open a command line window

    • If you are using Visual Studio Code, click on 'Terminal' on the lower part of the interface
    • If you are using other tools, open the Command Line from your system, under Windows, 'command.exe'
  • Change the directory to the root of the amos-2 directory

  • Compile your application by typing:

    • Windows:

      ./amosc-x64 applications/hello_world or

      ./amosc-x86 applications/hello_world if you have Windows 32 bits

    • MacOs

      ./amosc-macos applications/hello_world

    • Linux:

      ./amosc-linux applications/hello_world

  • If everything goes right, the compiler should indicate a succesful compilation

  • Open a file explorer, and display the content of the "application/hello_world" folder. You will see that the compiler has created a new "HTML" folder. You will find in it the components of your compiled application, and an index.html file at the root of the folder.

  • To run your application :

    • Open your favorite browser (note: AMOS 2 has been more tested on Chrome)
    • Enter the complete path (including the drive) to the "index.html" file. In our case, if you have installed the amos-2 directory at the root of your C: drive, the path would be "C:/amos-2/applications/hello_world/HTML/index.html".
    • Press ENTER
    • The classic AMOS screen should appear with the magic words: "Hello world"!

Repeat the process to create other applications.

The compiler command-line

At this stage of the development, the only command line parameters of the compiler is the path to the application to compile.

amosc-x64 path/to/application_folder

Important In this version, amosc must reside in the parent directory of the "runtime" and "default" directory. You have to be located in the same folder as the amosc folder for a succesful compilation. This will change in the future when I make an installer as the installer will define a system variable containing the path to the runtime and default folder.

The current default manifest (see later) is configured to point the compiler to a file called "main.amos" which contains the source code of the application.

No Comments

You need to login to comment.