Pascal
名詞
1967〜68年頃にNiklaus WirthがCDC 6600上で初等プログラミングの教育用ツールとして設計した、Algolの子孫である言語。この言語は、主に学生が自分の足を撃ち抜くのを防ぐために設計され、それゆえ汎用プログラミングの観点からは極めて制限的だったが、後に汎用ツールとして売り込まれ、実際にModula-2やAdaを含む大きな言語ファミリーの祖先となった(bondage-and-discipline languageも参照)。Pascalに対するハッカー的な見方は、おそらく(K&Rで有名な)Brian Kernighanによる1981年の痛烈な(そして、その淡々とした調子で、笑い転げるほど可笑しい)論文 Why Pascal is Not My Favorite Programming Languageに最もよく要約されている。これは技術誌に掲載を断られたが、コピーを通じて広く流通した。それは最終的にAlan FeuerとNarain Gehaniが編集した Comparing and Assessing Programming Languages(Prentice-Hall, 1984)に掲載された。彼の議論の一部はここで繰り返す価値がある。なぜなら、その批判は長年の改良を経た今でもPascal自身に当てはまり、他の多くのbondage-and-discipline言語に対する告発としても通用しうるからである。(エッセイ全文はhttp://www.lysator.liu.se/c/bwk-on-pascal.htmlで入手できる。)Pascalへの反論の要約の最後で、Kernighanはこう書いた:
9. There is no escape
This last point is perhaps the most important. The language is
inadequate but circumscribed, because there is no way to escape its
limitations. There are no casts to disable the type-checking when necessary.
There is no way to replace the defective run-time environment with a sensible
one, unless one controls the compiler that defines the standard
procedures. The language is closed.
People who use Pascal for serious programming fall into a fatal trap.
Because the language is impotent, it must be extended. But each group extends
Pascal in its own direction, to make it look like whatever language they
really want. Extensions for separate compilation, FORTRAN-like COMMON, string
data types, internal static variables, initialization, octal numbers, bit
operators, etc., all add to the utility of the language for one group but
destroy its portability to others.
I feel that it is a mistake to use Pascal for anything much beyond its
original target. In its pure form, Pascal is a toy language, suitable for
teaching but not for real programming.
Pascalはその後、本格的なアプリケーションやシステムプログラミングで獲得していたニッチから(主にCによって)、また教育言語としての役割からJavaによって、完全に追いやられた。