Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.forth > #24100

Re: OT (slightly) What is the "best" processor for a new project?

Newsgroups comp.lang.forth
Date 2013-07-02 13:51 -0700
References (15 earlier) <0a55ff9e-15cf-4b61-952f-d43c6133a3dc@googlegroups.com> <kqqguv$9sj$1@online.de> <0--dnSWLJo-FrEzMnZ2dnUVZ_rCdnZ2d@supernews.com> <e8ec1234-c381-45fb-9466-c21b1013c72d@googlegroups.com> <8vCdnYeb3YfLD0_MnZ2dnUVZ_s6dnZ2d@supernews.com>
Message-ID <dc1b1c8b-3ea7-4ea6-9ff5-9f0edc7c2d48@googlegroups.com> (permalink)
Subject Re: OT (slightly) What is the "best" processor for a new project?
From hughaguilar96@yahoo.com

Show all headers | View raw


On Tuesday, July 2, 2013 1:41:58 AM UTC-7, Andrew Haley wrote:
> hughaguilar96@yahoo.com wrote:
> > You have hundreds of words that would normally be primitives, 
> 
> Normally?  Simce when did Forth normally have hundreds of primitives?
> Not any Forth I've seen.

Apparently what you've seen are 1980s vintage Forths that don't do any optimization at all.

If you are going to have any speed, then it is necessary to make primitives out of common combos. For example: OVER_+ should be a primitive. This is generally faster than OVER followed by +, and it halves the memory usage in the threaded code.

In CAMForth that I'm writing, I have almost 500 primitives already, and I'll likely have about 1000 when I'm done. The 64-bit x86 has a 32Kbyte code cache, so this is reasonable. Ironically, a micro-controller such as the PIC24 allows for a lot more primitives as it doesn't have a code-cache but its code memory is something like 128Kwords.

> > but which are colon words instead.
> 
> Much better.  That's the Forth way to do it.

Just as a general rule of thumb: whenever people claiming to be experts in language X use phrases such as "the X way" or "idiomatic for X" --- this means that they are full of hot air, and they don't have any explanation for their opinions.

> > For example, if R@ is a primitive,
> > then you might write DUP like this;
> 
> Why wouldn't DUP be an instruction?
> 
> > : DUP  >R  R@ R> ;
> > Or, if DUP is a primitive, write R@ like this:
> > :MACRO R@  R>  DUP >R ;
> 
> Well, that'd be stupid.

There are only 32 primitives in most of the so-called "Forth chips." Trade-offs have to be made. Even with 64 primitives, trade-offs are going to have to be made --- and you are going to need a monster chip to support 64 primitives all in hardware.

Even supporting 32 primitives in hardware requires a pretty big chip --- I suspect that the chips Payson is using for his B16 are gigantic compared to the Lattice isp1048 that the MiniForth ran on. 

Testra rejected the original idea that the MiniForth would be like the B16 and support 32 primitives in hardware --- this was partially because it would be grossly inefficient in both speed and memory usage, and partially because it seemed unlikely that the Lattice PLD would be capable of supporting such a big design.

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


Thread

Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-16 23:17 -0700
  Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-17 14:19 +0200
    Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-17 16:04 -0700
    Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-17 16:15 -0700
      Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-18 00:01 -0400
        Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-19 15:33 +0200
          Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-19 17:25 -0400
            Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-19 17:00 -0700
              Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-20 18:35 -0400
          Re: OT (slightly) What is the "best" processor for a new project? Hugh Aguilar <hughaguilar96@yahoo.com> - 2013-06-19 17:38 -0700
            Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-20 12:51 +0200
              Re: OT (slightly) What is the "best" processor for a new project? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-06-20 15:28 +0000
              Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-20 18:39 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-21 14:50 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-22 18:56 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "WJ" <w_a_x_man@yahoo.com> - 2013-06-23 02:35 +0000
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-22 20:48 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-23 14:49 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-26 18:08 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-27 16:32 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 10:10 -0700
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-30 15:18 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 16:01 -0700
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-30 20:22 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-06-30 21:22 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 15:52 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-01 02:02 +0200
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-06-30 19:25 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-01 02:34 -0500
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-01 16:26 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-01 23:08 +0200
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-01 18:10 -0400
                Re: OT (slightly) What is the "best" processor for a new project? "Elizabeth D. Rather" <erather@forth.com> - 2013-07-01 12:35 -1000
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-01 18:42 -0400
                Re: OT (slightly) What is the "best" processor for a new project? "Elizabeth D. Rather" <erather@forth.com> - 2013-07-01 13:03 -1000
                Re: OT (slightly) What is the "best" processor for a new project? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-02 07:20 +0000
                Re: OT (slightly) What is the "best" processor for a new project? "Elizabeth D. Rather" <erather@forth.com> - 2013-07-02 07:38 -1000
                Re: OT (slightly) What is the "best" processor for a new project? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-02 07:24 +0000
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-02 13:02 +0200
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-02 05:58 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-02 03:34 -0500
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-01 20:01 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "WJ" <w_a_x_man@yahoo.com> - 2013-07-02 04:43 +0000
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-02 03:41 -0500
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-02 06:09 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-02 13:51 -0700
                Re: OT (slightly) What is the "best" processor for a new project? daveyrotten <danw8804@gmail.com> - 2013-07-02 14:37 -0700
                Re: OT (slightly) What is the "best" processor for a new project? daveyrotten <danw8804@gmail.com> - 2013-07-02 14:56 -0700
                Re: OT (slightly) What is the "best" processor for a new project? Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-03 00:30 +0200
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-03 02:19 -0500
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-03 05:18 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-03 18:10 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-03 05:30 -0400
                Static superinstructions(was: OT (slightly) What is the "best" ...) anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-07-03 14:33 +0000
                Re: Static superinstructions(was: OT (slightly) What is the "best" ...) Bernd Paysan <bernd.paysan@gmx.de> - 2013-07-04 00:41 +0200
                Re: Static superinstructions(was: OT (slightly) What is the "best" ...) "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-07 11:32 -0400
                Re: OT (slightly) What is the "best" processor for a new project? hughaguilar96@yahoo.com - 2013-07-03 18:31 -0700
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-07 11:28 -0400
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-07-02 16:44 -0400
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-02 05:56 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-02 05:58 -0500
                Re: OT (slightly) What is the "best" processor for a new project? "Rod Pemberton" <do_not_have@notemailnotq.cpm> - 2013-07-03 05:57 -0400
                Re: OT (slightly) What is the "best" processor for a new project? Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-07-03 06:43 -0500
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-30 20:29 -0400
                Re: OT (slightly) What is the "best" processor for a new project? rickman <gnuarm@gmail.com> - 2013-06-27 10:58 -0400

csiph-web