B語言

B語言大約是於1969年時由美國貝爾實驗室電腦科學家──肯·湯普森丹尼斯·利奇的支持下設計出來的。肯·湯普森最初想在UNIX上開發一個Fortran編譯器,但後來引進了BCPL的風格,形成一個新的語言。

B语言
設計者肯·汤普森
實作者肯·汤普森丹尼斯·利奇
1969
文件扩展名.b
啟發語言
BCPL, PL/I
影響語言
C语言

B語言是一种通用的程序设计语言。自從被C語言取代之後,它幾乎已遭棄置。

後來,丹尼斯·利奇以B語言為基礎開發出C語言,至此C語言漸漸發展成為目前世界上最常用的程式語言之一。

例子

這是肯·湯普森提供的一個源代碼:

/* The following function will print a non-negative number, n, to
  the base b, where 2<=b<=10,  This routine uses the fact that
  in the ASCII character set, the digits 0 to 9 have sequential
  code values.  */

printn(n,b) {
        extrn putchar;
        auto a;

        if(a=n/b) /* assignment, not test for equality */
                printn(a, b); /* recursive */
        putchar(n%b + '0');
}

參見

外部連結

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