eskiuv0.12.0
Packages

Official packages

Libraries from the eskiu-lang organization on GitHub. Each one is a git repository with an eskiu.toml, added to a project with one command.

Using a package

eskiuc add writes the dependency into eskiu.toml, fetches it with git and records its commit in eskiu.lock, so later builds reuse it without touching the network. There is no registry: a dependency is a git URL with a rev (a tag, branch or commit) or a local path.

eskiuc new myapp
cd myapp
eskiuc add compress --git https://github.com/eskiu-lang/compress --rev v0.1.0
eskiuc run

A package's modules are imported by the package name and the file name, as in import <gpu/model>;. Chapter 13 of the Book covers manifests, locks and eskiuc test.

gpu

GPU compute, rendering, 3D models and machine learning for Eskiu, over WebGPU.

One API runs on Metal (macOS), Vulkan (Linux) and DirectX 12 (Windows) through wgpu-native, with shaders in WGSL. It draws glTF and OBJ models with physically based shading, runs Llama models from GGUF or safetensors files (Llama 2 7B Q4_0 at 45 tokens per second on an M4 Pro; llama.cpp does 58 on the same machine) and trains small networks (97% test accuracy on MNIST).

The first build downloads wgpu-native 29 for you. Opening a window (<gpu/window>) also needs SDL3 from the system: brew install sdl3 on macOS, then build with -L/opt/homebrew/lib.

Install

eskiuc add gpu --git https://github.com/eskiu-lang/gpu --rev v0.1.0
eskiuc build
Example from the README
Gltf data = model_load("helmet.glb")?;   // or a .gltf, or an .obj
defer data.free();
GpuModel model = gpu.model(&data, surface.format)?;
defer model.release();

// every frame
data.animate(0, seconds);
model.update(mat4_identity());
GpuCamera cam = model.camera(aspect);
GpuPass pass = gpu.pass(frame.view, GpuColor{0.1, 0.1, 0.1, 1.0}, &depth);
model.draw(&pass, &cam);
pass.end()?;

onnx

ONNX model inference for Eskiu, over ONNX Runtime.

A model exported from PyTorch, TensorFlow or scikit-learn runs on the CPU everywhere, and on CoreML, CUDA, DirectML or WebGPU when the ONNX Runtime build has them. Wrong input names, types or shapes come back as error messages.

Nothing to install: the first build downloads ONNX Runtime 1.31 (macOS arm64, Linux and Windows).

Install

eskiuc add onnx --git https://github.com/eskiu-lang/onnx --rev v0.1.0
eskiuc build
Example from the README
import <io>;
import <onnx>;

Result<int, string> run() {
    OnnxSession s = onnx_session("model.onnx", null)?;
    defer s.release();
    float[4] x = {1.0, -2.0, 0.5, 3.0};
    int64[2] shape = {1, 4};
    OnnxTensor input = onnx_tensor_f32(&x[0], &shape[0], 2)?;
    defer input.release();
    OnnxTensor y = s.run1(&input)?;
    defer y.release();
    *float out = y.f32();
    for (i in 0..y.len()) printf("%f\n", (double)out[i]);
    return Ok<int, string>(0);
}

Result<int, string> r = run();
if (!r.ok) printf("error: %s\n", r.error);

tflite

TensorFlow Lite model inference for Eskiu.

A .tflite model converted from TensorFlow, Keras, JAX or PyTorch runs on the CPU with XNNPACK, and on the GPU through the Metal delegate (macOS) or the OpenCL/OpenGL delegate (Linux). Quantized inputs and outputs are converted for you.

Nothing to install on macOS and Linux: the first build downloads libtensorflowlite_c 2.21, which Google does not publish for desktops. On Windows the package's tools/get_tflite.sh fetches it.

Install

eskiuc add tflite --git https://github.com/eskiu-lang/tflite --rev v0.1.0
eskiuc build
Example from the README
import <io>;
import <tflite>;

Result<int, string> run() {
    TfliteInterpreter it = tflite_load("model.tflite", null)?;
    defer it.release();
    float[4] x = {1.0, -2.0, 0.5, 3.0};
    int[2] shape = {1, 4};
    it.set_f32(0, &x[0], &shape[0], 2)?;
    it.invoke()?;
    *TfliteTensor y = it.output(0);
    *float out = y.f32();
    for (i in 0..y.len()) printf("%f\n", (double)out[i]);
    return Ok<int, string>(0);
}

Result<int, string> r = run();
if (!r.ok) printf("error: %s\n", r.error);

compress

zlib, gzip, raw DEFLATE and ZIP archives for Eskiu, written in Eskiu.

DEFLATE at levels 0 to 9, zlib and gzip in both directions, and ZIP archives with ZIP64. Every read is bounds checked and the output is capped by a size limit, so a small file cannot expand into all of memory.

Nothing to install: no zlib and no C code.

Install

