B语言是一种通用的程序设计语言。自从被C语言取代之后,它几乎已遭弃置。
B语言大约是于1969年时由美国贝尔实验室的计算机科学家──肯·汤普森在丹尼斯·利奇的支持下设计出来的。肯·汤普森最初想在UNIX上开发一个Fortran编译器,但后来引进了BCPL的风格,形成一个新的语言。
后来,丹尼斯·利奇以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');}
参见
- BCPL
- C语言
- 支援头文字
外部链接
- The Development of the C Language页面存档备份,存于互联网档案馆
- Users' Reference to B,Ken Thompson著
- The Programming Language B
![]() | 这是一篇与计算机相关的小作品。你可以通过编辑或修订扩充其内容。 |