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.
1function main(argv: Array): int {2println("Hello from TypeX!");34for (let {index, value} in argv) {5println("[{index}]: {value}");6}78return 0;9}
No implicit coercion. No loose equality. No undefined. If a value can be null, its type says so.
TypeScript-shaped functions, types, imports, arrays, records and arrow functions. Read it and you already know it.
Result, match, panic, enums. Errors are values, not exceptions thrown across your call stack.
Run scripts instantly with tx run, or ship a single native binary with tx build. Same source, both paths.
UTF-8 everywhere. No unsafe index access — iterate by scalar or byte offset, always explicit.
v1 is safe scripting. v2 adds async and OOP. v3 goes systems. v4 self-hosts.
A quick look at how TypeX handles errors, iteration and types.
Result and match replace throw/catch. The compiler makes you deal with the failure path.
1function divide(n: int, d: int): Result {2if (d == 0) {3return Err("Cannot divide by zero!");4}56return Ok(n / d);7}89match divide(10, 2) {10Ok(r) => println("= {r}"),11Err(e) => println("! {e}"),12};
Ask for what you want — index, byte offset, value — and only pay for what you use.
1const message: string = "Hello, λ!";23for (let {index, offset, value} in message) {4println("[{index}] byte {offset}: {value}");5}67// only what you need8for (let {value} in [1, 2, 3]) {9println("{value}");10}
Sized integers, real floats, char, string. No mystery Number type.
1let active: boolean = true;23let a: int8 = -12;4let b: uint8 = 255;5let c: int32 = 123;6let d: uint64 = 999;7let x: float64 = 3.1415926535;89let ch: char = 'λ';10let name: string = "Zaphod Beeblebrox";
Values are non-nullable by default. Opt into null explicitly with a union — there is no undefined.
1let name: string = "Arthur";2let missing: string | null = null;34function findName(id: uint): string | null {5if (id == 42) return "Zaphod";6return null;7}
TypeX is early. The plan is deliberately staged — each version has a job.
Core language, Result-based errors, UTF-8 strings, tx run and tx build.
Async runtime, class/interface story, formatter, linter, test runner, packages.
FFI, explicit resource management, unsafe blocks, low-level memory & control primitives.
TypeX compiling TypeX. The compiler eats its own dogfood.
TypeX is being vibe-coded in the open. Read the source, run the kitchen sink example, file issues, argue about semantics.