#lang syndicate/actor

This commit is contained in:
Tony Garnock-Jones 2016-07-10 12:33:16 -04:00
parent bf12d3f27f
commit 175c619edc
26 changed files with 36 additions and 59 deletions

View File

@ -0,0 +1,9 @@
#lang racket/base
(require (except-in "lang.rkt"
dataspace
assert
))
(require "actor.rkt")
(provide (all-from-out "lang.rkt")
(all-from-out "actor.rkt"))

View File

@ -48,6 +48,9 @@
(struct-out endpoint) (struct-out endpoint)
) )
(module reader syntax/module-reader
syndicate/actor-lang)
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)

View File

@ -1,8 +1,6 @@
#lang syndicate #lang syndicate/actor
;; Hello-worldish "bank account" example. ;; Hello-worldish "bank account" example.
(require syndicate/actor)
(struct account (balance) #:prefab) (struct account (balance) #:prefab)
(struct deposit (amount) #:prefab) (struct deposit (amount) #:prefab)

View File

@ -1,8 +1,6 @@
#lang syndicate #lang syndicate/actor
;; Simple mutable box and count-to-infinity box client. ;; Simple mutable box and count-to-infinity box client.
(require syndicate/actor)
(struct set-box (new-value) #:transparent) (struct set-box (new-value) #:transparent)
(struct box-state (value) #:transparent) (struct box-state (value) #:transparent)

View File

@ -1,8 +1,6 @@
#lang syndicate #lang syndicate/actor
;; Demonstrate sending a message to multiple receivers. ;; Demonstrate sending a message to multiple receivers.
(require syndicate/actor)
(struct envelope (destination message) #:prefab) (struct envelope (destination message) #:prefab)
(actor (react (on (message (envelope 'alice $message)) (actor (react (on (message (envelope 'alice $message))

View File

@ -1,6 +1,5 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(require syndicate/drivers/timer) (require syndicate/drivers/timer)
(spawn-timer-driver) (spawn-timer-driver)

View File

@ -1,6 +1,5 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(require syndicate/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))

View File

@ -1,6 +1,5 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(require syndicate/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))

View File

@ -1,6 +1,5 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(require syndicate/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))

View File

@ -1,6 +1,5 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(require syndicate/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))

View File

@ -1,6 +1,5 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(require syndicate/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))

View File

@ -1,6 +1,5 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(require syndicate/drivers/tcp) (require syndicate/drivers/tcp)
(spawn-tcp-driver) (spawn-tcp-driver)

View File

@ -1,4 +1,4 @@
#lang syndicate #lang syndicate/actor
;; Illustrates a (now fixed) bug where mutation altering a ;; Illustrates a (now fixed) bug where mutation altering a
;; subscription caused the `retracted` half of a during instance to be ;; subscription caused the `retracted` half of a during instance to be
;; lost. ;; lost.
@ -14,8 +14,6 @@
;; ;;
;; Should eventually be turned into some kind of test case. ;; Should eventually be turned into some kind of test case.
(require syndicate/actor)
(struct foo (x y) #:prefab) (struct foo (x y) #:prefab)
(actor (define x 123) (actor (define x 123)

View File

@ -1,9 +1,7 @@
#lang syndicate #lang syndicate/actor
;; Illustrates the response of asserted / retracted / during to ;; Illustrates the response of asserted / retracted / during to
;; observation of assertions discarding some of their dimensions. ;; observation of assertions discarding some of their dimensions.
(require syndicate/actor)
(struct ready (what) #:prefab) (struct ready (what) #:prefab)
(struct entry (key val) #:prefab) (struct entry (key val) #:prefab)

View File

@ -1,8 +1,7 @@
#lang syndicate #lang syndicate/actor
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; syndicate/actor implementation, using "during" instead of "on asserted/until retracted". ;; syndicate/actor implementation, using "during" instead of "on asserted/until retracted".
(require syndicate/actor)
(require syndicate/drivers/timer) (require syndicate/drivers/timer)
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require (only-in racket/string string-trim string-split)) (require (only-in racket/string string-trim string-split))

View File

@ -1,9 +1,8 @@
#lang syndicate #lang syndicate/actor
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; Low-level implementation. ;; Low-level implementation.
(require (only-in syndicate [assert core:assert])) (require (only-in syndicate [assert core:assert]))
(require syndicate/actor)
(require syndicate/drivers/timer) (require syndicate/drivers/timer)
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require (only-in racket/string string-trim string-split)) (require (only-in racket/string string-trim string-split))

View File

@ -1,9 +1,8 @@
#lang syndicate #lang syndicate/actor
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; Low-level implementation, without subconversation. ;; Low-level implementation, without subconversation.
(require (only-in syndicate [assert core:assert])) (require (only-in syndicate [assert core:assert]))
(require syndicate/actor)
(require syndicate/drivers/timer) (require syndicate/drivers/timer)
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require (only-in racket/string string-trim string-split)) (require (only-in racket/string string-trim string-split))

View File

@ -1,8 +1,7 @@
#lang syndicate #lang syndicate/actor
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; syndicate/actor implementation. ;; syndicate/actor implementation.
(require syndicate/actor)
(require syndicate/drivers/timer) (require syndicate/drivers/timer)
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require (only-in racket/string string-trim string-split)) (require (only-in racket/string string-trim string-split))

View File

@ -1,8 +1,7 @@
#lang syndicate #lang syndicate/actor
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; syndicate/actor implementation, without subconversation. ;; syndicate/actor implementation, without subconversation.
(require syndicate/actor)
(require syndicate/drivers/timer) (require syndicate/drivers/timer)
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require (only-in racket/string string-trim string-split)) (require (only-in racket/string string-trim string-split))

View File

@ -1,8 +1,6 @@
#lang syndicate #lang syndicate/actor
;; Minimal syndicate/actor variation on examples/forward-chaining.rkt. ;; Minimal syndicate/actor variation on examples/forward-chaining.rkt.
(require syndicate/actor)
(actor (react (assert `(parent john douglas)))) (actor (react (assert `(parent john douglas))))
(actor (react (assert `(parent bob john)))) (actor (react (assert `(parent bob john))))
(actor (react (assert `(parent ebbon bob)))) (actor (react (assert `(parent ebbon bob))))

View File

@ -1,6 +1,4 @@
#lang syndicate #lang syndicate/actor
(require syndicate/actor)
(struct echo-req (body) #:prefab) (struct echo-req (body) #:prefab)
(struct echo-resp (body) #:prefab) (struct echo-resp (body) #:prefab)

View File

@ -1,8 +1,6 @@
#lang syndicate #lang syndicate/actor
;; Demonstrates that fields may not be passed between actors. ;; Demonstrates that fields may not be passed between actors.
(require syndicate/actor)
(actor #:name 'reading-actor (actor #:name 'reading-actor
(react (react
(on (message `(read-from ,$this-field)) (on (message `(read-from ,$this-field))

View File

@ -1,9 +1,7 @@
#lang syndicate #lang syndicate/actor
;; Demonstrates that fields may used in a child facet of a declaring ;; Demonstrates that fields may used in a child facet of a declaring
;; facet, but not the other way around. ;; facet, but not the other way around.
(require syndicate/actor)
(actor #:name 'reading-actor (actor #:name 'reading-actor
(react (react
(field [top 123]) (field [top 123])

View File

@ -1,8 +1,6 @@
#lang syndicate #lang syndicate/actor
;; Demonstrates that fields may not be passed between sibling facets. ;; Demonstrates that fields may not be passed between sibling facets.
(require syndicate/actor)
(actor (react (actor (react
(on (message `(read-from ,$this-field)) (on (message `(read-from ,$this-field))
(log-info "Trying to read from ~a" this-field) (log-info "Trying to read from ~a" this-field)

View File

@ -1,7 +1,6 @@
#lang syndicate #lang syndicate/actor
;; A toy spreadsheet model. ;; A toy spreadsheet model.
(require syndicate/actor)
(require racket/match) (require racket/match)
(require racket/set) (require racket/set)

View File

@ -1,4 +1,4 @@
#lang syndicate #lang syndicate/actor
;; An extended two-buyer book-purchase protocol, based loosely on that ;; An extended two-buyer book-purchase protocol, based loosely on that
;; given in Honda/Yoshida/Carbone 2008, "Multiparty Asynchronous ;; given in Honda/Yoshida/Carbone 2008, "Multiparty Asynchronous
;; Session Types". ;; Session Types".
@ -45,8 +45,6 @@
;; The order for "The Wind in the Willows" has id 10001485, and will be delivered on March 9th ;; The order for "The Wind in the Willows" has id 10001485, and will be delivered on March 9th
;;--------------------------------------------------------------------------- ;;---------------------------------------------------------------------------
(require syndicate/actor)
;; Role: SELLER ;; Role: SELLER
;; - when interest in (book-quote $title _) appears, ;; - when interest in (book-quote $title _) appears,
;; asserts (book-quote title (Option Float)), #f meaning not available, ;; asserts (book-quote title (Option Float)), #f meaning not available,