[][src]Crate binjs

A reference implementation for the BinJS binary source format for JavaScript.

About BinJS

As websites become more sophisticated, the amount of JavaScript source code keeps increasing. By itself, this is not a problem. However, with the amount of code loaded by large websites such as Facebook's chat, it is now common to witness page loads during which both the loading and the parsing of JS code can take several seconds each – this is assuming a fast connection, and taking into account that the code is both compressed and optimized for loading and parsing speed.

There is no reason to believe that the size of JS code will decrease or will even stop increasing, nor that every large webdev team has the means to profile loading and parsing speed of all their code.

This crate offers a (WIP) reference implementation for BinJS, a vendor-neutral JavaScript format designed to optimize parsing speed and, when possible, loading speed.

Modules

generic

Working with a generic (i.e. JSON-based) representation of the JavaScript AST.

io

Language-agnostic and representation-agnostic primitives for tokenization and detokenization of ASTs, including (de)compression.

meta

Dynamic manipulation of the specifications.

source

Parsing source JavaScript. Source-level operations.

specialized

Working with a specialized (i.e. strongly-typed) representation of the JavaScript AST.