eskiuc add compress --git https://github.com/eskiu-lang/compress --rev v0.1.0
Example from the README
ZipReader z = ZipReader_open("pack.zip")?;
defer z.close();
for (i in 0..z.count()) {
    ZipEntry* e = z.entry(i);
    printf("%10llu  %s\n", e.size, e.name.data);
}
Bytes readme = z.read_name("docs/readme.txt")?;
defer readme.free();
z.extract_all("out")?;

audio

Sound for Eskiu: WAV files, a mixer and output through SDL3.

Reads WAV files in every common encoding (PCM, float, IMA and Microsoft ADPCM) as ffmpeg decodes them, mixes any number of voices with volume, pan, pitch and loops, and sends the mix to the default output device.

<audio/wav> and <audio/mixer> are pure Eskiu; <audio/device> needs SDL3 (brew install sdl3 on macOS).

Install

eskiuc add audio --git https://github.com/eskiu-lang/audio --rev v0.1.0
eskiuc build -L/opt/homebrew/lib
Example from the README
import <time>;
import <audio>;

Result<int, string> run() {
    Sound jump = wav_load("jump.wav")?;
    defer jump.free();
    AudioDevice out = audio_open(48000)?;
    defer out.close();
    Mixer mixer = mixer_new(out.rate);
    defer mixer.free();
    uint32 voice = mixer.play(&jump, AudioPlay{volume: 0.8, pan: -0.25});
    while (mixer.playing(voice)) {
        out.pump(&mixer, 50)?;      // keeps 50 ms of audio queued
        time_sleep_ms(10);
    }
    return Ok<int, string>(0);
}

font

TrueType fonts for Eskiu: glyph outlines, antialiased rendering, text layout and atlases.

Reads .ttf files, renders glyphs into antialiased coverage bitmaps, lays out lines of UTF-8 text with kerning, and packs a character set into one texture for text on the GPU.

Nothing to install.

Install

eskiuc add font --git https://github.com/eskiu-lang/font --rev v0.1.0
Example from the README
import <font>;

Result<int, string> run(*uint8 rgba, int width, int height) {
    Font f = font_load("DejaVuSans.ttf")?;
    defer f.free();
    f.draw("Hola, Eskiu", 32.0, rgba, width, height, 10.0, 40.0, 0xFFFFFFFF);

    GlyphBitmap g = f.render(f.glyph('g'), 64.0)?;   // one glyph
    defer g.free();
    // g.pixels: g.width * g.height coverage values, 0 to 255, top row first;
    // g.left and g.top place it from the pen on the baseline.
    return Ok<int, string>(0);
}

jni

Native methods for Android and the JVM, written in Eskiu.

A native method of a Java or Kotlin class is an Eskiu function with the JNI name, with no C glue: strings cross as real UTF-8, lookups come back as a Result, and the whole JNIEnv table is there underneath. It runs on Android and on the desktop JVMs of macOS, Linux and Windows.

Nothing to install: the VM hands the library its tables.

Install

eskiuc add jni --git https://github.com/eskiu-lang/jni --rev v0.1.0
eskiuc build --target aarch64-linux-android24 -o libhello.so
Example from the README
import <string>;
import <jni>;

// package com.example.hello; class Greeter { static native String greet(String name); }
*void Java_com_example_hello_Greeter_greet(*void env, *void cls, *void name) {
    JniEnv e = jni_env(env);
    String who;
    defer String_free(&who);
    e.string(name, &who);
    String out;
    defer String_free(&out);
    String_appendf(&out, "Hello, %s, from Eskiu", who.data);
    return e.new_string(out.data);
}

nds

Nintendo DS file formats for Eskiu: ROMs, NARC archives, sound, 2D graphics and 3D textures.

ROM file systems and overlays, NARC archives, LZ compression, SDAT sound with a synthesizer of the DS sound driver, 2D graphics and 3D textures, in pure Eskiu. It was ported from the tools and engine of Tallgrass and checked against them.

Nothing to install.

Install

eskiuc add nds --git https://github.com/eskiu-lang/nds --rev v0.1.0
Example from the README
NdsRom rom = NdsRom_open("game.nds")?;
defer rom.close();
printf("%s (%s), %d files\n", rom.title, rom.code, rom.count());
Narc n = rom.narc("a/0/0/4")?;            // views into the ROM
defer n.close();
Bytes f = nds_unpack(n.file(12).data, n.file(12).len)?;   // LZ data decompressed
Bytes ov = rom.overlay(12)?;              // decompressed when compressed

vision

private for now

Corners, optical flow, multi-view geometry and planes, in pure Eskiu. It comes from tinyvio, the tracker behind ViroReact's web AR, and computes the same bits as its C++. The repository is private for now. What it does and how it was checked →

Every package needs Eskiu 0.12 or newer. Its README has the full module list, more examples and the details for each operating system.

Start in a minute.

Install the compiler with one command, or run a program in the browser first.