7 ms·
Wasmer 5.0
- MuffinFlavored 2y agoCool release! I've yet to personally find a good use case for wasm in any project, kind of the same way I'm not quite sure what to do with a bunch of Raspberry Pis It fills a need, I just don't know who/what has that need. Example: Say I write a bunch of Rust async projects for fun. Scraping APIs, etc. How/why would I choose wasm/wasmer to do that instead? I'd do it in Rust (awkwardly/in some specific non-standard way) to compile to wasm to then run in wasmer? To what benefit? Ok, that's not a good usecase/example So what is?...
- crabmusket 2y agoTake that API scraping script example. Imagine next you want to build a platform where you run code written by your users who want to e.g. scrape APIs. Think ParseHub I guess? Zapier is another good example. You'd let them write in Rust or some other language that can target WASM, then you'd run the WASM blobs in a controlled sandboxed execution environment in your platform.
- Groxx 2y agoSo basically: what every single platform with plugins should be doing to protect their users. Or similar via some other language that allows sandboxing, e.g. Lua.
- lll-o-lll 2y agoYeah, but the plugins can be written in Rust! OK, OK, it’s a bad example. WASM is language agnostic though, so as more languages can target WASM, then the possible advantage is programming language agnosticism. If I have some code, I don’t have to re-write it in Lua.
- crabmusket 2y agoYes, that's right. It's just another option that lets you do that in a different (better?) way, and doesn't force all your users to write Lua.
- iknowstuff 2y agoyea https://blog.cloudflare.com/announcing-wasi-on-workers/ https://blog.cloudflare.com/announcing-wasi-on-workers/ and such.
- dgfitz 2y agoI cross-compile a native qt app in windows, Mac, and Linux variants. It’s pretty neat to see it compile in wasm as well.
- 01HNNWZ0MV43FF 2y agoIt probably makes sense if you're running untrusted code or handling untrusted data, or running code that was written after the rest of your app So for a solo dev it doesn't add much, but for a web browser or something that needs plugins it could make a lot of sense.
- MuffinFlavored 2y ago> It probably makes sense if you're running untrusted code or handling untrusted data I never understood this because... I feel like wasm (the standard) is an empty box and a lot of runtimes help you attach things to it / make it useful (able to read/write to filesystem, call the Internet, etc.)
- 1oooqooq 2y agohistory tells us, that usecase will go out the window as soon as the usual suspects do their usual standards capture by implementation to support something or another related to advertising attribution.
- Starlevel004 2y agoWASM has two primary usages: 1) Making canvas webapps with unblockable ads built-in 2) Downloading and running random blobs of other people's code in a sandbox
- taberiand 2y agoTo be fair, a rock-solid sandbox with extremely well defined and host controlled ingress/egress in a tiny package sounds absolutely fantastic
- api 2y agoThat’s what it is.
- deleted 2y ago[deleted]
- 1oooqooq 2y agothat would have been implement in something like forward only language like ebpf. wasm is just an outgrown hack that people are hopping will be that safe sandbox and solve all JavaScript problems. do not fool yourself with this temporary feature. wasm was first for js performance. secondly for portability. and third and accidentally for sandbox.
- mrugiero 2y ago> that would have been implement in something like forward only language like ebpf. wasm is just an outgrown hack that people are hopping will be that safe sandbox and solve all JavaScript problems. It's funny that every time an article on new functionality for eBPF appears in LWN everybody is like "why don't they just use WASM???". More seriously, a forward only language is by definition too strict for the general case of sandboxing, unless you mean using it only for hooking the syscalls rather than as a target for your program. In particular, the Linux implementation caps your execution to 1M instructions, which is not a lot for something you'd want on your browser.
- sroussey 2y agoONNX has a WASM backend for running models in a browser. It’s what transformer.js (from HuggingFace) uses behind the scenes.
- xn 2y agoI've used wasm to write web applications in Go that run in the browser, both HTML applications (https://github.com/octoberswimmer/masc https://github.com/octoberswimmer/masc) and TUI apps using xterm.js (https://github.com/charmbracelet/bubbletea/pull/887 https://github.com/charmbracelet/bubbletea/pull/887).
- LSRegression 2y agoA toy project, but I'm working on a Scrabble clone for my mother to play. There's singleplayer against an AI, and then multiplayer against other people (myself, mostly). Multiplayer needs a server backend with all the game logic which I have programmed in Rust, but there's no reason I can't have the game logic for singleplayer running entirely in the browser. By compiling my backend code to WASM I basically do that - the client can use either a client-side 'server' or connect to a real server. The UI code itself is unchanged in either case. I suppose the need in this case is that I have code written in a language other than JS and I want to run it in a browser; inversely I could have written the entire project in JS and hosted my backend server on say Node.
- globalnode 2y ago> Multiplayer needs a server backend Did you mean single player? Although perhaps I'm just old and thinking about this in a strange way. And can I clarify.. your scrabble app is web based already right? connecting to a rust web server for the game logic? And you want to embed that server by compiling to wasm? I probably should go read up on how this works.
- nl 2y agoNot the OP, but most web-based multiplayer games use a server backend to communicate between the multiple players. > connecting to a rust web server for the game logic? And you want to embed that server by compiling to wasm? I would assume so, and it being in WASM means they can use the exact same binary code on the server and in the webbrowser. You could of course do the same thing by writing in Javascript (running in Node on the server or in the browser) but then you are in JS instead of Rust.
- globalnode 2y agoThank you, that clears it up for me. Tech has changed a lot since I was exposed to web programming.
- tricked 2y ago
- simonask 2y agoI’m using WASM as the modding interface in my game. (I’m using wasmtime from Rust, but same principle.) Main benefits are isolation, binary portability, and hot reload.
- colordrops 2y agoEveryone else has answered about WASM, so I'll answer about raspberry pi. I've got 5 of them. One is running Home Assistant for all my home automation and camera recording. One is running a quadruped that I built. And three are connected to three sets of speakers around the house running a home-rolled Sonos-like setup so I can stream the same music all around the house from my phone.
- MuffinFlavored 2y agoCool! Thanks! I've got none of that.
- csomar 2y agoI think the biggest company using wasm in production is figma (though there might be others). Otherwise, here is an example where wasm shines. Say you have an editor (rvim) and you want to support plugins. Usually, you’ll have a language interpreter and ask developers to develop in this language. With wasm, you can give them the freedom to use whatever stack they want. Then you expose an interface for their wasm artifacts. This abstract the host OS away. Another example is game mods/plugins.
- peutetre 2y ago> I think the biggest company using wasm in production is figma (though there might be others) Amazon uses Rust to wasm for the Prime video app and Google uses Java to wasm for Google Sheets. Both get higher performance and lower memory usage versus JavaScript: https://www.amazon.science/blog/how-prime-video-updates-its-app-for-more-than-8-000-device-types https://www.amazon.science/blog/how-prime-video-updates-its-... https://web.dev/case-studies/google-sheets-wasmgc https://web.dev/case-studies/google-sheets-wasmgc Abode uses wasm in the web based version of Photoshop: https://medium.com/@addyosmani/photoshop-is-now-on-the-web-38d70954365a https://medium.com/@addyosmani/photoshop-is-now-on-the-web-3...
- 0points 2y agoWasm could be a handy way of letting users mod your app using their choice of programming language that can compile to wasm. Compare with how lua is used.
- ledgerdev 2y ago> having V8 as a backend also means supporting WebAssembly Exceptions and Garbage Collection under the hood. Stay tuned for more news on this front soon Looking forward to this and languages that can make use of wasm-gc. Does wasm-gc allow sharing of host data/strings across different modules in the same runtime, or is it contained to only single module with repeated calls/invocations? The scenario I am considering would invoke several different modules in a pipeline, pass data between each step in an efficient manner.
- throw4950sh06 2y agoThat's what reference types (the Wasm proposal) are for, GC builds on top of that.
- azakai 2y agoSharing GC data between wasm modules is supported, yes. You just need to define the types identically on both sides, and things work.
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- deleted 2y ago[deleted]
- OtomotO 2y agoInteresting. I am happy with wasmtime though. Hacking on a wasm component model and wasi based plugin system these days. Having loads of fun. (I am aware of extism, but I am doing it for the fun :))
- bschwindHN 2y ago> Hacking on a wasm component model and wasi based plugin system these days. Same here! Can you share what you're working on? I'm (slowly) making a 3D CAD modeling API, so you write Rust code to define a model, and compile it to WASM so it can hot-reload and let you iterate faster. https://github.com/bschwind/opencascade-rs/tree/main/crates/wasm-example https://github.com/bschwind/opencascade-rs/tree/main/crates/...
- 1oooqooq 2y agoshape.faces().farthest(Direction::PosZ) nice. is this original from openscad (if that even is your inspiration)?
- bschwindHN 2y agoOpenSCAD is of course the OG for code-based CAD, but this particular syntax came about from converting CadQuery-esque queries into Rust iterators with a bit more type-safety instead of something stringly-typed. Here's a snippet from a CadQuery example: # 3a. The top-most Z face is selected using the >Z selector. # 3b. The lower-left vertex of the faces is selected with the <XY selector. result = result.faces(">Z").vertices("<XY") Right now it just does a naive linear search but at some point I'd like to extend it to use more of OpenCascade's underlying geometric acceleration structures (which I assume exist), and add more and more iterator adapters.
- punkpeye 2y agoWould this allow to safely eval Node.js code in a sandbox?
- samtheprogram 2y agoNot "Node.js code" specifically as Node.js itself can't be compiled to wasm. JavaScript can be compiled to wasm, but that won't include the whole Node.js standard library and doesn't seem to be what you are asking. Check out Deno for a sandbox that is getting there. Their new release does (aim to) support most Node.js code, where it previously and intentionally did not support node_modules nor CommonJS to the best of my knowledge. If you care more about wasm than sandboxing in general, one project called javy is interesting, but you'll quickly notice they bring their own IO library and not much else in terms of something that compares to Node.js' API.
- int_19h 2y agoIs Wasmer still openly adversarial wrt the Bytecode Alliance?
- deleted 2y ago[deleted]
- spirobelv2 2y agocan you link more infos on the drama pls
- SirGiggles 2y agoMost prolific example was this: https://news.ycombinator.com/item?id=30758651 https://news.ycombinator.com/item?id=30758651 Not a big one, but this was of personal note: https://github.com/bytecodealliance/wit-bindgen/issues/306 https://github.com/bytecodealliance/wit-bindgen/issues/306
- deleted 2y ago[deleted]
- wg0 2y agoSorry to be that guy but what's the business model for all these web assembly runtime companies?
- DustinBrett 2y agoI wish they had a solution that didn't require Cross-Origin Isolated headers. I am still using an older version where that wasn't required.
- nextaccountic 2y agoWhat do you mean? Wasmer isn't a web frontend tech
- nextaccountic 2y agoWell apparently it is? I am confused https://github.com/wasmerio/wasmer-js https://github.com/wasmerio/wasmer-js Don't browsers support wasm natively?
- 0points 2y agowasmer is a software to run a wasm binary locally like an app. wasm is a web standard supported by browsers and lets this wasm binary run in the browser. Also, the project called "wasmer" that is discussed in this thread is https://github.com/wasmerio/wasmer https://github.com/wasmerio/wasmer and not wasmer-js that you link to.
- thrdbndndn 2y agoGod, please stop using random AI-generated images in a release post..
- spretzer 2y agoWhat is the issue with AI-generated images? Just being overdone in general? Or ethical concerns?
- thrdbndndn 2y agoMakes your article looks cheap like a random blogspam. My personal opinion, obviously.
- NitpickLawyer 2y agoWhat's the difference between this and a generic photo from one of the dozens stock photo catalogs? Is this somehow "cheaper" because it's "AI" generated? Using stock photos is also cheap (free or cents per)... Second, does anyone really care? Has anyone spent more than half a second looking at a generic picture on an unrelated article? Does the generic hoodie hacker look good on security articles? Or the earth with pretty links on a networking article? Or the overdone handshake on a deal article? They feel equally as cheap and more importantly equally unimportant. It's a placeholder that noone should really care about. Third, what's the value of having human beings spend time on an image that's just there to fill space? I kinda get the argument for company identity and things that matter, but filler for an article? Nah, that's exactly where we shouldn't be spending human resources, IMO.
- thrdbndndn 2y agoI think using a stock photo in this case is also bad but not as bad; because the photo itself usually looks fine. I hate AI-generated photo more simply because they're not good enough (yet) to not look fake immediately; it even has somewhat uncanny valley effect. If one day they're as good as stock photos, then my opinion with them would be on par with that, too. I care, hence the comment. Can't speak for others. > where we shouldn't be spending human resources I agree; which is why in general I don't see the need to include irrelevant pictures at all for a software release post.
- enugu 2y agoCould this ever function as a less resource intensive substitute for Electron apps? WASM doesn't have DOM access, but could it be added in these extensions? Edit: Maybe this question doesn't make sense as the OS would need to have the runtime installed, and if that can be assumed, we would have lightweight apps already.
- NitpickLawyer 2y agoHa e a look at Tauri for a less resource intensive electron alternative. Written in rust and supports any framework on the frontend side, with strong access control & lightweight backend.
- yoav 2y agoTake a look at Electrobun. It’s a Tauri alternative where you write typescript instead of rust. App bundles as small as 16MB and it creates update patches for your app as small as 4KB. Written in zig and Bun, and uses the system webview by default.
- skybrian 2y agoThese performance graphs are confusing and possibly cursed. Sometimes they're log scale (confusing enough) and others, I have no idea what they're trying to say. For example, the first graph, labelled "Argon 2", nearly all the bars are the same length, labelled "100" (no units given, apparently log scale) and the individual bars are labelled with entirely different numbers in ms (presumably milliseconds).
- thiht 2y agoI have a hard time understanding what Wasmer does from their landing page. I understand it runs everything everywhere, unbound and above the cloud, but what does it do? From the name it seems like a very dev oriented product, and I can’t find a single technical word, just buzzwords
- Alifatisk 2y agoFrom my understandning, it's a runtime that runs webassembly (wasm). So anything that can be compiled to wasm can be runned with this which means it can be executable everywhere wasmer exists.
- flohofwoe 2y agoIt's a runtime for WASI blobs (basically a WASM based standard for crossplatform command line tools), for instance: emcc hello.c -o hello.wasm wasmer hello.wasm Hello World! This uses Emscripten as C compiler, but alternatively you can use the wasi-sdk toolchain instead of Emscripten to build WASI blobs: - https://github.com/WebAssembly/wasi-sdk https://github.com/WebAssembly/wasi-sdk ...or Zig as C compiler: zig cc -target wasm32-wasi hello.c -o hello.wasm wasmer hello.wasm Hello World! ...or of course Zig as Zig compiler :) zig -target wasm32-wasi hello.zig wasmer hello.wasm Hello World! (not sure if the Rust toolchain comes with builtin WASI support, but probably yes). ...or instead of wasmer use another WASI runtime: - https://github.com/wasmerio/awesome-wasi?tab=readme-ov-file#wasi-compatible-runtimes https://github.com/wasmerio/awesome-wasi?tab=readme-ov-file#... ...this is probably the best part of WASM and WASI, there's no 'vendor lock-in'.
- thiht 2y ago> It's a runtime for WASI blobs (basically a WASM based standard for crossplatform command line tools) Thanks! I wish this was the subtitle on their homepage :)
- flohofwoe 2y agoI mean, it's a Californian tech startup, what did you expect ;) Anything that isn't "earth-shattering" and "world-changing" would be too pedestrian, especially when your product is essentially a simple cmdline tool for coders (a very useful tool of course but not exactly "glamorous").
- mike_r_parsons 2y agoI really don't know what problem(s) this solves. Don't all the javascript runtimes already have wasm engines built into the runtimes?
- flohofwoe 2y agoYou don't need to carry around a whole Javascript engine when all you want is running some WASM/WASI code. Granted, the real-world differences aren't all that big: - wasmer: single 45 MByte exe - wasmtime: single 28 MByte exe - node.js: 87 MByte, lots of individual files - deno: 186 MByte over two executables (deno and denort not sure what denort is though) As an extreme outlier, there's wasm3 which is a WASI interpreter and which is just a single 255 KB executable (not a typo). All sizes looked up on an ARM Mac.
- mike_r_parsons 2y agoIs this (size) an issue in the real world?
- 0points 2y agoI'm having a really hard time reading the performance graps. The thousand separator comma and dot are both used (which is not correct in any part of the world), and precision is being randomly rounded to 1, 2 or 3 digits.
- v3ss0n 2y agoOk where to use it? Anybody using it? How it gives benefit over docker?
- flohofwoe 2y agoNot specific to wasmer, but WASI runtimes are much more lightweight than Docker, especially on Windows or macOS. For instance on macOS, a wasmer installation is a single 45 MByte executable, the alternative wasmtime is 28 MBytes, and if performance doesn't matter much, the wasm3 WASI interpreter is a 255 KBytes(!) executable - compared to that, a macOS Docker installation is 1.5 GBytes (and that doesn't even include any docker images). WASI itself can also be used in places where Docker doesn't make sense, for instance in this VSCode extension I'm using a C cmdline tool compiled to a 209 KB WASI blob: https://github.com/floooh/vscode-kcide https://github.com/floooh/vscode-kcide