Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #4746

Re: Forth Performance Question

From Julian Fondren <ayrnieu@gmail.com>
Newsgroups comp.lang.forth
Subject Re: Forth Performance Question
Date 2011-08-11 13:18 -0500
Organization A noiseless patient Spider
Message-ID <868vqz95gx.fsf@gmail.com> (permalink)
References <f0fc528e-2fdb-42af-a66d-976ebfa73b88@c8g2000prn.googlegroups.com> <j1udl9$el4$1@dont-email.me> <86zkjhjes4.fsf@gmail.com> <j20r39$edu$1@dont-email.me>

Show all headers | View raw


Arnold Doray <thinksquared@gmail.com> 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.

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Forth Performance Question TS <thinksquared@gmail.com> - 2011-08-06 20:43 -0700
  Re: Forth Performance Question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-08-07 01:02 -0400
    Re: Forth Performance Question Chris Hinsley <chris.hinsley@gmail.com> - 2011-08-16 12:09 +0100
      Re: Forth Performance Question stephenXXX@mpeforth.com (Stephen Pelc) - 2011-08-16 14:08 +0000
  Re: Forth Performance Question mhx@iae.nl (Marcel Hendrix) - 2011-08-07 07:45 +0200
    Re: Forth Performance Question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-08-07 16:18 +0000
  Re: Forth Performance Question Bruno Gauthier <bgauthier@free.fr> - 2011-08-07 07:53 +0200
  Re: Forth Performance Question Julian Fondren <ayrnieu@gmail.com> - 2011-08-07 01:01 -0500
  Re: Forth Performance Question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-08-07 12:50 +0000
  Re: Forth Performance Question stephenXXX@mpeforth.com (Stephen Pelc) - 2011-08-07 11:46 +0000
  Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-10 17:03 +0000
    Re: Forth Performance Question Julian Fondren <ayrnieu@gmail.com> - 2011-08-10 13:35 -0500
      Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-11 15:05 +0000
        Re: Forth Performance Question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-08-11 16:26 +0000
          Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-12 08:15 +0000
            Re: Forth Performance Question "Elizabeth D. Rather" <erather@forth.com> - 2011-08-11 22:29 -1000
              Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-12 10:09 +0000
                Re: Forth Performance Question Julian Fondren <ayrnieu@gmail.com> - 2011-08-12 08:15 -0500
            Re: Forth Performance Question anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2011-08-12 09:31 +0000
        Re: Forth Performance Question crc <charles.childers@gmail.com> - 2011-08-11 10:27 -0700
        Re: Forth Performance Question Julian Fondren <ayrnieu@gmail.com> - 2011-08-11 13:18 -0500
        Re: Forth Performance Question "Elizabeth D. Rather" <erather@forth.com> - 2011-08-11 12:00 -1000
          Re: Forth Performance Question Howerd <howerdo@yahoo.co.uk> - 2011-08-11 15:13 -0700
          Re: Forth Performance Question Charles Childers <crc_nospam@retroforth.org> - 2011-08-11 20:52 -0400
          Re: Forth Performance Question "Rod Pemberton" <do_not_have@noavailemail.cmm> - 2011-08-12 02:19 -0400
            Re: Forth Performance Question Julian Fondren <ayrnieu@gmail.com> - 2011-08-12 02:10 -0500
              Re: Forth Performance Question "Elizabeth D. Rather" <erather@forth.com> - 2011-08-11 21:48 -1000
            Re: Forth Performance Question "Elizabeth D. Rather" <erather@forth.com> - 2011-08-11 21:41 -1000
          Re: Forth Performance Question Hugh Aguilar <hughaguilar96@yahoo.com> - 2011-08-23 18:52 -0700
    Re: Forth Performance Question Charles Childers <crc_nospam@retroforth.org> - 2011-08-10 23:33 -0400
      Re: Forth Performance Question Ron Aaron <rambamist@gmail.com> - 2011-08-11 08:59 +0300
      Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-11 13:48 +0000
        Re: Forth Performance Question Charles Childers <crc@retroforth.org> - 2011-08-11 10:30 -0400
    Re: Forth Performance Question Ron Aaron <rambamist@gmail.com> - 2011-08-11 08:46 +0300
    Re: Forth Performance Question arc <arc@vorsicht-bissig.de> - 2011-08-12 12:20 +0000
      Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-12 13:59 +0000
        Re: Forth Performance Question stephenXXX@mpeforth.com (Stephen Pelc) - 2011-08-12 15:11 +0000
          Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-12 17:49 +0000
            Re: Forth Performance Question stephenXXX@mpeforth.com (Stephen Pelc) - 2011-08-12 19:38 +0000
            Re: Forth Performance Question "Elizabeth D. Rather" <erather@forth.com> - 2011-08-12 12:41 -1000
              Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-13 03:35 +0000
                Re: Forth Performance Question "Elizabeth D. Rather" <erather@forth.com> - 2011-08-12 17:52 -1000
                Re: Forth Performance Question Paul Rubin <no.email@nospam.invalid> - 2011-08-12 23:55 -0700
                Re: Forth Performance Question Albert van der Horst <albert@spenarnc.xs4all.nl> - 2011-08-14 09:01 +0000
                Re: Forth Performance Question Paul Rubin <no.email@nospam.invalid> - 2011-08-14 01:36 -0700
                Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-15 01:43 +0000
                Re: Forth Performance Question Hugh Aguilar <hughaguilar96@yahoo.com> - 2011-08-15 16:59 -0700
                Re: Forth Performance Question Mark Wills <markrobertwills@yahoo.co.uk> - 2011-08-16 03:25 -0700
                Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-16 11:22 +0000
                Re: Forth Performance Question Hugh Aguilar <hughaguilar96@yahoo.com> - 2011-08-16 14:37 -0700
                Re: Forth Performance Question Arnold Doray <thinksquared@gmail.com> - 2011-08-19 14:11 +0000
                Re: Forth Performance Question Hugh Aguilar <hughaguilar96@yahoo.com> - 2011-08-22 19:52 -0700
            Re: Forth Performance Question Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2011-08-13 02:28 +0200
        Re: Forth Performance Question Zbiggy <zbigniew2011REMOVE@gmail.REMOVE.com> - 2011-08-12 20:53 +0200

csiph-web