This is the insight behind the π-calculus. Encoding a program as a
π-calculus term shows it as a network of communicating processes. It
is also one of the original inspirations for Smalltalk, where every
object, every value, was imagined to be a separate computer in a vast
network, and where objects communicated by message-passing.</p><p><spanstyle="font-weight: bold">Every program is part of a network.</span>
A program that computes a result but cannot communicate it is useless
indeed. Every complete program both <spanstyle="font-style: italic">computes</span> and
<spanstyle="font-style: italic">communicates</span>. Furthermore, it does so with some finite set of
<spanstyle="font-style: italic">resources</span>, which it must carefully manage.</p><p><spanstyle="font-weight: bold">Our programming languages do not recognise that every program is
a network.</span> They blur the distinction between stateful and stateless
portions of a program, making it difficult for programmers to reason
about concurrency, contention, and distribution. They often treat
partial failure as an afterthought, despite its importance in
reasoning about program behaviour, particularly in connection with the
effect of exceptions on stateful programs. They seldom consider issues
of trust and security.</p><p><spanstyle="font-weight: bold">Our programming languages do not recognise that every program is part of a network.</span>
They treat communication with the outside world in an ad-hoc manner.
They frequently treat network communication separately from
<spanclass="stt">1950s-style terminal input and output</span>. They force the programmer
to divine failures in other parts of the network by arcane means such
as timeouts and examining the entrails of dead communication channels.
They offer no support for allocating or releasing local resources in
response to changes in other parts of the network. They seldom
consider issues of trust and security.</p><p><spanstyle="font-weight: bold">Marketplace is a network-aware programming language.</span> As a
corollary, because every program not only computes but also
communicates and manages its resources, Marketplace is also a
distributed operating system.</p><p>By recognising that programs communicate both
<spanstyle="font-style: italic">internally</span> (between subprograms) and <spanstyle="font-style: italic">externally</span> (between
peers), we recognise an inherently recursive layered architecture. We
see at every level the <spanstyle="font-style: italic">same</span> concerns of resource management,
location of mutable state, failure detection and recovery, access
control, I/O and user interface, debugging and profiling.</p><p>Marketplace addresses these concerns with a small set of primitives
chosen to make network programming in-the-small as flexible, scalable,
manageable and securable as network programming in-the-large—<wbr></wbr>and
vice versa.</p><tablecellspacing="0"><tr><td><p><spanclass="hspace"> </span><ahref="Concepts.html"class="toptoclink"data-pltdoc="x">1<spanclass="hspace"> </span>Concepts</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="Concepts.html#%28part._.What_is_a_process__what_are_event_handlers_%29"class="toclink"data-pltdoc="x">1.1<spanclass="hspace"> </span>What is a process, what are event handlers?</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="Concepts.html#%28part._.What_is_a_.V.M_%29"class="toclink"data-pltdoc="x">1.2<spanclass="hspace"> </span>What is a VM?</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="Concepts.html#%28part._.Endpoints__.Subscription_and_.Advertisement%29"class="toclink"data-pltdoc="x">1.3<spanclass="hspace"> </span>Endpoints: Subscription and Advertisement</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="Concepts.html#%28part._messages-and-topics%29"class="toclink"data-pltdoc="x">1.4<spanclass="hspace"> </span>Messages and Topics</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="Concepts.html#%28part._.Presence%29"class="toclink"data-pltdoc="x">1.5<spanclass="hspace"> </span>Presence</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="Concepts.html#%28part._.Nesting__relaying__and_levels_of_discourse%29"class="toclink"data-pltdoc="x">1.6<spanclass="hspace"> </span>Nesting, relaying, and levels of discourse</a></p></td></tr><tr><td><p><spanclass="hspace"></span></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html"class="toptoclink"data-pltdoc="x">2<spanclass="hspace"> </span>High-level interface</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._hashlang-variations%29"class="toclink"data-pltdoc="x">2.1<spanclass="hspace"> </span>Using <spanclass="stt">#lang marketplace</span> and friends</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._.Using_.Marketplace_as_a_library%29"class="toclink"data-pltdoc="x">2.2<spanclass="hspace"> </span>Using Marketplace as a library</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._constructing-transitions%29"class="toclink"data-pltdoc="x">2.3<spanclass="hspace"> </span>Constructing transitions</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._endpoint-dsl%29"class="toclink"data-pltdoc="x">2.4<spanclass="hspace"> </span>Creating endpoints</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._.Receiving_messages%29"class="toclink"data-pltdoc="x">2.4.1<spanclass="hspace"> </span>Receiving messages</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._.Action-only_vs__.State_updates%29"class="toclink"data-pltdoc="x">2.4.2<spanclass="hspace"> </span>Action-only vs. State updates</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._.Handling_presence_and_absence_events%29"class="toclink"data-pltdoc="x">2.4.3<spanclass="hspace"> </span>Handling presence and absence events</a></p></td></tr><tr><td><p><spanclass="hspace"> </span><ahref="high-level-interface.html#%28part._.Exit_reasons%29"class="toclink"data-p