Alpha convert: prospect -> syndicate

This commit is contained in:
Tony Garnock-Jones 2016-04-01 19:53:46 -04:00
parent e9b1645beb
commit 9dee4e3b30
139 changed files with 239 additions and 240 deletions

View File

@ -1,6 +1,6 @@
# Prospect: A Networked, Concurrent, Functional Programming Language # Syndicate: A Networked, Concurrent, Functional Programming Language
Prospect is an actor-based concurrent language able to express Syndicate is an actor-based concurrent language able to express
communication, enforce isolation, and manage resources. communication, enforce isolation, and manage resources.
Network-inspired extensions to a functional core represent imperative Network-inspired extensions to a functional core represent imperative
actions as values, giving side-effects locality and enabling actions as values, giving side-effects locality and enabling
@ -11,7 +11,7 @@ virtual machines) to scope their interactions. Conversations between
actors are multi-party (using a publish/subscribe medium), and actors actors are multi-party (using a publish/subscribe medium), and actors
can easily participate in many such conversations at once. can easily participate in many such conversations at once.
Prospect makes *presence* notifications an integral part of pub/sub Syndicate makes *presence* notifications an integral part of pub/sub
through its *shared dataspaces*, akin to through its *shared dataspaces*, akin to
[tuplespaces](https://en.wikipedia.org/wiki/Tuple_space). Each shared [tuplespaces](https://en.wikipedia.org/wiki/Tuple_space). Each shared
dataspace doubles as the pub/sub subscription table for its network. dataspace doubles as the pub/sub subscription table for its network.
@ -27,18 +27,18 @@ their containing network take on those burdens.
## The code ## The code
This repository contains a [Racket](http://racket-lang.org/) package, This repository contains a [Racket](http://racket-lang.org/) package,
`prospect`, which includes `syndicate`, which includes
- the implementation of the `#lang prospect` language, in the - the implementation of the `#lang syndicate` language, in the
[`prospect` directory](https://github.com/tonyg/prospect/tree/master/prospect/). [`syndicate` directory](https://github.com/tonyg/syndicate/tree/master/syndicate/).
- a TCP echo server example, which listens for connections on port - a TCP echo server example, which listens for connections on port
5999 by default, in 5999 by default, in
[`prospect/examples/echo.rkt`](https://github.com/tonyg/prospect/tree/master/prospect/examples/echo.rkt). [`syndicate/examples/echo.rkt`](https://github.com/tonyg/syndicate/tree/master/syndicate/examples/echo.rkt).
Connect to it using, for example, `telnet localhost 5999`. Connect to it using, for example, `telnet localhost 5999`.
- a handful of other examples, in - a handful of other examples, in
[`prospect/examples/`](https://github.com/tonyg/prospect/tree/master/prospect/examples/). [`syndicate/examples/`](https://github.com/tonyg/syndicate/tree/master/syndicate/examples/).
## Compiling and running the code ## Compiling and running the code
@ -46,7 +46,7 @@ You will need Racket version 6.3 or later.
Once you have Racket installed, run Once you have Racket installed, run
raco pkg install prospect raco pkg install syndicate
to install the package from the Racket package repository, or to install the package from the Racket package repository, or
@ -54,11 +54,11 @@ to install the package from the Racket package repository, or
from the root directory of the Git checkout to install the package from the root directory of the Git checkout to install the package
from a local snapshot. (Alternatively, `make link` does the same thing.) from a local snapshot. (Alternatively, `make link` does the same thing.)
This will make `#lang prospect` available to programs. This will make `#lang syndicate` available to programs.
At this point, you may load and run any of the example `*.rkt` files At this point, you may load and run any of the example `*.rkt` files
in the in the
[`prospect/examples/`](https://github.com/tonyg/prospect/tree/master/prospect/examples/) [`syndicate/examples/`](https://github.com/tonyg/syndicate/tree/master/syndicate/examples/)
directory. directory.
## Copyright ## Copyright

View File

@ -9,9 +9,9 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require prospect-monolithic) (require syndicate-monolithic)
(require prospect-monolithic/drivers/timer) (require syndicate-monolithic/drivers/timer)
(require prospect-monolithic/demand-matcher) (require syndicate-monolithic/demand-matcher)
(require bitsyntax) (require bitsyntax)
(require "dump-bytes.rkt") (require "dump-bytes.rkt")

View File

@ -2,7 +2,7 @@
;; Demonstration stack configuration for various hosts. ;; Demonstration stack configuration for various hosts.
(require racket/match) (require racket/match)
(require prospect-monolithic) (require syndicate-monolithic)
(require (only-in mzlib/os gethostname)) (require (only-in mzlib/os gethostname))
(require "configuration.rkt") (require "configuration.rkt")

View File

@ -13,8 +13,8 @@
(require racket/match) (require racket/match)
(require racket/async-channel) (require racket/async-channel)
(require prospect-monolithic) (require syndicate-monolithic)
(require prospect-monolithic/demand-matcher) (require syndicate-monolithic/demand-matcher)
(require packet-socket) (require packet-socket)
(require bitsyntax) (require bitsyntax)

View File

@ -1,7 +1,7 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require prospect-monolithic/demand-matcher) (require syndicate-monolithic/demand-matcher)
(require prospect-monolithic/drivers/timer) (require syndicate-monolithic/drivers/timer)
(require "demo-config.rkt") (require "demo-config.rkt")
(require "ethernet.rkt") (require "ethernet.rkt")
(require "arp.rkt") (require "arp.rkt")

View File

@ -13,9 +13,9 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require (only-in racket/string string-split)) (require (only-in racket/string string-split))
(require prospect-monolithic) (require syndicate-monolithic)
(require prospect-monolithic/drivers/timer) (require syndicate-monolithic/drivers/timer)
(require prospect-monolithic/demand-matcher) (require syndicate-monolithic/demand-matcher)
(require bitsyntax) (require bitsyntax)
(require "dump-bytes.rkt") (require "dump-bytes.rkt")

View File

@ -1,7 +1,7 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require prospect-monolithic/demand-matcher) (require syndicate-monolithic/demand-matcher)
(require prospect-monolithic/drivers/timer) (require syndicate-monolithic/drivers/timer)
(require "demo-config.rkt") (require "demo-config.rkt")
(require "ethernet.rkt") (require "ethernet.rkt")
(require "arp.rkt") (require "arp.rkt")
@ -91,9 +91,9 @@
(string->bytes/utf-8 (string->bytes/utf-8
(format (string-append (format (string-append
"HTTP/1.0 200 OK\r\n\r\n" "HTTP/1.0 200 OK\r\n\r\n"
"<h1>Hello world from prospect-monolithic-netstack!</h1>\n" "<h1>Hello world from syndicate-monolithic-netstack!</h1>\n"
"<p>This is running on prospect-monolithic's own\n" "<p>This is running on syndicate-monolithic's own\n"
"<a href='https://github.com/tonyg/prospect-netstack/'>\n" "<a href='https://github.com/tonyg/syndicate/'>\n"
"TCP/IP stack</a>.</p>\n" "TCP/IP stack</a>.</p>\n"
"<p>There have been ~a requests prior to this one.</p>") "<p>There have been ~a requests prior to this one.</p>")
counter))) counter)))

