Software Actors, Rare Benefactors

0 f

So excuse me forgetting, but these things I do
You see I’ve forgotten if they’re green or they’re blue
Anyway the thing is, what I really mean
Yours are the sweetest eyes I’ve ever seen
šŸ’
~ Elton John (Lyrics from 
Your Song)

Preamble šŸ˜™

Disclaimer

If you’re new to this blog, presumably having found this essay and perhaps expecting celebrity gossipā€”about movie actors and actresses in Hollywood and stuff like that as might have been suggested by the picture above showing theatrical drama unfolding before the eyes of a mesmerized audienceā€”then I suggest that you stop right here and move onā€¦ šŸ’”

Look, I’m an in-the-trenches software practitioner and this is yet another contrarian takeā€”heavily peppered as always with abundant servings of culture and funā€”on a topic that remains near and dear to my heart: the rip-roaring wherewithal of software actors and what makes them tick! ā°

The Hollywood Principle

(By the way, should anyone be interested, we can, in a future essay, chat some about the glamorous Hollywood Principle: ā€œDonā€™t call us, weā€™ll call you!ā€) šŸŽ§

ā€” Reader: Akram, are you feeling all right? Or is this another one of your excursions into a stormy night of bedeviling recursion?
ā€” Blogger: I feel mighty fine, thank you. In fact, never felt better!
ā€” Reader: So are you going to tell us, like, what this new essay is about?
ā€” Blogger: Ah, yes.
(The Reader is getting perceptibly agitated now, having waited for a good two minutesā€¦)
ā€” Reader: Iā€™m still waiting for your answer, and so are 
a million other readers, for crying out loud!
ā€” Blogger: Oh, you wanted the answer right now, you donā€™t sayā€¦ Do you?
ā€” Reader: I do.
ā€” Blogger: Aha, donā€™t despair, hereā€™s what I got going for youā€”dear Reader who hails from the legions of my beloved readersā€”and I ask you to turn your lovely eyes to the snapshot belowā€¦
ā€” Reader: OK.
ā€” Blogger: Cool. So hereā€™s my storyā€¦ šŸŽ¬

28 f

What’s Been Missing?

Much ink and paperā€”a bit too much if you ask meā€”has been expended in the service of bringing the excitement of the programming and engineering communities to the general public, and with mixed results, too; it seems, and tiresomely so, as if something has been missing all along. And I think itā€™s high time to fix it ā°

This essay in particularā€”frankly this whole blog in generalā€”is (and has been for a while) geared very much toward fixing all that šŸ”Ø šŸ”© šŸ”§

Who says that engaging in the crafts of computer programming and engineering canā€™t be fun? Should there be someone who disagrees, then I can only ask you to bring them to me (so I can have a word with them in private!) šŸ‘»

Highlights Of The Fun Ahead šŸŽŖ

 

Meanwhile, and as is the wont of us geek types around here in the land of Programming Digressions, weā€™re going to have funā€”I strongly believe that fun should go with learning as much as learning should go with fun. So here goes, a peek at the undertones of this essay:

  1. A glance at how the introduction of software actors into the mixā€”as spearheaded by the visionary work of Jonas Boner and othersā€”has revolutionized our industry šŸ„
  2. An introductionā€”in the briefest of waysā€”to an amazing software project (Ptolemy) based in the esteemed EECS department of the University of California at Berkeley and which makes remarkable use of software actors šŸ“¬
  3. A fugue which can perhaps be traced back to Douglas Hofstadterā€™s endearing, Pulitzer prize-winning work that we know as Gƶdel, Escher, Bach: An Eternal Golden Braid šŸ™ˆ šŸ™‰ šŸ™Š 
  4. A stream-of-consciousness collage inspired by the likes of Pink Floydā€™s timeless rock opera that we fondly call The Wall šŸŽ„
  5. This essay will be far more experimental (in nature) than its predecessors (A word to “the wise,” a community to which Iā€™m ceaselessly trying to ascend, Sisyphus-style). See the next pointā€”an  final and strongly-present undercurrent of this essayā€”for a bit more detailā€¦ šŸš§
  6. The notionā€”one that is ever-present in the mind of yours trulyā€”that real artists ship: in tirelessly searching and carefully curating the images you find soon (in the collage of sorts), I might have bitten off more than I could chew. Woohoo (!) šŸ¶
  7. And as I said above, “real artists ship“, of which I often remind myselfā€”otherwise, this blog just wouldn’t happen! The upshot of all this, of course, is that, in lockstep with the previous point (about how this essay will be decidedly experimental), you find this essay incrementally evolve before your eyes as the days go byā€¦ ā›µ
  8. Finally, I will add some real-time updatesā€”to go hand-in-hand with the previous announcementā€”as I go along: Look for those updates in the “Comments” section toward the end! šŸ

Collage, collage, wherefore art thou? šŸ‘€

