News for hackers. Stuff that matters.
Re:Achievement unlocked: rustc segfault by hu3 on Sunday April 10, 2022 @05:14PM (#30981777)
One of the reasons aircrafts like Boeing runs on safer languages like Ada.

There's a pretty cool article about it: http://archive.adaic.com/projects/atwork/boeing.html

edit: To those stating it was C++ portion of the compiler code at fault. That's not the point. Ada offers greater protection against segfaults than Rust. Not to mention that part of the compiler still being written in C++ and not Rust doesn't bode well.

Re:Achievement unlocked: rustc segfault by mbrubeck on Sunday April 10, 2022 @08:23PM (#30983185)
> Not to mention that part of the compiler still being written in C++ and not Rust doesn't bode well.

The Ada compilers I'm familiar with are also written partly or entirely in C or C++.

Re:Achievement unlocked: rustc segfault by __jem on Sunday April 10, 2022 @05:22PM (#30981839)
I didn’t read that closely, but isn’t this is a segfault in the compiler, not a miscompilation?
Re:Achievement unlocked: rustc segfault by gpm on Sunday April 10, 2022 @05:26PM (#30981884)
Yes.

A segfault in the portion of the compiler written in C++ no less, though triggered by invalid input from the portion of the compiler written in rust (due to a logic bug).

Unless GPs point is that "rust code can still have bugs" (so can ADA) or "the rust compiler still has bugs" (I'm willing to bet so do all ADA compilers) I don't see how this supports his claim.

Re:Achievement unlocked: rustc segfault by touisteur on Monday April 11, 2022 @06:52PM (#30996170)
I can confirm. I myself or our teams find compiler bugs every year or so, going from pure compiler crashes, to generate code that segfaults yay. Bugs are everywhere. Ada helps you with some categories of bugs and crashes but saying you can't segfault an Ada application is laughingly untrue. I manage that frequently on legacy codebases. And BTW, for the customer, a segfault or an uncaught top-level exception have the same effect. A crash.
Re:Achievement unlocked: rustc segfault by titzer on Sunday April 10, 2022 @05:25PM (#30981877)
Nothing inspires confidence like the compiler crashing. Given C/C++'s attitude towards UB, a crash just means you got lucky and the program really f'd up before doing something seriously nefarious like silent memory corruption or carrying on with nonsensical results....
Re:Achievement unlocked: rustc segfault by kelnos on Sunday April 10, 2022 @06:45PM (#30982481)
As a practical matter, though, I'd much rather the compiler segfault, than miscompile my code so it does something incorrect at runtime.

But agreed that seeing a compiler segfault doesn't inspire confidence!

Re:Achievement unlocked: rustc segfault by titzer on Sunday April 10, 2022 @07:40PM (#30982904)
Me too!
Re:Achievement unlocked: rustc segfault by theamk on Sunday April 10, 2022 @05:56PM (#30982116)
This article compares Ada with C and PL/1. This is pretty easy to win - its hard to imagine language less safe than C.
Re:Achievement unlocked: rustc segfault by msla on Sunday April 10, 2022 @06:03PM (#30982167)
https://yarchive.net/comp/ada.html

(Marc H. Donner and David H. Jameson, "Language and Operating System Features for Real-time Programming", Computing Systems vol 1 number 1, winter 1988, pp 33-62):

> Ill-chosen abstraction is particularly evident in the design of the Ada runtime system. The interface to the Ada runtime system is so opaque that it is impossible to model or predict its performance, making it effectively useless for real-time systems.

More:

https://catless.ncl.ac.uk/Risks/6/36#subj12

> Am I correct in thinking that several (two?) missiles were recently destroyed on launch each of which had their guidance systems coded in Ada? Were the problems which forced the destruction of the missiles the result of bad software design or some inherent ambiguity in Ada syntax?

> I spotted but unfortunately left unlogged a report somewhere which gave an account of a talk by a leading scientist (name?) in the military technology area who expressed grave reservations about the design of Ada. I think the report mentioned that the person expressed little confidence in guidance systems coded in Ada.

Re:Achievement unlocked: rustc segfault by cpgxiii on Sunday April 10, 2022 @08:53PM (#30983355)
In light of decades of demonstrated reliability of Ada use in aerospace applications, a bunch of comments about Ada from the late 1980s are meaningless.
Re:Achievement unlocked: rustc segfault by zozbot234 on Sunday April 10, 2022 @10:42PM (#30983989)
The quoted comment is saying that the Ada support runtime is so high level that it sometimes ends up being unsuitable for real-time programming. This is exactly the kind of concern that would be hard to improve even in recent versions of Ada, whereas it is naturally addressed by Rust.
Re:Achievement unlocked: rustc segfault by touisteur on Monday April 11, 2022 @06:57PM (#30996228)
That's one of those times when looking around at what exists and not only old papers might help. Been doing soft and hard real-time on baremetal (no OS) with Ada tech for a long time. There's a whole of language constructions to help reducing the language set for hard embedded stuff (no dynamic allocation, no specific constructs, no secondary stack,...) and there are the Ravenscar and Jorvik profiles.

Very strange to hear/read about non implementability of hard real-time with Ada when one the guy I hired years ago was one of the OS-for-aircraft-embedded-computer, doing that since the 90s...

Re:Achievement unlocked: rustc segfault by pjmlp on Monday April 11, 2022 @05:37AM (#30986503)
Except it ignores the little detail of stuff like Ravescar profile.

https://en.wikipedia.org/wiki/Ravenscar_profile

Re:Achievement unlocked: rustc segfault by ajxs on Monday April 11, 2022 @11:14PM (#30998182)
How do you figure Rust handles this better than Ada? Ada's runtime has always been configurable. You can customise the runtime library fairly easily to strip out things that don't suit your target platform. Most compilers even ship with a 'Zero Footprint (zfp)' runtime which is designed for minimal overhead.

You could make the exact same argument about C if you wanted. C's standard library, as implemented for most operating systems, is poorly suited for real-time systems too. That's why it's modified to be fit for purpose when targeting them.

Whether people know it or not, they've been living in the Ada world for a long time. A good deal of the world's critical real-time systems have been running on Ada for decades. Flight, and fire control systems in aircraft, Many major ATC systems, etc. The list goes on, and on.

Re:Achievement unlocked: rustc segfault by Jach on Monday April 11, 2022 @02:49AM (#30985473)
I like this sarcastic piece: https://web.archive.org/web/20180207161304/http://home.pipel...

> After a number of top-secret meetings at the highest levels, the "Ada Project" was conceived. ... Its goal was to divert Soviet attention from truly productive computer languages like Lisp, and convince them that only a bloated, grossly inefficient, high order compiled language along the lines of PL/I could be reasonably utilized in the deployment of military embedded systems. The use of a standardized, inefficient language would provide a one-two punch: it would render super-programmers useless, and it would increase the demands on hardware by more than two orders of magnitude.

> The Ada Project was inspired by the unexpected success of the IBM System/360 architecture behind the Iron Curtain. The Ada Project's wizards {the Ada Project was conceived at Kirtland AFB, NM, near Roswell} reasoned that if the Soviets could be lured into copying the 360 architecture, they could also be lured into copying the Ada language, and if this language were fiendishly designed to make real-time systems essentially impossible to program, then the Soviet military machine would grind to a halt.

> Although Ada would also severely impact American software productivity, it was felt that--just as cancer-fighting chemotherapy nearly kills healthy tissue while it kills tumors--the healthier US economy would be better able to bear the severe burden of an unproductive software industry than the Soviet economy could. Thus, while American geeks were inferior to Soviet geeks, our Elbonian hordes could beat their Mongolian hordes.

Presumably modern Ada is better! Even the sarcastic paper hints at it:

> Now that the Wicked Witch of the East is dead, the wizards have finally allowed Ada to evolve into Ada9X, which fixed some of Ada's more egregious dysfunctions. However, even today the brilliance of Ada's original conception still shines brightly through.

Re:Achievement unlocked: rustc segfault by ajxs on Sunday April 10, 2022 @09:16PM (#30983477)
> "The interface to the Ada runtime system is so opaque that it is impossible to model or predict its performance, making it effectively useless for real-time systems."

This comment didn't age well. If you've ever been a passenger on a modern jetliner you've most likely trusted your life to real-time systems coded in Ada.

> "Am I correct..."

> "Were the problems..."

> "...by a leading scientist (name?)..."

> "I think the report..."

Terrible. Entirely conjecture. Not one concrete source to substantiate these claims.

Re:Achievement unlocked: rustc segfault by msla on Sunday April 10, 2022 @10:24PM (#30983875)
I don't deny that, with careful coding review, Ada has the potential to be safer than C++ even with the noted deficiencies.
Re:Achievement unlocked: rustc segfault by touisteur on Monday April 11, 2022 @07:05PM (#30996303)
GNAT is a frontend (written in Ada yes) to GCC which might be one of the strangest pieces of C++ code in this world. And don't go there with AdaCore's SPARK examiner/prover implementation either because it's mostly an Ada frontend to Why3 (I'm simplifying) and you don't want to know what's behind Z3, CVC4 and Altergo. I'm a huge fan of SMT tech but I'm glad I don't have to open the hood.

These tools are enablers. Would it be nice to have an all-Ada compiler? Well, no! I want most of the gcc engineers to work for me! As long as the gcc backend improves, I get more perf! As long as SMT tools improve I get faster automated proof of contracts, or automated proof of far more complex contracts!

Re:Achievement unlocked: rustc segfault by johnisgood on Sunday April 10, 2022 @05:20PM (#30981826)
This is going to invite all the people who know nothing about the language and the circumstances with regarding to Ariane 5. :)
Re:Achievement unlocked: rustc segfault by hu3 on Sunday April 10, 2022 @06:13PM (#30982253)
Agreed. To those seeking more information about this, I always refer to this article because of the links it contains:

http://www.rvs.uni-bielefeld.de/publications/Incidents/DOCS/...