3 ms·
> Go prioritizes not breaking the ecosystem; this allows to assume that Hyrum’s Law will protect certain observable behaviors of the runtime, from which we may
by mkhattab 1y ago
> Go prioritizes not breaking the ecosystem; this allows to assume that Hyrum’s Law will protect certain observable behaviors of the runtime, from which we may infer what can or cannot break easily.
If this assertion is correct, then effectively Go as a language is an evolutionary dead end. Not sure if I would Go fascinating in this case.
- kyrra 1y agoThey broke the foreach loop behavior in 1.22, mainly to make it match what people expected. https://go.dev/blog/loopvar-preview https://go.dev/blog/loopvar-preview
- tgv 1y agoSmall, but significant point: you can easily avoid the new behavior. IIRC, if you had a pre-1.22 project, and didn't change anything, it still compiles as before. So if you relied on that behavior (which would be very weird, but who knows), backwards compatibility is still there for you.
- kyrra 1y agoIt defaults to the new behavior. If you want the old behavior, you had to set a flag on the compiler. But this applies to all code, so any libraries you include would also get whatever behavior you set on the flag.
- asp_hornet 1y agoThey introduced generics into the language whilst maintaining compatibility and breaking changes between language versions is painful in large code bases.
- sa46 1y agoIt's quite a leap from "certain observable behaviors of the runtime" cannot change to Go is a dead-end. Go regularly makes runtime changes and language changes, see https://go.dev/blog/ https://go.dev/blog/. Some highlights: - Iterators, i.e., range-over-function - Generics - For loops: fixed variable capture - Optimized execution tracing - Changing the ABI from stack-based to register-based.
- styluss 1y agoThey also changed maps' iteration order to be random, rather than insertion order.