Should Forth be cleaned up?
  Home FAQ Contact Sign in
comp.lang.forth only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.forth Profile…
 Up
Should Forth be cleaned up?         


Author: Andreas Kochenburger
Date: Jan 16, 2007 06:56

Forth is "littered" with words that belong more to a macro assembler
than into a generic programming language. Eg. CMOVE>, UNLOOP, C",
CS-PICK/ROLL, (LOCAL) et cetera. Some of them prescribe one certain
implementation method, some of them are there for historic reasons.

Which other programming language specifies a software-relict like
UNLOOP? It is even in the CORE wordset!

Can/should Forth be "cleaned" from such ballast?

Andreas
-------
Although the moon is smaller than the earth, it is farther away.
230 Comments
Re: Should Forth be cleaned up?         


Author: Andrew Haley
Date: Jan 16, 2007 07:21

Andreas Kochenburger nospam.com> wrote:
> Forth is "littered" with words that belong more to a macro assembler
> than into a generic programming language. Eg. CMOVE>, UNLOOP, C",
> CS-PICK/ROLL, (LOCAL) et cetera. Some of them prescribe one certain
> implementation method, some of them are there for historic reasons.
> Which other programming language specifies a software-relict like
> UNLOOP? It is even in the CORE wordset!
> Can/should Forth be "cleaned" from such ballast?

What is your problem with UNLOOP? I'm baffled.

Andrew.
1 Comment
Re: Should Forth be cleaned up?         


Author: Bruce McFarling
Date: Jan 16, 2007 07:26

Andreas Kochenburger wrote:
> Forth is "littered" with words that belong more to a macro assembler
> than into a generic programming language. Eg. CMOVE>, UNLOOP, C",
> CS-PICK/ROLL, (LOCAL) et cetera. Some of them prescribe one certain
> implementation method, some of them are there for historic reasons.
> Which other programming language specifies a software-relict like
> UNLOOP? It is even in the CORE wordset!
> Can/should Forth be "cleaned" from such ballast?

On the above ... C" possibly, as part of the general cleaning up that
can follow from PARSE-NAME ... however as soon as I say that, I expect
someone to have the reaction that I have to some of the rest of what is
referred to as "ballast".

What's the matter with CMOVE> ... unless your idea is to replace it
with an address-unit move-from-back-to-front, MOVE> ... but even then,
strings of character data are one of the things that are most commonly
slid up to make room for an inserted substring.

CS-PICK/ROLL *is* generic macro assembler that frees ANS Forth from
dependence on a specific implementation method ... labelling them as
"ballast" and tossing them out makes the language less generic.
Show full article (1.40Kb)
75 Comments
Re: Should Forth be cleaned up?         


Author: m-coughlin
Date: Jan 16, 2007 08:09

Andreas Kochenburger wrote:
>
> Forth is "littered" with words that belong more to a macro
> assembler than into a generic programming language.
> Eg. CMOVE>, UNLOOP, C", CS-PICK/ROLL, (LOCAL) et cetera.
> Some of them prescribe one certain implementation method,
> some of them are there for historic reasons.
>
> Which other programming language specifies a software-relict
> like UNLOOP? It is even in the CORE wordset!
>
> Can/should Forth be "cleaned" from such ballast?

Yes, definitely. Unfortunately the reason there are words in
Forth that one person finds useless is because someone else put
them there to clean up the previous versions of Forth. Forth has
words that belong to a macro assembler because Forth is a macro
assembler, as well as being an interactive debugger. If you only
want to use Forth as a high level language, then it is not Forth
anymore. Rewrite it and pick a new name.
Show full article (1.83Kb)
1 Comment
Re: Should Forth be cleaned up?         


Author: Andreas Kochenburger
Date: Jan 16, 2007 08:06

On Tue, 16 Jan 2007 15:21:25 -0000, Andrew Haley
wrote:
>What is your problem with UNLOOP? I'm baffled.

For an assembler programmer it is natural and clear.

From a higher level it is a burden. Even C (which is a rather
low-level language imo) offers break; continue; or even return; to
exit a for() loop without burdening loop parameter management to the
programmer.

I don't see any reason why some fossilized Forth constructs shouldn't
be marked as obsolete.

