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


Groups > comp.lang.forth > #32877

Re: ANS Forth test programs

From Gerry Jackson <gerry@jackson9000.fsnet.co.uk>
Newsgroups comp.lang.forth
Subject Re: ANS Forth test programs
Date 2014-08-08 10:18 +0100
Organization A noiseless patient Spider
Message-ID <ls24ki$d4n$1@dont-email.me> (permalink)
References (2 earlier) <lrnu66$52j$1@online.de> <lrr14o$d4i$1@dont-email.me> <38e74a2c-a0b1-4f6e-bb4f-aecaa979e7c0@googlegroups.com> <lrvgiq$5gf$1@dont-email.me> <b6373152-7d3f-47f8-8d0a-1f4511bd57ac@googlegroups.com>

Show all headers | View raw


On 08/08/2014 02:29, hughaguilar96@yahoo.com wrote:
> On Thursday, August 7, 2014 2:23:45 AM UTC-7, Gerry wrote:
>> On 06/08/2014 04:06, hughaguilar96@yahoo.com wrote:
>>> Anyway, I don't put any stock in these test
>>> suites.
>>
>> Well if you'd tried them you *may* have known what to avoid for
>> particular systems and saved yourself time. They are very quick to run.
>
> Why should I need anything other than the ANS-Forth document to learn ANS-Forth?

The purpose of the test programs is not to teach ANS Forth (where on 
earth did you get that idea) but to identify where a Forth system does 
not comply with ANS Forth.

>
>> What is the point of a test suite when the ANS-Forth document repeatedly
>> says that something may be this or may be that? Is the test suite going
>> to test both forks?
>> They're contradictory!!! A program can't be both this and that --- and
>> there are multiple forks like this
>
>> Can you give an example of such forks and where a chain of them lead to
>> exponential growth, and then perhaps I can explain what the tests do.
>
> Off the top of my head, here are a few:
> 1.) Locals may have their own stack or may use the return stack.
> 2.) Control-flow data may have its own stack or may use the data stack.
> 3.) Exception frame data may have its own stack, or may use the return stack.
> 4.) Code and data may be intermixed, or may be separate.
> 5.) Names may be case-sensitive or may be case-insensitive.
> 6.) Words may have an xt or may not have an xt at all (in which case FIND aborts).
> 7.) FIND may return the same xt value for a word whether used when compiling or not compiling, or may return different xt values.
> 8.) File names may be one format, or may be another format, depending upon the OS underneath.
> 9.) Various console I/O words may corrupt the ># buffer or they may not.
> 10.) ALIGN and ALIGNED may align, or they may not do anything.
> 11.) A cell may be 16-bit, 24-bit, 32-bit, 64-bit, etc..
>

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

Similarly for most, if not all, the other points.

> Assuming that each of the above has 2 possibilities, that would be 2^11=2048 versions of ANS-Forth --- but several of the above have multiple possibilities,

That is not a problem for the test programs, those implementation issues 
are irrelevant as I explained above.

> so we actually have tens of thousands of versions of ANS-Forth, and any program that assumes one particular version will not run on any other version.
>
> To write portable ANS-Forth code (as I did in the novice package), it is necessary to assume the worst-case scenario every time.

True, you're stating the blindingly obvious there, and sometimes it is 
difficult or tedious to write a truly portable Forth program.

For example, I assume that the control-flow data is on the parameter 
stack, so in my :NAME definers I hold my working data in local variables 
rather than on the parameter stack. For the most part, assuming the 
worst-case scenario just means assuming SwiftForth --- but not always 
--- an example of Gforth being the worst-case scenario is that it 
doesn't have an xt for the semicolon, which is why I have late-binding 
in my MACRO: word.
>
> All in all, the ANS-Forth standard doesn't nail anything down ---

I've agreed before that a lot of legacy crap ought to be removed from 
the ANS standard. To take one example, if the File-Access word set is 
implemented then the Block word set, which hardly anybody uses these 
days, also has to be implemented. I would remove the Block word set 
entirely and release words like BLOCK and BUFFER for something useful. 
But for lots of the points you raise, deciding one way or the other 
would force an implementation on Forth system developers - something 
that, in general they don't want.

-- 
Gerry

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


Thread

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

csiph-web