OK to post Forth source for feedback? 
Author Message
 OK to post Forth source for feedback?

Greetings,

Is it OK to post a full Forth program (40K) for feedback on this newsgroup?
I've been porting a chess program to Forth as a learning project (and
because ANS Forth is so primitive) and would like feedback on style,
efficiency and... um... Forthrightness.

Ian Osgood



Mon, 22 Mar 2004 22:41:02 GMT  
 OK to post Forth source for feedback?
If its 40k compressed, maybe the inner loops and the data structures they
access would be appropriate. And if its not compressed then a bziped fil
should be very small.

MvH Dan Andersson
--
Covered by the PPL: http://ppl.7thguard.net/PPL



Mon, 22 Mar 2004 23:25:25 GMT  
 OK to post Forth source for feedback?

Quote:

> Greetings,

> Is it OK to post a full Forth program (40K) for feedback on this newsgroup?
> I've been porting a chess program to Forth as a learning project (and
> because ANS Forth is so primitive) and would like feedback on style,
> efficiency and... um... Forthrightness.

Put it on a web site, and post the URL.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/



Mon, 22 Mar 2004 23:17:26 GMT  
 OK to post Forth source for feedback?

Quote:

> Greetings,

> Is it OK to post a full Forth program (40K) for feedback on this newsgroup?
> I've been porting a chess program to Forth as a learning project (and
> because ANS Forth is so primitive) and would like feedback on style,
> efficiency and... um... Forthrightness.

> Ian Osgood


Can you put it at an accessible URL? A zipped file is a form of binary,
and binaries are discouraged in newsgroups. At the worst, you can send
it to me zipped or not, and I will make a page for it at
http://users.erols.com/jyavins/ for a few weeks, along with any
additional text to go with it.

Jerry
--
Engineering is the art of making what you want from things you can get.
-----------------------------------------------------------------------



Tue, 23 Mar 2004 01:12:07 GMT  
 OK to post Forth source for feedback?

wrote on 10/4/01 7:41 AM:

Quote:
> Greetings,

> Is it OK to post a full Forth program (40K) for feedback on this newsgroup?
> I've been porting a chess program to Forth as a learning project (and
> because ANS Forth is so primitive) and would like feedback on style,
> efficiency and... um... Forthrightness.

> Ian Osgood


Jeff Fox has graciously agreed to host it on his ANS Chess page:

http://www.ultratechnology.com/chess.html

The current version is TSCP03.F

Ian



Tue, 23 Mar 2004 10:32:02 GMT  
 OK to post Forth source for feedback?
Ian Osgood's ANS Forth Chess program in win32forth source
format is available as 40K in
ftp://ftp.UltraTechnology.com/TSCP03.F  and as 12K
ftp://ftp.UltraTechnology.com/TSCP03.ZIP  w/ links to it on
http://www.UltraTechnology.com/chess.html

Updates and variations will be available in the
future.



Tue, 23 Mar 2004 10:26:31 GMT  
 OK to post Forth source for feedback?

Quote:

>Ian Osgood's ANS Forth Chess program in win32forth source
>format is available as 40K in
>ftp://ftp.UltraTechnology.com/TSCP03.F  and as 12K
>ftp://ftp.UltraTechnology.com/TSCP03.ZIP  w/ links to it on
>http://www.UltraTechnology.com/chess.html

>Updates and variations will be available in the
>future.

Thanks, Jeff, for solving one of life's little problems.

Walter Rottenkolber



Tue, 23 Mar 2004 13:13:16 GMT  
 OK to post Forth source for feedback?


Quote:
>Greetings,

>Is it OK to post a full Forth program (40K) for feedback on this newsgroup?

Anything more than 10 lines increases my skip-the-message reflex
enormously.  You have already put it on the web, which is the right
way to go.

Quote:
>I've been porting a chess program to Forth as a learning project (and
>because ANS Forth is so primitive) and would like feedback on style,
>efficiency and... um... Forthrightness.

To get more feedback, extract a specific (and small) example and pose
specific questions.

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html



Tue, 23 Mar 2004 23:13:13 GMT  
 OK to post Forth source for feedback?

Quote:



> >Greetings,

> >Is it OK to post a full Forth program (40K) for feedback on this newsgroup?

> Anything more than 10 lines increases my skip-the-message reflex
> enormously.  You have already put it on the web, which is the right
> way to go.

> >I've been porting a chess program to Forth as a learning project (and
> >because ANS Forth is so primitive) and would like feedback on style,
> >efficiency and... um... Forthrightness.

> To get more feedback, extract a specific (and small) example and pose
> specific questions.

> - anton
> --
> M. Anton Ertl   http://www.*-*-*.com/
> comp.lang.forth FAQs: http://www.*-*-*.com/

And explain what you mean by "primitive". When it is applied to Forth,
many meanings are possible.

Jerry
--
"I view the progress of science as ... the slow erosion of the
 tendency to dichotomize."                    Barbara {*filter*}s, U. Mich.
---------------------------------------------------------------------



Tue, 23 Mar 2004 23:56:07 GMT  
 OK to post Forth source for feedback?

Quote:


[..]
>> Is it OK to post a full Forth program (40K) for feedback on
>> this newsgroup?
[..]
>> I've been porting a chess program to Forth as a learning project (and
>> because ANS Forth is so primitive) and would like feedback on style,
>> efficiency and... um... Forthrightness.
> To get more feedback, extract a specific (and small) example and pose
> specific questions.

*** My comments on style:
Eventually you'll get bitten by the fact that you manipulate BASE
globally.

The fields in ``go'' should be increased slightly for next year's
CPUs.

I assume you concentrated on correctness for the first few releases;
the definitions seem quite long.

*** My comments on "Forthrightness":

[UNDEFINED] tolower [IF]
 : tolower ( C -- c ) 020 OR ;   \ standard function?
[THEN]

( lowercase HEX is not portable )
\ 03ff AND 0= IF checkTime IF 2DROP abortScore EXIT THEN THEN
  03FF AND 0= IF checkTime IF 2DROP abortScore EXIT THEN THEN





\ 03ff AND 0= IF checkTime IF 2DROP abortScore EXIT THEN THEN
  03FF AND 0= IF checkTime IF 2DROP abortScore EXIT THEN THEN

( Not a portable function, but you knew that. iForth uses ?MS )



  ?MS msStart !



*** Efficiency seems good. Do you have the numbers for the C prototype?

FORTH> go ( AMD Athlon, Windows 2000 )
ply    nodes    time score pv
  1       21   0.001    48 d2-d4
  2       93   0.003     0 d2-d4 d7-d5
  3      864   0.018    35 d2-d4 d7-d5 b1-c3
& 3     1652   0.036     0 d2-d4 d7-d5 b1-c3 g8-f6
& 3     3849   0.096     5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
  4     5002   0.131     5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
& 4    10706   0.265    35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
  5    26638   0.554    35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
& 5    59442   0.352    13 e2-e4 e7-e5 d2-d4 e5xd4 d1xd4 g8-f6
  6   186433   1.681    13 e2-e4 e7-e5 d2-d4 e5xd4 d1xd4 g8-f6
& 6   451534   2.640    30 e2-e4 d7-d5 e4xd5 d8xd5 d2-d4 d5-e4 g1-e2 e7-e5
  7  1394541   7.998    30 e2-e4 d7-d5 e4xd5 d8xd5 d2-d4 d5-e4 g1-e2 e7-e5
& 7  3892017  20.961    18 e2-e4 e7-e5 g1-f3 b8-c6 d2-d4 e5xd4 f3xd4 g8-f6
  8 11923650  66.471    18 e2-e4 e7-e5 g1-f3 b8-c6 d2-d4 e5xd4 f3xd4 g8-f6
Time's up!
180688 nps Move found: e2-e4

r n b q k b n r
p p p p p p p p
. . . . . . . .
. . . . . . . .
. . . . P . . .
. . . . . . . .
P P P P . P P P
R N B Q K B N R
 ok

*** Note: Surprisingly, the program crashes when run under NT 4.0 as soon
as ply goes past 5. The exact same Forth binary is used.

FORTH> go ( NT 4.0 )
ply    nodes    score pv
  1       21       48 d2-d4
  2       93        0 d2-d4 d7-d5
  3      864       35 d2-d4 d7-d5 b1-c3
& 3     1652        0 d2-d4 d7-d5 b1-c3 g8-f6
& 3     3849        5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
  4     5002        5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
