10 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
- 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
- timbit42 3y agoIt's still very popular in air traffic control. Some older NASA and military projects used it and are still in use.
- sneed_chucker 3y agoAs I understand, there's a very long tail of continued Ada use in military and aviation. So depends on your definition of "dead"
- trealira 3y agoNvidia uses it: https://blog.adacore.com/nvidia-security-team-what-if-we-just-stopped-using-c https://blog.adacore.com/nvidia-security-team-what-if-we-jus...
- 38529977thrw 3y agoIt is odd since Ada is DoD's (bastard?) child and NSA is DoD but a little digging you get this from 1997 (with a singular mention of the word "safety"): https://nap.nationalacademies.org/read/5463/chapter/3 https://nap.nationalacademies.org/read/5463/chapter/3 tldr; seems to be that the software development world has changed from the days that DoD was the "dominant" software developer, and Ada in the interim did not get adopted by the commercial sector (with safety critical exceptions in aerospace, etc. noted).
- 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.
- merpnderp 3y agoWhy is Python listed there and not other languages like Ruby, Javascript or Perl?
- cultureswitch 3y agoI would bet it's more unsafe to use Perl than C, on average.
- 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? ;) >
- andromeduck 3y agoPython replaced Matlab too.
- gsuuon 3y agoI think the familiarity when moving from Matlab to Python helps a lot with adoption.
- 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.
- 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.
- kome 3y agobased and true.
- 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!
- 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]
- 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]