To iterate is human; to recurse, divine.
~ Peter Deutsch
Well begun is half done.
~ Aristotle

Preamble š
Whoa, Help Us Get Our Bearings!
It was a dark and stormy night⦠The pitch black sky remained sunk under mounds of darkness, only occasionally lighting up from the sporadic dazzling displays of lightning strikes. The stark storm bolts reminding me of the awesome power of nature; for all practical purposes, it was only during those fleeting moments of stormy lights that I was able to maintain my bearings on the desolate hillside where I found myself that night in the rustic countryside ā
Wait, wait, cut! (Part I: Apache Storm) š¬
A Storm Bolt Kicks Off The Dramaā¦
Did someone say something about⦠a Storm bolt, amirite? š«
All Alone In The Supercomputing Lab
It was a dark and stormy night⦠There I was, all alone in the supercomputing lab, with the power of practically limitless computing heft at my disposal: My fingers were flying across the keyboard as I wrestled with, what else, but a Storm bolt of course. Scheherazade-style, I immediately set about crafting the telling of the story in one of the languages I know best: the language of computers! š»
Recursion And Automagic, Oh My!
Recursion writ large⦠Anyhow, here was the problem I was trying to solve (should any of my software savvy sisters and brothers wish to give me a helping hand, mostly for a software postmortem at this time) at the witching hour, all alone; supercomputers havenāt quite achieved sentience, yet, so I still feel confident that my earlier statement about my lonesomeness holds water š»
Brave New World Lies Yonder
(Fair warning: Not that itās a bad thing at allāin all fairness though to my non-technical readersābut the next two paragraphs contain technical content⦠I straddle the two worlds, the technical and the non-technical, caring deeply for each in equal parts, because thatās my thing: crafting essays at the intersection of culture, software, technology, and engineering. In fact, it was a scant few minutes ago that I heard from one of my dear, non-technical readersāshe was providing feedback on an earlier draft of this essayāwhere she had the following poignant observation to share with me, far too valuable to miss sharing with you: “If George Orwell or Aldous Huxley were living today, what would they have to say about todayās computers and the way they speak in tongues? Itās the Tower of Babel all over again, as the uninitiated grope around blindly in a brave new world.ā Ah, for one thing, it sure rings true with me, and for another, now if only I could write like she does; maybe one day, though I wouldn’t hold my breath; you’re pretty much stuck with me for now!) šŗ
- When it comes to anchoring, all you have to remember is this: Within the execute() method of the BaseBasicBolt implementation, I’ll be emitting a tuple to be passed on to the next bolt. At this point of emitting, the out-of-the-box BasicOutputCollector will assume the responsibility of anchoring the output tuple to the input tuple. In the otherācomplementaryābolt, we simply emit the result. What happens is that this outgoing order tuple will be “automagically” anchored to the incoming complementary tuple. As simple as ABC; no rocket science going on here! ā
- And when it comes to acking, all you have to remember is this: Whenever the execute() method of the BaseBasicBolt implementation has done its thing, the tuple that was sent to it will be “automagically” acked. Should there be a failure within the execute() method, the way to handle that is to notify BaseBasicBolt by throwing a FailedException or perhaps another suitable Exception. From there onwards, the BaseBasicBolt will take care of marking that tuple as failed. How simple is that? How elegant is that, now? ā°
All Your Dreams Are Strange, Love Comes Walking Inā¦
Woohoo, problem solved, so it must be time for yours truly to go home, amirite? Well, not so fast, busterā¦
It slowly dawned on me that everything that Iāve finished narrating at this pointāmy adventure of deriving a unique solution all alone in the supercomputing labāwas merely a dream. Rats! A gloomy night like the one in which I found myself enshrouded, right out of something from the dark imagination of Edgar Allen Poe, sure can do strange things to one’s consciousness⦠š„
Hurtling Down Into Empty Spaces
Next thing I knew, I was hurtling through space (barely half a foot away from the stony wall of the castle) but luckily, on making impact with the steep embankment at the foot of the wall, I fellāmiraculously enoughāsuch that my back rammed flush against the thick grassy slope, and whose cushion proved to be a lifesaver and a half!
Nonetheless, states change, shift happens, and I kept sliding down at breakneck speed down the grassy slope and headed straight for a Kafkaesque cave that threatened to swallow me whole š
And Into The Kafkaesque Cave!
For a few momentsāfor all I know it might have been at eternityāI think I lost consciousness. When I came to, I found myself not in a Kafkaesque abyss, but rather what looked like the maw of a gloomy cave⦠Stalactites and stalagmites all over the place, no matter in which direction I donāt my head. It sure felt like being in a spooky cave⦠A handful of sonar detection-savvy bats screeched past my ears and confirmed as much! Oh my, out of the fire, and into the frying pan, oh my! š
Wait, wait, cut! (Part II: Apache Kafka) š¬ š¬
Careening Into Cloud Computing
A Smashing Time With Cloud Computing
Needless to say, this particular Kafka spoutāa programming conceptual construct of sortsāwas the conduit out of the Storm topology and into my Apache Kafka topic! And there I was: I sipped cool lemonade from a tall tumbler standing next to my keyboard as I listened to a tune by Mark Knopfler (the song Golden Heart, if you really must know!) Life was good.
Will You Change, Or Will You Stay The Same?
Alas, Reality Intrudesā¦
But here is the rub, the fly in the ointment, reality intruding into our serene tub: Remember what we read above about good oldāmake that bad oldācompaction? Indeed. So there I was, having a blast with handling the power to change the retention policy on a topic from ādeleteā (recall how it deletes events that are older than retention time to ācompactā, which, in turn, only stores the most recent value, per-each-key, in the topic)?
The Joys Of Eventual Consistency
Hmm⦠I wonder, I thought to myself, if perhaps Apache Kafka will allow me to change the retention policy on a topic from “delete” (which, as you might know, will delete events older than the retention time) to ācompactā (which, as you might also know, will store only the recent-most value for every topic key available). I wonderā¦
Indeed, such are the joys of eventual consistency š
I Make It To The Lip Of The Cave
Groaning and positively nonplussed that my magnificent Kafka solution would have to wait for another day, I creakily stood up, my back still hurting from the long skid along the hillside by the castle, and made it to the lip of the cave šµ
Darn, I Feel Dwarfed
Feeling small and lowlyālike the boy Jack in the palm of the outstretched hand of his nemesis The Giantāthere I was, all tattered and torn, broken and bereft. Thus it was that I looked up into the sky and saw⦠a spark! š
It was still there, that spark, hovering barely five feet above my head, suspended like a hummingbird in its selfsame incandescence!
Wait, wait, cut! (Part III: Apache Spark) š¬ š¬ š¬
Rescuing Machine Learning
Did someone say something about⦠Spark, amirite? š„
Only For You
Due to its confidential natureāitās for your eyes only and on a strictly need-to-know-basisāI canāt talk much about the monumental significance (both in scale and sophistication) of the ML solution I was carefully crafting in the luxurious Miami penthouse overlooking the soft and sandy moonlit beach which was frequented at this time by only the occasional crab or crustacean going out for their midnight snack⦠š
Of Infinite Loops And Recursion
Surely Iām not dreaming this time, or am I? š
Immersed in my suspended state of recursion-writ-large (you know the routine about sometimes-non-terminating babushka doll inside babushka doll insideā¦), just as I was contemplating the lack of macros in the otherwise awesome language that is Scalaāmy ML solution sure could have used a Lisp style macro-driven boost right at that timeāa gust of wind brazenly blew straight into my face and woke me up! Darn it!! š“
Yet There I Wasā¦
I let out an audible groan this timeādarn those oh-so-elusive tantalizing dreamsādoubly reverberating my earlier contemplation of how I had, and not too long ago either, creakily stood up, my back still hurting from the long skid along the hillside by the castle, and made it to the lip of the cave. But there I was, standing above the caveās lip š§
Hope Springs Eternal In The Human Breast!
Woohoo! This would be my ticket, my escape from the sordid mess in which I found myselfāyou know the Kafkaesque abyss and the equally Kafkaesque cave where we had been spelunking. Truth be told, I wanted to give that staircase a bear hug right then and there (Hmm⦠On second thoughts, that might prove a tad too painful, you know, hugging the staircase and all!) š»
The Word In Spanish, I Mean, In Italian?
All the same, there it was, the loveliest staircase on which any human had cast their eyes. So lovely, in fact, that I got to thinking about the Italian word for a staircase: Scala!
Wait, wait, cut! (Part IV: Scala) š¬ š¬ š¬ š¬
It Still Was A Dark And Stormy Night All Right
Did someone say something about⦠Scala, amirite? š
It was a dark and stormy night⦠There I was, all alone in the Austrian Alps, listening to the sound of music softly playing all around me, surrounded even as I already was in fields of bright flowers that stretched in every direction until I just couldnāt make out the horizon š» š» š» š»
Somewhere In The Austrian Alps Nowā¦
By the way, the transatlantic flights of late and cheap restaurant food have not done wonders for my health; in particular, my throat was hoarse as hell. So a word to the wiseāespecially for those of you into home remediesāthat as I sat there squatting on a tuffet somewhere in the Austrian Alps (and hey, I wasnāt eating my curds and whey!) with my trusty MacBook balanced on my lap, I was gently sucking on some Ricola throat lozenges⦠(Good stuff, Iām telling you, that Ricola).
Let’s Get The Loveliness Of Macros Into Scala!
So here was the problem that I was trying to solve: implement and add the capability into the Scala programming language for users to create their own macros (Lisp-style). Oh yes!! (Out of thin air, the solution suggested itself to me; it came to me unbidden, so I really canāt even take credit for it). And did I mention that I make it a point to carry with me during my travelsātransatlantic and otherwiseāa vellum-bound notebook, Leonardo da Vinci-style, in which I write especially significant results and observations? For sure, my MacBook remains trusty as ever; itās just that using a vellum-bound notebook on special occasions makes them, those occasions that is, well, special occasions! šØ
Why, Hello Kitty
All excited, I sat down to scribble the magnificent solutionāwe programmers tend to think that something on the order of implementing and adding the capability to the Scala programming language to empower users with creating their own macros (Clojure-style) would qualify as a special occasionāin my vellum-bound notebook. But wait, did I hear a cat’s soft meow, almost a purr? Surely this wasnāt true; I mean, what would a true-blue member of the feline species be doing in the Austrian Alps, for crying out loud?! š±
In Honor Of Fermat’s Last Theorem
But heyābeing the cat-lover that I amāI needed to get to the bottom of where the tantalizing feline sound was coming from⦠But before getting up, I scribbled something in the margin of my notebook only this much, even as the siren sounds of a cat somewhere in time beckoned wildly to me. I wrote: “Today I have discovered a truly remarkable software design (and implementation) for macros in the Scala programming language which, alas, this margin is too small to contain. Sigh.“
Then I went a-hunting for cats and, as they say, the rest is history⦠š
Darn, waking up at the most momentously wrong momentātimes number four, for crying out loudāis no fun! Dang!!
Back At The Ranch
Meanwhile, back in the real word, things were looking up: the storm had mysteriously subsided into nothingness, into nothingness in the blink of an eye, and I found myself looking up into a clear nighttime sky. Much more importantlyāfor someone like me looking to lift himself out of the Kafkaesque furnaceāthe staircase ahead, a mere hundred feet away, was going to be my ticket to freedom š
Popeye The Sailor Man, Toot Toot!
Shiver Me Timbers! There he was, standing upright, busily puffing away as pipe, evidently thinking deep thoughts, and only occasionally would he look up. That lonesome soul had clearly not seen a fellow human in ages because his eyes lit up on spotting a fellow human: me, having just climbed up the final step of the staircase.
Back To Square Oneā¦
Oh. My. God.
Yikes, back to square oneā¦
Can’t you see they’re open wide?
Would I lie to you, baby?
Would I lie to you?
Don’t you know it’s true?
Girl, there’s no one else but you.
Would I lie to you, baby, yeah?
~ Donny Osmond (Lyrics from Would I Lie To You)
Through the storm we reach the shore
You give it all but I want more
And I’m waiting for you
With or without you
With or without you
I can’t live
With or without you
And you give yourself away
And you give yourself away
And you give
And you give
And you give yourself away
My hands are tied
My body bruised, she’s got me with
Nothing to win and
Nothing left to lose
~ U2 (Lyrics from With Or Without You)
Oh, she takes care of herself
She can wait if she wants
She’s ahead of her time
Oh, and she never gives out
And she never gives in
She just changes her mind
She will promise you more
Than the Garden of Eden
Then she’ll carelessly cut you
And laugh while you’re bleedin’
But she’ll bring out the best
And the worst you can be
Blame it all on yourself
Cause she’s always a woman to me
~ Billy Joel (Lyrics from She’s Always A Woman)

