Skip to main content

The ultimate programming language ?

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.

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

Popular posts from this blog

The Coolest Shortest PHP Function I Will Ever Write

Having now released my own programming language, FELT , and learned a lot about this and that in the process I have of late, in the evenings, been struggling to reconcile my love of LISP and how simple FELT makes some PHP coding task leaner and meaner with the fact that I still have to use PHP for my day job. In my language, FELT , I have used the square brackets to define a "normal" array and curly braces to define a "key-value" array, mainly because this is identical to JSON format and anybody familiar with Javascript coding just won't have any issues getting to grips with that now will they! Let's take some simple examples of FELT code: (defvar simple-array [1 2 3 4]) (defvar simple-map {:name "Eric" :age 42 :occupation "Viking Hacker"}) When FELT has done its thing, we get the following PHP code, $simple_array = array(1, 2, 3, 4); $simple_map = array('name' => "Eric", 'age' => 42, ...

Prime Peace

I think prime numbers are the numerical expression of peace. Restful nodes in the vibration of everything. Prime factorisation has always struck me as something truly astounding and it is reassuring to know that awsesome minds are hard at work trying to solve the Riemann hypothesis right now. There are some truly wonderful professional and amateur (in the nicest sense of the word) explorations I have watched recently and the ones that moved me the most, in order of cool factor were: This guy,Carlos Paris, has put in some serious work with AutoCAD and made some interesting observations. I truly enjoyed watching all of his four videos. Awesome work Carlos. As an interested amateur I found his work and thoughts to be very compelling. I am sure the professionals would groan or moan but to me this video is most excellent and informative. Speaking of the professionals, this video is also very interesting to watch as it goes some way to visually explaining the Riemann hypothesis in...

Emacs fat fringes and colours

Having gotten used to various editors implementations of distraction free or presentation mode views, I figured that emacs could probably do something similar with little effort. As usual, it could. For me, distraction free means no clutter, no menu bars, tool bars, gutters, line numbers, just the code. The first step is to be able to set the size of the left and right margins to something large, 100px works quite well. I use Aquamacs a lot. This does not work in the terminal! So, here is the little bit of code you need to place into your beloved ~/.emacs file: (defun fringe-bars (width) (interactive "pWidth:") (fringe-mode (cons width width)) (set-face-attribute 'fringe nil :foreground (face-foreground 'default) :background (face-background 'default))) Then, using the Ctrl-U prefix, you would set the left and right margins to be whatever you want, let’s say we wanted to have 500px left and right, which wor...