Skip to content

nightly-2023-12-14: chore!: Make file manager read-only to the compiler (#3760)

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 14 Dec 02:15
· 1728 commits to master since this release
e3dcc21
# Description

This is a PR that moves us towards having the compiler see the
FileManager as an immutable object. How it gets populated will now be
upto the caller.

One issue we have so far is that caller, can be in the wasm context or
the native context, so we have file_reader being a component that we
conditionally compile depending on the context.

Ideally we move to a case where both package source resolution and
dependency source resolution is done beforehand, and the compiler
assumes that FileManager has both the source for its current crate and
all of the crates dependencies.

This separation of concerns makes it easier to incrementally compile
parts of the compiler in the future. For example, if the FileManager has
not changed, then we know that the compilation result should not
change,and we do not need to recompile.

Further, lets say we add a pass that solely does parsing of the root
files in the File Manager, If a particular parsed AST has not changed,
then we do not need to parse that file again.

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.

---------

Co-authored-by: Tom French <[email protected]>
Co-authored-by: Tom French <[email protected]>