HTML conversions sometimes display errors due to content that did not convert correctly from the source. This paper uses the following packages that are not yet supported by the HTML conversion tool. Feedback on these issues are not necessary; they are known and are being worked on.

  • failed: anyfontsize
  • failed: pgffor
  • failed: silence

Authors: achieve the best HTML results from your LaTeX submissions by following these best practices.

License: CC BY 4.0
arXiv:2111.13384v5 [cs.PL] 01 Mar 2024
\WarningFilter

acmarthould only be used to provide space above/below

EOLANG and Ļ†šœ‘\varphiitalic_Ļ†-calculus

Yegor Bugayenko 0000-0001-6370-0678 [email protected] HuaweiMoscowRussia
Abstract.

Object-oriented programming (OOP) is one of the most popular paradigms used for building software systems111 sources of this paper are maintained in objectionary/eo GitHub repository, the rendered version is 0.35.5.. However, despite its industrial and academic popularity, OOP is still missing a formal apparatus similar to Ī»šœ†\lambdaitalic_Ī»-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. We have made yet another attempt and created Ļ†šœ‘\varphiitalic_Ļ†-calculus. We also created EOLANG (also called EO), an experimental programming language based on Ļ†šœ‘\varphiitalic_Ļ†-calculus.

Object-Oriented Programming, Object Calculus
ā€ ā€ booktitle: untitledā€ ā€ ccs: Software and its engineeringĀ Software notations and toolsĀ Formal language definitions

1. Introduction

It is difficult to define what exactly is OOP, as ā€œthe term has been used to mean different things,ā€ according toĀ Stefik and Bobrow (1985). Madsen and MĆøller-Pedersen (1988) claimed that ā€œthere are as many definitions of OOP as there papers and books on the topic.ā€ Armstrong (2006) made a noticeable observation: ā€œWhen reviewing the body of work on OO development, most authors simply suggest a set of concepts that characterize OO, and move on with their research or discussion. Thus, they are either taking for granted that the concepts are known or implicitly acknowledging that a universal set of concepts does not exist.ā€

1.1. Lack of Formal Model

The term OOP was coined byĀ Kay (1997) in 1966 and since then was never introduced formallyĀ (Kay, 1986). Back in 1982, Rentsch (1982) predicted: ā€œEveryone will be in a favor of OOP. Every manufacturer will promote his products as supporting it. Every manager will pay lip service to it. Every programmer will practice it (differently). And no one will know just what it is.ā€

There is a fundamental problem in OOPā€”the lack of a rigorous formal model, as was recapped byĀ Eden and Hirshfeld (2001): ā€œUnfortunately, architectural formalisms have largely ignored the OO idiosyncrasies. Few works recognized the elementary building blocks of design and architecture patterns. As a result of this oversight, any attempt to use formalisms for the specification of OO architectures is destined to neglect key regularities in their organization.ā€

There is no uniformity or an agreement on the set of features and mechanisms that belong in an OO language as ā€œthe paradigm itself is far too general,ā€ as was concluded byĀ Nierstrasz (1989) in his survey.

OO and semi-OO programming languages treat OOP differently and have variety of different features to follow the concept of object-orientedness. For example, Java has classes and types (interfaces) but doesnā€™t have multiple inheritanceĀ (Alpern etĀ al., 2001), C++ has multiple inheritance but doesnā€™t directly support mixinsĀ (Burton and Sekerinski, 2014), Ruby and PHP donā€™t have generics and types, but have traitsĀ (Bi and Oliveira, 2018), JavaScript doesnā€™t have classes, but has prototypesĀ (Richards etĀ al., 2010), and so on.

It was noted by Danforth and Tomlinson (1988) that object-oriented programming, like functional programming or logic programming, incorporates a metaphor in which computation is viewed in terms divorced from the details of actual computation. However, in the case of OOP, this metaphor is rarely introduced with the mathematical precision available to the functional or logic programming models. Rather, OOP is generally expressed in philosophical terms, resulting in a natural proliferation of opinions concerning exactly what OOP really is.

1.2. Complaints of Programmers

Although the history of OOP goes back for more than 50 years to the development of SimulaĀ (Dahl and Nygaard, 1966), OOP is under heavy criticism since the beginning to nowadays, mostly for its inability to solve the problem of software complexity.

According toĀ Graham (2004), ā€œsomehow the idea of reusability got attached to OOP in the 1980s, and no amount of evidence to the contrary seems to be able to shake it free,ā€ while ā€œOOP offers a sustainable way to write spaghetti code.ā€ West (2004) argues that the contemporary mainstream understanding of objects (which is not behavioral) is ā€œbut a pale shadow of the original ideaā€ and ā€œanti-ethical to the original intent.ā€ Gosling and McGilton (1995) notes that ā€œunfortunately, ā€˜object orientedā€™ remains misunderstood and over-marketed as the silver bullet that will solve all our software ills.ā€

1.3. High Complexity

Nierstrasz (2010) said that ā€œOOP is about taming complexity through modeling, but we have not mastered this yet.ā€ Readability and complexity issues of OO code remain unsolved till today. Shelly (2015) claimed that ā€œReading an OO code you canā€™t see the big picture and it is often impossible to review all the small functions that call the one function that you modified.ā€ Khanam (2018) in a like manner affirmed: ā€œObject oriented programming promotes ease in designing reusable software but the long coded methods makes it unreadable and enhances the complexity of the methods.ā€

The complexity of OO software is higher than the industry would expect, taking into account the amount of efforts invested into the development of OO languages. As was concluded byĀ Bosch (1997), ā€œOO frameworks have number of problems that complicate development, usage, composition and maintenance of software.ā€

For example, the infamous legacy code has its additional overhead associated with OO languagesā€”inheritance mechanism, which ā€œallows you to write less code at the cost of less readability,ā€ as explained byĀ Carter (1997). It is not infrequently when ā€œinheritance is overused and misused,ā€ which leads to ā€œincreased complexity of the code and its maintenance,ā€ as noted byĀ Bernstein (2016).

The lack of formalism encouraged OOP language creators to invent and implement language features, often known as ā€œsyntax sugar,ā€ which are convenient for some of them in some special cases but jeopardize the consistency of design when being used too often and by less mature programmers. The most obvious outcome of design inconsistencies is high complexity due to low readability, which negatively affects the quality and leads to functionality defects.

1.4. Solution Proposed

EO222https://www.eolang.org was created in order to eliminate the problem of complexity of OOP code, providing 1) a formal object calculus and 2) a programming language with a reduced set of features. The proposed Ļ†šœ‘\varphiitalic_Ļ†-calculus represents an object model through data and objects, while operations with them are possible through formation, application, and decoration. The calculus introduces a formal apparatus for manipulations with objects.

EO, the proposed programming language, fully implements all elements of the calculus and enables implementation of an object model on any computational platform. Being an OO programming language, EO enables four key principles of OOP: abstraction, inheritance, polymorphism, and encapsulation.

The following four principles stay behind the apparatus we introduce:

  • ā€¢

    An object is a collection of attributes, which are uniquely named bindings to objects. An object is an atom if its implementation is provided by the runtime.

  • ā€¢

    An object is abstract if at least one of its attributes is voidā€”isnā€™t attached to any object. An object is closed otherwise. Formation is the process of creating a objects. Application is the process of making a copy of existing object, specifying some or all of its void attributes with objects known as arguments. Application may lead to the creation of a closed object, or an abstract one, if not all void attributes are specified with arguments.

  • ā€¢

    An object may decorate another object by binding it to the Ļ†šœ‘\varphiitalic_Ļ† attribute of itself. A decorator has its own attributes and attached attributes of its decoratee.

  • ā€¢

    A special attribute Ī”Ī”\Deltaroman_Ī” may be attached to data, which is a computation platform dependable entity not decomposable any further. Dataization is a process of retrieving data from an object, by taking what the Ī”Ī”\Deltaroman_Ī” attribute is attached to. The dataization of an object at the highest level of composition leads to the execution of a program.

The rest of the paper is dedicated to the discussion of the syntax of the language that 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.

2. Syntax

The entire syntax of EO language in BNF is available on the first page of the objectionary/eo Github repository333https://github.com/objectionary/eo. Similar to PythonĀ (Lutz, 2013), indentation in EO is part of the syntax: the scope of a code block is determined by its horizontal position in relation to other blocks, which is also known as ā€œoff-side ruleā€Ā (Landin, 1966).

There are no keywords in EO but only a few special symbols denoting grammar constructs: > for the attributes naming, . for the dot notation, [] for the specification of parameters of formations, () for scope limitations, ! for turning objects into constants, : for naming arguments, " (double quotes) for string literals, @ for the decoratee, ā€™ (apostroph) for explicit copying, < for object identity, ^ for referring to the parent object, & for referring to the home object, and $ for referring to the current object. Attributes, which are the only identifiers that exist in EO, may have any Unicode symbols in their names, as long as they start with a small English letter and donā€™t contain spaces, line breaks, or special symbols mentioned above: test-File and iꖇ件 are valid identifiers. Identifiers are case-sentitive: car and Car are two different identifiers. Java-notation is used for numbers and strings.

2.1. Identity, State, and Behavior

According toĀ Booch etĀ al. (2007), an object in OOP has state, behavior, and identity: ā€œThe state of an object encompasses all of the properties of the object plus the current values of each of these properties. Behavior is how an object acts and reacts, in terms of its state changes and message passing. Identity is that property of an object which distinguishes it from all other objects.ā€ The syntax of EO makes a difference between these three categories.

This is a formation of a new object book, which has a single identity attribute isbn:

To make another object with a specific ISBN, the book has to be copied, with the data as an argument:

Here, b1 is a new object created. Its only attribute is accessible as b1.isbn.

A similar abstract object, but with two new state attributes, would look like:

1Ā Ā "ObjectĀ Thinking"Ā >Ā title
2Ā Ā memoryĀ 0Ā >Ā priceĀ 

The attribute title is a constant, while the price represents a mutable chunk of bytes in computing memory. They both are accessible similar to the isbn, via book2.title and book2.price. It is legal to access them in the abstract object, since they are attached to objects. However, accessing book2.isbn will lead to an error, since the attribute isbn is void in the abstract object book2.

A behavior may be added to an object with a new inner abstract object set-price:

1Ā Ā "ObjectĀ Thinking"Ā >Ā title
2Ā Ā memoryĀ 0Ā >Ā price
3Ā Ā [p]Ā >Ā set-price
4Ā Ā Ā Ā ^.price.writeĀ pĀ >Ā @Ā 

The price of the book may be changed with this one-liner:

2.2. Indentation

This is an example of an abstract object vector, where spaces are replaced with the ā€œā£ā€ symbol in order to demonstrate the importance of their presence in specific quantity (for example, there has to be exactly one space after the closing square bracket at the second line and the > symbol, while two spaces will break the syntax):

4[dxā£dy]ā£>ā£vectorā£
5ā£ā£sqrt.ā£>ā£lengthā£
6ā£ā£ā£ā£plus.
7ā£ā£ā£ā£ā£ā£dx.timesā£dx
8ā£ā£ā£ā£ā£ā£dy.timexā£dyā£ā£

The code at the line no.Ā LABEL:ln:comment is a comment. Two void attributes dx and dy are listed in square brackets at the line no.Ā 4. The name of the object goes after the > symbol. The code at the line no.Ā 5 defines an attached attribute length. Anywhere when an object has to get a name, the > symbol can be added after the object.

