Rearrange for independent packages.
This commit is contained in:
parent
419e90e42f
commit
f269c02c23
|
@ -0,0 +1,22 @@
|
||||||
|
PACKAGES=syndicate syndicate-examples
|
||||||
|
COLLECTS=syndicate syndicate-examples
|
||||||
|
|
||||||
|
all: setup
|
||||||
|
|
||||||
|
clean:
|
||||||
|
find . -name compiled -type d | xargs rm -rf
|
||||||
|
find . -name '*.rkte' | xargs rm -rf
|
||||||
|
|
||||||
|
setup:
|
||||||
|
raco setup --check-pkg-deps --unused-pkg-deps $(COLLECTS)
|
||||||
|
|
||||||
|
link:
|
||||||
|
raco pkg install --link $(PACKAGES)
|
||||||
|
|
||||||
|
unlink:
|
||||||
|
raco pkg remove $(PACKAGES)
|
||||||
|
|
||||||
|
test: setup testonly
|
||||||
|
|
||||||
|
testonly:
|
||||||
|
raco test -p $(PACKAGES)
|
|
@ -0,0 +1,84 @@
|
||||||
|
# Second Racket implementation of Syndicate
|
||||||
|
|
||||||
|
## The language itself
|
||||||
|
|
||||||
|
This repository contains a [Racket](http://racket-lang.org/)
|
||||||
|
implementation of Syndicate, which includes
|
||||||
|
|
||||||
|
- the implementation of the `#lang syndicate` language, in the
|
||||||
|
[`syndicate` directory](syndicate/).
|
||||||
|
|
||||||
|
- a TCP echo server example, which listens for connections on port
|
||||||
|
5999 by default, in
|
||||||
|
[`syndicate-examples/echo.rkt`](syndicate-examples/echo.rkt).
|
||||||
|
Connect to it using, for example, `telnet localhost 5999`.
|
||||||
|
|
||||||
|
- a number of other examples both small and large, in
|
||||||
|
[`syndicate-examples/`](syndicate-examples/).
|
||||||
|
|
||||||
|
## New implementation
|
||||||
|
|
||||||
|
This is a reimplementation of Syndicate that takes the language-level
|
||||||
|
constructs of facets, endpoints, and fields to heart, integrating
|
||||||
|
knowledge of facets and endpoints into the dataspace implementation
|
||||||
|
itself.
|
||||||
|
|
||||||
|
It gains a *significant* performance advantage by doing so.
|
||||||
|
|
||||||
|
Programs seem to be about *20x faster* (compared to the
|
||||||
|
[previous implementation](https://github.com/tonyg/syndicate/tree/master/racket)).
|
||||||
|
Some are only 10x faster, some are 30x faster.
|
||||||
|
|
||||||
|
The implementation techniques herein are the subject of a forthcoming
|
||||||
|
paper. The prototype that embodies the new idea is in
|
||||||
|
[historical/prototype.rkt](historical/prototype.rkt), and
|
||||||
|
[syndicate/HOWITWORKS.md](syndicate/HOWITWORKS.md) describes the
|
||||||
|
approach via prose.
|
||||||
|
|
||||||
|
All the drivers end up looking much nicer with this new
|
||||||
|
implementation. The previously-separate GL-2D support is now
|
||||||
|
integrated as just another driver (though the timing characteristics
|
||||||
|
of the old implementation are not precisely preserved). The
|
||||||
|
[ground.rkt](syndicate/ground.rkt) implementation is much cleaner.
|
||||||
|
|
||||||
|
To see the difference in speed, try out the "many Racket logos"
|
||||||
|
animation example/demo after installing the `syndicate` and
|
||||||
|
`syndicate-examples` packages:
|
||||||
|
|
||||||
|
racket -l syndicate-examples/gl-2d-many
|
||||||
|
|
||||||
|
Hopefully you'll get a smooth 60fps, though I admit I'm running it on
|
||||||
|
a fairly fast machine so you might need to drop the `sprite-count` in
|
||||||
|
the code a bit to sustain 60fps.
|
||||||
|
|
||||||
|
## Compiling and running the code
|
||||||
|
|
||||||
|
You will need Racket version 7.6 or later.
|
||||||
|
|
||||||
|
Once you have Racket installed, run
|
||||||
|
|
||||||
|
raco pkg install syndicate
|
||||||
|
|
||||||
|
to install the package from the Racket package repository, or
|
||||||
|
|
||||||
|
raco pkg install --link syndicate
|
||||||
|
|
||||||
|
from the root directory of the Git checkout to install the package
|
||||||
|
from a local snapshot. This will make `#lang syndicate` available to
|
||||||
|
programs.
|
||||||
|
|
||||||
|
Repeat the process with `syndicate-examples` in place of `syndicate`
|
||||||
|
to install the examples as well.
|
||||||
|
|
||||||
|
Alternatively, `make link` from the root directory of the Git checkout
|
||||||
|
installs both packages from the local copy.
|
||||||
|
|
||||||
|
### Running the tests
|
||||||
|
|
||||||
|
The implementation test suite lives in [syndicate/test/](syndicate/test/). Run it with:
|
||||||
|
|
||||||
|
raco setup syndicate; raco test -p syndicate
|
||||||
|
|
||||||
|
## Copyright
|
||||||
|
|
||||||
|
Copyright © Tony Garnock-Jones 2010-2020.
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
;; Simple mutable box and count-to-infinity box client.
|
;; Simple mutable box and count-to-infinity box client.
|
||||||
|
|
||||||
(message-struct set-box (new-value))
|
(message-struct set-box (new-value))
|
|
@ -1,8 +1,8 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/tcp)
|
(require/activate syndicate/drivers/tcp)
|
||||||
(require/activate imperative-syndicate/drivers/external-event)
|
(require/activate syndicate/drivers/external-event)
|
||||||
(require/activate imperative-syndicate/reassert)
|
(require/activate syndicate/reassert)
|
||||||
(require (only-in racket/port read-bytes-line-evt))
|
(require (only-in racket/port read-bytes-line-evt))
|
||||||
|
|
||||||
(spawn (define id 'chat)
|
(spawn (define id 'chat)
|
|
@ -1,6 +1,6 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/tcp)
|
(require/activate syndicate/drivers/tcp)
|
||||||
(require racket/format)
|
(require racket/format)
|
||||||
|
|
||||||
(message-struct speak (who what))
|
(message-struct speak (who what))
|
|
@ -1,6 +1,6 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/tcp)
|
(require/activate syndicate/drivers/tcp)
|
||||||
(require racket/format)
|
(require racket/format)
|
||||||
|
|
||||||
(message-struct speak (who what))
|
(message-struct speak (who what))
|
|
@ -0,0 +1,13 @@
|
||||||
|
#lang syndicate
|
||||||
|
|
||||||
|
(require/activate syndicate/drivers/tcp)
|
||||||
|
|
||||||
|
(spawn (during/spawn (tcp-connection $id (tcp-listener 5999))
|
||||||
|
(on-start (printf "Accepted connection ~v\n" id))
|
||||||
|
(on-stop (printf "Closed connection ~v\n" id))
|
||||||
|
(assert (tcp-accepted id))
|
||||||
|
(on-start (issue-credit! (tcp-listener 5999))
|
||||||
|
(issue-credit! tcp-in id))
|
||||||
|
(on (message (tcp-in-line id $bs))
|
||||||
|
(issue-credit! tcp-in bs)
|
||||||
|
(send! (tcp-out id (bytes-append bs (bytes 13 10)))))))
|
|
@ -1,7 +1,7 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/external-event)
|
(require/activate syndicate/drivers/external-event)
|
||||||
(require/activate imperative-syndicate/drivers/filesystem)
|
(require/activate syndicate/drivers/filesystem)
|
||||||
(require racket/file)
|
(require racket/file)
|
||||||
|
|
||||||
(require (only-in racket/port read-bytes-line-evt))
|
(require (only-in racket/port read-bytes-line-evt))
|
|
@ -1,8 +1,8 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
(require 2htdp/image)
|
(require 2htdp/image)
|
||||||
(require/activate imperative-syndicate/drivers/gl-2d)
|
(require/activate syndicate/drivers/gl-2d)
|
||||||
|
|
||||||
(define (spawn-background)
|
(define (spawn-background)
|
||||||
(spawn (during (window $width $height)
|
(spawn (during (window $width $height)
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
;; Compare to "ezd" clock-face example from: J. F. Bartlett, “Don’t
|
;; Compare to "ezd" clock-face example from: J. F. Bartlett, “Don’t
|
||||||
;; Fidget with Widgets, Draw!,” Palo Alto, California, DEC WRL
|
;; Fidget with Widgets, Draw!,” Palo Alto, California, DEC WRL
|
||||||
;; Research Report 91/6, May 1991.
|
;; Research Report 91/6, May 1991.
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
(require (only-in racket/math pi))
|
(require (only-in racket/math pi))
|
||||||
(require racket/date)
|
(require racket/date)
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/gl-2d)
|
(require/activate syndicate/drivers/gl-2d)
|
||||||
|
|
||||||
(define hand
|
(define hand
|
||||||
(polygon (list (make-posn 0 0)
|
(polygon (list (make-posn 0 0)
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
;; Multiple animated sprites.
|
;; Multiple animated sprites.
|
||||||
;;
|
;;
|
||||||
;; 2018-05-01 With the new "imperative" implementation of Syndicate,
|
;; 2018-05-01 With the new "imperative" implementation of Syndicate,
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
(require 2htdp/image)
|
(require 2htdp/image)
|
||||||
(require images/logos)
|
(require images/logos)
|
||||||
(require/activate imperative-syndicate/drivers/gl-2d)
|
(require/activate syndicate/drivers/gl-2d)
|
||||||
|
|
||||||
(define speed-limit 40)
|
(define speed-limit 40)
|
||||||
(define sprite-count 135)
|
(define sprite-count 135)
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require 2htdp/image)
|
(require 2htdp/image)
|
||||||
(require 2htdp/planetcute)
|
(require 2htdp/planetcute)
|
||||||
|
@ -9,9 +9,9 @@
|
||||||
(require (only-in racket/string string-prefix?))
|
(require (only-in racket/string string-prefix?))
|
||||||
(require (only-in racket/gui/base play-sound))
|
(require (only-in racket/gui/base play-sound))
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require/activate imperative-syndicate/drivers/gl-2d)
|
(require/activate syndicate/drivers/gl-2d)
|
||||||
(require imperative-syndicate/bag)
|
(require syndicate/bag)
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Layers:
|
;; Layers:
|
||||||
|
@ -710,7 +710,7 @@
|
||||||
(texture ,scene))))))))
|
(texture ,scene))))))))
|
||||||
|
|
||||||
;; http://www.travelization.net/wp-content/uploads/2012/07/beautiful-grassland-wallpapers-1920x1080.jpg
|
;; http://www.travelization.net/wp-content/uploads/2012/07/beautiful-grassland-wallpapers-1920x1080.jpg
|
||||||
(define grassland-backdrop (bitmap "../../examples/platformer/beautiful-grassland-wallpapers-1920x1080.jpg"))
|
(define grassland-backdrop (bitmap "./private/beautiful-grassland-wallpapers-1920x1080.jpg"))
|
||||||
|
|
||||||
(define (spawn-level #:initial-player-x [initial-player-x 50]
|
(define (spawn-level #:initial-player-x [initial-player-x 50]
|
||||||
#:initial-player-y [initial-player-y 50]
|
#:initial-player-y [initial-player-y 50]
|
||||||
|
@ -799,7 +799,7 @@
|
||||||
|
|
||||||
(require racket/runtime-path)
|
(require racket/runtime-path)
|
||||||
(begin-for-declarations
|
(begin-for-declarations
|
||||||
(define-runtime-path sounds-path "../../examples/platformer/sounds"))
|
(define-runtime-path sounds-path "./private/sounds"))
|
||||||
(define (lookup-sound-file sound-number)
|
(define (lookup-sound-file sound-number)
|
||||||
(define sought-prefix (build-path sounds-path (format "~a__" sound-number)))
|
(define sought-prefix (build-path sounds-path (format "~a__" sound-number)))
|
||||||
(for/or [(filename (in-directory sounds-path))]
|
(for/or [(filename (in-directory sounds-path))]
|
|
@ -1,17 +1,17 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
(require data/order)
|
(require data/order)
|
||||||
(require srfi/19)
|
(require srfi/19)
|
||||||
(require (prefix-in i: 2htdp/image))
|
(require (prefix-in i: 2htdp/image))
|
||||||
(require (prefix-in p: pict))
|
(require (prefix-in p: pict))
|
||||||
(require syndicate-gl/affine)
|
(require syndicate/drivers/gl-2d/affine)
|
||||||
(require "layout/main.rkt")
|
(require "layout/main.rkt")
|
||||||
(require "hsv.rkt")
|
(require "hsv.rkt")
|
||||||
(require imperative-syndicate/bag)
|
(require syndicate/bag)
|
||||||
(require imperative-syndicate/pattern)
|
(require syndicate/pattern)
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/gl-2d)
|
(require/activate syndicate/drivers/gl-2d)
|
||||||
|
|
||||||
;;---------------------------------------------------------------------------
|
;;---------------------------------------------------------------------------
|
||||||
|
|
Before Width: | Height: | Size: 483 KiB After Width: | Height: | Size: 483 KiB |
Before Width: | Height: | Size: 491 KiB After Width: | Height: | Size: 491 KiB |
|
@ -0,0 +1,18 @@
|
||||||
|
#lang setup/infotab
|
||||||
|
(define collection "syndicate-examples")
|
||||||
|
|
||||||
|
(define deps '("base"
|
||||||
|
"syndicate"
|
||||||
|
"bitsyntax"
|
||||||
|
"packet-socket"
|
||||||
|
"compatibility-lib"
|
||||||
|
"data-lib"
|
||||||
|
"gui-lib"
|
||||||
|
"htdp-lib"
|
||||||
|
"images-lib"
|
||||||
|
"net-lib"
|
||||||
|
"pict-lib"
|
||||||
|
"plot-lib"
|
||||||
|
"srfi-lite-lib"))
|
||||||
|
|
||||||
|
(define build-deps '("rackunit-lib"))
|
|
@ -1,9 +1,9 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require "protocol.rkt")
|
(require "protocol.rkt")
|
||||||
(require "message.rkt")
|
(require "message.rkt")
|
||||||
|
|
||||||
(require/activate imperative-syndicate/reload)
|
(require/activate syndicate/reload)
|
||||||
|
|
||||||
(spawn #:name 'channel-factory
|
(spawn #:name 'channel-factory
|
||||||
(stop-when-reloaded)
|
(stop-when-reloaded)
|
|
@ -1,8 +1,8 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/reload)
|
(require/activate syndicate/reload)
|
||||||
(require/activate imperative-syndicate/supervise)
|
(require/activate syndicate/supervise)
|
||||||
(require/activate imperative-syndicate/drivers/config)
|
(require/activate syndicate/drivers/config)
|
||||||
|
|
||||||
(require "protocol.rkt")
|
(require "protocol.rkt")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
(require/activate imperative-syndicate/reload)
|
(require/activate syndicate/reload)
|
||||||
(spawn-reloader "config.rkt")
|
(spawn-reloader "config.rkt")
|
||||||
(spawn-reloader "session.rkt")
|
(spawn-reloader "session.rkt")
|
||||||
(spawn-reloader "channel.rkt")
|
(spawn-reloader "channel.rkt")
|
|
@ -1,9 +1,9 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require "protocol.rkt")
|
(require "protocol.rkt")
|
||||||
(require "message.rkt")
|
(require "message.rkt")
|
||||||
|
|
||||||
(require/activate imperative-syndicate/reload)
|
(require/activate syndicate/reload)
|
||||||
|
|
||||||
(spawn #:name 'greeter
|
(spawn #:name 'greeter
|
||||||
(stop-when-reloaded)
|
(stop-when-reloaded)
|
|
@ -0,0 +1,3 @@
|
||||||
|
#lang syndicate
|
||||||
|
(require/activate syndicate/reload)
|
||||||
|
(spawn-reloader "dynamic-main.rkt")
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(provide (struct-out ircd-listener)
|
(provide (struct-out ircd-listener)
|
||||||
(struct-out ircd-motd)
|
(struct-out ircd-motd)
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
(require racket/string)
|
(require racket/string)
|
||||||
|
@ -6,8 +6,8 @@
|
||||||
(require "protocol.rkt")
|
(require "protocol.rkt")
|
||||||
(require "message.rkt")
|
(require "message.rkt")
|
||||||
|
|
||||||
(require/activate imperative-syndicate/reload)
|
(require/activate syndicate/reload)
|
||||||
(require/activate imperative-syndicate/drivers/tcp)
|
(require/activate syndicate/drivers/tcp)
|
||||||
(require syndicate/support/hash)
|
(require syndicate/support/hash)
|
||||||
(require (only-in racket/list append*))
|
(require (only-in racket/list append*))
|
||||||
|
|
|
@ -6,14 +6,14 @@ This implementation is largely the same as the old-Syndicate
|
||||||
## Linux Firewall Configuration
|
## Linux Firewall Configuration
|
||||||
|
|
||||||
Imagine a setup where the machine you are running this code has IP
|
Imagine a setup where the machine you are running this code has IP
|
||||||
192.168.1.10. This code claims 192.168.1.222 for itself. Now, pinging
|
192.168.2.10. This code claims 192.168.2.222 for itself. Now, pinging
|
||||||
192.168.1.222 from some other machine, say 192.168.1.99, will cause
|
192.168.2.222 from some other machine, say 192.168.2.99, will cause
|
||||||
the local kernel to receive the pings and then *forward them on to
|
the local kernel to receive the pings and then *forward them on to
|
||||||
192.168.1.222*, which because of the gratuitous ARP announcement, it
|
192.168.2.222*, which because of the gratuitous ARP announcement, it
|
||||||
knows to be on its own Ethernet MAC address. This causes the ping
|
knows to be on its own Ethernet MAC address. This causes the ping
|
||||||
requests to repeat endlessly, each time with one lower TTL.
|
requests to repeat endlessly, each time with one lower TTL.
|
||||||
|
|
||||||
One approach to solving the problem is to prevent the kernel from
|
One approach to solving the problem is to prevent the kernel from
|
||||||
forwarding packets addressed to 192.168.1.222. To do this,
|
forwarding packets addressed to 192.168.2.222. To do this,
|
||||||
|
|
||||||
sudo iptables -I FORWARD -d 192.168.1.222 -j DROP
|
sudo iptables -I FORWARD -d 192.168.2.222 -j DROP
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
;; ARP protocol, http://tools.ietf.org/html/rfc826
|
;; ARP protocol, http://tools.ietf.org/html/rfc826
|
||||||
;; Only does ARP-over-ethernet.
|
;; Only does ARP-over-ethernet.
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
(require racket/match)
|
(require racket/match)
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require bitsyntax)
|
(require bitsyntax)
|
||||||
|
|
||||||
(require "dump-bytes.rkt")
|
(require "dump-bytes.rkt")
|
|
@ -0,0 +1,21 @@
|
||||||
|
#lang syndicate
|
||||||
|
;; Demonstration stack configuration for various hosts.
|
||||||
|
|
||||||
|
(require racket/match)
|
||||||
|
(require (only-in mzlib/os gethostname))
|
||||||
|
(require (only-in racket/string string-split))
|
||||||
|
(require "configuration.rkt")
|
||||||
|
|
||||||
|
(spawn
|
||||||
|
(match (gethostname)
|
||||||
|
[other ;; assume a private network
|
||||||
|
(define-values (interface mkaddr me gw)
|
||||||
|
(match (car (string-split other "."))
|
||||||
|
["skip" (values "en0" (lambda (v) (bytes 192 168 2 v)) 222 254)]
|
||||||
|
["leap" (values "wlp4s0" ;; wtf
|
||||||
|
(lambda (v) (bytes 192 168 2 v))
|
||||||
|
222
|
||||||
|
254)]
|
||||||
|
[_ (values "wlan0" (lambda (v) (bytes 192 168 2 v)) 222 254)]))
|
||||||
|
(assert (gateway-route (bytes 0 0 0 0) 0 (mkaddr gw) interface))
|
||||||
|
(assert (host-route (mkaddr me) 24 interface))]))
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
;; Ethernet driver
|
;; Ethernet driver
|
||||||
|
|
||||||
(provide (struct-out available-ethernet-interface)
|
(provide (struct-out available-ethernet-interface)
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
broadcast-ethernet-address
|
broadcast-ethernet-address
|
||||||
ethernet-packet-pattern)
|
ethernet-packet-pattern)
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
(require racket/match)
|
(require racket/match)
|
||||||
(require racket/async-channel)
|
(require racket/async-channel)
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
(require "configuration.rkt")
|
(require "configuration.rkt")
|
||||||
(require "dump-bytes.rkt")
|
(require "dump-bytes.rkt")
|
||||||
(require imperative-syndicate/pattern-expander)
|
(require syndicate/pattern-expander)
|
||||||
|
|
||||||
(assertion-struct available-ethernet-interface (name))
|
(assertion-struct available-ethernet-interface (name))
|
||||||
(assertion-struct ethernet-interface (name hwaddr))
|
(assertion-struct ethernet-interface (name hwaddr))
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate "ethernet.rkt")
|
(require/activate "ethernet.rkt")
|
||||||
(require/activate "arp.rkt")
|
(require/activate "arp.rkt")
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(provide (struct-out ip-packet)
|
(provide (struct-out ip-packet)
|
||||||
ip-address->hostname
|
ip-address->hostname
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
(require "configuration.rkt")
|
(require "configuration.rkt")
|
||||||
(require "checksum.rkt")
|
(require "checksum.rkt")
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require/activate "ethernet.rkt")
|
(require/activate "ethernet.rkt")
|
||||||
(require/activate "arp.rkt")
|
(require/activate "arp.rkt")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require/activate "ethernet.rkt")
|
(require/activate "ethernet.rkt")
|
||||||
(require/activate "arp.rkt")
|
(require/activate "arp.rkt")
|
||||||
(require/activate "ip.rkt")
|
(require/activate "ip.rkt")
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
;; UDP/TCP port allocator
|
;; UDP/TCP port allocator
|
||||||
|
|
||||||
(provide spawn-port-allocator
|
(provide spawn-port-allocator
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(provide (struct-out tcp-connection)
|
(provide (struct-out tcp-connection)
|
||||||
(struct-out tcp-accepted)
|
(struct-out tcp-accepted)
|
||||||
|
@ -18,7 +18,7 @@
|
||||||
(require "dump-bytes.rkt")
|
(require "dump-bytes.rkt")
|
||||||
(require "checksum.rkt")
|
(require "checksum.rkt")
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require "ip.rkt")
|
(require "ip.rkt")
|
||||||
(require "port-allocator.rkt")
|
(require "port-allocator.rkt")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(provide (struct-out udp-remote-address)
|
(provide (struct-out udp-remote-address)
|
||||||
(struct-out udp-handle)
|
(struct-out udp-handle)
|
Binary file not shown.
After Width: | Height: | Size: 250 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,140 @@
|
||||||
|
Sound pack downloaded from Freesound.org
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
This pack of sounds contains sounds by LittleRobotSoundFactory ( https://www.freesound.org/people/LittleRobotSoundFactory/ )
|
||||||
|
You can find this pack online at: https://www.freesound.org/people/LittleRobotSoundFactory/packs/16681/
|
||||||
|
|
||||||
|
|
||||||
|
License details
|
||||||
|
---------------
|
||||||
|
|
||||||
|
Sampling+: http://creativecommons.org/licenses/sampling+/1.0/
|
||||||
|
Creative Commons 0: http://creativecommons.org/publicdomain/zero/1.0/
|
||||||
|
Attribution: http://creativecommons.org/licenses/by/3.0/
|
||||||
|
Attribution Noncommercial: http://creativecommons.org/licenses/by-nc/3.0/
|
||||||
|
|
||||||
|
|
||||||
|
Sounds in this pack
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
* 270344__littlerobotsoundfactory__shoot-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270344/
|
||||||
|
* license: Attribution
|
||||||
|
* 270343__littlerobotsoundfactory__shoot-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270343/
|
||||||
|
* license: Attribution
|
||||||
|
* 270342__littlerobotsoundfactory__pickup-03.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270342/
|
||||||
|
* license: Attribution
|
||||||
|
* 270341__littlerobotsoundfactory__pickup-04.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270341/
|
||||||
|
* license: Attribution
|
||||||
|
* 270340__littlerobotsoundfactory__pickup-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270340/
|
||||||
|
* license: Attribution
|
||||||
|
* 270339__littlerobotsoundfactory__pickup-02.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270339/
|
||||||
|
* license: Attribution
|
||||||
|
* 270338__littlerobotsoundfactory__open-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270338/
|
||||||
|
* license: Attribution
|
||||||
|
* 270337__littlerobotsoundfactory__pickup-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270337/
|
||||||
|
* license: Attribution
|
||||||
|
* 270336__littlerobotsoundfactory__shoot-02.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270336/
|
||||||
|
* license: Attribution
|
||||||
|
* 270335__littlerobotsoundfactory__shoot-03.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270335/
|
||||||
|
* license: Attribution
|
||||||
|
* 270334__littlerobotsoundfactory__jingle-lose-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270334/
|
||||||
|
* license: Attribution
|
||||||
|
* 270333__littlerobotsoundfactory__jingle-win-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270333/
|
||||||
|
* license: Attribution
|
||||||
|
* 270332__littlerobotsoundfactory__hit-03.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270332/
|
||||||
|
* license: Attribution
|
||||||
|
* 270331__littlerobotsoundfactory__jingle-achievement-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270331/
|
||||||
|
* license: Attribution
|
||||||
|
* 270330__littlerobotsoundfactory__jingle-achievement-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270330/
|
||||||
|
* license: Attribution
|
||||||
|
* 270329__littlerobotsoundfactory__jingle-lose-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270329/
|
||||||
|
* license: Attribution
|
||||||
|
* 270328__littlerobotsoundfactory__hero-death-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270328/
|
||||||
|
* license: Attribution
|
||||||
|
* 270327__littlerobotsoundfactory__hit-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270327/
|
||||||
|
* license: Attribution
|
||||||
|
* 270326__littlerobotsoundfactory__hit-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270326/
|
||||||
|
* license: Attribution
|
||||||
|
* 270325__littlerobotsoundfactory__hit-02.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270325/
|
||||||
|
* license: Attribution
|
||||||
|
* 270324__littlerobotsoundfactory__menu-navigate-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270324/
|
||||||
|
* license: Attribution
|
||||||
|
* 270323__littlerobotsoundfactory__jump-03.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270323/
|
||||||
|
* license: Attribution
|
||||||
|
* 270322__littlerobotsoundfactory__menu-navigate-02.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270322/
|
||||||
|
* license: Attribution
|
||||||
|
* 270321__littlerobotsoundfactory__menu-navigate-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270321/
|
||||||
|
* license: Attribution
|
||||||
|
* 270320__littlerobotsoundfactory__jump-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270320/
|
||||||
|
* license: Attribution
|
||||||
|
* 270319__littlerobotsoundfactory__jingle-win-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270319/
|
||||||
|
* license: Attribution
|
||||||
|
* 270318__littlerobotsoundfactory__jump-02.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270318/
|
||||||
|
* license: Attribution
|
||||||
|
* 270317__littlerobotsoundfactory__jump-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270317/
|
||||||
|
* license: Attribution
|
||||||
|
* 270316__littlerobotsoundfactory__open-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270316/
|
||||||
|
* license: Attribution
|
||||||
|
* 270315__littlerobotsoundfactory__menu-navigate-03.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270315/
|
||||||
|
* license: Attribution
|
||||||
|
* 270311__littlerobotsoundfactory__explosion-03.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270311/
|
||||||
|
* license: Attribution
|
||||||
|
* 270310__littlerobotsoundfactory__explosion-04.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270310/
|
||||||
|
* license: Attribution
|
||||||
|
* 270309__littlerobotsoundfactory__craft-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270309/
|
||||||
|
* license: Attribution
|
||||||
|
* 270308__littlerobotsoundfactory__explosion-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270308/
|
||||||
|
* license: Attribution
|
||||||
|
* 270307__littlerobotsoundfactory__explosion-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270307/
|
||||||
|
* license: Attribution
|
||||||
|
* 270306__littlerobotsoundfactory__explosion-02.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270306/
|
||||||
|
* license: Attribution
|
||||||
|
* 270305__littlerobotsoundfactory__climb-rope-loop-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270305/
|
||||||
|
* license: Attribution
|
||||||
|
* 270304__littlerobotsoundfactory__collect-point-00.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270304/
|
||||||
|
* license: Attribution
|
||||||
|
* 270303__littlerobotsoundfactory__collect-point-01.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270303/
|
||||||
|
* license: Attribution
|
||||||
|
* 270302__littlerobotsoundfactory__collect-point-02.wav
|
||||||
|
* url: https://www.freesound.org/people/LittleRobotSoundFactory/sounds/270302/
|
||||||
|
* license: Attribution
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
;; Santa Claus Problem
|
;; Santa Claus Problem
|
||||||
;; https://www.schoolofhaskell.com/school/advanced-haskell/beautiful-concurrency/4-the-santa-claus-problem
|
;; https://www.schoolofhaskell.com/school/advanced-haskell/beautiful-concurrency/4-the-santa-claus-problem
|
||||||
;; https://arxiv.org/pdf/1810.09613.pdf
|
;; https://arxiv.org/pdf/1810.09613.pdf
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require racket/list)
|
(require racket/list)
|
||||||
(require racket/set)
|
(require racket/set)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/distributed)
|
(require/activate syndicate/distributed)
|
||||||
(require/activate imperative-syndicate/drivers/external-event)
|
(require/activate syndicate/drivers/external-event)
|
||||||
(require (only-in racket/port read-line-evt))
|
(require (only-in racket/port read-line-evt))
|
||||||
|
|
||||||
(assertion-struct Present (name))
|
(assertion-struct Present (name))
|
|
@ -1,4 +1,4 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(assertion-struct greeting (text))
|
(assertion-struct greeting (text))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/sqlite)
|
(require/activate syndicate/drivers/sqlite)
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
|
|
||||||
(define PATH "t.sqlite")
|
(define PATH "t.sqlite")
|
||||||
(define DB (sqlite-db PATH))
|
(define DB (sqlite-db PATH))
|
|
@ -1,6 +1,6 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/external-event)
|
(require/activate syndicate/drivers/external-event)
|
||||||
(require (only-in racket/port read-bytes-line-evt))
|
(require (only-in racket/port read-bytes-line-evt))
|
||||||
|
|
||||||
(spawn (define stdin-evt (read-bytes-line-evt (current-input-port) 'any))
|
(spawn (define stdin-evt (read-bytes-line-evt (current-input-port) 'any))
|
|
@ -1,6 +1,6 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
|
|
||||||
(spawn #:name 'plain-timer-demo
|
(spawn #:name 'plain-timer-demo
|
||||||
(field [count 0])
|
(field [count 0])
|
|
@ -1,6 +1,6 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/udp)
|
(require/activate syndicate/drivers/udp)
|
||||||
|
|
||||||
(spawn (define s (udp-listener 5999))
|
(spawn (define s (udp-listener 5999))
|
||||||
(during s
|
(during s
|
|
@ -1,7 +1,7 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
(require/activate imperative-syndicate/drivers/udp)
|
(require/activate syndicate/drivers/udp)
|
||||||
(require racket/random file/sha1)
|
(require racket/random file/sha1)
|
||||||
|
|
||||||
;; IANA offers guidelines for choosing multicast addresses [1].
|
;; IANA offers guidelines for choosing multicast addresses [1].
|
|
@ -1,7 +1,7 @@
|
||||||
#lang imperative-syndicate
|
#lang syndicate
|
||||||
|
|
||||||
(require/activate imperative-syndicate/drivers/web)
|
(require/activate syndicate/drivers/web)
|
||||||
(require/activate imperative-syndicate/drivers/timer)
|
(require/activate syndicate/drivers/timer)
|
||||||
|
|
||||||
(define server (http-server "localhost" 8081 #f))
|
(define server (http-server "localhost" 8081 #f))
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue