News for hackers. Stuff that matters.
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by jinwoo68 on Tuesday May 30, 2023 @11:59AM (#36126419)
I think you're basically correct. But wasm isn't tightly coupled with a single programming language, like Java did. Of course, other languages can target JVM too, but there's not much momentum there. With wasm, we have many different implementations written in many languages running in many different platforms. I think it's a good thing.
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by pjmlp on Tuesday May 30, 2023 @12:31PM (#36126890)
Except JVM never was the only bytecode format in the history of computing.
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by inadequatespace on Tuesday May 30, 2023 @12:19PM (#36126685)
> not much momentum

Scala? Kotlin?

To be fair these came into play WAY after the JVM

Re:WASIX, the Superset of WASI Supporting Threads, Processes... by greenyoda on Tuesday May 30, 2023 @12:38PM (#36126990)
Also Clojure.
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by throwaway894345 on Tuesday May 30, 2023 @12:48PM (#36127157)
These are all languages that were designed expressly to run on the JVM, whereas WASM aspires to support existing languages. I'm not familiar with JVM bytecode (and would love to hear from someone who is), but I'm guessing the JVM bytecode offers less in the way of low-level control over memory allocations and so on which would be required to compile C, C++, Rust, Go, etc programs with reasonable performance characteristics?
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by brabel on Tuesday May 30, 2023 @02:49PM (#36128904)
JVM bytecode assumes the GC allocates and frees memory, so no, you don't have direct access to memory... though the Java standard library does let you allocate bytes and manage those yourself[1], not sure if you would consider that "more control over memory allocations".

JVM bytecode is quite approachable: https://en.wikipedia.org/wiki/List_of_Java_bytecode_instruct...

And does look superficially similar to WASM instructions. When WASM gets GC, I have trouble seeing what's fundamentally different between the two, to be honest... even something like (parts of) the Java stdlib will be available to WASM with the WASI API, making the difference too small to distinguish them into different categories IMO.

[1] https://blogs.oracle.com/javamagazine/post/creating-a-java-o...

Re:WASIX, the Superset of WASI Supporting Threads, Processes... by throwaway894345 on Tuesday May 30, 2023 @03:54PM (#36129777)
> though the Java standard library does let you allocate bytes and manage those yourself[1], not sure if you would consider that "more control over memory allocations".

That's interesting. So if you wanted to build a C compiler targeting the JVM, you would just request a big byteslice from the API and implement your own stack + heap on top of it (such that you never actually use the JVM GC)?

> And does look superficially similar to WASM instructions. When WASM gets GC, I have trouble seeing what's fundamentally different between the two, to be honest... even something like (parts of) the Java stdlib will be available to WASM with the WASI API, making the difference too small to distinguish them into different categories IMO.

It sounds like the fundamental distinction is that WASM will have both manual memory management APIs as well as GC APIs while Java will only have GC APIs.

Re:WASIX, the Superset of WASI Supporting Threads, Processes... by pjmlp on Tuesday May 30, 2023 @03:24PM (#36129349)
CLR was designed for C++ as well. About 20 languages supported on release day.

IBM TIMI was designed for C and C++.

Amsterdam Compilers Toolkit was designed for Pascal, Modula-2 and C.

Nothing new really.

Re:WASIX, the Superset of WASI Supporting Threads, Processes... by throwaway894345 on Tuesday May 30, 2023 @04:00PM (#36129880)
I'm not really arguing that WASM was the first to target previously existing languages, I'm arguing that WASM has a reason to exist because (1) it's an extant project and (2) it solves for other requirements (e.g., streaming compilation) that weren't previously addressed. I could well be wrong, and if so I'd genuinely like to hear how CLR actually solves all of WASM's requirements (essentially how we should have just shoved CLR into browser engines and called it a day!).
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by pjmlp on Wednesday May 31, 2023 @12:40AM (#36134531)
CLR didn't need to be shoved into the browser, it was there already via ActiveX first and Silverlight second.

As for the others since 1950's, plenty of stuff to study there.

Re:WASIX, the Superset of WASI Supporting Threads, Processes... by ecnahc515 on Tuesday May 30, 2023 @01:06PM (#36127425)
Those languages are very much designed around the JVM though. You have Scala, but not eg: C++, because the JVM itself is much higher level than what many languages would want to target.
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by duped on Tuesday May 30, 2023 @01:39PM (#36127885)
Arguably, JVM languages have much better tooling for them to be designed and interoperable (through Truffle and GraalVM) than WASM where everyone has to write a backend (or use LLVM which has its downsides).
Re:WASIX, the Superset of WASI Supporting Threads, Processes... by brabel on Tuesday May 30, 2023 @02:43PM (#36128815)
The GraalVM JVM can run LLVM bitcode, hence C++:

https://www.graalvm.org/22.0/reference-manual/llvm/