

Ask HN: what's up with HN and Lisp? - CoffeeDregs

[edit: formatting]<p>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?<p>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:<p><pre><code>  * 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?</code></pre>
======
dandrews
I'm using Clojure for small personal projects, and a few toy applications at
the office. ("The office" operates an IBM mainframe under z/OS -- sometimes
this "write once run anywhere" stuff really works.)

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.

~~~
jfields
I have been fluent in Scheme for some time. In fact, I used Project Euler
problems and Racket (formerly called PLT) to teach myself Scheme. I enjoyed it
immensely, and it reminded me of why I decided to study programming in the
first place.

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.

------
Ingaz
I think of Lisp not as a concrete programming language as but essence of
programming itself.

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

------
mindcrime
_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?_

Not 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?

------
JoshCole
I do use Clojure. I'm not working yet, so its only for personal projects.
However, I've been using it on all sizes of personal projects. I especially
like using it for web scraping.

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.

------
igneous4
Like many folks, I'd reckon, I've really meant to learn Lisp or Scheme better,
but it just seems like -- with the lack of syntax -- it would be tedious to
write out _every single operation_ as a function/procedure call.

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.

~~~
SamReidHughes
There's no tedium of writing everything out with parentheses, so you don't
need to worry about that. You aren't writing everything "as a procedure call,"
or at least I wouldn't put it that way. For example, if you write babby's
first recursive function in Scheme,

    
    
        (define (factorial n)
          (if (= n 0)
              1
              (* n (factorial (- n 1)))))
    

There, the procedure calls are (= n 0), (* n (factorial (- n 1))), (factorial
(- n 1)), and (- n 1). You are not writing "(define ...)" as if it were a
procedure call. You are writing it as if it were a special form (because it is
one). That's a description of how it psychologically feels. Writing the (if
...) special form feels no different than writing if (...) { } else { } in
Java.

Lisp and Scheme are not tedious at all. I'd say Common Lisp is one of the
least tedious languages.

~~~
igneous4
Thanks for the reply, Sam.

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?

~~~
SamReidHughes
Oh, Perl. In some cases, Lisp would certainly be more verbose. It's probably
more tedious than Perl for some things. It also depends on which language you
use. Scheme is more tedious than Common Lisp, which is sometimes more tedious
than Clojure.

Here are the Clojure equivalents, omitting the act of assigning stuff to
variables.

    
    
        (map #(a-list %) '(3 1 4))
    
        ; I'm not modifying x in-place because unfortunately Clojure
        ; doesn't like that.  Common Lisp is more imperative.
         (.replaceAll x foo "BAR")
    
        ((colored-objects :red) 2)
    
        (str "Sorry, but " thing1 " doesn't work with " thing2 ".")
    
        (doseq [i (reverse (range 1 11))]
          (println "Counting down: " i))
    

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.

    
    
        (let [other-list (map #(a-list %) '(3 1 4))]
          (subsequent statements that use other-list))

~~~
igneous4
Thanks for those equivalents, Sam! Informative.

That first `(map #...)` is particularly interesting. Looks like you're
applying the item lookup operation across the list of indices. Neat.

~~~
SamReidHughes
The first example could actually have been

    
    
        (map a-list [3 1 4])

------
bayareaguy
I'm eager to use Clojure professionally but Python is more practical. Another
case of the "worse is better" syndrome.

