Comparison of Rust to Julia for scientific computing?

Julia programmers use specializations everywhere while Rust’s type system does not support specializations: 1210-impl-specialization - The Rust RFC Book I’m curious to know about the impacts of this on the difference in the ecosystems.

1 Like

Yea, this and the dynamicity of Julia and other stuff are why this is harder than just translating rust’s traits verbatim… but I’m wondering if this is a fundamental gulf or is it fruitful to explore the safety vs flexibility tradeoff, especially as an opt in thing.

I don’t think dynamism is an issue here. In fact, the aforementioned RFC seems to suggest a reasonable solution (but I’m no Rust expert). Also, the RFC spends a lot of space discussing how to statically resolve what we call method ambiguities.

Yea, this and the dynamicity of Julia and other stuff are why this is harder than just translating rust’s traits verbatim… but I’m wondering if this is a fundamental gulf or is it fruitful to explore the safety vs flexibility tradeoff, especially as an opt in thing.

Got it. I was thrown off by the fact that it was never implemented.

For anyone following along here, we’re having a mega trait discussion about a potential implementation in base here: JuliaLang

and on slack #data

You might want to reconsider your assumption that Rust’s memory safety makes it slow. It’s one of the fastest languages available, partly because of, rather than in spite of, the memory safety. See these benchmarks: GitHub - drujensen/fib: Performance Benchmark of top Github languages. What Rust runs in 7.652 s, Julia runs in 11.318 s.

I’m not sure about Julia, but Rust’s pyo3 package (crate) makes it really easy to expose Rust functions, structs (classes), and methods to python. I’d be shocked if there’s not something similar for julia.

While I agree that Rust is certainly not a slow language, and it’s memory model can sometimes be quite helpful for that performance, I don’t think a benchmark on the recursive Fibonacci sequence is really that great a demonstration of this point.

4 Likes

Well, one of the main objective of Julia is to solve the two-language problem and provide scientist with fast and productive language.
With this in mind, exposing Julia function to Python is less important than exposing rust function to Python.

1 Like

Especially since the fib microbenchmark doesn’t involve arrays at all…

3 posts were split to a new topic: Yet another TCO thread

The main problem with Rust right now is that, as far as I know, there is no support for parallelism con clusters. Even the MPI wrapper crate has had no commits in 4 years. I would love to try Rust on my project but unfortunately I need it to run on a cluster.

2 Likes