Live data from Hacker News

WASM will replace containers

creston.blog

61–70 of 371 posts

Re: WASM will replace containers

#61

What sort of tooling is required for wasm? Let's say I wanted to deploy a middle tier in our app, consisting of some nodejs code that talks to an external database. We'd use a Dockerfile, install nodejs or use a source image to build from. How does that work for wasm? Does it have layers to reuse?

You need a toolchain to compile to wasm and a runtime to run it.

Re: WASM will replace containers

#65

Earlier quoted context omitted.

Well, AWS, typically.

Are you sure? Are those instances a VM or another docker container? Does anyone from amazon know?

Depends what part you mean.

AWS Fargate / Lambda are Firecracker VMs. EC2 are normal VMs.

Re: WASM will replace containers

#66
Forgive me but I've heard the heralding new age nay revolution of wasm is coming anyday now and it hasn't and probably won't.

I don't doubt that wasm has potential, but personally I imagine more esoteric use cases as the go to than necessarily the replacement for containers (where my money is more on unikernel).

Re: WASM will replace containers

#67
One advantage of containers is that run lots of software with it. Take old Perl application, wrap it in container, and then run in the cloud. Keep that old binary application that somehow lost the source for.

Also, I think most uses of containers lose the advantage of WASM. WASM is about running on any platform, great for browsers and serverless. But containers are usually run in controlled environment where can compile once and not pay the penalty of compiling each time.

Re: WASM will replace containers

#68

You underestimate developers. WASM will never replace containers. People will be running wasm inside of containers. That's what will happen.

Oh, I have seen this proposed, in real life. It was like 2019 or 2020, so not even new. Honestly, it was a good idea as it was proposed then, and I wish more of the tooling I interacted with adopt it.

WASM to an API is essentially the `Fn(…) -> …` type. E.g., you have

  POST /some/api
And it can take JSON, but what if it needs to do "something", where something depends on the consumer?

And across the board, what APIs/aaS's do is that some PM goes "I think these are the only 2 things anyone will ever want", those get implemented, and you get an enum in the API, the UI, the service, etc. And that's all it is ever capable of, until someone at the company envisions something bigger.

If I could pass WASM, I could just substitute my own logic.

Like webhooks, but I don't have to spin up a whole friggin' HTTP server.

Re: WASM will replace containers

#69
It really won't. For some use-cases, yes.

> WebAssembly is a true write-once-run-anywhere experience.

Except not. The wasm ISA is really quite limited in the types of operations. A full-blown RISC/CISC ISA will have way more opportunities for optimization. To say nothing of multithreading and pipelining. JITing also has overhead.

> You can compile several languages into WebAssembly already.

But if you can compile them, why not just compile to container, and get free performance?

Wasm will have a hard time with anything low level: networking, I/O, GPU, multimedia codecs.

Re: WASM will replace containers

#70
post #13

"The main thing holding back wider adoption is a lack of system interfaces. File access, networking, etc. But it's just a matter of time before these features get integrated." But then you've got to figure out and prevent all the security holes that can be introduced by adding file access, networking, etc. That's what killed the Java write-once, run-anywhere promise. Maybe put the whole thing into a container? Oops,…

I think you meant Java Applets instead of Compile once run everywhere.
Post reply on HN