Tov
A high-performance programming language for coding agents that uses TypeScript syntax to produce small, fast, and efficient native binaries.
Tov is a specialized programming language engineered to empower coding agents by utilizing familiar TypeScript syntax while compiling to high-performance native binaries. Developed by the team behind the open-source screen recorder Cap, Tov is designed to solve common challenges in agent-driven development by providing a compiler that does not merely report errors but suggests explicit, safe code edits to resolve them. By generating C code and leveraging the clang compiler, Tov creates efficient, standalone binaries that require no additional runtime environment installations. This approach effectively combines the developer productivity of TypeScript with performance characteristics that often exceed those of Rust.
Functionality is centered on a compiler that interprets TypeScript-compatible syntax while omitting complex or ambiguous features like 'any', 'null', or the '==' operator. It enforces strict type handling, such as distinguishing between 'int' and 'f64', and requires explicit 'try' markers for functions that can potentially fail. The system uses reference counting for memory management to avoid the overhead of traditional garbage collection, resulting in low latency and small binary sizes. When an agent develops code, Tov's checker identifies issues such as unhandled errors, incomplete switch statements, or incorrect memory sharing, providing machine-readable fixes that the agent can automatically apply.
Some of the key features are:
- Native Compilation: Transforms TypeScript-like code into efficient C and finally into high-performance native machine binaries.
- Agent-Ready Error Handling: Provides automated, safe code fixes in JSON format for easy integration with coding agents and AI assistants.
- Performance Optimization: Delivers extremely fast execution times and low memory footprints, often outperforming Rust, Bun, and Node.js in various benchmarks.
- Type System: Enforces strict typing with distinct integer and floating-point types while removing problematic JavaScript features like 'any' and 'null'.
- Runtime Independence: Produces standalone binaries with no additional runtime dependency, simplifying deployment and distribution.
- Reference Counting: Implements memory management through built-in reference counting in the generated code to eliminate garbage collection pauses.
- TypeScript Compatibility: Allows developers and agents to utilize familiar Bun and Node.js standard APIs and import existing npm packages.
- Fast Iteration: Supports rapid build times with advanced compiler caching, ensuring quick turnaround for development and testing cycles.
Operationally, Tov functions as a drop-in replacement for TypeScript-style projects where performance and binary portability are prioritized. Developers or agents write code in .tov files, utilizing familiar syntax and APIs. The development cycle involves using 'tov check --json' after edits to apply safe automated fixes. The 'tov run' command allows for immediate execution during development, while 'tov build' produces a single, optimized native binary for production deployment. The runtime includes essential infrastructure like an event loop, HTTP support, and native data structures.
Some common use cases include:
- Coding Agent Integration: Providing a stable, self-correcting programming environment for AI models to build and maintain complex software projects.
- High-Performance Web Services: Developing low-latency API servers that require minimal memory usage and rapid response times.
- System-Level Utility Development: Creating lightweight command-line tools that offer portability without requiring heavy runtimes like Node.js.
- Media Processing Applications: Implementing performance-critical components such as video encoders that benefit from raw hardware execution speed.
- Resource-Constrained Environments: Deploying fast, small-footprint applications where memory efficiency and low startup times are critical.