by the_duke · 3y ago · 0 comments
The Go approach does indeed seem to enable similar functionality. Although I'm not quite sure I understand how the individual settings and the module level version declarations compose, and how much complexity that introduces.
With both module-level versions and GODEBUG, the whole thing does seem quite a bit more complicated than editions.
No. If a module's go.mod files declares go1.21, the compiler will use go1.21 semantics when building it, even if 1.22 has already been published and the module is being used from a 1.22-enabled program. This is explicitly mentioned in the blog post.
"This crate is edition X, and an edition comes out every 3 years or so" is much easier to deal with.
It reminds me a bit of Haskell language pragrams, which can be toggled per source file (module), and which are a huge mess.