The declaration of the attribute length at the linesĀ 5ā€“8 can be written in one line, using dot notation:

An inverse dot notation is used in order to simplify the syntax. The identifier that goes after the dot is written first, the dot follows, and the next line contains the part that is supposed to stay before the dot. It is also possible to rewrite this expression in multiple lines without the usage of inverse notation, but it will look less readable:

8.plus
9Ā Ā dy.timexĀ dyĀ 
10.sqrtĀ >Ā lengthĀ 

Here, the line no.Ā LABEL:ln:dx-pow is the application of the object dx.times with a new argument dx. Then, the next line is the object plus taken from the object created at the first line, using the dot notation. Then, the line no.Ā 9 is the argument passed to the object plus. The code at the line no.Ā 10 takes the object sqrt from the object constructed at the previous line, and gives it the name length.

Indentation is used for two purposes: either to define attributes of an abstract object or to specify arguments for object application, also known as making a copy. A definition of an abstract object starts with a list of void attributes in square brackets on one line, followed by a list of attached attributes each in its own line. For example, this is an abstract anonymous object (it doesnā€™t have a name) with one void attribute x and two attached attributes succ and prev:

2Ā Ā x.plusĀ 1Ā >Ā succ
3Ā Ā x.minusĀ 1Ā >Ā prev

The arguments of plus and minus are provided in a horizontal mode, without the use of indentation. It is possible to rewrite this code in a vertical mode, where indentation will be required:

10Ā Ā x.plusĀ >Ā succ
11Ā Ā Ā Ā 1
12Ā Ā x.minusĀ >Ā prev
13Ā Ā Ā Ā 1Ā 

This abstract object can also be written in a horizontal mode, because it is anonymous:

2.3. EO to XML

Due to the nesting nature of EO, its program can be transformed to an XML document. The abstract object vector would produce this XML tree of elements and attributes:

13Ā Ā <oĀ name="dx"/>
14Ā Ā <oĀ name="dy"/>
15Ā Ā <oĀ name="length"Ā base=".sqrt">
16Ā Ā Ā Ā <oĀ base=".plus">
17Ā Ā Ā Ā Ā Ā <oĀ base=".times">
18Ā Ā Ā Ā Ā Ā Ā Ā <oĀ base="dx"/>
19Ā Ā Ā Ā Ā Ā Ā Ā <oĀ base="dx"/>
20Ā Ā Ā Ā Ā Ā </o>
21Ā Ā Ā Ā Ā Ā <oĀ base=".times">
22Ā Ā Ā Ā Ā Ā Ā Ā <oĀ base="dy"/>
23Ā Ā Ā Ā Ā Ā Ā Ā <oĀ base="dy"/>
24Ā Ā Ā Ā Ā Ā </o>
25Ā Ā Ā Ā </o>
26Ā Ā </o>
27</o>

Each object is represented by an <o/> XML element with a few optional attributes, such as name and base. Each attribute is either a named reference to an object (if the attribute is attached, such as length), or a name without a reference (if it is void, such as dx and dy).

2.4. Data Objects and Tuples

There are a few abstract objects which canā€™t be directly copied, such as float and int. They are created by the compiler when it meets a special syntax for data, for example:

3Ā Ā r.timesĀ 3.14Ā >Ā circumference

This syntax would be translated to XMIR (XML based data format):

27Ā Ā <oĀ name="r"/>
28Ā Ā <oĀ base=".times"Ā name="circumference">
29Ā Ā Ā Ā <oĀ base="r"/>Ā Ā 
30Ā Ā Ā Ā <oĀ base="float">
31Ā Ā Ā Ā Ā Ā <oĀ base="bytes">40-09-1E-B8-51-EB-85-1F</o>
32Ā Ā Ā Ā </o>
33Ā Ā </o>
34</o>Ā 

Each object, if it is not a formation, has a ā€œbaseā€ attribute in XML, which contains that name of a formation to be copied. The examples of some possible data objects are inĀ TableĀ 1.

Table 1. The syntax of all data with examples. The ā€œSizeā€ column denotes the number of bytes in the as-bytes attribute. UTF-8 is the encoding used in string object.
Data

Example

Size
bytes
1F-E5-77-A6
4
string
"Hello, Š“руŠ³!"
16
"\u5BB6"

or "家"

2
int
1024

, 0x1A7E, or -42

8
float
3.1415926

or 2.4e-34

8
bool
TRUE

or FALSE

1

The syntax of all data with examples. The ā€œSizeā€ column denotes the number of bytes in the as-bytes attribute. UTF-8 is the encoding used in string object.

Table 1. The syntax of all data with examples. The ā€œSizeā€ column denotes the number of bytes in the as-bytes attribute. UTF-8 is the encoding used in string object.

The tuple is yet another data, which canā€™t be copied directly. There is a special syntax for making tuples, which looks similar to object copying:

3*Ā >Ā aĀ 
4Ā Ā (*Ā "a")
5Ā Ā TRUEĀ 
6*Ā >Ā bĀ 

The code at the line no.Ā LABEL:ln:tuple-1 makes a tuple of three elements: two strings and one float. The code at the linesĀ 3ā€“5 makes a tuple named a with another tuple as its first element and TRUE as the second item. The code at the line no.Ā 6 is an empty tuple with the name b.

2.5. Scope Brackets

Brackets can be used to group object arguments in horizontal mode:

The (div 45 5) is a copy of the abstract object div with two arguments 45 and 5. This object is itself the first argument of the copy of the object sum. Its second argument is 10. Without brackets the syntax would read differently:

This expression denotes a copy of sum with four arguments.

2.6. Inner Objects

An abstract object may have other abstract objects as its attributes, for example:

34[xĀ y]Ā >Ā point
35Ā Ā [to]Ā >Ā distance
36Ā Ā Ā Ā length.Ā >Ā lenĀ 
37Ā Ā Ā Ā Ā Ā vector
38Ā Ā Ā Ā Ā Ā Ā Ā to.x.minusĀ (^.x)
39Ā Ā Ā Ā Ā Ā Ā Ā to.y.minusĀ (^.y)

The object point has two void attributes x and y and the attribute distance, which is attached to an abstract object with one void attribute to and one attached attribute len. The inner abstract object distance may only be copied with a reference to its parent object point, via a special attribute denoted by the ^ symbol:

6Ā Ā point
7Ā Ā Ā Ā 5:x
8Ā Ā Ā Ā -3:y
9Ā Ā point:to
10Ā Ā Ā Ā 13:x
11Ā Ā Ā Ā 3.9:y

The parent object is (point 5 -3), while the object (point 13 3.9) is the argument for the void attribute to of the object distance. Suffixes :x, :y, and :to are optional and may be used to denote the exact name of the void attribute to be attached to the provided argument.

2.7. Decorators

An object may extend another object by decorating it:

39Ā Ā centerĀ >Ā @Ā 
40Ā Ā [p]Ā >Ā is-inside
41Ā Ā Ā Ā lte.Ā >Ā @
42Ā Ā Ā Ā Ā Ā ^.@.distanceĀ $.pĀ 
43Ā Ā Ā Ā Ā Ā ^.radiusĀ 

The object circle has a special attribute @ at the line no.Ā 39, which denotes the decoratee: an object to be extended, also referred to as ā€œcomponentā€ byĀ Gamma etĀ al. (1994).

The decorator circle has the same attributes as its decoratee center, but also its own attribute is-inside. The attribute @ may be used the same way as other attributes, including in dot notation, as it is done at the line no.Ā 42. However, this line may be re-written in a more compact way, omitting the explicit reference to the @ attribute, because all attributes of the center are present in the circle; and omitting the reference to $ because the default scope of visibility of p is the object is-inside:

The inner object is-inside also has the @ attribute: it decorates the object lte (stands for ā€œless than equalā€). The expression at the line no.Ā 42 means: take the parent object of is-inside, take the attribute @ from it, then take the inner object distance from there, and then make a copy of it with the attribute p taken from the current object (denoted by the $ symbol).

The object circle may be used like this, to understand whether the (0,0)00(0,0)( 0 , 0 ) point is inside the circle at (āˆ’3,9)39(-3,9)( - 3 , 9 ) with the radius 40404040:

43c.is-insideĀ (pointĀ 0Ā 0)Ā >Ā i

Here, i will be a copy of bool behaving like TRUE because lte decorates bool.

It is also possible to make decoratee void, similar to other void attributes, specifying it in the list of void attributes in square brackets.

2.8. Anonymous Formations

A formation may be used as an argument of another object while making a copy of it, for example:

11Ā Ā *
12Ā Ā Ā Ā [f]
13Ā Ā Ā Ā Ā Ā f.is-dirĀ >Ā @

Here the object walk is copied with a single argument: the one-item tuple, which is a formation with a single void attribute f. The walk will use this formation, which doesnā€™t have a name, in order to filter out files while traversing the tree of directories. It will make a copy of the formation and then treat it as a boolean value in order to make a decision about each file.

The syntax may be simplified and the formation may be inlined (the tuple is also inlined):

43Ā Ā *Ā ([f]Ā (f.is-dirĀ >Ā @))

An anonymous formation may have multiple attributes:

This object has two attributes succ and prev, and doesnā€™t have a name.

The parent of each copy of the abstract object will be set by the object walk and will point to the walk object itself.

2.9. Constants

EO is a declarative language with lazy evaluations. This means that this code would read the input stream two times:

43Ā Ā stdoutĀ >Ā say
44Ā Ā Ā Ā sprintf
45Ā Ā Ā Ā Ā Ā "TheĀ lengthĀ ofĀ %sĀ isĀ %d"
46Ā Ā Ā Ā Ā Ā stdin.next-lineĀ >Ā x!
47Ā Ā Ā Ā Ā Ā x.length

The sprintf object will go to the x two times. First time, in order to use it as a substitute for %s and the second time for %d. There will be two round-trips to the standard input stream, which obviously is not correct. The exclamation mark at the x! solves the problem, making the object by the name x a constant. This means that all attributes of x are cached. Important to notice that the cache is not deep: the attributes of attributes are not cached.

Here, x is an attribute of the object hello, even though it is not defined as explicitly as say. Anywhere a new name shows up after the > symbol, it is a declaration of a new attribute in the nearest object abstraction.

2.10. Explicit Shallow Copies

There may be a need to make a copy of an object without giving any parameters to it. This may be done with an apostrophe suffix:

13pĀ 3Ā 5Ā >Ā p1

Here, two objects will be created, p and p1, where the former is an abstract one, a copy of copy, while the later is a closed one with two parameters specified. The apostrophe suffix may be used anywhere after the name of an object, for example:

47Ā Ā pointā€™Ā 3Ā aā€™

Making a copy of circle will not lead to making a copy of point, which is encapsulated by circle.

2.11. Object Identity

Each object has a special attribute <, which is an integer refering to a unique identifier of an object in the entire runtime scope of a program. All of the following expressions are true:

1342.<.eqĀ (42.<)
14point.<.eqĀ (point.<)

All of the following expressions are false:

47(2.plusĀ 2).<.eqĀ (4.<)
48(pointĀ 3Ā 5).<.eqĀ ((pointĀ 3Ā 5).<)
49(*Ā 1Ā 2).<.eqĀ ((*Ā 1Ā 2).<)

2.12. Metas and License

A program may have a comment at the beginning of the file, which is called a license. The license may be followed by an optional list of meta statements, which are passed to the compiler as is. The meaning of them depends on the compiler and may vary between target platforms. This program instructs the compiler to put all objects from the file into the package org.example and helps it resolve the name stdout, which is external to the file:

