Live data from Hacker News

Why I love Rust

speakerdeck.com

131–140 of 159 posts

Re: Why I love Rust

#131

Earlier quoted context omitted.

Yes, this is a good point about AAA. The issue with interop is on the C++ side, unfortunately, not our side. Until C++ has a well-defined ABI, it's not really possible.

C++ has a well defined ABI on many important platforms. On GCC/LLVM based platforms it's standardised in specification documents. On Windows, I think the Visual C++ ABI is the de-facto standard. Regardless, there are only a handful of top C++ compilers. Interop with even one of them would be of tremendous value.

Yeah, I mean, the basics of interop might be possible, it will just never be as robust as it could be if C++ had features better designed to play with other languages.

(This of course also affects Rust as well; we don't have a defined ABI either.)

Re: Why I love Rust

#132

Earlier quoted context omitted.

I swear I've seen more than one person gripe about this. Mostly from a change of thinking but it seems recurring. Might hurt adoption. I'd have expected Rust proponents to have a link on-hand for this to a guide that teaches this stuff in a way to reduce the effect. To be clear, this is not a critique of the Rust team so much as an observation of a larger problem in PL adoption that might be affecting Rust. The trick…

> I'd have expected Rust proponents to have a link on-hand for this to > a guide that teaches this stuff in a way to reduce the effect. I mean, yeah, I can link you to several. But reading a bunch of rules isn't the same as programming with them for a long time. Even once you understand the rules, the compiler will still catch you. If humans could reliably program safely without the compiler being involved, well, Rus…

I'd actually like to have those links in case I take up Rust or someone I know trying it gripes about the problem. Good to have them stashed away.

I see what you mean, though, if it's just rules you have to memorize and apply in many situations. Might be potential for my proposal but I'll take your word for now.

"Anyway, like I said, I'm doing my best. More experience reports is the only way that I can do that, basically :)"

Makes sense.

Re: Why I love Rust

#133

Earlier quoted context omitted.

You've been in discussions on this forum where I slam both C and C++. I'm clearly against it unless I absolutely have to use it due to its issues. That's why your strawman is more amusing than most. My actual argument was that new tools are usually unstable in terms of features, implementation bugs, and (with compilers) performance. So, default recommendation for mission-critical apps are mature tools whose strengths…

Yes, 1.0 is stable and the language will not change in backwards incompatible ways. It's been that way for months (google "rust stability deliverable"). "All bugs fixed" rules out every language in existence except CompCert, so I don't think that's a very interesting metric.

Good to know on stability part. Far as bugs fixed, it's more on the lines of day-to-day use of the language in common scenarios. Are people getting unnecessary troubles out of the compiler? Typically don't for most languages as they work out most of them in common idioms and library functions in first, few years. If they're serious rather than 1-3 people's hobby, that is.

I certainly won't expect it to be bug free. Nice comeback with CompCert, though. ;)

Re: Why I love Rust

#134

Earlier quoted context omitted.

> I'd have expected Rust proponents to have a link on-hand for this to > a guide that teaches this stuff in a way to reduce the effect. I mean, yeah, I can link you to several. But reading a bunch of rules isn't the same as programming with them for a long time. Even once you understand the rules, the compiler will still catch you. If humans could reliably program safely without the compiler being involved, well, Rus…

I'd actually like to have those links in case I take up Rust or someone I know trying it gripes about the problem. Good to have them stashed away. I see what you mean, though, if it's just rules you have to memorize and apply in many situations. Might be potential for my proposal but I'll take your word for now. "Anyway, like I said, I'm doing my best. More experience reports is the only way that I can do that, basic…

The official docs are https://doc.rust-lang.org/book/ownership.html and the following two sections. They explain the basics. I'm currently working on the next draft of the book, which will be more in-depth.

http://chrismorgan.info/blog/rust-ownership-the-hard-way.htm... and http://codrspace.com/buntine/aha-understanding-lifetimes-in-... are two blog posts that I can remember.

Re: Why I love Rust

#135

Earlier quoted context omitted.

Oh shit! That's one hell of an endorsement [in the making]. I bet the excitement and suspense are thick in the office, eh? Hope it works out for adoption reasons.

More details: https://www.reddit.com/r/programming/comments/3w8dgn/announc...

I appreciate that. It has some good details. Gotta leave to get some work done but I'll take the time to drop you a compliment related to this:

"Edit: also worth adding that he Rust core team has been amazingly friendly and helpful. We've had several meetings with them where they came to our office and basically said "how's it going? what do you need? open up your laptop and show us your biggest problem." The project is under very good management."

When Rust was being developed, the two languages that got me most excited as next-gen, systems tech were Julia mainly and Nim somewhat. They had a great choice of features balancing all sorts of attributes as PL's that might get easy adoption as C++ alternatives. Thing is, many blog posts reported their communities and dev teams were downright vicious on everything from questions to compiler bugs (wtf!?). That made it a no-go as there's an upper-bound on how good those projects can get building on such a creaky, hostile foundation.

That leaves Rust as my default recommendation for new, non-critical projects in this space. Like Dropbox employee, what I've noticed is the two of you on Rust teams here are unusually helpful and respectful compared to many in PL communities defending their work. Even pcwalton when he's clearly less than happy with my comments. ;)

The combination of brilliant design and seemingly (from my little exposure) excellent community is why I promote Rust. So, keep up the great work all of you! :)

Re: Why I love Rust

#136

Earlier quoted context omitted.

More details: https://www.reddit.com/r/programming/comments/3w8dgn/announc...

I appreciate that. It has some good details. Gotta leave to get some work done but I'll take the time to drop you a compliment related to this: "Edit: also worth adding that he Rust core team has been amazingly friendly and helpful. We've had several meetings with them where they came to our office and basically said "how's it going? what do you need? open up your laptop and show us your biggest problem." The project…

Thanks so much. :)

Re: Why I love Rust

#137

Earlier quoted context omitted.

It's not clear to me that it's impossible. The ABI isn't a huge issue; templates are, though. I can see a potential path forward by using clang heavily, but it requires a lot of thought. Isn't Swift looking heavily into C++ interop? It might make sense to collaborate with them to get it to work in both languages.

Swift is implemented in C++, and uses LLVM stuff that we don't because it's not exposed in the C ABI, last I heard.

Well, sure, but how the compiler calls into libclang/LLVM isn't the difficult issue here. The more interesting issue is how, conceptually, the Swift or Rust compiler would use libclang to interoperate with C++ in a foreign environment. Once that's established, writing C bindings to whatever part of libclang is necessary should be straightforward.

Re: Why I love Rust

#138

Earlier quoted context omitted.

Yes, this is a good point about AAA. The issue with interop is on the C++ side, unfortunately, not our side. Until C++ has a well-defined ABI, it's not really possible.

C++ has a well defined ABI on many important platforms. On GCC/LLVM based platforms it's standardised in specification documents. On Windows, I think the Visual C++ ABI is the de-facto standard. Regardless, there are only a handful of top C++ compilers. Interop with even one of them would be of tremendous value.

I totally agree. As I mentioned in a sibling comment, maybe the right solution is for Swift and Rust to solve the problem together by using libclang in the same way.

To be concrete, I could envision some sort of bolt-on "inline C++" feature that libclang would expose to all LLVM-based languages. It wouldn't have to be principled interop any more than Objective-C++ is principled interop. It'd just need to get the job done.

Re: Why I love Rust

#139

Earlier quoted context omitted.

This is good advice. I am totally confused by the Rust vs Go debate. They occupy such different spaces.

Because we have weird memories we all still remember Go claiming to be a systems programming language, which everyone took to mean "programming language you would use when you need to talk to metal" but which A) Go isn't suited for B)Rob Pike decided meant "programming language you would use to when you need to write a program" Rust sort of went public around the same time as Go which automatically "made it" a compet…

Yup. It turns out that Google internally uses C++ for developing web applications (or at least HTTP API endpoints), which nobody on the outside quite internalized. So Go is a perfectly reasonable C++ replacement from the point of view of Google, but doesn't hit the majority of use cases outside, and it feels rather more like a compiled competitor to Python/Ruby/etc. to most of us on the outside.

Also, until about a year before 1.0, Rust had heavy focus on lightweight concurrency (à la goroutines), a garbage collector built into the language (or at least plans for one, complete with syntax), a mandatory runtime to manage those things, etc. You had to give up on the standard library if you wanted to use Rust code as a shared library in non-Rust programs. That changed fairly rapidly, and the last bits of that (like runtime removal) only hit a few months before 1.0, so people's first impressions of Rust were much closer to that of Go.

They're very different languages today. It is technically true that for both of them they are better than C++ for some things people have traditionally used C++ for, but once you get beyond that they're not that similar.

Re: Why I love Rust

#140

Earlier quoted context omitted.

I think that Rust simplifies some things that you must do yourself in C++, and learning how to do them is valuable. At the very least, it will help you appreciate other languages, but it can also show you areas where you get manual control over performance in ways no other language offers. And, perhaps most significantly, there are a wealth of C++ libraries out there that have no equivalent in other languages, and be…

> I think that Rust simplifies some things that you must do yourself in C++, and learning how to do them is valuable. Given that you didn't answer the question, I think it's pretty clear at this point that you haven't used Rust. Rust is a low-level language with low-level control over memory and resources.

I certainly don't know Rust as well as C++. Some other fellows in this thread provided some features in C++ that you can't learn about in Rust, fyi.
Post reply on HN