-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
The new (apparently closed-source) programming language Mojo uses files named .mojo, but it allows .🔥 as an alternate spelling of .mojo, as in hello.🔥
.
Issue #45549 tracks handling of unicode in import paths, module paths, and file names. We have been proceeding cautiously due to the many subtle issues involved in cross-platform support, case-insensitive file systems, and so on: modules must work equally well on all supported systems.
Clearly Go is being left behind in the Unicode race. We must not let this stand. I propose that we throw caution to the wind and standardize on .ʕ◔ϖ◔ʔ as an alternate spelling of .go, as in hello.ʕ◔ϖ◔ʔ
.
The change would be primarily in go/build: .ʕ◔ϖ◔ʔ
files would be added to the GoFiles lists. There are probably a few places elsewhere in the toolchain that know the extension .go, such as go tool compile x.go
writing out x.o
, or VS Code registering .go
as the file suffix it supports. These will no doubt be trivial to find.
In #57001, there was some concern about the semantics of Go build tags changing meaning in a subtle way. We could address that by only applying the new semantics in .ʕ◔ϖ◔ʔ
files. Older toolchains already have code to ignore those.
There were similar concerns in the discussion #56010 about changing the semantics of for loops. The new .ʕ◔ϖ◔ʔ
provides an answer: .go
files get the old for loop semantics, while .ʕ◔ϖ◔ʔ
get the new semantics.
For long-term migration, go fix
can rename .go
files to .ʕ◔ϖ◔ʔ
There are a few weeks left before the Go 1.21 freeze. That should be plenty of time for a careful, considered discussion of this proposal and then a complete implementation with no subtle problems. Let's go ʕ◔ϖ◔ʔ!