Live data from Hacker News

Why scientists are turning to Rust

nature.com

51–60 of 105 posts

Re: Why scientists are turning to Rust

#51

I work in an academic computer science/big data/ML research environment. Nobody is using Rust. They use Python or Java.

Yah, you're not going to need Rust, but some kinds of research could benefit and does use Rust. Eg, anything financial, where floating point is a no go, Python falls on its face. Anything physics like NASA type research can benefit from strict types. Robotics, and so on.. ymmv.

Rust shouldn't take away from Python or Java, but it may take away from research that uses Fortran, C, or C++.

Re: Why scientists are turning to Rust

#52
post #18

Earlier quoted context omitted.

It's considerably more difficult than Python, people just get misled by the similar syntax. The advanced features that you're mentioning aren't optional in Julia, especially if you care about performance.

Which part of Julia is difficult?

For me it was understanding the type unification rules. After a long time I read the original dissertation papers, and only that was the time when I finally understood what method is being called why at what point. While method dispatch is the most interesting part of Julia, it's the most complex as well.

Re: Why scientists are turning to Rust

#53

I work in an academic computer science/big data/ML research environment. Nobody is using Rust. They use Python or Java.

The computationalists I know are maintain large sets of fortran code. When they’re not doing that, they’re porting fortran codes to julia or python or writing new codes in julia or python.

Usually these types are writing Python libraries, porting them to C and C++, not writing direct Python.

Re: Why scientists are turning to Rust

#54
post #18

Earlier quoted context omitted.

It's considerably more difficult than Python, people just get misled by the similar syntax. The advanced features that you're mentioning aren't optional in Julia, especially if you care about performance.

Which part of Julia is difficult?

Compared to Python? Just about everything starting from simple things like how to create a simple data structure, how to convert a variable to a different type, how to understand any error message that you get, how to open a file or modify a visualisation and extending all the way up to overarching concepts like the typing system, importing foreign code and managing dependencies.

Re: Why scientists are turning to Rust

#55
post #8

You know why I like Rust as a programmer? It's community feels a lot like how the Perl community did at the height of Perl's popularity. This is in contrast to Python's (has a friendly community, but tends to have bikeshedding), Node's (outright toxic npm-based warfare), or Java's (corporations shit out awful code when they're done with it, ie, everything donated to Eclipse or Apache, or all the dumpster fire code Go…

I think you are wearing pink glasses for Python. The most talked about lib lately is TensorFlow, and its code is worse, than any Java code I've ever seen.

Re: Why scientists are turning to Rust

#56
Has someone attempted to write something like Numerical Recipes Textbook or the GSL Scientific Library using Rust a lot of people in my org use those two resources - especially the NR textbook all the time.

I've found a lot of people bash NR online as outdated but it has really clear explanation of how certain algorithms are written as well as clean to read code examples. Very helpful to follow along with an explanation of the algorithm and see it all laid out in front of you with code.

So maybe a modern version written in a newer language could be a hit.

Re: Why scientists are turning to Rust

#57

Earlier quoted context omitted.

Yes. And a lot of that software collects dust after the paper it produced is published :/ Academia needs to recognize and incentivize software (including maintenance) as a research output, and make funding available for more research software engineers.

Amen! More long-term staff scientist jobs of all stripes! One lesson I hope people take away from AlphaGo/AlphaFold (and a lot of the work coming out of the Allen Institutes, Broad, etc) is that some really amazing work can be done when big groups of experienced people can work together on a project.

Seriously! My lab does plant root growth modeling, which (like protein folding) is a 3D morphology prediction problem. Tweaking crops for even a small increase in carbon uptake and sequestration in soil (e.g., via deeper or longer roots) may be able to cut a sizeable chunk out of annual CO2 emissions[0], but almost nobody's working on it because it doesn't have direct applications to human healthcare.

[0]: http://www.nature.com/articles/nature17174

Re: Why scientists are turning to Rust

#58

I've been learning Rust and find it not hard to learn, I think because I already know C/C++ and understand the concepts of pointers, references, stack and heap allocations.

I can confirm. I started learning Rust as a second language right after Python and it was hard to make sense of anything. Why the hell some values have the Copy trait and others don't? Then I learned C and now I have good mental model of how memory is allocated and Rust feels okay. I just don't like that it hides away the complexity because when it does not work, you don't have the means to understand why, you just know did not follow the rules that you never remember anyways because they don't make sense to you. C has quirks too and the learning can also be steep, but it forces you to understand how things are working under the hood. Will continue to learn Rust but I have high hopes for the Zig language which seems more approachable with C in mind (rather than C++ which Rust is said to be a replacement for).

Re: Why scientists are turning to Rust

#59

Earlier quoted context omitted.

Excel is far too slow for large scale datasets.

Is that true? Python is pretty slow too. I can’t imagine many scientists would really mind leaving their work running overnight.

It's true. Fun and relevant fact: The job title data scientist was invented at LinkedIn when they saw data analysts that needed to know R or Python skills. These skills seemed different enough from the traditional Excel and SAS data analyst jobs at the time to warrant a new job title.

So did Excel not cut it, or was it a preference to use Python? Back then Excel supported up to 65,535 rows, and would typically crash with over 8,000 rows. I worked in that era in Excel. One model once was split across three spreadsheets. Only one spreadsheet could be open at a time, they would take 20 minutes each to load, and there was about a 50% chance they would crash while loading.

So what do you do if you need over 65,000 instances of labeled data? For a neural network it's nice to have a million instances, yes a million.

R and Python have in them what is called a dataframe. It's a spreadsheet, but in another programming language. We tend to load our data into those, which is just like Excel, but without the hardware limitations. So in many ways, today it's just like it once was, but we get to choose which programming language to use while working in a spreadsheet, and let's be fair, the Excel programming language isn't exactly great.

Re: Why scientists are turning to Rust

#60

I've started learning Julia lately, and it also has an appeal, especially for fortran-ish computations. (Yup, I said fortran ... it is still used in lots of scientific computations e.g. fluid-mechanical models.)

"used" as in "using existing libraries" or do you mean there are folks still writing fortran in 2020?

I have a collaborator who was writing Fortran this summer (and not even in physics!).

Oddly, it didn't seem like he was particularly locked in by a vast pile of legacy code; he just found it a good match for his mental model of the project.

Post reply on HN