Look... I hate the Java language with a burning passion, but the Java VM core technology is perfectly acceptable. So is .Net. There is no reason for webassembly, other than that mozilla wanted to invent something.
Look... I hate the Java language with a burning passion, but the Java VM core technology is perfectly acceptable. So is .Net. There is no reason for webassembly, other than that mozilla wanted to invent something.
Webassembly was designed for sandboxing untrusted code in a webbrowser, giving native like performance and limited functionality.
It just so happened the same characteristics for running untrusted code in the browser work really well for usecases people use AWS Lambda for etc. You have small lightweight applications that have limited system access you need to binpack and have fast startup / low overhead.
Webassembly/WASI isn't replacing the JVM/.NET, it's providing an alternative for specific use cases, running untrusted code in isolated environments that is fast and light weight.
20 years ago I was running untrusted code in isolated environments via application containers like HP-UX Vault and later Java Application Servers.
On top of that, Microsoft enganged with the language community so that there were about 20 other languages available for .NET 1.0 on release date.
Here, diggging through the archives,
https://docs.microsoft.com/en-us/archive/msdn-magazine/2002/...
> One of the exciting things in Visual Studio .NET is its language agnosticism. If a vendor has written a .NET-compliant language, you can use it in Visual Studio .NET. It'll work just as well as C# or C++ or Visual Basic. This isn't just a future feature-in-planning. There are already nearly two dozen languages being developed for Visual Studio .NET: Visual Basic, C#, C++, JScript, APL, Cobol, Eiffel, Fortran, Pascal, Perl, Python, RPG, Smalltalk, Oberon, Component Pascal, Haskell/Mondrian, Scheme, Mercury, Alice, and even the Java language.
Naturally MSIL had to support all of them.
The dynamic runtime came later as side effect from IronPython and IronRuby efforts.
Naturally WebAssembly folks are going to tell you they are the very first of this kind of efforts.
[0]: Adding is favoured over subtracting in problem solving https://news.ycombinator.com/item?id=26727878
In reality,there's no such thing as a container. As far as Linux is concerned, containers are just processes with attributes, because that's what they are, we just decided to complicate it a lot
Look I'm trying to implement a wasm backend into an existing language right now and it could be a lot easier by either making wasm into a real architecture (with registers) or using an existing stack based vm isa.
The text version is basically an ast (with the binary form being a desugared version of that) so you could do whatever you want to transform into something executable.
The universe is much more flexible than you give it credit for.
The conversion from recursion to iteration mandates that all recursive entry points be known ahead of time so you can build a loop/conditional tree. If you want to dynamically load code, this creates two tiers of languages on the runtime.
You really think I haven't thought of this?
If you're trying to integrate WA into a host language the easiest, fastest, and safest way would be to pick up one of the established well-polished compilers or interpreters and calling into it with a standard FFI interface.
For example, if wa wanted to use a coloring allocator it wouldn't be linear time anymore. That's not a fundamental part of it, just an implenebtation choice.
But this whole discussion is out of scope for your use-case. If it's For Fun (tm) that's one thing, but (presumably) this is a practical integration into an existing language. Why are you implementing a VM instead of integrating an existing implementation? Certainly you wouldn't even consider implementing a custom from-scratch implementation of the JVM, the fact that it's even possible to attempt such a thing for WA is already telling about which VM has a better design.
Take your pick: https://github.com/appcypher/awesome-wasm-runtimes
All these VMs and runtimes want to force you into particular ways of thinking about programming. This is terrible for the community. You can say Web Assembly is meant to be an open standard and you can sing that till the cows come home, but leaving out basic support for things like TCO, direct jumps, etc that are vital for compiling any non-procedural language, is just inexcusable at this point.
If only the major companies sit together and agree upon a standard and let multiple VM implementations compete in an open-source manner ... oh wait, that's wasm.
Both are more advanced
What I am saying is that it is Java VM 2.0. The java ISA was perfectly fine. People knew how it worked, there was lots of tooling, etc. Instead of building off that, they made something new... just because. WASM is technically inferior to java, and is based upon the same basic principles. It's just like java bytecode in the 90s. It's not even done yet. This is a terrible mess.