John R. wrote:
On 6/21/06, Sean Conner <spc at conman.org>
wrote:
It was thus said that the Great John R. once
stated:
On 6/21/06, Don Y <dgy at dakotacom.net>
wrote:
Amusingly, *except* for parens, LISP largely does
without punctuation!
Unfortunately, parens are a royal PITA as they require tracking
more state than local punctuation.
And RPN languages like Forth can even do away with parentheses.
However I don't know that you could call Forth "punctuation free" or
even Regular (in the sense of not needing a parser). In general Forth
is processed one word at a time with an ad hoc lexer + smarts. Some
words read ahead in the input stream, and state during parsing is
important.
Well, in Forth, functions are called "words" and + is a word. So is (.
As is @. And !. As well as 0 [1], 1 [1] and 2 [1]. There are only a
few
words (in ANS Forth) that require looking ahead and they're well known.
Most of the words in Forth pull parameters off the stack.
-spc (And one can always rename @ as fetch)
Right. I think Forth is important to look at when considering the
different types of syntax and grammar that has been explored in
computer languages, but since the OP used the term "punctuation" which
is not a computer science term, I wasn't sure what to do with it. I
figured he was really leaning more toward simple languages that have
less structure. If punctuation means +, !, @, :, ; etc. then Forth has
plenty of punctuation. And it has structure since there are words like
" and : that read ahead in the input stream. Yes they are well known,
but they are still there.
I tried to qualify my use of the term "punctuation" (cf. ispunct()).
An easy way of defining it is to think of how you could READ a
line of code to another person over the telephone, unambiguously
WITHOUT THAT PERSON BEING FAMILIAR WITH THE LANGUAGE (i.e. if
he was familiar with the syntax, he would know where parens
were implied, etc.).
So:
A = B + 1
technically has two bits of punctuation but they are semi-intuitive;
one would assume "equals" to mean '=', etc.
OTOH:
A ::= B + 1
Would be read as "A colon colon equals B plus one". So, the colons
here act as nonintuitive punctuation while the '+' does not.
Likewise, ending statements with semicolons, inserting commas,
etc. all qualify as punctuation.
And, parens/braces/brackets are particularly nasty:
"foo open paren bar close paren"