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

Investigate binary AST storage #6

Closed
RedMser opened this issue Apr 29, 2024 · 1 comment
Closed

Investigate binary AST storage #6

RedMser opened this issue Apr 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@RedMser
Copy link
Owner

RedMser commented Apr 29, 2024

Games could store the AST in a binary serialization, so that parsing of .ftl files is not required at runtime. This could be done in a conversion step by an editor import plugin (related to #1). Formats like .png get imported and remapped to a .ctex file, this would be a similar approach.

This saves disk space, can combine multiple files into one, and could minify the data by e.g. removing all comment tokens.

See projectfluent/fluent-rs#352 for upstream support, although unlikely to happen.

Since fluent_bundle::FluentResource only takes a String as input, might need to use a compatible trait and/or insert entries by hand.

@RedMser RedMser added the enhancement New feature or request label Apr 29, 2024
@RedMser
Copy link
Owner Author

RedMser commented May 2, 2024

Parser already removes comments internally, so they're only really wasting disk space. Likely not worth the additional implementation effort.

Not sure how much of a difference merging files would make, should investigate whether Mozilla do this manually / if the lib does it automatically / if this helps anything at all.

@RedMser RedMser closed this as completed May 2, 2024
@RedMser RedMser closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant