If you need to deal with matrices Julia's built-in support for that kind of stuff is the best out of any language I've ever seen (and I've tried dozens of different languages). It's like having first-class numpy arrays without installing any third party packages, and the syntax is even more convenient than Python. The standard library is reasonably comprehensive (not quite as big as in Python or Ruby or Go, but it's usually more well-designed).
It is also an excellent language for messing about because the language and especially the REPL have tons of quality-of-life features. I often use it when I want to do something interactively (eg. inspect a data set, draw a graph, or figure out what's going on with an Unicode string, or debug some bitwise trickery).
What Julia is not great at is things where you need minimal overhead. It is performant for serious number crunching like simulations or machine learning tasks, but the runtime is quite heavy for simple scripting and command-line tools (where the JIT doesn't really get a chance to kick in).
Go is a total non-starter, it's not interactive at all. The competitors are things like Matlab, Mathematica, R or Python (with the right math libs). If you're weird you could use something like Haskell, APL or Lisp in this role, but you'd pay a hefty price in available libs.
In what situations would a non-interactive language be a non-starter? I have never felt that I missed having a REPL when coding C++ or Rust. The only reason it is even useful in python is that the type info is laughably bad, so you need to poke things interactivly to figure out what shape of data you should even expect.
(I'll take strong static typing every day, it is so much better.)
On top of what others have said: In many situations the alternative to Julia isn't Go but C++ (or maybe Rust though its library support is lacking). E.g. if you are writing high-ish* performance algorithmic code that should also run on GPU. Julia also heavily prioritizes composability of libraries. And though that can be a source of bugs at times, there are things we are doing in Julia with one or two PhD students that would be practically impossible (as in require an order of magnitude more implementation work) in any other language.
My two cents: while Julia is arguably more complex than Go, it's type system and especially its data types (N-dimensional arrays, ...) make it way more suited anything that needs to process complex data, or do anything that's even closely related to geometry. `.|>` is wonderful and makes functional-like code easier, and that's just the tip of the iceberg, macros are also beautiful and absurdly useful. Also LLVM more often than not generates faster code than the Go backend, albeit the slowdown at startup in Julia programs is often a dealbreaker for small scripts and iteration in my experience
Also, the REPL. Julia's REPL is vastly better than any other language REPL, by far. Python's is good but Julia is way better, even as a calculator for instance, it has fractions and it is more suited for maths
Yeah, Julia's REPL deserves special attention as it allows to do the package management (by pressing "]"), look for the functions help ("?") and do shell operations (";") without leaving it.
Correct, but I would add: Julia is better than Python+NumPy/SciPy when you need extreme speed in custom logic that can’t be easily vectorized. As Julia is JIT-compiled, if your code calls most of the functions just once it won’t provide a big advantage, as the time spent compiling functions can be significant (e.g., if you use some library heavily based on macros).
To produce plots out of data files, Python and R are probably the best solutions.
We use Julia at our quant fund. We looked into it and several other alternatives 5 years ago as a more performant replacement for numpy/scipy/etc., and Go was one of the alternatives we considered, along with things like numba and writing C extensions.
Julia won for a very simple reason: we tried porting one of our major pipelines in several languages, and the Julia version was both the fastest to port and the most performant afterwards. Plus, Julia code is very easy to read/write for researchers who don't necessarily have a SWE background, while Go or C++ are not.
We started using Julia in the Research Infrastructure team, but other teams ended up adopting it voluntarily because they saw the performance gains.
It is highly interactive and dynamic, yet performant. And it is not only about scientific computing, for almost any application can take advantage of interactive, modifiable system, where you can explore your state at any point. In others, more static langs good debuggers help with this to lesser or larger extend, but it is not the same from my experience.
So better question is: in which circumstances would you choose Julia over more mainstream-y alternative like Clojure? And here scientific and numerical angle comes to play.
At the same time I think Julia is failed attempt, with unsolvable problems, but it is a different topic.
To replace uses where you would use Matlab or R probably. I prefer Julia over Matlab or R. So data science. For production code however, it's not great since it has no static typing. Imagine having your production code crash mid-execution with the error "Function foo not found". Only dynamic languages can do that to you.
I broadly agree that it can be hard to nail down Julia's behaviour but it does have static typing and I think it is more subtle. Function arguments and variables can be concrete types e.g. if you were implementing an approximation for sin, you could restrict arguments to Float32 if you knew it was only suitably accurate for that type.
While others have mentioned plenty of reasons, for this particular case I want to highlight 3 things:
1. Julia has great tooling for operations research/linear programming. JuMP provides an standardise interface to interact with solvers (e.g., Gurobi, CPLEX) via wrapper libraries.
2. I like its overall ergonomics. It is fast enough that a programmer might not need to use a compiled language for performance. The type system allows for multiple dispatch. And the syntax is more approachable than say Python for matrix algebra.
3. I would say the performance is overstated by the community but out of the box it is good enough to avoid languages like C/C++ to build solutions. The two-language problem in academia is real, and Julia helps to reduce that gap somewhat in certain fields.
A very minor nit: Julia is a compiled language, but it has an unusual model where it compiles functions the first time they're used. This is why highly-optimized Julia can have pretty extreme performance.
> I would say the performance is overstated by the community but out of the box it is good enough to avoid languages like C/C++ to build solutions.
For about a year we had a 2-hour problem in our hiring pipeline where the main goal was to write the fastest code possible to do a task, and the best 2 solutions were in Julia. C++ was a close third, and Rust after that.
Julia is not an alternative to Go. It is the alternative to Python (slow) and to C++ (hard and complex). Go is fast and simple but doesn't have abstractions to create complex code required by math libraries.
Julia collapses entire programming paradigms into single character syntax, and often will transparently handle clean parallelism or cluster instance batching.
Judging by Julia's Discourse, compiling actual production Julia code into a standalone binary is highly nontrivial and ordinary users don't really know how and why to do this.
andriamanitra|4 days ago
It is also an excellent language for messing about because the language and especially the REPL have tons of quality-of-life features. I often use it when I want to do something interactively (eg. inspect a data set, draw a graph, or figure out what's going on with an Unicode string, or debug some bitwise trickery).
What Julia is not great at is things where you need minimal overhead. It is performant for serious number crunching like simulations or machine learning tasks, but the runtime is quite heavy for simple scripting and command-line tools (where the JIT doesn't really get a chance to kick in).
kryptiskt|4 days ago
VorpalWay|4 days ago
(I'll take strong static typing every day, it is so much better.)
Certhas|4 days ago
qalmakka|4 days ago
Also, the REPL. Julia's REPL is vastly better than any other language REPL, by far. Python's is good but Julia is way better, even as a calculator for instance, it has fractions and it is more suited for maths
dandanua|4 days ago
Human-Cabbage|4 days ago
ziotom78|4 days ago
To produce plots out of data files, Python and R are probably the best solutions.
SatvikBeri|4 days ago
Julia won for a very simple reason: we tried porting one of our major pipelines in several languages, and the Julia version was both the fastest to port and the most performant afterwards. Plus, Julia code is very easy to read/write for researchers who don't necessarily have a SWE background, while Go or C++ are not.
We started using Julia in the Research Infrastructure team, but other teams ended up adopting it voluntarily because they saw the performance gains.
wolvesechoes|4 days ago
So better question is: in which circumstances would you choose Julia over more mainstream-y alternative like Clojure? And here scientific and numerical angle comes to play.
At the same time I think Julia is failed attempt, with unsolvable problems, but it is a different topic.
huijzer|4 days ago
jondea|4 days ago
sinnsro|4 days ago
1. Julia has great tooling for operations research/linear programming. JuMP provides an standardise interface to interact with solvers (e.g., Gurobi, CPLEX) via wrapper libraries.
2. I like its overall ergonomics. It is fast enough that a programmer might not need to use a compiled language for performance. The type system allows for multiple dispatch. And the syntax is more approachable than say Python for matrix algebra.
3. I would say the performance is overstated by the community but out of the box it is good enough to avoid languages like C/C++ to build solutions. The two-language problem in academia is real, and Julia helps to reduce that gap somewhat in certain fields.
SatvikBeri|4 days ago
A very minor nit: Julia is a compiled language, but it has an unusual model where it compiles functions the first time they're used. This is why highly-optimized Julia can have pretty extreme performance.
> I would say the performance is overstated by the community but out of the box it is good enough to avoid languages like C/C++ to build solutions.
For about a year we had a 2-hour problem in our hiring pipeline where the main goal was to write the fastest code possible to do a task, and the best 2 solutions were in Julia. C++ was a close third, and Rust after that.
setopt|4 days ago
dandanua|4 days ago
Joel_Mckay|4 days ago
https://docs.julialang.org/en/v1/manual/mathematical-operati...
Go is similar in many ways, but takes a performance hit in areas like Garbage collection.
The Julia community is great, and performance projects may also be compiled into a binary image. =3
ForceBru|4 days ago
xeonmc|4 days ago
pjmlp|1 day ago
markkitti|4 days ago
a-french-anon|4 days ago
bandrami|4 days ago