News for hackers. Stuff that matters.
Re:Extensible WASM Applications with Go by coder543 on Friday February 14, 2025 @04:03AM (#43046373)
> Which will always be the best DX for writing code in the browser.

The article we're all commenting on is not about running WASM in the browser. WASI in particular may never be supported by browsers.

Re:Extensible WASM Applications with Go by jbreckmckye on Friday February 14, 2025 @04:15AM (#43046461)
I'm aware of the article's context but that just raises further questions. Why invest much effort, as a developer, or as a vendor, in a version of WASM that doesn't even let you run client side? It's carving an ever smaller niche.
Re:Extensible WASM Applications with Go by boomskats on Friday February 14, 2025 @04:57AM (#43046748)
> I'm aware of the article's context but that just raises further questions. Why invest much effort, as a developer, or as a vendor, in a version of WASM that doesn't even let you run client side? It's carving an ever smaller niche.

Because of the value it can deliver server-side, and that's where most of the value tends to be.

Server-side compute is the core of most companies' revenue streams, yet it really is bloating out of control. Think about how much money is wasted on build pipelines, artifact storage, giant image distribution, multi-tenant workload isolation, supply chain risk mitigation; how expensive cloud infrastructure is, and what a substantial share of it is spent on all of those. With the way WASM was designed, it has the potential to completely upend all of it: tiny binaries, sandboxed runtimes, tightly knit mt, instant scaling, clearly defined contracts, language agnostic microservices. It's a completely different world.

The potential for WASM in enterprise compute is immense - especially with the recent developments in the component model and WASI. We're talking about orders of magnitude improvements here.

Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @09:33AM (#43048701)
Just wait until they figure out WASM Application Servers, using serialised WebAssembly for server to server messages, now that would be an idea.
Re:Extensible WASM Applications with Go by boomskats on Saturday February 15, 2025 @04:52AM (#43057314)
They could call it wRPC or something
Re:Extensible WASM Applications with Go by rvolosatovs on Tuesday February 18, 2025 @11:29AM (#43091575)
Funnily enough, that's what [wRPC](https://github.com/bytecodealliance/wrpc) is designed to do, using the small and efficient [Component Model Value Encoding](https://github.com/WebAssembly/component-model/blob/main/des...), largely based on [Core Wasm spec](https://webassembly.github.io/spec/core/).

For example, here's an example of a Web App using [`wasi:keyvalue` interface](https://github.com/WebAssembly/wasi-keyvalue/) via WebTransport using wRPC: https://github.com/bytecodealliance/wrpc/tree/8e9de3b446ac05...

Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @09:32AM (#43048692)
And on that regard, there are more mature options out there, than reinventing the wheel with WebAssembly.
Re:Extensible WASM Applications with Go by coder543 on Friday February 14, 2025 @09:36AM (#43048750)
Do those "more mature" options support architecture-independent executables written in Rust or Go, so that a company doesn't need to rewrite their existing code in Java?
Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @09:42AM (#43048814)
Well, depends if they target LLVM IR, or .NET MSIL.

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

https://github.com/FractalFir/rustc_codegen_clr

Also ever heard about containers?

They have this magic feature, you don't need to rewrite anything to run on servers.

Re:Extensible WASM Applications with Go by coder543 on Friday February 14, 2025 @09:48AM (#43048870)
Containers are a much heavier way to implement a plug-in system, since you will also need to define an RPC of some kind, and they're not architecture-independent unless you require the users to build every container for every architecture. Containers generally aren't a security boundary, but you can wrap them in something like firecracker to help with that. (I believe plugins were an essential part of the context, based on the post we're commenting on, so it is important to evaluate these options against that.)

LLVM IR as it is actually generated is also not architecture independent, and not a security boundary, making it a poor way to do a plugin system. Definitely not more mature for this type of stuff.

.NET MSIL is probably a better fit than the other two options you provided, but not a good one... I don't think Go or Rust compile to MSIL, and MSIL probably isn't a very good security boundary anyways.

I know from past discussions that you don't like WASM. I think you're overly dismissive of it. WASM has been around long enough now that it is a fairly mature system. I haven't personally needed it, but that's simply a comment on my own work experience, not the usefulness of the technology for specific use cases... and I can easily see why people are passionate about WASM. It's not NIH syndrome.

Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @09:54AM (#43048925)
If you want a plugin-in system, maybe don't pick a language with static linking, and an half-backed plugin implementation in first place.

WebAssembly outside of the browser is a solution looking for a problem that has been sorted out multiple times since the idea of bytecode based execution exist, 1958 to be more precise.

Even on the browser its use, besides bringing back the old plugins is debatable, using GPU compute is much better for number crunching, with much better tooling.

Re:Extensible WASM Applications with Go by coder543 on Friday February 14, 2025 @09:58AM (#43048969)
Yes… I’m aware of the history. I’m also aware that WASM solves problems that those previous ones didn’t. Otherwise you would have provided an option that actually met the requirements, if there are so many to choose from.

> If you want a plugin-in system, maybe don't pick a language with static linking

Or… a plugin system could “just work”, without placing unnecessary restrictions on what I do.

Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @10:59AM (#43049732)
It starts by choosing the right language for the job.
Re:Extensible WASM Applications with Go by apitman on Friday February 14, 2025 @01:17PM (#43051311)
The right language for a plugin system is the one that attracts the most plugin writers. Supporting many languages is a huge boon for wasm in this department. It's one of the things that makes the JVM and .NET so appealing in the first place, but WASM is better than both combined when it comes to language selection.
Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @01:43PM (#43051622)
That surely isn't any WebAssembly then, if we are counting adoption growth throughout computing history.
Re:Extensible WASM Applications with Go by orf on Friday February 14, 2025 @10:14AM (#43049145)
How do I prevent my statically linked plugins from having any filesystem access, or a bug messing with memory it doesn’t control once it’s loaded?
Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @10:59AM (#43049725)
OS IPC and security configuration, no need to add a WebAssembly runtime and compiler toolchain.
Re:Extensible WASM Applications with Go by orf on Friday February 14, 2025 @11:01AM (#43049760)
So: slow, hard, complex and highly OS specific vs simple and secure.

Right.

Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @01:42PM (#43051602)
Because WASM tooling is so much better, thank goodness for emscripten.
Re:Extensible WASM Applications with Go by orf on Friday February 14, 2025 @02:19PM (#43051989)
Don’t argue in bad faith, especially if you’ve got nothing substantial to add to the discussion or any real points to make.
Re:Extensible WASM Applications with Go by apitman on Friday February 14, 2025 @01:09PM (#43051217)
I'm not aware of any tech other than wasm that I could be using to implement decent-auth: https://github.com/lastlogin-net/decent-auth

Things like JVM and .NET are great, but not designed to be embedded other languages.

Re:Extensible WASM Applications with Go by pjmlp on Friday February 14, 2025 @01:40PM (#43051576)
Dynamic libraries come to mind.
Re:Extensible WASM Applications with Go by apitman on Friday February 14, 2025 @07:44PM (#43054692)
You have to recompile for every architecture and OS, and no security features.
Re:Extensible WASM Applications with Go by neonsunset on Friday February 14, 2025 @04:39PM (#43053349)
.NET does support embedding:

- As full runtime i.e. hostfxr https://learn.microsoft.com/en-us/dotnet/core/tutorials/netc... (supplementary: https://github.com/StudioCherno/Coral)

- As a dynamic library via DNNE with full runtime: https://github.com/AaronRobinsonMSFT/DNNE

- As either dynamic (easy) or static (hard) native library: https://github.com/dotnet/samples/tree/main/core/nativeaot/N...

There are a few community projects which build on top of these to provide a more seamless integration with other languages.

Re:Extensible WASM Applications with Go by apitman on Saturday February 15, 2025 @09:13AM (#43058629)
That's actually really cool, thanks for sharing. Does seem pretty low level and niche though.
Re:Extensible WASM Applications with Go by neonsunset on Saturday February 15, 2025 @11:53AM (#43059981)
It is very popular in gamedev space whenever using C# as a high-performance scripting language.

You are right to say this is low-level though, but low-level scenarios are not as niche for .NET platform as they are for other languages in this category.

Re:Extensible WASM Applications with Go by marwis on Monday February 17, 2025 @04:23AM (#43076873)
You can embed JVM with JNI_CreateJavaVM(): https://docs.oracle.com/javase/7/docs/technotes/guides/jni/s...

It is used used by projects like Postgres PL/Java, LibreOffice and various native Java launchers/wrappers