TypeScript to .NET. Rust. Mojo.
Tsonic checks TypeScript, writes native source projects, and hands them to
dotnet, Cargo or Mojo.
Coming soon Python and Triton
Examples
Loading examples
Downloading source and generated files
Compilation flow
One checked TypeScript program becomes a native source project. The native toolchain performs the final build.
Read the compiler model-
01Write TypeScript
src/App.tsexport function add(left: number, right: number): number { return left + right; } -
02Generate sourceC#
double add(double left, double right)Rustfn add(left: f64, right: f64) -> f64Mojodef add(left: Float64, right: Float64) -> Float64 -
03Build natively
dotnet build out/csharpcargo build --manifest-path out/rust/Cargo.tomlpixi run --manifest-path out/mojo/pixi.toml build
Documentation