-
Notifications
You must be signed in to change notification settings - Fork 13
/
CWorld.html
106 lines (93 loc) · 3.41 KB
/
CWorld.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css"/>
<title>
The World According to C
</title>
</head>
<body>
<h1>
The World According to C
</h1>
<div style="text-align:center">
<p>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/9/95/The_C_Programming_Language%2C_First_Edition_Cover_%282%29.svg/171px-The_C_Programming_Language%2C_First_Edition_Cover_%282%29.svg.png">
</p>
</div>
<h2>
Why C?
</h2>
<figure>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/47/River_terrapin.jpg/170px-River_terrapin.jpg">
<figcaption>
It's turtles all the way down!
</figcaption>
</figure>
<p>
Why should we bother with such an "old-fashioned"
language? Haven't Python and Ruby and Java and... replaced C?
And it's so hard to use!
</p>
<figure>
<img
src="https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Tiobe_index.png/420px-Tiobe_index.png">
<figcaption>
The popularity of various languages. C is in red.
</figcaption>
</figure>
<p>
C: "All the speed of assembly, with all the ease of use of
assembly."
<br>
<br>
But an operating system <i>needs</i> to have direct access
to memory, device drivers, etc. C delivers that in a
structured language.
<br>
<b>Compare:</b>
<pre>
<code>
if(i > j)
{
z = 1;
}
else
{
z = 0;
}
...
cmp i, j
jne set_zero
mov z, 1
jump continue
set_zero: mov z, 0
continue: ...
</code>
</pre>
</p>
<p>
<a
href="https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/minix/kernel/proc.h">
Header files
</a>
</p>
<p>
<a
href="https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html">
Building a larger C program
</a>
</p>
<h2>
External Links
</h2>
<ul>
<li>
<a
href="https://en.wikipedia.org/wiki/C_(programming_language)">
The C Programming Language
</a>
</ul>
</body>
</html>