Skip to content

Commit aa01879

Browse files
committed
Refactor paper.tex for clarity and consistency.
1 parent 8182896 commit aa01879

File tree

2 files changed

+34
-19
lines changed

2 files changed

+34
-19
lines changed

DEPENDS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ hard babel-russian
66
hard biblatex
77
hard booktabs
88
hard cancel
9+
hard caption
910
hard catchfile
1011
hard cjk
1112
hard cm-super

paper.tex

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
\begin{abstract}
2929
C++, Java, C\#, Python, Ruby, and JavaScript are the most powerful object-oriented programming languages if language power is defined as the number of \emph{features} available to a programmer.
3030
\eolang{}, on the other hand, is an object-oriented programming language with a reduced set of features: it has nothing but objects and mechanisms of their composition and decoration.
31-
We are trying to answer the following research question: ``Which known features are possible to implement using only objects?''
31+
This paper asks the following research question: ``Which known features are possible to implement using only objects?''
3232
\end{abstract}
3333

3434
\begin{document}
@@ -38,7 +38,7 @@
3838

3939
\section{Features}
4040

41-
To answer our research question we selected the most complex features and demonstrated how each of them may be represented in \eolang{}~\citep{bugayenko2021eolang} objects\footnote{%
41+
We selected the most complex features and demonstrated how each of them may be represented in \eolang{}~\citep{bugayenko2021eolang} objects\footnote{%
4242
\LaTeX{} sources of this paper are maintained in
4343
\href{https://github.com/REPOSITORY}{REPOSITORY} GitHub repository,
4444
the rendered version is \href{https://github.com/REPOSITORY/releases/tag/0.0.0}{\ff{0.0.0}}.}:
@@ -83,7 +83,8 @@ \section{Features}
8383
\subsection{Goto}
8484
\label{sec:goto}
8585

86-
Goto is a one-way imperative transfer of control to another line of code. There are only two possible cases of goto jumps: forward and backward.
86+
Goto is a one-way imperative transfer of control to another line of code.
87+
There are only two possible cases of goto jumps: forward and backward.
8788

8889
\subsubsection{Backward Jump}
8990

@@ -121,7 +122,7 @@ \subsubsection{Backward Jump}
121122
\end{ffcode}
122123

123124
Here, the one-argument abstract atom \ff{go.to} is being copied with a one-argument abstract anonymous object, which is a sequence of objects incrementing \ff{i} and then comparing it with the number ten.
124-
If the condition is true, \ff{g.backward} is called, which leads to a backward jump and re-iteration of \ff{go.to}.
125+
If the condition is true, \ff{backward} is called, which leads to a backward jump and re-iteration of \ff{go.to}.
125126

126127
\subsubsection{Forward Jump}
127128

@@ -158,7 +159,7 @@ \subsubsection{Forward Jump}
158159
\end{ffcode}
159160

160161
Here, the same abstract atom \ff{go.to} is copied with an abstract one-argument object that is a sequence of objects.
161-
When the condition is true, a forward jump is performed by \ff{g.forward} atom.
162+
When the condition is true, a forward jump is performed by \ff{forward} atom.
162163

163164
Similarly, the atom \ff{go.to} may be used to simulate other conditional jump statements, like \ff{break}, \ff{continue}, or \ff{return} in the middle of a function body (see \cref{sec:procedures}).
164165

@@ -205,7 +206,7 @@ \subsubsection{Complex Case}
205206

206207
Then, the translation to \eolang{} is trivial using the \ff{go.to} object.
207208

208-
In more complex cases, a program may first be restructured to replace \ff{goto} statements with loops and branching, as suggested by~\citet{williams1985restructuring,pan1996formal,erosa1994taming,ceccato2008goto}.
209+
In more complex cases, a program may first be restructured to replace \ff{goto} statements with loops and branching, as suggested by \citet{williams1985restructuring,pan1996formal,erosa1994taming,ceccato2008goto}.
209210

210211
\subsubsection{Multiple Returns}
211212

@@ -235,7 +236,7 @@ \subsubsection{Multiple Returns}
235236
-1.times x
236237
\end{ffcode}
237238

238-
The dataization of \ff{g.forward} will exit the \ff{go.to} object wrapping the entire code in the ``function'' \ff{abs}.
239+
The dataization of \ff{forward} will exit the \ff{go.to} object wrapping the entire code in the ``function'' \ff{abs}.
239240

240241
\subsection{Pointers}
241242
\label{sec:pointers}
@@ -286,13 +287,19 @@ \subsubsection{Pointers to Data}
286287
b.price
287288
\end{ffcode}
288289

289-
Here, \ff{p1} is an object that can be used as an argument of \ff{f}. It is a copy of an abstract object \ff{heap.pointer}, which expects two parameters: 1)~an absolute address in memory and 2)~the size of the memory block it points to, in bytes. Its attribute \ff{block} expects two attributes: 1)~the number of bytes in the heap and 2)~an abstract object that can encapsulate \ff{bytes} that were just read from memory.
290+
Here, \ff{p1} is an object that can be used as an argument of \ff{f}.
291+
It is a copy of an abstract object \ff{heap.pointer}, which expects two parameters:
292+
1)~an absolute address in memory
293+
and
294+
2)~the size of the memory block it points to, in bytes.
295+
Its attribute \ff{block} expects two attributes: 1)~the number of bytes in the heap and 2)~an abstract object that can encapsulate \ff{bytes} that were just read from memory.
290296

291297
The object \ff{heap} is an abstraction of a random access memory.
292298

293299
\subsubsection{Pointers to Code}
294300

295-
A pointer may not only refer to data in the heap but also to executable code in memory (there is no difference between ``program'' and ``data'' memory in both x86 and ARM architectures). This is an example of a C program that calls a function referenced by a function pointer, providing two integer arguments to it:
301+
A pointer may not only refer to data in the heap but also to executable code in memory (there is no difference between ``program'' and ``data'' memory in both x86 and ARM architectures).
302+
This is an example of a C program that calls a function referenced by a function pointer, providing two integer arguments to it:
296303

297304
\begin{ffcode}
298305
int foo(int x, int y) {
@@ -364,12 +371,15 @@ \subsubsection{Variables in Stack}
364371
ret
365372
\end{ffcode}
366373

367-
Here, the atom \ff{malloc} allocates a segment of bytes in the \ff{heap}. Later, the atom \ff{free} releases it. The attribute \ff{ret} is made constant to avoid its recalculation after it is ``returned'' (this mechanism is explained in \cref{sec:destructors} where destructors are discussed).
374+
Here, the atom \ff{malloc} allocates a segment of bytes in the \ff{heap}. Later, the atom \ff{free} releases it.
375+
The attribute \ff{ret} is made constant to avoid its recalculation after it is ``returned'' (this mechanism is explained in \cref{sec:destructors} where destructors are discussed).
368376

369377
\subsection{Procedures}
370378
\label{sec:procedures}
371379

372-
A subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. In different programming languages, a subroutine may be called a routine, subprogram, function, method, or procedure. In this PHP example, a function \ff{max} is defined:
380+
A subroutine is a sequence of program instructions that performs a specific task, packaged as a unit.
381+
In different programming languages, a subroutine may be called a routine, subprogram, function, method, or procedure.
382+
In this PHP example, a function \ff{max} is defined:
373383

374384
\begin{ffcode}
375385
function max($a, $b) {
@@ -398,9 +408,8 @@ \subsection{Impure Functions}
398408

399409
\broken
400410

401-
A function is pure when, among other qualities, it does not have side effects:
402-
no mutation of local static variables, non-local variables, mutable reference arguments,
403-
or input/output streams. This PHP function is impure:
411+
A function is pure when, among other qualities, it does not have side effects: no mutation of local static variables, non-local variables, mutable reference arguments, or input/output streams.
412+
This PHP function is impure:
404413

405414
\begin{ffcode}
406415
$a = 42;
@@ -428,7 +437,8 @@ \subsection{Classes}
428437
429438
\broken
430439
431-
A class is an extensible program code template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions or methods). The following program contains a Ruby class with a single constructor, two methods, and one mutable member variable:
440+
A class is an extensible program code template for creating objects, providing initial values for state (member variables) and implementations of behavior (member functions or methods).
441+
The following program contains a Ruby class with a single constructor, two methods, and one mutable member variable:
432442
433443
\begin{ffcode}
434444
class Book
@@ -461,7 +471,8 @@ \subsection{Classes}
461471
id.write i > @
462472
\end{ffcode}
463473

464-
Here, the constructor is represented by the object \ff{ruby-init}, which finishes the initialization of the object. Making an ``instance'' of a book would look like this:
474+
Here, the constructor is represented by the object \ff{ruby-init}, which finishes the initialization of the object.
475+
Making an ``instance'' of a book would look like this:
465476

466477
\begin{ffcode}
467478
book 42 > b
@@ -475,7 +486,8 @@ \subsection{Destructors}
475486

476487
\broken
477488

478-
In C++ and some other languages, a destructor is a method that is called for a class object when that object passes out of scope or is explicitly deleted. The following code will print both \ff{Alive} and \ff{Dead} texts:
489+
In C++ and some other languages, a destructor is a method that is called for a class object when that object passes out of scope or is explicitly deleted.
490+
The following code will print both \ff{Alive} and \ff{Dead} texts:
479491

480492
\begin{ffcode}
481493
#include <iostream>
@@ -509,7 +521,8 @@ \subsection{Destructors}
509521
\subsection{Exceptions}
510522
\label{sec:exceptions}
511523

512-
Exception handling is the process of responding to the occurrence of exceptions—anomalous or exceptional conditions requiring special processing—during the execution of a program. This C++ program utilizes exception handling to avoid segmentation fault due to null pointer de-referencing:
524+
Exception handling is the process of responding to the occurrence of exceptions—anomalous or exceptional conditions requiring special processing—during the execution of a program.
525+
This C++ program utilizes exception handling to avoid segmentation fault due to null pointer de-referencing:
513526

514527
\begin{ffcode}
515528
#include <iostream>
@@ -554,7 +567,8 @@ \subsection{Exceptions}
554567

555568
Here, the object \ff{try} expects three arguments: 1)~an abstract object to be dataized, 2)~an abstract object to be copied with one argument, in case dataization returns an encapsulated object, and 3)~an object to be dataized anyway (similar to Java \ff{finally} block).
556569

557-
In the object \ff{price}, we get the object \ff{error}, which, if dataized, causes the termination of dataization and a non-conditional jump to the ``catch'' object of the \ff{try}. The mechanism is similar to ``checked'' exceptions in Java, where a method's signature must declare all types of exceptions the method may throw.
570+
In the object \ff{price}, we get the object \ff{error}, which, if dataized, causes the termination of dataization and a non-conditional jump to the ``catch'' object of the \ff{try}.
571+
The mechanism is similar to ``checked'' exceptions in Java, where a method's signature must declare all types of exceptions the method may throw.
558572

559573
\subsubsection{Many Exception Types}
560574

0 commit comments

Comments
 (0)