Show HN: I built a WASI playground for running CLI binaries in the browser

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

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

    Browser-based runtime for programming languages and WASI binaries.

  • Oh awesome!! I've just added Trealla to my issues list to add it to Runno.

    If you go into settings you can switch stdin echo on/off. I have stdio devices set up to return their file type as "Character Device" (see: https://github.com/taybenlor/runno/blob/main/packages/wasi-m...). It seems like some binaries handle this well and act like they are directly connected to the TTY (e.g. my quickjs example). Not sure how they determine that. I'm very much coming at this from a web-developer interested in WASI direction, and not from any experience with OSes or linux.

  • WASI

    WebAssembly System Interface

  • Very cool. This is super relevant to me, I've been porting Trealla Prolog to WASI recently and I've been considering moving from wasmer-js to libapps/wasi-js-bindings. This looks like a nice alternative as well.

    I tried running Trealla (you can grab a binary from here https://wapm.io/guregu/trealla) and it seems to work but it doesn't echo any of my input text. Does this have the terminal in raw mode by default? I'm curious how this works given that WASI lacks termios.h.

    I always thought a "Steam for text games/CLI apps" would be super cool (ala webassembly.sh) but the WASI spec is missing a lot of terminal-related things: https://github.com/WebAssembly/WASI/issues/161

  • 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
  • wasi-libc

    WASI libc implementation for WebAssembly

  • Thanks! This project is super cool. Looks like it is well on its way to replace the broken polyfill at https://wasi.dev.

    That makes sense about the stdio file type. I will play around with it and see what I can do. I think I need to copy whatever QuickJS is doing :)

    I'll keep an eye on your WASI runtime. I was just about to start hacking on the same thing. Dropped a comment in your issue about Trealla as well. Let's make WASI in the browser awesome!

  • fs

    File System Standard (by whatwg)

  • Score another point for memfs, the in-memory node.js fe impl.

    WHATWG recently took up File System Access spec as their FS spec. It both looks semi promising, but they seem to only care about & are only building specs for specifically emscripten wasm users. Only sync apis, only usable from dedicated workers... there's some hopes for more latter but feels super weird to see the web finally get fs access & have it be fast... but for it to be extremely odd shaped hand tailored to a very narrow class of use.

    https://fs.spec.whatwg.org/

  • wasmer-js

    Monorepo for Javascript WebAssembly packages by Wasmer

  • Good spotto! That's the WASI runtime from wasmerjs (https://github.com/wasmerio/wasmer-js).

    That's not the WASI runtime being used in this playground. The one in this playground is @runno/wasi-motor (https://github.com/taybenlor/runno/tree/main/packages/wasi-m...). I haven't released it as an NPM package, but it's all MIT so feel free to copy it.

  • 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
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