4 ms·
There’s another reason Wasm succeeded: it’s tiny. I'll agree with him that Java is very much not tiny, but I disagree about Flash. The last time I remember set
by userbinator 8y ago
There’s another reason Wasm succeeded: it’s tiny.
I'll agree with him that Java is very much not tiny, but I disagree about Flash. The last time I remember setting it up, the browser plugin was a single binary of a few MB (and I'm sure that could be made smaller.) SWF files are also a great example of a well-designed space-optimised vector graphics format --- remember that it was designed close to 20 years ago for the computers of the time.
Edit: care to explain, downvoters?
- afiori 8y agoBut flash was not an option for similar purposes because of its terrible security.
- vorpalhex 8y agoFlash runtime was several hundreds MBs. Sure the actual applets were a few mb of mostly animations and resources, but the runtime was another thing.
- deleted 8y ago[deleted]
- aepiepaey 8y agoThe runtime is ~15MB, far from hundreds of MBs.
- stcredzero 8y agoBack in the early 2000's, IIRC, Squeak Smalltalkers succeeded in getting a Smalltalk runtime down to 385 kB. Haters still complained about it being "too fat." There was an R&D project which got one Smalltalk image for a Unix-style command line utility to 45 kB. Back in those days, the standard class library for a VisualWorks Smalltalk image was about 12MB on disk. In contrast, Perl had a runtime of something like 768 kB. Yet, VisualWorks could load its runtime faster, if you tweaked things, like shutting off the boot-up chime and notifier dialog.
- derefr 8y ago> Yet, VisualWorks could load its runtime faster, if you tweaked things For the same reason that Emacs loads quickly: the "image" is (an abstracted, runtime-dependent equivalent to) a memory dump. Perl has to parse Perl code when it starts up; Smalltalk just "is" Smalltalk when it starts up. Like booting up a DBMS where the DB already has data in it. Honestly, I'm kind of surprised more modern languages/runtimes don't take this approach. The Smalltalk approach would work exactly as well for e.g. Ruby.
- simcop2387 8y agoIt leads to a lot of issues with the end design of everything. You either have to reconstruct the heap and all the pointers involved, or it has to be loaded at a known address. With things like ASLR, and a bunch of other security features this ends up difficult or impossible to do directly anymore. Along with that, it also means that the runtimes aren't cross-compatible at load time so weird differences might leak out (little or big endianess, etc.). It leads to a lot of headaches because of changing systems underneath it.
- icedchai 8y ago20 years ago, indeed, Java wasn't tiny. That was on "high end" desktop computers with roughly 64 to 128 megs of RAM. Today, in the days of browsers taking up gigabytes of memory, it's hardly a concern. That applet JVM would start lightning fast.
- leshow 8y agopepperflash plugin, the flash runtime that chrome includes, is about 20mb.
- hackcasual 8y agoIt's not tiny in the sense of file size, it's tiny in the sense of scope. It doesn't even have a standard library, let alone offer everything flash and Java did. At it's heart it's just a compact, efficient representation of a subset of JavaScript
- sitkack 8y ago> At it's heart it's just a compact, efficient representation of a subset of JavaScript WASM is a well specified encoding for a stack based machine with the following 4 types, i32, i64, f32 and f64. It is very much not JavaScript. https://github.com/WebAssembly/design/blob/master/Semantics.md https://github.com/WebAssembly/design/blob/master/Semantics....
- steveklabnik 8y agoIt's so much not JavaScript that you cannot even compile JavaScript to wasm!
- int_19h 8y agoWait... why? What's the limiting factor?
- steveklabnik 8y agothere’s not a lot of reason to. In the browser, you already have a JS environment. It’s easier to add a wasm environment to it than it is to re-write the world. Additionally, wasm doesn’t have a GC, and is not really optimized for dynamic languages, so there’s just not a lot of reason to do it.
- int_19h 8y agoOh, I thought you mean that there's some fundamental reason why it can't be done. Ofc it's pointless today, but I wouldn't be surprised if JS in browsers eventually becomes a layer on top of wasm.