These are chat archives for jdubray/sam

4th
Jan 2018
Michael Terry
@formido
Jan 04 2018 01:16
cool :)
Jean-Jacques Dubray
@jdubray
Jan 04 2018 02:41

I do like this comment:

Because the authors of haskell are sadomasochists and decided that you should do something stupidly complex to accomplish simple things, so you HAVE to learn monads to use haskell, not because they're in any way useful in themselves

For me monads are an indication that the "Functional Programming" programming model has something particularly flawed. But, I'll refrain from making that conclusion, just yet.

Jean-Jacques Dubray
@jdubray
Jan 04 2018 02:48

That other answer is pretty good too:

In essence, you're writing execution steps and linking them together with the "bind function". (In Haskell, it's named >>=.) You can write the calls to the bind operator yourself, or you can use syntax sugar which makes the compiler insert those function calls for you. But either way, each step is separated by a call to this bind function.
So the bind function is like a semicolon; it separates the steps in a process. The bind function's job is to take the output from the previous step, and feed it into the next step.

RayoGundead
@RayoGundead
Jan 04 2018 02:51
so you are saying that monads is
writing a declarative program that generates an imperative program
Jean-Jacques Dubray
@jdubray
Jan 04 2018 02:51
:-) yes, great summary.
RayoGundead
@RayoGundead
Jan 04 2018 02:52
I understood monads, but I almost lost the ability to describe it
take that Crockford!
Jean-Jacques Dubray
@jdubray
Jan 04 2018 02:57
I remainted convinced that we are shooting ourselves in the foot when we are not trying to define with precision what an action, a mutation and a programming step are. Monads make no attempt to clarify these concepts and, of course, offer no proper temporal logic constructs.
It's another pile of imperative rubish, the only difference is that it's hidden behing the 'pure' functions of Functional Programming. FP looks more and more like a syntactic scam.
I am not saying that the syntax is not better, it is better, but it doesn't seem to bring a superior programming model to the table. In particular, the "pure function" is a myth.
Jean-Jacques Dubray
@jdubray
Jan 04 2018 03:03
Without questioning the genius of Church and Turing, they took what everyone else would have taken to try to model computations, namely a mathematical function. Thinking that there would be no other possible way to describe computations is at best naive if not pure fallacy from a 2018 Computer Scientist.
devin ivy
@devinivy
Jan 04 2018 05:43
being able to utilize monads while programming is useful, but is such a generalized concept, i wouldn't expect it to speak directly to some specific programming model.
Jean-Jacques Dubray
@jdubray
Jan 04 2018 05:49
well, it's part of the FP programming model, we can't claim we are doing FP with pure functions only.
devin ivy
@devinivy
Jan 04 2018 14:03
okay i see what you mean– you're talking specifically about applying monads as a trick to factor i/o using pure functions.
i see that as just one application of monads, but it is perhaps a very foundational technique to making FP work
what does leslie lamport say about the matter, out of curiosity?
Jean-Jacques Dubray
@jdubray
Jan 04 2018 21:55
Actually, there seems to be more than meet the eye, this presentation is a bit slow but quite informative to understand what Monads do compared to imperative code:
https://www.youtube.com/watch?v=LEug6jAj5BA
@devinivy He doesn't say much about FP (he is trying to stay above programming languages and hence programming paradigms), when Erik Meijer was at Microsoft, they did a series of common interviews, but it didn't seem there was a lot of love.
Jean-Jacques Dubray
@jdubray
Jan 04 2018 22:27

Pure UI with GraphQL and Entity-Mapped Microservices

The best solution we found to the above is to use GraphQL and start with a normalized data model in the GraphQL Schema with performant, entity-mapped CRUD microservices corresponding by name and structure to user-defined data types (with id's being used as relational constructs) then de-normalize (with de-duping using the graphql-deduplicator library) using performant, async resolvers on the server, on-demand, according to the shape of the UI component to be rendered, then cache static data (only) in the UI.

Jean-Jacques Dubray
@jdubray
Jan 04 2018 22:37
The project raises important questions, but I happen to believe in the decoupling between View and Data (hence SAM). As pointed out, the problem is always "consistency" (in either direction, read -system of truth- and write -eventual consistency). From all the projects I have worked on, control state will always get in the way, CRUD, Event Sourcing,... are based on the assumption that control state is negligeable, which I am not sure is a general enough assumption. There are a few areas where this assumption works (CRM, Social...) but most business domains would not allow it.