Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Julian Fondren Newsgroups: comp.lang.forth Subject: Re: Forth Performance Question Date: Thu, 11 Aug 2011 13:18:54 -0500 Organization: A noiseless patient Spider Lines: 55 Message-ID: <868vqz95gx.fsf@gmail.com> References: <86zkjhjes4.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="cO8zBIpB9LiP7q+vFZIJrA"; logging-data="30017"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+oQsSYwoXsLsU7dxdkOyjEBYSabHGZxxA=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (windows-nt) Cancel-Lock: sha1:/qTE2O76rQFE/ikzmDVKR+cVA0A= sha1:UOOXOvX3YXdWRM7oJ5VJP8CQL0Q= Xref: x330-a1.tempe.blueboxinc.net comp.lang.forth:4746 Arnold Doray writes: > On Wed, 10 Aug 2011 13:35:23 -0500, Julian Fondren wrote: >> >> Except, you aren't learning Forth. You're learning Retro. You >> wouldn't've mixed up the arguments to DO .. LOOP if you had set out to >> learn Forth; as a suggested barrier to Java programmers, that's just >> absurd. > > Wouldn't learning Scheme help one learn Lisp? ;) IMO, the Retro language > set might be a comfortable introduction to Forth for programmers from a C/ > Java background. 1. No. I have a lot of experience behind this 'no'. 2. Common Lisp is a huge, huge language. Forth is not. Size, like flexibility, is absolutely no excuse for diving into one of the attractive nuisances. > The point of the DO...LOOP example wasn't that I got the arguments mixed > up, but that [it's possible for anyone to mix them up.] This is the case with all positional arguments, with a few exceptions. DO takes positional arguments, so there's the possibility that anyone can mix them up. Likewise your TIMES takes a number and then a block; someone could very well give it a block and then a number. "X is possible." does not imply "X is an actual rather than an imaginary problem.", and neither does "X happened to this guy who's decided not to learn Forth control structures." make a persuasive argument. > (I > am curious -- is there a reason that ANS Forth does it this way?) \ 'reversed' and potentially identical on purpose. : prune ( -- ) 1 #polled @ 1- do \ loop backwards, only over clients i pollfd[] closed? if i lost then -1 +loop ; \ although BOUNDS could be written for either ordering : spaced ( c-addr u -- ) bounds ?do i c@ [char] . = if bl i c! then loop ; \ speaking of C, how common a kind of loop do you think \ for (i = 0; i < provided_number; i++) ... is ? : times ( xt u -- ) 0 ?do dup >r execute R> loop drop ; : spaces ( u -- ) 0 ?do space loop ; > This observation might seem pedantic to an experienced Forther, but it is > hard for a beginner to deal with such "gotchas" at the start. No, it isn't. You aren't a Forth beginner.