Getting Started
Snail source files have the extension .sl
. The reference implementation also
defines several other formats for representing intermediate program
representations.
Obtaining and Running the Interpreter
Go to the Downloads page to obtain a copy of the reference interpreter. To run a snail program with the interpreter, pass the file in as a command line argument:
snail file.sl
The snail interpreter has several command-line options:
--lex
(-l
) the interpreter will stop after tokenizing (lexing) the input program and will output an.sl-lex
file containing tokens in a simple interchange format.--unlex
(-L
) the interpreter will undo lexing and produce an.unlex.sl
source file containing the original snail tokens.--parse
(-p
) the interpreter will stop after parsing tokens from the input program and output an.sl-ast
file containing the abstract syntax tree of the program in JSON format.--unparse
(-P
) the interpreter will undo parsing and produce an.unparse.sl
sourcefile containing a snail program equivalent to a given AST.--trace
(-t
) the interpreter will output additional debugging information while executing the program.
Note that the reference interpreter can also read well-formed .sl-lex
and
.sl-ast
files in addition to the basic .sl
program source code.
Where to Go from Here
- If you are just getting started with snail, have a look at the Language Basics page for an introduction to snail syntax and language features.
- Check out this repository for some example programs written in snail.
- For language implementers, please refer to the Specification page for a formal specification of the language.