Browse Source

Rearrange for independent packages.

fruit
Tony Garnock-Jones 1 year ago
parent
commit
f269c02c23
  1. 0
      .gitignore
  2. 22
      Makefile
  3. 84
      README.md
  4. 0
      historical/prototype.rkt
  5. 2
      syndicate-examples/box-and-client.rkt
  6. 8
      syndicate-examples/chat-client.rkt
  7. 4
      syndicate-examples/chat-server-nested-dataspace.rkt
  8. 4
      syndicate-examples/chat-server.rkt
  9. 13
      syndicate-examples/echo.rkt
  10. 6
      syndicate-examples/filesystem.rkt
  11. 4
      syndicate-examples/gl-2d-basic.rkt
  12. 4
      syndicate-examples/gl-2d-clock-face.rkt
  13. 4
      syndicate-examples/gl-2d-many.rkt
  14. 12
      syndicate-examples/gl-2d-platformer.rkt
  15. 0
      syndicate-examples/gui/README.md
  16. 10
      syndicate-examples/gui/gui.rkt
  17. 0
      syndicate-examples/gui/hsv.rkt
  18. 0
      syndicate-examples/gui/layout/layout.rkt
  19. 0
      syndicate-examples/gui/layout/main.rkt
  20. 0
      syndicate-examples/gui/layout/sizing.rkt
  21. 0
      syndicate-examples/gui/oakura-beach-20081225.jpg
  22. 0
      syndicate-examples/gui/syndicate-gui-snapshot.png
  23. 18
      syndicate-examples/info.rkt
  24. 0
      syndicate-examples/ircd/Makefile
  25. 4
      syndicate-examples/ircd/channel.rkt
  26. 8
      syndicate-examples/ircd/config.rkt
  27. 4
      syndicate-examples/ircd/dynamic-main.rkt
  28. 4
      syndicate-examples/ircd/greeter.rkt
  29. 0
      syndicate-examples/ircd/ircd-config.rktd
  30. 0
      syndicate-examples/ircd/irssi-config
  31. 3
      syndicate-examples/ircd/main.rkt
  32. 0
      syndicate-examples/ircd/message.rkt
  33. 2
      syndicate-examples/ircd/protocol.rkt
  34. 6
      syndicate-examples/ircd/session.rkt
  35. 0
      syndicate-examples/netstack/Makefile
  36. 10
      syndicate-examples/netstack/README.md
  37. 0
      syndicate-examples/netstack/TODO.md
  38. 4
      syndicate-examples/netstack/arp.rkt
  39. 0
      syndicate-examples/netstack/checksum.rkt
  40. 0
      syndicate-examples/netstack/configuration.rkt
  41. 21
      syndicate-examples/netstack/demo-config.rkt
  42. 0
      syndicate-examples/netstack/dump-bytes.rkt
  43. 6
      syndicate-examples/netstack/ethernet.rkt
  44. 2
      syndicate-examples/netstack/fetchurl.rkt
  45. 4
      syndicate-examples/netstack/ip.rkt
  46. 4
      syndicate-examples/netstack/main.rkt
  47. 2
      syndicate-examples/netstack/port-allocator.rkt
  48. 4
      syndicate-examples/netstack/tcp.rkt
  49. 2
      syndicate-examples/netstack/udp.rkt
  50. BIN
      syndicate-examples/private/beautiful-grassland-wallpapers-1920x1080.jpg
  51. BIN
      syndicate-examples/private/sounds/270302__littlerobotsoundfactory__collect-point-02.wav
  52. BIN
      syndicate-examples/private/sounds/270303__littlerobotsoundfactory__collect-point-01.wav
  53. BIN
      syndicate-examples/private/sounds/270304__littlerobotsoundfactory__collect-point-00.wav
  54. BIN
      syndicate-examples/private/sounds/270305__littlerobotsoundfactory__climb-rope-loop-00.wav
  55. BIN
      syndicate-examples/private/sounds/270306__littlerobotsoundfactory__explosion-02.wav
  56. BIN
      syndicate-examples/private/sounds/270307__littlerobotsoundfactory__explosion-01.wav
  57. BIN
      syndicate-examples/private/sounds/270308__littlerobotsoundfactory__explosion-00.wav
  58. BIN
      syndicate-examples/private/sounds/270309__littlerobotsoundfactory__craft-00.wav
  59. BIN
      syndicate-examples/private/sounds/270310__littlerobotsoundfactory__explosion-04.wav
  60. BIN
      syndicate-examples/private/sounds/270311__littlerobotsoundfactory__explosion-03.wav
  61. BIN
      syndicate-examples/private/sounds/270315__littlerobotsoundfactory__menu-navigate-03.wav
  62. BIN
      syndicate-examples/private/sounds/270316__littlerobotsoundfactory__open-00.wav
  63. BIN
      syndicate-examples/private/sounds/270317__littlerobotsoundfactory__jump-01.wav
  64. BIN
      syndicate-examples/private/sounds/270318__littlerobotsoundfactory__jump-02.wav
  65. BIN
      syndicate-examples/private/sounds/270319__littlerobotsoundfactory__jingle-win-01.wav
  66. BIN
      syndicate-examples/private/sounds/270320__littlerobotsoundfactory__jump-00.wav
  67. BIN
      syndicate-examples/private/sounds/270321__littlerobotsoundfactory__menu-navigate-01.wav
  68. BIN
      syndicate-examples/private/sounds/270322__littlerobotsoundfactory__menu-navigate-02.wav
  69. BIN
      syndicate-examples/private/sounds/270323__littlerobotsoundfactory__jump-03.wav
  70. BIN
      syndicate-examples/private/sounds/270324__littlerobotsoundfactory__menu-navigate-00.wav
  71. BIN
      syndicate-examples/private/sounds/270325__littlerobotsoundfactory__hit-02.wav
  72. BIN
      syndicate-examples/private/sounds/270326__littlerobotsoundfactory__hit-01.wav
  73. BIN
      syndicate-examples/private/sounds/270327__littlerobotsoundfactory__hit-00.wav
  74. BIN
      syndicate-examples/private/sounds/270328__littlerobotsoundfactory__hero-death-00.wav
  75. BIN
      syndicate-examples/private/sounds/270329__littlerobotsoundfactory__jingle-lose-00.wav
  76. BIN
      syndicate-examples/private/sounds/270330__littlerobotsoundfactory__jingle-achievement-01.wav
  77. BIN
      syndicate-examples/private/sounds/270331__littlerobotsoundfactory__jingle-achievement-00.wav
  78. BIN
      syndicate-examples/private/sounds/270332__littlerobotsoundfactory__hit-03.wav
  79. BIN
      syndicate-examples/private/sounds/270333__littlerobotsoundfactory__jingle-win-00.wav
  80. BIN
      syndicate-examples/private/sounds/270334__littlerobotsoundfactory__jingle-lose-01.wav
  81. BIN
      syndicate-examples/private/sounds/270335__littlerobotsoundfactory__shoot-03.wav
  82. BIN
      syndicate-examples/private/sounds/270336__littlerobotsoundfactory__shoot-02.wav
  83. BIN
      syndicate-examples/private/sounds/270337__littlerobotsoundfactory__pickup-00.wav
  84. BIN
      syndicate-examples/private/sounds/270338__littlerobotsoundfactory__open-01.wav
  85. BIN
      syndicate-examples/private/sounds/270339__littlerobotsoundfactory__pickup-02.wav
  86. BIN
      syndicate-examples/private/sounds/270340__littlerobotsoundfactory__pickup-01.wav
  87. BIN
      syndicate-examples/private/sounds/270341__littlerobotsoundfactory__pickup-04.wav
  88. BIN
      syndicate-examples/private/sounds/270342__littlerobotsoundfactory__pickup-03.wav
  89. BIN
      syndicate-examples/private/sounds/270343__littlerobotsoundfactory__shoot-01.wav
  90. BIN
      syndicate-examples/private/sounds/270344__littlerobotsoundfactory__shoot-00.wav
  91. 140
      syndicate-examples/private/sounds/_readme_and_license.txt
  92. 4
      syndicate-examples/santa.rkt
  93. 6
      syndicate-examples/server-chat-client.rkt
  94. 2
      syndicate-examples/simple-cross-layer.rkt
  95. 6
      syndicate-examples/sqlite.rkt
  96. 4
      syndicate-examples/stdin-echo.rkt
  97. 4
      syndicate-examples/time.rkt
  98. 4
      syndicate-examples/udp-echo.rkt
  99. 6
      syndicate-examples/udp-multicast.rkt
  100. 6
      syndicate-examples/web-core.rkt

0
syndicate/.gitignore → .gitignore

22
Makefile

@ -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)

84
README.md

@ -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.

0
syndicate/prototype.rkt → historical/prototype.rkt

2
syndicate/examples/box-and-client.rkt → syndicate-examples/box-and-client.rkt

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

8
syndicate/examples/chat-client.rkt → syndicate-examples/chat-client.rkt

@ -1,8 +1,8 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/drivers/tcp)
(require/activate imperative-syndicate/drivers/external-event)
(require/activate imperative-syndicate/reassert)
(require/activate syndicate/drivers/tcp)
(require/activate syndicate/drivers/external-event)
(require/activate syndicate/reassert)
(require (only-in racket/port read-bytes-line-evt))
(spawn (define id 'chat)

4
syndicate/examples/chat-server-nested-dataspace.rkt → syndicate-examples/chat-server-nested-dataspace.rkt

@ -1,6 +1,6 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/drivers/tcp)
(require/activate syndicate/drivers/tcp)
(require racket/format)
(message-struct speak (who what))

4
syndicate/examples/chat-server.rkt → syndicate-examples/chat-server.rkt

@ -1,6 +1,6 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/drivers/tcp)
(require/activate syndicate/drivers/tcp)
(require racket/format)
(message-struct speak (who what))

13
syndicate-examples/echo.rkt

