Commit Graph

288 Commits

Author SHA1 Message Date
Tony Garnock-Jones 585cbcdb9e Fix the jolly section numbering 2018-09-24 18:11:19 +01:00
Tony Garnock-Jones da5a60f42c Split out CSS; attempt to get section numbering (grrr!) 2018-09-24 16:45:39 +01:00
Tony Garnock-Jones 67d5d1c71f Minor print layout tweaks, and minor content fixes 2018-09-24 16:08:48 +01:00
Tony Garnock-Jones a7aa13818d Tighten 2018-09-24 15:33:19 +01:00
Tony Garnock-Jones cb2f2e6853 Literal small integers 2018-09-24 14:09:26 +01:00
Tony Garnock-Jones 13d34e035a Trim and improve 2018-09-24 12:59:22 +01:00
Tony Garnock-Jones acc4def15f Tweak print stylesheet 2018-09-24 10:36:10 +01:00
Tony Garnock-Jones 0120875d15 Print makefile 2018-09-23 22:56:41 +01:00
Tony Garnock-Jones 935ac403b4 Tweaks for Chrome and for print 2018-09-23 22:56:36 +01:00
Tony Garnock-Jones 8c501a6591 Fixes 2018-09-23 22:44:43 +01:00
Tony Garnock-Jones 7dee4c9b35 Progress 2018-09-23 22:35:00 +01:00
Tony Garnock-Jones 8cecaec69b Many improvements 2018-09-23 18:14:58 +01:00
Tony Garnock-Jones 9883d2bc5f move codec.md together with preserve.md 2018-09-23 14:39:46 +01:00
Tony Garnock-Jones efd6bc72ea codec.md draft 2018-09-23 14:39:02 +01:00
Tony Garnock-Jones 2b44d82c37 preserve.md based on codec.md which I'm about to check in 2018-09-23 14:37:20 +01:00
Tony Garnock-Jones 181e6a87a0 sqlite driver 2018-08-29 15:03:12 +01:00
Tony Garnock-Jones 8e88d4643c Rename codec --> preserve 2018-08-27 10:24:11 +01:00
Tony Garnock-Jones a1c9af708d Explore struct inheritance 2018-08-21 10:54:17 +01:00
Tony Garnock-Jones 710029ea9b Better codec 2018-08-19 22:13:42 +01:00
Tony Garnock-Jones 03dad81a49 Improve multicast protocol 2018-08-19 17:54:32 +01:00
Tony Garnock-Jones 41a4593183 Improve example 2018-08-15 10:11:07 +01:00
Tony Garnock-Jones 8a34bf20d8 Initial quasi-port of Syndicate/rkt web driver 2018-08-14 17:58:36 +01:00
Tony Garnock-Jones 0b7f827cec Multicast-UDP-based dataspace sketch, from last night 2018-08-14 12:35:56 +01:00
Tony Garnock-Jones 65e9ffac59 Clear no-longer-interesting timers 2018-08-14 12:33:50 +01:00
Tony Garnock-Jones 8bd848bca0 TODO 2018-08-13 21:45:44 +01:00
Tony Garnock-Jones 2a00d59231 term-intersect 2018-08-13 21:32:51 +01:00
Tony Garnock-Jones 11f28e13e2 UDP and UDP multicast 2018-08-13 20:07:27 +01:00
Tony Garnock-Jones 939b0620ed filesystem driver 2018-05-11 09:58:25 +01:00
Tony Garnock-Jones a391b0ff24 Port netstack to imperative-syndicate.
If you change `racket-bitsyntax` to use `typed/racket/base/no-check`
for its `bitstring.rkt` module, this runs about 15x faster than the
`syndicate` version of the stack. Otherwise, it runs about 3x faster
than the `syndicate` version of the stack.
2018-05-06 15:28:41 +01:00
Tony Garnock-Jones dbcc931ebd Notes on tcp2 protocol 2018-05-06 11:24:28 +01:00
Tony Garnock-Jones 07d5656e41 New test case 2018-05-06 11:06:36 +01:00
Tony Garnock-Jones 5cd8e2c2cb Add missing assertion for outbound connections. 2018-05-06 11:03:39 +01:00
Tony Garnock-Jones fd7cac5bae Repair bogus test. I should have caught this earlier! 2018-05-06 10:55:21 +01:00
Tony Garnock-Jones 3c7676906d Improve the kinds of tests we can do for expected output slightly. 2018-05-06 10:55:02 +01:00
Tony Garnock-Jones 85535608fd pattern-expander.rkt 2018-05-04 23:15:09 +01:00
Tony Garnock-Jones 12d4e95ac4 GUI example 2018-05-04 16:57:22 +01:00
Tony Garnock-Jones ff4c4a59bd Cosmetic - extra logging (when uncommented) 2018-05-04 16:56:56 +01:00
Tony Garnock-Jones c77416b727 Repair long-standing error in skeleton-walking. 2018-05-04 16:56:45 +01:00
Tony Garnock-Jones cc54496ac6 Extremely limited support for quasiquoting and quoting in patterns 2018-05-04 16:56:23 +01:00
Tony Garnock-Jones 59e1a09d61 Clock face example 2018-05-04 16:09:12 +01:00
Tony Garnock-Jones 00c6311bfc Quasi-useful debug output 2018-05-04 16:04:42 +01:00
Tony Garnock-Jones d9ca939d60 Restriction-paths: right idea (?), wrong implementation. This time maybe.
Instead of having restriction-paths as an adjunct to a change, they're
more propertly a part of each assertion itself. The new `skeleton.rkt`
keeps an optional restriction-path with each assertion, treating it as
distinct from its underlying assertion. The idea of not signalling
changes in assertions that have a restriction-path mismatch stays.
2018-05-04 15:55:53 +01:00
Tony Garnock-Jones ab75efe7f9 Skip apply-patch! make-work if patch is empty 2018-05-03 22:56:40 +01:00
Tony Garnock-Jones c27ace547d Add the concept of "restriction-path", which limits assertion visibility.
This is used when relaying: because we don't have access to the full
term, but only the projection results, we are inserting various
`(discard)`s. This is the cause of the failure in
`test/core/nesting-confusion.rkt`.

