|
|
|
|
|
by dashersw
73 days 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. |
|
It does appear most JS features can be translated to C++, even if at some overhead. Did you encounter any which wasn't straightforward?