Skip to content

Using the Algo Interpreter

C272 edited this page Sep 5, 2019 · 4 revisions

To boot up a simple interpreter window, you can run Algo with no command line arguments (eg. algo). You will be greeted with the following screen:

Algo Language Interpreter v0.x.xxxx, build yyyyy.
(c) Larry Tang, 2019-20xx

For information on how to use this interpreter, enter 'algo help'.
Starting interpreter...

>>

After this, you can now type (line by line, one line is interpreted at a time) any correct grammar, and it will be interpreted and output to the console. If you wish to interpret a script, you can instead pass a file as a command line argument, such as algo myAwesomeFile.ag. The file extension for Algo is .ag, but it'll recognise any text file.

This time, there will be no header printed like above, and it will simply automatically run. If you want to activate developer tools for Algo, you can use the --dev flag after your script (algo myAwFi.ag --dev). This will dump all variable scopes upon crash or program completion, and show the lexed tokens and parsed tree in Lisp form before runtime.

Once you've tested and run your script, you may want to compile it for portability, or to hand to others. To do this, you can use the Algo Language Executable Compiler (ALEC).

Standard Library Documentation:

Clone this wiki locally