23 votes

What are your thoughts on the rust programming language?

Last semester, I took a grad class where I had a project to optimize across a very high dimensional space (many hundreds if not thousands).

I implemented the algorithm using numpy, and I suppose it was functional, but it took to long. My algorithm was never really able to converge to a good solution. I got maybe 2 orders of magnitude speedup by numba-ing the critical parts, but it still was awefully slow.

Some of my classmates used C. I know C, its just...it's dated. I knew that for what I wanted to do, I didn't want to gdb all the time and deal with allocating and deallocating memory manually, and remember whether it was const int * or int const *.

Rust seems to be catching on for systems programming. From what I have seen, I like how it is the language specification (and the compiler) that prevents you from doing something stupid, rather than just getting a seg fault and wonder what' going on.

Does anyone have experience with rust? What do you use it for? What do you like? Dislike? Did it replace use of another language or tool?

4 comments

  1. jgb
    Link
    I've written a few Rust programs. It's a good language with some really nice touches - its match and enum constructs are excellent. It is quite verbose though and while you fight the compiler less...

    I've written a few Rust programs. It's a good language with some really nice touches - its match and enum constructs are excellent. It is quite verbose though and while you fight the compiler less the more code you write, it's certainly more restrictive than pretty much any other language out there. That said, it's extremely satisfying to know that when your compilation is finished you're left with a binary that's both extremely performant and highly resilient.

    10 votes
  2. Octofox
    Link
    I used it a bit. Its a very well designed language and solves a lot of hard problems while remaining lightning fast. The issue I had with it is that its really hard, there are a lot of complex...

    I used it a bit. Its a very well designed language and solves a lot of hard problems while remaining lightning fast. The issue I had with it is that its really hard, there are a lot of complex rules you need to understand to use rust. Once you spend the time to learn it you should be good but others have also pointed out that it takes longer to learn than most languages. Thats why Go is so popular, its still very fast while not being so hard to learn. Rust likely runs faster and has more safety features than go but many people are willing to make that trade off for faster learning.

    8 votes
  3. mrnd
    Link
    Biggest hurdle with learning Rust is internalizing the borrow checker, which is not really a part of any other common programming language. But after some time (I have heard week or two of active...

    Biggest hurdle with learning Rust is internalizing the borrow checker, which is not really a part of any other common programming language. But after some time (I have heard week or two of active use quoted on job context) of learning what the borrow checker wants, you mostly stop fighting the compiler and let it help you instead.

    How much you actually have to care about the borrow checker really depends on what you are doing though. If you don't need to write complex memory structures or can get away with cloning memory everywhere, it gets much easier much faster.

    Rust is still fairly verbose language, and using it for quick hacks is probably not actually worth it (I do it anyway though, because I like the language).

    6 votes
  4. tan
    Link
    I quite like this post by Bryan Cantrill of DTrace fame, because it talks about a lot of aspects of rust that aren't just the borrow checker, which you'll definitely have heard about if you've...

    I quite like this post by Bryan Cantrill of DTrace fame, because it talks about a lot of aspects of rust that aren't just the borrow checker, which you'll definitely have heard about if you've done some reading about learning Rust. Obviously at the end he concludes that Rust is great, and you should learn it, but he also talks about some problems you may run into and things to avoid.

    5 votes