> Message: 1 > Date: Sat, 10 Oct 2009 17:33:37 -0700 > From: "William Tanksley, Jr" <[email protected]> > Subject: Re: [Factor-talk] "Factor Versus Forth" --- the book > To: [email protected] > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1 > > Doug, I see your purpose and appreciate it; I think you explained well > why Factor separates data flow from operators. However, Forth's */ > operator has one additional purpose; it's really merely to be able to > avoid typing a space between star and slash. It's actually a scaling > operator which uses a double-length intermediate result, so that as > long as your final answer fits into a single-length integer, there > will be no overflow. In Forth, at that time, that's a very significant > guarantee. > > Factor doesn't need that; it has other ways to avoid integer overflow.
I agree that Factor is easier to use than Forth in regard to arithmetic, because the programmer doesn't have to worry about integer overflow and other such low-level concerns. On the other hand though, Forth is hella-fast largely because it supports mixed-precision arithmetic. Even in the 1980s when Forth was compiling to threaded code and C was compiling to machine-code, Forth still beat C in speed when used in applications that involved a lot of arithmetic (nowadays most Forth systems compile to machine-code and often beat C on all manner of applications). I said in the book that Factor makes an excellent prototyping language for Forth. The programmer can get a prototype working in Factor, and only concern himself with the integer-overflow issue when he is porting it to Forth for the production version. This is better than trying to write a program from scratch, which involves a lot of high-level thinking, while simultaneously dealing with a lot of low-level issues --- as done in Forth right now. It seems to me that Factor is tied to Forth because you decided to use a Forth-like syntax (rather than a Lisp-like or Java-like syntax) --- and the only reason for using Forth-like syntax was to support Factor/Forth ports. When Factor diverges too far from Forth syntax however, then Factor betrays the very purpose of Factor. Factor can be a super-Forth, that supports dynamic-OOP and garbage-collection and other niceties that Forth doesn't provide (because they would be too slow), but it should still continue to be a Forth. Even if you like Joy, with its DIP and all that, this is immaterial to the main purpose of programming, which is to write hella-fast programs. That is what the customer wants. ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
