Slashdot Mirror


Criticizing the Rust Language, and Why C/C++ Will Never Die

An anonymous reader sends an article taking a harsh look at Rust, the language created by Mozilla Research, and arguing that despite all the flaws of C and C++, the two older languages are likely to remain in heavy use for a long time to come. Here are a few of the arguments: "[W]hat actually makes Rust safe, by the way? To put it simple, this is a language with a built-in code analyzer and it's a pretty tough one: it can catch all the bugs typical of C++ and dealing not only with memory management, but multithreading as well. Pass a reference to an assignable object through a pipe to another thread and then try to use this reference yourself - the program just will refuse to compile. And that's really cool. But C++ too hasn't stood still during the last 30 years, and plenty of both static and dynamic analyzers supporting it have been released during this time."

Further, "Like many of new languages, Rust is walking the path of simplification. I can generally understand why it doesn't have a decent inheritance and exceptions, but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased. C++ doesn't restrict programmers regarding what they can or cannot use." And finally, "I can't but remind you for one more time that the source of troubles is usually in humans, not technology . If your C++ code is not good enough or Java code is painfully slow, it's not because the technology is bad - it's because you haven't learned how to use it right. That way, you won't be satisfied with Rust either, but just for some other reasons."

55 of 386 comments (clear)

  1. Pretty sure the heat death of the universe will by NotDrWho · · Score: 5, Funny

    No, I'm pretty sure the heat death of the universe will kill those languages

    --
    SJW's don't eliminate discrimination. They just expropriate it for themselves.
    1. Re:Pretty sure the heat death of the universe will by mark-t · · Score: 3, Insightful

      I predict that as heat-death approaches, time will slow down, and by the point of heat death, time will be at a complete standstill, much like approaching the event horizon of a black hole, so from its own frame of reference, the universe will actually seem to last forever.

    2. Re:Pretty sure the heat death of the universe will by goose-incarnated · · Score: 2

      Cobol is in attrition as far as most of the world is concerned. The starvation may take a while, but its occurring. Fortran is link compatible with C

      Are you sure? FooBar() and foobar() are different functions in C but the same function in Fortran, so calling foobar() from C in a fortran-compiled libfb.so is probably not going to have the effect you intended if both FooBar() and foobar() are present in libfb.so, if it is even possible at all (name-mangling might be happening).

      (My fortran may be a little ancient - do newer fortran compilers make a distinction between case?)

      and to many actively maintained simulations are based on it. Fortran will be around for at least as long as C is around. It will take generations of programmers to abandon C++ before that becomes a reality a honestly what takes over will likely be a certified subset of C++ that is considered safer and easier to work with.

      Nothing is going to take over from C; it's way too foundational :-(

      Whether you are writing C++, Fortran, Java, Python, Perl, Go, Rust, PHP, CLISP, guile, C#, ... hell even bash[1]... every single language out there is able to make use of a *.so library, but not all of them can generate one! When it comes to code reuse, C wins hands down. If you want your code/logic/algorithm to be reusable you write it in C.

      C++ code can only be called by other C++ code. Same with Java, Python, etc. C code, OTOH, can be called by every single thing living on your system so while your system may only slightly notice if the programs written in other languages go away, your system won't even boot if C code isn't around in the form of system libraries.

      Way too foundational to remove, which is a pity as it should have been superceded years ago with something better.

      [1] I wrote a small utility that loads and executes a specified function in a specified library with specified arguments. This lets my bash scripts execute anything in the C std. library and whatever other *.so files I have on my system. So from bash I can run sinf/cosf functions, make a few system calls, etc. It's very limited, can only return primitive data types to the caller and needs extensive specification on the command line, but it lets me do the occasional insane thing.

      --
      I'm a minority race. Save your vitriol for white people.
    3. Re:Pretty sure the heat death of the universe will by serviscope_minor · · Score: 4, Informative

      C++ code can only be called by other C++ code.

      My JNI plugin written in C++ disagrees with you. That's a .so compiled from C, called by Java. If you write functions in C++ as extern "C", then they are link compatible with C and therefore callable by anything.

      --
      SJW n. One who posts facts.
    4. Re:Pretty sure the heat death of the universe will by mirix · · Score: 2

      I'm pretty sure heat death was programmed in C.

      --
      Sent from my PDP-11
    5. Re:Pretty sure the heat death of the universe will by serviscope_minor · · Score: 4, Insightful

      What the fuck are you talking about? It doesn't compile C++ code as C, it compiles C++ functions with C linkage conventions. IOW it disables name mangling.

      That is all.

      Come to think of it, I think I've argued with you about C++ before. From what I recall you are both astonishingly ignorant and astonishingly angry. A quite entertaining combination if I may say so myself!

      --
      SJW n. One who posts facts.
    6. Re:Pretty sure the heat death of the universe will by buchner.johannes · · Score: 3, Informative

      I predict that as heat-death approaches, time will slow down, and by the point of heat death, time will be at a complete standstill, much like approaching the event horizon of a black hole, so from its own frame of reference, the universe will actually seem to last forever.

      Sounds like you don't understand time dilation. When you approach a black hole, time does not go at a different rate for you. It does however go at a different speed compared to an observer at a large distance (that's why time is *relative*). For them, all objects falling towards a black hole actually seem to pile up near the event horizon (but gravitational redshift and time dilation make the radiation gradually unobservable). For the person falling in, nothing changes, they just fall through.

      To summarize, time never slows down, it may only slow down in one place compared to another place. You did not specify two places so your statement does not make any sense.

      --
      NB: The message above might reflect my opinion right now, but not necessarily tomorrow or next year.
    7. Re:Pretty sure the heat death of the universe will by AndroSyn · · Score: 3, Insightful

      Just because a piece of software is old, doesn't mean it's suddenly doesn't do its intended function.

      I'm not sure I'd be shocked by the effort that people make to keep old software running,. You mention PDP emulators, but how many people here use DOSBox on a regular basis to play old games.

      Emulators are just one way do keep old software running of. The other way if the source is around is to keep updating the software for new platforms but avoiding too much feeping creaturism if you can. That's pretty much where I'm at with doing ircd work, keep the code updated for modern systems(with their own OS specific quirks) so it continues function.

      It seems like people just want new and shiny software just for the sake of having new and shiny. New and shiny code however doesn't have X number of years of being used as production and all of the WTF bugs have long been squashed.

      Meh.

    8. Re:Pretty sure the heat death of the universe will by radtea · · Score: 2

      Are you sure? FooBar() and foobar() are different functions in C but the same function in Fortran, so calling foobar() from C in a fortran-compiled libfb.so is probably not going to have the effect you intended if both FooBar() and foobar() are present in libfb.so, if it is even possible at all (name-mangling might be happening).

      I was writing Fortran/C multi-language applications twenty years ago, so yeah, despite a few issues this is easily possible. There was some weirdness, as I recall, because Fortran implicitly pushed the size of arrays onto the stack, so you had to do some fiddling to accommodate them. There were a few other minor issues, but what the GP said is essentially correct: Fortran is link-compatible with C. C++ mangles names, so unless functions are declared with C linkage (extern "C") all bets are off.

      Pretty much any language can be interfaced with any other using tools like swig (dunno if anyone still uses that--it's been almost 10 years since I wrote any multi-language code, thankfully).

      --
      Blasphemy is a human right. Blasphemophobia kills.
  2. An Old Story by evenmoreconfused · · Score: 3, Insightful

    "... but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased. C++ doesn't restrict programmers regarding what they can or cannot use."

    That's exactly what I said about C vs. 360/Assembler 25 or more years ago. And I still prefer to code in Assembler.

    --
    No. Well...maybe. Actually, yes. It really just depends.
    1. Re:An Old Story by evenmoreconfused · · Score: 4, Funny

      Sorry, I realize it's 35 years ago. You can blame it on senility.

      --
      No. Well...maybe. Actually, yes. It really just depends.
    2. Re:An Old Story by Dunbal · · Score: 4, Insightful

      And I still prefer to code in Assembler.

      There are all sorts of tools, many of them specialized and great for certain applications. But sometimes you just can't beat a sledgehammer. ASM, C, and to some extent C++ have a bad rep because of their lack of training wheels. But in the right hands they are the best and fastest solution to a problem. Plenty of people code, and plenty more people think they can code. Someone who knows what they are doing will not get into trouble in ASM, much less in C or C++. But there are lots of people who claim they know what they are doing when actually they know squat. They get "unintended results" when actually the language is doing exactly what they asked it to do - the problem exists in their understanding of how computers work. Yeah, maybe THOSE people should avoid these languages.

      --
      Seven puppies were harmed during the making of this post.
    3. Re:An Old Story by RailGunner · · Score: 2

      If I wasn't permanently blacklisted from getting mod points, I'd mod you up.

      Don't blame the tool, blame the user. A chainsaw is dangerous, but if I'm clearing brush or cutting tree limbs blown down by a storm, it's the best tool for that job. If I cut off my foot with it, is it the chainsaw's fault?

    4. Re:An Old Story by mr_mischief · · Score: 3, Insightful

      The best reason for avoiding assembly is that it's almost never the fastest way to get the programming done, and with a good C compiler it may not be the fastest way for the program to run, either. Assembly is great for bootstrapping a compiler or OS and inside tight loops. It can be handy if your hardware has an advanced feature not yet exposed through a library for a higher-level language. Not everything needs it, though.

      Even C or C++ is often not the fastest way to get a project done. Sometimes there's a pretty big runtime penalty for using something that enables faster development, though.

      There are lots of cases out there of Lua, Python, or some other language being used to wrap around a small core of C or C++ with maybe the most time-critical parts in assembly. Sometimes a higher-level language is the right tool for the situation, but sometimes not.

    5. Re:An Old Story by vux984 · · Score: 2

      But in the right hands they are the best and fastest solution to a problem.

      Sure. Provided the "right hands" acknowledges that they are not usually the the right solution to a problem chosen at random.

      Plenty of people code, and plenty more people think they can code. Someone who knows what they are doing will not get into trouble in ASM, much less in C or C++. But there are lots of people who claim they know what they are doing when actually they know squat.

      Sure those completely worthless people do exist and most developers do overestimate their own abilities.

      Q: Do you know how many really good ASM/ C / C++ devs are out there that you wouldn't dream of saying that they "don't know squat" that still produce and release code with subtle to obvious bugs in it?

      A: All of them.

      Yeah, maybe THOSE people should avoid these languages.

      Nobody is perfect. And nobody gets better at something by not doing it. You learn by doing.

      I agree some developers simply shouldn't be developers, and that others are way out of their proper depth. But no developers live up to your standards. Unintended things affect all of us; edge cases we didn't consider, api/library/hardware specs we didn't fully or correctly understand but thought we did, requirements we didn't fully or correctly understand but thought we did... that affects all of us.

    6. Re:An Old Story by phantomfive · · Score: 2

      Even C or C++ is often not the fastest way to get a project done........There are lots of cases out there of Lua, Python, or some other language being used

      In my experience, the availability of libraries is more important than language choice in getting the job done quickly.
      That is, if you had all the libraries you need, assembly would be faster than Perl/Python/Scheme without the libraries you need. Of course, there are not many libraries written in assembly.

      --
      "First they came for the slanderers and i said nothing."
    7. Re:An Old Story by saigon_from_europe · · Score: 2

      I've often wanted to have a language that wouldn't compile unless it met my [coding] standards...

      Hush! That's how we got Python!

      --
      No sig today.
    8. Re:An Old Story by goose-incarnated · · Score: 2, Insightful

      C++ doesn't restrict programmers regarding what they can or cannot use.

      C++ doesn't, but every reasonably large project has coding standards that do. I've often wanted to have a language that wouldn't compile unless it met my standards...

      Coding standards won't save you. How often have you come across something like this in other's code?

      QString qs;
      ...
      char *filename = qs.toStdString().c_str();

      (Might not even be QString getting abused here - might be something vendor provided).

      The problem with C++ is not the extra complexity thrown in by the standards committee to save a few keystrokes, it's the opacity of the source code. It requires the user of a library to know implementation details of that library, but the source code using that library will hide every single implementation detail that could fuck you up.

      The stl container libraries (for example vector) is used identically to hold complex classes (deep pointers) and to hold PoDs (say, int types). The source code, and all the code around the lines using the vector will look exactly the same, but alas - too many newbies get caught out when they try storing objects with deep pointers and no copy constructors. How can you tell the difference? You can't tell simply by looking at the lines using the vector. You have to look at the lines of code that define the class - very leaky abstraction indeed. So paper over it, tell students to use only references (or pointers) in containers and make sure that using an stl container is only done when you know how the elements you intend to store are implemented.

      C++ is filled with invisible gotchas, booby traps for the unwary and multiple poor choices for OO implementation (I blame the backwards compatibility with C for this). Before they add stuff to C++ they should have removed stuff from it; for example the default copy constructor provided by the compiler should make deep copies of objects and not bitwise copies. If that were to be done then no copy constructor would be needed. Another example, why not specify the order of file-scope object construction within multiple compilation units? How about this for a request: if you're going to insist on providing overloaded functions as an option please please please provide the ability to overload using return value - that makes the issue of which cast to use go away.

      A few more C++ requests: discard that outdated default promotion rules from C, make the minimum integer magnitude 'int' and do away with 'char'. The compiler is not catching errors in the line va_arg (ap, char) nor can overloading work correctly with both char and int. With decent overloading and a sane container design you don't need stdarg anyway - pass a container (caller can always use static initialisers if they want to).

      My greatest disappointment with C++ has to be the QT library. They went ahead and actually changed the language, but kept the most insane parts of it. Let's face it - if your dev environment reads in $FOO source files and spits out C++ source files to a C++ compiler, you may as well make your $FOO language something better than "C++ with extra #defines here and there" . What a missed opportunity by trolltech.

      --
      I'm a minority race. Save your vitriol for white people.
    9. Re:An Old Story by Darinbob · · Score: 3, Interesting

      Normally training wheels come off once you learn to ride that bike. But in many languages the training wheels are permanent.
      I do wish that more people who call themselves programmers or engineers actually understood how computers work. Then we wouldn't need faster computers every 5 years just to keep running the same programs at the same speed.

    10. Re:An Old Story by Ukab+the+Great · · Score: 2

      It was actually 31 years ago. And your octal's kinda rusty.

    11. Re:An Old Story by Anonymous+Brave+Guy · · Score: 2

      ASM, C, and to some extent C++ have a bad rep because of their lack of training wheels. But in the right hands they are the best and fastest solution to a problem. Plenty of people code, and plenty more people think they can code. Someone who knows what they are doing will not get into trouble in ASM, much less in C or C++.

      I contend that the entire history of computing disagrees with you and your hypothetical "person who knows what they are doing" does not exist. If you maintain otherwise, please name a large and widely used program written in any of the above languages that has never encountered the kinds of bug that more sophisticated type systems like Rust's prove can't exist.

      Seriously, this article is hosted on a site about a static analyser, whose purpose for existence is to try to identify errors in C and C++ code caused by exactly the kinds of failures you maintain that someone who knows what they are doing won't make. Such tools would be unnecessary if the language design did not admit the possibility of those types of errors in the first place, as is the case with many much safer languages being developed today. This whole piece is basically an attack ad, brought to you by the horse-and-cart drivers who are being made redundant with the invention of the internal combustion engine.

      And even if someone, somewhere in the world is smart enough to use a relatively primitive language like C or C++ and not make any mistakes of this kind, that person would surely be orders of magnitude more productive using a modern, expressive, safe language and modern, comprehensive, flexible libraries so they could focus on solving whatever real problem they were dealing with instead of getting bogged down with writing low-level mechanics and defensive programming manually.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    12. Re:An Old Story by Dutch+Gun · · Score: 2

      C++ isn't about productivity. It's really about performance. If your application isn't performance-critical, you probably don't have a good reason to be using C++. And actually, nowadays it's a lot easier to write much safer C++ than previously, especially with recent changes to the language. Overall, the language is a pretty good tradeoff between performance, productivity, and safety, with emphasis on the performance, of course. I'd imagine that's why game developers use C++ almost exclusively, at least for larger AAA games.

      On the other hand, game development tools are often written in languages such as C# (plus a mix of various other languages), because productivity is typically more important than performance for those types of applications (after all, you can just buy faster machines for your developers).

      So... why not write games / game engines in Rust, D, or some other arguably "better" language?

      Simple answer: inertia. Because there's an entire industry's worth of game developers who know C++ extensively (like myself). Our libraries and game engines are all in C++, and are battle-hardened and well-optimized. Who wants to rewrite all of that? Sample code is in C++. Libraries are C or C++. Etc, etc. C++ is often derided for it's flaws, but it's a language that actually gets *used*, and like it or not, being reasonably popular as a language is also a merit. It means that every major platform for which you might want to port a game has a modern C++ compiler and C libraries to link against, and mature debugging development and debugging tools.

      It's kind of a crappy chicken-and-egg problem for new languages to go up against, but that's the reality.

      --
      Irony: Agile development has too much intertia to be abandoned now.
  3. Programming languages must cater to humans by bluefoxlucid · · Score: 5, Insightful

    A programming language is better if it does one thing: Solves a particular type of general problem more efficiently and clearly than the language of comparison. The larger this set and scope of general problems, the better the language; the fewer corner cases hinder the language, the better the language.

    You will find the integration of mathematical languages, physics languages, or graphics languages into a general programming language a pile of clutter and complication. They won't integrate with much of the language, or they'll complicate it, or they'll constrict it. This is why you have libraries in a language to do some general tasks (Box2d, PhysX APIs, etc.), low-level specialized assemblies (OpenGL CUDA, shader assembly), and specialized high-level languages (R, Matlab): these tasks are best integrated by interfacing with a black box that takes in a data set, runs it through a set of coded procedures, and spits out a result.

    What makes a programming language "better" than state-of-the-art is its ability to supply general programming practices and functionality in an efficient way for humans. Classes that can be easily swiveled or overloaded or extended or polymorphed, but only in a way that a human being can reliably understand--that is, that a human being who has studied the language won't still struggle with understanding the workings of the language due to its conflict with the method of human thought. Code bodies which are simultaneously readable, maintainable, and efficiently executable. The ability to represent a wide variety of specialized tasks as API classes and functions, even if less effective than a specialized language, should someone seek to integrate physics or mathematics or cryptography or other such things with their program. All of these things, reflected in a way a human can grasp and use with fewer human-introduced defects, and also in a way that does not constrict the human from approaching the subset of programming tasks carried out in nearly 100% of code (imagine if 1 in 100 functions needed a specialized language, not a simple library API or raw programming code; even the Linux kernel is far less than 1% low-level assembly).

    It is not valid to say that people are bad at programming in C++ because they are bad programmers; but it is valid to say that bad programmers will not become good programmers if given a good language. If we assume, for example, that Perl is terrible and Python is some form of holy perfection, then we can claim that Perl will cause a good, studied, skilled Perl programmer to make many more defects than a good, studied, skilled Python programmer will make in Python; indeed, our metric for whether Perl or Python is superior to one another would be both the speed at which a new inductee to the language can learn to code with similar defects--how much programming exposure over a variety of challenging tasks does a person need in order to use the language for tasks of similar complexity without creating defects? Swift, Rust, C#, and so forth will face the same challenges: what is the defect rate produced by the programmer, relative to the amount of effort and resulting skill of the programmer in the given language, and how does it compare to all other languages?

    Bad languages will make good programmers produce more bad code. Good languages will not make bad programmers produce good code; they will enable good programmers to produce less bad code.

    1. Re: Programming languages must cater to humans by Anonymous Coward · · Score: 3, Informative

      > C++ too hasn't stood still during the last 30 years, and plenty of both static and dynamic analyzers supporting it have been released during this time.

      But without language semantics (e.g. for saying whether variables are threadsafe) these analyzers simply can't do anything other than guess at the programmers intentions. Even the best ones miss basic memory safety issues, while also producing far too many false positives. And this is all to be expected when the language can't expresss those semantics.

    2. Re:Programming languages must cater to humans by Anonymous Coward · · Score: 4, Interesting

      Programming language source code is a data structure. If the language is a data structure that can't be efficiently subjected to various (automated) optimizations, checks, and refactorings; then it's an inferior language (data structure) in that sense. It won't happen overnight (and it's not going to be Rust that does it), but this will eventually end up the same way that administration is ending up; where manually doing a large amount of work that could be automated will put you out of business. The idea that C++ is a great barrier to keep out bad programmers is really dumb, because it's another way of saying that development and maintenance costs do not matter. When every potential pointer mistake is a crowbar into robbing a bank account, the cowboys are going to need to be removed. Ultimately, software that allows for reproducability (no magicians in dev, administration, ops, or testing) is going to win. It won't happen without better compilers (ie: automated testing and code review). See the scale of Google and Amazon. They generally work in the highest tools they can get away with for the task at hand; and it's why they can scale.

    3. Re:Programming languages must cater to humans by phantomfive · · Score: 3, Funny

      The idea that C++ is a great barrier to keep out bad programmers is really dumb

      Especially if you've seen much C++ code.......

      --
      "First they came for the slanderers and i said nothing."
  4. A bit ranty. by serviscope_minor · · Score: 4, Interesting

    It seems pretty ranty.

    C is never going to die. C++ is never going to die. That's for unrelated reasons. There's vast bodies of solid, efficient, debugged code written in those two languages so it will take a long time to replace it all. C++ also isn't staying still so while there's the fight against the C legacy there are usually faster, cleaner, less verbose, safer and more obvious ways of doing things.

    That said, rust seems pretty cool. The underlying machine model semantics aren't a world away from C/C++ (one of the few cases where that's an appropriate use) so I expect the compilers will catch up pretty soon especially as they will all sue the same back ends.

    Rust does seem in many ways to be a good thing: a similar machine model to C/C++ with all the associated efficiency but combined with a type system which makes whole classes of nasty bug impossible.

    My guess is that will make it feel restrictive, especially at first. Well, at first, I didn't really get all the new-fangled C++ shit with classes derivation and templates and whatnot and didn't really see what was wrong with hacking around with void* and casta the whole time. Then I realised I wasn't as smart as I thought.

    So, to me, Rust is interesting. It has roughly the expressibility and speed of C++ (in theory), the same low resource usage but is memory safe.

    --
    SJW n. One who posts facts.
    1. Re:A bit ranty. by gweihir · · Score: 2

      There is also new C code for large machines. Just wrote some. Speed, memory-efficiency and fine-grained control over the execution is mandatory in some application scenarios.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    2. Re:A bit ranty. by gweihir · · Score: 2

      No. These cause more problems than they solve, because the template system in C++ is utterly borked. (Look at what Eiffel offers to understand what I am talking about...) As to qsort(), in a sane implementation, there will not be any difference. The extra call that C does does not matter once the code is in 1st level CPU cache. And if you need maximum performance, you have to move away from the library anyways.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  5. The source of troubles is usually in humans by Beck_Neard · · Score: 4, Insightful

    > the source of troubles is usually in humans, not technology

    Exactly, and that's why C/C++ is bad. Humans are terrible at programming. This isn't an insult to anyone and it's not me trying to say "no one is as good a coder as I am." It's a statement of fact, and everyone - including you and me - is terrible at programming. The human brain did not evolve to program computers. Programming computers is just something we kind of stumbled upon by accident and we have been continuing to stumble and fumble and generally make fools of ourselves. This is why we desperately NEED languages to hold our hands. Ironically, in the early days of programming, when people seemed to have a more mature attitude towards the art, this was a commonly-accepted fact. That's why Fortran and Lisp were developed even though it was hard and time-consuming and expensive to write compilers for those languages in those days (only a handful of people around the world knew how to write a compiler) and the code produced by those languages was typically awful and strained already-poor hardware to its limits. And when C was developed, it was a HIGH-LEVEL language. It was the python or the scala of its day. It was designed as a labor-saving device, a way to write operating systems without fucking around with assembly. "Writing an operating system in a high-level language? You're fucking nuts!" And just like a proper high-level language, it held the programmer's hands and put major restrictions on what he was allowed to do, at least relative to assembly.

    The modern programmer is a victim of luxury. His computers are powerful and he has a choice of thousands of languages, many of them really good. And like the rich bohemian who decides to live in filth for no reason, he thinks there's something impressive or 'cool' or 'edgy' about programming in a complex unstructured language. There isn't.

    --
    A fool and his hard drive are soon parted.
    1. Re:The source of troubles is usually in humans by JohnFen · · Score: 3, Informative

      And when C was developed, it was a HIGH-LEVEL language.

      Umm, no, it wasn't. It was (and is) considered a mid-level language, one step above assembler. High level languages of the day were things like COBOL and Fortran.

    2. Re:The source of troubles is usually in humans by drewm19801927 · · Score: 2

      If you decide to get into Rust, please post about it from an Ada developer perspective! Almost nothing has been posted comparing the two; I think the intersection of high assurance software gurus and new language nerds is pretty small... a niche within a niche.

  6. You dont' need another language to do this. by Glasswire · · Score: 2

    "To put it simple, this is a language with a built-in code analyzer and it's a pretty tough one: it can catch all the bugs typical of C++ and dealing not only with memory management, but multithreading as well. Pass a reference to an assignable object through a pipe to another thread and then try to use this reference yourself - the program just will refuse to compile. "
    Why do we need another language to accomplish those things? Better IDEs, compilers and analyzer tools should be able to all that for existing languages. If you have a better paradigm for expressing algorithms that you think merits a new language, make that case, but complaints in the quote don't need that.

    1. Re:You dont' need another language to do this. by Megol · · Score: 2

      We need it because that isn't what Rust is about - it is about making safe programming the default and making some common errors in other languages (like dangling pointers) impossible. And doing that while still being useful for systems programming and supporting high performance.

    2. Re:You dont' need another language to do this. by phantomfive · · Score: 2

      Why do we need another language to accomplish those things? Better IDEs, compilers and analyzer tools should be able to all that for existing languages.

      Because there is some analysis that can't be done statically (provably!), and other analysis that is intractable, no matter how good your IDE or tools. The language works around this by simplifying the problem by disallowing certain things.
      Another example of a language that solved the halting problem is Coq......it's impossible to write a program in that language that doesn't terminate.

      --
      "First they came for the slanderers and i said nothing."
  7. Come again? by Java+Pimp · · Score: 2, Funny

    it can catch all the bugs typical of C++ and dealing not only with memory management, but multithreading as well

    So they've solved the halting problem?

    They may have made some improvements and are capable of catching many bugs automatically but to say "all" is quite a stretch. I have yet to see a source code analyzer catch all mistakes and have a low false positive rate and a low false negative rate.

    Or perhaps I'm reading too much into it and they are simply capable of detecting bugs of all the typical C++ bug categories.

    --
    Ascalante: Your bride is over 3,000 years old.
    Kull: She told me she was 19!
  8. What's easier to change? by eggz128 · · Score: 2

    Human fallibility or the language/compiler?

  9. I don't even... by naasking · · Score: 3, Interesting

    Further, "Like many of new languages, Rust is walking the path of simplification. I can generally understand why it doesn't have a decent inheritance and exceptions [...]

    Spoken like someone who has no clue about the breadth and depth of the various programming paradigms available. The fact that he still considers inheritance as somehow essential just reveals his ignorance on the progress on comp sci over the past 20+ years.

    Exceptions are more debatable, since we don't yet have a better error handling abstraction that scales from local to global error handling (checked exceptions are the best we have so far).

    [...] but the fact itself that someone is making decisions for me regarding things like that makes me feel somewhat displeased. C++ doesn't restrict programmers regarding what they can or cannot use."

    I don't even... So by this argument, C++ restricts me from using generators and first-class delimited continuations, so it's not good enough either.

    This argument is both a contradiction because C++ also makes such decisions thus disqualifying it despite the author's claims, AND it's tautological because every language makes opinionated decisions about acceptable idioms. Really, no language could possibly satisfy the author's requirements.

    Given its goals, I think Rust made a pretty good set of opinionated choices though. Certainly better than C++ overall.

  10. Rust has a clear purpose by phantomfive · · Score: 2

    Rust has a clear purpose, and that is to embody and enforce the coding guidelines chosen by some members of the Mozilla team, to reduce bugs. And IMO it does that very well. If you don't like those coding guidelines, then you won't like Rust. If you do like them, then Rust will be a great language for you.

    Whether those coding guidelines will become popular outside of Mozilla remains to be seen, but there is nothing wrong with them.

    --
    "First they came for the slanderers and i said nothing."
  11. Rust is putting the cart before the horse by gman003 · · Score: 3, Interesting

    Rust is not yet production-usable. It has enough known bugs in the tracker that I can't even contemplate using it for a personal project, let alone for real.

    And yet they're already pushing the marketing, proclaiming it as a guaranteed C-killer. I'm sorry, but they've said that about every compiled language since C, and it hasn't been true for one of them. And you're pushing it this hard, when you're still this early along in development?

    Nobody uses C or C++ because they love the language. They use it because it has all the tools they need to debug, and all the libraries they need to run, and all the performance they need for the task. Rust maybe has the last one, but only has the second by being C-compatible (defeating the purpose of using a new language, particularly when you have to write this much wrapper code around it) and has none of infrastructure needed for large modern projects.

    Dear Rust devs: stop writing articles about how great Rust will be, and start writing stuff to make your language actually usable. Maybe then people with their heads outside their asses will listen to you.

    1. Re:Rust is putting the cart before the horse by bytesex · · Score: 2

      "Nobody uses C or C++ because they love the language."

      I take issue with that. I absolutely love C. I also abhor any movement to 'prettify' algol-like languages (python, java), which I consider useless.

      --
      Religion is what happens when nature strikes and groupthink goes wrong.
    2. Re:Rust is putting the cart before the horse by FranTaylor · · Score: 2

      You could write a line of C and have a pretty damn good idea what the assembler output would look like.

      Or maybe not, if your compiler does re-ordering or any sort of optimization. In fact the C standard states explicitly that the compiler is free to generate any code it wants to as long as it correctly executes your program. So that means that your stack variables will vanish, your unused code will vanish, your loop variables and exit conditions will be re-written and in general, depending on what works best for the platform you're compiling on, the code won't look anything like what you expected. Besides all that, the generated assembler will be fragile as all heck because it is depending on processor-specific functionality for high speed and you will probably not be able to go in and tweak it without breaking it terribly. So really what good does it do to know what assembler will be generated?

    3. Re:Rust is putting the cart before the horse by JohnFen · · Score: 2

      Nobody uses C or C++ because they love the language.

      I do. I routinely use about a dozen different languages, but C++ remains my favorite by a longshot, followed closely by C.

  12. I despise the blame the human idea by gurps_npc · · Score: 3, Interesting
    This quote indicates the reviewer does not know what he is talking about: "If your C++ code is not good enough or Java code is painfully slow, it's not because the technology is bad - it's because you haven't learned how to use it right."

    You don't give a 3'5" person an unmodified school bus and then say 'it's their fault for not having long enough legs'.

    You design FOR the actual people that will use your product, not the mythical perfect user.

    If people consistently make a set of mistakes, then a better designed product will prevent or at least warn/push them away from that mistake. Anytime there is a 'typical newbie error', that means that your product is bad - or at the very least should come with better free training. Minimal training required is one of the key functions of any product.

    If I give you a frozen dinner, that if properly prepared, is the most delicious thing in the world - wouldn't a version where 'properly prepared' means "Open package and wait 30 seconds for it to warm" be a lot more valuable than "Open package, season to taste, poor into sauce pan, heat until it you smell the cinnamon begin to burn, transfer to microwave, cook 5 minutes at 1000 watts, return to freezer and let sit for 2 minutes, before slicing and serving on individual plates"?

    "Open package and wait 30 second" is clearly the far superior product.

    Similarly, a variant of C++ that stops common errors is better than one that lets you do things that no one ever wants.

    --
    excitingthingstodo.blogspot.com
  13. Re:Someone is making decisions for me regarding th by DreamMaster · · Score: 4, Insightful

    Some cases I've used them for that I didn't feel dirty about are:
    * checking for failure conditions from calls to sub-methods, and jumping to a common cleanup and exit code block. Difficult to replicate cleanly without massive if blocks, or abusing exceptions.
    * Cleanly breaking out of multiple nested loops
    * I've used them for an implementation of coroutines, which simulates threading for systems which don't have threads. In this case the GOTOs were nested inside macros and stub classes for holding context, but the whole scheme wouldn't have worked without them.

  14. Get the bullshit bingo bot out of here! by bytesex · · Score: 3, Insightful

    People who say 'C/C++' are likely to know neither language.

    --
    Religion is what happens when nature strikes and groupthink goes wrong.
    1. Re:Get the bullshit bingo bot out of here! by Anonymous Coward · · Score: 2, Insightful

      People who criticize the term "C/C++" are really Python programmers.

  15. Re:Someone is making decisions for me regarding th by Anonymous Coward · · Score: 3, Insightful

    When has a goto ever been incorrect? Your question doesn't make much sense.

    Obviously you can use structured programming constructs to emulate a goto, and vice-versa. And in either case end up with _correct_ code. But when you're using a single-iteration loop or deeply nesting conditional blocks just to get the same effect as using goto, the goto should be preferred for the benefit of simplicity and readability.

    In C code goto's are very useful for jumping to error handling code that rewinds the state of the local function. They're also useful when trying to follow a single-point-of-return discipline, whether in C or any other language. They're useful for writing explicit state machines--I use a switch more often, but sometimes using gotos is cleaner, and in GCC computed gotos are helluva fast. Finally, gotos are exceptionally useful when generating code. In fact, Lua re-added goto support in 5.2 because the authors realized how unnecessarily painful it was to machine-generate Lua code without goto support.

    You should be focusing on writing clear and simple code, using whatever constructs your language provides. Feeling "dirty" about using gotos doesn't make any sense. When was the last time you carefully paid attention to arithmetic overflow in your code (C or otherwise)? Ignoring that stuff should make you feel dirty. Not use of goto.

  16. Re:garbage under, garbage above by Beck_Neard · · Score: 2

    > Humans actually suck at just about everything.

    We are great at the things we actually evolved to do. Language, visual perception, navigating social situations, etc. These are the reasons we went from 500 cc of brain volume to 1500 cc. These are extremely hard problems that require the equivalent of petaflops of computation.

    Yet it takes minutes of conscious effort for us to multiply two puny 10-digit numbers! We are extremely and demonstrably bad at doing arithmetic. The reason? Our working memory capacity is extremely limited and we have trouble consciously holding a lot of different pieces of information or outcomes in our heads simultaneously.

    That's one of the reasons we are terrible at programming. We simply are unable to think of all the different ways our code can go belly-up. There's nothing subjective at all about what I'm saying. That you think it's equivalent to a 'proper breathing' quack shows you aren't even making a tiny bit of effort to understand my point.

    --
    A fool and his hard drive are soon parted.
  17. Re:Named after the product of corrosion? by wshs · · Score: 4, Funny

    Nothing screams efficiency, well maintained, clean, and smooth running software like calling it "Rust"

  18. If I hear this again, I may puke. by gestalt_n_pepper · · Score: 4, Insightful

    If your C++ code is not good enough or Java code is painfully slow, it's not because the technology is bad - it's because you haven't learned how to use it right. That way, you won't be satisfied with Rust either, but just for some other reasons."

    Gods, I wish we could force EVERY programmer to take some basic neurophysiology and at least one human factors course.

    If the language is hard to use and makes it easy to make mistakes, the language design is wrong. NOT the humans. The humans, by definition *can't* be wrong. A language is like any other machine. In this case, it's purpose is to provide a highly granular interface to the system FOR HUMANS.

    Machines, any machine, exist for exactly, and only one reason, to serve humans efficiently (i.e to reduce human physical and cognitive labor to a minimum while allowing them to accomplish their goals).

    If a language accomplishes that, the language is well designed. If it doesn't do that due to obfuscated syntax, a lack of safety checks, over-engineering (It does so much) and under-design (What it does is almost impossible to understand and use), then the language is badly designed, and the language designers, incompetent, because they neglected to consider the human part of the system in their design.

    --
    Please do not read this sig. Thank you.
  19. better reasons by nten · · Score: 3, Informative

    Given the support for the functional paradigm that rust has, I am dissapointed that parallelizing folds and maps is so verbose and thought requiring. Not sure why a fold can't just use all the cores like in haskell.

    Sting slices vs strings. Verbose again but it works.

    No tail call optimization, makes some FP stuff impossible.

    No metaprogramming.

    Regex library is slow. But I don't use regex and it is on the long list to improve.

    Compile times. It rebuilds everything in a library or exe even if you only changed one line. Also it is just slow. Even hello world takes surprisingly long. This is really annoying because I have a habit of recompiling quite regularly as I code.

    Cargo, the package manager and build system is inflexible in that it does not let you pass command line parameters to rustc. This means that if you want to cross compile or use simd or any of the other cool stuff you get by building on the llvm back end, you have to roll your own build system with make or cmake or whatnot.

    That said, I am still excited about it.

    --
    refactor the law, its bloated, confusing and unmaintainable.
  20. Re:Someone is making decisions for me regarding th by perpenso · · Score: 2

    * Cleanly breaking out of multiple nested loops

    Tough one. I have to be honest, I've never used a goto in my code since I stopped writing BASIC, but I've sometimes missed this ability. Still, a language-level keyword like "breakall;" would be better than goto. Except insofar as it doesn't exist, and "goto" does...

    The problem is break one and break all are not the only cases. Perhaps you only want to break some but not all levels of nesting.

  21. Re:garbage under, garbage above by Beck_Neard · · Score: 2

    Whenever a programming task can be precisely defined, a machine can do it better. The process of converting C to assembly is hard for humans but machines can do it easily. The evolution of programming has mostly been a repetition of the same theme: Identification of a problem, clumsy efforts by humans to solve that problem manually, development of a process that automates that problem, and then sitting back and letting the computer handle that particular problem while we move on to more challenging ones. You could say this about not just converting high-level code to assembly (early programs that did this were called 'autocodes' and were in the domain of AI research), but about parallelism and type checking and memory analysis.

    --
    A fool and his hard drive are soon parted.
  22. Re:Pretty weak by david_thornley · · Score: 2

    Yup. In other words, both Mozilla and Google have style guides that are good for filtering outside submissions. There's any number of style guides that endorse C++ exceptions, but they aren't typically as public-facing.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes