TOOLS & PROJECT

Release notes

Explore the implemented additions in Ryft 0.3.

Ryft compiles checked .rz source to native code through Rust and Cargo. This release adds enums, exhaustive matching, inferred generic functions, typed containers, value methods, strict JSON codecs, module visibility, local dependency locks, lifecycle hooks, transactions and MongoDB. It is a working preview, with Windows Server qualification still pending.

Typed values

enum Status { todo, done }
enum Message { Text(String), Count(i64) }
struct Task { title: String; status: Status; }
fn identity<T>(value: T) -> T { return value; }
impl Task {
    fn valid(self: Task) -> bool { return len(trim(self.title)) > 0; }
}
test codecs {
    let task = Task { title: "Ship", status: Status.todo };
    assert(task.valid());
    match Task.from_json(task.to_json()) {
        Ok(decoded) => { assert(decoded.title == "Ship"); },
        Err(message) => { assert(false); }
    }
}

Result<T,E> and Option<T> require exhaustive match. parse_i64 and parse_json return results. List<T>.new(), list_push, list_at, Map<String,T>.new(), map_put and map_get provide typed collections. list(...) infers a nonempty homogeneous list. Index/key lookup returns Option<T>. Generic function arguments are inferred, and repeated parameters must agree; generated values require cloning. User-defined generic structs and trait constraints are not implemented.

Methods take owned values. Mutating a local field requires let mut; receiver methods do not implement borrowed in-place mutation. Struct codecs reject unknown or missing fields and invalid types. Optional fields must be present with a value or null. Unit enums encode as strings; payload variants encode as {"variant":"Text","value":"hello"}. See runnable features.

Modules and projects

Use import "math.rz" as math; and math::double(2). Aliased imports expose only pub fn, pub struct, pub enum, exported methods and public reexports. Unaliased imports retain the earlier shared namespace for compatibility. HTTP apps cannot be imported as aliased libraries. See module examples.

[project]
name = "service"
entry = "main.rz"
[dependencies]
common = { path = "../common" }

import "@common/math.rz" as math; resolves declared local dependencies. Run ryft lock to write dependency content hashes to ryft.lock; checks and builds reject changes until the lock is refreshed. Omitting a source selects the nearest manifest’s entry, otherwise main.rz. There is no remote registry or remote package installation.

Server lifecycle and storage

Apps can declare startup { ... }, shutdown { ... } and before { ... }. Startup runs after storage initialization and before readiness; shutdown runs after graceful drain. Crashes and forced termination cannot run shutdown hooks. Hooks cannot use request APIs, including through helper functions. A before block is copied into each route, so any early return must match that route’s return type.

SQLite db_transaction(db, [{"sql":"INSERT INTO t VALUES (?)","params":[1]}]) commits all steps or rolls back. SQL templates must be literal; authorizer restrictions remain active inside transactions. Mongo storage is declared as storage db: mongodb("MONGODB_URI", "database"); and requires permit env "MONGODB_URI";. Collection names must be literal. mongo_ping, mongo_find, mongo_insert, mongo_update, mongo_delete, mongo_index, mongo_drop and mongo_transaction return JSON result envelopes. The drop operation deletes a whole declared collection; application routes should not expose it to ordinary clients.

Mongo transaction steps use collection, operation (insert, update, delete), plus document or filter/update. A batch owns a driver session. Unknown commit outcomes return uncertain: true after bounded commit retries and require reconciliation before retrying the batch. The runtime does not automatically replay an entire transaction. Transactions require a compatible MongoDB deployment. Find operations, pool size and write concerns are bounded; synchronous driver operations are not forcibly cancelled by an HTTP deadline.

Operations and editor

request_path, request_method, request_id and response_header support shared request logic and headers. The runtime assigns request IDs and emits JSON access logs without query strings, bodies or credentials. /_ryft/metrics exports Prometheus counters. Keep diagnostics and control endpoints on a trusted network. POST /_ryft/shutdown requires x-ryft-control-token matching a parent RYFT_CONTROL_TOKEN of at least 32 characters; workers use a separate private token.

Native servers support --env-file FILE, --log-file FILE and Windows --service NAME, alongside --isolate. Environment files are literal data with an allowlist of declared capabilities. Service integration and installer scripts are implemented but have not been qualified under Windows Server SCM.

The local VS Code 0.3 extension bundles the compiler, highlights new syntax and watches source/manifests/locks. Checked projects support semantic navigation, references, scoped rename, hover and signature help. Rename rechecks the edited project and refuses unsafe changes. Type annotation references and incomplete-call signature recovery remain limited. No source-level Ryft debugger is supplied; --emit-rust provides generated Rust for inspection. The extension has not been published to the Marketplace.

Release limits

This release has not passed clean Windows Server 2022/2025 installation, service recovery, sustained load, independent security review or compatibility qualification. It does not include a remote registry, user-defined generic types/traits, source-level debugger, PostgreSQL driver or application user accounts. Follow production readiness before a production deployment.

Ryft 0.3.0Source: docs/ryft-0.3.md

Search installation, types, routes, storage and more.