Live data from Hacker News

A 30-minute Introduction to Rust

doc.rust-lang.org

21–30 of 94 posts

Re: A 30-minute Introduction to Rust

#21
I like this a lot, the right level to get an idea of what Rust is about.

The last example illustrates that concurrency is complex no matter what language you use - the code ends up reflecting the scaffolding enabling concurrency and the actual work ends up buried inside.

That said, I like what I see.

Re: A 30-minute Introduction to Rust

#22
post #20

Earlier quoted context omitted.

C++ is not safe in the same sense that Rust is. Without the use of "unsafe", Rust is designed to never segfault or have undefined behavior, ever. Even a modern subset of C++ cannot make the same guarantees (consider iterator invalidation, etc.)

I'll gladly use modern C++ techniques and a bit of care, even if that means only getting say 90% or 95% of the safety that Rust potentially offers offers, if it also means that I can get my code written today, and I can trust that it'll still compile unchanged tomorrow, next week, and probably a decade from now. I think it's great what Rust could potentially offer software developers. But it's still pretty theoretica…

if C++ doesn't terrify you, you're probably using it too much. C++ is the most complex programming language ever invented.

Re: A 30-minute Introduction to Rust

#23
post #16

How much cognitive overhead is it to think about ownership all the time once you get used to it ? Coming from a GC-languages background I had a hard time thinking in those terms last time I played with it. I ended up having .clone() littered all over the place :)

I don’t find that I need to think about it often at all. And very often I can get away with thinking about it less than I should, because if I make a mistake, the compiler will pull me up short. ☺

When writing libraries, you will typically need to think about ownership more frequently than when writing applications, but it’s normally not at all problematic.

Re: A 30-minute Introduction to Rust

#25
post #22
post #20

Earlier quoted context omitted.

I'll gladly use modern C++ techniques and a bit of care, even if that means only getting say 90% or 95% of the safety that Rust potentially offers offers, if it also means that I can get my code written today, and I can trust that it'll still compile unchanged tomorrow, next week, and probably a decade from now. I think it's great what Rust could potentially offer software developers. But it's still pretty theoretica…

if C++ doesn't terrify you, you're probably using it too much. C++ is the most complex programming language ever invented.

Yes, it's a big language, but the complexity is at least justifiable, and generally comprehensible.

C++ gives you immense power and a huge range of functionality to choose from, and some of the complexity arises from this. It has a very long history, which also contributes to the complexity. And it's first and foremost a pragmatic language, which of course brings in some complexity in order to deal with the inherent complexity of reality.

If something is seen as "complex" in C++, there's usually a good, or at least understandable, reason for this. You can usually find technical documents or discussion that justify why things are they way that they are, and the reasoning is usually quite sound. And in many cases, it's possible to safely ignore or just not use large portions of the complexity that C++ offers without facing any sort of a penalty or harm.

It's very different from the complexity that languages like JavaScript or PHP bring. The complexity there is usually unjustifiable, and often due to very rushed work, a lack of understanding and poor design, or a lack of care and consistency. They suffer from serious flaws and complexity that were not justified when introduced, and were subsequently not cleaned up or fixed once recognized. They suffer from harmful complexity, while C++ offers beneficial complexity.

Re: A 30-minute Introduction to Rust

#26
post #20

Earlier quoted context omitted.

C++ is not safe in the same sense that Rust is. Without the use of "unsafe", Rust is designed to never segfault or have undefined behavior, ever. Even a modern subset of C++ cannot make the same guarantees (consider iterator invalidation, etc.)

I'll gladly use modern C++ techniques and a bit of care, even if that means only getting say 90% or 95% of the safety that Rust potentially offers offers, if it also means that I can get my code written today, and I can trust that it'll still compile unchanged tomorrow, next week, and probably a decade from now. I think it's great what Rust could potentially offer software developers. But it's still pretty theoretica…

The language stability of Rust has already reached somewhere similar to Python 2.0: no core features would be removed, so some syntactic changes can occur before 1.0 but that wouldn't invalidate any effort to learn the language before 1.0. Would you say that Python 2.0 is not very useful because it is constantly changing and some features even get removed (albeit quite slowly)?

Re: A 30-minute Introduction to Rust

#27
post #24

Frankly, probably the best introduction to Rust is "Rust by example" [1] This is much more in depth + possibility of running code on site. I don't understand why rust site doesn't have links to this project. [1] http://rustbyexample.com/

http://doc.rust-lang.org/master/#external-documentation

Re: A 30-minute Introduction to Rust

#28
post #20

Earlier quoted context omitted.

C++ is not safe in the same sense that Rust is. Without the use of "unsafe", Rust is designed to never segfault or have undefined behavior, ever. Even a modern subset of C++ cannot make the same guarantees (consider iterator invalidation, etc.)

I'll gladly use modern C++ techniques and a bit of care, even if that means only getting say 90% or 95% of the safety that Rust potentially offers offers, if it also means that I can get my code written today, and I can trust that it'll still compile unchanged tomorrow, next week, and probably a decade from now. I think it's great what Rust could potentially offer software developers. But it's still pretty theoretica…

> and I can trust that it'll still compile unchanged tomorrow, next week, and probably a decade from now.

Given the practical history of C++ implementations, this may be rather optimistic... Though it does seem to be calming down a bit. Unfortunately, my first real work with C++ was with GCC2.96 (the phantom Redhat version of GCC); scarred me for life :)

Re: A 30-minute Introduction to Rust

#29
post #24

Frankly, probably the best introduction to Rust is "Rust by example" [1] This is much more in depth + possibility of running code on site. I don't understand why rust site doesn't have links to this project. [1] http://rustbyexample.com/

> This is much more in depth

This is Hacker News, so I'll explain it to you this way: this is specifically _not_ in depth. Have you ever done sales? The idea is that you need to figure out if your customer wants to buy as quickly as possible, and if they don't, move on. If they do, _then_ you move into the longform stuff. If your customer isn't going to buy, it wastes both you and their time.

The idea of this short introduction is to split you into one of two camps: "I want to know more about Rust," or "ewww." If you're in camp one, heading over to the tutorial or Rust by Example is great!

Re: A 30-minute Introduction to Rust

#30
post #14

I've only ever used GCed (and largely dynamic) languages up until now (Python, JS and Clojure primarily); C is alien and C++ is frankly terrifying. With all that, I've been having a ball using Rust to solve Project Euler problems, with astonishing speed compared to what I'm used to. It doesn't quite have all the libs you might want for general development yet, but for the things it's currently equipped for it's a lot…

I would looooove any insight that you have on making the docs better for people who haven't done systems programming before. If you've ever got the time to type out a few thoughts, my email is in my profile.
Post reply on HN