After many years of thought and many years of using many languages, I am now more and more convinced that the “perfect” combination, if such a thing exists, is going to be a mix of Haskell, LISP and Prolog.
Exactly what “combination” means in terms of the different programming paradigms each presents is completely unknown to me at this point! Haskell is functional, Prolog is logical and LISP is everything.
So, what’s the ideal? The future is on highly concurrent and scalable systems. So functional programming is more than likely the way forward for lots of reasons to do with not passing around state and the ability to perform map-reduce optimisations on functions just by deductive reasoning on what it does, or more importantly, doesn’t do: rely on external state.
Compilers are getting smarter, we need to keep up!
I am going to think about this more actually, and maybe design an “ivory tower” conceptual language and throw it out there…
Exactly what “combination” means in terms of the different programming paradigms each presents is completely unknown to me at this point! Haskell is functional, Prolog is logical and LISP is everything.
LISP
First of all, the uniform s-expression shape of LISP is so absolutely pure, clean and simple that I feel it’s the true shape of expressing thoughts as code. If you work in LISP long enough you don’t even see the parens any more. Really. And the implied return value being the last thing you did is also useful.Haskell
Haskell is incredibly clean in its form. The use of a space character as the argument separator is cool. The functional aspect is also very very nice. What I don’t like about Haskell is the IO / monad thing, Sometimes it feels incredibly hard work to do things within the context of other things, pardon the pun but sometimes there’s just too much heavy lifting!Prolog
Finally, Prolog. We all know about predicate logic, true or false. There is something so clear and obvious about Prolog rules… that the rule is true if and only if every single sub-rule is true. The first version of Erlang was written in Prolog, and when I learned that I suddenly realised why the syntax of Erlang is like it is, it made Erlang much more readable for me.Commonality
Haskell and Prolog both offer pattern matching; once you understand and get used to the idea of extracting “if” tests out of the code and making them separate clauses, your code becomes much clearer and easier to read and reason about. LISP doesn’t have pattern matching per se but it does have multi-methods, something I am sure no other language yet offers at all (I could be wrong) and this from a language created back in the 1950-s! John McCarthy and his students did something truly amazing indeed.So, what’s the ideal? The future is on highly concurrent and scalable systems. So functional programming is more than likely the way forward for lots of reasons to do with not passing around state and the ability to perform map-reduce optimisations on functions just by deductive reasoning on what it does, or more importantly, doesn’t do: rely on external state.
Compilers are getting smarter, we need to keep up!
I am going to think about this more actually, and maybe design an “ivory tower” conceptual language and throw it out there…
Comments
Post a Comment