These are chat archives for jdubray/sam

25th
Nov 2018
Slađan Ristić
@sladiri
Nov 25 2018 22:00

@dfkaye_twitter I implemented SAM in Angular6 and async generators. The mutable state is easy to use. Also testing is pretty neat, it is similar to what I saw in tests for Reactive Streams: You push actions "into" the SAM container and wait for it to settle down (via Microtasks, ie Promises, Angular's testing with Jasmine has a helper method for this), and then you assert the state.

It reminds me also of PID controllers, though I am not familiar with this topic much. In the end, the resulting relationship of software to physical reality (via input) is what is so appealing to SAM. My initial reaction was also like mentioned by @dfkaye_twitter : this looks like the Actor model. That is very abstract and leaves a lot of room for the implementation. https://www.youtube.com/watch?v=7erJ1DV_Tlo

The Die Hard problem (jugs of water) is interesting to test with fast-check and commands. Here you do a negative test, you abort when there are 4litres the big jug. And I believe Dr. Lamport used this problem as an example too, that relation to TLA+ is appealing.