3 ms·
> "Programming language quality is usually inversely proportional to the number of special forms" Programming language obscurity is also usually inversely prop
by barrkel 17y ago
> "Programming language quality is usually inversely proportional to the number of special forms"
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.
- shawndumas 17y agoPerfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. --Antoine de Saint Exupéry
- barrkel 17y agoMy 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.
- mechanical_fish 17y agoAnd 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.
- tome 17y agoWell, 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.
- Perceval 17y agoso much depends upon a red wheel barrow glazed with rain water beside the white chickens.
- klipt 17y agoMakes you think, until you realize you don't even have a wheelbarrow.
- gwern 17y agoHaving 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.)
- sedachv 17y agoOne observation to be made is that Common Lisp has 25 special forms (http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/sec_3-1-2-1-2-1.html#clspecialops http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec...). That's quite a lot. But none of them are redundant or superfluous.
- barrkel 17y agoI 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.
- foldr 17y agoWell 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.
- barrkel 17y agoNo, 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.
- lispm 17y agoYou don't need to guess. Here is the list of special operators: http://www.lispworks.com/documentation/lw50/CLHS/Body/03_ababa.htm#clspecialops http://www.lispworks.com/documentation/lw50/CLHS/Body/03_aba... Just tell us which ones you would replace.