@ -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)))))))

6
syndicate/examples/filesystem.rkt → syndicate-examples/filesystem.rkt

@ -1,7 +1,7 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/drivers/external-event)
(require/activate imperative-syndicate/drivers/filesystem)
(require/activate syndicate/drivers/external-event)
(require/activate syndicate/drivers/filesystem)
(require racket/file)
(require (only-in racket/port read-bytes-line-evt))

4
syndicate/examples/gl-2d-basic.rkt → syndicate-examples/gl-2d-basic.rkt

@ -1,8 +1,8 @@
#lang imperative-syndicate
#lang syndicate
(require racket/set)
(require 2htdp/image)
(require/activate imperative-syndicate/drivers/gl-2d)
(require/activate syndicate/drivers/gl-2d)
(define (spawn-background)
(spawn (during (window $width $height)

4
syndicate/examples/gl-2d-clock-face.rkt → syndicate-examples/gl-2d-clock-face.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
;; Compare to "ezd" clock-face example from: J. F. Bartlett, “Don’t
;; Fidget with Widgets, Draw!,” Palo Alto, California, DEC WRL
;; Research Report 91/6, May 1991.
@ -8,7 +8,7 @@
(require (only-in racket/math pi))
(require racket/date)
(require/activate imperative-syndicate/drivers/gl-2d)
(require/activate syndicate/drivers/gl-2d)
(define hand
(polygon (list (make-posn 0 0)

4
syndicate/examples/gl-2d-many.rkt → syndicate-examples/gl-2d-many.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
;; Multiple animated sprites.
;;
;; 2018-05-01 With the new "imperative" implementation of Syndicate,
@ -18,7 +18,7 @@
(require 2htdp/image)
(require images/logos)
(require/activate imperative-syndicate/drivers/gl-2d)
(require/activate syndicate/drivers/gl-2d)
(define speed-limit 40)
(define sprite-count 135)

12
syndicate/examples/gl-2d-platformer.rkt → syndicate-examples/gl-2d-platformer.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(require 2htdp/image)
(require 2htdp/planetcute)
@ -9,9 +9,9 @@
(require (only-in racket/string string-prefix?))
(require (only-in racket/gui/base play-sound))
(require/activate imperative-syndicate/drivers/timer)
(require/activate imperative-syndicate/drivers/gl-2d)
(require imperative-syndicate/bag)
(require/activate syndicate/drivers/timer)
(require/activate syndicate/drivers/gl-2d)
(require syndicate/bag)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Layers:
@ -710,7 +710,7 @@
(texture ,scene))))))))
;; 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]
#:initial-player-y [initial-player-y 50]
@ -799,7 +799,7 @@
(require racket/runtime-path)
(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 sought-prefix (build-path sounds-path (format "~a__" sound-number)))
(for/or [(filename (in-directory sounds-path))]

0
syndicate/examples/gui/README.md → syndicate-examples/gui/README.md

10
syndicate/examples/gui/gui.rkt → syndicate-examples/gui/gui.rkt

@ -1,17 +1,17 @@
#lang imperative-syndicate
#lang syndicate
(require racket/set)
(require data/order)
(require srfi/19)
(require (prefix-in i: 2htdp/image))
(require (prefix-in p: pict))
(require syndicate-gl/affine)
(require syndicate/drivers/gl-2d/affine)
(require "layout/main.rkt")
(require "hsv.rkt")
(require imperative-syndicate/bag)
(require imperative-syndicate/pattern)
(require syndicate/bag)
(require syndicate/pattern)
(require/activate imperative-syndicate/drivers/gl-2d)
(require/activate syndicate/drivers/gl-2d)
;;---------------------------------------------------------------------------

0
syndicate/examples/gui/hsv.rkt → syndicate-examples/gui/hsv.rkt

0
syndicate/examples/gui/layout/layout.rkt → syndicate-examples/gui/layout/layout.rkt

0
syndicate/examples/gui/layout/main.rkt → syndicate-examples/gui/layout/main.rkt

0
syndicate/examples/gui/layout/sizing.rkt → syndicate-examples/gui/layout/sizing.rkt

0
syndicate/examples/gui/oakura-beach-20081225.jpg → syndicate-examples/gui/oakura-beach-20081225.jpg

Before

Width: 1920  |  Height: 1440  |  Size: 483 KiB

After

Width: 1920  |  Height: 1440  |  Size: 483 KiB

0
syndicate/examples/gui/syndicate-gui-snapshot.png → syndicate-examples/gui/syndicate-gui-snapshot.png

Before

Width: 851  |  Height: 646  |  Size: 491 KiB

After

Width: 851  |  Height: 646  |  Size: 491 KiB

18
syndicate-examples/info.rkt

@ -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"))

0
syndicate/examples/ircd/Makefile → syndicate-examples/ircd/Makefile

4
syndicate/examples/ircd/channel.rkt → syndicate-examples/ircd/channel.rkt

@ -1,9 +1,9 @@
#lang imperative-syndicate
#lang syndicate
(require "protocol.rkt")
(require "message.rkt")
(require/activate imperative-syndicate/reload)
(require/activate syndicate/reload)
(spawn #:name 'channel-factory
(stop-when-reloaded)

8
syndicate/examples/ircd/config.rkt → syndicate-examples/ircd/config.rkt

@ -1,8 +1,8 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/reload)
(require/activate imperative-syndicate/supervise)
(require/activate imperative-syndicate/drivers/config)
(require/activate syndicate/reload)
(require/activate syndicate/supervise)
(require/activate syndicate/drivers/config)
(require "protocol.rkt")

4
syndicate/examples/ircd/dynamic-main.rkt → syndicate-examples/ircd/dynamic-main.rkt

@ -1,5 +1,5 @@
#lang imperative-syndicate
(require/activate imperative-syndicate/reload)
#lang syndicate
(require/activate syndicate/reload)
(spawn-reloader "config.rkt")
(spawn-reloader "session.rkt")
(spawn-reloader "channel.rkt")

4
syndicate/examples/ircd/greeter.rkt → syndicate-examples/ircd/greeter.rkt

@ -1,9 +1,9 @@
#lang imperative-syndicate
#lang syndicate
(require "protocol.rkt")
(require "message.rkt")
(require/activate imperative-syndicate/reload)
(require/activate syndicate/reload)
(spawn #:name 'greeter
(stop-when-reloaded)

0
syndicate/examples/ircd/ircd-config.rktd → syndicate-examples/ircd/ircd-config.rktd

0
syndicate/examples/ircd/irssi-config → syndicate-examples/ircd/irssi-config

3
syndicate-examples/ircd/main.rkt

@ -0,0 +1,3 @@
#lang syndicate
(require/activate syndicate/reload)
(spawn-reloader "dynamic-main.rkt")

0
syndicate/examples/ircd/message.rkt → syndicate-examples/ircd/message.rkt

2
syndicate/examples/ircd/protocol.rkt → syndicate-examples/ircd/protocol.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(provide (struct-out ircd-listener)
(struct-out ircd-motd)

6
syndicate/examples/ircd/session.rkt → syndicate-examples/ircd/session.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(require racket/set)
(require racket/string)
@ -6,8 +6,8 @@
(require "protocol.rkt")
(require "message.rkt")
(require/activate imperative-syndicate/reload)
(require/activate imperative-syndicate/drivers/tcp)
(require/activate syndicate/reload)
(require/activate syndicate/drivers/tcp)
(require syndicate/support/hash)
(require (only-in racket/list append*))

0
syndicate/examples/netstack/Makefile → syndicate-examples/netstack/Makefile

10
syndicate/examples/netstack/README.md → syndicate-examples/netstack/README.md

@ -6,14 +6,14 @@ This implementation is largely the same as the old-Syndicate
## Linux Firewall Configuration
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.1.222 from some other machine, say 192.168.1.99, will cause
192.168.2.10. This code claims 192.168.2.222 for itself. Now, pinging
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
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
requests to repeat endlessly, each time with one lower TTL.
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

0
syndicate/examples/netstack/TODO.md → syndicate-examples/netstack/TODO.md

4
syndicate/examples/netstack/arp.rkt → syndicate-examples/netstack/arp.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
;; ARP protocol, http://tools.ietf.org/html/rfc826
;; Only does ARP-over-ethernet.
@ -8,7 +8,7 @@
(require racket/set)
(require racket/match)
(require/activate imperative-syndicate/drivers/timer)
(require/activate syndicate/drivers/timer)
(require bitsyntax)
(require "dump-bytes.rkt")

0
syndicate/examples/netstack/checksum.rkt → syndicate-examples/netstack/checksum.rkt

0
syndicate/examples/netstack/configuration.rkt → syndicate-examples/netstack/configuration.rkt

21
syndicate-examples/netstack/demo-config.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))]))

