Skip to content
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

proposal: cmd/go: add .ʕ◔ϖ◔ʔ as an alternate spelling of .go in file names #59968

Closed
rsc opened this issue May 4, 2023 · 66 comments
Closed

Comments

@rsc
Copy link
Contributor

rsc commented May 4, 2023

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 ʕ◔ϖ◔ʔ!

@rsc rsc added the Proposal label May 4, 2023
@rsc
Copy link
Contributor Author

rsc commented May 4, 2023

(In all seriousness congrats to the Mojo team on their announcement. The rest of the language looks interesting, and I hope they join the open-source language club soon.)

@gopherbot gopherbot added this to the Proposal milestone May 4, 2023
@markuswustenberg
Copy link

markuswustenberg commented May 4, 2023

And, if the proposal for almost unthinkable reasons does not gain public approval, I propose a Go language and toolchain fork, naturally just called ʕ◔ϖ◔ʔ.

EDIT: The unthinkable has happened. The work will proceed here: https://github.com/markuswustenberg/gopher

@LeGEC
Copy link

LeGEC commented May 4, 2023

Is there a proposal to add a new gopher emoji in the standard unicode character set ?
I can't find the proper emoji to react to this proposal 🐐

@hajimehoshi
Copy link
Member

hajimehoshi commented May 4, 2023

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 .ʕ◔ϖ◔ʔ

IMHO, for this purpose, using numbers like .go2, .go3, ... would make more sense. What if we want yet another new semantics after .ʕ◔ϖ◔ʔ becomes the default?

@amit-upadhyay-IT
Copy link

AFAIK go is a language which does not believe in copying features from other languages. Just saying! 😇

@mattn
Copy link
Member

mattn commented May 4, 2023

Would this really work correctly on Windows?

@philippta
Copy link

Following the aesthetics of Mojo and what the emoji set has to offer, I suggest supporting either of these file extensions instead:

  • hello.🦫
  • hello.🦦

@atdiar
Copy link

atdiar commented May 4, 2023

I know it's bikeshedding, but why not go with the character ❤️ instead because "AI" also means love in nihon-go... I mean... Japanese.
More orthogonal? 😂

@elgs

This comment was marked as off-topic.

@JWhist
Copy link

JWhist commented May 4, 2023

Is it semantically correct for the eyes to be looking to the right, or should we consider any pupillary configuration as acceptable?

@DianeLooney
Copy link

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 .ʕ◔ϖ◔ʔ

IMHO, for this purpose, using numbers like .go2, .go3, ... would make more sense. What if we want yet another new semantics after .ʕ◔ϖ◔ʔ becomes the default?

We use the gold silver bronze emoji for that. Or the regional indicator 1/2/etc.

ʕ◔ϖ◔ʔ🥇``ʕ◔ϖ◔ʔ1️⃣

@donuts-are-good
Copy link

Out of all the ideas that should never happen, this one should never happen the most. I'm embarrassed on behalf of the community that this type of but-us-too stuff got posted. I'd expect this from other communities, but not us.

@irateswami
Copy link

Uhhhh it's May 4th, little late for April fools jokes, no?

@christophberger
Copy link

Uhhhh it's May 4th, little late for April fools jokes, no?

Oh c'mon, don't kill the fun 😁

@christophberger
Copy link

This proposal is so fundamental that I wonder why this was not filed in 2009 already.

I also second this extension to the proposal by u/GrayFox89:

We need support for build flags too:

  • main_linux.go -> main_🐧.ʕ◔ϖ◔ʔ
  • main_windows.go -> main_🏠.ʕ◔ϖ◔ʔ
  • main_darwin.go -> main_🍏.ʕ◔ϖ◔ʔ

@quenbyako
Copy link

Easter eggs are always great 🐣

Emojis are amazing even more 🥳

@alexcb
Copy link

alexcb commented May 4, 2023

and hello_test.go could alternatively be named hello.(╯°□°)╯︵ ┻━┻

edit: this convention should only be used for mislabeled "unit tests" that interact with a database.

@mark-pictor-csec
Copy link

mark-pictor-csec commented May 4, 2023

