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


Groups > comp.lang.forth > #9796

Re: Valentine Bingo - Comments?

Date 2012-03-02 21:00 -1000
From "Elizabeth D. Rather" <erather@forth.com>
Organization FORTH, Inc.
Newsgroups comp.lang.forth
Subject Re: Valentine Bingo - Comments?
References <jfsgbb$lu6$1@speranza.aioe.org> <jisacq0icb@enews1.newsguy.com>
Message-ID <GvadnStEdYoOXMzSnZ2dnUVZ_vOdnZ2d@supernews.com> (permalink)

Show all headers | View raw


On 3/2/12 7:32 PM, WJ wrote:
> Steve Graham wrote:
>
>>
>> create wordarr
>>      ," Be Mine"
>>      ," Love"
>>      ," It's Love"
>>      ," All Mine"
>>      ," Kiss Me"
>>      ," You&  Me"
>>      ," Awesome"
>>      ," My Baby"
>>      ," Love Me"
>>      ," All Star"
>>      ," My Way"
>>      ," Love You"
>>      ," For You"
>>      ," Cool"
>>      ," I Hope"
>>      ," Love Life"
>>      ," Angel"
>>      ," Sweet Talk"
>>      ," True Love"
>>      ," Be Good"
>>      ," How Nice"
>>      ," Let's Kiss"
>>      ," #1 Fan"
>>      ," Be True"
>>      ," Love Her"
>>      0 ,
>>
>> \ number of phrases
>> 25 constant #wordarr
>
> This is a good example of the extreme primitiveness of ANS
> Forth. An array of strings is created, but the language is
> too brain-dead to be able to count the number of items in
> the array.

If you need to count, it's trivially easy to do:

Variable #strings
: ,"   ( n -- n+1 )   1+  ," ;  / Counting version

create wordarr  0
	," Be Mine"
         ," Love"
         ," It's Love"
/ etc.

#strings !


> So the programmer has to tell ANS Forth how many strings
> there are. (After all, we can't expect ANS Forth to be
> able to do something as taxing as counting to 25.)  Later,
> when the programmer adds to the string list, he has
> to change the constant #wordarr.  It's as
> bad as or worse than assembly language.

Forth is an application-oriented language. It's incredibly easy to 
modify it to do what your app needs, and doesn't burden you with a lot 
of complexity you don't need. If you tend to do the same sorts of apps 
over and over, you develop your own library of application-specific things.

I have never heard a professional programmer complain about this sort of 
adaptation being hard or burdensome. On the contrary, the professional 
Forthers I worked with for 30 years were vastly more productive than 
their peers using other languages.  It's mostly the newbies who get 
culture-shock.

> ANS Forth is designed only to be used for very low-level
> tasks such as programming an embedded controller that
> flushes a toilet.

Hilarious. If only you knew...

> For the bingo job, it would be wise to use a higher-level
> language such as Ruby.

Sure. In fact, as John Passaniti frequently points out, every language 
has a particular target set of applications for which it is best suited. 
Valentine Bingo isn't really the kind of app that Forth is aimed at, 
though it's a cool example of how to do some stuff. I would agree that 
Forth is mainly aimed at embedded systems. But to assume they're all 
idiot simple is plain ignorance.  Most of the electric power grid in 
North America is managed by Forth, to give just one example.

Cheers,
Elizabeth

-- 
==================================================
Elizabeth D. Rather   (US & Canada)   800-55-FORTH
FORTH Inc.                         +1 310.999.6784
5959 West Century Blvd. Suite 700
Los Angeles, CA 90045
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================

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


Thread

Valentine Bingo - Comments? Steve Graham <jsgrahamus@yahoo.com> - 2012-01-26 14:24 -0700
  Re: Valentine Bingo - Comments? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-02-01 23:12 -0800
  Re: Valentine Bingo - Comments? Paul Rubin <no.email@nospam.invalid> - 2012-02-04 21:15 -0800
    Re: Valentine Bingo - Comments? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-02-07 17:59 -0800
    Re: Valentine Bingo - Comments? Steve Graham <jsgrahamus@yahoo.com> - 2012-02-08 07:53 -0700
      Re: Valentine Bingo - Comments? Paul Rubin <no.email@nospam.invalid> - 2012-02-08 10:59 -0800
  Re: Valentine Bingo - Comments? crc <charles.childers@gmail.com> - 2012-02-03 11:35 -0800
  Re: Valentine Bingo - Comments? Steve Graham <jsgrahamus@yahoo.com> - 2012-02-07 07:39 -0700
  Re: Valentine Bingo - Comments? "WJ" <w_a_x_man@yahoo.com> - 2012-03-03 05:32 +0000
    Re: Valentine Bingo - Comments? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-02 21:00 -1000
    Re: Valentine Bingo - Comments? "WJ" <w_a_x_man@yahoo.com> - 2012-03-03 09:21 +0000
      Re: Valentine Bingo - Comments? Paul Rubin <no.email@nospam.invalid> - 2012-03-03 01:26 -0800
        Re: Valentine Bingo - Comments? Josh Grams <josh@qualdan.com> - 2012-03-03 12:52 +0000
          Re: Valentine Bingo - Comments? John Passaniti <john.passaniti@gmail.com> - 2012-03-03 14:08 -0800
            Re: Valentine Bingo - Comments? Paul Rubin <no.email@nospam.invalid> - 2012-03-03 14:41 -0800
              Re: Valentine Bingo - Comments? John Passaniti <john.passaniti@gmail.com> - 2012-03-03 17:39 -0800
                Re: Valentine Bingo - Comments? Paul Rubin <no.email@nospam.invalid> - 2012-03-03 19:18 -0800
                Re: Valentine Bingo - Comments? vandys@vsta.org - 2012-03-05 17:27 +0000
            Re: Valentine Bingo - Comments? "Elizabeth D. Rather" <erather@forth.com> - 2012-03-03 17:51 -1000
            Re: Valentine Bingo - Comments? Josh Grams <josh@qualdan.com> - 2012-03-04 12:29 +0000
              Re: Valentine Bingo - Comments? Rugxulo <rugxulo@gmail.com> - 2012-03-04 07:53 -0800
                Re: Valentine Bingo - Comments? Josh Grams <josh@qualdan.com> - 2012-03-04 17:24 +0000
                Re: Valentine Bingo - Comments? Rugxulo <rugxulo@gmail.com> - 2012-03-04 11:41 -0800
            Re: Valentine Bingo - Comments? Rugxulo <rugxulo@gmail.com> - 2012-03-04 08:16 -0800
              Re: Valentine Bingo - Comments? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-04 17:39 +0100
                Re: Valentine Bingo - Comments? Bernd Paysan <bernd.paysan@gmx.de> - 2012-03-04 17:42 +0100
              Re: Valentine Bingo - Comments? kenney@cix.compulink.co.uk - 2012-03-05 04:09 -0600
    Re: Valentine Bingo - Comments? Rugxulo <rugxulo@gmail.com> - 2012-03-03 11:35 -0800
    Re: Valentine Bingo - Comments? Doug Hoffman <glidedog@gmail.com> - 2012-03-04 10:07 -0500
      Re: Valentine Bingo - Comments? mhx@iae.nl (Marcel Hendrix) - 2012-03-04 17:42 +0200
        Re: Valentine Bingo - Comments? hwfwguy@gmail.com - 2012-03-06 20:38 -0800
      Re: Valentine Bingo - Comments? Hugh Aguilar <hughaguilar96@yahoo.com> - 2012-03-07 22:10 -0800

csiph-web