✨ From vibe coding to vibe deployment. UBOS MCP turns ideas into infra with one message.

Learn more
Andrii Bidochko
  • Updated: January 18, 2026
  • 6 min read

Introducing Tsonic: A TypeScript‑to‑C# Compiler for .NET NativeAOT

Tsonic is a TypeScript‑to‑C# compiler that generates native .NET NativeAOT executables, allowing developers to write TypeScript code and ship fast, self‑contained binaries without a JavaScript runtime.

Tsonic Unveiled: The TypeScript‑to‑C# Compiler Powering Native .NET Applications

Tsonic has quickly become the talk of the developer community because it bridges two of the most popular programming ecosystems—TypeScript and .NET—through a single, streamlined toolchain. By compiling TypeScript directly to C# and then leveraging the .NET NativeAOT pipeline, Tsonic produces single‑file, self‑contained executables that run on Windows, Linux, and macOS with the performance of native code.

For software engineers focused on cross‑language compilation, code conversion, and modern developer tools, Tsonic offers a fresh alternative to traditional transpilers and runtime‑heavy solutions. Its design embraces the familiar TypeScript type system while exposing the full power of the .NET Base Class Library (BCL), making it a compelling choice for both front‑end developers and back‑end engineers.

Read on for a deep dive into Tsonic’s key features, a quick‑start guide, real‑world use cases, and a side‑by‑side comparison with competing tools.

Tsonic architecture diagram
Figure 1: High‑level flow from TypeScript source to a native .NET NativeAOT binary.

Key Features and Benefits

  • TypeScript‑to‑C# compilation: Source files are transformed into idiomatic C# code, preserving classes, interfaces, generics, async/await, and iterators.
  • .NET NativeAOT output: Produces a single, statically linked executable with no external runtime dependencies.
  • Full .NET BCL access: Use System.IO, System.Net, System.Text.Json, and any NuGet package directly from TypeScript.
  • Optional JavaScript/Node APIs: Add ChatGPT and Telegram integration or OpenAI ChatGPT integration when you need familiar JS/Node primitives.
  • Cross‑platform binaries: Build for x64 and ARM64 on Windows, Linux, and macOS from a single codebase.
  • Security and stability: Leverages the mature .NET runtime, receiving regular security patches and performance improvements.

Installation & Quick‑Start Guide

Getting Tsonic up and running takes just a few commands. Below is a step‑by‑step walkthrough for developers familiar with npm and the .NET SDK.

Prerequisites

  • Node.js ≥ 22
  • .NET 10 SDK (download here)
  • On macOS, Xcode Command Line Tools (xcrun --show-sdk-path)

Installation

npm install -g tsonic

Create Your First Project

mkdir my-tsonic-app && cd my-tsonic-app
tsonic project init          # basic project
# or include JS runtime APIs
tsonic project init --js
# or include Node‑style APIs
tsonic project init --nodejs

The command creates a src/App.ts entry point, a tsonic.json configuration file, and a package.json with build scripts.

Build & Run

npm run build   # compiles to native binary
./out/app        # execute the binary

Or combine both steps:

npm run dev

For a taste of .NET interop, try this minimal example:

import { Console } from "@tsonic/dotnet/System.js";

export function main(): void {
  Console.writeLine("Hello from Tsonic!");
}

When you run npm run dev, the console prints “Hello from Tsonic!” confirming the successful bridge between TypeScript and the .NET runtime.

Use Cases and Real‑World Examples

Tsonic’s flexibility makes it suitable for a wide range of scenarios. Below are three representative use cases that illustrate how developers can leverage the compiler.

1. High‑Performance CLI Tools

Many DevOps utilities require fast start‑up times and minimal dependencies. By compiling a TypeScript script to a native binary, you eliminate the need for a Node runtime on target machines. Pair this with Enterprise AI platform by UBOS to embed AI‑driven decision logic directly into the CLI.

2. Serverless Functions on .NET

Serverless platforms such as Azure Functions accept .NET assemblies. With Tsonic, you can author the function in TypeScript, compile to C#, and deploy the resulting DLL. This approach lets front‑end teams contribute to back‑end logic without learning C#.

3. Desktop Applications with Native UI

Combine Tsonic with Web app editor on UBOS to generate a native Windows executable that hosts a WebView for the UI while the business logic runs as compiled TypeScript. The result is a lightweight, cross‑platform desktop app with a modern UI.

These examples only scratch the surface. Because Tsonic outputs standard C# projects, you can also integrate with ASP.NET Core, Entity Framework, or any existing .NET ecosystem.

Comparison with Alternative Tools

When evaluating cross‑language compilers, developers often consider the following options:

Feature Tsonic Babel + pkg Emscripten (C++ → WebAssembly)
Target Language C# → .NET NativeAOT JavaScript → Executable (pkg) C++ → WebAssembly
Runtime Dependency None (static binary) Node.js required at runtime Browser or WASM runtime
Access to System APIs Full .NET BCL + optional JS/Node APIs Limited to Node core modules Web‑only APIs
Cross‑Platform Support Windows, Linux, macOS (x64/ARM64) All platforms with Node All browsers + Node
Performance Near‑native, no JIT overhead Node V8 JIT, higher memory WebAssembly speed, but limited syscalls

In short, Tsonic excels when you need a truly native binary with deep system access, while still writing in TypeScript. For pure JavaScript ecosystems, Babel + pkg remains a solid choice, but it cannot match the performance and security of a .NET NativeAOT binary.

Why Adopt Tsonic Today?

Adopting Tsonic can accelerate your product roadmap in three concrete ways:

  1. Speed to market: Write once in TypeScript, compile to native, and ship without bundling a runtime.
  2. Cost reduction: Smaller binaries mean lower cloud compute costs and easier containerization.
  3. Future‑proofing: Leverage the evolving .NET ecosystem, including upcoming .NET 12 features, while keeping your codebase in a language many front‑end developers already love.

Ready to experiment? The UBOS templates for quick start include a pre‑configured Tsonic project that you can clone in seconds. Pair it with the UBOS partner program to get dedicated support and co‑marketing opportunities.

Explore more resources on the UBOS ecosystem that complement Tsonic:

By integrating Tsonic with these UBOS services, you can build end‑to‑end AI‑powered solutions that start from TypeScript code and end as production‑grade native applications.

Source

For the official documentation, release notes, and detailed technical specifications, visit the Tsonic website.

© 2026 UBOS Technologies. All rights reserved.


Andrii Bidochko

CTO UBOS

Andrii Bidochko is an AI entrepreneur and researcher focused on AI agents, reinforcement learning, and autonomous systems. He writes about the technologies shaping the future of machine intelligence, from frontier models and agent architectures to real-world AI applications.

Sign up for our newsletter

Stay up to date with the roadmap progress, announcements and exclusive discounts feel free to sign up with your email.

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.