14 ms·
Their "Appendix: Memory Safe Languages" lists: C#, Go, Java, Python, Rust & Swift
by wodow 3y ago
Their "Appendix: Memory Safe Languages" lists:
C#, Go, Java, Python, Rust & Swift
- candiddevmike 3y ago[flagged]
- chewmieser 3y agoOh boy... Nothing is mandated here. These are just suggestions from experts. Don't take them if you don't want to.
- synergy20 3y agowait for gov contract projects mandate them in the fine prints, it's a signal that is serious enough for anyone interested in doing any software-related business with gov, for them, this is nearly the same as 'mandated'
- chewmieser 3y agoThere actually was a mandate for government work in the past with Ada. This is not a mandate. Even that mandate did not appear to fundamentally change the landscape beyond government work.
- zaphar 3y agoI for one would prefer that government projects set this kind of requirement. I don't want my government software implemented in C++. If they are the customer they should require that the projects do everything they can to eliminate bugs caused by memory unsafety. Using a Memory Safe language is one of the easiest ways to do so.
- mikeyouse 3y agoThat’s just a customer with requirements.. like all customers.
- 2devnull 3y agoBut, on the other hand it’s not. The government is a virtual monopsony. One customer has unappealing requirements and you can choose not to serve them. The federal government saying don’t hire c devs will hurt c devs. C devs will be understandably dismayed by this.
- bumby 3y agoBut this differs from the above statement that specifically referred to "government-related business". The "business" part implies a contract but it doesn't mean all non-govt contracts need to follow suit.
- deleted 3y ago[deleted]
- xnorswap 3y agoIt is ridiculous to equate a recommendation and a mandate.
- candiddevmike 3y agoIt is, but it doesn't mean folks won't.
- xnorswap 3y agoI don't understand the point you're trying to make. You're the person who wrote it would be mandated, and now you're admitting it's a ridiculous position to take. If you have some point to make please do so earnestly. Layering in levels of irony makes any point you're trying to make difficult to understand or follow, even if labelled with /s. This is going off-topic, but there is a style of internet arguing that I have come to seriously dislike. It is one where instead of someone making a point, they make the point they wish to detract and simply flag that they are being ironic. In doing so they don't actually advance the point they're trying to make, they assume that the audience already understands and is sympathetic to that point, so they simply put up a target to scoff at. I'm not sure if that's what you're doing here, or if you're just struggling to make a point about worrying about government intrusion into private business.
- marcosdumay 3y agoI guess the GP is trying to say that those languages will enter the compliance checklist of some unavoidable rule, and that recommendation will turn into an effective mandate. What is a quite real possibility. For example, there are plenty of places out there that can't stop expiring passwords every 1 or 3 months because it's in one of those lists. But I do agree that complaining about the recommendation because of this is completely out of topic, the focus should be on the rule that actually mandates it.
- slimsag 3y agoWell, there are groups that want a government mandate for this, though. If you don't know, Consumer Reports is paid by groups interested in encouraging the government to apply regulations to certain areas. A bike helmet manufacturer may pay them to create a report, host events, and otherwise lobby on their behalf to e.g. create regulations about people needing to use bike helmets. It is my understanding that many Rust advocates, security researchers, and members of the Internet Society are effectively advocating/lobbying for partial government mandates of 'memory-safe languages'[0]: > It’s not yet possible for government procurement to only buy memory-safe software. For example, you can’t say routers must be memory-safe top to bottom because no such products currently exist. But it may be possible for the government to say that newly developed custom components have to be memory-safe to slowly shift the industry forward. > This would require some type of central coordination and trust in that system. The government could ask for a memory safety road map as part of procurement. The map would explain how the companies plan to eliminate memory-unsafe code in their products over time. The carrot approach for memory safety may include not just decreased future costs in cybersecurity, but also reliability and efficiency. [0] https://advocacy.consumerreports.org/wp-content/uploads/2023/01/Memory-Safety-Convening-Report.pdf https://advocacy.consumerreports.org/wp-content/uploads/2023...
- ethbr1 3y agoLikely only if you're building government code. Worked out well enough with Ada in 1978. https://en.m.wikipedia.org/wiki/Ada_(programming_language)#History https://en.m.wikipedia.org/wiki/Ada_(programming_language)#H...
- kaetemi 3y agoEasier to decompile.
- CJefferson 3y agoNext thing they'll be giving requirements for people building bridges, houses, and gas and electricity fittings. Seriously, I think the time has long since passed software needs regulating. It's a major part of modern society, and as far as I'm aware, most people aren't opposed to building standards in principle.
- none_to_remain 3y agoPeople figured out how to build buildings prior to creating building codes
- baseballdork 3y agoAnd people figured out how to fly prior to the FAA. So what?
- helsinkiandrew 3y agoAnd many buildings were built deliberately poorly to make a quick buck - or caught fire too easily or fell down in minor earthquakes (or worse damage other property/people). Peoples homes are a major financial commitment and can ruin people if they're not up to scratch. The regulations are to ensure the 10% of bad builders/developers don't ruin peoples lives.
- wolvesechoes 3y agoAnd yet, poorly build buildings are still being build, but at least now it is much harder and much more expensive for a person to build their own house, and for a small construction companies to compete with giant monopolies. Yay!
- bumby 3y ago"Poorly build [sic] buildings" depends on context. Even low-quality builds in the US are relatively safe. It's disingenuous to imply they are of the same quality as in countries where building codes are effectively non-existent.
- WaitWaitWha 3y agoI agree that it is not a mandate yet. NSA does have some interesting insight and expertise they acquire in this area. Time and time again, we see experts make recommendations, then legislation and rules make it mandatory. A burning example is most of NIST special publications. NIST makes no rules, mandates and such. Yet, mandates (e.g.,DFARS, DEAR) point to the recommendation as the requirement. Right now there are two of these playing out in the cybersecurity field - zero trust and passwordless authentication. So those who down this comment, you are right, it is not a mandate. Those who up this comment, you are right, it is likely to become a mandate.
- AnimalMuppet 3y agoSome software needs to be NSA-certified. If you need a government certification, you get government mandates. Though at this point, this is a recommendation, not a mandate.
- merpnderp 3y agoWhy is Python listed there and not other languages like Ruby, Javascript or Perl?
- czbond 3y agoCommenting bc I had the same question. My impression of historical Python is that is an old, partially arcane language that due to D.S/AI is now popular; I would initially think it would be no better than those other interpreted. Python does these things well... mainly due to pandas/dataframes/polars. <btw, Perl? ;) >
- kelipso 3y agoLanguage wise, Python is basically just Perl with its arms cut off and bunch of makeup added. It's just very popular in the scientific community, so they have to add it.
- ctenb 3y agoPython does not have a lot in common with Perl language-wise, so this seems an odd statement.
- VerminOctopus1 3y ago
- jerf 3y agoReally, the only memory unsafe languages still in use are C and C++. If it weren't for the behemoth of legacy code we'd really have this problem more-or-less licked. Unfortunately, that behemoth is still rampaging across the landscape. "Rewrite it in Rust" gets a bit of pushback, perhaps even justified, but at this point in time I'll take anything that just reduces that behemoth in size. The journey of a thousand miles begins with a single step, an elephant is eaten one bite at a time, etc. Rust is just one of the easier and more effective options for a legacy codebase, with the unusual advantage of being able to slip in incrementally. Almost every other language requires a true rewrite.
- DeathArrow 3y ago>Really, the only memory unsafe languages still in use are C and C++. Ada, Fortran, assembly?
- orwin 3y agoIsn't Ada memory-safe?
- 38529977thrw 3y agothe internet says "it tries to be". http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-9-1.html http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-9-1.... https://old.reddit.com/r/ada/comments/mme3jk/is_ada_memory_safe/gtsa411/ https://old.reddit.com/r/ada/comments/mme3jk/is_ada_memory_s...
- kjs3 3y agoIn summary, Ada tries to be memory safe by default -- as far as that can be done without requiring automatic memory management and garbage collection -- but deliberate use of "unchecked" language features can break memory safety. In other words, if you go out of your way to use unsafe features, and don't use the features that compensate, Ada is memory unsafe. This has become the goto dismissal of Ada, apparently more popular than "eww...a BEGIN..END language" and "designed by committee/government tainted".
- jerpint 3y agowhat do we do about javascript?
- ethbr1 3y agoThis ain't that kind of movie.
- solardev 3y agoJudging from HN, just use HTML instead.
- roflmaostc 3y agoHTML, the Programming language, right? https://news.ycombinator.com/item?id=38519719 https://news.ycombinator.com/item?id=38519719
- solardev 3y agoWatch out Brainfuck, a challenger has arisen!
- kome 3y agobased and true.
- smolder 3y agoKind of interesting that they didn't include it given python is there. (JS is not even mentioned in the document.) I guess they don't class it as a general purpose programming language? It's not as if we have other options in the browser, particularly, and while node can do a lot of stuff, it's got a clearly intended purpose. Or... maybe they consider it unsafe somehow, but that seems less likely.
- teunispeters 3y agoWrite javascript engines in memory safe languages. I'd vote for rust as rust and javascript's APIs are pretty similar in style, structure, consistency and security/other issues that are not memory safety. On that note, try valgrind on existing javascript engines, you might be "entertained". (I certainly was, but that was some years back.
- deleted 3y ago[deleted]
- projektfu 3y agoAda people scratching their heads....
- marcosdumay 3y agoNeither Ada nor Rust are completely memory-safe... and they are partially unsafe in completely different ways. But I guess people prefer the Rust explicitness.
- projektfu 3y agoAda is safe if you never free memory explicitly. The story for reclaiming memory without GC was always a little weird, basically pool allocation by type. But it does bounds checking, counted strings, and has a reasonably rich type system that allows variants and things in a safe way.
- zozbot234 3y agoAda has Controlled types, so the memory reclaiming story can be similar to C++/Rust RAII. What it's missing compared to Rust is the lifetime and borrow checking.
- local_crmdgeon 3y agoHow many of them are left? I thought it was very much a dead language
- HideousKojima 3y agoThere are still plenty of Ada devs around, but they're almost all in the DoD or working for defense contractors.
- chasil 3y agoFar from it. "SQL/PSM (SQL/Persistent Stored Modules) is an ISO standard mainly defining an extension of SQL with a procedural language for use in stored procedures... SQL/PSM is derived, seemingly directly, from Oracle's PL/SQL. Oracle developed PL/SQL and released it in 1991, basing the language on the US Department of Defense's Ada programming language. However, Oracle has maintained a distance from the standard in its documentation. IBM's SQL PL (used in DB2) and Mimer SQL's PSM were the first two products officially implementing SQL/PSM. It is commonly thought that these two languages, and perhaps also MySQL/MariaDB's procedural language, are closest to the SQL/PSM standard. However, a PostgreSQL addon implements SQL/PSM (alongside its other procedural languages like the PL/SQL-derived plpgsql), although it is not part of the core product." https://en.wikipedia.org/wiki/SQL/PSM https://en.wikipedia.org/wiki/SQL/PSM
- jonnytran 3y agoIt's unfortunate that there's no mention that not all these languages are equally safe. Go isn't memory safe when using goroutines. See: Golang data races to break memory safety: https://blog.stalkr.net/2015/04/golang-data-races-to-break-memory-safety.html https://blog.stalkr.net/2015/04/golang-data-races-to-break-m...
- slimsag 3y agoAdding some more for other languages: * many GC'd languages like Go, C#, Java make it harder to leak memory, while languages where reference counting is more prevalent (Python, Rust) it can be easier to leak memory due to circular references. * Languages with VMs like C#/Java/Python may be easier to sandbox or execute securely, but since native code is often called into it breaks the sandboxing nature. * Formally-verified C code (like what aerospace manufacturers write) is safer than e.g. Rust. * For maximum safety, sandboxing becomes important - so WASM begins to look appealing for non-safety-critical systems (like aerospace) as it allows for applying memory/CPU constraints too in addition to restricting all system access.
- deleted 3y ago[deleted]
- Thaxll 3y agoGo is memory safe, that post does not means anything in real life scenario. Do you have a single example in the last 14 years of memory safety exploit using the Go runtime? I'm talking about public and known exploit not ctf and the like.
- jonnytran 3y agoThe same author has a post from 2022 [1]. > Is it possible to achieve arbitrary code execution on any Go version, even with PIE, and with no package import at all, just builtins? Yes! Whether it's capture the flag is irrelevant, IMO, because anything that's allowed by the compiler will emerge given enough complexity. 1: https://blog.stalkr.net/2022/01/universal-go-exploit-using-data-races.html https://blog.stalkr.net/2022/01/universal-go-exploit-using-d...
- theandrewbailey 3y agoConspiracy: The NSA has compromised the runtimes of those languages to run arbitrary payloads and spy on everything that runs through them. I mean, "catch terrorists".
- OrvalWintermute 3y agoIn unrelated news, security researchers have discovered a new class of vulnerabilities common to all memory safe languages ;)
- anthk 3y ago>Java Java it's a pest fest for exploits. From those, I'd choose Go, C# (and not totally sure because of AOT/JIT's) and Rust.
- RhodesianHunter 3y ago>Java it's a pest fest for exploits. Sure, if you haven't used it since the nineties and pay zero attention to new development.
- hackideiomat 3y agoRight, there haven't been crazy Java exploits going around the past few months, only Rust and Go!
- natbennett 3y agoI’ve only used Java in the last ten years. I helped deal with the log4j incident at a few companies. We specifically had to patch systems that were running newer versions of Java and older versions of Spring. The exploit relied on a new method of adding code to the JVM at runtime that newer versions of Spring had locked down to prevent people from using. I’ve never seen an explanation for why this mechanism was added or what it was supposed to enable — besides enabling new exploits. Every time I’ve seen Java used for a safety critical application the justification has been entirely based on the fact that it has cryptographic libraries that are widely certified for safety by enterprises. The security people on our side were… resigned.
- RhodesianHunter 3y agoThe fact that everyone in these comments points at the one major incident in years is more telling than anything else.
- papichulo2023 3y agoLog4j affair was last year. Kinda funny how HN still bitch about node dependencies and how Java's are more mature.
- 1-6 3y agoWill we one day be able to use AI to make code memory safe?
- jebarker 3y agoReviewing C/C++ code for memory safety is probably a good use case for LLMs actually. Writing memory safe code from scratch is a much bigger ask.
- hardware2win 3y agoI bet many, many false alarms
- jebarker 3y agoPerhaps, but reviewing code for memory safety issues is a more well defined task than general code generation so LLMs can be more easily trained to get better at it.
- deleted 3y ago[deleted]