86 points · by MichaelFBryan · 6y ago · 84 comments
Reading a bit of mainframe history would do some good it seems.
> we’ve encountered the dilemma where you want to make it easy for users to write their own application logic using the system but at the same time want to keep that logic decoupled from the implementation details of whatever platform the application is running on
A common problem with a whole range of solutions. A decade or two ago the "obvious" choice would have been Java bytecode instead. Even the little "BASIC Stamp" microcontroller system matches this description.
I don't know, I know nothing about mainframes. I do not understand if your criticism is that they are making mistakes that have already been solved half a century ago (which is a good criticism, if true) or that they are not giving proper recognition.
The new shiny thing about WASM is that it fits into the constraints of the web platform. I suspect that even the best mainframes bytcodes had at least slightly different constraints.
I would really like a discussion and a comparison of them, seriously, I would read any such article I could find as the topic is interesting. But comments like this feels a lot like a hipster hating on the mainstream.
Chrome PNaCL SDK came with C, C++ and OCaml support, with an open source version available, which Mozilla refused to use and came up with asm.js instead.
I wonder if anyone has a list of awesome mainframe features so that we know what modern computing is going to "invent" next? :P
(See also: hot-swappable parts, virtualisation, containers, etc... I never got to work with mainframes myself, just each time I dig into some new "industry game-changer" tech, I learn that mainframes had it in the 60's)
The trick is identifying which parts were abandoned by mistake, and which parts were abandoned because they were genuinely bad. Nobody wants 21st century JCL. https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/...
So it has actually a chance to not be limited to one ecosystem or one company.
In fact, the simple idea that it's going to have a monopoly in the browser pretty much guaranties a broad attempt of adoption.
JVM and main frames could have been it, but they never were.
Let's try if we can make it work with a different name this time.
And some of them, also with multiple vendor offerings.
Chrome already has preview features available, that other browsers might adopt, or not.
And one of the most successful 'Portable execution format' nowadays I believe is JavaScript. WASM is just a sequel of JavaScript.
However if this is done through a simple reinventing the wheel route, there is a high chance of hitting the same walls and repeating the same mistakes.
This is kind of similiar to a "let's rewrite this code from scratch in new shiny lang/lib/framework" with the expectation that new code will be bug-free from the start. It's not always bad, it is sometimes necessary or it may turn out to be more effective than trying to fix bloated code. But very often the new code has problems exactly the same as previous code and effectively the developers reinvent the wheel multiple times in the process of rewriting.
It is just pointing out people likes to reinvent technology every once in a while with 95% of the same thing. And it is not apparent whether those doing the "reinvention" knew what the constrain or trade offs or limitation the previous technology had.
Sometimes these sort of Full Circle makes me wonder if software has really moved forward at all.
I would find a comparison of wasm with older bytecodes very interesting as for sure none of them are perfect. But this kind of reply is clearly dismissive. It contains no criticism and it offer no insight over why some failed and other succeeded.
I essentially see it as lamenting that another similar technology was/is treated unfairly. Which is a fine comment, since many technologies meet a unjust or undeserved demise. It is still irrelevant as essentially boils down to "how dare you succeed where others have failed".
This is even worse than just saying that it is bound to fail miserably the same way Java applets did.
There are for sure negative sides to wasm, the fact that many parts are similar to past ideas is simply inconsequential on the merits.
HN top comment on dropbox wasn't really wrong either. Triviality proved to be a valid point. Plenty of companies made similar software once they saw there was a need for it. I mean who still uses dropbox today?
I'm quite sure that very often the "reinvention" is literally a reinvention - that is not based on previous invention, but an independent solution that just happens to be similiar to something created earlier (without the reinventors knowledge of the existing previous invention). With an abstraction level high enough, many concrete problems become one abstract problem with a few abstract solutions, and sometimes only very few "obvious"[0] solutions. This leads to a situation when many independent persons/teams come up with a concrete solution to their concrete problem that coincidentally happens to be very similiar to other solutions. If one of those solutions where created in the past, and others where rediscovered later, we then retrospectively call those later solutions as "reinventions" regardless of them being literal or just figurative reinventions.[1]
[0] in this context "obvious" defined as "most likely to be independently found/created by any sane person"
[1] "literal reinvention" being a solution that was consciously based on some previously existing invention and a "figurative" when it just happens to be similiar to something created in the past but the inventor did not (consciously) base their work on something already existing
The problem with WASM here, is that it really is a bloated model like JVM in its early days, huge amount of work is needed to make it closer to native speed, which is contradictory to the original slogan. What's more, people are still planning to add tons of new features to it: https://webassembly.org/docs/future-features/. Before you tell me those are opt-in features, the question I want to raise is: for an abstraction of general platform, you would definitely want to have a widely accepted standard so people know what features will be expected, one example is that people know SSE will be available for 64-bit x86 code.
With all those opt-in features, I doubt if we can have a proper layer that adapts well to different implementations with different supported features. We might end up with the situation like Rust, where you can claim a secondary compiler could exist, but in practice people are all using the same compiler/implementation.
Tech doesn't need to be perfect, the best, or even very good to win. They need to have a killer feature and a low cost of adoption.
Wasm seems on the right tracker for that.
This is a powerful statement actually. Could be applied to any tech startup product.
My understanding is that this intuition is usually untrue, because a JIT benefits from the stack-based code preserving code flow and thus allowing more efficient code generation.
And of course JIT can make WASM fast but if you look around, building a performant WASM JIT still remains terribly hard, some implementation even needs LLVM to perform optimizations. I'd say if this is the case, we must've chosen the wrong model.
Why? Optimizing machine-independent code for a particular machine is part of the "core business" of LLVM, up to the point where a sufficiently capable bytecode/optimizer becomes comparable to LLVM.
OTOH, if the main argument here is the size/speed/other weight of LLVM, then of course the host machine that wants to run WASM only needs a tiny subet of LLVM: no frontend, single backend, only a subset of optimization passes... There is also a tradeoff to make to leave optimization passes out that actually improve the code a bit but are too heavy for the host machine.
Isn't WASM (as of its MVP) quite simple VM model compared to other VMs?
I agree with your concern about the new futures though. It might introduce another hell of segmentation.
In what way? This discussion lacks specifics. Doesn't this also risk tying you to a specific machine, which is the opposite of the intent?
However I do agree with WASM everywhere fashion complaint.
E.g. Consider in C int foo[sizeof(void*)];
If I were him, I'd have used this as an excuse to play with NativeClient.
--
The original paper on SFI was by Robert Wahbe and colleagues: https://cs155.stanford.edu/papers/sfi.pdf.
Google's NativeClient is a modern take on SFI for x86: https://static.googleusercontent.com/media/research.google.c....
1. People need to be able to upload new code while the system is still running 2. This application will be interacting with the real world (think robots and automation), and we really don’t want a crash in user-provided code to make the entire system stop responding
is suspiciously close to Erlang, except for the user-provided part.
In what sense can a wasm program "crash?" What sort of backtraces are available in that event? How's the debugging story?
Is there a fast wasm runtime available for non-JIT platforms? Is there big-endian support (still hanging on)?
I'm not sure exactly what you mean with non-JIT platforms, As far as I know, most wasm hosts that generate native code just compile the entire wasm module at once, so its less like a JIT runtime and more like a regular compiler.
If you mean not compiling to native code at all, then you just have the performance of a plain old stack machine bytecode interpreter. Not sure how many there are currently and how well optimized they are though.
About big-endian - afaik little-endian is just the spec for storing to wasm's linear memory - the actual representation of stack values can be arbitrary (since you can not inspect their bytes directly).
I'm not an expert in wasm but memory allocation may fail depending on the host environment. Also, runtimes of higher languages may define their own crash cases. As it is a stack machine dumping a stacktrace in case of "crash" should be easy.
> Is there big-endian support?
Wasm still assumes little-endian byte ordering. Honestly who really cares about big-endian?
https://github.com/WebAssembly/design/blob/master/Portabilit...
Yes, Wasmtime can do AOT. Many other runtimes can do AOT as well.