Prefix, infix and function-call and their implications in embedded language readability

Peng Yu <pengyu.ut@gmail.com>
Wed, 20 Jan 2010 20:53:57 -0800 (PST)

          From comp.compilers

Related articles
Prefix, infix and function-call and their implications in embedded lan pengyu.ut@gmail.com (Peng Yu) (2010-01-20)
Re: Prefix, infix and function-call and their implications in embedded gah@ugcs.caltech.edu (glen herrmannsfeldt) (2010-01-21)
Re: Prefix, infix and function-call and their implications in embedded herron.philip@googlemail.com (Philip Herron) (2010-01-21)
Re: Prefix, infix and function-call and their implications in embedded kkylheku@gmail.com (Kaz Kylheku) (2010-01-21)
Re: Prefix, infix and function-call and their implications in embedded bartc@freeuk.com (bartc) (2010-01-21)
Re: Prefix, infix and function-call and their implications in embedded monnier@iro.umontreal.ca (Stefan Monnier) (2010-01-25)
| List of all articles for this month |

From: Peng Yu <pengyu.ut@gmail.com>
Newsgroups: comp.compilers
Date: Wed, 20 Jan 2010 20:53:57 -0800 (PST)
Organization: Compilers Central
Keywords: syntax, design, question
Posted-Date: 21 Jan 2010 01:02:27 EST

Consider the following three expressions, which are valid C, mit-
scheme and Mathematica expressions. There are of course many other
expressions that express the same thing in other languages, or in the
same language but other different ways.


3+2*5>7
(> (+ 3 (* 2 5)) 7)
Greater[Plus[3,Times[2,5]],7]


Apparently, at least to me, the first expression is the most readable.
One possible reason is that we learn this algebraic notation much
earlier than the other two, which is in analogy to that we can respond
to the native language (say, English) much faster than to a second
language (say, French).


Readability affects the programmer productivity. Since embedded
language can be embedded in a computer language, such scheme and C++,
the choice of prefix, infix and function-call can profound affect the
readability of the embedded language. I haven't found any previous
references on this issue. Could somebody recommend me some if there
are?
[I suspect it's like underwear, you like what you're used to, and you can't
really do meaningful comparisons because everyone already is familiar with
something. -John]



Post a followup to this message

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