Arnt Karlsen writes: > ..can C code be generated from C++ or Java source without undue > difficulty using some tool? How about C++ from Java source?
Originally, back in the old days, C++ was implimented via a translater that produced "C" code for final compilation. So, yes C code can be generated, however I have no idea if these old tools are still available. I'm sure they were commercial/proprietary (not open source) at the time they were being used before native C++ compilers existed. So by definition, anything you can do in C++, you can do in C. > ..or is C++ source as "easy" to read as C source for the FAA guys? I personally believe that code readability in most cases is more dependent on the author of the code, and less dependent on the language it was written in. But, true, some languages can help or hinder readability ... Intercal is [intentionally] one of the most difficult languages to read. I always thought that Modula-2 was one of the more readable languages out there. Some people say Python is like writing pseudo-code. Personally I still don't grok python very well, which means readability is also dependent on the reader's experiences. > ..agreed, agreed, and ugly code is not airworthy. Needs to be clean > and pretty and easy to read and understand. Linus and the kernel guys > enforce a coding style, how far off it are we? There's no practical way to ensure a coding style without automating the [re]formatting in some onobtrusive way. So far I haven't found a C++ beautifier that produces what I consider acceptable results (or rather which doesn't produce unacceptable results.) These questions can really lead into a religious debate so please everyone be nice if you weigh in. :-) > ..can the whole issue be as simple as enforcing coding style for > easy readibility??? The question is though, from a practical standpoint, how do you enforce a code style. Do you want to do it manually yourself? Do you expect someone else to do it? Who has the time? If not manually, we need to find an acceptable automated approach. I'm open to suggestions, maybe there's a new tool on the scene or something I haven't seen yet? > ..my "airworthy" questions comes from seeing the potential in > airworthy code in avionics etc, built from a subset of FG and > linux some day. Until someone comes up with a better idea. ;-) Another approach would be to build the 'airworthy' code on top of the lower level flightgear/simgear/plib code that is tried and trued and stressed tested over and over again. > ..hummm. Why is the Linux kernel not written in C++? ;-) > Hurd? Free|OpenBSD? Anyone? Any OS written in C++? > That _is_ possible? History? Momentum? Biases of the leading kernel authors? Bugs in g++? There was a time when the linux kernel could be built with g++, but there were issues and the result wasn't as stable as when compiled with C. From that perspective you make a fair point, however, this was a few years ago, g++ get's better and better, and coding a project from the bottom up in C++ is a *lot* different than taking one that is developed in C and trying to compile it with a C++ compiler. Regards, Curt. -- Curtis Olson IVLab / HumanFIRST Program FlightGear Project Twin Cities [EMAIL PROTECTED] [EMAIL PROTECTED] Minnesota http://www.menet.umn.edu/~curt http://www.flightgear.org _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel
