[Another repurposed comment from the same Lobsters thread I mentioned in my previous post.]
A serious answer deserved a serious response, so I slept on it, and, well, as you can see, it took some time. I don't even the excuse that "Je n’ai fait celle-ci plus longue que parce que je n’ai pas eu le loisir de la faire plus courte."
If you are curious to
(
Read more... )
Lisp definitely seems to be one of the great, paradigm-changing languages. I have no skills in it, but I am told it is a very enlightening language to learn. I would recommend you do, I think.
See Paul Graham's essays on it, or Eric S Raymond's quotes about it. Alan Kay, designed of Smalltalk and the Dynabook, called it "the Maxwell's Equations of software".
It is an impurely functional language, so no, it is not purely functional and it isn't that that is the cause of the impenetrability.
It is, I think, mainly its property of homoiconicity. Lisp is all about manipulating lists, which are structures accessed via what some implementations call CAR and CDR. CAR gives the 1st item in the list. CDR gives the rest of the list.
CAR = Contents of Address Register
CDR = Contents of Data Register
This is a glimpse of the architecture of the machines it was first implemented upon.
Lisp code manipilates lists; but also, Lisp code _consists_ of lists. The language is written in its own storage structure. Its code is a representation of its data: that's what homoiconicity means.
This means that macros in Lisp are much more powerful than in other languages. C macros basically do a search-and-replace expansion on text. Lisp macros can rewrite Lisp code, on the fly. Your subroutine only iterates through 2 dimensions of an array, and now you need to handle a 3D array? Just rewrite the code, turn the inner loop into a loop inside a loop, and in 1 line of code, your program modifies itself how you need.
This is why Lisp devotees call it a programmable programming language. The tool helps you to modify the tool itself to do what you need.
Of course this can make code _horribly_ unreadable and can play merry hell with compilers and optimisation.
This isn't the only thing, but it's an oft-cited thing.
Reply
Very familiar with lists - they are generally a core data structure in many of the lambda style functional programming languages - fortunately words like head and tail (or even just pattern matching) replacing cadr and cdr- phew. Prolog too on the logic side made strong use of them and I daresay was heavily influenced by lisp on the data structure side (been too long since I saw any, but have a feeling that microprolog might even have stored its programs as lists too)
I have learned (and probably now forgotten) so many different programming languages over the years :-) It is sad that the one that 'stuck' in industry was C, but that’s the way it went.
Reply
Leave a comment