The Collage Fun Begins Right Here (Admit One)

 šŸŽ« šŸŽ« šŸŽ« šŸŽ« ā€¦ šŸŽ« 

 ā€” “Hey, just one, I said!” I mean, what are those ton of admission tickets above doing here?!) Okay, let we worry about that later (our accounting system has gone bad or something, spewing out fake admission tickets!)ā€¦

Meanwhile, let’s start our tour of the gallery of actors, shall we? šŸŽ­ šŸŽ¬ šŸŽŖ šŸŽØ

29 f

It All Began With An Ideaā€¦

So whatā€™s all this about software actors and amazing benefactors? Well, read on to find out!

You can tell that you’re onto something incredible when one of the clearest-eyed thinkers in our software industryā€”Jonas Boner, a programming visionary extraordinaire who happens to be one of my mentorsā€”has devoted a large chunk of his life to bringing an idea to life (and indeed to its fruition), and has this to say about the idea that started it all:

When Carl Hewitt invented the Actor model in the early 1970s he was way ahead of his time. Through the idea of actors he defined a computational model embracing nondeterminism (assuming all communication being asynchronous), which enabled concurrency and, together with the concept of stable addresses to stateful isolated processes, allowed actors to be decoupled in both time and space, supporting distribution and mobility.
~ Jonas Boner (In the Foreword to Vaughn Vernonā€™s awesome book called 
Reactive Messaging Patterns with the Actor Model: Applications and Integration in Scala and Akka ā€” Addison-Wesley Professional)

Read on to find the concluding thoughtā€¦
6 f

What The Actor Model Brings To The Table

To bring closure to the aforementioned introduction of the power of an idea, hereā€™s what Jonas adds to it in the same breath:

Today the world has caught up with Hewittā€™s visionary thinking; multicore processors, cloud computing, mobile devices, and the Internet of Things are the norm. This has fundamentally changed our industry, and the need for a solid foundation to model concurrent and distributed processes is greater than ever. I believe that the Actor model can provide the firm ground we so desperately need in order to build complex distributed systems that are up for the job of addressing todayā€™s challenge of adhering to the reactive principles of being responsive, resilient, and elastic. This is the reason I created Akka: to put the power of the Actor model into the hands of the regular developer.
~ Jonas Boner (continuing, in the Foreword to Vaughn Vernonā€™s Reactive Messaging Patterns with the Actor Model: Applications and Integration in Scala and Akka ā€” Addison-Wesley Professional)

Wow! Talk about realizing the power latent in Hewittā€™s visionary thinking, and then dedicating oneself to make that dream come true, as you may well have noted in Jonas’s concluding words above (i.e. ā€œThis is the reason I created Akka: to put the power of the Actor model into the hands of the regular developer.ā€)

I invite you to re-read the message aboveā€¦ šŸŽÆ

I invite you to re-imagine the message aboveā€¦ šŸ˜“

3 f

The Movies, Akram, The Movies!

Again, to disabuse you of any lingering notion that the potion we’re smacking about is that of software actors; itā€™s not movie actorsā€”such as the melodramatic pair in the picture aboveā€”that we are hankering for today. (Wait up a bit, and all will be clear, I promise!)

Hereā€™s the deal: If youā€™re like meā€”relentlessly searching for better ways of doing thingsā€”you will sense, even know almost immediately that you donā€™t want to miss thisā€¦

Indeed, software actors are amazing benefactors, and we are going to find out exactly why and how!

That actors have become our benevolent benefactors is mainstream and a commonplace now: How this came to be is in many way a tribute to a number of people who have doggedly pursued their vision of making this a reality (I sincerely believe that the success of actors is a singularly spectacular example of academia and industry joining hands to achieve more than they ever could have on their own!)
4 f

Hey, What You Got Up Your Sleeves?

 ā€” Hey Akram, wait a secondā€¦ You got yet another actor in the picture above to throw us off-balance?!

 ā€” Um, not really; all I’m trying to do is drive home the point that itā€™s software that we be talking about today. (Again, wait up just a tad, and all will be clear!) šŸŒž

In fact, letā€™s dive right into it! šŸŠ

And we’ll do so with a marvelous introduction of sorts by Stephen Blackheath and Anthony Jones in their delightful book called Functional Reactive Programmingā€”the amazing folks at Manning Publications sure consistently produce stellar books on all things softwareā€”where the authors start out by posing a simple question to the reader, innocently asking

 

What is the actor model?

Actors often marry models, as you can see in the figure, but weā€™ll leave our analysis of the entertainment industry for another time.

Actors are a model of concurrency first developed in the 1970s. The programming language Erlang and, more recently, reactive frameworks like Akka make extensive use of it. Itā€™s especially suited for distributed computing because of its ability to tolerate runtime failures and to hot-swap components. Itā€™s been proven in large-scale commercial applications. 

