These are chat archives for jdubray/sam

21st
Jun 2017
Jean-Jacques Dubray
@jdubray
Jun 21 2017 00:26
It's a reasonably good fit, it's just a way to structure the update function, though I am not sure if it would support nap().
Marcus Feitoza
@mfeitoza
Jun 21 2017 00:35

Yes I refactor this example: http://elm-lang.org/examples/buttons
Was really easy.

I think is possible support nap and will try: http://package.elm-lang.org/packages/elm-lang/html/2.0.0/Html
program
"Create a Program that describes how your whole app works."
I roughly think that could be possible describe the reactive flow

I just need to put my mind in Elm Lang, is so different... but I liked.
Victor Noël
@victornoel
Jun 21 2017 09:07
@mfeitoza will you share the result of your experiment? I'm really interested to see how this could be represented with Elm. Actually, I think it would be helpful as a way to better understand SAM, because with Elm things are clear in terms of types. It is easier to read than javascript :)
Marcus Feitoza
@mfeitoza
Jun 21 2017 09:47
@victornoel Of course.
Jean-Jacques Dubray
@jdubray
Jun 21 2017 15:50
Interesting article on the evolution of React: http://formidable.com/blog/2017/infinite-state-composition-with-freactal/
(via Guillaume Fortaine)
Jean-Jacques Dubray
@jdubray
Jun 21 2017 15:56
The myopic management of state in React will one day kill it: https://medium.freecodecamp.com/functional-setstate-is-the-future-of-react-374f30401b6b
@jdubray I think you were favourable to using adt (things along union-type or similar) in SAM model, when appropriate -- correct me if I misspoke.
Jean-Jacques Dubray
@jdubray
Jun 21 2017 16:59
I am not against using "types" in any way, I only advocate a specific role for "types". You look at the evolution of React and it's like everything we do in software, we go "monadic" (single concept), i.e. a React component is a class, then someone comes along and say, but wait, really a React component is a function... V = f(M), then someone again says but wait how does "state" fits in it? then light-bulb turns on (or in this case off) and they say let's do functional setState? really?
Monadism is what's wrong, OOP, RP, FP, whatever will never work.
As soon as you take a monadic approach then you warp everything around it and one day you collapse.
I mean, look at that tweet, with what you know from SAM and otherwise experience, what do you think?
No it's not safe when your model "accepts" all proposals. How many people believe that in the React community? 99%? and 1% have no clue?
Slađan Ristić
@sladiri
Jun 21 2017 17:36
I guess it promotes React. IIRC Dan Abramov warned in the beginning that the reducer pattern is an interesting start for learning more about how to do applications. It was a nice presentation, and for old-school OO people probably very refreshing. Not sure how many people remember the beginnings of Redux.
Jean-Jacques Dubray
@jdubray
Jun 21 2017 17:39
All I am trying to say it that once you go down a path you are forced to make lots of decision and this is not necessarily obvious on the first step you take. Hence you should be careful in statements like a React component IS-A Class or IS-A function, or any statement at all.
All I can see right and left is that all these statements/decision have been made in complete vacuum. That's really all I am saying. If everyone is happy with that, fine by me.
Slađan Ristić
@sladiri
Jun 21 2017 17:44
As an argument that everything is not clear yet, I often pointed to this discussion, where it showed that people want something better than what React/Redux offers. They closed it unfortunately. reactjs/redux#1528
Jean-Jacques Dubray
@jdubray
Jun 21 2017 17:50
ah ah, I think I was part of the reason why they closed it. The mere fact that mutation and inter-process communication are reified as a "side-effect" should raise an alarm bell, but what do I know?
Slađan Ristić
@sladiri
Jun 21 2017 17:59
Yes, I see, technically it is correct, since the issue topic went nowhere. I wondered if that discussion would bring successor to Redux.
Jean-Jacques Dubray
@jdubray
Jun 21 2017 18:25
I think Dan's goal is to align with Elm, as long as that will remain true, I am not sure anything will change.