Commit Graph

43 Commits

Author SHA1 Message Date
Tony Garnock-Jones 2bcffd3bab Require explicit facet in Turn.stop 2024-03-09 23:05:40 +01:00
Tony Garnock-Jones 4843c76784 Remove unused import 2024-03-09 11:23:37 +01:00
Tony Garnock-Jones c73d4df2f2 Alter atExit to yield callback for removing the hook 2024-03-08 12:05:17 +01:00
Tony Garnock-Jones c9a52ebe39 New year 2024-02-03 15:59:22 +01:00
Tony Garnock-Jones c9aab425fe Facet.wrap 2024-01-07 13:02:01 +01:00
Tony Garnock-Jones e2e72467cd Don't run external turns when space is paused 2023-12-21 14:13:45 +13:00
Tony Garnock-Jones 4903bc5149 Allow prettier display of dataflow cyclic dependencies 2023-12-03 22:35:47 +01:00
Tony Garnock-Jones ed605718e5 Global Dataspace and ActorSpace available 2023-12-01 20:53:18 +01:00
Tony Garnock-Jones 2671033b07 Allow booting an actor into an existing ActorSpace 2023-12-01 15:03:32 +01:00
Tony Garnock-Jones 28dee5f098 Store the whole assertion when crossSpace 2023-06-16 21:31:51 +02:00
Tony Garnock-Jones b4a54d6f94 Track inbound/outbound assertions across spaces 2023-06-16 13:02:34 +02:00
Tony Garnock-Jones 7b8526dfcf Facet.idChainValues 2023-05-28 12:24:28 +02:00
Tony Garnock-Jones 2a2b7da4bc Switch to proper schema 2023-05-28 12:03:45 +02:00
Tony Garnock-Jones 021fdf06bb Remove unneeded spawningFacet field; mark StopOnRetract entities 2023-05-28 11:38:05 +02:00
Tony Garnock-Jones 39fb9cb92e Task descriptions 2023-05-28 11:18:29 +02:00
Tony Garnock-Jones 818f35c471 Introduce ActorSpace 2023-05-19 14:58:42 +02:00
Tony Garnock-Jones 5030130aef Update attenuations 2023-02-06 15:16:57 +01:00
Tony Garnock-Jones 4adcfdd0ab Update copyrights 2023-01-17 11:44:05 +01:00
Tony Garnock-Jones 4a49e6a314 Generalize fields to all is()ables 2022-04-28 23:03:30 +03:00
Tony Garnock-Jones cdd1c2393d Bump preserves dep 2022-01-26 14:44:35 +01:00
Tony Garnock-Jones c3dfd42a58 Bump copyright years 2022-01-26 14:38:38 +01:00
Tony Garnock-Jones 5560ce5aa1 Upgrade Preserves, allowing automatic conversion to Preserves values in many cases 2022-01-24 14:13:46 +01:00
Tony Garnock-Jones 83cc561cce Turn.every 2022-01-20 20:48:30 +01:00
Tony Garnock-Jones 08197626a6 Simplify. Why didn't I do it like this before? 2022-01-08 13:38:10 +01:00
Tony Garnock-Jones ed8adae3f2 Experiment: run facet teardown in the current turn, immediately, instead of delayed 2021-12-24 17:29:26 -05:00
Tony Garnock-Jones 04bbcd25ab Turn.after 2021-12-12 23:02:58 +01:00
Tony Garnock-Jones 33ac308564 Allow access to new Actor handle on spawn (is this safe?) 2021-12-12 23:02:51 +01:00
Tony Garnock-Jones 951598b7d0 Commit to having onStop shutdownActions run in parent facet context 2021-12-12 23:02:25 +01:00
Tony Garnock-Jones 364c97f357 Repair error in halfLink accounting during facet termination 2021-12-12 23:01:53 +01:00
Tony Garnock-Jones 8888ac3fe9 Dataflow blocks should contribute to facet liveness I guess, since they aren't removable 2021-12-11 15:43:56 +01:00
Tony Garnock-Jones 97cfb19852 Move stop continuation *before* a stopping facet's assertions are retracted.
This is a kind of ad-hocish response to an interesting problem. In
previous Syndicates, assertion changes were gathered into *patches*
which *netted out* intra-turn changes. In this implementation, each
change is relayed unchanged, so there is *no netting* going on. The
closest we get is a convention that when things are being replaced,
incoming assertions should be made before outgoing ones are retracted,
so that the kind of glitch that's seen is a double-up of records,
rather than a brief window where no records are present.

So here, by moving the stop continuation into an onStop for the
stopping facet (that nonetheless *executes* in that facet's parent's
context), we allow the following pattern to run without problem
glitching:

    react {
      assert Something(1);
      stop on asserted Condition() => react {
        assert Something(2);
      }
    }

Observers like this...

    during Something(_) => { // **A**
      ...
      during Something($specific) => { // **B**
      }
    }

will see

    + Something(1)
    + Something(2)
    - Something(1)

rather than what they saw before this change,

    + Something(1)
    - Something(1)
    + Something(2)

The consequence is that the line marked **A** above will *remain
active* after this change, with the facet at **B** being replaced,
rather than briefly tearing down the **A** facet when `- Something(1)`
and then creating a fresh one when `+ Something(2)`.

This came up in flappy bird, where I had

    react {
        at mainDs {
            assert ui.html('#board-area', template`<h1 class="score">${score.value}</h1>`);
        }
        at gameDs {
            stop on asserted GameOver() => react {
                at mainDs {
                    assert ui.html(
                        '#board-area',
                        template`<h1 class="score">${score.value}<br/>GAME OVER</h1>`);
                }
            }
        }
    }

which, in combination with the particular implementation of index.ts
in the html package, caused the UIFragment responder to get confused
and to not show the GAME OVER message - the previous score message was
removed, but the new one wasn't manifested in the DOM. Changing the
last `ui.html` above to `ui.context('foo').html` caused the problem to
go away (by making it effectively two unrelated fragments, rather than
a replacement of the content of a single fragment).
2021-12-11 14:04:31 +01:00
Tony Garnock-Jones 1c1decdb7d Repair type error for dataflow assertions 2021-12-09 22:12:02 +01:00
Tony Garnock-Jones dd4af85296 Allow ancillary data as a side-channel for intra-image value passing 2021-12-09 22:11:46 +01:00
Tony Garnock-Jones 20b83aa5a5 Support stopping a root facet, such as happens when a link between actors is broken 2021-12-09 18:52:22 +01:00
Tony Garnock-Jones 5455392efc Repair typo 2021-12-09 18:51:57 +01:00
Tony Garnock-Jones b5e82cba9b Better Ref printing 2021-12-09 18:51:41 +01:00
Tony Garnock-Jones fb420855e9 Use a global variable instead of threading thisTurn through everywhere. Should improve ergonomics a little. 2021-12-03 01:46:41 +01:00
Tony Garnock-Jones dd14c8471d Update compiler 2021-12-03 00:55:42 +01:00
Tony Garnock-Jones f9d1e694e0 Examples and bug-fixes 2021-12-02 16:04:07 +01:00
Tony Garnock-Jones d51af436f5 Much progress 2021-12-02 14:40:24 +01:00
Tony Garnock-Jones d2f5c947ac Bulk copyright notice repair 2021-12-01 17:24:29 +01:00
Tony Garnock-Jones 1563398dd8 More WIP novy 2021-12-01 17:13:00 +01:00
Tony Garnock-Jones c6fff70bae WIP moving to novy 2021-12-01 16:27:06 +01:00