diff --git a/_config.yml b/_config.yml index 4a3ae51..4e1f6e8 100644 --- a/_config.yml +++ b/_config.yml @@ -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 diff --git a/_includes/frontpage_javascript_example1.md b/_includes/frontpage_javascript_example1.md new file mode 100644 index 0000000..eeec2f2 --- /dev/null +++ b/_includes/frontpage_javascript_example1.md @@ -0,0 +1,11 @@ +```javascript +actor { + this.balance = 0; + forever { + assert account(this.balance); + on message deposit($amount) { + this.balance += amount; + } + } +} +``` diff --git a/_includes/frontpage_javascript_example2.md b/_includes/frontpage_javascript_example2.md new file mode 100644 index 0000000..bbf80da --- /dev/null +++ b/_includes/frontpage_javascript_example2.md @@ -0,0 +1,10 @@ +```javascript +actor { + forever { + on asserted account($balance) { + console.log("Balance:", + balance); + } + } +} +``` diff --git a/_includes/frontpage_racket_example1.md b/_includes/frontpage_racket_example1.md new file mode 100644 index 0000000..ef89fc4 --- /dev/null +++ b/_includes/frontpage_racket_example1.md @@ -0,0 +1,7 @@ +```racket +(actor + (forever #:collect [(balance 0)] + (assert (account balance)) + (on (message (deposit $amount)) + (+ balance amount)))) +``` diff --git a/_includes/frontpage_racket_example2.md b/_includes/frontpage_racket_example2.md new file mode 100644 index 0000000..c52a8ec --- /dev/null +++ b/_includes/frontpage_racket_example2.md @@ -0,0 +1,7 @@ +```racket +(actor + (forever + (on (asserted (account $balance)) + (printf "Balance: ~a\n" + balance)))) +``` diff --git a/index.md b/index.md index 106bb03..b9d0ff7 100644 --- a/index.md +++ b/index.md @@ -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. —[Wikipedia](https://en.wikipedia.org/wiki/Syndicate) + promote a shared interest. + —[Wikipedia](https://en.wikipedia.org/wiki/Syndicate) -# Motivation +
-Every interactive program needs some way of + - - representing the *conversations* it is having as *concurrent - components* + - - *mapping incoming events* to these components + + - - managing the *shared understanding* that the components are - building as they work towards the program's goal + - - cleaning up shared state after *partial failure* of a component + + - - *scoping* interactions and shared state inside the program + -Existing programming languages lack linguistic support for these -requirements, leaving the programmer to fend for themselves. + -Syndicate is a language designed to help organise interactive -programs. + + -# Features + + + +## 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. + -# 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 %} + +