??? 08/24/09 07:51 Read: times |
#168497 - you can write FORTRAN in any language Responding to: ???'s previous message |
Christoph Franck said:
However, speaking of MISRA, it's a set of styling rules rather than anything else, and there are automated ways how to enforce it. This could be quite well imposed on assembler, too; with similar expectancy of code quality improvement.
Well, MISRA rules say that if assembler is used, it's supposed to be in a C function containing inline assembler only. I mean, rules in the spirit of MISRA could be imposed on asm, not that MISRA could be applicable per se. Christoph Franck said:
Also, try enforcing a rule like "goto shall not be used" (required by MISRA) in assembler. Short of banning the use of any branch instruction, I can't think of any other way to do that.
Goto as such is not a problem - its usage is the problem. When I was taught programming formally the first time on the secondary school, my teacher was member of a board trying to establish some appropriate way how to teach it so she was quite keen on experiments. We were taught something resembling rudimentary Pascal, except the keywords were in my language (making things a bit easier). However, there was no compiler/interpreter for that thought-off language; we had a 8080-based "school" microcomputers available (think of BBC Micro, I bet you had somethings similar in Germany in those days), with BASIC as its "first" language. So, to be able to try our first programs, we were given a set of strict rules how to "hand-translate" our "Slovak Pascal" into BASIC. It worked very well. The point is, you *can* write structured programs in asm/C, and then it can be analysed if it obeys the rules. If it does, it is no worse than any other language as per "security" or "completeness". JW |