chiark / gitweb /
d5099251162b0204c72d512d1e64f8f912b6e6b1
[sod] / doc / intro.tex
1 %%% -*-latex-*-
2 %%%
3 %%% Introduction to Sod and its object system
4 %%%
5 %%% (c) 2015 Straylight/Edgeware
6 %%%
7
8 %%%----- Licensing notice ---------------------------------------------------
9 %%%
10 %%% This file is part of the Sensible Object Design, an object system for C.
11 %%%
12 %%% SOD is free software; you can redistribute it and/or modify
13 %%% it under the terms of the GNU General Public License as published by
14 %%% the Free Software Foundation; either version 2 of the License, or
15 %%% (at your option) any later version.
16 %%%
17 %%% SOD is distributed in the hope that it will be useful,
18 %%% but WITHOUT ANY WARRANTY; without even the implied warranty of
19 %%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 %%% GNU General Public License for more details.
21 %%%
22 %%% You should have received a copy of the GNU General Public License
23 %%% along with SOD; if not, write to the Free Software Foundation,
24 %%% Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26 \chapter{Introduction} \label{ch:intro}
27
28 Sod is an object system for the C programming language.
29
30 The software distribution for Sod contains two main parts:
31 \begin{itemize}
32 \item a translator, or preprocessor, similar in spirit to \manpage{lex}{1} or
33   \manpage{yacc}{1}, which reads input files containing class definitions,
34   and writes C source code and header files; and
35 \item a very small runtime library, containing the built-in base classes and
36   some simple utility macros and functions for working with instances and
37   classes.
38 \end{itemize}
39
40 %%%--------------------------------------------------------------------------
41 \section{About Sod's object system} \label{ch:intro.about}
42
43 Sod implements a fairly sophisticated object system, with multiple
44 inheritance, but only single dispatch.
45
46 \subsection{Ideology}
47
48 Object systems tend to come with ideology attached, so Sod is no exception;
49 but Sod's ideology is different from that of most object systems.
50 \begin{itemize}
51 \item Sod provides an object system, not a module system.  Sod provides no
52   facilities for `information hiding'; there is no equivalent to the
53   @|private| or @|protected| annotations in Java or \Cplusplus.  The author
54   takes the view (a) that such facilities are propertly part of a module
55   system, and that trying to abuse classes so that they become modules is a
56   mistake; and (b) that much useful functionality is unnecessarily hidden
57   away behind abstract interfaces, and a gentle-ish nudge towards greater
58   openness is called for.
59 \item Sod's objective is to provide an effective tool for the expert
60   programmer, in the classic `make easy things simple and, difficult things
61   possible' mould.  It isn't intended to be useful in an environment
62   containing unassisted novice programmers.  Sod tries to avoid placing
63   technically unnecessary restrictions on programmers, and is likely to
64   evolve in the direction of eliminating existing restrictions rather than
65   growing new `safety' features.
66 \end{itemize}
67
68 %%%--------------------------------------------------------------------------
69 \section{About this manual}
70
71 This manual intends to provide complete documentation about Sod.
72
73 %%%----- That's all, folks --------------------------------------------------
74
75 %%% Local variables:
76 %%% mode: LaTeX
77 %%% TeX-master: "sod.tex"
78 %%% TeX-PDF-mode: t
79 %%% End: