Rendered at 02:27:14 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
bertili 6 hours 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.
cryptolobster 3 hours ago [-]
Bookmarked, thanks
jeswin 21 minutes 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.
dashersw 9 minutes 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:
How many memory does it cost for a simple hello world window? VS Qt, Tauri
dashersw 35 minutes ago [-]
As much as it would cost a native app. Say, on Mac, a plain AppKit app consumes 16-17 MB, gea consumes 18-20 MB, Qt consumes 25-35 (depending on whether you use QML or not) and Tauri consumes 58-60 MB. Tauri suffers a lot from all the WebKit dependencies, as its UI is not native but rather HTML rendered by WebKit.
hombre_fatal 30 minutes ago [-]
Another data point: hello.c in GTK4 used over 100MB last I checked.
zerr 6 hours ago [-]
What do they use for graphics and audio?
trelliscoded 4 hours ago [-]
They mention OpenGL for the bigger targets, but I was wondering how this worked for the ESP32. Turns out they wrote a custom 2D rasterizer specifically for this target, basically a miniature version of a browser layout engine: https://geastack.com/blog-we-taught-a-chip-to-run-css
dashersw 6 hours ago [-]
Each platform has its native bindings. For graphics, you write CSS and HTML canvas API as well as JSX, it renders to native components and their alignments, the canvas API is converted to native surfaces, whatever the platform uses.
zerr 6 hours ago [-]
I mean, is it OpenGL, Vulkan, Metal? etc...
dashersw 4 hours ago [-]
It defers to platform defaults, Android compositor, UIKit/AppKit native views or CoreGraphics for the canvas on Apple platforms, GDI/GDI+ on Windows, whatever SDL2 chooses on Linux. If you have a Three.js app, it uses Metal on iOS and macOS, Direct3D 11 (open) and 12 (commercial license) on Windows and XBox.
zero_shift 4 hours ago [-]
It's not clear at first glance, but given (1) the apps are written in JavaScript (2) the project has repos for different OS native bindings, my bet is some kind of embedded JavaScript engine that just calls through to OS native widets
dashersw 3 hours ago [-]
It compiles TypeScript statically to C++, there's no JS engine or VM running.
sublinear 6 hours ago [-]
Ah this is for embedded apps. Pretty neat!
dashersw 6 hours ago [-]
It also supports iOS, macOS, Android, Windows, Linux, XBox for Three.js games, as well as (some) Node.js apps.
jr3592 5 hours ago [-]
could you throw a react project (WEB) at it and get a native macos project out of it?
The code is on GitHub, for example for the first video that renders a 3D cube with CSS the code is at https://github.com/geastack/examples/tree/main/apps/css-3d-c.... It takes only a couple of CLI commands to get it running. For reference, I'm using a WaveShare ESP32-S3 AMOLED Touch 2.06" device here, but the same code renders on every target Gea compiles for.
dspillett 2 hours ago [-]
The concern with a lot of projects that look largely AI made isn't that the current state works, but that this current state might be all that ever happens so people who try to use it end up relying on a dead project unless they maintain it themselves.
[refusing to reword the "it is not X, it is Y" - I'm not an LLM but I don't care that much if you think I am!]
dashersw 47 minutes ago [-]
I understand and appreciate the concern. We've been working on Gea Stack for about a year now. Started with https://geajs.com, then decided to enlarge the capabilities. The current capabilities have been under development for the past 6 months. We are in the process of forming a new company around Gea, and already collaborating with multiple embedded device vendors, development partners and customers who are interested in the technology.
There's a broader philosophy of "firmware freedom" that we want to bring to the world. Practically, you should buy hardware for what it is, and run your own firmware on it. E-book readers and unlocked bootloaders in the Android world is doing a pretty good job at this, so we want to contribute to this movement by making the development of such solutions dead simple, both for humans and AI. Incidentally, TypeScript, JSX, and CSS happen to be the languages AI knows best.
So, it's an ambitious project with a real team behind it, with commercialization on the horizon.
slopinthebag 2 hours ago [-]
with a lot of ai projects it's often that the only thing that does work is the demo. and im not saying this to be rude, its an ambitious project and im afk so i cant test it myself.
how does it compile js to c++? js is so dynamic it makes me think it either compiles to some kind of bytecode or its a heavily restricted subset of the language.
dashersw 43 minutes ago [-]
It took us 6 months to build the compiler. We analyze literally the hell out of the call graph. We started with strictly typed TS, which is trivial to compile. Then we added a dynamic fallback for projects that have "unknown"s and "any"s, then we had several architectural changes which allowed us to inspect those "claim"s. If you think about it, marking a variable "any" is a lazy claim. If it's ever used in one place and in one shape (akin to duck typing), you can create a static struct out of it...
So there's no byte code, and while not every single dynamic language feature has a corresponding static compilation, the base is pretty broad. So much so that Hono, the web framework, with all its dependencies, compile just fine.
nuk3 5 hours ago [-]
[dead]
tarcon 6 hours ago [-]
"The earlier implementation could not be driven to zero of them, because boxing was load-bearing in its emitter"
I see what you’re getting at, but let’s not pretend like “load-bearing” is something that AIs made up. It was a turn of phrase long before AIs became mainstream and people are still allowed to use it.
One of the biggest complaints I get is about missing documentation on what TypeScript is not supported.
For example, the following is obviously impossible:
or even: 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.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-...
https://www.youtube.com/watch?v=o5RDfAmzE7s
I will keep an eye on this for future use.
The code is on GitHub, for example for the first video that renders a 3D cube with CSS the code is at https://github.com/geastack/examples/tree/main/apps/css-3d-c.... It takes only a couple of CLI commands to get it running. For reference, I'm using a WaveShare ESP32-S3 AMOLED Touch 2.06" device here, but the same code renders on every target Gea compiles for.
[refusing to reword the "it is not X, it is Y" - I'm not an LLM but I don't care that much if you think I am!]
There's a broader philosophy of "firmware freedom" that we want to bring to the world. Practically, you should buy hardware for what it is, and run your own firmware on it. E-book readers and unlocked bootloaders in the Android world is doing a pretty good job at this, so we want to contribute to this movement by making the development of such solutions dead simple, both for humans and AI. Incidentally, TypeScript, JSX, and CSS happen to be the languages AI knows best.
So, it's an ambitious project with a real team behind it, with commercialization on the horizon.
how does it compile js to c++? js is so dynamic it makes me think it either compiles to some kind of bytecode or its a heavily restricted subset of the language.
So there's no byte code, and while not every single dynamic language feature has a corresponding static compilation, the base is pretty broad. So much so that Hono, the web framework, with all its dependencies, compile just fine.
In the docs of the repo of their TS to C++ compiler. https://github.com/geastack/compiler