Live data from Hacker News

Spin – WebAssembly Framework

fermyon.com

31–40 of 76 posts

Re: Spin – WebAssembly Framework

#31
post #11

Earlier quoted context omitted.

People bashed Java and .NET Application Servers, it turns out they actually had some cool ideas in them. Naturally now they have to be packaged and sold as a new revolutionary idea for the newer generations.

Since no company owns WebAssembly I'd call this repackaging a win.

WebAssembly co-developed by " W3C; Mozilla; Microsoft; Google; Apple" and unless they put the people to develop it further, it stays at it is.

And I wouldn't be surprised if some of those companies wouldn't be feeling like patent ways to compile and optized WebAssembly into native code, or anything else related to tooling.

Re: Spin – WebAssembly Framework

#32
I'm not too familiar with WebAssembly but I like the concept of compiling different source languages to a common "bytecode" language so it can run on various platforms.

However, with the way things are currently going, are we using WebAssembly to reinvent the concept of Java applets? It all sounds very familiar. And if this is the case, will it run into similar problems?

Re: Spin – WebAssembly Framework

#33
post #32

I'm not too familiar with WebAssembly but I like the concept of compiling different source languages to a common "bytecode" language so it can run on various platforms. However, with the way things are currently going, are we using WebAssembly to reinvent the concept of Java applets? It all sounds very familiar. And if this is the case, will it run into similar problems?

It's much lower level and has a robust sandboxing model, so the security issues with Java are not really a concern here. There are still security risks but they're different ones and generally less severe.

Because it's lower level it's a more viable compile target for things that couldn't easily be compiled to Java, like C++ for example.

Re: Spin – WebAssembly Framework

#34

I am sure this has been answered before, but a quick google search didn't really clear this up for me but... I don't quite understand the usage of WASM on the server side (not denigrating, just looking for an explanation). If you are using rust, can't you just compile it down to a binary and run that on your server? Or is the main advantage the sandboxing? Or is the idea you have a bunch of wasm compatible servers an…

I'm the author of a Wasm on the server side runtime[0] that focuses primarily on rust compiled to Wasm, and this question comes up quite often. Why compile to Wasm if you can compile to native code directly? To add to Radu's answer, here are some of my favourite reasons. Having an in-between bytecode layer allows you to build application architectures in rust that would not be possible when compiling directly to mach…

Thanks for the response. Lunatic seems like a really interesting piece of software. Allowing you to run anything that compiles down to wasm seems like an awesome opportunity for a platform to solve some of the headaches of current serverless setup.

Re: Spin – WebAssembly Framework

#35
post #32

I'm not too familiar with WebAssembly but I like the concept of compiling different source languages to a common "bytecode" language so it can run on various platforms. However, with the way things are currently going, are we using WebAssembly to reinvent the concept of Java applets? It all sounds very familiar. And if this is the case, will it run into similar problems?

(one of the authors of Spin here, and a WebAssembly enthusiast.)

There are, of course, a lot of similarities between the Java or .NET runtimes and WebAssembly, and other comments made excellent points about the lower level nature of Wasm, or the isolation sandbox.

I would also point out that there are significantly more languages that either have support for compiling to WebAssembly today, or that have started adding support (in the last month alone there were initial announcements for Python, Ruby, and .NET, for example).

Re: Spin – WebAssembly Framework

#36

I am sure this has been answered before, but a quick google search didn't really clear this up for me but... I don't quite understand the usage of WASM on the server side (not denigrating, just looking for an explanation). If you are using rust, can't you just compile it down to a binary and run that on your server? Or is the main advantage the sandboxing? Or is the idea you have a bunch of wasm compatible servers an…

I'm the author of a Wasm on the server side runtime[0] that focuses primarily on rust compiled to Wasm, and this question comes up quite often. Why compile to Wasm if you can compile to native code directly? To add to Radu's answer, here are some of my favourite reasons. Having an in-between bytecode layer allows you to build application architectures in rust that would not be possible when compiling directly to mach…

But you can already do this with DLLs or with SOs files. You can keep your network logic for example inside another module (perhaps the host app) and then load the logic that acts on the received data as a dll.

Process separation and IPC natively using a library such as Qt is literally a few hundred lines of code.

Re: Spin – WebAssembly Framework

#37
I have a demo Spin application running on a small VPS [1] and the performance is amazing. It boggles the mind that the server is loading the WASM, instantiating a runtime, parsing markdown, applying templates, etc. all in just a few milliseconds. You can see the source for the blog [2], and the original blog engine Bartholomew [3] that it's based on.

Note this is a toy deployment, not actual content. Don't expect all the links to work or any content to be accurate or relevant :)

[1] https://spin.brian.dev/blog/2022-03-18-caddy-zero-downtime [2] https://github.com/bketelsen/wasmblog [3] https://github.com/fermyon/bartholomew

Re: Spin – WebAssembly Framework

#38

I have a demo Spin application running on a small VPS [1] and the performance is amazing. It boggles the mind that the server is loading the WASM, instantiating a runtime, parsing markdown, applying templates, etc. all in just a few milliseconds. You can see the source for the blog [2], and the original blog engine Bartholomew [3] that it's based on. Note this is a toy deployment, not actual content. Don't expect all…

(one of the Spin authors here.)

This is so cool! The Spin documentation website (https://spin.fermyon.dev) is also served by Spin itself, running on a Nomad cluster, with the same blogging engine mentioned here.

We're really looking forward to improving the rolling deployments, but it's really great seeing something like this live!

Re: Spin – WebAssembly Framework

#40
post #39

Webassembly is growing fast. Do you think running a Java Swing application is going to be possible in the near future on Wasm in a browser?

(one of the Spin authors here.)

I'm not all that familiar with the Java ecosystem, but I seem to recall the CheerpJ people having examples for running Swing applications in the browser. (I don't know much about how their solution works, or whether it's open source.)

https://cheerpjdemos.leaningtech.com/SwingDemo.html

Post reply on HN