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 are typed and resumable, so you can express async behavior and host interactions without sacrificing safety.

  • Effect rows make side effects visible in signatures.
  • Handle effects locally with `try` clauses.
  • Keep pure APIs pure and explicit.
eff Async
  await(tail) -> i32
  resolve(resume, value: i32) -> void
  reject(resume, msg: String) -> void

fn load_count(): Async -> i32
  let value = Async::await()
  if value > 0:
    Async::resolve(value)
  else:
    Async::reject("Expected positive count")

fn main(): () -> i32
  try
    load_count()
  await(tail):
    tail(42)
  resolve(resume, value):
    value
  reject(resume, msg):
    0

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.
import { createSdk } from "@voyd/sdk";

const sdk = createSdk();
const result = await sdk.compile({
  entryPath: "./src/pkg.voyd",
  includeTests: true,
});

if (result.success && result.tests) {
  const summary = await result.tests.run({
    reporter: {
      onEvent(event) {
        if (event.type === "test:result") {
          console.log(event.result.displayName, event.result.status);
        }
      },
    },
  });

  console.log(summary);
}

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.
import { writeFile } from "node:fs/promises";
import { generateDocumentation } from "@voyd/sdk/doc-generation";

const { content } = await generateDocumentation({
  entryPath: "./packages/std/src/pkg.voyd",
  format: "html",
});

await writeFile("./build/std-docs.html", content);

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.