lark-parser / Lark.js

Live port of Lark's standalone parser to Javascript
MIT License
71 stars 12 forks source link

Reduce size of generated parser #5

Open erezsh opened 3 years ago

erezsh commented 3 years ago

Size is affected by parser + serialized data

The parser is already of a reasonable size (~15kb in min+zip), but it could be further reduced by refactoring the parse_tree_builder and lexer to serialize instead of rebuild at runtime. (also should have a slight faster loading time).

The serialized data can be changed into a better format, more efficient and with less repetition. Although it's not clear that it will make much difference when zipped.