Deutsch   English   Français   Italiano  
<b781b7565e7b2c60363014dacde27099ac877449@i2pn2.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail
From: dxf <dxforth@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: Standard compliance for systems
Date: Fri, 22 Nov 2024 16:49:35 +1100
Organization: i2pn2 (i2pn.org)
Message-ID: <b781b7565e7b2c60363014dacde27099ac877449@i2pn2.org>
References: <vcbn5e$3etuk$1@dont-email.me>
 <1a3ebf77c1ed8926d455a268e1309fe0@www.novabbs.com>
 <vcbuog$3etuk$3@dont-email.me> <66ee34a2$1@news.ausics.net>
 <vcmbf2$1ifml$1@dont-email.me> <66ef7dc7$1@news.ausics.net>
 <vcpi98$25spg$1@dont-email.me> <66f0fc6c$1@news.ausics.net>
 <vcr3ff$25spg$9@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 22 Nov 2024 05:49:40 -0000 (UTC)
Injection-Info: i2pn2.org;
	logging-data="3588643"; mail-complaints-to="usenet@i2pn2.org";
	posting-account="XPw7UV90Iy7EOhY4YuUXhpdoEf5Vz7K+BsxA/Cx8bVc";
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <vcr3ff$25spg$9@dont-email.me>
X-Spam-Checker-Version: SpamAssassin 4.0.0
Bytes: 4623
Lines: 76

On 23/09/2024 4:56 pm, Ruvim wrote:
> On 2024-09-23 09:28, dxf wrote:
>> On 23/09/2024 2:57 am, Ruvim wrote:
> ...
>>> NB: Keeping floating-point numbers on the data stack does not make a Forth system non-standard, but it merely adds an environmental restriction to this system, see the section "12.4.1.4 Environmental restrictions" in Forth-2012.
>>
>> I hadn't seen that.  Forth-94 stated floating-point stack was "the default".
>> If the only change is that the latter is clarified, then no harm done.
>> Implementing separate stack on an 8-bit cpu would be expensive and a
>> performance killer.  
> 
>> As to being "far simpler" to program, similar appeals
>> are made in respect of locals.
>> I make it a point to program as if I had a
>> unified stack just to see if the claim is true.
> 
> A real problem was to create programs that work with floating point numbers and would work correctly both on a unified fp stack and on a separate fp stack.

Code written for a unified stack works on every system.  The problem rather was
those hell-bent against a unified fp stack.  It wasn't enough ANS permitted them
to write separate stack fp code.  They wanted the unified stack fp gone - out of
the picture.  In 2012 a separate fp stack isn't an option - it's a commandment:

  12.3.3 Floating-point stack
  ...
  The floating-point stack _shall_ be separate from the data and return stacks.

When the Bible said:

  "You _shall_ have no other gods before Me"

there was no 'environmental restriction' in the footnotes allowing other gods or
none as that would render the commandment meaningless.

> ... 
> If a Forth system is so limited in memory that it cannot provide two buffers for `s"`, it *might* provide only one buffer and declare the corresponding environmental restriction according to the sections:
> 
> - 5.1.1 System compliance
> | An otherwise Standard System (Subset) that fails to comply
> | with one or more of the minimum values or ranges specified
> | in "3 Usage requirements" and its sub-sections has
> | environmental restrictions.
> 
> - 5.1.2 System labeling
> | The phrase "with Environmental Restrictions" shall be
> | appended to the label of a Standard System (Subset) that
> | has environmental restrictions.
> 
> - 11.3 Additional usage requirements, 11.3.4 Other transient regions
> | The system provides transient buffers for `S"` and `S\"`
> | regions strings. These buffers shall be no less than 80
> | characters in length, and there shall be at least two buffers.

This again is a mess since:

  S" abc"  S" def"  S" ghi"

in a 'standard program' falls outside the minimum and would not be
considered portable.  Yet a 'standard system' that cannot do:

  S" abc"  S" def"  S" ghi"

is deemed by 2012 to have an 'environmental restriction' since:

  11.3.4  Other transient regions
  ... "RAM-limited systems may have environmental restrictions on the
  number of buffers and their lifetimes."

Both Forth-94 and 2012 define 'environmental restriction' as applying
to systems which 'cannot meet the minimum values set out in section 3'.

AFAICS 'two' is the minimum number of S" interpretive buffers specified
by 2012.  Such a system should thus be considered entirely compliant.
OTOH a 'unified fp stack' is not any kind of minimum.  Rather it ignores
12.3.3 in the provisioning of a separate fp stack.  Such a system is
outright non-compliant.