# tsz: a TypeScript compiler written in Rust, built with AI assistants

> tsz aims to be a correct, fast drop-in replacement for tsc, with native and WASM targets, and it measures itself against TypeScript's own conformance suite. The README also warns that it is pre-release software whose diagnostics, inference and emit may differ from TypeScript today.

**tsz-org/tsz** — An experiment in fully hand-off software engineering: A performance-first TypeScript checker

- Repository: https://github.com/tsz-org/tsz
- Website: http://tsz.dev
- Stars: 577 · Forks: 15
- Language: Rust
- License: Apache-2.0
- Published: 2026-10-22 · Updated: 2026-10-22 · Language: en
- Canonical page: https://hysenlabs.com/projects/tsz-org-tsz

## A tsc replacement written in Rust, with the caveat first

The project is introduced in one line: tsz is a performance-first TypeScript compiler in Rust, and the goal is a correct, fast, drop-in replacement for tsc, with both native and WASM targets. The name is a joke, since z is for Zang, which the footnote says is the Persian word for rust.

The second line is about how it was built. tsz is built with the help of AI-assistant coding, and many tools and AI models were used during its development. The repository description calls it an experiment in fully hand-off software engineering.

The warning at the top of the install section is the most important sentence in the README. tsz is pre-release software and not yet a drop-in replacement for tsc. Diagnostics, inference and emit may differ from TypeScript today, and the instruction is to use it for experimentation only.

That warning sits before the install commands rather than at the end of the file, which is the right place for it, and it frames everything else. The project is a serious implementation with a real conformance suite behind it, and it is also explicitly not ready to be trusted with your build.

The primary language is Rust, the licence is Apache-2.0, the default branch is main, and the homepage is http://tsz.dev.

## What the conformance numbers actually cover

The compatibility story is measured rather than asserted, and there are three separate measurements because a compiler has three separate jobs.

The type checker runs the official TypeScript conformance test suite, and the README reports a progress of 96.9 percent, which is 11,667 of 12,043 runnable tests, out of 12,585 candidates with 12,043 runnable, 507 unsupported and 35 skipped.

The emitter results are split in two. JavaScript is at 100.0 percent, 11,562 of 11,563 tests. Declaration emit is at 99.1 percent, 1,377 of 1,390 tests. So the type checker is the part with the visible gap, and the declaration emitter is close behind.

The language service, measured with the fourslash tests, is at 100.0 percent across 6,562 tests. That is the LSP side of the tool, and it is the part that an editor talks to.

The project targets TypeScript 7.0.2, stated in a version marker in the README, and tsz runs TypeScript's own test suite for compatibility across type-checking, code emission and LSP. That is the right way to build confidence in a compiler, and it is also the reason the compatibility numbers can be regenerated rather than argued about.

The remaining question is what the 507 unsupported and 35 skipped tests cover, and the README does not break those down. That is the gap to be aware of when reading a 96.9 percent figure.

## Installing it, and the compatibility check that comes first

Before anything is installed, the README tells you how to find out whether tsz currently matches tsc on your project.

```bash
npx try-tsz
```

That is a sensible ordering, because the alternative is discovering the mismatch halfway through a build. The command runs the comparison against your own code rather than a sample, which is the only check that tells you something useful.

The install itself is a script, one per platform family.

```bash
curl -fsSL https://tsz.dev/install | sh
```

On Windows under PowerShell the equivalent is a one-liner that fetches the ps1 script and runs it.

```bash
irm https://tsz.dev/install.ps1 | iex
```

Note that the documentation does not describe a package manager install, a cargo install path or a binary release archive. The install route is the script, and the releases in the repository are versioned tags such as v0.1.75 rather than a published crate. That is a real constraint for anyone whose environment policy forbids piping a script into a shell.

The performance claim is stated with a comparison point. tsz is aiming to be 2x faster than tsgo on all benchmarks, and it is 3x faster in small file samples, with work on larger projects underway. The word aiming is doing the work there, and the benchmark results are published on the project site rather than in the repository.

## The crate layout follows the compiler's own pipeline

The workspace is a Cargo workspace whose members are the crates directory, and the internal crate names map closely onto the stages of a compiler front end, which is the clearest sign of how the project is organised.

The shared packages are tsz-core, tsz-common, tsz-scanner, tsz-parser, tsz-binder, tsz-solver, tsz-lowering, tsz-checker, tsz-emitter and tsz-lsp. Reading the list in order, it is the pipeline itself: scanning the source text, parsing it, binding names, solving types, lowering, checking, emitting, and serving the language server. The emitter carries default-features = false, which is the sort of detail that only matters if the emitter is optional.

The external dependency list is the other half of the picture and it is recognisably a compiler's dependency set. anyhow for error handling, clap with derive for the command line, bitflags for option sets, colored and console_error_panic_hook for terminal output and panic reporting, criterion for benchmarks, bincode and serde for serialisation, dashmap and fixedbitset for concurrent maps and bitsets, globset for pattern matching, memchr for fast searching, once_cell for lazy statics, rayon for data parallelism, regex, rustc-hash for fast hashing, and notify with crossbeam-channel and macos_kqueue features for file watching.

The workspace uses edition 2024 with resolver 3, and version 0.1.75 across the internal crates, which is how a monorepo of a dozen crates keeps a single version number. The repository also vendors its dependencies, has a deny.toml, and ships an AGENTS.md along with .claude, .codex and .agents directories, so the AI-assisted development claim is visible in the tree as well as in the README.

## Why the conformance suite is the whole argument

The interesting design decision in this project is not any single crate but what the project chose to be measured against.

Writing a TypeScript compiler is not hard in principle. It is hard in the sense that the type system has thousands of behaviours, and any implementation that diverges from tsc on even a small fraction of them produces errors in real code. A compiler that type-checks 96.9 percent of the official conformance suite can still fail on code you care about, and can also produce diagnostics that differ in wording, ordering or whether they appear at all.

Running TypeScript's own suite, rather than a hand-written set of examples, is the correct approach, and it makes the compatibility claim falsifiable. The numbers in the README are generated and marked with comment anchors between PERFORMANCE_START and END, CONFORMANCE_START and END, EMIT and FOURSLASH markers, which means they are refreshed by tooling as the code changes rather than typed by hand.

The alternative approach would have been a small self-contained subset, where a project picks a set of TypeScript features, implements them and demonstrates speed on a synthetic benchmark. That produces a much faster project and a much less useful one, because there is no way to know where the gaps are. The cost of this approach is that the suite is large, the percentages move slowly, and the 507 unsupported tests are an opaque remainder.

The honest summary is that tsz has a measurement apparatus rather than a claim, and the warning at the top of the README is the correct summary of where it stands: the measurements are good, and the tool is not yet ready to be trusted with a real build.

## Conclusion

Adopt tsz if you want to try a Rust TypeScript compiler on a side project or a benchmark of your own, since the conformance numbers make it a reasonable thing to measure. Do not adopt it to replace tsc in a production build, because the README states plainly that diagnostics, inference and emit may differ from TypeScript today and that it is for experimentation only. Before you try it, run npx try-tsz on your own project, and note the last push was on 2026-10-15 with release v0.1.75 from 2026-08-19.

## FAQ

### What is tsz and what is it trying to be?

tsz is a performance-first TypeScript compiler written in Rust, aiming to be a correct, fast drop-in replacement for tsc with both native and WASM targets. The README warns that it is pre-release software for experimentation only, and that diagnostics, inference and emit may differ from TypeScript today.

### How does tsz measure its TypeScript compatibility?

It runs TypeScript's own test suite. The type checker passes 11,667 of 12,043 runnable conformance tests, JavaScript emit is at 100.0 percent across 11,563 tests, declaration emit at 99.1 percent across 1,390 tests, and the language service passes all 6,562 fourslash tests.

### How do I install tsz?

On macOS and Linux, curl -fsSL https://tsz.dev/install | sh. On Windows under PowerShell, irm https://tsz.dev/install.ps1 | iex. Before installing, npx try-tsz checks whether tsz currently matches tsc on your own project.

### Which TypeScript version does tsz target?

The README states it is currently targeting TypeScript 7.0.2, and that tsz runs TypeScript's own test suite for compatibility across type-checking, code emission and LSP.

### What performance does tsz claim?

It is aiming to be 2x faster than tsgo on all benchmarks, and is described as 3x faster in small file samples, with work on larger projects underway. The benchmark results are published on the project site at tsz.dev.

## Sources

- [License: Apache-2.0](https://github.com/tsz-org/tsz/blob/main/LICENSE)
- [Project website](http://tsz.dev)
- [README](https://github.com/tsz-org/tsz/blob/main/README.md)
- [Releases](https://github.com/tsz-org/tsz/releases)
- [tsz-org/tsz on GitHub](https://github.com/tsz-org/tsz)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/tsz-org-tsz
