Author: Roy Brunjes
Date: 20:31:42 09/19/01
Go up one level in this thread
On September 19, 2001 at 20:29:00, Dann Corbit wrote: >On September 19, 2001 at 20:04:42, Ian Osgood wrote: >[snip] >>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. > >Wirth said it best: >"Algorithms + Data Structures = Programs" > >I've never programmed in Forth, and now that I hear of that "non-trivial" >limitation, let me add that I never will. > >Even assembler has data structures. >[snip] Well, as a former Forth programmer (I do not program at all anymore except the odd Perl program), let me say that Forth does allow for the programmer to build a lexicon (a set of words -- like functions in C) that build upon each other (if you choose) so that complex data structures can be created. Forth as implemented on most PCs about 10 years ago did not have any concept of strings and their associated functions. I built both counted strings (255 bytes max) and null-terminated strings (ala C) in a few short hours. The way most Forth programmers attack this is to create "compiling words" -- extensions of the compiler. This allows the programmer to build an wonderfully rich and sophisticated set of tools that are useful to your particular application domain (in this case, it would likely be chess). Having said all of that ... it takes work to get to that point. Many programmers starting in C would not like to have to code their own routines for libC. Forth, in essense, used to make you do this. I have not touched it in a decade -- I'm certain much has changed since then. All in all though, it is an immensely productive programming environment once you build up your lexicon with the basics you need.
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.