Second State
  • What is Second State?
  • Server-side WebAssembly
    • Why?
      • WebAssembly vs native code
    • Getting started
      • VS Codespaces
      • The ssvmup tool
    • Rust functions in Node.js
    • Access system resources
      • WASI
      • The storage interface
      • The inference interface
    • Examples and use cases
      • Encryption and decryption
      • Machine learning
      • Artificial intelligence
    • SSVM Performance
  • Function as a Service
    • Getting started
      • Context
      • Send result to another service
    • Input and output
      • JSON argument
      • Binary argument
      • Multiple arguments
      • Argument from a URL
      • JSON return value
      • Binary return value
      • Redirect return value
    • Stateful execution
  • Related technologies
    • Deno, Rust and WebAssembly
    • A Rusty hello world
    • Rust and WebAssembly
    • WebAssembly in the browser
    • Access JavaScript from Rust
    • How to Learn Rust Without Installing Any Software
    • How to Publish a no-code website in 10 minutes
Powered by GitBook
On this page

Was this helpful?

  1. Server-side WebAssembly
  2. Getting started

The ssvmup tool

The compiler toolchain for Rust functions in JavaScript

PreviousVS CodespacesNextRust functions in Node.js

Last updated 4 years ago

Was this helpful?

This page is outdated. Please visit here to learn how the work.

Throughout our examples, we make extensive use of the tool. It is inspired by the wasm-pack project but is optimized for server-side applications. Specifically, it supports the WebAssembly virtual machine and Deno host runtime.

The uses wasm-bindgen to automatically generate the “glue” code between JavaScript and Rust source code so that they can communicate using their native data types. Without it, the function arguments and return values would be limited to very simple types (i.e., 32-bit integers) supported natively by WebAssembly. For example, without and wasm-bindgen.

The easiest way to install is through .

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

You could also install as a standalone tool for runtimes such as Deno. You need to have Rust installed before running the command below.

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

Next, to use ssvmup to build Rust functions for Node.js and Deno applications.

ssvmup tool
ssvmup
SSVM
ssvmup
strings or arrays would not be possible
ssvmup
ssvmup
NPM
ssvmup
learn how