and hello_test.go could alternatively be named hello.(╯°□°)╯︵ ┻━┻

Does this only apply to table-driven tests, or is it acceptable for a file named like this to contain any style of test?

(edit) This naming convention implies that the table is being driven. We may need to find an alternate where the table is in control... 🤔

@donuts-are-good
Copy link

I'm calling the cops. This is bullshit.

@tliron
Copy link

tliron commented May 4, 2023

We've been maintaining a downstream fork of Go that supports the .¯\_(ツ)_/¯ extension. This fits our wing-and-a-prayer ethos that is averse to any kind of code testing coverage. If the code works, well, then that's just wonderful, innit.

@ancientlore
Copy link

This is why I □ Unicode. :-)

@zephyrtronium
Copy link
Contributor

IMHO, for this purpose, using numbers like .go2, .go3, ... would make more sense. What if we want yet another new semantics after .ʕ◔ϖ◔ʔ becomes the default?

I think it's fine for the gopher to become progressively more menacing:

  1. .ʕ◔ϖ◔ʔ
  2. .ʕ◉ϖ◉ʔ
  3. .ʕ👁ϖ👁ʔ

and so on. Makes sense to me.

@osen
Copy link

osen commented May 4, 2023

Yet another great innovation from Go that I want to see backported to Plan 9!

If we can get the Plan 9 flavor C compiler to support a Glenda bunny-like suffix (🐇), I know my personal efficiency will increase.

@thediveo
Copy link

thediveo commented May 4, 2023

Why stop at the .go extension?

  • go.work: ʕ◔ϖ◔ʔ.⚒
  • go.sum: ʕ◔ϖ◔ʔ.💶, with support for R13N
  • go.mod: ʕ◔ϖ◔ʔ.🧩

@AndrewHarrisSPU
Copy link

AndrewHarrisSPU commented May 4, 2023

I would recommend trademarking ʕ◔ϖ◔ʔ, and always-on telemetry in the toolchain to discover possible cases of infringement. (just kidding!)

@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals May 4, 2023
@lpar
Copy link

lpar commented May 4, 2023

It should clearly be ʕ◔ϖ◔ʔlang to make web searches work better.

@rsc
Copy link
Contributor Author

rsc commented May 5, 2023

Retracting. This was fun but not a serious proposal. 😄

My apologies to those who were concerned we would actually introduce this kind of unnecessary ambiguity, complexity, and churn. 💩

Have a great weekend everyone. 🎉

Congrats again to Mojo on their launch. Hope to see you in the open-source world soon. 🔥

@rsc rsc closed this as completed May 5, 2023
@aschenmaker
Copy link

IMHO, for this purpose, using numbers like .go2, .go3, ... would make more sense. What if we want yet another new semantics after .ʕ◔ϖ◔ʔ becomes the default?

I think it's fine for the gopher to become progressively more menacing:

  1. .ʕ◔ϖ◔ʔ
  2. .ʕ◉ϖ◉ʔ
  3. .ʕ👁ϖ👁ʔ

and so on. Makes sense to me.

3, is perfect. wow

@rsc rsc moved this from Incoming to Declined in Proposals May 5, 2023
@lly-ke
Copy link

lly-ke commented May 5, 2023

Not easy to identify

@qingtao
Copy link

qingtao commented May 6, 2023

I don't even know how to type this symbol right now.

@lattner
Copy link

lattner commented May 6, 2023

This seems like a great idea to me Russ! I agree with ^^ that .ʕ👁ϖ👁ʔ would be more visually appealing though. 🔥

@demo-pzx
Copy link

demo-pzx commented May 6, 2023

ʕ👁ϖ👁ʔ ʕ👁ϖ👁ʔ ʕ👁ϖ👁ʔ

1 similar comment
@784871129
Copy link

ʕ👁ϖ👁ʔ ʕ👁ϖ👁ʔ ʕ👁ϖ👁ʔ

@paralin
Copy link
Contributor

paralin commented May 6, 2023

ʕ👁ϖ👁ʔ

