5 Foreword
6 Preface
7 Begin Reading
8 Conclusion
9 Appendix: Solutions to the Exercises
10 List of Notations
11 Index of Programs
12 References
13 Index
14 End User License Agreement
1 v
2 iii
3 iv
4 xi
5 xii
6 xiii
7 xiv
8 1
9 2
10 3
11 4
12 5
13 6
14 7
15 8
16 9
17 10
18 11
19 12
20 13
21 14
22 15
23 16
24 17
25 18
26 19
27 20
28 21
29 22
30 23
31 24
32 25
33 26
34 27
35 28
36 29
37 30
38 31
39 32
40 33
41 35
42 36
43 37
44 38
45 39
46 40
47 41
48 42
49 43
50 44
51 45
52 46
53 47
54 48
55 49
56 50
57 51
58 52
59 53
60 54
61 55
62 56
63 57
64 58
65 59
66 60
67 61
68 62
69 63
70 64
71 65
72 66
73 67
74 68
75 69
76 70
77 71
78 72
79 73
80 74
81 75
82 76
83 77
84 78
85 79
86 80
87 81
88 82
89 83
90 84
91 85
92 86
93 87
94 88
95 89
96 90
97 91
98 92
99 93
100 94
101 95
102 96
103 97
104 98
105 99
106 100
107 101
108 102
109 103
110 104
111 105
112 106
113 107
114 108
115 109
116 110
117 111
118 112
119 113
120 114
121 115
122 116
123 117
124 118
125 119
126 120
127 121
128 122
129 123
130 124
131 125
132 126
133 127
134 128
135 129
136 130
137 131
138 132
139 133
140 134
141 135
142 136
143 137
144 138
145 139
146 140
147 141
148 142
149 143
150 144
151 145
152 146
153 147
154 148
155 149
156 150
157 151
158 152
159 153
160 154
161 155
162 156
163 157
164 158
165 159
166 160
167 161
168 162
169 163
170 164
171 165
172 166
173 167
174 168
175 169
176 170
177 171
178 172
179 173
180 174
181 175
182 176
183 177
184 179
185 180
186 181
187 182
188 183
189 184
190 185
191 186
192 187
193 188
194 189
195 190
196 191
197 192
198 193
199 194
200 195
201 196
202 197
203 198
204 199
205 200
206 201
207 202
208 203
209 204
210 205
211 206
212 207
213 208
214 209
215 210
216 211
217 212
218 213
219 214
220 215
221 216
222 217
223 218
224 219
225 220
226 221
227 222
228 223
229 224
230 225
231 226
232 227
233 228
234 229
235 230
236 231
237 232
238 233
239 234
240 235
241 236
242 237
243 238
244 239
245 240
246 241
247 242
248 243
249 244
250 245
251 246
252 247
253 248
254 249
255 250
256 251
257 252
258 253
259 254
260 255
261 257
262 259
263 260
264 261
265 262
266 263
267 264
268 265
269 266
270 267
271 268
272 269
273 270
274 271
275 272
276 273
277 274
278 275
279 276
280 277
281 278
282 279
283 280
284 281
285 282
286 283
287 284
288 285
289 287
290 288
291 289
292 290
293 291
294 293
295 294
296 295
297 296
298 297
299 298
300 299
301 300
302 301
303 302
304 303
305 304
306 305
307 306
308 307
309 308
310 309
311 310
Series EditorJean-Charles Pomerol
Concepts and Semantics of Programming Languages 1
A Semantical Approach with OCaml and Python
Thérèse Hardin
Mathieu Jaume
François Pessaux
Véronique Viguié Donzeau-Gouge
First published 2021 in Great Britain and the United States by ISTE Ltd and John Wiley & Sons, Inc.
part from any fair dealing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms and licenses issued by the CLA. Enquiries concerning reproduction outside these terms should be sent to the publishers at the undermentioned address:
ISTE Ltd
John Wiley & Sons, Inc.
27-37 St George’s Road
111 River Street
London SW19 4EU
Hoboken, NJ 07030
UK
USA
www.iste.co.uk
www.wiley.com
© ISTE Ltd 2021
The rights of Thérèse Hardin, Mathieu Jaume, François Pessaux and Véronique Viguié Donzeau-Gouge to be identified as the authors of this work have been asserted by them in accordance with the Copyright, Designs and Patents Act 1988.
Library of Congress Control Number: 2021930488
British Library Cataloguing-in-Publication Data
A CIP record for this book is available from the British Library
ISBN 978-1-78630-530-5
Computer programs have played an increasingly central role in our lives since the 1940s, and the quality of these programs has thus become a crucial question. Writing a high-quality program – a program that performs the required task and is efficient, robust, easy to modify, easy to extend, etc. – is an intellectually challenging task, requiring the use of rigorous development methods. First and foremost, however, the creation of such a program is dependent on an in-depth knowledge of the programming language used, its syntax and, crucially, its semantics, i.e. what happens when a program is executed.
The description of this semantics puts the most fundamental concepts into light, including those of value, reference, exception or object. These concepts are the foundations of programming language theory. Mastering these concepts is what sets experienced programmers apart from beginners. Certain concepts – like that of value – are common to all programming languages; others – such as the notion of functions – operate differently in different languages; finally, other concepts – such as that of objects – only exist in certain languages. Computer scientists often refer to “programming paradigms” to consider sets of concepts shared by a family of languages, which imply a certain programming style: imperative, functional, object-oriented, logical, concurrent, etc. Nevertheless, an understanding of the concepts themselves is essential, as several paradigms may be interwoven within the same language.
Introductory texts on programming in any given language are not difficult to find, and a number of published books address the fundamental concepts of language semantics. Much rarer are those, like the present volume, which establish and examine the links between concepts and their implementation in languages used by programmers on a daily basis, such as C, C++, Ada, Java, OCaml and Python. The authors provide a wealth of examples in these languages, illustrating and giving life to the notions that they present. They propose general models, such as the kit presented in Volume 2, permitting a unified view of different notions; this makes it easier for readers to understand the constructs used in popular programming languages and facilitates comparison. This thorough and detailed work provides readers with an understanding of these notions and, above all, an understanding of the ways of using the latter to create high-quality programs, building a safer and more reliable future in computing.
Читать дальше