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


Groups > comp.lang.forth > #32831 > unrolled thread

ANS Forth test programs

Started byGerry Jackson <gerry@jackson9000.fsnet.co.uk>
First post2014-08-03 23:34 +0100
Last post2014-08-08 13:40 -0700
Articles 10 on this page of 70 — 18 participants

Back to article view | Back to comp.lang.forth


Contents

  ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-03 23:34 +0100
    Re: ANS Forth test programs mhx@iae.nl - 2014-08-03 22:33 -0700
      Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-04 08:47 +0100
        Re: ANS Forth test programs "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-08-04 05:10 -0400
          Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-05 17:33 +0100
        Re: ANS Forth test programs stephenXXX@mpeforth.com (Stephen Pelc) - 2014-08-21 16:01 +0000
          Re: ANS Forth test programs anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-08-21 16:20 +0000
            Re: ANS Forth test programs stephenXXX@mpeforth.com (Stephen Pelc) - 2014-08-21 21:47 +0000
              Re: ANS Forth test programs anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-08-22 12:33 +0000
            Re: ANS Forth test programs albert@spenarnc.xs4all.nl (Albert van der Horst) - 2014-08-22 19:23 +0000
          Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-22 12:28 +0100
            Re: ANS Forth test programs "Alex McDonald" <blog@rivadpm.com> - 2014-08-22 13:35 +0100
              Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-22 17:11 +0100
            Re: ANS Forth test programs anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-08-22 12:47 +0000
      Re: ANS Forth test programs Bernd Paysan <bernd.paysan@gmx.de> - 2014-08-04 14:26 +0200
        Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-05 17:35 +0100
          Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-05 20:06 -0700
            Re: ANS Forth test programs "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-08-06 16:43 -0400
            Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-07 10:23 +0100
              Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-07 18:29 -0700
                Re: ANS Forth test programs "Alex McDonald" <blog@rivadpm.com> - 2014-08-07 23:28 -0700
                  Re: ANS Forth test programs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-08-08 04:25 -0500
                    Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-08 08:08 -0700
                      Re: ANS Forth test programs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-08-08 10:49 -0500
                        Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-08 19:54 -0700
                      Re: ANS Forth test programs anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-08-08 16:27 +0000
                        Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-08 10:47 -0700
                          Re: ANS Forth test programs Coos Haak <chforth@hccnet.nl> - 2014-08-08 22:34 +0200
                            Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-08 21:06 -0700
                              Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-08 23:59 -0700
                                Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-09 01:35 -0700
                                  Re: ANS Forth test programs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-08-09 04:41 -0500
                                    Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-09 17:53 -0700
                                      Re: ANS Forth test programs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-08-10 03:25 -0500
                                        Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-10 03:19 -0700
                                  Re: ANS Forth test programs Mikael Nordman <oh2aun@gmail.com> - 2014-08-10 05:28 -0700
                                    Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-12 22:43 -0700
                                      Re: ANS Forth test programs stephenXXX@mpeforth.com (Stephen Pelc) - 2014-08-13 09:46 +0000
                                        Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-13 21:17 -0700
                                          Re: ANS Forth test programs stephenXXX@mpeforth.com (Stephen Pelc) - 2014-08-14 10:24 +0000
                                            Re: ANS Forth test programs "Alex McDonald" <blog@rivadpm.com> - 2014-08-14 12:10 +0100
                                            Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-14 06:02 -0700
                                              Re: ANS Forth test programs stephenXXX@mpeforth.com (Stephen Pelc) - 2014-08-14 23:48 +0000
                                            Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-14 20:06 -0700
                                              Re: ANS Forth test programs stephenXXX@mpeforth.com (Stephen Pelc) - 2014-08-15 09:13 +0000
                                                Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-15 21:07 -0700
                                                  Re: ANS Forth test programs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2014-08-16 02:22 -0500
                                                  Re: ANS Forth test programs "Rod Pemberton" <dont_use_email@xnothavet.cqm> - 2014-08-16 04:43 -0400
                                                  Re: ANS Forth test programs stephenXXX@mpeforth.com (Stephen Pelc) - 2014-08-16 20:37 +0000
                              Re: ANS Forth test programs BruceMcF <agila61@netscape.net> - 2014-08-12 16:55 -0700
                                Re: ANS Forth test programs Raimond Dragomir <raimond.dragomir@gmail.com> - 2014-08-12 22:47 -0700
                                  Re: ANS Forth test programs "Alex McDonald" <blog@rivadpm.com> - 2014-08-13 10:43 +0100
                                  Re: ANS Forth test programs bruce.mcfarling@gmail.com - 2014-08-16 10:02 -0700
                          Re: ANS Forth test programs anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2014-08-09 11:09 +0000
                            Re: ANS Forth test programs Lars Brinkhoff <lars.spam@nocrew.org> - 2014-08-09 13:34 +0200
                              Re: ANS Forth test programs Bernd Paysan <bernd.paysan@gmx.de> - 2014-08-09 21:45 +0200
                    Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-08 13:39 -0700
                      Re: ANS Forth test programs "Alex McDonald" <blog@rivadpm.com> - 2014-08-10 03:21 +0100
                  Re: ANS Forth test programs "Bill Leary" <Bill_Leary@msn.com> - 2014-08-08 10:34 -0400
                Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-08 10:18 +0100
                  Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-08 12:48 -0700
                    Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-08 21:46 +0100
                      Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-08 14:14 -0700
                        Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-08 23:06 +0100
                      Re: ANS Forth test programs Coos Haak <chforth@hccnet.nl> - 2014-08-09 00:40 +0200
                        Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-08 18:17 -0700
    Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-06 14:50 -0700
      Re: ANS Forth test programs Gerry Jackson <gerry@jackson9000.fsnet.co.uk> - 2014-08-07 10:12 +0100
        Re: ANS Forth test programs hughaguilar96@yahoo.com - 2014-08-07 16:07 -0700
    Re: ANS Forth test programs francois.ganza@wanadoo.fr - 2014-08-08 13:40 -0700

