Tsonic manual
Tsonic compiles TypeScript into native source projects. The manual starts with a complete program, then explains the few choices that affect what gets built.
Start here
- Build your first program.
- Learn how projects and configuration work.
- Choose between an application and a library.
- Organize packages and workspaces.
- Build, test, and deploy with the native toolchain.
Then read the parts that apply to your code:
- Compiler model
- Source semantics
- Surfaces and capabilities
- C# target
- Rust target
- Mojo target
- Troubleshooting
The reference contains exact option, marker, API, and limitation contracts.
Most TypeScript needs no Tsonic-specific syntax:
export function greet(name: string): string {
return `Hello, ${name}`;
}
Use a marker only when ordinary TypeScript cannot state an important native distinction, such as an exact integer width, a writable location, a native pointer, or a Rust lifetime.