Hacker News new | past | comments | ask | show | jobs | submit login

Even if the CPL language has not been used for anything else except teaching, it has introduced a large number of important innovations.

For example: "break" for exiting loops without using labels, special symbolic brackets instead of "begin" and "end" (which have become "{" and "}" after the introduction of ASCII), distinct syntax for assignments and for definitions with initialization, an escape character in string literals (which was "*" in CPL through B, but was changed in C to "\"), both new line and semicolon as statement separators instead of only one of them as in earlier languages (this was inherited through BCPL by the UNIX shell), a special type for indices (like a signed size_t) and others.

One of the most important innovations of CPL was that it was one of the first two programming languages that had pointers. The second, slightly later language, was Euler. The term "pointer" itself was introduced later in the language PL/I, by IBM. Both CPL and Euler used the term "reference" (like later Algol 68; while C++ uses both terms with slightly different meanings, in earlier languages the terms were synonymous, with one of them preferred depending on the Algol or PL/I heritage)

CPL and Euler have made different choices for the syntax of the operations with pointers. In Euler indirect addressing through a pointer required an operator (like in C, but in C the operator is prefix instead of postfix due to a design mistake), while in CPL indirect addressing through a pointer was implicit (like with the references of C++). Other syntax differences are determined by this choice, e.g. for assigning the address stored in a pointer to another pointer a distinct assignment operator is needed in CPL (it did not have an address-of operator and normal assignment dereferences both pointers).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: