Earlier this evening, I was wondering how easy it would be to learn (or experience) every programming paradigm out there. I’ve tried functional programming, object orientation and so on, but what about Array Programming, or Reflective Languages? The first one fills me with terror (thanks to APL), and I don’t even know what the latter is.
Well, I figured out a way to find a small set of languages which comprise all programming paradigms. It may not be the best list, I banged it together in a hurry, but I certainly found it very interesting, especially given the results.
But first, here’s what I did. I took the lists on Wikipedia of programming languages arranged by type (which may not be exhaustive, in fact, I know it’s not), and zapped the lists into a spreadsheet. The next step was to find the language with the most paradigms in it. Lua was the winner here. Then I removed all the lists of languages which contained Lua from the sheet, and repeated the exercise. I continued until all the lists had been covered, with a bit of tweaking and investigation to get rid of categories which didn’t intersect other lists. I also removed things like lists of Educational and foreign-language-based languages.
Here are the results:
1) Lua: This surprised me when it came out top. It is an Extension Language, Imperative, runs in Interactive Mode, is Interpreted, Iterative, features Metaprogramming, is Object-oriented (single dispatch), Prototype-based, Reflective, can be Aspect-Oriented, and used for Scripting.
2) Rust: Not even heard of this one. It’s is apparently classed as an Impure Functional Language, is Imperative, used for Metaprogramming, is Concurrent, Procedural, and Compiled.
3) Curry: I’ll assume from the name that it’s a functional language, and it is, a pure one. But it’s also logic-based, concurrent, and uses the off-side rule (not the football one).
4) Lava: The list continues into obscurity. Here we have a Hardware Description Language for digital circuit design which is object-oriented, class-based and visual.
5) dBase / xBase: Well this is a blast from the past. It’s obviously data-oriented, but is also apparently a Processing Language, is Declarative, and Fourth Generation.
6) Julia: Julia is a mathematical, high-level, dynamic language. It allows array programming, so you won’t have to soil your hands or mind with APL, and it allows impure functional programming. It’s also object oriented (but with multiple dispatch this time).
Completing our Education
So there are still a few gaps in our knowledge. The languages below round things off. They might only cover one or two paradigms, but they each do something special (or odd):
8) Piet: Completely nuts. It’s an esoteric, stack-based language with a visual interface which you can use to drive yourself mad. Wonderful.
9) XSLT: Another niche language. XSLT is a rule-based language for transforming XML, and other markup.
10) SIGNAL: A programming language based on synchronized data-flow, for systems with several clocks. No doubt enormously useful, if you’re working with that sort of thing.
11) Yacc: Yacc is a syntax handling language. It’s a compiler, for compiling compilers.
So there you are. Plough your way through that lot and you ought to experience the gamut of joys that the programming world has to offer. At this point, I’d like to throw down the gauntlet to anyone who reckons that they can find a more compact combination of languages. I’m sure it’s eminently doable. Cleansing the sample data, then using a more valid algorithm for identifying the smallest set would undoubtedly lead to better results. I rather like this one though, Piet not withstanding. :-)