Live data from Hacker News

Standardizing WASI: A system interface to run WebAssembly outside the web

hacks.mozilla.org

221–230 of 238 posts

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#221

Earlier quoted context omitted.

Not a useful question to ask or answer, as the answer is either anything or nothing depending on how nitpicky you want to get or where you feel like drawing an arbitrary line. For example do you consider C++ on Windows to be a proprietary platform, even though C++'s STL isn't proprietary? If so, then WASI on Windows must also be proprietary, no? And if you don't consider C++ to be proprietary, then, you know, you can…

With C++ you have to compile to a specific plattform. So yes, that works, but is different to WASI, where you compile once and can deploy whereever a runtime exists. And apart from that, yes .NET is the only alternative I see today. But you don't see the benefits, of a new lower level option, entering the field?

> With C++ you have to compile to a specific plattform.

In a world where CI servers are plentiful, does this actually matter in the slightest?

And aren't you going to end up doing multiple compiles with WASI anyway since the list of required modules for a platform isn't mandatory?

And even if you only use wasi-core, you're still going to be doing platform-specific builds for either the installer to fetch the required runtime or a fat binary that just bundles it. Most likely the latter, like Electron does.

> But you don't see the benefits, of a new lower level option, entering the field?

Not unless it does something new or acknowledges why previous attempts didn't succeed and how this one will be different.

Plans on doing all the same things but years later and with worse tooling isn't exactly a compelling story for why anyone should touch it.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#222
post #132

Earlier quoted context omitted.

I was careful to say "unmodified." C++/CLI is hardly that. It's also not at all sandboxed the way wasm is. Why the chip on the shoulder?

You're conflating C++/CLI with the MSVC /clr compiler switch. They're distinct. With /clr:pure (which produces CIL only, although it is allowed to use memory-unsafe features like pointers), the entirety of ISO C90 is supported on CLR, with the sole exception of setjmp/longjmp. C++/CLI adds language extensions that allow one to interact with the CLR object model from C++ code. It is only needed if you need to call int…

I'm not conflating anything. And as I said, none of this is sandboxed like WebAssembly so it's hardly a comparison anyway.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#223
post #208

Earlier quoted context omitted.

This is the same reason that things like unikernels have been built for. They haven't taken off because of how difficult it is to rebuild your application to also contain it's kernel, but this kind of sandboxing with WASM and WASI doesn't require that and could likely make things a lot simpler to deal with.

Yep, just like JEE servers deployed bare metal, oh wait.

I'm not sure I get the reference? Could you explain a bit? I know what Java EE servers are, but don't recall anything about bare metal deployments. Comparing my experiences with using JEE and Docker was that they are nothing alike. Just unclear as to your point.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#224
post #150

Earlier quoted context omitted.

Java inside the browser doesn't exist. That's fine. That's not what I'm talking about or making comparisons to. Java runs just fine outside of the browser. You don't even need a browser installed to run Java applications. Javascript and WASM run fine inside the browser, and that's not what I'm talking about or making comparisons to. I'm talking about running WASM binaries outside of the browser. Similar to how Java r…

> Why does WASI need to exist if Java already exists for the intended uses? IMO, the reason is that the market showed that Java never got used like that. I can only speculate on the reasons, but as far as I can tell it comes down to: 1) The sandbox isn't good enough. See my sibling comment -- the separation between WASM and WASI makes a lot of sense, and I don't think Java had that. 2) The fact that you can't port C…

What is blocking C -> JVM compilation?

There seems to be such a compiler here: https://github.com/bedatadriven/renjin/blob/master/tools/gcc...

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#226

Earlier quoted context omitted.

> The JVM doesn't run languages that weren't designed for it, like C or C++ or Rust. You can run all those languages on top of the JVM! The JVM also runs many other languages which weren't designed for it, like Ruby and Python.

> You can run all those languages on top of the JVM! Do you have a source for this? I'm sure it's theoretically possible in a Turing-completeness sense, but considering Java lacks any concept whatsoever of a pointer, and considering that most (if not effectively all) C code uses pointers pretty extensively, I find it unlikely that this statement is meaningfully true without some severe efficiency penalties.

Webassembly came from asm.js, which came from Emscripten. These 3 are a lineage of the same c compilation model targeting a JS Uint8Array as the c heap. Emscripten was published a long time ago, probably 10 years? So, JVM has byte arrays too...

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#227
post #150

Earlier quoted context omitted.

> Why does WASI need to exist if Java already exists for the intended uses? IMO, the reason is that the market showed that Java never got used like that. I can only speculate on the reasons, but as far as I can tell it comes down to: 1) The sandbox isn't good enough. See my sibling comment -- the separation between WASM and WASI makes a lot of sense, and I don't think Java had that. 2) The fact that you can't port C…

What is blocking C -> JVM compilation? There seems to be such a compiler here: https://github.com/bedatadriven/renjin/blob/master/tools/gcc...

I would say it's:

1) There's a large difference between a compiler that exists and an efficient one. The JVM is designed for Java and not C, which makes efficient compilation hard / impossible. Graal as mentioned is an extremely unusual research technique that may make it feasible.

This comment is related:

https://news.ycombinator.com/item?id=19065829

Basically people underestimate how hard it is to make a VM that can run multiple languages. JRuby and Jython work, but it takes heroic efforts.

2) The interface to the OS, as mentioned. You can maybe run some algorithms like image processing, but try running the native sqlite code on the JVM, or something even hairier involving networking. It's not straightforward.

WASI provides something that's closer to what C programs expect than what Java provides. As I said, the market voted with its feet. All the friction adds up. If you try hacking on that compiler or manually porting code, you'll probably get a sense of why that is.

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#228
post #208

Earlier quoted context omitted.

Yep, just like JEE servers deployed bare metal, oh wait.

I'm not sure I get the reference? Could you explain a bit? I know what Java EE servers are, but don't recall anything about bare metal deployments. Comparing my experiences with using JEE and Docker was that they are nothing alike. Just unclear as to your point.

Java was at one point going to have a bunch of CPUs[1] built around the JVM bytecode, that would have allowed J2EE and such to run on the bare metal hardware, but they largely didn't go anywhere.

The most successful attempts that i'm aware of are Jazelle[2] and Java-card[3] plans to augment the software solutions

[1] https://en.wikipedia.org/wiki/Java_processor

[2] https://en.wikipedia.org/wiki/Jazelle

[3] https://en.wikipedia.org/wiki/Java_Card

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#229
post #91

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?

The 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…

Isn't sandboxing solved at the host OS level ?

Android apps are sandboxed Java apps.

Containers turn almost any Linux process into a sandboxed process.

Am I wrong ?

Re: Standardizing WASI: A system interface to run WebAssembly outside the web

#230

Earlier quoted context omitted.

I don't think that web technologies are going to be a good solution to anything that is not the web. The web development community haven't even solved their own problem space very well; spreading to new problem spaces will likely not suit them as much as they believe it will.

You should consider, that you just have a bias against "web people". But this technologie comes not from javascript webprogrammers, but from browsermakers. People who specialize in sandboxing, performance and portability since years. And they had to do this with javascript... and now they want a better foundation, BECAUSE of the flaws of javascript. So I don't know if they will succeed making a better jvm either, but…

I have no bias against "web people", I have a bias against using the wrong tool for the job.

This REEKS of developers who are psyched about WASM and want to create solutions where no problem exists.

If they want performant code outside of the browser, use any one of the 2-3 dozen languages that already do this! WHY is a new runtime, with the inevitable serious security issues that will be exposed throughout it's life, needed for this?

Post reply on HN