Pre-RFC: Add language support for global constructor functions

I would like to see in the RFC a (very serious and fleshed out) alternative of introducing instead a more restricted foundation that still allows for implementing something similarly powerful to the API of inventory without introducing any life-before-main. Fundamentally the thing needed for inventory is “have a way of knowing about things without depending on them,” which is a very different requirement from “have a way to run things before main.”

See linkme::distributed_slice for something in the direction that I have in mind.

I would encourage you to consider seriously whether this approach might be better than the one in the RFC, as I think it might be, and pivot the RFC accordingly.

17 Likes