ALGOL 58编程范型 | 过程式, 指令式, 结构化 |
---|
設計者 | Friedrich L. Bauer, Hermann Bottenbruch, Heinz Rutishauser, Klaus Samelson, 約翰·巴科斯, Charles Katz, 艾伦·佩利, Joseph Henry Wegstein |
---|
发行时间 | 1958年,66年前(1958) |
---|
|
FORTRAN, IT, Plankalkül[1], Superplan, Sequentielle Formelübersetzung |
|
ALGOL 60,以及类ALGOL语言 |
ALGOL 58(源自英語:ALGOrithmic Language 1958的縮寫),最早稱為国际代数语言(英語:International Algebraic Language,縮寫為IAL)[2],一種程式語言,是ALGOL家族的第一個成員。它在1958年問世,ALGOL 60即是它的基礎上開發而成。
ALGOL 58介入了复合语句的基础概念[3],但只局限于控制流程,它没有以ALGOL 60中块的那种方式,结合上标识符作用域。
歷史
1958年,ACM小组和以当时联邦德国的应用数学和力学协会(GAMM),在苏黎世把他们关于算法表示法的建议综合为一从而形成IAL(国际代数语言)[4],后来改称ALGOL 58。
ALGOL 58变体时间线
例子代码
下面是语言报告中的例子代码,采用辛普森积分法计算函数F(x)
的积分,函数F(x)
的值由假定存在的函数例程提供:
procedure Simps(F(), a, b, delta, V);
comment a, b are the min and max, resp. of the points def. interval of integ.
F() is the function to integrated.
delta is the permissible difference between two successive Simpson sums.
V is greater than maximum absolute value of F on a, b;
begin
Simps: Ibar := V×(b-a)
n := 1
h := (b-a)/2
J := h×(F(a)+F(b))
J1: S := 0;
for k := 1 (1) n
S := S+F(a+(2×k-1)×h)
I := J+4×h×S
if (delta < abs(I-Ibar))
begin Ibar := I
J := (I+J)/4
n := 2×n; h := h/2
go to J1 end
Simps := I/3
return
integer (k, n)
end Simps
这里的非实数类型声明放在了过程的末尾。原文中的斜体显示改为了粗体,下面再将其调整为ALGOL 60开创的缩进格局:
procedure Simps(F(), a, b, delta, V);
comment a, b are the min and max, resp. of the points def. interval of integ.
F() is the function to integrated.
delta is the permissible difference between two successive Simpson sums.
V is greater than maximum absolute value of F on a, b;
begin
Simps:
Ibar := V×(b-a)
n := 1
h := (b-a)/2
J := h×(F(a)+F(b))
J1: S := 0;
for k := 1 (1) n
S := S+F(a+(2×k-1)×h)
I := J+4×h×S
if (delta < abs(I-Ibar))
begin
Ibar := I
J := (I+J)/4
n := 2×n; h := h/2
go to J1
end
Simps := I/3
return
integer (k, n)
end Simps
引用
- ^ Rojas, Raúl; Hashagen, Ulf. The First Computers: History and Architectures. MIT Press. 2002: 292 [October 25, 2013]. ISBN 978-0262681377. (原始内容存档于2020-08-04).
- ^
Perlis, A.J. Talk on Computing in the fifties. ACM National Conference. Nashville,. TN. (Transcript in J. A. N. Lee (ed.), Computer Pioneers, IEEE Computer Society Press, Los Alamito, CA, 1995, 545-556). 1981.
- ^ Perlis, A. J.; Samelson, K. Preliminary report: international algebraic language (PDF). Communications of the ACM (New York, NY, USA: ACM). 1958, 1 (12): 8–22 [2023-02-20]. doi:10.1145/377924.594925. (原始内容存档 (PDF)于2023-02-20).
Strings of one or more statements may be combined into a single (compound) statement by enclosing them within the "statement parentheses" begin
and end
. Single statements are separated by the statement separator ";
".
- ^
Perlis, A.J.; Samelson, K. Preliminary report: international algebraic language. Communications of the ACM. 1958, 1 (12): 8–22. doi:10.1145/377924.594925.
外部連結