View File

@ -6,7 +6,7 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require prospect-monolithic) (require syndicate-monolithic)
(require "ip.rkt") (require "ip.rkt")
(struct port-allocation-request (type k) #:prefab) (struct port-allocation-request (type k) #:prefab)

View File

@ -8,9 +8,9 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require prospect-monolithic) (require syndicate-monolithic)
(require prospect-monolithic/drivers/timer) (require syndicate-monolithic/drivers/timer)
(require prospect-monolithic/demand-matcher) (require syndicate-monolithic/demand-matcher)
(require bitsyntax) (require bitsyntax)
(require "dump-bytes.rkt") (require "dump-bytes.rkt")

View File

@ -10,8 +10,8 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require prospect-monolithic) (require syndicate-monolithic)
(require prospect-monolithic/demand-matcher) (require syndicate-monolithic/demand-matcher)
(require bitsyntax) (require bitsyntax)
(require "dump-bytes.rkt") (require "dump-bytes.rkt")

View File

@ -1,6 +1,5 @@
#lang setup/infotab #lang setup/infotab
(define deps '("git://github.com/tonyg/prospect-gl" (define deps '("syndicate"
"prospect"
"base" "base"
"htdp-lib" "htdp-lib"
)) ))

View File

@ -8,15 +8,15 @@
(require racket/promise) (require racket/promise)
(require plot/utils) ;; for vector utilities (require plot/utils) ;; for vector utilities
(require prospect) (require syndicate)
(require prospect/drivers/timer) (require syndicate/drivers/timer)
(require prospect-gl/2d) (require syndicate-gl/2d)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Layers: ;; Layers:
;; ;;
;; - External I/O ;; - External I/O
;; as arranged by prospect-gl/2d ;; as arranged by syndicate-gl/2d
;; including keyboard events, interface to rendering, and frame timing ;; including keyboard events, interface to rendering, and frame timing
;; ;;
;; - Ground ;; - Ground

View File

