v0.1 · pre-release · built in Rust

Strictly typed.
Natively compiled.
Zero JavaScript baggage.

TypeX is an experimental language that feels like TypeScript, thinks like Rust, and ships as a single native binary. No undefined, no implicit coercion, no exceptions — just results.

$ cargo install --path crates/typex_cli && tx run examples/kitchen_sink.tx
hello.tx.tx
1function main(argv: Array): int {
2 println("Hello from TypeX!");
3 
4 for (let {index, value} in argv) {
5 println("[{index}]: {value}");
6 }
7 
8 return 0;
9}
// design_philosophy

Six ideas at the core

01·

Strict by default

No implicit coercion. No loose equality. No undefined. If a value can be null, its type says so.

02·

Familiar syntax

TypeScript-shaped functions, types, imports, arrays, records and arrow functions. Read it and you already know it.

03·

Rust-inspired safety

Result, match, panic, enums. Errors are values, not exceptions thrown across your call stack.

04·

Native-first tooling

Run scripts instantly with tx run, or ship a single native binary with tx build. Same source, both paths.

05·

Unicode-aware strings

UTF-8 everywhere. No unsafe index access — iterate by scalar or byte offset, always explicit.

06·

Small core, richer later

v1 is safe scripting. v2 adds async and OOP. v3 goes systems. v4 self-hosts.

// syntax_tour

Boring where it should be. Strict where it matters.

A quick look at how TypeX handles errors, iteration and types.

◆ example A

Errors as values

Result and match replace throw/catch. The compiler makes you deal with the failure path.

divide.tx.tx
1function divide(n: int, d: int): Result {
2 if (d == 0) {
3 return Err("Cannot divide by zero!");
4 }
5 
6 return Ok(n / d);
7}
8 
9match divide(10, 2) {
10 Ok(r) => println("= {r}"),
11 Err(e) => println("! {e}"),
12};
◆ example B

Iteration with destructuring

Ask for what you want — index, byte offset, value — and only pay for what you use.

iterate.tx.tx
1const message: string = "Hello, λ!";
2 
3for (let {index, offset, value} in message) {
4 println("[{index}] byte {offset}: {value}");
5}
6 
7// only what you need
8for (let {value} in [1, 2, 3]) {
9 println("{value}");
10}
◆ example C

Explicit primitives

Sized integers, real floats, char, string. No mystery Number type.

types.tx.tx
1let active: boolean = true;
2 
3let a: int8 = -12;
4let b: uint8 = 255;
5let c: int32 = 123;
6let d: uint64 = 999;
7let x: float64 = 3.1415926535;
8 
9let ch: char = 'λ';
10let name: string = "Zaphod Beeblebrox";
◆ example D

Nullability is a type

Values are non-nullable by default. Opt into null explicitly with a union — there is no undefined.

nullable.tx.tx
1let name: string = "Arthur";
2let missing: string | null = null;
3 
4function findName(id: uint): string | null {
5 if (id == 42) return "Zaphod";
6 return null;
7}
// roadmap

Small today. Systems tomorrow.

TypeX is early. The plan is deliberately staged — each version has a job.

  1. v1

    Safe native scripting

    Core language, Result-based errors, UTF-8 strings, tx run and tx build.

    in progress
  2. v2

    Async, OOP & tooling

    Async runtime, class/interface story, formatter, linter, test runner, packages.

    planned
  3. v3

    Systems layer

    FFI, explicit resource management, unsafe blocks, low-level memory & control primitives.

    planned
  4. v4

    Self-hosting

    TypeX compiling TypeX. The compiler eats its own dogfood.

    planned
// try_it

Build it. Break it.
Tell them what you found.

TypeX is being vibe-coded in the open. Read the source, run the kitchen sink example, file issues, argue about semantics.