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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 5b1e799cdb,3ef3e78eacf6f938 X-Google-Attributes: gid5b1e799cdb,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!v36g2000yqv.googlegroups.com!not-for-mail From: tm Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.modula3,comp.lang.pascal.misc,comp.programming Subject: Re: Alternatives to C: ObjectPascal, Eiffel, Ada or Modula-3? Date: Sun, 26 Jul 2009 03:55:52 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <4a6a2335.7649091@news.individual.net> NNTP-Posting-Host: 84.112.82.23 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1248605752 27351 127.0.0.1 (26 Jul 2009 10:55:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 26 Jul 2009 10:55:52 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: v36g2000yqv.googlegroups.com; posting-host=84.112.82.23; posting-account=269_QwoAAADSifhJt6OVa6bEjZR2ZMUB User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.12) Gecko/2009070812 Ubuntu/8.04 (hardy) Firefox/3.0.12,gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.eiffel:431 comp.lang.ada:7361 comp.lang.modula3:114 comp.lang.pascal.misc:312 comp.programming:12052 Date: 2009-07-26T03:55:52-07:00 List-Id: On 25 Jul., 00:29, "bartc" wrote: > "Wolfgang Ehrhardt" > wrote in messagenews:4a6a2335.7649091@news.individual.net... > > > On Fri, 24 Jul 2009 00:26:11 -0700 (PDT), tm > > wrote: > > >>I once met somebody, who wrote the front end of an Ada compiler, and > >>he told me a different story. E.g.: He said that a special function > >>needs to read ahead just to find out the semantic of a parenthesis. > >>In Pascal such read ahead is not necessary. > > > Of course a read ahead is necessary in Pascal (at least in a one-pass > > compiler), otherwise the following would give an error: > > > procedure test (*comment*) (x: integer); > > I think Pascal doesn't need lookahead if it's dealing with symbols rather > than characters. Even with characters only a single character lookahead is > needed. Agree. > Possibly Ada may need to read multiple symbols ahead. > > The Pascal design is elegant but I've done parsers where potentially > thousands of tokens need to be processed after a parenthesis before it knows > exactly what it's dealing with. It's not a problem. The problem is not that it is not doable. The problem is that human readers must also process thousands of tokens to know exactly what is going on. When one symbol tells you, what is going on, reading is easier. Complicated parsing with lookahead is IMHO an indication for hard to read constructs. I think that Wirth had such things in his mind when he compared human and compiler parsing. The rules that make the syntax of Seed7 easier to parse are described here: http://seed7.sourceforge.net/manual/syntax.htm Note that the syntax and semantic (types, overloading, ...) of Seed7 are handled by different parts of the compiler. It is never necessary to look at semantic information (e.g.: The type of an expression) to decide which syntax is allowed. Greetings Thomas Mertes Seed7 Homepage: http://seed7.sourceforge.net Seed7 - The extensible programming language: User defined statements and operators, abstract data types, templates without special syntax, OO with interfaces and multiple dispatch, statically typed, interpreted or compiled, portable, runs under linux/unix/windows.