wasmtime README

The project's README from github.com/bytecodealliance/wasmtime. As one markdown file: README.md.

wasmtime

A standalone runtime for WebAssembly

A Bytecode Alliance project

build status zulip chat supported rustc stable Documentation Status

Guide | Contributing | Website | Chat

Installation

The Wasmtime CLI can be installed on Linux and macOS (locally) with a small install script:

curl https://wasmtime.dev/install.sh -sSf | bash

This script installs into $WASMTIME_HOME (defaults to $HOME/.wasmtime), and executable is placed in $WASMTIME_HOME/bin.

After running the install script above, follow the on-screen instructions.

Windows or otherwise interested users can download installers and binaries directly from the GitHub Releases page.

For additional installation options, refer to the online book CLI installation page.

Documentation on Wasmtime's currently supported versions can be found in the online book documentation.

Example

If you've got the Rust compiler installed then you can take some Rust source code:

fn main() {
    println!("Hello, world!");
}

and compile it into a WebAssembly component with:

rustup target add wasm32-wasip2
rustc hello.rs --target wasm32-wasip2

Once compiled, you can run your component:

wasmtime hello.wasm

You should see the following output:

Hello, world!

(Note: make sure you installed Rust using the rustup method in the official instructions above, and do not have a copy of the Rust toolchain installed on your system in some other way as well (e.g. the system package manager). Otherwise, the rustup target add... command may not install the target for the correct copy of Rust.)

Features

Language Support

You can use Wasmtime from a variety of different languages through embeddings of the implementation.

Languages supported by the Bytecode Alliance:

Languages supported by the community:

Documentation

📚 Read the Wasmtime guide here! 📚

The wasmtime guide is the best starting point to learn about what Wasmtime can do for you or help answer your questions about Wasmtime. If you're curious in contributing to Wasmtime, it can also help you do that!


It's Wasmtime.

wasmtime (bytecodealliance/wasmtime)

Searching Database…

18.7K ·GitHub
这是做什么用的?Wasmtime 是一个轻量级的 WebAssembly 运行时:它能快速且安全地执行 WebAssembly(wasm)程序。它用 Rust 编写,由 Bytecode Alliance(字节码联盟)主导开发。
它是命令行工具,还是可以嵌入我自己应用里的库?两者都是。它提供一个独立的命令行工具,用来运行 WebAssembly 文件,同时也能作为库嵌入多种语言的应用程序中。
用它来运行东西,需要先安装 Rust 编译器吗?运行时本身是独立的。只有当你想把自己的源码编译成 wasm 组件时,才需要 Rust(通过 rustup 安装),而且 README 提醒不要把 rustup 和系统全局安装的 Rust 混用。
Cranelift 是什么?Wasmtime 底层所用的优化代码生成器。它能快速生成高质量的机器码,既可以在运行时即时编译(JIT),也可以提前编译(AOT)。
WASI 是什么?即 WebAssembly 系统接口(WebAssembly System Interface)——一套标准,为 WebAssembly 程序提供一组 API,用来和宿主环境交互。Wasmtime 把实现 WASI 作为核心功能之一。
它能运行 WebAssembly 组件(component),还是只能运行核心模块?组件没问题:README 中的示例就是把 Rust 源码编译成一个 WebAssembly 组件,然后直接用命令行工具运行它。
What are similar projects?wasmer, graal, WasmEdge, scriptc, codon, CalcKernel, deno, astrid
Size
163.5 MB
Stars
18.7K
Age
9y
Commits · 90 Days