Page 4 of 4 — ← Prev page 1 2 3 [4]


#32884

Fromhughaguilar96@yahoo.com
Date2014-08-08 12:48 -0700
Message-ID<dfda8d3a-201d-4528-8d3f-bdc6b563844b@googlegroups.com>
In reply to#32877
On Friday, August 8, 2014 2:18:20 AM UTC-7, Gerry wrote:
> I now see where you're coming from. The test programs don't care about 
> those things. They are testing *what* the system does not *how* it is 
> implemented. Taking your first point - there isn't currently a locals 
> test as I've never got around to tidying my existing test up for release 
> with the other tests, but it would do something like this as a test:
> 
> T{ : lt1 LOCALS| a b c | b c a ; -> }T
> T{ 3 2 1 lt1 -> 2 3 1 }T
> 
> where the bit before the -> is the test and the bit after is the 
> expected result on the data stack. The }T just checks that the 'before' 
> and 'after' stack values are the same. In short it is an automated 
> version of what you might type type in to do a simple manual test. 

This kind of test is so trivial as to be hardly worth the effort of automating. If you had done this for (LOCAL) on SwiftForth-v2 however, then you would have discovered that the use of (LOCAL) crashes SwiftForth and you could have told Elizabeth Rather about the problem --- I doubt that she would have cared in the slightest --- most likely she would have tried to sell you the Forth Handbook at $50 (I was fool enough to buy that along with SwiftForth).

> You 
> tell me where tests like that depend on whether locals have their own 
> stack or use the return stack - it's irrelevant.

It is not irrelevant if you are using >R etc. in the same colon word that you are using local variables! Duh!

[toc] | [prev] | [next] | [standalone]


#32888

FromGerry Jackson <gerry@jackson9000.fsnet.co.uk>
Date2014-08-08 21:46 +0100
Message-ID<ls3cvk$2pq$1@dont-email.me>
In reply to#32884
On 08/08/2014 20:48, hughaguilar96@yahoo.com wrote:
> On Friday, August 8, 2014 2:18:20 AM UTC-7, Gerry wrote:
>> I now see where you're coming from. The test programs don't care about
>> those things. They are testing *what* the system does not *how* it is
>> implemented. Taking your first point - there isn't currently a locals
>> test as I've never got around to tidying my existing test up for release
>> with the other tests, but it would do something like this as a test:
>>
>> T{ : lt1 LOCALS| a b c | b c a ; -> }T
>> T{ 3 2 1 lt1 -> 2 3 1 }T
>>
>> where the bit before the -> is the test and the bit after is the
>> expected result on the data stack. The }T just checks that the 'before'
>> and 'after' stack values are the same. In short it is an automated
>> version of what you might type type in to do a simple manual test.
>
> This kind of test is so trivial as to be hardly worth the effort of automating.

You miss the point.

If you had done this for (LOCAL) on SwiftForth-v2 however, then you 
would have discovered that the use of (LOCAL) crashes SwiftForth and you 
could have told Elizabeth Rather about the problem --- I doubt that she 
would have cared in the slightest --- most likely she would have tried 
to sell you the Forth Handbook at $50 (I was fool enough to buy that 
along with SwiftForth).
>
>> You
>> tell me where tests like that depend on whether locals have their own
>> stack or use the return stack - it's irrelevant.
>
> It is not irrelevant if you are using >R etc. in the same colon word that you are using local variables! Duh!
>

Well the duh's on you because you can use >R etc in a colon definition 
containing locals, try reading the standard document.
-- 
Gerry

[toc] | [prev] | [next] | [standalone]


#32889

