voyd

A high-performance language for full stack web development with a strong type system, typed effects, and first-class runtime embedding.

Designed for full stack web

Ship backend handlers, shared domain logic, and frontend views with one language model and one type system.

  • Compile to WebAssembly for browser, server, edge, and worker runtimes.
  • Keep API contracts and UI model types aligned across the stack.
  • Compose by modules and package exports, not framework magic.
use src::web::routes::all
use src::web::ui::all

pub fn main() -> void
  let app = WebApp::new()
  app.route("GET", "/", handler: render_home)
  app.route("GET", "/api/projects", handler: list_projects)
  app.listen(port: 8080)

fn Home() -> Html
  // Built in html support
  <div>
    <h1>Hello, World></h1>
    <p>Welcome to voyd.</p>
  </div>

Strong type system

Nominal and structural constraints, generics, and compile-time effect checking keep large systems predictable.

  • Use constrained generics to codify invariants early.
  • Model precise APIs with traits, objects, and type aliases.
  • Catch mismatch errors before runtime.
trait Persistable
  fn id(self) -> String

obj Repo<T: Persistable> {
  items: Array<T>
}

impl<T: Persistable> Repo<T>
  fn upsert(~self, value: T) -> void
    self.items = self.items.filter(item => item.id() != value.id())
    self.items.push(value)

Elegant syntax

Readable defaults, labeled parameters, UFCS, and overloads help code stay expressive without losing precision.

  • Write APIs that read like intent, not plumbing.
  • Overload where semantics match; keep names stable.
  • Use UFCS for composable data transforms.
fn add(a: i32, b: i32) = a + b
fn add(a: f64, b: f64) = a + b

fn move({ from: Vec, to destination: Vec })
  send_move_instruction(from, destination)

let point = Vec { x: 1, y: 2 }
let moved = point.add(Vec { x: 3, y: 5 })
move(from: point, to: moved)

Effects

Effects make required capabilities explicit, so domain logic can stay portable while hosts provide concrete behavior.

  • Effect rows make required capabilities visible in signatures.
  • Handle capabilities at the boundary with `try` clauses.
  • Keep domain logic decoupled from the host.
eff Confirm
  ask(tail, message: String) -> bool

fn delete_project(name: String): Confirm -> String
  if Confirm::ask("Delete ${name}}?"):
    "Deleted ${name}"
  else:
    "Kept ${name}"

fn main(): () -> String
  try
    delete_project("staging-dashboard")
  ask(tail, message):
    tail(true)

Embeddable

Use Voyd as a runtime for product extensions, sandboxed plugins, or AI-generated routines while keeping host control.

  • Compile in-process with the SDK.
  • Inject module files at runtime for plugin scenarios.
  • Execute safely through host-boundary handlers.
// This is a JS file.
import { compile } from "@voyd/sdk/browser";

const source = `use src::plugin::all

pub fn main() -> i32
  plugin_score()`;

const files = {
  "plugin.voyd": "pub fn plugin_score() -> i32\n  99\n",
};

const result = await compile(source, { files });
if (!result.success) throw new Error("Plugin compile failed");

const bytes = result.module.emitBinary();
console.log("Plugin wasm size", bytes.length);

Built-in tooling

Production-ready workflow support

Voyd includes native support for tests, docs, and runtime integration, so teams can standardize on one language and one toolchain.

Built-in test reporter

Test discovery, execution, events, and summaries are first-class in the SDK and CLI.

  • Emit structured events for CI dashboards.
  • Support skip/only and per-test diagnostics.
  • Run isolated tests or shared-runtime suites.
 voyd test

PASS src::set::set insert contains remove clear
PASS src::set::set values returns iterable keys
PASS src::string_bytes_iterator.test::string to_utf8 iterates utf8 bytes
PASS src::time::system_time unix_millis is pure
PASS src::time::sleep decodes host errors
PASS src::time::on_timeout invokes callback on success
PASS src::time::on_timeout decodes host errors and skips callback
PASS src::time::on_interval repeats callbacks and surfaces host errors
PASS src::time::on_interval clears timer when sleep fails
PASS src::traits::contracts.test::trait contracts work for baseline std traits

passed 210, failed 0, skipped 0 (210 total)

Built-in doc generator

Generate HTML or JSON API docs directly from source declarations. This powers std docs generation.

  • Derive docs from real declarations and signatures.
  • Produce HTML for websites or JSON for custom pipelines.
  • Reuse in CI to keep docs and code in lockstep.
 voyd doc --out project_docs.html

Wasm-first pipeline

Parser, semantics, and codegen are designed around a stable codegen-view boundary.

VSCode extension

Edit Voyd with focused IDE tooling for day-to-day language workflows. Supports refactoring, auto imports, error highlighting and more.

Open extension

Public SDK targets

Use one SDK across Node, browser, and Deno with aligned compile/run/test flows.

Host boundary protocol

Typed effect/continuation boundaries make embedding safe and deterministic.

Companion test modules

Include tests in selected module scopes without polluting production bundles.

Maintainable architecture

Monorepo packages separate compiler internals, runtime, SDK, and product surfaces.