14#Ā AllĀ rightsĀ reserved.
15#Ā TheĀ licenseĀ isĀ MIT
16
17+packageĀ org.example
18+aliasĀ org.eolang.io.stdout
19
20[args]Ā >Ā app
21Ā Ā stdoutĀ >Ā @
22Ā Ā Ā Ā "Hello,Ā world!\n"

2.13. Atoms

Some objects in EO programs may need to be platform specific and canā€™t be composed from other existing objectsā€”they are called atoms. For example, the object app uses the object stdout, which is an atom. Its implementation would be provided by the runtime. This is how the object may be defined:

49+rtĀ rubyĀ eolang:0.1.0
50
51[text]Ā >Ā stdoutĀ /boolĀ 

The /bool suffix informs the compiler that this object must not be compiled from EO to the target language. The object with this suffix already exists in the target language and most probably could be found in the library specified by the rt meta. The exact library to import has to be selected by the compiler. In the example above, there are two libraries specified: for JVM and for Ruby.

The bool part after the / is the name of object, which stdout decorates. The name may be replaced by a question mark, if uncertain about the object being decorated.

Atoms in EO are similar to ā€œnativeā€ methods in Java and ā€œexternā€ methods in C#: this mechanism is also known as foreign function interface (FFI).

2.14. Home Object

An instance of an abstact object may need to have access to the object where the abstract was defined, for example this is how object tuple.map is implemented in Objectionary:

22Ā Ā [f]Ā >Ā mapiĀ /listĀ 
23Ā Ā [f]Ā >Ā map
24Ā Ā Ā Ā ^.mapiĀ >Ā @
25Ā Ā Ā Ā Ā Ā [xĀ i]Ā 
26Ā Ā Ā Ā Ā Ā Ā Ā &.fĀ xĀ >Ā @

The object mapi at the line no.Ā 22 is an atom: it iterates through list of items and makes a copy of the provided two-arguments abstract object f applying the next item to it and the index in the tuple (that is why the name with the ā€œiā€ suffix).

The object map does exactly the same, but doesnā€™t provide the index of each element to the inner abstract object. The anonymous inner abstract object at the line no.Ā 25 has to get access to the attribute f of map. However, ^.f wonā€™t work, because the parent of it is a copy of mapi, and the parent of mapi is the object list. Thus, there is no way to get access to map.f using parent attributes.

The home attribute & helps here. Once an abstract object at the line no.Ā 25 is created, its home attribute is set to the abstract object list at the line no.Ā LABEL:ln:list-parent. Its parent attribute ^ is also set to the object list, but is later changed by the atom mapi when a copy of it is being made. However, the home attribute remains the same.

3. Calculus

The proposed Ļ†šœ‘\varphiitalic_Ļ†-calculus is based on set theoryĀ (Jech, 2013) and lambda calculus, representing objects as sets of pairs and their internals as Ī»šœ†\lambdaitalic_Ī»-terms. The rest of the section contains formal definitions of data, objects, attributes, formation, application, decoration, and dataization.

3.1. Objects and Data

Definition 3.1 ().

An object is a set of ordered pairs (ai,vi)subscriptš‘Žš‘–subscriptš‘£š‘–(a_{i},v_{i})( italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) such that aisubscriptš‘Žš‘–a_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is an identifier, all aisubscriptš‘Žš‘–a_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT are different, and visubscriptš‘£š‘–v_{i}italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is an object.

An identifier is either Ļ†šœ‘\varphiitalic_Ļ†, ĻšœŒ\rhoitalic_Ļ, ĻƒšœŽ\sigmaitalic_Ļƒ, Ī½šœˆ\nuitalic_Ī½, or, by convention, a text without spaces starting with a small-case English letter in typewriter font.

The object at the line no.Ā LABEL:ln:book may be represented as

(1) šš‹šš˜šš˜šš”={(šš’ššœšš‹šš—,āˆ…)},šš‹šš˜šš˜šš”matrixšš’ššœšš‹šš—\begin{split}\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{% book}&=\left\{\begin{matrix}[l](\vrule height=6.00006pt,depth=1.00006pt,width=% 0.0pt\textnormal{isbn},\varnothing)\\ \end{matrix}\right\},\end{split}start_ROW start_CELL book end_CELL start_CELL = { start_ARG start_ROW start_CELL ( isbn , āˆ… ) end_CELL end_ROW end_ARG } , end_CELL end_ROW

where isbn is an identifier and āˆ…\varnothingāˆ… is an empty set, which is a proper object, according toĀ DefinitionĀ 3.1.

Definition 3.2 ().

An object may have properties of data, which is a computation platform dependable entity and is not decomposable any further within the scope of Ļ†šœ‘\varphiitalic_Ļ†-calculus.

What exactly is data may depend on the implementation platform, but most certainly would include byte arrays, integers, floating-point numbers, string literals, and boolean values.

The object at the linesĀ LABEL:ln:book2ā€“2 may be represented as

(2) šš‹šš˜šš˜šš”šŸø={(šš’ššœšš‹šš—,āˆ…)(šššš’šššš•ššŽ,"Object Thinking")(šš™šš›šš’ššŒššŽ,šš–ššŽšš–šš˜šš›šš¢)},šš‹šš˜šš˜šš”šŸømatrixšš’ššœšš‹šš—šššš’šššš•ššŽ"Object Thinking"šš™šš›šš’ššŒššŽšš–ššŽšš–šš˜šš›šš¢\begin{split}\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{% book2}&=\left\{\begin{matrix}[l](\vrule height=6.00006pt,depth=1.00006pt,width% =0.0pt\textnormal{isbn},\varnothing)\\ (\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{title},\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{"Object Thinking"})\\ (\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{price},\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{memory})\\ \end{matrix}\right\},\\ \end{split}start_ROW start_CELL book2 end_CELL start_CELL = { start_ARG start_ROW start_CELL ( isbn , āˆ… ) end_CELL end_ROW start_ROW start_CELL ( title , "Object Thinking" ) end_CELL end_ROW start_ROW start_CELL ( price , memory ) end_CELL end_ROW end_ARG } , end_CELL end_ROW

where isbn, title, and price are identifiers, memory is an object defined somewhere else, and the text in double quotes is data.

3.2. Attributes

Definition 3.3 ().

In an object xš‘„xitalic_x, aš‘Žaitalic_a is a void attribute with the name aš‘Žaitalic_a iff (a,āˆ…)āˆˆxš‘Žš‘„(a,\varnothing)\in x( italic_a , āˆ… ) āˆˆ italic_x; it is an attached attribute with the value vš‘£vitalic_v iff āˆƒ(a,v)āˆˆxš‘Žš‘£š‘„\exists(a,v)\in xāˆƒ ( italic_a , italic_v ) āˆˆ italic_x and vā‰ āˆ…š‘£v\not=\varnothingitalic_v ā‰  āˆ…;

In Eq.Ā 2, identifiers isbn, title, and price are the attributes of the object book2. The attribute isbn is void, while the other two are attached.

Definition 3.4 ().

If xš‘„xitalic_x is an object and āˆƒ(a,v)āˆˆxš‘Žš‘£š‘„\exists(a,v)\in xāˆƒ ( italic_a , italic_v ) āˆˆ italic_x, then vš‘£vitalic_v may be referenced as x.aformulae-sequenceš‘„š‘Žx.aitalic_x . italic_a; this referencing mechanism is called dot notation.

Both void and attached attributes of an object are accessible using the dot notation. There is no such thing as visibility restriction in Ļ†šœ‘\varphiitalic_Ļ†-calculus: all attributes are visible to all objects outside of the one they belong to.

It is possible to chain attribute references using dot notation, for example šš‹šš˜šš˜šš”šŸø.šš™šš›šš’ššŒššŽ.šš—ššŽššformulae-sequencešš‹šš˜šš˜šš”šŸøšš™šš›šš’ššŒššŽšš—ššŽšš\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{book2}.\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{price}.\vrule height=6.% 00006pt,depth=1.00006pt,width=0.0pt\textnormal{neg}typewriter_book2 . typewriter_price . typewriter_neg is a valid expression, which means ā€œtaking the attribute price from the object book2 and then taking the attribute neg from it.ā€

Definition 3.5 ().

If xā¢(ai,vi)š‘„subscriptš‘Žš‘–subscriptš‘£š‘–x(a_{i},v_{i})italic_x ( italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) is an object, then x^^š‘„\hat{x}over^ start_ARG italic_x end_ARG, a set consisting of all aisubscriptš‘Žš‘–a_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, is its scope and the cardinality of |x^|^š‘„|\hat{x}|| over^ start_ARG italic_x end_ARG | is the arity of xš‘„xitalic_x.

For example, the scope of the object atĀ Eq.Ā 2 consists of three identifiers: isbn, title, and price.

3.3. Formation

Definition 3.6 ().

An object xš‘„xitalic_x is abstract iff at least one of its attributes is void, i.e. āˆƒ(a,āˆ…)āˆˆxš‘Žš‘„\exists(a,\varnothing)\in xāˆƒ ( italic_a , āˆ… ) āˆˆ italic_x.

An alternative ā€œarrow notationā€ may be used to denote an object xš‘„xitalic_x in a more compact way, where void attributes stay in the parentheses on the left side of the mapping symbol ā†¦maps-to\mapstoā†¦ and pairs, which represent attached attributes, stay on the right side, in double-square brackets. EquationĀ 2 may be written as

(3) šš‹šš˜šš˜šš”šŸø(šš’ššœšš‹šš—)ā†¦āŸ¦šššš’šššš•ššŽā†¦"Object Thinking",šš™šš›šš’ššŒššŽā†¦šš–ššŽšš–šš˜šš›šš¢āŸ§.\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{% book2}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{isbn})% \mapsto\llbracket\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{title}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{"Object % Thinking"},\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{price}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{memory}% \\[-4.0pt] &\rrbracket.\\ \end{split}start_ROW start_CELL end_CELL start_CELL book2 ( isbn ) ā†¦ āŸ¦ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL title ā†¦ "Object Thinking" , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL price ā†¦ memory end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL āŸ§ . end_CELL end_ROW

3.4. Application

Definition 3.7 ().

If xš‘„xitalic_x is an abstract object and yš‘¦yitalic_y is an object where y^āŠ†x^^š‘¦^š‘„\hat{y}\subseteq\hat{x}over^ start_ARG italic_y end_ARG āŠ† over^ start_ARG italic_x end_ARG, then an application of yš‘¦yitalic_y to xš‘„xitalic_x is a copy of xš‘„xitalic_x, a new object that consists of pairs (aāˆˆx^,v)š‘Ž^š‘„š‘£(a\in\hat{x},v)( italic_a āˆˆ over^ start_ARG italic_x end_ARG , italic_v ) such that v=y.aformulae-sequenceš‘£š‘¦š‘Žv=y.aitalic_v = italic_y . italic_a if x.a=āˆ…formulae-sequenceš‘„š‘Žx.a=\varnothingitalic_x . italic_a = āˆ… and v=x.aformulae-sequenceš‘£š‘„š‘Žv=x.aitalic_v = italic_x . italic_a otherwise.

Application makes some void attributes of xš‘„xitalic_x attachedā€”by binding objects to them. The produced object has exactly the same set of attributes, but some of them, which were void before, become attached.

It is not expected that all void attributes turn into attached ones during application. Some of them may remain void, which will lead to creating a new abstract object. To the contrary, if all void attributes are substituted with arguments during copying, a newly created object will be closed.

