Live data from Hacker News

Why scientists are turning to Rust

nature.com

71–80 of 105 posts

Re: Why scientists are turning to Rust

#71
post #54

Earlier quoted context omitted.

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.

A simple data structure:

  struct ASimpleDataStructure
    a
    b
  end
Convert a variable to a different type:

  x = 1
  x = Float64(x)
Open a file:

  open(“a_file.txt”)
Import foreign code:

  using PyCall
  so = pyimport(“scipy.optimize”)
  so.newton(x -> cos(x) - x, 1)

Re: Why scientists are turning to Rust

#72

Scientist are not turning to rust. Scientist, if they are turning, are turning to the scientific standard compute language and its plethora of platforms and libraries: Python. Rust is fine, but it will never catch up or replace Python. Python is just good enough at what it does and will only become better.

Yeah, I agree. All the scientists that I know who are using a programming language, are using Python because it’s easy enough to learn how to use and it’s powerful for their needs.

I really don’t see Rust being used for anything other than very specific cases.

Re: Why scientists are turning to Rust

#73

Earlier quoted context omitted.

I'm also highly sceptical. In my experience scientific software is mostly restricted to: C, C++, Fortran, Python, R, Matlab/Simulink, Mathematica, Julia, and Excel. I would think VERY few doing numerical computing or statistical or other engineering computations would have the bandwidth to really dive into Rust. I also wouldn't consider it stable enough for many projects (although I'm sure it's fine for some).

Rust is easier than C++ for this kind of work because of its packages. In some ways Rust is closer to Python for prototyping an idea to see if it works. Rust gets challenging when you have to deal with large systems, which is not a problem for research. Researchers / scientists will sometimes not even write functions. It's that small of a scope.

C++ still has a few desirable features re: value-parameterized templates and compile-time metaprogramming that currently lack an idiomatic Rust equivalent. In principle, you can replicate anything C++ can do via procedural macros, but it's not necessarily easy. Also proc macros are a nightly-only feature, so there's that.

Re: Why scientists are turning to Rust

#74

Earlier quoted context omitted.

Scientists are currently writing their code in C++ in many cases. If you have needs that require the performance benefits of C++, why not do it in a language that has a cohesive design (and is actually intuitive) instead of learning the pile of layers of decades-old debt that is C++?

I question if scientists ever should have to tackle the ins and outs of software architecture and performance optimization. Never mind the daunting task of running software. I don’t really see Rust being altogether different to someone outside the software industry. It’s yet another complex knowledge domain that can be abused and intractable like any other.

I suspect the lines are not as cleanly drawn as anyone would like them to be, no more making programming unnecessary for scientists than they make cooking unnecessary for .

Re: Why scientists are turning to Rust

#75
post #54

Earlier quoted context omitted.

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.

A simple data structure: struct ASimpleDataStructure a b end Convert a variable to a different type: x = 1 x = Float64(x) Open a file: open(“a_file.txt”) Import foreign code: using PyCall so = pyimport(“scipy.optimize”) so.newton(x -> cos(x) - x, 1)

Yeah defining a strict in python would be more lines.

Re: Why scientists are turning to Rust

#76

Earlier quoted context omitted.

Rust is easier than C++ for this kind of work because of its packages. In some ways Rust is closer to Python for prototyping an idea to see if it works. Rust gets challenging when you have to deal with large systems, which is not a problem for research. Researchers / scientists will sometimes not even write functions. It's that small of a scope.

C++ still has a few desirable features re: value-parameterized templates and compile-time metaprogramming that currently lack an idiomatic Rust equivalent. In principle, you can replicate anything C++ can do via procedural macros, but it's not necessarily easy. Also proc macros are a nightly-only feature, so there's that.

Proc macros are not a nightly only feature.

Re: Why scientists are turning to Rust

#77
post #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.

No, I positively hate Python as a language. I don't hate their community, though.

That said, TensorFlow was written by Google in the typical Google Java way. See that bit above where I shit on Google-supplied Java? This also applies to TensorFlow, even though its written in Python.

There is just something culturally wrong at Google, and I don't know why; Amazon and Microsoft and Netflix and whoever else have donated actually pretty decent code to the FOSS community, and none of it is even a fraction of the trainwreck that Google produces.

Re: Why scientists are turning to Rust

#78

I can't help but feel that given the requirements laid out in the article Nim would be a more suitable fit for their goals over Rust. I do think Nim really nails great performance with a very clean and straightforward syntax, certainly easier for someone who only works in Python to pick up over Rust.

Nim would be a nice option if the ecosystem were even half as developed as the Rust package ecosystem.

Kind of a chicken and egg scenario there really. A few early adopters will need to branch out and start using it to get that momentum building, which is probably a great opportunity for scientists who are looking for an alternative

Re: Why scientists are turning to Rust

#79
post #46
post #37

Earlier quoted context omitted.

Do these software collect dust and rust over time? ok sorry.. bad dad joke..

This just made me discover the Dust programming language[1]. [1]: https://bilalhusain.com/dust/

There is also DustJS [1]. It is much more popular.

1: https://github.com/linkedin/dustjs

Post reply on HN