diff.tex 66.5 KB
Newer Older
pknaggs's avatar
pknaggs committed
1
% !TeX root = forth.tex
pknaggs's avatar
F94  
pknaggs committed
2
% !TeX spellcheck = en_US
3
\cbstart\patch{compatibility}
pknaggs's avatar
F94  
pknaggs committed
4 5
\annex[Compatibility analysis]{Compatibility analysis of ANS Forth\strike{4}{80}} % D (informative annex)
\cbend
6
\label{annex:diff}
7 8
\setwordlist{core}

9
\replace{compatibility}{Prior to}{Before} this standard, there were several industry standards for Forth.
10
The most influential are listed here in chronological order, along
11 12
with the major differences between this standard and the most recent,
\replace{compatibility}{ANS Forth}{Forth 94}.
13 14 15 16 17 18 19

\section{FIG Forth (circa 1978)} % D.1

FIG Forth was a ``model'' implementation of the Forth language
developed by the Forth Interest Group (FIG). In FIG Forth, a
relatively small number of words were implemented in processor-dependent
machine language and the rest of the words were implemented in Forth.
20 21
The FIG model was placed in the public domain, and was ported to a wide
variety of computer systems. Because the bulk of the FIG Forth
22 23
implementation was the same across all machines, programs written in
FIG Forth enjoyed a substantial degree of portability, even for
24 25
``system-level'' programs that directly manipulate the internals
of the Forth system implementation.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81

FIG Forth implementations were influential in increasing the number
of people interested in using Forth. Many people associate the
implementation techniques embodied in the FIG Forth model with
``the nature of Forth''.

However, FIG Forth was not necessarily representative of commercial
Forth implementations of the same era. Some of the most successful
commercial Forth systems used implementation techniques different
from the FIG Forth ``model''.


\section{Forth 79} % D.2

The Forth-79 Standard resulted from a series of meetings from 1978
to 1980, by the Forth Standards Team, an international group of Forth
users and vendors (interim versions known as Forth 77 and Forth 78
were also released by the group).

Forth 79 described a set of words defined on a 16-bit, twos-complement,
unaligned, linear byte-addressing virtual machine. It prescribed an
implementation technique known as ``indirect threaded code'', and used
the ASCII character set.

The Forth-79 Standard served as the basis for several public domain
and commercial implementations, some of which are still available and
supported today.


\section{Forth 83} % D.3

The Forth-83 Standard, also by the Forth Standards Team, was released
in 1983. Forth 83 attempted to fix some of the deficiencies of Forth
79.

Forth 83 was similar to Forth 79 in most respects. However, Forth 83
changed the definition of several well-defined features of Forth 79.
For example, the rounding behavior of integer division, the base value
of the operands of \word{PICK} and \word{ROLL}, the meaning of the
address returned by \word{'}, the compilation behavior of \word{'},
the value of a ``true'' flag, the meaning of \texttt{NOT}, and the
``chaining'' behavior of words defined by \texttt{VOCABULARY} were all
changed. Forth 83 relaxed the implementation restrictions of Forth 79
to allow any kind of threaded code, but it did not fully allow
compilation to native machine code (this was not specifically prohibited,
but rather was an indirect consequence of another provision).

Many new Forth implementations were based on the Forth-83 Standard, but
few ``strictly compliant'' Forth-83 implementations exist.

Although the incompatibilities resulting from the changes between
Forth 79 and Forth 83 were usually relatively easy to fix, a number
of successful Forth vendors did not convert their implementations to
be Forth 83 compliant. For example, the most successful commercial
Forth for Apple Macintosh computers is based on Forth 79.

82 83 84
\cbstart\patch{compatibility}
\section[Recent developments]{\sout{Recent developments}} % D.4
\label{diff:development}
85

86
\sout{%
87 88 89 90
Since the Forth-83 Standard was published, the computer industry has
undergone rapid and profound changes. The speed, memory capacity, and
disk capacity of affordable personal computers have increased by
factors of more than 100. 8-bit processors have given way to 16-bit
91
processors, and now 32-bit processors are commonplace.}
92

