tc39 / proposal-binary-ast

Binary AST proposal for ECMAScript
963 stars 23 forks source link

Consider a compressed file format with pre-shared dictionary. #75

Open pmeenan opened 5 years ago

pmeenan commented 5 years ago

The binast files should benefit from using brotli as a file compression format with a binast-specific dictionary (that is part of the spec and built into the clients). Similar to how woff2 specifies brotli as part of the file format for the file itself. Presumably the pre-shared dictionary can contain the binast structures/tags as well as the full DOM and ES6 API's.

By making the compression part of the file format itself it will be done at build time and will also be more likely to use higher compression levels than most servers use at transfer time.

The dictionary may age as new interfaces become popular but it will still be at least as good as using brotli without a custom dictionary.