All Projects → second-state → rustwasmc

second-state / rustwasmc

Licence: other
Tool for building Rust functions for Node.js. Combine the performance of Rust, safety and portability of WebAssembly, and ease of use of JavaScript.

Programming Languages

rust
11053 projects
shell
77523 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to rustwasmc

cabasa
Haxe Framework for WebAssembly
Stars: ✭ 30 (-69.07%)
Mutual labels:  webassembly, wasm
WasmEdge-go
The GO language SDK and API for WasmEdge
Stars: ✭ 62 (-36.08%)
Mutual labels:  webassembly, wasmedge
jasper
🧳 Single-binary packaging for Ruby applications that supports native and Wasm targets
Stars: ✭ 29 (-70.1%)
Mutual labels:  webassembly, wasm
wasm-ops
Chart of WebAssembly Instructions
Stars: ✭ 46 (-52.58%)
Mutual labels:  webassembly, wasm
gearoenix
Cross-platform C++ 3D game engine.
Stars: ✭ 33 (-65.98%)
Mutual labels:  webassembly, wasm
wasm-linker-js
A simple WebAssembly Linker in JavaScript
Stars: ✭ 14 (-85.57%)
Mutual labels:  webassembly, wasm
fullstack-rust
Reference implementation of a full-stack Rust application
Stars: ✭ 39 (-59.79%)
Mutual labels:  webassembly, wasm
Prism
Build frontend web apps with Ruby and WebAssembly
Stars: ✭ 251 (+158.76%)
Mutual labels:  webassembly, wasm
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (-65.98%)
Mutual labels:  webassembly, wasm
vmrp
mrp emulator, virtual machine, mrp模拟器
Stars: ✭ 126 (+29.9%)
Mutual labels:  webassembly, wasm
vrcpu
Code, documentation, schematics, notes for my Ben Eater inspired breadboard computer and emulator
Stars: ✭ 98 (+1.03%)
Mutual labels:  webassembly, wasm
image-hub
Image Hub is a sample application for exploring WebAssembly modules used as Envoy filters.
Stars: ✭ 56 (-42.27%)
Mutual labels:  webassembly, wasm
ugo-compiler-book
📚 µGo语言实现(从头开发一个迷你Go语言编译器)[Go版本+Rust版本]
Stars: ✭ 996 (+926.8%)
Mutual labels:  webassembly, wasm
block-aligner
SIMD-accelerated library for computing global and X-drop affine gap penalty sequence-to-sequence or sequence-to-profile alignments using an adaptive block-based algorithm.
Stars: ✭ 58 (-40.21%)
Mutual labels:  webassembly, wasm
wasmedge-nodejs-starter
A template project to run Rust functions in Node.js through the Second State WebAssembly engine.
Stars: ✭ 148 (+52.58%)
Mutual labels:  node-js, second-state
wasmsign2
PoC implementation of the WebAssembly Modules Signatures proposal.
Stars: ✭ 18 (-81.44%)
Mutual labels:  webassembly, wasm
Wasmer Postgres
💽🕸 Postgres library to run WebAssembly binaries.
Stars: ✭ 245 (+152.58%)
Mutual labels:  webassembly, wasm
Rust Yew Realworld Example App
Exemplary real world app built with Rust + Yew + WebAssembly
Stars: ✭ 249 (+156.7%)
Mutual labels:  webassembly, wasm
imgalign
Webapplication for image stitching and aligning
Stars: ✭ 162 (+67.01%)
Mutual labels:  webassembly, wasm
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (-24.74%)
Mutual labels:  webassembly, wasm

rustwasmc

Rust compiler toolkit for WebAssembly apps in the WasmEdge Runtime

npm npm GitHub language count GitHub top language

Developers: Getting started with the Second State Functions (a serverless FaaS service), Tencent Serverless Functions for AI inference, or your own Node.js server.

About

A one-stop tool for building Rust functions into WebAssembly for deployment on the WasmEdge Runtime.

Prerequisite

You will need to install the Rust compiler in order to use rustwasmc. Currently, we support up to Rust 1.50.0.

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ source $HOME/.cargo/env

Install

From Linux command line

$ curl https://raw.githubusercontent.com/second-state/rustwasmc/master/installer/init.sh -sSf | sh

From NPM and Node.js

$ npm install -g rustwasmc # Append --unsafe-perm if permission denied

Usage

To build Rust functions for Node.js applications, use the following command. See a template application. The rustwasmc compiles and generates the wasm file, and the corresponding JavaScript file to call wasm functions from JavaScript. If the rust package contains only binary crate(s) and there are no library crate, the build command will only generate a wasm-wasi file for running as a standalone command program in the WasmEdge VM.

$ rustwasmc build

In most cases, you will want to enable AOT optimization in order to improve performance.

$ rustwasmc build --enable-aot

If you would like to use WasmEdge's extended APIs including Tensorflow, enable the extensions. Make sure that you install the wasmedge-extensions NPM module in this case.

$ rustwasmc build --enable-aot --enable-ext

To build Rust functions for Deno applications, use the following command. See a template application.

$ rustwasmc build --target deno

By default, rustwasmc will generate a directory for it's build output called pkg. If you'd like to customize this you can use the --out-dir flag.

$ rustwasmc build --out-dir out

Use clean subcommand to remove pkg and target directories.

$ rustwasmc clean

Logging

rustwasmc uses env_logger to produce logs when rustwasmc runs.

To configure your log level, use the RUST_LOG environment variable. For example:

$ RUST_LOG=info rustwasmc build

Known issues

For Rust version 1.51 and above, rustwasmc generates bytecode without WASI support. That means programs that access the file system, date and time, environment variables, and command line arguments would fail on Rust 1.50+. This should not affect most application use cases. We are working on a solution.

Acknowledgment

This project is derived from the open source wasm-pack.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].