93
\sout{%
94
The operating systems and programming-language environments of small
95
systems are much more powerful than they were in the early 80's.}
96

97
\sout{%
98
The personal-computer marketplace has changed from a predominantly
99
``hobbyist'' market to a mature business and commercial market.}
100

101
\sout{%
102 103
Improved technology for designing custom microprocessors has resulted
in the design of numerous ``Forth chips'', computers optimized for
104
the execution of the Forth language.}
105

106
\sout{%
107
The market for ROM-based embedded control computers has grown
108
substantially.}
109

110
\sout{%
111 112 113
In order to take full advantage of this evolving technology, and to
better compete with other programming languages, many recent Forth
implementations have ignored some of the ``rules'' of previous Forth
114
standards. In particular:}
115 116

\begin{itemize}
117 118 119 120
\item \sout{32-bit Forth implementations are now common.}
\item \sout{Some Forth systems adopt the address-alignment restrictions of
	the hardware on which they run.}
\item \sout{Some Forth systems use native-code generation, microcode
121
	generation, and optimization techniques, rather than the
122 123 124 125
	traditional ``threaded code''.}
\item \sout{Some Forth systems exploit segmented addressing architectures,
	placing portions of the Forth ``dictionary'' in different segments.}
\item \sout{More and more Forth systems now run in the environment of another
126
	``standard'' operating system, using OS text files for source code,
127 128
	rather than the traditional Forth ``blocks''.}
\item \sout{Some Forth systems allow external operating system software,
pknaggs's avatar
pknaggs committed
129
	windowing software, terminal con\-cen\-tratores, or communications
130 131
	channels to handle or preprocess user input, resulting in deviations
	from the input editing, character set availability, and screen
132
	management behavior prescribed by Forth 83.}
133 134
\end{itemize}

135
\sout{%
136
Competitive pressure from other programming languages (predominantly
pknaggs's avatar
pknaggs committed
137
``C'') and from other Forth ven\-dors have led Forth vendors to
138
optimizations that do not fit in well with the ``virtual machine
139
model'' implied by existing Forth standards.}
140 141


142
\section[ANS Forth approach]{\sout{ANS Forth approach}} % D.5
pknaggs's avatar
F94  
pknaggs committed
143
\label{diff:ans}
144

145
\sout{%
146 147 148
The ANS Forth committee addressed the serious fragmentation of the
Forth community caused by the differences between Forth 79 and
Forth 83, and the divergence from either of these two industry
149
standards caused by marketplace pressures.}
150

151 152
\sout{%
Consequently, the committee has chosen to base its compatibility
153 154 155
decisions not upon a strict comparison with the Forth-83 Standard,
but instead upon consideration of the variety of existing
implementations, especially those with substantial user bases and/or
156
considerable success in the marketplace.}
157

158 159
\sout{%
The committee feels that, if ANS Forth prescribes stringent
160 161
requirements upon the virtual machine model, as did the previous
standards, then many implementors will chose not to comply with
162
ANS Forth. The committee hopes that ANS Forth will serve to unify
pknaggs's avatar
F94  
pknaggs committed
163
rather than to further divide the Forth community, and thus
164 165
has chosen to encompass rather than invalidate popular implementation
techniques.}
166

167 168
\sout{%
Many of the changes from Forth 83 are justified by this rationale.
169 170 171
Most fall into the category that ``an ANS Forth Standard Program may
not assume x'', where ``x'' is an entitlement resulting from the
virtual machine model prescribed by the Forth-83 Standard. The
172
committee feels that these restrictions are reasonable, especially
173
considering that a substantial number of existing Forth implementations
174 175
do not correctly implement the Forth-83 virtual model, thus the Forth-83
entitlements exist ``in theory'' but not ``in practice''.}
176

177
\sout{%
178
Another way of looking at this is that while ANS Forth acknowledges
179 180
the diversity of current Forth practice, it attempts to document the
similarity therein. In some sense, ANS Forth is thus a ``description
181
of reality'' rather than a ``prescription for a particular virtual
182
machine''.}
183

184
\sout{%
185 186 187
Since there is no previous American National Standard for Forth, the
action requirements prescribed by section 3.4 of X3/SD-9,
``Policy and Guidelines'', regarding previous standards do not apply.
pknaggs's avatar
F94  
pknaggs committed
188
}
189

190
\sout{%
191 192 193 194 195
The following discussion describes differences between ANS Forth and
Forth 83. In most cases, Forth 83 is representative of Forth 79 and
FIG Forth for the purposes of this discussion. In many of these cases,
however, ANS Forth is more representative of the existing state of the
Forth industry than the previously-published standards.
pknaggs's avatar
F94  
pknaggs committed
196 197
}

198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
\section[ANS Forth (1994)]{\uline{ANS Forth (1994)}} % D.5

\uline{%
In the mid to late 1980s the computer industry underwent a rapid and
profound change.  The personal-com\-put\-er market matured into a business
and commercial market, while the market for ROM-based embedded control
computers grew substantially.  Improvements in custom processor design
allowed for the de\-vel\-op\-ment of numerous ``Forth chips,'' customized
for the execution of the Forth language.}

\uline{%
In order to take full advantage of evolving technology, many Forth
implementations ignored some of the restrictions imposed by the
implied ``virtual machine'' of previous standards.
The ANS Forth committee was formed in 1987 to address the fragmentation
within the Forth community caused not only by the difference between
Forth 79 and Forth 83 but the exploitation of technical developments.}

\uline{%
The committee undertook a comprehensive review of a variety of existing
implementations, especially those with substantial user bases and/or
considerable success in the market place.  This allowed them to identify
and document features common to these systems, many of which had not been
included in any previous standard.}

\uline{%
The committee chose to move away from prescribing stringent requirements
as previous standards had, with the specification of a virtual machine.
It preferred to describe the operation of the virtual machine, without
reference to its implementation, thus allowing an implementor to take
full advantage of any technical developments while providing the
developer with a complete list of entitlements.}

\uline{%
This required the identification of implicit assumptions made by the
previous standards, making them explicit and abstracting them into
more general concepts where possible.  A good example of this is the
size of an item on the stack.  In previous standards this was assumed
to be 16-bits wide.  This was no longer a valid assumption.  ANS Forth
introduced the concept of the \emph{cell}, allowing the an implementation
to use a stack size most suited to the environment.}

\uline{%
This was the most comprehensive review of Forth systems to date, taking
eighty seven days covering twenty three meetings over eight years.
The inclusive nature of the standard allowed the various factions within
the community to unify in support of ANS Forth, with many systems
providing a comparability layer.}

\uline{%
The American National Standards Institution (ANSI) published the ANS
Forth Standard in 1994 with the title ``\emph{ANSI X3.215-1994
pknaggs's avatar
F94  
pknaggs committed
250 251 252
Information Systems --- Programming Language FORTH}''.  This is referenced
throughout this document as Forth 94.}

253
\section[ISO Forth (1997)]{\uline{ISO Forth (1997)}}
pknaggs's avatar
F94  
pknaggs committed
254 255 256 257 258 259 260 261 262 263 264
\label{diff:iso}

\uline{%
ANSI submitted the Forth 94 Standard to the
ISO (International Organization for Standardization) and
IEC (International Electrotechnical Commission) joint committee for
consideration as an international standard.
The ISO/IEC adopted the Forth 94 document as an international standard
in 1997, publishing it under the title ``\emph{ISO/IEC 15145:1997
Information technology.  Programming languages.  FORTH}''.
}
265 266


267 268
\section[Approach of this Standard]{\uline{Approach of this Standard}} % D.6
\label{diff:approach}
pknaggs's avatar
F94  
pknaggs committed
269

270 271 272 273 274 275 276 277 278 279 280 281 282
\uline{%
During a workshop on the Forth standard at the EuroForth conference in
2004 it was agreed that the Forth 94 required updating.}

\uline{%
A committee was formed and agreed that the process should be as open
as possible, adopting the Usenet RfD/CfV (Request for Discussion/Call
for Votes) process to produce semi-formal proposals for changes to the
standard.  In addition to general discussion on the \texttt{comp.lang.forth}
usenet news group, a moderated mailing list (with public archive) was
created for those who do not follow the news group.
Standards meetings to discuss CfVs were held in public in
conjunction with the EuroForth conference.}
283

284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
\uline{%
The work of the Forth 94 Committee was the basis of this standard,
informally called Forth 200\emph{x}.  The aim of the Forth 200\emph{x}
committe is to produce a rolling document, with the standard constantly
being updated based on discussion of proposals and the corresponding
votes.  A snapshot document is occasionally produced, with this document
being the first.}

\uline{%
The Forth 200\emph{x} committee defined a procedure for proposals.  In
addition to the formal text of the proposal, they had to include:
the rationale behind the change;
a reference implementation, or a description of the reason a reference
implementation cannot be presented;
unit testing for the proposed change, especially for border conditions.
See \xref[Process]{process} (page \pageref{process}) for a full description.}


\section[Differences from Forth 83]{\sout{Differences from Forth 83}} % D.6

\subsection[Stack width]{\sout{Stack width}} % D.6.1

\sout{%
307 308 309
Forth 83 specifies that stack items occupy 16 bits. This includes
addresses, flags, and numbers. ANS Forth specifies that stack items
are at least 16 bits; the actual size must be documented by the
310
implementation.}
311 312

\begin{description}
313 314
\item[\sout{Words affected:}]
	\sout{all arithmetic, logical and addressing operators}
315

316 317 318
\item[\sout{Reason:}]
	\sout{32-bit machines are becoming commonplace. A 16-bit Forth
	system on a 32-bit machine is not competitive.}
319

320 321
\item[\sout{Impact:}]
	\sout{Programs that assume 16-bit stack width will continue to run on
322 323
	16-bit machines; ANS Forth does not require a different stack
	width, but simply allows it. Many programs will be unaffected
324
	(but see ``address unit'').}
325

326 327
\item[\sout{Transition/Conversion:}]
	\sout{Programs which use bit masks with the high bits set may have to
328 329 330
	be changed, substituting either an implementation-defined bit-mask
	constant, or a procedure to calculate a bit mask in a
	stack-width-independent way. Here are some procedures for
331
	constructing width-in\-de\-pend\-ent bit masks:}
pknaggs's avatar
pknaggs committed
332 333

	\begin{tt}
334 335
		\sout{1 \word{CONSTANT} LO-BIT} \\
		\sout{\word{TRUE} 1 \word{RSHIFT}
336
			\quad \word{INVERT}
337 338
			\quad \word{CONSTANT} HI-BIT} \\
		\sout{\word{:} LO-BITS \word{p} n -{}- mask )
339 340 341
			0 \word{SWAP}	0 \word{qDO}
				1 \word{LSHIFT}		LO-BIT \word{OR}
			\word{LOOP}
342 343
		\word{;}} \\
		\sout{\word{:} HI-BITS \word{p} n -{}- mask )
