Ask HN: what's up with HN and Lisp?
[edit: formatting]
I was browsing through HN this morning and came across the Lisp-at-JPL submission (http://news.ycombinator.com/item?id=2212211). There were about 3 other Lisp stories on the same page... And a question came to mind: putting aside PG and HN-being-written-in-Lisp, what's the deal with Hackers News and Lisp?
I'm curious about the actual status of Lisp (and Clojure) among HNers. I aspire to use Clojure, but I have not yet done so and am wondering if I oughta do a small project in it. The submissions on HN suggest I should do so. So:
* Do you use Lisp/Clojure?
* On core projects at work? On utilities or side projects at work?
*On serious personal projects? On small personal projects?
* Do you aspire to or want to use Lisp/Clojure? Why?
* Learn something new?
* See if you experience some of that wonderfulness
that everyone talks about?
* Do you know others who are serious Lispers?
* Are you reading HN and assuming that there are
lots of serious Lispers out there? (I am.)
* Is Lisp really seeing the kind of interest and
usage suggested by the submissions?
* Is HN groupthinking about Lisp?
13 comments
[ 4.2 ms ] story [ 123 ms ] threadNot yet. I've only recently started making a concerted effort to learn Clojure; so I haven't written any "production" Lisp yet.
Do you aspire to or want to use Lisp/Clojure? Why? Learn something new? See if you experience some of that wonderfulness that everyone talks about?
Yes, and for all of the reasons you mention. I've been hearing about how incredible and productive Lisp is, so I want to find out first-hand if it really lives up to the hype or not. If it does, then maybe using Lisp (via Clojure) could actually represent a real competitive advantage.
Do you know others who are serious Lispers? Are you reading HN and assuming that there are lots of serious Lispers out there? (I am.)
I really don't know anybody personally who I would call a "serious Lisper." But I do know some other people who have gotten on the Clojure bandwagon and are learning Clojure.
Is Lisp really seeing the kind of interest and usage suggested by the submissions? Or is HN groupthinking about Lisp?
Who knows?
I do want to be using Lisp, mostly because it is giving me a chance to experience programming in a new way. The only really new thing I've learned is a sort of mental click on how programming functionally feels. However, I've also been exposed to a lot of new concepts. I don't think I've had any sort of enlightenment, but I do think I've improved.
The only other people I know who use Lisp are people I met after starting Clojure. It has some really awesome people lurking in its IRC channel.
As to whether or not the Lisp love is group think, I have no idea. I can tell you that most of my teachers in college don't even know Lisp exists and I'm the only student I know who is using it. Subjectively, my teachers don't seem very competent to me and my fellow students don't seem to program outside of the classroom.
I can tell you that Lisp doesn't seem as readable as python, but it is still fun to program in. I don't regret that I'm trying out Clojure.
Is Lisp/Scheme as tedious as I'm assuming? I'm not talking about readability -- surely one can get used to the parens and indenting and read (and write) it just fine -- I'm talking about tedium of everything having to be a procedure call.
Lisp and Scheme are not tedious at all. I'd say Common Lisp is one of the least tedious languages.
To provide some small examples, I often use Perl, and it gives me some syntax that saves me typing, such as:
* `my @other_list = @a_list[3, 1, 4]` to return just those items from a list (item 3, item 1, and item 4)
* `$str =~ s/$foo/BAR/g` to do string replacements (in string $str, replace all ocurrences of contents of variable $foo with "BAR")
* `my $thing = $colored_objects{red}->[2]` to get item 2 in the list of red-colored objects ($colored_objects is a mapping of color names to lists of items of that color)
* `my $error_msg = "Sorry, but $thing1 doesn't work with $thing2."` to interpolate the values of those 2 variables into the string
* `for (reverse(1 .. 10)) { say "Counting down: $_"; }` (counts down from 10 to 1)
I suppose I've always just guessed that operations like those in a Lisp language would require multiple lines and procedure calls, which would become tedious to write after a while. Is that the case?
Here are the Clojure equivalents, omitting the act of assigning stuff to variables.
If you took the first example and assigned it to a variable other-list, it would typically be in a let expression, with a body.That first `(map #...)` is particularly interesting. Looks like you're applying the item lookup operation across the list of indices. Neat.
Before my infatuation with Clojure I spent a couple of years intermittently hacking at SBCL, writing other toy applications, flirting with CLSQL and UCW and struggling with the ASDF ecosystem. CL became a disappointment because of the library problem, and because I couldn't shake the feeling that the language was overburdened. How many operators for equal do you need, anyway?
(Joke, joke. Well, sorta.)
Frightfully smart people, worthy of your respect, say you should know Lisp.
You've already surmised that there's some groupthink here on HN. PG is one of Lisp's principal cheerleaders, he writes in lucid prose and has a couple of very nice textbooks to his credit. (On Lisp is probably the best macro treatment out there.) HN is itself written in PG's own Lisp variant, and there's lots of us here who have drunk the Kool-Aid.
So do invest some time in Lisp, but don't believe for a moment that you can do a few Euler problems and have a good feeling for the language. Your effort will take some time, however long it takes to learn to recognize design patterns in Lisp code. (This is where those autoindenting editors shine.)
And which Lisp? You'll get as many opinions as there are Lisps. Clojure's emphasis on FP attracts me, and its heavy emphasis on Java interop is immensely practical. You've got eight months to go before the next Conj; better get cracking, and good luck.
Unfortunately, I spent so long writing Scheme for my own amusement that I neglected my skill with C. I felt like a complete idiot the next time I tried to compose something in C, and I try to be more mindful of such things now.
I think that main feature of Lisp - Lisp is "syntaxless". And I mean not CL or Scheme or Clojure. I mean some "abstract Lisp"
But syntax sugar is not so bad in itself - you can treat python and javascript as versions of "infix scheme", you can treat java as horrible lisp-macros library, you can treat Perl as especially horrible Lisp with some funny inclusions.
I think that Lisp is a start of the road, not the end