The actor model: An actor is a process whose job is to handle incoming messages from a single asynchronous input queue. Each actor has a public address, and other actors that know the address can send the actor messages. Actors commonly use a reply mechanism that sends a message to the originator of an input message. Actors can spawn new actors, and they can send the address of an actor to another actor over a message. Actors as theyā€™re commonly implemented have a thread-like flow of control. We think thereā€™s a lot of potential for FRP and actors to work together. You could, for example, implement the logic of an actor within an established actor-based framework using FRP.
~ Stephen Blackheath and Anthony Jones (in 
Functional Reactive Programming ā€” Manning Publications)

Itā€™s been said that no two snowflakes are alike. Can the same be said of water drops, of actors (both of the human and software type)?

63 f

No man is an island entire of itself; every man 
is a piece of the continent, a part of the main;
if a clod be washed away by the sea, Europe
is the less, as well as if a promontory were, as
well as any manner of thy friends or of thine
own were; any man’s death diminishes me,
because I am involved in mankind.
And therefore never send to know for whom
the bell tolls; it tolls for thee.

~ John Donne (MEDITATION XVII in Devotions upon Emergent Occasions)

A few water drops by themselves admittedly donā€™t have much momentum going for them. But what happens when a bunch of those drops start assembling; anyone remember what John Steinbeck got rolling for common workers in the United Statesā€”his underlying message for workers to unite for their cause as couched in the context of the heart-rending saga of the Joad family’s travailsā€”with the publication of his novel The Grapes of Wrath?

63 5 f

No Man Is An Island Entire Of Itself

Much like John Donneā€™s emphatic reminder (that “No man is an island entire of itself; every man is a piece of the continent, a part of the main;ā€) that we came across just a breath ago, a software actorā€”in and of itselfā€”really canā€™t do much. (By the way, his reference to being ā€œā€¦a part of the mainā€, Iā€™m sure is not, at least I hope not, an impious suggestion to bulk up the entire logic of any given computer program into the fateful method we all love, hate, and otherwise know by the name public static void main(String[] args){ … }) or at least  that’s what we’ve got going for us in the Java programming language) šŸ¢

But I digress.

Anyhow, start adding more and more actors (like water drops assembled in a grid, making ever-denser super-connections between one another) and there is no limit to what you can accomplishā€¦ Weā€™ve got something rolling here, we got mojo! šŸƒ

64 f

Ashes To Ashes, Dust To Dust

And it all leads up toā€”water-drop unto water-drop unto trickle unto stream unto river unto sea unto oceanā€”the tides crashing on the seashore. Yep, soon enough, you can have at your fingertips the power of softwareā€”fueled of course by the collective agency of networked actorsā€”with at least as much force as the waves that crash on the shores of civilization as we know itā€¦ šŸŒŠ

7 f

Let It Crash!

It is in the interaction of thousands and millions of software actors that promise of decoupled software comes into its own. The interconnectivity can bend and twist through all kinds of contortions and yetā€”through powerful software libraries like Apache Akkaā€”we remain confident in the knowledge that the software system will remain supple, intact, and resilient. For one thing, Akka is deeply inspired by the Erlang philosophy of ā€œLet it crash!ā€. Apache Storm comes to mind as another prominent example of a software framework that fully embraces the fail-fast philosophy (aka resilience)ā€¦

1 f

One More Time (And This Time With Emotion!)

ā€” One more timeā€”all together nowā€”is it theater actors that weā€™re talking about? šŸŽ­
ā€” Of course not, you yell back! šŸ‘»
ā€” Darn, you didnā€™t have to be that loud either!! šŸ™‰

8 f

E Pluribus Unum (Out Of Many, One)

As you looked at the picture above of the endodermis of tightly packed cells, were you thinking what I was thinking? Put simply, one cell by itself canā€™t do much; put a bunch of them together and youā€™re off to the races šŸŒ

Same goes for software actors (Probably less so for movie actors, thought who am I to speak for their guild?) Remember, too, how the very roots of object-orientation were gleaned by Alan Kay in his pioneering work? Yep, there you go šŸ“¦
9 f

Nature: The Ultimate Engineer

Soon enoughā€”thinking here to our previous example involving the trace which lead us from puny water drops all the way up to roaring tidesā€”this kind of growth (and taking the example now of a coral reef as in the picture above) eventually led to structures of towering magnificence. See how the harried fish take shelter under one such coral structure?

10 f

Humans: The Runners-Up

So that was Nature at work. Man, on the other handā€”hey relax cuzā€™ I ainā€™t got no jeremiad coming your wayā€”with his propensity for synthesizing things more mundane, goes about synthesizing burgundy footwear, ultimately dangling his synthesized product as in the picture above. And guess what he does? He foists them atop a fake, white coral-like memento! Sheeshā€¦ šŸ‘ 

Oh well, what can I say? There ainā€™t no harried fish I know of that is going to take shelter under such a structure anytime soonā€¦ šŸŸ šŸ  šŸ” šŸŸ šŸ  šŸ” šŸŸ

11 f

To Nature We Look (One More Time)

