Lably
Skip to content

Asm.js

Intermediate programming language

  • 8 min read
  • 6 chapters

Related on Lably

Through Subset, JavaScript and Software

asm.js consists of a strict subset of JavaScript, into which code written in statically typed languages with manual memory management (such as C) is translated by a source-to-source compiler such as Emscripten (based on LLVM). Performance is improved by limiting language features to those amenable to ahead-of-time optimization and other performance improvements.

The project was started at Mozilla, and Firefox 22 released in 2013, was the first web browser to ship asm.js-specific optimizations.

Compiler and browser makers' experience with asm.js influenced the development of WebAssembly, which has largely supplanted asm.js since its release. Firefox 148, shipped in 2026, disabled asm.js optimizations and asm.js, with old code transparently continuing to run using the main JavaScript engine.

Design

asm.js enables significant performance improvements for web applications, but does not aim to improve the performance of hand-written JavaScript code, nor does it enable anything other than enhanced performance.

It is intended to have performance characteristics closer to that of native code than standard JavaScript by limiting language features to those amenable to ahead-of-time optimization and other performance improvements. By using a subset of JavaScript, asm.js is largely supported by all major web browsers, unlike alternative approaches such as Google Native Client.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Computing and communication