344 345 346
			0 \word{SWAP}	0 \word{qDO}
				1 \word{RSHIFT}	HI-BIT \word{OR}
			\word{LOOP}
347
		\word{;}}
pknaggs's avatar
pknaggs committed
348
	\end{tt}
349 350
\end{description}

351
\sout{%
352 353 354 355 356
Programs that depend upon the ``modulo 65536'' behavior implicit in
16-bit arithmetic operations will need to be rewritten to explicitly
perform the modulus operation in the appropriate places. The committee
believes that such assumptions occur infrequently. Examples: some
checksum or CRC calculations, some random number generators and most
357
fixed-point fractional math.}
358

359
\subsection[Number representation]{\sout{Number representation}} % D.6.2
360

361
\sout{%
362 363
Forth 83 specifies two's-complement number representation and
arithmetic. ANS Forth also allows one's-complement and
364
signed-magnitude.}
365 366

\begin{description}
367 368
\item[\sout{Words affected:}]
\sout{%
369 370
	all arithmetic and logical operators,
	\word{LOOP},
371
	\word{+LOOP}.}
372

373 374
\item[\sout{Reason:}]
\sout{%
375 376 377 378 379 380
	Some computers use one's-complement or signed-magnitude. The
	committee did not wish to force Forth implementations for those
	machines to emulate two's-complement arithmetic, and thus incur
	severe performance penalties. The experience of some committee
	members with such machines indicates that the usage restrictions
	necessary to support their number representations are not overly
381
	burdensome.}
382

383 384
\item[\sout{Impact:}]
\sout{%
385
	An ANS Forth Standard Program may declare an ``environmental
pknaggs's avatar
pknaggs committed
386
	dependency on two's-com\-ple\-ment arithmetic''. This means that the
387 388 389 390
	otherwise-Standard Program is only guaranteed to work on
	two's-complement machines. Effectively, this is not a severe
	restriction, because the overwhelming majority of current
	computers use two's-complement. The committee knows of no Forth-83
pknaggs's avatar
pknaggs committed
391
	com\-pli\-ant implementations for non-two's-complement machines at
392
	present, so existing Forth-83 programs will still work on the same
393
	class of machines on which they currently work.}
394

395 396
\item[\sout{Transition/Conversion:}]
\sout{%
397 398
	Existing programs wishing to take advantage of the possibility of
	ANS Forth Standard Systems on non-two's-complement machines may
pknaggs's avatar
pknaggs committed
399
	do so by eliminating the use of a\-rith\-me\-tic operators to perform
400 401 402 403
	logical functions, by deriving bit-mask constants from bit
	operations as described in the section about stack width, by
	restricting the usage range of unsigned numbers to the range of
	positive numbers, and by using the provided operators for
404
	conversion from single numbers to double numbers.}
405 406
\end{description}

407
\subsection[Address units]{\sout{Address units}} % D.6.3
408

409
\sout{%
410 411 412 413 414 415
Forth 83 specifies that each unique address refers to an 8-bit byte
in memory. ANS Forth specifies that the size of the item referred to
by each unique address is implementation-defined, but, by default,
is the size of one character. Forth 83 describes many memory
operations in terms of a number of bytes. ANS Forth describes those
operations in terms of a number of either characters or address
416
units.}
417 418

\begin{description}
419 420
\item[\sout{Words affected:}]
	\sout{those with ``address unit'' arguments}
421

422 423
\item[\sout{Reason:}]
\sout{%
424
	Some machines, including the most popular Forth chip, address
425
	16-bit memory locations instead of 8-bit bytes.}
426

427 428
\item[\sout{Impact:}]
\sout{%
429 430 431 432 433 434 435 436 437
	Programs may choose to declare an environmental dependency on
	byte addressing, and will continue to work on the class of
	machines for which they now work. In order for a Forth
	implementation on a word-addressed machine to be Forth 83
	compliant, it would have to simulate byte addressing at
	considerable cost in speed and memory efficiency. The committee
	knows of no such Forth-83 implementations for such machines,
	thus an environmental dependency on byte addressing does not
	restrict a Standard Program beyond its current de facto
438
	restrictions.}
439

440 441
\item[\sout{Transition/Conversion:}]
\sout{%
442 443 444 445 446
	The new \word{CHARS} and \word{CHAR+} address arithmetic operators
	should be used for programs that require portability to
	non-byte-addressed machines. The places where such conversion is
	necessary may be identified by searching for occurrences of words
	that accept a number of address units as an argument (e.g.,
447
	\word{MOVE}, \word{ALLOT}).}
448 449
\end{description}

450
\subsection[Address increment for a cell is no longer two]{\sout{Address increment for a cell is no longer two}} % D.6.4
451

452
\sout{%
453 454 455 456 457
As a consequence of Forth-83's simultaneous specification of 16-bit
stack width and byte addressing, the number two could reliably be used
in address calculations involving memory arrays containing items from
the stack. Since ANS Forth requires neither 16-bit stack width nor
byte addressing, the number two is no longer necessarily appropriate
458
for such calculations.}
459 460

\begin{description}
461 462
\item[\sout{Words affected:}]
\sout{%
463
	\word{@}	\word{!}	\word{+!}	\texttt{2+}
464
	\word{2*}	\texttt{2-}	\word{+LOOP}}
465

466 467 468
\item[\sout{Reason:}]
\sout{%
	See reasons for ``Address Units'' and ``Stack Width''}
