Having few special forms does not rule out syntax or having useful functions. Look at Scheme, for example. (Or Haskell, most of which syntax desugars into functions you could write yourself, like records or do-notation or list comprehensions.)
Re:I'm turning into a Lisp snob
by shawndumas on Saturday November 14, 2009 @11:01AM
(#941786)
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. --Antoine de Saint Exupéry
Re:I'm turning into a Lisp snob
by mechanical_fish on Saturday November 14, 2009 @11:22AM
(#941802)
And yet Antoine is famous for book-length works, not poetry, and certainly not minimalist poetry.
Don't take the lesson too literally. You can, in fact, take too much away. How much you need to put in depends on your artistic goals and, of course, on your audience.
Well, there's necessary complexity and unnecessary complexity. Perhaps he felt that in order to communicate the ideas and story in his book, he had to write a book length work.
so much depends
upon
a red wheel
barrow
glazed with rain
water
beside the white
chickens.Makes you think, until
you realize you don't even
have a wheelbarrow.
My point is that with programming language abstractions, you can in fact remove things without hurting the theoretical power of the language, but actually harming the practical power of the language.
You do have to leave things in that you could take away.
One observation to be made is that Common Lisp has 25 special forms (http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec...). That's quite a lot. But none of them are redundant or superfluous.
I am very certain that almost all of them could be removed without reducing the theoretical power of Common Lisp. At worst, successive rewrites of the program could reduce it to using a different set of simpler forms.
Well yeah, you don't need all those special forms to keep the language Turing complete, but you do need them to provide a lot of what people regard as the "powerful" features of common lisp. I wouldn't care to program without flet, for example, but obviously one could remove flet without any loss of power in a certain sense.
No, I mean that you could create a Lisp which had fewer forms, but that provided these special forms - that you would program using - except that they would no longer be special, but rather synthesized out of baser forms.
You don't need to guess. Here is the list of special operators:
http://www.lispworks.com/documentation/lw50/CLHS/Body/03_aba...
Just tell us which ones you would replace.
Programming language obscurity is also usually inversely proportional to the number of special forms. Church numerals?
The happy place is somewhere in the middle, where there's enough language such that you don't have to build it out of other pieces - and this also helps with performance, static analysis, tooling, debugging and lots of other areas - but there isn't so much that you end up with lots of methods to do the same thing, in similar but incompatible ways.