Once set, attached attributes may not be reset. This may be interpreted as immutability property of objects.

Arrow notation may also be used to denote object copying, where the names of the attributes, which remain void, stay in the brackets on the left side of the mapping symbol ā†¦maps-to\mapstoā†¦, while objects Pš‘ƒPitalic_P provided as arguments stay on the right side, in the brackets. For example, the object at the line no.Ā LABEL:ln:point-copy may be written as

(4) šš™šš˜šš’šš—šš(šš”ā†¦šŸ»,šš¢ā†¦-3).šššš’ššœššššŠšš—ššŒššŽ(šššš˜ā†¦šš™šš˜šš’šš—ššā¢(šš”ā†¦šŸ·šŸ¹,šš¢ā†¦3.9)),formulae-sequencešš™šš˜šš’šš—ššformulae-sequencemaps-tošš”šŸ»maps-tošš¢-3šššš’ššœššššŠšš—ššŒššŽmaps-tošššš˜šš™šš˜šš’šš—ššformulae-sequencemaps-tošš”šŸ·šŸ¹maps-tošš¢3.9\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{% point}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{x}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{5},% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{y}\mapsto\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{-3}).\vrule height=6.00% 006pt,depth=1.00006pt,width=0.0pt\textnormal{distance}(\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{to}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{x}\mapsto\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{13},\vrule height=6.000% 06pt,depth=1.00006pt,width=0.0pt\textnormal{y}\mapsto\vrule height=6.00006pt,d% epth=1.00006pt,width=0.0pt\textnormal{3.9})\\[-4.0pt] &),\end{split}start_ROW start_CELL end_CELL start_CELL point ( x ā†¦ 5 , y ā†¦ -3 ) . distance ( end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL to ā†¦ point ( x ā†¦ 13 , y ā†¦ 3.9 ) end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL ) , end_CELL end_ROW

and may further be simplified since the order of parameters is obvious:

(5) šš™šš˜šš’šš—ššā¢(šŸ»,-3).šššš’ššœššššŠšš—ššŒššŽā¢(šš™šš˜šš’šš—ššā¢(šŸ·šŸ¹,3.9)).formulae-sequencešš™šš˜šš’šš—šššŸ»-3šššš’ššœššššŠšš—ššŒššŽšš™šš˜šš’šš—šššŸ·šŸ¹3.9\begin{split}\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{% point}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{5},% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{-3}).\vrule hei% ght=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{distance}(\vrule height=6% .00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(\vrule height=6.00006pt% ,depth=1.00006pt,width=0.0pt\textnormal{13},\vrule height=6.00006pt,depth=1.00% 006pt,width=0.0pt\textnormal{3.9})).\end{split}start_ROW start_CELL point ( 5 , -3 ) . distance ( point ( 13 , 3.9 ) ) . end_CELL end_ROW

An application without arguments is a copy of an object. For example, in these expressions the attribute p1 is attached to the same object as the attribute p, while the attribute p2 is attached to a new object, a copy of p:

šš™ā†¦šš™šš˜šš’šš—ššā¢(šŸ»,-3),šš™šŸ·ā†¦šš™,šš™šŸøā†¦šš™ā¢().formulae-sequencemaps-tošš™šš™šš˜šš’šš—šššŸ»-3formulae-sequencemaps-tošš™šŸ·šš™maps-tošš™šŸøšš™\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p% }\mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{5},\vrule heigh% t=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{-3}),\\ &\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p1}\mapsto% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p},\\ &\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p2}\mapsto% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p}().\\ \end{split}start_ROW start_CELL end_CELL start_CELL p ā†¦ point ( 5 , -3 ) , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL p1 ā†¦ p , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL p2 ā†¦ p ( ) . end_CELL end_ROW

3.5. Formation

Definition 3.8 ().

The process of creating an object that is not a copy of another object is called formation.

Syntactically, object formation is denoted by double square brackets, as in Eq.Ā 3, to the contrary of object application, which is denoted by round brackets, as in Eq.Ā 4. Object abstraction is a special case of object formation. The following expression is a formation of the object xš‘„xitalic_x:

xā†¦[[yāˆ’>t]].maps-toš‘„delimited-[]delimited-[]limit-fromš‘¦š‘”x\mapsto[[y->t]].italic_x ā†¦ [ [ italic_y - > italic_t ] ] .

3.6. Parent and Home

Definition 3.9 ().

If xš‘„xitalic_x is an object, then x.Ļformulae-sequenceš‘„šœŒx.\rhoitalic_x . italic_Ļ is its parent, which is the object that created xš‘„xitalic_x.

An object may be created either by abstraction or application. In case of abstraction, an object is created by another abstract object, for example:

(6) xā†¦āŸ¦yā†¦āŸ¦zā†¦tāŸ§āŸ§x.y.Ļ=xx.y.z.Ļ=y.\begin{split}&x\mapsto\llbracket y\mapsto\llbracket z\mapsto t\rrbracket% \rrbracket\\[-4.0pt] &x.y.\rho=x\\[-4.0pt] &x.y.z.\rho=y.\end{split}start_ROW start_CELL end_CELL start_CELL italic_x ā†¦ āŸ¦ italic_y ā†¦ āŸ¦ italic_z ā†¦ italic_t āŸ§ āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_x . italic_y . italic_Ļ = italic_x end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_x . italic_y . italic_z . italic_Ļ = italic_y . end_CELL end_ROW

In case of application, an object is created by the prepending object:

(7) aā†¦āŸ¦bā†¦c,dā†¦e.f,gā†¦h.i(j)āŸ§a.b.Ļ=aa.d.Ļ=ea.g.Ļ=h.\begin{split}&a\mapsto\llbracket b\mapsto c,d\mapsto e.f,g\mapsto h.i(j)% \rrbracket\\[-4.0pt] &a.b.\rho=a\\[-4.0pt] &a.d.\rho=e\\[-4.0pt] &a.g.\rho=h.\end{split}start_ROW start_CELL end_CELL start_CELL italic_a ā†¦ āŸ¦ italic_b ā†¦ italic_c , italic_d ā†¦ italic_e . italic_f , italic_g ā†¦ italic_h . italic_i ( italic_j ) āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_a . italic_b . italic_Ļ = italic_a end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_a . italic_d . italic_Ļ = italic_e end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_a . italic_g . italic_Ļ = italic_h . end_CELL end_ROW
Definition 3.10 ().

If xš‘„xitalic_x is an object, then x.Ļƒformulae-sequenceš‘„šœŽx.\sigmaitalic_x . italic_Ļƒ is its home object, which is the ĻšœŒ\rhoitalic_Ļ of the abstract object xš‘„xitalic_x is a copy of.

For example:

(8) xā†¦āŸ¦y(f)ā†¦āŸ¦āŸ§āŸ§x.y.Ļ=xzā†¦āŸ¦tā†¦x.y(42)āŸ§z.t.Ļ=zz.t.Ļƒ=x.\begin{split}&x\mapsto\llbracket y(f)\mapsto\llbracket\rrbracket\rrbracket\\[-% 4.0pt] &x.y.\rho=x\\[-4.0pt] &z\mapsto\llbracket t\mapsto x.y(42)\rrbracket\\[-4.0pt] &z.t.\rho=z\\[-4.0pt] &z.t.\sigma=x.\end{split}start_ROW start_CELL end_CELL start_CELL italic_x ā†¦ āŸ¦ italic_y ( italic_f ) ā†¦ āŸ¦ āŸ§ āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_x . italic_y . italic_Ļ = italic_x end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_z ā†¦ āŸ¦ italic_t ā†¦ italic_x . italic_y ( 42 ) āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_z . italic_t . italic_Ļ = italic_z end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_z . italic_t . italic_Ļƒ = italic_x . end_CELL end_ROW

3.7. Decoration

Definition 3.11 ().

If xš‘„xitalic_x and yš‘¦yitalic_y are objects and x.Ļ†=yformulae-sequenceš‘„šœ‘š‘¦x.\varphi=yitalic_x . italic_Ļ† = italic_y, then āˆ€a(x.a=y.a)\forall a(x.a=y.a)āˆ€ italic_a ( italic_x . italic_a = italic_y . italic_a ) if aāˆ‰x^š‘Ž^š‘„a\not\in\hat{x}italic_a āˆ‰ over^ start_ARG italic_x end_ARG; this means that xš‘„xitalic_x is decorating yš‘¦yitalic_y.

Here, Ļ†šœ‘\varphiitalic_Ļ† is a special identifier denoting the object, known as a decoratee, being decorated within the scope of the decorator.

For example, the object at the linesĀ LABEL:ln:circleā€“43 would be denoted by this formula:

(9) ššŒšš’šš›ššŒšš•ššŽ(ššŒššŽšš—ššššŽšš›,šš›ššŠšššš’ššžššœ)ā†¦āŸ¦Ļ†ā†¦ššŒššŽšš—ššššŽšš›,is-inside(šš™)ā†¦āŸ¦Ļ†ā†¦Ļ.Ļ†.šššš’ššœššššŠšš—ššŒššŽā¢(šš™).šš•ššššŽā¢(šš›ššŠšššš’ššžššœ)āŸ§āŸ§,\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{% circle}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{center}% ,\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{radius})% \mapsto\llbracket\\[-4.0pt] &\quad\varphi\mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt% \textnormal{center},\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{is-inside% }(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p})\mapsto% \llbracket\\[-4.0pt] &\quad\quad\varphi\mapsto\rho.\varphi.\vrule height=6.00006pt,depth=1.00006pt,% width=0.0pt\textnormal{distance}(\vrule height=6.00006pt,depth=1.00006pt,width% =0.0pt\textnormal{p}).\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt% \textnormal{lte}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt% \textnormal{radius})\\[-4.0pt] &\quad\rrbracket\\[-4.0pt] &\rrbracket,\end{split}start_ROW start_CELL end_CELL start_CELL circle ( center , radius ) ā†¦ āŸ¦ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_Ļ† ā†¦ center , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL is-inside ( p ) ā†¦ āŸ¦ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_Ļ† ā†¦ italic_Ļ . italic_Ļ† . distance ( p ) . lte ( radius ) end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL āŸ§ , end_CELL end_ROW

while the application of it would look like:

(10) ššŒā†¦ššŒšš’šš›ššŒšš•ššŽā¢(šš™šš˜šš’šš—ššā¢(-3,šŸæ),šŸŗšŸ¶),maps-toššŒššŒšš’šš›ššŒšš•ššŽšš™šš˜šš’šš—šš-3šŸæšŸŗšŸ¶\begin{split}\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{c}% &\mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{circle}% (\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{-3},\vrule height=6.000% 06pt,depth=1.00006pt,width=0.0pt\textnormal{9}),\vrule height=6.00006pt,depth=% 1.00006pt,width=0.0pt\textnormal{40}),\end{split}start_ROW start_CELL c end_CELL start_CELL ā†¦ circle ( point ( -3 , 9 ) , 40 ) , end_CELL end_ROW

producing:

