1. 40

Archived link: https://archive.is/CjOCq

  1. 12

    Yes, maybe? Most of the examples come from bioinformatics domain. If I look at remote sensing or GIS where C++ and Python reigns or in Epidemiology/Public Health/Clinical Trials where C++/R/SAS reigns, I am not so sure to see anything in Rust coming for a long time. It depends also of the research affinity, when I was looking at the uses of OCaml in scientific research, I found a researcher working on climate models. It only tells me that it is possible to do it not that it is a new trend or the norm. It is nice to see Rust percolating in scientific environment but that is the only thing that the article shows.

    1. 10

      I don’t think the article purports to show ‘all scientists everywhere are turning to Rust’. The headline isn’t even misleading. Yes, scientists (not all) are turning to Rust, and the why is explained inside.

      1. 6

        In science all the coding is done by graduate students and postdocs. It’s a great opportunity to try out the new shiny. No one is going to challenge you technically.

        1. 5

          Then the grad student graduates and the new one is stuck trying to learn new_shiny_language that no one in the lab knows while under pressure to keep the research output going while trying to find a bug that is stopping an R&R to be done while working on their own research.

          There is a reason why some scientific code is still written in Fortran. It is too costly to to a rewrite in some more modern program, there are no incentives for a student to spend time rewriting old code because that is not publishable, and the people that have written the code have long left the research lab and no one really knows what is going on in the code.

          1. 2

            Our experiences differ, not on the graduate/Phd/postdocs part but I have been constraint to use specific technologies in certain research projects. During your Phd or postdocs maybe, you may have the freedom to chose your tools but it is not certain. Anecdata and personal bias of course.

            I am happy to see people using Rust in research, and fresh projects like WhiteBoxTools in GIS/Remote Sensing.

          2. [Comment from banned user removed]

            1. 5

              Ah yes, we use programming languages once again to extrapolate negative personality traits in other humans. If you’re going to make such a sweeping, acerbic judgement, can you at least back it up with some data?

              1. 2

                I’m a physics graduate student and I don’t think this is correct. From what I’ve seen most people don’t use C++, but those that do use it out of necessity (or ignorance, not knowing that Rust exists). I personally don’t have high performance requirements so I mostly use Python, but most labs I have experience with use Python, Matlab, or LabView. I only have experience with one lab that uses C++, and they use it because they need something very fast to process the absolutely enormous amount of data coming from the detectors in their dark matter experiments.

                1. 2

                  “Everyone knows 70% of C++. It’s just that no one knows the same 70%.”

                  1. 1

                    In my neck of the woods (computational linguistics) and what I have seen in related fields, pretty much everyone uses Python and perhaps some R for statistics (plus historically Perl and some Prolog). Only people who are implementing core machine learning algorithms use C++ (which is a tiny < 1% subset).

                    I do not see much Rust either. I used Rust in some projects when I was still in academia and so were some of my students (some liked it and I guess some wrote Rust because they were making extensions to my projects), but I haven’t really encountered many other people in the field who use Rust.

                2. 10

                  I’m a physics graduate student and a Rustacean of a few years. I don’t really use Rust in my lab for a few reasons:

                  • There’s not a de facto, ergonomic crate for optimization problems e.g. nonlinear least squares. I want something as easy to use as SciPy’s curve_fit.
                  • Most of the time I’m orchestrating different pieces of equipment to perform an experiment, and this mainly happens by transmitting ASCII commands over a serial port. Python is plenty fast in this regard, and very straightforward.
                  • Some equipment requires a DLL to communicate with, and this is pretty easy (so far) with Python’s ctypes module. If I were to do this in Rust I would have to deal with generating bindings, FFI, unsafe, etc.
                  • I work in a very small lab (2 people at the moment, both close to graduating), so there is precisely zero institutional knowledge. If the next person who comes along has no experience programming, I would rather hand them a Python program than a Rust program.

                  I generally think that Rust is the better choice if you can get away with it since it enforces correctness to some degree. That said, you have to look at the broader context of your research as to whether you even have a say in this at all. I think this breaks down into two categories:

                  • The Wild West: You’re the only person doing your kind of research, so you can do whatever the hell you want. You could do your research in Common Lisp for all anyone cares.
                  • The Cog in the Machine: You’re part of a larger research effort that is a collaboration across different labs, institutions, etc. In this case you’re pretty much stuck with whatever language the collaboration has decided on to write its tools.
                  1. 8

                    I‘m not that familiar with Julia, but doesn‘t that language claim to solve Python‘s shortcoming regarding speed? It‘s also much more focused on scientific computing. It would be interesting to hear from the scientists mentioned why they didn‘t choose Julia.

                    1. 2

                      Very small sample: I know of one person using Julia because it was faster than Python for a particular task. (Analysis of mass spectrometry data.)

                      (I didn’t actually study the code closely, so I can’t say whether it would have been possible to make it fast enough using numpy, etc.)

                      1. 2

                        The article on Julia is linked as a related article: https://www.nature.com/articles/d41586-019-02310-3

                        Many scientists are using Julia. As a Julia user, I can point out several reasons why one might pick Rust over Julia: Julia is a garbage-collected language, whereas Rust has its borrow-checker (If you need explicit control over performance, Rust might be the better choice). Rust is safer with static type-checking, whereas Julia mostly uses type-annotations for multiple dispatch (Julia is aimed more at computational exploration, whereas Rust aims for compiled binaries, and it seems Varlociraptor aims to build a distributable binary). Julia targets LLVM, whereas Rust targets specific architecture (Rust would be easier with embedded systems).

                        1. 1

                          Rust’s main implementation targets LLVM.