Re: [OT] PostLisp, a language experiment
From: Duane Rettig (duane_at_franz.com)
Date: 03/13/05
- Next message: Rainer Joswig: "Re: Common LISP Implementations for Mac OS X?"
- Previous message: Christopher Browne: "Statistics for comp.lang.lisp"
- In reply to: Elizabeth D Rather: "Re: [OT] PostLisp, a language experiment"
- Next in thread: Paul E. Bennett: "Re: [OT] PostLisp, a language experiment"
- Reply: Paul E. Bennett: "Re: [OT] PostLisp, a language experiment"
- Reply: Ed Beroset: "Re: [OT] PostLisp, a language experiment"
- Reply: Elizabeth D Rather: "Re: [OT] PostLisp, a language experiment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Mar 2005 00:50:40 -0800
"Elizabeth D Rather" <eratherXXX@forth.com> writes:
> "Duane Rettig" <duane@franz.com> wrote in message
> news:4ll8szw8p.fsf@franz.com...
>
> > "Paul E. Bennett" <peb@amleth.demon.co.uk> writes:
> >
> ...
> > So which is longer: "DUP *", or "SQUARED"?
> >
> > I count 4 characters in the first (or 5, if you include whitespace)
> > and 7 in the second.
>
> So? Counting characters in the name is utterly unrelated to runtime
> efficiency. A compiled reference to DUP and * might involve two
> calls, and a reference to SQUARED only one, so the latter would be
> shorter. On the other hand, some compilers might compile the
> instructions in line for really low-level primitives like DUP and *,
> so that's maybe not the best example. But my point is that the length
> of the name is really irrelevant to any discussion of efficiency. As
> others have observed, in an embedded system the names might be
> stripped anyway.
Why are we still talking about runtime efficiency? I answered one
article about that, and finished by saying that that was not what we
were talking about. For all of those who answered tangentially, I will
not reply to each post, but let me say here once what my point is,
based on my original conversation with John Doty:
DR: ... the user stack will end up growing or shrinking incorrectly
if there is a mismatch.
JD: ... write short definitions ...
DR: What if I wanted to write longer definitions?
JD: Why, to make your code unreadable?
Originally, my discussion with John Doty was based on stack
mismatch issues, and nothing else. John's answer included a
maxim to write short definitions. But I don't like that maxim,
so I'm asking what I could do in Forth in order not to be
bound by that rule. The responses I've received (as well as my
experiences) lead me to conclude that if I want to write long
definitions, I should not be using Forth. That's alright,
though; I already have a language in which I can write long
definitions without loss of cognitive simplicity.
> > And yet, which is more complex cognitively? If you are an experienced
> > Forther, you might answer the first, because you've seen it so often
> > and it becomes second nature to you (plus it uses standard words that
> > you can trust to do what you expect them to do). But to anyone not quite
> > as familiar with a DUP and * combination, some thought must be put into
> > play as to what occurs on the stack, whereas the very word SQUARED is
> > self-documenting, and becomes the more readable version.
>
> Agreed, that would be a good argument for doing it. And it also
> emphasizes the fact that making smaller components can enhance
> readability.
Correct. But there are times when a large function can indeed be used
without any loss of readability. Table-based code is one such example;
in Lisp a case statement might even span many pages, but to break it
up would not necessarily increase the readability or any reusability.
> > You apparently didn't count your characters very well. You (and other
> > Forthers) are advocating combining common cliches into single words,
> > but when the words are longer than their cliches, do you advocate
> > going back to the cliche? In other words, if John Doty was correct
> > in his advocacy of short definitions to long ones, then DUP * should
> > win, by his standard. That certainly wouldn't be my position. Give
> > me a longer, more descriptive name to call any day, rather than its
> > guts that are short.
>
> As various of us have said, the length of the name(s) is irrelevant
> except in source.
We're talking precisely and only about source. Since there are
apparently no runtime checks for stack mismatches, they are not caught
or introduced at compile-time, but instead they become directly dependent
on source only.
> To me, counting characters in source is one of the
> less important issues in writing efficient code. What John is talking
> about when he says "short" is the number of things to be done, not the
> number of characters needed to describe them.
Yes, but even this gets away from my question about what to do with these
pesky stack mismatches. It is one of the reasons why I did not stop
looking for a better language, even after I had found Forth. At that
time, I was awed by its simplicity and power, including its extensibility.
Now, I work in a language that gives me all that, including stack
safety, and other things as well.
-- Duane Rettig duane@franz.com Franz Inc. http://www.franz.com/ 555 12th St., Suite 1450 http://www.555citycenter.com/ Oakland, Ca. 94607 Phone: (510) 452-2000; Fax: (510) 452-0182
- Next message: Rainer Joswig: "Re: Common LISP Implementations for Mac OS X?"
- Previous message: Christopher Browne: "Statistics for comp.lang.lisp"
- In reply to: Elizabeth D Rather: "Re: [OT] PostLisp, a language experiment"
- Next in thread: Paul E. Bennett: "Re: [OT] PostLisp, a language experiment"
- Reply: Paul E. Bennett: "Re: [OT] PostLisp, a language experiment"
- Reply: Ed Beroset: "Re: [OT] PostLisp, a language experiment"
- Reply: Elizabeth D Rather: "Re: [OT] PostLisp, a language experiment"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|