5 ms·
Wait a second... I thought Java was supposed to do this with the JVM... I thought .Net was supposed to do this with the CLR... What's different now?
by gwbas1c 8y ago
Wait a second...
I thought Java was supposed to do this with the JVM...
I thought .Net was supposed to do this with the CLR...
What's different now?
- vardump 8y agoDifferent use cases. You don't necessarily want a 10 ton standard library for every use case, like on embedded devices or plugins for a software package. C/C++/Rust being 1st class citizens is also very useful.
- arcticbull 8y agoStandard libraries are what make languages useable. In my experience there's a solid case to be made for a 10-ton standard library (for targets with an operating system) or basically none whatsoever (for embedded). A thin standard library is always going to be too small to do useful things easily at the high level and too big to be deployed on an embedded system. Rust is good because it can play in both sandboxes.
- kllrnohj 8y agoFor embedded devices you'd always be better just compiling C/C++/Rust directly to the native code. You don't have any portability possibility there in the first place anyway, so why ship inferior code gen with arbitrary restrictions?
- vardump 8y agoBecause you want to be able to dynamically load semi-trusted code on a microcontroller without MMU and run it without having to worry it could crash the whole thing?
- ex3ndr 8y agois it really a use case for WASM?
- kllrnohj 8y agoDo you have an actual example of such a thing? I'm struggling to come up with a case of multiple independent mini-programs in such a microcontroller that needs, or even benefits, from that level of fault isolation.
- vardump 8y agoRapid prototyping, replacement for a scripting facility, diagnostics filtering & output, a platform for "apps" for a small IoT type devices and just the ability to run the same plugin anywhere you please. It can be an enabler for new innovations. Even if it runs 2-10x slower than native code. And what if the answer was just: just because I can? That's how a lot in our industry got started.
- pjmlp 8y agoAh, just like JavaCard.
- GordonS 8y ago.NET's '10 tonne' standard library is a decent part of what makes it so usable. And it's not exactly massive either - I can publish a standalone .NET Core app that's only around 30MB in size. For the usability and GC, I'll take that over C any day.
- naasking 8y ago> I can publish a standalone .NET Core app that's only around 30MB in size. Honestly, it shouldn't need to be that big. There's plenty of cruft even in .NET core.
- rndgermandude 8y agoThat will probably come done quiet a bit when illink gets out of alpha. It is basically a tree-shaker to eliminate dead/unused stuff from the resulting standalone binary. https://github.com/dotnet/announcements/issues/30 https://github.com/dotnet/announcements/issues/30
- naasking 8y agoA tree shaking linker will definitely help a lot, but there's still some runtime baggage that probably can't be removed. For instance, dynamic loading and all of the related type and assembly metadata structures. I look forward to seeing what they can do!
- arcticbull 8y agoNow it's got JavaScript in the mix ;) but honestly I can't tell either.
- mntmoss 8y agoA decade and change has passed, so we get to do it against a new set of I/O concepts and performance concerns. Those are always the factors motivating new software standards. I did evaluate WASM as a native runtime environment recently, pre-WASI. If what you're doing can coexist with memory mapped I/O, you don't have to have an explicit interface of this type, you can just say "lower region of linear memory is where the I/O goes" and hardcode all APIs against that. It's more "honest" in certain ways than a syscall interface since it doesn't lead to any parsing of intent or variable expectations around resource usage.
- mhh__ 8y agoDoes it matter? I don't really see the issue with competing standards if the standards are open: The "best" (for some definition of best) should win out eventually. Anything other than Electron if it comes to it
- emerongi 8y agoWe could re-implement C as well, but is it sensible if we already have C? If someone could explain the difference between WASI and JVM the way you can explain the difference between C, C++ or Rust, it would help a lot. If there is no such explanation, I think we should really question what is being accomplished here. As it stands currently, WebAssembly seems to integrate nicely with browsers, whereas JVM works nicely in native environments. I'm a younger developer and only partly remember the days of Java on the web, but is there a reason for why JVM is not suitable in web environments? I.e. why WebAssembly -> Native, not JVM -> Web?
- nepeckman 8y ago> If someone could explain the difference between WASI and JVM the way you can explain the difference between C, C++ or Rust, it would help a lot. I'll take a stab at it. While both WASM and the JVM aim to be portable virtual machines, WASM prioritizes sandboxing / security and a smaller runtime. A host should be able to easily set up WASM with restricted access and expect that the WASM program is secure. As far as I know, the JVM doesn't have an equivalent feature, or if it does, it's a lot more complicated.
- pjmlp 8y agoNah, just bytecode verifiers, security managers and access capabilities, but whatever.
- Yoric 8y agoIt really very much has :) On the other hand, I seem to remember that the security model was (somewhat) adapted to the threat at hand when it was designed (~25 years ago). I haven't kept tabs on it, so I don't know how well it has aged, but there's a chance it doesn't work anymore.
- eximius 8y agoyou can use html/css/js with it, I guess :/ Or, more accurately, its easy to make UIs for it? I'm personally bearish on the whole idea from a community / technical standpoint (in that I'd like us to return to more native stuff than follow JS into the browser), but I can't argue that WASM and co won't enable some really cool uses.
- dahfizz 8y agoI can't shake the niggling idea that this, just like node before it, is more or less a way for JS web devs to not have to leave the ecosystem they're comfortable with and learn a new language. We already have hundreds of ways to write native UI applications, but web devs can't bother to use them.
- Jarwain 8y agoCouldn't a native developer also take advantage of wasm/wasi to build their native application to a single build target/binary, which could then be run on Any machine?
- dahfizz 8y agoCross platform is in no way new. There are already plenty of ways for native devs to target multiple platforms at once if that's required.
- morgancmartin 8y agoBut are any of those ways both at the assembly level (speed) and decoupled from the runtime (space)? My takeaway from WASI is that it would allow for a single universal runtime with near-native execution. The near-native aspect being what other universal runtimes like the JVM and CLR lack due to their bundling of a GC and other non-essential features.
- usrusr 8y agoWhen you put WASM into something that isn't a browser then it still won't be a browser afterwards. WASM is not DOM+CSS. On top of that, JS devs would be the ones who get the short end of the stick, because js is the one language that does not compile to WASM because where WASM comes from, you already have a JS environment, no need to build a second one inside WASM.
- otabdeveloper2 8y agoThe JVM and CLR suck balls. They put in huge amounts of effort into things that don't need solving, and the things that need to be solved they do in the most roundabout way possible. What we _really_ need is a sandboxed VM for running C code securely and efficiently. The JVM is pretty much the opposite of that; it's not sandboxed, not secure and certainly not efficient as a target for C code. We're hoping WASM starts over from scratch and does things right this time around.
- Teknoman117 8y ago... 20 years later JVM, CLR, and WASM suck balls. People have been breaking the sandbox for the better part of a decade. We're hoping Cool New Thing™ starts over from scratch and does things right this time around.
- timClicks 8y agoBut isn't that the point? We should be getting better at building software over time. Sometimes that means restarting.
- Hydraulix989 8y agoUNIX is a good counter-argument.
- JeremyBanks 8y agoUNIX is thoroughly obsolete. Its continued use is from inetia; people rarely need anything but a tiny subset of its capabilities, for which there are more simpler alternatives every day.
- maccio92 8y agoare you kidding? do you know how many subsystems that people take for granted are using UNIX? furthermore, how do you get simpler than UNIX? it's not complex..
- layoutIfNeeded 8y agohttps://imgs.xkcd.com/comics/standards.png https://imgs.xkcd.com/comics/standards.png