Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- - why are all the newer posts on page 1 and page 2 under blog empty? I mean I literally only see the title
- not a single post has anything inside here https://flow.byu.edu/posts/
by vivzkestrel - I wonder how Mojo ranks along with Julia. Mojo was discussed yesterday here. Mojo seems to be more python focused while Julia is very much focused on Scientific computation. I may be wrong.by kasperset
- Over the years there already was almost the identical articles about making in language X program as fast as C or C++... And results was exactly the same: write C/C++ style programs!
Why ?
Because of CPU's architecture - given CPU one just need to structure code in a way CPU can perform efficiently! Is it such surprising that all sugar and multi-functional smartness have cost of all that if's and loops like maps? CPU is just rock stupid and can't do anything else!
That's from where all that specialized instructions are coming and programs just need to be structured or compiled to CPU arch way to perform as fast as CPU and rest of hardware allows...
And there are some "Java machines" and that is exaclty the same story: use CPU native lang :) As much as posible.
So: give us better cpus pls :)
by Woodi - Very interesting post and I think this exposes the limitations of the Julia compiler. Note that an old version of the compiler is used (1.0.3 from 2019).
One could say that we can almost replicate the semantic of a C++ program, but writing in Julia. For example we can remove bounds checks in arrays or remove hidden memory allocations.
But the goal of a language for numerical computing is capturing the mathematical formulas using high level constructs closer to the original representation while compiling to efficient code.
Domain scientists want to play with the math and the formulas, not doing common subexpression elimination in their programs. Just curious to see how it evolves
by FattiMei - I think the best compromise would be to get the best of two words. By default perform bound checks, but have a compiler flag which skips it. Might broke many programs written with default behaviour in mind, but allow perform additional optimizations.by northzen
- Dang, haven’t read much on Julia as of late. I remember using it for a CS 300-level course around 2016 when learning about tokenizing and parsing as part of language fundamentals. Julia has undoubtedly made some significant performance improvements since then. Would love to see a follow-up that explores what, if anything, from this still holds true and what improvements can be made.
- Note that this article is about Julia 1.0.3, whereas today you should consider as obsolete any experience reports involving Julia versions prior to Julia 1.10 (the current LTS version), the most significant milestone in the maturity and usability of the language.by mgkuhn
- Recent discussion on Julia Discourse: https://discourse.julialang.org/t/making-julia-as-fast-as-c/by ForceBru
- I'm always surprised when people describe Julia syntax as "Pythonic": Julia's syntax was clearly inspired by MATLAB rather than Python.
And that's a good thing, because Python+NumPy syntax is far more cumbersome than either Julia or MATLAB's.
You can see this at a glance from this nice trilingual cheat sheet:
by mgkuhn - It's definitely closer to matlab than python, but it's closer to python than most mainstream programming languages. I ported ~20k lines of python code to Julia over a couple years manually, and for the most part could do line-by-line translations that worked (but weren't necessarily performant until I profiled and switched to using Julia idioms.)by SatvikBeri
- Phew. 7-year old post about a 10-year old language. Triggers all the LLMs posting empty generic response "Very interesting, exposes limitations...".
Prelude of what's to come in the self-reinforcing cycle of machines talking to machines and drowning everything else.
by ekjhgkejhgk - It's a very predictable pattern I swear. Thought it was a mostly reddit thing but dead internet theory looking more and more real even here.by kelipso
- I really like Julia as a language but I have struggled to adopt it and be productive in it. Part of it is because of the JIT runtime and a sub-par LSP (at least when I last tried).
To those who regularly write Julia code, what is your workflow? The whole thing with Revise.jl did not suit me honestly. I have enjoyed programming in Rust orders of magnitude more because there's no run time and you can do AOT. My intention is not write scripts, but high performance numerical/scientific code, and with Julia's JIT-based design, rapid iteration (to me at least) feels slower than Rust (!).
by kmaitreys - > Part of it is because of the JIT runtime and a sub-par LSP (at least when I last tried)
Good LSPs do the autocompletion, sub par ones don't.
Is it really such a good idea to have every single automated aid turned on when picking up a new language?
How will you learn if you cannot get feedback on what you did wrong?
I mean, until you learn multiplication, maybe don't use the calculator.
Once you learn it then you get a small speed increase, but if you are new to something, LSP autocompletion is going to slow down your learning.
by lelanthran - What's the problem with the JIT runtime? Why is rapid iteration slower with JIT? Just-in-time compilation isn't inherently slower and is normally faster than AOT for dynamic languages and even static languages that have some dynamic features like dynamic dispatchby paddim8
- Just an FYI...Claude is actually really good at building LSP servers [1].
If you want a better Julia LSP, you might just be able to get Claude or Codex to build one for you. I've been impressed with the TLA+ bindings it generated.
by tombert - yup the LSP is bad, there is a new lsp being rewritten based on JET.jl a static code analyzer , this should be faster than the old lsp which kind of runs by loading all the modules into a julia instance and queries it for symbols and docs ( im not 100% sure but i think thats how it works)
- Well, my workflow uses Revise.jl. I develop either in Jupyter notebooks or in the REPL, prototyping code there and then moving functions to files when they're ready. In that context, rapid iteration is fairly fast.
Nowadays I often use Claude Code, working with a Julia REPL in a tmux or zellij session via send-keys. I'll have it prototype and try to optimize an algorithm there, then create a notebook to "present its results", then I'll take the bits I like and add them to the production codebase.
by SatvikBeri - The boring answer is that I don’t use huge dependencies that takes minutes to compile, and I don’t lean on the LSP - I tend to put more effort in reading the code.
In my experience you really gotta work with the tools the language gives you. Julia gives you Revise, so it’s a bit of a handicap not using it. Maybe analogous to writing Rust without an LSP.
I get that leaning on the LSP can become a habit, and also that the Julia LSP is quite poor, but I find it wild that rapid iteration for you is faster in Rust. I write Rust as well and can’t imagine how that would be the case.
by jakobnissen - Julia is reasonably fast. I returned to a language comparison project specific to my math research, to see how I might do better. My agents and I studied the advice in the post and various more recent links from the comments, but we were already mostly on target and nothing left moved the needle.
My work is more combinatorial. Julia does excel at numerical computation. There's a tribal divide in math between people who can't go 30 seconds away from the real or complex numbers, and those whose tolerance is about that long. I try to keep an open mind, but I'm closer to the second camp. Julia is good enough to consider either way.
A development in recent months, AI can assist in general purpose Lean 4 programming, no longer getting confused by the dominant proof-oriented training corpus. If one is a functional programmer who believes that Haskell was on the right track, then Lean is the most interesting language choice for shaping one's thoughts. Benchmarks are inherently misleading if a better language makes it possible to express algorithms out of reach of more primitive languages.
https://github.com/Syzygies/Compare
C++ 100 13.08s ±0.08s Rust 99 13.16s ±0.02s Julia 90 14.54s ±0.01s F# 90 14.54s ±0.04s Kotlin-native 88 14.79s ±0.01s Kotlin 86 15.18s ±0.01s Scala 79 16.50s ±0.08s Scala-native 76 17.14s ±0.02s Nim 65 20.17s ±0.01s Swift 64 20.54s ±0.04s Ocaml 52 25.38s ±0.04s Chez 49 26.64s ±0.02s Haskell 37 34.96s ±0.06s Lean 29 45.39s ±0.15sby Syzygies - Punchline: rewrote the code to look almost identical to C++, hand-held the compiler by adding @-marks to disable safety checks, forced SIMD codegen and fastmath on.
End result: code that is uglier and still much slower than C++. Kind of a shame.
by StilesCrisis - I don't get the appeal. It's like a. OSS Matlab but all contributions are used directly so the language developers can make money for a parent company? Most OSS languages aren't run that way. Seems kind of scammy
- Came here to say that. It's just easier to write C++ in the first place, and LLMs now make this easier than ever.by drnick1
- > code that is uglier and still much slower than C++.
Oh such a shame indeed! They didn’t even manage to produce better looking code at least?? Julia was looking great in 2019 but it was very buggy still so I stopped looking. Had hopes that by now it would be a good choice over C++ and Rust with similar performance.
by brabel - Hardly seems worth the effort, perhaps things have improved since 2019. It would be interesting to see an updated benchmark, but if your going to end up with code that looks like C++ to get proper performance, you might as well write it in C++. My biggest problem with Julia is that they decided to use column-major indexing for multi-dimensional arrays (i.e. FORTRAN/MATLAB style). This makes interoperability with C/C++ and python numpy a real pain, since you can't do zero-copy array sharing between the two without one side being forced into strided-access. For that reason alone I haven't adopted it in any of my work-flows.by neutrinobro
- This is 7 years old. Julia is a totally different language by now.
As a quick anecdote, in our take-home interview exercise, we usually receive answers in C++ or Julia, and the two fastest answers have been in Julia.
by SatvikBeri - I was once a bit of a Julia performance expert, but moved toward c++ for hobby projects even while still using Julia professionally.
I wrote a blog post at the time with exactly that punchline (not explicitly stated, but just look at the code!): https://spmd.org/posts/multithreadedallocations/ The example was similar to a real production-critical hot path from work.
Maybe things changed since I left Julia, but that was December 2023, for years after this blog post.
by celrod