mastodon.me.uk is one of the many independent Mastodon servers you can use to participate in the fediverse.
Open, user-supported, corporation-free social media for the UK.

Administered by:

Server stats:

499
active users

Peter Brett

Surprisingly large implementation divergence about whether U+200B ZERO WIDTH SPACE in an identifier is an error or not.

@catsalad You can have as many identifiers as you like with different numbers of U+200D

@krans surely identifiers exist for the purpose of having human readable source code? So non printing chars should not be allowed?
I am probably wrong 😁

@Slash909uk Yes, U+200B has XID_Start=No and XID_Continue=No, so it is not valid in C++ identifiers. However, more than one C++23 compiler silently accepts it. I don't understand. @Sdowney

@krans @Sdowney ooh, maybe this is a mistake in Unicode?
From:
unicode.org/Public/UCD/latest/
>200C..200D ; XID_Continue # Cf [2] ZERO WIDTH NON-JOINER..ZERO WIDTH JOINER

So it is allowed from the second char onward?

Some shenanigans seem possible here!

@Slash909uk Unfortunately there are some scripts that require ZWNJ to be successfully written @Sdowney

@krans For a historic precedent, one of the quirks of some early Pascal systems was, they didn't recognise underscore as a valid character in an identifier, and the way Knuth's original WEB system deals with this is, it allows underscores, but strips them before passing the identifier on to the translator. Sometimes, it can lead to weird clashes.