2,130 karma · joined June 6, 2008
http://www.cliki.net/ has a lot of useful resources for people who are just starting.
If you prefer a functional language(Common Lisp is multi-paradigm, and isn't particularly better at FP than say python) clojure and scheme are good options. I recently started reading Realm of Racket, which seems like a pretty good introduction to Racket(a scheme like language).
I recommend learning all 3 dialects, all of them deserve deep study and I strongly favor Common Lisp as the most mature and versatile one.
So if you pay 10$ the author gets 8.50$. As a leanpub author myself, I find this arrangement very good. The only problem with leanpub I have is that the 45 day money back guarantee is too long, and if that period happens to end in the beginning of a month, you have to wait for the start of the next one in order to get paid(leanpub pays in the first 3 days of a month). I had to wait two months for my first payment. I'm not complaining, leanpub haven't wronged me in any way, and in fact I have benefited from people paying much more than the suggested price(15$ for my book, 5$ minimum price). Leanpub is a great service! I recommend more people republish their blogs or publish new material with it.
Leanpub makes it very easy to set up such donations, if you are an author, consider doing so. You owe it to the free internet that you have such an opportunity in the first place. At least that is my reasoning.
Common Lisp, Clojure and Racket all have at the very least a descent set of libraries. And if you use clojure or ABCL, you get all of the jvm libraries too. With FFI you can use any C library from Common Lisp or Racket too. On top of that you get to use languages designed for extensibility, which means that there are actual best practices and examples of how to extend a language without painting yourself into a corner with an unmaintainable mess. Lispers have been doing stuff like this for decades, some of it is very well understood in the various lisp communities.
My favorite example of this power are the various sql DSLs, I can write in lisp something like (query (:select :* :from 'some-table :where ...)) without having to concatenate strings and worry about injections. Yes, I have to learn a new language on top of Common Lisp to use it, but if you know SQL and Lisp, you already know 90% of it. Now I have all the power of lisp in my queries, isn't that cool?
As for clojure, I think they are all implemented in java, but I haven't been following clojure development in two years, so maybe with protocols they moved them(or could) to clojure? I don't know.
As for the name, if clojure was named anything that had the word "lisp" in it, like "foo lisp" or the like, it would have been dead already. Even racket had to get rid of the word "scheme" from their name for marketing reasons.
It isn't any different from saying Linux is not Unix, but the various BSDs are. It doesn't really matter at all, and when used in the wrong context, such phrases can be confusing.
Another example is the member function. member checks to see if an element is in a list. In CL member takes an element, a list as well as several keyword arguments that control how the searching is conducted. One such keyword argument is test which is used to compare the element to the items in the list, and another one is key, which is called on the items in the list before they are compared to the searched element. In scheme you don't have the key argument, which is already a drag, and instead of having a test argument, you have 3 functions: member, using equal?, memq which uses eq?, and memv, which uses eqv? for comparison. If you need anything more than that, in scheme you'll have to write your own such function. in CL, you just pass two functions to member to control how it works. In that way, CL is actually much more conceptually simpler than scheme, but we have to keep myths alive, don't we :)
Another example is the CL concept of a generalized boolean. In CL nil is false, and everything else is true, with T being the canonical true value. In scheme you have special values representing true and false, which again complicates code a bit, but is more conceptually simpler. I consider this to be a great design blunder on schemes part.
Another example is that CL is very much an OO language, much more than an FP one. You have classes, methods, inheritance, mutable slots, and all sort of messy and complicated things that come in handy every once in a while.
I can go on for ever, but I won't even get to clojure, which is I think much more interesting. Clojure emphasizes immutability and laziness. Neither CL nor Scheme force you to be use immutability, but clojure does everywhere it makes sense to do so. Laziness is something else clojure emphasizes. And although there are libraries for CL to make it very much a clojure like language, it isn't the default.
So, to answer your question, there's no reason why one should learn Scheme over Common Lisp (or vice versa), if all you're looking to do is learn the concepts.
Once you scratch the surface, Scheme, Common Lisp and Clojure emphasize very different concepts, in some cases they even conflict in philosophy fundamentally. I'd say give all three a chance and pick a favorite. I picked Common Lisp, but that's just me.I don't really mind more popularity, but my definition of a mainstream language is "The non-technical boss prefers it, because of reasons completely unrelated to its technical qualities.", in which case I agree with the snobs, we don't need that at all.
But if by mainstream you mean "It moves up from its current position as 33th most popular language on github", sure, why not. If by mainstream you mean "more companies start using it for useful software that makes money": http://this-plt-life.tumblr.com/post/36425247242/when-i-hear...
I consider Common Lisp to be a tremendous success, some of the coolest software was written or prototyped in it, including many language implementations. Not to mention what a tremendous achievement it is for a modern lisp system to be able to run 4 decades old code with little or no modification. Being mainstream was probably never a design goal, but the things listed above are, and that is probably why many lispers simply don't care about being mainstream, the language is not optimized for that at all. I don't thing that makes lispers snobs, they've just self-selected for people who can work with less community support. It's like a low-econ game of starcraft :)
The choice to use s-expressions was made because It makes it easier to just type code in a repl and experiment, without having to worry about dealing with templates, and also because I wanted the first example to fit in a single file.
It also compiles to js, so you can even share templates between the client and the backend.
I'm experimenting with using both sexml and closure-template, but in the book I use almost exclusively sexml to make the code simpler. Also s-expressions are much easier to type in than sgml :)
Using common lisp and restas + Postmodern(for postgreSQL access) today is actually a better choice than using something like flask or sinatra. And since i dislike full stack frameworks, my personal opinion is that it's better than django or rails too, for a small team of good hackers.
Parens aren't unreadable, not like a sigil and punctuation heavy language, and on top of actually being reasonably readable, they are also extremely easy to edit with something like paredit in emacs and vim. So reasonable readability and extremely easy editing are working against you, also making the code easy to parse gives you not one, but three reasons not to waste time on such ideas.
Now, let's look at the reasoning this page gives for this endeavor(from http://sourceforge.net/p/readable/wiki/Problem/):
"Many people find Lisp's s-expressions hard to read as a programming notation, and thus reject them both."
And many find them perfectly readable.
"As noted below, even Lisp luminary Paul Graham agrees that Lisp notations have readability problems!"
The page lists several quotes from various people. Interestingly, the two quotes from PG aren't good very good support. The first one talks about mathematical expressions, but I tend not to write many of those in my code, so it is a minor problem at best. And there are macros that let you write infix math in Common Lisp, surely there exist equivalents for scheme and clojure.
The second doesn't even talk about lisp, but about code readability in general:
"When you program, you spend more time reading code than writing it... a language that makes source code ugly is maddening to an exacting programmer, as clay full of lumps would be to a sculptor."
Although I do agree with this quote, I don't believe it applies to lisp, all of the readability problems I have with lisp code have to do with bad naming, bad indentation(something parens actually help with, because the editor can indent your code automatically, since it is easy to parse) and really, nothing unique to lisp.
"I have more faith that you could convince the world to use esperanto than [to use] prefix notation." By Paul Prescod
function(argument1,argument2) is not prefix? Sure Object.method(args) is infix, but in general, programmers use prefix all the time. Command lines are prefix, nobody writes "filename copyfile /destination/directory" in the shell. Bullshit argument.
"Lisp has all the visual appeal of oatmeal with fingernail clippings mixed in." A Larry Wall quote in an argument about readability, this one might actually work in my favor :)
"After 13 years of doing Lisp and 3 or 4 years of Python, I agree: I prefer writing Lisp, but Python is easier to read." By John Wiseman
I agree, Python is easier to read. This is not an argument for lisp being hard to read, it's an argument for python being easier.
"LISP: ... mythically from ‘Lots of Irritating Superfluous Parentheses’ " Jargon File
HaHa, actually none of the parens are superfluous, unlike in C like languages, where they are, if only you can remember all the damn operator precedence rules, if you can't, they aren't superfluous there either, and you need them to actually make the code more readable. HaHa indeed :)
"... and don't ask me about the extraneous parenthesis. I bet some LISP programmer felt alone and decided to make it a bit more homey." Linus Torvalds
I don't know the context of this, but I'm willing to bet he was talking about C code.
"[If only] we could find characters or signs suited for expressing all our thoughts as clearly and as exactly as arithmetic expresses numbers" Gottfried Wilhelm Leibniz
WTF? I'm pretty sure Leibniz was slamming Newton and not Lisp :)
"A language should be designed in terms of an abstract syntax and it should have perhaps, several forms of concrete syntax: one which is easy to write and maybe quite abbreviated; another which is good to look at and maybe quite fancy... and another, which is easy to make computers manipulate... all should be based on the same abstract syntax... the abstract syntax is what the theoreticians will use and one or more of the concrete syntaxes is what the practitioners will use." John McCarthy
This is a bit difficult to refute, since on the one hand, it sounds reasonable, but on the other hand history didn't work out that way. Some of this is here today, Common Lisp has reader macros, and in Racket you can insert the Greek symbol lambda, instead of typing it out in English. But at least with reader macros, being as conservative about adding them is a good idea, since ultimately they make the code harder to read if overused. I think McCarthy was just throwing ideas out there, and didn't have the decades of hindsight we have today, people have been writing and reading Lisp code for 50 years with little difficulty, and only introducing new people has been a problem, and only because these people have been introduced to alternative notations earlier. Start small children on Lisp, and they would think 5 + 3 * 4 is unreadable, and (+ 5 (* 3 4)) is easy to read.
The page continues to say:
"Indeed, Lisp notation has changed over time; the quote operator ' was not in the original Lisps, and was added because that construct was so common that it was worth creating an abbreviation. We're just working to add new abbreviations."
As I mentioned, that can actually make code less readable if overused. Common Lisp has many such abbreviations: #' for function, #() for vectors, #P"" for pathnames, etc. And the mechanism is extensible, so you can go crazy if you want, adding #{} for hash tables is only a few lines of code.
I'd like to conclude with this great essay I came across yesterday: http://www.storytotell.org/essays/good-for-whom.html
Do you think clojure has the potential to be useful in 20 years if the JVM dies today hypothetically? I don't know, I think yes, because it has a bunch of good ideas, but it isn't at all clear. Take JS as an opposite example, if the web is to disappear, JS will disappear as well, no matter how many other platforms it is ported to, it just isn't good enough to stand on its own.
I could be talking out of my ass here, but my point was that CL has a good track record for survival, so it has the potential for a 100 year language, while clojure is yet to prove itself for such a task. These things are extremely hard to predict, tech history has a habit of throwing such wild-cards as personal computing and the web. We'll see.