ALGOL 60

維基百科,自由的百科全書
ALGOL 60
編程範型指令式過程式結構化
語言家族ALGOL
設計者Bauer英語Friedrich L. Bauer, Rutishauser英語Heinz Rutishauser, Samelson英語Klaus Samelson, 巴科斯, Katz英語Charles Katz, 佩利, Wegstein英語Joseph Henry Wegstein, 諾爾, Vauquois英語Bernard Vauquois, van Wijngaarden英語Adriaan van Wijngaarden, Woodger英語Michael Woodger, J. Green, 麥卡錫
釋出時間1960年,​64年前​(1960
當前版本
  • ISO 1538:1984 (1984年10月15日)[1]
編輯維基數據鏈接
型態系統靜態, 強類型
作用域詞法
啟發語言
ALGOL 58
影響語言
ALGOL 68, 所有「類似ALGOL語言」比如: Simula, Pascal, C等, ISWIM, Scheme

ALGOL 60(源自ALGOrithmic Language 1960的縮寫),是在1960年創建的稱為「算法語言」的一種程式語言。它是以後來稱為ALGOL 58的「國際代數語言」為基礎,其官方後繼者是ALGOL 68,它們一起並稱為ALGOL語言家族。Algol 60引進了許多新的概念如:詞法作用域遞歸[2]巴科斯-諾爾範式(BNF),它在程式語言設計和發展演化中有着巨大的影響力。

歷史

1960年,在巴黎舉行的討論會上,來自歐洲的諾爾Bauer英語Friedrich L. BauerRutishauser英語Heinz RutishauserSamelson英語Klaus SamelsonVauquois英語Bernard Vauquoisvan Wijngaarden英語Adriaan van WijngaardenWoodger英語Michael Woodger,與來自美國的佩利巴科斯麥卡錫Katz英語Charles KatzWegstein英語Joseph Henry Wegstein和J. Green,共同發表了《算法語言ALGOL 60報告》[3]戴克斯特拉實現了ALGOL 60語言的第一個編譯器。在1962年羅馬會議上,ALGOL 60報告得到了修訂,並於1963年出版[4]

ALGOL 60是程式語言發展史上的一個里程碑,影響到其後的SimulaCPLALGOL WISWIMBCPLBPascalCScheme等。它標誌着程式語言成為一門獨立的科學學科,並為後來軟件自動化及軟件可靠性的發展奠定了基礎。

標準

ALGOL 60以及COBOL,是最初的企圖標準化的程式語言。ALGOL60曾經提出兩項ISO標準:

  • ISO 1538: 1984年,程式語言ALGOL 60[5],它已穩固化。
  • ISO TR 1672: 1977年,ALGOL基本符號的ISO 7位編碼字符集硬件表示[6],它已撤消。

實現時間線

ALGOL 60在語言報告中沒有I/O設施;諸多實現以少有相互兼容的方式定義了自己的設施。迄今ALGOL 60已經有了至少70個擴充、擴展、派生和子語言[7]

名字 年份 作者 國家 描述 目標CPU
X1 ALGOL 60 1960年8月[8] Edsger W. Dijkstra和Jaap A. Zonneveld 荷蘭 第一個ALGOL 60實現[9] Electrologica X1英語Electrologica X1
Algol 1960[10] Edgar T. Irons 美國 ALGOL 60 CDC 1604英語CDC 1604
Burroughs Algol英語Burroughs large systems#ALGOL(及一些變體) 1961 Burroughs公司英語Burroughs Corporation(有HoareDijkstra和其他人參與) 美國 以Burroughs(後來基於Unisys MCP英語Burroughs MCP)計算機為基礎。Burroughs方言包括了特殊系統編程方言比如ESPOL英語Executive Systems Problem Oriented LanguageNEWP英語NEWP Burroughs大型系統英語Burroughs large systems中型系統英語Burroughs Medium Systems
Case ALGOL 1961 美國 Simula最初簽約為Case ALGOL的模擬器擴展 UNIVAC 1107英語UNIVAC 1100/2200 series
GOGOL 1961 William M. McKeeman 美國 用於ODIN分時系統 PDP-1
DASK ALGOL 1961 Peter NaurJørn Jensen英語Jørn Jensen 丹麥 ALGOL 60 Regnecentralen英語RegnecentralenDASK英語DASK
SMIL ALGOL 1962 Torgil Ekman,Carl-Erik Fröberg 瑞典 ALGOL 60 隆德大學SMIL英語SMIL (computer)
GIER ALGOL 1962 Peter NaurJørn Jensen英語Jørn Jensen 丹麥 ALGOL 60 Regnecentralen英語Regnecentralen的GIER
Dartmouth ALGOL 30英語Dartmouth ALGOL 30[11] 1962 Thomas Eugene Kurtz英語Thomas Eugene Kurtz,Stephen J. Garland,Robert F. Hargraves,Anthony W. Knapp英語Anthony W. Knapp,Jorge LLacer 美國 ALGOL 60 LGP-30英語LGP-30
Alcor Mainz 2002 1962 Ursula Hill-Samelson,Hans Langmaack 德國 Siemens 2002
ALCOR-ILLINOIS 7090 1962[12][13] Manfred Paul,Hans Rüdiger Wiehle,David Gries英語David GriesRudolf Bayer 美國,西德 ALGOL 60,伊利諾伊大學慕尼黑工業大學的實現,1962年-1964年 IBM 7090
USS 90 Algol 1962 L. Petrone 意大利
Elliott ALGOL英語Elliott ALGOL 1962 C. A. R. Hoare 英國 在他的1980年圖靈獎演講中討論 Elliott 803英語Elliott 803 & Elliott 503英語Elliott 503
ALGOL 60 1962 Roland Strobel[14] 東德 柏林德國科學院英語German Academy of Sciences at Berlin應用數學研究所實現 Zeiss-Rechenautomat ZRA 1
Algol Translator 1962 G. van der Mey,W.L. van der Poel英語Willem van der Poel 荷蘭 Staatsbedrijf der Posterijen,Telegrafie en Telefonie ZEBRA英語ZEBRA (computer)
Kidsgrove Algol 1963 F. G. Duncan 英國 英國電氣公司英語English ElectricKDF9英語English Electric KDF9
SCALP[15] 1963 Stephen J. Garland,Anthony W. Knapp英語Anthony W. KnappThomas Eugene Kurtz英語Thomas Eugene Kurtz 美國 作為ALGOL 60子集的自齊備Algol處理器 LGP-30英語LGP-30
VALGOL 1963 Val Schorre 美國 META II英語META II編譯器的編譯器的測試品
FP6000 Algol 1963 Roger Moore英語Roger Moore (computer scientist) 加拿大 Saskatchewan電力公司英語SaskPower寫作 FP6000英語Ferranti-Packard 6000
Whetstone英語Whetstone (benchmark) 1964[16] Brian Randell英語Brian Randell,Lawford John Russell 英國 英國電氣公司原子能部。以Ferranti Pegasus英語Ferranti Pegasus為前提,國家物理實驗室ACEEnglish Electric DEUCE英語English Electric DEUCE實現。 英國電氣公司KDF9英語English Electric KDF9
ALGOL 60 1964 Jean-Claude Boussard[17] 法國 Institut d'informatique et mathématiques appliquées de Grenoble IBM 7090
ALGOL 60 1965 Claude Pair[18] 法國 Centre de calcul de la Faculté des Sciences de Nancy IBM 1620英語IBM 1620
Dartmouth ALGOL 1965 Stephen J. Garland,Sarr Blumson,Ron Martin 美國 ALGOL 60 用於GE 235英語GE-200 seriesDartmouth分時系統英語Dartmouth Time Sharing System
NU ALGOL 1965 挪威 UNIVAC
ALGOL 60 1965[19] F.E.J. Kruseman Aretz 荷蘭 用於EL-X8的MC編譯器 Electrologica X8英語Electrologica X8
ALGEK 1965 蘇聯 АЛГЭК,基於ALGOL-60並支持COBOL,用於經濟任務 Minsk-22英語Minsk family of computers
MALGOL 1966 publ. A. Viil,M Kotli,M. Rakhendi 愛沙尼亞 Minsk-22英語Minsk family of computers
ALGAMS 1967 GAMS組織(ГАМС,группа автоматизации программирования для машин среднего класса),協作於Comecon科學院 經濟互助委員會 Minsk-22英語Minsk family of computers,後來的ES EVM英語ES EVMBESM英語BESM
ALGOL/ZAM 1967 波蘭 波蘭ZAM計算機
Chinese Algol[20] 1972 中國 中文,通過SYMBOL系統表達
DG/L英語DG/L 1972 美國 DG Eclipse英語Data General Eclipse計算機家族
NASE[21] 1990 Erik Schoenfelder 德國 解釋器 Linux和MS Windows
MARST[22] 2000 Andrew Makhorin 俄國 ALGOL 60到C轉換器 GNU編譯器套件支持的全部CPU;MARST是GNU計劃成員

詞法

簡單符號

除了字母數字之外,ALGOL定義了運算符

優先級 運算符
第一
算術
第一 (冪)
第二 ×/(實數),÷(整數)
第三 +-
第二 <=>
第三 ¬(非)
第四 (與)
第五 (或)
第六 (蘊涵)
第七 (等價)

分界符英語Delimiter:

, . : ;
( ) [ ]

在具體實現中,用:=表示(U+2254),用*表示×;可用//%表示÷,用**^表示,用#@表示科學記數法指數運算的底數10所用符號(U+23E8),用反引號英語Backtick`表示,並且用撇號'表示,亦有用"表示左右引號二者,用空格 下劃線_表示在字符串中的空白字符(U+2423)。

關鍵字

ALGOL 60有24個關鍵字

  • array
  • begin
  • Boolean
  • comment
  • do
  • else
  • end
  • false
  • for
  • goto
  • if
  • integer
  • label
  • own
  • procedure
  • real
  • step
  • string
  • switch
  • then
  • true
  • until
  • value
  • while

還包括標準函數名字作為限制標識符:

  • abs
  • sign
  • sqrt
  • sin
  • cos
  • arctan
  • ln
  • exp
  • entier

關鍵字寫法依賴於實現,常見的是一種叫做索繞英語Stropping (syntax)(stropping)的方法,例如將if包圍在兩個'之間並大寫為'IF'。在具體實現中關鍵字還包括對特定符號的某種文字轉寫:

符號 轉寫 符號 轉寫
'AND' ¬ 'NOT'
= 'EQUAL' 'NOTEQUAL'
'EQUIV' 'NOTGREATER'
> 'GREATER' 'NOTLESS'
'IMPL' 'OR'
< 'LESS' 'POWER'

語義

塊與作用域

在ALGOL 60中,「複合語句」被定義為:包圍在語句括號beginend之間的成序列的語句,形成一個複合語句。被定義為:成序列的聲明,跟隨着成序列的語句,並被包圍在beginend之間,形成一個塊;所有聲明以這種方式出現在一個塊中,並只在這個塊中有效。[23]

一個程序是特定的一個塊或複合語句,它不包含在另一個語句之中,並且不使用不包含在它之中的其他語句。在1976年的修改版語言報告中,程序只能包含在叫做「環境塊」的假定總是存在的一個虛構塊之中,除了可以使用在環境塊中聲明的過程標識符和函數指定符之外,不使用不包含在它之中的其他語句。

(quantity)被區分出如下種類:簡單變量、數組、標籤、switch(標籤列表[24])和過程。聲明負擔定義在程序中用到的量的特定屬性,並給它們關聯上標識符。聲明包括:類型聲明、數組聲明、switch聲明和過程聲明。量的作用域是語句和表達式的集合,在其中關聯於這個量的標識符的聲明是有效的。所有的塊,自動地介入命名法英語Nomenclature(nomenclature)的一個新的層級:

  • 在這個塊內出現的標識符,可以通過合適的聲明,而被指定為局部於所論及的這個塊。這個標識符在這個塊裏面的所表示的實體,不存在於它的外面。這個標識符在這個塊外面的所表示的任何實體,在這個塊裏面是不可見的。
  • 除了表示標籤的標識符之外,一個標識符,如果出現在一個塊中,而且並非聲明於這個塊中,則它非局部英語Non-local variable於這個塊[25],就是說它在這個塊裏面和在緊鄰其外的層級中所表示的是同一個實體。
  • 因為塊中的語句自身可以是一個塊,局部和非局部於一個塊的概念,必須遞歸地去理解,就是說非局部於一個塊A的一個標識符,可是亦可否地,非局部於A是其中語句的塊B

這動態的蘊涵了:在通過begin進入一個塊的時候,所有為這個塊聲明的標識符,假定了這個給定聲明的本性英語Nature (philosophy)所蘊涵的意義英語Meaning (philosophy)(significance);如果這些標識符已經被外面的其他聲明所定義,這時它們被給予新的意義;在另一方面,並非為這個塊聲明的標識符,保持它們舊有的含義。在通過endgoto語句退出一個塊的時候,為這個塊聲明的標識符失去它們的局部意義。聲明可以標記上額外的聲明符own,其效果為:在重新進入一個塊的時候,自有的這些量的值將不變更而仍是上次退出時的值,然而聲明的沒有標記上own的變量的值是未定義的。

表達式和語句

在描述算法處理的程序中,主要構成者是算術表達式、布爾表達式,和得到語句標籤的指定表達式。除了特定的分界符之外,表達式的構成者包括:邏輯值、數值、變量、函數指定式,和基本的算術、關係、邏輯運算符(operator)及順序運算符。用以形成語句的關鍵字,在ALGOL 60中被歸入順序運算符和分隔符之中。

變量是對一個單一的指名(designation英語Designation (law))。下標(subscripted)變量指定(designate)多維數組的元素的值,這裏將數組元素稱為「組成元件」(component)[26]。函數指定式(designator)定義單一的數量值或邏輯值,它們是將給定的由過程聲明定義的規則集合,應用於固定的實際參數集合的結果。

現在通常將變量定義為抽象的存儲位置,它含有了被稱為一個的某種已知或未知的信息,並且配對了關聯的符號英語Symbol (programming)名字。在ALGOL 60中,某些語法單位,比如表達式及其構成者和數組標識符,被稱為擁有值。各種「類型」即integerrealBoolean指稱(denote)的基本的屬性。

在左圓括號和匹配的右圓括號之間的表達式(parenthesized expression)自行求值,而這個值被用於後續的計算之中;因此通過適當的圓括號放置,總是可以在表達式之內安排出想要的運算次序

賦值語句擔負將表達式的值,指派(assign)到一個或多個變量,或者在定義函數指定式的值的過程主體中指派到過程標識符;在作為指派目標的下標變量中出現的任何下標表達式,先於得出所指派之值的表達式,而按從左至右順序求值。空無的虛設(dummy)語句不執行任何運算。過程語句負擔實施調用一個過程主體的執行。

控制流程語句包括:goto跳轉語句、if條件語句、for循環語句。goto語句不能從塊外跳轉到塊內的標籤,但可以跳轉進入複合語句。ALGOL 60在if語句和for語句中介入了子句概念,在更具一般性的算術表達式中,可以包含if條件表達式[27]

由於變量和函數指定式二者的語法定義都包含表達式,表達式及其構成者的定義必須是遞歸的。由於成序列的語句,可以被組織成複合語句和塊,語句的定義必需是遞歸的。ALGOL 60採用了左遞歸巴科斯範式(BNF)。

過程

在ALGOL 60中,過程聲明擔負定義過程標識符所關聯的過程,其主要構成者是過程主體,它是一個語句或一段代碼。過程主體總是表現得如同一個塊,不管它是否有着塊的形式;故而標記了在過程主體內語句或者主體自身的標籤的作用域,永遠不能延伸超出這個過程主體[28]

過程主體關聯着一個頭部,它規定了出現在過程主體內的代表形式參數的特定標識符。過程參數傳遞有兩種求值策略傳名調用傳值調用。在過程聲明中,通過對形式參數名字前導value來指定傳值調用,缺省為傳名調用。在過程主體是用ALGOL語言寫的語句的情況下,過程語句執行它的效果,等價於在程序上進行下列操作的效果:

  • 聲明為傳值調用的形式參數,都要被賦值即指派上對應的實際參數的值,這些指派被認為是在進入過程主體之前顯式進行的。其效果如同創建了包圍着這個過程主體的一個額外的塊,在其中所做的這些指派針對的是局部於這個虛構塊的變量,它們具有在相應規定中給出的類型。作為結論,傳值調用的變量,被認為非局部英語Non-local variable於過程主體,但是局部於這個虛構塊。
  • 聲明為傳名調用的形式參數,在整個過程主體內,要被替代為對應的實際參數,並且只要語法上可能就對這些實際參數包圍上圓括號。在通過這個名字替代處理而插入的標識符,和已經存在於過程主體之內的其他標識符,二者之間的可能衝突,將憑藉對涉及到的(這個過程主體的)形式標識符或局部標識符的適合的系統性變更來避免[29]
  • 最終經過上述修改後的過程主體,被插入到過程語句的位置上並被執行。如果調用這個過程的位置,處在這個過程主體的任何非局部量[30]作用域的外面,在通過這個過程主體替代處理而插入的標識符,和在這個過程語句或函數指定式所在位置上其聲明有效的標識符,二者之間的可能衝突,將通過(在發起調用的這個層級上)對後者標識符的適合的系統性變更來避免[31]

對於定義函數指定式的值的過程聲明,在其過程主體中,必須出現具有過程標識符在其左側部份中的一個或多個賦值語句,其中至少有一個必須被執行;並且這個過程標識符所關聯的類型,必須通過以類型聲明符作為其過程聲明的最先符號的樣貌來聲明。最後那個這樣指派的值,被用來繼續此函數指定式在其中出現的表達式的求值。在這個過程主體中,這個過程標識符的不在賦值語句左側部份中的任何出現,指示了這個過程的激活(activation)。

兩個傳名調用形式參數,其對應的實際參數之間可能存在依賴關係,比如第一個是整數變量i,而第二個是下標變量A[i],從而導致後者形式參數也依賴於前者形式參數,利用傳名調用和這種副作用可以實現Jensen設備英語Jensen's Device[32];它典型的用於定義對應於級數過程Sum(k, l, u, ak),它有兩個傳名調用的形式參數:索引變量k和通項(general)表達式ak

對於交換兩個參數的值的swap(x, y)過程,其過程主體定義為:t:=x; x:=y; y:=t,這種依賴性副作用會導致可能出現異常行為,由於名字替代機制相當於展開(expansion),過程語句swap(i, A[i])中下標變量A[i]的下標i未經求值,對應的過程主體就轉換成為:t:=i; i:=A[i]; A[i]:=t。1964年IFIP英語International Federation for Information Processing工作組2.1英語IFIP Working Group 2.1制定了《SUBSET ALGOL 60報告》,在這個子集語言中對「完全的名字概念」(full name-concept)增加了一項限制:在名字替代(傳名調用)中,實際參數只能是一個標識符或字符串。

在過程的參數列表( … <参数分界符> … )中,有可選的「) <字母串>: (」樣式的參數分界符英語Delimiter[33]。眾所周知的傳名調用實現採用了thunk英語Thunk[a][35]Donald Knuth設計了「男人抑或男孩測試」,來區分編譯器是否正確的實現了「遞歸和非局部引用」,這個測試用到了傳名調用。

例子

下面是語言報告中過程聲明的一個例子[b]

procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
    value n, m; array a; integer n, m, i, k; real y;
    comment 矩阵a,其大小为nm,其绝对值最大的
        元素被传送到y,并且这个元素的下标是ik ;
begin
    integer p, q;
    y := 0; i := k := 1;
    for p := 1 step 1 until n do
        for q := 1 step 1 until m do
            if abs(a[p, q]) > y then
            begin
                y := abs(a[p, q]);
                i := p; k := q
            end
end Absmax

在1976年修改版語言報告的環境塊中,定義了輸入輸出過程:incharoutcharlengthoutstringoutterminatorinintegeroutintegerinrealoutreal,下面以其中的outinteger作為演示例子:

procedure outinteger(channel, int);
    value channel, int;
    integer channel, int;
    comment 将表示int的值的那些字符
        加上尾随的终结符传递到channel ;
begin
    procedure digits(int);
        value int; integer int;
    begin
        integer j;
        comment 使用递归从右至左求值数字 
            但从左至右打印它们 ;
        j := int ÷ 10;
        int := int - 10 × j;
        if j  0 then
            digits(j);
        outchar(channel, 0123456789, int + 1)
    end digits;
    if int < 0 then
    begin
        outchar(channel, -, 1);
        int := -int
    end;
    digits(int); outterminator(channel)
end outinteger

這裏調用到的outchar(channel, str, int),將在字符串str中對應整數int的值的那個字符,傳遞到通道channeloutterminator(channel),用於輸出在數值之後的終結符(即空格、換行或分號)。此外,IFIP英語International Federation for Information Processing工作組2.1英語IFIP Working Group 2.1在1964年曾制定《ALGOL 60輸入輸出過程報告》,其中定義了insymboloutsymbollengthinrealoutrealinarrayoutarray,這裏的多維數組採用了橫行為主英語Row- and column-major order(Row major)次序[36]

參見

註釋與引用

  1. ^ A thunk is an early limited type of closure. The environment passed for the thunk is that of the expression, not that of the called routine.[34]
  2. ^ 這裏採用了1976年修改版語言報告中的代碼,對原版進行的修改是增加了i := k := 1;,針對的是數組的全部元素都是0的特殊情況。
  1. ^ https://www.iso.org/standard/6126.html.
  2. ^ Peter Naur; et al. Revised Report on the Algorithmic Language Algol 60. [2022-04-14]. (原始內容存檔於2007-06-25). Any occurrence of the procedure identifier within the body of the procedure other than in a left part in an assignment statement denotes activation of the procedure. 
  3. ^ Backus, J. W.; Bauer, F. L.; Green, J.; Katz, C.; McCarthy, J.; Perlis, A. J.; Rutishauser, H.; Samelson, K.; Vauquois, B.; Wegstein, J. H.; van Wijngaarden, A.; Woodger, M. Naur, Peter , 編. Report on the Algorithmic Language ALGOL 60. Communications of the ACM (Copenhagen). May 1960, 3 (5): 299–314. ISSN 0001-0782. S2CID 278290. doi:10.1145/367236.367262. 
  4. ^ Revised Report on the Algorithmic Language Algol 60. 1963 [2020-04-23]. (原始內容存檔於2007-06-25). 
  5. ^ ISO 1538:1984 Programming languages — ALGOL 60 (PDF). [2022-05-02]. (原始內容 (PDF)存檔於2021-01-31). 
  6. ^ ISO/TR 1672:1977 Hardware representation of ALGOL basic symbols in the ISO 7-bit coded character set for information processing interchange. [2022-05-02]. (原始內容存檔於2022-05-02). 
  7. ^ The Encyclopedia of Computer Languages 互聯網檔案館存檔,存檔日期September 27, 2011,.
  8. ^ Daylight, E. G. Dijkstra's Rallying Cry for Generalization: the Advent of the Recursive Procedure, late 1950s – early 1960s. The Computer Journal英語The Computer Journal. 2011, 54 (11): 1756–1772 [2022-05-02]. doi:10.1093/comjnl/bxr002. (原始內容存檔於2013-03-12). 
  9. ^ Kruseman Aretz, F.E.J. The Dijkstra-Zonneveld ALGOL 60 compiler for the Electrologica X1 (PDF). Software Engineering. History of Computer Science. Kruislaan 413, 1098 SJ Amsterdam: Centrum Wiskunde & Informatica. 30 June 2003 [2022-05-02]. (原始內容 (PDF)存檔於2021-10-23). 
  10. ^ Edgar T. Irons. A syntax directed compiler for ALGOL 60. Communications of the ACM, Vol. 4, p. 51. Jan. 1961 [2023-07-14]. (原始內容存檔於2023-07-14). 
  11. ^ ALGOL for the LGP-30, A Comparison (PDF). Computation Center, Dartmouth College. February 16, 1962 [2023-07-14]. (原始內容存檔 (PDF)於2023-05-29). 
  12. ^ Gries, D.; Paul, M.; Wiehle, H. R. Some techniques used in the ALCOR ILLINOIS 7090. Communications of the ACM. 1965, 8 (8): 496–500. S2CID 18365024. doi:10.1145/365474.365511. 
  13. ^ Bayer, R.; Gries, D.; Paul, M.; Wiehle, H. R. The ALCOR Illinois 7090/7094 post mortem dump. Communications of the ACM. 1967, 10 (12): 804–808. S2CID 3783605. doi:10.1145/363848.363866. 
  14. ^ Rechenautomaten mit Trommelspeicher頁面存檔備份,存於互聯網檔案館), Förderverein der Technischen Sammlung Dresden
  15. ^ Stephen J. Garland, Anthony W. Knapp, Thomas E. Kurtz, A Manual for SCALP, being a Self Contained ALgol Processor for the General Precision LGP-30 (PDF), CCM-7A, Computation Center, Dartmouth College, Hanover, NH, January 1, 1964 [2023-07-14], (原始內容存檔 (PDF)於2023-05-29) 
  16. ^ B.Randell, L.Russell. Algol 60 implementation (PDF). 1964 [2023-07-14]. (原始內容存檔 (PDF)於2023-10-03). 
  17. ^ Jean-Claude Boussard. Design and implementation of a compiler Algol60 on electronic calculator IBM 7090/94 and 7040/44 (學位論文). Institut d'informatique et mathématiques appliquées de Grenoble: Université Joseph-Fourier - Grenoble I. June 1964 [2022-05-02]. (原始內容存檔於2022-04-10). 
  18. ^ Claude Pair. Description d'un compilateur ALGOL. European Région 1620 Users Group (IBM). 27 April 1965. 
  19. ^ Kruseman Aretz, F.E.J. An ALGOL 60 compiler in ALGOL 60. Mathematical Centre Tracts. Amsterdam: Mathematisch Centrum. 1973. 
  20. ^ Algol 60 in Chinese glyphs. [2023-07-14]. (原始內容存檔於2023-03-23). 
  21. ^ NASE. [2022-05-02]. (原始內容存檔於2022-03-30). 
  22. ^ MARST. [2020-04-23]. (原始內容存檔於2020-03-22). 
  23. ^ J. W. Backus, F. L. Bauer, J. Green, C. Katz, J. McCarthy, P. Naur, A. J. Perlis, H. Rutishauser, K. Samelson, B. Vauquois, J. H. Wegstein, A. van Wijngaarden, M. Woodger. Peter Naur , 編. Revised Report on the Algorithmic Language ALGOL 60. Communications of the ACM, Volume 6, Number 1, pages 1-17. January 1963 [2023-02-20]. (原始內容存檔於2023-02-20). A sequence of statements may be enclosed between the statement brackets begin and end to form a compound statement. ……
    A sequence of declarations followed by a sequence of statements and enclosed between begin and end constitutes a block. Every declaration appears in a block in this way and is valid only for that block.
     
  24. ^ Peter Naur; et al. Revised Report on the Algorithmic Language Algol 60. [2022-04-14]. (原始內容存檔於2007-06-25). A switch declaration defines the set of values of the corresponding switch designators. These values are given one by one as the values of the designational expressions entered in the switch list. With each of these designational expressions there is associated a positive integer, 1, 2, ..., obtained by counting the items in the list from left to right. The value of the switch designator corresponding to a given value of the subscript expression ( …… ) is the value of the designational expression in the switch list having this given value as its associated integer. 
    Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「25.4.3.

     
    «

    begin
        switch wernik := ariea, aeryl, m17, larix;
        goto wernik[k];
    arica: ; comment this for k = 1 ;
        
        goto common;
    aeryl: ; comment this for k = 2 ;
        
        goto common;
    m17: ; comment this for k = 3 ;
        
        goto common;
    larix: ; comment this for k = 4 ;
        
    common: 
    end
    

    ».
     

    Here, by virtue of switch wernik, the computation follows one of four possible branches of the program depending on the current value of k. Afterwards the common course of the calculation (i.e. the statements which would follow «end») is taken up again.」

  25. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「42.5.1. The operands of a block B are defined as those quantities existing outside the block which are involved in the execution of the block. Obviously the quantities global to B are operands of B provided they are actually used inside B. ……
    42.5.2. Hidden operands. A block may have hidden operands: Indeed, if a procedure P is operand of block B, …… the global parameters of P are also involved in the execution of B, hence operands of B. We call these hidden operands of B because they cannot be found by inspection of block B but only by inspection of the declaration for procedure P, which is given somewhere outside B. ……
    42.5.3. The operands of a block B fall into the following four categories:
    Arguments …… ⒝ Results …… ⒞ Transients: …… which have properties of both arguments and results …… ⒟ Exits: Labels referring to destinations located outside B and switches which are declared outside B. ……
    52.3.1. Considering a mathematical expression, e.g. an integral
        
    it is seen that the variables x and y serve entirely different purposes: y is a variable upon which the value of I depends; in mathematical logic this is called a free variable (of the expression). This latter term indicates that one is free to substitute a value, e.g. 2.75, for y, where-upon one obtains the result
        
    The variable x, on the other hand, is only an auxiliary object for describing the operation to be performed by the expression. It is called a bound variable since it is not accessible from outside the expression. ……
    52.3.2. Comparing these examples with an ALGOL procedure and the terminology used ……, it becomes obvious that the free variables correspond to what are called the operands of a procedure, while the bound variables correspond to the internal quantities.」
  26. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「9.1.2. An array is a set of elements, called the components of the array, everyone of which behaves like a simple variable. The components of an array are distinguished by a set of p integers (subscripts)i1, i2, ……, ip, where p is called the dimension of the array. If we interpret the subscripts as coordinates in a p-dimensional space, then the entire array corresponds to the total of all unit-gridpoints in a p-dimensional hyperbox
        lk ≤ ik ≤ uk  (k = 1, 2, ……, p),
    whose boundaries (i.e. the array bounds l1, l2 ……, lp, u1, u2, ……, up) are given in the corresponding array declaration ……. ……
    14.3.2. A subscripted variable «I[E1, E2, ……, Ep]», if encountered in an expression, represents also a single value defined as follows: Evaluate the subscript expressions E1, E2, ……, Ep; if their values are i1, i2, ……, ip, then the subscripted variable represents the value that has most recently been assigned to the i1, i2, ……, ip-component of the array I.」
  27. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 
    19.7.1. «x + (if t > t1 then 1 else -1) / x».
    We recall that a conditional arithmetic expression cannot be used directly as a primary in a larger expression, but must for this purpose be enclosed in parentheses (the sequence «+ if» is always illegal).
    19.7.2. Selection of a component of an array with safeguards against exceeding the array bounds:
         «a[if k > n then n else if k < 1 then 1 else k]».
    19.7.3. Where conditional expressions are intended as comparands of a relation or as alternatives of a conditional expression, they must again be enclosed in parentheses:
         «if (if u then x else y) > 0 then (if z = 0 then x + y else x - y) else x × y».」
  28. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「44.2. …… The operands of a procedure, i.e. the quantities involved in its execution, are essentially the operands of the fictitious block which - if S stands for the procedure body - is defined as the construction
        «begin real æ; S end»1, 2.
    ……
    1 The declaration of the fictitious variable æ serves solely to make this piece of program a block.
    2 In case S is already an unlabelled block, this artificial construction is unneeded and we could take S instead. ……」
  29. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「45.2.3. Name conflicts. …… Indeed, without this rule, the effect of a call «x(z)» of a

     
    «

    procedure x(y);
        real y;
        begin real z; z := 2 × y; y := y / z end
    

    »
     

    would erroneously be interpreted as
      «begin real z; z := 2 × y; z := z / z end»,
    which certainly was not the intention of the designer of the procedure. With the above amendment, however, the internal z is changed into , after which we obtain the equivalence block correctly as
      «begin real zæ; zæ := 2 × z; z := z / zæ end».」

  30. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「44.2. Operands of a procedure …… Indeed, execution of a procedure means essentially execution of this fictitious block, …… However, it is one of the most important properties of procedures that their operands - besides being distinguished as arguments, results, transients and exits - fall into three categories, namely
    ⒜ Those operands of the fictitious block whose identifiers are not quoted in the formal parameter part are called global operands of the procedure. …… ⒝…… formal operands ……⒞…… hidden operands ……
    44.3.1. A global parameter - that is, the identifier of a global operand - represents the same quantity inside the procedure body as outside in the environment of the procedure declaration. A global operand is therefore simply the extension of a quantity which exists outside the procedure. As a consequence we have
    44.3.2. The environment rule for global parameters:
    If the identifier I is global parameter of a procedure, then a (true or formal) quantity Q with that identifier must exist in the environment of the procedure declaration, and it is this Q which in a call of the procedure is meant by the identifier I.
    According to this rule, a global parameter acts like a thread which links the procedure declaration permanently to its environment; indeed, a procedure which has global parameters is only fully defined if it is embedded into an ALGOL program in which the global operands are properly declared.」
  31. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「45.2.4. Suppressed global operands. …… Consider, for instance

     
    «

    begin
        integer t;
        procedure common(x); real x; t := x;
    z:  begin
            real t;
            common(t);
        end z
    end
    

    ».
     

    Here the integer type variable t is suppressed in block z, and therefore the actual parameter of the call «common(t)» refers to the real type variable which is local to block z. …… the t occurring as global parameter of procedure common refers to the suppressed quantity t. The above rule makes this evident by requiring that the name of the real type variable t be changed throughout block z into tee before the substitution rule is applied:

     
    «

    begin
        integer t;
        procedure common(x); real x; t := x;
    z:  begin
            real tæ;
            common(tæ);
        end z
    end
    

    ».
     

    Now the substitution rule yields the equivalent block for the call «common(t)» correctly as (æ denoting again the hypothetical variable necessary to make this piece of program a block)
      «begin real æ; t := tæ end».
    Accordingly, this call accomplishes something which would seem impossible, namely changing the value of a suppressed variable.
    45.2.5. ……Consequently no name changes apply where the identifier of a global operand not suppressed at the location of a procedure call coincides with the identifier of an actual operand.」

  32. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). In view of its ad-hoc character it seems doubtful that the Jensen device (and to some extent even the full name-concept) is the last word in programming language design. Indeed, the dependence of the components of an array upon its subscripts (and likewise the dependence of a function upon its arguments) is more appropriately described by means of CHURCH'S lambda notation rather than through the bound variables of a computing process. Accordingly, we conclude with a sideview to a possibility for introducing this notation in a future ALGOL, but in doing so we strictly adhere to a SUBSET like language-concept, i.e. one in which quantities rather than names play the fundamental role. 
  33. ^ Peter Naur; et al. Revised Report on the Algorithmic Language Algol 60. [2022-04-14]. (原始內容存檔於2007-06-25). Parameter delimiters. All parameter delimiters are understood to be equivalent. No correspondence between the parameter delimiters used in a procedure statement and those used in the procedure heading is expected beyond their number is the same. Thus the information conveyed by using the elaborate ones is entirely optional. 
  34. ^ E. T. Irons. Comments on the Implementation of Recursive Procedures and Blocks in ALGOL. Communications of the ACM (Association for Computing Machinery (ACM)). January 1, 1961, 4 (1): 65–69. ISSN 0001-0782. S2CID 42778823. doi:10.1145/366062.366090可免費查閱. 
  35. ^ Ingerman, P. Z. Thunks: a way of compiling procedure statements with some comments on procedure declarations. Communications of the ACM (Association for Computing Machinery (ACM)). 1961-01-01, 4 (1): 55–58. ISSN 0001-0782. S2CID 14646332. doi:10.1145/366062.366084可免費查閱. 
  36. ^ Heinz Rutishauser英語Heinz Rutishauser. Description of ALGOL 60 (PDF). Springer-Verlag New York Inc. 1967 [2023-07-06]. ISBN 978-3-642-86936-5. doi:10.1007/978-3-642-86934-1. (原始內容存檔 (PDF)於2022-12-22). 「49.3.2. For inarray and outarray the order in which the components of the array b are transferred is defined to be what for matrices (two-dimensional arrays) is usually called "row-wise". More precisely: b[i1, i2, ……, ip] is transferred before b[j1, j2, ……, jp] provided we have for some h ≤ p:
        il = jl for l = 1, 2, ……, h - 1, but ih < ih.
    Moreover, these procedures always transfer all components of the array appearing as the second actual operand.
    As a consequence, a call «outarray(15, p)», where p is declared e.g. as «array p[-4:5, 1:50, 0:20]», is equivalent to

     
    «

    for j1 := -4 step 1 until 5 do
        for j2 := 1 step 1 until 50 do
            for j3 := 0 step 1 until 20 do outreal(15, p[j1, j2, j3])
    

    ».」
     

外部連結