Hacker News new | ask | show | jobs
by rademacher 2758 days ago
Looks pretty nice. Unfortunately, I never run into this issue because I only get to write research code.

The Julia language was designed to target the two language problem and at least from these benchmarks it looks pretty competitive [1]. I imagine over time, pythran may fix some limitations and beat Julia in most benchmarks.

[1] https://github.com/fluiddyn/BenchmarksPythonJuliaAndCo/tree/...

3 comments

Thanks for that benchmark link - puts the claims of the article in perspective.

That said, I want to try Pythran to see how it works for one of my at-home side projects.

I had to learn a bit of Julia about 20 months ago - an old customer got in a pinch when somewhen left before a deliverable so I was immersed using Julia for two weeks. At first I liked the idea of Julia but I didn’t fall in love with the language.

I used to only use MATLAB, which for a lot of research code applications is actually nice for getting a prototype running quickly. Now that I have the freedom to choose, I typically use Julia as I'm trying to gain skills in opensource languages that are actually valuable in the job market. The choice of Julia over python is probably due to my nature of going against the grain, which flies in the face of my previous point.

Was there anything specific that turned you off from Julia?

One major issue with Julia is that it only recently reached 1.0, with a lot of breaking changes, that make a lot of libraries incompatible.

Another issue is that it's not always that fast, for a recent project I never managed to exceed 100 MFLOPS, at which point I switched to C++ and got 3 GFLOPS. But the python version stalled out at 4 MFLOPS though...

Did you write type-unstable code? That brings Julia performance down and memory usage up, since things often get inferred to be Any. So, a vector of what you think are doubles could be turned into a boxed vector of Any. It will slow things down to the speed of Python. Fortunately, it's usually pretty easy to avoid this if you are aware of it.

Well-written Julia should always be within a factor of 2-3 of C, often less. Huge problems are done in pure Julia now. Pure Julia code has been run on HPCs to over a petaflop, something that only C/C++ and Fortran have done. 100 MFLOP is not a problem.

Here is a reference for the comment above and a brief excerpt,

"Written in the productivity language Julia, the Celeste project—which aims to catalogue all of the telescope data for the stars and galaxies in in the visible universe—demonstrated the first Julia application to exceed 1 PF/s of double-precision floating-point performance (specifically 1.54 PF/s)." [1]

[1] https://www.nextplatform.com/2017/11/28/julia-language-deliv...

Very roughly without knowing details: probably the Julia implementation can be tuned to get close to 3 GFLOPS; it's not that the language has limitations to get above this 100MFLOPS whereas in Python 4MFLOPS might potentially be the best you can get.

Care to share your code and see if it can be improved upon?

I think the main performance bottleneck is that I'm adding to a submatrix. Which seems to be a big performance hit in basically all high level languages.
Note that the blog post is also about deployment, not just about performance. Does Julia support statically compiled executables without dependencies or GC?
Unfortunately, not really. There is some community work in that regard [1], but it doesn't seem to get as much attention as one would like. Some people have gotten it to work, but official support (guaranteeing maintenance and decent documentation) for static compilation and easy deployment would make a huge difference.

[1] https://github.com/JuliaLang/PackageCompiler.jl

Better support for static compilation Is on the roadmap
Was also going to mention Julia, it aims to solve this problem and has a really great community