Languages are cool! Compilers are cool! How do they work? That's why this project exists: Kyanite is a statically-typed, compiled programming language to learn more about how PLs are created. There are two backends: LLVM and a custom IR, kyir
. The latter currently supports more language features, but is much less stable than the former.
(reqiures macOS on Apple Silicon)
Kyanite is available on FlakeHub:
nix build "https://flakehub.com/f/alythical/kyanite/[tag].tar.gz"
./result/bin/kyanite run path/to/program.kya
[tag]
should be replaced by either:
0.1.[commit-count]
(where [commit-count]
is the total number of commits in this repository)The test suite verifies the programs in the examples
directory function correctly. Feel free to experiment with other programs, but expect panics to occur, particularly with the kyir
backend.
Note: By default, the
kyir
backend is used. Provide the--llvm
flag to compile with LLVM instead.
The Nix derivation is an instructive resource for compiling manually. In particular, note nativeBuildInputs
(dependencies), buildPhase
and installPhase
, and the RUSTFLAGS
and LLVM_SYS_150_PREFIX
environment variables.
Other operating systems are currently unsupported.
There's a reference and user guide here, and some working samples in the examples/
directory for both backends to demonstrate basic features.