Better organisation; examples; ESOP2014

This commit is contained in:
Tony Garnock-Jones 2016-04-04 05:13:40 +02:00
parent c14f4558e7
commit ba4bcf9a49
8 changed files with 129 additions and 24 deletions

View File

@ -7,3 +7,10 @@ defaults:
title: "syn·di·cate"
subtitle: "a language for interactive programs"
markdown: kramdown
highlighter: rouge
kramdown:
input: GFM
hard_wrap: false

View File

@ -0,0 +1,11 @@
```javascript
actor {
this.balance = 0;
forever {
assert account(this.balance);
on message deposit($amount) {
this.balance += amount;
}
}
}
```

View File

@ -0,0 +1,10 @@
```javascript
actor {
forever {
on asserted account($balance) {
console.log("Balance:",
balance);
}
}
}
```

View File

@ -0,0 +1,7 @@
```racket
(actor
(forever #:collect [(balance 0)]
(assert (account balance))
(on (message (deposit $amount))
(+ balance amount))))
```

View File

@ -0,0 +1,7 @@
```racket
(actor
(forever
(on (asserted (account $balance))
(printf "Balance: ~a\n"
balance))))
```

View File

@ -4,6 +4,7 @@ layout: page
class: frontpage
link:
ghrepo: 'https://github.com/tonyg/syndicate'
docs: 'http://docs.racket-lang.org/syndicate/index.html'
---
**noun**
@ -11,31 +12,34 @@ link:
1. a self-organizing group of individuals, companies, corporations or
entities formed to transact some specific business, to pursue or
promote a shared interest. <small>—[Wikipedia](https://en.wikipedia.org/wiki/Syndicate)</small>
promote a shared interest.
<small>—[Wikipedia](https://en.wikipedia.org/wiki/Syndicate)</small>
# Motivation
<div></div>
Every interactive program needs some way of
<!-- # Motivation -->
- representing the *conversations* it is having as *concurrent
components*
<!-- Every interactive program needs some way of -->
- *mapping incoming events* to these components
<!-- - representing the *conversations* it is having as *concurrent -->
<!-- components* -->
- managing the *shared understanding* that the components are
building as they work towards the program's goal
<!-- - *mapping incoming events* to these components -->
- cleaning up shared state after *partial failure* of a component
<!-- - managing the *shared understanding* that the components are -->
<!-- building as they work towards the program's goal -->
- *scoping* interactions and shared state inside the program
<!-- - cleaning up shared state after *partial failure* of a component -->
Existing programming languages lack linguistic support for these
requirements, leaving the programmer to fend for themselves.
<!-- - *scoping* interactions and shared state inside the program -->
Syndicate is a language designed to help organise interactive
programs.
<!-- Existing programming languages lack linguistic support for these -->
<!-- requirements, leaving the programmer to fend for themselves. -->
# Features
<!-- Syndicate is a language designed to help organise interactive -->
<!-- programs. -->
## Overview
Syndicate is an Actor-based language offering
@ -53,12 +57,40 @@ Syndicate is an Actor-based language offering
- recursive layering of groups of actors, each group with a private
dataspace of its own, for organising larger programs
Together, these features help address the above challenges.
<!-- Together, these features help address the above challenges. -->
# Code
Together, these features help programmers organise their interactive programs.
## Example
These two actors implement a toy “bank account” actor that listens for
`deposit` messages and maintains an `account` balance record in the
shared dataspace. The first is written using Syndicate implemented for
Racket, and the second using Syndicate for JavaScript.
{% capture racket_example1 %}{% include frontpage_racket_example1.md %}{% endcapture %}
{% capture javascript_example1 %}{% include frontpage_javascript_example1.md %}{% endcapture %}
{% capture racket_example2 %}{% include frontpage_racket_example2.md %}{% endcapture %}
{% capture javascript_example2 %}{% include frontpage_javascript_example2.md %}{% endcapture %}
<div class="frontpage_code_examples">
{{ racket_example1 | markdownify }}
{{ javascript_example1 | markdownify }}
</div>
The next two implement a client for the “bank account”. Each time the
balance in the shared dataspace changes, they print a message to the
console.
<div class="frontpage_code_examples">
{{ racket_example2 | markdownify }}
{{ javascript_example2 | markdownify }}
</div>
## Code
Syndicate is implemented both for [Racket](http://racket-lang.org/)
and for [ES5](https://en.wikipedia.org/wiki/ECMAScript).
and for [JavaScript](https://en.wikipedia.org/wiki/ECMAScript).
<a href="{{ page.link.ghrepo }}"><img class="leftfloat" alt="Link to Syndicate github repo" src="{{ site.baseurl }}/img/GitHub-Mark-64px.png"></a>
The [Syndicate github repository]({{ page.link.ghrepo }}) contains
@ -66,15 +98,19 @@ implementations along with some larger example programs.
<div class="clear"></div>
# Papers
## Documentation
Forthcoming.
<!-- An early draft is available [here]({{ page.link.docs }}). -->
## Papers
<a href="{{ site.baseurl }}/papers/from-events-to-reactions-a-progress-report-20160301-1747.pdf"><img class="leftfloat" src="{{ site.baseurl }}/img/pdf_icon_gen_48x49.png"></a>
Tony Garnock-Jones, [“From Events To Reactions: A Progress Report”]({{
site.baseurl
}}/papers/from-events-to-reactions-a-progress-report-20160301-1747.pdf),
In: Proc. 9th Int. Workshop on Programming Language Approaches to
Concurrency and Communication-cEntric Software (PLACES 2016), April
2016, Eindhoven, Netherlands.
In: Proc. PLACES 2016 (workshop), April 2016, Eindhoven, Netherlands.
<div class="clear"></div>
@ -82,7 +118,14 @@ Concurrency and Communication-cEntric Software (PLACES 2016), April
Tony Garnock-Jones and Matthias Felleisen,
[“Coordinated Concurrent Programming in Syndicate”]({{ site.baseurl
}}/papers/coordinated-concurrent-programming-in-syndicate-20160111-1409.pdf),
In: Proc. 25th European Symposium on Programming (ESOP 2016), April
2016, Eindhoven, Netherlands.
In: Proc. ESOP 2016, April 2016, Eindhoven, Netherlands.
<div class="clear"></div>
<a href="{{ site.baseurl }}/papers/network-as-language-construct-20140117-1204.pdf"><img class="leftfloat" src="{{ site.baseurl }}/img/pdf_icon_gen_48x49.png"></a>
Tony Garnock-Jones, Sam Tobin-Hochstadt, and Matthias Felleisen,
[“The Network as a Language Construct”]({{ site.baseurl
}}/papers/network-as-language-construct-20140117-1204.pdf),
In: Proc. ESOP 2014, April 2016, Eindhoven, Netherlands.
<div class="clear"></div>

Binary file not shown.

View File

@ -373,6 +373,26 @@ em {
padding: 0em 2em;
}
#page.frontpage .frontpage_code_examples {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
#page.frontpage .frontpage_code_examples div {
flex-grow: 1;
text-align: center;
background: #eee;
margin: 0.2em;
}
#page.frontpage .frontpage_code_examples pre {
font-size: 105%;
display: inline-block;
text-align: left;
margin: 0;
}
/*---------------------------------------------------------------------------*/
div.linkbuttons {