469

470 471
\item[\sout{Impact:}]
\sout{%
472 473 474 475 476 477
	In this respect, existing programs will continue to work on
	machines where a stack cell occupies two address units when
	stored in memory. This includes most machines for which
	Forth 83 compliant implementations currently exist. In principle,
	it would also include 16-bit-word-addressed machines with 32-bit
	stack width, but the committee knows of no examples of such
478
	machines.}
479

480 481
\item[\sout{Transition/Conversion:}]
\sout{%
482 483 484 485 486
	The new \word{CELLS} and \word{CELL+} address arithmetic operators
	should be used for portable programs. The places where such
	conversion is necessary may be identified by searching for the
	character ``2'' and determining whether or not it is used as part
	of an address calculation. The following substitutions are
487
	appropriate within address calculations:}
488 489 490 491

	\begin{center}
	  \begin{tabular}{cl}
	  \hline\hline
492
	  \sout{Old} & \sout{New} \\
493
	  \hline
494 495 496 497 498
		\sout{\texttt{2+} or \texttt{2} \word{+}}	& \sout{\word{CELL+}} \\
		\sout{\word{2*}   or \texttt{2} \word{*}}	& \sout{\word{CELLS}} \\
		\sout{\texttt{2-} or \texttt{2} \word{-}}	& \sout{1 \word{CELLS} \word{-}} \\
		\sout{\word{2/}   or \texttt{2} \word{/}}	& \sout{1 \word{CELLS} \word{/}} \\
		\sout{\texttt{2}}							& \sout{1 \word{CELLS}} \\
499 500 501 502 503
	  \hline\hline
	  \end{tabular}
	\end{center}
\end{description}

504
\sout{%
505 506 507
The number ``2'' by itself is sometimes used for address calculations
as an argument to \word{+LOOP}, when the loop index is an address. When
converting the word \word{2/} which operates on negative dividends, one
508
should be cognizant of the rounding method used.}
509

510
\subsection[Address alignment]{\sout{Address alignment}} % D.6.5
511

512
\sout{%
513 514 515
Forth 83 imposes no restriction upon the alignment of addresses to
any boundary. ANS Forth specifies that a Standard System may require
alignment of addresses for use with various ``\word{@}'' and
516
``\word{!}'' operators.}
517 518

\begin{description}
519 520
\item[\sout{Words Affected:}]
\sout{%
521
	\word{!}	\word{+!}		\word{2!}	\word{2@}
522
	\word{@}	\word[tools]{q}	\word{,}}
523

524 525
\item[\sout{Reason:}]
\sout{%
526 527 528 529
	Many computers have hardware restrictions that favor the use of
	aligned addresses. On some machines, the native memory-access
	instructions will cause an exception trap if used with an
	unaligned address. Even on machines where unaligned accesses do
530
	not cause exception traps, aligned accesses are usually faster.}
531

532 533
\item[\sout{Impact:}]
\sout{%
534 535 536 537
	All of the ANS Forth words that return addresses suitable for
	use with aligned ``\word{@}'' and ``\word{!}'' words must return
	aligned addresses. In most cases, there will be no problem.
	Problems can arise from the use of user-defined data structures
538
	containing a mixture of character data and cell-sized data.}
539

540
\sout{%
541 542 543 544
	Many existing Forth systems, especially those currently in use on
	computers with strong alignment requirements, already require
	alignment. Much existing Forth code that is currently in use on
	such machines has already been converted for use in an aligned
545
	environment.}
546

547 548
\item[\sout{Transition/Conversion:}]
\sout{%
549
	There are two possible approaches to conversion of programs for
550
	use on a system requiring address alignment.}
551

552
\sout{%
553 554 555 556
	The easiest approach is to redefine the system's aligned
	``\word{@}'' and ``\word{!}'' operators so that they do not
	require alignment. For example, on a 16-bit little-endian
	byte-addressed machine, unaligned ``\word{@}'' and ``\word{!}''
557
	could be defined:}
558
	\begin{quote}\ttfamily
559
		\sout{\word{:} \word{@} \word{p} addr -{}- x )
560 561 562
			\word{DUP} \word{C@} \word{SWAP}
			\word{CHAR+} \word{C@} 8
			\word{LSHIFT} \word{OR}
563 564
		\word{;}} \\
		\sout{\word{:} \word{!} \word{p} x addr -{}- )
565 566 567
			\word{OVER} 8 \word{RSHIFT}
			\word{OVER} \word{CHAR+}
			\word{C!} \word{C!}
568
		\word{;}}
569
	\end{quote}
570
\sout{%
571 572 573
	These definitions, and similar ones for ``\word{+!}'',
	``\word{2@}'', ``\word{2!}'', ``\word{,}'', and
	``\word[tools]{q}'' as needed, can be compiled before an
574
	unaligned application, which will then work as expected.}
575

576
\sout{%
577 578
	This approach may conserve memory if the application uses
	substantial numbers of data structures containing unaligned
579
	fields.}
580

581
\sout{%
582 583 584 585 586 587
	Another approach is to modify the application's source code to
	eliminate unaligned data fields. The ANS Forth words \word{ALIGN}
	and \word{ALIGNED} may be used to force alignment of data fields.
	The places where such alignment is needed may be determined by
	inspecting the parts of the application where data structures
	(other than simple variables) are defined, or by ``smart compiler''
588
	techniques (see the ``Smart Compiler'' discussion below).}
589

590
\sout{%
591 592
	This approach will probably result in faster application execution
	speed, at the possible expense of increased memory utilization for
593
	data structures.}
594

595
\sout{%
596 597 598 599
	Finally, it is possible to combine the preceding techniques by
	identifying exactly those data fields that are unaligned, and
	using ``unaligned'' versions of the memory access operators for
	only those fields. This ``hybrid'' approach affects a compromise
600
	between execution speed and memory utilization.}
601 602 603
\end{description}


604
\subsection[Division/modulus rounding direction]{\sout{Division/modulus rounding direction}} % D.6.6
605

606
\sout{%
607 608 609 610 611 612
Forth 79 specifies that division rounds toward 0 and the remainder
carries the sign of the dividend. Forth 83 specifies that division
rounds toward negative infinity and the remainder carries the sign
of the divisor. ANS Forth allows either behavior for the division
operators listed below, at the discretion of the implementor, and
provides a pair of division primitives to allow the user to
613
synthesize either explicit behavior.}
614 615

\begin{description}
616 617
\item[\sout{Words Affected:}]
\sout{%
618
	\word{/}		\word{MOD}		\word{/MOD}
619
	\word{*/MOD}	\word{*/}}
620

