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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,11414a19b0e4a97a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.68.MISMATCH!feeder.news-service.com!newsfeed.straub-nv.de!news.mb-net.net!open-news-network.org!aioe.org!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: Advice on selling Ada to a C shop Date: Thu, 24 Jun 2010 17:25:13 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <101bf8f3-b823-45ee-9afd-40cbafb4b7a9@t26g2000prt.googlegroups.com> <774c25c4-3270-4ffb-ad19-366a0ab16659@i31g2000yqm.googlegroups.com> <4c22669b$0$3623$4d3efbfe@news.sover.net> Reply-To: anon@anon.org NNTP-Posting-Host: rN+PGqTC7d7JjvHzNLG87Q.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news2.google.com comp.lang.ada:12886 Date: 2010-06-24T17:25:13+00:00 List-Id: In , Robert A Duff writes: >"Peter C. Chapin" writes: > >> I wasn't involved in the discussion that lead to the decision to include >> conditional expressions in Ada, but my impression is that they were >> introduced in large measure to make the new pre- and post-conditions more >> expressive. > >Yes, that's a big part of the reason. One use for them is to express >logical implication. ARG considered, and rejected, the idea of >adding an "implies" operator. Instead, you can say something like: > > procedure P (...) with > Pre => (if X > 10 then Y > 10); > >The "else True" is implied here. So it means the same >as what "X > 10 implies Y > 10" would mean if "implies" >were in the language. > >This is not (yet) Ada! It is proposed for Ada 2012. > >> In any case conditional expressions are entirely normal in functional >> languages and widely implemented by such languages. They are not some sort of >> C quirk as you seem to suggest. I'm not suggesting that Ada should become a >> functional language (lambdas, anyone?) but to a person fluent with functional >> programming such expressions are very natural. > >Lambdas should indeed be added to Ada, IMHO, and they have been >discussed by ARG. I forget the status, but I don't think they'll >make it in. We had a lot of trouble coming up with a readable >syntax, for one thing. (And nobody proposed any syntax involving >a "lambda" keyword.) > >But to be a true functional language Ada would need more than that. >Full closures, for example. And those pretty much require >garbage collection. > >- Bob >From a Read Only web site: "Ada - The Project The DoD High Order Language Working Group" William A. Whitaker, Colonel USAF, Retired PO Box 3036, McLean VA 22103 Typo in the quoted work come from the document. "Without exception, the following languages were found by the evaluators to be inappropriate to serve as base languages for a development of the common language: FORTRAN, COBOL, TACPOL, CMS-2, JOVIAL J-73, JOVIAL J-3B, SIMULA 67, ALGOL 60, and CORAL 66." That statement alone shows that Algol had no influence on the design of common language (later named Ada). Later in the paper it states a reason for Algol's dismissal: "There were other common language meta-requirements. For example, the language must be an applications user language. This went against certain academic concepts of a mathematically minimalistic formulation, like ALGOL 68." Since, the designers were against mathematically minimalistic formulation, this suggest that "Lambda" might need to be classified as forbidden fruit as well. Sorry, Robert Duff. But then again "Lambda" might be able to find itself as a separate set of math packages. Especially, if you created the blueprint for Adacore's GNAT. Because it seams like anything that GNAT adds to its design is adopted by the language. Later the "Base" language of the Ada came from the four languages. But since the DoD had a long-term commitment for Fortran and Cobol, the set became: "FORTRAN was significant because that was the successful language - we are still apologizing for FORTRAN features not in Ada (intrinsic math functions (e.g., SQRT, SIN, etc.), interpretive I/O (i.e., with dynamic formatting)), no matter how proper the exclusion; COBOL pioneered validation - made sure we did not allow the subsets that in 1976 made COBOL systems difficult to validate and compare (may be right for COBOL but not for the purposes of Ada) - data handling, and readability; JOVIAL and CORAL were languages of major military users whose experiences made considerable contribution to the requirements; Pascal contributed mostly its syntactic form." Algol did not make the cut! Now, except for "GNAT.Sockets.*" and the outdate "pragma No_Rum_Time" GNAT has side-step the following design concept. "The language must also be "complete" in the sense of the user being able to write all usual programs without having to resort to assembly language or local extensions. It had to have real-time capability and it had to be set up to produce programs for the bare machine in a missile, without support of an operating system. It also was required to support large Command and Control systems, so it had to have a file input/output system, however messy that might be." This paragraph suggest that they should be packages under Ada.* or System.* that would control the hardware such as the Serial (both UART and USB), parallel ports. And all connection types (bus, serial, usb, and parallel, etc) for the keyboard and mouse devices. Plus, it should have routine to control network cards and other standard I/O, such as direct video control and disk while bypassing the OS. But no Ada 83 system every used the RM defined Low_Level_IO package. And in Ada 95 and Ada 2005 there is no packages that are defined in the RM that control any group of hardware directly, bare machine or not. The Ada package mostly just linked to a precompiled library (aka local extensions) that connected to the OS. So, where are these packages? Note: Allowing Ada to be written without using "Local Extension" can mean that Ada needs a "Universal Windows/Graphics" package groups that in one version links to the OS, as well as having another directly control the graphics of a group of common GPU cards. Where is the package or packages, without the programmer using assembly language or the Machine_Code package. Plus, the file system in some case needs to be self-contained without the OS. So where are the System.File_System.* packages like fat, ext2, ext3, etc. ? Or may be a generic package for creating file systems. We needs there package before adding any type of C-Like conditional operators. Now what did the DoD and the Ada creating teams think of C. "Since the developed systems were to be long-lived, maintenance and modification of the software would cost several times as much as initial development. Readability was much more important than writability, a requirement contrary to those advocating the "economy of expression" that leads to incomprehensible C and APL code. Maintainability also argued for rigid interfaces and powerful compiler checking." Being that the team thought C leads to incomprehensible coding. This also include the C-like "Conditional operators"! Like : C: Variable := ? : Ada: Variable := then else As for "powerful compiler checking", GNAT sometimes overdoes the checking even when the programmer turns off all checking. That is, just try to use the statement like "Z := X / 0;" the GNAT compiler will never allow that statement, even if one disable all checking, exceptions and exceptions handlers, the compiler will still block this statement by inserting exception coding at that point. A friend spent a month last year talking to Adacore on this one. As for "rigid interfaces" GNAT could use a few adjustments, like making sure an item can not be altered if the address to that item is passed as an "in" only parameter. like access referenced variables. Example: type String_Record; type String_Access is access all String_Record; type String_Pointer is access all String; type String_Record id record Index : Natural; -- 0 = empty string Value : String_Pointer; end record ; A : Character ; Buffer : String_Access ; function Get ( B : in String_Access ) returns Character ; -- The compiler should make sure that this function -- does not directly alter the "Index" or "Value" in -- the record "String_Record" referenced by Buffer, -- if this routine is written in Ada. ... A := Get ( Buffer ) ;