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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% PAPER FOR: %%
%% https://locos.codeberg.page/loco2024/ %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% The first command in your LaTeX source must be the \documentclass
%% command.
%%
%% For submission and review of your manuscript please change the
%% command to \documentclass[manuscript, screen, review]{acmart}.
%%
%% When submitting camera ready or to TAPS, please change the command
%% to \documentclass[sigconf]{acmart} or whichever template is required
%% for your publication.
%%
%%
\documentclass[sigconf]{acmart}
%% For Unix quotes
\usepackage{epigraph}
\setlength{\epigraphrule}{0pt}
%% \BibTeX command to typeset BibTeX logo in the docs
\AtBeginDocument{%
\providecommand\BibTeX{{%
Bib\TeX}}}
%% Rights management information. This information is sent to you
%% when you complete the rights form. These commands have SAMPLE
%% values in them; it is your responsibility as an author to replace
%% the commands and values with those provided to you when you
%% complete the rights form.
\setcopyright{none}
\copyrightyear{2024}
\acmYear{2024}
\acmDOI{}
%% These commands are for a PROCEEDINGS abstract or paper.
\acmConference[LOCO '24]{1st International Workshop on Low Carbon
Computing}{December 05, 2024}{Glasgow, Scotland, United Kingdom }
%%
%% Uncomment \acmBooktitle if the title of the proceedings is different
%% from ``Proceedings of ...''!
%%
%%\acmBooktitle{Woodstock '18: ACM Symposium on Neural Gaze Detection,
%% June 03--05, 2018, Woodstock, NY}
\setcopyright{none}
\settopmatter{printacmref=false}
\acmDOI{}
\acmISBN{}
%% Submission ID.
%% Use this when submitting an article to a sponsored event. You'll
%% receive a unique submission ID from the organizers
%% of the event, and this ID should be used as the parameter to this command.
%%\acmSubmissionID{123-A56-BU3}
%% For managing citations, it is recommended to use bibliography
%% files in BibTeX format.
%%
%% You can then either use BibTeX with the ACM-Reference-Format style,
%% or BibLaTeX with the acmnumeric or acmauthoryear sytles, that include
%% support for advanced citation of software artefact from the
%% biblatex-software package, also separately available on CTAN.
%%
%% Look at the sample-*-biblatex.tex files for templates showcasing
%% the biblatex styles.
%%
%%
%% The majority of ACM publications use numbered citations and
%% references. The command \citestyle{authoryear} switches to the
%% "author year" style.
%%
%% If you are preparing content for an event
%% sponsored by ACM SIGGRAPH, you must use the "author year" style of
%% citations and references.
%% Uncommenting
%% the next command will enable that style.
%%\citestyle{acmauthoryear}
%% Easy way to write code inline
\newcommand{\code}{\texttt}
%% end of the preamble, start of the body of the document source.
\begin{document}
%% The "title" command has an optional parameter,
%% allowing the author to define a "short title" to be used in page headers.
\title{Simplifying modern computing by embracing the language}
\subtitle{A case study using Scheme}
%%
%% The "author" command and its associated commands are used to define
%% the authors and their affiliations.
%% Of note is the shared affiliation of the first two authors, and the
%% "authornote" and "authornotemark" commands
%% used to denote shared contribution to the research.
\author{Ekaitz Zárraga Río}
%% \authornote{Both authors contributed equally to this research.}
\email{ekaitz@elenq.tech}
%% \affiliation{%
%% \institution{Institute for Clarity in Documentation}
%% \city{Dublin}
%% \state{Ohio}
%% \country{USA}
%% }
%%
%% By default, the full list of authors will be used in the page
%% headers. Often, this list is too long, and will overlap
%% other information printed in the page headers. This command allows
%% the author to define a more concise list
%% of authors' names for this purpose.
\renewcommand{\shortauthors}{Zárraga Río E.}
%% The abstract is a short summary of the work to be presented in the
%% article.
\begin{abstract}
Unix based Operating Systems have dominated the computer market since its
inception and its concepts and needs have impregnated almost every aspect of
modern computing.
In this paper a novel approach for optimization is proposed, one that is
rooted on the simplification of personal computers by embracing the
programming language \textit{Scheme}, and describes how this strategy
provides a high level of abstraction and opens the door to many research
topics that directly challenge the current computing ecosystem, where
industry relies in the continuous delivery of heavily specialized hardware to
support the ever growing software demands, mainly coming from Unix's
heritage.
\end{abstract}
%% Document outline:
%% - Motivation: Simplification as a mean for more efficient computing and
%% a more accessible manufacture. Modern computing systems are so complex
%% that they require very good manufacturing to deal with the excessive
%% computing waste.
%% Also, maintenance should be reduced as much as possible, even leaving it
%% in the hands of the user, as Oberon would, reducing the impact of the
%% repairs, upgrades, and computing infrastructure needed for simple tasks.
%% - Kernels, Unix
%% - Interpreters
%% - Shells
%% - Are interpreters a kernel?
%% - Removing layers instead of adding layers
%% - Unikernels: Good idea but miss the target.
%% Keywords. The author(s) should pick words that accurately describe
%% the work being presented. Separate the keywords with commas.
\keywords{Operating Systems, Programming Languages, Interpreters, CPU}
%% A "teaser" image appears between the author and affiliation
%% information and the body of the document, and typically spans the
%% page.
%% \begin{teaserfigure}
%% \includegraphics[width=\textwidth]{sampleteaser}
%% \caption{Seattle Mariners at Spring Training, 2010.}
%% \Description{Enjoying the baseball game from the third-base
%% seats. Ichiro Suzuki preparing to bat.}
%% \label{fig:teaser}
%% \end{teaserfigure}
%% Dates for the article
%% \received{20 February 2007}
%% \received[revised]{12 March 2009}
%% \received[accepted]{5 June 2009}
%% This command processes the author and affiliation and title
%% information and builds the first part of the formatted document.
\maketitle
\section{Context}
%% We need to understand context ...
The computing industry, arguably due to its rapid emergence, has been driven
by \textit{backwards compatibility}. This section summarizes the most
influential milestones in computing history and their impact in modern
computer hardware.
\subsection{Von Neumann model}
The von Neummann model introduced in 1945 proposes a general purpose device
consisting of a \textit{Central Processing Unit} (CPU) and a \textit{Store}.
The \textit{Store} is often implemented as a \textit{Random Access Memory}
(RAM or, simply, \textit{memory}).
In the von Neumann model the data and the program are both written to and
read from the \textit{Store}. This fact imposes limitations in any design
that aims to have direct access to memory and multitasking, as any running
program could read and manipulate other running program's memory, and even
manipulate its behavior, overwriting the program itself.
\subsection{Unix's heritage}
\epigraph{
Applicants must also have extensive knowledge of Unix, although they should
have sufficiently good programming taste to not consider this an achievement.
}{\textit{-- Hal Abelson}}
Since its inception, Unix was a huge innovation in Operating Systems market.
Its main features include \textit{multitasking} and \textit{multi-user}
support, a programming interface, \textit{files as abstractions} for devices
and other objects and a powerful \textit{shell} that facilitates program
composition.
In the Unix model, the Kernel, the core of the Operating System, is
responsible for managing the hardware resources. For that job, it uses
several concepts that systems designers and programmers are familiarized with
and are discouraged to change. Those include \textit{virtual memory},
\textit{processes}, \textit{shared-memory threads}, \textit{hierarchical
filesystems} and \textit{system calls}.
The \textit{shell} is run as a userspace program that has the ability to
launch other programs using an outdated fork+exec mechanism that encourages
memory overshoot\cite{fork:Baumann}. The shell in Unix systems is optimized
for text processing as, in McIlroy's words, \textit{"text streams [are] the
universal interface"} \cite{QuarterCenturyUnix:Salus}.
Userspace programs are loaded in and given access to \textit{virtual memory},
and they can only run the \textit{unprivileged} subset of the CPU
instructions. For restricted operations, programs need to call the
\textit{Kernel} using a \textit{system-call} that can be accepted or rejected
by the latter, according to \textit{permissions} or resource availability. In
order to achieve multitasking, many programs can be loaded in memory
(\textit{processes}) simultaneously and the \textit{Kernel}
\textit{schedules} which of the them will run at a given moment in time.
% \paragraph{Concurrency}
% If programs need to operate concurrently they can create many
% \textit{processes} or use \textit{threads}. A \textit{thread} is a
% lightweight version of a \textit{process} that shares the memory with the
% \textit{process} that created it. Resource sharing in a concurrent system has
% many security and reliability implications, and has proven to be a difficult
% subject for computer programmers over the years
% \cite{Threads:Lee}.
%
%
%\subsubsection{Interpreters}
% Interpreters, like one in the \textit{shell}, are a fundamental part of
% modern day programming. Interpreters are run as userspace programs, acting as
% a \textit{host} for the program they interpret. The interpreter effectively
% hides the details of the Operating System, often even implementing a virtual
% machine for that job, in order to provide \textit{portability} and
% \textit{usability} to the programmers. That is why the most used and demanded
% programming languages nowadays are interpreted \cite{PLCommunity:Tambad}.
% Unix was marketed as a system for multiple languages / supports many
% languages via interpreters that ease the development experience. Describe how
% they work and why they are useful
% Interpreters are programs that run in userspace
\subsection{Computer hardware}
Computer processors, often marketed as "\textit{general purpose}", are based
on the von Neumann model\cite{LiberateFromVonNeumann:Backus}, a CPU and a
Store that is, and designed for running an Operating System on them. They
clearly separate \textit{privileged}, reserved for the kernel, and
\textit{unprivileged} instructions, that any userspace program can use, in
order to facilitate \textit{system-calls} and \textit{interrupt} and
\textit{virtual memory} control.
Contrary to what one could expect, improvements in the processor
architectures come from specialization, instead of generalization, making
processors heavily optimized machines for Operating Systems that follow the
Unix model (including MS Windows), and a memory layout that resembles that of
a \textit{C-like} program, which also comes from the days of Unix
\cite{GeneralPurposeProcessor:Chisnall}, reducing the chance for other
paradigms to succeed.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Simplification enables optimization}
Choosing a language and committing to it enables aggressive simplification of
the computing systems, taking advantage of that, many research areas open.
Most of them confront Unix's heritage and modern computing but could provide
a powerful but simple set of constructs that allow to create simple computers
that can be maintained by an individual and reduce the economical and
environmental costs of infrastructure of the modern CPU fabrication.
\subsection{Embracing the language: Scheme}
\textit{Scheme} is a simple language, with a minimal standard, that enables a
huge level of abstraction thanks to its minimal but powerful core concepts
which are also present in mainstream programming languages today (Python,
JavaScript).
The \textit{Lisp} family of languages have proven to be flexible and powerful
for system design \cite{LispMachine:Greenblatt} and particularly
\textit{Scheme} has a long history of research in language and CPU design
\cite{Lambda:Steele}.
The nature of the Lisp family of languages also makes them suitable as file
formats\cite{SXML:Kiselyov} for storage and configuration files, for
extending the language or writing DSLs \cite{LanguageOriented:Culpepper},
eliminating the need to rely on unstructured text.
\subsection{Operating System}
An Operating System that embraces the language becomes a bare metal
interpreter, eliminating the duplication of tasks present in Unix operating
systems \cite{MIMOSA:Yvon}. The Operating System is accessible in the runtime
environment of the programs. \textit{System calls} become \textit{procedure
calls}. The \textit{Shell} is a system \textit{REPL}, an interactive
environment for programming that exposes Operating System's facilities.
\subsubsection{Capability based security "lambda-style"}
Most modern computers do not have more than a single user, but they preserve
an antique user management system, inherited from Unix, recycled for program
permissions.
3L \cite{3L:Hintz} explored an OS where permission control is reduced to
\textit{environments} with access to a limited set of bindings
\cite{securityKernelLambda:Rees}. A program can only access the bindings
provided by the system, which also facilitates fine grained control letting
the user replace system bindings by ad-hoc versions when needed.
\subsubsection{Managed memory}
Virtual memory is an attempt to isolate programs from each other and provide
a permission system on top of a flawed von Neumann model, but it is a
leaky abstraction that can be exploited\cite{SpectreMeltdown:HillMasters}.
Preventing direct access to memory, replacing it with managed memory,
obviates the need of virtual memory and decouples underlying implementations
from user programs.
\subsubsection{Concurrency}
Unix-style concurrency, reinforced by modern \textit{multi-core} CPU design
and threads, is hard to reason about\cite{Threads:Lee}. A multitasking system
can be approached in terms of \textit{Scheme}'s
\textit{continuations}\cite{ContinuationsConcurrency:Hieb}, embracing its
first-class constructs.
\subsection{Computer hardware}
Attempts have been done to run \textit{Scheme} in a bare-metal environment
using commodity hardware\cite{MIMOSA:Yvon}\cite{Loko:Weinholt}, but they do
not take advantage of hardware optimized for \textit{Scheme}, which would
provide huge performance benefits and simplify the interpreter and
potentially the CPU.
\subsubsection{Optimization for tree structures}
\textit{Scheme} is profoundly based on the \textit{cons cell}, similar to a
\textit{linked-list} node, and the data structures that can be created from
it (\textit{lists} and \textit{trees}). Optimizing the CPU for that case,
with fast lookups and \code{car} and \code{cdr} operations would impact its
performance.
\subsubsection{CPU as a reducer}
Like other functional programming languages, \textit{Scheme} is based on
expression reduction, in opposition to imperative languages, where the basis
is the \textit{statement}, that matches current processor architectures
better. This research area, was mainly abandoned after the modern CPU
architectures flooded the market, but has a long
history\cite{LiberateFromVonNeumann:Backus} and has been revived with the
introduction of Field Programmable Gate Arrays,
\textit{FPGA}\cite{Heron:Ramsay}.
\subsubsection{Hardware garbage collection}
When the whole system uses managed memory, the Garbage Collection,
\textit{GC}, can be pushed down in the stack. Both Oberon\cite{Oberon:Wirth}
and MIMOSA \cite{MIMOSA:Yvon} propose Garbage Collector as part of the
Operating System. A computing device that embraces \textit{Scheme} in its
core may take a more radical approach and involve the hardware in the Garbage
Collection process. Hardware assisted GC has been proven to improve the
performance of managed memory in von Neumann style processors
\cite{HWAssistedGC:Maas} and Lisp Machines\cite{LispMachine:Greenblatt}.
\subsubsection{Exploration via reconfigurable Hardware}
A design based on a FPGA would facilitate incremental testing and evaluation
of the impact of the proposed optimizations. If a Hardware Description
Language, \textit{HDL}, and support for Partial and Dynamic
Reconfiguration\cite{FPGAReconf:Vipin} are provided within the system, it
could be updated with no distinction between hardware and software, while
making the system more resistant to trusting-trust and supply-chain
attacks\cite{riscvSelfHostingComputer:Somlo}. A \textit{rollback}
system\cite{Guix:Courtes} could always recover the state of both hardware and
software as a whole.
\subsection{Environmental implications}
A computing system designed around its reconfigurability is less likely to
become obsolete in the short term and encourages its repurpose once it
happens. This attenuates the \textit{embodied} environmental impact of the
device, which nowadays accounts for the majority of computing systems'
\(CO_{2}\) emissions \cite{Carbon:Gupta}.
While FPGAs are not as efficient as Application Specific Integrated Circuits,
\textit{ASIC}, which would increase the \textit{operational} impact of the
system, an aggressive simplification has been proven to have acceptable
performance and energy usage in minimalistic processors running in a baseline
FPGA\cite{Oberon:Wirth}, even without the optimization level proposed in this
document. Additionally, the low-power nature of personal
computing facilitates the decarbonization of its energy sources, reducing the
environmental impact of the device operation to negligible levels.
\section{Conclusion}
This paper introduces a computing system that combines a reconfigurable CPU
and a simplified approach to Operating System design that embraces the
programming language \textit{Scheme} and proposes several optimizations and
research areas that its design would enable.
The cited literature demonstrates systems with a level of simplification
analogous to the one proposed in this document can be implemented and
maintained by a single individual, down to the hardware, while keeping it
secure, accessible and bootstrappable if carefully designed.
The reconfigurability of the system directly challenges the current computer
processor supply chain that relies on very specialized \textit{ASIC}
manufacture. The proposed generalization of the hardware attenuates its
embodied environmental impact pushing the specialization to the software
side, the malleable part of the system, where a language with high level of
abstraction can provide a solid foundation for a more human-centered design
that finally obsoletes the antiquities from the times of Unix.
\clearpage
%% The acknowledgments section is defined using the "acks" environment
%% (and NOT an unnumbered section). This ensures the proper
%% identification of the section in the article metadata, and the
%% consistent spelling of the heading.
%% \begin{acks}
%% To Robert, for the bagels and explaining CMYK and color spaces.
%% \end{acks}
%% The next two lines define the bibliography style to be used, and
%% the bibliography file.
\bibliographystyle{ACM-Reference-Format}
\bibliography{../../bibliography}
%% If your work has an appendix, this is the place to put it.
%% \appendix
\end{document}
\endinput
|