Re: Have we reached the asymptotic plateau of innovation in programming language design?

torbenm@diku.dk (Torben Ęgidius Mogensen)
Wed, 21 Mar 2012 11:53:35 +0100

          From comp.compilers

Related articles
[23 earlier articles]
Re: Have we reached the asymptotic plateau of innovation in programmin cr88192@hotmail.com (BGB) (2012-03-15)
Re: Have we reached the asymptotic plateau of innovation in programmin federation2005@netzero.com (Rock Brentwood) (2012-03-17)
Re: Have we reached the asymptotic plateau of innovation in programmin cr88192@hotmail.com (BGB) (2012-03-18)
Re: Have we reached the asymptotic plateau of innovation in programmin mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2012-03-18)
Re: Have we reached the asymptotic plateau of innovation in programmin genew@ocis.net (Gene Wirchenko) (2012-03-19)
Re: Have we reached the asymptotic plateau of innovation in programmin eijkhout@tacc.utexas.edu (2012-03-19)
Re: Have we reached the asymptotic plateau of innovation in programmin torbenm@diku.dk (2012-03-21)
Re: Have we reached the asymptotic plateau of innovation in programmin mailbox@dmitry-kazakov.de (Dmitry A. Kazakov) (2012-03-22)
Re: Have we reached the asymptotic plateau of innovation in programmin jgk@panix.com (2012-03-23)
Re: Have we reached the asymptotic plateau of innovation in programmin johann@2ndquadrant.com (Johann 'Myrkraverk' Oskarsson) (2012-06-06)
Re: Have we reached the asymptotic plateau of innovation in programmin gah@ugcs.caltech.edu (glen herrmannsfeldt) (2012-06-06)
Re: Have we reached the asymptotic plateau of innovation in programmin bc@freeuk.com (BartC) (2012-06-07)
Re: Have we reached the asymptotic plateau of innovation in programmin robin51@dodo.com.au (robin) (2012-06-08)
[18 later articles]
| List of all articles for this month |

From: torbenm@diku.dk (Torben Ęgidius Mogensen)
Newsgroups: comp.compilers
Date: Wed, 21 Mar 2012 11:53:35 +0100
Organization: SunSITE.dk - Supporting Open source
References: 12-03-012 12-03-013 12-03-038 12-03-046
Keywords: design, history
Posted-Date: 22 Mar 2012 14:40:15 EDT

Gene Wirchenko <genew@ocis.net> writes:


> On Wed, 14 Mar 2012 09:51:31 +0100, torbenm@diku.dk (Torben Fgidius
> Mogensen) wrote:
>
>>But intuitive syntax can also mean consistent, unambiguous and without
>>arbitrary restrictions, which certainly does not apply to C-style
>>syntax. In a way, APL syntax is very intuitive: Operators are single
>>characters, so you dont have problems parsing things like a+++b, where
>>it is not clear where one operator ends and the next begins, evaluation
>
> Greedy parsing. Fornm the longest token. That is
> a ++ + b


Indeed. But that requires knowledge of lexing/parsing methods, so it
is confusing to a newbie programmer, and even some not-so-newbie
programmers can get confused. A programming language should primarily
be easy to read (parse) by a human reader and only secondarily be easy
to parse by a computer. Ambiguity is a problem for both, but long
lookahead is usually not a problem for human readers, but may
challenge some parsing methods. Having a huge hierarchy of operator
precedences is no problem for most parsing methods (certainly not
LR-based methods), but it can make programs hard to read for humans.
C++ has (IMO) gone over the top with the number of predefined
operators and precedence levels.


Most programmers have no problem with the four arithmetic operators, and
can fairly easily also remember the precedences of comparison operators
and logical connectives. So an idea (employed by, IIRC, OCaml) is to
let operators have a precedence that is determined by their first
character. So +. has the same precedence as + and so on. That is a
fairly neat idea, and by allowing all combinations of characters from a
subset of the non-alphanumeric characters in operator names, you also
avoid C's problem of parsing +++: It is parsed as a single operator, and
if it is not defined in the program, that is reported as an error.


Torben


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.