Xref: utzoo comp.sys.amiga:49744 comp.sys.amiga.tech:9965 comp.lang.forth:2172 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!swrinde!emory!mephisto!mcnc!rti!sas!bts From: bts@sas.UUCP (Brian T. Schellenberger) Newsgroups: comp.sys.amiga,comp.sys.amiga.tech,comp.lang.forth Subject: Re: Thanks...Amiga Forth quest. answered Message-ID: <1548@sas.UUCP> Date: 13 Feb 90 03:59:37 GMT References: <3178@trantor.harris-atd.com> <1990Feb8.154759.21230@wilbur.uucp> Reply-To: bts@sas.UUCP (Brian T. Schellenberger) Organization: SAS Institute Inc, Cary NC Lines: 46 In article <1990Feb8.154759.21230@wilbur.uucp> scott@wilbur.UUCP (Scott Beckstead) writes: |Forth is extremely fast for an interpreted language but not |quite as fast as most C programs. The difference is admittedly small This is true of MOST FORTH IMPLEMENTATIONS, but not an inherent property of the language. In fact, JForth (which the original artical primarily discussed is not a threaded interpreted (traditional Forth) at all. It compiles each word directly to 68000 assembly (JSR-threaded), *and* it supports in-line expansion of simple words based on the length of the definitions. Thus, it produces code just like a C compiler for it is, in fact, a compiler. It lacks only an optimizer. In Forth, this not all that serious, though; optimizers mostly optimize out common subexpressions (rarely a problem in Forth; this is a real benefit of the stack approach) and other common code (also rarely a problem because of the ease of factoring problems sufficiently. All in all, the difference is likely to be miniscule when comparing C to JForth. Certainly, being able to compile in about 1/100 of the time more than makes up for whatever slight difference there might be. Now, the *other* point, about the paradigm differences is certainly valid. Forth requires a different kind of approach to problems. I think that it is just plain more fun, and certainly better suited to tasks like graphics and user interfaces because of the ability to test as you develop and the ease with which you can re-compile small sections interactively. On the other hand, C code is a lot easier to share. But that's only because it's more popular, and if you were into popularity, you'd have bought a PC, not an Amiga anyway. Right? (Actually, C *is* better [modern C, anyway, like Lattice] for applications which can't easily be verified by testing--eg, low-level stuff that must deal with extreme situations. With C, you can use prototypes and various static, compile-time verification to be sure that you are doing what you thought you were doing.) (Also, if you need to run on more than one machine, C would be my recommendation for almost any application; Forth is, alas and alak, a tower of Babel. Great fun for your own, one-machine stuff but a nightmare to port.) -- -- Brian, the Man from Babble-on. ...!mcnc!rti!sas!bts -- (Brian Schellenberger) "No one will ever write a song called 'Nitro Burning Funny Cars'" -- THE DEAD MILKMEN, "Nitro Burning Funny Cars"