Fromhughaguilar96@yahoo.com
Date2014-08-08 14:14 -0700
Message-ID<8e142abb-76c3-430f-8f76-82d060fed9e6@googlegroups.com>
In reply to#32888
On Friday, August 8, 2014 1:46:54 PM UTC-7, Gerry wrote:
> On 08/08/2014 20:48, hughaguilar96@yahoo.com wrote:
> >> You
> >> tell me where tests like that depend on whether locals have their own
> >> stack or use the return stack - it's irrelevant.
> 
> > It is not irrelevant if you are using >R etc. in the same colon word that you are using local variables! Duh!
> 
> Well the duh's on you because you can use >R etc in a colon definition 
> containing locals, try reading the standard document.

Section 13.3.3.:

- Locals shall not be declared until values previously placed on the return stack within the definition have been removed;
- After a definition's locals have been declared, a program may place data on the return stack. However, if this is done, locals shall not be accessed until those values have been removed from the return stack;

[toc] | [prev] | [next] | [standalone]


#32890

FromGerry Jackson <gerry@jackson9000.fsnet.co.uk>
Date2014-08-08 23:06 +0100
Message-ID<ls3hlm$2q8$1@dont-email.me>
In reply to#32889
On 08/08/2014 22:14, hughaguilar96@yahoo.com wrote:
> On Friday, August 8, 2014 1:46:54 PM UTC-7, Gerry wrote:
>> On 08/08/2014 20:48, hughaguilar96@yahoo.com wrote:
>>>> You
>>>> tell me where tests like that depend on whether locals have their own
>>>> stack or use the return stack - it's irrelevant.
>>
>>> It is not irrelevant if you are using >R etc. in the same colon word that you are using local variables! Duh!
>>
>> Well the duh's on you because you can use >R etc in a colon definition
>> containing locals, try reading the standard document.
>
> Section 13.3.3.:
>
> - Locals shall not be declared until values previously placed on the return stack within the definition have been removed;
> - After a definition's locals have been declared, a program may place data on the return stack. However, if this is done, locals shall not be accessed until those values have been removed from the return stack;
>

A test program would not violate the restrictions that the standard 
places on use of the return stack when locals are used, so the fact that 
a system may have a separate locals stack or use the return stack *is* 
irrelevant to the test itself because the test will run on both types of 
system.

However it is relevant for the test programmer who must obey the 
restrictions if the program has to run on all compliant systems. I was 
talking about the test programs not the programmer.

-- 
Gerry

[toc] | [prev] | [next] | [standalone]


#32891

FromCoos Haak <chforth@hccnet.nl>
Date2014-08-09 00:40 +0200
Message-ID<flcxst85ppfq.6fi7v7kp86op.dlg@40tude.net>
In reply to#32888
Op Fri, 08 Aug 2014 21:46:54 +0100 schreef Gerry Jackson:

<snip>

> If you had done this for (LOCAL) on SwiftForth-v2 however, then you 
> would have discovered that the use of (LOCAL) crashes SwiftForth.
The following crashes SwiftForth 3, but runs in Gforth 0.7.x

: try, s" try" (local) ;  immediate
: tried  10 try, try . ;  \ does not compile.

But this runs without hiccups, of course, see the rules for (local).

: try, s" try" (local) 0 0 (local) ;  immediate
: tried  10 try, try . ;
tried 10 ok

-- 
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html 

[toc] | [prev] | [next] | [standalone]


#32892

Fromhughaguilar96@yahoo.com
Date2014-08-08 18:17 -0700
Message-ID<c650b37c-a94a-4e1e-96b5-b8626d04fc23@googlegroups.com>
In reply to#32891
On Friday, August 8, 2014 3:40:01 PM UTC-7, Coos Haak wrote:
> The following crashes SwiftForth 3, but runs in Gforth 0.7.x
> 
> : try, s" try" (local) ;  immediate
> : tried  10 try, try . ;  \ does not compile.

It is supposed to crash, or hopefully abort with a helpful error message --- so this is a bug in Gforth not SwiftForth.
 
> But this runs without hiccups, of course, see the rules for (local).
> 
> : try, s" try" (local) 0 0 (local) ;  immediate
> : tried  10 try, try . ;
> tried 10 ok

The definition of (LOCAL) is too complicated! This business of having a "last local" message implies that there is a state inside of the compiler (either compiling locals or not). But having internal states and "messages" is a gross violation of Forth philosophy --- (LOCAL) appears to have been designed by C programmers who knew little or nothing about Forth, but were trying to make Forth more C-like. LOCALS| is also a bad design because the parameters are, ahem, backwards! Also, the rule regarding when >R etc. can be used in conjunction with local variables is complicated and can really only be explained to a novice Forth student by explaining the internal implementation (the fact that a shortage of registers on the x86 made it necessary to use one register for both the return-stack and the local-stack) --- but implementation details such as this are exactly what were supposed to be hidden from the user! Who was the chair of the ANS-Forth committee, who allowed this crap into the ANS-Forth standard? (Ha! We all know the answer to that one!) 

