#![no_std] with WASI is more complicated than I thought it would be

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • cargo-wasi

    A lightweight Cargo subcommand to build Rust code for the `wasm32-wasi` target

  • I use cargo-wasi to build it:

  • wasi-libc

    WASI libc implementation for WebAssembly

  • So what happened is that _start is already defined by this mysterious crt1-command.o. I didn't learn until much after that this is from wasi-libc:

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • WASI

    WebAssembly System Interface

  • Uh... ok then. At this point I decide that I should probably use WASI to define this exit function, instead of just endlessly looping. So I link in proc_exit. According to the WASI docs, proc_exit takes in an exitcode (a u32) and returns nothing. Perfect!

  • wasi

    Experimental WASI API bindings for Rust (by bytecodealliance)

  • At this point, I look into Bytecode Alliance's WASI rust bindings, used by Rust's std.

  • wasmtime

    A fast and secure runtime for WebAssembly

  • I use fd_write, and since I don't want to look into how interface types work, I just look at the wasi crate again, with some help from the wasmtime WASI WAT tutorial.

  • wee_alloc

    The Wasm-Enabled, Elfin Allocator

  • Ok. Now I need to add in a global allocator. I use wee_alloc since I know it works pretty well with WASM: Cargo.toml

  • compiler-builtins

    Porting `compiler-rt` intrinsics to Rust

  • Um. Ok, I remember this kind of thing. I do some searching and then rediscover compiler_builtins.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts