The current compiler is written in Go and found in the
pkg folder. Source files
are compiled in a sequence of stages, each helping get to the backend form
(currently, only Go source code) that can be built to machine code and executed.
The various stages are:
For testing and debugging purposes, the
pkg/printer package supports pretty-
printing of the AST. The grammar is documented in EBNF form in
Once the backend code is generated, the final build step is offloaded to the
backend-specific compiler or assembler (currently, the
And the online playgrounds for quick checks:
snowc command supports commands that mirror the stages listed above.
The command can be built by executing
scripts/release.sh; the resulting
binary will be in
snowc --help for usage details.