summaryrefslogtreecommitdiff
path: root/doc/djblegacy.html
blob: dcf27cca3c7217fa17459aafc561b747260e9045 (plain)
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<html>
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Language" content="en" />
    <title>skalibs: the djb legacy</title>
    <meta name="Description" content="skalibs: the djb legacy" />
    <meta name="Keywords" content="skalibs c unix djb legacy library libstddjb" />
    <!-- <link rel="stylesheet" type="text/css" href="//skarnet.org/default.css" /> -->
  </head>
<body>

<p>
<a href="index.html">skalibs</a><br />
<a href="//skarnet.org/software/">Software</a><br />
<a href="//skarnet.org/">skarnet.org</a>
</p>

<h1> The DJB legacy </h1>

<h2> Who is this DJB guy, and why is he so special anyway&nbsp;? </h2>

<p>
<a href="https://cr.yp.to/">Dan J. Bernstein</a> is a cryptologist and
a mathematician; he's also the author of a widely known and used MTA,
<a href="https://cr.yp.to/qmail.html">qmail</a>, as well as a few
lesser known pieces of software.
</p>

<p>
 For some time he was quite active in some Unix software-related
Internet newsgroups and mailing-lists; he quickly became a
controversial figure of the Unix programming community, mostly
by being extremely vocal against well-known authors of
"mainstream" Unix software and by suggesting designs so removed
from traditional software design that a normal human reaction is
to first view him as a complete nut.
</p>

<p>
 I do not care for controversy. I am interested in the code. I was
a sysadmin at the time, and still learning to program in C beyond
what they teach you in school (i.e. not much). I had heard enough
horror stories with sendmail; so I gave a shot at qmail, trying to
understand its design principles and the way it was made. And then
I fell down the rabbit hole.
</p>

<p>
 Look, I don't care what you think of the guy, I don't know him
anyway, and this is totally beside the point. The only thing that
matters is that DJB's software is <strong>right</strong> in so
many ways. This software <strong>works</strong>. DJB's design
principles are <strong>sound</strong> and elegant; they are
sound foundations to build <strong>reliable, secure, and
low resource-consuming</strong> software. And the design,
when you get used to it, feels so unix-ish: it's Unix the way it
should have been from the start.
</p>

<p>
 Studying DJB's software was the best course in C/Unix programming
I ever had. Now I <em>teach</em> C/Unix; and I am really glad I
learned from the best.
</p>

<h2> Building beyond DJB's works. </h2>

<p>
 There's already
<a href="http://thedjbway.b0llix.net/">a lot you can do</a> with
pristine DJB software and some brains.
</p>

<p>
 However, I mostly see DJB as a pioneer. He showed it was possible
to think Unix differently and build secure, reliable and efficient
software without investing millions of dollars into it; now it is
up to software architects and programmers to use the breakthrough
and build upon it. There's a real demand for quality Unix software
out there; it's time to supply. And
<a href="http://thedjbway.b0llix.net/friends.html">I am not the only
one</a> thinking this way.
</p>

<p>
 So, skalibs.
</p>

<p>
 One of the "DJB philosophy" key points is to <em>question the
interfaces</em>. You have a task to do; you have existing interfaces.
What do you do?
</p>

<ul>
 <li> Most people don't even think about it and use the existing
interfaces, even if it amounts to cramming a square peg into a
round hole. This is why buffer overflows exist. This is why
people use abominations such as
<a href="https://www.opengroup.org/onlinepubs/9699919799/functions/gets.html">gets()</a>,
<em>which is still in the Single Unix Specification as of version 4,
in freaking June 2011</em>. This is why the System V
initialization scheme is still prevalent in Linux distributions,
despite being one of the slowest and most unreliable of all
initialization schemes. This is why people still use the
atrocious "libresolv" DNS client library. </li>
 <li> An alternative way of thinking is to ask yourself:
"Is the interface I have adequate for the task at hand?"
 <ul>
  <li> If yes: perfect, use that interface. </li>
  <li> If no: then <em>do not use</em> that interface, duh. Design a
better one and use it: so the complexity will be split and the code
will be easier to maintain. </li>
 </ul> </li>
</ul>

<p>
 Interfaces should be questioned <em>right down to the libc</em>. You
cannot build strong software on flakey foundations. And from a system
and network programmer's point of view, one thing is clear: <em>most
standard libc interfaces suck.</em> There is no buffered asynchronous
I/O. There is no timed I/O. There is no heap management helper. Even
<a href="libstddjb/safewrappers.html">simple system calls are not
always guaranteed to succeed!</a>
</p>

<p>
 That is where skalibs comes from. skalibs results from questioning
the libc interfaces, and providing replacements or additions where
the existing interfaces do not make it easy to write reliable, secure
and efficient software. It is <em>inspired by</em> DJB's work. It is
not a shrine or anything of the kind.
</p>

<h2> Conclusion </h2>

<p>
 So, in short, DJB is not a guru, I'm not a mindless brainwashed fan,
and the "DJB advocates" are not a cult. We just think DJB brought
something to Unix and more generally to the software programming world;
we learned from him, we write software following
sound principles that he was one of the first to really apply, and we give
credit where credit is due.
</p>

<p>
 Use our software. You will never want to go back.
</p>

</body>
</html>