Monday, 11 May 2015

Wizards and Warriors

What Could Possibly Go Wrong?
Players, such as wizards and warriors, have weapons; such as staffs and swords.
So innocuously begins Eric Lippert's latest forage into object-oriented design. Like all of his best work, this adventure soon takes us into various intuitive dead ends and surprising ambush back-alleys. You will nod sagely as he overcomes each successive objection, excises each fly from the ointment, with a new design principle or approach; THEN CURSE as your newest paradigm rears up and bites you in the assets. Finally, you will marvel at the astonishing and enlightened conclusion of it all, by which time you will have become a better human being in every sense that matters (to an object-oriented software designer).

Enjoy it here:
Part One
Part Two
Part Three
Part Four
Part Five
Note: the "DSLs" that emerge toward the end of Part Five are of course Domain Specific Languages.

Tuesday, 10 March 2015

The Uroboros and Other Quines

The 50-Language Uroboros
Eleven, Fifty, One Hundred Languages...

Something over five years ago, I described Yusuke Endoh's cycle of eleven programs - each of which, "written" in a particular computer programming language, prints out the source code - in a completely different language - for the next program in the cycle. Here, I have put the verb "written" into "so-called quotes", because in fact every program in such a cycle is auto-generated by the preceding one. So in fact, nothing at all need be "written", in the sense of "consciously composed" - half a dozen decent monkeys banging on a few old typewriters for a fortnight ought to suffice!

Just kidding, of course. Yusuke-san's achievement was and remains a very clever and unspeakably elegant construction. That its method of discovery can so readily be explained, and thence extended and generalised in various ways, detracts in no part from this.

The 100-Language Uroboros
Cyclic Cod Cosmologies

At the time, this extension of the Quine concept made me muse on the subject of Sims. The notion that our universe is "almost certainly" a simulation was trending highly at the time, and this cycle of languages seemed to lend the air of a Kekulé, benzene-ring "snake anecdote" to the previously hierarchical model of Sims creating Sims, creating Sims... and turtles all the way down.

For what if the laws of thermodynamics, working their random magic on the primordial "box of smoke" bestowed on us by an unstable vacuum, at some particular moment allowed the appearance of a configuration matching one of these Quines? Why then, wouldn't the subsequent evolution of the system be driven deterministically through the remaining phases, and eventually, back to that same starting configuration? In other words, the prime mover may be the ultimate effect, and we may well be products of creations we have authored.

Obviously this cosmology glosses over the fact that the laws of physics do not, in fact, appear to comprise a particular sequence of discrete, high-level computer language compilers and interpreters. Pah! Don't distract me with such trivial details!

Subsequent Developments

The original sequence of eleven languages went like this: Ruby, Python, Perl, Lua, OCaml, Haskell, C, Java, Brainfuck, Whitespace, Unlambda (and then back to Ruby). Then I missed a landmark in the development of this program cycle, because in 2012, Yusuke-san produced a 50-language variant demonstrating his complete mastery of the technique. Not so much by the sheer number of languages, as by the arbitrary character of his choice of "50" as a temporary stopping point, and the fact that all 50 languages are sequenced in alphanumeric order of language name!

Now there's a 100-language version, announced to the world on December 23rd, 2014 with the comment, "the 100th language: Lazy K. Merry Quine-mas!" This new dragon stretches all the way from A+ to Zoem and back, taking in all the Cs, sundry Lisps, Makefile, Visual Basic and LOLCODE among the many others along the way.

When you remember exactly what these programs do, the functionality disclaimer at the foot of the GitHub page is its own peculiar brand of comedy gold.

In Other News

Yusuke-san (@mametter) is also responsible - in collaboration with his wife Hiren (@hirekoke), whom he credits with teaching him Gingold, Monaghan and Lucy's SPH (smoothed-particle hydrodynamics) methods - for this almost-viral ASCII 2-D fluid mechanics simulator, currently doing the rounds:

Friday, 20 February 2015

Microsoft Achieves Privacy Standard

Microsoft has achieved the globally recognized ISO/IEC 27018 privacy standard for Azure, Office 365, and Dynamics CRM Online. And here is the BSI certificate to prove it! These services are now aligned with the standard’s code of practice for the protection of Personally Identifiable Information (PII) in the public cloud.

Further Information

Announcement last Monday by Microsoft's General Counsel & Executive Vice President, Legal and Corporate Affairs, Brad Smith:
"With the Microsoft Cloud, you’re in control", he concludes, and it's hard to deny that's a step in a good direction.