Hacker News new | ask | show | jobs
by Tarrosion 3775 days ago
My areas of focus are pretty different from that author's - e.g. I haven't tried contributing to the core language. But I've been using Julia for my research code for ~4 months now, and it's been an absolute joy.

The language allows super-readable code while remaining quite fast. The sort of research I'm doing involves interacting a bit with data then doing a bunch of simulations, and Julia excels at this. The expressiveness in how Julia handles anonymous functions, optional arguments, tuple construction/deconstruction, etc. allows for really concise configurations of how my little simulations run.

My only pain points:

- DataFrames are not as fast as the rest of the language.

- I'd like an infix function composition operator. (Possibly this exists, but I can't find it in the documentation).

9.5/10, absolutely recommend.

1 comments

> I'd like an infix function composition operator.

Do you mean like the pipe symbol?

    rand() |> println
Or are you referring to something else?
No, x |> f is equivalent to f(x) while (f ∘ g)(x) is equivalent to g(f(x)). Specifically, x |> f results in a value (of the type of the return value of f) while f ∘ g results always results in a function.
Why not make one for yourself? ;)

julia> (∘)(f, g) = x -> f(g(x))

∘ (generic function with 1 method)

julia> (sum ∘ rand)(10)

3.397728240035534

Tip: type \circ<tab> to get ∘

I know, but why isn't something like this in core? * did function composition a while ago, but it was removed (beats me why) and hasn't been replaced.

Enough Perl6 has left me with <compose>(.) to get ∘ :-)

Get involved then, Julia isn't exactly the illuminate.
That's exactly it - thanks! Somehow I missed that when searching the docs for "chain", "pipe", and "compose".