-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/compile: add new range behind GOEXPERIMENT=range #61717
Comments
This proposal has been added to the active column of the proposals project |
Would it make sense to have a experimental coro package users could try too? |
No change in consensus, so accepted. 🎉 |
@carlmjohnson , I think it's pretty unclear what we want to do with coro. Note that @rsc's new proposal for the iter package (#61897) includes |
Change https://go.dev/cl/518376 mentions this issue: |
Change https://go.dev/cl/510541 mentions this issue: |
Change https://go.dev/cl/510537 mentions this issue: |
Change https://go.dev/cl/510538 mentions this issue: |
Will these changes make its way into gopls in some way, so that the "experiment" can be used from IDEs without compile errors? |
Is this version of the implementation going to have unused Also, I wanted to just turn this on via Edit: I tried building the toolchain with the environment variable already set again in Linux this time and it worked this time, except that the defaults are still what they already were. |
I get this: % GOEXPERIMENT=range gotip version
go: unknown GOEXPERIMENT range
% gotip version
go version devel go1.22-51ed3cb702 Wed Aug 30 21:18:04 2023 +0000 darwin/arm64
% GOEXPERIMENT=range gotip download
Updating the go development tree...
From https://go.googlesource.com/go
* branch master -> FETCH_HEAD
HEAD is now at 51ed3cb702 net: retry TestDialTimeout subtests with progressively shorter timeouts
Building Go cmd/dist using /usr/local/go. (go1.21.0 darwin/arm64)
Building Go toolchain1 using /usr/local/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
go_bootstrap: unknown GOEXPERIMENT range
go tool dist: FAILED: /Users/meling/sdk/gotip/pkg/tool/darwin_arm64/go_bootstrap install -pgo=off cmd/asm cmd/cgo cmd/compile cmd/link: exit status 2
gotip: failed to build go: exit status 2 Anyone got this working on macOS? |
Ok. I had to download % go install golang.org/dl/gotip@latest Now I can compile with |
It's not all checked in yet. When it is, I'll close this issue. |
Add type-checking logic for range over integers and functions, behind GOEXPERIMENT=range. For proposal #61405 (but behind a GOEXPERIMENT). For #61717. Change-Id: Ibf78cf381798b450dbe05eb922df82af2b009403 Reviewed-on: https://go-review.googlesource.com/c/go/+/510537 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Add compiler implementation of range over integers. This is only reachable if GOEXPERIMENT=range is set, because otherwise type checking will fail. For proposal #61405 (but behind a GOEXPERIMENT). For #61717. Change-Id: I4e35a73c5df1ac57f61ffb54033a433967e5be51 Reviewed-on: https://go-review.googlesource.com/c/go/+/510538 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Russ Cox <rsc@golang.org>
Add compiler support for range over functions. See the large comment at the top of cmd/compile/internal/rangefunc/rewrite.go for details. This is only reachable if GOEXPERIMENT=range is set, because otherwise type checking will fail. For proposal #61405 (but behind a GOEXPERIMENT). For #61717. Change-Id: I05717f94e63089c503acc49b28b47edeb4e011b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/510541 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Russ Cox <rsc@golang.org>
This is all checked in now (and has been for a while). Closing. |
It would be good to get code for #61405 into the tree for easier use.
I propose we check in the current prototype behind GOEXPERIMENT=range.
The text was updated successfully, but these errors were encountered: