Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!van-bc!rsoft!mindlink!a684 From: Nick_Janow@mindlink.UUCP (Nick Janow) Newsgroups: comp.robotics Subject: Re: "Easy" way to put "AI" in realtime embedded systems? Message-ID: <5495@mindlink.UUCP> Date: 14 Apr 91 16:26:24 GMT Organization: MIND LINK! - British Columbia, Canada Lines: 60 jm59@prism.gatech.EDU (MILLS,JOHN M.) writes: > I haven't used Forth, but it has some attractive qualities for this: > (1) [SUPPOSED to be] Inherently "clean" for real-time-interrupts, True; Forth is used extensively in real-time applications. > (2) Inherently extensible (but if you "extend" an existing function, > you probably lose the original definition), Nope, you don't have to lose the earlier definition. Forth is extensible in many ways. You can add new data structures and manipulation tools with ease; if your work deals with floating-point vectors, you can extend Forth to handle them. You can change existing definitions if you want to; you could have "+" mean "subtract 5 and multiply by 7" if you _really_ wanted to. :) All it takes is : + 5 - 7 * ; > (3) Inherently recursive, Yes, useful at times. > (4) Assembly-language sources available for several common processors, Yes, there's quite a list. Forth is quite easy to write compilers for and can fit on small (<2kbytes) systems, so it's often used as the first language. All SPARC stations use Forth as their boot core and is available for regular use. There are also several microprocessors that are designed to run Forth. The RTX (real-time express) series and the SC32 are high-performance risc chips that run Forth as native code. These are probably ideal for running AI-Forth software. > (5) Small but [fairly] visible body of experienced users. > I understand that Forth was invented for telescope control in a lab setting, > which sounds like a comparable set of problems viz. hardware driving. Yes, Forth was developed to run hardware and is still one of the best choices for that, especially real-time control. Assembler could give slightly higher performance, but Forth is so much more productive. :) Forth is presently in the process of becoming ANSI-approved. Having this standard Forth will make programs and programmers even more portable than they are now. > (Also, Forth tends to parenthesize, making LISPers feel comfortable: > LISP :: "Lots of Irritating Single Parentheses" M. Waite, _Software for > Non-Numerical Applications_ [8->). Now that I have to disagree with. I chose Forth because it didn't have those irritating parentheses and you didn't have to declare every single variable (tedious). The only thing I use parentheses for is for stack comments (documentation). Contrary to popular misconception, Forth can be quite readable and--depending on the programmer's style--self-documenting. I'm not an expert on AI research, but Forth sounds well-suited for that. Its extensibility, modularity and interactiveness makes it ideal for experimentation. One Forth'er uses it for exploring mathematics, since he can extend the language to with mathematical constructs.