Projects

Peko

A toolchain for shipping one app to macOS, Windows, Linux, iOS, and Android, built around Pekoscript, a statically typed language I designed and wrote the LLVM compiler for.


What it does

  • Compiles Pekoscript to native executables for five platforms through LLVM 18 and lld.
  • Builds the UI on each platform’s own webview: WKWebView, WebView2, WebKitGTK, and Android WebView.
  • Bundles, signs, and packages the result for each platform from one peko CLI.
  • Ships a standard library, a formatter, a package manager, and a language server.
Pekoscript, from pekoshots/builder.peko
/// A DOM target: a selector plus an anchor point given as
/// percentages of the element box.
[public] class Target {
    [private] selector: string
    [private] x: number
    [private] y: number
}

Peko Studio

An IDE for Peko projects, written as a Peko app: Monaco for editing, the Pekoscript language server for diagnostics, and panels for building, signing, and deploying to each platform.

Peko Studio with the Bridge panel open, listing CALL and REPLY messages such as ide.watch, ide.read, and ide.project_sources
The Bridge panel logs every call between the JavaScript UI and the native side while the app runs.

The compiler

Four Rust crates, about 89,000 lines. peko-core (34k) is the lexer, parser, type checker, static analysis, formatter, and package resolver. peko-llvm (18k) lowers typed ASTs to LLVM IR and object files. peko-cli (31k) drives builds, bundling, signing, and deploys. peko-lsp (6k) is the language server.

The language server reuses peko-core directly, so the errors in the editor are the same errors the compiler reports.

Codegen is organized as ten builder traits in dependency layers, from LLVM types and constants at the bottom to cross-module orchestration at the top. Each layer only calls itself or the layers below it, so new operations don’t pile up on one giant context type.

Linking runs lld in process through a small C++ shim, picking ld.lld, ld64.lld, or lld-link per target.

Pipeline
   .peko source
        │
        ▼
   peko-core          lexing, parsing, types, static analysis
        │
        ├──▶ diagnostics ──▶ peko-lsp     same engine, so the editor
        │                                 and the compiler agree
        └──▶ typed AST
                │
                ▼
           peko-llvm       LLVM 18 IR ──▶ object files ──▶ lld
                │
                ▼
           peko-cli        the peko command

Packaging and signing

A bundler per platform, plus signing: Apple code signing in process with the apple-codesign crate, Android through jarsigner, and Windows Authenticode through osslsigncode, with signing passwords kept in the OS keychain.

For iOS and macOS icons, Peko writes Assets.car files itself instead of calling Xcode’s actool. That means producing the BOM container, its trees, and CSI renditions with LZFSE-compressed image data. It only covers what app icons need.

A later rewrite split the build into two pipelines: a rare prebuild that compiles the native runtime once per platform, and a per-deploy assembly step with no compiler in it that injects assets, writes manifests, and signs.

Status

Tagged releases through v2.3.1, with CI and nightly builds. I stopped working on it in August 2026. The source is still public.