104 karma · joined May 20, 2012 (14y ago) · 37 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 6y ago · link · parent
It's like any of our instinctual responses. Sometimes it helps, sometimes it's in the way.
comment 6y ago · link · parent
One of them was unburdened by any thought of freeing stuff, and relied entirely on the application exiting for cleanup. This was very convenient to work with, and never ended up posing an issue.
Another used a series of allocation arenas, where certain arenas would be cleared at certain points in the compiler pipeline. This made for both speedy alloc/freeing and avoided leaks, since you weren't at risk of "forgetting" a data structure. It was also a major headache to keep track of exactly what the longest lifetime of a long-lived datastructure might be, and to pick an arena that won't be cleared in the meantime. Unfortunately the programs compiled with this compiler were large enough that we certainly couldn't have gotten away with just leaking memory; we sometimes OOMed as-is!
The third used standard C++ memory management. This compiler was quite simple, and the vast majority of its data used stack-based lifetimes. For a more complex compiler this would've become a headache.
I think that all of these compilers chose the correct allocation strategy for what they were doing. "Good practices" aren't as universal as we might like to believe, they depend entirely on the context in which a tool is designed to operate. And yes, we can guard to some extent against that context changing, but for the most part that's why we keep getting paid.
comment 7y ago · link · parent
Though if we're feeling pessimistic, we can guess at how a failure might occur. Let's say that your GPS receiver is poorly written enough that it just starts returning wrong location data on week rollover. Let's also say that that receiver is the aircraft's main time provider. Since the inertial navigation system also needs an accurate time source, it could be hooked up to this same time source. Hopefully it wouldn't be, but we're assuming the aircraft in question here is all-around subtly defective. The INS doesnt't include handling for bogus time jumps, so its speed and location tracking is also corrupted. So, you and your unfortunate copilot could find yourselves without your two main navigation sources a few hours into a trans-pacific flight, and assumedly the GPS-coupled autopilot had pointed you well off course before you'd noticed. In this situation you'd have to get yourselves reoriented based off your compass and best guess of a location. Hopefully you have enough fuel reserves after you little diversion to find land search for an airfield.
So that would be a pretty bad situation. I wouldn't worry though, aircraft systems are generally better isolated than that.
comment 8y ago · link · parent
comment 8y ago · link · parent
edit: That said, you could probably make a decent aviation touchscreen. The main issue with off-the-shelf screens is it's easy to brush the wrong thing. A screen that takes significant pressure to register a touch would probably be usable, and for all I know this system might do that.
comment 9y ago · link · parent
Scammy? Ehhh. People get way more than their money back for switching flights, which I consider enough to make it un-scammy. Others might reasonably disagree.
comment 9y ago · link · parent
[1]: https://en.wikipedia.org/wiki/Aviation_accidents_and_inciden...
comment 9y ago · link · parent
Now hold on. The most successful sprog of nature is humanity[citation needed] and we're a case study in the fact that raw intelligence is more effective than fitness for any particular niche. So: as in nature, there may be a bunch of niche languages, but in time they'll find themselves with a conservation status while a smart language rules the earth.
comment 9y ago · link · parent
But that's hard, so every compiler I've used leaves it to human engineering instead.
comment 11y ago · link · parent
comment 11y ago · link · parent
I personally didn't find the semantics to be unreasonably complicated, but the type system is very much based on Haskell's so if you're not used to that there'll be more of a learning curve.
comment 13y ago · link · parent