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-Thread: 103376,3a1c64628a09855b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!b5g2000pri.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Lack of formal syntax undermines Ada Date: Fri, 11 Apr 2008 11:13:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <2147940c-0ae7-4043-8119-d55139d3efa2@b5g2000pri.googlegroups.com> References: <47ff9f76$0$4848$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207937597 6337 127.0.0.1 (11 Apr 2008 18:13:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 11 Apr 2008 18:13:17 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b5g2000pri.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20882 Date: 2008-04-11T11:13:16-07:00 List-Id: On Apr 11, 10:27 am, Georg Bauhaus wrote: > use...@leapheap.co.uk wrote: > > Ada is designed for the construction of high-integrity software > > by validated compilers. Would it not be better to have formal > > Ada lexical and syntactic rules, expressed in regular expression > > and BNF format respectively, even if such rules turn out to be > > not particularly readable? > > How will a syntax that is simple for the parser writer cause > the language to be the best one for the programmer? > In fact Ada was reportedly not designed to make the tool writers > life easier. Tell me about it!! But on the other hand, I don't see parser generators as making life easier for tool writers, either. If you want to do something simple like scan the source and extract a relatively small amount of information about the source, they're fine. For anything more complex than that, I've found that working with tools like YACC can be a pain. It doesn't find the needed information in an order that's easy to work with. > Some of the ambiguity might in part have been caused by > an original requirement,http://archive.adaic.com/docs/reports/steelman/steelman.htm#2 > but I can't tell. The rumor I heard was that they wanted to ensure that programs could be entered on certain ancient keypunch machines. It's a bit ironic, since a recent thread complained that Ada's handling of Unicode and its 23,927,511,320,418 characters could be improved, and the original language requirement wouldn't even let us use the whole ASCII character set. On the other hand, I suppose it's an advantage to keep the character set limited, in order to prevent Ada programs from starting to look like C or Perl or APL or Egyptian hieroglyphics (sometimes all four look about the same to me). > Actually, there have been arguments in favor > of "overloaded parentheses" here because they permit switching > between array access and function call without notice. Only if you don't use array accesses on the left of an assignment, or as an OUT or IN OUT parameter. Actually, I think that's a pretty lame after-the-fact rationalization, given that the original reason for avoiding square brackets had nothing to do with any language design principles. If they had really meant that, they would have also used the same syntax for record components, so that you could switch from that to a function call without notice too---that would have been useful. (Ada 2005's Object.Operation notation gives us some of that, 22 years later.) I'll allow that I've taken advantage of the parenthesis overloading at times; although switching from array accesses to function calls isn't a transparent change, it does save a bit of editing work. -- Adam