News for hackers. Stuff that matters.
Re:Expectations for generics in Go 1.18 by topspin on Wednesday October 27, 2021 @10:03PM (#29021485)
On the question of "what's this?":

    type ImmutableTreeListᐸElementTᐳ struct
"If you look closely, those aren't angle brackets, they're characters from the Canadian Aboriginal Syllabics block, which are allowed in Go identifiers. From Go's perspective, that's just one long identifier."

Simultaneously amusing and disturbing. Is there an award for which one might nominate this person?

Re:Expectations for generics in Go 1.18 by jandrese on Wednesday October 27, 2021 @11:12PM (#29021951)
That's the kind of thing you see in a comment and then back slowly out of the room, never breaking eye contact with the code until you are far enough away to turn tail and run.

At the very least they could have used the cute Japanese 「quotation marks」 to avoid confusion.

Re:Expectations for generics in Go 1.18 by weego on Thursday October 28, 2021 @05:33AM (#29024055)
This is the person you need. Be assured that they were the person willing to log into the live prod server to fix that script that was killing your startups app at 2am on a Friday night in 2007 when everyone else was too gun-shy.
Re:Expectations for generics in Go 1.18 by kodah on Thursday October 28, 2021 @02:15AM (#29022946)
> oh my god

Definitely the correct response.

Also,

> c++ allows 0-width spaces in variable names. Where's your god now?

Nowhere. We have strayed maximal distance from god's light and are currently in orbit around Satan.

Re:Expectations for generics in Go 1.18 by ithkuil on Thursday October 28, 2021 @02:19AM (#29022981)
Bow to the One whose Name cannot be expressed in the Basic Multilingual Plane
Re:Expectations for generics in Go 1.18 by jcelerier on Thursday October 28, 2021 @05:54AM (#29024146)
> > c++ allows 0-width spaces in variable names.

Is that true though ?

> A valid identifier must begin with a non-digit character (Latin letter, underscore, or Unicode character of class XID_Start) and may contain non-digit characters, digits, and Unicode characters of class XID_Continue in non-initial positions. Identifiers are case-sensitive (lowercase and uppercase letters are distinct), and every character is significant. Every identifier must conform Normalization Form C.

Re:Expectations for generics in Go 1.18 by jeroenhd on Thursday October 28, 2021 @06:52AM (#29024515)
I don't know about the standard, but both GCC and Clang accept ZWSP characters in the middle of variable names.

Clang logs a warning about potentially invisible characters every time you use them. g++ just compiles the code without warning, even with -Wall and -Wpedantic.

What clang _doesn't_ warn for, is the use of the left-to-right override character. This can be used to confuse the victims of your code even more.

Re:Expectations for generics in Go 1.18 by therein on Thursday October 28, 2021 @06:47AM (#29024464)
> every character is significant. Every identifier must conform Normalization Form C.

This seems to be the only limitation for that to be true.

So the question is does 0-width space (U+200B) survive canonical decomposition, followed by canonical composition?

It feels like it does to me.

Re:Expectations for generics in Go 1.18 by LastMuel on Thursday October 28, 2021 @01:16PM (#29028483)
I'm dying. This is hilarious.
Re:Expectations for generics in Go 1.18 by iamcreasy on Thursday October 28, 2021 @04:15AM (#29023644)
I suppose there are many examples like this. Once I've copied a piece of code from SO but IntellijIDEA was warning me that the semicolon at the end of the line is not correct.

Upon further investigation(I think IntelljIDEA reported Unicode value) I've found out that the 'semicolon' I copied is a Greek character that looks exactly like semicolon.

I wonder how people on vim/emacs deal with situation like this.

Re:Expectations for generics in Go 1.18 by Cthulhu_ on Thursday October 28, 2021 @04:41AM (#29023795)
It's similar when online editors try to be clever and replace a straight " with a fancy one (like in Word), really annoying.
Re:Expectations for generics in Go 1.18 by Joker_vD on Thursday October 28, 2021 @08:30AM (#29025280)
That's why Powershell actually recognizes those fancy quotes and treats those as normal quotes.
Re:Expectations for generics in Go 1.18 by aweiland on Thursday October 28, 2021 @11:09AM (#29027008)
So one Microsoft product contains an automatic workaround for an issue created by another Microsoft product.
Re:Expectations for generics in Go 1.18 by maattdd on Thursday October 28, 2021 @04:34AM (#29023747)
On VSCode, I use the Gremlins extension which highlight all those suspicious characters.

https://github.com/nhoizey/vscode-gremlins

Re:Expectations for generics in Go 1.18 by effdee on Thursday October 28, 2021 @07:08AM (#29024631)
Pressing ga in command mode in Vim displays the ASCII / Unicode value of the character under the cursor.
Re:Expectations for generics in Go 1.18 by iamcreasy on Friday October 29, 2021 @02:37PM (#29042062)
Yes, but IntelljIDEA's Linter showed me the error. Without linter you'll need compiler/interpreter to tell you something is not right.

And in my case, even if compiler / interpreter reported about an invalid syntax - I would not think of checking the unicode codepoint as it the character appeared to look exactly like semicolon.

Re:Expectations for generics in Go 1.18 by CodesInChaos on Thursday October 28, 2021 @04:20AM (#29023663)
The rust compiler warns when it encounters confusable symbols like that. Not sure about other languages.
Re:Expectations for generics in Go 1.18 by ipmonkey on Sunday October 31, 2021 @01:31PM (#29058641)
vim user here. Most of us are running the same linters and language servers as every other major editor, which does a pretty good job catching stuff like this. Modern vim is really only a C core with a web of JS, Python, Lua, and vimscript using the exact same third party solutions for every other part of an "IDE". emacs is probably similar, but no personal experience with that.
Re:Expectations for generics in Go 1.18 by killingtime74 on Thursday October 28, 2021 @01:42AM (#29022773)
Java Certified Professional
Re:Expectations for generics in Go 1.18 by glouwbug on Wednesday October 27, 2021 @10:55PM (#29021851)
Canadians now roll with the term Indigenous instead of Aboriginal
Re:Expectations for generics in Go 1.18 by spenczar5 on Wednesday October 27, 2021 @11:06PM (#29021915)
That may be, but in this case it is a precise technical term, referring to a particular block of Unicode: https://en.m.wikipedia.org/wiki/Unified_Canadian_Aboriginal_...

Maybe the Unicode Consortium should change it, but for now, Canadian Aboriginal is the correct term.

Re:Expectations for generics in Go 1.18 by LudwigNagasena on Thursday October 28, 2021 @03:47AM (#29023480)
In 10 years a new word may become fashionable. Better to keep technical terms the same.
Re:Expectations for generics in Go 1.18 by Cthulhu_ on Thursday October 28, 2021 @04:43AM (#29023805)
It's not about fashion, it's about cultural identity. I take it you don't see a problem with master/slave either?

Just do a find and replace, refactoring is easy and trying to argue on the internet about it is tiring.

Re:Expectations for generics in Go 1.18 by asguy on Thursday October 28, 2021 @11:37AM (#29027352)
I take it you didn’t grow up in the 80s. Trends in words change: you’ll see it with your own eyes.

> trying to argue on the internet about it is tiring.

… exactly.

Re:Expectations for generics in Go 1.18 by earleybird on Friday October 29, 2021 @07:37PM (#29044689)
If identity is about appearance, that would seem to admit fashion for consideration.
Re:Expectations for generics in Go 1.18 by uuddlrlr on Wednesday October 27, 2021 @11:54PM (#29022199)
Colloquially in the north "native" is ubiquitous.
Re:Expectations for generics in Go 1.18 by andai on Thursday October 28, 2021 @01:07AM (#29022581)
For now...