Compiler internals / Roadmap
Roadmap
Where Eskiu stands and what comes next. 0.13 is the first public release; per-release detail is in
CHANGELOG.md, and what can change between releases is in
stability.md.
Goal
Compute-heavy services are often split across several languages: C for the hot paths, Go
for concurrency, C++ for libraries, Python for glue. Eskiu aims to cover that ground with one
language that compiles to native code through LLVM, calls any C library directly, manages
memory explicitly, and still runs a file directly with eskiuc run.
The work has two stages. The first, a systems foundation that can do what C does, is complete. The second is to make the types that high-throughput services work with first-class in the language without giving up general systems use.
Where it is today
-
Tooling.
eskiuc runfor scripts,eskiuc replfor trying code,eskiuc new/add/build/testfor packages,eskiuc fmt, and editor support in VS Code-based editors and JetBrains IDEs through the same compiler modes. -
Apps. ui draws native views on iOS and Android, the DOM on the web and a webview window on macOS from one Eskiu codebase.
ui serveshows a change in under a second,ui openmakes Xcode and Android Studio projects whose Run builds the Eskiu code, andui releasebuilds for the App Store and Google Play. Packages for location, notifications and the camera build on it. - Language. C-style syntax and C integer semantics, structs with methods, structural
interfaces, monomorphized generics with constraints, sum types with exhaustive
match, closures with escape analysis, exceptions,defer/errdefer, slices, checked nullable pointers, operator overloading, inline assembly, async/await. - Standard library. Collections, strings, JSON, regex, time, random, allocators, threads and atomics, an async runtime, and HTTP/1.1, HTTP/2 and TLS servers.
- Targets. Native on macOS arm64, Linux x86-64 and arm64, and Windows x86-64, with
prebuilt binaries for all four. Cross-compilation to WebAssembly (emscripten and WASI),
Android and iOS, with static and shared library outputs for app builds, to 32-bit ARM
(verified on a Nintendo 3DS) and 32-bit x86, and freestanding builds for bare metal (an
ARM64 kernel boots in QEMU). The C ABI is followed on every target. See
cross-compile.md. - Self-hosting. The compiler is also written in Eskiu (
selfhost/). It reaches a three-stage bootstrap fixpoint, behaves like the C++ compiler over the whole test corpus, and is built and checked by CI aseskiuc-esk. The C++eskiucremains the released binary because it bundles LLVM. Seeself-hosting.md. - EIR. An IR of its own and native back ends that skip LLVM's code generator
(
--backend=eir: ARM64 assembly, C99), passing every run test, with the self-hosted compiler building the same EIR byte for byte. It is an experimental back end, not the path for release builds:eir-spec.md§8. - Quality. Every fix ships with a regression test. CI runs the test suite, the parity
checks between the two compilers, an
-O0against-O2differential, and fuzzers (a C oracle checked against clang, a negative-program corpus, and the stdlib parsers under AddressSanitizer).
Next: 0.15
-
Recoverable exceptions in ui. 0.14 brought the language's part (
catch (_)andexception_text()); next, ui keeps an app running when a block, a handler or an effect throws, withErrorBoundaryandui_on_error. The plan:ui-error-recovery.md. -
Build times. Measured on
examples/scripts/organize.esk(11 stdlib imports, the filetests/editor_timing.shbudgets): lexing all the imported text is about 5% of an-O0build, parsing about 20%, type checking about 15%, code generation about 45% and LLVM's back end the rest; at-O2LLVM's optimizer is about 60% of the time. A module cache would save the parse and check of the imports (a third of an-O0build, a sixth of an-O2one), and CI's Release build type-checks the file in about 130 ms, so it waits until a real package's front end passes about a second; the editor timing budget in CI is the signal. - Native WebAssembly exceptions. On emscripten, exceptions run through its
JavaScript-based runtime, which costs a call into JavaScript at every call that may throw;
the WebAssembly exception-handling instructions (
-fwasm-exceptions) would avoid it and bring exceptions to WASI. That needs a second lowering oftry(funclet pads instead oflandingpad) in both compilers. - Eskiu in LangArena. All 50 benchmarks of
LangArena are ported with matching checksums: Eskiu
runs at C's speed on the 39 algorithmic ones and at about 1.28 times C's time over all 50,
with byte-identical output from both compilers. Propose it upstream as Goose was added (PR
#28): a directory with the sources, a Makefile and run scripts, a Docker image from the Linux
release, and the entry in
benchmarks.rb.
Next: 1.0
- Packages beyond git. Today the package manager resolves git and path dependencies pinned
in
eskiu.lock. A registry and version ranges would let packages depend on "1.2 or later" instead of a commit. - Shipping the self-hosted compiler. It already matches the C++ one, but it writes LLVM
IR as text and runs
clangto build it, so it cannot ship without clang. The plan is to have it drive LLVM through LLVM's C API (libLLVM, called withexternfrom Eskiu) instead: the same optimizer and the same performance as the C++ compiler, no clang, and a binary that ships with libLLVM as the C++ one does. EIR is not the path to this: a native back end will not match LLVM's optimized code (no language that has tried, Rust with Cranelift or Zig with its own back ends, uses one for release builds), and building one that covers every target and option is many months of work. EIR stays an experimental back end (eir-spec.md§8). - A faster front end. The parser's thrown exceptions, the second type-checker run of a
program without
asyncand thedynamic_casts on AST nodes are gone, which took theuikit gallery's-O0rebuild from 0.47 s to 0.29 s (compile-speed.md). Left: a program withasyncis still checked twice, and the standard library and the packages a program imports are parsed and checked again on every build.
Later, not scheduled
-
Errors that point at the spec. A rejection whose reason is not obvious from the message alone (a closure that escapes, an
escapingparameter, a?*Tused without a check, a capture written inside its lambda) ends with the section ofspec.mdthat states the rule, such as(spec §3.2). Section numbers move when the spec grows, so the messages need anchors that stay put. Both compilers print the same text, whichtc_parity.shcompares byte for byte. -
Leaner async frames. Today every local of an async function is stored in its frame; storing only the locals that live across an
awaitwould make frames smaller. This is an optimization, not a correctness issue. - 32-bit Android.
armeabi-v7aandx86compile, but a C function reached through a hand-built fn value (the wayonnxcalls ONNX Runtime's function table) getssize_tandc_longas 64 bits, since the target-width rule applies only toexterndeclarations. Bringing fn values under that rule would let packages such asonnxbuild for those ABIs. Google Play no longer requires them and few devices still run them. - HTTP/3. By binding an existing QUIC library over
externrather than writing QUIC. A reverse proxy in front of an Eskiu HTTP/1.1 or HTTP/2 server covers most uses today. - ui on the web beyond one page. Prerendering routes to HTML at build time, then server-side rendering with hydration, then server functions the ui tool generates.
- A desktop renderer for ui on
gpuandfont. The native macOS, Linux (GTK 4) and Windows (Win32) hosts exist (in Preview); a renderer of its own would draw the same on every desktop, without the platform's widgets or a webview. - Compile-time
derive. Generating code such as serializers from a struct's fields at compile time, with no metadata left in the binary. It adds language surface, so it waits until after 1.0.
Non-goals
- Garbage collection. Memory is explicit:
alloc/free, allocators,defer. - Runtime reflection. It would add type metadata to every binary; compile-time generation covers the same needs.
eskiu