Live data from Hacker News

Ask HN: Will Rust ever become a mainstream systems programming language?

news.ycombinator.com

181–190 of 291 posts

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#181

Earlier quoted context omitted.

Are there any AAA game studios using or evaluating Rust yet? I saw some GDC talks about the multithreaded game engine for Bungie's Destiny game. Given the debugging and QA challenges of their multithreaded architecture, something like Rust's ownership model seems like a good fit. Does the Rust toolchain support Xbox and PlayStation? * Destiny's Multithreaded Rendering Architecture: https://www.youtube.com/watch?v=0nT…

DICE is using it internally. The only reason why they aren't using it in games is because Rust won't compile on console platforms.

Oh? I hadn't heard of this before! I wonder if we can fix that...

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#182

Earlier quoted context omitted.

Using exceptions would be unprofessional. If someone were to use exceptions, then all of my carefully crafted error-handling routines would go up in flames because someone's library decided not to use an algebraic data type for conveying error messages across boundaries. It's bad enough that C libraries can suffer catastrophic failures bringing the entire stack down. I want a consistent error-handling strategy, and p…

> Using exceptions would be unprofessional. Unless it happens to be the best tools for the particular scenario... > then all of my carefully crafted error-handling routines would go up in flames No just sandbox the code inside a try catch... > pattern matching is the best method of clearly displaying intents and possible downfalls. You are stating an opinions as a fact here.

> No just sandbox the code inside a try catch...

This works fine if it's just a matter of rolling back a database transaction or releasing file handles (b/c someone else is doing all the work for you). But if you have more complicated invariants, your try catch has to handle restoring those invariants, no matter what path your code took.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#183
post #148

Earlier quoted context omitted.

It's not really hard. It's incredibly easy, from my perspective. It only took me about a week to get a hang of it -- about the same amount of time that it took me to get the hang of Go. Yet the difficulty curve progressively becomes easier and easier until it's much easier to write and maintain software in Rust than Go or even Python. Now I can regularly slap out solutions to challenging problems that would be much h…

Rust has benefits for writing and maintaining correct code, sure. But your claim here is absolutely absurd. Rust is quite difficult to learn- anecdotally, empirically, and by nature. Being dishonest about Rust is not going to help anyone no matter how good it is.

It's entirely dishonest and ignorant to simply discredit and dismiss someone's point of view because you have it set in your mind to not believe a point of view that isn't your own. My history with Rust is proof alone that there is more to the story than you claim. I'm not the only one that has no difficulty with Rust either.

It is all a matter of mindset, and so if you think it is hard, then it will be hard. However, you must remember that like many things in life, learning is like a Chinese finger trap. The more you struggle and resist, the harder it seems. Rust is a Chinese finger trap. Until you change your point of view and use a different, simpler approach, you will have hard time.

http://mmstick.tk/posts/id/292

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#184

Earlier quoted context omitted.

DICE is using it internally. The only reason why they aren't using it in games is because Rust won't compile on console platforms.

Oh? I hadn't heard of this before! I wonder if we can fix that...

I recall some DICE slides about two years ago and a mentioning from a DICE employee that they are building some of their game dev tools in Rust. Naturally, EA would never approve of allowing DICE to develop a game in Rust if it meant it would make the game PC-exclusive.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#185
post #146

Earlier quoted context omitted.

Despite all the flashy tools that proponents of C and C++ claim that makes C++ as safe as Rust, it's not doing any good at stopping the exponentially-increasing amount of vulnerabilities and crashes that are being reported over the last few years.

You have no data at all to back this up. The vulnerabilities you speak of are, far more often than not, written in old-style C and C++. That doesn't make Rust a bad idea, but it does mean your claim is completely unsubstantiated. Advocating for Rust by lying is not going to help anyone.

This is the same line of logic and statements repeated by C and C++ programmers that shortly thereafter get showed up with a list of CVEs in their 'modern C/C++' projects. Remember the recent Curl developer PR disaster?

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#186
post #146

Earlier quoted context omitted.

Despite all the flashy tools that proponents of C and C++ claim that makes C++ as safe as Rust, it's not doing any good at stopping the exponentially-increasing amount of vulnerabilities and crashes that are being reported over the last few years.

You have no data at all to back this up. The vulnerabilities you speak of are, far more often than not, written in old-style C and C++. That doesn't make Rust a bad idea, but it does mean your claim is completely unsubstantiated. Advocating for Rust by lying is not going to help anyone.

[deleted]

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#187
post #146

Earlier quoted context omitted.

You have no data at all to back this up. The vulnerabilities you speak of are, far more often than not, written in old-style C and C++. That doesn't make Rust a bad idea, but it does mean your claim is completely unsubstantiated. Advocating for Rust by lying is not going to help anyone.

This is the same line of logic and statements repeated by C and C++ programmers that shortly thereafter get showed up with a list of CVEs in their 'modern C/C++' projects. Remember the recent Curl developer PR disaster?

I think it's too early to tell if rust will prove any better in the real world, which includes things like devs using unsafe sections to cope with time pressures.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#188
post #148

Earlier quoted context omitted.

