r/programming • u/jamesob • Jan 19 '14
Lisp: more is less
http://jameso.be/2014/01/19/lisp.html
0
Upvotes
2
u/kamatsu Jan 20 '14
I agree that lispy macros and dynamism are bad ideas for programming in the large, but Python is hardly a better alternative. I'd much rather write Clojure than Python.
2
u/orbiscerbus Jan 19 '14
So this is just a love song to Python? Python has its plethora of problems. People just ignore them because they enjoy its "simplicity". Lack of features is not simplicity, it's the conformism to the thought of the lowest common denominator.
1
u/jyf Jan 20 '14
as a python engineer, i need to say, python is not that simplicity, at least, not as it promise
4
u/lispm Jan 19 '14
Not sure what he means, but the functionality often is not implemented as macros. Macros often provide a surface to functionality which is implemented as functions. For example CLOS provides surface macros to define classes, methods, etc. - but this is on top of layers of functions and meta-objects.
Static syntax analysis is indeed difficult in the presence of full (procedural) macros. Lisp code sometimes applies so-called code walkers to analyze or manipulate Lisp code.
What makes these macros a bit simpler to handle is the fact that most Lisp developers use compilers which expand macros, so typically most errors are handled at compile time. This got popular in the 1970 and replaced runtime code manipulation (FEXPRs) in most Lisp dialects.
See Pitmans paper: http://www.nhplace.com/kent/Papers/Special-Forms.html
In Common Lisp thus macro errors, usually are caught be the compiler.
I would agree that non-macro languages like Python are easier to use and often the syntactic abstraction support of Lisp is not needed.
But CL's flexibility and macro facility is still a step up in expressibility - something which needs to be learned. OTOH, the is a reward for learning it. The programmer will experience a language where he/she is a language designer and will learn about that.
One thing I would also question: if one has a large piece of software developed by a larger team, there usually is always a way where complexity manifests itself in the code. For example the class system could be relatively simple, but the system of hundreds or many thousands could be not. Macros can bring a huge code reduction and this could help to keep the system manageable with a smaller team. Also, syntactic extensions in other languages seem to be implemented outside: for example see the use of XML in Java projects, the various macro processors or embedded scripting languages.