top | item 43758695

(no title)

mkhattab | 10 months 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.

discuss

order

sa46|10 months ago

It'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/. 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.

asp_hornet|10 months ago

They introduced generics into the language whilst maintaining compatibility and breaking changes between language versions is painful in large code bases.

styluss|10 months ago

They also changed maps' iteration order to be random, rather than insertion order.

kyrra|10 months ago

They broke the foreach loop behavior in 1.22, mainly to make it match what people expected.

https://go.dev/blog/loopvar-preview

tgv|10 months ago

Small, 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.