18K ·GitHub
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.
What are similar projects?
scriptc, tsrs, emscripten, tesseract.js, ondine, liteparse, deno, kotlin
Which topics is it in?
toolchain, webassembly, programming-language, compiler, wasm, browser, npm, nodejs, apache-2.0, javascript, typescript, web