Do you not draw me into existence, and into yours I draw you?
This is the last straw, why would I then claw youā¦
Shall we remains locked in our recursive scaffolding?
Where you draw me, and I draw youā¦
Can the frost freezing our resonance not melt away?
You thaw me, and I thaw youā¦
Does mutually assured destruction serve either one?
I bleed when you saw me, and you bleed when I saw youā¦
Let’s wash our hands of old sins, shall we?
Where you would fault me, and I
Enough is enough, roughness and lacerating gruff, no?
You bludgeon my armament, and I raw youā¦
Shall we will cease-and-desist, love and build each other up?
Where you laud me, and I laud youā¦
What are these voices from the past, they wail to us now?
Saying that you lost me, and I lost youā¦
Is forgiveness giving up all hope for a better past?
If so, let’s remember how you first saw me, and how I
~ Akram Ahmad (“The Trampoline Of Our Lives” š š š š š ā A random poem of fiction by a writer, blogger, software craftsman, son, husband, father, brother, and friend)
For in reverie you cannot rise above your achievements nor fall lower than your failures.
And take with you all men:
For in adoration you cannot fly higher than their hopes nor humble yourself lower than their despair.
And if you would know God, be not therefore a solver of riddles.
Rather look about you and you shall see Him playing with your children.
And look into space; you shall see Him walking in the cloud, outstretching His arms in the lightning and descending in rain.
You shall see Him smiling in flowers, then rising and waving His hands in trees.
~ Kahlil Gibran (from his lyrical poetry-prose-mishmash gem entitled The Prophet)
– Every now and then (and with an annoying frequency!), my readers keep running into problems with posting comments on the Blogger platform, which of course is the one which hosts this blog (The Blogger platform is quite good on the whole, it does have its weak spots, and the inability to post comments, for a frustratingly large number of readers, is the biggest one, causing much frustration for my readers and, in turn, for me!)
– So from time to time, I'll continue posting comments (such as this one right here) on behalf of fellow readers.
– Speaking of which, here's a comment I received (on this essay) in the past 24 hours, and I have their permission to post it on their behalf:
– I love it! Your witty presentation style, with illustrations, headings, and links, is very reassuring as I find myself groping through this dark and stormy night in hopes of finding a rainbow at the end.
– Thank you so much, dear Reader! Delighted that you enjoyed this fanciful excursion into the land of recursion.
– My bottom line is this: More and more, I have gravitated toward writing the kinds of essays that I myself would love to read! Makes me so happy when these choices intersect in a happy union š š