← ScriptC: native TypeScript without Electron, Node, or V8 — where it actually fits
ScriptC: native TypeScript without Electron, Node, or V8 — where it actually fits
English ↔ Español
What caught my attention
My first reaction to ScriptC was to compare it with Electron. That is natural for a web developer: TypeScript, desktop software, distribution. It is also inaccurate.
Electron is a desktop platform built around Chromium and Node.js. ScriptC is a TypeScript-to-native compiler.
Its official promise is straightforward: ordinary TypeScript can become a small native executable without requiring Node, V8, or another full JavaScript engine in the binary. Its production backend is LLVM.
So the useful question is not "ScriptC or Electron?" It is: how much of my program actually needs a browser and a JavaScript runtime?
The three tiers matter more than the benchmark
ScriptC documents three explicit execution tiers.
Tier 1 is statically compiled. Classes, closures, async/await and a meaningful surface of familiar Node APIs can become native code.
Tier 2 is opt-in dynamic execution through --dynamic. The current implementation embeds quickjs-ng for code that cannot stay static, including relevant npm JavaScript and any-typed paths. Values crossing back into static code are validated.
Tier 3 is rejection at compile time.
I consider that last behavior a feature. A compiler saying "I cannot preserve this construct" is better than silent semantic drift.
The scriptc coverage command makes the boundary measurable.
scriptc coverage cli.ts
scriptc build cli.ts -o cli
Before discussing speed, I want to know how much of a real application stays on the static path.
Where LLVM fits
LLVM is compiler infrastructure, not a UI framework and not a runtime like Node.
ScriptC has a frontend that analyzes TypeScript and builds its typed IR. Its LLVM backend lowers that representation to LLVM IR and native objects. You can inspect the generated IR with --emit=llvm.
A simplified pipeline is:
TypeScript
↓
TypeScript compiler API / analysis
↓
ScriptC typed IR
↓
LLVM IR
↓
native object
↓
runtime pack + platform linker
↓
executable
The runtime pack matters. Saying the result has "no runtime" would be misleading. The important distinction is that the application does not have to carry a complete Node/V8 runtime.
Does it replace Electron?
Not directly.
Electron solves a problem ScriptC alone does not: shipping a full browser engine for an HTML/CSS/DOM UI.
If my application is fundamentally a React UI running in Chromium, Electron can still be the coherent choice.
ScriptC looks more natural for CLIs, local tooling, workers, automation binaries, small services, and native components written in TypeScript.
For a desktop GUI, I would evaluate it as the native logic/backend behind a native UI or WebView:
Native UI or WebView
↓
small bridge
↓
ScriptC native logic
↓
filesystem / network / local services
That can be lighter than packaging Chromium and Node for everything, but only if the bridge and release complexity remain smaller than the benefit.
npm is the hard part
The TypeScript ecosystem assumes dynamic JavaScript.
npm packages can use reflection, monkey patching, dynamic module loading, runtime code generation, or APIs that a static compiler does not support yet.
ScriptC addresses this explicitly rather than pretending the problem does not exist. Dynamic dependencies can execute inside the opt-in JavaScript island.
That improves compatibility, but it also changes the binary profile and weakens the simplistic "everything is native" story.
This is why I would make scriptc coverage the first step of any serious evaluation.
Small binaries and startup need context
ScriptC's website currently demonstrates a hello-world binary around 320 KB starting in roughly 4 ms, contrasted with a much larger Node runtime.
That demonstrates architectural overhead well. It does not prove that a production application will be universally faster.
A hello world does not measure I/O, real dependencies, sustained throughput, debugging, build time, compatibility, or maintenance.
For a CLI, startup and distribution can be decisive. For a server that stays alive for weeks, a few milliseconds at boot may barely matter.
Platforms and operational reality
Current documentation lists native targets for macOS, Linux, Windows, and WASI, with library modes for iOS and Android under specific toolchain constraints.
There is also an important distinction: Node is required to run the compiler. The produced native executable does not require Node.
Executable builds still involve the platform linker and SDK/sysroot. ScriptC removes a large runtime assumption; it does not make native toolchains disappear.
I would therefore treat it as promising technology that deserves a proof of concept before becoming a critical production dependency.
Where I would start
I would start with a real CLI.
It is almost an ideal test because startup matters, single-binary distribution is valuable, browser UI is absent, dependencies can be controlled, and behavior can be compared directly with Node.
I would measure:
- static coverage;
- final binary size;
- startup;
- memory;
- build time;
- debugging experience;
- release complexity;
- behavior parity across Windows, Linux, and macOS.
Only after that would I move toward larger applications.
What I would not do
I would not rewrite a mature Electron application just because "native is faster."
If the product deeply depends on the DOM, Chromium behavior, dynamic npm packages, and browser APIs, rebuilding that infrastructure can cost far more than the runtime savings.
I also would not choose ScriptC solely for a tiny binary if my workload is a long-lived backend where I/O latency, throughput, and operational maturity dominate.
Why I will keep watching it
ScriptC explores a genuinely interesting idea: TypeScript can be the source language without JavaScript necessarily being the final runtime representation.
That creates a third path between "Node for everything" and "rewrite it in Rust, C++, or Go when I need a native binary."
There are serious trade-offs. npm is dynamic, compatibility is a moving target, and LLVM does not erase native complexity.
But the idea is distinct enough to deserve attention.
My current conclusion is that ScriptC is not "a better Electron." It is an attempt to make TypeScript an input language for native software. If static coverage grows while semantic behavior stays predictable, CLIs, automation, and local components are where I expect it to become especially interesting.
References
Lo que me llamó la atención
Mi primera reacción al conocer ScriptC fue compararlo con Electron. Es natural para quien viene del desarrollo web: TypeScript, escritorio y distribución. Pero la comparación es imprecisa.
Electron es una plataforma de escritorio basada en Chromium y Node.js. ScriptC es un compilador de TypeScript a código nativo.
Su propuesta oficial es convertir TypeScript común en un ejecutable nativo pequeño sin exigir Node, V8 u otro motor JavaScript completo dentro del binario. El backend de producción es LLVM.
La pregunta útil no es "¿ScriptC o Electron?". Es: ¿cuánto de mi programa necesita realmente un navegador y un runtime JavaScript?
Los tres niveles importan más que el benchmark
ScriptC documenta tres niveles explícitos.
El primero compila estáticamente. Clases, closures, async/await y una superficie relevante de APIs familiares de Node pueden convertirse en código nativo.
El segundo es ejecución dinámica opcional mediante --dynamic. Actualmente utiliza quickjs-ng para código que no puede permanecer estático, incluyendo JavaScript de ciertas dependencias npm. Los valores que regresan al mundo estático se validan.
El tercero rechaza el código en compilación.
Considero esto último una virtud. Prefiero un compilador que diga que no puede preservar una construcción antes que una herramienta que cambie semántica silenciosamente.
scriptc coverage permite medir esa frontera.
scriptc coverage cli.ts
scriptc build cli.ts -o cli
Antes de hablar de velocidad, quiero saber cuánto de una aplicación real permanece estático.
Dónde entra LLVM
LLVM es infraestructura de compiladores, no un framework de UI ni un runtime como Node.
ScriptC analiza TypeScript, construye su IR tipada y la baja a LLVM IR y objetos nativos. --emit=llvm permite inspeccionar esa etapa.
TypeScript
↓
análisis
↓
IR tipada de ScriptC
↓
LLVM IR
↓
objeto nativo
↓
runtime pack + linker
↓
ejecutable
El runtime pack es importante. Decir "sin runtime" sería engañoso. La diferencia es que no hace falta cargar un Node/V8 completo.
¿Sustituye Electron?
No directamente.
Electron entrega un motor de navegador completo para interfaces HTML/CSS/DOM. ScriptC por sí solo no resuelve esa capa.
Si mi producto depende profundamente de React dentro de Chromium, Electron puede seguir siendo coherente.
ScriptC me parece más natural para CLIs, herramientas locales, workers, automatizaciones, servicios pequeños y componentes nativos escritos en TypeScript.
Para una GUI de escritorio, evaluaría una arquitectura con UI nativa o WebView y ScriptC detrás:
UI nativa o WebView
↓
bridge pequeño
↓
lógica nativa con ScriptC
↓
filesystem / red / servicios locales
Puede ser más ligero, pero solo si el bridge y la distribución no introducen más complejidad de la que eliminan.
npm es la parte difícil
El ecosistema TypeScript presupone JavaScript dinámico.
Paquetes npm pueden usar reflexión, modificaciones en runtime, carga dinámica, generación de código o APIs todavía no cubiertas por un compilador estático.
ScriptC no oculta el problema. El modo dinámico permite ejecutar esas partes en una isla JavaScript.
Eso mejora compatibilidad, pero cambia el perfil del binario y rompe la narrativa simplista de "todo es nativo".
Por eso empezaría cualquier evaluación con scriptc coverage.
Tamaño y startup necesitan contexto
La web oficial muestra actualmente un hello world de alrededor de 320 KB y un arranque cercano a 4 ms.
Es una buena demostración del overhead arquitectónico. No demuestra que una aplicación de producción sea universalmente más rápida.
Hello world no mide I/O, dependencias reales, throughput sostenido, debugging, tiempo de build, compatibilidad ni mantenimiento.
Para una CLI, startup y distribución pueden ser decisivos. Para un servidor que vive semanas, unos milisegundos al arrancar pueden ser irrelevantes.
Plataformas y realidad operativa
La documentación actual incluye macOS, Linux, Windows y WASI, además de modos de biblioteca para iOS y Android bajo condiciones específicas.
Node es necesario para ejecutar el compilador. El binario producido no necesita Node.
Los builds ejecutables siguen necesitando linker y SDK/sysroot de la plataforma. ScriptC reduce una dependencia grande de runtime, pero no hace desaparecer el toolchain nativo.
Lo trataría como tecnología prometedora que merece un proof of concept antes de entrar en un camino crítico.
Dónde empezaría
Empezaría con una CLI real.
Startup importa, distribuir un único binario aporta valor, no hay UI de navegador, puedo controlar dependencias y comparar comportamiento directamente con Node.
Mediría cobertura estática, tamaño, startup, memoria, tiempo de build, debugging, complejidad de release y paridad entre Windows, Linux y macOS.
Solo después probaría algo mayor.
Lo que no haría
No migraría una aplicación Electron madura simplemente porque el código nativo pueda arrancar más rápido.
Si el producto depende mucho de DOM, Chromium, paquetes npm dinámicos y APIs de navegador, reconstruir esa infraestructura puede costar más de lo que ahorras.
Tampoco elegiría ScriptC solo por un binario pequeño para un backend de larga duración donde importan mucho más throughput, I/O y madurez operativa.
Por qué voy a seguirlo
ScriptC explora una idea interesante: TypeScript puede ser el lenguaje fuente sin que JavaScript tenga que ser la representación final en runtime.
Eso abre una tercera vía entre Node para todo y reescribir en Rust, C++ o Go cuando quiero un binario nativo.
Hay trade-offs serios. npm es dinámico, la compatibilidad cambia y LLVM no elimina la complejidad nativa.
Mi conclusión actual es que ScriptC no es un Electron mejor. Es un intento de convertir TypeScript en lenguaje de entrada para software nativo. Si la cobertura estática crece manteniendo semántica predecible, CLIs, automatizaciones y componentes locales son los escenarios que más me interesan.