Rust has benefits for writing and maintaining correct code, sure. But your claim here is absolutely absurd. Rust is quite difficult to learn- anecdotally, empirically, and by nature. Being dishonest about Rust is not going to help anyone no matter how good it is.

It's entirely dishonest and ignorant to simply discredit and dismiss someone's point of view because you have it set in your mind to not believe a point of view that isn't your own. My history with Rust is proof alone that there is more to the story than you claim. I'm not the only one that has no difficulty with Rust either. It is all a matter of mindset, and so if you think it is hard, then it will be hard. However…

Your posts in this thread are good examples of how the "Rust Evangelism Task Force" meme started: it's great that you're enthusiastic about Rust, but you're not tempering your enthusiasm with pragmatism nor with empathy for your audience, like, for instance, the core team does.

Pushing back on the Rust-is-hard "misconception" where it is wrong is good, but calling the language universally easy just because you happened to learn it quickly... is wild: it incorporates ideas from a lot of different languages, so many people will be encountering more than one completely new concept. It can often take a while to "click" onto a new concept, because one isn't used to framing problems in the way that makes the concept simple. For one, saying Rust is easy so stridently, without nuance, makes people who are struggling feel stupid and demeaned (yes, I'm sure you don't mean it that way, but that's how it comes across), and makes you personally sound rather arrogant (/r/iamverysmart material).

In any case, with such ardent advocacy and combativeness, your technical arguments need to be 100% perfect: people will remember reading wild assertions they know to be wrong ("some Rust guy was talking about how ..., it wasn't even close to correct") more than they remember normal discussion about Rust. And this applies to both the people directly commenting, and the orders of magnitude more who are just reading the threads.

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#189

Earlier quoted context omitted.

You're being so rude and inflammatory, for no reason. What's so frustrating is how you're convinced that everyone else is an idiot. > it's incredibly disingenuous to act like it's a major issue I gave you a trove of real world examples of serious security issues in widely used software developed by competent teams. Quite a few of these would have not existed in a language with the kind of guarantees that Rust provide…

> I gave you a trove of real world examples of serious security issues in widely used software developed by competent teams. Quite a few of these would have not existed in a language with the kind of guarantees that Rust provides. How is this disingenuous? Genuine question : do we know that those bugs would have been avoided using rust? Maybe some of those part would have had to be done unsafe mode for some reasons.…

> Genuine question : do we know that those bugs would have been avoided using rust? Maybe some of those part would have had to be done unsafe mode for some reasons.

AFAIK no one's done a comprehensive survey, and it'd be hard to know for certain what someone would choose to use unsafe for until/unless they actually rewrite the code in question into Rust.

But if you look at code that is written in Rust today, I think you'll find less than 1% of the code is unsafe. [1] I think it's used for

* FFI / interfacing with C (common now, but less so the more you rewrite into Rust),

* low-level code (such as synchronization primitives and data structures), and

* a few bits of performance-sensitive code.

My gut feeling is that many of these bugs are in safe code, the "boring" 99%. The bugs would either be prevented by the compiler or turned into a panic at runtime instead of undefined behavior.

When people use unsafe, I'd like to think having to explicitly flag it as such would make authors and reviewers more careful. But certainly there's no 100% guarantee; I've seen broken unsafe Rust code in the wild already. As a small example, sqlite3::core::ResultRow::column_slice [2] is unsound; a following call to another column_* method would invalidate the returned pointer, [3] but as they all take a &self nothing prevents you from using the pointer after it's no longer valid. column_slice should take a &mut self instead. I haven't reported the bug because this buggy crate has been marked obsolete in favor of rusqlite.

[1] For a project of mine, it's found on 0.3% of non-comment-non-blank lines (23 unsafes / 7,390 lines). 13 of those were for FFI; the remaining 10 were due to my unfortunate obsession with optimizing for CPU. If anyone's done an accounting of more/larger projects, I'd be curious to hear it.

[2] http://www.madmode.com/rust-sqlite3/sqlite3/core/struct.Resu...

[3] https://www.sqlite.org/capi3ref.html#sqlite3_column_blob

Re: Ask HN: Will Rust ever become a mainstream systems programming language?

#190

Earlier quoted context omitted.

>> The error handling is too weird. >What would you rather see? Exceptions

We would lose lots of users from C and C++ if we mandated exceptions for error handling. The code size and complexity of unwinding is too much of a price for many to pay.

Rust is already paying the cost of unwinding. RFC 1236 added unwinding machinery for catching panics.[1] ("A drawback of this RFC is that it can water down Rust's error handling story.") This is the expensive part of exception handling. Rust has exceptions, but they're not very good.

Go also backed into adding most of the machinery for exceptions by adding catch with unwind for panics. If you're going to have the unwinding machinery, why not have real exceptions?

Exceptions aren't so bad if you do them the way Python does, using a predefined exception hierarchy. Catching an exception catches everything in its subtree. Catching RuntimeError catches most of the things one can induce from outside the program. Python's WITH statement also has one of the few mechanisms which can gracefully handle an error on releasing a resource. Exceptions in C++, Java, and Javascript are more troublesome.

[1] https://github.com/rust-lang/rfcs/blob/master/text/1236-stab...

Post reply on HN