Live data from Hacker News

Announcing Rust 1.12.1

blog.rust-lang.org

1–10 of 30 posts

Re: Announcing Rust 1.12.1

#2
I have Travis builds against nightly, beta and stable on Linux and Mac. I have to say, with the exception of OpenSSL breaking on Mac recently (fixed with OpenSSL 0.8), I haven't had a compiler failure or bug introduced in any of my tests in the time since 1.0 (at least I can't remember one).

Even these, which obviously effected others, didn't effect my code. Cudos to the Rust team for being on top of this!

Re: Announcing Rust 1.12.1

#3
Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

Re: Announcing Rust 1.12.1

#4
post #3

Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generics, and a decent macro system. A modern language should also be memory safe, and Rust opts to ensure memory safety at compile time with the borrow checker (as opposed to runtime with a garbage collector like in most languages). As for tooling, it also has a proper package manager, which believe me, is incredible compared to handling dependencies in C++.

So why would you choose Rust? If you need to use C++, because you need performance, or low-level access to memory, or any other reason, then you should choose Rust instead, because it's better for all the reasons listed above. The biggest strike against Rust compared to C++ is library support--people have been writing C++ and C libraries for decades, and Rust is a new language, so it won't have the same level of support.

Re: Announcing Rust 1.12.1

#5
post #3

Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

Rust is a systems programming language that runs blazingly fast, prevents segfaults, and guarantees thread safety.

Featuring

  * zero-cost abstractions
  * move semantics
  * guaranteed memory safety
  * threads without data races
  * trait-based generics
  * pattern matching
  * type inference
  * minimal runtime
  * efficient C bindings
That is from the Rust front page. HTH.

Re: Announcing Rust 1.12.1

#6

I have Travis builds against nightly, beta and stable on Linux and Mac. I have to say, with the exception of OpenSSL breaking on Mac recently (fixed with OpenSSL 0.8), I haven't had a compiler failure or bug introduced in any of my tests in the time since 1.0 (at least I can't remember one). Even these, which obviously effected others, didn't effect my code. Cudos to the Rust team for being on top of this!

Not even on nightly? I know that we don't tend to mess with things unless they're behind unstable feature flags (which you presumably aren't using), but I'd be very pleasantly surprised if we managed to make nightly stable enough that you never happened to run into any compiler bugs. :)

Re: Announcing Rust 1.12.1

#7
post #6

I have Travis builds against nightly, beta and stable on Linux and Mac. I have to say, with the exception of OpenSSL breaking on Mac recently (fixed with OpenSSL 0.8), I haven't had a compiler failure or bug introduced in any of my tests in the time since 1.0 (at least I can't remember one). Even these, which obviously effected others, didn't effect my code. Cudos to the Rust team for being on top of this!

Not even on nightly? I know that we don't tend to mess with things unless they're behind unstable feature flags (which you presumably aren't using), but I'd be very pleasantly surprised if we managed to make nightly stable enough that you never happened to run into any compiler bugs. :)

So I have 20,292 lines of Rust with 85%ish code coverage in my project (by current count), and I can't recall a failure in nightly since I enabled it in Travis. Mind you, that only gets run when a commit happens, so it's entirely possible it could have failed and I've just been lucky. It looks like from git log, I committed the change to Travis to start nightly builds on

  Date:   Sat Aug 22 11:45:08 2015 -0700
So, take that for what it's worth :)

Re: Announcing Rust 1.12.1

#8
post #3

Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

I wrote a Donald Trump text to speech server in Rust. It's blazingly fast. If I'd written it in Python, it'd have taken seconds to generate audio. If I'd written it in C++, it'd likely have memleaked or segfaulted since I'm not skilled or patient enough to write safe C++.

Rust is pretty much the coolest thing ever in my opinion. It's easy and fun to write. Cargo is the best package manager ever, and makes importing library code a breeze. I've never had multithreaded code warn me when I don't lock it correctly. It's so awesome.

(wrt my Rust app, as soon as I load test and redesign the UI I'm going to share it on HN. It's pretty ridiculous and we have a lot of fun with it at work.)

Re: Announcing Rust 1.12.1

#9
post #3

Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

Rust is a replacement for C++. It is meant to be a modern, general-purpose systems language, where "systems" generally means anywhere you need to be close to the metal. This includes areas like embedded systems and high performance computing. Modern means it has features and tooling you expect from languages in 2016. For example, on a language level, Rust has type inference, sum types, pattern matching, proper generi…

While Rust is positioned firmly as an option in the same situations where C or C++ would be chosen, I'm personally of the opinion that it has a great potential of capturing use cases of higher-level languages as well, with the advent and work of Rust running on WebAssembly, it will become one of the first serious web client language alternatives to Javascript.

It's partly because of the memory safety features. There have been quite a few people I've noticed coming from languages like Ruby and Javascript and being successful. Whereas I think C and/or C++ might have been more challenging, again b/c of memory safety (GC's are a lovely thing to rely on, until they get in your way). The compiler offers a huge advantage here, because while it is true that it is much more restrictive than other languages, it also almost guarantees that your code is correct.

As an old C hack, with bad memories of C++, and a hater of the memory footprint of Java and the horribleness of the great GC pause; Rust has been a joy to learn and use. It's like bowling with the bumper rails up as an adult, and no one laughs at you (well, maybe they do, but you never throw a gutter ball!)

Re: Announcing Rust 1.12.1

#10
post #3

Honest question from a non C++ developer: what's the main point of Rust? What's the primary reason for choosing it over any other language? When would it be most appropriate to choose?

Compared to C++:

- A fantastic package manager for your dependencies

- Easy build system

- A nicer language

- Memory safe

- Just as fast

- A way stronger compiler that will prevent you from making mistakes that you can make in C/C++ very easily

All in all more then enough benefits to make it worthwhile to switch unless there is a very good reason not to.

Post reply on HN