Currently, okta only supports the following platform and architecture combinations:
DISCLAIMER: This project, as well as the okta language itself, it's in a very early development state, expect bugs and frequent breaking changes.
There are two ways to compile oktac from source: using docker, or using cargo (the traditional way), chose the most combinient method for you.
The instructions for both methods assume the repository is cloned and that the working directory is set to the cloned repository:
git clone https://git.sr.ht/~mikelma/oktac cd oktac
First of all, check if the following dependencies are present in your host machine:
Next, execute the following command to build the docker container with the build environment:
docker build -t oktac-build .
The last step is to run the docker container as the following:
docker run --rm -it -v "$(pwd)":/home/rust/src oktac-build:latest
After some minutes, the building process should finish, providing an
oktac static binary
in the current directory.
The first step is to install the following dependencies (if not already present):
The next step is to build the compiler using rust's
cargo. Note that
--release flag isn't mandatory, however it is strongly recommended,
as if this flag isn't provided the debug version of oktac will be built instead.
cargo build --release
The output binary shoud be located in the
This section covers the most common use cases of oktac, for more information
Compiling a single okta file to a binary.
oktac test.ok -o test
Compiling multiple okta files:
oktac main.ok bar.ok foo.ok
Note that if the
-o (output) flag isn't provided the output binary is saved to
Including okta libraries:
oktac -L path/to/lib some.ok code.ok
code.ok can import modules inside
as if they were in their same location (path).
Emit the LLVM-IR generated from the source:
oktac test.ok --emit=llvm-ir
Emit the AST of the source code:
oktac main.ok --emit=ast
Emit the full AST of the source code (very verbose):
oktac main.ok --emit=ast-dbg
The language's reference is also provided with the compiler's source code.
The reference can be found in
docs/reference.md inside this repo, or online
You can also convert the reference to a pretty PDF using
pandoc and wkhtmltopdf:
pandoc --pdf-engine=wkhtmltopdf --css docs/style.css docs/reference.md -o reference.pdf
If you want to contribute or found a bug, please take a look at the contributing section of the okta website.
Oktac is distributed under the terms of the GLPv3 license. See LICENSE for more details.