eskiuv0.17.0
Packages

Packages

The packages the project maintains, in the eskiu-packages organization, and every package anyone has published in the package index. 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. A dependency is a git URL with a rev (a tag, branch or commit) or a local path, from any repository; the index only helps people find packages.

eskiuc new myapp
cd myapp
eskiuc add compress --git https://github.com/eskiu-packages/compress --rev v0.1.1
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, iOS), Vulkan (Linux, Android) 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). It has what a 3D renderer needs: several render targets, cube maps, GPU mipmaps, shadow maps, image-based lighting, morph targets, KTX2 and HDR textures, and camera and video frames drawn from YUV. On iOS and Android it draws into a GpuView of a ui app, and the same programs build for the browser through emdawnwebgpu, with a WebGL2 backend where the browser has no WebGPU. Desktop windows take keyboard, mouse, touch and gamepads. What it does, with its benchmarks

Nothing to install: the first build downloads wgpu-native 29, and SDL3 for a desktop window (<gpu/window>). With Eskiu 0.15.1, ESKIU_SYSTEM_LIBS=SDL3 links the system's SDL3 instead.

Install

eskiuc add gpu --git https://github.com/eskiu-packages/gpu --rev v0.8.0
eskiuc build
Example from the README
import <io>;
import <gpu>;

string twice = "@group(0) @binding(0) var<storage, read_write> v: array<f32>;\n"
    "@compute @workgroup_size(64)\n"
    "fn main(@builtin(global_invocation_id) id: vec3<u32>) { v[id.x] = v[id.x] * 2.0; }\n";

Result<int, string> run() {
    float[256] data;
    for (i in 0..256) data[i] = (float)i;
    Gpu gpu = gpu_open()?;
    defer gpu.release();
    GpuBuffer v = gpu.storage(&data, sizeof(data))?;
    defer v.release();
    GpuKernel k = gpu.kernel(twice, "main")?;
    defer k.release();
    k.bind(0, &v);
    k.dispatch(4, 1, 1)?;
    v.read(&data, sizeof(data))?;
    printf("%.1f\n", (double)data[255]);
    return Ok<int, string>(0);
}

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

scene

A scene graph and material renderer for Eskiu, on gpu.

Nodes, cameras, shapes and glTF scenes, drawn with Constant, Lambert, Phong, Blinn or PBR materials under ambient, directional, point and spot lights, transparency sorted back to front, HDR with tone mapping and bloom, skyboxes, image-based lighting and shadow maps, plus input, physics, animation, particles and headset rendering for Meta Quest and Apple Vision Pro. Checked against analytic values on Metal, Vulkan and DirectX 12.

The first build downloads wgpu-native through gpu.

Install

eskiuc add scene --git https://github.com/eskiu-packages/scene --rev v0.3.0
eskiuc build
Example from the README
import <gpu>;
import <gpu/math>;
import <scene>;

Result<int, string> draw(*Gpu gpu, *GpuTexture target) {
    Scene scene = gpu.scene()?;
    defer scene.release();
    SceneGeometry ball = scene_sphere(1.0, 48, 24);
    int mesh = scene.add_geometry(&ball)?;
    ball.free();
    SceneMaterial m = scene_material(SCENE_PBR);
    m.diffuse = Vec4{0.9, 0.2, 0.1, 1.0};
    m.roughness = 0.4;
    scene.add_object(0, mesh, scene.add_material(m));
    scene.add_light(scene_directional(Vec3{-0.5, -1.0, -0.3}, Vec3{1.0, 1.0, 1.0}, 2.0));
    scene.add_light(scene_ambient(Vec3{0.4, 0.45, 0.5}, 0.3));
    int cam = scene.add_camera(0, scene_perspective(0.9, 0.1, 100.0));
    scene.node(cam).position = Vec3{0.0, 1.0, 4.0};
    scene.look_at(cam, Vec3{0.0, 0.0, 0.0}, Vec3{0.0, 1.0, 0.0});
    scene.set_camera(cam);
    scene.post.tone_mapping = SCENE_TONE_HABLE;
    return scene.render_to(target);   // or scene.render(frame.view, w, h, surface.format)
}

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. Its image resizers give the same bytes as Pillow and OpenCV, and <onnx/detect> decodes SSD boxes and runs NMS bit for bit as numpy, so a Python vision pipeline moves over with the same numbers.

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-packages/onnx --rev v0.2.4
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-packages/tflite --rev v0.1.4
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-packages/compress --rev v0.1.1
Example from the README
import <io>;
import <compress>;

