Skip to content
master
Go to file
Code

Latest commit

2026: expose trap error from RuntimeError r=syrusakbary a=ailisp

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
<!-- 
Provide details regarding the change including motivation,
links to related issues, and the context of the PR.
-->

Internal of RuntimeError is private, user can know UserError via `downcast`, but user isn't able to tell the trap code if it's a `Trap`. This PR expose trap code via `RuntimeError#to_trap`. (And, if both downcast returns error and to_trap returns None, user will know it's a `RuntimeError::Generic`, which can be shown by `error.message()`, so there's no need to expose `RuntimeError::Generic` case)

# Review

- [x] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Bo Yao <bo@nearprotocol.com>
b4d2d8e

Git stats

Files

Permalink
Failed to load latest commit information.

README.md

Wasmer logo

Build Status License Slack channel

Website β€’ Docs β€’ Chat


Wasmer enables super lightweight containers based on WebAssembly that can run anywhere: from Desktop to the Cloud and IoT devices, and also embedded in any programming language.

Features

  • Fast & Safe. Wasmer runs WebAssembly at near-native speed in a fully sandboxed environment.

  • Pluggable. Wasmer supports different compilation frameworks to best suit your needs (LLVM, Cranelift...).

  • Universal. You can run Wasmer in any platform (macOS, Linux and Windows) and chipset.

  • Standards compliant. The runtime passes official WebAssembly test suite supporting WASI and Emscripten.

Quickstart

Wasmer ships with no dependencies. You can install it using the installers below:

curl https://get.wasmer.io -sSfL | sh
With PowerShell (Windows)

iwr https://win.wasmer.io -useb | iex

See wasmer-install for more installation options: Homebrew, Scoop, Cargo...

Executing a WebAssembly file

After installing Wasmer you should be ready to execute your first WebAssemby file! πŸŽ‰

You can start by running QuickJS: qjs.wasm

$ wasmer qjs.wasm
QuickJS - Type "\h" for help
qjs >

Here is what you can do next:

Language Integrations

πŸ“¦ Wasmer runtime can be used as a library embedded in different languages, so you can use WebAssembly anywhere.

Β  Language Package Docs
Rust logo Rust wasmer Rust crate Docs
C logo C/C++ wasmer.h headers Docs
C# logo C# WasmerSharp NuGet package Docs
D logo D wasmer Dub package Docs
Python logo Python wasmer PyPI package Docs
JS logo Javascript @wasmerio NPM packages Docs
Go logo Go wasmer Go package Docs
PHP logo PHP wasm PECL package Docs
Ruby logo Ruby wasmer Ruby Gem Docs
Java logo Java wasmer/wasmer-jni Bintray package Docs
Elixir logo Elixir wasmex hex package Docs
R logo R no published package Docs
Postgres logo Postgres no published package Docs
Swift no published package

πŸ‘‹ Missing a language?

Contribute

We welcome any form of contribution, especially from new members of our community πŸ’œ

You can check how to build the Wasmer runtime in our awesome docs!

Testing

Test you want? The Wasmer docs will show you how.

Community

Wasmer has an amazing community of developers and contributors. Welcome, please join us! πŸ‘‹

Channels

You can’t perform that action at this time.