Not to worry though: Man’s got his act together in a ton of other areas, chiefly in the arena of engineering. But to take one more example of Nature at workā€¦ Ah, good old cellular mechanisms have got their act together; theyā€™ve had their act together for millions of years and counting.

Nature is the ultimate engineer. We software types ever turn to Nature for inspiration. Forevermore will be continue to do so, amirite? šŸš šŸš šŸš šŸš ā€¦ šŸš

12 f

Networks Of Pulsating Objects

Symmetryā€”fearful or otherwiseā€”as in the picture above is but an example of manā€™s take on his selfsame attempts to attack (technological) problems as he deems fit šŸ…

The drive to uncover the fitness of things is a powerful driving indeed. But what you get in the end is a pulsating network made up of loosely coupled constellations of objectsā€”the bits and bytes of the underlying substrate doing the bidding of these abstract constructsā€”that we have at our disposal. And as always, the limits of the human imagination are the limits of what can be achieved with this power.
Enter functional programming. But I digress: Iā€™ll leave you with merely a (dangling(!)) pointer hereā€¦

77 f

Prime Territory For The Actor Model

Enter Reactive Programming. And here I decidedly do not digress; reactive programming is prime territory for the actor model. What you’ll see in the picture aboveā€”and in the handful followā€”is a snapshot in time that captures the brilliance of some luminaries in the firmament of software design and developmentā€¦

76 f

Tell All The Truth (But Tell It Slant)

Another view, albeit told slant, told to mold the fold of the underlying origami that will perhaps elude you at this time, but which is fully present all the same šŸ’

(Hint: Did anyone notice the Towers of Hanoi in their, somewhere? Recursive bootstrapping anyone?)

75 f

Composition: All The Way Down!

This view is being told even more slant, cold and rolled, but never sold; a writer worth her salt never sold herself. Never. Ever. Did anyone notice the hefty UNIX tome? If so, does it remind youā€”now that Iā€™ve let the cat out of the bag by alluding to the UNIX philosophy of composing with pipes and filters and stuffā€”of what gets you excited every single day as you wake up and imagine assembling ever more powerful compositions of software wizardry as enshrined in our objects (of desire)? Yep, it is objects and functionsā€”and actorsā€”all the way down! (Take it from someone who has worked in the trenches for over two decades).

Hey, I Got My T-Shirt!

  • Yes, Iā€™ve been there, done that, and got the T-shirt šŸ‘•
  • Yes, Iā€™ve been there, done that, and I’m immensely proud of it šŸ’™
  • And yes, I “believe” in software actors in part because Iā€™ve known the sincerity and genuine awesomeness of rare benefactors šŸŽÆ

Actors Even Up There?!

See the Lockheed C-130 Hercules dropping flares as in the picture above? Yep, Lockheed Martin sure keeps on making powerful flying machines. I wonder how much of the software that powers, in turn, such flying machines is itself powered by software actorsā€¦ šŸš€

Have you thought about it? šŸ˜œ

13 f

Hey, What’You Doing, Cellular Automata Thingamajig?

One more time, to reinforce the ideaā€”nobody heard me use the word didactic ever, now did they?ā€”would you be willing to suspend your judgment and blurt out whether the cellular automata-like sprawling (and semi-spiraling) thingamajig above reminds you of something? (Hint: The core idea of that thingamajig in action is a five-lettered wordā€”it starts with the letter ā€œaā€ and ends with the letter ā€œrā€ā€”and that word is commonly used to describe movie stars. OK, no more hints. Itā€™s all on you from here!) šŸ€

14 f

Actors In A Parallel Realm

For those of you not yet familiar with my fondness for the prose written by Philip M. Bromberg, I invite you to check out what he’s been up to, at least what he was up to the last time I checkedā€¦ āœ…

Meanwhile, let’s you and I take in Bromberg’s take on actors and such:

To underscore his argument, Whyte quoted Hippolyte Taine, the 19th-century French philosopher and literary historian who also questioned the idea of separating conscious and unconscious into different realms. In imagery that I find breathtakingly comparable to current thinking about the structure of the mind, Taine wrote, 

“One can… compare the mind of a man to a theatre of indefinite depth whose apron is very narrow but whose stage becomes larger away from the apron. On this lighted apron there is room for one actor only. He enters, gestures for a moment, and leaves; another arrives, then another, and so on…. Among the scenery and on the far-off backstage there are multitudes of obscure forms whom a summons can bring onto the stage … and unknown evolutions take place incessantly among this crowd of actors” [Taine, 1871, cited in Whyte, 1960, pp. 166-167] šŸŽ¬ šŸŽ­ šŸŽ¬
~ Philip M. Bromberg (
Awakening the Dreamer: Clinical Journeys ā€” Taylor and Francis)

Now is that mind-bendingly cool or what?

15 f

Oops, We Have A Maalox Moment Here!

