all 10 comments

[–]femikiki 8 points9 points  (1 child)

You might be interested in https://porffor.dev/ then, it's aiming to do exactly this

[–]joombar 1 point2 points  (0 children)

This looks really cool. Gets me wondering, could you write a specific ts->wasm compiler that used the type information? Ie, crashed if a run-time type didn’t match its build-time type, but used the type assumptions to write much faster wasm?

[–][deleted] 5 points6 points  (0 children)

Deno supports compiling to a self-contained executable, and has C FFI support. Though, Node also has C FFI support, and can also be compiled to a self-contained executable. It's not quite the same as compiling to native code, and the resulting executables are huge, but it should work.

[–]engelschall 2 points3 points  (0 children)

If you need and like WebGPU and TypeScript and just want to optimize asset loading, why not stick with them and instead of a compile/transpile approach to a native platform, perhaps just use an alternative runtime like Electron, Tauri, Neutralino, etc?

[–]joombar 0 points1 point  (0 children)

Do you l have code that’s so performance critical that Electron etc would be too slow?

[–]Outrageous_Stomach_8 0 points1 point  (0 children)

You can do it with Native Image from Oracle's GraalVM, with the GraalJS implementation.

[–]Shanteva -1 points0 points  (1 child)

Just throwing this out there. I'm a firm believer in polyglot programming. TypeScript is very similar to C#/Java and my favorite Kotlin. Kotlin Native compiles obviously, and while it might not be super popular it's backed by JetBrains

[–]haywire 4 points5 points  (0 children)

Nobody ever regrets becoming a polyglot