News for hackers. Stuff that matters.
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by protomyth on Friday March 14, 2014 @11:48PM (#7403408)
Ada is proven in this area and generates fast, efficient code that is suitable for embedded systems. Ada's last revision is 2012. What do you find unfriendly?

I would most certainly not trust Haskell over Ada in embedded system work.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by codygman on Saturday March 15, 2014 @12:36AM (#7403533)
I'm sure someone once made the same comment about Ada when compared to competing languages (C? Assembly?) too ;)
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by protomyth on Saturday March 15, 2014 @02:54AM (#7403872)
The history of Ada is about these type of systems. Haskell's history and runtime characteristics aren't.
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by mcguire on Saturday March 15, 2014 @12:08PM (#7404984)
As an aside, I've been playing with learning Ada for a while (and all of the books I have from the last time poked at it are very out of date). Do you happen to know of any good references, online (Better!) or off?
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by protomyth on Saturday March 15, 2014 @01:27PM (#7405283)
this seems to be a good starting point these days - http://www.adacore.com/adaanswers/resources

I learned with "ADA as a Second Language", but its way out of date and I do believe out of print.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by wyager on Friday March 14, 2014 @11:56PM (#7403429)
>Ada is proven in this area and generates fast, efficient code that is suitable for embedded systems.

So does coding in assembly. The idea is to create fast, efficient code that is also simple and easy to understand.

>I would most certainly not trust Haskell over Ada in embedded system work.

If the system does not have hard realtime requirements and has a decent resources, why wouldn't you trust Haskell?

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by akiselev on Saturday March 15, 2014 @12:07AM (#7403459)
>> If the system does not have hard realtime requirements and has a decent resources, why wouldn't you trust Haskell?

Because that doesn't describe cars, a jet, space shuttles, or ... well anything I'd trust my life to. Hell, Haas CNCs still run DOS 8.0

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by comex on Saturday March 15, 2014 @12:37AM (#7403539)
Yeah, I would avoid trusting something hard-realtime to a language with lazy evaluation and garbage collection, even if it's quite trustworthy for other purposes.

(IIRC, these programs don't even use malloc, let alone garbage collection :)

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by akiselev on Saturday March 15, 2014 @01:39AM (#7403706)
MISRA discourages use of malloc (because you can deviate with clear documentation as to why) but it's not at all unheard of. That said, many embedded systems don't come with a usable implementation of malloc so the safe default is to write your own memory manager (safer but not always possible: use a well tested one) that uses static memory pools to allocate dynamic memory.
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by userbinator on Saturday March 15, 2014 @04:29AM (#7404037)
Any time you're using malloc() you run the risk of running out of memory, which is a very very bad thing for a safety-critical embedded system. Statically allocated, fixed-size things are good, as are algorithms that are designed not to require O(n) space to perform their processing.
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by wyager on Saturday March 15, 2014 @12:53AM (#7403588)
There are many safety-critical systems that aren't hard realtime. Radio transponders, human interface systems, life support systems.

In fact, I'd say a great way to do it would be to implement all the hard realtime bits in some low-level, pain-in-the-ass language like Ada and then wrap all that unpleasant stuff in a high-level language that is very unfriendly to implementation bugs (like Haskell).

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by akiselev on Saturday March 15, 2014 @01:34AM (#7403691)
>> Radio transponders, human interface systems, life support systems.

Don't think you know what a hard real time system is. Both radio transponders and life support systems have to be hard real time. Motors and antennas don't magically communicate with your userland "apps," they're controlled by precisely timed code. The "human interface systems" (could you have brought to the conversation a more generic term?) to all of these are often, too, hard real time because that's the easiest way to prove something is safe and test the edge cases. For all intents and purposes, anything "soft real time" has a kernel and kernels are monolithic disasters waiting to happen for anyone who needs timing guarantees (hint: if your life depends on it, it needs timing guarantees).

On top of that is the unfriendliness of Haskell to the real world of hiring (and this is Boeing for godzilla's sake) and it's lack of proper testing in such an environment, although I'm sure there are those who use it in embedded.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by wyager on Saturday March 15, 2014 @02:00AM (#7403761)
>Motors and antennas don't magically communicate with your userland "apps," they're controlled by precisely timed code.

Motors and antennas are usually managed by hardware or dedicated uCs, not PFC software. Aircraft aren't running their telemetry off GnuRadio, and aircraft PFCs sure as hell aren't worrying about servo timing.

"Human interface systems" I thought would be self explanatory; pilots don't care if their plane UIs take 5us or 5ms to update. They can't react on those time scales anyway. Hell, you could probably code all the user-facing avionics stuff in Javascript and be fine.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by KMag on Saturday March 15, 2014 @03:38AM (#7403966)
> pilots don't care if their plan UIs take 5us or 5ms to update

Hard real-time doesn't mean "fast", it means having guaranteed upper bounds on response time. In order to get those guarantees, uninteruptable code paths need to be short and critical parts of the systems need to be simple, which often also leads to fast response. However, the difference between soft and hard realtime systems is the guarantees.

A soft real-time system that has a 5ms mean update time but has a 1e-6 chance of taking 10 seconds is much less useful than a hard real-time system that has a 15ms mean update time with a hard upper-bound of 50ms.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by eric_bullington on Saturday March 15, 2014 @05:19AM (#7404121)
Which is why Rust is so interesting. It has deterministic upper bounds on performance. Not many new languages have this feature. Should eventually be useful for real-time systems and game developers.

But based on my meager experience in the language, I disagree that Ada is a massive pain in the ass to program in. It's probably less verbose and friendlier than Java, for example. Certainly easier than programming in C, and much less prone to fatal mistakes.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by sswezey on Saturday March 15, 2014 @12:35PM (#7405068)
Do you have any links about the upper bounds of performance in Rust? I have a passive interest in embedded and Rust and that sounds pretty interesting.
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by mattdeboard on Saturday March 15, 2014 @10:44AM (#7404738)
> user-facing avionics stuff in Javascript

Please don't give anyone any stupid ideas.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by jeffdavis on Saturday March 15, 2014 @01:11AM (#7403634)
"There are many safety-critical systems that aren't hard realtime."

I'm not convinced you can make such a clean separation.

Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by a3n on Saturday March 15, 2014 @04:04PM (#7406137)
They wouldn't be running Ada 2012 on a 777.
Re:Expert Was Needed to Disable Malaysia Airlines Jet Systems by protomyth on Saturday March 15, 2014 @04:15PM (#7406187)
I was just answering that the language is not old. I'm really not sure what they would be running (83 probably, since its first flight was before 95).