1. 24
  1.  

  2. 21

    This is an interesting article, but a number of the complaints about Rust are more about the language being new, rather than the language design. Of course Rust doesn’t have a ton of libraries, professional success stories, etc. yet, it won’t even hit 1.0 until this Friday! It’s frustrating to see someone discounting the language before it’s even really had a chance to do anything.

    Has Rust been around a while? Yes. In alpha, and then beta. A lot has changed as the language solidified its core concepts, and took in ideas from the community, and just generally added features and cleaned up cruft.

    Now, it may be that Rust never displaces C++. That’s fine. Seriously. Any individual project that chooses Rust over C++ for the writing of secure software is a win, not just the language, but for the users. I truly believe that Rust is a strong C++ competitor, and I question the performance claims made in that article, as they don’t jive at all with the performance analyses I’ve seen previously.

    There are good reasons not to use Rust, but many of them are because the language is new, and hasn’t had the time to build up adoption and add to its collection of libraries. When that happens, I do think that Rust can give C++ a run for its money, even if it doesn’t kill C++ entirely.

    1. [Comment removed by author]

      1. 3

        Indeed. Something being an industrial standard isn’t much of an argument for quality. It’s just a statement of adoption. It holds weight, yes, but not in the way it’s used here.

        1. 2

          Being an industrial standard does not indicate quality, but being an industrial standard with interoperable implementations by multiple independent compilers does indicate quality of the standard, at least its completeness and precision. Rust has no independent implementation, so completeness and precision of its specification is very much in doubt.

        2. 2

          Also, the trope is that the almighty enterprise values stability over everything. Nothing could be further from the truth. They value stability of their core systems, but are eager for new things in a controlled fashion.

          E.g. Ruby/Rails was actually adopted by some big players rather early on. RailsConf Europe 2007 (my first conf) was full of them. Just not in projects that couldn’t fail.

      2. 8

        Graydon’s reply makes sense to me, and it seems like something worth remembering before debating most tech topics.

        1. 5

          Graydon’s reply is well worth reading. His second point speaks to something I’ve really been noticing more and more in the last few years–a lot of technology writing tends to pose one technology against another as if the field is a zero sum game. There’s plenty of room for Rust to succeed without C++ (or Go or OCaml or whatever) dying. The world of systems programming languages is expanding and that’s great. Debate is important, but it’s all the richer for being grounded in pluralism, as Graydon points out. And, on certain rare occasions, it’s even effective to use the language of the zero sum game to make your point. But that particular tool gets dull with overuse.

          1. 4

            I left a comment with a similar sentiment on Reddit: http://www.reddit.com/r/rust/comments/35pn5a/criticizing_the_rust_language_and_why_cc_will/cr6mspj?context=3

            I’m hoping the number of upvotes means the community is with us on this one. It’s seemed like it so far, but any time there’s massive growth, building a culture is hard.

          2. 6

            This article reminds me of a feeling I had the other day. For a while I felt silly for sticking to C++ for most of my work, where people would constantly ask me “Why in C++?”. Like I am some silly silly person.

            But with the new C++11 and 14 standards, I feel my investment in the language has paid off. I show people modern C++ code and it doesn’t look much more verbose than say python. But much faster and types are a win.

            I am cheering for Rust though, only because it will bring more dynamic language people into systems programming where C++ might scare them off.

            Just like Rob Pike was surprised that Go really got popular with the dynamic language crowd where he expected people from C++ to jump all over it.

            1. 4

              I would be interested in a good sample of modern C++ if you have one on hand.

              1. 3

                I always found this article useful Elements of modern C++ Style by Herb Sutter

                If you are sick like me and like to do code reviews. You can check out my vector clock implementation written in C++11 style. I need someone to tell me it is bad and I should feel bad for writing it.

                1. 5
                  std::transform(std::begin(p), std::end(p), 
                                          std::inserter(r, r.end()),
                                          [](const vt& p) { return p.first;});
                  

                  I understand C++’s historic constraints, but I think “much more verbose than Python” is still entirely fair.

                  1. 3

                    Yes, C++ can be much much more verbose than Python, but that is because there are bad programmers like me using it wrong!

                    C++ is friendly to library writers, it provides tools for creating possibilities. I just happened to use the standard library here, I could have used Boost.Range, or dozens of other libraries here to do the same thing.

                    There are no real historic constrains here. Here is a less generic rewrite of python’s ‘map’ function, which I can tuck away and reuse.

                    template<class F, class C>
                    C map(F f, const C& c)
                    {
                        using namespace std;
                        C r;
                        transform(begin(c), end(c), inserter(r, end(r)), f);
                        return r;
                    }
                    

                    Where I can now do, given a vector

                    vector<int> m = {2, 4, 6};
                    

                    I can square all elements like so in C++

                    map([](auto v) { return x*x;}, m); 
                    

                    Which in python would be

                    map(lambda x : x * x, m)
                    

                    Which I think “Doesn’t look much verbose than python”.

                  2. 2

                    Nice, you program like me but with even more C++11 goodness.
                    Should get_keys and merge_keys be either in a more generic file or within vclock.hpp but within namespace clock?
                    Why are size_t& operator[](id_t i) and the const version so different? The const version does a find, REQUIRE_GREATER and CHECK whereas the non-const just dives straight in.
                    Also, what is a vector clock, I couldn’t tell from the comment on line 70. Is it something to do with your text editing/versioning/collaboration?

                    1. 2

                      Nice, you program like me but with even more C++11 goodness.

                      Thanks!

                      Should get_keys and merge_keys be either in a more generic file or within vclock.hpp but within namespace clock?

                      They can totally be put in a more generic place! or maybe within a “details” namespace if I feel greedy with the rest of the code and don’t want to share.

                      Why are size_t& operator[](id_t i) and the const version so different? The const version does a find, >REQUIRE_GREATER and CHECK whereas the non-const just dives straight in.

                      This is a great question and really deserves a comment in the code! Basically the const version, i expect the id to be there and the non const version i don’t.

                      Also, what is a vector clock, I couldn’t tell from the comment on line 70. Is it something to do with your text >editing/versioning/collaboration?

                      It is a tool for being able to partially order events in a distributed system. You can use this to determine if two events happened concurrently for example.

                      I updated the code based on your input and pushed it to github, thanks!

              2. 5

                There is a lot wrong with Rust, but this article is completely pointless.

                The first half of the article lacks any content in it, and the second part is more or less him showing his lack of understanding.

                It feels like it was written by some insecure person who really needed to justify to himself why he’s won’t spend time learning anything new.

                1. 6

                  There is a lot wrong with Rust

                  Like what, for example?

                  1. 3

                    Given the defensive/dismissive attitude I have received from some Rust proponents, I’m not really motivated to go deeper into this. If that part of my sentence offends you, I’m happy to delete it.

                    1. 4

                      No, it doesn’t offend me. I was just curious about what can be wrong or not in Rust. It’s an interesting new language in my opinion. But obviously it cannot be perfect. There is always some tradeoff somewhere.

                      I’m surprised about the “defensive/dismissive” attitude you report, because I saw some discussions about Go where people complained about the “defensive/dismissive” attitude of the Go community, and made a comparison with the Rust community which was more welcoming to critics according to them.

                      1. 2

                        Just look at the down-votes. I think that says everything.

                        Yes, sometimes tradeoffs are necessary, but sometimes things are just worse than they could be for no particular good reason at all.

                        Don’t take me wrong. I think what Rust does is immensely important, that’s why I care about it in the first place.

                        because I saw some discussions about Go where people complained about the “defensive/dismissive” attitude of the Go community

                        Yes, Go is certainly a lot worse, but on the other hand no one takes Go devs seriously in the first place, right? :-)

                        1. 2

                          I think what Rust does is immensely important, that’s why I care about it in the first place.

                          If you care about Rust, then it would be great to share your thoughts. It looks like Steve Klabnik is following this discussion and I’m sure he is ready to listen to any constructive comment :-)

                          Yes, Go is certainly a lot worse, but on the other hand no one takes Go devs seriously in the first place, right? :-)

                          Heh heh, I was expecting this one. For the record, my company uses Go in production and we’re happy with it. But I agree that discussions about generics and other PL theory topics have become a bit taboo in the Go community. This is probably because the core team is focusing now on the implementation and the tooling, instead of the language design.

                          May I ask what programming languages you use and for what kind of applications?

                      2. 4

                        I’m sorry that’s happened :/ we generally try to cultivate a culture that’s not such, but of course, there’s always some people no matter what you do…

                  2. 1

                    I can’t but remind you for one more time that the source of troubles is usually in humans, not technology

                    This is of course true, but I would argue that it’s an incomplete truth, because it glosses over the different ways that humans and technologies interact. I am not a good Java programmer, because Java-the-language does not afford me the tools that I am used to using in a language – but I know cracker-jack Java programmers with mental models that map more neatly onto a SIMULA system.

                    Computer software provides Donald Norman style affordances, just as do physical objects. Pretending this isn’t important is I think a problem with a lot of technical analysis.

                    1. -14

                      Finally a bloody article which reveals the truth to us all! Rust is just another Hipster-language which doesn’t bring enough on the table to really make people switch to it. No one will know this garbage-language in a few years. Mark my words!

                      And please, stop posting these horrible Rust-indulging articles on Lobsters. This is (used to be) a serious and interesting website.

                      1. 4

                        There’s a ‘Rust’ tag. You can filter them out from showing to you.