621 622
\item[\sout{Reason:}]
\sout{%
623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639
	The difference between the division behaviors in Forth 79 and
	Forth 83 was a point of much contention, and many Forth
	implementations did not switch to the Forth 83 behavior. Both
	variants have vocal proponents, citing both application
	requirements and execution efficiency arguments on both sides.
	After extensive debate spanning many meetings, the committee was
	unable to reach a consensus for choosing one behavior over the
	other, and chose to allow either behavior as the default, while
	providing a means for the user to explicitly use both behaviors
	as needed. Since implementors are allowed to choose either
	behavior, they are not required to change the behavior exhibited
	by their current systems, thus preserving correct functioning of
	existing programs that run on those systems and depend on a
	particular behavior. New implementations could choose to supply
	the behavior that is supported by the native CPU instruction set,
	thus maximizing execution speed, or could choose the behavior
	that is most appropriate for the intended application domain of
640
	the system.}
641

642 643
\item[\sout{Impact:}]
\sout{%
644 645 646 647
	The issue only affects programs that use a negative dividend with
	a positive divisor, or a positive dividend with a negative divisor.
	The vast majority of uses of division occur with both a positive
	dividend and a positive divisor; in that case, the results are the
648
	same for both allowed division behaviors.}
649

650 651
\item[\sout{Transition/Conversion:}]
\sout{%
652 653 654 655 656 657 658
	For programs that require a specific rounding behavior with division
	operands of mixed sign, the division operators used by the program
	may be redefined in terms of one of the new ANS Forth division
	primitives \word{SM/REM} (symmetrical division, i.e., round toward
	zero) or \word{FM/MOD} (floored division, i.e., round toward
	negative infinity). Then the program may be recompiled without
	change. For example, the Forth 83 style division operators may be
659
	defined by:}
660
	\begin{quote}\ttfamily
661 662 663 664 665 666 667 668 669 670
		\sout{\word{:} \word{/MOD}~ \word{p} n1 n2 -{}- n3 n4 ) ~~
			\word{toR} \word{StoD} \word{Rfrom} \word{FM/MOD} \word{;}} \\
		\sout{\word{:} \word{MOD}~~ \word{p} n1 n2 -{}- n3 ) ~~~~~
			\word{/MOD} \word{DROP}  \word{;}} \\
		\sout{\word{:} \word{/}~~~~ \word{p} n1 n2 -{}- n3 ) ~~~~~
			\word{/MOD} \word{SWAP} \word{DROP}  \word{;}} \\
		\sout{\word{:} \word{*/MOD} \word{p} n1 n2 n3 -{}- n4 n5 )
			\word{toR} \word{M*} \word{Rfrom} \word{FM/MOD} \word{;}} \\
		\sout{\word{:} \word{*/}~~~ \word{p} n1 n2 n3 -{}- n4 n5 )
			\word{*/MOD} \word{SWAP} \word{DROP}  \word{;}} \\
671 672 673 674
	\end{quote}
\end{description}


675
\subsection[Immediacy]{\sout{Immediacy}} % D.6.7
676 677
\label{diff:immediate}

678
\sout{%
679 680 681 682 683
Forth 83 specified that a number of ``compiling words'' are
``immediate'', meaning that they are executed instead of compiled
during compilation. ANS Forth is less specific about most of these
words, stating that their behavior is only defined during compilation,
and specifying their results rather than their specific compile-time
684
actions.}
685

686
\sout{%
687
To force the compilation of a word that would normally be executed,
pknaggs's avatar
pknaggs committed
688
Forth 83 provided the words \linebreak \texttt{COMPILE}, used with non-immediate
689 690 691
words, and \word{[COMPILE]}, used with immediate words. ANS Forth
provides the single word \word{POSTPONE}, which is used with both
immediate and non-immediate words, automatically selecting the
692
appropriate behavior.}
693 694

\begin{description}
695 696
\item[\sout{Words Affected:}]
\sout{%
697
	\texttt{COMPILE}	\word{[COMPILE]}
698
	\word{[']}			\word{'}}
699

700 701
\item[\sout{Reason:}]
\sout{%
702 703 704 705 706 707 708 709 710 711 712
	The designation of particular words as either immediate or not
	depends upon the implementation technique chosen for the Forth
	system. With traditional ``threaded code'' implementations, the
	choice was generally quite clear (with the single exception of
	the word \word{LEAVE}), and the standard could specify which words
	should be immediate. However, some of the currently popular
	implementation techniques, such as native-code generation with
	optimization, require the immediacy attribute on a different set
	of words than the set of immediate words of a threaded code
	implementation. ANS Forth, acknowledging the validity of these
	other implementation techniques, specifies the immediacy attribute
713
	in as few cases as possible.}
714

715
\sout{%
716 717 718 719 720 721
	When the membership of the set of immediate words is unclear, the
	decision about whether to use \texttt{COMPILE} or \word{[COMPILE]}
	becomes unclear. Consequently, ANS Forth provides a ``general
	purpose'' replacement word \word{POSTPONE} that serves the purpose
	of the vast majority of uses of both \texttt{COMPILE} and
	\word{[COMPILE]}, without requiring that the user know whether or
722
	not the ``postponed'' word is immediate.}
723

724
\sout{%
725 726 727
	Similarly, the use of \word{'} and \word{[']} with compiling words
	is unclear if the precise compilation behavior of those words is
	not specified, so ANS Forth does not permit a Standard Program to
728
	use \word{'} or \word{[']} with compiling words.}
729

730
\sout{%
731 732 733 734 735 736 737 738 739 740
	The traditional (non-immediate) definition of the word \texttt{COMPILE}
	has an additional problem. Its traditional definition assumes a
	threaded code implementation technique, and its behavior can only
	be properly described in that context. In the context of ANS Forth,
	which permits other implementation techniques in addition to
	threaded code, it is very difficult, if not impossible, to describe
	the behavior of the traditional \texttt{COMPILE}. Rather than changing
	its behavior, and thus breaking existing code, ANS Forth does not
	include the word \texttt{COMPILE}. This allows existing implementations
	to continue to supply the word \texttt{COMPILE} with its traditional
741
	behavior, if that is appropriate for the implementation.}
742

743 744
\item[\sout{Impact:}]
\sout{%
745 746 747 748 749 750 751 752
	\word{[COMPILE]} remains in ANS Forth, since its proper use does
	not depend on knowledge of whether or not a word is immediate (Use
	of \word{[COMPILE]} with a non-immediate word is and has always
	been a no-op). Whether or not you need to use \word{[COMPILE]}
	requires knowledge of whether or not its target word is immediate,
	but it is always safe to use \word{[COMPILE]}. \word{[COMPILE]}
	is no longer in the (required) core word set, having been moved
	to the Core Extensions word set, but the committee anticipates
753
	that most vendors will supply it anyway.}
754