& 4    10706       35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
  5    26638       35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
& 5    59442       13 e2-e4 e7-e5 d2-d4 e5xd4 d1xd4 g8-f6

Caught exception 0xc0000005
ACCESS VIOLATION
instruction pointer = 0x4c60e600
hardware exception in ``setup''+$4C1474D8

-marcel



Wed, 24 Mar 2004 03:50:45 GMT  
 OK to post Forth source for feedback?
When I run it in auto mode (sufficiently large # of moves), it
eventually crashes on division by 0, IFF some level is less than 3. I.e.
        3 3 auto
does not crash, while
        3 2 auto
        2 2 auto
etc. do crash.

Elko

Quote:

> *** Note: Surprisingly, the program crashes when run under NT 4.0 as soon
> as ply goes past 5. The exact same Forth binary is used.

-----------------------------------------------------------------------
I want to be a nothing-knower,               Elko Tchernev

for time is dead, the sun is over            www.gl.umbc.edu/~etcher1
and there is nothing left to kill.           tel/fax (613) 246 6313


Wed, 24 Mar 2004 04:53:19 GMT  
 OK to post Forth source for feedback?

wrote on 10/5/01 1:53 PM:

Quote:
> When I run it in auto mode (sufficiently large # of moves), it
> eventually crashes on division by 0, IFF some level is less than 3. I.e.
> 3 3 auto
> does not crash, while
> 3 2 auto
> 2 2 auto
> etc. do crash.

> Elko

There is a use of */ in think which could do this for short searches.  It
will be fixed in the next version.  Thanks!  I haven't tested auto very
much.

Ian



Sat, 27 Mar 2004 22:21:26 GMT  
 OK to post Forth source for feedback?

wrote on 10/5/01 12:50 PM:

Quote:


> [..]
>>> Is it OK to post a full Forth program (40K) for feedback on
>>> this newsgroup?
> [..]
>>> I've been porting a chess program to Forth as a learning project (and
>>> because ANS Forth is so primitive) and would like feedback on style,
>>> efficiency and... um... Forthrightness.

> *** My comments on style:
> Eventually you'll get bitten by the fact that you manipulate BASE
> globally.

So at the top save BASE in a temp variable and restore it at the end?  Is
there a portable way to define individual numbers as decimal or hex,
ignoring BASE?

Quote:
> The fields in ``go'' should be increased slightly for next year's
> CPUs.

> I assume you concentrated on correctness for the first few releases;
> the definitions seem quite long.

Yes.  Factoring was what I needed the most help with.  I am also hesitant to
factor the inner loop words too far for performance reasons.

Quote:
> *** My comments on "Forthrightness":

> [UNDEFINED] tolower [IF]
> : tolower ( C -- c ) 020 OR ;   \ standard function?
> [THEN]

I don't have [UNDEFINED] in Win32Forth.  Is it this?
: [UNDEFINED] BL WORD FIND NIP 0= ;

Now, how do I put this definition in conditionally?  :)

Quote:
> ( lowercase HEX is not portable )


Thanks for the tips!  They will be incorporated into the next version.

Quote:
> *** Efficiency seems good. Do you have the numbers for the C prototype?

The Forth version was faster than I expected, but it is about five to ten
times slower than the C executable distributed with TSCP, which gets to ply
7 below in 1.42 seconds (Win2000, PIII-550).  I don't trust the Win32Forth

Quote:
> FORTH> go ( AMD Athlon, Windows 2000 )
> ply    nodes    time score pv
> 1       21   0.001    48 d2-d4
> 2       93   0.003     0 d2-d4 d7-d5
> 3      864   0.018    35 d2-d4 d7-d5 b1-c3
> & 3     1652   0.036     0 d2-d4 d7-d5 b1-c3 g8-f6
> & 3     3849   0.096     5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
> 4     5002   0.131     5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
> & 4    10706   0.265    35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
> 5    26638   0.554    35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
> & 5    59442   0.352    13 e2-e4 e7-e5 d2-d4 e5xd4 d1xd4 g8-f6
> 6   186433   1.681    13 e2-e4 e7-e5 d2-d4 e5xd4 d1xd4 g8-f6
> & 6   451534   2.640    30 e2-e4 d7-d5 e4xd5 d8xd5 d2-d4 d5-e4 g1-e2 e7-e5
> 7  1394541   7.998    30 e2-e4 d7-d5 e4xd5 d8xd5 d2-d4 d5-e4 g1-e2 e7-e5
> & 7  3892017  20.961    18 e2-e4 e7-e5 g1-f3 b8-c6 d2-d4 e5xd4 f3xd4 g8-f6
> 8 11923650  66.471    18 e2-e4 e7-e5 g1-f3 b8-c6 d2-d4 e5xd4 f3xd4 g8-f6
> Time's up!
> 180688 nps Move found: e2-e4

> r n b q k b n r
> p p p p p p p p
> . . . . . . . .
> . . . . . . . .
> . . . . P . . .
> . . . . . . . .
> P P P P . P P P
> R N B Q K B N R
> ok
> *** Note: Surprisingly, the program crashes when run under NT 4.0 as soon
> as ply goes past 5. The exact same Forth binary is used.

> FORTH> go ( NT 4.0 )
> ply    nodes    score pv
> 1       21       48 d2-d4
> 2       93        0 d2-d4 d7-d5
> 3      864       35 d2-d4 d7-d5 b1-c3
> & 3     1652        0 d2-d4 d7-d5 b1-c3 g8-f6
> & 3     3849        5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
> 4     5002        5 e2-e4 d7-d5 f1-b5 c8-d7 b5-d3
> & 4    10706       35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
> 5    26638       35 e2-e4 e7-e5 d2-d4 d7-d5 g1-f3
> & 5    59442       13 e2-e4 e7-e5 d2-d4 e5xd4 d1xd4 g8-f6

> Caught exception 0xc0000005
> ACCESS VIOLATION
> instruction pointer = 0x4c60e600
> hardware exception in ``setup''+$4C1474D8

> -marcel

Mystified by this... I use Win2000.  I'll keep looking.

Ian



Sat, 27 Mar 2004 22:51:17 GMT  
 OK to post Forth source for feedback?

10/5/01 8:56 AM:

Quote:



>>> Greetings,

>>> Is it OK to post a full Forth program (40K) for feedback on this newsgroup?

>> Anything more than 10 lines increases my skip-the-message reflex
>> enormously.  You have already put it on the web, which is the right
>> way to go.

>>> I've been porting a chess program to Forth as a learning project (and
>>> because ANS Forth is so primitive) and would like feedback on style,
>>> efficiency and... um... Forthrightness.

>> To get more feedback, extract a specific (and small) example and pose
>> specific questions.

>> - anton
>> --
>> M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
>> comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html

> And explain what you mean by "primitive". When it is applied to Forth,
> many meanings are possible.

> Jerry

I'm sorry, I meant to type "... (and because ANS Forth CHESS is so
primitive)."  I didn't mean to disparage Forth at all!

Ian



Sat, 27 Mar 2004 22:59:25 GMT  
 OK to post Forth source for feedback?

Quote:


> wrote on 10/5/01 12:50 PM:

> > [UNDEFINED] tolower [IF]
> > : tolower ( C -- c ) 020 OR ;   \ standard function?
> > [THEN]

> I don't have [UNDEFINED] in Win32Forth.  Is it this?
> : [UNDEFINED] BL WORD FIND NIP 0= ;

> Ian

Win32Forth does have [UNDEFINED],  It's definition is:

: [UNDEFINED]           DEFINED NIP 0= ; IMMEDIATE  ok

Tom Zimmer



Sat, 27 Mar 2004 23:35:46 GMT  
 
 [ 44 post ]  Go to page: [1] [2] [3]

 Relevant Pages 

1. Find Forth source (was: 8031 Forth Source Code Needed)

2. Micro Focus - can you post feedback?

3. Ok to post product announcements here?

4. Is it OK to post a Job Opening ?

5. Is it OK to post a Job Opening ?

6. Ok final crack at this..ignore all my other posts

7. Waveform debugger linked to HDL source programs, feedback?

8. Feedback to the Forth Interest Group

9. Feedback to the Forth Interest Group

10. Feedback to the Forth Interest Group

11. Feedback to the Forth Interest Group

12. Feedback to the Forth Interest Group

 

 
Powered by phpBB® Forum Software