context-2021-programming.tex /size: 6933 b    last modification: 2021-10-28 13:50
1% language=us
2
3\usemodule[present-boring,abbreviations-logos]
4
5\definehighlight[nb][style=bold,color=middlegray,define=no]
6
7\startdocument
8  [title={PROGRAMMING},
9   banner={the way \CONTEXT\ is set up},
10   location={context\enspace {\bf 2021}\enspace meeting}]
11
12\starttitle[title=Levels]
13
14When you look at \CONTEXT\ bottom|--|up (engine|--|interface) you will notice: \blank[2*big]
15
16\startnarrower
17
18\startitemize[n]
19
20\startitem
21    \highlight[nb]{primitives:} this is what the engine comes with
22\stopitem
23\startitem
24    \highlight[nb]{infrastructure:} basic management of data structures
25\stopitem
26\startitem
27    \highlight[nb]{helpers:} macros that hide complexity
28\stopitem
29\startitem
30    \highlight[nb]{subsystems:} collections of macros that implement functionality
31\stopitem
32\startitem
33    \highlight[nb]{mechanisms:} these combine various subsystems
34\stopitem
35\startitem
36    \highlight[nb]{modules:} extra functionality (uses 1--5)
37\stopitem
38\startitem
39    \highlight[nb]{styles:} handling sources and layout (uses 4--6)
40\stopitem
41
42\stopitemize
43
44\stopnarrower
45
46\blank[2*big] Users normally see \CONTEXT\ top|--|down (usage|--|hacking).
47
48\stoptitle
49
50% % %
51
52\starttitle[title=Styles]
53
54\startitemize
55
56\startitem
57    These are prebuilt solutions for common as well as rare situations.
58\stopitem
59
60\startitem
61    The system comes with some styles: the \type {s-*} files.
62\stopitem
63
64\startitem
65    Right from the start the idea was that you get some reasonable default.
66\stopitem
67
68\startitem
69    And if you want more you stepwise define your style as you go.
70\stopitem
71
72\startitem
73    It really is part of the game: exploration.
74\stopitem
75
76\startitem
77    Solving your problem is a nice challenge.
78\stopitem
79
80\startitem
81    If you want a completely predefined setup, shop somewhere else.
82\stopitem
83
84\stopitemize
85
86\stoptitle
87
88% % %
89
90\starttitle[title=Modules]
91
92\startitemize
93
94\startitem
95    A lot of functionality is built in.
96\stopitem
97
98\startitem
99    This helps to keep the system consistent.
100\stopitem
101
102\startitem
103    We could cheat and ship thousands of few|--|liner styles but don't do that.
104\stopitem
105
106\startitem
107    There are a few mechanisms that don't really fit into the core, so these are
108    implemented as modules that do fit into the interface: the \type {m-*} and
109    \type {x-*} files.
110\stopitem
111
112\startitem
113    Users can build and share their solutions which has resulted in some
114    third party modules: the \type {t-*} files.
115\stopitem
116
117\startitem
118    For (a few, often old) private files I use \type {p-*} name scheme.
119\stopitem
120
121\stopitemize
122
123\stoptitle
124
125% % %
126
127\starttitle[title=Mechanisms]
128
129\startitemize
130
131\startitem
132    These are combinations of subsystems but often they cannot really be distinguished.
133\stopitem
134
135\startitem
136    Examples are notes, that combine notations, lists, references, descriptions etc.
137\stopitem
138
139\stopitemize
140
141\stoptitle
142
143% % %
144
145\starttitle[title=Subsystems]
146
147\startitemize
148
149\startitem
150    This is what users see and can configure
151\stopitem
152
153\startitem
154    Most are (conceptually) rather old but evolved over time. There are no
155    fundamental differences between \MKIV\ and \LMTX, but the later is hopefully
156    a bit cleaner.
157\stopitem
158
159\startitem
160    Examples are fonts, languages, color, structure (sectioning, lists,
161    constructions, itemgroups, references), spacing, graphics, bibliographies,
162    positioning, numbering and layout.
163\stopitem
164
165\startitem
166    More hidden are the backend, export and \XML\ interfaces.
167\stopitem
168
169\startitem
170    Some have subsystems themselves, like widgets that relate to a specific
171    backend.
172\stopitem
173
174\startitem
175    There are often dependencies between subsystems which makes that it's not really a
176    hierarchy. A more strict separation would demand much more overhead.
177\stopitem
178
179\stopitemize
180
181\stoptitle
182
183% % %
184
185\starttitle[title=Helpers]
186
187\startitemize
188
189\startitem
190    These provide basic programming help.
191\stopitem
192
193\startitem
194    Examples are macros for comparing things, loops, list processing,
195    argument handling.
196\stopitem
197
198\startitem
199    But more abstract box manipulations also fits in here.
200\stopitem
201
202\startitem
203    Some subsystems, like \XML\ and bibliographies provide more specific low
204    level helpers.
205\stopitem
206
207\stopitemize
208
209\stoptitle
210
211% % %
212
213\starttitle[title=Infrastructure]
214
215\startitemize
216
217\startitem
218    The engine provides counters, dimension and other registers that need
219    to be managed in order to avoid clashes in usage.
220\stopitem
221
222\startitem
223    Many of the helpers, subsystems and mechanisms fall back on common rather
224    low level functions (\LUA) and macros (using primitives).
225\stopitem
226
227\stopitemize
228
229\stoptitle
230
231% % %
232
233\starttitle[title=Primitives]
234
235\startitemize
236
237\startitem
238    This is what the engine provides: the built|-|in commands and features.
239\stopitem
240
241\startitem
242    In addition to the visible primitives there are \LUA\ interfaces and these
243    permit adding extra primitives.
244\stopitem
245
246\startitem
247    In \LUAMETATEX\ we have the core \TEX\ set but a few were dropped because we
248    don't have a backend and a different \IO\ subsystem (so they have to be
249    emulated).
250\stopitem
251
252\startitem
253    We also have some of the \ETEX\ primitives and very few of the \PDFTEX\ ones
254    but I now consider for instance expansion and protrusion extensions to be
255    kind of \ETEX.
256\stopitem
257
258\startitem
259    There are additional \LUATEX\ primitives but some were dropped, again because
260    of the backend, so we emulate some, and also because some were experimental.
261\stopitem
262
263\startitem
264    There are quite some new primitives and existing mechanisms have been extended,
265    cleaned up and (hopefully) improved.
266\stopitem
267
268\stopitemize
269
270% % %
271
272\starttitle[title=The shift]
273
274\startitemize
275
276\startitem
277    There have always been complaints about \TEX\ as a language (what makes me
278    wonder why those who complain use it.)
279\stopitem
280
281\startitem
282    Although there are some extensions to the language in \ETEX, follow|-|ups have
283    not really succeeded in this area.
284\stopitem
285
286\startitem
287    At some point I decided that code in the categories 1|--|4 cold benefit from
288    extensions.
289\stopitem
290
291\startitem
292    That also meant that we use less of the low helpers. It makes the code look a
293    bit more \TEX.
294\stopitem
295
296\startitem
297    It also means less clutter, in code as well in tracing. Often the code
298    becomes simpler too.
299\stopitem
300
301\startitem
302    The idea is that \TEX\ becomes a bit more a programming language.
303\stopitem
304
305\startitem
306    Of course it takes away the \quotation {Watch me, I can do real dirty \TEX\
307    hacking!} brawling.
308\stopitem
309
310\startitem
311    It also can take away some of the complaints.
312\stopitem
313
314\startitem
315    And it definitely adds some fun.
316\stopitem
317
318\stopitemize
319
320{\em During the week we show some of the implementation (in Visual Studio) and
321examples of applications. We also write a small extension (the {\tttf dk} unit)}
322
323\stoptitle
324
325\stopdocument
326