4 ms·
I should have expounded in original post, thanks for asking. There are many points, the one I'm thinking about in particular has to do with what Lisp is. I conc
by andreyf 17y ago
I should have expounded in original post, thanks for asking. There are many points, the one I'm thinking about in particular has to do with what Lisp is. I conced that Cojure is in the family of Lisp languages because it has the s-exp syntax and the macros.
However, it's a step back in The Philosophy of Lisp, because it doesn't allow user-defined reader macros. First let me explain what I see the philosophy of Lisp - it is the late-binding of all things. Late-binding, in this sense, means that the system by which you make the computer do the things you want it to (we usually call them "languages") makes as few decisions as possible, and lets the user overwrite and extend them. For example, the Python mailing list every once in awhile has an active debate if anaphoric `aif' should be allowed in the language [0]. This would mean adding a special symbol `it', such that:
aif expensive_function_call():
foo(it)
is an equivalent to:
it = expensive_function_call()
if it:
foo(it)
GvR decided against it, after weighing the needs of the Python community. The late-binding that I see as inherent in The Lisp Philosophy says that decisions like these are personal decisions to be made as late as possible (certainly not when you're designing a system of computational expression), and certainly not for all users. Each user should be able to define aif to mean whatever they feel it does. The current popular counter-argument is that this would shatter languages into a personal dialects that nobody but themselves and their best friend would understand. The Lisp family of languages disagrees, and hence, supports macros. Cojure, for this reason, supports macros [1].
However, there are two kinds of macros Lisp supports for the same reason: "syntax macros" which let you late-define how syntax is interpreted, and "reader macros", which let you define how the parser interprets your syntax (the Lisp parser is called the reader). For example, the reader of Clojure translates '(foo) into (quote foo), #{:x} into (hash-set :x), [x y z] into (vector x y z), etc.
However, the rules by which the reader translates those "special" deviations from normal s-expression syntax into s-expressions is closed off from modification. This goes against The Lisp Philosophy, and is not so in other Lisps [2]. The only case for this I've heard (in Stuart Halloway's "Programming Clojure") is that this would allow people to dilute the language into something which is no longer Clojure. This explicit early binding is a step back in what I see as the Philosophy of Lisp because brings us back to the religious tribalism of "this is Clojure, and the language decisions that were made are good decisions, and if you don't like them go fuck yourself".
0. http://en.wikipedia.org/wiki/Anaphora_%28linguistics%29 http://en.wikipedia.org/wiki/Anaphora_%28linguistics%29
1. The analogy I like best here is to mathematics. Any mathematician can create his own definitions to explain his ideas (as they usually do), and yet, mathematics doesn't break up into dialects that nobody can understand. Instead, mathematical language evolves as people participate - if you have a pet definition you like (maybe one you thought up all on your own!) you don't need to convince Guido or some council of language makers to be able to use it. You use it, and if your paper is worth reading, maybe you can convince other people to accept it. That way, mathematics as a language evolves, not by design, but by social interaction. The formal languages of computation can (and should) do the same.
2. http://www.psg.com/~dlamkins/sl/chapter03-12.html http://www.psg.com/~dlamkins/sl/chapter03-12.html
- johnzabroski 17y agoEverything in Lisp, traditionally, is not extremely late bound. For this, look to COLA by Viewpoints Resaearch Institute. The no reader macro convention basically boils down to making it easier to design a language. If you want an acceptable Lisp, you effectively have to combine the best features of all Lisps. This is surprisingly difficult to do and ensure portability and stability. So your comments about "direction of Java" are puzzling, as it guarantees portability and stability to the extent the JVM is. Really the only downside is compatibility with type erasure, which is unfortunate but hey.
- lispm 17y agoThe usual default is that Lisp is late bound. You would tell Lisp when or where you don't want that. If you use CLOS for example, any method can be removed or added at runtime. I'm not sure how not adding a reader macro mechanism makes the design easier. Actually the point of read macros is to enable incremental addition/change of syntactic elements of s-expressions.
- johnzabroski 17y agoStability of any problem space makes reasoning about any problem space easier. The statement is a tautology. 'How' is a rabbit hole. I wish, though, that Clojure had a versioning system similar to Curl or even .NET's module system, or even OSGi/Jigsaw. Syntactically, I'm thinking of something like Curl.
- andreyf 17y agoFor this, look to COLA by Viewpoints Resaearch Institute. linky: http://piumarta.com/software/cola/ http://piumarta.com/software/cola/ Thanks! I was thinking of dropping that into the post as an example of the late-binding philosophy going into the future, but I've been linking it quite a bit lately, and decided to go without it for once. In my view of it, Piumarta's COLA is very strongly "of The Lisp Philosophy". As a matter of fact, I would call it the future of Lisp (the philosophy) :) When things are truly late-bound, it makes as little sense to split computational instructions into these "language" silos. Allowing users (and creating tools) to modify syntax is fundamental to breaking this tribal idiocy around "languages" as atomic sets of programming system design decisions.