Java Forum / First Aid / June 2005
ADA vs Java
Ted - 16 Jun 2005 21:32 GMT Writing code in ADA 95 and compiling it for the JVM should produce more reliable code than writing in Java 2. Does anyone know any good technical reasons for prefering Java?
Eric Sosman - 16 Jun 2005 21:49 GMT > Writing code in ADA 95 and compiling it for the JVM should produce more > reliable code than writing in Java 2. Does anyone know any good technical > reasons for prefering Java? All published studies[1] of the reliability of Ada and Java programs have consistently found that Java is between 86.3% and 87.7% more reliable than Ada.[2]
[1] Sample size N = 0, AFAIK.
[2] 94.2% of all statistics quoted on Usenet are bogus.
(In other words: Are there any objective data to support the opinion that either Ada or Java is "more reliable" than the other? Surveys, experiments, studies, ...?)
 Signature Eric.Sosman@sun.com
Pascal Obry - 18 Jun 2005 09:23 GMT > (In other words: Are there any objective data to support > the opinion that either Ada or Java is "more reliable" than > the other? Surveys, experiments, studies, ...?) Probably SUN has. The license quote explicitly that Java MUST NOT be used to control nuclear power plant for example. No Ada vendors are saying that Ada must not be used for safety critical projects. Don't you think this is related to safety/reliability ?
Pascal.
 Signature --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
