8 ms·
Why aren't we standardizing on something like Java bytecode or LLVM IR or CLR? What problems with those existing technologies could wasm solve better?
by gcr 10y ago
Why aren't we standardizing on something like Java bytecode or LLVM IR or CLR?
What problems with those existing technologies could wasm solve better?
- darpa_escapee 10y agoMy friend, where have you been for the last 5 years? Web developers have been reinventing the wheel every 3-6 months and calling it innovation.
- Rusky 10y agoA fair criticism of a lot of web tech, but not of WebAssembly, which is doing many things JVM/CLR/Flash/etc. never did.
- throwawaysbdi 10y agoAnd what are those exactly? JVM and CLR bytecode is totally platform agnostic and both support many languages without trouble. Apparently they aren't cool anymore so we need to spend another few thousand man years building another system in their image
- Rusky 10y agoBut they don't support the primary reason for asm.js and thus wasm- C and C++. They also, as you note in another comment, do not have the appropriate security model for web apps.
- pjmlp 10y agoI guess you never did any .NET development. .NET 1.x introduced Managed C++. .NET 2.0 replaced Managed C++ with C++/CLI due to feedback from C++ devs, regarding keywords and how GC types were declared. C++/CLI was submitted to ANSI C++ as standard proposal. UWP introduced C++/CX, although it does compile to native code and interoperates with .NET Native instead. Or Flash for that matter, which had a C++ compiler called FlasCC.
- Rusky 10y agoI am well aware of managed C++ and C++/CLI. They are not the same language as native C++, in the sense that matters for WebAssembly's target audience. C++/CX is closer, but a) also still not the same language and b) doesn't run on the CLR, so isn't an argument for replacing wasm with IL.
- rubber_duck 10y agoYou seriously don't see the difference between WASM and CLR/JVM ? JVM/CLR are high level and need to know about things like types/object model - this lets them do GC more efficiently and fancy stuff like reflection, etc. at WASM is assembly level just sandboxed and portable - direct memory access and basic instructions - it doesn't even have GC right now. They are only superficially similar.
- gcr 10y agoSo here's a thought: how is this different from PNaCL and friends?
- dragonwriter 10y agoPNaCl, IIRC, doesn't expose web APIs, but requires message-passing to and from associated JS for that.
- rubber_duck 10y agoConceptually not very different, practically PNaCL has a problem of being an ad-hoc standard based on LLVM - WASM fixes that.
- dragonwriter 10y ago> And what are those exactly? Providing a lower-level platform; directly exposing open web APIs. The first may not seem like an advantage, but it means more flexibility in the higher level systems (including runtimes like JVM or CLR, if you wanted to) that can be usefully run on top of it.
- pizza 10y agosmaller ideas faster, zestierly
- username223 10y agoAmazingly, "zestier.ly" has not yet been registered.
- scrame 10y agooooh, it's like agile, but lightweight.
- throwawaysbdi 10y ago"micro" if you will
- wruza 10y ago5 years? All years, actually.
- paulddraper 10y agoSeems like a waste of time. Maybe if we had a JS framework for reinventing the wheel...
- Retra 10y agoYou mean Wheel.js? It's crap. RollCircle is 1000x better, and it's got a flexable plugin layer that works with Angular, Ember, or Asm.js.
- ethbro 10y agoRollCircle is too complicated. I already learned Wheel.js two years ago, and don't want to relearn the wheel.
- throwawaysbdi 10y agoI prefer ReWheel. It's like RollCircle but they've reduced everything to a single wheel so it's easier to reason about. Some people still think you shouldn't have a single global wheel but it's definitely where things are headed. Anyways you should take a look, it's a lot easier to pick up than RollCircle and nobody really uses Wheel.js anymore
- jnordwick 10y agoModern developers want more variety. I've been working on something new: npm elipse.js It's based on circle, but I'm still working out some issues.
- throwawaysbdi 10y agoI tried to install but I'm getting an error message: "undefined" is "undefined" on line 27361 in elipse.min.js . I'll send you the stacktrace because it's bigger than the message limit here. I see that you're transpiling typescript into ES2015 then down to ES5 in Babel, cool. Could I get a source map for the original file?
- paulddraper 10y agoWe already did Java bytecode, though it wasn't good enough to get standardized.
- JoshTriplett 10y agoJava bytecode doesn't make a good compilation target for compiled languages; wasm specifically aims to provide a good target for such languages. LLVM IR by itself doesn't provide appropriate sandboxing for the web; wasm has security and sandboxing as a fundamental part of its design. The CLR shares many of the same problems Java has, and would also fail to provide a vendor-neutral, unencumbered solution.
- Touche 10y agoLlvm ir isn't cross platform, for starters.
- muizelaar 10y agoJava bytecode and CLR are not great targets for compiling C++ to and implementing performant VMs for them is much more difficult than a WASM JIT. The WASM FAQ has an entry about LLVM IR: https://github.com/WebAssembly/design/blob/master/FAQ.md#why-not-just-use-llvm-bitcode-as-a-binary-format https://github.com/WebAssembly/design/blob/master/FAQ.md#why...
- throwawaysbdi 10y agoUpvoted for having actual information
- iainmerrick 10y agoJava and the CLR are pretty similar (legal issues aside). Both are great, but neither is ideal as a general-purpose VM for arbitrary programming languages. Neither is a good target for C and C++. (The CLR has "managed C++" but I don't think that's widely used.) What is WebAssembly going to be used for that isn't already handled well by Javascript? High-end video games is an important example. Those are almost exclusively written in C++. Lots of indie games are written in C# using Unity, but the Unity runtime library itself is C++. So why not LLVM? The LLVM isn't actually well-defined, stable, or even platform-independent. That hasn't stopped both Google and Apple trying to use it for this kind of thing (PNaCl and Bitcode respectively). PNaCl failed to catch on, Bitcode is helped by the fact that Apple has complete control over their own platform. Edit to add: from a game developer's point of view, a good question is why we need both this and the new "SPIR-V" thing in Vulkan...!
- cm2187 10y agoBut I presume that webassembly will allow a program to ship with its own managed environment. So you can have a .net program running within a CLR within webassembly. The return of Silverlight! (which I welcome by the way)
- Nelkins 10y agoI thought the exact purpose of the CLR was to be a general-purpose VM for arbitrary programming languages. I mean, it's even in the name: Common Language Runtime. Also, there's this passage from the CLR docs (a.k.a. Book of the Runtime) that explicitly states its multi-language intentions[1]. [1] https://github.com/dotnet/coreclr/blob/master/Documentation/botr/intro-to-clr.md#multi-language-support https://github.com/dotnet/coreclr/blob/master/Documentation/...
- iainmerrick 10y agoHuh, the meaning of the name hadn't even occurred to me! I guess I just think of it as the Common Microsoft Language Runtime. :) It seems like alternate languages on the CLR have never really caught on, even though in principle it's more flexible than the JVM. The only ones you hear much about are C# and F#. Compare to the JVM where you have Java, Scala, Clojure, Kotlin. And neither the CLR nor JVM seems to have caught on for low-level, performance-critical code (game engines, scientific programming, deep learning). I guess people feel the garbage collection and bounds checking add too much overhead. So the new fashionable approach seems to be portable machine code, very close to the way real hardware behaves. If you want bounds checking and garbage collection, do it yourself.