Slashdot Mirror


TechCrunch Urges Developers: Replace C Code With Rust (techcrunch.com)

Software engineer and TechCrunch columnist Jon Evans writes that the C programming language "gives its users far too much artillery with which to shoot their feet off" and is "no longer suitable for the world which C has built." An anonymous reader shared Evans' post: Copious experience has taught us all, the hard way, that it is very difficult, verging on "basically impossible," to write extensive amounts of C code that is not riddled with security holes. As I wrote two years ago, in my first Death To C piece... "Buffer overflows and dangling pointers lead to catastrophic security holes, again and again and again, just like yesteryear, just like all the years of yore. We cannot afford its gargantuan, gaping security blind spots any more. It's long past time to retire and replace it with another language.

"The trouble is, most modern languages don't even try to replace C... They're not good at the thing C does best: getting down to the bare metal and working at mach speed." Today I am seriously suggesting that when engineers refactor existing C code, especially parsers and other input handlers, they replace it -- slowly, bit by bit -- with Rust... we are only going to dig ourselves out of our giant collective security hole iteratively, one shovelful of better code and better tooling at a time."

He also suggests other fixes -- like using a language-theoretic approach which conceptualizes valid inputs as their own formal language, and formal verification of the correctness of algorithms. But he still insists that "C has become a monster" -- and that we must start replacing it with Rust.

