Pre-RFC: Add language support for global constructor functions

The main reason I would argue for it would be to allow proper support an all platforms, not just those with intrinsics already available to implement the functionality. In particular, I believe only the compiler has the ability to coalesce values together in wasm-unknown-unknown - it's just doesn't support link sections as a target.

If it was possible to implement it on all platforms in a library, then I would agree with you. But if the alternatives end up being a library supported only on Windows, OSX and Linux, and a std implementation with support for many for platforms, then I'd go for the latter.

3 Likes