E is an
object-oriented programming
Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impl ...
language for
secure distributed computing
Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers.
The components of a distributed system commu ...
, created by
Mark S. Miller,
Dan Bornstein,
Douglas Crockford
Douglas Crockford is an American computer programmer who is involved in the development of the JavaScript language. He specified the data format JSON (JavaScript Object Notation), and has developed various JavaScript related tools such as the s ...
,
Chip Morningstar and others at Electric Communities in 1997. E is mainly descended from the concurrent language
Joule
The joule ( , or ; symbol: J) is the unit of energy in the International System of Units (SI). In terms of SI base units, one joule corresponds to one kilogram- metre squared per second squared One joule is equal to the amount of work d ...
and from Original-E, a set of extensions to Java for secure distributed programming. E combines
message
A message is a unit of communication that conveys information from a sender to a receiver. It can be transmitted through various forms, such as spoken or written words, signals, or electronic data, and can range from simple instructions to co ...
-based computation with
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
-like syntax. A
concurrency model based on
event loops and
promises ensures that
deadlock can never occur.
Philosophy
The E language is designed for
computer security
Computer security (also cybersecurity, digital security, or information technology (IT) security) is a subdiscipline within the field of information security. It consists of the protection of computer software, systems and computer network, n ...
and secure computing. This is performed mainly by strict adherence to the object-oriented computing model, which in its pure form, has properties that support secure computing. The E language and its standard
library
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
employ a
capability-based design philosophy throughout in order to help programmers build secure software and to enable software components to co-operate even if they don't fully trust each other. In E, object references serve as capabilities, hence capabilities add no computational or conceptual overhead costs. The language syntax is designed to be easy for people to audit for security flaws. For example, lexical
scoping limits the amount of code that must be examined for its effects on a given variable. As another example, the language uses the
operator for comparison and the
:=
operator for assignment; to avoid the possibility of confusion, there is no
=
operator.
Computational model
In E, all values are
objects and computation is performed by sending messages to objects. Each object belongs to a ''vat'' (analogous to a
process
A process is a series or set of activities that interact to produce a result; it may occur once-only or be recurrent or periodic.
Things called a process include:
Business and management
* Business process, activities that produce a specific s ...
). Each vat has a single thread of execution, a stack frame, and an event queue.
Distributed programming
Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different networked computers.
The components of a distributed system commu ...
is just a matter of sending messages to remote objects (objects in other vats). All communication with remote parties is
encrypted by the E runtime. Arriving messages are placed into the vat's event queue; the vat's event loop processes the incoming messages one by one in order of arrival.
E has two ways to send messages: an ''immediate call'' and an ''eventual send''. An immediate call is just like a typical function or method call in a non-concurrent language: a sender waits until a receiver finishes and returns a value. An eventual send sends a message while producing a placeholder for a result called a
promise. A sender proceeds immediately with the promise. Later, when a receiver finishes and yields a result, the promise resolves to a result. Since only eventual sends are allowed when communicating with remote objects,
deadlocks cannot happen. In distributed systems, the promise mechanism also minimizes delays caused by network latency.
Syntax and examples
E's syntax is most similar to
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
, though it also bears some resemblance to
Python and
Pascal. Variables are
dynamically typed
In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usua ...
and lexically
scoped. Unlike Java or Python, however, E is composed entirely of
expressions. Here is an extremely simple E program:
println("Hello, world!")
Here is a recursive function for computing the factorial of a number, written in E. Functions are defined using the keyword.
def factorial(n :int) :int
In the first line, is a ''guard'' that constrains the argument and result of the function. A guard is not quite the same thing as a type declaration; guards are optional and can specify constraints. The first ensures that the body of the function will only have to handle an integer argument. Without the second above, the function would not be able to return a value. Being able to see up front that information escapes out of the function is helpful for security auditing.
Since E is intended to support secure co-operation, the canonical example for E programs is the mint, a simple electronic money system in just a few lines of E. The following code defines a function that makes mints, where each mint has its own currency. Each mint can make purses that hold its currency, and any holder of two purses of the same currency can securely transfer money between the purses. By quick examination of the source code, an E programmer can easily verify that only mints may change the amount of money in circulation, that money can only be created and not destroyed, that mints can only create money of their own currency, and that only the holder of a purse can change its balance.
def makeMint(name) :any
Objects in E are defined with the keyword, and within the object definition, the keyword begins each method. The guard expressions in this example illustrate how to specify a value constraint (as in or ).
The mint example makes use of a built-in mechanism called a ''sealer''. The function creates two associated objects, a sealer and an unsealer, such that the sealer can seal an object in a box and the unsealer is the only object that can retrieve the contents of the box. See the E website for a more detailed explanation of this money example.
See also
*
Object-capability model
References
External links
*
{{DEFAULTSORT:E (Programming Language)
Concurrent programming languages
Object-oriented programming languages
JVM programming languages
Secure programming languages
Dynamic programming languages
Dynamically typed programming languages
Capability systems
Programming languages
High-level programming languages
Programming languages created in 1997
1997 software