0
syndicate/examples/netstack/dump-bytes.rkt → syndicate-examples/netstack/dump-bytes.rkt

6
syndicate/examples/netstack/ethernet.rkt → syndicate-examples/netstack/ethernet.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
;; Ethernet driver
(provide (struct-out available-ethernet-interface)
@ -8,7 +8,7 @@
broadcast-ethernet-address
ethernet-packet-pattern)
(require/activate imperative-syndicate/drivers/timer)
(require/activate syndicate/drivers/timer)
(require racket/set)
(require racket/match)
(require racket/async-channel)
@ -18,7 +18,7 @@
(require "configuration.rkt")
(require "dump-bytes.rkt")
(require imperative-syndicate/pattern-expander)
(require syndicate/pattern-expander)
(assertion-struct available-ethernet-interface (name))
(assertion-struct ethernet-interface (name hwaddr))

2
syndicate/examples/netstack/fetchurl.rkt → syndicate-examples/netstack/fetchurl.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(require/activate "ethernet.rkt")
(require/activate "arp.rkt")

4
syndicate/examples/netstack/ip.rkt → syndicate-examples/netstack/ip.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(provide (struct-out ip-packet)
ip-address->hostname
@ -17,7 +17,7 @@
(require "configuration.rkt")
(require "checksum.rkt")
(require/activate imperative-syndicate/drivers/timer)
(require/activate syndicate/drivers/timer)
(require/activate "ethernet.rkt")
(require/activate "arp.rkt")

4
syndicate/examples/netstack/main.rkt → syndicate-examples/netstack/main.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 "arp.rkt")
(require/activate "ip.rkt")

