| ▲ | drnick1 a day ago |
| I don't think Julia really solves any problems that aren't already solved by Python. Python is sometimes slower (hot loops), but for that you have Numba. And if something is truly performance critical, it should be written or rewritten in C++ anyway. But Julia also introduces new problems, such as JIT warmup (so it's not really suitable for scripting) and is still not considered trustworthy: https://yuri.is/not-julia/ |
|
| ▲ | SatvikBeri a day ago | parent | next [-] |
| > Python is sometimes slower (hot loops), but for that you have Numba This is a huge understatement. At the hedge fund I work at, I learned Julia by porting a heavily optimized Python pipeline. Hundreds of hours had gone into the Python version – it was essentially entirely glue code over C. In about two weeks of learning Julia, I ported the pipeline and got it 14x faster. This was worth multiple senior FTE salaries. With the same amount of effort, my coworkers – who are much better engineers than I am – had not managed to get any significant part of the pipeline onto Numba. > And if something is truly performance critical, it should be written or rewritten in C++ anyway. Part of our interview process is a take-home where we ask candidates to build the fastest version of a pipeline they possibly can. People usually use C++ or Julia. All of the fastest answers are in Julia. |
| |
| ▲ | sbrother 21 hours ago | parent | next [-] | | > People usually use C++ or Julia. All of the fastest answers are in Julia That's surprising to me and piques my interest. What sort of pipeline is this that's faster in Julia than C++? Does Julia automatically use something like SIMD or other array magic that C++ doesn't? | | |
| ▲ | jakobnissen 19 hours ago | parent | next [-] | | I use Rust instead of C++, but I also see my Julia code being faster than my Rust code. In my view, it's not that Julia itself is faster than Rust - on the contrary, Rust as a language is faster than Julia. However, Julia's prototyping, iteration speed, benchmarking, profiling and observability is better. By the time I would have written the first working Rust version, I would have written it in Julia, profiled it, maybe changed part of the algorithm, and optimised it. Also, Julia makes more heavy use of generics than Rust, which often leads to better code specialization. There are some ways in which Julia produces better machine code that Rust, but they're usually not decisive, and there are more ways in which Rust produces better machine code than Julia. Also, the performance ceiling for Rust is better because Rust allows you to do more advanced, low level optimisations than Julia. | | |
| ▲ | SatvikBeri 9 hours ago | parent [-] | | This is pretty much it – when we had follow up interviews with the C++ devs, they had usually only had time to try one or two high-level approaches, and then do a bit of profiling & iteration. The Julia devs had time to try several approaches and do much more detailed profiling. |
| |
| ▲ | SatvikBeri 10 hours ago | parent | prev | next [-] | | To be clear, the fastest theoretically possible C++ is probably faster than the fastest theoretically possible Julia. But the fastest C++ that Senior Data Engineer candidates would write in ~2 hours was slower than the fastest Julia (though still pretty fast! The benchmark for this problem was 10ms, and the fastest C++ answer was 3 ms, and the top two Julia answers were 2.3ms and .21ms) The pipeline was pretty heavily focused on mathematical calculations – something like, given a large set of trading signals, calculate a bunch of stats for those signals. All the best Julia and C++ answers used SIMD. | |
| ▲ | adgjlsfhk1 20 hours ago | parent | prev [-] | | The main thing is just that Julia has a standard library that works with you rather than working against you. The built in sort will use radix sort where appropriate and a highly optimized quicksort otherwise. You get built in matrices and higher dimensional arrays with optimized BLAS/LaPack configured for you (and CSC+structured sparse matrices). You get complex and rational numbers, and a calling convention (pass by sharing) which is the fast one by default 90% of the time instead of being slow (copying) 90% of the time. You have a built in package manager that doesn't require special configuration, that also lets you install GPU libraries that make it trivial to run generic code on all sorts of accelerators. Everything you can do in Julia you can do in C++, but lots of projects that would take a week in C++ can be done in an hour in Julia. |
| |
| ▲ | pbowyer 17 hours ago | parent | prev | next [-] | | > Part of our interview process is a take-home where we ask candidates to build the fastest version of a pipeline they possibly can. People usually use C++ or Julia. All of the fastest answers are in Julia. It would be fun if you could share a similar pipeline problem to your take-home (I know you can't share what's in your interview). I started off in scientific Python in 2003 and like noodling around with new programming languages, and it's great to have challenges like this to work through. I enjoyed the 1BRC problem in 2024. | | | |
| ▲ | drnick1 21 hours ago | parent | prev [-] | | The C++ devs at your firm must be absolutely terrible if a newcomer using a scripting language can write faster software, or you are not telling the whole story. All of NumPy, Julia, MATLAB, R, and similar domain-specific, user-friendly libraries and platforms use BLAS and LAPACK for numerical calculations under the hood with some overhead depending on the implementation, so a reasonably optimized native implementation should always be faster. By the looks of it the C++ code wasn't compiled with -O3 if it can be trivially beaten by Julia. | | |
| ▲ | SatvikBeri 10 hours ago | parent | next [-] | | Are you aware that Julia is a compiled language with a heavy focus on performance? It is not in the same category as NumPy/MATLAB/R | |
| ▲ | postflopclarity 4 hours ago | parent | prev [-] | | Julia is not a scripting language and can match C performance on many tasks. |
|
|
|
| ▲ | sundarurfriend a day ago | parent | prev | next [-] |
| As your comment already hints at, using Python often ends up a hodgepodge of libraries and tools glued together, that work for their limited scope but show their shaky foundations any time your work is outside of those parts. Having worked with researchers and engineers for years on their codebases, there is already too much "throw shit at the wall and see what sticks" temptation in this type of code (because they'd much rather be working on their research than on the code), and the Python way of doing things actively encourages that. Julia's type hierarchies, integrated easy package management, and many elements of its design make writing better code easier and even the smoother path. > I don't think Julia really solves any problems that aren't already solved by Python. I don't really need proper furniture, the cardboard boxes and books setup I had previously "solved" the same problems, but I feel less worried about random parts of it suddenly buckling, and it is much more ergonomic in practice too. |
| |
| ▲ | wolvesechoes 18 hours ago | parent [-] | | > using Python often ends up a hodgepodge of libraries and tools glued together At least it has those tools and libraries, what cannot be said about Julia. | | |
| ▲ | forgotpwd16 17 hours ago | parent [-] | | What tools/libraries you miss from Julia? Have you used the language or merely speculating? | | |
| ▲ | wolvesechoes 14 hours ago | parent [-] | | > What tools/libraries you miss from Julia? My experience with this website is that it would be rather pointless to enumerate, because you will then point to some poorly documented, buggy and supporting fraction of features Julia "alternatives" to Python packages or APIs that are developed and maintained by well-resourced organizations. The same thing for tooling - unstable, buggy Julia plugin for VSCode is not the same as having products like PyCharm and official Python plugins made by Microsoft for VS and VSCode. Now, I will admit that Julia also has some niceties that would be hard to find in Python ecosystem (mainly SciML packages), but it is not enough. > Have you used the language or merely speculating? I just saw the logo in Google Images. |
|
|
|
|
| ▲ | MillironX a day ago | parent | prev | next [-] |
| > I don't think Julia really solves any problems that aren't already solved by Python. But isn't the whole point of this article that Matlab is more readable than Python (i.e. solves the readability problem)? The Matlab and Julia code for the provided example are equivalent[1]: which means Julia has more readable math than Python. [1]: Technically, the article's code will not work in Julia because Julia gives semantic meaning to commas in brackets, while Matlab does not. It is perfectly valid to use spaces as separators in Matlab, meaning that the following Julia code is also valid Matlab which is equivalent to the Matlab code block provided in the article. X = [ 1 2 3 ];
Y = [ 1 2 3;
4 5 6;
7 8 9 ];
Z = Y * X';
W = [ Z Z ];
|
| |
| ▲ | forgotpwd16 a day ago | parent [-] | | This snippet is also cleaner than one in article and more in spirit. Also the image next to whiteboard has a no-commas example. |
|
|
| ▲ | jakobnissen 19 hours ago | parent | prev | next [-] |
| Yes, Python code is indeed fast if you write it in C++... what a bizarre argument. The whole selling point of Julia is that I can BOTH have a dynamic language with a REPL, where I can redefine methods etc, AND that it runs so fast there is no need to go to another language. It's wild what people get used to. Rustaceans adapt to excruciating compile times and borrowchecker nonsense, and apparently Pythonistas think it's a great argument in favor of Python that all performance sensitive Python libraries must be rewritten in another language. In fairness, we Julians have to adapt to a script having a 10 second JIT latency before even starting... |
| |
| ▲ | wolvesechoes 18 hours ago | parent [-] | | > Pythonistas think it's a great argument in favor of Python that all performance sensitive Python libraries must be rewritten in another language. It is, because usually someone already did it for them. |
|
|
| ▲ | forgotpwd16 a day ago | parent | prev | next [-] |
| >I don't think Julia really solves any problems that aren't already solved by Python. You read the article that compares MATLAB to Python? It's saying MATLAB, although some issues exist, still relevant because it's math-like. GP points out Julia is also math-like without those issues. |
|
| ▲ | nallana a day ago | parent | prev | next [-] |
| In Julia, you explicitly need to still reason about and select GPU drivers + manage residency of tensors; in RunMat we abstract that away, and just do it for you. You just write math, and we do an equivalent of a JIT to just figure out when to run it on GPU for you. Our goal is to make a runtime that lets people stay at the math layer as much as possible, and run the math as fast as possible. |
|
| ▲ | kelipso a day ago | parent | prev [-] |
| Sometimes slower? No, always slower. And no one wants to deal with the mess that is creating an interface with C or C++. And I wouldn’t want to code in that either, way too much time, effort, headache. |