3 ms·
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_
by suls 10y ago
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
- wereHamster 10y agoMonad implies Applicative, so the "might need a free applicative part as well" is already a given.
- suls 10y agoYes and no. With Free Applicatives you can express side-effects such as parallelism .. not so with Free Monads afaik
- WhitneyLand 10y agoIt 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.