Result<int, string> run(*uint8 data, uint64 n) {
    Bytes gz = gzip_compress(data, n, 9)?;
    defer gz.free();
    Bytes back = gzip_decompress(gz.data, (uint64)gz.len)?;
    defer back.free();
    printf("%llu -> %lld -> %lld bytes\n", n, gz.len, back.len);
    return Ok<int, string>(0);
}

yaml

YAML configuration files for Eskiu, read into the standard library's JSON tree.

One YAML document under the YAML 1.2 core schema (block and flow collections, every scalar style, comments) becomes a JsonValue, so settings are read with json_get paths. Errors say the line and column. Pure Eskiu.

Nothing to install.

Install

eskiuc add yaml --git https://github.com/eskiu-packages/yaml --rev v0.1.1
Example from the README
import <io>;
import <json>;
import <yaml>;

int main() {
    YamlError err;
    *JsonValue cfg = yaml_load("service.yaml", &err);
    if (cfg == null) {
        printf("service.yaml:%d:%d: %s\n", err.line, err.col, err.message.cstr());
        return 1;
    }
    defer JsonValue_free(cfg);
    *JsonValue port = json_get(cfg, "server.port");
    *JsonValue model = json_get(cfg, "models[0].path");
    printf("port %d, model %s\n", port != null ? (int)port.num : 80,
           model != null ? model.str.cstr() : "none");
    return 0;
}

audio

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

Reads WAV files in every common encoding (PCM, float, IMA and Microsoft ADPCM) as ffmpeg decodes them, and Ogg Vorbis on every platform with a decoder written in Eskiu, whole or streamed, honoring the loop points a file carries. It mixes any number of voices with volume, pan, pitch, loops and gapless intro-to-loop playlists, and sends the mix to the default output device. In a ui app on iOS and Android it plays through the system (RemoteIO, AAudio) and decodes MP3, AAC and FLAC with the system's codecs.

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

Install

eskiuc add audio --git https://github.com/eskiu-packages/audio --rev v0.4.1
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-packages/font --rev v0.1.1
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-packages/jni --rev v0.1.1
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);
}

quickjs

JavaScript for Eskiu programs, over QuickJS.

Embeds QuickJS, the engine rquickjs 0.6.2 bundles with the same patches, for games and tools that keep their logic in JavaScript. ES modules with top-level await, values both ways (JSON and typed arrays included), Eskiu closures as JavaScript functions, errors as a Result with their file, line and column, and memory, stack and time limits.

Nothing to install: the first build downloads the prebuilt QuickJS library for macOS, Linux, Windows, iOS or Android. Eskiu 0.15 or newer.

Install

eskiuc add quickjs --git https://github.com/eskiu-packages/quickjs --rev v0.1.1
eskiuc build
Example from the README
import <io>;
import <quickjs>;

struct Player { double x; }

Result<int, string> boot(*Player p) {
    *JsRuntime rt = js_runtime()?;
    defer rt.release();
    rt.set_fs_loader("scripts");          // "./a.js" from the importer, "lib/b.js" from scripts/
    JsContext ctx = rt.context()?;
    defer ctx.release();

    JsValue engine = ctx.object();
    engine.set_fn("setX", 1, JsValue(*JsContext c, *JsArgs a) {
        p.x = a.num(0);
        return c.undefined();
    });
    engine.set_fn("log", 1, JsValue(*JsContext c, *JsArgs a) {
        printf("%s\n", a.str(0));
        return c.undefined();
    });
    ctx.set_global("engine", engine);

    JsValue ns = ctx.eval_file("scripts/main.js")?;
    defer ns.free();
    JsValue booted = ctx.call_global_opt("onBoot", null, 0)?;
    booted.free();
    JsValue dt = ctx.num(1.0 / 60.0);
    for (frame in 0..600) {
        JsValue r = ctx.call_global("onUpdate", &dt, 1)?;
        r.free();
    }
    return Ok<int, string>(0);
}

nds

