A few years ago, I was wondering how easy it would be to learn, or at least experience, every type of programming language style. So I ran a quick experiment. I used a simple algorithm against the data on Wikipedia’s programming pages, designed to find the smallest set of languages which would expose me to the full set of programming paradigms. The results were interesting, and fun, the article which I wrote about it was pretty popular.
So recently, when I came to republishing the article on the latest version of my site, I wondering how things have changed in the 3-4 years since. New languages will have popped up, and Wikipedia contributors will have added more detail, perhaps improving the quality of the results. So I’ve given it another go. My basic algorithm remains the same, as although I had learned about the joys of Minimal Spanning Set algorithms from the comments on the original article, none of those which I found online (such as Kruskal’s Algorithm) quite matched my requirements.
It’s a fairly basic procedure. Sift the Wikipedia lists of languages by feature into a dataset. Find the language which covers the largest number of paradigms, note down those language features and detail all data related to them from the set. Then repeat with the next most popular, until only features which have no languages in common remain. On this occasion, none were left in this category.
So - on to the results. Does Piet make an appearance again? We shall see.
1) Julia: If you haven’t heard of Julia, it’s a language primarily aimed at scientists who want more bang for their buck than they get out of Matlab or R. It’s coupled to C and Fortran libraries for technical computing, and built from the beginning for speed. It came in with a thwopping 15 paradigms. These are: Reflective Programming, Interactive Mode, Interpreted Code, Imperative Programming, Iteration, Scripting, Impure Functional Code, Concurrency, Metaprogramming, Numerical Analysis, Array Programming; it’s Embeddable, Procedural, and Object-Oriented with Multiple Dispatch. It is also, as you might have gathered from that list, Multi-Paradigm.
2) Mercury: Okay, this is where my earlier knowledge ends. I’ve not heard of this one before. It turns out that Mercury is a is a functional logic programming language geared towards real-world applications; it’s related to Haskell and Prolog. Learn Mercury and you will encounter Pure Functional Code in a declarative language which is compiled.
3) Lava: We continue down the rabbit hole. Lava is an experimental programming language which looks like it was written by some German academics (please correct me if I’m wrong). It gets into the list by virtue of being a visual language for hardware description, which ticks two boxes. It’s also object or class-based with single dispatch, meaning that only one parameter is used in its implementation of polymorphism.
4) AWK: This is more familiar to me. AWK is a cornerstone of Unix shell programming. It’s generally used for data extraction and text processing. It features curly brackets, it’s a transformation language, and is rule-based.
Now, every one of these lists needs an Esoteric Programming Language, and it looks like this time, the honour goes to….
5) Beatnik
Scrabble
Why Scrabble letters? Well, Beatnik uses the Scrabble values of the English-language words in the code to determine operations. So, for instance, the sentence “Hello, aunts! Around, around, swim!” evaluates to a program which takes a letter input and increments its ASCII value by 7. Completely bizarre, but wonderfully, it also fulfills our requirement for a Stack-based language, as well as being Esoteric.
6) ECMAScript for XML - ECMAScript is also known as Javascript, and as a consequence, this variant of ECMAScript retains features like prototypal inheritance, but is also a language designed for XML. “E4X” as it is acronymised, treats XML as a primitive, which means that it can be processed much more quickly. Apparently it’s been deprecated by Mozilla, so it doesn’t sound as though many people found that functionality particularly useful.
7) M4 - This is a general-purpose macro processor which is found in Unix. It all over the place, in Autoconf, SELinux, and Sendmail. It appears in our list because in additiona to being a Macro Language, it’s also a Syntax-Handling Language.
8) Oz - Ah! Well, I can tell you this - Oz has many enthusiastic proponents, as I found out the last time I did this exercise and didn’t include it. As Oz is designed to include most of the major programming paradigms, its fervent fans were frustrated when I failed to feature it last time. It was the algorithm, not me! Well, this time it’s made an appearance thanks to being a Dataflow Language which features Constraint Programming. Oz is part of something called the Mozart Programming System.
9) LabView - And finally! This beauty is a visual fourth gen language used for data processing. According to its very professional website, it’s driven progress in many industries. Which is great, I guess. I suppose it also means that you probably can’t afford to buy it, but they offer a 45-day evaluation license if you feel the need. Certainly it should be quite different to anything else on this list, so it might be worth examining for completeness.
Well, we got there! And with two fewer languages than last time! As before, if you think I’ve made any heinous errors, or have a better algorithm, or just want to rave about the multitudinous and wonderful features of your language of choice, please do drop a comment below, I’d love to hear from you!