Basic Combined Programming Language(BCPL),1967 byUniversity of CambridgeMatin Richards, also developed by Cambridge UniversityCPL LanguageIt has been improved.BCPL was first used asOxfordThe development tool on the OS6 operating system.Later adoptedBell Lab The improvement and promotion ofUNIXCommon development languages on.
BCPL is somewhat similar toFortran, also typicalProcess orientedThe high-level language of.The syntax of BCPL is closer to the machine itself, which is suitable for developing sophisticated and demanding applicationscompilerThe requirements are not high.BCPL is also one of the first languages to use library functions to encapsulate basic input and output, which makes it very portable across platforms.The code of BCPL is written in lowercase letters, which is different from that of the same eraBASICandPASCAL。BCPL's support for strings is poor, and this shortcoming has continued to his descendants. BCPL's memory management is also poor, but fortunately this shortcoming has been eliminated in his descendants.BCPL program from aPrincipal functionStarting from, function modules can be added to various functions, and functions support nesting and recursion.
BCPL itself has not been used for a long time, because its descendants are too powerful.In 1970, Bell LaboratoriesKen ThompsonOn the basis of BCPLLanguage B, used to write UNIX.This name is taken from the first letter in BCPL.B language was used for a shorter time, because three years later, in 1973, it was also DM. RITCHIE further improves the B language, and takes the second letter in BCPL to name itC language。C andC++Will become the most popular in the futurehigh-level language。
example
Announce
edit
The following is Martin Charles' BCPL distribution
Printing factorials:GET "libhdr"LET start() = VALOF{ FOR i = 1 TO 5 DO writef("fact(%n) = %i4*n", i, fact(i))RESULTIS 0}AND fact(n) = n=0 -> 1, n*fact(n-1)N queen questions:N queen questions:GET "libhdr"GLOBAL { count:200; all:201 }LET try(ld, row, rd) BE TEST row=allTHEN count := count + 1ELSE { LET poss = all & ~(ld | row | rd)UNTIL poss=0 DO{ LET p = poss & -possposs := poss - ptry(ld+p << 1, row+p, rd+p >> 1)}}LET start() = VALOF{ all := 1FOR i = 1 TO 12 DO{ count := 0try(0, 0, 0)writef("Number of solutions to %i2-queens is %i5*n", i, count)all := 2*all + 1}RESULTIS 0}