14 ms·
Wasmer 3.0
- tlarkworthy 4y agoOff topic but is there a good way of running wasi on browser?
- syrusakbary 4y agoThere are multiple ways! I'd recommend `@wasmer/wasi` since it uses the same WASI implementation as Wasmer (compiled from Rust to Wasm using wasm-bindgen): https://www.npmjs.com/package/@wasmer/wasi https://www.npmjs.com/package/@wasmer/wasi
- williamstein 4y agowasi-js is another one I’m actively supporting that is in pure JavaScript (hence small and easily hackable): https://www.npmjs.com/package/wasi-js https://www.npmjs.com/package/wasi-js This is based on what wasmer used to provide for wasi in the browser before they did their major rewrite in rust mentioned above. I personally find the JavaScript version more useful for my projects so I revived their old project and am maintaining it.
- DustinBrett 4y agoThanks for this info! I have a terminal on my website that was still using the old version and I've been wanting to upgrade it and get better input/blocking support. I will give this a try.
- williamstein 4y agoI have added some new ad hoc hooks for blocking io. You can see how they are used in https://CoWasm.org https://CoWasm.org and https://CoWasm.sh https://CoWasm.sh
- DustinBrett 4y agoI started digging into it, looks promising indeed. I may have to go the service worker route, or perhaps a web worker if possible. Nothings exploded so far: https://github.com/DustinBrett/daedalOS/commit/eb958836f1f5e5afed742fc015b406450fdecf8d https://github.com/DustinBrett/daedalOS/commit/eb958836f1f5e...
- Jaxkr 4y ago> support for multi-value functions Link to example for this? Tried Wasmer about a year ago and had too much trouble passing multiple non-int args with a Rust host (so no JS bindgen)
- syrusakbary 4y agoThis test might be useful (although it might be a bit hard to read because of the usage of macros) [1]. We will create a simple example of multivalue to showcase how it can be used [1]: https://github.com/wasmerio/wasmer/blob/master/tests/compilers/multi_value_imports.rs https://github.com/wasmerio/wasmer/blob/master/tests/compile...
- nycticorax 4y agoCan someone ELI5 what problem this solves? I think of WebAssembly as being a tool for getting code written in <random language> to run in a web client. Can't I already run code written in <random language> on a server that I control? Heck, PG went on at some length in one of his early essays about how that was one of the great things about the Web: you could use any language you wanted on the server. Even Common Lisp...
- rglullis 4y ago"dumb clients" don't exist anymore. Why run things on the server and have to deal with scaling issues, if I can just distribute super complex applications easily and as reliably as publishing a web page?
- satvikpendem 4y agoNext.js' (and others') server side rendering exists and React Server Components exist as well. We're seeing a reversion back to the server due to SEO and performance concerns.
- rglullis 4y agoYour example is about something that gives power to the developers. My is about something that gives power to application users. Which do you think is more important for non-developers?
- satvikpendem 4y agoWhatever get their job done faster. Don't host an ecommerce site as a client-side app, no one will buy your products if they don't show up on Google. Same with heavy websites, people complain often of bloated JS-based sites hogging their CPU, RAM and battery life. Doing the computation on the server is actually beneficial to the user's hardware. Non-developers don't care about client-side computing as much developers think they do. Aside, I also can't believe I'm defending server side rendering in this day and age where people actually think client side routing is better. Around 10 years ago when React was still getting new, I would have held the same views as you. It's interesting how tech moves cyclically.
- nuc1e0n 4y agoDoes the exe generation need any runtime like vb needed vbrun.dll back in the day?
- fschuett 4y agoNo, it's a standalone binary. It compiles the wasm file to native assembly (depending on target), then uses zig build-exe to link libc and libunwind into a final exe file. $ wasmer create-exe --target x86_64-windows-gnu qjs.wasm -o ./js.exe && llvm-objdump -p ./js.exe | grep DLL DLL Name: KERNEL32.dll DLL Name: msvcrt.dll DLL Name: WS2_32.dll DLL Name: ADVAPI32.dll DLL Name: USERENV.dll DLL Name: bcrypt.dll
- lijogdfljk 4y agoThe `create-exe` subcommand is interesting! For any language with decent cross compiling capability, is there a use case for `create-exe`? Eg i use Rust these days.. and i wonder if there's any use case for me to cross compile via wasmer instead of natively. My project(s) do work on WASM as a target (for browser reasons), maybe it would be easier to setup cross compiling via wasmer and not manage the release pipelines i have? Though for some of my performance critical applications i may not want to bother with it. Simply because i'd suspect wasmer might not have the same platform specific optimizations that natively compiling would give me.
- williamstein 4y agoWasm provides very extensive sandboxing capabilities that are extremely valuable for certain applications (plugins, real-time collaboration, multi tenant hosting), and pointless for others. You can leverage that by using wasm and create-exe.
- samtheprogram 4y agoRunning WASM outside of a web browser? Obligatory Gary Bernhardt, “The Birth and Death of JavaScript”: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...
- rizky05 4y ago
- walrus_pen 4y agoJavascript and WASM are unrelated
- kthakore 4y agoGreat work Wasmer team :)
- lioeters 4y agoCross-compiling to different targets with `create-exe` command is a very intriguing idea. > In Wasmer 3.0 we used the power of Zig for doing cross-compilation from the C glue code into other machines. > This made almost trivial to generate a [binary] for macOS from Linux (as an example). > So by default, if you are cross-compiling we try to use zig cc instead of cc so we can easily cross compile from one machine to the other with no extra dependencies. https://wasmer.io/posts/wasm-as-universal-binary-format-part-1-native-executables https://wasmer.io/posts/wasm-as-universal-binary-format-part... > Using the wasmer compiler we compile all WASI packages published to WAPM to a native executable for all available platforms, so that you don't need to ship a complete WASM runtime to run your wasm files. https://wasmer.io/posts/wasm-as-universal-binary-format-part-2-wapm https://wasmer.io/posts/wasm-as-universal-binary-format-part...
- h4x0rr 4y agoone thing to note is that the performance is still on the level of normal wasmer exexution and thus inferior to natively compiled code in most instances
- coder543 4y ago> thus inferior to natively compiled code in most instances Do you have a source for this claim? Using a JIT with AOT binaries (which is what this seems to be) can sometimes be very beneficial. It's like doing PGO without the manual work of doing PGO properly. I'm sure the JIT can make poor decisions sometimes, but I would want to see a comprehensive set of benchmarks, like The Benchmarks Game and TechEmpower showing this. Benchmarks aren't always reflective of reality, but good ones are usually more insightful than random opinions. The only Wasmer benchmarks I could readily find were from three years ago, and that was before Wasmer 1.0, let alone 3.0. EDIT: Reading more... maybe `create-exe` doesn't include the JIT at all, so it is just making an AOT binary from the source WASM? In which case, benchmarks are just as necessary to understand how it affects performance compared to a normally-compiled native binary.
- riquito 4y ago
- gary_0 4y agoThe docs.wasmer.io page could use some work (it looks nice, though!) For instance, under the C/C++ section, the MinGW link at the bottom leads to a hijacked domain, and the "Wasmer C API" link in the sidebar leads to a 404.
- tromp 4y agoCan this be compared to something like αcτµαlly pδrταblε εxεcµταblε [1], that makes a single executable run on Linux, MacOS, Windows, FreeBSD, OpenBSD, and NetBSD? While wasmer seems to support more source languages, it requires running the executable under a WASM virtual machine. Are there other important differences? [1] https://justine.lol/ape.html https://justine.lol/ape.html
- brundolf 4y agoWASM also gives you sandboxing
- gary_0 4y agoAnd it works the same regardless of the host CPU architecture, whereas APE is built around x86_64.
- lioeters 4y agoThere's another blog post by Wasmer where they compare with ape/cosmopolitan. > How is this approach different? ape is aiming to create one standalone binary that works everywhere (same chipset, x86 as lingua franca). On the other hand, Wasmer aims to have one standalone lingua franca (Wasm), that can target multiple OSes (macOS, Linux, Windows), chipsets (x86, ARM, RISC-V) and programming languages (Python, Rust, Go…). > On one hand, both ape and Wasmer rely on a “universal binary interface” to interact universally with the Operating System: Cosmopolitan (as a universal libc POSIX interface) in the case of ape, and WASI in the case of Wasmer. > On the other hand, since Wasmer relies on WASI it can also offer a full-sandboxed execution when running the binary (this means that by default no files or sockets could be accessed or created by the binary unless explicitly allowed, for example). WebAssembly as a Universal Binary Format (Part II: WAPM) - Portable Executables - https://wasmer.io/posts/wasm-as-universal-binary-format-part-2-wapm#portable-executables https://wasmer.io/posts/wasm-as-universal-binary-format-part...
- devops3 4y agoCool! Does this support compiling of games to WASM, with deployment at the edge?
- fschuett 4y agoIt does, using the wasm4 console target: https://itch.io/jam/wasm4-v2 https://itch.io/jam/wasm4-v2
- TUSF 4y agoOther than some fantasy consoles like WASM-4, which have some retro-inspired limitations, there isn't really a standard way to do any kind of GUI in Wasm yet. Wasmer has a non-standard way[1], which they hide behind compilation flags, and involves writing to a bitmap framebuffer, so no hardware acceleration. [1]: https://medium.com/wasmer/wasmer-io-devices-announcement-6f2a6fe23081 https://medium.com/wasmer/wasmer-io-devices-announcement-6f2...
- TobyTheDog123 4y agoWhile I'm glad to see WASM get more attention, iirc wasmer has had some behavioral issues / drama in the past. However, it seems they're making far more progress than wasmtime, so taking the bad with the good I guess.
- benatkin 4y agoThat progress is mostly boilerplate. For instance if you want a memory filesystem, you probably want a dedicated filesystem module with features like an overlay filesystem. If you want an executable, you can just add it to your build scripts.
- karmasimida 4y agoI have a use case in mind I have a piece of library written in rust that i need to run on multiple different hosting environment due to business reasons, like java/js. They will all call this library to validate part of the logic at the same time do something else Could wasmer help in this case for me to write once and have consistent behavior everywhere ?
- sanxiyn 4y agoYes.
- deleted 4y ago[deleted]
- tracker1 4y agoOne annoyance, on the wapm website, seems you can't click on search results to open in a new tab. :-/ Wasmer seems pretty cool, and may in fact be a future for micro-services.
- supermatt 4y agoIm a bit confused with the WASM landscape. It seems there are numerous implementations of the runtime. How do I go about finding WHICH runtime is best for my needs? Is there a list of them available somewhere?