By adding `restriction-path`, we allow the inner dataspace to avoid
showing a reconstructed term to endpoints that might be able to
observe the reconstructed parts.

An alternative implementation approach is to generalize patterns in
the inner relay actor, translating all `(discard)`s into captures,
which would give us all the relevant terms that we need. The way I've
chosen to go (or at least, to try out) allows us to potentially keep
the "efficient" idea of just transmitting pattern-bound values across
some network link connecting dataspaces. The alternative would require
transmission of the full assertions, eliding no irrelevant detail.
2018-05-03 22:09:33 +01:00
Tony Garnock-Jones 8acfaab8f8 for/bag and for/bag/count 2018-05-03 22:09:13 +01:00
Tony Garnock-Jones 58695351d9 Make test-implementation language expose all of `racket` rather than just `racket/base`, for convenience. 2018-05-03 22:08:52 +01:00
Tony Garnock-Jones b95dd5142a Reuse apply-patch for initial-assertions too 2018-05-03 20:09:34 +01:00
Tony Garnock-Jones afaebdf69c Factor out assertion structure definitions 2018-05-03 16:14:30 +01:00
Tony Garnock-Jones 7079a14d5a Notes on install and test 2018-05-03 15:21:33 +01:00
Tony Garnock-Jones a4b8294734 README.md 2018-05-03 15:06:53 +01:00
Tony Garnock-Jones 5631b24904 Add second, non-dataspace, test case to illustrate correct behaviour 2018-05-02 23:36:03 +01:00
Tony Garnock-Jones 835528e855 New (failing) test case re: the approach to relaying 2018-05-02 18:23:02 +01:00
Tony Garnock-Jones 496682f550 Correct printing of test procedures 2018-05-02 18:20:33 +01:00
Tony Garnock-Jones e7773e918d Add `bag-empty?` 2018-05-02 18:20:24 +01:00
Tony Garnock-Jones 81e5cfbec4 Ensure (??) that relays' assertions can't outlive them 2018-05-02 18:10:52 +01:00
Tony Garnock-Jones 0b0615ec46 Notes on eventual improvements to dataspace nesting 2018-05-02 13:19:18 +01:00
Tony Garnock-Jones f9af2de438 Actually-useful instantaneous frame rate measurement 2018-05-01 22:40:12 +01:00
Tony Garnock-Jones 67279c9da7 Handy logging for diagnosing problems 2018-05-01 22:39:50 +01:00
Tony Garnock-Jones d3a7179907 Eliminate a (mostly harmless) source of #f current-facet. 2018-05-01 22:39:26 +01:00
Tony Garnock-Jones 571fc13787 Allow multiple "root" facets, by creating a dummy root 2018-05-01 22:39:02 +01:00
Tony Garnock-Jones 15120a8488 A few names for unnamed actors make it clear which actor is faulting 2018-05-01 21:19:19 +01:00
Tony Garnock-Jones 76c74f25c2 Adapt platformer to imperative-syndicate. Mostly working!
It's also nicely fast compared to the old-Syndicate version :-)

