Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
E (programming language)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|none}} <!-- "none" is preferred when the title is sufficiently descriptive; see [[WP:SDNONE]] --> {{Distinguish|AmigaE|e (verification language)|GNU E|Easy Programming Language}} {{Infobox programming language |name = E |logo = |paradigm = [[Multi-paradigm programming language|Multi-paradigm]]: [[Object-oriented programming|object-oriented]], [[message passing]] |designer = [[Mark S. Miller]] |developer = |released = {{Start date and age|1997}} |latest release version = |latest release date = |typing = [[strong typing|Strong]], [[dynamic typing|dynamic]] |implementations = E-on-Java, E-on-CL |influenced =[[Pony (programming language)|Pony]] |operating system = [[Cross-platform]] |license = Portions in different [[Free-software license|free licenses]] |website = {{URL|erights.org}} |influenced_by = [[Joule (programming language)|Joule]], [http://erights.org/history/original-e/ Original-E], [[Java (programming language)|Java]] }} '''E''' is an [[object-oriented programming]] language for [[computer security|secure]] [[distributed computing]], created by [[Mark S. Miller]],<ref>{{cite web |last=Handy |first=Alex |title=The future of software security |url=https://sdtimes.com/botnets/future-software-security/ |website=SD Times |date=14 November 2016}}</ref> [[Dan Bornstein]], [[Douglas Crockford]],<ref>{{cite book |last=Seibel |first=Peter |title=Coders at Work: Reflections on the Craft of Programming |url=https://books.google.com/books?id=2kMIqdfyT8kC&q=electric+communities+e+programming+language |publisher=Apress |pages=95β96 |language=en |date=21 December 2009|isbn=9781430219491 }}</ref> [[Chip Morningstar]]<ref>{{cite web |title=E's History |url=http://www.erights.org/history/ |website=www.erights.org}}</ref> and others at Electric Communities in 1997. E is mainly descended from the concurrent language [[Joule (programming language)|Joule]] and from Original-E, a set of extensions to Java for secure distributed programming. E combines [[Message (computer science)|message]]-based computation with [[Java (programming language)|Java]]-like syntax. A [[concurrent programming|concurrency]] model based on [[event-driven programming|event loops]] and [[promise (programming)|promises]] ensures that [[Deadlock (computer science)|deadlock]] can never occur.<ref>{{cite journal |last1=Miller |first1=Mark S. |last2=Tribble |first2=E. Dean |last3=Shapiro |first3=Jonathan |title=Concurrency Among Strangers |journal=Trustworthy Global Computing |series=Lecture Notes in Computer Science |date=2005 |volume=3705 |pages=195β229 |doi=10.1007/11580850_12 |bibcode=2005LNCS.3705..195M |isbn=978-3-540-30007-6 |url=https://agoric.com/assets/pdf/papers/concurrency-among-strangers.pdf |access-date=2021-03-05 |archive-date=2022-03-31 |archive-url=https://web.archive.org/web/20220331013428/https://agoric.com/assets/pdf/papers/concurrency-among-strangers.pdf |url-status=dead }}</ref> ==Philosophy== The E language is designed for [[computer security]] 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 (computing)|library]] employ a [[Capability-based security|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 [[Scope (programming)|scoping]] limits the amount of code that must be examined for its effects on a given variable. As another example, the language uses the <code>==</code> operator for comparison and the <code>:=</code> operator for assignment; to avoid the possibility of confusion, there is no <code>=</code> operator. ==Computational model== In E, all values are [[Object-oriented programming|objects]] and computation is performed by sending messages to objects. Each object belongs to a ''vat'' (analogous to a [[process (computing)|process]]). Each vat has a single thread of execution, a stack frame, and an event queue. [[Distributed programming]] is just a matter of sending messages to remote objects (objects in other vats). All communication with remote parties is [[encryption|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 (programming)|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, [[Deadlock (computer science)|deadlock]]s 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 (programming language)|Java]], though it also bears some resemblance to [[Python (programming language)|Python]] and [[Pascal (programming language)|Pascal]]. Variables are [[datatype|dynamically typed]] and lexically [[scope (programming)|scoped]]. Unlike Java or Python, however, E is composed entirely of [[expression (programming)|expressions]]. Here is an extremely simple E program: <syntaxhighlight lang="python"> println("Hello, world!") </syntaxhighlight> Here is a recursive function for computing the factorial of a number, written in E. Functions are defined using the {{code|def}} keyword. <syntaxhighlight lang="python"> def factorial(n :int) :int { if (n == 1) { return 1 } else if (n > 0) { return n * factorial(n-1) } else { throw("invalid argument to factorial: "+n) } } </syntaxhighlight> In the first line, {{code|:int}} 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 {{code|:int}} ensures that the body of the function will only have to handle an integer argument. Without the second {{code|:int}} 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. <syntaxhighlight lang="python"> def makeMint(name) :any { def [sealer, unsealer] := makeBrandPair(name) def mint { to makePurse(var balance :(int >= 0)) :any { def decr(amount :(0..balance)) :void { balance -= amount } def purse { to getBalance() :int { return balance } to sprout() :any { return mint.makePurse(0) } to getDecr() :any { return sealer.seal(decr) } to deposit(amount :int, src) :void { unsealer.unseal(src.getDecr())(amount) balance += amount } } return purse } } return mint } </syntaxhighlight> Objects in E are defined with the {{code|def}} keyword, and within the object definition, the {{code|to}} keyword begins each method. The guard expressions in this example illustrate how to specify a value constraint (as in {{code|1=:(int >= 0)}} or {{code|1=:(0..balance)}}). The mint example makes use of a built-in mechanism called a ''sealer''. The function {{code|makeBrandPair}} 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.<ref>{{cite web |last1=Rees |first1=Jonathan |last2=Miller |first2=Mark |title=From Objects To Capabilities - Simple Money |url=http://erights.org/elib/capability/ode/ode-capabilities.html#simple-money |website=erights.org |publisher=ERights |access-date=8 July 2014 |year=2001 |quote=Before presenting the following simple example of capability-based money, we must attempt to head off a confusion this example repeatedly causes. We are not proposing to actually do money this way! A desirable money system must also provide for...}}</ref> ==See also== * [[Object-capability model]] ==References== {{Reflist}} ==External links== * {{Official website|erights.org}} {{Object-capability security}} {{DEFAULTSORT:E (Programming Language)}} [[Category:Concurrent programming languages]] [[Category:Object-oriented programming languages]] [[Category:JVM programming languages]] [[Category:Secure programming languages]] [[Category:Dynamic programming languages]] [[Category:Dynamically typed programming languages]] [[Category:Capability systems]] [[Category:Programming languages]] [[Category:High-level programming languages]] [[Category:Programming languages created in 1997]] [[Category:1997 software]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Distinguish
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Object-capability security
(
edit
)
Template:Official website
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)