These are chat archives for jdubray/sam

6th
Dec 2018
Jean-Jacques Dubray
@jdubray
Dec 06 2018 01:24
"This is, in my opinion, the best available introduction to TLA+ and why it's so valuable for software engineering. And the whole talk is only half an hour long, so why not give it a watch?" https://twitter.com/Hillelogram/status/1070121326139138048
@nerdo yes, I agree, I am rather sloppy in my semantics, it's difficult to convey exactly what you mean. I don't consider a singleton an object (though it technically is), it's rather a bag of functions for me.
A component model is simply a way to slice and dice your business logic (into components) such that it makes it easier to reason about the parts without ever having to consider the sum. Just like redux has the ability to compose reducers but as we have seen when you start on the wrong foot, composition is not going to help you much.
Dannel Albert
@nerdo
Dec 06 2018 01:35
I would like to adopt a component model. Taking a look at the TLA+ video now...
Dannel Albert
@nerdo
Dec 06 2018 04:08
I’ve been tinkering a bit and have a better understanding of the component model now. I get why you said what you did about putting the acceptors in the model. If the acceptor and action are in a component, they are portable and can operate on whatever part of the model they happen to live in
I’m a stickler when it comes to names, as if you already couldn’t tell lol. I may choose to call them “units” or “workers” or “operatives” - maybe “ops” for short, to distinguish them from ui components
Jean-Jacques Dubray
@jdubray
Dec 06 2018 13:28
It's ok, as long as we can agree about the general structure and principles I am not caught up in names!
From the video, there are two important aspects of TLA+ that can be directly weaved into SAM (optionally): safety conditions and livelyness. SAM has of course no simulation capabilities, but you can add safety conditions to identify defects, if you keep a history of actions, you can even quickly understand the steps that lead to the defect. Same thing for livelyness (things happen eventually).
Dannel Albert
@nerdo
Dec 06 2018 13:31
That makes sense. Would you normally keep a history of actions by documenting a sequence of proposals to the model?
Jean-Jacques Dubray
@jdubray
Dec 06 2018 13:33
that could be one way, but you could also just keep the events and action (names).
Dannel Albert
@nerdo
Dec 06 2018 13:37
Ah ok, I guess by tracking it from the events you can source where the action is coming from, since actions can be triggered from anywhere, really
Jean-Jacques Dubray
@jdubray
Dec 06 2018 13:40
yes
Dannel Albert
@nerdo
Dec 06 2018 13:49
I've been tinkering with some ideas I've had in the implementation I'm working through. I know that mutability is a first class citizen in SAM, but some UI frameworks (namely react), one can take advantage of immutability and being able to detect changes on the model with a simple equality check. What I've currently set up is a mutation interface, which is just an object with get and set methods. They take the object they intend to operate on, and a path (in the form of an array) of how to get to the property to get/set. I have two implementations of it, one that I wrote, and one that basically wraps seamless-immutable. I'm forcing all the underlying model changes through that interface. That way the application can decide if immutability is important to it or not.