(11) ššŒā†¦āŸ¦ššŒššŽšš—ššššŽšš›ā†¦šš™šš˜šš’šš—ššā¢(-3,šŸæ),šš›ššŠšššš’ššžššœā†¦šŸŗšŸ¶,Ļ†ā†¦ššŒššŽšš—ššššŽšš›,is-inside(šš™)ā†¦āŸ¦Ļ†ā†¦Ļ.šššš’ššœššššŠšš—ššŒššŽā¢(šš™).šš•ššššŽā¢(šš›ššŠšššš’ššžššœ)āŸ§āŸ§.\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{c% }\mapsto\llbracket\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{center}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{-3},\vrule heig% ht=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{9}),\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{radius}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{40},\\[-% 4.0pt] &\quad\varphi\mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt% \textnormal{center},\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{is-inside% }(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p})\mapsto% \llbracket\\[-4.0pt] &\quad\quad\varphi\mapsto\rho.\vrule height=6.00006pt,depth=1.00006pt,width=0.% 0pt\textnormal{distance}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt% \textnormal{p}).\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal% {lte}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{radius})% \\[-4.0pt] &\quad\rrbracket\\[-4.0pt] &\rrbracket.\end{split}start_ROW start_CELL end_CELL start_CELL c ā†¦ āŸ¦ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL center ā†¦ point ( -3 , 9 ) , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL radius ā†¦ 40 , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_Ļ† ā†¦ center , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL is-inside ( p ) ā†¦ āŸ¦ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_Ļ† ā†¦ italic_Ļ . distance ( p ) . lte ( radius ) end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL āŸ§ . end_CELL end_ROW

Because of decoration, the expression Ļ.Ļ†.šššš’ššœššššŠšš—ššŒššŽformulae-sequencešœŒšœ‘šššš’ššœššššŠšš—ššŒššŽ\rho.\varphi.\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{distance}italic_Ļ . italic_Ļ† . typewriter_distance in Eq.Ā 9 is semantically equivalent to a shorter expression Ļ.šššš’ššœššššŠšš—ššŒššŽformulae-sequencešœŒšššš’ššœššššŠšš—ššŒššŽ\rho.\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{distance}italic_Ļ . typewriter_distance in Eq.Ā 11.

The following expression makes a new object is, which represents a sequence of object applications ending with a copy of lte:

(12) šš’ššœā†¦ššŒ.is-insideā¢(šš™šš˜šš’šš—ššā¢(šŸ·,šŸ½)),formulae-sequencemaps-tošš’ššœššŒis-insidešš™šš˜šš’šš—šššŸ·šŸ½\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{% is}\mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{c}.% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{is-inside}(% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{1},\vrule height=6.0000% 6pt,depth=1.00006pt,width=0.0pt\textnormal{7})),\end{split}start_ROW start_CELL end_CELL start_CELL is ā†¦ c . is-inside ( point ( 1 , 7 ) ) , end_CELL end_ROW

producing:

(13) ššŒā†¦āŸ¦ššŒššŽšš—ššššŽšš›ā†¦šš™šš˜šš’šš—ššā¢(-3,šŸæ),šš›ššŠšššš’ššžššœā†¦šŸŗšŸ¶,Ļ†ā†¦ššŒššŽšš—ššššŽšš›,is-insideā†¦āŸ¦šš™ā†¦šš™šš˜šš’šš—ššā¢(šŸ·,šŸ½),Ļ†ā†¦Ļ.šššš’ššœššššŠšš—ššŒššŽā¢(šš™).šš•ššššŽā¢(šš›ššŠšššš’ššžššœ)āŸ§āŸ§.\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{c% }\mapsto\llbracket\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{center}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{-3},\vrule heig% ht=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{9}),\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{radius}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{40},\\[-% 4.0pt] &\quad\varphi\mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt% \textnormal{center},\\[-4.0pt] &\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{is-inside% }\mapsto\llbracket\\[-4.0pt] &\quad\quad\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{p}% \mapsto\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{point}(% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{1},\vrule heigh% t=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{7}),\\[-4.0pt] &\quad\quad\varphi\mapsto\rho.\vrule height=6.00006pt,depth=1.00006pt,width=0.% 0pt\textnormal{distance}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt% \textnormal{p}).\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal% {lte}(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{radius})% \\[-4.0pt] &\quad\rrbracket\\[-4.0pt] &\rrbracket.\end{split}start_ROW start_CELL end_CELL start_CELL c ā†¦ āŸ¦ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL center ā†¦ point ( -3 , 9 ) , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL radius ā†¦ 40 , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_Ļ† ā†¦ center , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL is-inside ā†¦ āŸ¦ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL p ā†¦ point ( 1 , 7 ) , end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL italic_Ļ† ā†¦ italic_Ļ . distance ( p ) . lte ( radius ) end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL āŸ§ . end_CELL end_ROW

It is important to notice that attributes of a decoratee donā€™t belong to the scope of its decorator.

3.8. Atoms

Definition 3.12 ().

If Ī»ā¢s.Mformulae-sequencešœ†š‘ š‘€\lambda s.Mitalic_Ī» italic_s . italic_M is a function of one argument sš‘ sitalic_s returning an object, then it is an abstract object called an atom, Mš‘€Mitalic_M is its Ī»šœ†\lambdaitalic_Ī»-term, and sš‘ sitalic_s is its void attribute.

Atoms may have their Ī»šœ†\lambdaitalic_Ī»-terms defined outside of Ļ†šœ‘\varphiitalic_Ļ†-calculus formal scope. For example, the object at the line no.Ā 51 would be denoted as

(14) ššœšššššš˜ššžššā¢(ššššŽšš”šš)ā†¦Ī»ā¢s.Mššœšššššš˜ššžšš,formulae-sequencemaps-toššœšššššš˜ššžššššššŽšš”šššœ†š‘ subscriptš‘€ššœšššššš˜ššžšš\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{stdout}(\vrule h% eight=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{text})\mapsto\lambda s.% M_{\texttt{stdout}},typewriter_stdout ( typewriter_text ) ā†¦ italic_Ī» italic_s . italic_M start_POSTSUBSCRIPT stdout end_POSTSUBSCRIPT ,

where Mššœšššššš˜ššžššsubscriptš‘€ššœšššššš˜ššžššM_{\texttt{stdout}}italic_M start_POSTSUBSCRIPT stdout end_POSTSUBSCRIPT is a Ī»šœ†\lambdaitalic_Ī»-term defined externally.

In atoms, Ī»šœ†\lambdaitalic_Ī»-terms are attached to Ī»šœ†\lambdaitalic_Ī» attribute. Thus, a more formal form of the Eq.Ā 14 is:

ššœšššššš˜ššžššā†¦āŸ¦ššššŽšš”ššā†¦āˆ…,Ī»ā†¦MstdoutāŸ§.\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{stdout}\mapsto% \llbracket\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{text}% \mapsto\varnothing,\lambda\mapsto M_{\text{stdout}}\rrbracket.typewriter_stdout ā†¦ āŸ¦ typewriter_text ā†¦ āˆ… , italic_Ī» ā†¦ italic_M start_POSTSUBSCRIPT stdout end_POSTSUBSCRIPT āŸ§ .

3.9. Constant

Definition 3.13 ().

If xā†¦āŸ¦yā†¦-ā†¦zāŸ§x\mapsto\llbracket y\mapstochar\relbar\mathrel{\mkern-8.0mu}\mapsto z\rrbracketitalic_x ā†¦ āŸ¦ italic_y ā†¦ - ā†¦ italic_z āŸ§ is an object then yš‘¦yitalic_y is a constant attribute, meaning that the result of dataization of x.yformulae-sequenceš‘„š‘¦x.yitalic_x . italic_y always equals to itself.

3.10. Identity

Definition 3.14 ().

If xš‘„xitalic_x is an object then x.Ī½formulae-sequenceš‘„šœˆx.\nuitalic_x . italic_Ī½ is a positive integer data object with a unique identity of xš‘„xitalic_x in the entire runtime scope.

For example, without any other objects in scope it is safe to assume the following, however there is no guarantee that the actual numbers will be the same in all implementations:

(15) šš”(šš¢)ā†¦āŸ¦āŸ§šš£ā†¦šš”ā¢(šš¢ā†¦šŸŗšŸø)Ī¦.Ī½=0,šš”.Ī½=1,šŸŗšŸø.Ī½=2,šš£.Ī½=3.\begin{split}&\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{x% }(\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{y})\mapsto% \llbracket\rrbracket\\[-4.0pt] &\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{z}\mapsto% \vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{x}(\vrule heigh% t=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{y}\mapsto\vrule height=6.00% 006pt,depth=1.00006pt,width=0.0pt\textnormal{42})\\[-4.0pt] &\Phi.\nu=0,\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{x}.% \nu=1,\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{42}.\nu=2% ,\vrule height=6.00006pt,depth=1.00006pt,width=0.0pt\textnormal{z}.\nu=3.\end{split}start_ROW start_CELL end_CELL start_CELL x ( y ) ā†¦ āŸ¦ āŸ§ end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL z ā†¦ x ( y ā†¦ 42 ) end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL roman_Ī¦ . italic_Ī½ = 0 , x . italic_Ī½ = 1 , 42 . italic_Ī½ = 2 , z . italic_Ī½ = 3 . end_CELL end_ROW

4. Key Features

There are a few features that distinguish EO and Ļ†šœ‘\varphiitalic_Ļ†-calculus from other existing OO languages and object theories, while some of them are similar to what other languages have to offer. The Section is not intended to present the features formally, which was done earlier in SectionsĀ 3 andĀ 2, but to compare EO with other programming languages and informally identify similarities.

No Classes.ā€„ EO is similar to other delegation-based languages like SelfĀ (Ungar etĀ al., 1987), where objects are not created by a class as in class-based languages like C++ or Java, but from another object, inheriting properties from the original. However, while in such languages, according toĀ Fisher and Mitchell (1995), ā€œan object may be created, and then have new methods added or existing methods redefined,ā€ in EO such object alteration is not allowed.

No Types.ā€„ Even though there are no types in EO, compatibility between objects may be inferred in compile-time and validated strictly, which other typeless languages such as Python, JuliaĀ (Bezanson etĀ al., 2012), LuaĀ (Ierusalimschy, 2016), or ErlangĀ (erl, 2020) canā€™t guarantee. Also, there is no type casting or reflection on types in EO.

No Inheritance.ā€„ It is impossible to inherit attributes from another object in EO. The only two possible ways to re-use functionality are either via object composition or decorators. There are OO languages without implementation inheritance, for example GoĀ (Donovan and Kernighan, 2015), but only KotlinĀ (Jemerov and Isakova, 2017) has decorators as a language feature. In all other languages, the Decorator patternĀ (Gamma etĀ al., 1994) has to be implemented manuallyĀ (Bettini etĀ al., 2011).

No Methods.ā€„ An object in EO is a composition of other objects and atoms: there are no methods or functions similar to Java or C++ ones. Execution control is given to a program when atomsā€™ attributes are referred to. Atoms are implemented by EO runtime similar to Java native objects. To our knowledge, there are no other OO languages without methods.

No Constructors.ā€„ Unlike Java or C++, EO doesnā€™t allow programmers to alter the process of object construction or suggest alternative paths of object instantiation via additional constructions. Instead, all arguments are attached to attributes ā€œas isā€ and canā€™t be modified.

No Static Entities.ā€„ Unlike Java and C#, EO objects may consist only of other objects, represented by attributes, while class methods, also known as static methods, as well as static literals, and static blocksā€”donā€™t exist in EO. Considering modern programming languages, Go has no static methods either, but only objects and ā€œstructsā€Ā (Schmager etĀ al., 2010).