My language is going to be so much simpler than ANS-Forth! I only support { for defining locals, which has to be immediately after the : xxx at the beginning if it is used, but which is optional. I also allow >R etc. to be used freely, without regard to the use of locals --- and we don't have DO loops, so there is no longer that weird conflict between >R and DO. Also, if you push data onto the R stack with >R, it is not necessary to remove it, as EXIT will remove it automatically --- all of those R> DROP at the end of a function were error-prone (you might have too few or too many), and they usually didn't get optimized very well so they slowed down the function, and they cluttered up the source-code --- so I got rid of them. The result is super simple --- the language can be explained easily to a novice student --- we no longer have the use of one kind of code changing the rules for the use of another kind of code, or all of that other useless complication in ANS-Forth (and Forth-200x is worse).

ANS-Forth is a stinking heap of amateurism that Forth Inc. left for us --- it has been 20 years now, so it is past time to press the flush lever! We need a new standard that is not compatible with ANS-Forth! The Forth language can still be saved, but ANS-Forth is doomed to oblivion --- and Forth Inc. won't be making a contribution because they have nothing worthwhile to say on the subject.

[toc] | [prev] | [next] | [standalone]


#32866

Fromhughaguilar96@yahoo.com
Date2014-08-06 14:50 -0700
Message-ID<ff907564-211e-4b7f-aef4-d56e7ff99d44@googlegroups.com>
In reply to#32831
On Sunday, August 3, 2014 3:34:27 PM UTC-7, Gerry wrote:
> Using Windows 7 (32 bit) the only Forth system that passed all tests 
> with no errors was Swiftforth. The maintainers of GForth, VFX Forth, 
> iForth and Win32 Forth might like to try running the tests.

Does SwiftForth-v2 pass with no errors? This is the SwiftForth version that I paid over $400 for, and in which (LOCAL) crashes the system when it is used.

[toc] | [prev] | [next] | [standalone]


#32871

FromGerry Jackson <gerry@jackson9000.fsnet.co.uk>
Date2014-08-07 10:12 +0100
Message-ID<lrvftg$vr5$1@dont-email.me>
In reply to#32866
On 06/08/2014 22:50, hughaguilar96@yahoo.com wrote:
> On Sunday, August 3, 2014 3:34:27 PM UTC-7, Gerry wrote:
>> Using Windows 7 (32 bit) the only Forth system that passed all tests
>> with no errors was Swiftforth. The maintainers of GForth, VFX Forth,
>> iForth and Win32 Forth might like to try running the tests.
>
> Does SwiftForth-v2 pass with no errors? This is the SwiftForth version that I paid over $400 for, and in which (LOCAL) crashes the system when it is used.
>

I don't know as I don't have Swiftforth-v2 and I've no reason to test 
v2. I tested a more recent v3.

Sorry I accidentally sent you a personal reply - Thunderbird strikes 
again, I must remember to press 'Followup'

-- 
Gerry

[toc] | [prev] | [next] | [standalone]


#32874

Fromhughaguilar96@yahoo.com
Date2014-08-07 16:07 -0700
Message-ID<5568766c-a1b5-492c-ac91-a20ed04140e9@googlegroups.com>
In reply to#32871
On Thursday, August 7, 2014 2:12:24 AM UTC-7, Gerry wrote:
> On 06/08/2014 22:50, hughaguilar96@yahoo.com wrote:
> > On Sunday, August 3, 2014 3:34:27 PM UTC-7, Gerry wrote:
> > Does SwiftForth-v2 pass with no errors? This is the SwiftForth version that I paid over $400 for, and in which (LOCAL) crashes the system when it is used.
> 
> I don't know as I don't have Swiftforth-v2 and I've no reason to test 
> v2. I tested a more recent v3.

I have no reason to test v3 --- Elizabeth Rather tried hard (on the Forth-200x mailing list) to sell it to me for another $300, but even the super-salesperson that she is, she just couldn't squeeze the money out of me...

[toc] | [prev] | [next] | [standalone]


#32886

Fromfrancois.ganza@wanadoo.fr
Date2014-08-08 13:40 -0700
Message-ID<2167c05b-cb86-4241-adbb-7e99e0b26dc9@googlegroups.com>
In reply to#32831
I don't understand ANS Forth
I don't understand why everybody try to program Forth like C

With a smallest Core Forth, the portability is not a problem..

[toc] | [prev] | [standalone]


Page 4 of 4 — ← Prev page 1 2 3 [4]

Back to top | Article view | comp.lang.forth


csiph-web