6 ms·
Wasmer – Universal WebAssembly Runtime
- loudmax 4y agoThe Wasmer main page is splashy but not particularly informative. There's a lot more information on their github page here: https://github.com/wasmerio/wasmer https://github.com/wasmerio/wasmer
- labrador 4y agoStill doesn't answer why I should care about Wasmer. I've already got several virtual machines on my computer such as the JVM. What does Wasmer have to offer?
- clpm4j 4y agoYC (S19) company
- mwaitjmp 4y agoSlightly off topic what would people recommend to use to compile Java to wasm? Is what’s currently available still fairly experimental?
- szundi 4y agoI would love to save our swing app to the browser haha
- easrng 4y agoCheerpj can do that, though it's slow and I'm not sure what the license is.
- dagipflihax0r 4y agoThat would require garbage collection support, no? To me (very limited) knowledge, supporting gc in WASM is being worked on but not there yet.
- jackdaniel 4y agolibgc in its pre-release branch works fine with Emscripten.
- yarg 4y agoGraal has an LLVM back-end: https://www.graalvm.org/22.1/reference-manual/native-image/LLVMBackend/ https://www.graalvm.org/22.1/reference-manual/native-image/L... Then use the WASM back-end for LLVM. Probably won't work though.
- kaba0 4y agoI believe both TeaVM and Google’s J2CL library have experimental support for targeting wasm.
- drunner 4y agoIts been a while since I looked at using webassembly as a scripting language for modules in a larger program. Has support been added for: 1) types other than int, for example strings and what not without the hacks of passing string lengths and addresses? 2) sharing of data. That is can I declare a struct of some sort in the main program, pass that to the webassembly script, operate on it, and return it? Last I looked at that the only thing I could come up with was passing it back and forth as a (pick your format here) json string.
- MaulingMonkey 4y ago> types other than int Floating point values are also supported. > for example strings and what not without the hacks of passing string lengths and addresses? That's not so much a "hack" per se, so much as it is fundamentally how string types are represented when broken down into their basic components. ARM, x64, etc. interact with strings in similar ways. Tools like wasm-bindgen[1] generate JS wrappers around the raw WASM calls, which wrap the address+length APIs in string accepting ones. For non-JS hosts, you might have to roll your own boilerplate or boilerplate generators, but that's straightforward. > sharing of data. That is can I declare a struct of some sort in the main program, pass that to the webassembly script, operate on it, and return it? Last I looked at that the only thing I could come up with was passing it back and forth as a (pick your format here) json string. Multiple WASM instances can share a single memory instance without copying data. A non-wasm host will typically copy/serialize data into/out-of WASM memory for simplicitly/convenience/durability, but there are APIs[2][3] that let you directly manipulate WASM memory - and there's nothing stopping you from generating identical structures on both ends and directly using them without copying. [1]: https://github.com/rustwasm/wasm-bindgen https://github.com/rustwasm/wasm-bindgen [2]: https://docs.rs/wasmer/latest/wasmer/struct.Memory.html#method.data_ptr https://docs.rs/wasmer/latest/wasmer/struct.Memory.html#meth... [3]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Memory/buffer https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- afiori 4y agofor 1) WASI [0][1] makes it nicer and acts sort of like a FFI for 2) there are reference types, which allow wasm to receive opaque objects similarly to how userland processes receive handles from the kernel. In this way you could pass an object to wasm and let it call host functions to modify it. If you want to have the same datatype both in wasm and in the host you simply a compiler that supports it. [0] https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/ https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webas... [1] https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-overview.md https://github.com/bytecodealliance/wasmtime/blob/main/docs/...
- lofatdairy 4y agoNote that this company in the past attempted to trademark WebAssembly [^1]. Maybe their product is still solid despite this, but I can't help but distrust the intentions of their upper leadership. [^1]: https://news.ycombinator.com/item?id=30758651 https://news.ycombinator.com/item?id=30758651
- synergy20 4y agoThanks for the info, that's unbelievable to even have that odd idea.
- krapp 4y agoTheir product is open source and MIT licensed, so their intentions shouldn't be relevant.
- lumost 4y agoUltimately their intention does matter, even open source projects tend to die once the financial interest in their success is gone. Most open source libraries you interact with are created in the course of building apps internally at a company, created by consultants and free lancers to support their consulting work, or are created as monetizable products in their own right. Software is a hard and complex thing to build, people don't tend to work full-time on projects which they can't earn a living from.
- hunterb123 4y ago> Ultimately their intention does matter, even open source projects tend to die once the financial interest in their success is gone. > Software is a hard and complex thing to build, people don't tend to work full-time on projects which they can't earn a living from. Wouldn't these be positive points towards how Wasmer is running the company? They are trying to keep their open source product alive by marketing and finding a way to build revenue, to continue to fund development. In the end, if they fail, it's all open source, someone can fork and continue it if the demand is there. Until then, they are the ones doing it, and doing it well imo.
- synergy20 4y agohttps://github.com/appcypher/awesome-wasm-runtimes https://github.com/appcypher/awesome-wasm-runtimes quite a list, it is becoming a new JVM that runs all different languages.
- idle_zealot 4y agoThat is a list of WASM runtimes, analogous to JVM implementations, and not languages that run on WASM runtimes.
- synergy20 4y agoexactly, wasmer is also a runtime itself, but might be the most popular one for now.
- potsandpans 4y agoI just simply don't trust Wasmer the company. The trademarking and bytecode alliance drama coupled with the over-the-top marketing splash pages and reaching claims ("THE" universal runtime) and attemps to sockpuppet discussions on hn and reddit along with bizarre pr stunts. The product may be good, but the company stinks.
- hunterb123 4y ago> I just simply don't trust Wasmer the company You don't trust them with what? Their core products are open source.
- gycom 4y agoY'know what I want? A wasm runtime for microcontrollers. It would be super awesome to be able to write code for a microcontroller in any language I want.
- gycom 4y agoScratch that, apparently such things exist. What a world we live in!
- saidinesh5 4y agoYou might want to look at: https://github.com/wasm3/wasm3 https://github.com/wasm3/wasm3 Out of curiosity, what kind of use cases would you want to target with microcontrollers running wasm binaries?
- tym0 4y agoI second Wasm3, it's super easy to embed.
- danellis 4y agoWhich language do you want to use? You already have a choice.
- Conlectus 4y agoGiven my experience, I would not recommend using Wasmer over an alternative like Wasmtime for several reasons. 1. Lack of support for `externref`, AKA opaque references to host data. Sure, the Wasmer 2.0 blog post _claims_ they added support for it, but that amounts to allowing you to read the type signature in an existing module, but not actually use the feature yourself. With some digging, my educated guess is they wanted this to be their headlining 2.0 feature but weren't able to get it working, so they just pretended in their blog post and left the incomplete version behind a development flag. 2. An awkward context API for host calls. All host data associated with an instance must be `Send` + `Sync`. In practice I've found this leads to wrapping your entire context object in a `Arc<RefCell<T>>`, even if your data could otherwise live on the stack. Wasmtime does not have this limitation, so it's not a hard technical requirement. 3. It took me about 2 weeks of development to run into a use-after-free bug bubbling up into Rust. 4. The performance, at least for my use case, was not meaningfully better than Wasmtime. This may not be true if you're doing a lot of intense number crunching. 5. Lack of support for instance resource allocation pools. Wasmtime allows you to pre-allocate / reuse the resources associated with an instance, whereas you would have to roll this on your own with Wasmer. 6. Lack of support for the module linking proposal. This proposal may be incomplete, but it is still helpful ahead of its replacement. This is on top of, as others have mentioned, their questionable business practices[1][2]. All of this may improve, but as things currently exist, Wasmtime should give you everything you would want from Wasmer in a more stable, more complete and more ergonomic package. [1]: https://mnt.io/2021/10/04/i-leave-wasmer/ https://mnt.io/2021/10/04/i-leave-wasmer/ [2]: https://wasmer.io/posts/wasmer-and-trademarks https://wasmer.io/posts/wasmer-and-trademarks
- syrusakbary 4y agoHey Conlectus, let me address your technical comments (note: I work at Wasmer) > 1. Lack of support for `externref`, AKA opaque references to host data. We do support `externrefs`, but had to partially disable it due to big impacts on performance due to how we did the initial implementation. We are refactoring this in Wasmer 3.0 and this shall be completely addressed in the Wasmer 3.0 release. > 2. An awkward context API for host calls. This is probably the point I agree most with. This is already being worked on. Please take a look on this PR if you are interested on knowing how things will look like for Wasmer 3.0 [1] > 3. It took me about 2 weeks of development to run into a use-after-free bug bubbling up into Rust. Sorry to hear that! We are working hard make sure there are no such leaks/bugs in Wasmer > 4. The performance, at least for my use case, was not meaningfully better than Wasmtime In general, being able to have to have a pluggable compiler infrastructure I think makes the runtime infrastructure way more resilient and with almost zero effort we should be able to support more chipsets (such as RISC-V). In the case of Wasmtime they are using the partially-optimized compiler Cranelift, but they only support for x86_64 and aarch64. They are doing super interesting things such as the ISLE initiative but IMHO they are far from having the robustness that projects like LLVM already have. Which is why Wasmer chose a pluggable compiler infrastructure rather than tying itself to only one. > 5. Lack of support for instance resource allocation pools. Yup, this is on our plans! > 6. Lack of support for the module linking proposal This have been very intentional. IMHO module linking is an over-engineered solution that can be solved more easily with a static spec definition outside of Wasm. I personally think it's unlikely that it will reach broad adoption. But I can assure you that Wasmer will implement this once browsers do (if they ever do, of course) [1]: https://github.com/wasmerio/wasmer/pull/2892 https://github.com/wasmerio/wasmer/pull/2892
- vcryan 4y agoWhat does this have to do with Blockchain?
- devops3 4y agoI'll reiterate what most of you already know - this company is incredibly shady. Previous threads for those who don't know their history: Co-founder talks about toxicity and the overbearing CEO Syrus Akbary: https://news.ycombinator.com/item?id=28772863 https://news.ycombinator.com/item?id=28772863 Trademark drama: https://news.ycombinator.com/item?id=30758651 https://news.ycombinator.com/item?id=30758651 Stay far, far away.
- pipeline_peak 4y agoConsidering the dominance of V8, wouldn’t that be the Universal Wasm RT? What exactly do these wasm startups intend to capitalize on, niche markets like IoT devices? I’m sure they’re all seriously developed, complicated projects. I just don’t see what they have that any much larger company already does.
- sandstrom 4y agoSorry for being slightly off-topic. Is there anyone in this thread that would be interested in doing sponsored open-source work (we pay you for contributing code to an OS project), with the aim of making Wasmtime [not Wasmer] work better with Ruby? Basically, to make it easier to call the Wasmtime runtime from within Ruby? (passing of args etc)
- avinassh 4y agoCan I write some code in Python or JS, compile to WASM and run that in Go using Wasmer? Has anyone tried something similar?