Andrew Feeney

Software developer in Sydney, Australia.

Rashid: A Rosetta Stone for code

The year was 1799. Napoleon's campaign in Egypt was in full swing. Ostensibly undertaken to protect French trade interests in the region, the colonial forces were feeding a growing appetite for ancient Egypt's treasures and artefacts in France. The French army had ousted the Ottoman forces from Fort Julien on the banks of the Nile a few miles outside of the coastal city of Rashid, and were taking a moment to bolster its defences. Officers shouted at toiling soldiers while they worked in their platoons to pile up pieces of stone, rushing to fill gaping holes in the ramparts blasted by cannon fire. Lieutenant Pierre-François Bouchard, a bright and well-educated young officer, watched as a platoon of soldiers dragged a large stone from a pile of rubble with a rope. The earth shook as the boulder finally shifted from the pile.
As the dust cleared, something amongst the rubble caught Bouchard's eye. Beneath the stone that the soldiers had been moving lay a smaller stone, lying flat on the ground. The stone was badly broken around the edges, but it was clear that this was not an ordinary piece of stonework. Chiseled into it with remarkable craftsmanship was not one but three different inscriptions, one on top of the other. Each inscription was in a different language, the top was Egyptian hieroglyphs, an as yet undeciphered ancient written language. Although nobody alive understood it, it was unmistakeable with its very distinctive pictorial symbols. Below that another script appeared, unrecognised by Bouchard. At the very bottom, in near pristine condition, was the text which caught the young officer's eye. Bouchard was no linguist, but he knew enough to know that the bottom text was in ancient Greek. If this dust covered stone proved to be what he suspected, Bouchard knew that this discovery could be something very, very important.

Western history tends to tell the above story with an air of victory; a ground-breaking historical discovery. One might also argue that it is a story of conquest and plundering by greedy colonial powers. The stone itself still rests in the hands of Great Britain who captured it from the French shortly after its discovery and have held it ever since. Despite Calls by the Egyptian government to repatriate it, it remains at the British Museum. That's a discussion for another day but it's certainly beyond dispute that the so-called 'Rosetta Stone' which Bouchard and his soldiers re-discovered that day, did indeed prove to be a pivotal moment in archaeology and the study of ancient languages.

What Bouchard suspected, and experts later confirmed was that the tablet had the same message, a royal decree by King Ptolemy V, inscribed in three different written languages. Egyptian Hieroglyphs, Demotic text (Egyptian), and Ancient Greek. Although incomplete due to damage, there was enough data here for linguists to begin to decipher and translate the Hieroglyphs found on many artefacts and in many historical locations in Egypt, as well as better understanding how Ancient Greek was used in the Hellenistic period. They did this by comparing the same message in multiple languages.

Cool Story Bro

One of the things I found helpful when first learning the Laravel framework was diving into the codebase of Laravel.io, which, at the time (circa 2015) was about the most fully fleshed out application codebase I could find which was open source. It gave me some insight in to one way people glue their whole app together. Since then I’ve taken often great delight in source diving other people’s code, and seeing what I could learn. Unfortunately, while places like Github are filled with open source libraries, packages and boilerplates, finding high quality fully fleshed out application codebases is still a tricky task.

Recently I was looking for an example of a Laravel SPA built with Vue. Of course I can implement these technologies following their respective documentation but often there’s so much benefit in seeing the application codebase as a whole and how all the little pieces fit together.

A Rosetta Stone For Code

It got me thinking, what if there was a place where you could go for reliably high quality examples of the same full application in whatever technology stack and language, with whatever frameworks or libraries you want to learn. A kind of Rosetta Stone for coding, if you will.

It’s not a new idea, people have been implementing known programs or algorithms in different languages. Examples of this would be ‘Hello World’ or ‘FizzBuzz’. But while these examples do help new developers quickly understand languages fundamentals, they don’t look much like anything you might need to build in the real world.

What I’m talking about is examples of an actual useable application that does something useful, built to a common specification. I looked for existing projects but I couldn’t find anything quite like this. If you know of anything please let me know. It seems like the kind of idea that many people would have had before me.

Being the tragic sufferer of optimism bias that I am, in a rush of blood to the head I made github.com/rashid-project/spec. My idea was to start putting together a specification for an app that could be implemented in many different technology stacks as an example of one way that one could develop applications in those stacks. In the tradition of coding tutorials, I picked the domain of a 'To Do list' or productivity manager type app (cue groans and eye-rolls) because, while it is a bit overdone, it seems to be a pretty good example of the kind of application one could build, while also being a domain that's easy to understand and that anyone could conceivably have use for in their daily life.

The Name

The name 'Rashid' comes from the Anglicised version of the Arabic name of the city in Egypt where the Rosetta Stone was discovered. If I understand correctly both 'Rosetta' and 'Rashid' are corruptions of the original Coptic name for the location which was 'Trashit'. I would have picked 'Trashit' because it's Anglicisation kind of works, (as in an app that you would build for learning purposes and then delete) but I feel the original meaning of the word might get lost behind the negative connotations of the English word 'Trash'.

Considerations

My initial thoughts on how this project would work are as follows:

Specification

  • A versioned specification: (major).(minor).(micro) which evolves over time gradually adding complexity in the same way a real app’s requirements might grow and change
  • Ideally the specification would be general enough that the app could be implemented on entirely different platforms, e.g. web application, native application or CLI. I’m not sure how realistic this is.

Codebases

  • Each codebase would be versioned according to the specification versioning, with an additional component for patch releases, e.g. (major).(minor).(micro).(patch).
  • In this way somebody reviewing the source code of an implementation could match the version of the codebase to the relevant version of the specification.
  • The patch releases give us a method to push bugfixes and other changes which don't represent changes in the spec.
  • Ideally, the codebases ought to be built in the most 'vanilla' way possible, representing the most dominant conventions and styles of the community who work in that technology stack.
  • People in the various communities for frameworks, libraries etc. could implement the Rashid spec as an example of how to use that technology.

Potential Pitfalls, Questions and Caveats

  • Maintaining all those codebases is a lot of work
  • They will quickly become out of date with latest versions of dependencies, or evolving best practices
  • Who decides what the "dominant conventions" and "best practices" of some technology stack are?
  • In the case of a standard SPA style web application, what about client side vs server side divide? How do we handle implementations that only care about the client or server side?
  • Should Rashid be implemented in non-web-app stacks, e.g. as a CLI or as a desktop application?

Final Thoughts

I feel like this is an idea that would quickly die without a lot of input from a lot of people. And, having written all this out, I can honestly say I can't tell if this idea is even remotely good or if I'm suffering from delusions of grandeur, or a serious lapse of judgment. At the very least I might use this as a place to put my own tinkerings in stacks outside my comfort zone and if nobody else cares then so be it. Let me know your thoughts!