To everyone who thought this wasn't a joke: how did you miss "For long-term migration, go fix can rename .go files to .ʕ◔ϖ◔ʔ" 😂😂

@d100972
Copy link

d100972 commented May 6, 2023

ʕ⊙ω⊙ʔ

@notonlyericy
Copy link

“gopher” is gonna be real gopher 🤓 hhhhhhh

@caiyaonan
Copy link

Don't use copy, How to input this symbol

@la3rence
Copy link

la3rence commented May 6, 2023

真会玩😅 再补充两个
swift: .
next.js: .▲

@as
Copy link
Contributor

as commented May 6, 2023

ʕ⊙益ºʔ

@interrrp
Copy link

interrrp commented May 7, 2023

We could probably use 🧪_ instead of test_ too. 🧪_unicode_file_paths.ʕ◔ϖ◔ʔ would absolutely NEVER fail.

@CompuRoot
Copy link

Yeah, why strong typed languages, exact meaning definition using alphabet, let's go stone age way

@fwielstra
Copy link

We should also build a new filesystem that supports multiline filenames, so we can be even more expressive in file naming.

main. ´.-::::::-.´
  .:-::::::::::::::-:.
  ´_:::    ::    :::_´
   .:( ^   :: ^   ):.
   ´:::   (..)   :::.
   ´:::::::UU:::::::´
   .::::::::::::::::.
   O::::::::::::::::O
   -::::::::::::::::-
   ´::::::::::::::::´
    .::::::::::::::.
      oO:::::::Oo

@AriehSchneier
Copy link

I think if this proposal is accepted, we should probably go the full mile and also publish binaries as ʕ◔ϖ◔ʔ.

ʕ◔ϖ◔ʔ run main.ʕ◔ϖ◔ʔ

elegance.

So you suggest we go the full mile and then fell short! Your example should look like:

ʕ◔ϖ◔ʔ 🏃 🦁.ʕ◔ϖ◔ʔ

@vcastellm
Copy link

First a request should be raised to include Gopher as an emoji https://unicode.org/emoji/proposals.html

Then:
image

@CompuRoot
Copy link

First a request should be raised to include Gopher as an emoji https://unicode.org/emoji/proposals.html

Then: image

And the second, - start producing keyboards with emojies

@AnthonyMikh
Copy link

I think we should also look into past and adopt .went extension for outdated versions of Go.

@lpar
Copy link

lpar commented May 15, 2023

We should also build a new filesystem that supports multiline filenames, so we can be even more expressive in file naming.

I have good news regarding Linux and macOS...

package main

import (
	"fmt"
	"os"
	"path/filepath"
)

const filename = `main.
    ´.-::::::-.´
.:-::::::::::::::-:.
´_:::    ::    :::_´
 .:( ^   :: ^   ):.
 ´:::   (..)   :::.
 ´:::::::UU:::::::´
 .::::::::::::::::.
 O::::::::::::::::O
 -::::::::::::::::-
 ´::::::::::::::::´
  .::::::::::::::.
    oO:::::::Oo`

func main() {
	fname := filepath.Join(os.TempDir(), filename)
	fp, err := os.Create(fname)
	if err != nil {
		panic(err)
	}
	fp.Close()

	info, err := os.Stat(fname)
	if err != nil {
		panic(err)
	}
	fmt.Println(info.Name())
}

adrian-lin-1-0-0 added a commit to adrian-lin-1-0-0/bullet-train.zsh that referenced this issue Jun 6, 2023
* BULLETTRAIN_GO_PREFIX is replaced by "ʕ◔ϖ◔ʔ" to approve the proposal:
  cmd/go: add .ʕ◔ϖ◔ʔ as an alternate spelling of .go in file names (golang/go#59968)
wangqingfree added a commit to wangqingfree/cloc that referenced this issue Aug 28, 2023
wangqingfree added a commit to wangqingfree/cloc that referenced this issue Sep 7, 2023
reference: golang/go#59968

Signed-off-by: wangqing <wyuchemtsing@126.com>
@rsc rsc removed this from Proposals May 8, 2024
@golang golang locked and limited conversation to collaborators Jul 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests