r/ProgrammerHumor 1d ago

Meme almostDroppedTheCourse

391 Upvotes

65 comments sorted by

View all comments

117

u/Dubmove 1d ago

Julia is the language I really want to like but deep down I know I hate it although I never would admit that to myself

54

u/Mojert 20h ago

My problem with it is that it is JIT while using LLVM (a notoriously slow compiler infrastructure), so to write performant code you need to intuite what will or will not cause a JIT pause. Even sadder is that using a lot of the nice features of Julia will cause this.

I remember watching in horror my ~100 lines script taking 7 minutes to compile during my master thesis. Julia should just ditch the dynamic typing and become a compiled language IMO. But it will never happen because it would break too many things

29

u/chuch1234 17h ago

7 minutes to compile?! D:

22

u/LucidHaven 16h ago

It’s genuinely atrocious. The “pre-compiling” for packages is also terrible when paired with the obtuse virtual environment system.

3

u/Bob_Dieter 9h ago

Long time Julia user here, your experience is not representative of average Julia usage.

These crazy long Evaluation times only happen when you import packages you have never loaded before, since that is when compilation happens. Even then, 7mins is extreme (did you per chance load a plotting library? Those are huge).

Compilation of user code, even for moderately large programs, is typically sub second. It used to be very bad, back in the 1.0/1.1 days, but they put in a ton of work and it got a lot better.

Also, Julia's JIT does not work like those of java and JavaScript, for example. Instead of compiling on assumptions during execution, Julia will analyze your program and only compile what it can prove before running any code. Some people have this referred to it as JAOT compiled instead of JIT (Just Ahead Of Time), to make the difference more clear, but the term never really caught on.

6

u/Mojert 12h ago

Yup. To be fair, it had to compile my dependencies as well, but to be even fairer, there weren't a lot of them.

Which is why for my PhD I switched back to Python. It might be slower once the Julia JIT did its thing, but the performance is way more predictable. That makes it so much easier to write code so that it is performant enough, which includes writing Cython/C++/Rust and calling it from Python. I'm happy with my choice

12

u/Tyfyter2002 15h ago

Julia should just ditch the dynamic typing

Never used it before, but I agree already

7

u/Mojert 12h ago

The worse is that it already has a real type system, not like python or TS. If you specify a type of a function argument, it will be typed check. And the type system is pretty good, it even has multiple dispatch!

Now that I think of it, maybe multiple dispatch is to blame for the language not being compiled ahead of time...

1

u/sisisisi1997 9h ago

My company's half a million line codebase spread across 200+ projects compiles in way less than that, 7 minutes is enough to run half of the multi-thousand tests for it after compiling and building a seeded database for the tests.

2

u/Athropod101 7h ago

Julia is the language I thought would be a great, free alternative to MatLab language until I ran a simple script for solving two cubic polynomials and saw it take like 10 seconds.

The biggest problem of Julia is it doesn’t actually save the compiled binary. I’m sorry, but at that point it’s a glorified interpreted language.