Live data from Hacker News

Why scientists are turning to Rust (2020)

nature.com

21–30 of 55 posts

Re: Why scientists are turning to Rust (2020)

#21
post #16

Good question then: how is the "occasianal's programmer" experience compare between Rust and C++? I used to write games in C++ as a teenager, and using it daily was fine. Now I find, every time I try to write something in it, it's a massive pain, as I forget the myriad of tiny rules, the very specific ways to write types etc. And that's before I even think about dependency management. Is Rust substantially better at…

Rust users are very enthusiastic about Rust, because it fixes so much annoying shit you have to deal with in C/C++. It really brings back a lot of joy to programming. The borrow checker is an issue when you are a beginner and have to unlearn all the bad practices you were doing in C/C++.

I would say the borrow checker is an issue if you come from most other mainstream languages, because Rust's approach of trying to automate memory management without having a garbage collector is quite unique.

Also, as a person interested in Rust, but who hasn't yet found the time (and strength of mind) to really commit to learning it: the main difference between C++ and Rust is the cruft that C++ has accumulated over the decades, which Rust doesn't have because it's much younger. But seeing the pace of new features introduced into Rust, I'm a bit worried that some of the older features will soon be declared "non-best practice" and turn into C++-style cruft.

Re: Why scientists are turning to Rust (2020)

#22

Good question then: how is the "occasianal's programmer" experience compare between Rust and C++? I used to write games in C++ as a teenager, and using it daily was fine. Now I find, every time I try to write something in it, it's a massive pain, as I forget the myriad of tiny rules, the very specific ways to write types etc. And that's before I even think about dependency management. Is Rust substantially better at…

If you want to hack something fast without frustrations and don't need performance yet, and still use rust, there is a way: just declare your variable mutable, clone() a lot and return values.

Tbh most of the time the borrow checker was easy to use, and at the time (circa 2014) it was allegedly harder to use than it is now, according to a friend who still use it professionally.

Re: Why scientists are turning to Rust (2020)

#24
post #18

Good question then: how is the "occasianal's programmer" experience compare between Rust and C++? I used to write games in C++ as a teenager, and using it daily was fine. Now I find, every time I try to write something in it, it's a massive pain, as I forget the myriad of tiny rules, the very specific ways to write types etc. And that's before I even think about dependency management. Is Rust substantially better at…

> the Borrow Checker... does that affect "pedestrian" code Unfortunately, the reason why you hear complaints is because it does affect even normal code. Writing code in a setting where you have a strict type system is like writing a mathematical proof. You know that the thing you want to do is safe/correct/valid, but you have to find a way to write it formally, which is itself kind of a puzzle. Don't get me wrong, I…

> With Python or C++, most experienced programmers will be able to bang out just about anything.

I think the trade off you often get with Rust compared to C++ is that easy things get harder to do and harder things get easier to do correctly. This won't be true for every problem or person but I think it's a fine rule of thumb. Python is a lot more straightforward than either for most problems of any complexity but of course you don't get the same performance potential where you're not grafting it onto a different language.

Re: Why scientists are turning to Rust (2020)

#25

Good question then: how is the "occasianal's programmer" experience compare between Rust and C++? I used to write games in C++ as a teenager, and using it daily was fine. Now I find, every time I try to write something in it, it's a massive pain, as I forget the myriad of tiny rules, the very specific ways to write types etc. And that's before I even think about dependency management. Is Rust substantially better at…

> Is Rust substantially better at this? When I read frustrations about Rust, it seems to be mostly about the Borrow Checker... does that affect "pedestrian" code, like "take this 4-dimensional array and munge it with an arcane for-loop"? Or, here's a basic immutable class with some fields and some methods, make it available in Python? I think language complexity in general is not a problem; language consistency is. I…

> the article seems to be a puff piece; it takes one case and generalizes it.

Agreed. I write mostly in Rust, but I don't recommend it unless you have a hard problem. If you need C/C++ speed, and there's enough complicated state coordination that you need safe threading and allocation control, Rust is useful. For typical webcrap, use Go. That's the job for which Google created Go.

Re: Why scientists are turning to Rust (2020)

#26
post #7

Are they? I worked with bioinformaticians and now physicists and rust has never come up. > Köster, now at the University of Duisburg-Essen in Germany, was looking for a language that offered the “expressiveness” of Python but the speed of languages such as C and C++. In other words, “a high-performance language that is still, let’s say, ergonomic to use”, he explains. What he found was Rust. He must not have looked v…

Nim is very niche and doesn't have nearly the reach or possibilities that Rust does. In terms of expressiveness it's not all that different in practice.

Re: Why scientists are turning to Rust (2020)

#27
A couple of years ago when checking out Rust for scientific work I started looking for familiar ground, e.g. Jupyter notebook support. I was happy to find google/evcxr's Jupyter kernel [1] and started writing an early access book on Rust for data analysis [2].

I still check _Are we learning yet_ [3] to see their recommendation on the state of ML in Rust. It still lists "the ecosystem isn't very complete yet.", which is how I felt at the time!

[1] https://github.com/google/evcxr/tree/main/evcxr_jupyter

[2] https://datacrayon.com/shop/product/data-analysis-with-rust-...

[3] https://www.arewelearningyet.com

Re: Why scientists are turning to Rust (2020)

#28
post #7

Are they? I worked with bioinformaticians and now physicists and rust has never come up. > Köster, now at the University of Duisburg-Essen in Germany, was looking for a language that offered the “expressiveness” of Python but the speed of languages such as C and C++. In other words, “a high-performance language that is still, let’s say, ergonomic to use”, he explains. What he found was Rust. He must not have looked v…

Nim seems to have adopted a lot of the trappings of rust in the last few years. Sort of weird he didn't see Julia first, as it's explicitly aimed at this group.

Speaking as someone who has built things in python, rust and Julia,I have to say that while I love multiple dispatch and the possibilities the Julia ecosystem offers, I'm not surprised he went to Rust over Julia: it's not much slower to hack in (as in, change some code, try running things, see what breaks, fix) because cargo check will catch a lot of errors before actually running things and you can stub things with "todo!()", but it manages complexity much better (if you lean on the typesystem and your code compiles, it's usually almost done), integrates easier into other ecosystems (cbindgen, pyo3)and the finished product will start up faster

Re: Why scientists are turning to Rust (2020)

#30
post #26
post #7

Are they? I worked with bioinformaticians and now physicists and rust has never come up. > Köster, now at the University of Duisburg-Essen in Germany, was looking for a language that offered the “expressiveness” of Python but the speed of languages such as C and C++. In other words, “a high-performance language that is still, let’s say, ergonomic to use”, he explains. What he found was Rust. He must not have looked v…

Nim is very niche and doesn't have nearly the reach or possibilities that Rust does. In terms of expressiveness it's not all that different in practice.

You'd need to expand on possibilities because the only factor I could see where that's remotely true would be the current size of the ecosystem.
Post reply on HN