內容列表(Table of Contents)


A. 基本理論(教育性的附件) Rationale (informative annex)


A.1 介紹(Introduction)


A.1.1 目的(Purpose)


A.1.2 範圍(Scope)

這個標準比之前的 Forth 語言工業標準更廣大. 數個事情讓這樣子是必要的:

This Standard is more extensive than previous industry standards for the Forth language. Several things made this necessary:

這個努力的結果是以一種標準排列來滿足了那些所有的目的, 因此所需的詞集保持小量. 因此 ANS Forth 可以提供給花費資源的內嵌式系統使用. 超過需要詞集的那些詞是安排成一些選用詞集和它們的延伸, 允許了修改過的實作系統是標準的.

The result of the effort to satisfy all of these objectives is a Standard arranged so that the required word set remains small. Thus ANS Forth can be provided for resource-constrained embedded systems. Words beyond those in the required word set are organized into a number of optional word sets and their extensions, enabling implementation of tailored systems that are Standard.

當評估有關的價值時, X3J14 技術委員會的成員是由下列的目標所引導 (以字母順序列出):

When judging relative merits, the members of the X3J14 Technical Committee were guided by the following goals (listed in alphabetic order):

一貫性
這個標準提供了一個功能完全地詞集, 而只有最小部分的功能重疊.
Consistency
The Standard provides a functionally complete set of words with minimal functional overlap.
遵守的花費
這個目標包含了一般實際上的這樣的議題, 多少已經存在的程式碼將會被提議的改變所破壞, 和將已存在的應用程式和系統符合這個標準的努力需要的數量.
Cost of compliance
This goal includes such issues as common practice, how much existing code would be broken by the proposed change, and the amount of effort required to bring existing applications and systems into conformity with the Standard.
效能
執行速度, 記憶體的緊密.
Efficiency
Execution speed, memory compactness.
可移植性
被選擇用來包含進來的詞必須是免於系統相依的特色.
Portability
Words chosen for inclusion should be free of system-dependent features.
可讀性
Forth 定義名稱必須清楚敘述它們的行為. 那個行為必須有一個明顯的單純, 而支援快速地理解. Forth 必須易教並且支援可讀的維護程式碼.
Readability
Forth definition names should clearly delineate their behavior. That behavior should have an apparent simplicity which supports rapid understanding. Forth should be easily taught and support readily maintained code.
工具
被評價有充分地必要的功能和頻繁使用的是被認為適合包含.
Utility
Be judged to have sufficiently essential functionality and frequency of use to be deemed suitable for inclusion.


A.1.3 文件組織(Document organization)


A.1.3.1 詞集(Word sets)

從開始, X3J14 技術委員會面對不只衝突的意見, 如 真正的 Forth 是什麼, 也有在 Forth 社群中不同的團體的需要的衝突. 一個極端是要推行一個 最起碼的 Forth. 在另一個極端是要一個 豐富的 Forth. 許多是在兩者之間的某種程度. 所有人都堅信不疑它們自己的位置, 並且認為至少兩個極端的其中之一是錯的. 委員會的組成反應了這些主張的所有範圍.

From the beginning, the X3J14 Technical Committee faced not only conflicting ideas as to what real Forth is, but also conflicting needs of the various groups within the Forth community. At one extreme were those who pressed for a bare Forth. At the other extreme were those who wanted a fat Forth. Many were somewhere in between. All were convinced of the rightness of their own position and of the wrongness of at least one of the two extremes. The committee's composition reflected this full range of interests.

我們採用的方式是定義一個 核心詞集 建立於一個最低的系統功能需求底限, 而且提供一個選用詞集的投資組合給特殊需求所用. 這個簡單的方法並行的了 Forth 作為一個可延伸語言的自然基礎, 而因此達到了一種亞延伸性.

The approach we have taken is to define a Core word set establishing a greatest lower bound for required system functionality and to provide a portfolio of optional word sets for special purposes. This simple approach parallels the fundamental nature of Forth as an extensible language, and thereby achieves a kind of meta-extensibility.

由這個關鍵, 高層的妥協, 無論如何實際的獨立詞集的構造, 穩固的和可工作的架構建立在長期的條件中. 一個人可能或可能不同意必須有一個 區域詞集, 或詞 COMPILE, 屬於 核心延伸詞集. 但至少有一個機制可讓這樣的事情被以一種合理的和有序的方式包含.

With this key, high-level compromise, regardless of the actual makeup of the individual word sets, a firm and workable framework is established for the long term. One may or may not agree that there should be a Locals word set, or that the word COMPILE, belongs in the Core Extensions word set. But at least there is a mechanism whereby such things can be included in a logical and orderly manner.

