These are chat archives for jdubray/sam

12th
Feb 2018
david kaye
@dfkaye_twitter
Feb 12 2018 00:06
@jdubray There's another one about Redux regret here > https://twitter.com/housecor/status/962754389533429760
Jean-Jacques Dubray
@jdubray
Feb 12 2018 10:30
Again my jaw drops, not that I am surprised, but that is quite a sharp constrast of what you hear from the community.
Jean-Jacques Dubray
@jdubray
Feb 12 2018 12:11
It's probably time to bring back the "dossier" the redux community is using to keep track of my statements
https://gist.github.com/markerikson/dc10ee3c6fcaee245ab02c2498ab53f4
Jean-Jacques Dubray
@jdubray
Feb 12 2018 14:39
With all that being said, a client asked me to add a couple features on a project I had done last year. Nothing major, but I could see first hand how robust and how clear it was to change the code. The project is a complex analytics dashboard with admin/profile management. The separation of concerns between the view and the state function turn out to be gold. The probability of introducing defects with these changes is close to zero.
Dmitry Shalkhakov
@dshalkhakov
Feb 12 2018 16:26
G'day, gentlemen!
As an exercise in learning about the SAM pattern, I've translated the tutorial at sam.js.org to C#
Here it is: https://github.com/dshalkhakov/sam-csharp
Hopefully, somebody will find it useful.
Jean-Jacques Dubray
@jdubray
Feb 12 2018 16:34
outstanding, thank you for doing that. I'll take a look, most likely Thu or Fri.
Paul Reimer
@paulreimer
Feb 12 2018 17:12
Can someone help me to connect SAM to TLA+? The SAM pattern seems well motivated, but when I read about TLA+ (independent from SAM) it doesn't seem immediately obvious how SAM is built on/derived from its concepts. (not that I doubt it, but my primary interest is in using and understanding SAM -- so methinks I should understand a little of TLA+ and how it applies, without a full application of it)
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:14
Paul Reimer
@paulreimer
Feb 12 2018 17:16
It's one of my many open tabs about SAM/Flux/Redux/ReactiveX/Elm!
VaseJS
@VaseJS
Feb 12 2018 17:18
@paulreimer I would recommend battling through the TLA+ video course. Leisle does a great job of starting from the beginning (though he has a lot of corny things he does for entertainment, but he’s old. let him have his fun). If you follow the instructions and watch as he instructs, you will see the connection and how SAM is based on TLA+.
Paul Reimer
@paulreimer
Feb 12 2018 17:19
FWIW I am hoping to select one of these patterns to implement for my C++ IoT designs (the behaviour seems similar to modern web-apps and I regularly suffer the same scaling / side-effect issues that JS devs seem to be facing)
VaseJS
@VaseJS
Feb 12 2018 17:19
it took me all weekend to go through all his videos and the examples he gave in the videos but when you look deeper you see that AWS is using TLA+ not necessarily SAM and other major players in the software world.
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:19
You may also want to take a look at his work on the Paxos protocol (Propose/Accept/Learn).
VaseJS
@VaseJS
Feb 12 2018 17:19
@paulreimer FWIW?
in the videos, he recommends everyone look at Paxos also because: spoiler alert! He invented it
:D
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:20
@paulreimer I would expect TLA+ (and SAM) to be a good fit for IoT, basically everywhere you need an event handler, SAM is a good fit.
Paul Reimer
@paulreimer
Feb 12 2018 17:20
"for what it's worth". I say it just in case the context of C++ (non-JS) changes things.
VaseJS
@VaseJS
Feb 12 2018 17:21
@paulreimer PlusCal is a language close to C that is a tool to turn the specs into code also so if you’re using any C lang, you’re covered
there are a set of tools that have been created for those very problems
Paul Reimer
@paulreimer
Feb 12 2018 17:21
Hahaha I'm a Raft man myself, but I do appreciate the design of Paxos.
VaseJS
@VaseJS
Feb 12 2018 17:21
i guess i learned a lot more this weekend than i realized
I’m not in the code that deep to understand Raft or Paxos.
I’m a JS/Node guy
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:23
@paulreimer you should also make sure you take a look at the STAR library (Java/Javscript), this was my first step with SAM, it could be very close to what you need:
https://www.ebpml.org/blog15/2015/04/star-based-component-model-with-tla-semantics/
Paul Reimer
@paulreimer
Feb 12 2018 17:23
Well, for me Raft brought clarity where I had to just trust Paxos at a certain point. And heading into TLA+ brings back memories of trying to grok Paxos at the formal spec level.
VaseJS
@VaseJS
Feb 12 2018 17:23
also, Leisle (i think i’m spelling his name wrong), is very conscious of what dev needs are and tells you exactly what a dev will need vs someone who needs more understanding. he’s structured his work to reflect this
Paul Reimer
@paulreimer
Feb 12 2018 17:25
OK, that was part of my intuition on this too... it may take a few days of total immersion to grok it.
VaseJS
@VaseJS
Feb 12 2018 17:25
@paulreimer it seems worth it. SAM becomes a lot more clear if you just power through his videos and get understanding
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:27
uh? I tried so hard to make TLA+ clearer by making it easy to undestand SAM :smile:
VaseJS
@VaseJS
Feb 12 2018 17:29
@jdubray i don’t know if that is possible. TLA+ is some deep stuff, but if one sticks with it, it becomes clear. they have to want to learn it or understand its utility. Its the same issue AWS had internally until they could prove its usefulness. then everyone started using it.
that say it takes about 2 weeks to get down for even new devs on the AWS team
Paul Reimer
@paulreimer
Feb 12 2018 17:31
@jdubray Yup, I think that SAM fits much cleaner than (typical, bad) MVC for IoT uses. And my thinking is that Flux is just a decent, specific implementation of MVC (with new terms). And Redux adds to that decomposition/FP with reducers. But they don't really offer anything new from MVC? I think the specific notion of "time-travel" is new, but only because of the singleton Dispatcher.
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:37
I won't comment further on Redux :smile:
Paul Reimer
@paulreimer
Feb 12 2018 17:37
How does SAM fit/compare with the Actor model? Seems that is even another level of decoupling.
VaseJS
@VaseJS
Feb 12 2018 17:38
@jdubray :+1:
Paul Reimer
@paulreimer
Feb 12 2018 17:39
Especially with things like "process" supervision trees (Erlang/OTP), really seem the most intuitive paradigm for side effects.
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:40
I don't have time right now for a discussion, I have not done much research on the Actor model but my best guess would be: SAM is a possible factoring to implement an actor (event handler)
Paul Reimer
@paulreimer
Feb 12 2018 17:42
OK, I will try and understand them both (SAM, Actor model) through the lens of the TLA+, and hopefully get some clarity. Thanks for the quick tips in the right direction @jdubray, @VaseJS !
VaseJS
@VaseJS
Feb 12 2018 17:42
@paulreimer no problem
Jean-Jacques Dubray
@jdubray
Feb 12 2018 17:46
:+1:
Fred Daoud
@foxdonut
Feb 12 2018 17:50
@VaseJS just to be sure.. this? https://lamport.azurewebsites.net/video/videos.html
VaseJS
@VaseJS
Feb 12 2018 17:51
@foxdonut :+1:
that’s it. nice and 1990s looking
Fred Daoud
@foxdonut
Feb 12 2018 17:51
@VaseJS lol
thanks!
VaseJS
@VaseJS
Feb 12 2018 17:51
follow his instructions and follow along. you’ll get the most out of it
each vid is no longer than 20 mins on avg
Fred Daoud
@foxdonut
Feb 12 2018 17:54
@VaseJS I can relate to your comment, i.e. to take the time and make the effort to work through some material. I had the same experience with ADT/Fantasy Land/etc. Took some time and effort but it was well worth it to then understand how useful it is. (I'm talking about things like Maybe, Either, Result, Async and so on, with libraries such as crocks).
@VaseJS definitely makes me feel like I'm back to using Mosaic or Netscape 4 :laughing:
VaseJS
@VaseJS
Feb 12 2018 17:57
@foxdonut yea. i may redo his site and send him the files
but he does break it down very well. it does get heavy towards the end
Paul Reimer
@paulreimer
Feb 12 2018 18:05
I almost lost focus reading the TLA+ paper but then I realized he was describing "action"s in the same context as "Die Hard" . Interest renewed!
VaseJS
@VaseJS
Feb 12 2018 18:06
@paulreimer don’t read. watch the videos
then read.
a lot easier to understand. he breaks it way down in simple terms
Paul Reimer
@paulreimer
Feb 12 2018 18:10
oh I've read so many academic papers in grad school that I can absorb them very fast and they "build on" to my mental model quickly. even videos at 1.5x speed, I'd get more out of a few hours reading.
but I'll watch the videos a couple weeks from now and hopefully reinforce/confirm what I learned.
unless he's a funny guy, then I might watch the videos for learning + lols.
VaseJS
@VaseJS
Feb 12 2018 18:13
@paulreimer he tries to be in a weird way. his humor is lost on me
Paul Reimer
@paulreimer
Feb 12 2018 18:13
he's a great writer.
david kaye
@dfkaye_twitter
Feb 12 2018 20:00
@paulreimer @jdubray @VaseJS Article on implementing the actor model in JavaScript by Dale Schumacher I find a couple years back ... http://www.dalnefre.com/wp/2014/03/actors-in-javascript/
VaseJS
@VaseJS
Feb 12 2018 20:00
@dfkaye_twitter let’s check it out!
now i have to figure out what an actor is :trollface:
david kaye
@dfkaye_twitter
Feb 12 2018 21:49
MODELING REDUX WITH TLA+ by Hillel Wayne https://www.hillelwayne.com/post/tla-redux/
Jean-Jacques Dubray
@jdubray
Feb 12 2018 23:04
@dfkaye_twitter thank you for sharing. I would think that a reducer is bread-and-butter for TLA+
personally I am more interested in the other way around, how do you use the semantics of TLA+ in every day code. We rarely write "algorithms" in our front-end work. Anything beyond pure algorithms is difficult to model in PlusCal/TLA+
Fred Daoud
@foxdonut
Feb 12 2018 23:53
thanks for the links @dfkaye_twitter