Wasmer 5.0
wasmer.io
wasmer.io
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).
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.
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
...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#...
...this is probably the best part of WASM and WASI, there's no 'vendor lock-in'.
Thanks! I wish this was the subtitle on their homepage :)
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").
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?...
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.
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.
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.
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.)
1) Making canvas webapps with unblockable ads built-in
2) Downloading and running random blobs of other people's code in a sandbox
do not fool yourself with this temporary feature. wasm was first for js performance. secondly for portability. and third and accidentally for sandbox.
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.
WebAssembly brings every language to the web and does it with higher performance than JavaScript.
Whereas if I understand correctly, WASM can be provided with host approved JS functions to call directly in importObject. This seems more convenient and fast.
But for a plugin system, many people would prefer to write plugins in JS itself, so for WASM plugins, they might have to be compiled to WASM first. Dont know how if there is a mature implementation of JS->WASM.
Not everyone tho, which is kinda the point of abstracting away your language for plugins. People like Python, Lua, Go, Rust, etc... Some do like JS of course, but not everybody. Re: mature implementations, I would guess worst case QuickJS probably can compile to WASM and it's small enough that your runtime will probably offset the extra blob size.
That's actually exactly what Figma is doing for their plugins. [1] Seems to be working ok, though not without some pain [2].
[1] https://www.figma.com/blog/an-update-on-plugin-security/
3) Bring back all the plugins that were taken away.
See no other use for it.
Which isn't any different from Javascript if you choose to embed the ads right into the Javascript code - but nobody does this because it doesn't make any sense.
In reality, a WASM app that displays ads would also need to load the ad content over one of the existing ad-network mafias (serving ads any other way simply doesn't make any financial sense), and those HTTP requests initiated by a WASM blob (by calling out into JS - because that's the only way in browsers) will be blocked just as fine by existing ad-blockers.
...but I'm also not actually aware of any webpage that does this (trying to defeat ad-blockers via wasm), do you have any example?
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.
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.
> 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.
Main benefits are isolation, binary portability, and hot reload.
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-...
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-3...
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 :))
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/...
nice. is this original from openscad (if that even is your inspiration)?
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.Don't browsers support wasm natively?
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 and not wasmer-js that you link to.
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.
Written in zig and Bun, and uses the system webview by default.
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.
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.
- 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.
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:
Not a big one, but this was of personal note: https://github.com/bytecodealliance/wit-bindgen/issues/306
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.
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.
You see an AI generated image next to a bullet point list and start to suspect all you are reading is AI generated nonsense.
It doesn't exactly help communicating professionalism if that is the intended goal.
Rather, it gives the idea that the author did a minimal effort post.
None really, using a stock photo in a blog post is also a stupid idea. Just don't add any image if it isn't needed to get an important point across.
Of course it can be overdone, but it definitely does add utility for me at least sometimes.