37 lines
20 KiB
HTML
37 lines
20 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>Marketplace: Network-Aware Programming</title><link rel="stylesheet" type="text/css" href="scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="manual-racket.css" title="default"/><script type="text/javascript" src="scribble-common.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="scribble-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="" class="tocviewselflink" data-pltdoc="x">Marketplace:<span class="mywbr"> </span> Network-<wbr></wbr>Aware Programming</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="Concepts.html" class="tocviewlink" data-pltdoc="x">Concepts</a></td></tr><tr><td align="right">2 </td><td><a href="high-level-interface.html" class="tocviewlink" data-pltdoc="x">High-<wbr></wbr>level interface</a></td></tr><tr><td align="right">3 </td><td><a href="low-level-interface.html" class="tocviewlink" data-pltdoc="x">Low-<wbr></wbr>level interface</a></td></tr><tr><td align="right">4 </td><td><a href="Drivers.html" class="tocviewlink" data-pltdoc="x">Drivers</a></td></tr><tr><td align="right">5 </td><td><a href="Management_and_Monitoring.html" class="tocviewlink" data-pltdoc="x">Management and Monitoring</a></td></tr><tr><td align="right">6 </td><td><a href="Examples.html" class="tocviewlink" data-pltdoc="x">Examples</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><span class="tocsublinknumber"></span><a href="#%28part._marketplace%29" class="tocsubseclink" data-pltdoc="x">Marketplace:<span class="mywbr"> </span> Network-<wbr></wbr>Aware Programming</a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="versionbox"><span class="version">6.0.0.1</span></div><div class="navsettop"><span class="navleft"> </span><span class="navright"> <span class="nonavigation">← prev</span> <span class="nonavigation">up</span> <a href="Concepts.html" title="forward to "1 Concepts"" data-pltdoc="x">next →</a></span> </div><h2><a name="(part._marketplace)"></a>Marketplace: Network-Aware Programming</h2><div class="SAuthorListBox"><span class="SAuthorList"><p class="author">Tony Garnock-Jones <<a href="mailto:tonyg@ccs.neu.edu">tonyg@ccs.neu.edu</a>></p></span></div><p><span style="font-weight: bold">Every program is a network.</span>
|
|
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><span style="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 <span style="font-style: italic">computes</span> and
|
|
<span style="font-style: italic">communicates</span>. Furthermore, it does so with some finite set of
|
|
<span style="font-style: italic">resources</span>, which it must carefully manage.</p><p><span style="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><span style="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
|
|
<span class="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><span style="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
|
|
<span style="font-style: italic">internally</span> (between subprograms) and <span style="font-style: italic">externally</span> (between
|
|
peers), we recognise an inherently recursive layered architecture. We
|
|
see at every level the <span style="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><table cellspacing="0"><tr><td><p><span class="hspace"> </span><a href="Concepts.html" class="toptoclink" data-pltdoc="x">1<span class="hspace"> </span>Concepts</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Concepts.html#%28part._.What_is_a_process__what_are_event_handlers_%29" class="toclink" data-pltdoc="x">1.1<span class="hspace"> </span>What is a process, what are event handlers?</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Concepts.html#%28part._.What_is_a_.V.M_%29" class="toclink" data-pltdoc="x">1.2<span class="hspace"> </span>What is a VM?</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Concepts.html#%28part._.Endpoints__.Subscription_and_.Advertisement%29" class="toclink" data-pltdoc="x">1.3<span class="hspace"> </span>Endpoints: Subscription and Advertisement</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Concepts.html#%28part._messages-and-topics%29" class="toclink" data-pltdoc="x">1.4<span class="hspace"> </span>Messages and Topics</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Concepts.html#%28part._.Presence%29" class="toclink" data-pltdoc="x">1.5<span class="hspace"> </span>Presence</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Concepts.html#%28part._.Nesting__relaying__and_levels_of_discourse%29" class="toclink" data-pltdoc="x">1.6<span class="hspace"> </span>Nesting, relaying, and levels of discourse</a></p></td></tr><tr><td><p><span class="hspace"></span></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html" class="toptoclink" data-pltdoc="x">2<span class="hspace"> </span>High-level interface</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._hashlang-variations%29" class="toclink" data-pltdoc="x">2.1<span class="hspace"> </span>Using <span class="stt">#lang marketplace</span> and friends</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Using_.Marketplace_as_a_library%29" class="toclink" data-pltdoc="x">2.2<span class="hspace"> </span>Using Marketplace as a library</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._constructing-transitions%29" class="toclink" data-pltdoc="x">2.3<span class="hspace"> </span>Constructing transitions</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._endpoint-dsl%29" class="toclink" data-pltdoc="x">2.4<span class="hspace"> </span>Creating endpoints</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Receiving_messages%29" class="toclink" data-pltdoc="x">2.4.1<span class="hspace"> </span>Receiving messages</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Action-only_vs__.State_updates%29" class="toclink" data-pltdoc="x">2.4.2<span class="hspace"> </span>Action-only vs. State updates</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Handling_presence_and_absence_events%29" class="toclink" data-pltdoc="x">2.4.3<span class="hspace"> </span>Handling presence and absence events</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Exit_reasons%29" class="toclink" data-pltdoc="x">2.4.4<span class="hspace"> </span>Exit reasons</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._updating-endpoints%29" class="toclink" data-pltdoc="x">2.4.5<span class="hspace"> </span>Updating endpoints</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Who_am_.I_talking_to_%29" class="toclink" data-pltdoc="x">2.4.6<span class="hspace"> </span>Who am I talking to?</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._participating-vs-observing%29" class="toclink" data-pltdoc="x">2.4.7<span class="hspace"> </span>Participating in a conversation vs. observing conversations</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._naming-endpoints%29" class="toclink" data-pltdoc="x">2.4.8<span class="hspace"> </span>Naming endpoints</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._deleting-endpoints%29" class="toclink" data-pltdoc="x">2.5<span class="hspace"> </span>Deleting endpoints</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Sending_messages_and_feedback%29" class="toclink" data-pltdoc="x">2.6<span class="hspace"> </span>Sending messages and feedback</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Creating_processes%29" class="toclink" data-pltdoc="x">2.7<span class="hspace"> </span>Creating processes</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Exiting_and_killing_processes%29" class="toclink" data-pltdoc="x">2.8<span class="hspace"> </span>Exiting and killing processes</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Cooperative_scheduling%29" class="toclink" data-pltdoc="x">2.9<span class="hspace"> </span>Cooperative scheduling</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Creating_nested_.V.Ms%29" class="toclink" data-pltdoc="x">2.10<span class="hspace"> </span>Creating nested VMs</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="high-level-interface.html#%28part._.Relaying_across_layers%29" class="toclink" data-pltdoc="x">2.11<span class="hspace"> </span>Relaying across layers</a></p></td></tr><tr><td><p><span class="hspace"></span></p></td></tr><tr><td><p><span class="hspace"> </span><a href="low-level-interface.html" class="toptoclink" data-pltdoc="x">3<span class="hspace"> </span>Low-level interface</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="low-level-interface.html#%28part._handler-functions%29" class="toclink" data-pltdoc="x">3.1<span class="hspace"> </span>Handler Functions</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="low-level-interface.html#%28part._.Messages__.Topics_and_.Roles%29" class="toclink" data-pltdoc="x">3.2<span class="hspace"> </span>Messages, Topics and Roles</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="low-level-interface.html#%28part._endpoint-events%29" class="toclink" data-pltdoc="x">3.3<span class="hspace"> </span>Endpoint Events</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="low-level-interface.html#%28part._.Actions%29" class="toclink" data-pltdoc="x">3.4<span class="hspace"> </span>Actions</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="low-level-interface.html#%28part._endpoints-and-messages%29" class="toclink" data-pltdoc="x">3.4.1<span class="hspace"> </span>Endpoints and Messages</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="low-level-interface.html#%28part._.Process_.Management%29" class="toclink" data-pltdoc="x">3.4.2<span class="hspace"> </span>Process Management</a></p></td></tr><tr><td><p><span class="hspace"></span></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html" class="toptoclink" data-pltdoc="x">4<span class="hspace"> </span>Drivers</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._event-relay%29" class="toclink" data-pltdoc="x">4.1<span class="hspace"> </span>event-relay</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._tcp-bare%29" class="toclink" data-pltdoc="x">4.2<span class="hspace"> </span>tcp-bare</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._.T.C.P_channels%29" class="toclink" data-pltdoc="x">4.2.1<span class="hspace"> </span>TCP channels</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._.T.C.P_addresses%29" class="toclink" data-pltdoc="x">4.2.2<span class="hspace"> </span>TCP addresses</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._.Opening_an_outbound_connection%29" class="toclink" data-pltdoc="x">4.2.3<span class="hspace"> </span>Opening an outbound connection</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._.Accepting_inbound_connections%29" class="toclink" data-pltdoc="x">4.2.4<span class="hspace"> </span>Accepting inbound connections</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._.Receiving_data%29" class="toclink" data-pltdoc="x">4.2.5<span class="hspace"> </span>Receiving data</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._.Sending_data%29" class="toclink" data-pltdoc="x">4.2.6<span class="hspace"> </span>Sending data</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._timer__typed_and_untyped_%29" class="toclink" data-pltdoc="x">4.3<span class="hspace"> </span>timer (typed and untyped)</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Drivers.html#%28part._udp__typed_and_untyped_%29" class="toclink" data-pltdoc="x">4.4<span class="hspace"> </span>udp (typed and untyped)</a></p></td></tr><tr><td><p><span class="hspace"></span></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Management_and_Monitoring.html" class="toptoclink" data-pltdoc="x">5<span class="hspace"> </span>Management and Monitoring</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Management_and_Monitoring.html#%28part._generic-spy%29" class="toclink" data-pltdoc="x">5.1<span class="hspace"> </span>generic-spy</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Management_and_Monitoring.html#%28part._logging%29" class="toclink" data-pltdoc="x">5.2<span class="hspace"> </span>logging (MARKETPLACE_LOG)</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Management_and_Monitoring.html#%28part._debugger__experimental_%29" class="toclink" data-pltdoc="x">5.3<span class="hspace"> </span>debugger (experimental)</a></p></td></tr><tr><td><p><span class="hspace"></span></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Examples.html" class="toptoclink" data-pltdoc="x">6<span class="hspace"> </span>Examples</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Examples.html#%28part._echo-server-example%29" class="toclink" data-pltdoc="x">6.1<span class="hspace"> </span>TCP echo server</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Examples.html#%28part._chat-server-example%29" class="toclink" data-pltdoc="x">6.2<span class="hspace"> </span>TCP chat server</a></p></td></tr><tr><td><p><span class="hspace"> </span><a href="Examples.html#%28part._chat-client-example%29" class="toclink" data-pltdoc="x">6.3<span class="hspace"> </span>TCP chat client</a></p></td></tr></table><div class="navsetbottom"><span class="navleft"> </span><span class="navright"> <span class="nonavigation">← prev</span> <span class="nonavigation">up</span> <a href="Concepts.html" title="forward to "1 Concepts"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html> |