Thanks for your interest! Xi is an experimental, self-hosting language. This guide covers how to build it, what to check before opening a pull request, and how the project is laid out.
Xi is provided as is, with no warranty and no obligation of support (see SUPPORT.md and the LICENSE). Contributions are welcome but reviewed on a best-effort basis.
- A C compiler (
cc— clang or gcc) curland a POSIX shell- Network access (to download the bootstrap seed), or an existing
xcbinary
The compiler is self-hosting. bootstrap.sh downloads the released xc for your
platform, compiles compiler/xc.xi with it, then rebuilds the result from source
with itself:
./compiler/bootstrap.sh # -> ./compiler/xc and ./bin/xiTo build offline, point XC_SEED at any working xc:
XC_SEED=/path/to/xc ./compiler/bootstrap.sh-
Self-hosting fixpoint must hold. Any change to
compiler/*.xi,compiler/xc_helpers.c, orruntime/must still produce a byte-identical fixpoint:./compiler/selfhost.sh
-
Examples must compile and run. This is what CI checks:
export XC_RUNTIME="$PWD/runtime" for f in $(find examples -name '*.xi' -not -path 'examples/showcase/*') examples/showcase/main.xi; do ./compiler/xc "$f" done
-
Add coverage for new features. A new language feature should come with a small example under
examples/(it will be compiled and run by CI). -
Update docs in
docs/and theREADME.mdfeature table when behaviour changes.
There is no checked-in C seed to regenerate — bootstrap.sh always rebuilds
from source, so you never commit generated C.
compiler/ the compiler, written in Xi (lexer, parser, codegen, driver) + xc_helpers.c
runtime/ the C runtime (runtime.h, runtime.c)
std/ the standard library (Xi modules wrapping the runtime)
examples/ programs exercised by CI
docs/ MkDocs documentation
editors/ tree-sitter grammar, Zed and Vim integrations
scripts/ release packaging
See docs/internals.md for the pipeline and self-hosting details.
- Keep each commit a single logical change with a clear message.
- Branch from
main; CI (build + self-host fixpoint + examples) runs on every PR. - By contributing you agree your work is licensed under the project's Apache-2.0 license.
Open an issue using the templates. For security issues, follow SECURITY.md instead of filing a public issue.