C programming language: Difference between revisions

From Computer History Wiki
Jump to navigationJump to search
Larsbrinkhoff (talk | contribs)
Dialects: Some milestones.
m External links: The OCR on the text version has some errors; use the scanned version
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
The C language.....
The '''C programming language''' was derived from an earlier [[programming language]] called [[B programming language|B]], itself derived from [[BCPL]]. There was next a short-lived intermediary language called 'NB', or New B. C can be crisply, and aptly, described as 'BCPL with [[type]]s and terser [[syntax]]'. The syntax arrived with B; types were added in the step to NB; and C added such things as [[structure]]s.
 
A number of [[object-oriented language]]s have been influenced by C, including
[[Objective-C]], [[C++]], [[D]], [[Vala]].


== Dialects ==
== Dialects ==
There are two popular dialects, the original was K&R C, which spread with the original C [[compiler]], and [[pcc]], the portable C compiler.  Later there was a ANSI standard to the C language, and it's usually refered to as just ANSI C.
 
There are two popular dialects, the original was K&R C, which spread with the original C [[compiler]], and [[pcc]], the portable C compiler.  Later there was an ANSI standard for the C language, usually referred to as 'ANSI C'.


The C language evolved continuously starting in 1972.  Some milestones:
The C language evolved continuously starting in 1972.  Some milestones:


* 1972 - [https://www.bell-labs.com/usr/dmr/www/primevalC.html Primeval C] - no '''struct''', automatic variables can't be initialized.
* 1972 - Primeval C - no '''struct''', automatic variables can't be initialized.
* 1973 - preprocessor added.
* 1973 - preprocessor added.
* 1976? - [[Typesetter C]] - introduced '''long''', '''unsigned''', '''typedef''', '''union''', and changed '''=+''' etc to '''+='''.
* 1976? - [[Typesetter C]] - introduced '''long''', '''unsigned''', '''typedef''', '''union''', and changed '''=+''' etc to '''+='''.
Line 13: Line 17:


== hello world ==
== hello world ==
Ancient
Ancient
<pre>
<pre>
Line 50: Line 55:
</pre>
</pre>


C was derived[http://cm.bell-labs.com/cm/cs/who/dmr/chist.html] from an earlier language called [[B]].  There was an intermediary language called NB, or New B.
==Compilers==


A number of object-oriented languages have been influenced by C, including
* [[Borland C]]
[[Objective-C]], [[C++]], [[D]], [[Vala]].
* [[Watcom C]]
 
{{semi-stub}}


==See also==
==See also==


* [[Typesetter C]]
* [[Programming in C - A Tutorial]] - wonderfully clear and concise
* [[Old C Changes]] - some history of the development
* [[C Changes]]
* [[Typesetter C]] - one important stage
* [[Standard I/O library]] - I/O is not formally part of the language
* [[PDP-11 C stack operation]]
* [[PDP-11 C stack operation]]


{{semi-stub}}
==External links==
 
* [https://archive.org/download/bstj57-6-1991/bstj57-6-1991_text.pdf The C Programming Language] - a later [[BSTJ]] paper describing C
* [http://squoze.net/UNIX/bltj/06771914.pdf The Evolution of C - Past and Future] - covers things after K+R
* [https://www.nokia.com/bell-labs/about/dennis-m-ritchie/ Dennis M. Ritchie] - see section "C and its immediate ancestors"
** [https://www.nokia.com/bell-labs/about/dennis-m-ritchie/cman.pdf C Reference Manual] - the version from [[UNIX Sixth Edition|V6]]
** [https://www.nokia.com/bell-labs/about/dennis-m-ritchie/chist.html The Development of the C Language] ([https://www.nokia.com/bell-labs/about/dennis-m-ritchie/chist.pdf PDF]) - Ritchie paper with details of the early evolution
** [https://www.nokia.com/bell-labs/about/dennis-m-ritchie/primevalC.html Primeval C] - Ritchie notes on some C software archaeology
** [https://www.nokia.com/bell-labs/about/dennis-m-ritchie/clcs.html The C Language Calling Sequence] - interesting note by DMR and SCJ
** [https://www.nokia.com/bell-labs/about/dennis-m-ritchie/cchanges.pdf Recent Changes to C - November 15, 1978] - a few post-K+R changes
* [https://arstechnica.com/features/2020/12/a-damn-stupid-thing-to-do-the-origins-of-c/ “A damn stupid thing to do” — the origins of C] - starts at the beginning, with the CPL story


[[Category: Languages]]
[[Category: C Language]]
[[Category: C Language]]

Latest revision as of 14:06, 19 July 2025

The C programming language was derived from an earlier programming language called B, itself derived from BCPL. There was next a short-lived intermediary language called 'NB', or New B. C can be crisply, and aptly, described as 'BCPL with types and terser syntax'. The syntax arrived with B; types were added in the step to NB; and C added such things as structures.

A number of object-oriented languages have been influenced by C, including Objective-C, C++, D, Vala.

Dialects

There are two popular dialects, the original was K&R C, which spread with the original C compiler, and pcc, the portable C compiler. Later there was an ANSI standard for the C language, usually referred to as 'ANSI C'.

The C language evolved continuously starting in 1972. Some milestones:

  • 1972 - Primeval C - no struct, automatic variables can't be initialized.
  • 1973 - preprocessor added.
  • 1976? - Typesetter C - introduced long, unsigned, typedef, union, and changed =+ etc to +=.
  • 1978 - K&R C
  • 1989 - ANSI C

hello world

Ancient

char *hello "hello"; /* No = for initialization. */

main (argc, argv)
int argc;               /* Parameter declarations as in K&R. */
char **argv;
{
        char *world;    /* Auto variables can't be initialized. */
        world = "world";
        cprint ("%s %s\n", hello, world);       /* No stdio yet. */
}

K&R

#include <stdio.h>
main(argc,argv)
int argc;
char **argv;
{
        printf("Hello World\n");
        exit (0);
}

ANSI C

#include <stdio.h>
int main(int argc, char *argv[])
{
        printf("Hello World\n");
        return 0;
}

Compilers

See also

External links