Patches the AssemblyScript compiler to utilize WASI imports instead of Web APIs.

Overview

WASI shim for AssemblyScript

Test status Publish status

Patches the AssemblyScript compiler to utilize WASI imports instead of Web APIs.

Note that this shim also serves a higher purpose, that is as an example of how to target any non-standard interface with the AssemblyScript compiler, including your own!

Supported features

See the assembly folder for the concrete implementations.

Component Functionality
console assert, log, debug, info, warn, error, time, timeEnd
crypto getRandomValues
date now
internal abort, trace, seed
performance now
process arch, platform, argv, env, exitCode, stdin¹, stdout¹, stderr¹, hrtime

¹ Limited/basic support

Usage

First, install the WASI shim alongside the AssemblyScript compiler:

npm install --save-dev @assemblyscript/wasi-shim

Afterwards, reference the provided configuration file in your builds.

Option 1: Command line

When invoking asc manually, add --config ./node_modules/@assemblyscript/wasi-shim/asconfig.json as a command line option.

Option 2: Config file

When using an asconfig.json for your project, extend the provided configuration file instead:

{
  "extends": "./node_modules/@assemblyscript/wasi-shim/asconfig.json",
  // ...
}

That's it. The AssemblyScript compiler now emits WASI-compatible modules. No more Web APIs!

Migrating from 0.20

Using this shim offers almost identical functionality to the former WASI support that was included with the AssemblyScript compiler up to version 0.20. The differences are:

  • The prior import "wasi" mechanism is no longer necessary and hence no longer supported.
  • The compiler does no longer try to detect if a module is a WASI command or reactor. By default, a command will be assumed. For a reactor, specify --exportStart _initialize. See the WASI documentation for differences.

Considerations

Since version 0.21, AssemblyScript considers WASI, derived proposals, the W3C's endorsement of its subgroup and the Bytecode Alliance's practices, that not all of their respective members necessarily are aware and/or approve of, harmful to open standards in general and the WebAssembly specification in particular.

The AssemblyScript project neither endorses nor officially supports any particular custom interface suitable to undermine purpose, goals and/or values of open Web standards. This package is nonetheless provided to our community for those who, given the subsequently established market situation, have no other choice than to use such interfaces or derived products. Regardless of the existence of this package, we explicitly welcome healthy competition in the rich design space of modern host interfaces. Specifically, we'd love to see (and use) a truly open host interface that keeps the Web in mind, i.e. adheres to WebAssembly's goals, while being portable, secure and efficient for many programming languages — including those that are a natural fit for the Web platform.

You might also like...

Tracer for module requires/imports to optimize coldstarts in serverless

treq treq is a library to automatically trace requires/imports in your serverless applications and gives you insights about the most expensive modules

Aug 16, 2022

An imports transform unplugin.

unplugin-transform-imports An imports transform unplugin based on babel inspired by babel-plugin-transform-imports. What unplugin-transform-imports Do

Nov 29, 2022

Sort imports by path - VS Code extension

Import sort by absolute path The sorting algorithm will group each item in the array and sort (alphabetically) its children that starts with the path

Feb 2, 2022

Wrap a function with bun-livereload to automatically reload any imports inside the function the next time it is called

bun-livereload Wrap a function with bun-livereload to automatically reload any imports inside the function the next time it is called. import liveRelo

Dec 19, 2022

Emoji - Use emoji names instead of Unicode strings. Copy-pasting emoji sucks.

Grammy Emoji Adds emoji parsing for grammY. Check out the official documentation for this plugin. While this draft is working, we still do not recomme

Sep 5, 2022

Quo is a (free) debugging companion app to help you debug dumped variables, the dumped variables will appear in this Quo client instead of the traditional way which is often tedious.

Quo is a (free) debugging companion app to help you debug dumped variables, the dumped variables will appear in this Quo client instead of the traditional way which is often tedious.

Quo is a debugging companion to help you debug dumped variables, the dumped variables will appear in this Quo client instead of via the traditional way which is often tedious.

Dec 25, 2022

kakaolink-plugin is a remote-kakao plugin for sending KakaoLinks instead of plain text

kakaolink-plugin is a remote-kakao plugin for sending KakaoLinks instead of plain text

kakaolink-plugin Discord Server About kakaolink-plugin is a remote-kakao plugin for sending KakaoLinks instead of plain text. Requirements Node.js v17

Oct 1, 2022

shell script replacement; write shell scripts in js instead of bash, then run them with a single static binary

yavascript YavaScript is a bash-like script runner which is distributed as a single statically-linked binary. Scripts are written in JavaScript. There

Dec 29, 2022

Pure JavaScript library that add .is-hover class instead of css :hover for mobile and desktop.

 Pure JavaScript library that add .is-hover class instead of css :hover for mobile and desktop.

MultiDeviceHover Pure JavaScript library that add .is-hover class instead of css :hover for mobile and desktop. Usage Install Using npm, install multi

Oct 5, 2021
Owner
The AssemblyScript Project
Umbrella GitHub organization for everything AssemblyScript.
The AssemblyScript Project
Automaticly parses known pocket ips patch resources, scans folders or zip files for matching roms and applies the patches.

Pocket Automaton Automaticly parses known pocket ips patch resources, scans folders or zip files for matching roms and applies the patches. Usage pock

null 3 Nov 27, 2022
This experimental library patches the global custom elements registry to allow re-defining or reload a custom element.

Redefine Custom Elements This experimental library patches the global custom elements registry to allow re-defining a custom element. Based on the spe

Caridy Patiño 21 Dec 11, 2022
🔂 Send patches around to keep the system in sync.

The core idea is to use patches to keep the UI in sync between client and server, multiple clients, or multiple windows. It uses Immer as an interface

Webstudio 27 Sep 15, 2022
A WASI implementation that uses VS Code's extension host as the implementing API

Project This repo has been populated by an initial template to help get you started. Please make sure to update the content to build a great experienc

Microsoft 93 Dec 24, 2022
practice site to utilize node.js, Express, and mySQL

fishing_site practice site to utilize node.js, Express, and mySQL Run Locally create local instance of MySQL database. Run DB/fishing_Schema.sql to cr

Ryan Graue 1 Jan 22, 2022
Helps make it easier to utilize flyte from vs-code

Flyte-Wingman This is the repository for the Flyte-Wingman vscode extension. This extension can be used to easily create, serialize, and register pyth

Striveworks Inc 11 Jun 13, 2022
Simple trading bot that utilize Jupiter SDK on Solana blockchain.

solana-jupiter-bot CAUTION! Use at Your own risk! I take no responsibility for your transactions! ⚠️ EPILEPSY WARNING - CLI UI is constantly refreshed

Pawel Mioduszewski 13 Dec 27, 2022
O projeto MKS Sistemas tem como objetivo o desenvolvimento de uma aplicação em React que utilize endpoint da API de produtos fornecida pela própria MKS Sistemas.

MKS front-end Descrição O projeto MKS Sistemas tem como objetivo o desenvolvimento de uma aplicação em React que utilize endpoint da API de produtos f

Rodrigo William 4 Jul 21, 2022
Sheetzapper imports your account value accross Zapper.fi supported wallets and dapps into a Google Sheet

Overview Sheetzapper imports your account value accross Zapper.fi supported wallets and dapps into a Google Sheet. This allows you to chart your net w

null 4 Nov 27, 2022
Combine type and value imports using Typescript 4.5 type modifier syntax

type-import-codemod Combines your type and value imports together into a single statement, using Typescript 4.5's type modifier syntax. Before: import

Ian VanSchooten 4 Sep 29, 2022