Stefan Schulz - 18 Jun 2005 12:20 GMT >> (In other words: Are there any objective data to support >> the opinion that either Ada or Java is "more reliable" than [quoted text clipped - 4 lines] > must not be used for safety critical projects. Don't you think this is > related to safety/reliability ? It merely means that they want to be absolutely positively sure that noone will sue them over a bug in the compiler. IIRC, you will find a similar clause in Mircosofts C/C++ Compilers license es well.
 Signature In pioneer days they used oxen for heavy pulling, and when one ox couldn't budge a log, they didn't try to grow a larger ox. We shouldn't be trying for bigger computers, but for more systems of computers. --- Rear Admiral Grace Murray Hopper
Larry Kilgallen - 18 Jun 2005 13:13 GMT >>> (In other words: Are there any objective data to support >>> the opinion that either Ada or Java is "more reliable" than [quoted text clipped - 8 lines] > will sue them over a bug in the compiler. IIRC, you will find a similar > clause in Mircosofts C/C++ Compilers license es well. "Sue them over a bug in the compiler" certainly seems related to safety/reliability. I doubt the suit would be over trademark misuse.
I am not sure how the statement about Microsoft C/C++ is related. The question was about Ada vs. Java. So which Ada compilers have such a restriction ?
HansF - 18 Jun 2005 22:46 GMT > "Sue them over a bug in the compiler" certainly seems related to > safety/reliability. I doubt the suit would be over trademark misuse. > > I am not sure how the statement about Microsoft C/C++ is related. > The question was about Ada vs. Java. So which Ada compilers have > such a restriction ? The following deals with typical commercial software companies:
You will find that many 'modern companies' have contracts and disclaimers that are created by their lawyers. They have nothing to do with 'actual' safety and reliability and everything to do with 'potential' safety and reliability.
(Just because a bug has not been found, that does not imply that the software is totally bug free. And even if it is bug free, are there 'exceptional results' which may be found, possibly at previously undiscovered boundary conditions?)
Without such statements, companies must include the possibility of a lawsuit due to error or negligence as a risk factor in their SEC-filed financial statement. And then analysts look at the total risk factors and 'determine' the possible stock price. The stock price, of course, tells us which are 'good' companies. (Good, perhaps meaning, those who have enough disclaimers to avoid risk-based lawsuits?)
The previous post mentioned Microsoft C/C++ simply to indicate that the practise of using such disclaimers is not unusual.
Barring such a blanket disclaimer, the company's insurance would expect a documented test suite that demonstrates how the product handles a variety of possible failure conditions. Even then, the company will frequently add a disclaimer limiting liability if the product is used outside the scope of the demonstrated test cases.
Bottom line - read your license agreement. Especially the fine print.
 Signature Hans Forbrich Canada-wide Oracle training and consulting mailto: Fuzzy.GreyBeard_at_gmail.com *** I no longer assist with top-posted newsgroup queries ***
Pascal Obry - 18 Jun 2005 15:09 GMT > It merely means that they want to be absolutely positively sure that noone > will sue them over a bug in the compiler. IIRC, you will find a similar ^^^^^
Exactly my point, thanks.
Pascal.
 Signature --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
HansF - 18 Jun 2005 22:40 GMT >> It merely means that they want to be absolutely positively sure that noone >> will sue them over a bug in the compiler. IIRC, you will find a similar > ^^^^^ > > Exactly my point, thanks. Are you implying that no Ada compiler has any bugs?
 Signature Hans Forbrich
Pascal Obry - 19 Jun 2005 07:42 GMT > Are you implying that no Ada compiler has any bugs? Building safety-critrical software is possible in Ada and no Ada vendor will have such disclamer (Ada is used in the most critical application around). The point is that Ada can be used with a certified runtime or no runtime at all in some implementation.
Pascal.
 Signature --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
HansF - 19 Jun 2005 23:19 GMT > Building safety-critrical software is possible in Ada and no Ada vendor will > have such disclamer (Ada is used in the most critical application around). The > point is that Ada can be used with a certified runtime or no runtime at all > in some implementation. > > Pascal. No doubt Ada is solid. Little wonder that Oracle's PL/SQL is based on Ada.
<opinion> In my opinion, based on my experience, Ada will tend to be used in a professional environment tht includes proper analysis, specification and testing. As such, the attitude in an Ada environment may be as much or more important to critical programming than the fact that it is a solid piece of technology. </opinion>
But you do not answer the question, which is (rephrased): "Are you implying that there are no bugs in any Ada compiler?".
(If you answer yes, the next obvious question is - what is the proof. However, I will not ask that question! <g>)
 Signature Hans Forbrich
Pascal Obry - 20 Jun 2005 07:30 GMT > But you do not answer the question, which is (rephrased): "Are you > implying that there are no bugs in any Ada compiler?". I did not answer this question because it is not a question, I mean you pretty well know the answer. All piece of software has bugs. But softwares built with Ada tends to have far less bugs per sloc than other languages. See recent thread on comp.lang.ada for ref documents.
Pascal.
 Signature --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
Alan Krueger - 20 Jun 2005 18:13 GMT >>But you do not answer the question, which is (rephrased): "Are you >>implying that there are no bugs in any Ada compiler?". > > I did not answer this question because it is not a question, I mean you pretty > well know the answer. All piece of software has bugs. But softwares built with > Ada tends to have far less bugs per sloc than other languages. You appear to be equating compiler bugs with quality of code implemented in the language.
Pascal Obry - 20 Jun 2005 19:43 GMT > You appear to be equating compiler bugs with quality of code implemented in > the language. No I did not mean that. I'm not sure there is relation between both except when a C compiler is built in C, and Ada compiler built in Ada...
Pascal.
 Signature --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
HansF - 20 Jun 2005 23:31 GMT > I did not answer this question because it is not a question, I mean you pretty > well know the answer. All piece of software has bugs. But softwares built with > Ada tends to have far less bugs per sloc than other languages. See recent The question was originaly rhetorical - you claimed earlier that the standard disclaimer was related to safety and reliability, and now you acknowledge that Ada has bugs (at least potentially), but does not have a disclaimer, and therefore does not make the user aware of *possible* deficiencies. I see the potential for a lawsuit in any decently litigious society.
To conclude and summarize my points:
- the reason for the disclaimer by many large software organizations is to avoid legal repercussions. It has nothing to do with the quality of the compiler, nor the quality of the resultant code; and
- it may be that the attitiude of the Ada community, with respect to thorough analysis and test cases, is the significant contributor to the use of Ada in critical environments, rather than the compiler itself.
The reason I am driving on this - I pay large quantities of money to an insurance company to cover myself as a consultant in the instance that I could be sued due to an unforeseen (not even deliverate) error or ommission. This, and my standard contract disclaimer, simply means that I do not wish to waste all on a lawsuit - but it does NOT reflect on the quality I deliver.
 Signature Hans Forbrich
Pascal Obry - 21 Jun 2005 17:48 GMT > The question was originaly rhetorical - you claimed earlier that the > standard disclaimer was related to safety and reliability, and now you > acknowledge that Ada has bugs (at least potentially), but does not have a > disclaimer, and therefore does not make the user aware of *possible* No you missed an important point in one of my previous message. In Ada, for safety critical softwares, one will use a certified runtime or no runtime at all. Also in safety critical applications only a subset of Ada is used (there is an annex for this and compiler are required to check that such or such feature is not used). See also the SPARK-Ada subset.
Of course a compiler bug can still exists and show up in your code. Here testing/validation/proof are important.
Note that I'm not on the safety-critical field, so I hope I did not say something wrong :) Others will correct me anyway.
Pascal.
 Signature --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
HansF - 21 Jun 2005 18:08 GMT > No you missed an important point in one of my previous message. In Ada, for Didn't miss it. You apparently missed my points though.
> safety critical softwares, one will use a certified runtime or no runtime at > all. Also in safety critical applications only a subset of Ada is used (there Q: So, why would a person not use the full Ada in a safety critical application?
A? I assume that some document makes a statement like 'only the following features/environment/capabilities/constructs/whatever are approved for safety critical applications'.
If true, that imposes limits and is equivalent to a disclaimer about using the full capability of Ada in such environments - just not written by lawyers.
(We've used up way too much bandwidth in this non-Ada group. Final word is yours - I hereby refrain from further responses.)
 Signature Hans Forbrich
Pascal Obry - 21 Jun 2005 18:25 GMT > Q: So, why would a person not use the full Ada in a safety critical > application? But this is not a constraint imposed by the Ada vendors. Nobody on earth (I hope so at least) will use full Ada when it comes to human-lives as there is too many constructs that can't be verified/certified. At least that's what I like to think when I'm flying in an Air plane :)
Pascal.
 Signature --|------------------------------------------------------ --| Pascal Obry Team-Ada Member --| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE --|------------------------------------------------------ --| http://www.obry.net --| "The best way to travel is by means of imagination" --| --| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
Björn Persson - 21 Jun 2005 23:59 GMT > [...] and now you > acknowledge that Ada has bugs (at least potentially), but does not have a > disclaimer, and therefore does not make the user aware of *possible* > deficiencies. I see the potential for a lawsuit in any decently litigious > society. In that case I'm pretty sure the United States of America is the one and only "decently litigious" society on this planet.
Do you really, honestly think there is *any* nuclear power plant *anywhere* on the Earth, where the programmers who wrote the software for it didn't already *know* that any program may have bugs?
"The lawnmower didn't have a warning label stating that I shouldn't use it to trim my moustache, so it's the manufacturer's fault that I had my nose cut off!"
 Signature Björn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu
Dmitry A. Kazakov - 22 Jun 2005 08:38 GMT >> [...] and now you >> acknowledge that Ada has bugs (at least potentially), but does not have a [quoted text clipped - 8 lines] > *anywhere* on the Earth, where the programmers who wrote the software > for it didn't already *know* that any program may have bugs? It's no matter whether a product has a defect or not. What matters is who would take the responsibility for the consequences. I wouldn't for any program written in Java if that should work in any hazardous to one's life environment. Neither Sun seeks for such adventures for itself...
 Signature Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de
HansF - 22 Jun 2005 14:31 GMT > What matters is who > would take the responsibility for the consequences. THANK YOU!
 Signature Hans Forbrich
David Alex Lamb - 16 Jun 2005 22:25 GMT >Writing code in ADA 95 and compiling it for the JVM should produce more >reliable code than writing in Java 2. Does anyone know any good technical >reasons for prefering Java? Last time I looked at Ada, its concurrency model was very different from the threads Java uses. Are you sure the JVM can handle all of Ada?
 Signature "Yo' ideas need to be thinked befo' they are say'd" - Ian Lamb, age 3.5 http://www.cs.queensu.ca/~dalamb/ qucis->cs to reply (it's a long story...)
HansF - 16 Jun 2005 22:28 GMT > Writing code in ADA 95 and compiling it for the JVM should produce more > reliable code than writing in Java 2. Does anyone know any good technical > reasons for prefering Java? Both sides of the argument briefly discussed here:
http://www.dwheeler.com/lovelace/s16sf.htm
Mind you, the site that page is on has a number of higher lavel pages written in 1996-1998. Things may have changed somewhat.
Also - looking at the site http://www.adahome.com/, which purports to be the 'Home of Ada', page for one of the two Ada J-class generators listed in the Resources provides a wonder 404, the other still doesn't load (mind you - I use FireFox.)
So the technical reason might be "Cause it don't exist" ???
 Signature Hans Forbrich
Mark Lorenzen - 16 Jun 2005 23:44 GMT > Also - looking at the site http://www.adahome.com/, which purports to be > the 'Home of Ada', page for one of the two Ada J-class generators listed > in the Resources provides a wonder 404, the other still doesn't load > (mind you - I use FireFox.) Don't look at www.adahome.com - it hasn't been maintained for a very, very, long time. Try www.adapower.com instead.
- Mark Lorenzen
HansF - 17 Jun 2005 00:08 GMT > Don't look at www.adahome.com - it hasn't been maintained for a very, > very, long time. I noticed <g>
Georg Bauhaus - 17 Jun 2005 00:26 GMT >>Writing code in ADA 95 and compiling it for the JVM > > So the technical reason might be "Cause it don't exist" ??? Two compiler shops have Ada compilers targetting a JVM, so you might ask them (AdaCore, Aonix). There is also a paper by Tucker Taft explaining how and where Ada and a JVM are a good match. It's called Programming the Internet in Ada 95, IIRC. It may be a bit hard to find online at the moment.
Another article is here: http://libre.act-europe.fr/papers/ada-on-jvm.pdf
-- Georg Bauhaus
Björn Persson - 17 Jun 2005 00:38 GMT > Also - looking at the site http://www.adahome.com/, which purports to be > the 'Home of Ada', page for one of the two Ada J-class generators listed > in the Resources provides a wonder 404, the other still doesn't load > (mind you - I use FireFox.) > > So the technical reason might be "Cause it don't exist" ??? Adahome.com is sadly out of date. Those who want information about Ada can start at http://adaworld.com/ or http://adapower.com/.
As for compiling Ada to Java byte code there is always Jgnat from AdaCore (ftp://cs.nyu.edu/pub/gnat/jgnat/), but it's not being maintained. As I understand it there wasn't enough interest. Apparently Ada programmers prefer compiling to machine code.
 Signature Björn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu
The Wogster - 17 Jun 2005 14:10 GMT > Writing code in ADA 95 and compiling it for the JVM should produce more > reliable code than writing in Java 2. Does anyone know any good technical > reasons for prefering Java? The argument is more like, which language has a more reliable conversation, French or German? Well people have been having conversations in both, for hundreds of years.
For reliability, a far more important aspect is the experience of the one who is writing the code, and what is their background.
Back to our human languages for a minute, suppose you know neither one, if you know Spanish or Italian then you will probably have more luck with French as they are all based on Latin. If you have Austrian or to a lesser degree Dutch, many words and phrases are similar to German, so you will probably have more luck with it.
If your background in programming is C or C++, you will have better luck with Java, as many things are very similar. If you come from a Pascal background you probably would find Ada easier. No programming language is 100% safe, although some like C will provide you enough rope to hang yourself -- realistically C will provide the rope, tree, support, minister, and a handy helper, but that is beside the point.
The biggest issues with reliability are type safety and memory sanity checking. Both languages take care of these reasonably well.
The problem for Ada is that most modern operating systems are written in C and documented in a C style, so most programming students learn C or C++ if nothing else. Mind you, I still think that Pascal is probably the best teaching language for the basics......
W
Martin Dowie - 17 Jun 2005 15:35 GMT > If your background in programming is C or C++, you will have better luck > with Java, as many things are very similar. If you come from a Pascal > background you probably would find Ada easier. I find that Java has C/C++ syntax but is much, much closer to Ada for its semantics.
Cheers
-- Martin
Dale King - 18 Jun 2005 02:42 GMT >> Writing code in ADA 95 and compiling it for the JVM should produce more >> reliable code than writing in Java 2. Does anyone know any good technical [quoted text clipped - 3 lines] > conversation, French or German? Well people have been having > conversations in both, for hundreds of years. Interesting analogy, but it misses the important detail of the compiler. In your analogy of human language it would be like having a proofreader of what you were saying in the languages. In one case the proofreader is much better than the other being much more strict about grammar, making sure that you didn't have run-on sentences and passive voice.
Ada is a much stricter compiler and has much stronger typing (realizing that term means different things to different people). My experience using a similar type of language (Modula-2) is that it is harder to get things to compile because the "proofreader" keeps correcting your sloppy expressions and bad grammar, but when it did compile it was much more likely to be correct when executed.
The problem with translating Ada or other languages to Java is that the JVM lacks certain constructs that are part of other languages. The simplest example would be that Java lacks unsigned numerical types in a size other than 16 bits.
 Signature Dale King
Ted - 19 Jun 2005 13:15 GMT > >> Writing code in ADA 95 and compiling it for the JVM should produce more > >> reliable code than writing in Java 2. Does anyone know any good technical > >> reasons for prefering Java? > > > Ada is a much stricter compiler and has much stronger typing ....it is harder to get
> things to compile ... but when it did compile it was much more > likely to be correct when executed. [quoted text clipped - 3 lines] > simplest example would be that Java lacks unsigned numerical types in a > size other than 16 bits. OK, the JVM has certain limitations one would have to restrict oneself to a subset of ADA. Wouldn't ADA code still be moire reliable than code written in Java 2?
Steve - 18 Jun 2005 04:52 GMT >> Writing code in ADA 95 and compiling it for the JVM should produce more >> reliable code than writing in Java 2. Does anyone know any good technical [quoted text clipped - 6 lines] > For reliability, a far more important aspect is the experience of the one > who is writing the code, and what is their background. So, if I understand what you're saying. There is no point in developing any new tools for sofware development that make programming more efficient or reduce defects, because none of that really matters... It is just programming tools, and they have been around for decades.
I spend a lot of time keeping track of the new tools that become available. I learn advantages and disadvantages of new tools and techniques. I guess I have been wasting my time.
I learned BASIC, FORTRAN, Pascal, and COBOL in school. I guess I was wasting my time when I learned C, C++, Ada, C#, Modula-2, Java, and FORTH.
Realistically, I think it makes sense to do objective research on the use of different programming languages, productivity, and defect rates. It is unfortunate that people often disregard the results if such research and say "it really doesn't matter... it's just preferance". Or it's just like comparing French and German.
Steve (The Duck)
> W
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|