<commit_before><commit_msg>design doc for caching compiled interfaces<commit_after>Support for compiled interfaces
————————————————

When F* type checks a module, it also has to type check the standard
library and all imported modules to include their definitions in the
environment. Instead, it would be good to have support for persistent
cache of compiled module interfaces, that can be restored when
needed.

On the writing side, once F* type checker finishes type checking a
module module.fs, it can serialize following details of the module to
a module.tc file:

— The definition of non-private types
— Signature (kinds) of private types (?)
— Non-private val declarations
— Signature of non-private top level let bindings that do not have val
declarations
— Definitions of top-level pure functions
— Non-private assumptions
— Monad declarations

(Thanks Nik for the list !)

Marshaling format: TBD

On the reading side, when the type checker finds an import module,
it’s going to read the module.tc file and populate the type
environment. It needs to check that the module.tc file is not
outdated. It can do that by comparing the timestamps of the module
file and module.tc file. Alternatively, we can have more elaborate
Makefile rules listing all the dependencies there, and then let make
handle the generation of module.tc file.

{'fraction_non_alphanumeric': 0.05078416728902166, 'fraction_numerical': 0.0, 'mean_word_length': 4.775862068965517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3899228', 'n_tokens_mistral': 336, 'n_tokens_neox': 320, 'n_words': 206}