All Projects → marvinhagemeister → esbuild-js

marvinhagemeister / esbuild-js

Licence: other
No description, website, or topics provided.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

JS-Parser

This parser started out on a rainy day whilst reading through the source code of esbuild. Evan did an outstanding job in ensuring that the parser does a single pass. Only with the recent addition of scope-tracking there was a need to introduce a second one. Despite of that it's easily one if not the fastest parser for JS currently around. I was wondering how much of that can be attributed to chosing a different lanuguage vs better algorithms and being mindful of allocations.

On that day and the day after I ported most of the lexer to JS. But I lost interest in working on it, until a few months later the topic of parsers came up in relation to other projects. Out of curiosity I tried to build the parser on top of the existing lexer. It's very much translated from esbuild, with a different AST structure. The initial goal was to have it be complient with estree/acorn to make it easy to reuse existing plugins. The more I'm diving into to it, the more I'm questioning that noble goal though. Numeric literals and variables can benefit from much better structures and so I've began to slowly deviate from acorn/estree.

The current goal is to finish translating the missing bits of the parser for the JS-Grammar. I'm currently skipping everything related to TS and any scope-tracking.

Note, that this repo is an experiment for now.

Name

The current name is crap, need a better one.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].