News for hackers. Stuff that matters.
Re:GoPlus – The Go+ language for data science by ascotan on Friday June 19, 2020 @07:23AM (#23573266)
They're great until you find something like this in code:

[x for y in z for x in zz if y in x]

Then you begin to wonder how great they really are.

Re:GoPlus – The Go+ language for data science by mlthoughts2018 on Friday June 19, 2020 @07:49AM (#23573392)
To me that looks super easy to read. You just go left to right.

    for y in z:
        for x in zz:
            if y in x:
                yield x
It’s extremely easy to sight read. If the lines become long, just split them up and it’s even more obvious.

    [x
     for y in z
     for x in zz
     if y in x]
There’s nothing tricky about multiple loops and conditions in comprehensions in most languages that support them. Just go left to right and it mirrors outer to inner loops/conditionals.
Re:GoPlus – The Go+ language for data science by xushiwei on Friday June 19, 2020 @12:16PM (#23575904)
Agree.
Re:GoPlus – The Go+ language for data science by wenc on Friday June 19, 2020 @09:04AM (#23574085)
Also, most data scientists presumably have some advanced math background so it's akin to reading set-builder notation (albeit with listcomps the sets are sometimes nested). Your listcomp reads:

{x : y ∈ z, x ∈ zz | y ∈ x}

If you've read enough statistics/ML papers, this becomes second nature.

Re:GoPlus – The Go+ language for data science by JNRowe on Friday June 19, 2020 @09:48AM (#23574476)
> If you've read enough statistics/ML papers, this becomes second nature.

As someone who breathes that style of notation, there is excellent support in vim and emacs for custom display for readability. Conceal syntax in vim¹(builtin for rust/help/$few_others and external such as vim-cute-python²), and pretty-mode³ in emacs. I'm sure similar things exist in other editors too, but I don't use those ;)

You don't get the exact representation in your example with the things I've mentioned, but if you're used to a more "mathy"-style they really are quite nice. YM[and taste]MV.

1. http://vimdoc.sourceforge.net/htmldoc/syntax.html#conceal

2. https://github.com/ehamberg/vim-cute-python (moresymbols branch for er… more symbols)

3. https://github.com/akatov/pretty-mode

Re:GoPlus – The Go+ language for data science by ascotan on Sunday June 21, 2020 @08:15AM (#23591596)
Interesting. I didn't know that!