A program's code is written in an .h64
text file, then translated by horsec to bytecode combined with HVM in various stages. The result is a mostly standalone executable.
Other tooling like horp helps with project management.
These are the current compilation stages of horsec as of 2024-06-08:
--stage token
does tokenization.
--stage ast
applies the AST parser for a syntax tree and computes a global scope, which can be output with --stage global-scope
if desired.
--stage checked-ast
processes all imports and applies the previous stages to them as well, and then does full project-wide symbol resolution to verify all symbol references.
--stage transformed-code
takes the fully checked code and applies all concurrency transforms and the part of the optimizations that happen still on the AST tree level. You can alternatively output the corresponding AST via --stage transformed-ast
if desired.
--stage bytecode
will take the fully resolved and transformed AST and generate the resulting bytecode.
(Upcoming maybe at some point, more optimizations here.)
--stage binary
will write out the bytecode binary representation attached to a VM binary.