328 of 505 comments (clear)

  1. Yes, go ahead! by mveloso · · Score: 5, Insightful

    Yes, replace billions of working C code with billions of lines of code in a new language. What could possibly go wrong?

    1. Re:Yes, go ahead! by SCVonSteroids · · Score: 4, Funny

      Well if this guy says so, what doubts could you possibly have left?

      --
      I tend to rant.
    2. Re:Yes, go ahead! by BCooley · · Score: 5, Insightful

      He's not suggesting that at all.

      "..I am seriously suggesting that when engineers refactor existing C code, especially parsers and other input handlers, they replace it — slowly, bit by bit — with Rust."

      He's suggesting that when you refactor a critical piece of C code - in other words you're already going to change it and potentially add brand new C/C++ security issues - you instead use a language with some form of god damn formal verification and some fucking way of validating that you're not opening a new exploitable vulnerability that will bring down half the damn internet.

      I mean is that really too much to ask?

    3. Re:Yes, go ahead! by El+Cubano · · Score: 1

      Yes, replace billions of working C code with billions of lines of code in a new language. What could possibly go wrong?

      Not only that, but which standard requires that a system have a rust compiler on it? POSIX and SUS (are they the same now?) require a C compiler. In practice I know that many systems have other environments available, but standards matter in some cases and there will be instances where C is an appropriate choice, if not the best or only choice.

      I could understand advocating "choose rust instead of C for new projects" or "if you are considering rewriting major portions of a C project then consider redoing all or part of it in rust." However, advocating replacement of lots of working code sort of ignores a major part of the risk management calculus. In fact, risk management is why the banking and finance industry core still mostly on COBOL and why lots of big companies still have HR systems that were written in COBOL.

      Granted if a project has a history of being filled with security issues, then there needs to be a consideration for if it is better to expend the effort on fixing vulnerabilities or rewriting in a more "secure" language. Im looking at you imagemagick and PHP.

    4. Re:Yes, go ahead! by Chris+Mattern · · Score: 4, Interesting

      I mean is that really too much to ask?

      Yes. Formal verification of most production programs will not happen in my lifetime or yours, or possibly ever, because it's expensive and nobody's paying for it.

      The simple fact is that there's a hue and cry about security but nobody really cares about it, because nobody's willing and able to pay what it would take to fix it.

    5. Re:Yes, go ahead! by Anonymous Coward · · Score: 1

      Rust has both a safe variation for doing good things and an unsafe veriation for doing low-level actions. This is the same problem with a new paint job.

    6. Re:Yes, go ahead! by jmccue · · Score: 4, Insightful

      I think we should replace c with COBOL, no pointers, no dynamic memory allocation, rounding errors with floats rare and all strings fixed length.

      That is just as good an option as any for these crazy "my language is better than your's" posts

    7. Re:Yes, go ahead! by Anonymous Coward · · Score: 1

      No you just have a low IQ. There's a difference between everything being unsafe and only being unsafe in the critical areas where you need to be.

    8. Re: Yes, go ahead! by Zontar+The+Mindless · · Score: 2

      I would expect Slashdot users to post numerous variations on, "Is she hot?"

      --
      Il n'y a pas de Planet B.
    9. Re:Yes, go ahead! by Anonymous Coward · · Score: 3, Insightful

      I can never explain to people which things need to be validated in a safe manner in C, C++, or Java. Is Rust going to give me the tongue of a oceanside saltwater merchant, or open their ears?

    10. Re:Yes, go ahead! by plopez · · Score: 1

      What needs to happen is the cost of security breaches must greatly exceed the cost to fix it. The only way I can see that happening is huge fines and/or civil accountability. In other words government fixing the market place.

      --
      putting the 'B' in LGBTQ+
    11. Re: Yes, go ahead! by Anonymous Coward · · Score: 1

      that just killed all conversation

    12. Re:Yes, go ahead! by Sarten-X · · Score: 1

      Ah, yes... That's why I've had to fight managers who wanted devs to have root on production systems. After all, the devs are all perfectly qualified to have admin power, since he was sure he only hired good people... and the devs need root to read the system log files and attach tools for debugging!

      --
      You do not have a moral or legal right to do absolutely anything you want.
    13. Re:Yes, go ahead! by karlnyberg · · Score: 1

      This is precisely the same model being fomented by the Defense contractor community in wanting to replace working Ada code (see below) - which had been mandated for years - with C++ or Java code. Their rationale is often that they can't find Ada programmers to maintain the code. Of course, what they don't tell you is that there is so little maintenance required that they can't make money unless they do the conversions to something more buggy...

      --
      -- Karl --
    14. Re:Yes, go ahead! by ShanghaiBill · · Score: 4, Insightful

      What needs to happen is the cost of security breaches must greatly exceed the cost

      Why does that "need" to happen? If there was actually a "need" for secure and expensive software the marketplace would already be providing it. Most people want cheap, or even better, free. There is no political demand for an authoritarian solution to online security, nor should there be. Government involvement will stifle innovation, increase costs, and do little to actually solve the problem.

    15. Re:Yes, go ahead! by Jeremi · · Score: 4, Insightful

      Yes. Formal verification of most production programs will not happen in my lifetime or yours, or possibly ever, because it's expensive and nobody's paying for it.

      The idea with Rust is that the Rust compiler does a significant amount of formal verification so that human beings don't have to.

      It won't guarantee that your program does what you intended, but at least if your Rust program compiles, you have a pretty good assurance that it won't be corrupting its memory space and suffering from (potentially-exploitable) Undefined Behavior when it runs.

      The simple fact is that there's a hue and cry about security but nobody really cares about it, because nobody's willing and able to pay what it would take to fix it.

      There's some truth to that; in most cases, people are only going to invest a modest, finite amount of additional time/effort/money into making code secure.

      Which is why it makes sense to minimize the cost of making code secure, e.g. by building the necessary checks into the language itself so that all programs benefit from them "for free".

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    16. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 4, Interesting

      A much better argument against formal regulation of the software development profession is that we don't know the best way to do it yet.

      We have centuries of experience building bridges, and have a pretty good idea of how to build bridges that don't fall down by accident, even under unlikely but plausible conditions like freak weather events or excessive loading because the public ignore some limit or other.

      We have decades of experience building software at all, and little consensus on the best way to do it. Indeed, we don't even have a clear definition for what "best" means in this context, and it's possible that depending on the purpose of and risks associated with software, a reasonable set of good practices might look entirely different in one case from another.

      Worse, the people who are most qualified to judge when we do reach that level of maturity within the industry, and to formally recognise good practices, are probably among the least likely to actually do that. They're probably too busy building good software where quality matters.

      Instead, there must be an all too realistic possibility that any formal regulatory system would be dominated by the famous consultblogauthspeakers who spend a career burnishing their profile within the industry, but who in many cases have remarkably little experience actually building working software of their own, never mind working software to a very high quality standard. The very last thing we need is these fools being given any real authority over developers who are trying to do better, or $DEITY forbid, being required to give their blessing to those developers before anyone can ship anything.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    17. Re:Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1, Insightful

      If there was actually a "need" for secure and expensive software the marketplace would already be providing it.

      Apparently not.

      It turns out that ignorance and apathy are often more powerful influences than the invisible hand. That doesn't make the costs of security breaches any less for the victims.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    18. Re: Yes, go ahead! by K.+S.+Kyosuke · · Score: 1

      It is, you don't need to replace C for this specific purpose. Parsers and such are served well by correct code generation.

      --
      Ezekiel 23:20
    19. Re: Yes, go ahead! by K.+S.+Kyosuke · · Score: 1

      There's so little maintenance that the newest fighter airplanes run into silly programming problems when crossing time zones?

      --
      Ezekiel 23:20
    20. Re:Yes, go ahead! by serviscope_minor · · Score: 1

      Except that Rust is kinda a bit like C except with a formal verifier built in so you can prove you don't have memory errors. And they've updated a few things like making macros less of a bolt-on.

      I used to love C, but seriously, it's a mess of micro management and pointer errors. It's possible to avoid those, e.g. OpenBSD if you do an incredible amount of code revewing. Thing is though we have better tools now. Why not let a computer formally prove you have no pointer errors, freeing up the expensive and hard to train human minds to check for the stuff that's harder to formally proove, like correctness compared to and of specs and so on.

      --
      SJW n. One who posts facts.
    21. Re:Yes, go ahead! by unixisc · · Score: 1

      Yes, replace billions of working C code with billions of lines of code in a new language. What could possibly go wrong?

      Not just that, is Rust akin to a low level language that C is? Something that's close enough to assembly to be really portable b/w microprocessors?

    22. Re: Yes, go ahead! by Anonymous Coward · · Score: 1

      That won't make more secure code. It will only lead to the creation of compliance & certification structures, pretty much like today's medical industry.

      When a security fsckup happens, companies will be able to present some kind of certification along the lines of "we're not liable, $CERTIFICATE here proves that we adhered to $BESTCERTFIEDPRAXIS, so we did everything in our power".

      You'll still have buggy software, only now with the added benefit that doing software development will not be possible for small companies any longer because of the regulatory overhead involved.

    23. Re:Yes, go ahead! by Anonymous Coward · · Score: 2, Interesting

      Pascal is the only language that's created a verified A-1 secure computer system, so let's use that.

    24. Re:Yes, go ahead! by Megane · · Score: 4, Interesting

      How about this: rewrite systemd in Rust first and I might consider it.

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    25. Re:Yes, go ahead! by johanw · · Score: 2

      Aparently he didn't seem capable of hiring sysadmins who are thinking about making things possible instead of trying to prevent others from doing their jiob to remain their position of power.

    26. Re:Yes, go ahead! by flopsquad · · Score: 1

      How about this: rewrite systemd in Rust first and I might consider it.

      Sees systemd rewritten in Rust.

      --
      Nothing posted to /. has ever been legal advice, including this.
    27. Re: Yes, go ahead! by Anonymous Coward · · Score: 1

      Or... The cost of a security breach doesn't always cost as much as trying to prevent security problems...

      Your argument is retarded. Seat belts are demonstrably a valuable cost to prevent something that may not happen, but it is self evident and easily proven.

      Spending $100k to root out an overflow bug that can only be accessed by a local attacker who has to spend months discovering it might be a good investment for the NSA or NASDAQ, but it isn't worth it for most companies.

    28. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 3, Interesting

      Most people have literally no idea what it would actually cost to prevent security issues and other bugs using formal methods. The average developer probably hasn't even heard of them, and I'd guess less than 5% of professionals have any substantial knowledge of the relevant tools and techniques or have ever actually used anything much beyond a type system for this purpose.

      It may well be that organisations assume that the cost of prevention will be higher, but their ignorance is not an argument. (Neither is calling me names, by the way.)

      Finally, your hypothetical $100K low risk vulnerability is irrelevant, given that within the past few weeks alone we have seen major security outbreaks with consequences like bringing down large parts of the NHS infrastructure in the UK, which probably cost lives and certainly caused a great deal of unnecessary suffering. Even the lower bound on the cost of security screw-ups in modern software includes people dying unnecessarily.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    29. Re:Yes, go ahead! by doom · · Score: 2

      It's pretty impressive for a pundit to come up with this idea. Of course, "let's rewrite everything in rust!" it's already such a cliche I've seen people moderated down for posting it, but you have to expect pundits to be a little slow on these things.

      The response of the postgresql folks was something like "how about we finish porting it from lisp, first?"

    30. Re:Yes, go ahead! by Darkness+Of+Course · · Score: 1

      Nice troll, but a BSOD would have been an order of magnitude better.

    31. Re:Yes, go ahead! by AaronW · · Score: 3, Informative

      Rust is not all that portable. Rust is tied to LLVM. There are a lot more platforms supported by, say, GCC than LLVM. For example, I'm working on some Arduino and Xtensa based stuff at the moment. No Rust support but C and C++ are both supported. It's also trivial to link between C and assembly or for that matter C and just about any other language. I mix C and assembly all the time in the work that I do. I don't need any overhead of garbage collection, bounds checking, etc. either. The C calling ABI is very well documented and supported on all but the lowest end microcontrollers. If I write a library in C, it can be called from virtually any language. If I write a language in Rust, i doubt that would be the case. The C runtime library is pretty trivial. I've written bootloaders with only a page of assembly before calling the main function. By bootloader I'm referring to a true bootloader, code that is the first code executed when a CPU comes out of reset, not something called by the BIOS but code that will at some point load the BIOS.

      --
      This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
    32. Re: Yes, go ahead! by Chris+Mattern · · Score: 3, Insightful

      Most people have literally no idea what it would actually cost to prevent security issues and other bugs using formal methods. The average developer probably hasn't even heard of them, and I'd guess less than 5% of professionals have any substantial knowledge of the relevant tools and techniques or have ever actually used anything much beyond a type system for this purpose.

      It may well be that organisations assume that the cost of prevention will be higher, but their ignorance is not an argument. (Neither is calling me names, by the way.)

      That means the first cost will be training a generation of developers in how to do it. Aside from assumptions, that will not be cheap.

      And actually, their ignorance is an argument. Corporations are very allergic to costs they can't estimate in advance. It's up to the advocates to demonstrate that it'll be cheap, not to the skeptics to demonstrate that it'll be expensive. That's the way the world works.

    33. Re:Yes, go ahead! by Aighearach · · Score: 1

      My first doubt is, if his advice is targeted at people who aim artillery at their feet, why does he want more code from them? It seems like he's identified the people just to not accept pull requests from.

    34. Re:Yes, go ahead! by suutar · · Score: 1

      I could understand advocating "choose rust instead of C for new projects" or "if you are considering rewriting major portions of a C project then consider redoing all or part of it in rust."

      Then it's quite convenient that that's actually what he's saying (especially the latter).

    35. Re:Yes, go ahead! by GameboyRMH · · Score: 1

      Why does that "need" to happen? If there was actually a "need" for secure and expensive software the marketplace would already be providing it.

      There is - in aircraft control systems and banking. But everything else can get fucked apparently.

      But you could look at insecure code as a form of pollution. Companies saving money through irresponsible behavior that makes the environment more dangerous for everyone.

      --
      "When information is power, privacy is freedom" - Jah-Wren Ryel
    36. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      It's up to the advocates to demonstrate that it'll be cheap, not to the skeptics to demonstrate that it'll be expensive. That's the way the world works.

      Of course, one solution to this problem is to make security breaches or other software failures that cause serious harm to third parties extremely expensive if they could reasonably have been avoided.

      There is an old saying that if you think education is expensive, you should try ignorance. It was never truer than here. The software industry has been getting away with shipping substandard products for years, and has pulled off one of the greatest PR coups of modern times by convincing the general public and their political and business leaders that this is somehow inevitable.

      Evidently it doesn't have to be this way. The inherent dangers of using languages like C and C++ to write software with a high cost of failure are widely documented in industry and routinely taught to students studying software-related fields. There is no doubt that modern languages have facilities that make writing the equivalent code objectively safer by eliminating the possibility of various classes of programmer error.

      Moreover, there is no doubt that using alternative tools and methods to the mainstream programming world can result in dramatically lower failure rates, and consequently better safety, security, etc. If the software running air traffic control centres or medical devices failed as often as a typical web startup or cheap mobile app, many of us would be dead right now. We can examine the more successful software projects and make reasonable assumptions about the costs of achieving the best quality we know how to achieve in the most important situations, and again evidently this is a price that the market will bear in such cases.

      At this point, the principle is established, and it is simply a matter of degree: how much damage could a failure in any given system cause, and so how much effort is justified to use better tools and methods to mitigate that risk? As long as software development businesses aren't significantly penalised regardless of the damage caused by their negligence, of course the answer to that will be "very little effort", but that is exactly why we should be starting to hold software developers working on products and services with significant risks to higher standards.

      Which brings us back to the original point that plopez made...

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    37. Re:Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      Until then, the hurdle of learning a new syntax and switching between them as you maintain existing C code and write new Rust code is too much of a productivity hit for most developers working in a commercial environment.

      People have been making this argument forever, yet today a huge amount of commercial code is written in languages that just a few years ago didn't have a large supporting ecosystem if they even existed at all. Apparently the millions of professional programmers now writing code in those languages managed to make the switch just fine, and the organisations they work for managed to find the time and money to support those switches without their projects failing.

      In the specific context of languages that support newer and safer ways to build software, maybe developers who can't or won't learn to use better tools and techniques and so to achieve better results simply need to find another career, just like obsolete workers with out-of-date skills in many other professions.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    38. Re:Yes, go ahead! by king+neckbeard · · Score: 1

      You are putting far too much faith in the 'invisible hand' of the market.

      However, the answer to how this actually should be handled is this:
      The NSA and the like need to put 90% of their focus on fixing security breaches, and leave only 10% to the spying. That budget is more than enough to make a substantial dent in software security.

      The subject of liability is an interesting one, but I think it would be important to ensure that the primary parties being influenced by this law are management for medium to large businesses.

      --
      This is my signature. There are many like it, but this one is mine.
    39. Re:Yes, go ahead! by Anonymous Coward · · Score: 1

      Rust enforces good practices that C developers are just "supposed to know", while also allowing the developer to request the ability to shoot themself in the foot on demand. You use safe Rust for 99% of your codebase, and the 1% of things that absolutely demand complete control over the metal you can use the unsafe subset of Rust. By minimizing the places the programmer can make mistakes you also severely reduce the places where logic needs to be carefully checked when certain types of bugs arise.

      Rust can be written for bare metal, it's definitely aiming to fill the space that C/C++ currently dominates. It also aims to have some of the memory safety guarantees of higher level languages. Even the best coders have coded tired, or drunk, or otherwise handicapped. It's far better for a tired dev's mistakes to be a compile time error than a runtime error.

    40. Re: Yes, go ahead! by Bing+Tsher+E · · Score: 1

      Formal verification would not have prevented what took down the NHS. Oh, I suppose it would have, eventually, but we still wouldn't be using Windows XP today, which was the software in question, if it had all had to be formally verified first. The problem that caused the NHS takedown had to do with distribution of patches, updates, and just plain communicating the need to turn off obsolete versions of a networking protocol which had been replaced already.

      But you're the one who brought that specific issue up as an example.

    41. Re: Yes, go ahead! by Bing+Tsher+E · · Score: 1

      Instead, there must be an all too realistic possibility that any formal regulatory system would be dominated by the famous consultblogauthspeakers who spend a career burnishing their profile within the industry, but who in many cases have remarkably little experience actually building working software of their own, never mind working software to a very high quality standard.

      They also apparently write columns for TeleCrunch.

    42. Re:Yes, go ahead! by Bing+Tsher+E · · Score: 1

      simply need to find another career,

      Fire them all. In fact, lets get some pitchforks and make DAMN SURE they get fired.

      No, that would be illegal. Howabout we have the government do it. Yeah, that's it. From now on, there will be a Regulatory Affairs department, with at least as big a budget as the Sofware Development department, in any company producing software.

      Open Source software? Unthinkable unless it's sponsored by a large entity who can afford to maintain the required large Regulatory Affairs department.

      It works in Health Care. They do one hell of a good job of containing cost. Ask anybody.

    43. Re:Yes, go ahead! by roca · · Score: 1

      > If I write a language in Rust, i doubt that would be the case.

      You're wrong. Rust has 'extern "C"' functions.

      > No Rust support

      That's wrong too, there is a Rust fork targeting Arduino (albeit not mainline).
      https://github.com/avr-rust/ru...

    44. Re:Yes, go ahead! by Bing+Tsher+E · · Score: 1

      For instance, making root possible for said developers, eh?

    45. Re:Yes, go ahead! by yuriklastalov · · Score: 1

      Bruh, the government can't even secure it's own shit. On top of that, any "security" procedures they'd mandate would certainly involve "back doors" and "patriotic crypto", for safety you understand.

    46. Re: Yes, go ahead! by ShanghaiBill · · Score: 1

      Of course, one solution to this problem is to make security breaches or other software failures that cause serious harm to third parties extremely expensive

      Draconian punishment has a poor record of effectiveness. We used to execute people for stealing bread, yet people still stole bread.

      Additional costs will be passed on to consumers, who are unwilling to pay for it. It will also eliminate free software, since no one will be willing to accept the liability. Progress will slow to a crawl, as new releases are held up for review after review, likely making security worse.

      You seem to be fixated on "online security" as some existential crisis threatening the future of humanity, but very few other people see it that way. If you picked a thousand people at random, and had them list the 10 biggest problems in their lives, I doubt if any of them would list "online security breaches". Yet you expect these people to pay much more to mitigate the threat.

    47. Re:Yes, go ahead! by AaronW · · Score: 1

      It is still not well supported. It certainly is NOT supported on the ESP32 I'm working with.

      --
      This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
    48. Re:Yes, go ahead! by AaronW · · Score: 1

      If I had that sort of overhead my software would not exist or work. Some of it has very tight memory constraints and besides, there would be no support for all the things one might expect. There's no heap, only a small stack available. Rust just isn't an option. Also, the entire toolchain is gcc, which precludes the use of Rust since Rust currently requires LLVM which does not have any of the optimizations that are required in order to allow the software to fit in the size constraints. Rust buys nothing but headaches. Many of Rust 'features' become hindrances, requiring a lot more overhead in terms of code space and efficiency. Remember, these are conditions completely different than some user-space application running on the command line.

      Another killer for embedded use is the lack of the volatile keyword. This is essential, and "atomics" don't cut it. The lack of "volatile" pointers is a major killer, especially for dealing with hardware descriptors and memory mapped registers.

      C handles these things quite well.

      --
      This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
    49. Re:Yes, go ahead! by TheRaven64 · · Score: 1

      you instead use a language with some form of god damn formal verification

      I think you're confusing Rust with Pony (which does have formal verification of its type system). Rust's type system has not been formally verified (let alone any of the implementation, though someone did verify its binary search implementation).

      --
      I am TheRaven on Soylent News
    50. Re:Yes, go ahead! by K.+S.+Kyosuke · · Score: 1

      You use safe Rust for 99% of your codebase, and the 1% of things that absolutely demand complete control over the metal you can use the unsafe subset of Rust.

      The problem with that idea is that you can already employ a combination of a higher language plus C to the same effect in many cases, and often without giving up on useful existing libraries. That significantly reduces the room for such a language.

      --
      Ezekiel 23:20
    51. Re: Yes, go ahead! by TheRaven64 · · Score: 4, Informative

      I work with a group that does formal verification and you seem also to be talking from a position of ignorance. Currently, the record for low-cost formally verified software is held by the NICTA team behind seL4. Their number is around 30 times the cost of using best practices for normal software development. A few caveats for this number:

      • The baseline is assuming the effort involved in creating a test suite with full coverage of the specification and a detailed specification. Few projects actually have this level of QA, so add another factor of 2-4 to the cost relative to most projects.
      • They're employing mathematicians on fairly low (academic-level) salaries for the verification. In an industrial setting, with skills in so much demand, you'd find it difficult to pay them less than double this.
      • Their entire software stack is around 10,000 lines of code and they've not yet shown that their verification effort scales linearly with the complexity of the software.
      • The cost of refactoring is close to the cost of initial development, as the proofs are not often reusable after modifications to the code.
      • It was a whole 6 hours between the first public release of their formally verified microkernel and someone finding the first exploitable security vulnerability.

      There's a lot of ongoing research in this area (I quite like F*, though it has some significant issues with proof reuse and usability of its error messages), but the tools for formal verification are currently as appropriate for large-scale modern software development as punch cards.

      --
      I am TheRaven on Soylent News
    52. Re:Yes, go ahead! by TheRaven64 · · Score: 4, Insightful

      The idea with Rust is that the Rust compiler does a significant amount of formal verification so that human beings don't have to.

      Please don't confuse type checking, using a non-verified type system, with formal verification.

      --
      I am TheRaven on Soylent News
    53. Re:Yes, go ahead! by TheRaven64 · · Score: 4, Informative

      Except that Rust is kinda a bit like C except with a formal verifier built in so you can prove you don't have memory errors

      Please stop repeating this. Rust has a type checker. Most languages have a type checker. The type system in Rust is stricter than that in C (though it is possible to implement the same thing in the library in C++), but it is not a formally verified type system and the implementation of the type checker (which is not a formal verifier) is also not verified (and can't be until the type system itself is verified). If you want a language with a formally verified type system, look at Pony. If you want a language that integrates formal verification, look at F*. If you want to use Rust, that's fine, but stop claiming that it has features that it doesn't.

      --
      I am TheRaven on Soylent News
    54. Re:Yes, go ahead! by Anonymous Coward · · Score: 1

      Just for the record, just in case someone points to this and claims nobody expressed any doubts. Certainly not because I missed the tone of biting sarcasm in your voice:

      Maybe these will be overcome. Maybe a better more formally proven type system will be implemented. For now there are doubts.

    55. Re: Yes, go ahead! by AmiMoJo · · Score: 1

      It's not a binary no-test/full verification though, there are many degrees between those two points. Changing from C to Rust gets you a lot of verification for free. Also using libraries that have been well tested and widely adopted helps, although you do have to keep them up to date.

      A lot of this can be covered under the mantra that you probably shouldn't try to do security yourself. Don't code your own encryption/hashing system, use a well respected and well tested one. The same advice works well for things like input parsers in many cases.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    56. Re: Yes, go ahead! by Peter+La+Casse · · Score: 2

      The baseline is assuming the effort involved in creating a test suite with full coverage of the specification and a detailed specification.

      The detailed specification is an often overlooked cost driver in this scenario. Customers really hate having to write detailed specifications and then being held to them.

    57. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      Draconian punishment has a poor record of effectiveness. We used to execute people for stealing bread, yet people still stole bread.

      I don't think that's a fair comparison. People stole bread anyway because they needed to eat to survive. Businesses tend to optimise for whatever is cheapest given their other constraints, and so typically they do respond to making undesirable behaviours more expensive. Indeed, short of piercing the corporate veil and imposing criminal sanctions on the senior executives personally, financial incentives are arguably the only thing to which businesses will reliably respond.

      Additional costs will be passed on to consumers, who are unwilling to pay for it.

      You return to this point multiple times, but the underlying assumption is that working more carefully and so reducing failures in the longer term will be significantly more expensive. I don't see much evidence anywhere in this discussion to support that assumption, though. Nor is it self-evident that, to pick a very simple example, coding in a language that requires nullability to be explicitly declared would take significantly longer than coding in a nullable-by-default language, other things being equal. (Personally I would be comfortable extending that same argument to much more powerful types of case analysis as well, but for now I'll stick with an example that will be familiar to almost everyone.)

      As for security being a significant threat, the problem here is that humans are very bad at evaluating the risk from low-probability, high-damage events. "It would never happen to me," said no-one who had ever actually been the victim of identity theft and spent the next 3-6 months of their lives trying to recover the financial losses and repair their reputation, yet most people don't spend even a very small amount of time and money to check their credit record every now and then.

      Similarly, I suspect most non-geeks have little idea how much damage might be caused by some of these security and privacy failures, and are often harmed without even realising it. To pick a familiar analogy again, consider this: do you know what proportion of your car insurance premium is only there because of insurance fraud? I don't; I have no data to determine a precise figure. But certainly insurance fraud appears to be a significant problem, because from time to time insurance companies mention figures like 5% or 10% changes in premiums just in response to specific trends in fraudulent claims. Now extend that principle to every software system you depend on, knowingly or unknowingly.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    58. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      Actually, it turned out that the XP issue was mostly a red herring, and most of the NHS systems affected were running Windows 7 anyway. They were within a regular support period, and the relevant bug fix had been available for a few weeks. Unfortunately, as so often seems to be the case, that fix hadn't been installed in timely fashion, leaving the systems vulnerable when the attack hit.

      But all of that is irrelevant to the main point here. WannaCry spread by using the EternalBlue exploit, which is based on a remote code execution vulnerability on receipt of data in a certain format from an attacker. That vulnerability was present -- and, controversially, known to certain people but not disclosed to Microsoft -- long before the patch was available. Obviously a more defensively structured system would not admit such a vulnerability or need patching in the first place, and that is exactly the sort of area that formal methods can help with.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    59. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      Mainstream programming is bad because of bad programmers.

      Sometimes, yes, but mainstream programming is also worse than it could be because generally decent programmers who would like to do a good job aren't necessarily aware of the tools and methods available to help them do so.

      This isn't a failure of skill or attitude, it's a failure of education. That problem can be solved, but the first step to solving a problem is acknowledging that it exists.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    60. Re:Yes, go ahead! by epyT-R · · Score: 1

      That would put programming out of the reach of just about everyone but the largest institutions. I'm not sure such power held by so few is good for a free society.

    61. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      We have some reasonable ideas for producing very high quality, money-no-object software, I agree. However, in most cases, money is going to be a relevant factor. Unless we're talking about things like safety or privacy issues, where significant and unfixable physical or mental harm may result, the question is often going to be a trade-off between accepting some level of risk voluntarily in return for keeping costs down.

      I don't think we have as much experience as an industry with this very wide middle ground yet. In particular, I think there are a lot of improvements that could potentially be implemented at very modest extra costs and with significant resulting benefits, but relatively few developers are even aware of them and so relatively little software is being developed using them to learn about what does and doesn't work both in absolute terms and in terms of cost-effectiveness.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    62. Re:Yes, go ahead! by shubus · · Score: 1

      Finally! Someone who gets it!

    63. Re:Yes, go ahead! by david_thornley · · Score: 1

      If you're discussing safety, please do not use "C/C++". They're very different in that respect., with C++ providing most of the specific safety guarantees people are talking about for Rust.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    64. Re:Yes, go ahead! by serviscope_minor · · Score: 1

      , but it is not a formally verified type system

      My mistake. I thought it was. It appears it's partially (i.e. a restricted subset has been) been verified, but I misremembered that it had all been.

      --
      SJW n. One who posts facts.
    65. Re:Yes, go ahead! by michael_wojcik · · Score: 1

      I think we should replace c with COBOL, no pointers, no dynamic memory allocation, rounding errors with floats rare and all strings fixed length.

      COBOL has pointers, dynamic memory allocation, native floats, and variable-length strings. That's true of all the predominant COBOL dialects today.

      True, it also has non-native numeric types with different roundoff behavior; and traditional COBOL code generally uses fixed-length strings; and you're free to write COBOL code without pointers and dynamic memory allocation.

      But then you can do all of those things in C, too.

    66. Re: Yes, go ahead! by dargaud · · Score: 1

      It was a whole 6 hours between the first public release of their formally verified microkernel and someone finding the first exploitable security vulnerability.

      Ha. Ha. Ha. Sad Beep...

      --
      Non-Linux Penguins ?
    67. Re: Yes, go ahead! by TheRaven64 · · Score: 1

      The toy project is the most complex piece of software that has been formally verified. The fact that you consider it to be a toy project tells you everything that you need to know about the current state of the art in formal verification.

      --
      I am TheRaven on Soylent News
    68. Re:Yes, go ahead! by WaffleMonster · · Score: 1

      He's suggesting that when you refactor a critical piece of C code - in other words you're already going to change it

      How does this actually work in practice? Are people really going to tolerate random portions of code written in different languages? How do you manage and debug that? This thing here jumps into that other language and then back out... and back again... For many projects such advice would seem as a practical matter to devolve into rewrite it all or don't do it at all.

      in other words you're already going to change it and potentially add brand new C/C++ security issues - you instead use a language with some form of god damn formal verification and some fucking way of validating that you're not opening a new exploitable vulnerability that will bring down half the damn internet.

      General purpose language selection is mostly irrelevant syntactic noise.

      All Rust does is impose constraints... not even that noting it still allows access to "unsafe" operations. Nothing prevents imposition of the very same constraints in C/C++ with very same result as "rewriting in rust". It's all a syntactic shell game.

      People who care about buffer overflow vulnerabilities will spend their time improving analysis algorithms, allow developers to enable enforcement of voluntary constraints and correct deficiencies in poorly designed base libraries. Tree huggers go around telling people to write shit in different languages in order to solve a specific problem.

    69. Re:Yes, go ahead! by dargaud · · Score: 1

      I'm always amazed at the number of C programmer who don't use -Wall to get all the necessary warnings. If you check them all out, it removes a large amount of bug/vulnerabilities already.

      --
      Non-Linux Penguins ?
    70. Re: Yes, go ahead! by Chris+Mattern · · Score: 1

      the underlying assumption is that working more carefully and so reducing failures in the longer term will be significantly more expensive. I don't see much evidence anywhere in this discussion to support that assumption, though

      Once again you put the burden of proof in the wrong place. You have to prove that reducing failures through your proposed methods *won't* be significantly more expensive. Until you do, nothing will happen.

    71. Re: Yes, go ahead! by Chris+Mattern · · Score: 1

      Similarly, I suspect most non-geeks have little idea how much damage might be caused by some of these security and privacy failures, and are often harmed without even realising it. To pick a familiar analogy again, consider this: do you know what proportion of your car insurance premium is only there because of insurance fraud? I don't; I have no data to determine a precise figure. But certainly insurance fraud appears to be a significant problem, because from time to time insurance companies mention figures like 5% or 10% changes in premiums just in response to specific trends in fraudulent claims. Now extend that principle to every software system you depend on, knowingly or unknowingly.

      And yet, the insurance industry is willing to endure the cost of those fraudulent claims rather then incur the expense of stamping them out. The same principle applies here.

    72. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      The insurance industry is based on estimating risk. Sometimes they get it spectacularly wrong and lose huge amounts of money following a catastrophic event. Sometimes they get it subtly wrong due to not fully understanding the situation, and lose still quite large amounts of money without really understanding why. Those costs are still there, whether or not the industry collectively knows about them or has any awareness of better alternatives.

      And of course, to the insurance industry, even a human life is just a dollar value, and anything you can't be sued for has little if any value at all. People with ethics might take a different view.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    73. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      Well, that's not entirely true. To summarise my arguments from this discussion:

      1. There is ample evidence of real and serious costs due to software failures. The NHS fiasco is a clear example, and hardly the only one in recent times.

      2. There is ample evidence that we can build high quality software if we are willing to adopt alternative methods and tools. Many safety-critical areas already do. (Note that this point has no reference to cost.)

      3. There are techniques that can self-evidently be adopted with negligible cost and still make some improvement. C, and by extension C++, are languages that have many fundamentally dangerous elements that have literally no benefit, and which are often avoided by more modern languages.

      (To expand on this point with a few more examples, there is no need for null-by-default, or ubiquitous types like enumerations and void pointers that aren't type safe, or standard library functions to deal with null-terminated strings that have no mechanism to prevent buffer overruns, or allowing silent confusion of = and == in a conditional expression. These things have caused countless bugs over the years, that would be entirely avoidable in new software today.)

      4. So far, we have established that serious problems are caused by poor software quality, that much better quality is achievable without reference to cost, and that some improvements can be achieved with negligible cost. What remains is the question of what the cost/benefit curve looks like between those established extremes. How far to go for any given software development project would then necessarily depend on the nature of the software and the risks associated with its failure.

      5. The human cost of software failure may be extremely high in individual cases and is certainly high in aggregate, but the developers of that software are often relatively unaccountable for those failures. One way to promote improvements in quality is to increase that accountability to more realistic levels in line with other products and services. This would encourage developers to experiment with better development processes and tools rather than staying in their comfort zone, which in light of the above is not an unreasonable strategy if our goal is to reduce those human costs.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    74. Re: Yes, go ahead! by Chris+Mattern · · Score: 1

      You have described a gold mine for the taking. So why are you debating this point on Slashdot instead of starting a software concern to cash in on all this?

    75. Re: Yes, go ahead! by Anonymous+Brave+Guy · · Score: 1

      I have been running software businesses and working in fields where high reliability is important for many years, and we have sometimes achieved things that (as far as I'm aware) no-one else working in the same area has, in part thanks to this careful and systematic approach. This is why I have quite strong views on this issue.

      Of course, just because we've done OK, that doesn't mean I can't encourage other developers and their customers to share in the benefits as well. Nor, sadly, does it make me immune to the consequences when I use or depend on software written by people who didn't. It's in everyone's interests for the software development industry as a whole to become more aware of some of these ideas and up its game.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    76. Re: Yes, go ahead! by TheRaven64 · · Score: 2
      Two things:

      First, verifying the type system is formal verification, applying the results of a formally verified type system is still just type checking, not verification (except in the loosest possible sense of the word, with about the same level of accuracy as when the press says 'AI' when they mean 'algorithm'). A lot of verification works by reducing the problem to type checking, but in the case of Rust the guarantees afforded by the type system are not correctness according to the specification of your program (the property that you get from verification), they are much weaker (e.g. no data is aliased and mutable at the same time).

      Second, unlike that of Pony, the Rust type system is not yet verified and usually this kind of process is iterative, with the type system being found to be unsound during the verification process and fixed. Type systems are assumed to be unsound until they have been verified, type checking against an unsound type system is a long way from verification.

      --
      I am TheRaven on Soylent News
  2. Ada by Anonymous Coward · · Score: 4, Interesting

    Why now? Why rust? What about Ada? They're not so different that somehow the argument becomes that much better than it was for Ada. I just don't get all this rust hype. But, then again, I'm a C programmer, and I am 100% certainly I won't see C replaced in the systems I work on (cars), so it's a moot point. I would, however, support a move to Ada. My industry would never consider Rust. Pushing it over Ada is actually counterproduction, because it primes the C-suite to see languages pushed as a replacement for C as immature. Rust is still immature, way too immature for a conservative industry. Ada, though... maybe not.

    1. Re:Ada by david.emery · · Score: 4, Interesting

      In part it's a cultural thing. Ada is considered "complex and verbose" (but compare with Java). Ada is, of course, from the DoD, so it's "obviously bad." Most importantly, Ada requires a bit more thought before you jump into the code.

      The interesting thing about Ada is that a skilled practitioner learns how to use the language to his advantage. You code so the compiler checks as much as it can, so you can concentrate on things the compiler can't check. When the compiler and you agree the code is correct, it probably is, at least with respect to typos and coding errors.

      One big criticism I have with most languages, even those with a type system, is they don't support strongly typed scalars. But that's where type errors are most common. I don't think I ever tried to "add apples to oranges". But I have tried to add "count of apples" to "count of oranges" (or more specifically, once tried to add horizontal pixel location to vertical pixel location.)

      Furthermore, those who think their C code is "close to the machine" don't know much about modern machine architectures. Compilers do a LOT MORE work than they did in the days of the PDP-8/PDP-11 or original x86 family. Ada (among other 'higher level' languages) provides the modern compiler with a lot more information for code selection and optimization. For example, register flushing is a lot easier to manage in Ada because pointer types are always declared as such, and unless there are specific language constructs, the compiler can prove a given variable will not be accessed through its address (and therefore doesn't have to spill the register to memory.) That's a simple example, compiler optimizations and instruction scheduling are very complex topics.

      Finally, I've always thought C syntax was harmful, because it's so easy to make a mistake, either through ignorance or simple typo ("=" vs "==").

      I know experts can do amazing things in C. Aren't that may experts out there slinging code, and most of the software we use these days shows it!!

    2. Re:Ada by sphealey · · Score: 1, Interesting

      Two other issues:
          1) having lost the race, there is no longer a viable ecosystem of Ada compilers, tools, etc outside of a few specialized (and very expensive) aerospace and DoD environments. That creates a large chicken-and-egg barrier to its use
          2) Back in the day Dijkstra strapped on the 10 most powerful swords and warhammers in human mythology and went after Ada full force. At the time his criticisms seemed on point, but with knowledge of what came after (e.g. Java) his objections were perhaps overly strong. Be that as it may the damage was done and the reputation of Ada never recovered.

      sPh

    3. Re:Ada by Zontar+The+Mindless · · Score: 1

      What about Ada?

      I came to this story to post this very question.

      --
      Il n'y a pas de Planet B.
    4. Re:Ada by phantomfive · · Score: 2

      How does Ada prevent buffer overflows?
      How does Ada prevent memory leaks?

      (Maybe I should also ask how Ada prevents rockets from exploding, but Rust won't do that either)

      --
      "First they came for the slanderers and i said nothing."
    5. Re:Ada by david.emery · · Score: 2

      #1 is not true. See https://sourceforge.net/projec... There's been a GPL Ada compiler for at least 30 years. The Ada Core product is open source, you pay for maintenance.

      For #2, the debate in many respects boils down to "simple programs in complex language" or "complex programs in a simple language." But see http://www.adacore.com/sparkpr... (and there are free versions of that, too), for a subset of Ada specifically designed to support proof-of-correctness.

    6. Re:Ada by Rockoon · · Score: 4, Interesting

      This will come up again and again. Every generation will need to be taught about Ada.

      This guys beginning premise is wrong. People dont use C because its "getting down to the bare metal and working at mach speed." C is not a "bare metal language" so that cannot be the reason. The reasons that people use C mainly stem from it being based on a simple yet expressive-enough abstract machine.

      C isnt the ideal language for its purpose. The issue is really that none of the other languages are suitable upgrades. Many of those other languages can greatly help with "security" .. truly they can .. but they are not based on a "simple yet expressive-enough abstract machine."

      Now Ada as used in practice is the language if you are looking for formal proofs about the algorithms expressed. Not only does the Ada abstract machine lend itself to formal proofs, there is a whole mature ecosystem of analysis software for Ada already there and being used. Quite a bit of military contract stuff has to be done in Ada.

      --
      "His name was James Damore."
    7. Re:Ada by 0100010001010011 · · Score: 1

      I won't see C replaced in the systems I work on (cars),

      C isn't being replaced but it also isn't being written.

      Simulink Embedded Coder / "Model Based Design" is taking over most industries.

      It's trivial to switch between C/C++. Adding Rust, ADA, etc shouldn't be too much of a leap.

      Rule of Generation

      • Developers should avoid writing code by hand and instead write abstract high-level programs that generate code. This rule aims to reduce human errors and save time.
    8. Re:Ada by david.emery · · Score: 2

      1. No address arithmetic. Arrays are programmed with bounds-checking, usually through dope vectors generated by the compiler. It is a requirement of the language to generate an exception if you try to go beyond the bounds of the array.

      2. Ada handles pointers through access types (which, by the way, are always checked before dereferencing to be sure the pointer is not null). There are coding styles and means to do memory management, e.g. setting up a memory pool for a specific access type. Ada95 and beyond includes good support for constructors and destructors. Under some circumstances, the compiler can prove when there are no more extant values for a given access type and reclaim the entire pool.

      That being said, if you're not a bit careful, you can program storage leaks in Ada through the normal mechanisms. It's not 100% foolproof. Some competence by the developer is required.

      And there are means to escape the restrictions of the language. These have substantial syntactic sugar, so the developer (coder, reviewer, tester) knows "we are now doing something extraordinary. Certain checks provided by the language no longer apply here." In my experience, the most skilled developers work on this stuff (carefully) and then package it up (pun intended!) for use by the rest of the project.

      And the Ariadne 5 incident is interesting, in part because the developers -turned off- the checks provided by the language!!! That's kinda like deciding you don't need seat belts in your car driving down the highway, because it passed crash testing.

    9. Re:Ada by Zontar+The+Mindless · · Score: 1

      ...there is no longer a viable ecosystem of Ada compilers, tools, etc outside of a few specialized (and very expensive) aerospace and DoD environments.

      Say what? I've got gcc-ada installed on the system I'm using to post this.

      --
      Il n'y a pas de Planet B.
    10. Re:Ada by squiggleslash · · Score: 1

      Buffer overflows are a uniquely C (and assembler) thing. Most programming languages do actually do bounds checking, and will generate a run time error if you attempt to write more data to an array/block/other fixed size container than will fit. Ada is a normal programming language in this respect.

      Addressing memory leaks is a more complex subject, but you can reduce memory leaks if your programming language is built properly. You can't eliminate them, because it's always possible for a programmer to keep around data that they never intend to use again, but you can certainly reduce it through various garbage collection strategies.

      In Adas case, the programming language's eschewing of (direct, rather than implied) pointers and general memory model is ideal for automatic garbage collection. Ada compilers usually don't implement it because AGC is difficult to make real time, which is a requirement for many Ada applications, but there's nothing stopping a desktop-oriented Ada implementation from implementing it.

      --
      You are not alone. This is not normal. None of this is normal.
    11. Re:Ada by sphealey · · Score: 1

      That's one. How many industrial-quality C compilers are on the market and what is their price range?

    12. Re:Ada by phantomfive · · Score: 2

      Arrays are programmed with bounds-checking, usually through dope vectors generated by the compiler. It is a requirement of the language to generate an exception if you try to go beyond the bounds of the array.

      Doesn't a bounds-check on every array access slow things down?

      --
      "First they came for the slanderers and i said nothing."
    13. Re:Ada by david.emery · · Score: 1

      1. It's maybe 1 instruction on most architectures.
      2. If you want security, you have to pay for it.
      3. In many cases, the compiler can prove the bounds check is not needed!
      Consider
            for index in some_array'range loop
      ... some_array(index) ....
            end loop;
      Unless you modify index (as an "l-value"), the compiler knows the values for index are exactly the bounds of the array (because 'range returns the range of values for the object some_index), so no bounds check is required. If the compiler does detect that index can be modified, it would need to insert a bounds check.

    14. Re:Ada by phantomfive · · Score: 1

      Most programming languages do actually do bounds checking, and will generate a run time error if you attempt to write more data to an array/block/other fixed size container than will fit.

      Most programming languages are slower as a result of this bounds checking at runtime.

      --
      "First they came for the slanderers and i said nothing."
    15. Re:Ada by Hentes · · Score: 1

      The first big problem with Ada is that its developers looked at the Pascal syntax and decided it would be a good challenge to make it even worse. In Ada variable, a pointer dereference (of any level) and a nullary function call look exactly the same. The second problem is that key language features have never been standardised. Some compilers support garbage collection, while in others you have to manage memory allocation by hand, which can easily leave you wondering why your code have suddenly started leaking memory after you switched compilers. Ada is not safer than C, it's just bad in different ways. The only people who like it are the language flagellants who believe the suffering will automatically lead to better code.

    16. Re:Ada by digitig · · Score: 1

      I don't know how many industrial-strength C compilers there are. There are not many industrial-strength Ada compilers because there's not much demand, but there are a few. The main project I've worked on involving Ada for a mission-critical application used AdaCore's GNAT PRO (they'd switched from another compiler - I don't know which one - and found GNAT PRO's built-in static checking to be far superior). AdaCore is cagey about pricing, though. I have a Janus Ada installation set somewhere; that's from US$195 for a single seat. So Ada is quite affordable (there's always the GPL, non-PRO, version of GNAT for getting to know the language).

      --
      Quidnam Latine loqui modo coepi?
    17. Re:Ada by sphealey · · Score: 1

      = = = here are not many industrial-strength Ada compilers because there's not much demand, but there are a few [adahome.com]. = = =

      Which is what I said ;-)

      = = = AdaCore is cagey about pricing, though. = = =

      Always how it is in the aerospace and DoD worlds!

    18. Re:Ada by digitig · · Score: 1

      Doesn't a bounds-check on every array access slow things down?

      Not much. Ada is quite capable of hard-real-time applications (in some cases it's an advantage for those applications because the B&D nature of the language makes it more straightforward to write programs with a bounded maximum execution time, which can be more valuable than knowing something is usually a bit faster). And most compilers will let you switch it off, which might be sensible if you've proved out-of-range access to be impossible. Of course, if you're determined you can write crummy code and turn off all checking. Ada doesn't stop you shooting yourself in the foot: it just makes damn sure you know you're doing it.

      --
      Quidnam Latine loqui modo coepi?
    19. Re:Ada by RhettLivingston · · Score: 1

      I guess the chip makers would love that. Finally, something to obsolete all of the existing HW that has been building up over the past few years as we've not had any new killer app using local processor cycles. Only, instead of giving us new features, it just runs less efficiently.

      In my experience, I've been able to achieve 30+ times speed increases most of the time when rewriting system-level Ada code in ANSI C. I've seen new generations of avionics hardware with 100-fold speed increases that ended up having no or very few new features because the language change and the change to multiple tasking across many processors sucked up all of the new bandwidth.

      Put the kool-aid down.

    20. Re:Ada by ThosLives · · Score: 1

      Rule of Generation Developers should avoid writing code by hand and instead write abstract high-level programs that generate code. This rule aims to reduce human errors and save time.

      In my experience Simulink and its toolchain is painful. It also doesn't help that it's proprietary, expensive, and doesn't lend itself nicely to collaborative development (ever try to to merge two branches with changes to the same .mdl file? Oh, and if you use the new .snx files, you can't even merge them, because they are binary...). Developing complex code in Simulink is painful - you think spaces vs tabs is a pointless debate? You should hear discussions about how to route your signals in Simulink or how you should group your subsystems.

      I think autocoding is indeed the future, but I long for something better than Simulink.

      While Simulink may reduce some kinds of errors, I have never once had it save time. At least in the code I've written, I can *always* write it faster in C than in Simulink. Now, reviewing Simulink I will say can indeed be faster than reviewing C code, but writing it? No way.

      --
      "There are a dozen opinions on a matter until you know the truth. Then there is only one." - CS Lewis (paraprhase)
    21. Re:Ada by Kiwikwi · · Score: 1

      you can program storage leaks in Ada through the normal mechanisms. It's not 100% foolproof. Some competence by the developer is required.

      People say the same thing about C++. (Just remember to use RAII, smart pointers, etc.)

      Ada is a safeR language than C, sure. But Rust is, plainly, a memory safe language. There's no comparison.

    22. Re:Ada by david.emery · · Score: 1

      And those programs are vulnerable to exploitation due to the lack of bounds checking.

      Please produce real numbers for real programs demonstrating a significant cost from bounds-checking.

      Seriously, a single instruction bounds-check that prevents a security breach is a damn small price to pay! (Some instruction sets even do this as a side-effect, I think.)

    23. Re:Ada by david.emery · · Score: 3, Insightful

      The particular interesting thing about -avionics- is the cost of development is dwarfed by the cost of verification. I remember a presentation by Boeing Commercial Aircraft on the 777. They said, "We've done DO-178b Level A in a bunch of languages. For most languages, the cost to develop and the cost to verify is pretty much the same. For Ada [Ada83 - this was in the 90s], the cost to develop in Ada was 25% more than other languages. But the cost to -verify- that Ada was about 1/4 the cost of any other language. DO-178b Verification costs up to 10x development," He wouldn't say just how much that cost for 777, but he strongly implied it was multiple billions of dollars.

    24. Re:Ada by Megol · · Score: 1

      Generally no. That's because the language specifies that bounds checking is required but the generated code can avoid such checks it it is safe to do. Checking is done in the cases where it is or can be unsafe to remove them.

      But even if checks are done the overhead is small in most cases. Sure one can create a scenario where bounds checking for a certain workload for a certain machine have a strong performance impact but in the general case there is little or none measurable impact.

      For x86 a bounds check would look something like this (I ignore the 16/32 bit instruction designed for this as it is slow, not used and removed from 64 bit mode):
      cmp ecx, upper ; is (unsigned)ecx>upper
      ja .check_fail ; if so branch to handler

      In the normal case both of those are 1 cycle instructions, 6+6 bytes (or 6+2 if a short branch can be used). That doesn't mean the pair will take 2 cycles, modern x86 folds them into one operation taking 1 cycle. Modern processors are also superscalar and can execute several instructions per cycle, in many cases this kind of check can be done "for free" when the processor wouldn't be able to fill all execution units anyway.

    25. Re:Ada by Megol · · Score: 1

      Unique? Hardly.

    26. Re:Ada by 0100010001010011 · · Score: 1

      It also doesn't help that it's proprietary, expensive

      Develop something else. .mdls are XML with a known format. Given how fancy Jupyter Notebooks has become I'm shocked someone hasn't come up with a ModelBased web GUI that would autocode down to C, Python, etc.

      snx

      *slx. It's just a zip file of XML files. No different than any of the "binary" office document formats that are just compressed xmls.

      The format is easily opened and parsed as XML in Python or any other language. No one in OSS has taken the initiative to do anything with it.

      doesn't lend itself nicely to collaborative development

      I actually like it more for collaborative development because it means you have to break apart your system into libraries. It pushes our team to the UNIX philosophy. Peers insisted on one massive model until merging went to hell. Now that everything's broken apart it's much easier to unit test.

      You should hear discussions about how to route your signals in Simulink or how you should group your subsystems.

      Been there done that. We have style guidelines just like any other 'code.' Some of that is dictated by standards like DO-178C and we let Simulink validation handle if it was done 'right'. (No different than linting hand written code).

      At least in the code I've written, I can *always* write it faster in C than in Simulink.

      I'm the opposite. I can knock out a complex controller much, much faster in Simulink. Changes are even faster. Need to test it on an 8-bit controller, switch everything to fixed point. Need to validate fixed point vs floating point? A few clicks.

    27. Re:Ada by ckatko · · Score: 1

      It's really not as slow as you think. There are tons of things we use every day (syscalls like "get time") without realizing they're orders-of-a-magnitude slower.

      Also, in D, for example, it's a simple compiler option to turn array bounds checking off, and IIRC, it's only turned on during debug mode. So you can, with a single switch, benchmark whether your code is any bit noticeably slower or faster. (Plus D directly supports unit tests and benchmarking in the language.)

      And that's a hell-of-a-lot easier than having to ASSERT every single array access MANUALLY. I'm a fan of "default on: MANUAL off" error checking. It's way too easy to forget to add your custom error checking, as opposed to intentionally telling the compiler "don't check this one spot." Any checking that requires the user to remember to add that checking is adding another dimension of possible failure modes.

    28. Re:Ada by ckatko · · Score: 2

      You are what you eat?

    29. Re:Ada by serviscope_minor · · Score: 1

      One big criticism I have with most languages, even those with a type system, is they don't support strongly typed scalars. But that's where type errors are most common. I don't think I ever tried to "add apples to oranges". But I have tried to add "count of apples" to "count of oranges" (or more specifically, once tried to add horizontal pixel location to vertical pixel location.)

      I don't know if you kow, but you can do those in C++. The std::chrono library has a rather nice implementation. You can add miliseconds to seconds and it gets it right. it also distinguishes between durations and points in time both of which are ultimately scalars, but it's been programmed with the semantics so the correct things come out when you do the arithmetic.

      That also meshes well with C++'s user defined literals. There also exist physical unit libraies, so if you;re dealig with quantities, you can guarantee at compile tme that your arithmetic is all dimensionally correct.

      I'd imagine most languages which allow for operator overloading will allow you to make strongly typed scalars to some extent.

      --
      SJW n. One who posts facts.
    30. Re:Ada by sciengin · · Score: 1

      Wait, formal proofs in Ada?
      Are you sure you did not mean Agda?

      I think too that Ada would be a great replacement for C and that its type system is quite powerful, but formal proofs should probably be left to Agda, Coq and maybe Haskell.

    31. Re:Ada by phantomfive · · Score: 1

      Hard real-time is completely different than performance. Hard real-time means you know how long it will take, not that it will go fast. For every function call you can say, "this function will take no longer than X seconds"

      --
      "First they came for the slanderers and i said nothing."
    32. Re:Ada by phantomfive · · Score: 1

      It really depends on the situation. In most cases, I agree with you, adding an extra check won't matter (and usually I use some kind of queue instead of an array, which takes even more time). But in situations where arrays are very large, you often do want to cut execution time as much as possible. These kinds of situations pop up in image processing, for example.

      --
      "First they came for the slanderers and i said nothing."
    33. Re:Ada by david.emery · · Score: 1

      Image processing routines have had more than their fair share of vulnerabilities. All the more reason to use a language that can eliminate most checks.

    34. Re:Ada by phantomfive · · Score: 1

      Yes they have, and it's super hard to write an image processing routine for the same reason that it's hard for a compiler to prove they are correct automatically.

      But whether it's secure or not wasn't the question.......you changed the subject.

      --
      "First they came for the slanderers and i said nothing."
    35. Re:Ada by roca · · Score: 1

      Ada has nothing like Rust's affine type system and the Rust features that flow from it --- strong control of aliasing, immutability guarantees (while you have an immutable reference to data, *nothing* else can modify that data), data-race freedom, dynamic memory allocation with no possibility of dangling pointers while not requiring GC/refcounting, etc.

      This paper explains the unique virtues of Rust in a language-theoretic manner: https://people.mpi-sws.org/~dr...

    36. Re:Ada by phantomfive · · Score: 1

      Is there a good ADA tutorial somewhere that you can recommend?

      --
      "First they came for the slanderers and i said nothing."
    37. Re:Ada by david.emery · · Score: 1

      Only partially... Image processing routines have been subject to buffer overrun attacks. Buffer overrun attacks occur when array bounds aren't checked. The core question is the efficiency of such checks (versus the security they provide.)

      If the compiler has type information on the index, then in many cases it can (easily) prove that a range check is not required.

      Consider:

            type index_t is range 1..10:
            type image_element_array is array (index_t) of image_elements;

      Now any object declared of type index_t does not require a range check when used as index for an object of type image_element_array. Under some circumstances, -creating a value of type index_t- does require that check (e.g."my_index := my_index + 1;" will require a range check on the assignment. If you try to assign "11" to my_index, either directly or because the previous value of my_index was 10 and you tried to add 1 to it, you'll raise Constraint_Error exception at that statement. And this is where Ada started out superior to Pascal, because you never really knew what would happen in Pascal if you violated a range constraint.)

      But the 'right way' to iterate over an array, one that is perfectly type safe, is
              my_image : image_element_array;
      -- somehow my_image gets loaded
              for an_index in my_image'range loop ...
      -- all values of an_index are within the range of values for my_image; compiler does not need to generate any range checks for my_image (an_index) !!

    38. Re:Ada by ThosLives · · Score: 1

      No one in OSS has taken the initiative to do anything with it.

      The MathWorks is notorious for litigation. There's a reason why they are expensive and there are no (or is it merely 'few'?) alternatives.

      I actually like it more for collaborative development because it means you have to break apart your system into libraries.

      You've never had two people try to change the same library at the same time? That's what I meant by merging. I guess you could argue then that the library is too big - but if you get any smaller, they aren't libraries but single files for a single block. (Which actually might not be a bad thing, mind you!)

      I'm the opposite. I can knock out a complex controller much, much faster in Simulink....

      If you said Stateflow I might agree with you - that is a great tool, and I can indeed write state machines much faster using it than by hand.

      Changes are even faster. Need to test it on an 8-bit controller, switch everything to fixed point. Need to validate fixed point vs floating point? A few clicks.

      That is indeed a technical feat that is nice. But it is kind of terrifying in other ways. Especially since you mentioned DO-178C earlier...I can't imagine the impact analyses required to make such a fundamental architectural change on a DO-178 project (unless you're talking about some kind of library code re-use?).

      --
      "There are a dozen opinions on a matter until you know the truth. Then there is only one." - CS Lewis (paraprhase)
    39. Re:Ada by phantomfive · · Score: 1

      But the 'right way' to iterate over an array, one that is perfectly type safe, is

      This completely misunderstands how compression algorithms work. You often don't know how large an array you need until you are done compressing.

      --
      "First they came for the slanderers and i said nothing."
    40. Re:Ada by david.emery · · Score: 2

      There's a lot of good stuff here: http://www.adahome.com/ and here: http://www.adaic.org/

      And It's "Ada" not "ADA". The language name is not an acronym. Rather it's named after Ada Countess Lovelace, see https://en.wikipedia.org/wiki/... The choice of the name was deliberate, Ada Lovelace is commonly cited as the first computer programmer (for Babbage's Analytical Engine). And that name long pre-dates the current initiatives for "women in computing." (There were a fair number of women involved with the Ada program, such as the late Jean Sammet, quite unusual in the late 1970s/early 1980s during the initial development of the requirements and then language itself.)

    41. Re:Ada by david.emery · · Score: 1

      OK, not the right data type in that situation. In that case, you'll have to use a dynamic structure with runtime bounds-checking.

    42. Re:Ada by roca · · Score: 1

      > Control of aliasing? There's a keyword for that.

      Ada's "aliased" keyword simply controls whether you can create a reference to a variable at all, so you have two options: "no references" or "free-for-all". Rust is vastly more powerful. Read the Rustbelt paper.

      > Immutable references? You can find examples in the standard container library.

      Not sure what you're referring to. Ada's "constant" keyword is like C/C++ "const": you can't modify the value through that reference, but it could change under you via modification through some other reference. That's much weaker than the guarantee that Rust can provide.

      > Data race freedom? Protected types.

      Haha, by forcing taking a mutex for every read and write? No thanks. Plus, the option to use "protected" is just that, optional; the language is not statically preventing the programmer from introducing data races, like Rust does.

      > No possibility of dangling pointers? Access level restrictions.

      I'm not sure what you mean here. Rust provides static deallocation with compile-time checking that you don't leave dangling pointers, but in Ada deallocation is unchecked.

    43. Re:Ada by egilhh · · Score: 1

      And it's illegal to modify Index anyway...

    44. Re:Ada by egilhh · · Score: 1

      Please produce real numbers for real programs demonstrating a significant cost from bounds-checking.

      http://benchmarksgame.alioth.d...

    45. Re:Ada by TheRaven64 · · Score: 1

      Image processing routines are exactly the sort where compilers are good at eliding bounds checks. The input size is fixed, the filter size is fixed, and scalar evolution lets you calculate up-front the maximum index using well-known analysis techniques. It's then easy to hoist the checks out of the loop and leave a single 'will this loop ever overflow' check, with no bounds checks during the calculation.

      --
      I am TheRaven on Soylent News
    46. Re:Ada by robinsc · · Score: 1

      But it sucks as a programming language so it fails as a popular language.

      --
      Linkedin http://in.linkedin.com/in/robinsaikatchatterjee
  3. Re:Betteridge's Law bullshit by war4peace · · Score: 2, Funny

    Well ain't that a self-confirming statement...

    --
    ...gis sdrawkcab (usually not responding to ACs; don't bother posting as AC)
  4. That's a bit rusty... by __aaclcg7560 · · Score: 1

    I can't see CPython being replaced by RustPython anytime soon.

  5. Or Ada. Or Erlang... by sphealey · · Score: 1

    = = = Today I am seriously suggesting that when engineers refactor existing C code, especially parsers and other input handlers, they replace it -- slowly, bit by bit -- with Rust. = = =

    Or Erlang. Or Ada. Or PL/I. Or... or any of the 23 languages/environments that have been proposed since the Ada/Pascal/C split circa 1975. Yet none of these proposals have taken root. Why not? Seems to me that is just as important a research question as developing Yet Another Correct Compiler for the Unbreakable Language.

    sPh

  6. An embarrassing admission by BarbaraHudson · · Score: 4, Insightful

    Basically, this is an admission that the average programmer is fairly shitty. Then again, you don't want average programmers working on anything important, so by sticking with c, you're not going to get the "rust, rust, baby" programmers.

    --
    "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    1. Re:An embarrassing admission by Anonymous Coward · · Score: 2, Informative

      While in grad school I had a roommate take an introductory to programming course. I saw grave errors in the example code the lecturer was giving the students. It starts with the education. If they are not taught properly from the beginning don't expect anything but crap later.

      In the basic read stuff from a file example given to the students -

      char c;
      while ( (c=getc)!=-1) {
      }

    2. Re:An embarrassing admission by BCooley · · Score: 4, Insightful

      Yeah.. expert C programmers never write insecure code.

      Except for when they do, which is pretty much constantly because true expert C programmers know it's impossible to write any large piece of C/C++ software using it's native features without making at least a few mistakes.

      If you're a C programmer, and you don't already know this, then you aren't an expert.

    3. Re:An embarrassing admission by BarbaraHudson · · Score: 1

      Any smart teacher will slip in a mistake once in a while to see if anyone is paying attention. Then again, I'm not saying all, or even a majority, are smart.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    4. Re:An embarrassing admission by Anonymous Coward · · Score: 3, Insightful

      If the only way you can document your code is "this may look wrong but it's not" You're a shitty developer.

    5. Re:An embarrassing admission by gweihir · · Score: 1

      Indeed. Well said.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    6. Re:An embarrassing admission by gweihir · · Score: 1

      So your argument is we should move to something new because it has not been proven that it is worse than the old thing? Are you suffering from dementia?

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    7. Re:An embarrassing admission by Jeremi · · Score: 1

      Basically, this is an admission that the average programmer is fairly shitty.

      Surely that was common knowledge already?

      Then again, you don't want average programmers working on anything important, so by sticking with c, you're not going to get the "rust, rust, baby" programmers.

      Because management is wise enough to understand the pitfalls of the C language and the risks of hiring a mediocre programmer, and will instead let the critical position remain open and let the product's shipping-schedule slip indefinitely until a Really Good C programmer finally comes along -- no matter how long that takes?

      I think you are giving management a little too much credit there :)

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    8. Re:An embarrassing admission by BCooley · · Score: 1

      So your argument is we should move to something new because it has not been proven that it is worse than the old thing? Are you suffering from dementia?

      It's not controversial that it's very difficult to write and maintain secure C/C++ code, and that the the cost of deploying insecure systems has dramatically multiplied in recent years with both criminal and state actors using vulnerabilities to create worldwide chaos.

      If you don't see a problem here that's in serious need of fixing, you've been living under a rock.

    9. Re:An embarrassing admission by tietokone-olmi · · Score: 1

      Rather, it's the claim that even the very best programmers are shitty and need a compiler to handhold them by force. The shitty average uses Java, or other languages that succeeded at memory safety while approximating C's performance (over time, as JIT profiling kicks in).

      The problem with Rust is that the only modes of concurrency it permits are "write before publication, read only until disposal", single copy (arbitrated by channels), and various unsafe BYOB things. This isn't enough for the cost it exacts from e.g. algorithms and data structures. Me, I like my languages with doubly linked lists that aren't built on reference counting.

    10. Re:An embarrassing admission by swillden · · Score: 2

      Of course, a year after I left, someone modified the code and it started eating up ram. When they called me, I told them to put the code back the way it was, because even the source said "this may look wrong - but it's not. DO NOT TOUCH". They reverted to my old code, and everyone was happy.

      So... from that anecdote, are we to conclude that C code is unmaintainable, your code is unmaintainable, or both?

      All in all, your story is a great example of why C is bad. It took a long time to build something that worked correctly, and once completed the code is brittle and unmaintainable, to the degree that you felt the need to comment that it should not be touched. And you were apparently right. Also... the code could still be full of security holes. The fact that it runs correctly in normal circumstances says next to nothing about what happens under attack.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    11. Re:An embarrassing admission by Wrath0fb0b · · Score: 1

      Why do you say that? The average programmers perform at the level (and speed) that his organization requires of him. If you drop them a project to write Linux network driver for some obscure IoT hardware, they'll do just that. What will come out is (usually) a functional Linux network driver

      If you stand up a CI service and reject changes that don't compile/test, then your trunk will never be (too) broken.

      If you give them a fuzzer (or better yet, run it automatically in your CI) and time to investigate and repair the findings, you will likely get a more hardened driver.

      If you have a test rack where the driver is run for thousands of hours with different scenarios, you will likely get a more stable driver.

      If you have CI run all test cases using valgrind/ASAN/scribble, you will likely have fewer memory leaks/vulns.

      An exceptional programmer will see which of these scaffolds are missing from the development team and work to build them up. A shitty programmer will just figure that if things don't have tests, then there's no reason to write them. A shitty management team will not see the lack of support.

    12. Re:An embarrassing admission by roca · · Score: 1

      You can always write your own linked-list library that uses a little bit of unsafe code. Or use one that already exists, like the one in the standard library: https://doc.rust-lang.org/std/...

      I've written a lot of Rust code over the last year. Hardly any of it uses unsafe code, but escaping to unsafe code once in a while is much better than making the whole language unsafe or making the type system super-complicated in an effort to reduce the amount of unsafe code required even further.

    13. Re:An embarrassing admission by roca · · Score: 1

      Even extremely good C/C++ programmers make mistakes that have disastrous consequences. For example, the C++ developers working on browser engines at Microsoft, Google, Mozilla and Apple are extraordinarily good on average, yet every one of their veterans will be able to tell you war stories about security bugs in code they wrote

      There is no large pool of skilled C/C++ programmers who routinely get everything right. Most people who think they're in that pool have simply never had their code thoroughly fuzz-tested or attacked by adversaries.

    14. Re:An embarrassing admission by roca · · Score: 1

      If you make all that investment and fix all those bugs, you will get pretty robust C code, but fuzzers and dynamic analyzers by nature don't find all bugs even of the type they're designed to search for, so you can be sure more of the same sorts of bugs remain.

      But if you use Rust, then whole classes of bugs simply won't happen. Not only will you get more robust code at the end, but it will save most of the time and money you spent hardening your C code.

    15. Re:An embarrassing admission by gweihir · · Score: 1

      It is very difficult to write and maintain secure code in _any_ language. If you do not know that, then you have been living under a rock. This is not a language issue. This is an issue of the coders not understanding what they are doing.

      Seriously, there is no silver bullet [Brooks, 1986] and Rust is not something that really matters to software security. At best, it will be a small incremental improvement, but only when it is a finished language with a stable feature-set and a clear understanding what it can _not_ do.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    16. Re:An embarrassing admission by BarbaraHudson · · Score: 1

      When part of the requirements is to be as heavily optimized as possible in a resource-poor environment, you'll do things that people who haven;t been looking at the problem might think are wrong, even though they're just the most efficient way to do something. Problem is, most people will look at it and try to "fix" it. And in doing so, they fuck it up.

      So I warn them. Same with "there be dragons here" for code that has desired side effects that aren't readily apparent but necessary for proper operation.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    17. Re:An embarrassing admission by BarbaraHudson · · Score: 1

      Considering that there was a history of programmers who had attempted the job, then started polishing their resumes to jump elsewhere when they realized they couldn't do it, putting a warning in for the idiots who, for example, insisted on putting #include windows.h in FreeBSD code is the prudent thing to do. Ditto for morons who are too stupid to keep track of resource allocation (and to design in a modicum of simplicity so that it's possible to keep track of it in the first place) so they end up having to use "smart" pointers.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    18. Re:An embarrassing admission by BarbaraHudson · · Score: 1

      I never said that ANYONE always "gets it right." In fact, mistakes are the best teachers. You need to make a ton of mistakes to gain any level of proficiency. Problem is, most people make a mistake, google for the fix, and move on without gaining any insight as to WHY it's a mistake. Programming by google and rote is just wrong.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    19. Re:An embarrassing admission by BarbaraHudson · · Score: 1

      Absolutely correct. Hence all the disclaimers of liability. So now we have the whole industry running software on software stacks with no legal accountability. Takata would have loved to be able to make air bags with the same disclaimer of liability. Dow Corning would not have gone bankrupt if their silicone breast implants had no liability attached. Ford Pinto?

      Software is a product. The vendor should be legally liable for defects. Sure, it would take longer, but there'd be less tendency to push it out quickly, and maybe fix it later.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    20. Re:An embarrassing admission by david_thornley · · Score: 1

      Do not write C/C++ here. C++, written with an easily enforceable style guide, avoids whole classes of errors C is prone to.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    21. Re:An embarrassing admission by david_thornley · · Score: 1

      Aside from NASA or avionics*, is there any large pool of X programmers who routinely get everything right, for any computer language X? I haven't seen that happen.

      *There are extremely expensive software production techniques that result in very few bugs. These are not normally commercially feasible, partly in that they require specialized developers.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    22. Re:An embarrassing admission by BarbaraHudson · · Score: 1

      Because some people don't know how to do memory allocation properly without them, which means they have to use C++ and the STL. That's what. Duh!

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    23. Re:An embarrassing admission by swillden · · Score: 1

      Hand-holding was deliberately rejected to avoid complexity and increase efficiency. And it worked, until people tried to make things "easier."

      The plethora of serious security defects in code written by highly-competent C programmers gives the lie to this notion.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    24. Re:An embarrassing admission by swillden · · Score: 1

      So... your employer is apparently unable to hire enough competent programmers, and wants the incompetents they do hire to program in the easiest-to-screw-up language in common use. I think the real morons are in management.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    25. Re:An embarrassing admission by david_thornley · · Score: 1

      That isn't my experience. Of course, I usually deal with competent software people.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    26. Re:An embarrassing admission by swillden · · Score: 1

      There is no magic bullet. C is powerful and can be dangerous, but if you're writing security-critical software in C and you don't know how to avoid security holes, I'd say by definition you are not "highly competent."

      The point is that it's quite clear that no one is highly competent at writing security-critical software in C.

      FWIW, I write security-critical software, and I write in C. Well, mostly in C++, which is a little better. I'm pretty good at it, too. Security researchers have found very few problems in my code. But I don't kid myself. I know there are bound to be some issues in there. The same would be true if it were written in Rust, but there are whole classes of problems that are eliminated by use of something like Rust... and there really is no benefit to the lack of safety of C. With C++ I can build some safety nets that C doesn't have, but there are limits.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    27. Re:An embarrassing admission by swillden · · Score: 1

      > The point is that it's quite clear that no one is highly competent at writing security-critical software in C.

      Huh? You literally just said there is a plethora of security defects written by highly competent C programmers. So which is it?

      That's what I said. It's so hard to write secure software in C that basically no one can do it.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    28. Re:An embarrassing admission by swillden · · Score: 1

      Come on, it's not impossible to write secure C code if you know what you're doing.

      If you believe this, you don't pay much attention to CVEs.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    29. Re:An embarrassing admission by swillden · · Score: 1

      I do believe it, and here's why: the vast majority of security holes in C code are buffer overruns and failing to sanitize inputs. These are both easily mitigable.

      And yet, they so often aren't. Even in code written and reviewed by security experts. You're supporting my point.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    30. Re:An embarrassing admission by swillden · · Score: 1

      If your point is that these security "experts" are not highly competent, then I support that, yes.

      They're the best in the world, in many cases.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    31. Re:An embarrassing admission by swillden · · Score: 1

      Your argument is circular. You assert that someone is an expert if and only if they can write secure C code. My assertion is based not on logic (circular or otherwise) but on data. What can we possibly conclude when security-focused portions of widely-scrutinize, mission-critical operating system kernels; cryptographic libraries; security-focused "trusted" operating systems; secure container systems; and the like, all written by top security-focused software engineers who are doing their level best to make their code airtight, consistently have vulnerabilities which would not be possible in a more secure language?

      The only possible conclusion is: writing secure software in C is too hard.

      I'm fully aware of the techniques one uses to avoid buffer overflows, stack smashing, heap corruption, etc. They're easy to describe and in the abstract it seems like they should be simple to consistently implement. Heck in many cases correctness can even be automatically validated. So it seems like this should be easy. Massive amounts of real-world experience proves otherwise.

      I'll even grant that it's possible that somewhere there are C programmers who are good enough that they never write such bugs. But obviously there aren't enough of them to write all of the security-sensitive software that we need written.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  7. as if more proof is needed by Anonymous Coward · · Score: 1

    Rust has one of the most aggressive fanboy cultures since the Ruby hey days. Those kool-aide drinkers infest every corner of every programming language forum (notably Reddit's C++ forum) repeating their mantras and echo chamber memes.

    But yes, sure, let's start refactoring a kajillion lines of C that are out there working perfectly well. Let's replace working C with an immature, untried, untested language that is still largely under active development. As another poster said, what can possibly go wrong?

    The world doesn't need more proof that these characters live in their own pink marshmallowy world of poofy clouds and fairies and wood sprites where reality can never intrude.

    LOL@vword: astute

    1. Re:as if more proof is needed by gweihir · · Score: 1

      Rust has one of the most aggressive fanboy cultures since the Ruby hey days.

      And that is just it. They have not understood the most fundamental thing about coding: "There is no silver bullet" [Brooks, 1986]. No language or tool will ever turn a bad coder into a good coder. No language will ever compensate for lack of insight on the part of the one using it. If you cannot hack it, then you are not a coder and that cannot be fixed, no matter how hard you cheer for a language that thinks will turn you into a good coder.

      Rust is by far not the first failed attempt in that direction (albeit the one with the nastiest proponents so far). The problem is a fundamental one, which smart people have understood right from the beginning. But since there is an endless supply of non-smart people in the human race, it will not remain the last failed attempt. And when in, say 20 years, nobody cares about Rust anymore, C will still be around, because in the hands of an expert, it does its job exceptionally well. It just does not cater to incompetents, and that is why the Rust people do not like it: It forces them to realize what they are.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    2. Re:as if more proof is needed by Dagger2 · · Score: 1

      Or maybe you haven't understood the first thing about Rust. It doesn't turn bad coders into good coders, it doesn't magically give insight to programmers without it... all it does is check the code you write for memory safety issues, and reject it if it's unsafe.

      Many, many security vulnerabilities in C code are memory safety issues. Whether you feel the need to insult the coders of that code or not, the fact remains that in the real world we suffer from a great many security vulnerabilities that could've been automatically detected and rejected by the Rust compiler. If we insist on continuing to use C then we will continue to suffer from this class of security bugs.

    3. Re:as if more proof is needed by gweihir · · Score: 1

      No. Most vulnerabilities in C are cases where the coder did not understand what they were doing. In C that often gives a memory safety issue, in Rust it will simply be something else that breaks. Your misunderstanding is that you think if the language prevents one type of error, than this error will go away and will not be replaced by something else. That is a wrong model and there is ample evidence that this model is wrong. This has been known for a long time. But, as usual, those that do not know or understand the history of computing are doomed to repeat it.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    4. Re:as if more proof is needed by Zo0ok · · Score: 1

      Yes,

      Either you understand what you are doing and you know how to do it right.
      Or you dont understand. Or you are not capable of doing it right.

      That said, some tools are better for some jobs. And it makes no sense to complicate things for yourself.

    5. Re:as if more proof is needed by david_thornley · · Score: 1

      all it does is check the code you write for memory safety issues, and reject it if it's unsafe.

      So it's no improvement over C++.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    6. Re:as if more proof is needed by Dagger2 · · Score: 1

      I see you do feel the need to insult the programmers.

      You might have missed the bit where C makes it unnecessarily complicated to understand what you're doing. If we can reduce that complication, we'd have more programmers capable of understanding what they're doing. Surely you don't think that's a bad thing?

      I'm not convinced that removing unnecessary complexity will lead to more problems in the other parts of the program. If anything, it should lead to fewer problems because the developer has more attention available to find and fix those other problems. (Or, in an imaginary world where all programs are written by perfect programmers with no time limits, it would lead to programs taking less time to write, which would mean we could write more software for the same cost.)

    7. Re:as if more proof is needed by Dagger2 · · Score: 1

      There are plenty of ways to write memory-unsafe code in C++, so no, it's not no improvement.

    8. Re:as if more proof is needed by david_thornley · · Score: 1

      There are ways, specifiable in a style guide and easily checked, to write memory-safe code in C++. Therefore, if used with any intelligence, it will do memory checking.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    9. Re:as if more proof is needed by Dagger2 · · Score: 1

      That's nice, but it's also clearly possible to write non-memory-safe code in C++, because people keep doing it and it keeps ending up in released software. In Rust it's not. That's an improvement.

    10. Re:as if more proof is needed by david_thornley · · Score: 1

      If people release software in C++ that uses non-memory-safe code, the developers usually not all that good. The choice of language is less important than the competence of the developers.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    11. Re:as if more proof is needed by Dagger2 · · Score: 1

      So basically... you can write memory-safe software in C++, but it's much harder, some developers can't do it and the failure mode is that we get security vulnerabilities? This is not a very good argument for using C++ for software that needs to be secure.

  8. Bullshit slashvertisement by lorinc · · Score: 3, Interesting

    Hire competent C developers and you should be good to go. Hire dumb-asses and sure the future doesn't look bright.

    The usual PR stunt of "use my new language that is so good and so simple even a stupid high school teen with an IQ somewhere between stone and plankton in the phylogenetic tree could use it without wrecking anything" is not going to convince anybody here. It's boring at best, and no-one cares about your "advice".

    The linux kernel is in its 3rd decade, as most gnu/bsd tools and all of that is written in plain C. They are good and safe. Oh, maybe it's because they are written by competent guys.

    1. Re:Bullshit slashvertisement by TheRaven64 · · Score: 2

      I'd argue that there aren't many good reasons to favour C over C++ these days and there's a much simpler migration path as most C code is valid (though not idiomatic) C++ code. Replacing bare arrays with std::array, collections implemented in macros with ones implemented in templates, and raw pointers with std::unique_ptr / std::shared_ptr will go a long way to catching bugs. You retain the ability to easily sidestep the type system if you need to, but a lot of the things that require you to in C can be simply implemented with C++.

      --
      I am TheRaven on Soylent News
    2. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 1

      Also C++, if used correctly, makes many typical C bugs very hard to implement by accident, while still having the option of using some things that only C can do well if really needed.

    3. Re:Bullshit slashvertisement by Yosho · · Score: 1

      The linux kernel is in its 3rd decade, as most gnu/bsd tools and all of that is written in plain C. They are good and safe.

      Really? Are you sure?

      --
      Karma: Terrifying (mostly affected by atrocities you've committed)
    4. Re:Bullshit slashvertisement by Kohath · · Score: 1, Flamebait

      This is a common argument. What you're really saying is that a small number of elite developers feeling good about themselves is better than good tools that prevent mistakes.

      And the response is "No, it's not." We need more people to be able to produce more with fewer mistakes. The number of developers who write production code will always be more than the number of developers who write mistake-free code. The way to get more mistake-free code is to eliminate opportunities to make mistakes.

      Shorter version: "We're trying to accomplish a goal. It's not all about you."

    5. Re:Bullshit slashvertisement by sphealey · · Score: 2

      = = = Hire competent C developers and you should be good to go. Hire dumb-asses and sure the future doesn't look bright. = = =

      I've met a lot of very competent cabinetmakers over the years, but of those who use circular saws 80% are missing at least the tip of one finger. The SawStop technology seems like a good idea to me, although many deride it as "sissy stuff".

      In any case, the history of the last 30 years shows that you really can't depend only on having hired the "competent" programmers - there aren't enough of them, it is hard to determine who is/isn't until it is too late, and anyone can make a mistake.

      sPh

    6. Re:Bullshit slashvertisement by phantomfive · · Score: 2

      The first four bugs there wouldn't have been prevented by rewriting in Rust. They're logic errors (which happen in every language). That is the biggest downside or Rust: people think they will be secure by using it, leading to turning off their security brain.

      --
      "First they came for the slanderers and i said nothing."
    7. Re:Bullshit slashvertisement by gweihir · · Score: 1

      And that is exactly it. Sure, C is not that great a language, but it is simple, easy to understand in full (if you have what it takes) and it does not stand in your way. It also does not eat your cycles, unlike many, "modern" languages, but gives you native speed for what you are doing. As such, it works pretty well for anybody really competent. Insecure C code is not a language issue, it is a coder issue.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    8. Re:Bullshit slashvertisement by Anne+Thwacks · · Score: 1
      leading to turning off their security brain.

      If you use Rust you don't need a security brain.

      However, the sensible posts above all indicate that the best languages for some problems may not be the best for others.

      For complex computation-intensive problems, Algol68 is the answer, and C is not. For low level hardware control C often IS the answer, and COBOL is not.

      If you find a problem and Rust or Python is the answer, keep it to yourself. (And don't even mention Perl to anyone, ever).

      Let me know if you find a problem for which Snobol is the best solution. Enquiring minds want to know.

      --
      Sent from my ASR33 using ASCII
    9. Re:Bullshit slashvertisement by Jeremi · · Score: 4, Insightful

      Hire competent C developers and you should be good to go. Hire dumb-asses and sure the future doesn't look bright.

      A competent C developer will make only a very small number of mistakes per N lines of code, so that's a good thing.

      Of course, it only takes a single tiny mistake to produce potentially devastating consequences, so unless every single one of your C developers is not just good, but infallible, then by hiring "only" competent C programmers you are guaranteeing that your software will include a security hole, sooner or later.

      The problem with infallible C programmers is that they do not exist. The problem with competent C programmers is that there are only a limited number of them around, and it's not always easy to tell up front the competent C programmers from the seemingly-competent ones. Not to mention that every competent C programmer started out as a less-than-competent C programmer; if companies hired only competent C programmers, there would not be any competent C programmers since nobody would be able to make a living as a C programmer during the first N years of their programming career.

      Since the whole point of computers is to automate processes to make them quicker, easier, and less susceptible to human error, why would you not want to automate the creation of secure software, to the extent it is practical to do so?

      The linux kernel is in its 3rd decade, as most gnu/bsd tools and all of that is written in plain C. They are good and safe.

      Why do you think the Linux kernel is good and safe? It has suffered from many security holes in the past, and will probably suffer from more in the future. There are almost certainly multiple gaping security holes in the Linux kernel right now, just waiting to be discovered and exploited. And this is despite it being written by competent guys.

      Imagine how much more robust the Linux kernel would be if the competent guys were also using a language that caught more of their mistakes at compile-time, rather than leaving them to be discovered by testers, users or hackers at some later date. Dunno if Rust is the language to do that, but it's hard to see how automatic coding-error detection wouldn't be a big improvement over the status quo.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    10. Re:Bullshit slashvertisement by GeodesicGnome · · Score: 1

      I agree that C++ is generally a better way to go, even if you aren't using the object oriented features (which really should only be used when you need them). All of the languages that have risen up claiming to be better replacements for C because C is basically "enough rope", are really dumbing down of the language by removing useful features (like address pointers and use of free unions). I remember when HP tried to replace a C-like language with Pascal for this reason and it led to years of low productivity and bloated code.

    11. Re:Bullshit slashvertisement by SoftwareArtist · · Score: 2

      Hire competent C developers and you should be good to go.

      Anyone who is a competent C programmer understands the limitations of the language, knows there's a lot of truth in his criticisms, and uses C only when there are no other reasonable options. They understand that because they're competent C programmers.

      You can write correct code in any language, or incorrect code in any language, but the choice of language makes a really big difference in how many errors your code has. C is a minefield of potential errors that don't exist in many other languages, and then it only gives you really primitive tools for avoiding those errors. You're responsible for manually doing all memory allocation, and then manually freeing that memory when it's done, and you don't even have access to destructors or try/finally constructs to do that more safely. All memory access is through pointers, which can then be used to access any memory location in the program's address space. That's insane. We've learned a lot about language design in the 40 years since C was created, and we know there are much better ways of doing these things.

      At least use C++ instead of C. It's a superset of C, so it can do anything C can do. But it also provides tools for avoiding those problems. Use STL containers instead of arrays. Use references instead of pointers whenever possible. Use destructors to do your memory management via RAII. You will make fewer mistakes, and your code will contain fewer errors as a result.

      --
      "I'm too busy to research this and form an educated opinion, but I do have time to tell everyone my uninformed opinion."
    12. Re:Bullshit slashvertisement by Yosho · · Score: 1

      The first four bugs there wouldn't have been prevented by rewriting in Rust.

      There have been about 150 vulnerabilities disclosed in 2017 alone so far. How many of them wouldn't have even been possible in a language that prevented you from doing inherently unsafe operations? What's the threshold for when it finally becomes worth doing so?

      That is the biggest downside or Rust: people think they will be secure by using it, leading to turning off their security brain.

      [citation needed]. I'm not convinced that's true at all. One could also easily say that putting locks on your house's doors and windows will cause the residents to "turn off their security brain" and lead to them being less secure overall, but that's absurd on its face. Nobody in their right mind would advocate for writing security-critical software in Intel assembly because having no safeguards at all would clearly cause you to write more secure code.

      --
      Karma: Terrifying (mostly affected by atrocities you've committed)
    13. Re:Bullshit slashvertisement by Dagger2 · · Score: 1

      You still need a security brain with Rust. The difference that Rust makes is that the compiler will make sure your code is free of memory safety issues, which means you can spend your security brain's limited bandwidth on other issues -- issues that can't be handled automatically for you by your computer. (Why would you ever want to waste time manually checking things that can be done automatically?)

      I have no idea where this idea of "it's impossible to write insecure code in Rust" came from. It doesn't even claim to be able to do that.

    14. Re:Bullshit slashvertisement by BCooley · · Score: 1

      The first four bugs there wouldn't have been prevented by rewriting in Rust. They're logic errors (which happen in every language). That is the biggest downside or Rust: people think they will be secure by using it, leading to turning off their security brain.

      Here's a good current security vulnerability in Linux that has a score of 10 on the first page:

      https://www.cvedetails.com/cve...

      "The mq_notify function in the Linux kernel through 4.11.9 does not set the sock pointer to NULL upon entry into the retry logic. During a user-space close of a Netlink socket, it allows attackers to cause a denial of service (use-after-free) or possibly have unspecified other impact."

      This is a classic "use-after-free" bug which is common in C/C++ but which can not occur in a secure language like Rust.

      If you browse the historic Linux security vulnerability database, you'll find plenty of these types of vulnerabilities scattered everywhere.

    15. Re:Bullshit slashvertisement by serviscope_minor · · Score: 1

      In any case, the history of the last 30 years shows that you really can't depend only on having hired the "competent" programmers - there aren't enough of them, it is hard to determine who is/isn't until it is too late, and anyone can make a mistake.

      Yep: even the most competent programmers have days where they're distracted, have a cold, or are brain-addled in some way or another.

      --
      SJW n. One who posts facts.
    16. Re:Bullshit slashvertisement by phantomfive · · Score: 1

      How many of them wouldn't have even been possible in a language that prevented you from doing inherently unsafe operations?

      Why don't you look through the list and figure it out? That would have made your post good instead of ignorant.

      --
      "First they came for the slanderers and i said nothing."
    17. Re:Bullshit slashvertisement by thegarbz · · Score: 1

      Hire competent C developers and you should be good to go.

      And yet we have yet to see any sizable program be truly bug free. So are you taking a dig at C programmers or programmers in general?

    18. Re:Bullshit slashvertisement by phantomfive · · Score: 1

      If you use Rust you don't need a security brain.

      Yeah......you're like a parody of Rust fans. Let me know what code you write without thinking of security, and I'll hack it.

      --
      "First they came for the slanderers and i said nothing."
    19. Re:Bullshit slashvertisement by roca · · Score: 1

      > They are good and safe.

      The endless treadmill of Linux kernel "must update" updates suggests this is not true.

    20. Re:Bullshit slashvertisement by roca · · Score: 1

      The first four bugs are basically all the same "StackClash" issue.

      It's true that you can't just turn off your "security brain" when writing code in Rust or any other language. There are a lot of security-relevant bugs that are language-independent. But there are a lot of other bugs that very much depend on the weaknesses of C and C++.

    21. Re:Bullshit slashvertisement by geekymachoman · · Score: 1

      > Hire competent C developers and you should be good to go. Hire dumb-asses and sure the future doesn't look bright.

      And where do these competent ones work at ? Microsoft, yahoo, apple, Linux kernel developers ? Where are they ?

      Oh right, I see. Microsoft, Apple and Linux Kernel don't have bugs at all. /Sarcasm.
      They have bugs, may of them critical, once a month, and they continue to have those bugs. I remember RCE in kernel in 2001, had one couple of weeks ago again. It will be another one in 2019,2020,etc. and it will never be better, until things fundamentally change. Changing a language... well, might be a good idea, but you won't know it unless it's tried.

      It's not about being a "good" programmer, it's about being human. If you have to think about 70 different things, sooner or later, you'll make a mistake. Got in a fight with the missus, she's considering leaving ? Oh well.. yes, it's 08am, better go to work write some code...get payed you know. That alimony, the car and the house won't pay for themselves.

      You nerds completely take out humanity out of everything. Even if you find couple of robotic ones that make no mistakes (and i'm sure there are some like that), there are trillions and trillions of lines code out there, you think these few ones will make the world a better place ?

      We've been using C to write low level software for decades. This is where we are. If you think everything is peachy... then sure, don't change anything.

      Now, continue crapping on everything !C.

    22. Re:Bullshit slashvertisement by TheRaven64 · · Score: 1

      That kind of bug also wouldn't appear in C++ with modern (automatically checkable) coding conventions. Additionally, the C++ version would easily have permitted the memory to be reclaimed by RCU, whereas doing this in Rust without overhead would require compiling everything in unsafe mode.

      --
      I am TheRaven on Soylent News
    23. Re:Bullshit slashvertisement by robinsc · · Score: 1

      Yup C++ better than rust. after all the dependencies to build the rust compiler are g++ or clang ....

      --
      Linkedin http://in.linkedin.com/in/robinsaikatchatterjee
    24. Re:Bullshit slashvertisement by strikethree · · Score: 1

      Imagine how much more robust the Linux kernel would be if the competent guys were also using a language that caught more of their mistakes at compile-time, rather than leaving them to be discovered by testers, users or hackers at some later date.

      Hm. Yeah...

      Dunno if Rust is the language to do that, but it's hard to see how automatic coding-error detection wouldn't be a big improvement over the status quo.

      To my knowledge, there are no "languages" that have the features you desire. All "safe" solutions appear to be around restricting the solution space. It is like cutting off everyone's hands because some people have touched a hot stove. Yes, it is now guaranteed that no hot stoves will be touched but ... there are consequences.

      Forcing errors into the higher layers of the abstraction can be useful, but placing limits is placing limits. Removing direct memory access will remove all errors associated with direct memory access but it also prevents all solutions that would be most efficiently created using direct memory access.

      I would rather see a solution that does not utilize arbitrary restrictions to provide security.

      --
      "Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen
    25. Re:Bullshit slashvertisement by Jeremi · · Score: 1

      All "safe" solutions appear to be around restricting the solution space. It is like cutting off everyone's hands because some people have touched a hot stove. Yes, it is now guaranteed that no hot stoves will be touched but ... there are consequences.

      Rust seems to have a pretty good solution to that problem -- if you absolutely need to do something unsafe, you can tag a section of your code as "unsafe" and then do whatever dark magic you need to do in that unsafe section -- at your own risk of course.

      The advantage of this is that (hopefully) the vast majority of your codebase won't need to be written as unsafe-code, which means that the vast majority of your code will automatically receive the benefit of compiler-guaranteed safety, while the small portion that does need free reign will be tagged with a big red blinking UNSAFE sign so that anyone who is tempted to modify it will know to be extra careful.

      --


      I don't care if it's 90,000 hectares. That lake was not my doing.
    26. Re:Bullshit slashvertisement by DrXym · · Score: 1
      The problem is that to become a competent C or C++ programmer you must write a lot of C and C++. And by implication you make a LOT of mistakes in the course of writing that code. What happens to that code? If you work for a company then it goes into production and is out there. Even companies that mitigate the risk with code reviews, pair programming or whatever still aren't going to catch all issues. Even some of the most heavily reviewed code in the world like openssl has contained serious problems.

      Therefore it's not a good argument to say competent programmers. Besides, even competent programmers make mistakes whether they mean to or not.

      The argument for the likes of Rust is that it stops entire classes of problem happening by design. During normal programming forget to deallocate memory, or buffer overflow, or call a NULL / dangling pointer because the language stops those things from happening. You can't have two pointers modifying the same data, or have threads sharing an unprotected datastructure because the language stops those things from happening. Things that commonly blow up in C/C++ simply can't happen in Rust without enormous effort, such as throwing the safe checks.

      Rust is no panacea since you can still write broken application logic, or cause a panic (a managed termination), but it's very hard to actually cause a segfault or suchlike. The result is better quality code with less bugs and consequently less support, bugfixing later on. Companies should consider this a good thing.

  9. well, he's not wrong by Anonymous Coward · · Score: 3, Insightful

    C was one of the most influential languages the world has ever seen, but all things reach a point where time moves and and they are not good ideas for new projects any more. I don't think we should necessarily go replace every line of C code out there - couldn't if we wnanted to - but for new projects we should use better tools now.

    Tools do matter. It's just way way way too easy to write buffer overflows in C, even for highly experienced programmers. History shows that clearly. We need better tools that are not so dependent on the human being doing the checking. That isn't to argue you can't write bugs in Rust, just that it helps the programmer avoid some classes of problems. Slashdot readers tend to think "if it isn't 100% perfect and can't guarantee bug-free code then it must be worthless", but that's autism thinking at its finest.

    People get attached to "the way things have always been done", but sometimes it really is best to move on. Yes, there is still COBOL code out in the world but that's not a language people use very often now for new projects. It did its job decades ago but we have learned lessons since then and we don't have to repeat the mistakes of the past.

    It's time to leave C in the past.

    1. Re:well, he's not wrong by TheRaven64 · · Score: 2, Interesting

      It's just way way way too easy to write buffer overflows in C

      Technically: it's too easy to write buffer overflows in most implementations of C. The C specification makes accessing beyond the end of a buffer undefined behaviour. That means that an implementation is allowed to do whatever it wants (and doesn't have to do the same thing consistently). Most implementations implement this as 'trample an arbitrary memory location', but it's completely valid to transform it into a recoverable trap. My research group has proposed a small set of CPU extensions that we're talking to vendors about adopting that allows an implementation of C (which I've created and which we're able to build complex C programs with) that provides these guarantees. Any out-of-bounds array access for us is a CPU trap, which the OS turns into a signal. You can then either kill the process, unwind the stack and kill the thread, or recover in some other way.

      --
      I am TheRaven on Soylent News
    2. Re:well, he's not wrong by robinsc · · Score: 1

      well if you write languages that cater to children and idiots after a generation all your programmers will be children and idiots.

      --
      Linkedin http://in.linkedin.com/in/robinsaikatchatterjee
    3. Re:well, he's not wrong by pauljlucas · · Score: 1

      What if the pointer points beyond the end of some chunk of malloc'd memory? Merely checking array bounds is insufficient for any non-trivial C program.

      --
      If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
    4. Re:well, he's not wrong by TheRaven64 · · Score: 1

      What if the pointer points beyond the end of some chunk of malloc'd memory?

      Then you will get a trap. The bounds are set at malloc() time and cannot be extended (except by the code in malloc, which holds a pointer to a larger area which it can subset).

      Merely checking array bounds is insufficient for any non-trivial C program.

      Checking the array bounds is sufficient. Checking the bounds of the static type, is not.

      --
      I am TheRaven on Soylent News
  10. Re: Betteridge's Law bullshit by war4peace · · Score: 1

    Sorry I am not discussing the anonymous coward behind it, but the statement itself...

    "They just show up to post random nonsense and exhibit absurd biases" - that's exactly how I perceive the GP.

    --
    ...gis sdrawkcab (usually not responding to ACs; don't bother posting as AC)
  11. Fix the code dont try a new language by gordona · · Score: 3, Informative

    How about training developers on security policy, training mgmt on the need for secure code and the balance between acceptible risk and convenience, proper requirement and tests.

    --
    "Gentlemen, you can't fight in here! This is the War Room!" -- Dr. Strangelove
    1. Re:Fix the code dont try a new language by TopSpin · · Score: 1

      you need to realize some things just can't be done

      Indeed; judging feasibility is an important ability. Analyzing why something is not feasible is a useful exercise. I believe the GP's proposal is infeasible because most code is created by people that haven't got the resources (time, tools, education, desire, experience, etc.) needed to create high quality code and are employed by people that don't care.

      Stipulate for a moment that I am correct. What does this say of Rust? Isn't Rust simply an enforced expression of the discipline that working programmers and their employers are deliberately avoiding? Is Rust feasible for use by programmers that haven't got the resources to suffer its costs and are employed by people that won't let them? It's entirely possible that Rust is yet another entry in the list of things that "just can't be done," in the sense that it won't be taken up for the same reasons that few are applying the GPs methods.

      I like Rust. I think it has moved that bar like nothing has in years. Decades perhaps. The "R word" is now unavoidable in discussions of language design because Rust embodies plausible solutions to serious and long standing problems. I've written code in Rust and found and used Rust software 'in the wild,' as have millions of others given Firefox. I do not, however, take it as a given that it (or any tool that enforces an equivalent discipline) will succeed in the long term because I hold the cynical view that people (programmers, employers, users, etc.) are not willing to pay the needed costs.

      The puerile rage that has emerged for this language is truly sad. Rust is the honest effort of honorable people that attempts to address a legitimate problem in an open and liberal manner. There is no stink on Rust. Yet it has generated a legion of haters that take exception to its very existence. A further cynicism I hold is that this is primarily because Rust (or at least the concepts embodied in the language) exposes the inherent flaws of some loved tools, and the narrow minded practitioners that love those tools simply don't like it.

      --
      Lurking at the bottom of the gravity well, getting old
    2. Re:Fix the code dont try a new language by gordona · · Score: 1

      I guess it would depend on how the policies are written. There may be upfront costs with regard to additional time writing requirements and appropriate tests following the security policies. incorporating proper secure coding techniques up front is more efficient than going back and tracing down the problem. I had a system some years ago with about 30,000 lines of code in C, that because the company was small, just 5 of us, no code reviews were done. Just before the acceptance test, the system started crashing. We got through the acceptance test, but it took me several days to find the bug. it was mainly do to a very tight schedule and a huge oversight on my part. But there was no security policy, no hard and fast requirements and of course no testing of the system other than whether it worked or not. Since I was the sole programmer for the system and the other software guy was deep into another project, I was on my own with it. I wrote about "acceptable risk" which is what the policy has to address. This is weighed against the value of what might be lost if the code is hacked. Its called return on security investment or ROSI. Its an avoided cost. Things can never be made 100% risk free, but the gods on high in company have to decide what is an appropriate investment in reducing risk. Its a balance between security and convenience. But working it up front is less costly than going back and fixing the code.

      --
      "Gentlemen, you can't fight in here! This is the War Room!" -- Dr. Strangelove
    3. Re:Fix the code dont try a new language by gordona · · Score: 1

      Thank you for your very informative comments. Bugs are one thing. Security flaws are quite another.

      --
      "Gentlemen, you can't fight in here! This is the War Room!" -- Dr. Strangelove
    4. Re:Fix the code dont try a new language by Raenex · · Score: 1

      Gee, thanks, nobody has thought of this before! Moar training! Forty years later, I'm sure we'll get it right this time!

  12. Moving the goal posts doesn't eliminate them by RightwingNutjob · · Score: 1, Interesting

    If something needs to be done in C because it talks to hardware (and everything operation that computes eventually talks to hardware), then having another layer in front of it that still needs to talk to C code doesn't necessarily get rid your chance to make mistakes; it might in fact leave you even more rope to hang yourself with. And it won't look like the same kinds of errors you're making now, which is why you don't foresee it.

    One is data structures: in C there are no data structures. Any memory can be treated any way you like. So you can pack different bits and bytes together on one end and have them make sense on the other. At the cost of a potential security hole. But sometimes that's how you need to talk to hardware and for speed's sake, the thing that talks to the thing that talks to the hardware speaks the same language. Now if you impose a type-safe bounds-checked language anywhere in there, then one of three things will happen:

    1. You can't do in the type safe language what you used to be able to do in C because you can't specify the necessary data structures anymore.
    2. You can do it, but it costs you a ton of extra execution time, because even though you can *specify* an analogous variable-length data structure in your type safe language, the newer and better language makes no guarantees about how that data actually resides in memory, so when it gets to the C layer, there's a bunch of gathering and reconstructing and recreating that packed data from various places, all with bounds check overhead. This is what happens in Java.
    3. You can do it, but you have to write a language extension to support what you're doing. And guess what language you have to write it in? C!

    1. Re:Moving the goal posts doesn't eliminate them by serviscope_minor · · Score: 1

      If something needs to be done in C because it talks to hardware

      You can talk to the hardware in C++ too. It won't prevent you from messing up like C, but it does give you tools to use to make it harder to mess up. Usually using those tools yields code which is shorter, faster, easier to read and write and much more likely to be correct.

      One is data structures: in C there are no data structures. Any memory can be treated any way you like.

      That ain't compliant C. If you try to use aliasing like that you'll likely end up in a world of hurt with a modern compiler, since the optimizer understands about aliasing rules.

      --
      SJW n. One who posts facts.
    2. Re:Moving the goal posts doesn't eliminate them by Rockoon · · Score: 1

      Exactly how does C help you talk to the hardware?

      Even BASIC could peek and poke, read and write directly to hardware ports, and so on. C is not special here.

      --
      "His name was James Damore."
  13. Formal verification my foot by RightwingNutjob · · Score: 1

    "Did you build it right?" is easy to answer. "Did you build the right thing?" is not. Language choice has nothing to do with that.

    1. Re:Formal verification my foot by gweihir · · Score: 1

      Formal verification has failed. It is one of many coding hypes that has. "There is no silver bullet" still applies and it does not look like it will go away, possibly not ever. Sure, formal verification has some niche uses and it is a nice tool to teach code semantics, but that is it.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  14. Recent experience with C by CustomSolvers2 · · Score: 2

    I have recently started a quite demanding development by fully relying on C and this experience has being quite eye-opening. One thing is knowing that C is really fast (and dangerous), but a completely different story is getting in there from a modern-language background.

    C can certainly be extremely problematic in bad hands (increasingly careless attitudes in the programming world, anyone?). Also I don't see the point of using it other than under very specific conditions. But completely replacing it? I don't think that this is neither possible nor logical.

    --
    Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    1. Re:Recent experience with C by CustomSolvers2 · · Score: 1

      I swear that I realised about it right after writing the post and was even about to write another comment with a correction. But then I said to me "what on the hell! Why not letting other people have some fun?". LOL. I logically meant pretty much the opposite ("I think that this is neither possible nor logical"), but wrote it wrong.

      FUN FACT: in Spanish, double negation is correct. For example, a word-by-word translation of my version to Spanish would be fine: "NO creo que sea posible NI lógico".

      --
      Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    2. Re:Recent experience with C by gweihir · · Score: 2

      Indeed. Use C for core algorithms, containers with tight space requirements, hardware access, etc. Use something modern for glue code, "business logic", UI, etc. like Python.

      The problem here is not C, it is incompetent C coders. I actually thing using C is an advantage, because it makes incompetent coders far more obvious than, for example, Java, were even the most incompetent ones can hack something together. The second problem is however incompetent "managers" that do not fire incompetent C coders, because competent C coders are quite a bit more expensive. That they are worth it overall several times over is not something the bean-counters can grasp.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    3. Re:Recent experience with C by CustomSolvers2 · · Score: 1

      because competent C coders are quite a bit more expensive

      No doubt about that. I am quite experienced with different languages (most of them C-based) and, in most of the cases, I can start using a new language almost immediately; but this experience with C has been quite problematic. Even now when I am starting to get used to it, I keep seeing lots of peculiarities. Although I am kind of enjoying the process, I don't think that most of (modern-language) programmers are cut for this.

      --
      Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    4. Re:Recent experience with C by gweihir · · Score: 1

      Well, possibly. At the very least, academic coder education has gone down the drain with that utterly stupid focus on Java (probably not the worst language ever, but surely a close contender) that one encounters everywhere. But that does not change the fact that the problem are the coders and not the language. I am absolutely not opposed to restrict C coding to the places where it is necessary, but for these you need somebody that really knows what they are doing.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    5. Re:Recent experience with C by roca · · Score: 1

      It is actually very easy for "incompetent" C coders to hack something together that works and is shipped, and is later discovered to be riddled with security holes. This happens all the time.

      It is also easy for very experienced and talented C coders to do exactly the same thing, and that also happens all the time.

    6. Re:Recent experience with C by gweihir · · Score: 1

      For your definition of "very easy" (which is utterly demented), that is true for any language and any coder. Your statement is a null-statement and worthless.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    7. Re:Recent experience with C by Tranzistors · · Score: 1

      You should examine your own weasel words (namely, “competent”) before casting stones.

    8. Re:Recent experience with C by CustomSolvers2 · · Score: 1

      I didn't imply that more modern languages are intrinsically wrong or that programmers fully focusing on them are worse. Modern languages are a normal outcome of programming evolution and have allowed to easily create much more complex pieces of software. Even trying to use C nowadays in a big number of situations would imply a much higher (even unacceptably high) complexity than what any development 20-30 years ago did.

      With old languages like C, programmers have to take care of a big proportion of issues which can be plainly ignored with modern languages; that's why the attitude of those programmers was somehow different to the modern ones. Equivalent things happen with any other aspect of human evolution: driving a modern car is much easier than an old one, but it doesn't mean that modern drivers are worse. All what this implies is that, for most of modern drivers/programmers, moving back to an old car/language wouldn't be easy/they wouldn't do a good job/they wouldn't even try to do such a thing; nothing to do with being intrinsically worse, but with not being as adaptable as required.

      It is also true that the easier a given framework becomes (e.g., modern languages and huge availability of learning resources thanks to internet), the more likely is that less prepared people start using it. But again this also happens in other aspects of modern societies like manufacturing (e.g., increasingly number of cheap, low-quality products). So and generically speaking, I do think that any modern language is much better than C for taking care of random, nowadays, complex-enough situations and modern programmers are likely to be much more prepared to face them. On the other hand, in the specific sub-fields where the C features have no competition (i.e., being the fastest language under relatively simple conditions), you need a very specific type of programmer: either a "native" C or a very adaptable (like me :)) one.

      --
      Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    9. Re:Recent experience with C by CustomSolvers2 · · Score: 1

      As said in my previous comments, some other comments in this thread and even by applying some programming common knowledge, C is a very problematic environment. You shouldn't ever forget about this issue when using that language, hiring people to use that language, test the outputs of that language, etc. When you are perfectly aware about certain conditions to be very problematic, you can do two things: either completely ignore those conditions by assuming that can/should do such a thing; or accept that reality and take all the required measurements to adequately deal with it.

      In this specific case, you cannot (better: shouldn't even think about it) fully replace C, simply because there is no replacement. What do you want? To make everything unnecessarily slower (and even less reliable)? You have to adequately understand a complex reality and to deliver the best output which, as what usually happens, isn't the simplest, one-magical-solution-for-everything-based approach. C will not go anywhere, accept it. Its actual applicability is likely to keep decreasing in parallel to the increase of complexity in the software world; but you will have still to maintain all the non-replaceable C code and continue using it in certain cases. Eventually, there might even be new developments under a-priori-non-ideal-for-C conditions (e.g., the one I have recently started and which I commented here) where C might also be used.

      --
      Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    10. Re:Recent experience with C by david_thornley · · Score: 1

      C++ can do anything C does (it's a near-superset, and none of the differences affect what can be easily done), and can be used (by complying with an easily verifiable style guide) to eliminate a large number of errors C is prone to.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    11. Re:Recent experience with C by CustomSolvers2 · · Score: 1

      C++ can do anything C does

      and

      to eliminate a large number of errors C is prone to.

      are incompatible statements. The strongest point of C is its speed, a direct consequence of being one of the most minimal versions of a programming language around. What means that you have to write everything by your own because there are virtually no in-built functionalities. It also means that you have to check everything and take care of every single aspect (e.g., memory). Any language improving C would affect these issues and, consequently, its main advantage.

      There is trade-off speed vs. programmer friendliness and no way around it. Modern languages are very fast for most of situations. You can even use languages like C++ which might rely more/less on the C peculiarities. A different story is saying that C++ can do the same than C, because it cannot. In the best scenario, it might be somehow similar to C; but the closer it gets to C, the less C++/typical-C-problems-being-avoided would become.

      --
      Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    12. Re:Recent experience with C by david_thornley · · Score: 1

      No, they're not contradictory statements. You can write C++ that's as unsafe as any C, but you have alternatives. You can write code that's automatically range-checked unless the compiler decides it doesn't need it, and if you want to skip the range checking in favor of speed or something you can do that. You can handle memory with smart pointers, and at least std::unique_ptr is about as fast as a raw pointer. Still, if you have good reason to use a raw pointer, you can.

      With C, you wind up using C-style arrays, raw pointers, and usually C-style strings all the time. With C++, these can easily be limited to where they're actually necessary, which frequently winds up being "never".

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    13. Re:Recent experience with C by CustomSolvers2 · · Score: 1

      With C, you wind up using C-style arrays, raw pointers, and usually C-style strings all the time. With C++, these can easily be limited to where they're actually necessary, which frequently winds up being "never".

      I am currently developing a piece of software (still work in progress, but expected to be reasonably big/complex) exclusively relying on C-style arrays, pointers and C-style strings. In fact, it is a string-parsing/management-intensive development. I will continue sticking to pure C because it is the best alternative under these conditions.

      You can write code that's automatically range-checked unless the compiler decides it doesn't need it, and if you want to skip the range checking in favor of speed or something you can do that.

      So, you are saying that a language/compiler with all these additional options (which might be used or not, but which has to be supported) generates an equivalently fast output than another one not having any of those? This doesn't sound too right. On the other hand, I haven't done any tests on this front and cannot be sure. That scenario of using C++ as C wouldn't make too much sense anyway.

      --
      Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    14. Re:Recent experience with C by david_thornley · · Score: 1

      Chances are your C program would be easy to transform to C++, line for line. It might be necessary to add a few casts and change a few identifiers. Hence, C++ could be used to produce a program just as fast.

      The difference is that there are facilities in C++ to easily handle range checking, if you want to use them, and in most situations there's no good reason not to.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    15. Re:Recent experience with C by CustomSolvers2 · · Score: 1

      Chances are your C program would be easy to transform to C++, line for line

      I wasn't implying that it would be difficult. It would become plainly slower. The idea is extremely simple: on one hand, you have virtually nothing; on the other hand, you have much more.

      See, although you have had a quite acceptably-understanding attitude, I stopped seeing the exact point of this discussion a while ago. For a reason I don't know, you seem to be interested in convincing me about using C++ rather than C and you think that you have a chance. Sorry to burst your bubble, but you have none (not even 1 out a million LOL). I will finish the referred development in plain C and, unless under very specific conditions, I will continue using other programming languages different than C and C++. I guess that you will continue using C++ and I am OK with it.

      For the time being, I am not planning to publicly release this C code, although I have created a repository (it is still preliminary/work-in-progress and I am updating it regularly) with some of its accessory methods. I don't think that it would change anything, but you might even take some of this code, convert it to C++ and do some speed tests (in that case, there might something of interest to add to this conversation). You can find it here (ironically, GitHub has automatically tagged that repository as C++ for a reason I don't know).

      --
      Custom Solvers 2.0 = Alvaro Carballo Garcia = varocarbas.
    16. Re:Recent experience with C by david_thornley · · Score: 1

      I'm dealing in facts here. A C program can trivially be converted to a C++ program that means the same thing. Most C compilers nowadays are C++ compilers with a few differences. C++ can easily be as fast as C.

      C++ also comes with some features that make it a lot harder to write certain categories of bad code when applied. Range-checking comes with a small price, but std::unique_ptr really doesn't.

      What language you use is your decision, and it's reasonable for us to differ, but C++ was designed to be fast. Stroustrup wrote that a fast construct can be made safer, but a safe construct cannot be made faster.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  15. The Rust community worries me. by Anonymous Coward · · Score: 4, Insightful

    The Rust community really worries me. It's far too tyrannical for my tastes. For example, they apparently aren't capable of acting like civilized adults on their own. They need a Code of Conduct to tell them how to behave, and a Moderation Team to act as what is effectively a judge/jury/executioner role.

    What's worse is when they use these tyrannical apparatuses to attack others. For all of their bragging about how they value "tolerance" and "inclusivity", they so often exhibit the opposite behaviors. Just look at any Reddit or Hacker News discussion about Rust. Anyone who doesn't post a glowingly positive comment about Rust will quickly become the victim of downvote attacks. It worries me when people offering valid, correct and relevant criticisms of a technology are attacked, censored and silenced.

    I've used a lot of languages over the years, from C to C++ to Java to Perl to PHP to Erlang to Haskell. But none of them have had communities as hypocritical, contradictory and tyrannical as I have found Rust's to be.

    1. Re:The Rust community worries me. by Zontar+The+Mindless · · Score: 3, Insightful

      When I first heard about Rust and went to check it out, the so-called "community" put me off it completely.

      --
      Il n'y a pas de Planet B.
    2. Re:The Rust community worries me. by Anonymous Coward · · Score: 2, Insightful

      It's a language by and for SJWs. The real reason for its existence is to try to push out the older generation of hackers, whose politics they despise.

    3. Re: The Rust community worries me. by Anonymous Coward · · Score: 4, Funny

      emacs vs vim, obiously.

    4. Re:The Rust community worries me. by Anonymous Coward · · Score: 1

      I honestly haven't seen this to any worse degree than any other language I've worked with other the years, and I've been closely following Rust's development since its inception. Frankly it's been disappointing to see the lack of quality conversation from the anti-Rust camp (of whom I am actually a member). It's difficult to have honest arguments with the language's developers and supporters with all the nonsensical rhetoric that floats around muddying up the waters. It's worse than the anti-Go circlejerking.

    5. Re:The Rust community worries me. by Zaurus · · Score: 4, Interesting

      I had the exact opposite experience! I have never had such a positive experience with a programming community of any sort as I have with the Rust community. I have never seen an open source project put so much thought and effort into the community side of things. Because of my interaction with the community, I ended up contributing a couple patches and giving two talks about Rust at a conference this last week.

    6. Re: The Rust community worries me. by Anonymous Coward · · Score: 1

      The old "men should not be able to follow little girls alone into the public bathroom or public shower" politics which the Dems thew out under Obama and replaced with the "any man has a civil right to follow any little girl alone in any public bathroom or public shower and if a father or security guard attempts to stop it they should be jailed for civil rights violations".

    7. Re:The Rust community worries me. by Cyberax · · Score: 1

      Seriously? I read the Rust-internals mailing list and so far I have not seen any problems with conduct. And by experience, people who make noise about Code Of Conduct are not going to contribute anything useful anyway.

      Oh, and the language itself is covered by MIT, so even KKK, Nazi party members and Republican primary voters can use it.

    8. Re:The Rust community worries me. by blazin · · Score: 1

      If it was a conference in Utah, I probably saw the first of your two talks. Great job. It definitely made me want to go back and try to learn Rust again.

    9. Re:The Rust community worries me. by Zaurus · · Score: 1

      It was! I'm so glad you enjoyed it!

    10. Re:The Rust community worries me. by AmiMoJo · · Score: 1

      Anyone who doesn't post a glowingly positive comment about Rust will quickly become the victim of downvote attacks.

      So no worse than Slashdot or Reddit or HN then, despite having the dreaded Code of Conduct.

      I've found the Rust community helpful and welcoming. The only systemic down-voting I've seen is when there is obvious trolling or people complaining about the very existence of the CoC. I'm sure you will supply us with some links to evidence of the kind of abuse you speak of.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    11. Re: The Rust community worries me. by alexgieg · · Score: 1

      "any man has a civil right to follow any little girl alone in any public bathroom or public shower and if a father or security guard attempts to stop it they should be jailed for civil rights violations"

      This is right in line with the Romans of old thinking acting though on Christians was okay because everyone knew they drunk human blood and eat human flesh in their dark rituals on crypts.

      Or with Christians of old thinking acting though on Jews was okay because, on top of being god-killers, they were all well known for poisoning wells and kidnapping babies to sacrifice and eat in their Sabbaths.

      Or with...

      Or with...

      Or with...

      Humans. When will they learn?

      --
      Conservatism: (n.) love of the existing evils. Liberalism: (n.) desire to substitute new evils for the existing ones.
    12. Re: The Rust community worries me. by david_thornley · · Score: 1

      Unless you're going to institute genital and/or DNA checks to use rest rooms, the "trans people use the rest room of their initially assigned sex" is quite dangerous. If I were to walk into a ladies' room, I'd cause a fuss. There are trans men who look a lot more muscular and hairy than I do, and if you're legally forcing them into the ladies' room there's no justification for a fuss.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
    13. Re:The Rust community worries me. by strikethree · · Score: 1

      I had the exact opposite experience! I have never had such a positive experience with a programming community of any sort as I have with the Rust community.

      That is because their tight rules fit you. Think of the Community Rules as if they were clothes: What fits perfectly on you will not fit perfectly on your friend... even if they can wear the same clothes.

      --
      "Someone needs to talk to the tree of liberty about its ghoulish drinking problem." by ohnocitizen
  16. Cheap bounds-checking is possible: Cheri CPU by Anonymous Coward · · Score: 1

    The Cheri CPU does pointer bounds and 'const' qualifier checking and some protection of C++ private member variables in hardware, sufficient to replace the security properties of virtual memory (with the caveat you can't unmap a page without killing the process), but without any idea of a "context" so security can apply to each pointer.

    It's implemented in FPGA and only requires a few gates over a standard MIPS and is working with comparable performance without any exotic kinds of cache memory.

    Buffer overflows aren't the only problem with C, but some of the other problems are fixed by C++. I think Cheri CPU would let us execute C++ with langsec approaching garbage-collected languages without pointer arithmetic like Java, Rust, Haskell, OCaml, Erlang, Go, etc. It's only "approaching" because I don't think it can solve use-after-free (there is some help from CCall/CReturn), but still it covers many bug classes. This could be particularly helpful for IoT stuff, $1 CPUs with 32 - 256kByte of RAM for the whole system: Cheri has the gate count and space efficiency to work, while virtual memory and garbage-collected language runtimes are probably both too expensive in both data memory and code size.

    1. Re:Cheap bounds-checking is possible: Cheri CPU by TheRaven64 · · Score: 1
      I am the author of the CHERI C/C++ implementation (and a bunch of the instructions and key parts of the abstract model). A few corrections:

      does pointer bounds and 'const' qualifier checking and some protection of C++ private member variables in hardware

      We don't enforce const in hardware, because it broke too much code. For example, the C standard library function strstr takes a const char* argument and returns a char* derived from it. Our hardware doesn't permit you to add permissions to a pointer (or increase its bounds), and so the returned pointer also lacks the store permissions. Instead, we add __input and __output qualifiers that allow this to work: if you cast a pointer to an __input-qualified one then the compiler removes store permissions and no pointer derived from that pointer can be used to modify an object.

      sufficient to replace the security properties of virtual memory (with the caveat you can't unmap a page without killing the process)

      CHERI doesn't require that you throw away the MMU and some things work a lot better when you compose the two. The MMU is good for coarse-grained isolation, CHERI is good for fine-grained sharing. You can use the MMU to revoke objects (unmap the pages), without having to find and invalidate all pointers (which we can do - a couple of my students and I have added accurate garbage collection to C).

      It's implemented in FPGA and only requires a few gates over a standard MIPS and is working with comparable performance without any exotic kinds of cache memory.

      Note that we do rely on tagged memory, though we are able to efficiently implement this in commodity DRAM via a tag cache (some of my colleagues have done some great work on improving the efficiency here). We need one tag bit per 128 bits of memory (the tag bit tells you whether an aligned 128-bit value contains a pointer or normal data), so 256 bits per page. You can read 256 bits from a single DRAM read, so anything with vaguely good cache locality rarely needs to pull the tags from DRAM.

      It's only "approaching" because I don't think it can solve use-after-free

      We can implement an accurate garbage collector in C with CHERI. Some of my current work is attempting to push the performance of this up to where C programmers will be willing to just leave it on, because they won't be able to measure a slowdown vs malloc / free. For the Java interop work that I published at ASPLOS this year, we did very coarse-grained revocation, allowing the JVM to invalidate pointers that the native code held for longer than it claimed that it would, thus preventing any spatial or temporal memory safety violations in C code from affecting the Java heap in any way.

      --
      I am TheRaven on Soylent News
    2. Re:Cheap bounds-checking is possible: Cheri CPU by david_thornley · · Score: 1

      Memory allocation in C++ is normally done with smart pointers, which can solve the use-after-free case by changing all invalid pointers into nullptr.

      --
      "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  17. Misplaced blame by ka9dgx · · Score: 1

    Security is the job of the Operating System, not applications, or users. When you run the program, and tell the OS which files it should use, that should be it. The program shouldn't have the authority to access anything not specified. This has worked in the mainframe world for decades, as you specified which virtual disks a system had access to when loading the run-time system. This works in virtualization, when you specify the disks the virtual machine is to use.

    It's going to be a few more years for the technical community to finally wake up to the insanity that is ambient authority, then a decade or so to finally shift to systems that implement the principal for least privilege, like Gnu Hurd and/or Genode.

    1. Re:Misplaced blame by gtall · · Score: 1

      Yes, this. Now let's all trust MS Winders.

    2. Re:Misplaced blame by gweihir · · Score: 1

      And then there are the cases where programs can access things and the security requirement is that they must not misuse them. Which is pretty much the most important case these days and most of it cannot be solved by MAC. You miss about 90% of the problem with your statement.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    3. Re:Misplaced blame by Misagon · · Score: 1

      Principle of least privilege does not make a program more safe or secure. It only limits the amount of damage that it can do.

      I think the largest reason why capability-based security (classical sense, not Unix sense) has failed to get traction is because the designers have not realised that it needed revocation to make long-term services manageable.
      Certificate-based systems (where some are a type of capabilities...) do almost always have it, but I have never seen it in any OS, not even on research level.

      BTW, Google's new Fuchsia OS with Magenta kernel (to replace the Linux kernel in Android eventually, maybe?) is using capabilities but I have not seen that they support revocation either.

      --
      "We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
  18. What happens to Rust when Mozilla is gone? by Anonymous Coward · · Score: 5, Interesting

    Rust is very tied to Mozilla. And Mozilla's only remaining "successful" product is Firefox. But Firefox's market share is dropping. It was only a few percent, last I saw, while Chrome is over 50%. Mozilla reportedly gets a lot of funding from Yahoo, due to a Firefox search deal. So here we have an organization with one major product, but this project is being rejected by consumers, and what might be this organization's most significant source of revenue comes from this failing product and is paid for by another company that isn't doing so well. I fear for Mozilla's future if, say, the Yahoo deal wasn't renewed and they couldn't find a replacement.

    If Mozilla goes the way of the dodo bird, then I can't see the Rust project really going anywhere. I don't think it has a robust independent community like Python or C++ has, for example.

    I think it is too risky to adopt Rust, especially for important long term projects. The tech industry moves fast. Rust could plausibly be gone in 3 years, while languages like C, C++, Python and PHP are far more likely to be going strong.

    1. Re:What happens to Rust when Mozilla is gone? by AaronW · · Score: 4, Informative

      I agree. If Firefox or Thunderbird is anything to go by I'd stay far away. I used Thunderbird for years until very recently but its performance is unusably bad. On my quad core xeon workstation it's almost impossible to write email because the editor freezes so frequently, often for seconds at a time. In the process it drops characters so I can't even type ahead. I suspect it's due to its single threaded nature and I'm dealing with several IMAP accounts with a LOT of emails. I recently switched over to KMail which seems to work far more smoothly. On top of that, Thunderbird is a huge memory pig. I gave up on Firefox ages ago and switched to Chrome due to horrible performance with single-threaded Javascript and the fact that it leaked memory like crazy for years. I also blame Mozilla for killing off MNG which is why we so often are STILL stuck with gif, which is a horrible format for most of the animations I see.

      Rust has its place but it isn't going to replace C any time soon. There are other languages that also make the same claims, i.e. Go, Swift, D, etc.

      One thing about C is it is supported on virtually everything except the micros where only assembly or some oddball language is the only thing supported (I used a processor that ran a pattern matching functional programming language at the hardware level once). There are plenty of other languages that are better than C in many cases, but one thing with C is you don't need to worry about libraries having weird interactions with other languages. C bindings are ubiquitous and very well understood and supported. C++ apps can easily link to and call C libraries but the other direction often requires some glue logic. Most languages can link against C code whereas the opposite is often not true. C has very minimal underlying requirements. I have written numerous bootloaders in C which require only around a page (or less) of assembly code. By boot loader, I'm talking about with no BIOS underneath for embedded systems. Cross compiling is well supported as well and I frequently am cross compiling for MIPS or AARCH64 with compilers that are tuned to the specific chips they're targeting.

      I'm playing with an ESP32 device right now which has two Xtensia cores in it. No Rust support but C and C++ are both supported. There's no underlying operating system. Similarly, one doesn't run Rust on Arduino platforms. Rust is tied almost exclusively to LLVM. There is no GCC support for Rust so there are plenty of platforms where Rust just isn't supported.

      C and C++ are supported by many toolchains, both open source and proprietary. Rust is not.

      --
      This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
    2. Re:What happens to Rust when Mozilla is gone? by phantomfive · · Score: 2

      It's worth watching how Firefox goes as they begin to switch to Rust. If they see performance problems, or if their security bugs all go away (they won't, but you know, some of them might), then those are good data points.

      --
      "First they came for the slanderers and i said nothing."
    3. Re:What happens to Rust when Mozilla is gone? by michael_wojcik · · Score: 1

      But Firefox's market share is dropping. It was only a few percent, last I saw

      If only you had access to some sort of repository of information where you could check this sort of thing, rather relying on something you think you saw at some point in time.

      According to StatCounter's most recent report, Firefox is the #2 browser with a 15.6% market share. "Few" is a vague term, but I don't think most people would have it include 15.

      Personally, if I were a fan of Rust, I wouldn't worry about Mozilla's fortunes. There are plenty of people who could maintain the Rust standard and implementation, should that be necessary.

  19. C can be used for good code by Anonymous Coward · · Score: 1

    In the early 90s, I led a team of 10 that took on the task of re-engineering a working code base to eliminate a pervasive intermittent fault problem caused by many race states in the system and resultant dangling pointers and buffer overflows. The system contained over 180 devices, mostly custom, working together via messages on buses on a real-time task, simulating the rest of an A/C to an avionics computer under test.

    The code was so bad that we decided to do a complete from-scratch rewrite of all software and firmware including programmable logic.

    We switched from Intel PL/M (a simpler language with all of the problems of C) and assembly to ANSI C. We wrote custom language extensions for some of the code that was very patternistic and used ANTLR to compile to pure ANSI C. We religiously used a commercial Lint and Perl-based custom code checkers. After two years, on-schedule and on-budget, we shipped 30 revamped systems that worked like never before. There were only 5 bugs reported in the first year of extensive use.

    Here's the kicker, we wrote over 3 million lines of ANSI C code in those two years, all new, with 5 bugs. It can be done.

  20. So replace old and proven with new and unproven? by gweihir · · Score: 1

    That will go well. Especially as Rust is nowhere near the "silver bullet" it is claimed to be. No. Just no.

    The actual fix is to hire competent coders. Incompetent ones will make their code just as insecure in Rust as they do in C. Sure, the insecurities will be different ones, but that is it. Software quality never has been a question of the language used. The only influence the language used has is how long coding takes. Software quality (and in particular security) is solely a question of the skills of the coders used and the time they are given.

    My take is that this is just another cretin that mistakes "new" for "good" and "old" for "bad".

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  21. Many who code in C should not by Alain+Williams · · Score: 4, Insightful

    To be able to code effectively in C you need to have been doing so for at least 3 years and, preferably, spent 6 months or more writing in assembler. I am not saying that without this people cannot write good C, but I believe that this is what is needed to provide you with the level of insight that is necessary to be a competent C programmer. To be a great one, add a few years experience.

    C is not a language for every one, it is not a language for all problems. But for some it is a good language. The trouble is that some people use it when the, perhaps, should be using another language and then when they get problems blame the language and not themselves.

    Anyway: how can you call a language complete if it does not have a GOTO statement ? I'm not saying that I use it a lot, but it is useful for handling errors & similar. I will doubtless now be flamed by those who have heard Dijkstra's complaint about GOTO and not understood it. I remember programs where one in every three statements was a GOTO - yuck, that is what he was complaining about; not about the single GOTO in every 1,000 to 3,000 lines that I seem to write. Yes: I could eliminate those GOTOs but either by making the program less clear (by introducing extra state variables, or similar) or by making it less efficient. His complaint was about excessive use of GOTO, many who have not read the paper, or do not have enough real programming experience, forget that important qualification.

    1. Re:Many who code in C should not by Mybrid · · Score: 1

      Perl has GOTO and LABELS. I used PERL mostly for ETL and having the capability to break out nested for loops using LABELS made the code cleaner not having to use a bunch of condition variables. Now that I'm in Python I have to filter things which means iterating over things once for the filter in the for list and then again for the processing. Things can be corrected by using 'yield' to iterate once with generators but, and here's the but, the Perl LABEL code is intuitive, whereas the 'yield' code trips people up, is confusing and is under utilized. Therefore developers in Python not using 'yield' are less efficient. Python should use LABELS as a best practice in my opinion.

    2. Re:Many who code in C should not by Tranzistors · · Score: 1

      how can you call a language complete if it does not have a GOTO statement ? I'm not saying that I use it a lot, but it is useful for handling errors & similar

      The valid use-case of GOTO I have seen is recourse cleanup. For that rust has RAII approach. Breaking out of multiple for loops can be a bit more tricky, but those can still be done rather painlessly and if not, use of GOTO would not help with understanding what the code actually does.

    3. Re:Many who code in C should not by rkordmaa · · Score: 1

      General rule of thumb, to get any good at something, you need to do it professionally for 5 years first. Applies to pretty much any engineering field. That obviously means that its unavoidable that there are many many professionals who are still going through these first 5 years...

  22. C is not the problem. by Mybrid · · Score: 1

    I'm sorry but I don't see the security problem, at all. All I see is a bunch of hyperbole.

    First thing one learns in security is that as long as humans are involved then you have a problem. RUST only addresses one aspect of human involvement, operator error. RUST does not address backdoors of design. The recent IOT attack the created the largest DDOS attack was such a back door.

    If the past is any indication of the future then RUST will find its niche and that's it. Safe malloc libraries have been around a long time. But, and here's the but, protection comes at a cost. Kernel developers care about that cost. RUST is being put out there as a free lunch, security without cost. We know that is not true. Instructions need to be run to secure things. Kernel calls that are called orders of magnitude far more than user space calls require bare metal performance.

    It would be interesting to see the statistics on the security attacks over the years so as to compile a percentage of types of breaches. Password hacks are far more common the buffer overflow attacks. So, the question is how much so? The Sony attack was a password attack. If an analysis is done whereby the security breaches due to human error of C coding are minuscule relative to the total then RUST needs to be accounted for: the cost of replacing C with the risk of C breaches. I'm guessing that calculation has already been made.

    Finally, my advisor at UC Berkeley sat on the Board of VISA in the 1990s. In one class he invited students to breach VISA's network protocol. And guess what, someone did. The student's analysis was that security protocol wasn't of the highest order and known breaches existed on the Internet. This was the lesson for the day. The cost of loss for VISA due to security breaches was lower than the performance cost using better security.

    The RUST advocates need to make a better business case than just "RUST is better security". What the RUST advocates such as the one are doing is spreading FUD. The sky is falling! The sky is falling! But if you ask security experts what their top security priorities are, human error due to the C programming language is not in the top of the list.

  23. What about Go? by plopez · · Score: 1

    For the sake of discussion. I haven't used but worked with people who did. They said it was much better than C or C++. Can anyone weigh in on the pros and cons of Go?

    --
    putting the 'B' in LGBTQ+
    1. Re:What about Go? by serviscope_minor · · Score: 1

      They said it was much better than C or C++.

      It's very much not a replacement for C++. It's a pretty basic language, more like a modern version of C. Seems perfectly good for problems which map well onto the structures already built into the language. It was designed for web services and it does that decently well as far as I see.

      If your problem domain doesn't map onto what go's already got builtin, then while doable, it's gonna be annoying and a bit painful because go has no real extensibility mechanisms.

      --
      SJW n. One who posts facts.
  24. It's too late by RhettLivingston · · Score: 1

    I believe that we are about a decade away from a disruptive change that will obsolete all of this. The refactoring would probably take longer.

    At some point, we are going to change to a system in which neural networks are the system and a swarm of traditional processors running very small, tight, calculator-like algorithms are tied within the neural network. This merging of calculators, memories and artificial minds will occur long before any intensive augmentation of biological minds - likely in the next couple of decades. Most of our computers will be grown up versions of Google's assistant, Alexa, Siri, etc.

    These computers will defend themselves with intelligence, not good coding. The main danger will be from snakes with convincing arguments, not buffer overflows.

  25. Re:at least its not python by gweihir · · Score: 1

    Ah, yes. Python, the language that pretty much requires its users to know what they are doing. Just like C, come tho think of it. All the hate against these languages comes from one corner only: Those that cannot hack it.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  26. Re:A job for AI by gweihir · · Score: 1

    Not anytime soon. As in certainly not in the next 50 years. The little problem is that current AI is exclusively "weak AI". and that is the AI without intelligence. All it can do is statistical classification and that is not enough. So for the foreseeable future, the only thing that can make code secure is competent coders. "Pay peanuts, get monkeys" is the main problem that causes insecure code.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  27. Re:Or Ada. Or Erlang... by sphealey · · Score: 1

    Erlang was originally developed to facilitate the creation of provably correct real-time communications systems. The argument (all the way in the dim depths of 2014 here on Slashdot IIRC) is that in today's world all software will eventually be connected to the Internet and both its interactions and its databases may be located at multiple remote unreliable locations/links, and hence all systems can be (and then proceed to should be) modeled as real-time communications systems requiring provably correct software.

    I'm not saying that Erlang has the features needed to create general-purpose business systems, nor am I an advocate of the language, but that's the argument that is out there. Or was 3 years ago; now we have moved on to Rust. Somewhere down at the bottom of the pile is poor old ALGOL...

    Yes, PL/I was out there in the 1965 time frame. Many of what we consider "modern" languages were developed in part to avoid the horror and expense of using PL/I. (keeping in mind that most of the programming language design guys and gals from 1955-1975 knew and interacted with one another). Also similar to Ada in that the in retrospect it is hard to see what the perception of horror was all about. [disclosure: I personally always liked PL/I]

  28. Re:Here we go again by gweihir · · Score: 1

    And that is just it. A C coder needs to be competent, or the code will be horrible. But the same happens in other languages, just that it is less obvious and that is a problem in itself. The problem are not the languages used, it is that there are far too many bad coders.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  29. Doctor Whatever by Tenebrousedge · · Score: 1

    It's almost like the rest of us are more interested in the future of systems programming than casting decisions on some television show. If this bothers you, maybe you're on the wrong site.

    --
    Those who advocate genocide deserve every protection afforded by law, and none afforded by common human decency.
  30. Formal verification is not so unrealistic by Anonymous+Brave+Guy · · Score: 1, Flamebait

    That seems to be a very defeatist attitude. Formal verification doesn't need to be a huge burden. After all, we enforce many useful properties of our programs automatically all the time just by using strongly typed languages. (Obviously less so with needlessly dangerous languages like C and C++, which seems to be the fundamental point in this particular discussion.)

    It's true that it might be prohibitively expensive to formally prove every conceivably useful property of every line of code using the best known methods. Indeed, just figuring out how to specify exactly what you do want to prove isn't always straightforward.

    However, this isn't a black and white issue. We could do much better than we actually do in everyday software development, and the savings could be substantial. The fact that we don't use more powerful tools and more powerful methods routinely is more down to some mix of developer ignorance and hubris than anything else. Most working developers probably don't even realise what is possible or know roughly how the tools and processes work, because unfortunately this remains a relatively low profile field for now. Too many working developers would rather just play with the latest libraries that came out this week in their painting-by-numbers languages anyway, or listen to consultants who've never written a piece of critical software in their entire careers offering the false promise of good code without having to spend much time on things like proper design or documentation.

    We could do so much better with even a modest investment in developer education and a willingness of management to look beyond the current quarter's accounts. Ironically, given the savings from better quality code both due to lower maintenance costs generally and particularly in areas like security or regulatory compliance where failures might also have $$$ fines attached, it might even work out cheaper in the long term to develop in a more careful, considered way. Just some robust analysis of the different possible cases and data flows and so on would probably turn up all kinds of lurking bugs in everyday software, and this is hardly beyond the abilities of an average developer if they have some awareness of what is possible.

    Now, if our priority is to build throwaway web/mobile startups that can TDD an MVP in ten seconds and don't care much about long term maintenance or quality because they're going to either flip or fold the business within a year or two anyway, or if we're interested in in-house business admin systems that need to be as cheap as possible right now because it will come from someone else's budget if we have to fix any screw-ups later, none of this matters. But if we actually want to build good software, then at some point we have to start playing the long game and looking at options that aren't the quick, easy path all the time.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    1. Re:Formal verification is not so unrealistic by Gr8Apes · · Score: 1

      It goes back to the statement: fast, reliable, or cheap, pick 2. The web/mobile startups must have fast, and they're going cheap. I guess that explains it.

      --
      The cesspool just got a check and balance.
    2. Re:Formal verification is not so unrealistic by Anonymous+Brave+Guy · · Score: 1

      There's truth in that, certainly, but I think a lot of people make bad assumptions about how expensive and slow formal methods will or could be. The up-front cost may be higher, perhaps quite significantly so depending on your exact tools and methods. On the other hand, the cost of fixing bugs that you don't catch until much later in the development process can also be high, as can the costs of making good any resulting damage or paying compensation or fines for bugs that make it into production. In each case, "cost" can mean both time and money, and by investing in better safeguards up-front you're likely to reduce the costs of problems later. Whether the cost/benefit is favourable probably depends on the specifics of each case.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  31. Re:Or Ada. Or Erlang... by tigersha · · Score: 1

    > disclosure: I personally always liked PL/I

    Are you kidding?
    Ok, serious question: is PL/I still being used somewhere?
    I remember the thing from back in the late 80s but never bothered to learn it. I met the wife of a colleague in 95 and she claimed to be working it, which surprised me a bit, even then.

    --
    The dangers of excessive individualism are nothing compared to the oppressiveness of excessive collectivism
  32. Re:Here we go again by Anne+Thwacks · · Score: 1
    there are far too many bad coders.

    Unfortunately, not everyone can play Premier League football or win Formula 1 races.

    The real issue for most managers is "how to use the bunch of plonkers HR have hired" - its all very well saying "sack 'em and get some new plonkers" but the new plonkers will probably not be better than the old ones, and will have even less experience of your project.

    Reality is a bitch

    The issue is not how do you get good ones - that is easy - have a recruitment process that can tell the difference and pay more. Now, go on, just do that!

    This also applies to teachers in schools and colleges (subject of griping in previous posts) - and politicians.

    --
    Sent from my ASR33 using ASCII
  33. Swift by johnrpenner · · Score: 4, Interesting

    i've recently converted from C++ to Swift — better modern native unicode string handling, and scales really well from beginner semantics all the way to system level stuff. its a great language to work in — and written by chris lattner (who wrote the clang and LLVM compiler/architecture) — so its well fitted for performance optimizations/very fast.

    swift is the first language that i'd say i feel comfortable replacing C++ with.

    2cents from toronto
    john p

  34. Re:Choice the Language by Anne+Thwacks · · Score: 2
    You sir, are a Unix, neckbeard hipster.

    The whole point of this posting is that you should rewrite NetBSD in Rust. Without losing any portability. It is really quick and easy with such a modern and trendy language - you might even finish by next Thursday.

    I expect it to work fine on a 6809.

    Any failure will be punished by a lifetime PHP project.

    --
    Sent from my ASR33 using ASCII
  35. Re:Or Ada. Or Erlang... by sphealey · · Score: 1

    IBM still sells/supports their compiler, or at least did the last time I checked a couple of years ago. I doubt it is used for anything other than support of very old legacy code. All the PC compilers are gone now I think. I wonder if anyone at Cornell even remembers PL/C?

  36. Re:Or Ada. Or Erlang... by sphealey · · Score: 1

    There you go: available for both z/OS and AIX!

    http://www-03.ibm.com/software...

  37. Re:Here we go again by gweihir · · Score: 1

    As long as we allow bad coders to write mission-critical code, the problem is not going to go away. Sure, there are other problems as well, as the one you describe, but the core problem is that people that have no business doing so are writing code. And this "code boot-camp" madness is making things worse.

    For myself, I cant complain. While I usually do security consulting, I recently had a larger project coding some Apache modules in C (no other choice as there were both tight memory and speed constraints) and I did it at the full consulting rate. That boils down to around 2.3 times what that customer pays for a "coder" (Java monkey, really). Also, all the bad coders around assure my primary job. But the sheer stupidity of what is going on does offend me, in particular all those morons (this time "Rust morons") charging off screaming "Hurrah!" in the _known_ to be wrong direction.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  38. why? by kiviQr · · Score: 1

    my C code has plenty of rust already why should I touch it?

  39. TechCrunch are noobs by el_jake · · Score: 1

    The day TC can write this in Rust i'll spray WD40 all over my screen. main(int c,char**v){return!m(v[1],v[2]);}m(char*s,char*t){return*t-42?*s?63==*t|*s==*t&&m(s+1,t+1):!*t:m(s,t+1)||*s&&m(s+1,t);} Jake.

    --
    In order to form an immaculate member of a flock of sheep one must, above all, be a sheep.
  40. Re:Or Ada. Or Erlang... by serviscope_minor · · Score: 1

    If only there was a language that was mostly compatible with C, to the point where you could slowly migrate an old and massive C project to that language and then slowly replace thigs with more modern features that make correctnes much easier.

    --
    SJW n. One who posts facts.
  41. Re:Or Ada. Or Erlang... by Megol · · Score: 1

    Because people are stupid. Yes I include me in that category. Oh the myths of how gods own language with the dangerous (=unchecked) but powerful design was so fast and nice and ... Yeah I bought into that idea. The fourth language I learned. And was soon let down. It was a primitive language with few features. The compilers were obviously bad if one ever had used assembly language, in some cases interpreted Forth was faster(!). The big thing was that is was portable. Or so "they" claimed. In practice that was limited to a subset of machines and even then most c code was filled with defines to create some kind of meta-language to get that portability. Some skilled programmers could write beautiful portable and good code in C. Most couldn't.

    But people like me thought that C was the good thing and alternatives were crap. A lot of code were created in C, a lot of people got C experience. That lead to increasing use of C in a lot of companies even when other languages would be the better choice. Some software actually said outright that it was written in C as if that would be a guarantee of performance or portability. It sure wasn't a guarantee of code quality or reliability.

    Then the years passed, C++ became actually usable. The same idea of C/C++ as something superior still remained and more code was created in those languages. Some weaknesses of the C family were polished. C became the default standard and most other languages simply ignored.

    So there is a mental (=developers, ex-developers in management, management that thinks C family languages is equal to portability) and physical (=a lot of code written in C) bias towards C, strong attractions of using C family languages even when they aren't a good fit. So now we have the standard tool but we don't have the skilled programmers that can actually write good code using it. It isn't systems programmers with good knowledge of the machine they are using that writes C code - it is application level programmers that use a polished systems programming language writing code on an abstraction level the language wasn't designed for in the first place.

    Sorry for the ranting.

  42. Re:Choice the Language by serviscope_minor · · Score: 1

    You don't want to monkey with old codebases. If they're written in C, keep them in C.

    The developers of GCC made the opposite choice. They migrated it from C to C++ a while back. The first stage was to ensure it compiled and ran correctly on both. They are still migrating since GCC has crazy requirements on compatibility for bootstrapping, which is fair enough.

    --
    SJW n. One who posts facts.
  43. I'd like to hear Linus T. about this one by AncalagonTotof · · Score: 1

    M. Torvalds, do you agree with this statement : "if it's made with C, it's nothing but a bunch of security issues ?".

    --
    Totof
  44. Formalizing type safety in Rust by whh3 · · Score: 1

    I love C. That's first. Second, I haven't read this TechCrunch person's post, but I am generally not inclined to believe anything on TC beyond their analysis of the industry (if I even believe that!).

    HOWEVER,

    I wanted to share this paper from HotOS 2017 about formalizing type safety in Rust:

    https://www.ics.uci.edu/~aburtsev/doc/crust-hotos17.pdf

    I thought it was interesting. In light of this discussion, I thought someone might find it useful!

    Will

    --
    remove nospam. to email!
    1. Re:Formalizing type safety in Rust by Mybrid · · Score: 1

      Thanks!

      "Our SFI implementation (Section 3)
      introduces the overhead of 90 cycles per protected method
      call and has zero runtime overhead during normal execution."

      90 clock cycles is still 90 clock cycles more than C.

    2. Re:Formalizing type safety in Rust by Mybrid · · Score: 1

      And then there is this:
      "Single ownership eliminates pointer aliasing, making it
      impossible to implement data structures like doubly-linked
      lists in pure Rust. The language offers two mechanisms to
      remedy this limitation. First, Rust embeds an unsafe subset
      that is not subject to the single ownership restriction and
      is used to, e.g., implement parts of Rustâ(TM)s standard library,
      including linked lists. Techniques described in this paper
      rely on properties of the Rust type system that only hold
      for the safe subset of the language. In the rest of the paper
      we assume that unsafe code is confined to trusted libraries."

      Trusted libraries! woo hoo! /facepalm

  45. Formal verification considered harmful by dcollins · · Score: 1

    It is argued that formal verifications of programs, no matter how obtained, will not play the same key role in the development of computer science and software engineering as proofs do in mathematics. Furthermore the absence of continuity, the inevitability of change, and the complexity of specification of significantly many real programs make the formal verification process difficult to justify and manage. It is felt that ease of formal verification should not dominate program language design.

    De Millo, Richard A., Richard J. Upton, and Alan J. Perlis. "Social processes and proofs of theorems and programs." The mathematical intelligencer 3.1 (1980): 31-40. (Reprinted from Communications of the ACM, Vol. 22, No. 5, May 1979.)

    https://link.springer.com/article/10.1007/BF03023394

    --
    We know where leadership by an anti-intellectual "strongman" who scapegoats minorities and likes boisterous rallies goes
  46. Yes it is too much to ask. by TiggertheMad · · Score: 1

    Why replace it at all? Why not just introduce new features into the c compilers, language, and libraries that just identify and correct bad patterns and practices? Why is it that we need to replace the language at all? The whole point of putting logic in software is that it can be changed relatively easily.

    --

    HA! I just wasted some of your bandwidth with a frivolous sig!
    1. Re:Yes it is too much to ask. by BCooley · · Score: 1

      Why replace it at all? Why not just introduce new features into the c compilers, language, and libraries that just identify and correct bad patterns and practices? Why is it that we need to replace the language at all? The whole point of putting logic in software is that it can be changed relatively easily.

      Microsoft Research took that approach with "Checked C" and the current version is here:

      https://github.com/microsoft/c...

      I'm not sure if it comes close to offering the guarantees that Rust does, but I believe it's an attempt to provide a similar set of type and memory safety constructs while still essentially being a variant of C.

      In any case, it's not about the syntax. I for one am not a fan of Rust's as a language. It's about the very reasonable goal of building software that has some form of baseline resistance to common vulnerability flaws built in.

      There's more than one way to skin that cat. It doesn't have to be Rust but it should be something.

    2. Re:Yes it is too much to ask. by Anonymous+Brave+Guy · · Score: 3, Interesting

      Why replace it at all? Why not just introduce new features into the c compilers, language, and libraries that just identify and correct bad patterns and practices?

      Because at some point, you can't keep building skyscrapers on shaky foundations. If the underlying programming model in your language doesn't provide some useful guarantee in relation to the correctness of your code, there is only so much you can do. Even modern C and C++ are very far into the not-providing-guarantees area compared to many other languages that have been designed with correctness in mind and the benefit of decades more collective experience in the industry.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    3. Re:Yes it is too much to ask. by Bing+Tsher+E · · Score: 1

      Why replace it at all?

      Every generation of new people wants to rip it all down and replace it. This particularly seems to apply when it comes to software development. Everybody knows, they simply know, that they can do a better job, if we just rip out everything from before and implement it again from scratch.

      That has always been the case.

    4. Re:Yes it is too much to ask. by poptix · · Score: 1

      ^-- This.

      --
      Just because you disagree doesn't mean it's not true.
    5. Re:Yes it is too much to ask. by K.+S.+Kyosuke · · Score: 1

      This was the case with Smalltalk and it worked very well for Smalltalk until someone tried to commercialize it in the 1980s. Ultimately it's all about whether the stability you get is worth the technical debt you accrue by having to carve out a new software artifact with structures you discovered you need from an old environment in which they may not have been even conceptualized yet. The funny thing is, sometimes the better job is not actually all that difficult and the "from scratch" part often merely involves employing things that were actually discovered in the 1960s or 1970s but again ignored in the 1980s or 1990s. (Sometimes it actually *is* about generations - every time a new class of computers came into the market, its software people apparently forgot the lessons of the previous generation. That realization was when I finally understood some of Dijkstra's bickerings about PCs.) The only problem is that the software on top of the environment you'd have to rewrite is usually bigger than the environment itself. *That* is the real problem.

      --
      Ezekiel 23:20
    6. Re: Yes it is too much to ask. by Anonymous+Brave+Guy · · Score: 1

      There is absolutely no reason that C/C++ cannot have a "safe" mode and maintain the familiar and relatively sane syntax that millions of software professionals know.

      And yet no such "safe" mode exists. QED.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  47. Rust is not always the answer by AaronW · · Score: 1

    Rust developers seem to think that Rust is the answer to everything when it is not. I recall getting into an argument with a Rust developer over the fact that I refuse to even look at Rust. I write low-level boot loaders with a mixture of C and some assembly language for embedded systems where size can be a real premium and I'm working close to the hardware where things like pointer checking would cause a lot of problems and I don't have space for all the extra overhead (i.e. bounds checking, garbage collection, etc.) when every byte of space counts. In addition, I am cross compiling using the GCC toolchain optimized and tuned for the particular chips I'm working with (MIPS64 and ARMv8). Rust would be a big pain in the butt for the stuff I deal with where I frequently rely on the features of C that are considered "unsafe" like typcasting pointers to specific memory addresses, allocating memory without garbage collection, etc. While you can do those things with Rust, all of those Rust features get in the way and require language overhead of a run-time library (I don't have the C run-time library in many cases). Then there's the fact that I know the C cross compiler is very well supported and optimized for our architecture (we have a team of compiler people where I work). On the side I'm playing with an ESP32 (Xtensa CPU cores) device and Rust is not supported. C and C++ are supported, on the other hand. I was just looking at TLS support for a project I'm planning on the ESP32 and found an open-source cross-platform C library for it that works within its constraints, considering the fact that it does not have a real operating system. As far as I can tell, Rust is not supported at all on the ESP32 since LLVM is not supported (but gcc is).

    I can throw C at basically anything. In some of the MIPS bootloaders I've written I need only about a page of assembly code before jumping to C code. There's no way I could do that with Rust.

    No language is good at everything. C has a very long track record and is supported by virtually every CPU out there other than some extremely limited micros that only support assembly language or other oddball languages. (I once worked with a processor that executed a functional programming pattern-matching language in hardware that was incapable of running C). The FPL was basically assembly to this processor.

      I don't know Rust other than what I've read about the language and I'm sure it has its place. One other thing to realize is that a lot of languages come and go.
      Look at Java, for example. At one point there was a huge rush to support Java for everything but that has died down. One doesn't see many Java apps any more and I must say that it's always a major pain in the butt every time I need to use one now (especially since Oracle's Java RPM is broken and won't install without a lot of hacking... they screwed up the alternatives settings). Also, Oracle refuses to upgrade their Java plug-in to work with Chrome and modern plug-in interfaces.

    C and C++ are very well established and have long track records and they are not controlled or dominated by any one company or group. I've also lost a lot of respect for Mozilla. The Firefox browser has been a disaster for a long time, and don't get me started on how bad Thunderbird is... Thunderbird on all of my systems is so slow I can barely type to compose an email due to its horrible single-threaded nature. I dumped Firefox for the most part a long time ago and haven't looked back. The horrible memory leaks and bad single-threaded Javascript killed it for me and they ignored the major problems for years. There's a reason Apple adopted KHTML for Webkit.

    There are plenty of other similar programming languages, i.e. D, Go, Swift, etc. Only the test of time will prove its success. C and C++ have withstood the test of time, warts and all.

    --
    This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
  48. Re:Lack of an Ada bootstrap compiler in C. by sphealey · · Score: 2

    = = = Having said all this, if someone gets the old NYU Ada interpreter (written in C!) = = =

    DB: HAL, I think I've detected a logic error in the main core.

    HAL: I'll get right on that Dave

  49. Re:Or Ada. Or Erlang... by sphealey · · Score: 1

    Doesn't strike me a rant at all - a reasonably thought about the underlying question IMHO

    sPh

  50. Much easier said than done - even in small doses. by jaredm1 · · Score: 1

    I remember this came up on Postgres mailing lists earlier this year: https://www.postgresql.org/mes... Perhaps someone can code some machine learning code-converter to do it :-p

  51. Use C with the right tools by GuB-42 · · Score: 2

    The strength of Rust is that it has a great static analyzer.
    But C also has great tools : linters, debuggers, test frameworks, ... Use them. No need to rewrite everything.

  52. Performance is merely an excuse by aberglas · · Score: 1

    The real problem is that ADA has End If, and all the cool kids use {}. It also normally counts from 1 which is so archaic -- had a word about that to my kid's kindy teacher.

    (Ada is also obsolete because it does not have garbage collection, which is the number one issue with C in practice (providing you write it very carefully). Ada is also rather facist. There is a place for the very occasional explicit unsafe array access (like .Net). C was obsolete when it was invented, and many people said at the time how horrible it was. But it grew prominant with Unix. And no, Java is not slower than C in practice.)

  53. Another bad idea from the press, surprise! by Darkness+Of+Course · · Score: 1

    Well not a surprise actually. Peter Bright at Arstechnica.com made a similar pitch last year or so. Just as poorly thought out although more verbose than this piece.

    New programmers are being trained in what language? Yep, Java (or worse java.script). Many of the code camp type of pushes appear (to me) as pitches to have everything run in the cloud/on the web/in HTML 5. None of which teach anything at all about systems, security and coding standards. How can you enforce a standard on crap? Just plop it down, see if it works.

    The people making these pitches are not people that I would hire/trust. Sorry. If they aren't capable of doing the job, then don't hire them. I have a few people I would trust to write systems code. A few more that I would trust to write user level code. None of them were trained in Java. And we all write in C.

    There is C.

    There is no C++.

  54. Calling it "Rust" defeats acceptance. by Futurepower(R) · · Score: 1

    The response of the postgresql folks was something like "how about we finish porting it from lisp, first?"

    Hah!

    Why do tech. people give things wacky names? Things that are rusty get thrown away. On the other hand, if they wanted a wacky name, why didn't they go all the way and call the Rust language "Feces"? Okay then, how about "Vomit"?

    "Lisp" is a speech impediment.

    "Gimp" is a person who limps or is lame.

    But hey! Why voluntarily restrict technology names to only 1 alphabet? "LaTeX" LaTeX uses Greek letters, also, and requires two paragraphs in the Wikipedia article to explain the name.

    1. Re:Calling it "Rust" defeats acceptance. by Bing+Tsher+E · · Score: 1

      and requires two paragraphs in the Wikipedia article to explain the name.

      A guy named Lamport writes an extension for a software tool called TeX. TeX is typesetting software written by Donald Knuth.

      Two paragraphs required? I did a good job with two sentences. Somebody at Wikipedia was bored.

    2. Re:Calling it "Rust" defeats acceptance. by arglebargle_xiv · · Score: 1

      Why do tech. people give things wacky names?

      Well if it wasn't called Rust then you couldn't call its supporters Rust Flakes.

    3. Re:Calling it "Rust" defeats acceptance. by K.+S.+Kyosuke · · Score: 1

      You think that "tech people" are the only ones giving wacky names to things? I didn't notice that.

      --
      Ezekiel 23:20
    4. Re:Calling it "Rust" defeats acceptance. by Cro+Magnon · · Score: 1

      But, is naming a language after oxidized iron any worse than naming a language after a grade, and a mediocre one at that?

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
  55. Re:Many who code should not by w3woody · · Score: 1

    There. FTFY.

  56. Re:Or Ada. Or Erlang... by roca · · Score: 1

    Because before Rust there weren't any languages that let you incrementally replace C code and have safety.

  57. How about C with type checking that works? by DutchUncle · · Score: 1

    Just type checking. If I take the time to define an enum, or even just a type, don't just mush them all into integers and let them all be the same. That one check would catch a lot of consistency errors. For example, I do a lot of Modbus programming with 1-based Modbus addresses which turn into 0-based offsets in tables. I would love to define some variables as OneBased and ZeroBased, and specify that my table index has to be ZeroBased, And don't compare with assembler, I worked in IBM assembler for nine years, I'd *rather* work in assembler because IBM assembler macros had more capability than C++ templates. I could have donw better type checking that way.

  58. Migrating linux should be the target by e70838 · · Score: 1

    IMHO, C should be replaced by a better language. The most important peace of software that should be replaced is the OS. The new language shall be perceptibly optimized for this task so that you can convince Linus Torvalds to migrate. Once Linux is migrated, conquering the rest of the world will be peace of cake ;-)

  59. Absolutely not by c++horde · · Score: 1

    People like this have no business developing software. Countless projects use C and have been able to use that artillery to make very stable software that runs systems Aircraft Systems to powering Word Processors. When someone suggests dumping C it hearkens back to the day when they passed legislation requiring all defense work be developed in Ada. I've looked at Rust, but definitely not a fan. Why use Rust when there is Ada? Not invented here syndrome is back in full force with the kiddies. C is a language for big boys that need and want that "artillery". I don't understand why people have such a problem with C. Memory management is not that difficult. Error handling is not difficult. I've found nothing is difficult in C, even Bjarne Stroustrup's claim you're unable to abstract is bogus. structs can have function pointers. I've been developing for 30 years and C/C++ both languages will be around longer than I'm alive. Rust and Ada are pretty much the same language. Why did someone spend the time developing another language called Rust? Learn C, C++, Java and Python and forget the rest of these pet projects. Oh, Learn Ada over Rust. Ada is far more advanced and extensible than Rust will ever be.

  60. Re:Or Ada. Or Erlang... by Zo0ok · · Score: 1

    C++, or even Objective C... but mixing C and C++ is usually worse than either of them.

  61. Re:Swift by fred6666 · · Score: 1

    In your Apple-only world Swift might be an option.
    For the rest of the world, it's far from being a C++ replacement.

  62. Why Rust ? by robinsc · · Score: 1

    And Has someone written comparable sized programs in rust ? I haven't seen them - have you ?

    --
    Linkedin http://in.linkedin.com/in/robinsaikatchatterjee
    1. Re:Why Rust ? by robinsc · · Score: 1

      the rust compiler has bits written in c++ ... hmmm circles within circles... Jon Evans needs a new job with more sunshine.

      --
      Linkedin http://in.linkedin.com/in/robinsaikatchatterjee
    2. Re:Why Rust ? by Anonymous Coward · · Score: 1

      Just look at Servo to see what can be done with Rust.

      Rust allows a long-time browser developer to spend years creating a half-arsed browser that barely works and that's only about as capable as Netscape Navigator 4 was 20 years ago.

      Or look at the Rust compiler and standard library.

      Rust allows the creation of a compiler that depends heavily on LLVM (which is mainly written in C++), yet somehow manages to feel so much slower than Clang, which is a C++ compiler that also uses LLVM.

      If you need another example, you can look at the thousands of Rust libraries scattered around GitHub.

      Most of these libraries are woefully incomplete, don't see anything resembling proper releases, and probably won't even compile because they use last week's (or last month's, or last year's) dialect of Rust instead of whatever the Rust compiler understands today.

  63. An F for C and D. by Futurepower(R) · · Score: 1

    I agree! "C" is a letter, not a name for a computer language. Yuck.

    Worse!!! C++ is a name spelled with a math symbol.

    Then there is the D language.

  64. Great idea! by T.E.D. · · Score: 1

    Replacing all existing C code with rust is a wonderful idea. All those worries about hackers and safety-critical systems failing due to a surprising int/float conversion will be gone. The only danger we have to worry about from it any more is tetanus.

    What's that? Rust is another programming language you say? Oh well, that's very different.

  65. Re:Or Ada. Or Erlang... by david_thornley · · Score: 1

    C++ can easily eliminate buffer overflows and dangling pointer problems. It isn't perfect, but it's better than C and very easy to move to from C.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  66. Re:Does formal verification really prove correctne by TheRaven64 · · Score: 1

    Formal verification proves that the program corresponds to the specification. It doesn't prove that the specification is correct. It's really hard not to run into Goedel's incompleteness theorem and discover that the specification is actually more complex (and therefore error prone) than the program.

    --
    I am TheRaven on Soylent News
  67. Re:More on this please! by TheRaven64 · · Score: 1

    There's a lot of ongoing work. Some of it is in formal models of programming languages: we had a paper in PLDI last year on a model for C (which has to be parameterised, because it turns out the C standards committee, C programmers, and C compiler writers have almost totally disjoint ideas about what C means). We're looking at combining this with formal models of CPUs to allow black-box testing of compilers (if we can prove that the output corresponds to the input then we don't need to verify a few million lines of compiler). There's white-box stuff, such as the Alive project from Utah and MSR looking at proving correctness of a number of the peephole optimisations in LLVM (although, unfortunately, it's so far managed to prove incorrectness of a depressing number of them).

    Beyond that, there's a lot of ongoing work improving the proof tools. Coq, Isabelle and HOL4 are still in active development and AGDA has gained an increasingly large following in recent years. The more that you can automate the proofs, the more feasible this kind of thing becomes and, in particular, the easier you can make it to write modular proofs the easier it is to maintain the code. The CEO of Intel just after the Pentium FDIV bug started to pour money into verification and made quite an insightful comment in this regard: He didn't care how much it cost to verify something the first time (it had to be cheaper than doing a full recall), but he needed it to be cheap to re-verify after some changes. Centaur (formerly VIA's x86 chip division) incorporates a lot of verification into their CI system: they're a long way away from full verification, but their verification tools help catch and pinpoint a lot of things that would otherwise (probably) show up in testing in the simulator as 'something is broken in the design'.

    There's also a growing push towards proof-carrying code. The F* language (MSR and INRIA) is probably the best example in this space. It's a version of F# that allows you to write proofs in the same language that you write the code and only compiles when the code matches the proofs. Unfortunately, F* still has a very long way to go before simple changes are easy. For example, they have a talk where they walk through verifying a quicksort implementation. If you want to change the quicksort to a heapsort, then you have to throw away most of the proof (and the proof is more complex than the implementation, though at least the input / output specifications are simple and so you can be sure that the proof is correct if it compiles). They're also using an SMT solver (Z3) on the back end, so there's no guarantee that it will actually terminate: you will either get a counterexample, a success message, or a timeout in the solver and a timeout doesn't necessarily mean that the proof is correct or incorrect, just that it's too complex to machine check.

    --
    I am TheRaven on Soylent News
  68. carving turkey by nten · · Score: 1

    It is very very hard to create the sort of defects that cause the majority of cve in rust. Needs citation sure. But out of bounds by itself. Just look at cve for java vs c or c++. If there is a turkey carving knife that has a handle who cares if it is perfect as long as you can cut turkey with it? Put down the one that is all blade! Most of my 15yr career has been embedded c++ and I see what even good developers sometimes do. Most of which you couldn't compile in rust (or Ada).

    --
    refactor the law, its bloated, confusing and unmaintainable.
  69. Add the devs to adm so they can read logs by tepples · · Score: 1

    I'm not sure exactly to what "tools for debugging" you refer. But your operating system ought to be able to give read-only access to the log files to a particular ordinary user account. In GNU/Linux distributions based on Debian, users in the group adm have read privileges throughout /var/log but little else. Think of it as standing for "ADministrative Monitoring".

  70. Re:More on this please! by TheRaven64 · · Score: 1

    Thanks a lot for this overview. It looks like the only active giant is Microsoft, which I interpret as: there's no money to be made there soon.

    It's more that Microsoft is the only big tech company that had its reputation hurt badly as a result of poor security. Android security is arguably worse than Windows XP (definitely if you consider how much better it should be given that they had a decade to learn lessons from XP), but Google doesn't yet have a reputation as a vendor of insecure software. Apple invests quite a bit in security, but if you read the list of fixes in the security update from a couple of days ago (including a privilege escalation in the library used for IPC between sandboxed and unsandboxed processes that allows sandbox escape), you can see that they still have a long way to go, yet aren't big malware targets yet. Companies tend to invest in formal verification after some expensive negative PR. Intel did after the FDIV bug, Microsoft after things like Slammer associated 'Windows' and 'insecure' in the minds of their customers.

    The thing I don't understand is: how come we still live with internet connected things botnets (CCTVs and such) that can e.g. deal massive DDoS attacks?

    Participating in a DDoS doesn't take much and is hard to prevent. If you have a million devices on a 1Mb/s connection, they can easily overwhelm someone on a gigabit connection, even using a sufficiently small amount of their available bandwidth that they won't be spotted at the endpoints. Being able to create a botnet out of these that can launch a DDoS requires a vulnerability and a monoculture. Most software will have at least one exploitable vulnerability, but finding a vulnerability in a thousand different things is prohibitively expensive. If there are a hundred million devices all running the same Linux version or the same network-facing application, then an exploit in that lets you build a botnet.

    By the way, DARPA has been funding a lot of research in improving security, including the project that I work on.

    --
    I am TheRaven on Soylent News