There are still some problems with parameters in cross-ds relaying;
the symptom is #f for (current-facet) at some point, leading to some
sprites that don't get retracted (!).
2018-05-01 21:15:22 +01:00
Tony Garnock-Jones 7b05a25301 First sketch of `quit-dataspace!`. 2018-05-01 21:12:54 +01:00
Tony Garnock-Jones 77a3042c98 Multi-assert!/retract! for adhoc assertions 2018-05-01 20:58:26 +01:00
Tony Garnock-Jones 9d4388ad8c More thoughtless uncommenting of query-* forms 2018-05-01 20:58:02 +01:00
Tony Garnock-Jones 7e71f04cc6 Correct error from earlier thoughtless uncommenting 2018-05-01 20:57:42 +01:00
Tony Garnock-Jones bf98354984 Support vector in patterns, like we already support list 2018-05-01 20:57:22 +01:00
Tony Garnock-Jones f4681c21a1 gl-2d driver and examples 2018-05-01 17:39:17 +01:00
Tony Garnock-Jones e44ee5ef28 Drain multiple external ground events at once. (Good or bad idea?) 2018-05-01 17:34:51 +01:00
Tony Garnock-Jones ca67f9405f Easy access to profiling 2018-05-01 17:34:34 +01:00
Tony Garnock-Jones 007af89325 Care less about exact set ordering in test case 2018-05-01 17:32:03 +01:00
Tony Garnock-Jones aaea276ec5 Uncomment query-value and friends. May need tweaks. 2018-04-30 22:48:50 +01:00
Tony Garnock-Jones dab13836f7 Clamp `adhoc-retract!` to not drop below zero. 2018-04-30 22:48:27 +01:00
Tony Garnock-Jones 55d13e7569 In case there are no activation-forms, add a gratuitous `(void)` at the end. 2018-04-30 22:47:53 +01:00
Tony Garnock-Jones 47f645d579 Repair incorrect interleaving of actions and scripts 2018-04-30 22:47:25 +01:00
Tony Garnock-Jones bda2ec0566 Switch another in-hash to hash-for-each 2018-04-30 14:46:43 +01:00
Tony Garnock-Jones 9d5213ecf4 Speedup from avoiding uselessly enqueueing an empty work queue 2018-04-30 11:19:03 +01:00
Tony Garnock-Jones 00b7f42335 Eliminate another parameter: now only `current-facet` remains 2018-04-30 11:18:49 +01:00
Tony Garnock-Jones d68bc87da5 Avoid manipulating `in-script?` all the time 2018-04-30 10:44:35 +01:00
Tony Garnock-Jones 77676fca9b Another small speed bump from using hash-for-each over in-hash-keys 2018-04-30 10:04:33 +01:00
Tony Garnock-Jones 1bd410db23 Avoid sets on the hot path (use hashes instead); good speed improvement 2018-04-30 09:32:08 +01:00
Tony Garnock-Jones 2008e66f38 Add in-* annotations to for loops 2018-04-30 09:14:00 +01:00
Tony Garnock-Jones 8bed3d4d4c Add timer/timestate support; this prompted a change to endpoint registration.
The `add-endpoint!` call is changed in two ways:

 - the old `assertion-fn` has become `update-fn`, yielding both
   an assertion *and* an optional handler, because if the handler
   depends on a field which changes, previously the handler wasn't
   being updated

 - a new parameter, `dynamic?`, can be set to #f (it's usually #t)
   to ensure that the assertion and skeleton-interest are calculated
   only once ever, and are not connected to the dataflow machinery.

The first change makes it possible for the `(later-than (deadline))`
pattern, where `deadline` is a field, to work; the second change makes
`during` and `during/spawn` work correctly in the face of field
updates.
2018-04-29 22:27:55 +01:00
Tony Garnock-Jones 98b7aecd8f External-event and TCP drivers; chat server and stdin echo programs 2018-04-29 18:43:39 +01:00
Tony Garnock-Jones 14bc36c4c5 Extract raw dataspace test to separate file 2018-04-29 16:08:52 +01:00
Tony Garnock-Jones d06acb2b59 Commented-out debug-printing in relay.rkt 2018-04-29 16:08:35 +01:00
Tony Garnock-Jones 768ee57a15 Add `test` make target 2018-04-29 16:08:20 +01:00
Tony Garnock-Jones a13884cbda bag-key-count 2018-04-29 16:08:01 +01:00
Tony Garnock-Jones e3d64677bd Repair scheduling of inner dataspaces, thus allowing e.g. double nesting 2018-04-29 16:07:49 +01:00
Tony Garnock-Jones 70b4bc5e74 Makefile 2018-04-29 14:54:28 +01:00
Tony Garnock-Jones 5a3f89ccf5 Tweak .gitignore 2018-04-29 14:54:22 +01:00
Tony Garnock-Jones 8900eccb1e Nested dataspaces 2018-04-29 14:54:14 +01:00
Tony Garnock-Jones 71756d8d40 First stab at #lang infrastructure 2018-04-29 12:22:12 +01:00
Tony Garnock-Jones 9b6fd1418a Refactor tests 2018-04-29 11:55:32 +01:00
Tony Garnock-Jones 45f401e607 Repair rotten pattern tests 2018-04-29 11:30:26 +01:00
Tony Garnock-Jones f2af7cb20b Box-and-client speed test 2018-04-27 23:59:04 +01:00
Tony Garnock-Jones 897c1aec0a Simple test harness 2018-04-27 23:53:31 +01:00
Tony Garnock-Jones 7199e6be64 Cosmetic notes 2018-04-27 18:23:34 +01:00
Tony Garnock-Jones a22062e043 Remove current-dataspace parameter 2018-04-27 18:05:33 +01:00
Tony Garnock-Jones 2c202d46ad Cosmetic notes 2018-04-27 17:36:43 +01:00
Tony Garnock-Jones 7be0ccf32c More robust approach to cleanup of assertions on actor termination.
We now explicitly track *committed* assertions of each actor in a new
field, `actor-cleanup-changes`. Each time a patch action is
*performed*, `actor-cleanup-changes` is updated. When an actor quits,
it enqueues a special new kind of action, a `quit` action.

When a `quit` action is performed, any remaining contents of
`actor-cleanup-changes` are processed in order to fully remove any
leftover assertions. (Leftover assertions will only arise in
exceptional cases: when some stop-script or facet boot-script raises
an uncaught exception.)

As part of this commit, we undo the effect of commit b207a07.
2018-04-27 17:30:26 +01:00
Tony Garnock-Jones 60a6290bc2 New failing test case. This, plus recent commits, calls for a
different strategy for tracking the retractions necessary at actor
termination.
2018-04-27 10:55:21 +01:00
Tony Garnock-Jones 629b4f8509 Cosmetic 2018-04-27 10:54:58 +01:00
Tony Garnock-Jones c56e5ad547 Switch adhoc-assertions to a bag (from a set).
This repairs a bug regarding crashes in a new actor's boot-proc.

Previously, if boot-proc raised an exception, the initial assertions
would stick around forever. By changing adhoc-assertions to a bag
rather than a set, and putting the initial assertions in the bag, we
put them somewhere they are guaranteed to be processed during actor
termination, even when an exception is signalled during boot.

This is an API change wrt the previous Syndicate implementation:
assert!/retract! now have bag semantics, not set semantics. We can add
set-semantics APIs if we end up needing them, of course, layered on
top of the bag implementation.
2018-04-27 09:59:03 +01:00
Tony Garnock-Jones bcfebeb402 Immutable bags 2018-04-27 09:55:19 +01:00
Tony Garnock-Jones b207a07798 The failing test now passes. The reasons for this are subtle:
The patch here removes a terminated facet from its parent's
`facet-children` set only in a script, and only after all other
scripts enqueued as part of facet termination have executed without an
uncaught exception.

This means that, if (say) a stop script raises an uncaught exception,
it might have happened after some *but not all* scripts resulting from
calls to `retract-facet-assertions-and-subscriptions!` have already
executed. So some endpoints' assertions and subscriptions will have
been removed.

When the uncaught exception is caught by the handler in
`with-current-facet`, a call to `abandon-queued-work!` is made, which
discards queued scripts, including the remaining assertion-cleanup
scripts as well as the scripts for removing dead facets from their
parents' `facet-children` sets. It also (crucially) discards queued
patch actions, including those resulting from already-executed
assertion-cleanup scripts.

At this point, we have a facet tree with some dead facets still in it,
and no queued outbound patches. The assertions for the still-present
dead facets are still logically asserted.

Then, a call to `terminate-actor!` happens, which traverses the whole
tree enqueueing assertion-cleanup scripts. No user code is enqueued,
so (in principle) no exceptions can be signalled.

Once these `terminate-actor!`-enqueued scripts execute, a pending
patch exists that will remove all remaining endpoint assertions.

The remaining sticky point is the calls to `dataspace-unsubscribe!`.
Happily, these are idempotent because of the implementation in
`skeleton.rkt`.