Sure, such a "Forth300x" would lose some compatibility, but IMO the
core language would become clearer and more streamlined.

Andreas
-------
After a number of decimal places, nobody gives a damn.
no comments
Re: Should Forth be cleaned up?         


Author: John Passaniti
Date: Jan 16, 2007 08:27

Andreas Kochenburger wrote:
> Can/should Forth be "cleaned" from such ballast?

No. Those words exist to support the infrastructure that higher-level
words are built on. Eliminate them, and you eliminate (some) of the
reason why Forth is attractive-- access to the lowest levels of the
language.

If the issue is that when you type WORDS you see a lot of "noise" words
that aren't immediately useful to you, then what you want is to limit
the scope. Defining those low-level words in different wordlists might
be one solution. A better solution might be an extension to the
dictionary that allows arbitrary attributes to be associated with
definitions (as is the case in a number of other languages). Low-level
words that aren't likely to be useful to a high-level application
developer could be attributed as "system".
2 Comments
Re: Should Forth be cleaned up?         


Author: jmdrake_98
Date: Jan 16, 2007 08:44

Bruce McFarling wrote:
> What's the matter with CMOVE>

Nothing...and everything. Nothing in that it does serve a very usefull
purpose. It's a fast way to move charecter strings around and it's
good that it's in the standard because that means it will likely be
optimized.

The bad thing that the "string" wordset in ANS only has low
level words like CMOVE> in it.

http://www.taygeta.com/forth/dpans17.htm

People usually don't work at that level. Just look at Marcel's
"pico IRC" code. There are quite a few COMUS string manipulation
words in there as well as some words he (apparently) made up
on his own. Thankfully the COMUS words are documented
in ANS Forth making them portable.

http://www.albany.net/~hello/comus.htm#,%%22
Show full article (1.21Kb)
no comments
Re: Should Forth be cleaned up?         


Author: Andreas Kochenburger
Date: Jan 16, 2007 08:50

C" prescribes the string storage method. This is limiting. Is "string"
really too daring? Mark C" and S" as obsolete, replace S" by ".
CMOVE and CMOVE> behave differently, old assembler trick programmers
like it. Most users don't.
A CFS is *one* way to manage control flows. Other ways are not worse.
So why mandating it as standard?
(LOCAL) is an over-standardization. It is useful _only_ for Forth
implementors, not for users - a historic foul compromise between
different locals syntaxes. Should be tossed out.

I mentioned the above words only as examples.

Sure, it is a pastime discussion. But I'd really like to see a
rejuvenated Forth some day.

Andreas
-------
After a number of decimal places, nobody gives a damn.
74 Comments
Re: Should Forth be cleaned up?         


Author: Chuck Adams
Date: Jan 16, 2007 09:58

On Jan 16, 8:50 am, Andreas Kochenburger nospam.com> wrote:
> Sure, it is a pastime discussion. But I'd really like to see a
> rejuvenated Forth some day.

http://factorcode.org - I think what you're looking for is there.

Certainly some things need to be *added* to a future standard, but C"
is about the only thing I can agree with taking out, because virtually
everything uses the S" format anyway. As for everything else, well,
taking the assembler nature out of ANS forth is like taking pointers
out of C.
1 Comment
Re: Should Forth be cleaned up?         


Author: rickman
Date: Jan 16, 2007 10:55

Andrew Haley wrote:
> Andreas Kochenburger nospam.com> wrote:
>> On Tue, 16 Jan 2007 16:37:11 -0000, Andrew Haley
>> wrote:
>>>So what? C doesn't have SWAP, either. This is one of the many ways
>>>in which Forth is different from other langauges.
>
>> That was not my point. Using stacks to pass parameters is fundamental.
>
>>> What would you prefer instead of UNLOOP? Compiler magic?
>
>> Yes. ;-)
>
> The fact that Forth may be simply implemented without such compiler
> magic is also fundamental.
>
> It's a common belief that stacks are the key idea behind Forth, but I
> don't think so. Moore wanted a simple and small system without
> complex compilers and interpreters, and he discovered that by using a
> dictionary and a stack he could dispense with almost all of the ...
Show full article (2.80Kb)
2 Comments
1 2 3 4 5 6 7 8 9