assemblyscript README

The project's README from github.com/AssemblyScript/assemblyscript. As one markdown file: README.md.

AssemblyScript logo

Test status Publish status npm compiler version Discord online #StandWithUkraine

AssemblyScript compiles a variant of TypeScript (basically JavaScript with types) to WebAssembly using Binaryen. It generates lean and mean WebAssembly modules while being just an npm install away.

About  ·  Getting started  ·  Examples  ·  Built with AssemblyScript


Contributors

Contributor logos

Thanks to our sponsors!

Most of the maintainers and contributors do this open source work in their free time. If you use AssemblyScript for a serious task or plan to do so, and you'd like us to invest more time on it, please donate to our OpenCollective. By sponsoring this project, your logo will show up below. Thank you so much for your support!

Sponsor logos

Development instructions

A development environment can be set up by cloning the repository:

git clone https://github.com/AssemblyScript/assemblyscript.git
cd assemblyscript
npm install
npm link

The link step is optional and makes the development instance available globally. The full process is documented as part of the repository:

assemblyscript (AssemblyScript/assemblyscript)

Searching Database…

What is this?AssemblyScript is a programming language that looks like TypeScript and compiles to WebAssembly, so you can write .wasm modules in familiar JS/TS syntax instead of Rust or C.
So is it a language, a compiler, or a library I import into my code?It's a language plus its compiler toolchain, shipped as an npm package: you run the compiler ('asc') in your build step to emit .wasm files, which your app then loads and executes at runtime.
How do I set up a new AssemblyScript project?Install the compiler from npm ('npm install -g assemblyscript') and scaffold a starter project with 'npx asinit .', which creates a config file and example sources to build on.
What do I need to have installed before I can use it?Node.js and npm — the toolchain requires Node 20+ and npm 10+. It pulls in Binaryen as its WebAssembly optimization backend, but everything installs automatically via npm.
Can I take my existing TypeScript or JavaScript code and compile it straight to wasm?Not as-is — AssemblyScript is a TypeScript-like language, not all of TypeScript: code must be written with wasm-compatible static types in mind, so plain untyped JavaScript won't compile.
Where does the resulting WebAssembly actually run?Anywhere WebAssembly is supported — modern browsers and standalone wasm runtimes — while the compiler itself runs on Node.js 20+, so any dev machine with Node can build with it.
Why use AssemblyScript instead of writing Rust or C for WebAssembly?The pitch is familiar syntax: web developers who know TypeScript can produce fast, optimized .wasm binaries without learning a systems language and its build tooling.
What is Binaryen and why does the compiler depend on it?Binaryen is a WebAssembly compiler and optimization toolkit that AssemblyScript uses as its backend; it comes along automatically as an npm dependency when you install the compiler.
Is it free to use for serious projects, and how is it maintained?Yes — it's open source under Apache-2.0. The maintainers and contributors do the work in their free time and ask teams using it for serious tasks to donate via OpenCollective, where sponsors get their logo shown.
Size
163.1 MB
Stars
18K
Age
9y
Commits · 90 Days