comptime.ts: Compile-Time Computation for TypeScript

2025-08-07
comptime.ts: Compile-Time Computation for TypeScript

comptime.ts is a dead-simple TypeScript compiler designed for efficient compile-time evaluation of expressions marked with `comptime`. This allows for code optimization by shifting computations from runtime to compile time. It supports various use cases, including calculating constants, generating static content, and optimizing performance-critical code. Integration is straightforward via Vite, Bun, or the CLI, boosting developer productivity. However, comptime expressions must be JSON-serializable, and complex expressions may increase build times.