Mercerenies / tfactor

0 stars 0 forks source link

Module Synonyms #11

Closed Mercerenies closed 4 years ago

Mercerenies commented 4 years ago

Module synonyms are a mess with respect to module load order. Namely, they don't occupy resource IDs themselves, so they get loaded as an accessory to their parent. This in and of itself isn't unsound, but it causes several unintuitive behaviors. For example, it means we can't instantiate a functor in the same module as it's been declared.

Here's my proposal. Synonyms used to have placeholder resource IDs that were only used until they could be dereferenced. We go back to that system and place synonyms themselves into the load order. They dereference when module-loaded.

Note that while this doesn't solve #8, it does make it less egregious. With the above proposal, we would be able to instantiate functors at the top-level, which alleviates a lot of the suffering in dealing with #8.

Mercerenies commented 4 years ago

Module synonyms and functor actualizations are now resources of type SynonymPlaceholder.