Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any chess programs using Forth?

Author: Victor Zakharov

Date: 08:28:52 09/20/01

Go up one level in this thread



Here is my opinion that worked with Forth-like systems for a few years. It was
about ten years ago. so things can change thes days.

>I think it is possible to find (or write) a C compiler for this Forth chip.
>
>A few years ago I have created for a commercial company a language which
>resembles Basic. It was composed of a compiler, which produced P-Code, and an
>interpreter, which executed the P-Code.

Writing simple compiler for Forth is not a huge problem. But the problem is that
Forth programming technology is based on implicit parameters passing through
data stack. This way C programming technique will not be reflected to Forth in
optimal way. I can say that simple compiler realization will be far apart from
optimal. Writting compiler that produces optimal code is a large problem.

BTW, writing programs on Forth is not much more complex than writing them on C.
At least it is much easier than making this on x86 assembler. Language is easily
extendable and this makes programming even pleasure (for simple tasks).  But the
problem is in the development and supporting tools. Modern compilers prevent
huge number of bugs. Forth compiler didn't prevent something serious. I should
say that there are much more posibilities in Forth to make a bug as compared
with classic assembler due active using of data stack. Any small bug crushes the
program in a moment. So debugging and making changes is the huge problem.

>Looking at the specs of the Forth chip, I see other problems:
>* 18 bits address bus => 256K words max address space (a little bit more than
>512Kb).

As for program code on Forth it is highly compact if native Forth is used. And
it will not be so if compiler is used. I suspect that any PC  program can be
reduced 10x times if it is written of Forth by experienced Forth programmer.
Numbers seem fantastic, but they are true.
Surely data and hash tables can't be eliminated.

>* the return stack is limited to 16 levels: you would probably have to bypass
>this stack and create your own (or to add expensive logic around the existing
>stack management) to avoid return stack overflows.

This seems to be too high limitation. It is suppoded that nesting in Forth is
higher than in usual programs.

>>  It can be implemented in as little as 2K (!).  Thus, it
>>has found a niche in embedded systems and prototypes.  I believe they are aiming
>>this chip at the embedded market (set-top web boxes).  However, they have to
>>develop all their own software for it.
>>
>>Chuck Moore, the inventor of Forth and these chips, is quite an iconoclast.  He
>>actually wrote his own PC Forth OS and Forth VLSI CAD system to design and
>>simulate these chips.  He can't understand why people buy big bloated operating
>>systems instead of writing their own.  :)
>
>He is a wise guy! :)

I believe that Forth technology is excellent and it surpasses a lot of current
technologies in a lot of things. But industry didn't accept it. So you should
provide yourself with a lot of things to develop Forth programs. And I see no
chance for Forth to survive in future. Too much money is already invested into
other technologies.

Victor



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.