A small language compiler, written in Python and targeting LLVM.
Language guide · Architecture · Installation · Contributing · Roadmap
Kinetic is an early compiler prototype (1.1.0). It reads Kinetic source, performs lexical, syntactic, and type analysis, emits verified textual LLVM IR through llvmlite, and uses Clang to produce a native executable.
The long-term goal is a readable systems language. The current prototype is deliberately small; it does not yet provide a standard library or a production memory-safety model.
- Type inference and implicit function returns.
- Immutable bindings with opt-in mutation.
- Conditional branches and loops.
- Integer and string values, integer arrays, and array indexing.
- A built-in printing operation for one integer or string at a time.
Start with the language guide and the programs in examples.
The introductory example is a complete Kinetic program:
func main() {
print("Hello World!")
}
Functions use func, immutable bindings use
let, and mutable bindings use
mut. See the syntax guide for
declarations, reassignment, and function calls.
You need Python 3.10 or newer, a compatible llvmlite release, and Clang on your executable search path. See installation for details.
Install the Python dependency:
python -m pip install -r requirements.txtCompile and run the introductory example:
python kinetic.py run examples/01_hello.knCompile without running the result:
python kinetic.py build examples/01_hello.knThe root launcher provides the build and run commands. Generated IR and native binaries are written next to the input source.
Compiler sources, documentation, examples, and development utilities each have one clear location.
| Area | Responsibility |
|---|---|
| Compiler | A flat Python package containing all compiler stages and the CLI. |
| Documentation | Language reference, architecture, and repository design. |
| Examples | Small programs demonstrating the 1.1.0 language. |
| Tools | Repository maintenance utilities, separate from the compiler CLI. |
| Tests | Static repository checks; no native builds are required. |
| Package configuration | Python packaging and the optional installed command. |
See the layout guide for the directory responsibilities.
Run the dependency-free, static-only repository checks:
python -B tools/check.pyThe same command runs static checks (syntax, layout, links, keyword mapping) plus frontend behavioral tests against the lexer, parser, and analyzer — including the new compile-time diagnostics. Backend and native suites skip cleanly without llvmlite or Clang.
The GitHub Actions workflow runs the same checker on pushes and pull requests, using Python 3.10 and 3.14 on Windows and Linux. It can also be started manually from GitHub's Actions tab. A passing static check is not a compiler-behavior result; targeted manual checks remain useful when native builds are appropriate. See contributing.
The current goal is to build the foundations needed for a compiler written in Kinetic that can compile itself. Version 1.1.0 is not self-hosting yet. The roadmap separates completed work, current planning, and future milestones.
See LICENSE.