Re: [OT] PostLisp, a language experiment

From: John Doty (jpd_at_whispertel.LoseTheH.net)
Date: 03/10/05


Date: Thu, 10 Mar 2005 14:48:54 -0700

Duane Rettig wrote:

> C uses infix, and an implied operator precedence, with parens
> optional unless they must override precedence. This is, in my
> opinion, unnatural for both humans and computers. I give it
> a zero.

The problem with this is that infix notation with precedence is the
result of centuries of intercultural research and negotiation on the
best way to communicate mathematical ideas. Its strength is revealing
the relationships among the elements of an expression in a
human-readable way. It is, however, less good at expressing procedure.

> Forth [I have to plead ignorance as to what technologies have been
> added since 1978, so my score may be too low] uses RPN to match arguments
> to a word by pushing them onto a stack and having them be there when
> the word is invoked. It is the word's responsibility to pop the correct
> number of arguments off, and the calling word's responsibility to push
> the correct number of arguments, so if there is mismatch, the user stack
> will end up either growing or shrinking incorrectly if there is a
> mismatch.

But the reality is that experienced Forth programmers have very little
trouble here. Write short definitions, document stack effect, test
bottom up. Do that, and this sort of mistake is usually trivial to
detect and correct. If you're having trouble with stack errors you're
fighting the language rather than using it.

-jpd



Relevant Pages

  • Re: Mysterious crash in LIBC06B4.DLL
    ... function without trouble, the function completes... ... the instant it tries to return to the calling procedure. ... As expected with stack memory overrun. ...
    (comp.os.os2.programmer.misc)
  • Re: Building my own freestanding start-up and library
    ... magically appears in front of Nate Eldredge: ... for taking the trouble to track down the problem for me, ... you push more values onto the stack, you need to add the number of ... the stack by the caller. ...
    (comp.unix.programmer)
  • Re: current function / sub name ?
    ... I think the trouble I was having ... Use Exceptions - you can get a full call stack... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: systematic debugging of random freeze in debug mode
    ... > even though I found what causes the trouble, Interestingly, I found ... unrelated system code runs on the others. ... switch to it and you'll get correct call stack. ... With sufficient thrust, pigs fly just fine. ...
    (microsoft.public.vc.language)