No Primitive Data Types.ā€„ There are no primitive data types in EO, which exist in Java and C++, for example. As in Ruby, SmalltalkĀ (Goldberg and Robson, 1983), Squeak, Self, and Pharo, integers, floating point numbers, boolean values, and strings are objects in EO: ā€œeverything is an objectā€ is the key design principle, which, according toĀ West (2004, p.66), is an ā€œobviously necessary prerequisite to object thinking.ā€

No Operators.ā€„ There are no operators like + or / in EO. Instead, numeric objects have built-in atoms that represent math operations. The same is true for all other manipulations with objects: they are provided only by their encapsulated objects, not by external language constructs, as in Java or C#. Here EO is similar to Ruby, Smalltalk and Eiffel, where operators are syntax sugar, while implementation is encapsulated in the objects.

No NULL References.ā€„ Unlike C++ and Java, there is no concept of NULL in EO, which was called a ā€œbillion dollar mistakeā€ byĀ Hoare (2009) and is one of the key threats for design consistencyĀ (Bugayenko, 2016). Haskell, Rust, OCaml, Standard ML, and Swift also donā€™t have NULL references.

No Empty Objects.ā€„ Unlike Java, C++ and all other OO languages, empty objects with no attributes are forbidden in EO in order to guarantee the presence of object composition and enable separation of concernsĀ (Dijkstra, 1982): larger objects must always encapsulate smaller ones.

No Private Attributes.ā€„ Similar to PythonĀ (Lutz, 2013) and SmalltalkĀ (Hunt, 1997), EO makes all object attributes publicly visible. There are no protected ones, because there is no implementation inheritance, which is considered harmfulĀ (Hunt, 2000). There are no private attributes either, because information hiding can anyway easily be violated via getters, and usually is, making the code longer and less readable, as explained byĀ Holub (2004).

No Global Scope.ā€„ All objects in EO are attached to some attributes. Objects constructed in the global scope of visibility are attached to attributes of the Ī¦Ī¦\Phiroman_Ī¦ object of the highest level of abstraction. Newspeak and Eiffel are two programming languages that does not have global scope as well.

No Mutability.ā€„ Similar to ErlangĀ (Armstrong, 2010), there are only immutable objects in EO, meaning that their attributes may not be changed after the object is constructed or copied. Java, C#, and C++, have modifiers like final, readonly, or const to make attributes immutable, which donā€™t mean constants though. While the latter will always expose the same functionality, the former may represent mutable entities, being known as read-only referencesĀ (Birka and Ernst, 2004). For example, an attribute r may have an object random.pseudo attached to it, which is a random number generator. EO wonā€™t allow assigning another object to the attribute r. However, every time the attribute is dataized, its value will be different. There are number of OOP languages that also prioritize immutability of objects. In RustĀ (Matsakis and Klock, 2014), for example, all variables are immutable by default, but can be made mutable via the mut modifier. Similarly, DĀ (Bright etĀ al., 2020) has qualifier immutable, which expresses transitive immutability of data.

No Exceptions.ā€„ In most OO languages exception handlingĀ (Goodenough, 1975): happens through an imperative error-throwing statement. Instead, EO has a declarative mechanism for it, which is similar to Null Object design patternĀ (Martin etĀ al., 1997): returning an abstract object causes program execution to stop once the returned object is dealt with.

No Functions.ā€„ There are no lambda objects or functions in EO, which exist in JavaĀ 8+, for example. However, objects in EO have ā€œbodies,ā€ which make it possible to interpret objects as functions. Strictly speaking, if objects in EO would only have bodies and no other attributes, they would be functions. It is legit to say that EO extends lambda calculus, but in a different way comparing to previous attempts made byĀ Mitchell etĀ al. (1993) and DiĀ Gianantonio etĀ al. (1998): methods and attributes in EO are not new concepts, but lower-level objects.

No mixins.ā€„ There are no ā€œtraitsā€ or ā€œmixinsā€ inĀ EO, which exist in Ruby and PHP to enable code reuse from other objects without inheritance and composition.

5. Four Principles of OOP

In order to answer the question, whether the proposed object calculus is sufficient to express any object model, in this Section we demonstrate how four fundamental principles of OOP are realized by Ļ†šœ‘\varphiitalic_Ļ†-calculus: encapsulation, abstraction, inheritance, and polymorphism.

5.1. Abstraction

Abstraction, which is called ā€œmodularityā€ byĀ Booch etĀ al. (2007), is, according toĀ West (2004, p.203), ā€œthe act of separating characteristics into the relevant and irrelevant to facilitate focusing on the relevant without distraction or undue complexity.ā€ While Stroustrup (1997) suggests C++ classes as instruments of abstraction, the ultimate goal of abstraction is decomposition, according toĀ West (2004, p.73): ā€œcomposition is accomplished by applying abstractionā€”the ā€˜knifeā€™ used to carve our domain into discrete objects.ā€

In Ļ†šœ‘\varphiitalic_Ļ†-calculus objects are the elements the problem domain is decomposed into. This goes along the claim ofĀ West (2004, p.24): ā€œobjects, as abstractions of entities in the real world, represent a particularly dense and cohesive clustering of information.ā€

5.2. Inheritance

Inheritance, according toĀ Booch etĀ al. (2007), is ā€œa relationship among classes wherein one class shares the structure and/or behavior defined in one (single inheritance) or more (multiple inheritance) other classes,ā€ where ā€œa subclass typically augments or restricts the existing structure and behavior of its superclasses.ā€ The purpose of inheritance, according toĀ Meyer (1997), is ā€œto control the resulting potential complexityā€ of the design by enabling code reuse.

Consider a classic case of behaviour extension, suggested byĀ Stroustrup (1997, p.38) to illustrate inheritance. C++ class Shape represents a graphic object on the canvas (a simplified version of the original code):

51Ā Ā PointĀ center;
52public:
53Ā Ā voidĀ move(PointĀ to)Ā {Ā centerĀ =Ā to;Ā draw();Ā }
54Ā Ā virtualĀ voidĀ draw()Ā =Ā 0;
55};

The method draw() is ā€œvirtual,ā€ meaning that it is not implemented in the class Shape but may be implemented in sub-classes, for example in the class Circle:

26Ā Ā intĀ radius;
27public:
28Ā Ā voidĀ draw()Ā {Ā /*Ā ToĀ drawĀ aĀ circleĀ */Ā }
29};

The class Circle inherits the behavior of the class Shape and extends it with its own feature in the method draw(). Now, when the method Circle.move() is called, its implementation from the class Shape will call the virtual method Shape.draw(), and the call will be dispatched to the overridden method Circle.draw() through the ā€œvirtual tableā€ in the class Shape. The creator of the class Shape is now aware of sub-classes which may be created long after, for example Triangle, Rectangle, and so on.

Even though implementation inheritance and method overriding seem to be powerful mechanisms, they have been criticized. According toĀ Holub (2003), the main problem with implementation inheritance is that it introduces unnecessary coupling in the form of the ā€œfragile base class problem,ā€ as was also formally demonstrated byĀ Mikhajlov and Sekerinski (1998).

The fragile base class problem is one of the reasons why there is no implementation inheritance in Ļ†šœ‘\varphiitalic_Ļ†-calculus. Nevertheless, object hierarchies to enable code reuse in Ļ†šœ‘\varphiitalic_Ļ†-calculus may be created using decorators. This mechanism is also known as ā€œdelegationā€ and, according toĀ Booch etĀ al. (2007, p.98), is ā€œan alternate approach to inheritance, in which objects delegate their behavior to related objects.ā€ As noted byĀ West (2004, p.139), delegation is ā€œa way to extend or restrict the behavior of objects by composition rather than by inheritance.ā€ Seiter etĀ al. (1998) said that ā€œinheritance breaks encapsulationā€ and suggested that delegation, which they called ā€œdynamic inheritance,ā€ is a better way to add behavior to an object, but not to override existing behavior.

The absence of inheritance mechanism in Ļ†šœ‘\varphiitalic_Ļ†-calculus doesnā€™t make it any weaker, since object hierarchies are available. Booch etĀ al. (2007) while naming four fundamental elements of object model mentioned ā€œabstraction, encapsulation, modularity, and hierarchyā€ (instead of inheritance, like some other authors).

5.3. Polymorphism

According toĀ Meyer (1997, p.467), polymorphism means ā€œthe ability to take several forms,ā€ specifically a variable ā€œat run time having the ability to become attached to objects of different types, all controlled by the static declaration.ā€ Booch etĀ al. (2007, p.67) explains polymorphism as an ability of a single name (such as a variable declaration) ā€œto denote objects of many different classes that are related by some common superclass,ā€ and calls it ā€œthe most powerful feature of object-oriented programming languages.ā€

Consider an example C++ class, which is used byĀ Stroustrup (1997, p.310) to demonstrate polymorphism (the original code was simplified):

55Ā Ā stringĀ name;
56public:
57Ā Ā Employee(constĀ string&Ā name);
58Ā Ā virtualĀ voidĀ print()Ā {Ā coutĀ <<Ā name;Ā };
59};

Then, a sub-class of Employee is created, overriding the method print() with its own implementation:

29Ā Ā intĀ level;
30public:
31Ā Ā Employee(intĀ lvl)Ā :
32Ā Ā Ā Ā Employee(name),Ā level(lvl);
33Ā Ā voidĀ print()Ā {
34Ā Ā Ā Ā Employee::print();
35Ā Ā Ā Ā coutĀ <<Ā lvl;
36Ā Ā };
37};

Now, it is possible to define a function, which accepts a set of instances of class Employee and prints them one by one, calling their method print().:

59Ā Ā forĀ (set<Employee*>::const_iteratorĀ pĀ =
60Ā Ā Ā Ā emps.begin();Ā pĀ !=Ā emps.end();Ā ++p)Ā {
61Ā Ā Ā Ā (*p)->print();
62Ā Ā }
63}

The information of whether elements of the set emps are instances of Employee or Manager is not available for the print_list function in compile-time. As explained by Booch etĀ al. (2007, p.103), ā€œpolymorphism and late binding go hand in hand; in the presence of polymorphism, the binding of a method to a name is not determined until execution.ā€

Even though there are no explicitly defined types in Ļ†šœ‘\varphiitalic_Ļ†-calculus, the comformance between objects is derived and ā€œstronglyā€ checked in compile time. In the example above, it would not be possible to compile the code that adds elements to the set emps, if any of them lacks the attribute print. Since in EO, there is no reflection on types or any other mechanisms of alternative object instantiation, it is always known where objects are constructed or copied and what is the structure of them. Having this information in compile-time it is possible to guarantee strong compliance of all objects and their users. To our knowledge, this feature is not available in any other OOP languages.

5.4. Encapsulation

Encapsulation is considered the most important principle of OOP and, according toĀ Booch etĀ al. (2007, p.51), ā€œis most often achieved through information hiding, which is the process of hiding all the secrets of an object that do not contribute to its essential characteristics; typically, the structure of an object is hidden, as well as the implementation of its methods.ā€ Encapsulation in C++ and Java is achieved through access modifiers like public or protected, while in some other languages, like JavaScript or Python, there are no mechanisms of enforcing information hiding.

However, even thoughĀ Booch etĀ al. (2007, p.51) believe that ā€œencapsulation provides explicit barriers among different abstractions and thus leads to a clear separation of concerns,ā€ in reality the barriers are not so explicit: they can be easily violated. West (2004, p.141) noted that ā€œin most ways, encapsulation is a discipline more than a real barrier; seldom is the integrity of an object protected in any absolute sense, and this is especially true of software objects, so it is up to the user of an object to respect that objectā€™s encapsulation.ā€ There are even programming ā€œbest practices,ā€ which encourage programmers to compromise encapsulation: getters and setters are the most notable example, as was demonstrated byĀ Holub (2004).

