Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove strings from the compiler and internal AST to reduce bundle format #327

Open
DrRataplan opened this issue Apr 22, 2021 · 0 comments

Comments

@DrRataplan
Copy link
Collaborator

Right now, we use a bunch of string literals in the parser. We should be able to replace those with for example numbers.

I'm thinking of something like this:

Inject an object that maps all AST nodes to a number and make sure the closure compiler inlines those numbers. In the compiler, use the same object to traverse the AST in a logical way.

For the parseExpression function, we will still need the expanded human readable names, but that will reduce the repetition of those names in both the parser and the AST to only one central place.

Before integrating, make sure that the total binary size actually decreases! Especially compression already cause the duplicated strings to impact the binary size not that much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant