Hacker News new | ask | show | jobs
by jarbus 496 days ago
I've used, and am still using, Julia for my PhD research. It's perfect for parallel/distributed computing, and the neural network primitives are more than enough for my purposes. Anything I write in pure julia runs really, really fast, and has great profiling tools to improve performance further.

Julia also integrates with python, with stuff like PythonCall.jl. I've gotten everything to work so far, but it hasn't been smooth. The python code is always the major bottleneck though, so I try to avoid it.

Overall, julia is a significantly better language in every single aspect except for ecosystem and the occassional environment issue, which you'll get with conda often anyways. It's really a shame that practically nobody actually cares about it compared to python. It supports multi-dimensional arrays as a first-class citizen, which means that each package doesn't have it's own array like torch, numpy, etc, and you don't have to constantly convert between the types.

4 comments

I agree on all points. I have used Python for 15 years, Julia for 3 and reach for Julia most of the time for personal projects. I was really stoked when at work the only FOSS solver for our problem was in Julia so we wrote the rest in it for easy integration. The only thing I dread is having to look for a new package since the ecosystem can be quite fragmented.
I actually find that ecosystem for Julia is not that big of an issue for me. I guess that my specific use-case (data analysis, numerical simulations) is probably the most developed part of the ecosystem, but regarding that I find that the ecosystem is much more homogeneous than for example python - most things work with most other things (eg units or measurement uncertainties libraries work automatically with a piloting library).
As you probably know, that almost magical interworking of libraries is a consequence of Julia’s multiple dispatch and type system:

https://arstechnica.com/science/2020/10/the-unreasonable-eff...

Yes, it's a wonderful language for scientific computing - mostly by the venture of being designed from the ground up for this role, and not retroactively ported in (like python).
I actually prefer the smaller community of the jusia ecosystem. For one thing, when searching for issues online youre much less likely to hit spam “tutorials” or eternal september stuff.

And other peoples code is actually a pleasure to read

Your last sentence applies equally to Fortran. How would you compare Julia and Fortran?
Julia adds some pretty amazing stuff with multiple dispatch and run-time compilation. What this means is that you can glue code together in ways impossible for other languages.

One example is a system that I built using three libraries. One was a C library from Postgres for geolocation, another was Uber's H3 library (also C) and a third was a Julia native library for geodesy. From Julia, I was able to extend the API of the H3 library and the Postgres library so that all three libraries would inter-operate transparently. This extension could be done without any mods to the packages I was important.

Slightly similar, if you have a magic whizbang way of looking at your data as a strange form of matrix, you can simply implement a few optimized primitive matrix operations and the standard linear algebra libraries will now use your data structure. Normal languages can't really do that.

More on that second case and the implications in the following video:

https://www.youtube.com/watch?v=kc9HwsxE1OY

Julia is generally higher level than Fortran, with syntax inspired by Python/R/Matlab. We've been able to reliably hire Math PhDs and quickly get them productive in Julia, which would take much longer with Fortran.
Julia uses LLVM for its jit architecture, if I recall correctly.

That makes it a good candidate for running well on ARM platforms (think embedded data processing at the edge).

Not sure how well fortran does on ARM.

Fortran does quite well on almost any major CPU since 1950's, including GPUs.

Actually one of the reasons CUDA won the hearts of researchers over OpenCL, is that Khronos never cared for Fortran, and even C++ was late to the party.

I attended one Khronos webminar where the panel was puzzled with a question from the audience regarding Fortran support roadmap.

NVidia is sponsoring the work on the LLVM Fortran frontend, so same applies.

https://flang.llvm.org/docs/

“sponsoring” in this case means writing nearly all of it ourselves (although we’ve had lots of help from Arm and some others on specific areas like OpenMP).
I see, I do follow LLVM conference talks, but not that deep.
And because it runs on arm (there are official arm binaries at julialang.org) you can run Julia on your phone:

https://bsky.app/profile/badphysicist.bsky.social/post/3lhfm...

Julia is dynamically typed, has a very rich type system, powerful metaprogramming and polymorphism tools.

Julia also has an active thriving ecosystem, and an excellent package manager.