Game Theory and Framework Architecture

Nash proved more than 50 years ago that if everybody competes for the same prize, we would only inflict harm, not only to ourselves, but also to the group as a whole. Or at least, this is true in a “zero sum game”, implying games where there can only be one winner. According to legend and Hollywood, his ideas were conceptualised as him and 3 friends of him were trying to pick up a beautiful blond girl at a bar. You can see this depiction below. His theories were later referred to as “Game Theory”, and they tell us something about how we can both succeed as individuals, and as a group. The paradox is that a web application framework, is actually a “group”. It is not a single entity, but rather a collection of tools, that works together the same way a “group” works together. For instance, there’s Ajax, database layers, markup generation, etc, etc, etc. All in all, resulting in that the laws of “group dynamics” are key to understand how to best implement and create a web application framework.

Phosphorus Five is a “second best web application framework”. For instance, it’s very difficult, if not flat out impossible, to re-create a social media website such as Facebook or Twitter with it. It also does not incorporate a MongoDB or Couchbase database adapter, which according to dogma are among some of the most scalable databases in the world today. Instead it contains only a MySQL database adapter, allowing you to create your own MongoDB/Couchbase wrapper yourself in C# if you wish. It does not use the latest and hottest C# features, which has the additional advantage of that it’s more easily ported to Mono, and doesn’t require you to understand all the latest features from Redmond to understand its code. Hyperlambda is slower than C#, and has less syntax than both LISP and YAML. It does not contain a rich JavaScript API. In fact, it barely contains any JavaScript at ALL! I could go through every single feature in Phosphorus Five, and illustrate how it consistently chooses the “second best” alternatives where it can. However, the end result, of its combined effort, becomes very weird due to this decision, and due to “Game Theory” and “Group Dynamics”.

For instance, with Phosphorus Five, you can create web applications without knowing any C#, JavaScript, CSS or HTML. In fact, the only thing you’ll need to learn in order to create highly rich web apps, is the difference between a colon (:) and double space (”  “). These are the two only syntactic tokens in Hyperlambda. With Phosphorus Five you can create a modal window with 5 lines of code. You can traverse your folder structure on disc in a tree view, with 25 lines of code. You can create an Ajax MySQL datagrid with 7 lines of code. Etc, etc, etc. The reasons for this, is because none of its parts are “blocking” any other parts. The “individuals in the group” becomes 100% perfectly untangled.

If I were to “micro optimise” Phosphorus Five, the same way lots of other frameworks have been micro optimised, the end result of me trying to become the winner on all parameters, would be more syntax, more complexity, more entanglement, more cognitive noise for you as you create your code, more overhead, etc, etc, etc. The individual parts of Phosphorus Five would basically “block” each other. Phosphorus Five incorporates the ideas coined by Nash more than 50 years ago in its core! And the end result, of consistently choosing to be number 2 instead of number 1, is that as a *WHOLE* it wins. Don’t believe me? Watch what a Nobel prize winner in math has to say about this …

Whenever “group dynamics” applies to your problems, you should never strife for winning the first place in any individual parts of your system. Instead, you should try to become second best on all parameters. The reasons is because as you do, the sum of your work, will inevitably be that your collective efforts becomes the winner. Nash proved this, and got the Nobel Prize for it. And I believed him, and I implemented Phosphorus Five in accordance to his theories. Resulting in … 😉