wasmer | 🚀 The leading WebAssembly Runtime supporting WASI | Binary Executable Format library

 by   wasmerio Rust Version: v4.0.0-beta.3 License: MIT

kandi X-RAY | wasmer Summary

kandi X-RAY | wasmer Summary

wasmer is a Rust library typically used in Programming Style, Binary Executable Format applications. wasmer has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Wasmer is a fast and secure WebAssembly runtime that enables super lightweight containers to run anywhere: from Desktop to the Cloud, Edge and IoT devices. This document is also available in: 中 文 -Chinese • Deutsch-German • Español-Spanish • Français-French • 日本 語 -Japanese • 한국인 -Korean.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              wasmer has a medium active ecosystem.
              It has 15525 star(s) with 665 fork(s). There are 197 watchers for this library.
              There were 5 major release(s) in the last 12 months.
              There are 230 open issues and 1020 have been closed. On average issues are closed in 72 days. There are 31 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of wasmer is v4.0.0-beta.3

            kandi-Quality Quality

              wasmer has 0 bugs and 0 code smells.

            kandi-Security Security

              wasmer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              wasmer code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              wasmer is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              wasmer releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 119 lines of code, 4 functions and 1 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of wasmer
            Get all kandi verified functions for this library.

            wasmer Key Features

            No Key Features are available at this moment for wasmer.

            wasmer Examples and Code Snippets

            No Code Snippets are available at this moment for wasmer.

            Community Discussions

            QUESTION

            How to stop embedded code execution from imported host function in wee8?
            Asked 2022-Mar-15 at 17:18

            Is there a way in wee8 (v8's wasm api) to stop the execution of an embedded guest function from within an imported host function?

            Example:

            ...

            ANSWER

            Answered 2022-Mar-15 at 17:18

            Yes there is a way, and of course it can be found in the examples.

            From trap.cc:

            Source https://stackoverflow.com/questions/71486162

            QUESTION

            How to run in wee8 wasm code that was compiled from c++ with emcc? (WASI in wee8?)
            Asked 2022-Mar-14 at 17:50

            I am trying to compile C++ code to wasm and then embed it in other C++ code with wee8 (v8's wasm-api). Currently I'm getting a Segfault on instantiating the module:

            ...

            ANSWER

            Answered 2022-Mar-14 at 17:50

            I can answer part of your question:

            I'm missing is WASI support in wee8? Does it exist?

            No, wee8 does not implement WASI. Adding such support is theoretically possible, but not currently scheduled to get done.

            You can implement it yourself in your wee8 embedder, and make it available to loaded modules via imports. Most (or all?) of it could probably be a reusable (among many engine implementations) library, potentially offered and maintained by the WASI project itself. (I don't know whether such a library exists already.)

            You didn't say what imports object you're currently passing; it needs to be an array of wasm::Extern* pointers that's at least as long as the imports of the module, and ordered equivalently (i.e. imports[i] will be the module's ith import).

            (I agree that the Wasm C/C++ API is very barebones currently. Unless/until that is changed, you'll have to build any convenience mechanisms yourself. It's all possible with the information that's available, it's just clearly less convenient than instantiating Wasm modules from JavaScript.)

            Source https://stackoverflow.com/questions/71471462

            QUESTION

            Why does clang emit i64 instructions when targeting wasm32?
            Asked 2021-Oct-25 at 15:45

            I used clang --target=wasm32-unknown-wasi ... to compile a Hello World C program into WebAssembly. Everything goes fine, and the .wasm file can run correctly in runtime like wasmer.

            But when I check the .wasm file(in .wat format), I found some i64 instructions like:

            ...

            ANSWER

            Answered 2021-Oct-25 at 15:45

            I see nothing wrong with that. Targeting 32bits means that the memory addressing is 32bits. For this reason before the memory store instruction, all you have are 32bit instructions (i.e. the offset and the value are i32) you have this at some point:

            Source https://stackoverflow.com/questions/69708502

            QUESTION

            Cannot execute standalone webassembly file with wasmer
            Asked 2021-Jul-06 at 21:36

            I wrote a matrix multiplication program in C and compiled it using Emscripten with the following command

            emcc matrix.c -o matrix.wasm -s STANDALONE_WASM

            And the C program is as follows,

            ...

            ANSWER

            Answered 2021-Jul-06 at 21:36

            Compilers will often inline functions and remove code that isn't used, this is why your C program ends up with everything inside a _start function. As explained in the FAQ you may list functions to export using emcc -s EXPORTED_FUNCTIONS=_main,_matrix in order to prevent them from being inlined or removed. Adding this results in a wasm module with the function correctly exported.

            As for running functions directly, the source code for wasmer run has logic to determine which runtime environment should be exposed to the module. However, if you pass -i function, it entirely skips the environment setup and runs your function directly. In this case, the modules fails to initialize because it imports functions from WASI (in order to write things to the console, and get the current clock time).

            I believe the reason why wasm32-unknown-unknown works is that it doesn't link to any runtime, and implements dummy interfaces for things that it can't simulate (all filesystem calls result in errors, etc.)

            In summary, wasmer run -i function isn't meant to run functions from modules that have imports, it might be possible to patch wasmer-cli for that, but I'm not sure if it would work across all runtime environments.

            Source https://stackoverflow.com/questions/68265851

            QUESTION

            How can I read an existing directory from WASM in Rust using wasmer-wasi?
            Asked 2021-Jan-31 at 15:13

            I wrote a simple wasmer-wasi example that reads directory entries but it always fails.

            wasi_fs_example/src/lib.rs:

            ...

            ANSWER

            Answered 2021-Jan-31 at 15:13

            Currently in Rust we can really only create WASI binaries, not libraries. WASI only works for the duration of a main function that needs to be there. Calling the wasi functions from anywhere else segfaults because libpreopen isn't initialized.

            So to summarize, how to fix this currently:

            • Do not have lib.crate-type at all
            • Have the file be src/main.rs, not src/lib.rs
            • Have #![no_main] at the top of the src/main.rs
            • Use RUSTFLAGS="-Z wasi-exec-model=reactor" cargo +nightly build --target wasm32-wasi
            • Make sure that you call _initialize before anything else

            https://github.com/WebAssembly/WASI/issues/24

            https://github.com/rust-lang/rust/pull/79997

            In my case:

            wasi_fs_example/src/main.rs:

            Source https://stackoverflow.com/questions/65978265

            QUESTION

            How can I JIT compile code to run across OSes and for bare metal?
            Asked 2020-Sep-10 at 22:40

            I'm looking to do some realtime data processing within a cross-platform user-facing application, and I need some kind of just-in-time or just-ahead-of-time compilation of dynamically generated code to get the performance I need. I want to use the same library to generate code for a bare-metal microcontroller, but the microcontroller does not need to JIT anything. What's the best solution for embeddable dynamic code execution?

            • I've looked at embedding Clang+LLVM and compiling generated C code on the fly, but couldn't get Clang to compile C from memory.
            • WebAssembly via wasmer would be easier to work with than LLVM, but I believe it needs system libraries and executable memory.
            • I'm embedding this in C++, but the embedded compiler can be written in any language with a C API.
            • Performance is important. I want to do realtime processing without taking more than ~10% CPU time on desktop, and obviously not overloading my microcontroller.
            • I'm okay choosing a microcontroller that can run embedded Linux if necessary, provided it can boot nearly instantly.
            ...

            ANSWER

            Answered 2020-Sep-10 at 22:40

            I think generating and running LLVM IR using the C++ API will be the best solution, unless another option is presented. Though the code generation might be low-level, it supports all relevant platforms, can cross compile, and has exceptional performance.

            Source https://stackoverflow.com/questions/63838164

            QUESTION

            Can't import "ImportObject" from python "wasmer"
            Asked 2020-Aug-20 at 16:51

            So easy to reproduce that I'm surprised that nobody has reported it yet.

            ...

            ANSWER

            Answered 2020-Aug-20 at 16:51

            The library in pip is outdated. The current version is from March, 2nd, and the necessary changes were implemented only on June, 2nd. 0.4.2 beta version is outdated also (May, 19). So, the only way now is manual build. Probably the library will be updated in a couple of weeks.

            See more details in this thread: https://github.com/wasmerio/python-ext-wasm/issues/215.

            Source https://stackoverflow.com/questions/63489278

            QUESTION

            How to use Go slice when calling WebAssembly code in Go?
            Asked 2020-Mar-19 at 05:12

            I want to calculate the sum of an array using WebAssembly in Go:

            ...

            ANSWER

            Answered 2020-Mar-19 at 05:12

            Copy data to WebAssembly memory (for example WebAssembly memory address 0):

            Source https://stackoverflow.com/questions/60735939

            QUESTION

            What does "embed it into other languages" mean in Wasmer?
            Asked 2020-Mar-10 at 00:44

            On https://wasmer.io, it says

            ...

            ANSWER

            Answered 2020-Mar-10 at 00:44

            What they're saying is that you can embed Wasmer runtime itself in various languages, and then use such embeddings to run WebAssembly compiled from any other source language, as long as it's using WASI API for any input / output.

            You can find a list of currently supported embedding targets on their documentation page or on their Github account.

            As of time of this writing supported targets include:

            Different targets have different level of readiness, support and documentation, but you can ask more specific questions when you start playing with a specific target.

            Source https://stackoverflow.com/questions/60594496

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install wasmer

            Wasmer CLI ships as a single executable with no dependencies.
            Powershell (Windows) iwr https://win.wasmer.io -useb | iex
            Homebrew (macOS, Linux) brew install wasmer
            Scoop (Windows) scoop install wasmer
            Chocolatey (Windows) choco install wasmer
            Cargo Note: All the available features are described in the wasmer-cli crate docs cargo install wasmer-cli
            You can start by running QuickJS, a small and embeddable Javascript engine compiled as a WebAssembly module (qjs.wasm):.
            Use Wasmer from your Rust application
            Publish a Wasm package on WAPM
            Read more about Wasmer

            Support

            We appreciate your help! 💜. Check our docs on how to build Wasmer from source or test your changes.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Binary Executable Format Libraries

            wasmer

            by wasmerio

            framework

            by aurelia

            tinygo

            by tinygo-org

            pyodide

            by pyodide

            wasmtime

            by bytecodealliance

            Try Top Libraries by wasmerio

            wasmer-go

            by wasmerioGo

            wasmer-python

            by wasmerioRust

            wasmer-php

            by wasmerioPHP

            kernel-wasm

            by wasmerioC

            wasmer-js

            by wasmerioJavaScript