golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
123.83k stars 17.65k forks source link

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

Closed rsc closed 1 year ago

rsc commented 1 year ago

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 commented 1 year ago

(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.)

markuswustenberg commented 1 year ago

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 commented 1 year ago

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 :goat:

hajimehoshi commented 1 year ago

In https://github.com/golang/go/issues/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 https://github.com/golang/go/discussions/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 commented 1 year ago

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

mattn commented 1 year ago

Would this really work correctly on Windows?

philippta commented 1 year ago

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

atdiar commented 1 year ago

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 commented 1 year ago

If this is only for fun, great. Please don't let it carry any semantical meaning. That would cause more confusion than what could be useful. My $.02.

JWhist commented 1 year ago

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

DianeLooney commented 1 year ago

In https://github.com/golang/go/issues/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 https://github.com/golang/go/discussions/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 commented 1 year ago

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 commented 1 year ago

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

christophberger commented 1 year ago

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

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

christophberger commented 1 year ago

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:

  • mainlinux.go -> main🐧.ʕ◔ϖ◔ʔ
  • mainwindows.go -> main🏠.ʕ◔ϖ◔ʔ
  • maindarwin.go -> main🍏.ʕ◔ϖ◔ʔ
quenbyako commented 1 year ago

Easter eggs are always great 🐣

Emojis are amazing even more 🥳

alexcb commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

I'm calling the cops. This is bullshit.

tliron commented 1 year ago

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 commented 1 year ago

This is why I □ Unicode. :-)

zephyrtronium commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Why stop at the .go extension?

AndrewHarrisSPU commented 1 year ago

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

lpar commented 1 year ago

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

intel352 commented 1 year ago

So then would the tagline now be the following?

ʕ◔ϖ◔ʔ - The language formerly known as Go

Signed, a fellow ʕ◔ϖ◔ʔfer

zyansheep commented 1 year ago

This addition seems really cool, but if it does get added, I think there should be some auto-formatting feature for cobsistency within a given project / to align with a given programmer's preferences. 🤔

crabdancing commented 1 year ago

I'm primarily a Rust dev, but I strongly support this precedent.

FreezingSnail commented 1 year ago

Go is a very serious language. This is detrimental to its life cycle. It needs to invest in the future and to do that it needs to invest in the youth. Failing to entice the youth into contributing means the language will die when the maintainers are too old to type anymore, affecting billions of users at that point. Do what's right, go build aBetterFutureWith.🦫

jolheiser commented 1 year ago

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

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

elegance.

diamondburned commented 1 year ago

Having .ʕ◔ϖ◔ʔ is nice and conventional, but it doesn't align well on my editor. This bothers me; it's practically unusable.

I propose that we should prefix the gopher instead:

Edit: it has come to my attention that I can do this already.

I will start using this for all of my code.

dexterp commented 1 year ago

Russ Cox for President

dancojocaru2000 commented 1 year ago

@4cq2 Can't let people have their fun, I guess. You must be great at parties. Unless you don't enjoy being the fun-ruiner guy but you are forced by someone, in which case comment the eyes emoji twice 👀👀.

The man easter egg impacted the expected behaviour of the program by printing text to stderr in a mode in which text should have never been printed to stderr (arguably, treating exit code 0 as a failure in case text is printed to stderr is a very dubious choice, but whatever).

For one, this proposal is discussed in the open, and, if actually acted upon, will be a documented behaviour. As such, the only impacted people would be those who don't read about the programming language they use to code and those who expected Go to ignore files ending in .ʕ◔ϖ◔ʔ. Also, this proposal doesn't affect people who don't have files ending in .ʕ◔ϖ◔ʔ, which, before the time this issue was opened, I can confidently say was nearly the entire population of Earth, give or take.

masmatsum commented 1 year ago

I think this proposal is something like Perl's TMTOWTDI ("There's More Than One Way To Do It"). Is this consistent with "simplicity" (which, I think, is Go's philosophy) ?

Also, there are disadvantages:

cristaloleg commented 1 year ago

I'm proposing to standardise benchmark files to lib_┳━┳_test.go or lib_┳━┳_test.ʕ◔ϖ◔ʔ.

tony612 commented 1 year ago

How about also supporting ʕ◔ϖ◔ʔ as goroutine keyword?

ʕ◔ϖ◔ʔ run()
bambuo commented 1 year ago

The following conjecture

Java hello.☕ Go hello.🐹 Didn't find a more suitable one

christophberger commented 1 year ago

How about also supporting ʕ◔ϖ◔ʔ as goroutine keyword?


ʕ◔ϖ◔ʔ run()

Excellent idea! A few more changes like this, and we can launch Obfuscated Go contests! C, Perl, we're coming!

Kaifuny commented 1 year ago

If this proposal is adopted, hopefully it will also be adopted to allow .shit or . 💩 for marking shit mountain codes

flimzy commented 1 year ago

While I see the obvious merit in this proposal, I can imagine a few unforseen consequences. Therefore, I'd like to propose that for Go 1.21, we include it as an experimental feature, which is enabled by setting the environment variable GO🧪=ʕ◔ϖ◔ʔ.

wtflmao commented 1 year ago

This is the most fun I've ever had, great proposal

choleraehyq commented 1 year ago

Is this a serious proposal?

rsc commented 1 year ago

Over on Reddit /u/robot_54 suggests .ʕ⚆.⚆ʔ instead of the historical emoji gopher .ʕ◔ϖ◔ʔ. Very nice. Let's use that one instead.

intel352 commented 1 year ago

@rsc .ʕ⚆.⚆ʔ actually makes me think of Furby, lol

rsc commented 1 year ago

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. 🔥

aschenmaker commented 1 year ago

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

lly-ke commented 1 year ago

Not easy to identify

qingtao commented 1 year ago

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

lattner commented 1 year ago

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