Author: Ian Osgood
Date: 17:04:42 09/19/01
Go up one level in this thread
On September 19, 2001 at 17:48:15, Christophe Theron wrote: >On September 19, 2001 at 05:02:53, David Blackman wrote: > >>On September 18, 2001 at 13:51:07, Ian Osgood wrote: >> >>>Has anyone run across a chess program written in Forth? I ask because I >>>recently ran across an asynchronous processor design optimized for Forth >>>(designed by the creator of Forth, in fact) which claims 2.4 Bips (or 60 Gips >>>for the 25x parallel version) dissipating only 10mW. >>> >>>Link: http://www.mindspring.com/~chipchuck/25x.html >>> >>>Ian >> >>That particular chip has 384 words DRAM and 128 Words ROM for each processor. A >>strong chess program needs a lot more memory than that, and will spend most of >>its time going to the much slower off-chip ram. Note: this chip is designed to interface with SDRAM with 10ns sequential access times (i.e. as fast as cache memory). In fact, they were having trouble interfacing with DRAM because their chip's signals were too fast! >> Also the 2400 Mips is not quite >>the same as other poeple would count Mips. A forth chip instruction doesn't do >>much. So don't expect this chip to be an unbeatable monster chess machine. I would argue that most any machine instruction doesn't do much. Load and store from registers and memory plus simple arithmetic and tests make up the majority of code in any program. This Forth chip has all of those working at the equivalent of one cycle. I am still curious about its chess performance, but I think it would require a Forth guru to transfer existing chess expertise efficiently to Forth. >As a chess programmer I often wish I had faster instructions at my disposal, >even if they were doing less. Maybe I could adapt to this 27 instructions and >take advantage of the speed. > >384 registers is not so bad when you think about it. At least I know what I >would do with 64 of them, if you see what I mean. Having the chessboard in >registers is a dream for a chess programmer! Together with the 16 levels stack >and the remaining registers, memory accesses would be very sparse. I don't think >that memory bandwidth would be a problem. > >I find the design of this chip very interesting. However it is true that it has >been around for a while (at least the f21 and x18), so if it was as great as it >seems then certainly you would find it at the heart of many handhelds. But it's >not the case. So I wonder what the catch is (the 18 bits address bus and word >length maybe?). The biggest catch is having to think in RPN! Forth is a very simple and compact interpreted language. 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. :) When I saw how deplorable their Forth chess program was (no quiescence, eval is simply material and kings on first rank until the endgame), I started porting TSCP to Forth for fun. What a headache! Migrating from C to Forth is hard; you lose types and structures and local variables and all your C idioms. Forth is a *very* idiomatic language, from what I can tell. Without knowledge of common patterns, efficient Forth looks like so much line noise. Definitely a language for Real Programmers (TM). I thought that a chess program would make a good benchmark for this chip because 1) no floating point required, 2) requires little memory and small word size for a basic engine, and 3) it can give you a real metric, nodes per second, which this asynchronous chip currently lacks, having no clock speed as such. Ian > >>The idea of doing a chess program in Forth doesn't appeal much to me, but it >>certainly should be possible. The best language for a chess program is usually >>the language the programmer knows best. > > >The performance of the existing compilers counts also. C is great for chess >because you can program at the low level, AND with the performances of current >compilers you get very close to the speed of assembly programming (only 1.5 >times slower I guess). > >I would not say the same for Cobol for example. > > > Christophe
This page took 0.01 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.