Live data from Hacker News

Why Julia

ucidatascienceinitiative.github.io

31–40 of 257 posts

Re: Why Julia

#31

As someone who has never run into performance problems with R, and also knows how to use Python - is there a good reason to learn Julia?

Ideally, Julia should give you the best of R (good, integrated data-types, -structures and functionality for statistics etc) and python (a sane, real programming language) - with the benefit of speed - and no/hardly any need to drop to/link to C libraries - "everything" is in Julia, and you can inspect the code "all the way down" (well, to a point - there's of course llvm at the bottom).

Whether Julia is that for you right now probably depends a bit on your needs/use cases.

Until Julia gains some form of aot compiler for static binaries - it's not quite an alternative to python imnho - you can't expect to run Julia scripts everywhere you can run python. Though this is similar to R. And there are of course much bigger ecosystems for python and R code/libraries than currently for Julia.

Personally I think they've done a great job on the design/syntax of Julia - it's a fun language - and that might be the best reason to play with it?

Re: Why Julia

#32
post #12

So... The answer is fundamentally "statically typed", right?

Julia is not statically typed, at least not in the common sense of the term.

Yes, I got that. But the "good parts" according to this artcle derive from where it can work like a statically typed language.

Re: Why Julia

#33
I did a 5000 line dissertation project in Octave after rejecting Julia. Reason : I had derived the math in linear algebra including Kronecker products; the math mapped to Octave pretty directly, but Julia requred me to translate all the Kronecker products to loops —yuck! kron(A, B) would become 12 lines of weird indices and for loops. On the listserv I was told that Julia was great because it didn't require vectorization for performance, but I only wanted vectorization for graceful expression.

Plus I got annoyed with extra weird syntax, but I can't remember the specifics.

Basically, Julia required more lines and characters and wasn't as close to the math.

Aside:I think Matlab / Octave is a lot like SQL and Tcl: lots of haters, unfashionable, but usually the most elegant solution .

Re: Why Julia

#34

I did a 5000 line dissertation project in Octave after rejecting Julia. Reason : I had derived the math in linear algebra including Kronecker products; the math mapped to Octave pretty directly, but Julia requred me to translate all the Kronecker products to loops —yuck! kron(A, B) would become 12 lines of weird indices and for loops. On the listserv I was told that Julia was great because it didn't require vectoriza…

Julia has had a kron function in Base since at least 0.5.

Re: Why Julia

#35

I recently began learning Julia and initially everything was amazing, except for 1 based indexing but with everything else I could overlook that. Then I attempted building something medium sized and it all fell apart. I feel like it needs some serious work on tooling, the module system, packages, etc. Has anyone built something medium-large sized in Julia? Maybe I'm missing something. When I was trying to use modules…

I actually like 1-based for numerical work. A lot of great languages (Smalltalk, APL, Lua...etc) use it too.

It makes sense with matrices.

Re: Why Julia

#36

I did a 5000 line dissertation project in Octave after rejecting Julia. Reason : I had derived the math in linear algebra including Kronecker products; the math mapped to Octave pretty directly, but Julia requred me to translate all the Kronecker products to loops —yuck! kron(A, B) would become 12 lines of weird indices and for loops. On the listserv I was told that Julia was great because it didn't require vectoriza…

I haven't dipped into Julia's macro side, but I wonder how much work it would be to just create macros to create syntactic sugar that maps infix Kronecker products to the Kronecker function.

There are so many Julia packages that do similar stuff that I imagine it can't be all that hard for people who have become fluent with the macro system.

Re: Why Julia

#37

I did a 5000 line dissertation project in Octave after rejecting Julia. Reason : I had derived the math in linear algebra including Kronecker products; the math mapped to Octave pretty directly, but Julia requred me to translate all the Kronecker products to loops —yuck! kron(A, B) would become 12 lines of weird indices and for loops. On the listserv I was told that Julia was great because it didn't require vectoriza…

`kron` is in the standard library, at least in the first stable version of the language https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/index....

Re: Why Julia

#38
post #21

The main issue I encountered as a Julia user is that multiple dispatch doesn't scale very well. When you start building out a project, it's easy to keep track and debug if multiple dispatch starts failing (i.e. type starts spreading everywhere and Julia slows to Python like speeds). In medium-to-large projects, it becomes extremely cumbersome to manage this. It's doable, but adds a layer of complexity management to p…

> In a nutshell: Julia is great when you're a grad student working mostly by yourself on small scale projects! But not so great in prod. Some people would disagree with that https://juliacomputing.com/case-studies/celeste.html

Sorry - I didn't mean to sound so negative! I'm very well aware of all the large Julia use cases and they're often great applications of the language.

I would also argue that the large open source Julia packages are also great examples of Julia "in prod".

Just highlighting what I think is a significant con in a language with many pros!

Re: Why Julia

#39
post #36

I did a 5000 line dissertation project in Octave after rejecting Julia. Reason : I had derived the math in linear algebra including Kronecker products; the math mapped to Octave pretty directly, but Julia requred me to translate all the Kronecker products to loops —yuck! kron(A, B) would become 12 lines of weird indices and for loops. On the listserv I was told that Julia was great because it didn't require vectoriza…

I haven't dipped into Julia's macro side, but I wonder how much work it would be to just create macros to create syntactic sugar that maps infix Kronecker products to the Kronecker function. There are so many Julia packages that do similar stuff that I imagine it can't be all that hard for people who have become fluent with the macro system.

Why metaprogram? Just define an operator using the built in kron function. Example:

const ⊗ = kron

A = rand(5,5)

B = rand(3,3)

A ⊗ B

Tada! I'm not sure how MATLAB/Octave's kron(A,B) looks more like math than A⊗B, but everyone can have their own opinion.

Re: Why Julia

#40

I did a 5000 line dissertation project in Octave after rejecting Julia. Reason : I had derived the math in linear algebra including Kronecker products; the math mapped to Octave pretty directly, but Julia requred me to translate all the Kronecker products to loops —yuck! kron(A, B) would become 12 lines of weird indices and for loops. On the listserv I was told that Julia was great because it didn't require vectoriza…

Surprises me. Julia can usually stay much closer to mathematical notation than, say, Python or C++.

You can even use nice Unicode notation such as A ⊗ B ⊗ C.

So, `kron` is actually provided by the standard library [1], are you saying that this kronecker product didn't do the job?

[1] search in this file: https://github.com/JuliaLang/julia/blob/master/stdlib/Linear...

Post reply on HN