ɛ∞ɜɛ∞ɜ

AyeYaiYai

AyeYaiYai is a Rust compiler that translates a growing subset of JavaScript directly into a Preview 2 .wasm.

The repository now contains a real end-to-end baseline:

Status

This is not close to full JavaScript yet, and it is nowhere near test262 compliance. The current compiler is intentionally narrow, but it is real and executable.

Supported today:

Not supported yet:

Usage

Build the compiler:

cargo build

Compile JavaScript to WASI Preview 2:

cargo run -- examples/sum.js -o sum.wasm
wasmtime sum.wasm
cargo run -- examples/control-flow.js -o control-flow.wasm
wasmtime control-flow.wasm
cargo run -- examples/objects.js -o objects.wasm
wasmtime objects.wasm

Inspect direct backend output bytes or run the resulting module:

cargo run -- examples/sum.js -o sum.wasm
hexdump -C sum.wasm

Example

function sumTo(limit) {
  let total = 0;

  for (let i = 0; i <= limit; i++) {
    if (i === 2) {
      continue;
    }

    if (i === 5) {
      break;
    }

    total += i;
  }

  return total;
}

let label = false ? "bad" : "good";
console.log(label, sumTo(10), undefined ?? "fallback");

Development

The current tests include an end-to-end integration path that compiles JavaScript, emits a Preview 2 WebAssembly component, and executes it with wasmtime:

cargo test

Run the full test262 sweep from the repository root with:

./test262.sh

You can also target high-level test262 categories directly:

./test262.sh --category language
./test262.sh --category built-ins
./test262.sh --category intl402

The wrapper will:

At the end of the run it prints a compliance line based on discovered tests:

Compliance: <passed%> (<passed> / <discovered> discovered tests passed)
Attempt rate: <attempted%> (<attempted> / <discovered> discovered tests executed)

The full runner log is written to ./.artifacts/test262/latest.log.

Useful examples:

# Full corpus
./test262.sh

# Run a specific top-level category
./test262.sh --category language

# Run multiple categories in one sweep
./test262.sh --category language --category built-ins

# Narrow to a subtree while keeping the same reporting format
./test262.sh --contains 'test/language/statements/'

# Run a smaller sample
./test262.sh --category language --contains 'test/language/statements/with/' --limit 40

# Show the available wrapper categories
./test262.sh --list-categories

AyeYaiYai is part of Millillion: impossibly ambitious, open-source software built with AI.

View on GitHubSupport Millillion