Live data from Hacker News

Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

sinews.siam.org

191–200 of 249 posts

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#191
post #167

Earlier quoted context omitted.

Use them like the first-class vectors they are. You can use _any_ array manipulation on ranges.

please take a look at my rant below, do not want to write it twice

Your rant comes down to a distaste of +1s in certain situations. My point is that Julia's emphasis on arrays allows you to compose ranges with mathy operations in very powerful ways. You're concerned about composing APIs that take endpoints as arguments — I say you should just accept a range in the first place!

Say I have an index `idx` into a very large array and I want to select a symmetric window of `N` indices before and after that index. In Julia:

    A[idx .+ (-N:N)]
In Python:

    A[idx-N:idx+N+1]
Python cannot even index lists by ranges (or other lists). And if I go out of bounds, well, it'll happily just give me back a list of a size I didn't expect.

Heck, in Julia I can even easily determine what the OOB behavior should be. It's an error above, but I can easily change it. This, for example, will ensure no indices go out of bounds by repeating the final endpoint as necessary.

    A[clamp.(idx .+ (-N:N), 1, end)]
Sometimes you want to work in terms of the fenceposts, and sometimes by the length of the fence. There certainly are cases where 0-based offsets are nice — or even arbitrary offsets. In those cases we have OffsetArrays.

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#192
post #159

Earlier quoted context omitted.

This is why the language creators usually avoid using the word 'homoiconic' because every time one uses that word there's a finite probability of being bogged down in an incredibly uninteresting semantic argument. Instead, people prefer to say that julia code is just another (tree-like) data-structure in the language and it can be manipulated at runtime with functions or compile time with macros or at parse time with…

Then why not just say 'Julia has macros'? Lightly perusing the description of Julia's features, that seems like a clear way of expressing what it is. (I also vaguely recall Julia describing its type system as "dependent" in way that goes against convention. Maybe they just liked controversy in the early days!)

"macros" are unfortunately used by C and lisp to describe two different things, and both usages are as widely popular as their parent languages (i.e. very).

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#193
post #136

Earlier quoted context omitted.

> But why should you have to care, why not just sum(range)? Sure, if you have single infinitely fast CPU. In real life, we have to decompose problem, run it in parallel and compose it back. > Or @threads for i in eachindex(object) & let the details about how many cores be written once, correctly, elsewhere? Here I'm explicitly talking about details, how it should be done, importance of composition, monoids etc. I und…

1-indexed ranges can still be composable if we define them as open on the right at N+1 (which is how I imagine one would want to define things in their implementation). [1...N] = [1...N+1) = [1...K+1) + [K+1..N+1) So the real loss is your point (2) - which, I agree, makes the implementation much less elegant and simple.

[deleted]

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#194
post #136

Earlier quoted context omitted.

1-indexed ranges can still be composable if we define them as open on the right at N+1 (which is how I imagine one would want to define things in their implementation). [1...N] = [1...N+1) = [1...K+1) + [K+1..N+1) So the real loss is your point (2) - which, I agree, makes the implementation much less elegant and simple.

> 1-indexed ranges can still be composable you could make them work, but improper abstraction leaks out in so many fugly ways. F.e. in Python you could compose functions, not only ranges. What do you pass in? Simple, [0, len(a)). What you get out? Simple, len(a). So you could operate on ranges composing function calls like in FP. Even works for unknown beforehand sequences/streams, just count along the sequence how m…

I don't buy it. Inclusive ranges are much more intuitive than left side inclusive and right side exclusive ranges. And they compose just fine; you just have to add a plus one at the right places. E.g.

    function mean(a, l, r)
        s = 0
        N = r-l+1
        for k in l:r
            s += a[k]
        end
        s/N, N
    end
    
    function mean2(a)
        N = length(a)
        lr1 = (1,div(N,2))
        lr2 = (div(N,2)+1,N)
        v1, N1 = mean(a, lr1...)
        v2, N2 = mean(a, lr2...)
        N = N1+N2
        (v1 * N1 + v2 * N2) / N, N
    end

    function compose(M1, M2)
        v1, N1 = M1
        v2, N2 = M2
        N = N1+N2
        (v1 * N1 + v2 * N2) / N
    end
    
    function mean3(a)
        N = length(a)
        lr1 = (1,div(N,2))
        lr2 = (div(N,2)+1,N)
        compose(mean(a, lr1...), mean(a, lr2...))
    end
You have to think about what is passed in and out anyway. Arguments of elegance etc. are most of the time personal preferences and very biased.

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#195
post #136