The inability to make the encapsulation barrier explicit is one of the main reasons why there is no information hiding in Ļ†šœ‘\varphiitalic_Ļ†-calculus. Instead, all attributes of all objects in Ļ†šœ‘\varphiitalic_Ļ†-calculus are visible to any other object.

In EO the primary goal of encapsulation is achieved differently. The goal is to reduce coupling between objects: the less they know about each other the thinner the the connection between them, which is one of the virtues of software design, according toĀ Yourdon and Constantine (1979).

In EO the tightness of coupling between objects should be controlled during the build, similar to how the threshold of test code coverage is usually controlled. At compile-time the compiler collects the information about the relationships between objects and calculates the coupling depth of each connection. For example, the object garage is referring to the object car.engine.size. This means that the depth of this connection between objects garage and car is two, because the object garage is using two dots to access the object size. Then, all collected depths from all object connections are analyzes and the build is rejected if the numbers are higher than a predefined threshold. How exactly the numbers are analyzed and what are the possible values of the threshold is a subject for future researches.

6. Complexity

One of the most critical factors affecting software maintainability is its complexity. The design of a programming language may either encourage programmers to write code with lower complexity, or do the opposite and provoke the creation of code with higher complexity. The following design patterns, also known as anti-patterns, increase complexity, especially if being used by less experienced programmers (most critical are at the top of the list):

  • ā€¢

    P1: Returning NULL references in case of error
    (Hoare, 2009)

  • ā€¢

    P2: Implementation inheritance (esp. multiple)
    (Holub, 2003)

  • ā€¢

    P3: Mutable objects with side-effects
    (Bloch, 2016)

  • ā€¢

    P4: Type casting
    (McConnell, 2004; Gannimo, 2017)

  • ā€¢

    P5: Utility classes with only static methods
    (Bugayenko, 2016)

  • ā€¢

    P6: Runtime reflection on types
    (Bugayenko, 2016)

  • ā€¢

    P7: Setters to modify objectā€™s data
    (Holub, 2004)

  • ā€¢

    P8: Accepting NULL as function arguments
    (Hoare, 2009)

  • ā€¢

    P9: Global variables and functions
    (McConnell, 2004)

  • ā€¢

    P10: Singletons
    (Nystrom, 2014; Bugayenko, 2016)

  • ā€¢

    P11: Factory methods instead of constructors
    (Bugayenko, 2016)

  • ā€¢

    P12: Exception swallowing
    (Rocha etĀ al., 2018)

  • ā€¢

    P13: Getters to retrieve objectā€™s data
    (Holub, 2004)

  • ā€¢

    P14: Code reuse via mixins (we can think of this as a special case of workaround for the lack of multiple inheritance)
    (McConnell, 2004)

  • ā€¢

    P15: Explanation of logic via comments
    (Martin, 2008; McConnell, 2004)

  • ā€¢

    P16: Temporal coupling between statements
    (Bugayenko, 2016)

  • ā€¢

    P17: Frivolous inconsistent code formatting
    (Martin, 2008; McConnell, 2004)

In Java, C++, Ruby, Python, Smalltalk, JavaScript, PHP, C#, Eiffel, Kotlin, Erlang, and other languages most of the design patterns listed above are possible and may be utilized by programmers in their code, letting them write code with higher complexity. To the contrary, they are not permitted in EO by design:

Thus, since in EO all patterns listed above are not permitted by the language design, EO programs will have lower complexity while being written by the same group of programmers.

7. Related Work

Attempts were made to formalize OOP and introduce object calculus, similar to lambda calculusĀ (Barendregt, 2012) used in functional programming. For example, Abadi and Cardelli (1995) suggested an imperative calculus of objects, which was extended byĀ Bono and Fisher (1998) to support classes, byĀ Gordon and Hankin (1998) to support concurrency and synchronisation, and byĀ Jeffrey (1999) to support distributed programming.

Earlier, Honda and Tokoro (1991) combined OOP and Ļ€šœ‹\piitalic_Ļ€-calculus in order to introduce object calculus for asynchronous communication, which was further referenced byĀ Jones (1993) in their work on object-based design notation.

A few attempts were made to reduce existing OOP languages and formalize what is left. Featherweight Java is the most notable example proposed byĀ Igarashi etĀ al. (2001), which is omitting almost all features of the full language (including interfaces and even assignment) to obtain a small calculus. Later it was extended byĀ Jagannathan etĀ al. (2005) to support nested and multi-threaded transactions. Featherweight Java is used in formal languages such ObsidianĀ (Coblenz etĀ al., 2019) and SJFĀ (Usov and Dardha, 2020).

Another example is Larch/C++Ā (Cheon and Leavens, 1994), which is a formal algebraic interface specification language tailored to C++. It allows interfaces of C++ classes and functions to be documented in a way that is unambiguous and concise.

Several attempts to formalize OOP were made by extensions of the most popular formal notations and methods, such as Object-ZĀ (Duke etĀ al., 2000) and VDM++Ā (Durr and VanĀ Katwijk, 1992). In Object-Z, state and operation schemes are encapsulated into classes. The formal model is based upon the idea of a class historyĀ (Duke and Duke, 1990). Although, all these OO extensions do not have comprehensive refinement rules that can be used to transform specifications into implemented code in an actual OO programming language, as was noted byĀ Paige and Ostroff (1999).

Bancilhon and Khoshafian (1985) suggested an object calculus as an extension to relational calculus. Jankowska (2003) further developed these ideas and related them to a Boolean algebra. Lee etĀ al. (1996) developed an algorithm to transform an object calculus into an object algebra.

However, all these theoretical attempts to formalize OO languages were not able to fully describe their features, as was noted byĀ Nierstrasz (1991): ā€œThe development of concurrent object-based programming languages has suffered from the lack of any generally accepted formal foundations for defining their semantics.ā€ In addition, when describing the attempts of formalization, Eden (2002) summarized: ā€œNot one of the notations is defined formally, nor provided with denotational semantics, nor founded on axiomatic semantics.ā€ Moreover, despite these efforts, Ciaffaglione etĀ al. (2003b, a, 2007) noted in their series of works that a relatively little formal work has been carried out on object-based languages and it remains true to this day.

8. Acknowledgments

Many thanks to (in alphabetic order of last names) Fabricio Cabral, Kirill Chernyavskiy, Piotr Chmielowski, Danilo Danko, Konstantin Gukov, Andrew Graur, Ali-Sultan Ki-gizbaev, Nikolai Kudasov, Alexander Legalov, Tymur Ī»šœ†\lambdaitalic_Ī»ysenko, Alexandr Naumchev, Alonso A. Ortega, John Page, Alex Panov, Alexander Pushkarev, Marcos Douglas B. Santos, Alex Semenyuk, Violetta Sim, Sergei Skliar, Stian Soiland-Reyes, Viacheslav Tradunskyi, Maxim Trunnikov, Ilya Trub, CĆ©sar Soto Valero, David West, and Vladimir Zakharov for their contribution to the development of EO and Ļ†šœ‘\varphiitalic_Ļ†-calculus.

