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.

505 comments

  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 Anonymous Coward · · Score: 0

      An opinion piece was published when a real news item fir geeks is spreading like wildfire - we are finally getting a female Doctor Who.

      I'm collecting everyone's Geek Cards at the door.

      M

    4. 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.

    5. 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.

    6. 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.

    7. 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

    8. 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.

    9. 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.
    10. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      If you thought the complaining about cast of Star Trek Discovery was crazy

      I missed that. Was there a niggér in it?

    11. 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?

    12. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      Well?... Is she??

    13. 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+
    14. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      I am not even sure I know anyone remotely considering moving off C. The people who say this usually live in some fantasy bubble where all problems look like their very narrow problem for which C is no longer the best choice. In my work there is only C and I haven't seen anything remotely equipped to replace it.

    15. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      https://imgflip.com/i/1sldvf

    16. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      But muh insular group of unemployed redditor friends told me that it makes writing bad code impossible~~!

      I'd better rewrite my 100K+LoC codebase in Rust immediately!

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

      that just killed all conversation

    18. 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.
    19. 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 --
    20. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      Not as if strongly typed languages weren't tried before: Pascal, Ada, Java...
      A good programmer can write bad code in any language.

    21. 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.

    22. 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.
    23. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      People that make mistakes that have great consequences should be punished.
      Civil engineers that build a bridge that collapses because of an error are punished, maybe they lose their license, and go to jail. I don't see why professional software developers should be immune from this. And don't say because people don't die. Yet, but software is pervading a lot of critical systems. What happens when one of those systems fucks up (because of a software bug) and kills someone ?

    24. 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.
    25. 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.
    26. 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
    27. 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
    28. Re:Yes, go ahead! by Anonymous Coward · · Score: 0, Flamebait

      If developers can't write secure programs using C what makes anyone think they can do it using Rust or any other language for that matter? One of the reason the author would support Rust over C is that C gives the programmer to much access to the underlying OS and hardware layers and creating security issues. There is a quick and surefire way to alleviate this concern. Hire people that know what the are actually doing. Assigning your front-end web developer guru to a project that requires C skills is just asking for trouble. Developers are quite adept at taking any language on any platform and creating some really impressive security holes that have nothing to do with the particular technology being used. And if you refactor your C code one piece at a time you now have two different development environments to support for however long it takes to retire all the C code. Of course this assumes you can find enough competent C/C++ developers willing to work on such a project. The largest segment of the software developer talent pool is programmers who develop against runtimes (usually built using C/C++ or Java) instead of programming against an actual OS. The next greatest segment are the programmers who maybe knowledgeable in all the various scripting technologies but haven't a clue about the under lying scripting engines that turn their scripts into an actual program. If you pitched this conversion project to me the first thing I would ask is what are the actual real world benefits of replacing C with Rust.

    29. 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.
    30. 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?

    31. 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.

    32. 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.

    33. 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; }
    34. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      Why, yes, yes she is...

    35. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      No need. Despite poplar opinion, writing C that works is not hard. Sure, you have to avoid a few bad library function like gets(), but that doesn't mean you have to give up C.

    36. 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.

    37. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      The problem is the opposite really.

      Everyone should be using C, not C++, not Rust, not Java. Just C, and standardize on C11 and require Annex K (the bounds-checking mechanic) to always be used at the compiler level.

      I'd actually propose we move to a new standard which I'll call "Portable C20", where all the quirks and bullshit imposed by platforms like Windows and Linux are banned. If you set your compiler target to "PC20" the binary will run on all platforms, x86, x86-64, ARM, PPC, etc. The process launcher on the OS will pick which binary blob is suitable for the CPU in the system and run that (eg fat binaries) and nothing else needs to be done.

      You can't switch to other languages because other languages runtimes are not on the operating system, and some of these languages evolve rapidly, which means that the operating system runtime becomes out of date.

      You all remember seeing "can't find VBRUN300.DLL" right? Or "MSVCRxx.DLL", If you do a search of your Windows PC you'll probably find one runtime for every C runtime going back to Visual Studio 6.0.

      Let's see:
      7 copies of MSVCR80.DLL
      5 copies of MSVCR90.DLL
      2 copies of MSVCRT.DLL
      1 copy of MSVCRT120.DLL
      2 copies of MSVCR120.DLL
      15 copies of MSVCR100.DLL
      4 copies of MSBCR71.DLL
      10 copies of MSVCR120_CLR0400.DLL
      1 copy of MSBVCR110.DLL

      So there are 9 versions of Visual Studio C run times here, and to be fair some of these are SxS (Side by Side Assemblies) which are basically a way for Windows to say "which flavor do you want"
      eg
      WinSxS\x86_netfx4-msvcr120_clr_dll_31bf3856ad364e35_4.0.14917.107_none_5236aa29214f301c
      WinSxS\Temp\InFlight\d5b2a28f16fdd201ee0600005021a421\x86_netfx4-msvcr120_clr_dll_31bf3856ad364e35_4.0.14917.105_none_524c4a01213ef83a

      But on Linux and MacOS X, things are a bit more awful. Because of shitty package managers on Linux (and now on FreeBSD), there is a need to maintain multiple copies, if not multiple versions of shared C runtimes.

      Now throw in the complexity of C,C++,C# runtime shipped with Windows, C,C++.OBJC runtime shipped with MacOSX, and only the C runtime shipped with FreeBSD, and you have this predicament where the only "known quantity" that will work on all operating systems is a C program written to use the CLI text-mode.

      There is no standard GUI library, despite Windows and OSX trying to hide the CLI, and Linux/FreeBSD being too married to the CLI to be allowed to hide it.
      The only language with an uptick in popularity is Assembly. All languages are otherwise in large downticks. Scripting languages like Python, Perl, PHP, Javascript (eg node.js or nw.js) and other "non-native runtime married" languages will never be the language of choice because all languages are C-binded. You want to use a library, you have to use C bindings. There is no standard way to use a library written in any other language, including C++, because the symbols may change from version to version. Because things like Python, Ruby, PHP and Perl change rapidly, there is no way to write something in one of these languages and have it work as the runtime changes. In the case of PHP and Perl, often language runtime changes actually break things, and developers who have long since retired from that project are not able to come back and help fix things.

      This is why you will never see anyone advocate, endorse, or even commit to replacing C anywhere. C is everywhere, C works everywhere, and a lot of problems with C can be solved by making the compiler turn warnings into errors, and have the programmer, line-by-line fix their bad code or mark it with #pragma _badcode to tell the compiler to blame warnings as errors in this file first before considering warnings in other files as errors.

    38. 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.
    39. 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.

    40. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      That is exactly what they did with UNIX... replaced existing code with the C language... seems to have worked so far... most of us old people have an affinity for C... but we also have an affinity for 65 mustangs.... at some point... you have to upgrade.

    41. 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.
    42. 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?"

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

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

    44. 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.
    45. 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.

    46. 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.

    47. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      What needs to happen is that someone needs to reimplement Rust with C syntax. 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.

    48. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      It all comes down to cost vs benefit. Is there objective evidence that re-factoring code into Rust reduces the risk of security breaches later. Insurance companies are of course, in the business of estimating the livelihood of future losses. I'm curious if Loyd's offers security breach insurance. And would they offer a better rate for a Rust system that C/C++?

    49. 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).

    50. 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
    51. 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.
    52. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      COBOL is pretty much _all_ pointers, that's what you're passing when you do a subroutine call (a PERFORM) using a list of one or more field names - you're internally passing a list of pointers to structures.

      It may not have dynamic memory allocation, but how do you know? When was the last time you read the generated machine code? It can be a real eye-opener sometimes, finding out what the compiler actually generates.

      Since COBOL is a business-oriented language, almost nobody ever uses floats in the first place. In 49 years (46 of them using COBOL off and on, and more than 35 using C) I only saw one COBOL program use a float, and that was a programmer's experiment to see what it did - the program only ran once a year, and the second year it bombed because there had been a major power outage in the meantime that crashed the computer hard, and the Customer Engineers never checked the float circuitry because they knew nobody ever used it...naturally, that circuit had been damaged in the power outage.

      Decfined fields are fixed length, but you can certainly handle random-length strings in them. One of the business programs I wrote for the Army way back when (mid-1980's, an interservice supply cataloging system standardized at the DoD level) had sets of input cards containing a random number of random-length fields on a random number of cards. DoD changed the data specification for that set after the other service branches all formally complained that it couldn't be done - about six months after I had written and tested it for the Army.

    53. 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.
    54. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      A lot less than with C. Many of the language features in Rust provide some security built in. I don't know Rust extensively but I know enough to know C really is a swiss cheese when it comes to security.

    55. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      > I don't need any overhead of... bounds checking, etc. either.

      But the *users* of your software do.

    56. 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.
    57. 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.

    58. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      authoritarianism and draconian penalties never work.

      Translation: authoritarianism and draconian penalties are just dandy when my team does it.

    59. 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.

    60. 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.

    61. 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.

    62. 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...

    63. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      I suppose that the problem is that Lennart is kind of rusty in that new language.

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

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

    65. 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.

    66. 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.

    67. 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.
    68. 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.
    69. 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
    70. 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
    71. 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
    72. 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
    73. 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
    74. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      If its littered with vulnerability, then techinically it is not "working" but horribly broken.

    75. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      So little effort and intent exists towards figuring out the best way to do it that unless approaches are tried, for real, we'll never figure out the best way to do it. We need to figure out how to do it.

    76. 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.

    77. 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
    78. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      Mainstream programming is bad because of bad programmers. Even if you get rid of the all of the bugs, many of their designs are fundamentally flawed. In my experience, a substantial portion of their "bugs" are actually features, working as designed. Using a different language will not help with these issues. Personally, my untested code has roughly 1/10th as many bugs per lines of code and roughly 1/2 to 1/3 the code compared to my peers who have proper QA. This is why I'm in a special elite group of single person "teams" that need to quickly fix issues in productions without time to QA or projects that have massive SLA requirements, short timelines, and $10k+/day penalties for issues.

      We don't have room for error and no time for QA. I have never delivered a late project. I've always projected the time requirement being 1/2 to 1/4 the other normal teams, and almost always finished in 1/2 the time I projected. Other teams always take 2-3x longer than their projected times and under deliver a bug riddled pile of crap that only just barely passes the technical requirements. I also over deliver on features and handle feature creep. I can't directly speak for others that are part of my group because we never really work together, but they seem to do the same. I don't even work that hard. I'm very slow and lazy, I get distracted very easily, and I make lots of little mistakes. I've always wondered what other programmers are doing that they're so bad at programming. I feel I'm horrible at it and I'm constantly trying to improve myself, but it's difficult to work past my issues. But in the end, I seem leaps and bounds better than most others. I'm so confused about why programming is difficult for most.

    79. 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.

    80. 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.
    81. 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.
    82. 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.
    83. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      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 don't know the absolute best way of doing it but we know several very good ways, for example the way avionics software is regulated whereby safety critical code has to be certified by an independent authority in accordance with DO-178C.

      https://en.wikipedia.org/wiki/DO-178C

      This process of testing and certifying software certainly seems to work - there has yet to be a civilian airliner crash solely due to a software bug (although there are some conspiracy theories surrounding Air France Flight 296).

      There are similar more generic standards, such as IEC 61508.

      The only problem with it is that it is expensive.

    84. 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.

    85. 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.
    86. Re:Yes, go ahead! by shubus · · Score: 1

      Finally! Someone who gets it!

    87. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      I love C, I love to recast the output of functions, recast pointers to voids and void pointers to structures or to have them point to programs.
      I do that to befuddle the guy who loves Rust.

    88. 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
    89. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      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?

      Yes. If you thought pure C/C++ was bad just wait until you combine C/C++ with $MEME_LANGUAGE. You could convince me to start a new project using $MEME_LANGUAGE, or maybe using $MEME_LANGUAGE in project 2.0, but "formal verification" is probably the stupidest justification for the extra complexity and maintenance of combining multiple languages for a project.

    90. 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.
    91. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      So, basically, you have posted some meaningless drivel that relates to some toy project.

      Thanks.

    92. 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.

    93. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      Good point. Better is better, can't argue against that. A lack of experience or knowledge is NEVER an excuse in programming. Abstract reasoning is the ability to solve problems in lieu of knowledge or experience. Abstract reasoning is the cornerstone of programming. If you're not good at it, it's best you stop.

      And don't think abstract reasoning can be taught. Not only are their no know effective ways of teaching abstract reasoning, abstract reasoning goes down quickly over time after peaking in the late teen years, inversely related to knowledge for most people. I say most people because this is not true for those who are metacognitive. Their abstract reasoning increase over time, but they're fringe outliers. Abstract reasoning can be self taught by those who are metacognative.

      An example where the bell curve breaks down. About 1% of people are near-exclusive spatial-visual thinkers, not to be confused with spatial-visual learners. While these people represent about 1% of the general population, they represent about 30%-40% of those with IQs over 140. While 65% of the general population can use spatial-visual thinking, it is not natural to them and they only use it when forced to. Spatial-visual thinkers who use it 24/7 for everything are constantly exercising their the spatial portion of their brain. To make things worse(better), spatial processing is a right brain thing, but logic is a left brain. Spatial-visual thinkers are forced to use both hemispheres in a cooperative fashion. Strong abstract reasoning is highly correlated with whole-brain usage, very large short duration large bursts of neural actively across most regions of the brain. People with weak abstract reasoning tend to use one region of the brain at a time with much weaker inter-regional communication.

      There is nothing really special about spatial-visual, but it is generally described as a "personality trait", which many scientists hate the term but it does accurately reflect the issue, and is largely hereditary where a child with spatial-visual thinking almost always has a parent or grand-parent who has it.

      It's not all rainbows and butterflies. Spatial-visual thinkers have their own custom ways of learning that are never the same, are horrible at rote memorization, and have many other traits that are similar to ADD or other learning disabilities. They typically do very poorly in school.

      This is probably a good portion of why there's a power curve in talent distribution.

    94. 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 ?
    95. 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
    96. 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.

    97. 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 ?
    98. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      Sure, there is nothing users love more than overhead...

    99. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      I am so sick of this argument. Not far from home a bridge collapsed a few years after being built. 5 or 6 ppl died . No engineers went to jail.

      What you talking about foo' ?

    100. 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.

    101. 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.

    102. 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.
    103. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      Yeah, same here.

      I downloaded an open-source project from GitHub that was written in "straight ANSI C" but it wouldn't compile with all the warnings on.

      If you cut corners on your code correctness, you can expect trouble down the road.

    104. 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.
    105. 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?

    106. 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.
    107. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      Rust's type system is in the process of being formally verified:

      https://internals.rust-lang.org/t/rustbelt-securing-the-foundations-of-the-rust-programming-language/5509

    108. 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
    109. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      If you're going to refactor it, just fix the damn bugs instead of introducing new ones with a rewrite in another language.

    110. Re: Yes, go ahead! by Anonymous Coward · · Score: 0

      Where was this bridge and why did it collapse?
      How old was the bridge?
      How was it maintained?
      We're there original construction flaws?
      We're there original design issues?
      These questions, and others, need to be answered before blaming the engineer of record.

      Forensic structural engineer AC here.

    111. Re:Yes, go ahead! by Anonymous Coward · · Score: 0

      Realtek chips support Rust so you could move you development to a cheaper, more capable platform and get Rust as an bonus :)

  2. "Death To C" by Anonymous Coward · · Score: 0

    Yeah.... That's a source i'm gonna listen to...

  3. 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 Anonymous Coward · · Score: 0

      Some developers get really fanatical (irrational) about their favorite language.

      I like C, with a little C++ on the side. Objects where they fit, but not where they don't. I do that stuff in my hobby code only these days...I am paid to write C# and it gets the job done well enough.

      That's all.

    14. 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.

    15. 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."
    16. 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.

    17. Re:Ada by Anonymous Coward · · Score: 0

      This works for many things, but not systems software. Systems software underneath the model-based code will be hand-coded for a long time.

    18. 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?
    19. 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!

    20. 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?
    21. 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.

    22. Re:Ada by gweihir · · Score: 0

      Bullshit from a proponent of yet another failed language, that was advertised with grande claims it could not deliver on. Kind of like Rust.

      I will not even go into the details of how wrong the statements made are, there obviously is no point educating somebody that has gotten it this massively wrong.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    23. 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)
    24. 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.

    25. 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.)

    26. Re:Ada by Anonymous Coward · · Score: 0

      Why are you such an asshole?

    27. 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.

    28. 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.

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

      Unique? Hardly.

    30. Re:Ada by Anonymous Coward · · Score: 0

      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.

      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.

      I posted the original comment. Both great points. I agree that silicon vendors in my industry seem to be using security as an excuse to push people to more expensive hardware. However, for autonomous vehicles, hardware costs are not as important (and may never be if "transportation services" really take off the way its predicted). The conventional logic in gas-powered, manually-driven, gas autos is that per-part cost is king. As software complexity grows, it begins to make more sense to spend trade-off slightly more expensive hardware for cheaper development and maintenance. Security changes that equation even more as security incidences can be VERY costly. I have a hard time believing that Ada code (if the quality is unchanged) is 30x slower than C. If that's actually true, then maybe the hatred for Ada is well placed. But, I remain skeptical.

    31. 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.

    32. 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.

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

      You are what you eat?

    34. 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.
    35. 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.

    36. 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."
    37. Re:Ada by Anonymous Coward · · Score: 0

      there obviously is no point educating somebody that has gotten it this massively wrong.

      Yeah; well, but the rest of us would be interested to hear more than just the criticism.

    38. 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."
    39. 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.

    40. 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."
    41. 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...

    42. 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."
    43. 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) !!

    44. 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)
    45. 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."
    46. 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.)

    47. 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.

    48. Re: Ada by Anonymous Coward · · Score: 0

      Which is even worse (performance wise) since you now have a range check on every assignment to a index_t type variable.

    49. Re:Ada by Anonymous Coward · · Score: 0

      Yes, the GP meant Ada. Or more specifically, SPARK.

    50. Re:Ada by Anonymous Coward · · Score: 0

      Actually, Ada does have all those features you list.

      Control of aliasing? There's a keyword for that.
      Immutable references? You can find examples in the standard container library.
      Data race freedom? Protected types.
      No possibility of dangling pointers? Access level restrictions.

      The feature you probably wanted to list is preventing memory leaks, but with access pools, controlled types, and the ease of using the stack even that isn't an issue. Perhaps you should learn about the language before you dismiss it in favour of the latest half-baked fad. The Ada Reference Manual, Sections 6.1.1 and 13.8, along with Annexes D, E, H, may be of particular interest to you.

    51. Re:Ada by Anonymous Coward · · Score: 0

      Typical slowdown is 20-50%, well within acceptable levels for 99% of applications, as compared to the same code with all checking turned off.

      Yes, you can turn it all off if it doesn't make sense for the program you're writing. An exception won't save you if you're relying on software to keep your plane from not crashing into the ground. It is, however, encouraged that you formally prove your code correct in such instances. Which is what SPARK was invented for.

    52. 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.

    53. Re:Ada by Anonymous Coward · · Score: 0

      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.

      Hello fellow automotive software engineer! I too came to see what sorts of responses there would be. Even though Rust has fairly low overhead (i.e. no GC) it's reference counting and other compiler generated doodads are often not suitable for tight embedded systems or time critical code.

      Anyone who has done serious embedded work knows that even C++ adds too much compiler magic to get the job done.

      I think it's also funny that I too actually like Ada for some tasks and wouldn't mind it over Rust. But saying "no" to portable assembler is just nuts. It seems like there is this assumption that any C code is a security risk. Sorry IT types: That's not the case and the amount of microcontroller firmware out there that doesn't talk to other stuff and just does its job is staggering. Replacing it with Rust makes no sense.

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

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

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

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

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

    56. 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
    57. Re:Ada by Anonymous Coward · · Score: 0

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

      Not in many circumstances, because the compiler is allowed to remove the checking if it can prove that it is not required. If you learn to program in Ada, most of the time Ada *can* prove that the checks are not required.

      If you declare an array using a type as the index, any valid item in that type can be used to index the array. If you also declare a variable as that type, Ada will check values that go into that variable as it is assigned, and will not need to recheck it when it is used to index an array.

      Here's an example. Keywords are capitalized to help those unfamiliar with Ada (the language is not case sensitive.)

      PROCEDURE my_program IS
      TYPE range_type IS NEW INTEGER RANGE 3..7;
      my_array : ARRAY(range_type) OF CHARACTER;
      my_index : range_type := 4;
      BEGIN
          my_array(my_index) := 'W';
          my_array(3..6) := my_array(4..7); -- Shuffle entire array down.
          my_index := 22; -- This won't compile.
          my_array(my_index) := 'H';

            -- Loop through array indices (no check needed.)
            FOR index IN my_array'range LOOP
                  my_array(index) := 'Q';
            END LOOP;
      END my_program;

      Ada will not allow invalid *values* for variables if you tell it what values you want it to allow. If it can check at compile time, it will (and will refuse to compile invalid code.) This often catches off-by-one issues. If the variable is assigned a dynamic value, Ada will add the check wherever it is assigned.

      If I wanted to use an Integer to index the above array, I can do it, but I would need to typecast it to range_type and Ada would do the check then. In reality, Ada only performs the check when a programmer *should* have done it in any other language.

      You can have pointers, but you have to add the keyword ALIASED when you declare the variable. In that case, Ada will always add the range check before using it (as it should.)

      For a good beginner's reference, I recommend:
      http://www.pegasoft.ca/resourc...

      Start on chapter 10 (all the preceding chapters are about getting started on Linux). It has helpful extra information for C programmers.

    58. Re:Ada by Anonymous Coward · · Score: 0

      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 agree, when I saw Pascal for the first time I thought, this is what we should be doing! Instead of == and = you use = and :=, changing assignment to something other than = allows you to use the = to mean the same thing it does in math, which is a good thing.

    59. 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
    60. Re:Ada by Anonymous Coward · · Score: 0

      > once tried to add horizontal pixel location to vertical pixel location

      A type system can't help you on the semantic layer without becoming itself a massive overpspecified drag and source of errors. If I can't check hv without some kind of type error how would I calculate if a box is wider than taller? Am I supposed to coerce the operands into a MultidimensionalPixelMeasurement type before comparing?

      That sounds clean and elegant.

  4. PE Binaries by Anonymous Coward · · Score: 0

    Can I compile Windows PE binaries properly yet? Serious question, last I checked it seemed very immature.

  5. 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)
  6. That's a bit rusty... by __aaclcg7560 · · Score: 1

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

    1. Re: That's a bit rusty... by Anonymous Coward · · Score: 0

      (puts up shield to protect creimer from trolls)

    2. Re: That's a bit rusty... by Anonymous Coward · · Score: 0

      Creimer is the troll.

    3. Re:That's a bit rusty... by Anonymous Coward · · Score: 0

      No, you probably can't.

    4. Re: That's a bit rusty... by Anonymous Coward · · Score: 0

      creimer is a 350 pound powerlifter who eats 1500 calories a day. He can protect himself, why do you think he needs protecting, by you?

  7. 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

  8. Re: Betteridge's Law bullshit by Anonymous Coward · · Score: 0

    Ad hominem attacks because you can't actually address the issue; thanks for actually confirming the statement.

  9. more cake by Anonymous Coward · · Score: 0

    i guess all the "hard" programming problem have been solved. all the important algos have been invented/discovered.
    so it amounts to: the less people learn "C" the more the salary of remaining "C" programmers goes up, non?

  10. 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 Anonymous Coward · · Score: 0

      As they used to say... "If you can't do... teach."

    4. 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.
    5. Re:An embarrassing admission by BarbaraHudson · · Score: 0

      Wrong. I wrote a multithreaded server that had zero memory leaks, never had to restart a thread to reclaim memory, and could run for years with no faults and no slowly chewing up extra ram. It took 2 years to get it perfect. Most places wouldn't give you 2 years to do that. They want "good enough".

      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.

      --
      "Transparent" is a shit show that trades on every stereotype going. A man in drag is NOT a transsexual.
    6. 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.

    7. 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.
    8. 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.
    9. 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.
    10. 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.

    11. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      Stop saying shitty. You ain't one of them shitty guys. Never will. And that's a good thing.

    12. 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.

    13. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      Oh you will but they just program badly in c instead.

    14. Re: An embarrassing admission by Anonymous Coward · · Score: 0

      Care to elaborate? Or were you just mouth-farting again?

    15. 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.
    16. 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.

    17. Re:An embarrassing admission by Anonymous Coward · · Score: 0

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

      I would conclude that C is a language for programmers who know WTF they are doing... which is, of course, what Thompson and Ritchie said from the very beginning.

      Some of C is tricky, inconsistent, counterintuitive. Hand-holding was deliberately rejected to avoid complexity and increase efficiency. And it worked, until people tried to make things "easier."

    18. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      I disagree STRONGLY... the average programmer is not 'fairly shitty'... they are MASSIVELY SHITTY.

    19. 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.

    20. 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.

    21. 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.

    22. 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.
    23. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      Saying that the source code said something doesn't mean it's the only place that information was presented.

      Good luck finding maintenance people who thoroughly read associated documentation with software. Most of them are the "I just need to find the right spot to tweak it" crowd. Most of the documentation for my projects isn't in the code, it's in specification and assumption documents, there's absolutely no reason it has to all be in one place, but even if I managed to put all that information in comment blocks around all the different methods and properties it would still be glossed over by the crowd we currently seem to be attracting.

      Nobody seems to care about understanding the process anymore, they do just the bare minimum to get by, and the quality suffers amazingly for that.

    24. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      No, it's an admission that THE WHOLE FREAKING INDUSTRY is extremely shitty about it! Just look at big ass development corps like MS. They hire very good people. They have very good auditing. They use very good tools. They throw A LOT OF MONEY into security. And still they don't manage to write C code without vulnerabilities. How much more proof do you need that the problem is inherent?

      More proof: look at all the vulnerabilities in security products. Written by security experts (ok those are self-declared experts).

    25. 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.
    26. 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.
    27. 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.
    28. 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.
    29. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      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.

      What do smart pointers have to do with C..?

    30. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      If they write insecure code, then they aren't experts are they?

    31. 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
    32. 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
    33. 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.
    34. 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.
    35. 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.
    36. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      Only if you live in some fantasy world where other languages are somehow immune to the same kind of serious security defects. A shitty programmer will write lots of bugs; an excellent one write one occasionally. Nobody is perfect.

    37. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      ...and introduces even more. The complexity of C++ creates several new ways to create errors and actually using more than a token amount of C++ additions makes code significantly harder to maintain.

    38. 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
    39. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      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."

    40. 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.
    41. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      > 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?

    42. 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.
    43. Re:An embarrassing admission by Anonymous Coward · · Score: 0

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

      I don't think the programmers are incompetent or lazy. What usually happens is feature creep, deadline pressure and inadequate QA let bugs slip through that a "highly competent" C programmer would otherwise catch.

      Is that the fault of the language? Not really. There certainly are a number of pitfalls in the language, but they are well known and documented, and a highly competent programmer should be aware of them.

      In short, I don't believe the language or skill level of the programmers are the main reasons for all the security holes.

    44. 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.
    45. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      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.

      If you are aware of these issues and know how to check for and fix them, your code will be 99% secure. The remaining issues are usually the result of bad design or holes in libraries that you have no control over, and neither of those are the fault of the language.

    46. 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.
    47. Re:An embarrassing admission by Anonymous Coward · · Score: 0

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

    48. 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.
    49. Re:An embarrassing admission by Anonymous Coward · · Score: 0

      Sorry, I'm not calling you a liar, but I'll take your opinion with a large grain of salt.

      If they can't secure against ALL the most common vulnerabilities, then they have no business calling themselves experts. In fact, they should probably switch to another profession.

    50. 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.
  11. 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.

  12. 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 Anonymous Coward · · Score: 0

      I remember hearing a lot about replacing C++ with JAVA because safety.
      Safety comes with a good design, which seems most developers don't like to do, if you don't have a safe design you have to add safety bits here and there and that's bad at long-term.

      Apart from the magic "safety" what other beneffits come from Rust? I know there must be something else besides cargo.

    7. 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."
    8. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

      Concur!

      More typical /. 'article shit-posting'...

      At most RUST is niche... I'm sure it's great if you have time, and you're resting on laurels in a dev shop...

      Nothing is wrong with C, beyond a good number of supposed 'programmers' being produced today, can't understand applying it.
      I.e., they are at best, web dev's, and not software dev's, programmers...

      I digress...

    9. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

      The problem is, thanks to the way ubiquitous modern frameworks (like Spring) generally work, we've practically turned Java into a de-facto interpreted language. And despite all the cruft that's been added since Java 6, we STILL don't have primitive unsigned bytes, so anything (like programmatically-populated OpenGL structures) that depends upon them STILL gets plagued by bugs caused by forgetting to repeatedly cast & logically-AND everything.

    10. 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.
    11. 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
    12. 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.
    13. 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.

    14. 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."
    15. 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)
    16. 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.

    17. 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.

    18. 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.
    19. 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."
    20. 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?

    21. 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."
    22. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

      I have been in software dev for 40 years and interviewed hundreds looking for them... I can count the 'competent C developers' I have run across on one hand...

      I don't use RUST, but I think it (or something like it) is long over due... a language that you have to over-ride some sort of safe mode to do the bit twiddling...

      We all think we are experts at bitwise operations till our dicks get caught in the pencil sharpener.

    23. 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.

    24. 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++.

    25. 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.

    26. 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
    27. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

      Strongly disagree. The reality is that there are so many gaping holes in C++, starting with with the Static Initialization Order Fiasco, the huge amount of manufactured complexity, the long list of boost bugs and the wonderful way C++ allows minor syntax changes to cause massive changes in code semantics (references anyone?), that it's a tossup whether C++ is an improvement over C for any but the most data structure intensive problem.

      Personally, I still use C for most simple problems that benefit from speed. Not because I like it particularly but because the available alternatives in common use, including C++, simply aren't very good. I like Hoare's dictum:

      There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. It demands the same skill, devotion, insight, and even inspiration as the discovery of the simple physical laws which underlie the complex phenomena of nature.

      C++ fails badly by that measure.

    28. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

      I've found Python to be the answer when you want to get an algorithm written down and run quickly. No need to worry about types that slightly mis-match, etc.

    29. 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
    30. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

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

      That's not the first part of my brain I'd want to fall victim to atrophy. The grand, species-wide race towards the lowest common denominator that humans are engaging in nowadays will probably end in a spectacular pileup.

    31. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

      The problem with infallible C programmers is that they do not exist.

      Nah, they exist, but I already have a job.

    32. 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
    33. Re:Bullshit slashvertisement by Anonymous Coward · · Score: 0

      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.

      And I say we give the people who support this idea the opportunity to demonstrate that their solution will solve the problem. We're waiting.

    34. 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.
    35. 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.

  13. Here we go again by Anonymous Coward · · Score: 0

    This seems to come up over and over.

    I like to paraphrase Wiston Churchill. "C is a terrible language to program in, until you look at the other languages available"

    Yes there are cases where specific languages have strengths and weaknesses. But instead of bashing a specific language and promoting another as a "complete replacement" lets look at why each language is used in a given niche and see if there is a better choice for that niche.

    1. 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.
    2. 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
    3. 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.
    4. Re:Here we go again by Anonymous Coward · · Score: 0

      You are one of the bad coders you fucking imbecile.

  14. 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 Anonymous Coward · · Score: 0

      C is still good for small, resource-constrained embedded systems, like for smaller microcontrollers.

      But otherwise, I agree. I love C++ because I can avoid manual memory management by using RAII and containers. I can almost always avoid pointers as well. Great stuff. I would love to get into Rust, but it doesn't seem to have very wide library support.

    2. 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
    3. 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
    4. 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.
    5. 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
    6. Re:well, he's not wrong by Anonymous Coward · · Score: 0

      Yes and No, its still the go-to for embedded systems, and its still the place for library writers, as 99% of other languages "interface" to the C libraries. Its still the #1 for portability and interfacing.

  15. 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)
  16. 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 BCooley · · Score: 0

      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.

      So great, you do all of that but your expert C coder still accidentally introduces an off by one error in a complex algorithm that he just didn't catch. It passes peer review, and all of your tests.

      So much for all of your training, security policy, proper requirements and testing. You did everything right, but your software is still insecure.

    2. Re:Fix the code dont try a new language by Anonymous Coward · · Score: 0

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

    3. Re:Fix the code dont try a new language by Anonymous Coward · · Score: 0

      Do any of those things cost money?

    4. Re:Fix the code dont try a new language by Anonymous Coward · · Score: 0

      Why dont you mosey on back to the stupid feminist cunts that dictate your conduct you spineless pink bitch

    5. 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
    6. 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
    7. 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
    8. 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!

  17. We switched embedded C to C++ by Anonymous Coward · · Score: 0

    just by changing the file names and making a couple of basic changes. You can't play fast and loose with function arguments with C++, which is a good thing. This was a port of quite a bit of code, nothing that worked and compiled was changed. Pretty painless really, and we're ready to use all the nice C++ stuff (although most of our code is OO already, most functions get a context pointer as the first argument). New stuff will be able to use the nice stl:: templates.

  18. Rename it. by Anonymous Coward · · Score: 0

    "Rust" isn't a name that inspires confidence. Nor is "Corrosion," "Decay," or "Flatulence."

    1. Re:Rename it. by flatulus · · Score: 0

      "Rust" isn't a name that inspires confidence. Nor is "Corrosion," "Decay," or "Flatulence."

      Hey - I resent your use of that last word!

    2. Re:Rename it. by Anonymous Coward · · Score: 0

      You meant to say you "represent" that last word. Get it right, my n word.

  19. 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 Anonymous Coward · · Score: 0

      As someone who did a fair amount of game programming on 80s and 90s hardware, I don't get your objection. I am a C programmer, but I don't really have a problem with what's being proposed.

      A lot of games in the 80s, especially on systems like the Commodore 64, were written in assembly. Interpreted languages simply didn't have the speed. Compilers generally weren't used, and have gotten a lot better at optimization since then. A lot of things could be done more efficiently by doing it yourself in assembly.

      Even writing games for PCs to run in DOS, a lot of code was written in C, which has definite benefits over writing your entire program in assembly, that wasn't the end of assembly. Sometimes, it was better to manually optimize something by writing it yourself in assembly. That was particularly true for directly interacting with graphics hardware, which needed to be fast to achieve reasonable performance for games. However, that wasn't an excuse to avoid writing new code in C and keeping limited sections in assembly. Even if Rust compilers aren't mature, that's not necessarily a good reason to avoid them. As I pointed out, C compilers have greatly improved in the past two decades and generate much better code than the old Borland C compilers I used in the 90s.

      Writing some code in other languages doesn't mean that some things won't still be done in C. However, just because some things can be done better in C shouldn't prevent the adoption of newer languages for some tasks. Just because C or even assembly is the best tool for some tasks, that doesn't mean it ought to be used for everything else. If there's a better tool for some jobs, you should use it for those jobs. It's difficult to secure code written in C, so if there's a better tool for some tasks, why not use it for those tasks?

      I don't know if Rust is the right tool for that job, so I'm not specifically advocating for that language. But you shouldn't dismiss the recommendation out of hand.

    2. 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.
    3. 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."
  20. 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.
  21. 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 Anonymous Coward · · Score: 0

      > " I don't think that this is neither possible nor logical."

      You think this is possible and logical?

    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. 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.

    7. 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.
    8. Re:Recent experience with C by Tranzistors · · Score: 1

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

    9. 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.
    10. 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.
    11. 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
    12. 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.
    13. 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
    14. 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.
    15. 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
    16. 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.
    17. 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
  22. 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: 0

      What politics are those?

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

      emacs vs vim, obiously.

    5. 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.

    6. 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.

    7. 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".

    8. 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.

    9. Re:The Rust community worries me. by Anonymous Coward · · Score: 0

      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.

      If you want people to believe you, you will need to provide links to specific instances of the "attacks" that you are describing.

    10. 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.

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

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

    12. Re:The Rust community worries me. by Anonymous Coward · · Score: 0

      How long have you been using FOSS?

      You sound, new.

    13. Re: The Rust community worries me. by Anonymous Coward · · Score: 0

      I have four cats. I gave a talk to them last week about Rust.

      "These Rust guys (LGBTIQEUR inclusive) are going too far, what shall we do about them?"

      Was the name of the talk.

      It was very well received by the delegates. One of whom made a salient point that groups who make up a name for themselves called Rustaceans are a bit like me when I was in a secret club at school when I was 7 and we all cut our fingers and became blood brothers.

      I had to reflect on this for a moment.

      The others heartily agreed and mowed that they just wish they would spend less time jerking off and more time working with the C++ language committee to add safety features in a language people actually use.

      I will be giving another talk to rabbits next year, because I am Dr. Doolittle.

    14. Re: The Rust community worries me. by Anonymous Coward · · Score: 0

      Surprisingly, some people get upset by forced fellatio.

      Who would have known looking at Pornhub?

      Sorry gotta dash and get back to writing everything in OCaml.

    15. Re:The Rust community worries me. by Anonymous Coward · · Score: 0

      Found the trans black woman!

    16. 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
    17. 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.
    18. 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
    19. Re: The Rust community worries me. by Anonymous Coward · · Score: 0

      Rape is illegal, so you could try prosecuting actual crimes. Rather than trying to redefine hypothetical situations as a new type of crime.

    20. 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
    21. Re:The Rust community worries me. by Anonymous Coward · · Score: 0

      Rust is the Apple/Tesla of programming languages...

    22. Re: The Rust community worries me. by Anonymous Coward · · Score: 0

      I'm not the guy you're responding to but if there is a concerted censoring of certain viewpoints wouldn't it be fairly hard to link to them ?

  23. A job for AI by Anonymous Coward · · Score: 0

    Couldn't the job of proving a C program is "safe" be a job for an AI? If the AI can't figure something out, it could flag it for review. I guess what I'm saying is we don't need another language, we need verification tools.

    1. 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.
  24. 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
  25. Re:Betteridge's Law bullshit by wonkey_monkey · · Score: 0

    Wrong story, numb nuts.

    --
    systemd is Roko's Basilisk.
  26. at least its not python by Anonymous Coward · · Score: 0

    thank fuck at least it's not python!.

    1. 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.
  27. Re: Betteridge's Law bullshit by Anonymous Coward · · Score: 0

    Go eat a dick.

  28. Any tool can be dangerous if not used properly by Anonymous Coward · · Score: 0

    Go to any construction site and you will be surrounded by tools that can quickly kill if not used properly or mishandled. Somehow buildings still get built and the mortality rate is shockingly low (given what they're doing and what they're working with). This is possible because they don't let you play with the dangerous tools until you've proven you know how to use them and if you f*ck around and do something stupid that endangers yourself or others you're going to get kicked off the job site (and your ass beat depending on where you are).

    As with anything since we first figure out that flint is sharp and that is useful, you pick the right tool for the job. Sometimes that's C, it isn't always and quite often Rust, Java, .NET, etc. is a much better choice for a variety of reasons. But you don't stop using nail guns because dumbasses can't be trusted with them... you hand it to someone competent who knows how to use it and let them do their jobs.

    1. Re:Any tool can be dangerous if not used properly by Anonymous Coward · · Score: 0

      you've never spent any time on a construction site. pneumatic nailers to the heart or brain takes an extremely deliberate physical action. Hammer drills? maybe if you dropped on on someones head? welders might have a good chance... Lifts and cranes have a good shot, but seriously, your sense of potential immanent death is overblown. Deaths do happen, but im going to guess far less construction worker deaths occur than deaths of poorly coded projects

  29. 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
  30. 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 Anonymous Coward · · Score: 0

      C and C++ are supported by many toolchains, both open source and proprietary. Rust is not.

      I agree, when I go to buy bread at the supermarket, they take cash or credit card but not bitcoin, therefore cash is the best payment system

    4. Re:What happens to Rust when Mozilla is gone? by Anonymous Coward · · Score: 0

      There have been reports saying that the upcoming FF 57 will likely only support WebExtensions add-ons.

      Once released, it could mean that a lot of FF users would find their old extensions no longer work.

      I suspect that this will be the final nail in FF's coffin.

      Recent stats put FF at about 5% of the market.

      After FF 57, I wouldn't be surprised if it lost 2% to 3%.

      That will put it well within the irrelevant territory.

      The whole Rust-in-FF situation may become moot.

      FF may become completely irrelevant before it really starts using Rust code.

    5. 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.

    6. Re:What happens to Rust when Mozilla is gone? by Anonymous Coward · · Score: 0

      "I suspect it's due to its single threaded nature and I'm dealing with several IMAP accounts with a LOT of emails."

      The answer to your problem is in that statement: IMAP. Use SMTP and POP3 instead. Problem solved. My personal Thunderbird install handles receipt and management of 800+ e-mails per day across 15 different e-mail accounts without any issues on an i7. I have to restart Firefox every other day as it likes to inexplicably chug more and more RAM. Thunderbird runs for months without requiring a restart. IMAP support in Thunderbird is half-baked, so I wouldn't be surprised if it is broken. SMTP and POP3 are simpler protocols that just work (albeit slightly slower than IMAP).

    7. Re:What happens to Rust when Mozilla is gone? by Anonymous Coward · · Score: 0

      Well, it is a better payment system than Bitcoin in the sense that you can buy bread with it in that supermarket, and not with Bitcoin. That could be a major benefit if you need bread.

  31. So... by Anonymous Coward · · Score: 0

    One of the best, most popular, and most powerful languages of all times sucks, so let's replace it with a shitty language no one uses and everyone hates! What a great idea.

  32. Choice the Language by jgotts · · Score: 0

    Your choice of language should be context dependent.

    C is used in some situations that spring readily to mind where Rust would not be appropriate:

    1) Codebases that are elderly, dating back to the 1990's or earlier. Back then we used C for most things. Compiled languages were required for most types of programming, because interpreted languages were too slow for most things. [I know that Rust is compiled, but it also didn't exist until 2010. To me, something was either written in C, rarely in C++, or scripted.] You don't want to monkey with old codebases. If they're written in C, keep them in C.

    2) Low-level programming. The kernel is written in C, and it should stay in C.

    3) The command line. Shells and utilities are written in C and they should stay in C. There are so many utilities that you can use to lint these programs (from memory checkers to fuzz tools to any of the many versions of lint to output from both of the major compilers) that there really is no point in using anything else.

    Rust and other, newer languages, including and especially interpreted languages should be used for new programming. Maybe if you have some things that are 10 years old or less then maybe you can convert them bit-by-bit to Rust or something else but it would be hard for me to justify this, either. I just don't see rewriting existing code piece by piece in another language to be a good use of programming time.

    Oh, and by the way: Rust is ugly. No matter how safe or nice your language is in terms of security, the closer your language reads to English or another Western language the more successful it will be. All programmers (Western programmers anyway) have spent their lives since age 4 or 5 learning to read English or their native language. It's no surprise that the closer a programming language is to written language syntax, the more popular it is. I've been writing about this for a long time. C works, PHP works, and other languages work because they're extensions of the language of math, which is written in Latin. English is written in the Latin way, with Latin letters and similar syntax. Syntax, not just features, is important! Why do people both love and complain about Perl? Because people love Perl when it's written like English (French, German, Dutch, ...) and hate it when it's written cryptically, unlike English (French, German, Dutch...)

    1. 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
    2. 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.
    3. Re:Choice the Language by Anonymous Coward · · Score: 0

      Any failure will be punished by a lifetime PHP project.

      That's not legal. The Constitution forbids cruel and unusual punishment.

  33. We already did that by Anonymous Coward · · Score: 0

    Go. /done

  34. Re:Or Ada. Or Erlang... by Anonymous Coward · · Score: 0

    = = = 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

    Well, Erlang, is not a general purpose programming language (built for signaling software in the telecoms); PL/I pre-dates C; and Ada does pretty well in embedded systems and flight control systems. All of these languages have taken root.

    You are probably reacting to the straw man concept of "Correct Compiler for the Unbreakable Language", which are two different concepts. Partially correct compilers are proven to adhere to their language specifications on their target platform. And unbreakable languages are a straw man concept meant to discourage progress in the programming language design. However, there are those of us who want something better than C/C++, and we use better languages for our jobs, and thus, we get most of our life back from the endless develop/debug/maintenance cycle that dominates the life of C/C++ developer when they dare to do as simple as design their own data structures.

    Rust as a programming language is not stable; does not have a specification; and it does not . That is the primary reason to not use it. There are much better languages than Rust.

    Use modern PLs and get rid of bad developers. If you do these two things, you will out perform shops that only hire "competent C developers".

  35. 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.

  36. 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.
  37. 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 Anonymous Coward · · Score: 0

      > I'm not saying that I use it a lot, but [GOTO] is useful for handling errors & similar.

      When you use RAII and have destructors that release those resources on "object" destruction (or when the "object" is marked for deletion in a GC language), then exceptions are the far superior way to handle serious error conditions.

      As an added bonus, when you use RAII + destructors, you'll never forget to call your cleanup code.

      GOTO has its uses, but there are _far_ superior methods to achieve the same result, and have been for ages.

      (Note that Java's "checked exceptions" are a crime against both Nature and Man. A programmer should be free to only handle exception types that he wishes to handle, and should not be required to be aware of _any_ other types!)

    3. 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.

    4. 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...

  38. 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.

    1. Re:C is not the problem. by Anonymous Coward · · Score: 0

      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.

      It would be interesting, but isn't going to happen in a society that thrives on making believe.

  39. 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.
    2. Re:What about Go? by Anonymous Coward · · Score: 0

      Having dabbled in Go a bit, the main advantages to me are:

      * Builtin, cheap concurrency support; perhaps even comparable to Erlang (although it's a different model, CSP vs. actor)

      * Native compilation for speed and ease of distribution

      * Clean, compact syntax (certainly compared to Rust, which is awful)

      * Automatic memory management

      * Language spec is small and pretty orthogonal, fits in your head, C++ being the diametric opposite here. And it's stable, the Go team doesn't bolt more shit onto it because a critical mass of retards said "+1" on a GitHub PR. Again, this is unlike C++ which is simply the accretion of every single feature that anyone proposed.

      * Fairly comprehensive, modern standard library

      * The standard tooling for code formatting, testing, compilation, etc. is really great and vastly reduces the number of decisions you have to make or problems to solve when getting started

      * This is very subjective, but the Go user community in my experience is much more driven by shared technical goals and not striving for superficial popularity via a public relations blitz like Rust seems to be.

      On a technical level there's very little that's new and useful in Rust, and no reason to pick it vs. any other modern language in the same space. Just lots of peer pressure being exerted by egomaniacs who want their pet language to be used by others.

  40. 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.

  41. LOL by Anonymous Coward · · Score: 0

    Just wait until this guy hears what assembler lets you do...

  42. It's not the language; it's analysis and testing by Anonymous Coward · · Score: 0

    One can write in C, Lisp, Rust, or straight machine code and still write software rife with security vulnerabilities. One can write in each of these languages and write software that is, for all intents and purposes, not likely to be exploited. The difference isn't just language features. It's a matter of proper analysis and proper testing.

    Analysis *must* include formal methods for anything that has an attack surface. Proper analysis and architecture should minimize attack surfaces and build code in which critical parts are smaller and more easily scrutinized than less critical parts -- from the perspective of threat. The language is secondary to this analysis. When I hear people claim, "Rust is more secure", I laugh derisively. At the point of implementation, ninety percent of security analysis should already be sorted.

    Daniel J. Bernstein demonstrated proper security architecture with qmail. He wrote the system in a combination of C and shell scripts, but he architected the system with defense-in-depth and process separation in mind. There were and very well may still be vulnerabilities in qmail, but the extent of these vulnerabilities were minimized through proper analysis and architecture. This is a real-world example, but it is imperfect. The point is not that qmail is secure -- it is not -- but it had better security architecture, *despite* these language level flaws, than most naively written Rust programs are likely to have.

    The call to arms should not be to replace one language with another. This is missing the point. The call to arms should be to teach people how to properly architect software with security in mind, and then based on this, make language decisions that reflect this architecture. If this means using Rust for the more critical code and legacy C for the remainder of the system, then so be it. However, treating Rust or any other language as a silver bullet simply smacks of ignorance and wishful thinking.

  43. ATTENTION RUST CODERS: You are all stupid faggots by Anonymous Coward · · Score: 0, Flamebait

    Holy fucking $&!<:' worst delimiters EVER CHOSEN. It's like a hyperactive aspie found a way to marry to the worst aspects of C++ templates, Visual Basic, PERL and Brainfuck.

    pub struct DeclarationListParser<'i: 't, 't: 'a, 'a, P> { /// The input given to `DeclarationListParser::new`
        pub input: &'a mut Parser<'i, 't>, /// The parser given to `DeclarationListParser::new`
        pub parser: P,
    }

    This is how you do ($string == "!important") in faggotass Rust:

    /// Parse `!important`. /// /// Typical usage is `input.try(parse_important).is_ok()` /// at the end of a `DeclarationParser::parse_value` implementation.
    pub fn parse_important(input: &mut Parser) -> Result<(), ()> {
        try!(input.expect_delim('!'));
        input.expect_ident_matching("important")
    }

  44. most modern languages don't even try to replace C by Anonymous Coward · · Score: 0

    This guy obviously hasn't heard of C++

  45. 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]

  46. 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.
  47. 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.
  48. Re:ATTENTION RUST CODERS: You are all stupid faggo by Anonymous Coward · · Score: 0

    I like the gratuitous extra slash, to help *distinguish* Rust from other languages that use doubleslash comments. And just look at those dangling commas. Sick.

    WTF is "<(), ()>" ?? Some kind of code Emoji ?

  49. 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
  50. Swift by Anonymous Coward · · Score: 0

    Pffff Rust. Come one. Who is using that? Besides - it's oxidised as it is. If you really want to replace C code with something more palatable, then consider Swift.

    1. Re:Swift by Anonymous Coward · · Score: 0

      I'd be all for Swift if it were stable. Unfortunately every new version breaks existing code.

      I bought the ebook of Cocoa Programming for OS X and the very first example, a random password generator, fails to compile because the syntax for getting characters from strings changed after it was published (less than 2 years ago).

      I spent 2 hours just trying to figure out how to fix Hello World... that does not bode well.

    2. 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.

    3. Re:Swift by Anonymous Coward · · Score: 0

      Same here. Love it, not only to replace C++ but also to replace JVM languages and script languages. It's a very good sweet spot.

  51. 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

  52. 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?

  53. 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...

  54. why? by kiviQr · · Score: 1

    my C code has plenty of rust already why should I touch it?

  55. Re:ATTENTION RUST CODERS: You are all stupid faggo by Anonymous Coward · · Score: 0

    Comments like this are why we still have a social stigma that programmers are childish idiotic nerds, good only at making people's sub-par crashy software.

  56. 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.
  57. 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.
  58. 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.

  59. Learning Rust requires to learn C first ? by Anonymous Coward · · Score: 0

    Is it possible to learn Rust without learning C first ? The numerous pointer types of Rust look quite complicated if you do not understand basic pointer bugs in C. And to understand them, debugging numerous segfault seem the shortest way to me.

  60. 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
  61. Key issue for me: Single Source Compiler by Anonymous Coward · · Score: 0

    Replace dozens to hundreds of C compilers (ok ok, many don't work on the same codebase/different architectures without changes...) with a single source rust compiler, which requires a signing chain of predecessor compilers to generate the current one, trusting that chain to have been secure the whole way. OR trust any of the dozens to hundreds of C compilers, which would make it much harder to inject malicious code into the compiler to in turn inject into future compilers/compiled binaries, as well as ensuring if development stops on your favorite compiler, that some other compiler can take up the slack.

    Furthermore: given up the ~20 years of ABI stability that C has managed to attain on the majority of still meaningful operating system platforms.

    Tell me again how Rust makes sense from any of these points of view. Additionally, while C has lots of security failings given commonly used syntax, we have tools which can root out most of these bugs today. Does Rust have a sufficient analysis tool base to catch the same level of security errors across Rust? And furthermore: Does Rust offer support for a diverse enough set of platforms that you can 'compile anywhere' (whether or not the code needs other modifications to 'run' there.)

  62. Rust is the Trump of programming languages by Anonymous Coward · · Score: 0

    Every time the tech gentry is reminded that Rust is a thing they empty their bowels.

  63. 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

  64. If you can't trust someone with a certain language by Anonymous Coward · · Score: 0

    ... you probably shouldn't trust them with a keyboard.

  65. Lack of an Ada bootstrap compiler in C. by Anonymous Coward · · Score: 0

    While this might sound silly, at the moment you're dealing with a single source Ada compiler from GNAT, and almost all the open source Ada compilers available are derived from it. Furthermore it has its own build system gnatmake or something which is used for compiling modules, both for itself and the majority of ada packages compiled against it. FURTHERMORE there is no BSD/MIT licensed standard library for it, meaning people are less likely to trust it for non-GPL'd software which adds another checkmark against it.

    Having said all this, if someone gets the old NYU Ada interpreter (written in C!) fixed up so it can support Ada95 or newer and output to a format that can be natively compiled and add an mit licensed standard library (maybe a C to ada redesign of musl-libc), I think that GNAT-GCC/ADA-LLVM could take off again and offer many of the security advantages people are asking for.

    That said, my personal belief is we need a *NEW* language that isolates in-memory structures/datatypes from storage/network datatypes, so for example if an int64 is called for in a database, but the processor architecture only supports int32 or int16, the program function (which thanks to some dev assuming everybody has a 64 bit int datatype) would normally break on the other platforms, can now provide feedback that the function code would violate the on-disk format without changes or an 'overloaded' arch-specific function/code block. While C allows some nice low-level code development, it never really got the engineering necessary to help provide the level of portability it should have had for all code constructs. Having said that: I much prefer its efficiency and traditional/ansi c's 48k RAM compiler implementations. You are lucky to find a compiler that doesn't require hundreds of megs of disk space and 32+ megs of ram minimum (not including optimization passes bloating things up for a fractional percent performance increase.)

    1. 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

  66. 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
  67. 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 Anonymous Coward · · Score: 0

      Unfortunately, bolting on additional features often can't work for a language. If the checks aren't enforced, they don't get used. If the checks are enforced, there's suddenly a lot of code that isn't going to compile.

      There's also the reality that certain things that Rust accomplishes are incompatible with C. Rust's type system is leaps ahead of anything C offers, because it has to be for the various other parts of Rust to work. The borrow checker is baked into Rust, and is required for Rust's memory management safety guarantees.

      Honestly, by the time you were done converting C into Rust-C, you'd essentially have a different language that was almost if not wholly incompatible with existing C.

    4. 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.

    5. Re: Yes it is too much to ask. by Anonymous Coward · · Score: 0

      That's just a crock of FUD, which is typical from the Rust community.

      C and Rust are both built upon machine instructions. Maybe that is the shaky foundation?

      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.

      You know, just like Rust has an "unsafe" mode...

    6. Re: Yes it is too much to ask. by Anonymous Coward · · Score: 0

      Something about Mohammed a mountain, and a bunch of moving goats.

    7. Re:Yes it is too much to ask. by poptix · · Score: 1

      ^-- This.

      --
      Just because you disagree doesn't mean it's not true.
    8. 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
    9. 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.
  68. Re:ATTENTION RUST CODERS: You are all stupid faggo by Anonymous Coward · · Score: 0

    It's honestly amazing to me that a language with such horrifically ugly syntax is taken seriously. And that's coming from someone who doesn't mind Erlang's syntax.

    Some people will claim syntax doesn't matter, and there is some amount of truth in that, but it's also a marker for the quality of a language design, and in the case of Rust it doesn't look good. At all.

  69. 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.
  70. Re: ATTENTION RUST CODERS: You are all stupid fagg by Anonymous Coward · · Score: 0

    Yeah comments requiring three ///'s definitely are childish and could only come from nerds.

    The parent comment is completely correct.

    Rust has an absolutely abysmal syntax that has been built with no thought to the programmer. How you expect anyone to want to use such gibberish is beyond me. It's frankly a language that goes out of its way to disrespectful to "humans".

    Much like the Rust community themselves who seem to have painted themselves into a corner, realize that their utopian vision has become a steaming turd and are afraid to do a File|New.

    The Rust community would do the works a much bigger favor by working with the C++ standards committee to add safe section support within the industry standard professional language, rather than spending time shilling on newsgroups and feeling hurt when there is legitimate pushback.

  71. no by Anonymous Coward · · Score: 0

    take a hike jon. people will be saying the same thing about rust in another 20 years.

  72. 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

  73. Talent VS. Need by Anonymous Coward · · Score: 0

    Would you be so resistant to a surgeon using a robotic arm during surgery in order to compensate for their own potential faults in motor control or finesse? I doubt it. So even though that surgeon is no longer using the complexity of all 10 of their own that doesn't make them less of a surgeon.

    What you're proposing is the technological equivalency of the Luddite. Move forward to newer languages and embrace them if they actually fit the need, don't just hang on because you don't like the change.

  74. 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

  75. 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.

  76. 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.)

  77. Good Job Trump...!!! by Anonymous Coward · · Score: 0

    That is what Trump is doing too, replace the freaking free.... :) :)

  78. 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++.

  79. 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.
    5. Re:Calling it "Rust" defeats acceptance. by Anonymous Coward · · Score: 0

      'C' is for 'cookie.'

    6. Re:Calling it "Rust" defeats acceptance. by Anonymous Coward · · Score: 0

      And that's good enough for me!

  80. Re:Many who code should not by w3woody · · Score: 1

    There. FTFY.

  81. Experts suggest replace Jon Evans with non-fanatic by Anonymous Coward · · Score: 0

    Besides, we all know Evans isn't up to the job of replacing any C code, so it's likely not going to happen.

  82. No. by Anonymous Coward · · Score: 0

    Rust is shitty

  83. 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.

  84. 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.

  85. Better: bad programmers should stop it. by Anonymous Coward · · Score: 0

    Censorship has worked so well in English.....
    Because it's a problem with the language and not the idiot.... oh, my dad.
    In another 50 years programming will return to a science. Until then designers will continue to put their opinions where they are not correct.

    id10t errors like this are why the 21 century has ruined technology and its user.

  86. Great idea! by Anonymous Coward · · Score: 0

    I love this idea, Rust is so kewl!
    I'm totally going to get started on this after I finish my killer golang project and my ruby on rails app.

  87. Why not fix C specifications/behavior by Anonymous Coward · · Score: 0

    If there is nothing better than C, why not fix the bad specs/behavioral parts of C(which in turn changes the compiler behaviour). Call it C-2020. I guess one probably need to recompile the code and fix the issues, eliminating a class of issues like buffer overflows.

  88. He's not right, either by Anonymous Coward · · Score: 0

    Yes, tools matter. Yes, it's been a while and maybe we have learned a thing or two and perhaps we could cobble up a "better mousetrap" programming language that has most of the advantages and perhaps fewer disadvantages than C.

    But that better mousetrap language is not rust. So, before we leave C behind, we'll have to find that actually better alternative. Best keep looking, eh.

  89. 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 ;-)

  90. 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.

  91. 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.

  92. 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.

  93. 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.

  94. No by Anonymous Coward · · Score: 0

    No, languages like C are for people who actually know what they are doing and don't need a crutch.

  95. Pundits intentions by Anonymous Coward · · Score: 0

    When Pundits suggest things, they usually have political motivations, and I for one am not going to let politics dictate to me the language I will use because they think I have too much firepower.

    let rust just rust away. I will stick to C and assembly.

  96. Just "I don't like language FOO" ?? by Anonymous Coward · · Score: 0

    How is this not just a glorified personal opinion of someone who prefers one language over another?

    Security holes don't go away just cause you write code in a new language. Anyone who believes they do, should realize that the new language is just hiding the security holes from you.

    Now, quite possibly, the new langauge makes it easier to re-design for fewer security problems. But I don't see that C is automatically Bad and some other language automatically Good.

    Most C programs are bad cause most ppl stink at programming (overall, not specifically in C). But leaving those aside for a minute -- most of the other C programs are bad, because they were designed to be FAST. When C was created, the bandwith and CPU power was minicule compared to today, and the number of hackers, as well as the financial incentives driving those hackers, were tiny.

    So sure, in that enviornment, security was barely on the table. Speed was king.

    What's important is redesign, not language. sheesh Adding a new language to the problem, reminds me of this old joke....

    quote
          "Curse these personal computers!" cried the novice in anger, "To make them do anything I must use three or even four editing programs. This is truly intolerable!"
          The master programmer stared at the novice. "And what would you do to remedy this state of affairs?" he asked.
          The novice thought for a moment. "I will design a new editing program," he said, "a program that will replace all these others."
          Suddenly the master struck the novice on the side of his head.
          "What did you do that for?" exclaimed the surprised novice.
          "I have no wish to learn another editing program," said the master.
          And suddenly the novice was enlightened.
                    -- The Zen of Programming

  97. 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.

  98. international standard by Anonymous Coward · · Score: 0

    Rust is not standardized nor is it supported through multiple implementations. Sorry but it is still too soon to rewrite my C libraries. I really need to wait for a winner to appear, and so far it is not clear that Rust is it.

  99. 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
  100. why not Swift by Anonymous Coward · · Score: 0

    Why not Swift - it is type safe and almost as fast as C.

  101. ADA by whitroth · · Score: 0

    I mean, wasn't ADA the be-all and end-all, and was provably correct?

    While you're at it, why don't you do like Jack Williamson's Humanoids, and take away our power tools, and give us ones suitable for 10-yr-olds, and don't let us drive....

    Or - I know this is a totally outrageous thought, horrifying to upper management and HR alike - you might HIRE MORE EXPERIENCED PROGRAMMERS, AND PAY THEM WHAT THEY"RE ACTUALLY WORTH, instead of offshoring or hiring "lead" programmers who are on their first or second job out of college.

    Nahh, that'd be a waste of money.

  102. Geezus! by Anonymous Coward · · Score: 0

    The guy didn't suggest formal verification. The OP didn't propose government involvement. Where is the bloody reading comprehension around here!?

    The proposal is actually rational and modest. Slow, incremental replacement, as the opportunities present themselves. Lots of code will never get replaced. We do it as an IT imperative precisely because management will never ask for this and if you separately did a budget ask, you'd never get approval. Well, most places.

    I view this as akin to switching from an interpreted environment to a compiled environment. The compiler can help you! Proactive bug finding and quality control is better than reactive QC.

    The big ask here is, you have to learn a different language (OK, that's not such a big ask), but you have to shift over all your libraries, your deep knowledge of the language ecosystem. The mitigating factor is, you don't have to do it all at once. You can start small and build your comfort level as you go.

    Personally, I like the concept. It would take years but it adds value and moves us forward in a non-disruptive way.

  103. No True Scotsman by Anonymous Coward · · Score: 0

    You are veering dangerously close to the "No True Scotsman" fallacy.

    For example: If an "expert" C programmer (a true expert!) knows they cannot making mistakes, what is their response to that? "C'est la vie?" "Sucks to be the user?" "QA will catch it?"

    Seems to me that an "expert" C programmer (by your definition) felt this was an important issue, they ought to proactively switch to Rust, or at least away from C. And that includes even knowing that all non-trivial systems have bugs.

  104. More on this please! by Anonymous Coward · · Score: 0

    What can we hope, or not, from formal verification? For instance, can we hope that quality labels soon require internet connected things to be sandboxed in a formally verified core system that guarantees they can't be used as cyber weapons?
    I was very excited a few years ago when I read about the "unhackable" drone involving seL4 and DARPA; I thought formally verified systems had made incredible progress and would be making more and more headlines in the years to come, as more and more bad behavior would be prevented in more and more sandboxed systems. But nothing came, and whatever google/wikipedia searches I've done since then didn't let me see the big picture.
    Thanks a lot for your post, it's the first time I really learned something since then.
    Is there any place where I can read a layman overview of the state of the art, current actors and practices, and research directions?
    It looks like many slashdotters are as clueless on this as I am, so perhaps an IT guy (which I'm not) could just ask /. and raise the awareness.
    Thanks again! -- Jean-Marc (yeah, this post's accent was French)

    1. 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
    2. Re:More on this please! by Anonymous Coward · · Score: 0

      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.
      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? This is a national threat for all nations, yet I don't see various international committees pop up and define specifications for various internet things, to be met with a formally proven kernel that sandboxes the application software and guarantees the specs, which could be checked at the quality certification step. Where does this approach fail? How can these two facts coexist: (1) a DARPA program could use a seL4 kernel to sandbox a drone, making it unhijackable (2) no money there anytime soon? -- Jean-Marc

    3. 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
  105. Rust needs to get Tetanus to go with it by Anonymous Coward · · Score: 0

    Like most of TechCrunch, Jon Evans is clueless. C++ does *all* of the things he is complaining about, still manages to hit bare metal (when done right), AND its template system can even outperform C in several areas (again, when done right). Proclaiming Rust as superior is stupid when it doesn't run everywhere. Of course, C++ doesn't run everywhere either but it runs in a LOT more places than Rust ever will.

    Also, things that have rust are things that people generally try to avoid. What you name your programming language or software application matters. Rust brings to mind cars from the American midwest where salt hits the roads every winter to destroy both the roads and the cars riding on them. Defunct factories and trains just sitting around, slowly succumbing to the environment. And, finally, Tetanus. Lots and lots of Tetanus.

  106. Does formal verification really prove correctness? by Anonymous Coward · · Score: 0

    Does formal verification really prove correctness?

    Or are there likely oversights and bugs in the formally verification processes and tools?

  107. 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
  108. 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.
  109. Garbage! This a bad craftsman blaming his tools! by Anonymous Coward · · Score: 0

    The problem isn't the language but the idiot at the keyboard - classic PEBKAC.

    C problems occur as much due to lack of planning as the language allowing dangerous code.

    Rust won't solve anything by itself - again: lack of planning and groking the problem space is going to cause just as much fail as if you'd done in C!

  110. 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".