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 way types are stored and represented + allow for more than u16::MAX types #120

Open
kaleidawave opened this issue Mar 3, 2024 · 1 comment
Assignees
Labels
architecture type checking and compiler related general structuring bug Something isn't working checking Issues around checking compiler-performance Making parsing / type checking / transformations faster

Comments

@kaleidawave
Copy link
Owner

Currently all types are currently held under a single Vec<Type>, and TypeId is pointer into this vector. TypeId is a wrapped for a u16. To support larger files/codebases this needs to increase

  • Currently the sequential ids require the whole program to be checked (from a starting point). Adding more incremental parts will create problems if an intermediate file is changed. TypeId has to be split between libraries/files somehow.

  • Also from Add binary type caching back and think about TypeId #103: Adding versioning or something to the binary format that can be checked on deserialization. This is because new versions of the compiler might have a different representation in byte form (new fields, removed enum members, etc) that isn't compatible to be parsed with binary files generated by older compilers

@kaleidawave kaleidawave added bug Something isn't working checking Issues around checking compiler-performance Making parsing / type checking / transformations faster labels Mar 3, 2024
@kaleidawave kaleidawave self-assigned this Mar 3, 2024
@kaleidawave kaleidawave added the architecture type checking and compiler related general structuring label Mar 3, 2024
@kaleidawave
Copy link
Owner Author

Quick thoughts:

Considering struct TypeId { block: u16, offset: u16 }. Where BlockId points to a collection of Vec<Type> that can span multiple files / packages. But each block only contains types per module so that invalidations have a limited effect or something.

@kaleidawave kaleidawave changed the title Allow for more than u16::MAX types Change way types are stored and represented + allow for more than u16::MAX types May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture type checking and compiler related general structuring bug Something isn't working checking Issues around checking compiler-performance Making parsing / type checking / transformations faster
Projects
None yet
Development

No branches or pull requests

1 participant