Nintendo DS file formats for Eskiu: ROMs, NARC archives, sound, 2D graphics, 3D models and particles, and game text.

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. NSBMD models and their joint, texture and material animations convert to glTF 2.0, checked against apicula on 3,410 models, and SPL particle archives to an open JSON format. 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-packages/nds --rev v0.3.1
Example from the README
import <nds/sdat>;
import <nds/wav>;

Result<int, string> run() {
    Sdat s = Sdat_open("sound_data.sdat")?;
    defer s.close();
    Pcm16 pcm;
    s.render_name("SEQ_BGM_FIELD", 30.0, &pcm)?;   // stops at the song's loop point
    defer pcm.free();
    pcm.write_wav("field.wav")?;
    return Ok<int, string>(0);
}

location

Where the device is, for apps on eskiu-packages/ui.

A component calls use_location and gets the latest position while it is mounted, measured by the platform's own service: CoreLocation on iOS, LocationManager on Android and the browser's geolocation on the web. The first use asks for permission, and the package brings the framework, the usage text and the Android permissions through its ui.toml.

An app made with eskiu-packages/ui (ui new).

Install

ui new myapp && cd myapp
eskiuc add location --git https://github.com/eskiu-packages/ui-location --rev v0.1.7
ui run ios
Example from the README
import <location>;

void Here() {
    Location here = use_location(true);
    if (here.status == LocationReady) {
        String text;
        defer String_free(&text);
        String_format(&text, "%.5f, %.5f (± %.0f m)", here.latitude, here.longitude, here.accuracy);
        Text(text.data);
    } else if (here.status == LocationDenied) {
        Text("Allow the location in Settings");
    } else {
        ActivityIndicator(Style{}, true);
    }
}

notifications

Local notifications for apps on eskiu-packages/ui.

The app schedules a notification with a title and a body for a number of seconds from now; the system shows it then, also when the app is closed, and tells the app when the user opens it. UNUserNotificationCenter on iOS, AlarmManager and NotificationManager on Android, the Notification API on the web.

An app made with eskiu-packages/ui (ui new).

Install

ui new myapp && cd myapp
eskiuc add notifications --git https://github.com/eskiu-packages/ui-notifications --rev v0.1.7
ui run android
Example from the README
import <ui/kit>;
import <notifications>;

void Tea() {
    Column(Style{padding: 20, gap: 12}) {
        int permission = use_notification_permission();
        use_notification_opened(void(string id) { kit_toast("Your tea is ready"); });
        if (permission != NotificationsAllowed) {
            Button("Allow notifications") { notifications_ask(); }
        }
        Button("Remind me in four minutes") {
            notification_schedule("tea", "Tea is ready", "Take the leaves out.", 240);
        }
    }
}

camera

Photos for apps on eskiu-packages/ui: the library, the camera and a live view.

Pick a photo from the library, take one with the system's camera, or show the camera live in a CameraView and capture it. Each photo comes back upright as a JPEG that Image shows. PHPicker and AVFoundation on iOS, the photo picker and Camera2 on Android, a file input and getUserMedia on the web. use_camera_frames lends each live frame to Eskiu by pointer (YUV planes, newest frame wins) for vision code or for <gpu/yuv> to draw.

An app made with eskiu-packages/ui (ui new).

Install

ui new myapp && cd myapp
eskiuc add camera --git https://github.com/eskiu-packages/ui-camera --rev v0.3.0
ui run android
Example from the README
import <camera>;

List<String> photos;

void Shoot() {
    Column(Style{padding: 20, gap: 12}) {
        use_photos(void(Photo photo) {
            if (photo.status != PhotoReady) { return; }
            String path;
            String_from(&path, photo.path);   // borrowed for the call: keep a copy
            photos.push(path);
        });
        CameraView(Style{height: 360, radius: 20}, false);
        Button("Take a photo") { camera_capture(); }
        Button("Choose from the library") { camera_pick_photo(); }
    }
}

video

Video playback for apps on eskiu-packages/ui, with the decoded frames in Eskiu.

use_video plays files, URLs and app assets with the platform's own player (AVPlayer on iOS, MediaPlayer on Android, the video element on the web), VideoView shows it, and use_video_frames lends the decoded frames to Eskiu in the same layout as the camera's, for <gpu/yuv> to draw.

An app made with eskiu-packages/ui (ui new).

Install

ui new myapp && cd myapp
eskiuc add video --git https://github.com/eskiu-packages/video --rev v0.1.4
ui run ios
Example from the README
import <video>;

void Clip() {
    *VideoPlayer player = use_video("intro.mp4", VideoOptions{autoplay: true, loop: true});
    use_video_frames(player, VideoFrameOptions{max_width: 640}, void(*VideoFrame frame) {
        // Borrowed for this call: upload it (<gpu/yuv>), convert it or copy it.
    });
    Column(Style{padding: 20, gap: 12}) {
        VideoView(Style{height: 220}, player, VideoContain);
        Button(player.status() == VideoPlaying ? "Pause" : "Play") {
            if (player.status() == VideoPlaying) { player.pause(); } else { player.play(); }
        }
    }
}

ar

Augmented reality for apps on eskiu-packages/ui: ARKit on iOS, ARCore on Android, WebXR on the web.

use_ar_session (<ar/ui>) gives each frame's camera pose, planes, anchors, hit tests, image targets, light and depth, and the camera image in the same layout as the camera's frames, so <gpu/yuv> draws the background and scene the content. ARCore runs with no OpenGL context, the projection is computed in Eskiu the same way on every platform, and in Chrome on Android a WebXR session gives the same data.

An app made with eskiu-packages/ui (ui new), on a phone with ARKit or ARCore.

Install

ui new myapp && cd myapp
eskiuc add ar --git https://github.com/eskiu-packages/ar --rev v0.2.4
ui run ios
Example from the README
import <ar>;

bool tapped;          // set by a tap at (tap_x, tap_y) in the 390 x 844 view
float tap_x;
float tap_y;

void World() {
    use_ar_session(ArOptions{horizontal: true}, void(*ArFrame frame) {
        // Borrowed for this call. Draw frame.image with <gpu/yuv>, then the world with:
        ArMat4 view = frame.view();
        ArMat4 projection = frame.projection(390.0, 844.0, 0.05, 100.0);
        ArHit[1] hit;
        if (tapped && frame.hit_test(tap_x, tap_y, 390.0, 844.0, AR_HIT_PLANES, &hit[0], 1) > 0) {
            ar_anchor_add_hit(&hit[0]);
            tapped = false;
        }
    });
}

arscene

Augmented reality on scene: the camera, occlusion, placement and image markers.

ArStage puts each AR frame into a scene: the camera picture behind it, the device as the camera with the session's projection, and the real world's depth hiding virtual content. ArPlacer places content where the user taps (ViroARPlaneSelector), ArMarkers follows tracked images and ArWorldMesh turns the LiDAR mesh into occluders and physics bodies.

An app made with eskiu-packages/ui (ui new), on a phone with ARKit or ARCore; it brings ar and scene.

Install

ui new myapp && cd myapp
eskiuc add arscene --git https://github.com/eskiu-packages/arscene --rev v0.1.5
ui run ios
Example from the README
ArStage stage = ar_stage(&scene, cam)?;
ArPlacer placer = ar_placer(&scene, content)?;
placer.scale = 0.2;
use_ar_session(ArOptions{horizontal: true, depth: true, people: true}, void(*ArFrame frame) {
    stage.frame(&scene, frame, width, height)?;
    placer.frame(&scene, frame, (float)width, (float)height)?;
    if (tapped) placer.tap(&scene, frame, tap_x, tap_y, (float)width, (float)height);
    scene.render(view, width, height, format)?;
});

canvas

A 2D canvas for Eskiu, in a ui app (the GPU on phones, Canvas 2D on the web) or offscreen.

Sprites and pixel art drawn every display frame in a CanvasView: atlas cells into rects with nearest or linear sampling, opacity, a tint, mirroring and a transform stack, batched into one draw call per image. WebGPU through gpu on iOS and Android, the browser's Canvas 2D on the web; PNG, JPEG and, on phones, WebP.

An app made with eskiu-packages/ui (ui new); the first build downloads wgpu-native.

Install

ui new myapp && cd myapp
eskiuc add canvas --git https://github.com/eskiu-packages/ui-canvas --rev v0.1.5
ui run ios
Example from the README
import <ui>;
import <canvas>;
import <canvas/ui>;

void Game() {
    *Signal<bool> playing = use_signal<bool>(true);
    CanvasView(Style{grow: 1}, playing.get(), void(*Canvas canvas, Tick tick) {
        world_step(&world, tick.delta);
        canvas.fill_rect(CanvasRect{0, 0, canvas.width(), canvas.height()}, 0x14182aff);
        canvas.draw_image_rect(&atlas, CanvasRect{16, 0, 16, 16}, CanvasRect{x, y, 64, 64}, Paint{nearest: true});
    });
}

svg

Vector drawings from SVG text, for Eskiu ui apps.

Svg draws an SVG document scaled to its box: paths with every command and arcs, the basic shapes, groups, transforms, fill and stroke, and currentColor from the style, so one icon takes any tint. The document is parsed in Eskiu; Core Graphics, Android's Canvas or the browser draws it.

An app made with eskiu-packages/ui (ui new).

Install

ui new myapp && cd myapp
eskiuc add svg --git https://github.com/eskiu-packages/ui-svg --rev v0.1.4
ui run web
Example from the README
import <ui>;
import <svg>;

const string kHeart = "<svg viewBox=\"0 0 24 24\"><path fill=\"currentColor\" d=\"M12 21 3 12a5 5 0 0 1 9-7 5 5 0 0 1 9 7z\"/></svg>";

void Like(bool liked) {
    Svg(Style{width: 24, height: 24, color: liked ? rgb(230, 57, 70) : rgb(140, 140, 140)}, kHeart);
}

pedometer

Steps walked, live and between two times, for Eskiu ui apps on iOS and Android.

use_steps counts the steps walked while the component is mounted and use_steps_between the ones between two times, also those walked with the app closed. CMPedometer on iOS; on Android the step counter sensor, with the samples the package keeps to answer for past times.

An app made with eskiu-packages/ui (ui new), on a device.

Install

ui new myapp && cd myapp
eskiuc add pedometer --git https://github.com/eskiu-packages/ui-pedometer --rev v0.1.5
ui run ios
Example from the README
import <ui>;
import <pedometer>;

void Walk() {
    Steps now = use_steps();                          // since this mounted, live
    Steps today = use_steps_between(midnight, now_ms); // the app open or not
    if (today.status == StepsReady) { ... today.steps ... }
}

barcode

QR codes and barcodes read live from the camera, for Eskiu ui apps.

A BarcodeScanner shows the back camera and hands each code it reads to its handler: QR, Aztec, Data Matrix, PDF417 and the 1D formats. AVFoundation on iOS, ML Kit bundled with the app on Android, the browser's BarcodeDetector on the web.

An app made with eskiu-packages/ui (ui new), on a device with a camera.

Install

ui new myapp && cd myapp
eskiuc add barcode --git https://github.com/eskiu-packages/ui-barcode --rev v0.1.5
ui run android
Example from the README
import <ui>;
import <barcode>;

void Scan() {
    *StringState found = use_string("");
    BarcodeScanner(Style{grow: 1}, "qr", found.get()[0] == 0, void(Barcode code) {
        if (code.status == ScanCode) { found.set(code.value); }
    });
}

securestore

Small secrets kept by the platform's secure storage, for Eskiu ui apps.

secure_set, secure_get and secure_remove keep a session token or a key: in the Keychain on iOS, encrypted with a key of the Android Keystore on Android, and in localStorage on the web, which has no secure store (secure_is_secure says so).

An app made with eskiu-packages/ui (ui new).

Install

ui new myapp && cd myapp
eskiuc add securestore --git https://github.com/eskiu-packages/ui-securestore --rev v0.2.0
ui run ios
Example from the README
import <securestore>;

secure_set("session", token);
string saved = secure_get("session");   // null when there is none; free it
defer free(saved);
secure_remove("session");

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

From the index

Packages published by their own maintainers. They are not reviewed by the Eskiu project: read a package before you depend on it.

ui

v0.8.0github.com/eskiu-packages/uieskiu-packagesMIT

Native apps from one Eskiu codebase for iOS, Android, the web and the desktop

eskiuc add ui --git https://github.com/eskiu-packages/ui --rev v0.8.0

Publishing a package

Make a public git repository with an eskiu.toml (eskiuc new NAME writes one), tag a release (v0.1.0), and open a pull request on eskiu-lang/index that adds packages/NAME.toml with its name, repository, a one-line description and its license. Its README has the rules.

Every package needs Eskiu 0.13 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 and run your first program.