755
\sout{%
756 757 758 759
	In nearly all cases, it is correct to replace both \word{[COMPILE]}
	and \texttt{COMPILE} with \word{POSTPONE}. Uses of \word{[COMPILE]}
	and \texttt{COMPILE} that are not suitable for ``mindless'' replacement
	by \word{POSTPONE} are quite infrequent, and fall into the following
760
	two categories:}
761 762

	\begin{itemize}
763 764
	\item \sout{%
Use of \word{[COMPILE]} with non-immediate words. This is
765 766 767 768
		sometimes done with the words \word{'} (tick, which was
		immediate in Forth 79 but not in Forth 83) and \word{LEAVE}
		(which was immediate in Forth 83 but not in Forth 79), in
		order to force the compilation of those words without regard
769
		to whether you are using a Forth 79 or Forth 83 system.}
770

771 772 773
	\item \sout{%
Use of the phrase \texttt{COMPILE} \word{[COMPILE]}
		\arg{immediate word} to ``doubly postpone'' an immediate word.}
774 775
	\end{itemize}

776 777
\item[\sout{Transition/Conversion:}]
\sout{%
778 779
	Many ANS Forth implementations will continue to implement both
	\word{[COMPILE]} and \texttt{COMPILE} in forms compatible with
780
	existing usage. In those environments, no conversion is necessary.}
781

782
\sout{%
783 784 785 786 787 788
	For complete portability, uses of \texttt{COMPILE} and \word{[COMPILE]}
	should be changed to \word{POSTPONE}, except in the rare cases
	indicated above. Uses of \word{[COMPILE]} with non-immediate words
	may be left as-is, and the program may declare a requirement for
	the word \word{[COMPILE]} from the Core Extensions word set, or
	the \word{[COMPILE]} before the non-immediate word may be simply
789
	deleted if the target word is known to be non-immediate.}
790

791
\sout{%
792 793 794
	Uses of the phrase \texttt{COMPILE} \word{[COMPILE]}
	\arg{immediate-word} may be handled by introducing an
	``intermediate word'' (\texttt{XX} in the example below) and then
795
	postponing that word. For example:}
796
	\begin{quote}\ttfamily
797
		\sout{\word{:} ABC COMPILE \word{[COMPILE]} \word{IF} \word{;}}
798
	\end{quote}
799
\sout{changes to:}
800
	\begin{quote}\ttfamily
801 802
		\sout{\word{:} XX \word{POSTPONE} \word{IF} \word{;}} \\
		\sout{\word{:} ABC \word{POSTPONE} XX \word{;}}
803
	\end{quote}
804
\sout{%
805 806
	A non-standard case can occur with programs that ``switch out of
	compilation state'' to explicitly compile a thread in the
807
	dictionary following a \texttt{COMPILE}. For example:}
808
	\begin{quote}\ttfamily
