Lisp has had a tremendous impact on the world of programming. Even though Common Lisp and Scheme — the two main Lisp dialects — may not be considered mainstream today, several popular languages have been influenced by one or both of them.
It isn’t stretching things too much to say that both Ruby and Python can be seen as slower, easier (for beginners), object-oriented, infix Lisp dialects.
Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people. — Yukihiro “Matz” Matsumoto
Ruby and Python aren’t intimidating and remain very approachable for absolute beginners. Furthermore, their approachability is not confined to the language design itself, but transcends into the community and ecosystem that surrounds them.
I’m not here to discuss how languages like Ruby and Python managed to become more popular than major Lisp dialects nowadays. I’d rather focus on how these gentler introductions to functional programming are acting as gateway drugs to Lisp for many developers.
A community that values metaprogramming and is obsessed with the construction of DSLs (Domain Specific Languages) like the Ruby’s is, will no doubt find in Lisp a valuable ally. Plus, if you know Ruby inside and out, you should find Lisp to be easy enough to learn.
To attract Ruby developers though, Lisp has to offer something more than just a set of powerful features. You could say that Rails is enough of a reason to learn and use Ruby. But what is Lisp able to solve all that better than Ruby? I’ll answer that question by focusing on a specific dialect of Lisp, that I and continually more Ruby developers are getting into: Clojure.
It wouldn’t be fair to characterize the Lisp community as stagnant, but Clojure is definitely a welcomed dose of new blood. Clojure is a JVM-based modern Lisp designed for concurrency, which elegantly includes a set of carefully chosen features that are not easily found in mainstream languages.
In my opinion, Clojure has three main advantages over Ruby:
Clojure’s interoperability with Java resolves the issue of only having a few available libraries, which often affects new languages. It also helps in getting people to use the language within the enterprise world where Java still dominates.
Of all the “new” languages out there, I find Clojure to be the most fun, interesting and pragmatic: it’s something worth getting excited about. I don’t really care if it turns out to be the next Ruby or not, it’s a language that’s worth knowing and using. (If you haven’t tried it yet, a decent, short introductory book is the recently published Practical Clojure.)
Clojure’s popularity may even bring more attention to Lisp in general (for example, most must-read literature uses Scheme or Common Lisp). Perhaps then, it may indirectly help introduce more traditional Lisp dialects to a new generation of programmers.
If you enjoyed this post, then make sure you subscribe to my Newsletter and/or Feed.
I will only approve civil comments, whether in agreement or dissenting with my article. Trolling will not be tolerated, nor will negative comments be approved if posted through Tor or similar anonymizers (this is to prevent the same person from disrupting the discussion under false names).
Just some thoughts: Destructuring and sequence comprehension doesn’t get enough attention in the press. These are wonderful features. Designing solutions to problems using lazy sequences and memoization also doesn’t get enough attention. Clojure has some really good ideas and provides an easy mechanism (REPL) for learning them. I’m having fun coding again.
This comment was originally posted on Reddit
tl;dr: I kind of love Clojure from the first sight. I am currently a quasi-Python programmer (glue and batches on my systems in my corporate work), could not get myself to give Java love, so before Python I’ve used C for pleasure/CS assignments when given choice, C++ for CS projects that required it, PHP for work on the side (there is never a script that does not need fixing/tweaking). Familiar with lot’s of other stuff from Logo to Matlab and Prolog. After mucking with Python and Javascript flavours I tried to go functional three years ago. I’ve given Erlang a fair chance (worked my way through ,,Programming Erlang”), but the syntax hurts my eyes. Then I’ve tried Haskell (with ,,Programming Haskell” and ,,Real World Haskell”) and liked it a lot (purity rocks), but I’m sick of what people do with it — because you just gotta love the <++|++> operator when you see it, amirite? I heard about Clojure (pre 1.0) and Scala, first seemed immature, other was and is plain ugly. Then I came back to Lisp, namely Scheme. While yes, SICP is a slow read and ,,Little Schemer” is really the kick-starter. But… How could I use that at work without writing a business case and pushing this through myriad of managerial fluff? What about the libraries? Where are my ,,batteries”, man? So I went back to Python and I was happy. Got a brief romance with Javascript (Node.js @ V8), but it looked like nothing new would ever come. GoogleGo? Meh. New C++ standard? Meh. Out of boredom I’ve started polishing my SQL skills, but that could only keep me busy for some time. I was bored. Until few months back, that is, when I stumbled at some Clojure slides again. Immutable variables, targeted for JVM/CLR, minimal, compact, Lisp-y, almost mature. Gave it a try, then bought ,,Programming Clojure”, then did a full dive. It’s sweet. It’s simple, elegant, functional (purity and immutability) unless you need it to be something different..erm..concurrent (refs, agents). JVM is a lot faster than CPython VM, so even when brute forcing a problem (hi, project euler) it’s a breeze (not counting the startup time
. It’s lisp-y, but feels fresh. You can use everything that Java ships with. It’s JVM based, so it can be run on every machine I’ve got admin access to without a hassle. So is anybody saying that the parentheses are not readable? Yeah, so was whitespace for some people. I won’t be switching to Clojure anytime soon, since I’ve got a lot of time invested in Python (which I’m pretty awesome at), with Twisted and Excel tools and such, but I will slowly make Clojure my main hobby language and will try to push it at work as soon as I’m fluent enough and opportunity strikes. Maybe things will change when PyPy becomes the default implementation of Python (in like a million years), but I don’t think so. I naturally start everything from ( now. There is no turning back. Sorry for the rant, please don’t burn my karma.
This comment was originally posted on Reddit
A Hacker News commenter linked to a great comment on how to get started with Clojure: http://news.ycombinator.com/item?id=1033503
Just started Scheme about two days ago. It’s just wonderful, I like it very much. With that programming model, you have to think twice on the algorithms you’re going to use. And that’s good because you have no other choice than writing a piece of program in a proper way (for instance, you don’t initialize 42 variables just to make a nested loop). I like it so much that I’m currently reading the PNG Specification in order to be able to use PNG files with the Ikarus Scheme’s implementation, and I actually enjoy doing it: it’s fun. Anyway, one day I’ll certainly give Clojure a try. Looks promising.
This comment was originally posted on Reddit
I’d love Clojure more if all you LISPers didn’t indent your code in such a confusing fashion (and if it wasn’t on the JVM … but that’s another story). Call me Algolish, but I hate seeing ))))))) at the end of a code block. http://gregslepak.posterous.com/on-lisps-readability
This comment was originally posted on Reddit
I also find Clojure to be the most fun, interesting and pragmatic.
Immutable data structures they actually made it work in log32n.
lazy / infinite sequences and memoization – a nice powerful way to solve problems.
Destructuring and sequence comprehension – a wonderful mechanism that lets me clearly express how I want to deal with my data.
No one notices () after the first 2 weeks. Use an editor that colors them if you like.
I get more done in a day using Clojure (by far) than I could in a day using any other language over the past 20 years. Any my Clojure code is better designed and has less bugs and performs better given the same effort.
Rich’s videos on Clojure are a great way to enlighten yourself about a cool new thing in your universe.
There’s an interesting dissection of the SE Radio interview by Rich Hickey (clojure author) here:
http://whiley.org/2010/06/23/rich-hickey-on-clojure-se-radio/
This talks a lot on the advantages of using values and pure functions, compared with the normal OO approach.
[...] Wikibooks as a base, but I built on top of it , so as to customize and improve it.'; My previous post about Clojure generated quite a bit of interest, so I thought I’d follow it up with something a bit more [...]
Nice!
I am definitely going to give it a shot.