Thread: Let's talk about Rust!

  1. #106
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by kibwen View Post
    ...without anyone actually bothering to look at Rust at all, or understanding the problems that it's attempting to solve.
    You have mischaracterized the thread. Several posters have, in fact, explored Rust in a meaningful way, and don't see it as a meaningful improvement over existing languages. I agree with Soma here. You were both obviously "tipped off" to come to this thread, to shore up the failing arguments of the OP. I don't buy that you were just passing by, and happened to read a seven-page thread at random, only to wade in with your own "correction of misinformation." The point I made in my very first reply to this thread remains valid:

    Quote Originally Posted by Elkvis View Post
    The idea that this could replace a language that's been used to great success for more than 40 years seems a little far-fetched.
    The barrier to entry in the systems programming language market is just too impenetrable, due to the entrenched tools we already have.

    Just like generation-Y kids don't like to be advertised to, programmers generally don't like to be proselytized. We're (mostly) quite happy with the tools we have, despite, and in some cases, because of their idiosyncrasies.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  2. #107
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    No offense was intended - I don't mean to denigrate C++ or troll - I just got linked here from elsewhere and thought I'd try to clear up some confusion in the thread.
    O_o

    You have no need to hedge an apology or anything. I simply found the timing suspicious. If you are different people, you are different people.

    I can easily see multiple fans of Rust popping in after a post on the Rust "subreddit".

    As long as you and other "redditors" keep your defense of Rust confined I see no problems.

    [Edit]
    Of course, the linked thread isn't doing you any favors. Many of the posts do nothing other than speculate about the posters here dismissing Rust due to ignorance.
    [/Edit]

    [Edit]
    To be fair, many of the posters also clearly understand that the presentation was flawed, and that the onus is on Rust fans to present arguments.
    [/Edit]

    Soma
    Last edited by phantomotap; 06-18-2014 at 11:26 AM.
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  3. #108
    Registered User
    Join Date
    Jun 2014
    Posts
    3
    Quote Originally Posted by Elkvis View Post
    Several posters have, in fact, explored Rust in a meaningful way, and don't see it as a meaningful improvement over existing languages.
    You're correct, I apologize for painting with too broad of a stroke.

    Quote Originally Posted by Elkvis View Post
    You were both obviously "tipped off" to come to this thread, to shore up the failing arguments of the OP. I don't buy that you were just passing by, and happened to read a seven-page thread at random, only to wade in with your own "correction of misinformation."
    The discussion was linked from reddit. I came here in an attempt to fend off impending flamewars, since I believe that the internet met its argument quota in the early 90s. Obviously I was a bit too late to head off everyone, though.

    Quote Originally Posted by Elkvis View Post
    The barrier to entry in the systems programming language market is just too impenetrable, due to the entrenched tools we already have.
    Indeed, nobody should be delusional enough to think that Rust is going to "kill" C++ any more than C++ "killed" C. Every language has its strengths. And as a user of Rust, I can state with honesty that there are lots of things about Rust that I don't like. It would also be silly to presume that Rust is the language to end all languages. But let's also acknowledge that the concepts that underlie Rust, namely linear types and region analysis, are going to be big, big concepts in systems languages in the coming years (see also Microsoft's M# language). C++11 has already begun evolving in this direction with unique_ptr and move semantics (which allow you to approximate linear types), and I have hopes that this evolution will continue once Rust proves how useful region analysis is. But first Rust has to actually prove itself, which is something that we've yet to do.

  4. #109
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Oh man, we finally get some redditors over here. That's nice. I've heard a lot of mixed things about reddit. I hear, "never go to the politics sub-reddits" which makes a lot of sense.

    But that rust sub-reddit seems like it's full of well-balanced people. I like the one who posts about using the discussion here to help market Rust better. Very clever.

    And I really like the answers from the reddit people who seem to have migrated here. If Rust has security in mind then that's great and it's something C++ was not designed in mind with. Was there even internet when C++ was invented? Well, even if it was invented, I don't think it was popularized outside of very select sectors.

    Still, I highly doubt it'll ever replace C++ given that C++ is continuously being improved/worked on. If anything, C++ will just become less popular which I think it certainly has. Now it seems like the idea in industry is, "Lol write better code? Nah, we'll just buy/require faster hardware."

  5. #110
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Poor Neo1: linked to the Rust home page in the introductory post, but still gets the comment that "No one linked the home page"... unless "No one" was a typo for "Neo1"
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #111
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    And I really like the answers from the reddit people who seem to have migrated here.
    O_o

    As far as that goes, so do I.

    This kibwen seems to understand that the onus is on Rust fans to proselytize better.

    Soma
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  7. #112
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by kibwen View Post
    C++11 has already begun evolving in this direction with unique_ptr and move semantics (which allow you to approximate linear types), and I have hopes that this evolution will continue once Rust proves how useful region analysis is.
    unique_ptr, must be said, isn't new (pun aside). It evolved from old and well know patterns. You and I were managing unique and shared pointers in C++ with well established patterns long before Rust. unique_ptr and shared_ptr are simply answers the old problem of compile time checking. Rust must not feel the need to prove what we always knew.

    Instead Rust design goal is to support these C++ idiomatic patterns while enforcing their safety. Contrary to C or C++, whose design goals will never be to enforce code safety.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  8. #113
    Registered User
    Join Date
    Jun 2014
    Posts
    3
    Still, I highly doubt it'll ever replace C++ given that C++ is continuously being improved/worked on.
    I agree - I don't necessarily think an enormous number C++ programmers will move over. I suspect what we might see instead/first is that rust opens the door for non systems programmers to migrate to a more systems-y language.

    For myself, while I'm a semi-competent C programmer, it's fair to say that I spend a lot of my day-to-day time in managed languages. I'm unlikely to fully learn C++ because I don't have the time - my income largely derives from RDBMS expertise. I can't justify spending enough time to be genuinely good at C++, and to know all the ins and outs of such a large language. I know some argue that you only need to know a modern subset, but I tend to reject that as an option because I want to be able to reliably work on other people's stuff, even if it is an older/bad/whatever style. Again, I don't mean to disrespect C++ as a choice - I have a lot of respect for people that do master it!

    Rust struck me as a great option for the future simply because (a) it enforces memory safety, which given my background is highly advantageous, and (b) it's quite focussed, by virtue of being newer. Given my background in database systems, I'm particularly interested in languages that focus on safety while retaining performance.

    Thanks all for the conversation. It's been really interesting to see what areas Rust needs to work on in terms of delivering a clear message.


    edit:
    I hear, "never go to the politics sub-reddits" which makes a lot of sense.
    On average, subreddit quality is inversely proportional to size. A lot of the large subreddits are just pain-inducing to read. Some larger subreddits maintain quality with heavy moderation - AskScience: Got Questions? Get Answers. is a wonderful example.


    edit2: The other thing is that I'm very much a convert when it comes to RAII. My perception is that GC'd languages make your life really easy when it comes to memory, but help you very little with other closeable resources. Rust using RAII is a big win from my perspective when compared to the other languages I use.
    Last edited by AlisdairO; 06-18-2014 at 03:53 PM.

  9. #114
    Registered User
    Join Date
    Jun 2014
    Posts
    1
    Hey, yet another silly /r/rust-er here. I will keep my musings on Rust confined to this thread.

    I hope you guys don't get a bad taste in your mouth after this thread - we really are on the whole a very friendly and reasonably balanced community. It is perfectly understandable that you guys would be highly skeptical of another 'C++ killer', as I'm sure you have been burned many times before.

    I will leave it to Herb Sutter:

    C's big claim to fame and the reason Dennis Ritchie deserves the Turing Award was because he did something they said couldn't be done. He created a high level language that was portable, at high performance, leaving no room for a language lower than assembler. We can niggle about the C declaration syntax and other things that didn't work out so well, but it's really important to recognise that those are side experiments that were details in a much larger thing that he accomplished. Now, advance another decade. 1979 and early 1980s – Bjarne is working at Bell Labs on C++ and what he accomplished there was to take a systems programming language that was portable, with strong abstractive power especially with classes and templates. He proved that you could actually do a portable systems programming language with strong abstraction and strong typing. That was a major advance. I would love to see somebody tackle the challenge of demonstrating that you can create a portable systems language (meaning that it has performance equal to C, C++, Fortran) that is portable, type safe, and also memory safe. To add that on top of classes and templates and the portability of C, to add strong type safety (which requires a form of garbage collection) and not leave performance on the table – that would be something. That would be the first strong competition to C++ on its home turf.
    Herb Sutter: C++ Questions and Answers (2:37)

    C and C++ have great ideas, and Rust is taking the lessons learned from them (both good and bad). It won't be to everyone's taste, and it remains to be seen if the language will ever see widespread adoption, but I do think it has a fighting chance.

  10. #115
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by bjz View Post
    I will leave it to Herb Sutter:
    I would love to see somebody tackle the challenge of demonstrating that you can create a portable systems language (meaning that it has performance equal to C, C++, Fortran) that is portable, type safe, and also memory safe. To add that on top of classes and templates and the portability of C, to add strong type safety (which requires a form of garbage collection) and not leave performance on the table – that would be something. That would be the first strong competition to C++ on its home turf.
    Herb Sutter knows it. Unfortunately the problem of all attempts made so far is that that all fail the zero-overhead principle of languages like C and C++, which ends up affecting their comparative performance. Rust is no different. That said Rust may come up with a close enough solution for all but the most performance critical projects. Particularly as we keep pushing computing power, and with that we tend to reduce the impact feature overhead has on program performance.

    What we would really need, instead of new programming languages with smartly done compilers, would be new and better patterns. Particularly in the area of memory management. The biggest performance hitter has always been the various types of GC and ARC attempted by these languages. And this will always be the problem as long as we insist on working on top of the existing patterns. But in all truth, I suspect the reason languages fail to achieve Herb Sutter dream is because we really are at the limit of our ability to progress in the current ISAs, hence why we cannot devise better memory management patterns for languages to be able to truly compete with C.

    It just seems the industry cannon that under the current architecture, a programming language truly has to abandon any pretensions of safety in order to achieve maximum possible performance.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #116
    Registered User
    Join Date
    Jun 2014
    Posts
    13
    I also got linked here from the Rust subreddit, and I don't understand the hostility. As I understand it, Rust offers something C/C++ can never offer:

    Absolute safety without sacrificing speed. That means no iterator invalidation, use after free, dangling pointers, etc. while at the same time compiling down to the same machine code.

    That means you would never have the heartbleed bug in the first place. For crypto/security code it's a huge win, if those libraries get written in Rust by domain experts after Rust reaches 1.0 I would even encourage C programmers to link against them.

    If Servo ever gets close to finished, I would encourage people to switch to the browser that uses Servo. Firefox and Chrome tend to crash, despite thousands of engineers trying to find every defect possible. But they still have bugs that cause them to crash or have vulnerabilities. This is why Mozilla decided to make a new language to enforce safety - because they couldn't do it in C++. Firefox is too complex to make it completely memory-safe. I have high hopes for Servo, but even higher hopes for Rust.

  12. #117
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    A lot of hostility is towards Rust replacing C/C++. That's never going to happen. The incentive just isn't there. There aren't enough improvements to justify the cost.
    Don't get me wrong. Rust sounds like a nice language, and it can probably live alongside C and C++ and find its own niche sector, and that's a good thing.
    Last edited by Elysia; 06-19-2014 at 11:49 AM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  13. #118
    Registered User
    Join Date
    Jun 2014
    Posts
    13
    I think it has the potential to replace C for libraries like OpenSSL because of added safety. At the same time it can replace C++ for performance-critical programs like browsers and media players where you're dealing with untrusted data. You really don't want someone's coding mistake to be able to enable someone to compromise your system. There is too much at stake to trust every programmer to do the right thing.

    At the same time, it's clear that most current C++ projects won't switch. You're not going to write your game in Rust. You don't have the SDKs for consoles or mature game engines. You can't talk with existing C++ software as easily. So unless it becomes one of the top 5 used languages, it's not useful for a lot of things. I concede that point, you're completely correct. It's not worth to switch for the benefits it offers now.

    I think the scope of the discussion should be reframed to "replacing C/C++ for what?" What do YOU think Rust can be used for given its emphasis on safety?

  14. #119
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by iopq View Post
    I think it has the potential to replace C for libraries like OpenSSL because of added safety. At the same time it can replace C++ for performance-critical programs like browsers and media players where you're dealing with untrusted data. You really don't want someone's coding mistake to be able to enable someone to compromise your system. There is too much at stake to trust every programmer to do the right thing.
    I wouldn't consider that "replacing" C or C++. That is some project switching over to another language because it offers them some benefits. But I agree with you - I'd rather not see something as critical as OpenSSL be written in C. C++ is much better in this regard, but if Rust is even better, then it might be a good idea to consider switching to Rust if it fits the requirements.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #120
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    It seems i've been peddling misinformation - the ref-counting smart_ptr equivalent has been removed from the Rust language.

    This kibwen seems to understand that the onus is on Rust fans to proselytize better.
    Screw it, i'll bite.

    If i initially failed to argue _why_ some of the features of Rust are desirable that was only because i assumed most of the regulars here already saw eye-to-eye with me on these matters. This was a mistake.

    As this mistake became apparent i feel i did the best i could to argue the merits of a language with which i don't yet feel comfortable.

    I thought the first few posts from you and a few other members were needlessly dismissive and shallow replies to some casual opening remarks of mine. I mean, we hardly get a thread per week on the general discussion board nowadays, what a shame it would be if we actually got a discussion going, right?

    But hey, you got to spend a few pages arguing pointless pedantics and evading the fact that you are just as responsible for properly backing up your statements with sound arguments as i am. Not to mention spending the best part of a page telling us how you've seen it all a thousand times. According to you, a new language like Rust will not replace existing languages solely because other new languages have failed to do so, an obvious fallacy if there ever was one.

    Apparently Rust is developed on the foundations of C++.
    Polymorphism in Rust is inferior to polymorphism in JavaScript or Python.
    Rust is making the same mistakes as C++, albeit in a different flavour.

    You were asked to clarify on each of these statements, failed to do so, and then left the thread in protest of how i apparently did not provide sufficient arguments in favour of the statements i made. The hypocrisy is astounding.

    I utterly regret indulging you in this. I suppose i'm naive for thinking i have any amount of influence on where a thread like this goes, in reality it goes wherever those responding to it wants it to go. On CBoard this means anyone trying to drum up a thread either gets no replies at all, or will have to see that thread decay into mindless bickering over irrelevant details. The core group of users here have mostly reached a consensus about what is to be considered a valid point and what is to be considered "narrow" or "limited". I see this state of affairs as the main reason the board has grown so stale and uninteresting over the last few years. The reason there is no worthwhile content is because this place has become a reverberation chamber for those arguing the established 'truths' of the business. This is absolutely toxic, and frankly i no longer see any reason to remain an active member here. Bye.
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Do I talk too much?
    By GoodStuff in forum A Brief History of Cprogramming.com
    Replies: 11
    Last Post: 05-20-2003, 10:45 PM
  2. Who wants to talk on AIM?
    By Death Wish in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 07-05-2002, 06:29 AM