How I built new Javascript Superset for $250 in about two weeks
I've been rather busy since an evening in December when I was waiting on a Helsinki rail platform for the overnight train to Oulu.
It occurred to me that two problems I was thinking about were actually the same problem:
- Service-as-a-Service: Creating an endpoint that fetches data and manipulates it server-side before returning the payload.
- Instant Agents: Spawning AI software "agents" on-the-fly without a full deploy.
Both were stymied by one hard fact: eval() is so horribly unsafe that most cloud environments simply disable it entirely. Heck, most organizations use CSPs that block it from running on clients.
But what if eval() were safe?
The first thing I did was create and release agent-99. At the time, I thought it was the most brilliant thing I'd ever done.
My observation was simple: You could send an AST (Abstract Syntax Tree) over the wire and execute it on a custom VM. The VM didn't need to eval anything. It just walked the tree.
- Turing Complete? Easy.
- Halting Problem? Solved via "Gas." Every request has finite fuel, every execution atom has a cost, when it runs out, the execution dies.
- Security? Capabilities are injected at runtime. The code can't reach what you don't give it.
So I had safe eval, code-as-data, and zero-deploy services and agents. It seemed like a solid weekend's work. I posted it to Hacker News, waited for the acclaim, and... crickets.
Why? Because despite all claims to the contrary, agents hate writing ASTs. And humans hate reading them. I had solved the execution problem but ignored the authoring experience.
The Pivot: Code, Not JSON
I wondered: how hard would it be to replace the clunky "fluent builder" pattern with a minimal JavaScript subset?
A few quick experiments showed that even small 4B parameter models could write perfect code for this subset. I published that, and it worked. By this time, a little over a month had elapsed since my midnight wait on the railway platform in Helsinki.
This all worked dandy. Maybe I should publish it and see if anyone cared? You know: safe eval, universal endpoints, NoSQL joins that are easy to reason about, a dynamic GraphQL replacement with no need to deal with cache problems and hoisting security models, code that moves to data, simple demos showing agents writing their own agents. It seemed like a solid accomplishment. A contribution.
But the outer language—the language which you'd write the "universal endpoint" in and write the capabilities you inject in—that would be TypeScript. And TypeScript's types were ephemeral. They didn't guarantee type-safety at runtime. So you'd be just hoping that the payload your injected capability receives is what you expected.
What if JavaScript were a true LISP?
The main problem with TypeScript isn't just that the types disappear at runtime. It's that TypeScript is a step backward.
It markets itself as a "superset," but that is a marketing fiction. If you can't change the file extension to .js and run it in a browser, it isn't a superset; it's a separate language with familiar syntax. TypeScript introduces Enums, Namespaces, and complex decorators that native engines will never understand. It is a transpilation-required sibling that refuses to let JavaScript be JavaScript.
I wanted to build an honest superset. One that, like ES5’s "use strict", changes the rules of the
game at runtime to fix JavaScript’s original sins, but remains fundamentally rooted in the dynamic,
introspective nature of the environment it lives in.
JavaScript was born as a Lisp in C's clothing. It is dynamic, introspective, and flexible. TypeScript tries to beat that Lisp nature into submission with a static type system that is fundamentally a collection of lies you tell the transpiler to make the red squiggly lines go away. It gives you mediocre autocomplete based on static analysis, not truth. And yet it's so complex it is accidentally Turing complete. Hovering over a term in your editor can crash the language server.
I wanted to go the other way. I wanted Dylan disguised as the world's most popular programming language.
I wanted a language where the types are real values, where autocomplete works by introspection, and where the safety is enforced at runtime. I wanted to reclaim the "Lisp" heritage of JavaScript.
Guess what's really good at building the dumb but necessary tooling (transpilers, highlighters) to make that happen?
Pausing only to add 90% test coverage to tosijs and tosijs-ui, I wrote a manifesto of everything wrong with JS/TS and how to fix it. Then, I built it.
It's called tjs-lang. It is the language I wish I had been writing in all along.
TypeScript:
function hello(name = 'world'): string {
return `Hello, ${name}`
}
TJS:
function hello(name = 'world') -> 'Hello, world' {
return `Hello, ${name}`
}
test 'hello works for other names' {
expect(hello('Bob')).toBe('Hello, Bob')
}
The difference is TJS transpiles, for real, in the browser. It produces documentation and runtime type-checked code. And because it declares its return type and has default parameters, its signature becomes an implicit test.
- Types-by-Example
foo = +5isn't just an assignment; it definesfooas a non-negative integer. - Runtime Types Types persist into runtime, allowing real-time type-checking (with surprisingly low overhead).
- Safe Eval The
ajssandbox is embedded directly. - Polymorphic Functions No more gymnastics. Treat different calling conventions as actual separate functions.
- Local Extensions Extend
NodeListorStringlocally without polluting the global prototype. - Inline WASM Write WASM blocks directly in your code with fallbacks.
- Monadic Errors "Rails-oriented programming" built-in. Catchless
try {}returns an error value. - Inline Tests
test "description" {}lives right next to the code. - Real Transpilation in the Browser Test, transpile, and generate documentation in one pass. (It also works for ts!)
The Real "10x" Difference
I recently read an article about how 16 AI agents built a C compiler with human supervision. It was hailed as a breakthrough in autonomous coding.
That project is an impressive demonstration of AI-assisted implementation at scale. But the specification existed—the map was drawn 50 years ago. I wanted to test a different question: can one person with AI create a vision and implement it?
tjs-lang was an exercise in invention.
There was no map. I had to design a novel type system where types survive compilation. I had to invent a runtime that makes eval() safe. I had to solve the "halting problem" via gas metering in a language that wasn't designed for it. I had to design all this so it's actually usable, generating error messages that both humans and AIs can understand in a syntax AIs can write without hallucinating.
I designed the language, built the "compiler", the runtime, syntax-highlighting, autocomplete, the test suite, an interactive playground, and the documentation in about two weeks of spare time using Claude Max and Gemini. Total cost: ~$250.
The "16 Agents" proved they could follow instructions at scale. My experiment shows that one human with the right vision can use AI to architect entirely new software paradigms that would have previously required a dedicated team of engineers.
And this isn't a compiler, or "just" a compiler. It transpiles a pre-existing language, TypeScript—a notoriously complex task—both to itself AND javascript. It defines a new javascript superset that does things Javascript promised, but never delivered, and TypeScript fails to do by aggressively refusing to allow JavaScript to be JavaScript. Oh and it gives you type-safe, sandboxed, gas-limited, eval.
Beyond the language itself, I built the entire ecosystem—it comes with syntax highlighters, a live demo environment, you can clone the repo, run it locally, and test it against LM Studio. tjs is easy enough for Claude to work with that it can happily write tjs demo code and work on the ts tooling without getting confused. Because tjs is so much more consistent conceptually than TypeScript, grokking it is a "downhill path" for AIs. And the way it propagates errors also helps AIs (and humans) debug.
This isn't "10x" or even "100x" development. It's not typing faster or writing boilerplate. It's the ability to act as the Architect, the Lead Engineer, Technical Writer, and the QA Department simultaneously.