Skip to content

ZynxA general-purpose language with explicit ownership.

Explicit ownership, visible errors, and cold async compiled to native code through LLVM.

Zynx

First Program

Fallible behavior is visible from the first program. read_id declares the errors it can raise, and the caller chooses whether to propagate with try or recover with a catch arm per variant.

Zynx
import std.io;
import std.mem.{ AllocError };

error LoadError {
  NotFound,
  Denied,
}

fn read_id(fail: bool) throws(LoadError) -> i32 {
  if fail {
    throw LoadError.NotFound;
  }
  return 42;
}

fn main() throws(AllocError) {
  let id = read_id(false) catch {
    .NotFound => 0,
    .Denied => -1,
  };

  io.println(try ^"id={id}");
}

Choose A Document

Development Snapshot

Zynx is development software. Public pages describe implemented and documented behavior. Prefer the language chapters when a feature guide and current compiler behavior disagree.

Released under the MIT License.