by kbarros · 1y ago · 0 comments
It's true that accidental dynamic behaviors are a real concern and can be a performance killer. Fortunately, the language has nice tooling. In VSCode, I often use the visual profiling tool `@profview` to get a flame graph. Anything dynamic gets highlighted in red, and is quick to diagnose. There also exist nice static analysis packages like JET.jl. During development, one can use `report_opt` to statically rule out accidental dynamical behaviors. Such checks can also be incorporated into a project's unit tests. In practice, it's not much of an issue for me anymore. But to be fair, there is a big learning curve for new Julia users. See, e.g., https://docs.julialang.org/en/v1/manual/performance-tips/
At the same time, I would expect the Rust ecosystem to overtake Julia’s in that domain in the next couple of years. Polars is already nicer than pandas, I’ve seen a some promising work on numpy-style tensor libraries, and I’m pretty impressed by the progress with getting enzyme integrated into Rust (I could never make it work with Julia). Here’s a nice example repo I saw recently:
I think something in between Zig and Rust will emerge someday as a sort of optimal compromise between compile speed, safety, and programmability wrt memory and performance tradeoffs.
Also, it's worth emphasizing that the user experience of Julia has been improving greatly, even in just the last 3 years. Julia 1.9 introduced caching of native code [1], and now at Julia 1.11 the time-to-first-plot in a new Julia process is typically less than a second.
Having said all this, Rust is an absolutely fantastic language too, and might be preferred for large-scale software development efforts where static analysis is prioritized over an interactive development workflow.
[1] https://julialang.org/blog/2023/04/julia-1.9-highlights/#cac...
There was also some other if I remember correctly I saw it in the comments of https://youtu.be/eRHlFkomZJg, but now I don't see it , I think it was evcxr only.