News for hackers. Stuff that matters.
Re:Simplify Service Dependencies with Nodes by suls on Sunday December 11, 2016 @03:42AM (#13150193)
Yes you are missing something. The purpose of this library is to decouple the "description" from the "computation" itself. I usually call "separating the _what_ from the _how_".

Essentially they construct an AST for whatever services that need to be called. Most of the time they then simply "interpret" the AST with the lower-level Finagle constructs. But, and that's actually the big point, they can use _the same code_ with a different interpreter to generate a GraphViz representation for visual inspection. This super helpful once your call graph becomes more complex .. Another possibility is to write an optimizing interpreter etc.

Anyhow, what I find a bit sad is that they didn't leverage the Scala part if Finagle more .. this would be a prime example for a Free Monad () based DSL. That way they could have avoided writing 10s of classes with less than fortunate names.

() might need a Free Applicative part as well since they inherently want to have parallelism expressed in the language

Re:Simplify Service Dependencies with Nodes by WhitneyLand on Sunday December 11, 2016 @02:01PM (#13152511)
It feels like over engineering for most projects, and yet another thing for new hires to learn.

I can't judge Twitter's design without seeing it, but I don't like the sound of this:

"the simplest web page on twitter.com requires collaboration of dozens of network services speaking many different protocols"

Simplest page? Dozens of collaborating services? Many different protocols?

I'm skeptical this is the most elegant architecture possible that meets the requirements of their simplest web page.

Re:Simplify Service Dependencies with Nodes by wereHamster on Sunday December 11, 2016 @04:04AM (#13150254)
Monad implies Applicative, so the "might need a free applicative part as well" is already a given.
Re:Simplify Service Dependencies with Nodes by suls on Sunday December 11, 2016 @04:12AM (#13150278)
Yes and no. With Free Applicatives you can express side-effects such as parallelism .. not so with Free Monads afaik