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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fc6f9338f3a892fe X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.online.be!newsfeed.wirehub.nl!news2.euro.net!transit.news.xs4all.nl!195.241.76.212.MISMATCH!tiscali!transit1.news.tiscali.nl!dreader2.news.tiscali.nl!not-for-mail Sender: lbrenta@deuteronomy Newsgroups: comp.lang.ada Subject: Re: A couple of questions References: From: Ludovic Brenta Date: 01 May 2004 18:04:01 +0200 Message-ID: <87oep86sni.fsf@insalien.org> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tiscali bv NNTP-Posting-Date: 01 May 2004 18:02:18 CEST NNTP-Posting-Host: 83.134.237.105 X-Trace: 1083427338 dreader2.news.tiscali.nl 41765 83.134.237.105:37675 X-Complaints-To: abuse@tiscali.nl Xref: controlnews3.google.com comp.lang.ada:167 Date: 2004-05-01T18:02:18+02:00 List-Id: "Yeric" writes: > How well does ADA interface with other languages ? The Ada standard contains ways to interface to C, FORTRAN and COBOL. If you can interface to C, you can interface to pretty much any language. The Ada capabilities for this are very good, and standard. On Windows it is possible to load DLLs written in almost any language (even Visual BASIC) from Ada, or to produce Ada DLLs that can be used from other languages. > I know it has capabilities to interface with ADO through COM, what about > .NET, Can ADA do this now, are there any plans for the future ? Yes. There is an A# project here: http://www.usafa.af.mil/dfcs/bios/mcc_html/a_sharp.html > I also read that ADA is reviewd every 10 years, so does this mean the > language is going to change/enhance in any way for 2005 ? Yes indeed. The next ISO standard is expected in Dec 2005. For more details, see http://www.ada-auth.org. > One thing that makes me feel a bit uneasy about adopting ADA is that > there seems to be very little activity on web pages for it, and the > ADA FAQ is dated 1997, even some projects that are good now have not > changed in over a year. > > Is this becuase the software is so reliable it does not need to be > changed ? In many cases, yes. There are also many high-profile companies that use Ada but don't advertise it. Ada shines in long-lived, real-time, embedded and safety-critical software, and some people get the misconception that it is good only in those niches. This is not true; Ada is very good for general-purpose programming. The issue of tha FAQ dating back to 1997 was raised on this newsgroup recently. Perhaps someone will volunteer to adopt it. > To be fair though this is also the same for a couple of other > languages I have looked at, I guess I am used to seeing updates for > C/C++ programs mainly bug fixes :) Yes. If you look at the constant stream of patches for popular software, you will see that most of it deals with bug fixes that any conforming Ada compiler would have caught at compile time. This is in particular the case for most buffer overflows, integer overflows, and associated security holes. > How would ADA handle incorrect data types being input apart from > exception handling or lots of messy if then statements ? I'm not sure what you mean by "incorrect data types being input". Ada is a statically-typed language; this means that all type checks are done at compile time. Now if you mean checking that values received from various inputs belong to certain data types, the checks depend on the particular application at hand. Ada provides several tools to help write those checks (e.g. "in", "'Value", "'Valid"). Exceptions, of course, are one such tool. > I would very much like to know any thoughts advantages/disadvantes > of ADA compared to another language, but I dare not mention the > other languages name to avoid being called a TROLL or starting a > debate of this language is better than that, like a similar post I > noted about OO operating systems. Ada is good for your mental health and for your productivity. If helps reduce stress by reducing the number of bugs you write. You can also mention other languages here; but Java, C and C++ are especially prone to attracting flame. Other languages like Pascal, Eiffel or Modula-3 are well respected here. > I guess the only way I could really know is to use them both and > decide from there, however learning one language is time consuming > but two will be near impossible. I have learned and used 12 languages so far, so do not despair. I think your idea of writing programs in several languages and compare the outcome is The Right Way. > It is interesting to see that ADA supports range checking, but how > about data type checking, does range checking preclude the need for > exception handling for a number too large being entered ? Most of the time, yes, the compiler eliminates run-time checks because it can statically prove that no exception will ever be raised. In other cases such as user or file input, the compiler does insert run-time checks which can raise Consraint_Error at run time. > I guess design by contract could be handled using lots of if then > statements and carefully crafted exception handling statements ? Ada already provides some support for Design by Contract. The things it does not provide are some complex Preconditions, Post-conditions, and Invariants. It is possible to program all of these, of course, possibly using exceptions. GNAT provides an extension to the language called pragma Assert. You can use it at the beginning and end of each subprogram to do design by contract at run time. With one compiler option, you can enable and disable all these checks. There is also SPARK[1], an annotated subset of Ada with tools that do full design by contract at compile time. The SPARK tools look at specially formatted comments that you add to your source code. These comments provide for pre- and postconditions as well as invariants. [1] http://www.sparkada.com > Can ADA interface with OpenGL ? have any games been written in > ADA/would ADA be suited for games programming ? Yes. See adaopengl at http://adaopengl.sourceforge.net. > Are there any GUI designers available for ADA like in VB? even if > this is just designing them and compiling as a resource or exporting > as ADA code ? Yes. You can write GTK+ programs on various platforms using GtkAda[1]. The GLADE[2] GUI designer produces XML files that describe the GUI. GtkAda can load these files at runtime using libglade, and also provides gate, a program that generates Ada source code from the GLADE XML files. [1] http://libre.act-europe.fr/GtkAda [2] http://glade.gnome.org There are also non-free GUI designers for Windows. One comes with CLAW[3]. [3] http://www.rrsoftware.com/html/prodinf/claw/claw.htm > I have seen a couple of Commercial products for ADA Gnat Pro and > GPS, but there are no published prices for this software. > > This menas that either they cost thousands or tens of thousands of > pounds or they are only availble as customised products, and > dependent on what your requiremnts are depends how much it will > cost. Both GNAT and GPS are free software; you can download them at no cost, with source code, from Ada Core Technologies' web site. See http://libre.act-europe.fr. The commercial versions are more recent and come with support contracts. They are used mostly by the aerospace or other high-profile industries. As you suspect, the support contracts are not for the individual developer. > While learning ADA I am more than happy with ADAGide and Gnat, and > Gwindows :) Good. You can use GPS too. > I have bookmarked ADApower.com, any other web sites that may be of > interest ? Yes: http://www.adaic.org http://www.adaworld.com http://www.ada-auth.org http://www.ada-france.org http://www.ada-belgium.org PS. I don't know if others told you before, but it is Ada not ADA; see http://www.adaic.org/AdaWho/byron.html for an explanation why. -- Ludovic Brenta.