References

  • (1)
  • erl (2020) 2020. Erlang/OTP System Documentation.
  • Abadi and Cardelli (1995) MartĆ­n Abadi and Luca Cardelli. 1995. An Imperative Object Calculus. Theory and Practice of Object Systems 1, 3 (1995).
  • Alpern etĀ al. (2001) Bowen Alpern, Anthony Cocchi, Stephen Fink, and David Grove. 2001. Efficient Implementation of Java Interfaces: Invokeinterface Considered Harmless. In Proceedings of the Conference on Object-Oriented Programming, Systems, Languages, and Applications.
  • Armstrong (2006) DeborahĀ J. Armstrong. 2006. The Quarks of Object-OrienTed Development. Communications of the ACM 49, 2 (2006).
  • Armstrong (2010) Joe Armstrong. 2010. Erlang. Communications of the ACM 53, 9 (2010).
  • Bancilhon and Khoshafian (1985) Francois Bancilhon and Setrag Khoshafian. 1985. A Calculus for Complex Objects. In Proceedings of the Symposium on Principles of Database Systems.
  • Barendregt (2012) HendrikĀ P. Barendregt. 2012. The Lambda Calculus: Its Syntax and Semantics. College Publications.
  • Bernstein (2016) DavidĀ Scott Bernstein. 2016. Beyond Legacy Code: Nine Practices to Extend the Life (and Value) of Your Software. Pragmatic Bookshelf.
  • Bettini etĀ al. (2011) Lorenzo Bettini, Viviana Bono, and Betti Venneri. 2011. Delegation by Object Composition. Science of Computer Programming 76 (2011).
  • Bezanson etĀ al. (2012) Jeff Bezanson, Stefan Karpinski, ViralĀ B. Shah, and Alan Edelman. 2012. Julia: a Fast Dynamic Language for Technical Computing.
  • Bi and Oliveira (2018) Xuan Bi and Bruno C. dĀ S. Oliveira. 2018. Typed First-Class Traits. In Proceedings of the European Conference on Object-Oriented Programming.
  • Birka and Ernst (2004) Adrian Birka and MichaelĀ D. Ernst. 2004. A Practical Type System and Language for Reference Immutability. ACM SIGPLAN Notices 39, 10 (2004).
  • Bloch (2016) Joshua Bloch. 2016. Effective Java. Pearson Education India.
  • Bono and Fisher (1998) Viviana Bono and Kathleen Fisher. 1998. An Imperative, First-Order Calculus With Object Extension. In Proceedings of the European Conference on Object-Oriented Programming.
  • Booch etĀ al. (2007) Grady Booch, RobertĀ A. Maksimchuk, Michael Engle, Bobbi Young, Jim Conallen, and Kelli Houston. 2007. Object-Oriented Analysis and Design With Applications.
  • Bosch (1997) Jan Bosch. 1997. Object-Oriented Frameworks: Problems & Experiences.
  • Bright etĀ al. (2020) Walter Bright, Alex, Andrei rescu, and Michael Parker. 2020. Origins of the D Programming Language. ACM on Programming Languages 4 (2020).
  • Bugayenko (2016) Yegor Bugayenko. 2016. Elegant Objects. Amazon.
  • Burton and Sekerinski (2014) Eden Burton and Emil Sekerinski. 2014. Using Dynamic Mixins to Implement Design Patterns. In Proceedings of the European Conference on Pattern Languages of Programs.
  • Carter (1997) Jeffrey Carter. 1997. OOP Vs. Readability. ACM SIGADA Ada Letters XVII (1997).
  • Cheon and Leavens (1994) Yoonsik Cheon and GaryĀ T. Leavens. 1994. A Quick Overview of Larch/C++.
  • Ciaffaglione etĀ al. (2003a) Alberto Ciaffaglione, Luigi Liquori, and Marino Miculan. 2003a. Imperative Object-Based Calculi in Co-Inductive Type Theories. In Proceedings of the International Conference on Logic for Programming Artificial Intelligence and Reasoning.
  • Ciaffaglione etĀ al. (2003b) Alberto Ciaffaglione, Luigi Liquori, and Marino Miculan. 2003b. Reasoning on an Imperative Object-Based Calculus in Higher Order Abstract Syntax. In Proceedings of the MERLINā€™03: Proceedings of the 2003 ACM SIGPLAN Workshop on Mechanized Reasoning About Languages With Variable Binding.
  • Ciaffaglione etĀ al. (2007) Alberto Ciaffaglione, Luigi Liquori, and Marino Miculan. 2007. Reasoning About Object-Based Calculi in (Co)Inductive Type Theory and the Theory of Contexts. Journal of Automated Reasoning 39 (2007).
  • Coblenz etĀ al. (2019) MichaelĀ J. Coblenz, Reed Oei, Tyler Etzel, Paulette Koronkevich, Miles Baker, Yannick Bloem, BradĀ A. Myers, Joshua Sunshine, and Jonathan Aldrich. 2019. Obsidian: Typestate and Assets for Safer Blockchain Programming. CoRR 1 (2019).
  • Dahl and Nygaard (1966) Ole-Johan Dahl and Kristen Nygaard. 1966. SIMULA: an ALGOL-based Simulation Language. Communications of the ACM 9, 9 (1966).
  • Danforth and Tomlinson (1988) Scott Danforth and Chris Tomlinson. 1988. Type Theories and Object-Oriented Programming. ACM Computing Surveys 20, 1 (1988), 29ā€“72.
  • DiĀ Gianantonio etĀ al. (1998) Pietro DiĀ Gianantonio, Furio Honsell, and Luigi Liquori. 1998. A Lambda Calculus of Objects With Self-Inflicted Extension. In Proceedings of the Conference on Object-Oriented Programming, Systems, Languages, and Applications.
  • Dijkstra (1982) EdsgerĀ W. Dijkstra. 1982. On the Role of Scientific Thought. Springer Verlag.
  • Donovan and Kernighan (2015) AlanĀ A.A. Donovan and BrianĀ W. Kernighan. 2015. The Go Programming Language. Addison-Wesley Professional.
  • Duke and Duke (1990) David Duke and Roger Duke. 1990. Towards a Semantics for Object-Z. In Proceedings of the International Symposium of VDM Europe.
  • Duke etĀ al. (2000) Roger Duke, Paul King, Gordon Rose, and Graeme Smith. 2000. The Object-Z Specification Language. Citeseer.
  • Durr and VanĀ Katwijk (1992) Eugene Durr and Jan VanĀ Katwijk. 1992. VDM++, a Formal Specification Language for Object-Oriented Designs. In Proceedings Computer Systems and Software Engineering.
  • Eden (2002) Amnon Eden. 2002. A Visual Formalism for Object-Oriented Architecture.
  • Eden and Hirshfeld (2001) AmnonĀ H. Eden and Yoram Hirshfeld. 2001. Principles in Formal Specification of Object-Oriented Architectures. In Proceedings of the CASCONā€™01: Proceedings of the 2001 Conference of the Centre for Advanced Studies on Collaborative Research.
  • Fisher and Mitchell (1995) Kathleen Fisher and JohnĀ C. Mitchell. 1995. A Delegation-Based Object Calculus With Subtyping. In Proceedings of the International Symposium on Fundamentals of Computation Theory.
  • Gamma etĀ al. (1994) Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1994. Design Patterns: Elements of Reusable Object-Oriented Software. Addison Wesley.
  • Gannimo (2017) Gannimo. 2017. Type Confusion: Discovery, Abuse, and Protection.
  • Goldberg and Robson (1983) Adele Goldberg and David Robson. 1983. Smalltalk-80: the Language and Its Implementation. Addison-Wesley.
  • Goodenough (1975) JohnĀ B. Goodenough. 1975. Exception Handling: Issues and a Proposed Notation. Communications of the ACM 18, 12 (1975).
  • Gordon and Hankin (1998) Andy Gordon and PaulĀ D. Hankin. 1998. A Concurrent Object Calculus: Reduction and Typing.
  • Gosling and McGilton (1995) James Gosling and Henry McGilton. 1995. The Java Language Environment. Sun Microsystems Computer Company 2550 (1995).
  • Graham (2004) Paul Graham. 2004. Hackers & Painters: Big Ideas From the Computer Age. Oā€™Reilly Media.
  • Hoare (2009) Tony Hoare. 2009. Null References: the Billion Dollar Mistake.
  • Holub (2003) Allen Holub. 2003. Why Extends Is Evil.
  • Holub (2004) Allen Holub. 2004. More on Getters and Setters.
  • Honda and Tokoro (1991) Kohei Honda and Mario Tokoro. 1991. An Object Calculus for Asynchronous Communication. In Proceedings of the European Conference on Object-Oriented Programming.
  • Hunt (1997) John Hunt. 1997. Smalltalk and Object Orientation: an Introduction. Springer Science & Business Media.
  • Hunt (2000) John Hunt. 2000. Inheritance Considered Harmful. Springer.
  • Ierusalimschy (2016) Roberto Ierusalimschy. 2016. Programming in Lua, Fourth Edition. Lua.Org.
  • Igarashi etĀ al. (2001) Atsushi Igarashi, BenjaminĀ C. Pierce, and Philip Wadler. 2001. Featherweight Java: a Minimal Core Calculus for Java and GJ. ACM Transactions on Programming Languages and Systems 23, 3 (2001).
  • Jagannathan etĀ al. (2005) Suresh Jagannathan, Jan Vitek, Adam Welc, and Antony Hosking. 2005. A Transactional Object Calculus. Science of Computer Programming 57, 2 (2005).
  • Jankowska (2003) Beata Jankowska. 2003. Yet Another Object-Oriented Data Model and Its Application. Control and Cybernetics 32 (2003).
  • Jech (2013) Thomas Jech. 2013. Set Theory. Springer Science & Business Media.
  • Jeffrey (1999) Alan Jeffrey. 1999. A Distributed Object Calculus. In Proceedings of FOOL.
  • Jemerov and Isakova (2017) Dmitry Jemerov and Svetlana Isakova. 2017. Kotlin in Action. Manning Publications Company.
  • Jones (1993) CliffĀ B. Jones. 1993. A Pi-Calculus Semantics for an Object-Based Design Notation. In Proceedings of the International Conference on Concurrency Theory.
  • Kay (1986) Alan Kay. 1986. FLEXā€”A Flexible Extendable Language.
  • Kay (1997) Alan Kay. 1997. The Computer Revolution Hasnā€™t Happened yet.
  • Khanam (2018) Zeba Khanam. 2018. Barriers to Refactoring: Issues and Solutions. International Journal on Future Revolution in Computer Science & Communication Engineering 4 (2018).
  • Landin (1966) PeterĀ J. Landin. 1966. The Next 700 Programming Languages. Communications of the ACM 9, 3 (1966).
  • Lee etĀ al. (1996) Kwak Lee, Hoon-Sung Ryu, Hong-Ro, and Keun-Ho. 1996. A Translation of an Object Calculus into an Object Algebra. The Transactions of the Korea Information Processing Society 3 (1996).
  • Lutz (2013) Mark Lutz. 2013. Learning Python: Powerful Object-Oriented Programming. Oā€™Reilly Media.
  • Madsen and MĆøller-Pedersen (1988) OleĀ Lehrmann Madsen and Birger MĆøller-Pedersen. 1988. What Object-Oriented Programming May Be-And What It Does Not Have to Be. In Proceedings of the European Conference on Object-Oriented Programming.
  • Martin (2008) RobertĀ C. Martin. 2008. Clean Code: a Handbook of Agile Software Craftsmanship. Prentice Hall PTR.
  • Martin etĀ al. (1997) RobertĀ C. Martin, Dirk Riehle, and Frank Buschmann. 1997. Pattern Languages of Program Design 3. Addison-Wesley.
  • Matsakis and Klock (2014) NicholasĀ D. Matsakis and FelixĀ S. Klock. 2014. The Rust Language. ACM SIGADA Ada Letters 34, 3 (2014).
  • McConnell (2004) Steve McConnell. 2004. Code Complete, Second Edition. Microsoft Press.
  • Meyer (1997) Bertr Meyer. 1997. Object-Oriented Software Construction. Prentice Hall.
  • Mikhajlov and Sekerinski (1998) Leonid Mikhajlov and Emil Sekerinski. 1998. A Study of the Fragile Base Class Problem. In Proceedings of the European Conference on Object-Oriented Programming.
  • Mitchell etĀ al. (1993) JohnĀ C. Mitchell, Furio Honsell, and Kathleen Fisher. 1993. A Lambda Calculus of Objects and Method Specialization. In Proceedings of the IEEE Symposium on Logic in Computer Science.
  • Nierstrasz (1989) Oscar Nierstrasz. 1989. A Survey of Object-Oriented Concepts.
  • Nierstrasz (1991) Oscar Nierstrasz. 1991. Towards an Object Calculus. In Proceedings of the European Conference on Object-Oriented Programming.
  • Nierstrasz (2010) OscarĀ Marius Nierstrasz. 2010. Ten Things I Hate About Object-Oriented Programming. Journal of Object Technology 9, 5 (2010).
  • Nystrom (2014) R. Nystrom. 2014. Game Programming Patterns. Genever Benning.
  • Paige and Ostroff (1999) RichardĀ F. Paige and JonathanĀ S. Ostroff. 1999. An Object-Oriented Refinement Calculus.
  • Rentsch (1982) Tim Rentsch. 1982. Object Oriented Programming. ACM SIGPLAN Notices 17, 9 (1982).
  • Richards etĀ al. (2010) Gregor Richards, Sylvain Lebresne, Brian Burg, and Jan Vitek. 2010. An Analysis of the Dynamic Behavior of JavaScript Programs. In Proceedings of the Conference on Programming Language Design and Implementation.
  • Rocha etĀ al. (2018) Jonathan Rocha, Hugo Melo, Roberta Coelho, and Bruno Sena. 2018. Towards a Catalogue of Java Exception Handling Bad Smells and Refactorings. In Proceedings of the 25th Conference on Pattern Languages of Programs.
  • Schmager etĀ al. (2010) Frank Schmager, Nicholas Cameron, and James Noble. 2010. GoHotDraw: Evaluating the Go Programming Language With Design Patterns. In Proceedings of the PLATEAUā€™10: Evaluation and Usability of Programming Languages and Tools.
  • Seiter etĀ al. (1998) LindaĀ M. Seiter, Jens Palsberg, and KarlĀ J. Lieberherr. 1998. Evolution of Object Behavior Using Context Relations. IEEE Transactions on Software Engineering 24, 1 (1998).
  • Shelly (2015) Asaf Shelly. 2015. Flaws of Object Oriented Modeling. (2015).
  • Stefik and Bobrow (1985) Mark Stefik and DanielĀ G. Bobrow. 1985. Object-Oriented Programming: Themes and Variations. AI Magazine 6, 4 (1985).
  • Stroustrup (1997) Bjarne Stroustrup. 1997. The C++ Programming Language. Addison-Wesley Professional.
  • Ungar etĀ al. (1987) David Ungar, R. Smith, and all B. 1987. Self: the Power of Simplicity. In Proceedings of the ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications.
  • Usov and Dardha (2020) Artem Usov and Prnela Dardha. 2020. SJF: an Implementation of Semantic Featherweight Java. In Proceedings of the Coordination Models and Languages. COORDINATION 2020, Vol.Ā 12134.
  • West (2004) David West. 2004. Object Thinking. Pearson Education.
  • Yourdon and Constantine (1979) Edward Yourdon and LarryĀ L. Constantine. 1979. Structured Design: Fundamentals of a Discipline of Computer Program and Systems Design. Prentice-Hall.