2021-04-29 16:58:16 +03:00
|
|
|
% The MIT License (MIT)
|
|
|
|
%
|
2022-05-09 15:10:38 +03:00
|
|
|
% Copyright (c) 2020-2022 Yegor Bugayenko
|
2021-04-29 16:58:16 +03:00
|
|
|
%
|
|
|
|
% Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
% of this software and associated documentation files (the "Software"), to deal
|
|
|
|
% in the Software without restriction, including without limitation the rights
|
|
|
|
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
% copies of the Software, and to permit persons to whom the Software is
|
|
|
|
% furnished to do so, subject to the following conditions:
|
|
|
|
%
|
|
|
|
% The above copyright notice and this permission notice shall be included
|
|
|
|
% in all copies or substantial portions of the Software.
|
|
|
|
%
|
|
|
|
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
% FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
% SOFTWARE.
|
|
|
|
|
2022-06-06 18:40:58 +03:00
|
|
|
\documentclass[sigplan,nonacm,natbib=false]{acmart}
|
2021-04-29 16:58:16 +03:00
|
|
|
\settopmatter{printfolios=false,printccs=false,printacmref=false}
|
2022-06-06 18:40:58 +03:00
|
|
|
\usepackage[maxnames=1,minnames=1,maxbibnames=100,natbib=true,citestyle=authoryear,bibstyle=authoryear,doi=false,url=false,isbn=false,isbn=false,backend=biber]{biblatex}
|
2022-01-05 08:40:20 +03:00
|
|
|
|
|
|
|
\ifnum\pdfshellescape=1
|
|
|
|
\usepackage[finalizecache]{minted}
|
|
|
|
\else
|
|
|
|
\usepackage[frozencache]{minted}
|
|
|
|
\fi
|
|
|
|
|
2022-06-06 19:01:24 +03:00
|
|
|
\usepackage[T2A,T1]{fontenc}
|
|
|
|
\usepackage[utf8]{inputenc}
|
|
|
|
\usepackage[russian,english]{babel}
|
|
|
|
\renewcommand\ttdefault{cmtt}
|
2022-06-06 18:40:58 +03:00
|
|
|
\usepackage{csquotes}
|
2022-06-06 19:01:24 +03:00
|
|
|
\usepackage{ffcode}
|
|
|
|
\usepackage{CJKutf8}
|
|
|
|
\usepackage{paralist}
|
|
|
|
\usepackage{cancel} % to enable \cancel command
|
|
|
|
\usepackage{anyfontsize} % To get rid of font not found warnings
|
|
|
|
\usepackage{tabularx} % for special tables
|
|
|
|
\usepackage{amsmath}
|
|
|
|
\usepackage{to-be-determined}
|
|
|
|
\usepackage{href-ul}
|
|
|
|
\usepackage{amsthm}
|
|
|
|
\usepackage{tcolorbox} % for algorithm
|
|
|
|
\tcbuselibrary{skins}
|
|
|
|
\usepackage{fdsymbol} % for \mathbb
|
|
|
|
\usepackage{algpseudocode} % for algorithms
|
|
|
|
\usepackage{multicol} % for two cols in BNF
|
|
|
|
\usepackage{pgffor} % to enable \foreach
|
|
|
|
\usepackage{stmaryrd}
|
|
|
|
\usepackage{mathtools}
|
|
|
|
\newtheoremstyle{theorems}
|
|
|
|
{} % Space above
|
|
|
|
{} % Space below
|
|
|
|
{} % Theorem body font % (default is "\upshape")
|
|
|
|
{} % Indent amount
|
|
|
|
{\scshape} % Theorem head font % (default is \mdseries)
|
|
|
|
{.} % Punctuation after theorem head % default: no punctuation
|
|
|
|
{ } % Space after theorem head
|
|
|
|
{} % Theorem head spec
|
|
|
|
\theoremstyle{theorems}
|
|
|
|
\newtheorem{eodefinition}{Definition}
|
|
|
|
\newtheorem{eotheorem}{Theorem}
|
|
|
|
|
|
|
|
\tolerance=1500
|
|
|
|
\raggedbottom
|
|
|
|
\setlength\headheight{21pt}
|
|
|
|
|
|
|
|
\newcommand\nospell[1]{#1}
|
|
|
|
\newcommand\br{\\[-4pt]}
|
|
|
|
\newcommand\figcap[1]{\caption{#1}\Description{#1}}
|
|
|
|
\newcommand\phic{$\varphi$-calculus}
|
|
|
|
\newcommand\eo{{\sffamily EO}}
|
|
|
|
\newcommand\XMIR{{\sffamily XMIR}}
|
|
|
|
\newcommand\lref[1]{the line no.~\ref{ln:#1}}
|
|
|
|
\newcommand\lrefs[2]{the lines~\ref{ln:#1}--\ref{ln:#2}}
|
|
|
|
|
|
|
|
\newenvironment{twocols}{}{}
|
|
|
|
|
|
|
|
\usepackage{tikz}
|
|
|
|
\usetikzlibrary{arrows}
|
|
|
|
\usetikzlibrary{decorations}
|
|
|
|
\usetikzlibrary{decorations.pathmorphing}
|
|
|
|
\usetikzlibrary{intersections}
|
|
|
|
\usetikzlibrary{positioning}
|
|
|
|
\usetikzlibrary{backgrounds}
|
|
|
|
\usetikzlibrary{calc}
|
|
|
|
\usetikzlibrary{shapes.arrows}
|
|
|
|
\newenvironment{ingraph}%
|
|
|
|
{\noindent\begin{tikzpicture}[om,pics/parallel arrow/.style={code={\draw[-latex,rho] (##1) -- (-##1);}}]}%
|
|
|
|
{\end{tikzpicture}}
|
|
|
|
\tikzstyle{om} = [->,>=stealth',node distance=2.5cm,thick]
|
|
|
|
\tikzstyle{thing} = [thick,inner sep=0pt,minimum height=2.4em,draw,font={\small}]
|
|
|
|
\tikzstyle{object} = [thing,circle]
|
|
|
|
\tikzstyle{dup} = [thing,rectangle,draw=none,minimum height=1.5em,inner sep=3pt]
|
|
|
|
\tikzstyle{empty} = [object]
|
|
|
|
\tikzstyle{transforms} = [fill=white!80!black, single arrow, minimum height=0.5cm, minimum width=0.5cm,single arrow head extend=2mm]
|
|
|
|
\tikzstyle{rho} = [draw,decorate,decoration={snake,amplitude=.4mm,segment length=2mm,post length=1mm}]
|
|
|
|
\tikzstyle{ref} = []
|
|
|
|
\tikzstyle{edge-name} = [circle,font=\scriptsize,near start,sloped,fill=white,inner sep=0pt,sloped/.append style={transform shape}]
|
|
|
|
\tikzstyle{parent} = [draw,dotted]
|
|
|
|
\tikzstyle{atom} = [object,double]
|
|
|
|
\tikzstyle{lambda} = [xshift=-5pt,yshift=3pt,draw,fill=white,rectangle,thin,minimum width=1.2em,anchor=north west,font={\scriptsize}]
|
|
|
|
\tikzstyle{attr} = [midway,sloped,inner sep=0pt,above=2pt,sloped/.append style={transform shape},font={\scriptsize},color=black]
|
|
|
|
\tikzstyle{locator} = [attr,below=2pt]
|
|
|
|
\tikzstyle{Phi} = [font={\scriptsize}]
|
|
|
|
|
|
|
|
\newcounter{rule}
|
|
|
|
\renewcommand\therule{R\arabic{rule}}
|
|
|
|
\newcommand\rr{\smalltriangleright{}}
|
|
|
|
\newcommand\rrule[1]{{\scshape\sffamily\ref{rule:#1}}}
|
|
|
|
\newcommand{\jrule}[1]{%
|
|
|
|
\refstepcounter{rule}\label{rule:#1}%
|
|
|
|
\text{\textbf{\rrule{#1}}}}
|
|
|
|
\newcommand*{\ohat}[2]{%
|
|
|
|
\stackrel{\textcolor{gray}{#1}}{%
|
|
|
|
\textcolor{gray}{%
|
|
|
|
\overlinesegment{\textcolor{black}{%
|
|
|
|
\vrule height 8pt depth 1pt width 0pt%
|
|
|
|
#2%
|
|
|
|
}}%
|
|
|
|
}%
|
|
|
|
}%
|
|
|
|
}
|
|
|
|
\newenvironment{algo}
|
|
|
|
{\newcommand\kw[1]{{\bfseries\sffamily ##1}}
|
|
|
|
\newcommand\tab{{\hspace*{1em}}}
|
|
|
|
\noindent}
|
|
|
|
{}
|
2022-06-06 18:40:58 +03:00
|
|
|
|
|
|
|
\addbibresource{main.bib}
|
|
|
|
|
|
|
|
\setlength{\footskip}{13.0pt}
|
2021-06-13 17:31:15 +03:00
|
|
|
|
2021-06-13 07:45:44 +03:00
|
|
|
\acmBooktitle{untitled}
|
2021-08-11 18:43:38 +03:00
|
|
|
\title{EOLANG and \texorpdfstring{$\varphi$}{phi}-calculus}
|
2022-06-06 18:47:00 +03:00
|
|
|
\subtitle{%
|
2022-01-05 08:48:57 +03:00
|
|
|
Ver:
|
|
|
|
\texorpdfstring{
|
|
|
|
\href{https://github.com/REPOSITORY/releases/tag/0.0.0}
|
|
|
|
{\ff{0.0.0}}
|
|
|
|
}{0.0.0}
|
2022-06-06 18:47:00 +03:00
|
|
|
}
|
2021-11-26 08:58:41 +03:00
|
|
|
\author{Yegor Bugayenko}
|
|
|
|
\orcid{0000-0001-6370-0678}
|
2021-04-29 16:58:16 +03:00
|
|
|
\email{yegor256@gmail.com}
|
|
|
|
\affiliation{
|
2022-06-06 18:40:58 +03:00
|
|
|
\institution{Huawei}
|
2021-04-29 16:58:16 +03:00
|
|
|
\city{Moscow}
|
|
|
|
\country{Russia}
|
|
|
|
}
|
|
|
|
\ccsdesc[300]{Software and its engineering~Software notations and tools~Formal language definitions}
|
|
|
|
\keywords{Object-Oriented Programming, Object Calculus}
|
|
|
|
|
|
|
|
\begin{document}
|
|
|
|
|
|
|
|
\begin{abstract}
|
|
|
|
Object-oriented programming (OOP) is one of the most popular
|
|
|
|
paradigms used for building software systems. However, despite
|
|
|
|
its industrial and academic popularity, OOP is still missing
|
|
|
|
a formal apparatus similar to $\lambda$-calculus, which functional
|
|
|
|
programming is based on. There were a number of attempts to formalize
|
|
|
|
OOP, but none of them managed to cover all the features available in
|
|
|
|
modern OO programming languages, such as C++ or Java.
|
2021-06-17 09:30:45 +03:00
|
|
|
We have made yet another attempt and created \phic{}. We also
|
2021-04-29 16:58:16 +03:00
|
|
|
created EOLANG (also called \eo{}), an experimental
|
|
|
|
programming language based on \phic{}.
|
|
|
|
\end{abstract}
|
|
|
|
|
|
|
|
\maketitle
|
|
|
|
|
2021-06-13 10:22:51 +03:00
|
|
|
\section{Introduction}
|
|
|
|
\label{sec:intro}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/intro}
|
|
|
|
\input{sections/overview}
|
2021-04-29 16:58:16 +03:00
|
|
|
|
2021-06-13 14:50:12 +03:00
|
|
|
The rest of the paper is dedicated to the discussion of the
|
|
|
|
syntax of the language we created based on the calculus,
|
|
|
|
the calculus itself, its semantics, and pragmatics.
|
|
|
|
In order to make it easier to understand, we start
|
|
|
|
the discussion with the syntax of the language, while the calculus
|
|
|
|
is derived from it. Then, we discuss the
|
|
|
|
key features of \eo{} and the differences between it and other
|
|
|
|
programming languages. We also discuss how the absence of traditional
|
|
|
|
OOP features, such as mutability or inheritance, affect the complexity of code.
|
|
|
|
At the end of the paper we overview the work done by others in the area of
|
|
|
|
formalization of OOP.
|
|
|
|
|
2021-04-29 16:58:16 +03:00
|
|
|
\section{Syntax}
|
|
|
|
\label{sec:syntax}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/syntax}
|
2021-04-29 16:58:16 +03:00
|
|
|
|
|
|
|
\section{Calculus}
|
|
|
|
\label{sec:calculus}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/calculus}
|
2021-04-29 16:58:16 +03:00
|
|
|
|
|
|
|
\section{Semantics}
|
|
|
|
\label{sec:semantics}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/semantics}
|
2021-04-29 16:58:16 +03:00
|
|
|
|
|
|
|
\section{Pragmatics}
|
|
|
|
\label{sec:pragmatics}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/pragmatics}
|
2021-04-29 16:58:16 +03:00
|
|
|
|
2021-09-24 20:09:44 +03:00
|
|
|
\section{XMIR}
|
|
|
|
\label{sec:xmir}
|
|
|
|
\input{sections/xmir}
|
|
|
|
|
2021-05-27 20:56:31 +03:00
|
|
|
\section{Examples}
|
|
|
|
\label{sec:examples}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/examples}
|
2021-05-27 20:56:31 +03:00
|
|
|
|
2021-06-13 17:31:15 +03:00
|
|
|
\section{Mappings}
|
|
|
|
\label{sec:mappings}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/mappings}
|
2021-06-13 17:31:15 +03:00
|
|
|
|
2021-06-13 08:56:14 +03:00
|
|
|
\section{Key Features}
|
2021-06-13 08:15:32 +03:00
|
|
|
\label{sec:features}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/features}
|
2021-06-13 08:15:32 +03:00
|
|
|
|
2021-06-13 08:35:56 +03:00
|
|
|
\section{Four Principles of OOP}
|
|
|
|
\label{sec:four}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/four}
|
2021-06-13 08:35:56 +03:00
|
|
|
|
2021-06-13 08:56:14 +03:00
|
|
|
\section{Complexity}
|
|
|
|
\label{sec:complexity}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/complexity}
|
2021-06-13 08:56:14 +03:00
|
|
|
|
2021-06-13 07:00:48 +03:00
|
|
|
\section{Related Works}
|
|
|
|
\label{sec:related}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/related}
|
2021-06-13 07:00:48 +03:00
|
|
|
|
2021-04-29 16:58:16 +03:00
|
|
|
\section{Acknowledgments}
|
2021-08-11 17:29:30 +03:00
|
|
|
\input{sections/acks}
|
2021-04-29 16:58:16 +03:00
|
|
|
|
2022-06-06 18:40:58 +03:00
|
|
|
\printbibliography
|
|
|
|
|
2021-04-29 16:58:16 +03:00
|
|
|
\clearpage
|
|
|
|
|
|
|
|
\end{document}
|