madlib
madlib copied to clipboard
Cache module interfaces to load them from disk if the source hasn't been touched
When we compile a module we have a few steps:
- source ast
- canonical ast
- solved ast
- core ast
- generated object file or js file
The idea would be that during the compilation we would save to disk two things:
- an interface file containing enough information for imports, this info would be a mix of what is currently stored in the canonical ast ( types declarations mostly ) and in the solved ast ( instances, exported top level definitions )
- the target file ( object file or js file )
Then from the cache we could just retrieve everything to satisfy imports and then skip later phases of Core and Codegen as the generated output file would already be up-to-date.