Mo Bitar - Rust vs Julia in scientific computing

preview_player
Показать описание
Recording of a talk given at the Scientific Computing in Rust 2023 online workshop.

One of the main objectives of Julia is solving the two-language problem. This means that by using Julia, you don't have to prototype in a dynamic language like Python for flexibility and later rewrite the code in a compiled language like C/C++ for performance.

This goal did catch me while picking a programming language for my bachelor's thesis in physics. But after regularly using and even teaching Julia, do I still think that Julia solves that two-language problem?

And why do I think that Rust is the actual solution in some cases?

Рекомендации по теме
Комментарии
Автор

I don't think Julia has many "performance footguns". To me a footgun is something that is easy to get wrong. Does Julia allow non-performant, non-type stable, etc things? Yes. I have yet to see Julia code that is very slow where I am wondering why it isn't fast. The example given of a Array{Any}, it is obvious to me why that wouldn't be performant. To me Julia's advantage is that it is a language where it is "easy to get performant and idiomatic code".

You can not care about performance at all and get code that runs slow (but you can write fast). You can, if you want, make very optimized code that looks nothing like idiomatic Julia. In most cases I want something in the middle. I want abstract idiomatic code (easy to maintain) that is reasonably fast. I've found avoiding things that make your code slow in Julia is usually easy and there are nice tools for doing so.

offensivearch
Автор

Guys, use the right language for the right problem...
Rust is the language you want for writing stable and performant software for sure. Noone would want to write a database in Julia, but for scientific computing, Im sorry, Julia is just the better language.
There are static analysis tools for Julia as well you dont need a compiler for that.
Btw you can have bad performance in any language if you dont know basics.

Sumospider
Автор

This is an old debate. Bottom line: developing in Julia is and will be easier. Rust is an amazing compiler, but developing code in Rust seem to be a PITA.

MarcoAntoniotti
Автор

never have i ever seen v.pop used or taught in julia. the use case would be someone trying to straight up paste code from some other language to julia.

nanocentury
Автор

4:28 I think pop! is a feature. Most of the time, if I try to pop an empty array, I want my program to error so I can know there was something wrong.

halneufmille
Автор

what about software development efficiency? how easy the language for researcher or scientist to adopt the language? code readability? personally, for scientific computing, I don't think rust is anywhere close to julia/python or even matlab or R. I love rust for its speed and safety, but a lot of rust enthusiasts want others to see it as the "best language for everything" which is just clearly wrong.

kaihsiangju
Автор

Nd arrays in rust suck. Lack of elegant broadcasting rules also sucks. No way to generate cuda kernels (from within rust). Lack of a good AD/ML library. I dont know what kind of scientific products you are using rust for, but definately rust is not the tool for my usecase.

nicklam
Автор

I think this is a great snippet of the issues of Julia; there are of course a lot of other issues (starting with the fact that it indexes at 1). I definitely agree that Julia does not solve the two language problem; right now mojo is the best candidate to solve it, but mojo's decision to essentially be compatible with python will be a huge albatross in this endeavor. Ironically, I do think that Rust comes closest to solving the two language problem, it is much easier to do scripting/prototyping in rust that to get a quality prod-ready code in Julia.

yevgeniygrechka
Автор

Saying Julia is not good for anything outside of simple scripting seems to me that some doesn't actually know how to program in Julia. I have written at least 2 large simulation packages ( phontonics related.) They were previously written in C for speed. Julia is just at fast as the C ones and and way easier to maintain and extend. I was able to model then optimize the code so much easier than c or c++. I think think you just don't have experience writing a large package in Julia. That is not to say Rust isn't a good language. Rust seems to be a good systems level programing language. Julia is not. Plain simple has nothing to do with size of the program.

dustinhess