News for hackers. Stuff that matters.
Re:Code Generation in Rust vs. C++26 by jepler on Thursday October 03, 2024 @09:25AM (#41730579)
A modest proposal: stop adopting new digraphs like [:, ^^, [[.

Unicode has at least 50 sets of pairing punctuation just waiting for use...

       \N{MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT} U+276c 
       \N{HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT} U+2770 
       \N{LIGHT LEFT TORTOISE SHELL BRACKET ORNAMENT} U+2772 
       \N{MEDIUM LEFT CURLY BRACKET ORNAMENT} U+2774 
and multiple blocks of mathematical operators including

      ⊥ \N{UP TACK} U+22a5 ⊥
      ⊦ \N{ASSERTION} U+22a6 ⊦
      ⊧ \N{MODELS} U+22a7 ⊧
      ⊨ \N{TRUE} U+22a8 ⊨
      ⊩ \N{FORCES} U+22a9 ⊩
so you could just write the much clearer and more distinctive ⹗derive<serde::Serialize>⹘ and so on for the other new multi-punctuation sequences.

Yes, by the time C++37 comes around it might be necessary to petition Unicode to add additional code points. This wouldn't be a problem, for two reasons:

First, Unicode is accustomed to adding new code points and might even be willing to pre-allocate some entire pages to the C++ committee.

Second, the existing ways to modify emoji could apply to designated mathematical modifiers as well. For instance, ∅ would denote a distinct future C++ operator symbol from ∅ or ∅ (sadly, as of 2024, hacker news can't render "pale woman "A-type" empty set" or the other empty set symbol variations I lovingly entered in this paragraph).

These sequences are highly preferable to ASCII sequences like [: because the ZWJs allow supporting editors to correctly render them as a single glyph occupying a single terminal cell and without using font ligature hacks.

Re:Code Generation in Rust vs. C++26 by Filligree on Thursday October 03, 2024 @09:31AM (#41730636)
Your serde example isn’t even rendering in my browser. It’s also missing from my keyboard; how do you propose I type it?
Re:Code Generation in Rust vs. C++26 by zarzavat on Thursday October 03, 2024 @09:39AM (#41730704)
Lean (and iirc Mathematica) use backslash escapes: you type \symbolname and the symbol is inserted by your editor.

You can also imbue the backslash escape sequence with the same meaning as the unicode, so that in the event that the editor didn’t make this replacement it would still mean the same thing.

Re:Code Generation in Rust vs. C++26 by shwouchk on Thursday October 03, 2024 @11:16AM (#41731559)
julia also. Mathematica uses literal “escape” sequences, ie you start a symbol by pressing the esc key and finish with another esc (aside from a bunch of bindings for commonly used things).
Re:Code Generation in Rust vs. C++26 by greenavocado on Thursday October 03, 2024 @09:52AM (#41730813)
This isn't extreme enough. We need to use APL specific keyboards and write in APL for maximum clarity

https://xpqz.github.io/learnapl/intro.html

Re:Code Generation in Rust vs. C++26 by 98469056 on Thursday October 03, 2024 @09:36AM (#41730667)
thats the joke
Re:Code Generation in Rust vs. C++26 by dooglius on Thursday October 03, 2024 @12:03PM (#41731961)
It got me, I've seen this sort of suggestion made un-ironically enough that it seemed believable
Re:Code Generation in Rust vs. C++26 by mikepurvis on Thursday October 03, 2024 @10:07AM (#41730951)
I also assumed initially that it was serious, but upon reflection, "a modest proposal" is the educated man's /s.
Re:Code Generation in Rust vs. C++26 by layer8 on Thursday October 03, 2024 @12:40PM (#41732369)
The most general solution is to configure yourself a Compose key [0]. Useful for typing anything that doesn’t directly figure on your keyboard.

[0] https://en.wikipedia.org/wiki/Compose_key

Re:Code Generation in Rust vs. C++26 by eximius on Thursday October 03, 2024 @12:38PM (#41732340)
Is this satire? It has to be, right?
Re:Code Generation in Rust vs. C++26 by omoikane on Thursday October 03, 2024 @12:45PM (#41732421)
This reminds me of Bjarne Stroustrup's proposal on overloading whitespace, and around page 4 he suggested using the full Unicode character set:

https://www.stroustrup.com/whitespace98.pdf

This was an April Fool's joke:

https://www.stroustrup.com/whitespace.html

I am not sure about the parent comment.

Re:Code Generation in Rust vs. C++26 by bryanlarsen on Saturday October 05, 2024 @11:12AM (#41750423)
> I am not sure about the parent comment.

Starting with "a modest proposal" is a clear sign it is satire.

Re:Code Generation in Rust vs. C++26 by fanf2 on Thursday October 03, 2024 @12:52PM (#41732475)
One of the fun things about the Unicode bidi algorithm is that it flips brackets. You always use ( as an open round bracket, but if your script is rtl it appears like ). In order to support this feature, Unicode has a list of all known kinds of reversible paired brackets.

https://www.unicode.org/Public/UNIDATA/BidiBrackets.txt

For extra fun, C++ < angle brackets > are, of course, not brackets.