223 points · by patrickmay · 10y ago · 55 comments
I can relate to the Web Assembly team's reluctance to add features which are only really wanted by a small subset of users, especially when they only affect the binary size. These features, if implemented, may suffer from poor test coverage. My own preference is that compact binaries are nice but if you're going to use a high-level language, an increase in binary size is just expected (say, an order of magnitude) unless the encoding/VM and language were designed in concert (Java + JVM, or C# + CIL are two examples). Heck, C++ binaries can be enormous.
Then again, I didn't dig deep enough to really understand the nuances of the argument. Perhaps someone could elaborate.
"Please keep in mind that Wasm is not a user-facing language, it is a compilation target. To justify the extra complexity of this feature for its own sake, you would need to come up with convincing evidence that compilers would significantly benefit from it. I doubt that."
https://github.com/WebAssembly/spec/pull/215#issuecomment-17...
And here, as explained in this thread, Wasm is not a user-facing language but the target of compiler, which means that the usual complaints about the somewhat verbose binding constructs of CL's values (which I find acceptable as a user) are not a problem either, since the code ought to be generated from other languages (which might even not define multiple values themselves, but for which a compiler could generate code that use MVR).
It seems that the only acceptable way to produce multiple values for you is to return a composite value. I think that having a dedicated type to represent multiple values is a useful tool to give to the programmer.
Asm.js is a hack made with ducktape and chewing gum, wasm is a solution designed/engineered to solve the general problem - not just smaller asm.js
A clearer call to action would be helpful here. What exactly should members of the Lisp community who care about this do?
It's very low level implementation level detail that enables fast execution of dynamically typed languages. Boxing has high cost and it consumes memory. Type tags embedded in pointers can be very fast. For that to work, you need objects that are aligned with power-of-two byte boundaries.
Adding this feature enables efficient execution strategy for scripting and dynamic languages.
A more appropriate title will be "WebAssembly team doesn't want to listen my ideas on how WebAssembly should work".
> The mission of this group is to promote early-stage cross-browser collaboration on a new, portable, size- and load-time-efficient format suitable for compilation to the web.
See also https://www.w3.org/community/council/wiki/Templates/CG_Chart....
This is a collaborative work where people can make suggestions (I cannot judge if the proposal was fairly evaluated or not).
> WebAssembly team doesn't want to listen my ideas on how WebAssembly should work.
Your title implies that the WebAssembly team has the best knowledge and/or expertise to develop WebAssembly. They are probably expert in their own domain but are willing to take advice from other contributors.
"This masking strategy would in turn require a power-of-two related memory size, and there has been a lot of resistance to this too."
And try to think about the implications it has on the memory model of the VM that is going to execute/JIT Webassemly. A power of two memory model, isn't really viable at this level I think. And you don't need to think a lot about it, to figure out that jumping to 256MB memory, just because your app/page needs 130MB is a bit of counter-optimization :)
The resistance is the sensible thing to do in this case :)
BTW2, time to appreciate how LLVM's approach is superior to JVM madness/religion (and how Golang's is even more clever - do less by doing it right - essentiaistic/minimalistic ascetism)
A VM as user-level OS process which tries to do an OS job and reimplement everything inside a VM is simply ridiculous. Javascript follows the same madeness.
Multi-threading for imperative code is a big mistake, which breaks isolation and results in lock-hell, context-switching nightmare and layers of unnecessary complexity which is impossible to reason about.
Golang and Swift guys got it.
https://www.techempower.com/benchmarks/#section=data-r11&hw=...
Swift is nowhere to be seen and Go is nowhere near the top.
Once it gets going JVM is a beast.
The problem with a modern CPU+OS as a VM is that it cannot be re-implemented on other hardware effectively. you can't pull a piece of software designed to run on the x86+unix "VM" and write a VM to make it run on ARM+Windows. Not fast, not in a way that you'd want to use. Try writing native code translation fast enough that you can run Quake3 without even noticing the difference. That's why VMs exist.
Go is multithreaded and imperative. Sure, it has some nice concurrency features to help you untangle it, but all of the dangers of shared memory multithreading is right there.