809
		\sout{\word{:} XYZ COMPILE \word{[} \word{'} ABC \word{,} \word{]} \word{;}}
810
	\end{quote}
811
\sout{%
812 813 814 815
	This depends heavily on knowledge of exactly how \texttt{COMPILE}
	and the threaded-code implementation works. Cases like this cannot
	be handled mechanically; they must be translated by understanding
	exactly what the code is doing, and rewriting that section according
816
	to ANS Forth restrictions.}
817

818
\sout{%
819
	Use the phrase \word{POSTPONE} \word{[COMPILE]} to replace
820
	\word{[COMPILE]} \word{[COMPILE]}.}
821 822 823
\end{description}


824
\subsection[Input character set]{\sout{Input character set}} % D.6.8
825

826
\sout{%
827 828 829
Forth 83 specifies that the full 7-bit ASCII character set is
available through \word{KEY}. ANS Forth restricts it to the graphic
characters of the ASCII set, with codes from hex 20 to hex 7E
830
inclusive.}
831 832

\begin{description}
833 834
\item[\sout{Words Affected:}]
\sout{\word{KEY}}
835

836 837
\item[\sout{Reason:}]
\sout{%
838 839
	Many system environments ``consume'' certain control characters
	for such purposes as input editing, job control, or flow control.
840
	A Forth implementation cannot always control this system behavior.}
841

842 843
\item[\sout{Impact:}]
\sout{%
844 845
	Standard Programs which require the ability to receive particular
	control characters through \word{KEY} must declare an environmental
846
	dependency on the input character set.}
847

848 849
\item[\sout{Transition/Conversion:}]
\sout{%
850 851 852
	For maximum portability, programs should restrict their required
	input character set to only the graphic characters. Control
	characters may be handled if available, but complete program
853
	functionality should be accessible using only graphic characters.}
854

855
\sout{%
856 857 858 859 860 861 862
	As stated above, an environmental dependency on the input character
	set may be declared. Even so, it is recommended that the program
	should avoid the requirement for particularly-troublesome control
	characters, such as control-S and control-Q (often used for flow
	control, sometimes by communication hardware whose presence may be
	difficult to detect), ASCII NUL (difficult to type on many keyboards),
	and the distinction between carriage return and line feed (some
863
	systems translate carriage returns into line feeds, or vice versa).}
864 865 866
\end{description}


867
\subsection[Shifting with UM/MOD]{\sout{Shifting with \word{UM/MOD}}} % D.6.9
868

869
\sout{%
870 871 872 873 874
Given Forth-83's two's-complement nature, and its requirement for
floored (round toward minus infinity) division, shifting is equivalent
to division. Also, two's-complement representation implies that
unsigned division by a power of two is equivalent to logical
right-shifting, so \word{UM/MOD} could be used to perform a logical
875
right-shift.}
876 877

\begin{description}
878 879
\item[\sout{Words Affected:}]
\sout{\word{UM/MOD}}
880

881 882
\item[\sout{Reason:}]
\sout{%
883 884
	The problem with \word{UM/MOD} is a result of allowing
	non-two's-complement number representations, as already
885
	described.}
886

887
\sout{%
888 889 890
	ANS Forth provides the words \word{LSHIFT} and \word{RSHIFT}
	to perform logical shifts. This is usually more efficient, and
	certainly more descriptive, than the use of \word{UM/MOD} for
891
	logical shifting.}
892

893 894
\item[\sout{Impact:}]
\sout{%
895 896 897 898 899 900 901 902
	Programs running on ANS Forth systems with two's-complement
	arithmetic (the majority of machines), will not experience any
	incompatibility with \word{UM/MOD}. Existing Forth-83 Standard
	programs intended to run on non-two's-complement machines will
	not be able to use \word{UM/MOD} for shifting on a
	non-two's-complement ANS Forth system. This should not affect
	a significant number of existing programs (perhaps none at all),
	since the committee knows of no existing Forth-83 implementations
903
	on non-two's-complement machines.}
904

905 906
\item[\sout{Transition/Conversion:}]
\sout{%
907 908
	A program that requires \word{UM/MOD} to behave as a shift
	operation may declare an environmental dependency on
909
	two's-complement arithmetic.}
910

911
\sout{%
912 913 914
	A program that cannot declare an environmental dependency on
	two's-complement arithmetic may require editing to replace
	incompatible uses of \word{UM/MOD} with other operators defined
915
	within the application.}
916 917
\end{description}

918
\subsection[Vocabularies / wordlists]{\sout{Vocabularies / wordlists}} % D.6.10
919

920
\sout{%
921 922 923 924
ANS Forth does not define the words \texttt{VOCABULARY},
\texttt{CONTEXT}, and \texttt{CURRENT}, which were present in
Forth 83. Instead, ANS Forth defines a primitive word set for
search order specification and control, including words which have
925
not existed in any previous standard.}
926

927
\sout{%
928 929
Forth-83's ``\word[search]{ALSO}/\word[search]{ONLY}'' experimental
search order word set is specified for the most part as the extension
930
portion of the ANS Forth Search Order word set.}
931 932

\begin{description}
933 934
\item[\sout{Words Affected:}]
\sout{\texttt{VOCABULARY}	\texttt{ CONTEXT}	\texttt{CURRENT}}
935

936 937
\item[\sout{Reason:}]
\sout{%
938
	Vocabularies are an area of much divergence among existing systems.
pknaggs's avatar
pknaggs committed
939
	Considering major ven\-dors' systems and previous standards, there
940 941 942 943 944 945 946 947 948
	are at least 5 different and mutually incompatible behaviors of
	words defined by \texttt{VOCABULARY}. Forth 83 took a step in the
	direction of ``run-time search-order specification'' by declining
	to specify a specific relationship between the hierarchy of
	compiled vocabularies and the run-time search order. Forth 83 also
	specified an experimental mechanism for run-time search-order
	specification, the \word[search]{ALSO}/\word[search]{ONLY} scheme.
	\word[search]{ALSO}/\word[search]{ONLY} was implemented in numerous
	systems, and has achieved some measure of popularity in the Forth
949
	community.}
950

951
\sout{%
952 953 954 955 956 957 958 959
	However, several vendors refuse to implement it, citing technical
	limitations. In an effort to address those limitations and thus
	hopefully make \word[search]{ALSO}/\word[search]{ONLY} more
	palatable to its critics, the committee specified a simple
	``primitive word set'' that not only fixes some of the objections
	to \word[search]{ALSO}/\word[search]{ONLY}, but also provides
	sufficient power to implement \word[search]{ALSO}/\word[search]{ONLY}
	and all of the other search-order word sets that are currently
960
	popular.}
961

962
\sout{%
963 964 965 966 967 968 969 970 971 972 973 974 975
	The Forth 83 \word[search]{ALSO}/\word[search]{ONLY} word set is
	provided as an optional extension to the search-order word set.
	This allows implementors that are so inclined to provide this
	word set, with well-defined standard behavior, but does not
	compel implementors to do so. Some vendors have publicly stated
	that they will not implement \word[search]{ALSO}/\word[search]{ONLY},
	no matter what, and one major vendor stated an unwillingness to
	implement ANS Forth at all if \word[search]{ALSO}/\word[search]{ONLY}
	is mandated. The committee feels that its actions are prudent,
	specifying \word[search]{ALSO}/\word[search]{ONLY} to the extent
	possible without mandating its inclusion in all systems, and also
	providing a primitive search-order word set that vendors may be
	more likely to implement, and which can be used to synthesize
976
	\word[search]{ALSO}/\word[search]{ONLY}.}
977

978 979
\item[\sout{Transition/Conversion:}]
\sout{%
980 981 982 983 984 985 986
	Since Forth 83 did not mandate precise semantics for \texttt{VOCABULARY},
	existing Forth-83 Standard programs cannot use it except in a
	trivial way. Programs can declare a dependency on the existence
	of the Search Order word set, and can implement whatever semantics
	are required using that word set's primitives. Forth 83 programs
	that need \word[search]{ALSO}/\word[search]{ONLY} can declare a
	dependency on the Search Order Extensions word set, or can implement
987
	the extensions in terms of the Search Order word set itself.}
988 989 990
\end{description}


991
\subsection[Multiprogramming impact]{\sout{Multiprogramming impact}} % D.6.11
pknaggs's avatar
pknaggs committed
992
\label{diff:multitasking}
993

994
\sout{%
995 996
Forth 83 marked words with ``multiprogramming impact'' by the letter
``M'' in the first lines of their descriptions. ANS Forth has removed
pknaggs's avatar
pknaggs committed
997
the ``M'' designation from the word descriptions, moving the dis\-cus\-sion
998
of multiprogramming impact to this non-normative annex.}
999 1000

\begin{description}
1001 1002
\item[\sout{Words affected:}]
\sout{none}
1003

1004 1005
\item[\sout{Reason:}]
\sout{%
1006 1007 1008 1009 1010 1011 1012
	The meaning of ``multiprogramming impact'' is precise only in the
	context of a specific model for multiprogramming. Although many
	Forth systems do provide multiprogramming capabilities using a
	particular round-robin, cooperative, block-buffer sharing model,
	that model is not universal. Even assuming the classical model,
	the ``M'' designations did not contain enough information to
	enable writing of applications that interacted in a multiprogrammed
1013
	system.}
1014

1015
\sout{%
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027
	Practically speaking, the ``M'' designations in Forth 83 served
	to document usage rules for block buffer addresses in multiprogrammed
	systems. These addresses often become meaningless after a task
	has relinquished the CPU for any reason, most often for the
	purposes of performing I/O, awaiting an event, or voluntarily
	sharing CPU resources using the word \texttt{PAUSE}. It was
	essential that portable applications respect those usage rules to
	make it practical to run them on multiprogrammed systems; failure
	to adhere to the rules could easily compromise the integrity of
	other applications running on those systems as well as the
	applications actually in error. Thus, ``M'' appeared on all words
	that by design gave up the CPU, with the understanding that other
1028
	words NEVER gave it up.}
1029

1030
\sout{%
1031 1032
	These usage rules have been explicitly documented in the Block
	word set where they are relevant. The ``M'' designations have
1033
	been removed entirely.}
1034

1035 1036
\item[\sout{Impact:}]
\sout{In practice, none.}
1037

1038
\sout{%
1039 1040 1041 1042
	In the sense that any application that depends on multiprogramming
	must consist of at least two tasks that share some resource(s) and
	communicate between themselves, Forth 83 did not contain enough
	information to enable writing of a standard program that DEPENDED
1043
	on multiprogramming. This is also true of ANS Forth.}
1044

1045
\sout{%
1046 1047 1048
	Non-multiprogrammed applications in Forth 83 were required to
	respect usage rules for \word[block]{BLOCK} so that they could be
	run properly on multiprogrammed systems. The same is true of
1049
	ANS Forth.}
1050

1051
\sout{%
1052 1053 1054
	The only difference is the documentation method used to define
	the \word[block]{BLOCK} usage rules. The Technical Committee
	believes that the current method is clearer than the concept of
1055
	``multi\-pro\-gram\-ming impact''.}
1056

1057 1058
\item[\sout{Transition/Conversion:}]
	\sout{none needed.}
1059 1060 1061
\end{description}


1062
\subsection[Words not provided in executable form]{\sout{Words not provided in executable form}} % D.6.12
1063

1064
\sout{%
1065 1066
ANS Forth allows an implementation to supply some words in source
code or ``load as needed'' form, rather than requiring all supplied
1067
words to be available with no additional programmer action.}
1068 1069

\begin{description}
1070 1071
\item[\sout{Words affected:}]
\sout{all}
1072

1073 1074
\item[\sout{Reason:}]
\sout{
1075 1076 1077 1078 1079 1080
	Forth systems are often used in environments where memory space
	is at a premium. Every word included in the system in executable
	form consumes memory space. The committee believes that allowing
	standard words to be provided in source form will increase the
	probability that implementors will provide complete ANS Forth
	implementations even in systems designed for use in constrained
1081
	environments.}
1082

1083 1084
\item[\sout{Impact:}]
\sout{%
1085 1086 1087 1088 1089
	In order to use a Standard Program with a given ANS Forth
	implementation, it may be necessary to precede the program with
	an implementation-dependent ``preface'' to make ``source form''
	words executable. This is similar to the methods that other
	computer languages require for selecting the library routines
1090
	needed by a particular application.}
1091

1092
\sout{%
1093 1094 1095 1096 1097
	In languages like C, the goal of eliminating unnecessary routines
	from the memory image of an application is usually accomplished
	by providing libraries of routines, using a ``linker'' program
	to incorporate only the necessary routines into an executable
	application. The method of invoking and controlling the linker
1098
	is outside the scope of the language definition.}
1099

1100 1101
\item[\sout{Transition/Conversion:}]
\sout{%
1102 1103
	Before compiling a program, the programmer may need to perform
	some action to make the words required by that program available
1104
	for execution.}
1105
\end{description}
pknaggs's avatar
pknaggs committed
1106 1107

% =========================================================
pknaggs's avatar
pknaggs committed
1108
\cbend
1109 1110 1111 1112

\newpage
\cbstart\patch{ed12}
\section{Differences from Forth 94} % D.6
pknaggs's avatar
pknaggs committed
1113
\label{diff:forth94}
pknaggs's avatar
pknaggs committed
1114

1115 1116
\subsection[Removed Obsolete Words]{Removed \sout{Definitions} \uline{Obsolete Words}} % D.7.1

pknaggs's avatar
pknaggs committed
1117
	This standard removes six words that were marked `obsolescent'
1118
	in the \replace{ed12}{ANS Forth}{Forth 94} document.  These are:
pknaggs's avatar
pknaggs committed
1119 1120

\begin{tabular}{rl@{\qquad}rl@{\qquad}rl}
pknaggs's avatar
pknaggs committed
1121 1122 1123 1124 1125 1126
	6.2.0060	& \textbf{\#TIB}
&	6.2.1390	& \textbf{EXPECT}
&	6.2.2240	& \textbf{SPAN} \\
	6.2.0970	& \textbf{CONVERT}
&	6.2.2040	& \textbf{QUERY}
&	6.2.2290	& \textbf{TIB} \\
pknaggs's avatar
pknaggs committed
1127 1128
\end{tabular}

1129
\remove{ed12}{Reuse of these names is strongly discouraged.}
pknaggs's avatar
pknaggs committed
1130

pknaggs's avatar
F94  
pknaggs committed
1131 1132 1133
\subsection{Obsolescent features}
\label{diff:94:obsolete}

1134
	This standard has designated the following practice as obsolescent:
pknaggs's avatar
F94  
pknaggs committed
1135 1136

\begin{itemize}
1137 1138
\item Requiring floating-point numbers to be kept on the data stack.
	(This has always been an environmental dependency.)
pknaggs's avatar
F94  
pknaggs committed
1139

1140
\item Using \word{ENVIRONMENTq} to enquire whether a word set is present.
pknaggs's avatar
F94  
pknaggs committed
1141
\end{itemize}
1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474

% \uline{Forth 94 declared seven words as `obsolescent', all but \word[tools]{FORGET} have
% been removed from this standard.}
%  
% \begin{description}
% \item[\uline{Words affected:}]
% \uline{\texttt{\#TIB},
%  	\texttt{CONVERT},
%  	\texttt{EXPECT},
%  	\texttt{QUERY},
%  	\texttt{SPAN},
%  	\texttt{TIB},
%  	\word{WORD}.}
%  
% \item[\uline{Reason:}]
% \uline{Obsolescent words have been removed.}
%  
% \item[\uline{Impact:}]
% \uline{\word{WORD} is no longer required to leave a space at the
%  	end of the returned string.}
%  
% \item[\uline{Transition/Conversion:}]
% \uline{The function of \texttt{TIB} and \texttt{\#TIB} has been
%  	superseded by \word{SOURCE}.}
% 
% \uline{The function of \texttt{CONVERT} has been superseded by
% 	\word{toNUMBER}.}
% 
% \uline{The function of \texttt{EXPECT} and \texttt{SPAN} have
% 	been superseded by \word{ACCEPT}.}
% 
% \uline{The function of \texttt{QUERY} may be performed with
% 	\word{ACCEPT} and \word{EVALUATE}.}
% \end{description}
% 
% 
% \subsection{Combined Floating-point/Data Stack Obsolescent} % D.7.2
% 
% The requirement for floating-point numbers to be kept on the data stack
% has been marked as obsolescent.  This was previously an environmental
% dependency/restriction.
% 
% \begin{description}
% \item[Words Affected:]
% 	All floating-point words.
% 
% \item[Reason:]
% 	The developing of software that may be used with either a combined
% 	stack or a separate stack is extremely difficult and costly.  While
% 	some of the systems surveyed provide a combined floating-point/data
% 	stack, they all provide a separate floating-point stack.
% 
% \item[Impact:]
% %	Any code that has an environmental dependency on the uses of a
% %	combined floating-point/data stack will become obsolescent and should
% %	be ported to use a separate floating-point stack.
% %
% %	A system that has an environmental restriction on using a combined
% %	floating-point/data stack will become obsolescent.  Such systems
% %	should consider providing a separate floating-point stack, simulating
% %	a floating-point stack if required.
% 
% 	Forth 94 programs with an environmental dependency on a separate
% 	floating-point stack become standard programs.
% 
% 	Forth 94 programs with an environmental dependency on a combined
% 	stack r