From: | Alex McDonald <blog@rivadpm.com> |
Newsgroups: | comp.compilers |
Date: | Sun, 10 Jun 2012 13:36:21 -0700 (PDT) |
Organization: | Compilers Central |
References: | 12-03-012 12-03-014 12-06-008 12-06-010 12-06-013 12-06-014 |
Keywords: | design |
Posted-Date: | 11 Jun 2012 02:10:57 EDT |
On Jun 7, 1:21 pm, Johann 'Myrkraverk' Oskarsson
<joh...@2ndquadrant.com> wrote:
> Joshua Cranmer <Pidgeo...@verizon.invalid> writes:
[snip]
>
> <><><>
>
> Another point to make. Why do we assign from right to left? Is it in
> any way natural? What's wrong with
>
> a + b --> c "a plus b assigned to c"
>
> instead of
>
> c <-- a + b "c becomes a + b?"
>
> The more I think about it, I believe the former construct is a bit more
> natural since we read from left to right. However, I'd want to see or
> work on a non-trivial project in such a language to make up my mind.
But we already have languages that support
a b + c ! ( stack based, for bang read store )
or
ADD A TO B GIVING C.
I'll let you guess which languages support these constructs.
>
> For an Arabic programming language, all bets are off.
! c + b a
My first example reversed. The arity of the operators make it easy to
parse left to right too; "Store in c the sum of a and b". It would be
a trivial modification to a stack-based compiler to parse right to
left.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.