News for hackers. Stuff that matters.
Re:Grain: WebAssembly-First Programming Language by RcouF1uZ4gsC on Friday May 07, 2021 @12:06AM (#27072019)
One of the big issues for a WebAssembly-First programming language becoming big is that Rust is already has a very good WebAssembly story, being a direct compiler supported target.

In addition, WebAssembly was designed to be able to run languages like C and C++ (and Rust) efficiently, and so does not have built in garbage collection.

Thus a language that wants to be WebAssembly first, is either going to have to bring in a garbage collector, have safety with something very similar to Rust's borrow checker (in that case, it would be similar complexity to Rust), or else put the burden on the programmer for safety like C and C++ (in that case, what is the advantage over them).

Re:Grain: WebAssembly-First Programming Language by pjmlp on Friday May 07, 2021 @01:42AM (#27072599)
My x86_64 and ARM CPUs were also designed to able to run languages like C and C++ (and Rust) efficiently, and so does not have built in garbage collection.
Re:Grain: WebAssembly-First Programming Language by Yoric on Friday May 07, 2021 @02:16AM (#27072833)
And Rust runs very well on them :)
Re:Grain: WebAssembly-First Programming Language by bayesian_horse on Friday May 07, 2021 @05:01AM (#27073885)
The burden of entry to learn Rust seems higher than with Grain. And Rust does not have webassembly-centric language features.

C/C++ contains a lot of baggage from other platforms. And has a steeper learning curve. Interoperability with WASM and Javascript is even worse.

Re:Grain: WebAssembly-First Programming Language by azakai on Friday May 07, 2021 @12:43PM (#27077872)
Wasm 1.0 did not include garbage collection, but there is a lot of effort right now by many people to add it (that is what I work on myself currently).

Once wasm has GC, languages like Grain will be able to save a lot on code size, and have some advantages over the "first set" of wasm languages (C/C++/Rust/Zig/etc., all using linear memory), like smaller sizes, less memory fragmentation, and properly collecting cycles with JS.

Re:Grain: WebAssembly-First Programming Language by jedisct1 on Friday May 07, 2021 @09:27AM (#27075604)
Zig supports WebAssembly out of the box, doesn't require GC and has first-class support for WASI.
Re:Grain: WebAssembly-First Programming Language by v8dev123 on Friday May 07, 2021 @09:53AM (#27075853)
Rust doesn't have first class WASM support. It lacks many things Emscripten provides to C++. I'd say C++ has first class support for WASM. Very straightforward to get start!!