Example Gea apps, used by the simulator and all targets. - geastack/examples

131 points•arbayi•8 days ago•54 comments•

54 comments

bertili8 days ago
Not apparent at first, but this is a TypeScript to c++ compiler at the core (https://github.com/geastack/compiler), with bindings for various platforms.
pjmlp8 days ago
There is also the one from Microsoft themselves, although it supports only a subset.

https://www.microsoft.com/en-us/research/publication/static-...

Used in Make Code,

https://www.microsoft.com/en-us/research/project/microsoft-m...

cryptolobster8 days ago
Bookmarked, thanks
jeswin8 days ago
Author of tsonic.org here (which is very similar, but for Rust, C# and Mojo - WIP).

One of the biggest complaints I get is about missing documentation on what TypeScript is not supported.

For example, the following is obviously impossible:

  const a = eval("...something....");
or even:

  a: unknown, or a: any.
The rest of it is largely doable. But people want to see what's not supported. Otherwise it's not clear to them what to avoid.
dashersw8 days ago
Ah, amazing project! Congratulations. I was just writing under another thread that we support any and unknowns in two different ways. First, most any and unknowns are lazy programming—if you trace the call graph you can prove they have concrete types, or used only in one shape. If we can't prove a type narrows properly, we lower it to a boxed dynamic value carrier so it doesn't block compilation. Like JSON.parse—for this we have a special syntax, you can do JSON.parse(x) as T, to define the type, and if you don't it becomes a dynamic value whose price you pay only for that site / variable.

We also have limited support for `new Function("...")` via a small evaluator written in C++ that parses and runs the generated body. We mainly built this for Fastify's generated routing functions so it doesn't support classes, asynchronous, destructuring, etc, but conditionals, loops, variable declarations etc work.

There is no "eval" yet, but the same support shape could be added for it too, as the mechanism is already there.

The approaches and the limitations are documented here:

https://github.com/geastack/compiler/blob/main/docs/EVAL.md https://github.com/geastack/compiler/blob/main/docs/DYNAMIC-...

jeswin8 days ago
I've been working on this full-time since late 2025. Happy to share what I've learned - feel free to email me as well if you wish to.

> so it doesn't support classes, asynchronous, destructuring

For users, this general category of problems (not knowing these edges) is the hardest. It's amplified if you pull libs from npm. One of the best ways to test compatibility is to test with non-trivial projects, or existing codebases. For example, one which has helped me a lot is trying to compile Microsoft's typescript-go compiler, after translating it from golang to TypeScript via a separately written tool. Large projects surface a ton of issues.

jeswin8 days ago
Also curious - how do you handle "number"? i32, i64, doubles, floats, i16 etc have very different performance characteristics. Also, things like sparse arrays, Error.stack etc. I haven't documented them in my project yet, but it's quite high up in the list of things people actually care about.
mpweiher8 days ago
So essentially React Native but with the code not left in TypeScript/JavaScript but transpiled to C++?
desmondl7 days ago
I'll keep an eye on this, it seems cool - write once in typescript, compiler compiles typescript into native apps. Seems like it combines ideas from React Native (one language/application model across platforms), Svelte (compiles away high level abstractions to avoid a heavy runtime), and Flutter (own enough of the UI model to target very different platforms).

What I still don't understand (and can't find documentation for) is how Gea defines the portable abstraction boundary.

The targets are radically different: embedded devices, native UI kits, framebuffer-style rendering, and webviews. The docs don't make it clear which Typescript/JS/node/browser semantics are guaranteed. If I write something like `requestAnimationFrame` and `fetch` and `queueMicrotask`, does it work on every target? The lack of caveats in the documentation implies "Yes" but provides no assurance. Where is the compatibility matrix?

Does an application developer mostly stay inside a portable Gea model, or do they need to understand both Gea internals and the target platform to know what will work? If it's the latter, then it's hard to see the advantage of Gea vs just writing a native app.

My impression right now is: potentially VERY interesting, but needs clearer technical documentation about the portability/limitations and convincing real world proof before I can believe it and let myself be excited about it :)

Looking at the compiler repo, it looks like there is just one contributor. So I'm curious, what AI coding tools did you use? Which models? What's your workflow like? (I'm really interested in first hand experience on how models perform on truly difficult projects, not just at drawing pelicans)

dashersw7 days ago
Amazing questions, thank you for the careful read!

We should ship a compatibility matrix... at some point we were hoping to report test262 coverage for ECMAScript compliance, but we had to prioritize the release. Of course any of the typical web APIs work, including localStorage, and even so far as the Web Audio API (and we're working on WebRTC to make it cross platform. It's especially interesting to be able to build real-time communication apps, say, on an ESP32-S3, with just the web semantics).

In short, most app code stays inside the portable model. You need to know the target when you use host APIs that are constrained on small devices: blocking I/O, memory limits, file sizes, and of course you can combine it with native code for the target. I'm building a guitar effects processor, for example, where the UI is powered by Gea Stack but all the audio processing happens natively (https://github.com/dashersw/coyopedal).

On AI: yes, it's mostly me plus agents for the compiler. We have a team at Coyotiv that helps with everything else. I use Claude Code with Claude Opus as the main model and Sonnet subagents for parallel work, with a fair bit of Fable. I also combine this with whatever GPT model is available over Codex. During the past 6 months I've started working on the compiler, I've changed several model versions :)

What makes AI perform on a compiler:

Hard gates the agents can't argue with, like a diff gate that names every program whose output changed, plus conformance sweeps, a diary that captures past failures so they don't repeat, and treating a passing exit code as insufficient and the outputs get checked against Node.js behavior and unit tests.

The biggest differentiator for me is, even though I'm a pretty relaxed manager for humans, I'm a heavy micro-manager for AI. I read its thinking tokens and its code live and as soon as I spot something I don't like, I intervene and guide the model to the output I want to see.

It wasn't easy, Gea Stack in total I think burnt more than a million dollars in AI credits, and I've been working on it literally non-stop for 6 months.

potato-peeler8 days ago
> iOS Native mobile apps and device companion experiences

> Android Gea apps packaged as a native Android APK, rendered through a WebView

Why webview? No love for android?

dashersw7 days ago
Ah damn, this is a leftover from literally the first day of our Android target build. Of course it's native for Android, too. Will fix it ASAP, thank you!

Read the full thread on Hacker News →

Related stories