Date Wed 17 October 2018 Tags scala / cats / fetch / applicative / functor / monad / parallel / haxl
Stupidly Obscure Programming in a Troubled Time
Since obsessively underlining passages in a tattered copy of Goodbye to Berlin hasn't proven to be the uplifting diversion I was hoping for, I resolved to bash my head against some really complicated scala code that I'm not qualified to write and that nobody is asking for either.
So that this exercise in self-abuse could pass for a reasonable use of my time - but not too reasonable, since that would be a giveaway - I decided to link it to an existing, longstanding obsession of mine: paradigms and constructs for concurrency.
Warning of what's to come:
Concurrent data retrieval in Haskell with Haxl and in Scala with Fetch , observing that Haxl benefits from extensions to the do construct that we don't have with Scala's for . Tedious construction of a Scala macro that purports to extend for in the same fashion. Many sad lessons are learned along the way. Demonstration of success in this endeavor, with some rueful acknowledgments. An unexpected rant about programming that uses types with names from category theory in combination with blocks of expressions involving left-arrows.
Waiting for guff
A couple of years ago, I offered to the the ungrateful internet a numbing fugue of mumblings that purported to explain how parallelism and batching were achieved in the Haxl package for Haskell. For no obvious reason, nearly all my code was in Clojure, which made no sense in the context of Haskell, but paid some dividends in the end, because the modern[ish] miracle of homoiconicity, plus a nice interface to quasar fibers, facilitated an alternate implementation based on asynchronicity and no monadic guff whatsoever.
Two years is a long time to wait for monadic guff, but good things - well, things anyway, come to those who wait.
Buried within the verbiage of the my previous post were a few pieces of information that will be useful today.
... continue reading