Remix.run Logo
▲ cowsandmilk 11 hours ago

why would that be important? Having a typescript compiler in wasm seems like a pretty niche need.

▲Benjamin_Dobell 3 hours ago | parent | next [-]

It's extremely useful if your distribution platform is the web. However, I find it much more valuable as a type checker than a compiler. I use TypeScript extensively (in several projects) for defining schemas types.

For example, in the Breaka Club (https://breaka.club/) editor, which is not presently exposed to kids yet, we define behaviors for characters, props, mosaics (terrain tiles) and items in JSON. But the JSON has type checking and real-time completion as you type. Not naive property auto-suggestion, we have effect types and they're context aware in that you can refer to targets introduced higher in parent constructs of the JSON — and they're fully type checked. If you refer to a target that does not exist in a context, it won't validate and you cannot save the schema.

We use tsgo for development, but the editor (runtime schema validation) is presently stuck on TypeScript 6 because there's no WASM support.

Now, is it nutty that we're using TypeScript for JSON validation? A little. But it's extremely powerful. We're going far beyond what's capable with Zod or ArkType.

▲pjmlp 5 hours ago | parent | prev | next [-]

Because you need to keep the compiler running here,

- https://www.typescriptlang.org

- https://code.visualstudio.com/docs/remote/vscode-web

▲tcfhgj 2 hours ago | parent | prev | next [-]

But it's not the only niche, see Typst compiler in wasm for live document generation in the browser.

▲viraptor 8 hours ago | parent | prev [-]

Theo is making a new twist on the idea of IDE which hosts the application itself. I'm sure there's going to be a video about it soon. But the idea is to embed the whole compilation and type-check in wasm in the browser which then runs the app immediately, as the agents edit the code.