@ -1,12 +1,12 @@
# FAQ # FAQ
* How do I run a prospect program? * How do I run a syndicate program?
- `#lang prospect` collects actions (`spawn`s) from module toplevel and - `#lang syndicate` collects actions (`spawn`s) from module toplevel and
uses them as boot actions for a ground-level network. The alternative uses them as boot actions for a ground-level network. The alternative
is to use a different #lang, and to call `run-ground` yourself; see an is to use a different #lang, and to call `run-ground` yourself; see an
example in prospect/examples/example-plain.rkt. example in syndicate/examples/example-plain.rkt.
* How do I debug a prospect program? * How do I debug a syndicate program?
- You can view a colored trace of a program's execution on stderr by setting the MINIMART_TRACE environment variable, e.g. - You can view a colored trace of a program's execution on stderr by setting the MINIMART_TRACE environment variable, e.g.
``` ```
@ -220,7 +220,7 @@
``` ```
- use `spawn-network`: - use `spawn-network`:
```racket ```racket
#lang prospect #lang syndicate
(spawn-network <net1-spawns> ...) (spawn-network <net1-spawns> ...)
(spawn-network <net2-spawns> ... (spawn-network <net2-spawns> ...
(spawn-network <net3-spawns> ...)) (spawn-network <net3-spawns> ...))
@ -269,8 +269,8 @@
process is killed - the spawning process is not signalled. More thought process is killed - the spawning process is not signalled. More thought
required. required.
* Can I split a prospect program across multiple files? * Can I split a syndicate program across multiple files?
- Only one module with `#lang prospect` can be used at a time. - Only one module with `#lang syndicate` can be used at a time.
* Why does `#f` keep getting sent as an event? * Why does `#f` keep getting sent as an event?
- When a behavior returns something besides `#f` in response to an event, it is - When a behavior returns something besides `#f` in response to an event, it is

View File

@ -1,5 +1,5 @@
PACKAGENAME=prospect PACKAGENAME=syndicate
COLLECTS=prospect prospect-monolithic COLLECTS=syndicate syndicate-monolithic syndicate-gl
all: setup all: setup

View File