Prior to this patch, terminating facets were removed early from their
parents' `facet-children` sets, meaning there was no way to find them
again to clean up if a failure occurred during a stop script.

Ideally, it'd be easy to see that the code is correct in this respect.
We're not there yet.
2018-04-25 20:43:25 +01:00
Tony Garnock-Jones 18418dfc13 Failing test: an exception in a stop script messes up cleanup 2018-04-25 20:13:54 +01:00
Tony Garnock-Jones e7f3dab519 Run stop-scripts in one scheduled execution 2018-04-25 19:54:58 +01:00
Tony Garnock-Jones 762d1d4250 Be specific in for-loops 2018-04-25 19:47:18 +01:00
Tony Garnock-Jones 76c0fe03c9 Guard against double-adhoc-assertion 2018-04-25 19:46:08 +01:00
Tony Garnock-Jones d298ad2c66 Remove redundant `facet-live?` test 2018-04-25 19:40:53 +01:00
Tony Garnock-Jones 2878386805 Omit "name" to ctor for dataspace struct - name is/will be a property of the downward relay connection 2018-04-25 19:30:45 +01:00
Tony Garnock-Jones 1b1c598aa0 during/spawn 2018-04-22 21:07:35 +01:00
Tony Garnock-Jones 8cb4e947a5 Correct typo 2018-04-22 21:06:18 +01:00
Tony Garnock-Jones d93d773c23 Repair: it is incorrect to invoke retraction-handlers when retracting an interest 2018-04-22 21:04:22 +01:00
Tony Garnock-Jones e4a9f1fa8f Repair error: stop-facet scripts must run in parent facet's context! 2018-04-22 21:03:21 +01:00
Tony Garnock-Jones 6a7b9d57db Notice attempts to install more than one root facet in an actor 2018-04-22 21:03:01 +01:00
Tony Garnock-Jones 6de484b307 Introduce action-groups 2018-04-22 21:02:40 +01:00
Tony Garnock-Jones 3707782906 Improve debug-printing of facets 2018-04-22 21:00:35 +01:00
Tony Garnock-Jones d00a0c3216 Remove unused dataspace-actors field 2018-04-22 20:59:57 +01:00
Tony Garnock-Jones 7283eb8362 Implement during and ad-hoc assertions 2018-04-19 17:55:52 +01:00
Tony Garnock-Jones dd816a74ca Better Isolated Turn Principle 2018-04-11 12:28:09 +01:00
Tony Garnock-Jones d37a675afc Improve syntax location tracking 2018-04-09 10:29:14 +01:00
Tony Garnock-Jones b8e00e90f9 Script suspend and resume 2018-04-09 10:23:22 +01:00
Tony Garnock-Jones 8fcf765192 Simple messages-per-second test (~195kHz at present) 2018-04-08 12:06:37 +01:00
Tony Garnock-Jones 0673d6d9b3 Progress on syntax veneer 2018-04-08 11:44:32 +01:00
Tony Garnock-Jones 0e2384514f Eliminate (interesting uses of) facet IDs by storing references directly 2018-04-08 08:52:37 +01:00
Tony Garnock-Jones a4591944f1 More structured FID representation. 2018-04-08 07:58:17 +01:00
Tony Garnock-Jones e1de8a2814 Steps toward API usable by syntax layer; beginning of syntax layer, adapted from previous implementation 2018-04-08 07:39:39 +01:00
Tony Garnock-Jones 811a7a0a45 Fine-tune skeleton-accumulator representations for persistency/reuse and for potential speed benefit 2018-04-08 07:01:39 +01:00
Tony Garnock-Jones 210afa2395 Correct typo 2018-04-07 08:42:38 +01:00
Tony Garnock-Jones bdd8a0e4ff printf to log-info; clean up demo output 2018-04-06 12:07:09 +01:00
Tony Garnock-Jones ffa5b616ab Eliminate a few useless parameters 2018-04-06 11:58:49 +01:00
Tony Garnock-Jones 6a0439cbd0 POC imperative dataspace implementation, with set-box example 2018-04-06 11:37:59 +01:00
Tony Garnock-Jones 55dbc2f29a Switch to skeleton-stx with struct-type rather than predicate 2018-03-27 22:21:49 +13:00
Tony Garnock-Jones 7767563ff6 Rearrange 2018-03-27 22:21:49 +13:00
Tony Garnock-Jones 4a470bd2e0 Start translation of pattern syntax to various structures 2018-03-27 22:21:49 +13:00
Tony Garnock-Jones 5f78b24dc3 Initial sketch of new routing-table idea 2018-03-27 22:21:49 +13:00