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

Change ByteIdx in the lexer/parser to u32 #27

Open
adamchristiansen opened this issue Jan 31, 2025 · 0 comments
Open

Change ByteIdx in the lexer/parser to u32 #27

adamchristiansen opened this issue Jan 31, 2025 · 0 comments
Assignees

Comments

@adamchristiansen
Copy link
Member

Currently the ByteIdx into source files is a usize, which is unnecessarily large on 64-bit systems. This leads to a lot of wasted space in the AST when tracking source spans, since the upper 32 bits is never used (unless there is a source file >4 GB...). Switching to u32 will be more compact and still be able to represent any reasonable source file.

@adamchristiansen adamchristiansen moved this to Ready in Parser Jan 31, 2025
@adamchristiansen adamchristiansen self-assigned this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

1 participant