2
syndicate/examples/netstack/port-allocator.rkt → syndicate-examples/netstack/port-allocator.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
;; UDP/TCP port allocator
(provide spawn-port-allocator

4
syndicate/examples/netstack/tcp.rkt → syndicate-examples/netstack/tcp.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(provide (struct-out tcp-connection)
(struct-out tcp-accepted)
@ -18,7 +18,7 @@
(require "dump-bytes.rkt")
(require "checksum.rkt")
(require/activate imperative-syndicate/drivers/timer)
(require/activate syndicate/drivers/timer)
(require "ip.rkt")
(require "port-allocator.rkt")

2
syndicate/examples/netstack/udp.rkt → syndicate-examples/netstack/udp.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(provide (struct-out udp-remote-address)
(struct-out udp-handle)

BIN
syndicate-examples/private/beautiful-grassland-wallpapers-1920x1080.jpg

After

Width: 1920  |  Height: 1080  |  Size: 250 KiB

BIN
syndicate-examples/private/sounds/270302__littlerobotsoundfactory__collect-point-02.wav

BIN
syndicate-examples/private/sounds/270303__littlerobotsoundfactory__collect-point-01.wav

BIN
syndicate-examples/private/sounds/270304__littlerobotsoundfactory__collect-point-00.wav

BIN
syndicate-examples/private/sounds/270305__littlerobotsoundfactory__climb-rope-loop-00.wav

BIN
syndicate-examples/private/sounds/270306__littlerobotsoundfactory__explosion-02.wav

BIN
syndicate-examples/private/sounds/270307__littlerobotsoundfactory__explosion-01.wav

BIN
syndicate-examples/private/sounds/270308__littlerobotsoundfactory__explosion-00.wav

BIN
syndicate-examples/private/sounds/270309__littlerobotsoundfactory__craft-00.wav

BIN
syndicate-examples/private/sounds/270310__littlerobotsoundfactory__explosion-04.wav

BIN
syndicate-examples/private/sounds/270311__littlerobotsoundfactory__explosion-03.wav

BIN
syndicate-examples/private/sounds/270315__littlerobotsoundfactory__menu-navigate-03.wav

BIN
syndicate-examples/private/sounds/270316__littlerobotsoundfactory__open-00.wav

BIN
syndicate-examples/private/sounds/270317__littlerobotsoundfactory__jump-01.wav

BIN
syndicate-examples/private/sounds/270318__littlerobotsoundfactory__jump-02.wav

BIN
syndicate-examples/private/sounds/270319__littlerobotsoundfactory__jingle-win-01.wav

BIN
syndicate-examples/private/sounds/270320__littlerobotsoundfactory__jump-00.wav

BIN
syndicate-examples/private/sounds/270321__littlerobotsoundfactory__menu-navigate-01.wav

BIN
syndicate-examples/private/sounds/270322__littlerobotsoundfactory__menu-navigate-02.wav

BIN
syndicate-examples/private/sounds/270323__littlerobotsoundfactory__jump-03.wav

BIN
syndicate-examples/private/sounds/270324__littlerobotsoundfactory__menu-navigate-00.wav

BIN
syndicate-examples/private/sounds/270325__littlerobotsoundfactory__hit-02.wav

BIN
syndicate-examples/private/sounds/270326__littlerobotsoundfactory__hit-01.wav

BIN
syndicate-examples/private/sounds/270327__littlerobotsoundfactory__hit-00.wav

BIN
syndicate-examples/private/sounds/270328__littlerobotsoundfactory__hero-death-00.wav

BIN
syndicate-examples/private/sounds/270329__littlerobotsoundfactory__jingle-lose-00.wav

BIN
syndicate-examples/private/sounds/270330__littlerobotsoundfactory__jingle-achievement-01.wav

BIN
syndicate-examples/private/sounds/270331__littlerobotsoundfactory__jingle-achievement-00.wav

BIN
syndicate-examples/private/sounds/270332__littlerobotsoundfactory__hit-03.wav

BIN
syndicate-examples/private/sounds/270333__littlerobotsoundfactory__jingle-win-00.wav

BIN
syndicate-examples/private/sounds/270334__littlerobotsoundfactory__jingle-lose-01.wav

BIN
syndicate-examples/private/sounds/270335__littlerobotsoundfactory__shoot-03.wav

BIN
syndicate-examples/private/sounds/270336__littlerobotsoundfactory__shoot-02.wav

BIN
syndicate-examples/private/sounds/270337__littlerobotsoundfactory__pickup-00.wav

BIN
syndicate-examples/private/sounds/270338__littlerobotsoundfactory__open-01.wav

BIN
syndicate-examples/private/sounds/270339__littlerobotsoundfactory__pickup-02.wav

BIN
syndicate-examples/private/sounds/270340__littlerobotsoundfactory__pickup-01.wav

BIN
syndicate-examples/private/sounds/270341__littlerobotsoundfactory__pickup-04.wav

BIN
syndicate-examples/private/sounds/270342__littlerobotsoundfactory__pickup-03.wav

BIN
syndicate-examples/private/sounds/270343__littlerobotsoundfactory__shoot-01.wav

BIN
syndicate-examples/private/sounds/270344__littlerobotsoundfactory__shoot-00.wav

140
syndicate-examples/private/sounds/_readme_and_license.txt

@ -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

4
syndicate/examples/santa.rkt → syndicate-examples/santa.rkt

@ -1,9 +1,9 @@
#lang imperative-syndicate
#lang syndicate
;; Santa Claus Problem
;; https://www.schoolofhaskell.com/school/advanced-haskell/beautiful-concurrency/4-the-santa-claus-problem
;; https://arxiv.org/pdf/1810.09613.pdf
(require/activate imperative-syndicate/drivers/timer)
(require/activate syndicate/drivers/timer)
(require racket/list)
(require racket/set)

6
syndicate/examples/server-chat-client.rkt → syndicate-examples/server-chat-client.rkt

@ -1,7 +1,7 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/distributed)
(require/activate imperative-syndicate/drivers/external-event)
(require/activate syndicate/distributed)
(require/activate syndicate/drivers/external-event)
(require (only-in racket/port read-line-evt))
(assertion-struct Present (name))

2
syndicate/examples/simple-cross-layer.rkt → syndicate-examples/simple-cross-layer.rkt

@ -1,4 +1,4 @@
#lang imperative-syndicate
#lang syndicate
(assertion-struct greeting (text))

6
syndicate/examples/sqlite.rkt → syndicate-examples/sqlite.rkt

@ -1,7 +1,7 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/drivers/sqlite)
(require/activate imperative-syndicate/drivers/timer)
(require/activate syndicate/drivers/sqlite)
(require/activate syndicate/drivers/timer)
(define PATH "t.sqlite")
(define DB (sqlite-db PATH))

4
syndicate/examples/stdin-echo.rkt → syndicate-examples/stdin-echo.rkt

@ -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))
(spawn (define stdin-evt (read-bytes-line-evt (current-input-port) 'any))

4
syndicate/examples/time.rkt → syndicate-examples/time.rkt

@ -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
(field [count 0])

4
syndicate/examples/udp-echo.rkt → syndicate-examples/udp-echo.rkt

@ -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))
(during s

6
syndicate/examples/udp-multicast.rkt → syndicate-examples/udp-multicast.rkt

@ -1,7 +1,7 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/drivers/timer)
(require/activate imperative-syndicate/drivers/udp)
(require/activate syndicate/drivers/timer)
(require/activate syndicate/drivers/udp)
(require racket/random file/sha1)
;; IANA offers guidelines for choosing multicast addresses [1].

6
syndicate/examples/web-core.rkt → syndicate-examples/web-core.rkt

@ -1,7 +1,7 @@
#lang imperative-syndicate
#lang syndicate
(require/activate imperative-syndicate/drivers/web)
(require/activate imperative-syndicate/drivers/timer)
(require/activate syndicate/drivers/web)
(require/activate syndicate/drivers/timer)
(define server (http-server "localhost" 8081 #f))

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

Loading…
Cancel
Save