ABC (程式語言)

ABC,一種程式語言編程環境,起源於荷兰数学和计算机科学研究学会,最初的設計者為Leo Geurts、Lambert Meertens與Steven Pemberton。程式風格受到ALGOL-68的影響,最初用來取代BASICPascalAWK,目標是在教導非專業的程式設計師學習如何開始寫程式。

ABC
多范式指令式过程式结构化
設計者Leo Geurts, Lambert Meertens, Steven Pemberton
實作者CWI
穩定版本
1.05.02
(2012年3月9日2012-03-09
型態系統强类型, 类型多态性
網站
啟發語言
SETL, ALGOL 68[1]
影響語言
Python

程式語言Python的設計風格,有許多源自於ABC語言。Python的创立者Guido van Rossum在1980年代中期曾为ABC系统工作了很多年[2][3]

特征

它的设计者声称ABC程序的大小典型的是等价的Pascal或C程序的四分之一,并且更加可读。关键特征包括:

  • 只有五种基本数据类型
  • 不要求变量声明。
  • 显式支持自顶向下编程
  • 语句嵌套通过越位规则使用缩进来指示。
  • 任意精度算术,无大小限制的列表和字符串,支持正交性和初学者易用性的其他特征。

ABC最初是一个单体实现,导致它不能适配新的需求,比如建立图形用户界面。ABC不能直接访问底层文件系统和操作系统。

完全的ABC系统包括使用语法制导编辑、提示、持久变量和多工作空间的编程环境,并可获得为解释器/编译器,当前版本是1.05.02,已经移植到了UnixDOSAtariApple Macintosh

例子

一个收集在文档中所有单词的集合的函数words

 HOW TO RETURN words document:
    PUT {} IN collection
    FOR line IN document:
       FOR word IN split line:
          IF word not.in collection:
             INSERT word IN collection
    RETURN collection

引用

  1. "He was clearly influenced by ALGOL 68's philosophy of providing constructs that can be combined in many different ways to produce all sorts of different data structures or ways of structuring a program." - Guido van Rossum Federico Biancuzzi; Shane Warden. . O'Reilly Media. April 2009: 32 [December 14, 2009]. ISBN 0-596-51517-0.
  2. The A-Z of Programming Languages: Python 页面存档备份,存于. "...I figured I could design and implement a language 'almost, but not quite, entirely unlike' ABC, improving upon ABC's deficiencies...", Computerworld (2008-08-05). Retrieved on 2014-07-08.
  3. An Interview with Guido van Rossum 页面存档备份,存于. "... in my head I had analyzed some of the reasons it had failed..." ONLamp.com. Retrieved on 2013-07-08.

本條目部分或全部内容出自以GFDL授權發佈的《自由線上電腦詞典》(FOLDOC)。

外部連結

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.