這個選用詞集方案的數個牽涉是重要的.

Several implications of this scheme of optional word sets are significant.

首先, ANS Forth 系統可以繼續在一個巨大的硬體範圍實作, 它們可能被幾乎所有其他的單一語言奪走. 由於只有核心詞集是必須的, 非常有限的硬體將能適應一個 ANS Forth 實作.

First, ANS Forth systems can continue to be implemented on a greater range of hardware than could be claimed by almost any other single language. Since only the Core word set is required, very limited hardware will be able to accommodate an ANS Forth implementation.

第二, 一個巨大的應用程式可移植程度, 和程式設計師是可預期的. 選用的詞集標準化了不同的功能 (例如, 浮點運算) 而以前它們是廣泛的被實作, 但是沒有用一致的定義名稱和方法論, 也沒有相同的完成等級. 由於這樣的詞現在以選用詞集標準化了, 在程式設計師之間的通訊 - 口頭上, 透過雜誌或期刊文章等等. - 將跳躍到一個新的方便等級, 而程式碼和應用程式的可共享性必被戲劇性地提升.

Second, a greater degree of portability of applications, and of programmers, is anticipated. The optional word sets standardize various functions (e.g., floating point) that were widely implemented before, but not with uniform definition names and methodologies, nor the same levels of completeness. With such words now standardized in the optional word sets, communications between programmers - verbally, via magazine or journal articles, etc. - will leap to a new level of facility, and the shareability of code and applications should rise dramatically.

第三, ANS Forth 系統可以被設計成提供使用者選擇的能力, 甚至是動態地包含或除去一個或多個選用的詞集或其他的部分. 低價的產品也可以提供只需要核心詞集的使用者, 而不那麼貴. 因此, 事實上的無限制的彈性將會提供給使用者.

Third, ANS Forth systems may be designed to offer the user the power to selectively, even dynamically, include or exclude one or more of the optional word sets or portions thereof. Also, lower-priced products may be offered for the user who needs the Core word set and not much more. Thus, virtually unlimited flexibility will be available to the user.

但是這些好處有一些代價. 使用者的負荷是選擇需要哪些性能, 選擇相應的產品供給, 特別是應用程式的性能是重要的時. 我們不期待大部分的實作者提供所有的詞集, 而能選擇對於它們目標的市場最有價值的部分.

But these advantages have a price. The burden is on the user to decide what capabilities are desired, and to select product offerings accordingly, especially when portability of applications is important. We do not expect most implementors to attempt to provide all word sets, but rather to select those most valuable to their intended markets.

基本的需求是如果實作者宣稱要有一個特別的選用詞集, 需要的詞集的整個部分必須被提供. 如果實作者希望只提供選用詞集的一部分, 它是可以接受的, 例如 這個系統提供 [named] 詞集的一部分, 特別是選用或排除的詞是清楚地分項列出時.

The basic requirement is that if the implementor claims to have a particular optional word set the entire required portion of that word set must be available. If the implementor wishes to offer only part of an optional word set, it is acceptable to say, for example, This system offers portions of the [named] word set, particularly if the selected or excluded words are itemized clearly.

每一個選用的詞集將可能吸引一個特別的支持者. 例如進行複雜數學分析的科學家可能將較高的價值置於 浮點詞集, 超過發展簡單內嵌控制器的程式設計師. 對於在核心延伸集中的情況, 我們期待實作者提供那些詞集, 如果他們期望讓他們的使用者重視的話.

Each optional word set will probably appeal to a particular constituency. For example, scientists performing complex mathematical analysis may place a higher value on the Floating-Point word set than programmers developing simple embedded controllers. As in the case of the core extensions, we expect implementors to offer those word sets they expect will be valued by their users.

選用詞集可以以原始碼或其他因素的方式提供, 因而它們的使用者可以選擇性地載入它們.

Optional word sets may be offered in source form or otherwise factored so that the user may selectively load them.

選用詞集的延伸是包含比較不被認為是本質的進行由那個詞集主要支援的動作, 然而確清楚地與它相關. 在核心延伸詞集的情況, 實作者可以選擇地加入分項列出的一個詞延伸集的子集, 提供名稱, 不會誤導使用者不正確地想到所有的詞都存在.

The extensions to the optional word sets include words which are deemed less essential to performing the primary activity supported by the word set, though clearly relevant to it. As in the case of the Core Extensions, implementors may selectively add itemized subsets of a word set extension providing the labeling doesn't mislead the user into thinking incorrectly that all words are present.


內容列表(Table of Contents)
下一章(Next Section)