Live data from Hacker News

Some Insights from a Julia Developer

stochasticlifestyle.com

11–20 of 241 posts

Re: Some Insights from a Julia Developer

#11

Strangely, the only mention of Cython is to point at that we have had less developers than Julia: "as evidenced by the over 500 committers to just the Base language, more than projects like Cython has ever had!"

I don't find it strange: I wrote this to say why I like using Julia and point out what the community is missing, not as a comparison to every other JIT in existence. But if you want to know why I gave up on Cython, I'll lay it out for you. I tried it almost 2 years ago because some documents in a course had IPython notebooks which used it. So I did some standard scientific computing stuff like write some Runge-Kutta methods and yes its speed was fine (that was a pretty big part of the blog post: if you try hard and use the right tools you'll get pretty much the same performance anywhere). That's not the problem at all.

The problem was extending it to be more widely useful in my own research. I wanted to make those same compiled functions also work with complex numbers to integrate spectral discretizations of a stochastic PDE (instead of the finite difference one from before). I found some SO posts like:

https://stackoverflow.com/questions/30054019/complex-numbers... https://stackoverflow.com/questions/27906862/complex-valued-...

At that point it stopped looking like Python at all. I always found the SciPy syntax a little verbose since I had used a lot of MATLAB before (but I wanted to make this project not require a license to run) (this QuantEcon cheatsheet is a good demonstration of what syntax is like in my domain: https://cheatsheets.quantecon.org/). But to make this kind of "complex or not" logic work in compiled Cython, I resorted to conditional compilation (http://cython.readthedocs.io/en/latest/src/userguide/languag...). These days I understand that what I created was essentially a multiple dispatch mechanism.

Anyways, at around that time I started experimenting with other tools, especially Julia, because I really was getting frustrated whenever I had to "go beyond doubles" and write something that was extendable instead of a one-use script. Maybe there's some tricks I was missing, but I found it really hard in Python and MATLAB. Soon after, my PhD adviser and I started arguing about whether one of the properties in the simulation's solution was due to floating point errors. I couldn't convince him, so I wanted to write this integrator so it was fast and compiled, but allowed arbitrary precision so that way I could prove that it still existed even with very high precision. I couldn't find a page which explained how to do high precision arithmetic in Cython or Numba, so I completely gave up. Needless to say, I decided to re-write a small portion of this in Julia and it worked really well, pretty much instantly. Then I was digging around the Julia package listing and Viral pointed me to a big opportunity (https://github.com/JuliaDiffEq/ODE.jl/issues/64) and I have been developing a lot of Julia differential equation solvers ever since.

Obviously YMMV, but after computing a lot without a "first-choice language" (between R, Python, C, MATLAB, Mathematica) for quite awhile, I kept with Julia because I didn't have issues when I hit less standard tasks, and I found it very easy to contribute fixes to other people's projects because it was just Julia code. This stochastic PDE integrator story is just one (significant) project that led me in this direction.

Re: Some Insights from a Julia Developer

#12
post #7
post #6

Too bad they somehow thought it was a good idea to make the syntax resemble MATLAB of all languages. Perhaps most of the nausea inducing warts could be worked around with some kind of transcompilation, although some semantic issues, such as one-based indexing, would remain. It'll be a sad day if Julia starts to get such popularity that high quality libraries will be Julia-only.

One-based indexing is not a semantic issue, it's a language-design decision you may disagree with.

Julia 0.5 introduced support for any indexing scheme you care to invent.

1-based 0-based 20-based

https://docs.julialang.org/en/latest/devdocs/offset-arrays/

Re: Some Insights from a Julia Developer

#13
post #7

Earlier quoted context omitted.

One-based indexing is not a semantic issue, it's a language-design decision you may disagree with.

Julia 0.5 introduced support for any indexing scheme you care to invent. 1-based 0-based 20-based https://docs.julialang.org/en/latest/devdocs/offset-arrays/

That is an ugly hack, mainly because it was not in the original language design.

Re: Some Insights from a Julia Developer

#14

The packages-first attitude feels significant to me. A language that “users” enjoy but package developers also enjoy seems important. I hadn’t thought about language choice from a heavily package-development weighted perspective before. It seems obvious in retrospect though, which is probably a sign of something cool. A version of this would be: how can good package development be as easy as possible, and how can pac…

It is.

Many of the language flamewars we do, tend to skip over the eco-system.

Which is much more relevant that any language design issue.

Specially given that the decision of choosing a language is a consequence of working with a specific tool, unless one is open to face some hurdles.

Re: Some Insights from a Julia Developer

#15

Earlier quoted context omitted.

Julia 0.5 introduced support for any indexing scheme you care to invent. 1-based 0-based 20-based https://docs.julialang.org/en/latest/devdocs/offset-arrays/

That is an ugly hack, mainly because it was not in the original language design.

Why ugly? It looks similar to what I know in the Pascal family, where indexes can be ranges or enumerations.

Re: Some Insights from a Julia Developer

#17
It's great and all, but I can't justify switching languages for minor improvements over Python + numpy/scipy. I'd be abandoning:

  * My deep knowledge and experience with Python
  * My entire codebase
  * The ability to work on projects with colleagues who don't also switch
  * The certainty that when I leave my current job, someone will be able to pick up after me
  * Zero-based indexing
I've started to do some work in Rust when it makes sense, since there's occasionally a compelling case and it's substantially different than Python. Incremental advances in programming languages just aren't worth it, and knowing that other people are probably coming to the same conclusion means I can't expect a serious community to ever arise around Julia.

Re: Some Insights from a Julia Developer

#18

Earlier quoted context omitted.

Julia 0.5 introduced support for any indexing scheme you care to invent. 1-based 0-based 20-based https://docs.julialang.org/en/latest/devdocs/offset-arrays/

That is an ugly hack, mainly because it was not in the original language design.

it is in the original language design which is all about type-genericness and separation of implementation from interface with zero-cost abstractions. Creating an array with a different `getindex` dispatch is a great example of what Julia's type system was made to do! The standard library chose to use 1-base indexed contiguous fixed-dimesion dynamic arrays, but that's not the right choice for every problem.

As evidence of this, check out JuliaArrays (https://github.com/JuliaArrays) which is a whole Github organization devoted to the development of alternative array types, like StaticArrays (which are stack-allocated immutable arrays) or CatViews (arrays which are non-contiguous and constructed from views of multiple different arrays). The nice thing about Julia is that, if packages are written to work with generic types, they can natively (and efficiently) work with these "non-standard" array types, making them easy to integrate into the scientific ecosystem.

Re: Some Insights from a Julia Developer

#19
post #6

Too bad they somehow thought it was a good idea to make the syntax resemble MATLAB of all languages. Perhaps most of the nausea inducing warts could be worked around with some kind of transcompilation, although some semantic issues, such as one-based indexing, would remain. It'll be a sad day if Julia starts to get such popularity that high quality libraries will be Julia-only.

What syntax would you like instead, for numerical programming?

* Python seems not so different, but once you add numpy then it involves a lot of ugly `np.arcsin(np.sqrt([...]))` type of things.

* R looks horrifyingly ugly but I haven't written anything

Coming from Mathematica 1-based is comforting, and it also matches the way people write mathematics on paper which is nice.

Re: Some Insights from a Julia Developer

#20
post #3

Everything sounds great about Julia but it's lacking sufficient critical mass to develop useful packages to make scientists and data analysts effective. At the moment the bottleneck in our scientific computing and data analysis workflow is not waiting for code to run but rather quickly inplementing, evaluating, and iterating different models on datasets.

When I last looked at Julia, the language wasn't yet stable. It's not fun developing packages for a language that changes from release to release, so I don't expect their ecosystem to stand a chance until they get to v1.0. All the advantages for package developers listed in this article are moot while the language remains a moving target.

It was said that v1.0 was due in early/mid 2017, but it looks like it's still a ways off.

There is (or was) a window of opportunity for Julia to steal mindshare in academia from MATLAB and R, but it feels like Python is beating them to the punch. Of course, Python had a 21 year head start.

Post reply on HN