- What tools do they use for error checking/linting? - Well... why C? If correctness is so important... surely there are better languages than C - not only better type systems, but also theorem proving and other fancy modern features. It doesn't even have to be garbage collected. - at the very least are they using language extensions? even gcc primitves would help!
The Power of Ten – Rules for Developing Safety Critical Code
61–70 of 155 posts
Re: The Power of Ten – Rules for Developing Safety Critical Code
#62Earlier quoted context omitted.
They mean that it's hard to write a static analysis tool that can determine if functions using recursion will ever terminate or not.
Just out of curiosity, why is that harder than writing a static analysis that determines if a loop with condition will finish?
Although they define this flexibily as "It should be possible for a verification tool to prove statically that a preset upper-bound on the number of iteration of a loop can’t be exceeded."
So any loops where they can in fact write a verifier is simple enough.
Re: The Power of Ten – Rules for Developing Safety Critical Code
#63If we're talking about high reliability code, one thing claimed about Haskell, is "if it compiles, it has no bugs". How close is it to the truth ? And how close are we to having that kind of capability for real-time programming(even assuming we're willing to forsake protability, community, and maximum efficiency to some extent ) ?
Haskell's type system protects from a certain class of bug, but it can't prevent logic errors - something like using won't trigger a build error, but it certainly is a bug.
Re: The Power of Ten – Rules for Developing Safety Critical Code
#64Earlier quoted context omitted.
How do you analyze worst case ? don't you need to know what calls what, up to what depth, and that's dynamic by nature ?
As said by TickleSteve, you define the worst case rather than analyze it. As for the stack usage requirements, it seems like this could be determined statically by some parametric process, but I’m no expert on this. Does anyone see a reason why there couldn’t be some algorithm to statically analyze some code to derive the worst case stack usage? For example, take every function and assume that every variable declarat…
(tho that takes a bit of analysis, there are tools around that can automate this).
Re: The Power of Ten – Rules for Developing Safety Critical Code
#65- What tools do they use for error checking/linting? - Well... why C? If correctness is so important... surely there are better languages than C - not only better type systems, but also theorem proving and other fancy modern features. It doesn't even have to be garbage collected. - at the very least are they using language extensions? even gcc primitves would help!
This formatting doesn't match the rest of HN which makes it difficult to read. Is this a bug somewhere?
Re: The Power of Ten – Rules for Developing Safety Critical Code
#66Earlier quoted context omitted.
task == thread of control. (Seriously? downvoted because I gave a direct, true answer to a question?)
I'm afraid I don't know what you mean by that either.
Re: The Power of Ten – Rules for Developing Safety Critical Code
#67- What tools do they use for error checking/linting? - Well... why C? If correctness is so important... surely there are better languages than C - not only better type systems, but also theorem proving and other fancy modern features. It doesn't even have to be garbage collected. - at the very least are they using language extensions? even gcc primitves would help!
This formatting doesn't match the rest of HN which makes it difficult to read. Is this a bug somewhere?
Re: The Power of Ten – Rules for Developing Safety Critical Code
#68> Do not use [..] direct or indirect recursion. Ok.. I get it that they don't want their C programmers to do that, but do they also mean that this is to "complex" for normal developers to implement in a fault-free manner?
They mean that it's hard to write a static analysis tool that can determine if functions using recursion will ever terminate or not.
Re: The Power of Ten – Rules for Developing Safety Critical Code
#69Earlier quoted context omitted.
The https://en.wikipedia.org/wiki/Curry–Howard_correspondence says there is a correspondence between any logical statement and a type in a sufficiently advanced type system. So yes, there are languages aimed at eliminating logic errors, and Haskell goes pretty far(though its type system isn't quite advanced enough).
If I grasp that right, it says that if something is provable mathematically, then you can write a program for it with an equal meaning. I still don't see how that prevents user error. My question is then how do you mathematically prove intent? Also, how far should "sufficiently advanced" be? We already have a tool for that in the forms of unit tests and types does help if the subject is abstract enough.
However, you can consider the formal specification of your intent (the type), to be an example of fully declarative programming.
Since you write your type without any care about how it might be executed -- the holy grail of abstraction -- you are less likely to make errors.
When using a type system that isn't capable of fully specifying what you're doing (i.e. Haskell), you are of course subject to making implementation errors within the range of possible programs that type check. But in practice it's usually enough to catch the sorts of mistakes that you're likely to make.
Re: The Power of Ten – Rules for Developing Safety Critical Code
#70http://number-none.com/blow/john_carmack_on_inlined_code.htm...