Live data from Hacker News

Why scientists are turning to Rust (2020)

nature.com

41–50 of 55 posts

Re: Why scientists are turning to Rust (2020)

#41

Yeah no, "scientists", this wonderful general category that means nothing and everything, in general, are not turning to Rust. Programming is a niche. Rust is a, albeit amazing and gaining traction at a fast pace, niche in this niche. 99% of mathematicians, physicists and biologists I have worked with have not even tried programming yet. And if they do, they will start with the stuff their friends are already using:…

Agree that "Scientist" means nothing. I assume that they're basically saying "people who used Python already to solve some sort of problem, but are not programmers".

Which is a very small part of the overall "scientist" world I think, who are probably not programming, or who may use matlab or python.

Re: Why scientists are turning to Rust (2020)

#42
I worked as a Research Software Engineer, and while I saw the topic come up as a 'that's cool', I never met anyone using it. People writing HPC code are still overwhelmingly using C++ or Fortran, and everyone else is using Python or R. I didn't even come across more than about 2 people in my institution using Julia, despite the hype that it gets.

Re: Why scientists are turning to Rust (2020)

#43
post #29

Python and R are the two go to modern programming languages for number crunching. Fortran still has a lot of sway. C has a little. Rust is totally irrelevent in this context.

For everything high-performance in some scientific areas (like bioinformatics in the article), all the heavy number crunching isn't done by Python or R, but by underlying C/C++ libraries. And from having seen some of those libraries, my impression is that many are riddled with memory problems (even more so than other C/C++ code due to the FFI boundary to the wrapping language) and could benefit from being written in Rust.

Re: Why scientists are turning to Rust (2020)

#44

Yeah no, "scientists", this wonderful general category that means nothing and everything, in general, are not turning to Rust. Programming is a niche. Rust is a, albeit amazing and gaining traction at a fast pace, niche in this niche. 99% of mathematicians, physicists and biologists I have worked with have not even tried programming yet. And if they do, they will start with the stuff their friends are already using:…

Agree that "Scientist" means nothing. I assume that they're basically saying "people who used Python already to solve some sort of problem, but are not programmers". Which is a very small part of the overall "scientist" world I think, who are probably not programming, or who may use matlab or python.

I would expect that new graduates in more or less any numerate subject do some programming these days.

I just looked, we (a major UK university) as well as having a Computer Science department to teach programming to obviously Computer Science and Electronics students as well as related disciplines such as Mathematics, other departments have their own staff teach programming for Physicists, Chemists, Psychologists, Geographers, and a bunch of social scientists who need Statistics. I just asked the API for courses about "programming" and then checked they didn't mean some other type of programming. So if say Law has a course named like "Coding in Javascript" for some reason I wouldn't have seen it.

The most obvious numerate discipline I thought of which doesn't teach programming was Medicine, and I guess they just couldn't find time to add yet another entire discipline's knowledge into the timetable.

Re: Why scientists are turning to Rust (2020)

#45

  >But for many Rustaceans, the human element is equally compelling. Hauck, a member of the LGBT+ community, says that Rust users have gone out of their way to make her feel welcome.
Because, when interacting with a programming language community, it's so vitally important to know that they accept what you choose to do with your genitals, in your spare time.

Re: Why scientists are turning to Rust (2020)

#46

Earlier quoted context omitted.

Python sort of suffers from a lack of reliable fast companions. Here's a rough look of the field: - Things like Cython... let's just say experience is mixed. IME it is very hard to reason with its performance, and quickly it gets about-as-complex as writing your tight loop in a "natively fast" language. - C++ is the standard Python companion, and frankly it can integrate amazingly well. You can define types in C++, n…

I do not have any experience with C++ and thus none about its python interop, which makes it hard for me to compare it to nim's python interop which I do have some experience with. Given that, I'm curious what bits of C++/python interop are easier. I'm mostly asking because my experience of nim-python interop consisted of: Compile nim module with nimpy imported. Put compiled nim module somewhere where your python can…

Well, I certainly wouldn't call C++/Python interop easy. It is, IMO, verbose, arcane and complex. BUT, once it works, you have truly seamless integration of Python and C++ code. It feels as magical as, say, two languages interacting on JVM or .NET (not that I used either). Or different languages talking through a REST API.

In C++, you'd write your C++ code as if you don't care about Python. Then, you add the "glue" code, which tells C++ how to convert objects to and from Python (there's more options than that but let's leave it here). That, plus a lot of boilerplate. Then, in effect, you can pass objects back and forth between Python and C++, create objects in C++, return them to Python, pass them back to more C++ functions, and so on.

I haven't used Nim+Python; but looking at Nimpy documentation, it looks like, for example, to export a class from Nim to Python, it needs to inherit from a special underlying class. You can't just take a class and make it available in Python. And even then, can you pass that back to Nim to call a function with?

Maybe yes, and if so, that bumps Nim higher up my priority list.

Re: Why scientists are turning to Rust (2020)

#47

>But for many Rustaceans, the human element is equally compelling. Hauck, a member of the LGBT+ community, says that Rust users have gone out of their way to make her feel welcome. Because, when interacting with a programming language community, it's so vitally important to know that they accept what you choose to do with your genitals, in your spare time.

I don't think most straight people are aware just how much of everyday life is peppered with aspects of their sexuality - holding hands, kissing their spouse or partner goodbye, even just referring to them in a gendered way. Growing up closeted, this is something I was acutely aware of every moment of every day.

A welcoming environment for LGBTQ+ people has nothing to do with their genitals, and everything to do with them being able to be genuine and open about themselves without consequence.

Re: Why scientists are turning to Rust (2020)

#48
post #10

This article describes pretty much exactly why I turned to Rust for my scientific computing - high speed, far easier to use than C or C++, less bug prone.

You can't run it on GPUs and IPUs/TPUs like C++ though? I like Rust but all the scientists I know work with C++/Python (PyTorch) nowadays due to that.

Rust has tch-rs - quite descent PyTorch binding. But I still switched to Python due to poor debugging experience in Rust (expression evaluation especially with traits is impossible).

Re: Why scientists are turning to Rust (2020)

#50
I remember many years ago people would start building a scientific ecosystem around Go, but where are all the scientists/engineers using Go now? Eventually people would also realize that Rust is just a bad language choice for building some things, like making games, scientific computing, etc. I expect all this effort to become abandoned. Not everyone wants to invest learning hard to explain memory management concepts and especially engineers are just not interested. For them programming is a tool, not something to be sucked in. I believe Nim on the other hand is a much more realistic choice, with a vibrant scientific community and many fast, high quality and easy to use libraries.
Post reply on HN