News for hackers. Stuff that matters.
Re:Go generics draft design: building a hashtable by BurningFrog on Wednesday June 17, 2020 @04:16PM (#23556206)
Now that unicode is everywhere I think it's time to use more brackets than [], (), {} and <>.

Python is the worst, where dicts and sets both use {} and tuples and "grouping" both use (), each causing real problems.

Some of many possibilities:

⦅⦆«» ⟦⟧ ⟨⟩ ⟪⟫ ⟮⟯ ⟬⟭ ⌈⌉ ⌊⌋ ⦇⦈ ⦉⦊ ||

Yes, you need a way to type it on non specialized keyboards.

An easy way is is to type it as (( or [[ etc, and let the IDE convert it.

Re:Go generics draft design: building a hashtable by hombre_fatal on Wednesday June 17, 2020 @04:32PM (#23556390)
To me this is the ultimate "developer chasing shiny" at the expense of everything else.

Especially in the context of Go that hasn't even managed to use anything other than parentheses in its func definition syntax. No language has saturated the bracket options that come with the standard US keyboard so much that it's worth bringing in characters that you need additional tooling to type.

If (), <>, {}, and [] aren't enough for a language, something has gone very wrong.

Re:Go generics draft design: building a hashtable by qtplatypus on Wednesday June 17, 2020 @08:41PM (#23558571)
While you normally don't regard it as a bracketing we also use "", '' and `` to bracket things.

In Perl / / was used to bracket regrexs in C and many C languages /* */ is used to bracket comments.

Re:Go generics draft design: building a hashtable by a1369209993 on Wednesday June 17, 2020 @06:09PM (#23557400)
Dicts and sets are supposed to both use {}; {a,b,c} is (conceptually) shorthand for {a:dummy,b:dummy,c:dummy}, where sets (in some cases, including python, opaquely) are actually dicts without the space to store values. (This also shows up in set theory and related mathematics, although there it's dicts that are unusual.)

The rest of your post is a fair point, although I think you underestimate the value of plain ASCII that can be typed on a unassisted keyboard.

Re:Go generics draft design: building a hashtable by asjw on Wednesday June 17, 2020 @04:35PM (#23556409)
That's a lot of effort for little benefits

I can already see a lot of edge cases

Most notably font support

I like ligatures and ide/editor support for them, but I'm not sure I like this

Re:Go generics draft design: building a hashtable by BurningFrog on Wednesday June 17, 2020 @06:11PM (#23557419)
The benefit is purely readability.

You read code 1000x more often than you write it, so a little extra effort for even a small readability benefit is worth it.

Most fonts have quite full Unicode support since many years.

I'm often disappointed in how reluctant programmers are to use modern technology. The public thinks we're on the cutting edge of advanced technology. If they only knew :)

Re:Go generics draft design: building a hashtable by tcbasche on Wednesday June 17, 2020 @09:24PM (#23558809)
This is just unnecessarily salty. Fonts may have full unicode support, but do keyboards? I don't want to have to press some weird key combination to type a symbol I might type hundreds of times each day.

Honestly, it's just common sense.

Re:Go generics draft design: building a hashtable by asjw on Saturday June 20, 2020 @12:23PM (#23584755)
> The benefit is purely readability.

This year mark my 30th year as a professional developer, but my first "program" was copied fro a magazine

   10 PRINT CHR$(205.5+RND(1)); : GOTO 10
It generated random maze like structures in screen using two PETSCII symbols

I think everybody know this one liner here

So it's not symbols I don't like, it's the lack of ergonomics

My hands started hurting when I had to type a lot to write simple symbols like } that's why I switched to US layout and things have gone a lot better for my nuckles

What really surprises and disappoints me is how many people appoint themselves as engineers or computer scientists, but take for granted that their ideas are good and the rebuttals are "resistance to change" without even reading the most basic studies on the topic or testing their theories on the field.

Implement your idea, measure the results and then we'll discuss of why they didn't take off.

Because they won't, believe me.

There is a reason why I use font with the zero striked, otherwise capital O would look too similar.

What do you think of ‹‹ vs « ?

Do they really look different enough to be useful?

Cutting edge doesn't mean "stupid"

Re:Go generics draft design: building a hashtable by hombre_fatal on Thursday June 18, 2020 @04:04AM (#23560864)
Even Spanish keyboards only have a dedicated Ñ key, so you have to use multi-key sequences to input ÁÉÍÓÚÜ etc.

And even after typing in Spanish for five years, it's still objectively more annoying to write está (6 keypresses) vs esta (4 keypresses). And I'm always having to go back and correct the key sequence because I've written ´a instead of á.

Also, just today I saw someone use "⇸" (crossed out arrow) on HN and it was so tiny with HN's font that I had to zoom in to see what it was which only inhibited their message.

You have to consider this sort of overhead when making decisions about the glyphs you are going to impose upon everyone when designing a language.

I've seen pages and pages of bike-shedding over whether to use kebab-case over snake_case for a DSL because it's one less keypress to type a hyphen vs underscore.

I can appreciate your preference for those characters. It's nice how they can encode meaning in a single glyph where you would otherwise need multiple glyphs (like "!="). One solution that you can find people doing today are IDE plugins that simply rerender something like "->" as "→".

Seems like the best of all worlds. You get to work with higher level characters while the plaintext format remains in the most accessible common denominator.

Re:Go generics draft design: building a hashtable by lsllc on Wednesday June 17, 2020 @11:03PM (#23559386)
I do like what Haskell and Scala have done for operator diversity ... maybe Go should learn from it:

https://www.reddit.com/r/programming/comments/a9tb2/secret_h...

Re:Go generics draft design: building a hashtable by entha_saava on Wednesday June 17, 2020 @11:54PM (#23559664)
I'd rather have

    [* *]

    [= =]

    [/ /]

    (* *)

    (= =)

    (/ /)
Just kidding, requiring specialized tooling to type isn't quite acceptable..
Re:Go generics draft design: building a hashtable by c3534l on Thursday June 18, 2020 @02:54AM (#23560477)
Half of those don't even render for me. French quotes seem fair though, since we throw $'s around in languages like every country needs a dollar sign on their keyboards.
Re:Go generics draft design: building a hashtable by tcbasche on Wednesday June 17, 2020 @09:25PM (#23558819)
And then you need a specialised IDE to type characters?

Or there's a bug in the IDE and all of a sudden you literally cannot type anymore?

Re:Go generics draft design: building a hashtable by deathanatos on Wednesday June 17, 2020 @09:48PM (#23558942)
It's a chicken and egg problem. Input systems could be a lot better, and we wouldn't need (as much) a specialized IDE. E.g., in Linux, I can type « and » if I map the compose key (which I do, but it isn't the default). For really wild characters, OS X has a pretty decent character search dialog (^+⌘+Space) though it has a few usability shortcoming that I really wish Apple would address. (I wish I could get a decent implementation of this in Linux, and I wish I could get a compose key in OS X.)

(I'm not sure I'm convinced that using such symbols in a programming language is a good idea, of course, just that our current input tech is barely trying.)

Also, APL happened.

Re:Go generics draft design: building a hashtable by donio on Thursday June 18, 2020 @01:08AM (#23559966)
How do I pronounce... any of those?