@ -1,4 +1,4 @@
#lang prospect ;; -*- racket -*- #lang syndicate ;; -*- racket -*-
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect ;; -*- racket -*- #lang syndicate ;; -*- racket -*-
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect ;; -*- racket -*- #lang syndicate ;; -*- racket -*-
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")
(require "../demand-matcher.rkt") (require "../demand-matcher.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect/hll ;; -*- racket -*- #lang syndicate/hll ;; -*- racket -*-
(actor (forever #:collect [(count 0)] (actor (forever #:collect [(count 0)]
(assert `(parent-count ,count)) (assert `(parent-count ,count))

View File

@ -1,4 +1,4 @@
#lang prospect/hll ;; -*- racket -*- #lang syndicate/hll ;; -*- racket -*-
(actor (forever #:collect [(count 0)] (actor (forever #:collect [(count 0)]
(assert `(parent-count ,count)) (assert `(parent-count ,count))

View File

@ -1,4 +1,4 @@
#lang prospect/hll ;; -*- racket -*- #lang syndicate/hll ;; -*- racket -*-
(actor (forever (assert `(parent john douglas)))) (actor (forever (assert `(parent john douglas))))
(actor (forever (assert `(parent bob john)))) (actor (forever (assert `(parent bob john))))

View File

@ -1,4 +1,4 @@
#lang prospect/hll ;; -*- racket -*- #lang syndicate/hll ;; -*- racket -*-
(actor (forever (assert `(parent john douglas)))) (actor (forever (assert `(parent john douglas))))
(actor (forever (assert `(parent bob john)))) (actor (forever (assert `(parent bob john))))

View File

@ -114,7 +114,7 @@ with their values at the time the `until` is started.
## Examples ## Examples
```racket ```racket
#lang prospect/actor #lang syndicate/actor
;; Simple mutable box and count-to-infinity box client. ;; Simple mutable box and count-to-infinity box client.
(struct set-box (new-value) #:transparent) (struct set-box (new-value) #:transparent)

View File

@ -23,9 +23,9 @@
(require (prefix-in image: 2htdp/image)) (require (prefix-in image: 2htdp/image))
(require (prefix-in pict: pict)) (require (prefix-in pict: pict))
(require prospect) (require syndicate)
(require prospect/trie) (require syndicate/trie)
(require prospect/ground) (require syndicate/ground)
(require "texture.rkt") (require "texture.rkt")
@ -394,7 +394,7 @@
(collect-garbage 'major) (collect-garbage 'major)
(define frame (new frame% (define frame (new frame%
[style '(fullscreen-button)] [style '(fullscreen-button)]
[label "prospect-gl"] [label "syndicate-gl"]
[width (or width 640)] [width (or width 640)]
[height (or height 480)])) [height (or height 480)]))
(define c (new network-canvas% (define c (new network-canvas%

View File

@ -1,6 +1,6 @@
#lang racket #lang racket
(require prospect) (require syndicate)
(require 2htdp/image) (require 2htdp/image)
(require "../2d.rkt") (require "../2d.rkt")

View File

@ -1,4 +1,4 @@
# prospect-monolithic # syndicate-monolithic
This is an implementation of the monolithic semantics, without any use This is an implementation of the monolithic semantics, without any use
of patches. of patches.

View File

@ -66,12 +66,12 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require (only-in racket/list flatten)) (require (only-in racket/list flatten))
(require "../prospect/functional-queue.rkt") (require "../syndicate/functional-queue.rkt")
(require "../prospect/trie.rkt") (require "../syndicate/trie.rkt")
(require "scn.rkt") (require "scn.rkt")
(require "../prospect/trace.rkt") (require "../syndicate/trace.rkt")
(require "mux.rkt") (require "mux.rkt")
(require "../prospect/pretty.rkt") (require "../syndicate/pretty.rkt")
(module+ test (require rackunit)) (module+ test (require rackunit))
;; Events = SCNs Messages ;; Events = SCNs Messages
@ -111,8 +111,8 @@
states ;; (HashTable PID Any) states ;; (HashTable PID Any)
) )
#:transparent #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print w [p (current-output-port)]) [(define (syndicate-pretty-print w [p (current-output-port)])
(pretty-print-network w p))]) (pretty-print-network w p))])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -439,12 +439,12 @@
(fprintf p " - ~a runnable pids ~a\n" (set-count runnable) (set->list runnable)) (fprintf p " - ~a runnable pids ~a\n" (set-count runnable) (set->list runnable))
(fprintf p " - ~a live processes\n" (hash-count states)) (fprintf p " - ~a live processes\n" (hash-count states))
(fprintf p " - ") (fprintf p " - ")
(display (indented-port-output 3 (lambda (p) (prospect-pretty-print mux p)) #:first-line? #f) p) (display (indented-port-output 3 (lambda (p) (syndicate-pretty-print mux p)) #:first-line? #f) p)
(newline p) (newline p)
(for ([pid (set-union (hash-keys (mux-interest-table mux)) (hash-keys states))]) (for ([pid (set-union (hash-keys (mux-interest-table mux)) (hash-keys states))])
(fprintf p " ---- process ~a, behavior ~v, STATE:\n" pid (hash-ref behaviors pid #f)) (fprintf p " ---- process ~a, behavior ~v, STATE:\n" pid (hash-ref behaviors pid #f))
(define state (hash-ref states pid #f)) (define state (hash-ref states pid #f))
(display (indented-port-output 6 (lambda (p) (prospect-pretty-print state p))) p) (display (indented-port-output 6 (lambda (p) (syndicate-pretty-print state p))) p)
(newline p) (newline p)
(fprintf p " process ~a, behavior ~v, CLAIMS:\n" pid (hash-ref behaviors pid #f)) (fprintf p " process ~a, behavior ~v, CLAIMS:\n" pid (hash-ref behaviors pid #f))
(display (indented-port-output 6 (lambda (p) (display (indented-port-output 6 (lambda (p)

View File

@ -5,7 +5,7 @@
(require racket/match) (require racket/match)
(require "core.rkt") (require "core.rkt")
(require "drivers/timer.rkt") (require "drivers/timer.rkt")
(require "../prospect/pretty.rkt") (require "../syndicate/pretty.rkt")
(provide (except-out (struct-out demand-matcher) demand-matcher) (provide (except-out (struct-out demand-matcher) demand-matcher)
(rename-out [make-demand-matcher demand-matcher]) (rename-out [make-demand-matcher demand-matcher])
@ -27,8 +27,8 @@
current-demand ;; (Setof (Listof Any)) current-demand ;; (Setof (Listof Any))
current-supply) ;; (Setof (Listof Any)) current-supply) ;; (Setof (Listof Any))
#:transparent #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print s [p (current-output-port)]) [(define (syndicate-pretty-print s [p (current-output-port)])
(pretty-print-demand-matcher s p))]) (pretty-print-demand-matcher s p))])
;; A ChangeHandler is a ((Constreeof Action) Any* -> (Constreeof Action)). ;; A ChangeHandler is a ((Constreeof Action) Any* -> (Constreeof Action)).

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
;; Hello-worldish "bank account" example. ;; Hello-worldish "bank account" example.
(struct account (balance) #:prefab) (struct account (balance) #:prefab)

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
;; Simple mutable box and count-to-infinity box client. ;; Simple mutable box and count-to-infinity box client.
(struct set-box (new-value) #:transparent) (struct set-box (new-value) #:transparent)

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require racket/set) (require racket/set)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")
(require "../demand-matcher.rkt") (require "../demand-matcher.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require (only-in racket/port read-line-evt)) (require (only-in racket/port read-line-evt))
(require "../drivers/timer.rkt") (require "../drivers/timer.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
;; Check that nested-world assertions are properly retracted. ;; Check that nested-world assertions are properly retracted.
;; Should print two "Got SCN:" tries - one nonempty, and one empty. ;; Should print two "Got SCN:" tries - one nonempty, and one empty.

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
;; Test case for a historical bug in Syndicate. ;; Test case for a historical bug in Syndicate.
;; ;;
;; When the bug existed, this program receiveed four SCN events in ;; When the bug existed, this program receiveed four SCN events in
@ -13,13 +13,13 @@
;; The fix was to adjust the implementation of state change ;; The fix was to adjust the implementation of state change
;; notifications to cancel the echo for metaassertions. ;; notifications to cancel the echo for metaassertions.
(require prospect/pretty) (require syndicate/pretty)
(spawn-network (spawn-network
(spawn (lambda (e counter) (spawn (lambda (e counter)
(and e (and e
(let ((new-counter (+ counter 1))) (let ((new-counter (+ counter 1)))
(printf "Received event ~a:\n~a\n" new-counter (prospect-pretty-print->string e)) (printf "Received event ~a:\n~a\n" new-counter (syndicate-pretty-print->string e))
(transition (+ counter 1) '())))) (transition (+ counter 1) '()))))
0 0
(list (scn/union (assertion (at-meta 'x)) (list (scn/union (assertion (at-meta 'x))

View File

@ -1,13 +1,13 @@
#lang prospect-monolithic #lang syndicate-monolithic
;; The actor should receive a single event adding the (at-meta x) assertion. ;; The actor should receive a single event adding the (at-meta x) assertion.
(require prospect/pretty) (require syndicate/pretty)
(spawn-network (spawn-network
(spawn (lambda (e counter) (spawn (lambda (e counter)
(and e (and e
(let ((new-counter (+ counter 1))) (let ((new-counter (+ counter 1)))
(printf "Received event ~a:\n~a\n" new-counter (prospect-pretty-print->string e)) (printf "Received event ~a:\n~a\n" new-counter (syndicate-pretty-print->string e))
(transition (+ counter 1) '())))) (transition (+ counter 1) '()))))
0 0
(list (scn/union (assertion (at-meta 'x)) (list (scn/union (assertion (at-meta 'x))

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
;; Demonstrates quit-network. ;; Demonstrates quit-network.
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(struct echo-req (body) #:prefab) (struct echo-req (body) #:prefab)
(struct echo-resp (body) #:prefab) (struct echo-resp (body) #:prefab)

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")
(require "../demand-matcher.rkt") (require "../demand-matcher.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require "../drivers/udp.rkt") (require "../drivers/udp.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require "../drivers/websocket.rkt") (require "../drivers/websocket.rkt")
(require "../demand-matcher.rkt") (require "../demand-matcher.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect-monolithic #lang syndicate-monolithic
(require "../drivers/websocket.rkt") (require "../drivers/websocket.rkt")
(require "../demand-matcher.rkt") (require "../demand-matcher.rkt")

View File

@ -6,9 +6,9 @@
(require racket/match) (require racket/match)
(require racket/list) (require racket/list)
(require "core.rkt") (require "core.rkt")
(require "../prospect/trace.rkt") (require "../syndicate/trace.rkt")
(require "trace/stderr.rkt") (require "trace/stderr.rkt")
(require "../prospect/tset.rkt") (require "../syndicate/tset.rkt")
(provide (struct-out external-event) (provide (struct-out external-event)
send-ground-message send-ground-message

View File

@ -1,2 +1,2 @@
#lang s-exp syntax/module-reader #lang s-exp syntax/module-reader
prospect-monolithic/lang syndicate-monolithic/lang

View File

@ -16,11 +16,11 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require "../prospect/trie.rkt") (require "../syndicate/trie.rkt")
(require "scn.rkt") (require "scn.rkt")
(require "../prospect/trace.rkt") (require "../syndicate/trace.rkt")
(require "../prospect/tset.rkt") (require "../syndicate/tset.rkt")
(require "../prospect/pretty.rkt") (require "../syndicate/pretty.rkt")
;; A PID is a Nat. ;; A PID is a Nat.
;; A Label is a PID or 'meta. ;; A Label is a PID or 'meta.
@ -30,8 +30,8 @@
interest-table ;; (HashTable Label Matcher) interest-table ;; (HashTable Label Matcher)
) )
#:transparent #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print m [p (current-output-port)]) [(define (syndicate-pretty-print m [p (current-output-port)])
(pretty-print-mux m p))]) (pretty-print-mux m p))])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -17,17 +17,17 @@
(require racket/set) (require racket/set)
(require racket/match) (require racket/match)
(require "../prospect/trie.rkt") (require "../syndicate/trie.rkt")
(require "../prospect/tset.rkt") (require "../syndicate/tset.rkt")
(require "../prospect/pretty.rkt") (require "../syndicate/pretty.rkt")
(module+ test (require rackunit)) (module+ test (require rackunit))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; State Change Notifications ;; State Change Notifications
(struct scn (trie) #:transparent (struct scn (trie) #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print d [p (current-output-port)]) [(define (syndicate-pretty-print d [p (current-output-port)])
(pretty-print-trie (scn-trie d) p))]) (pretty-print-trie (scn-trie d) p))])
;; Claims, Interests, Locations, and Advertisements ;; Claims, Interests, Locations, and Advertisements

View File

@ -8,9 +8,9 @@
(require racket/exn) (require racket/exn)
(require (only-in racket/string string-join)) (require (only-in racket/string string-join))
(require "../core.rkt") (require "../core.rkt")
(require "../../prospect/trace.rkt") (require "../../syndicate/trace.rkt")
(require "../mux.rkt") (require "../mux.rkt")
(require "../../prospect/pretty.rkt") (require "../../syndicate/pretty.rkt")
(define (env-aref varname default alist) (define (env-aref varname default alist)
(define key (or (getenv varname) default)) (define key (or (getenv varname) default))
@ -118,7 +118,7 @@
(when (not (boring-state? st)) (when (not (boring-state? st))
(with-color YELLOW (with-color YELLOW
(output "~a's state just before the event:\n" pidstr) (output "~a's state just before the event:\n" pidstr)
(prospect-pretty-print st (current-error-port)))))] (syndicate-pretty-print st (current-error-port)))))]
[('process-step-result (list pids e beh st exn t)) [('process-step-result (list pids e beh st exn t))
(define pidstr (format-pids pids)) (define pidstr (format-pids pids))
(define relevant-exn? (and show-exceptions? exn)) (define relevant-exn? (and show-exceptions? exn))
@ -143,7 +143,7 @@
(when (exn-and-not (and show-process-states-pre? (not (boring-state? st)))) (when (exn-and-not (and show-process-states-pre? (not (boring-state? st))))
(with-color YELLOW (with-color YELLOW
(output "~a's state just before the event:\n" pidstr) (output "~a's state just before the event:\n" pidstr)
(prospect-pretty-print st (current-error-port)))) (syndicate-pretty-print st (current-error-port))))
(when relevant-exn? (when relevant-exn?
(with-color WHITE-ON-RED (with-color WHITE-ON-RED
(output "Process ~a ~v died with exception:\n~a\n" (output "Process ~a ~v died with exception:\n~a\n"
@ -159,7 +159,7 @@
(when (not (equal? st (transition-state t))) (when (not (equal? st (transition-state t)))
(with-color YELLOW (with-color YELLOW
(output "~a's state just after the event:\n" pidstr) (output "~a's state just after the event:\n" pidstr)
(prospect-pretty-print (transition-state t) (current-error-port)))))))] (syndicate-pretty-print (transition-state t) (current-error-port)))))))]
[('internal-action (list pids a old-w)) [('internal-action (list pids a old-w))
(define pidstr (format-pids pids)) (define pidstr (format-pids pids))
(define oldcount (hash-count (network-behaviors old-w))) (define oldcount (hash-count (network-behaviors old-w)))
@ -209,7 +209,7 @@
newcount)) newcount))
(unless (boring-state? state) (unless (boring-state? state)
(output "~a's initial state:\n" newpidstr) (output "~a's initial state:\n" newpidstr)
(prospect-pretty-print state (current-error-port))) (syndicate-pretty-print state (current-error-port)))
(unless (trie-empty? interests) (unless (trie-empty? interests)
(output "~a's initial interests:\n" newpidstr) (output "~a's initial interests:\n" newpidstr)
(pretty-print-trie interests (current-error-port))))] (pretty-print-trie interests (current-error-port))))]

View File

@ -122,8 +122,8 @@
mux ;; Mux mux ;; Mux
) )
#:transparent #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print s [p (current-output-port)]) [(define (syndicate-pretty-print s [p (current-output-port)])
(pretty-print-actor-state s p))]) (pretty-print-actor-state s p))])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -853,7 +853,7 @@
(fprintf p " - variables:\n") (fprintf p " - variables:\n")
(for ((v variables)) (for ((v variables))
(fprintf p " - ") (fprintf p " - ")
(display (indented-port-output 6 (lambda (p) (prospect-pretty-print v p)) #:first-line? #f) p) (display (indented-port-output 6 (lambda (p) (syndicate-pretty-print v p)) #:first-line? #f) p)
(newline p)) (newline p))
(fprintf p " - aggregates:\n") (fprintf p " - aggregates:\n")
(for (((index a) (in-hash aggregates))) (for (((index a) (in-hash aggregates)))
@ -861,14 +861,14 @@
(fprintf p "~a" leader) (fprintf p "~a" leader)
(display (indented-port-output #:first-line? #f (display (indented-port-output #:first-line? #f
(string-length leader) (string-length leader)
(lambda (p) (prospect-pretty-print a p))) (lambda (p) (syndicate-pretty-print a p)))
p) p)
(newline p)) (newline p))
(fprintf p " - pending-patch:\n") (fprintf p " - pending-patch:\n")
(display (indented-port-output 3 (lambda (p) (prospect-pretty-print pending-patch p))) p) (display (indented-port-output 3 (lambda (p) (syndicate-pretty-print pending-patch p))) p)
(newline p) (newline p)
(fprintf p " - ") (fprintf p " - ")
(display (indented-port-output 3 (lambda (p) (prospect-pretty-print mux p)) #:first-line? #f) p) (display (indented-port-output 3 (lambda (p) (syndicate-pretty-print mux p)) #:first-line? #f) p)
(newline p)) (newline p))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -169,7 +169,7 @@
#:height [height #f] #:height [height #f]
#:register [ip LOCALHOST] #:register [ip LOCALHOST]
#:port [port-number SQPORT] #:port [port-number SQPORT]
#:name [world-name (gensym 'prospect)] #:name [world-name (gensym 'syndicate)]
. boot-actions) . boot-actions)
(big-bang-network** width height boot-actions (big-bang-network** width height boot-actions
(on-receive (lambda (b sexps) (on-receive (lambda (b sexps)

View File

@ -111,8 +111,8 @@
states ;; (HashTable PID Any) states ;; (HashTable PID Any)
) )
#:transparent #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print w [p (current-output-port)]) [(define (syndicate-pretty-print w [p (current-output-port)])
(pretty-print-network w p))]) (pretty-print-network w p))])
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -435,12 +435,12 @@
(fprintf p " - ~a runnable pids ~a\n" (set-count runnable) (set->list runnable)) (fprintf p " - ~a runnable pids ~a\n" (set-count runnable) (set->list runnable))
(fprintf p " - ~a live processes\n" (hash-count states)) (fprintf p " - ~a live processes\n" (hash-count states))
(fprintf p " - ") (fprintf p " - ")
(display (indented-port-output 3 (lambda (p) (prospect-pretty-print mux p)) #:first-line? #f) p) (display (indented-port-output 3 (lambda (p) (syndicate-pretty-print mux p)) #:first-line? #f) p)
(newline p) (newline p)
(for ([pid (set-union (hash-keys (mux-interest-table mux)) (hash-keys states))]) (for ([pid (set-union (hash-keys (mux-interest-table mux)) (hash-keys states))])
(fprintf p " ---- process ~a, behavior ~v, STATE:\n" pid (hash-ref behaviors pid #f)) (fprintf p " ---- process ~a, behavior ~v, STATE:\n" pid (hash-ref behaviors pid #f))
(define state (hash-ref states pid #f)) (define state (hash-ref states pid #f))
(display (indented-port-output 6 (lambda (p) (prospect-pretty-print state p))) p) (display (indented-port-output 6 (lambda (p) (syndicate-pretty-print state p))) p)
(newline p) (newline p)
(fprintf p " process ~a, behavior ~v, CLAIMS:\n" pid (hash-ref behaviors pid #f)) (fprintf p " process ~a, behavior ~v, CLAIMS:\n" pid (hash-ref behaviors pid #f))
(display (indented-port-output 6 (lambda (p) (display (indented-port-output 6 (lambda (p)

View File

@ -27,8 +27,8 @@
current-demand ;; (Setof (Listof Any)) current-demand ;; (Setof (Listof Any))
current-supply) ;; (Setof (Listof Any)) current-supply) ;; (Setof (Listof Any))
#:transparent #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print s [p (current-output-port)]) [(define (syndicate-pretty-print s [p (current-output-port)])
(pretty-print-demand-matcher s p))]) (pretty-print-demand-matcher s p))])
;; A ChangeHandler is a ((Constreeof Action) Any* -> (Constreeof Action)). ;; A ChangeHandler is a ((Constreeof Action) Any* -> (Constreeof Action)).

View File

@ -30,8 +30,8 @@
state ;; Any state ;; Any
) )
#:transparent #:transparent
#:methods gen:prospect-pretty-printable #:methods gen:syndicate-pretty-printable
[(define (prospect-pretty-print g [p (current-output-port)]) [(define (syndicate-pretty-print g [p (current-output-port)])
(pretty-print-endpoint-group g p))]) (pretty-print-endpoint-group g p))])
;; A Endpoint is a (Event State -> Transition) ;; A Endpoint is a (Event State -> Transition)
@ -172,7 +172,7 @@
(match-define (endpoint-group m endpoints state) g) (match-define (endpoint-group m endpoints state) g)
(fprintf p "ENDPOINT GROUP:\n") (fprintf p "ENDPOINT GROUP:\n")
(fprintf p " ---- STATE:\n") (fprintf p " ---- STATE:\n")
(display (indented-port-output 6 (lambda (p) (prospect-pretty-print state p))) p) (display (indented-port-output 6 (lambda (p) (syndicate-pretty-print state p))) p)
(newline p) (newline p)
(fprintf p " - ~a endpoints\n" (hash-count endpoints)) (fprintf p " - ~a endpoints\n" (hash-count endpoints))
(fprintf p " - next eid: ~a\n" (mux-next-pid mux)) (fprintf p " - next eid: ~a\n" (mux-next-pid mux))

View File

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

View File

@ -1,7 +1,7 @@
#lang prospect #lang syndicate
;; Simple mutable box and count-to-infinity box client. ;; Simple mutable box and count-to-infinity box client.
(require prospect/actor) (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,7 +1,7 @@
#lang prospect #lang syndicate
(require prospect/actor) (require syndicate/actor)
(require prospect/drivers/timer) (require syndicate/drivers/timer)
(spawn-timer-driver) (spawn-timer-driver)

View File

@ -1,7 +1,7 @@
#lang prospect #lang syndicate
(require prospect/actor) (require syndicate/actor)
(require prospect/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(define local-handle (tcp-handle 'chat)) (define local-handle (tcp-handle 'chat))

View File

@ -1,7 +1,7 @@
#lang prospect #lang syndicate
(require prospect/actor) (require syndicate/actor)
(require prospect/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))
(struct says (who what) #:prefab) (struct says (who what) #:prefab)

View File

@ -1,7 +1,7 @@
#lang prospect #lang syndicate
(require prospect/actor) (require syndicate/actor)
(require prospect/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))
(struct says (who what) #:prefab) (struct says (who what) #:prefab)

View File

@ -1,7 +1,7 @@
#lang prospect #lang syndicate
(require prospect/actor) (require syndicate/actor)
(require prospect/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))
(struct tcp-remote-open (id) #:prefab) (struct tcp-remote-open (id) #:prefab)

View File

@ -1,7 +1,7 @@
#lang prospect #lang syndicate
(require prospect/actor) (require syndicate/actor)
(require prospect/drivers/tcp) (require syndicate/drivers/tcp)
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))
(struct says (who what) #:prefab) (struct says (who what) #:prefab)

View File

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

View File

@ -1,9 +1,9 @@
#lang prospect #lang syndicate
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; prospect/actor implementation, using "during" instead of "on asserted/until retracted". ;; syndicate/actor implementation, using "during" instead of "on asserted/until retracted".
(require prospect/actor) (require syndicate/actor)
(require prospect/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,10 +1,10 @@
#lang prospect #lang syndicate
;; 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 prospect [assert core:assert])) (require (only-in syndicate [assert core:assert]))
(require prospect/actor) (require syndicate/actor)
(require prospect/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))
(require racket/set) (require racket/set)

View File

@ -1,10 +1,10 @@
#lang prospect #lang syndicate
;; 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 prospect [assert core:assert])) (require (only-in syndicate [assert core:assert]))
(require prospect/actor) (require syndicate/actor)
(require prospect/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))
(require racket/set) (require racket/set)

View File

@ -1,9 +1,9 @@
#lang prospect #lang syndicate
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; prospect/actor implementation. ;; syndicate/actor implementation.
(require prospect/actor) (require syndicate/actor)
(require prospect/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,9 @@
#lang prospect #lang syndicate
;; Toy file system, based on the example in the ESOP2016 submission. ;; Toy file system, based on the example in the ESOP2016 submission.
;; prospect/actor implementation, without subconversation. ;; syndicate/actor implementation, without subconversation.
(require prospect/actor) (require syndicate/actor)
(require prospect/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))
(require racket/set) (require racket/set)

View File

@ -1,6 +1,6 @@
#lang prospect #lang syndicate
(require prospect/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,7 +1,7 @@
#lang prospect #lang syndicate
;; A toy spreadsheet model. ;; A toy spreadsheet model.
(require prospect/actor) (require syndicate/actor)
(require racket/match) (require racket/match)
(require racket/set) (require racket/set)

View File

@ -1,4 +1,4 @@
#lang prospect #lang syndicate
;; After Figure 1 in "Logic and lattices for distributed programming", ;; After Figure 1 in "Logic and lattices for distributed programming",
;; Conway et. al, UCB tech report, 2012 ;; Conway et. al, UCB tech report, 2012
;; ;;
@ -6,7 +6,7 @@
;; input. ;; input.
(require racket/set) (require racket/set)
(require prospect/actor) (require syndicate/actor)
(struct link (from to cost) #:prefab) (struct link (from to cost) #:prefab)
(struct path (from to cost) #:prefab) (struct path (from to cost) #:prefab)

View File

@ -1,11 +1,11 @@
#lang prospect #lang syndicate
;; After Figure 1 in "Logic and lattices for distributed programming", ;; After Figure 1 in "Logic and lattices for distributed programming",
;; Conway et. al, UCB tech report, 2012 ;; Conway et. al, UCB tech report, 2012
;; ;;
;; Added path-seen set to ensure termination on input cycles. ;; Added path-seen set to ensure termination on input cycles.
(require racket/set) (require racket/set)
(require prospect/actor) (require syndicate/actor)
(struct link (from to cost) #:prefab) (struct link (from to cost) #:prefab)
(struct path (from to seen cost) #:prefab) (struct path (from to seen cost) #:prefab)

View File

@ -1,4 +1,4 @@
#lang prospect #lang syndicate
;; Hello-worldish "bank account" example. ;; Hello-worldish "bank account" example.
(struct account (balance) #:prefab) (struct account (balance) #:prefab)

View File

@ -1,4 +1,4 @@
#lang prospect #lang syndicate
;; Simple mutable box and count-to-infinity box client. ;; Simple mutable box and count-to-infinity box client.
(struct set-box (new-value) #:transparent) (struct set-box (new-value) #:transparent)

View File

@ -1,4 +1,4 @@
#lang prospect #lang syndicate
(require (only-in racket/port read-bytes-line-evt)) (require (only-in racket/port read-bytes-line-evt))
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect #lang syndicate
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect #lang syndicate
(require (only-in racket/string string-trim)) (require (only-in racket/string string-trim))
(require "../drivers/tcp.rkt") (require "../drivers/tcp.rkt")

View File

@ -1,4 +1,4 @@
#lang prospect #lang syndicate
;; The chat server, using a proxy abstracting over details of the TCP ;; The chat server, using a proxy abstracting over details of the TCP
;; driver's protocol. ;; driver's protocol.

Some files were not shown because too many files have changed in this diff Show More