7 ms·
FaaS in Go with WASM, WASI and Rust
- caust1c 4y agoWaZero is pretty freaking amazing. Been using it at RunReveal for log processing and alerts. Highly recommend picking it up to anyone wanting to learn about Web Assembly. Their docs are amazing and the team is really responsive, knowledgable and helpful!
- benatkin 4y agoHave you tried wasmtime? Any noticeable difference?
- dilyevsky 4y agoWasmtime is i think the only engine that does proper jit, everything else does interpreter and aot (like wazero)
- benatkin 4y agoYeah, Wasmer (which I don't pay much attention to) uses Cranelift from Wasmtime, so Cranelift is pretty much the only game in town for JIT. Wazero is awesome, I wish them luck and hope to use it, but I would use wasmtime for most everything until it gets a lot further along.
- mojodojodev 4y agoSo much tech with the word wasm in it now, it's beginning to get confusing!
- benatkin 4y agoYeah I perused the wazero docs and AOT doesn't sound too bad for a lot of use cases. A lot of different choices in the WASM space!
- titzer 4y agoWamr has two JITs. Wizard recently added a JIT. And of course all of the Web engines and node have JITs.
- benatkin 4y agoNone of those is relevant to me here imo. It's not that I don't know of them.
- evacchi 4y agohey wazero dev here, AMA!
- cube2222 4y agoHey! First, wazero is awesome, thanks for building it! I saw initial steps of a Cranelift Wazero backend in your organization. Any plans or ETAs around this?
- evacchi 4y agothanks for the praise! Our community is super-awesome too! Very experimental! No ETAs yet but we're considering a few strategies for the optimizing compiler
- richieartoul 4y agoSeconded, I used it in one of my side projects and it’s pretty amazing to have full WASI with no CGO
- kqr 4y agoThis is a slightly off-topic question but I'll go anyway: if I would want to learn a cross platform low-level language to target with custom toy language compilers, which would be the best alternative betweeen - JVM; - LLVM; - WebAssembly; or - Something else entirely?
- sethaurus 4y agoThe JVM has amazing, mature tooling, and a bunch of existing compile-to languages. If the goal is to do a productive exploration with some toys, that’s a good place to start.
- awestroke 4y agoReally? What JVM tooling amazes you, specifically?
- baq 4y agoEverything that isn’t Java is top notch. JIT, GCs, debugging. It’s sad that Java the language sucked so bad for this long.
- pjmlp 4y agoThat is a matter of opinion, plenty of people like Java, the language.
- baq 4y agoJava today is a likable language. It was not expressive enough a few years ago which lead to major boilerplate copypasta and making do with abhorrent ’design patterns’ instead of well designed language features. Plenty of people liked it then I agree, can’t really understand why, because the simplicity argument just moved the complexity into libraries.
- pjmlp 4y ago
- klabb3 4y agoFaaS is cool, but what I would love is if wasm can be used as a universal FFI boundary. Excellent tooling permitting, you could basically bring in dependencies from other language ecosystems when necessary. They could also be fully sandboxed.
- ridruejo 4y agoThis is where it is going, checkout the component model https://cosmonic.com/blog/engineering/evolution-of-wasm-standards-building-the-component-model https://cosmonic.com/blog/engineering/evolution-of-wasm-stan...
- amelius 4y agoThe problem with this is that memory management across subsystem boundaries is very difficult.
- brodouevencode 4y agoI think that’s what OP meant by tooling permitting.
- kaba0 4y agoTruffle is that but better.
- adrianfcole 4y ago(wazero maintainer) Right now, there's no auto-magic repackaging, but it is extremely common to do manually in our ecosystem. Most will use go:embed to embed the wasm binary into the compiled application so it still appears all static linked, self contained at the end. A couple examples of this: * https://github.com/jerbob92/go-pdfium-wasm https://github.com/jerbob92/go-pdfium-wasm * https://github.com/ncruces/go-sqlite3 https://github.com/ncruces/go-sqlite3 More here: https://wazero.io/community/users/ https://wazero.io/community/users/ Note that often times a lot of work is porting because not all tools build well to wasm. This would apply for any runtime as we're just running the standard with some special extensions for emscripten, wasi etc.
- 4y ago
- candiodari 4y agoOoh ... this guy makes the forbidden argument. "FAAS" is essentially cgi-bin with a few functional upgrades and supposedly better language support. I applaud it! He's right. It is. Except of course in reality FAAS and WASM and all implementations have less language support than cgi-bin ...
- SergeAx 4y agoThe author really believes that everyone around knows what FaaS and WASI are. It's a bit frustrating.
- adrianfcole 4y ago(wazero contributor) This is a fairly common problem in WebAssembly, jargon overload mixed with conflation. We're starting our own docs, and doing the rare thing of adding a terminology section to it ;) https://wazero.io/docs/ https://wazero.io/docs/
- qskousen 4y agoFor anyone else like me who doesn't know without looking it up, FaaS is Function as a Service.
- lmeyerov 4y agoThis seems cool for a lot of normal faas I keep wanting a flow like this to work for faas python data science sandboxed serving, esp @ scale -- python interpreters talking to cpython kernels and one day GPU passthrough -- but the experience leaves me wondering about wasm on the backend in general Basically, coldstart overhead + overall runtime overhead + inability to use GPU mean it'll be awhile yet for something you want to run. The former may be partly about pyodide (but not entirely?), but the latter seems to be about wasm Comparatively, firecracker VMs seem to solve a lot here. Though still a lot you have to role out on your own to actually scale untrusted code here vs just say fargate I feel like I must be missing something.. am curious.
- kennu 4y agoI've been hoping to have WASM/WASI as an official AWS Lambda runtime for a long time. Ideally, it would be an evergreen platform that runs code forever once deployed. I'm pretty bored with updating Node.js versions every year or two to hundreds of Lambdas.
- jeremy_wiebe 4y agoThis example sounds like exactly how Fastly’s Compute@Edge works. Fastly provides an API via a rust crate that you use to build your edge (CDN) logic with. They also provide a local development cli that can run these WASM bundles with. https://crates.io/crates/fastly https://crates.io/crates/fastly