Earlier quoted context omitted.

1-indexed ranges can still be composable if we define them as open on the right at N+1 (which is how I imagine one would want to define things in their implementation). [1...N] = [1...N+1) = [1...K+1) + [K+1..N+1) So the real loss is your point (2) - which, I agree, makes the implementation much less elegant and simple.

> 1-indexed ranges can still be composable you could make them work, but improper abstraction leaks out in so many fugly ways. F.e. in Python you could compose functions, not only ranges. What do you pass in? Simple, [0, len(a)). What you get out? Simple, len(a). So you could operate on ranges composing function calls like in FP. Even works for unknown beforehand sequences/streams, just count along the sequence how m…

[deleted]

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#196

Earlier quoted context omitted.

> CPython is 100 to 1000 times slower than C That's very context dependant. With annotations, typical calculations compile to C code roughly equivalent to native. The more of the actual runtime you use, the more you call into cpython which can't be sped up this way. Cython compiled code will be somewhere between C and cpython in terms of speed, but putting a single number to it will be always misleading.

>> CPython is 100 to 1000 times slower than C > That's very context dependant. With annotations, typical calculations compile to C code roughly equivalent to native. The more of the actual runtime you use, the more you call into cpython which can't be sped up this way. Cython compiled code will be somewhere between C and cpython in terms of speed, but putting a single number to it will be always misleading. OP said "…

Oops, you're right. One day I'll learn to read :-)

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#197

Earlier quoted context omitted.

Please don't vilify Python or R thinking that will help with Julia's adoption or popularity. If Julia is as awesome as its evangelists say, it will gracefully displace its competitors without the need of a smear campaign

Criticisms of languages should not be taken as criticisms of their creators or users. I don't see anything wrong with saying "Language X does Y better than language Z in my use cases." Languages are toolsets and programmers are always looking for appropriate tools for a given task. It seems crazy to demand that people not be able to talk honestly about their experiences using a given tool. Python doesn't have feeling…

Even if it does, what's wrong with stating an opinion? Why does an honest opinion have to be branded "smear"?

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#198
post #92

Earlier quoted context omitted.

Wish advocates of all new languages stuck with this principle.

I wasn't being disrespectful of Python. We are allowed to criticize languages. The fact is, by any reasonable measure, Julia is more expressive than Python, which was all I stated. This is an advantage of Julia. Both languages have advantages and disadvantages, and comparing them honestly is necessary for people to make a good choice when selecting a language for a project. C is less expressive than Python or Julia,…

Can you give concrete examples of where Julia is more expressive than Python? I can think of defining custom units https://medium.com/@Jernfrost/defining-custom-units-in-julia...

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#199
post #39

I built a very simple neural-network app a few years ago with Julia, and while the project was fun and I didn't think the language was bad by any means, as someone who does software for a living I had trouble seeing why compsci people really got into it. I could totally see someone like my dad using it (he's an aerospace engineer, not software), but I have friends who work in compsci in academia trying to evangelize…

I was playing around at work with some galois field stuff (very cs) and was very pleased to find that the lu decomposition for Julia "just worked" with the custom galois field type that I implemented. All in all about 75 lines of highly performant code, which is what I needed because I was conducting searches over 2^32 elements.

Did you ever try Magma? I graduated in pure maths from University of Sydney where Magma was born. It was great for doing Galois theory stuff.

Re: Julia Language Co-Creators Win James H. Wilkinson Prize for Numerical Software

#200
post #50

Julia is interesting, but the block syntax is a little off-putting. I'm not sure why someone would design a language that uses 'end' to delineate a block. Curly brackets make sense. Tabs make sense. But 'end'? All it does is make code harder to read and harder to write.

Ruby and Elixir both made the same decision, and I don't feel like it's had an actual negative impact, for me at least; I've found both languages to be delightfully readable. I haven't dabbled very much in Julia since the pre-1.0 days, but I don't recall it being any more or less jarring. I suppose it could indeed be jarring if you're not already used to languages which use 'end' to terminate blocks, but after awhile…

I mean, maybe it's not a big deal. But what value does it add? What if we had a 50 character string of random digits be the terminating identifier for a block? What about 100 characters? What about 200? Syntax shouldn't create visual noise, it should be as lightweight as possible.

Maybe someone can justify why a 3 character word (end) doesn't really matter. But can someone give an argument on how it adds value versus one character (a bracket), or zero characters (visible at least), a tab?

Post reply on HN