Essential Effects: podcast episode, book progress, resource love, and more
Greetings all -
News items first:
- I recently recorded a podcast episode about the book for The Scala Logs with Zach McCoy and it "dropped" (it that how the cool kids say it?) today on Spotify. Take a listen if you have some time.
- My upcoming talk for the Philly Area Scala Enthusiasts has been moved to March 24th.
- Our next Essential Effects course (EU-timezone) runs from 24-26 Feb 2021. Tickets are still available!
You can also buy the book at https://essentialeffects.dev.
Speaking of the book, I'm slowly making my way through the remaining issues I've filed for myself.
I don't think I'll make it by Valentine's day, but it's always good to have a deadline. I love the whooshing noise they make as they go by.*
The most difficult task is to support more book formats, specifically EPUB and MOBI. EPUB is at least a sane format, while MOBI, or whatever Amazon calls it now, is, uhh, not sane. Or at least the tooling around this is a giant pain. Plus I don't have a Kindle, or whatever. (You can tell I'm really enthusiastic about this, sorry.)
So, dear readers,
- Do you have any advice about tooling for these formats?
- Would anyone like to volunteer to look at early versions to tell me if they look ok, or look terrible?
Please let me know!
* Actually it was Kurt Vonnegut who said that. But I totally agree.
Today on the Cats Effect gitter channel I saw someone post really nice news: how Cats Effect, specifically the Resource
data type, gave them such joy! I shared it on Twitter, but will reproduce it here:
I'm going to take a moment to be grateful about how absolutely amazing Resource is.
I'm working on a complex system that has to move around a lot of files (one single unit of work comprises of roughly 8000x 11MB files), it has to create a lot of temporary files, it has to even invoke external python scripts, grab whatever they are writing to disk and cleanup. And the whole system, on top of everything, has to be resilient to restarts and maintain active web socket connections. Across (currently) three different services that in prod run on separate machines. Theoretically one of those big data things, but I chose to not use Spark or any "classic" solution because:
All easy peasy when everything is a resource!
- Temporary file? Resource!
- Python script that has to be there to call with like 4 parameters to file paths? All resources!
- Any component in the system? Resource! makes adding Refs, Semaphores, etc. or any other more complicated initialization job later on easy. That's why I prefer to do new PureService().pure[Resource[F, *]] in all constructors instead of returning plain PureService, little price to pay for future proofing the app.
- the high level connection between components? Resource!
- The "main" of each app? Resource!
- Entire system test? Just take above mentioned "main" resource for all three components, run the composition as a separate app on the same JVM!! Then use http client (also a Resource) to kick off the data flow through everything. Easy peasy! All scala code! This gives me enourmous confidence that my system will run OK when each service is distributed on their own machine.
And fs2 to glue things in between and keep the data flowing. Absolutely amazing :clap: All quite complex interaction... and it took like 120h of my work to get things up and running and computing! And even after like 3-4 contiguous of writing a certain flow end-to-end... it just works on the first try (most of the time)!
Thinking back to the before days, it was unfathomable to have such a resilient and correct system (with so much concurrency everywhere) up and running in such a short amount of time.
None of this even remotely possible without pure functional programming and the amazing ecosystem we have here :clap: :clap: :clap:
(Essential Effects talks about resources in chapter 7: "Managing resources".)
Be well,
.. Adam