News for hackers. Stuff that matters.
Re:Go automatically downloads a newer toolchain if needed by Jyaif on Tuesday August 20, 2024 @06:56AM (#41298788)
This sounds amazingly convenient! Language creators, please take note.
Re:Go automatically downloads a newer toolchain if needed by sgt on Tuesday August 20, 2024 @07:27AM (#41298959)
Imagine if Python 2 automatically upgraded itself to Python 3.
Re:Go automatically downloads a newer toolchain if needed by kokada on Tuesday August 20, 2024 @08:14AM (#41299316)
Author here.

This doesn't make sense. The toolchain will be updated only IF you say your project only runs in Go >= XX. This is what `go` directive in `go.mod` says: my projects doesn't work in versions of Go older than this. This is why it happened to me, I declared I need `go 1.23` because of range-over-func, and the toolchain respected my wishes.

This is not an "enforcing you to use the latest Go version, even if you don't wish for it".

Re:Go automatically downloads a newer toolchain if needed by danslo on Tuesday August 20, 2024 @08:09AM (#41299279)
After explicitly setting the python version to 3 in package.json? Yes please!
Re:Go automatically downloads a newer toolchain if needed by trw9991019 on Tuesday August 20, 2024 @08:03AM (#41299221)
I don't like Python much, but they will definitely not pull off something like this (again), because they've actually learned from that mistake and broadly agree that it was one.
Re:Go automatically downloads a newer toolchain if needed by IshKebab on Tuesday August 20, 2024 @07:49AM (#41299112)
Python 3 is not backwards compatible with Python 2 so why would it do that?

Maybe you meant "imagine if Python 3.6 automatically updated itself to Python 3.12"... Which would be amazing! Except that Python 3.12 is also not backwards compatible with Python 3.6. There's no saving Python.

Re:Go automatically downloads a newer toolchain if needed by pjmlp on Tuesday August 20, 2024 @08:43AM (#41299555)
Same is also starting to apply to Go runtime, standard library and even some minor fixes like the for loop variables lifetime.

All possible places for existing code to break, either via compiler errors, or changes in the expected runtime semantics.

Re:Go automatically downloads a newer toolchain if needed by IshKebab on Tuesday August 20, 2024 @10:57AM (#41300660)
Even in that case they did the behaviour change properly:

> To ensure backwards compatibility with existing code, the new semantics will only apply in packages contained in modules that declare go 1.22 or later in their go.mod files.

CMake and Rust and Android and lots of other systems have mechanisms like this that allow you to introduce opt-in breaking changes, but unsurprisingly Python doesn't. They just decided it was ok to start breaking backwards compatibility.

Re:Go automatically downloads a newer toolchain if needed by pjmlp on Tuesday August 20, 2024 @12:19PM (#41301406)
That doesn't apply to runtime and standard library changes.

Enough of them happened already, that a clarification post was needed,

https://go.dev/blog/compat

Re:Go automatically downloads a newer toolchain if needed by IshKebab on Tuesday August 20, 2024 @05:57PM (#41304518)
That's still among the strongest backwards compatibility guarantees in any major language. Maybe Java would be close? It's certainly better than C++ which is famed for backwards compatibility, and light years ahead of Python.
Re:Go automatically downloads a newer toolchain if needed by pjmlp on Wednesday August 21, 2024 @01:26AM (#41307029)
Yet it isn't without zero issues, as claimed.
Re:Go automatically downloads a newer toolchain if needed by tapirl on Wednesday August 21, 2024 @11:51AM (#41311422)
> That's still among the strongest backwards compatibility guarantees in any major language.

Not at all. See https://go101.org/blog/2024-03-01-for-loop-semantic-changes-... for reasons.

Re:Go automatically downloads a newer toolchain if needed by IshKebab on Thursday August 22, 2024 @08:21AM (#41319460)
What reasons? You need to pass one flag to the compiler to specify the language version? That's still very very good.

Please tell me what flag I can pass to Python 3.12 so `distutils` still exists.

Re:Go automatically downloads a newer toolchain if needed by tapirl on Thursday August 22, 2024 @09:03AM (#41319784)
Reasons are in the article.

I'm not familiar with Python, so I don't understand what is the problem with Python. But I think the problem of Go is unrelated to Python.

Re:Go automatically downloads a newer toolchain if needed by tapirl on Wednesday August 21, 2024 @11:48AM (#41311404)
> Even in that case they did the behaviour change properly:

Not in fact. Go core team has admitted that Go toolchain 1.22.n versions break backward compatibility: https://github.com/golang/go/issues/66092

There is another breakage case: https://github.com/golang/go/issues/66070 and the team leader doesn't plan to fix it.

Re:Go automatically downloads a newer toolchain if needed by iand on Tuesday August 20, 2024 @07:41AM (#41299066)
Imagine if Python had as strong a compatibility promise as Go
Re:Go automatically downloads a newer toolchain if needed by chuckadams on Tuesday August 20, 2024 @10:32AM (#41300438)
It’s more like if virtualenv looked in requirements.txt for the Python version and used that version locally. Other languages like Haskell and Scala have been doing that sort of thing for ages.