ā€” Nemo: Hey Dory, Nemo here. Is itā€¦ safe to come out?! šŸŸ
ā€” Dory: Well, it depends. Look, the bottom line is that, as Vaughn Vernon said swimmingly well in the fishy Preface to his cool book (Reactive Messaging Patterns with the Actor Model: Applications and Integration in Scala and Akka) when he hastened to comfort us that… “if Functor and Monad sound like viruses you caught as a child, steer clear of scalaz for a while.” šŸ 
ā€” Nemo: Methinks I’ll stay put in my comfort blanket (the corals) a bit more!
šŸŸ

    16 f

     So We Pause To Regain Our Composureā€¦

    • Rhythmically swaying in the ocean currents, how far have the tentacles spread?
    • What are the outer reaches of actors?
    • Deterministic or nondeterministic, evolutionary or revolutionary?
    • Anything else going on?

    ā€¦and move right along šŸš“

    17 f

    Actors Revel In The Perfect Storm

    Do clouds make you think of fractals? Itā€™s quite all right if you answered no; I used to have the same response before I read the marvelous book Chaos: Making a New Science by James Gleick.
    What else? What do clouds make you think of? How about cloud computing? Now we are getting warmer: Cloud computing is one of the crucial ingredients that make up the perfect stormā€”along with of course the Internet of Things (IoT), multicore processors, and mobile devicesā€”which directly led the software industry to embrace software actors (Other kind of actors may follow suit, although Iā€™m not holding my breath for that to happen anytime soon!)

    18 f

    Are There Actors Even In There?!

    Hey, that person kneeling on the floor, hands intently on his keyboardā€”he seems to be peering into the guts of an actuator arm even as he is surrounded by all kinds of gadgets which include an overhead displayā€”and he sure seems to be having a lot of fun! Iā€™m willing to bet that the software in action involves actors in some way, shape, or formā€¦

    19 f

    Multicores Streak, Scream, And Screech!

    Now is that one slick time-lapse photograph of a nighttime, cosmopolitan street or what? So why did I include it here? Simply because the red-light streaks left suspended in midair by the tail-lights of vehicles whizzing byā€”much like the thousands of smiles one can imagine being left behind in suspended animation by an equal number of Cheshire Cats that disappeared a priori on the spotā€”remind me a lot of the circuitry inside multicore processors cranking away in mechanistic unison. And guess where all those multicores lead to: software actors but of course!

    20 f

    Akram, How Did You Get Away With This Now?!

    Iā€™ll fess straight up that the only reason the high-speed train above made it here is that it vividly reminds me of JCIP (JCā€¦ what?! Oh, you meant JC Penney, right?) Okay, so for the 10 people on this planet who are not familiar with the classic book called Java Concurrency in Practice (known fondly by its initials JCIP) by Brian Goetz et al, if you want to understand actors, you have to start here; this is concurrency done right especially if you happen to professionally inhabitā€”as I doā€”a world run (predominantly) by Java programs.

    21 f

    It Starts Innocently Enoughā€¦

    It all startsā€”as all traffic congestion fiascos doā€”with tiny contributions such as made by the arrival on the scene of a pair of bicyclists above (Hey, you two, didnā€™t someone tell you that itā€™s smart and cool to wear helmets? Itā€™s your own noggin that you be protecting, for crying out loud!)

    22 f

    A Juggernaut-In-The-Making!

    The tiny contributions to the traffic juggernaut-in-the-making keep adding until itā€™s not a trickle anymore; we have a stream of traffic on our handsā€¦

    23 f

    Actors To The Rescue Of (Traffic) Gridlock

    Soon enoughā€”sooner than most city planners would care to admit the frequency with which it happensā€”the stream of traffic transforms into a veritable river (Proof of purchase appears by way of the picture above in which you’ll spy an about-to-be-clogged roundabout).

    24 f

    Akram Needs To Dig Out His Queuing Theory Text!

    Is this an M/M/1 queue or something or just my single-track mind at work? šŸš„

    25 f

    Mesurier Marcel Proust, I Introduce You To Actors

    Remembrance of Things Pastā€¦ So I was saying?

    26 f

    Preparing For A Berkeley Touchdown

    Imagining a remembrance of things futureā€¦ (I almost cringed at using the word “adumbration” here even though it fit the bill perfectly; somehow that word doesnā€™t sound like part of “normal” speech, whatever, I guess, that might beā€¦ But then again, a bunch of words I had memorized eons ago when studying for my GRE, coming on the heels as it did of an analogous venture for my SATā€”right around the Paleozoic period it was as I recallā€”also didnā€™t quite sound like the word which would have a place in “normal” speech!) šŸ‰

    Digressions aside, with you in mind of course, I got to thinking: So ya thought ya might like to go to the show? šŸŽ­

    Strap on your seatbelts for the ride ahead as we get on the autobahn otherwise known as Ptolemy which, as I said at the outset, is an amazing software project based in the esteemed EECS department of the University of California at Berkeley. It makes some really cool use of software actors šŸ˜Ž

    66 f

    Hey, I Got Actors Prancing Around In My Eclipse Work-space!

    As you’ll spy (in the picture above), Iā€™ve got the Ptolemy II code-base all loaded up (and running in debug mode actually) in my Eclipse work-space. There is admittedly far too much going on in the picture above of my Ptolemy II code-base, so feel free to spend a few minutes digging into the nooks and crannies of what Iā€™ve got captured just for you šŸ”¦ šŸ”§ šŸ”Ø šŸ”© šŸ”Ž šŸ”¬ šŸ”­ šŸ”— šŸ”¦

    (I spent a fair amount of timeā€”all the while remaining mindful of the adage that a picture is worth a 1,000 wordsā€”packing as much information as I could, as densely as I could, into these handful of snapshots: I hope this works for you!)

    Pretty much the same goes for the next set of images in our collage: Iā€™ve tried to capture as best as I could a mere handful of aspects to (hopefully) give you a flavor of the goodies that await you in the Ptolemy II code-baseā€¦ šŸŽ šŸŽ šŸŽ šŸŽ ā€¦ šŸŽ

    67 f

    Stellar Coding Style On Display!

    As for the image above, Iā€™ve drilled down into the guts of a neat little methodā€”the fully qualified name  for those who want to go to the details is ptolemy.domains.ddf.lib.DDFSingleTokenCommutator.connectionsChanged(Port)ā€”which, according to the accompanying Javadoc, essentially goes about doing the following:

    Pre-calculate the rates to be set in the rate parameter of the input port. Initialize the private variable _rateArray, each element of which indicates the input port needs to consume one token from a corresponding channel and no token from the rest of the channels.

    So I didn’t choose this pointā€”drawing your attention to the documentation aspects of the Ptolemy II code-baseā€”randomly either: I wanted to, as best as I could, illustrate a mere smidgen out of the copiously and thoroughly documented code, which makes reading the code a pleasure! šŸ‘
    68 f

    Interacting With Code Visualizations, Oh My!

    Uh oh, yours truly clearly hasnā€™t figured out the ins and outs of playing with the DDFSingleTokenCommutator as you can clearly tell from the helpful (Stack trace) pop-up staring me in the face, telling me that somethingā€™s up with an (XML) element in the DE Director. Dude, itā€™s time to hit the Javadoc to bail myself of this lovely mess Iā€™ve got myself into. Hey, itā€™s all good: this is my idea of funā€”untangling delightful puzzlements such as this oneā€”and Iā€™m going to get to the bottom of it! šŸš§

    See the helpful visualization pop-upā€”one of the many helpful pop-ups that have mushroomed to help me out in my Eclipse work-spaceā€”right behind the (Stack trace) pop-up? Yep, the one with the delightfully color-coded visualization of the workflow (And best of all, the Ptolemy II environment lets you interact with the visualization in an intriguing variety of ways. I’m loving it!)

    Time to dig inā€¦ ā›

    And hey, I havenā€™t forgotten about delving into the Javadoc like the one below, amirite? šŸ“•
        /** Construct an actor in the specified container with the
         *   specified name
         *  @param name This is the name of this distributor within
         *   the container.
         @param container The container.
         *  @exception NameDuplicationException If an actor
         *   with an identical name already exists in the container.
         *  @exception IllegalActionException If the actor cannot be contained
         *   by the proposed container.
         */
        public DDFSingleTokenCommutator(CompositeEntity container, String name)
                throws NameDuplicationException,IllegalActionException {
            super(container,name);

            input_tokenConsumptionRate=new Parameter(input,
                    “tokenConsumptionRate”);
            input_tokenConsumptionRate.setVisibility(Settable.NOT_EDITABLE);
            input_tokenConsumptionRate.setTypeEquals (new ArrayT  }


    69 f

    Not All Who Wander Are Lostā€¦

    ā€¦just as all that is gold does not glitter. And from the looks of itā€”check out the gazillion results returned in the ā€œSearch” tab docked to the southwest region of my Eclipse work-spaceā€”Iā€™ve been searching high and low. Where, oh where will my searches lead me to? Fair question there!

    For one thing, Iā€™m going to have some fun looking into a tonne (we Americans would of course spell it “tons”, but hey, thatā€™s my early, British education poking out unbidden!) of actor libraries, and of course the domain polymorphic components. Cool and righteous stuff (Whoa, did I spy even something about data polymorphism in there?! Dude, my Clojure sensesā€”code is data and data is codeā€”are tingling like gangbusters this second! šŸž

    70 f

    The Actors (In Ptolemy II) Are Alive And Kicking!

    Having loaded the same (Ptolemy II) code-base into good old IntelliJ IDEAā€”my IDE of choiceā€”I couldnā€™t help but notice just how active the code-base is šŸš€

    Dude, this project is alive and kicking and moving right along: I couldn’t help but notice code commits to the SVN repository right up to the present day! (I invite you to “check out”ā€”using that phrase and its overloaded senseā€”the ā€œVersion Controlā€ tab toward the bottom of the picture above and you can’t miss the steady stream of ongoing commits to the development branch of Ptolemy II in the SVN repositoryā€¦) ā›³

    71 f

    Scala, Wherefore Art Thou, Scala?

    And hey, the fun Iā€™m having with porting the (Java) code-base to the Scala programming language is in its infant stages so itā€™s probably best that you not look at my preliminary results šŸ‘€

    (Since we are on the subject of Scala, I’ll mention in passing that the Ptolemy II environment has some REPLlike capabilities: instantaneous feedback during interactions with the JavaScript portions of the code-base that you can update and have reflected real-time in the view-rendering of the updated model. Hot-swaps of code are supportedā€”this is one of the many areas in Ptolemy II that I look forward to tinkering withā€”for the Java portions of the code-base!)

    I mean, you could, but then you would likely find yourself reaching into your medicine closet for a healthy serving of Maalox (Just sayinā€™) šŸ˜‰

     YMMV šŸš— šŸš• šŸš™ šŸšš šŸš› šŸšœ šŸšŒ šŸš‚ šŸšƒ šŸš… šŸšŸ šŸš£ šŸš¤ šŸšŽ šŸš² šŸš“ Again, just sayin’ā€¦

    72 f

    Hey Akram, RTFM* (And The Javadoc While You’re At It!)

    Hey, hey, heyā€¦ I was going to add something to go along with the image aboveā€”showing yet another ā€œsliceā€ of the (Ptolemy II) code-base as viewed from my IntelliJ IDEA work-spaceā€”but something happened along the wayā€¦ šŸ‘’

    I broke into a song sung by (you donā€™t want to hear me singing!) the one and only Chris Cross. It went like this šŸŽø

    Well, it’s not far down to paradise, at least it’s not for me
    And if the wind is right you can sail away and find tranquility
    Oh, the canvas can do miracles, just you wait and see
    Believe me
     

    It’s not far to never-never land, no reason to pretend
    And if the wind is right you can find the joy of innocence again
    Oh, the canvas can do miracles, just you wait and see
    Believe me
     

    Sailing takes me away to where I’ve always heard it could be
    Just a dream and the wind to carry me
    And soon I will be free
     

    Fantasy, it gets the best of me
    When I’m sailing
    All caught up in the reverie, every word is a symphony
    Won’t you believe me?
     

    Sailing takes me away to where I’ve always heard it could be
    Just a dream and the wind to carry me
    And soon I will be free
     

    Well it’s not far back to sanity, at least it’s not for me
    And if the wind is right you can sail away and find serenity
    Oh, the canvas can do miracles, just you wait and see
    Believe me
     

    Sailing takes me away to where I’ve always heard it could be
    Just a dream and the wind to carry me
    And soon I will be free
    ~ Christopher Cross (Lyrics from 
    Sailing)

    RTFM* (i.e. Read The Farming Manual) šŸŒ¾ šŸŒ¾ šŸŒ¾ šŸŒ¾

    73 f

    System Design And Modeling Using Actors (Part One)

    Notice the hefty volume standing upright, perched atop a stack of ragtag books that periodically float around in orbitā€”not in outer-space I hasten to addā€”inside the confines of my house? Yep, that’s the final word (aka the collected wisdom) on the subject of doing things right with actors using Ptolemy II. It’s available online freelyā€¦

    74 f

    System Design And Modeling Using Actors (Part Two)

    And what you see above is basically another view of the bookā€”the back of the Ptolemy II book to be preciseā€”on understanding the wherewithal of of Ptolemy II (i.e. the ins and outs of what makes it tick and cool stuff like that). Hey, you may have notice the wizened philosopher on the coverā€¦ ā³

    So that’s good old Claudius Ptolemaeus, the fine chap who came out of retirement just to (ghost) write this amazing volume and thereby enlighten the engineering and programming worlds on the coolest of actors šŸ˜Ž

    61 f

    E Pluribus Unum (One More Time!)

      Quick now, what is…

      • An ant by itself? šŸœ
      • A drop of water by itself?šŸ’§
      • A grain of sand by itself? šŸ”¬

      Not much!,” you yell back with great enthusiasm, which is nice, yay! See, this whole “didactic” businessā€”oops, I didn’t use that word now or did I?ā€”is there for a good reason: to drill the goodness of an idea deep into the recesses of your cranium šŸ’€

      (But then again, what do I know?) šŸ’¤

      62 f

      Strength In Numbers (One More Time!)

      Quick now, can a…

      • Colony of ants (actors) not overcome disproportionately larger foes? šŸœšŸœšŸœšŸœšŸœ
      • Sea of water-drops (actors) not overrun the most formidable problems?šŸ’§šŸ’§šŸ’§šŸ’§šŸ’§
      • Vista of sandy tracts (actors) not overtake the most intractable messes? šŸ”¬šŸ”¬šŸ”¬šŸ”¬šŸ”¬

      You got it!,” I, in turn, bellow with enthusiasm equal to that of my audience, as I bask in the satisfaction of having got the point across that there is indeed strength in numbers: a handful of actors won’t get you very far, but stitch together a network of these amazing software objects and you’re off to the races šŸƒ

      (But then again, what do I know?) šŸŽ“

      27 f

      Micro-Faust (A Tiny Smidgen Of A Bargain)*

      Try stopwatch: Hey you, timing-reactor!
      Yo, actor
      You I intend to refactor
      This time I be your benefactor
      Amirite, will you then be a sniveling malefactor?
      Should you desist, then redact away, you redactor
      Meanwhile, I’ll contract the way for you, my contractor

      Catch stopwatch: You again, timing-reactor!
      Throw: Should I be remiss, please forward me to 
      Shacterā€¦
      Finally: Calculate the factor

      * So this was chiefly an exercise to calculate the time-factorā€”complete with a Faustian interlude of courseā€” for which Akram can be kept away from breaking into verses of poetry, from waxing wee lyricalā€¦ šŸŽ»

      60 f

      Hey, We’ve Seen This Before!

      I know you haveā€¦ (And yes, you’re correct, the picture above has indeed shown up earlier in this essay; I put it here a second time just to see if you are still awakeā€”don’t you now be accusing me of being devious or something, okay?) šŸ˜“

      Anyhow, it appears that you areā€¦  sound asleep! šŸ˜³

      Look, even if you’re fast asleepā€”hey I welcome people of all stripes to our blog here including card-carrying members of any extant somnambulists’ associationsā€”I encourage you to continue reading (Lots more fun stuff ahead for you!) šŸš¶

      83 f

      Enacting Figaro

      Andā€”just to be perfectly clearā€”it’s not redacting that we are talking about here: it’s enacting, and Figaro at thatā€¦ (“Okay Akram, you’re busted real good this time ‘cuz there ain’t no connection between software actors and Figaro and acting or, for that matter, enacting!”, you scold me).

      Here’s what I got to say in my defense: “Ooh, but there’s more of aā€”for sure far more than a tenuousā€”connection than meets the eye when it comes to establishing a nexus between those seemingly disparate items (software actors, Figaro, and acting), yoohoo”. Check this:

      Enacting Figaroā€¦
      29 f

      30 f

      81 f
      31 f

      32 f

      33 f

      84 f

      34 f

      35 f

      36 f

      85 f

      What Is This Thing That Builds Our Dreamsā€¦

      ā€¦yet slips away from us?

      What could the books in the picture above (the three atop that ragtag bookshelf now), and in the order that they’re decked out, have possibly to do with software actors? Nothing šŸŒ‹

      And everything šŸŒˆ

      So however tenuous a connection there might now be floating around and congealing in your imagination, I can assure you of the presence of a strong connection between the material of those books and the subject matter of this essay (all things actors). It would take (at least) a whole another essay to do justice to establishing that very nexus and will have to wait for its time ā³

      37 f

      [Empty space]

      39 f

      40 f

      [Empty space]
      84 f

      41 f

      42 f

      82 f

      43 f

      44 f

      [Empty space]

      45 f

      46 f

      47
      [Empty space]

      53 f

      44 f

      45 f
      [Empty space]

      49 f

      48 f

      46 f

      [Empty space]

      36 f

      37 f
      [Empty space]

      58 f

      55 f

      59 f

      [Empty space]
      58 f

      50 f

      51 f

      [Empty space]
      54 f

      56 f
      [Empty space]
      52 f

      57 f

      Experimental Afterword šŸ”®

       

      Experimenters Ahoy!

      Much as I said at the outset, this essay was going to beā€”dare I say that’s how it turned out?ā€”far more experimental (in nature) than its predecessorsā€¦ šŸš§

      As you took in the collage aboveā€”we had fun and we went places but we still have empty spaces of which some were even annotated with the “[empty spaces]” moniker in fits of literal-mindednessā€”did your mind to turn to (I’ll ‘fess up: Mine did!) to these hauntingly memorable lyrics

      What shall we use
      To fill the empty spaces
      Where we used to talk?
      How shall I fill
      The final places?
      How should I complete the wall

      ~ Pink Floyd (Lyrics from
      Empty Spaces)

      Any ideas? (And you don’t have to answer all at once now!)

      2 comments

      1. – Thanks a ton, Nadia, for your endorsement of this essay! I'm glad you enjoyed the post šŸ™‚

        – As I've noted elsewhere, much ink and paper (a bit too much if you ask me) has been spent in the service of trying to bring the excitement of the programming and engineering communities to the general public, and with mixed results, too; it seems, and tiresomely so, as if something has been missing all along. And I think it's high time to fix it.

        – So this essay, in the (same) spirit as all the other essays that appear on this blog, is hopefully a nudge in that direction: Far from being something akin to the onset of rigor mortis, the pursuit and practice of software engineering should really be about having fun!

      Your Comment Here!

      This site uses Akismet to reduce spam. Learn how your comment data is processed.