News for hackers. Stuff that matters.
Re:Learning Ada by tombert on Thursday March 28, 2019 @09:59AM (#19512217)
I've never used Ada, but some of the graybeards I talk to have said that it's sort of like a predecessor to Rust, at least in some of the same concepts of safety with an emphasis on performance.

With the risk of having my foot planted in my mouth, how "systems-ey" is Ada? Could I conceivably write an OS in nothing but Ada (and obviously a bit of assembly to kickstart it), similar to something like Redox-OS in Rust?

Re:Learning Ada by nickpsecurity on Thursday March 28, 2019 @12:40PM (#19513897)
A few OS's and a micro-hypervisor done in Ada or SPARK including a high-assurance, secure kernel for Ada apps with strong isolation and leak resistance. Given its main domain, Ada is often used to write bare metal with no OS or for the app (not OS) in a runtime on top of a RTOS. They're usually C and/or assembly since those are dominant for OS work.

https://www.muen.sk/

https://marte.unican.es/

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

https://apps.dtic.mil/dtic/tr/fulltext/u2/a340370.pdf

https://www.researchgate.net/publication/220713695_Specifica...

Note: This one is also downloadable on ACM or IEEE. I got it off of one of them. Has good example of Gypsy language for verifying systems.

Re:Learning Ada by jecel on Thursday March 28, 2019 @05:02PM (#19516563)
Since you mentioned BiiN we can add its predecessor to the list. The iMAX operating system for Intel's first 32 bit processor, the iAPX432 (which Intel likes to pretend never existed), was written entirely in Ada.

https://cs.uwaterloo.ca/~Brecht/courses/702/Possible-Reading...

Re:Learning Ada by nn3 on Thursday March 28, 2019 @10:12AM (#19512351)
Yes early versions of https://en.wikipedia.org/wiki/RTEMS were written in Ada. I believe modern versions are large in C with just an Ada API though.
Re:Learning Ada by tombert on Thursday March 28, 2019 @10:16AM (#19512380)
Do you know why they changed? Was it performance, or just that more people had familiarity with C than Ada?
Re:Learning Ada by nn3 on Thursday March 28, 2019 @10:23AM (#19512456)
At some point maintenance was taken over by a startup, and they moved to POSIX as the primary API as a industry standard (over "RTEMS classic" which was purely Ada). The move to C was part of that I believe.
Re:Learning Ada by tombert on Thursday March 28, 2019 @10:26AM (#19512488)
Fair enough; after some cursory reading, it seems that Ada is objectively safer, so it makes me wonder why there wasn't an "Ada all the things!" movement.

I suppose I'd have to do a big-ish project to know for sure how it compares to C as far as maintenance is concerned.

Re:Learning Ada by Jtsummers on Thursday March 28, 2019 @10:59AM (#19512808)
Cost, culture.

Ada compilers, versus Rust, used to cost a lot of money. Rust is novel so it doesn't have that historical baggage and reputation associated with it.

People view Ada as verbose (it is, I won't disagree), but it's not that cumbersome (in my experience). And reading it is a pleasure compared to reading a lot of other code. From a maintenance perspective, I greatly prefer it to C.

Static analysis tools and coding practices have made C and C++ safer languages than they used to be, even if they're not innately safe languages (or designed with safety in mind) as with Ada and Rust. So this mitigates the need (though drives up the costs if you want to do it right) to use a safer language in the fields that really care about safety.

Re:Learning Ada by twic on Thursday March 28, 2019 @02:46PM (#19515252)
I suspect toolchain availability was a big thing. Every unix shipped with a C compiler, and if you didn't like it, chances are GCC, which was free, ran on your system too.

AIUI, Ada toolchains have historically been commercial. GNAT was released in 1995, and i don't know how good it was, or is, compared to commercial versions.

Re:Learning Ada by nn3 on Thursday March 28, 2019 @11:10AM (#19512924)
In the 90ies there was more a "move away from Ada movement" to avoid that language that the dod forced on the industry and for which it was hard to hire programmers for. Today it would be likely different. Also to stay pure Ada they would have needed to write a TCP stack in Ada, which would have been a big burden I guess.
Re:Learning Ada by marcosdumay on Thursday March 28, 2019 @01:55PM (#19514758)
> why there wasn't an "Ada all the things!" movement

From the history I've read, there was. Then at some point the US DoD the most vocal member, what created a very bad culture on the Ada community (based on waterfall methodologies and government contracts) that everybody learned to avoid.

Re:Learning Ada by steveklabnik on Thursday March 28, 2019 @10:03AM (#19512251)
I'm still learning, of course, but it's my understanding that Ada is used almost exclusively in systems contexts.
Re:Learning Ada by acomjean on Thursday March 28, 2019 @11:02AM (#19512841)
If I remember correctly Ada has some non-sytem things, like its own threads (tasks). For our compiler (Rational) they weren't handled by the OS. Many of the closed source compiler vendors stopped supporting them (probably too much work for too few customers), thus GNAT/ Adacore and actual OS threads.

[1] http://www.iuma.ulpgc.es/users/jmiranda/gnat-rts/node14.htm

Its been a while.

The ada runtime didn't have a lot of things built in so for our project we built a ada library that would call out to some C code that allowed ada to call to the OS for networking/shared memory/message queues and such. Sizing of types passed from ada to C was important, but wasn't too difficult. Ada also has a record type that seemed to map well to structs.

Re:Learning Ada by steveklabnik on Thursday March 28, 2019 @11:09AM (#19512916)
I've seen embedded RTOSes that are focused on task-like abstractions, I don't think that means it disqualifies.