From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca0b11ae1c9a00cb X-Google-Attributes: gid103376,public From: Markus Kuhn Subject: Re: Papers saying Ada as an overly complex language and hard to implement Date: 1998/02/20 Message-ID: <34ED7AF9.20955F29@cl.cam.ac.uk>#1/1 X-Deja-AN: 326917006 Content-Transfer-Encoding: 7bit References: <34E7B551.115C289F@cs.utexas.edu> <34E8AA02.7ED447E0@cs.utexas.edu> <34E91572.CE9CEED2@cs.utexas.edu> <34EB634F.2EDF9B80@cs.utexas.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Cambridge University, Computer Laboratory Newsgroups: comp.lang.ada Date: 1998-02-20T00:00:00+00:00 List-Id: Yongxiang Gao wrote: > Actually, Ada is described as a complex language in a lot of places. However, most > of them just address one or two words, so that they are worthless for me. The notion that Ada is a "too complex" language is -- although unfortunately still widely believed among people who never used the language -- based on a few historic misconceptions: - Ada was the first modern language for which a formal ANSI/ISO standard (the reference model) was widely published before good tutorials and free compilers where available. We now know that reading a language reference manual is a very bad way of getting a first impression of a language (just try to learn Java or C++ from the RM!). But in the early days, people compared the readability of the very formally written Ada83 specification with the very informally written and incomplete tutorials by Wirth and K&R about their languages (Pascal and C). Of course Ada seemed to be much more complex. Once you have read both the Ada95 standard and the C++ draft standard, I am sure you will agree that Ada95 is in no way more difficult to learn and implement than C++. - Ada has some features that look complicated at first when you learn the language, but you have to realize that these features add a lot to the safety of the language. For instance, Ada has the following more complex mechanism that are much simpler in C/C++ but are much safer in Ada: - Much more sophisticated pointers that make dangling references and memory leaks much more unlikely. - Sophisticated arrays (slices, aggregates) make the dangerous memcpy/memfil/memcmp mechanisms of C unnecessary that escape proper type checking. - Ada has many features that make it easier to write code for which certain properties can quickly be proofen formally. For instance the simple fact that "for" loop variables are inside the block constants guarantees that Ada "for" loops always terminate (unless you do messy "unchecked" things which can easily be spotted and are extremely rarely necessary). Writing verifyably correct C/C++ code is a many orders of magnitutes more complex task than writing verifyably correct Ada code. Therefore Ada won rather quickly the markets of safety and security critical applications where code inspection costs much more than code development. Most of the negative press that Ada got before 1995 (before Ada was revised into the modern 1995 version and before GNAT was available) should be considered completely out-of-date today! Ada95 is is a modern state-of-the-art language for large scale universal application software engineering. With some restrictions, the same applies for Java. The Java vs. Ada view of the industry is strongly biased by the enormous marketing hype that has been created for Java in the context of being a Web language. C is becoming a rather old language and seems to slowly join Fortran and Cobol as old-fashioned but never dieing languages. C++ suffers fundamentally from all the problems of C and is only interesting because Microsoft supports it well. If you look at a high-quality production language in 1998, Java and Ada95 are the ones you should consider. The advantage of Ada over Java is that Ada is not designed for the byte code interpretation model. Ada software therefore executes more efficiently and Ada in contrast to Java has excellent facilities for low-level system programming (e.g., for writing device drivers) and for interfacing with other programming languages (especially C, which is important because of all the excellent C libraries and the many C APIs out there). I've been using C intensively for over eight years now and I have had some experience with both C++ and Java. I am now moving to Ada95, and so far it has been a lot of fun and a good experience. I love C, but I am well aware of its problems, which can be a real pain in large or safety critical applications. I am uncomfortable with C++ and I think it is fair to describe it more as a object-oriented luxury assembler and not as a modern high-level programming language. Java is a neat modern state-of-the-art language, as is Ada95. Ada95 is in some ways less restricted than Java and certainly better suited for low-level and system programming as well as for safety critical systems. Just my private experience, feel free to forward it to your boss ... Markus -- Markus G. Kuhn, Security Group, Computer Lab, Cambridge University, UK email: mkuhn at acm.org, home page: