News for hackers. Stuff that matters.
Re:Universal Binaries Using WASM by baq on Tuesday February 26, 2019 @04:38AM (#19253065)
actually, the exact opposite
Re:Universal Binaries Using WASM by tyfon on Tuesday February 26, 2019 @05:22AM (#19253224)
This is Java 2.0 isn't it? "Write once, run everywhere".

I wonder how one would solve linking to native libraries and the like through this.

I still prefer just having the application source code available so one can compile it for a specific system.

Re:Universal Binaries Using WASM by austincheney on Tuesday February 26, 2019 @06:19AM (#19253420)
No. Java is a language. WASM is a byte code compile target. A better comparison would be the JVM, such as a language like Scala that is definitely not Java still compiles to the JVM and can run anywhere there is a JVM.

> I wonder how one would solve linking to native libraries

Either use WASM outside the browser (I don't even know if that's a thing) or create some sort of import mechanism using JavaScript.

Re:Universal Binaries Using WASM by cyphar on Tuesday February 26, 2019 @06:55AM (#19253548)
> No. Java is a language [...] A better comparison would be the JVM

I think the point was that it's a reinvention of "write once run everywhere", which had its own problems at the time (such as native libraries). Java introduced the idea, and arguing the fact that the JVM is the reason why it works is a touch pedantic in this discussion.

> Either use WASM outside the browser (I don't even know if that's a thing)

That's what TFA is doing.

Re:Universal Binaries Using WASM by andrewshadura on Tuesday February 26, 2019 @07:16AM (#19253636)
Actually, Oberon first came with it, with JIT compilation of intermediate code into the target code.
Re:Universal Binaries Using WASM by pjmlp on Tuesday February 26, 2019 @07:18AM (#19253646)
The concept goes back all the way to Xerox PARC workstations and Pascal UCSD.
Re:Universal Binaries Using WASM by mrec on Tuesday February 26, 2019 @06:58AM (#19253561)
> use WASM outside the browser (I don't even know if that's a thing)

Not mainstream, but absolutely a thing. There's people even looking at running it in Ring 0.

https://github.com/nebulet/nebulet

Re:Universal Binaries Using WASM by tyfon on Tuesday February 26, 2019 @09:25AM (#19254496)
I thought Java was both a language and a virtual machine target. You can compile programs written in other languages for it's VM like Clojure.
Re:Universal Binaries Using WASM by yarg on Tuesday February 26, 2019 @08:02AM (#19253879)
It should be far more open and lightweight than java.

Linking to native libraries isn't desirable - you don't want to leak your native vulnerabilities into your web browser.

If you have the source however (as you mentioned), using Clang to compile to WASM should be a viable approach.

Re:Universal Binaries Using WASM by tyfon on Tuesday February 26, 2019 @09:17AM (#19254450)
But if this is to be a "universal" binary it has to interface with the OS, the DE and other native programs not just the browser.

If not you will end up with Swing type libraries that look very off compared to native applications.

Same for games really. You usually need to be aware of what platform (hardware and software) your run on and adjust for that to be able to use it optimally.