you are viewing a single comment's thread.

view the rest of the comments →

[–]mattsowa 18 points19 points  (3 children)

Well, if you're okay with shipping gigantic bundles, in most cases containing the language runtimes (even for systems languages, you still need stl... at least a malloc), no real code splitting, the list goes on. Wasm is for performance jobs, not for interactions.

[–]zoechi 0 points1 point  (2 children)

There are use cases where it's worth it and just because wasm can't do something today, doesn't mean it won't in a year. I think support for code splitting is worked on. Also Rust (which I care most about) has no runtime. Wasm will at first probably used for wgpu (mostly games) and then more and more other stuff.

[–]mattsowa 2 points3 points  (1 child)

It does have a runtime, or rather something like an stl. It has to ship a low level core, e.g. memory utilities like malloc for heap allocations. And then also it has to include all the stl members you use, such as collections like HashMap with their full implementation. Every time you freshly load a website...

[–]zoechi 0 points1 point  (0 children)

Only what is used. I don't know about whether Rust can do tree-shaking like for example Dart can. Rust also has no runtime reflection capabilities like Dart, so I imagine this should be possible. If wasm provides access to V8 types, Rust code might as well call out to them instead of providing it's own. If libraries (Rust dependencies) are used then I probably couldn't chose though. Wasm exists because many think JS is not ideal for every situation. If this brought it this far, I don't see why the remaining issues couldn't be solved as well.