Live data from Hacker News

The Land of Lisp

landoflisp.com

61–70 of 146 posts

Re: The Land of Lisp

#61

This book comes up in #lisp on freenode every so often, and the channel is generally split on whether or not to recommend it. I generally do. It's fun and lighthearted. Using games as a medium to teach the language is something some people enjoy, and is a lot less dry than most programming books. It avoids taking sides on the editor war, by just ignoring it altogether and teaching Lisp . This is refreshing compared t…

> This is refreshing compared to most books, which hit you with the Emacs cinderblock to the face right in the preface.

While if they use Emacs' lisp features that approach could be useful for some people (mainly those unfamiliar with or undecided on an editor to use), it's likely to strike others that don't already use Emacs as extremely annoying. I'm glad I haven't encountered that (but I haven't read a book on Lisp either).

Re: The Land of Lisp

#62
post #32

This book is destined to be a classic programming book, just as "The C programming language", "The Little Schemer" or "Operating systems: Design and implementation". I would really like to meet Conrad Barski and give him a great hug. And invite him a good beer. Be sure to read the comic that is on the bottom of the page!! Now, to be honest, a quicker or more practical introduction to Lisp would be the "Practical Comm…

Thanks for the kind words! Glad you enjoyed my book!

I was going to jump in and say nice things about your comic, too. I really like the light-hearted dramatization of what really motivates programmers: the elimination of bugs. The fact that there are a few, discrete approaches is only obvious in a language that supports them all, like Lisp. (I think I might be a combination of CLOSest, minimalist, and continuationist). (I would point out that the multi-corists are more motivated by performance than correctness)

Re: The Land of Lisp

#63
When I discovered lisp several years ago, it was indeed the textbook moment of enlightenment that you've heard about. This book was a part of that introduction for me (along with Practical Common Lisp). After working in C-like languages, I had no idea that programming could work this way as in lisp, the idea of code and data being inseparable, I even had dreams at night about run-time data structures getting expressed as quoted lists! (I kid you not!)

It is now several years later and I have earned my living ever since by working in another lisp, Clojure. And I have indeed learned a lot along the way and what I've learned does indeed translate to how I work in other languages (even C++, which I also love).

However -- it is not all roses and nicely-flavored toothpaste after a savory feast. There is one aspect to lisp programming that, by virtue of its dynamic typing, I still find myself struggling to reconcile. No matter how much I marvel at what I can do in one or two lines of lisp, I do still often find myself making dumb mistakes that a compiler would catch instantly. Without type annotations and checked structured data for everything, it can also be hard to remember what a function does, or what its variables represent, when you read the code later.

One aspect of this that has made a big difference is naming -- how you name things in lisp and dynamic languages is a skill in its own right that helps guide the readability of code in the absence of types. When I look at C++ code I've written, the verbosity of naming is a clear influence from lisp. And it is an improvement.

The other feature that occurs more often is in-line documentation. It is a joy to read Clojure programs (the good ones, anyway) where every (non-trivial or meaningful) function has a little paragraph summarising what it does. This is just good in any language, but somewhat essential in a dynamic one.

Finally, run-time contracts and things like Clojure.spec come about to help fill the void of static typing. The problem I have there is that you add back into your code a fair amount of the verbosity that was removed in the first place by using a dynamic language (just look at Clojure.spec's lengthy annotations for a function signature, and I find myself wondering... why god oh why?). At which point, I then wonder why not just go back to using a static language.

So using lisp taught me perhaps one final, frustrating lesson: there are just great things about both dynamically typed and statically typed languages, and I've learned that the fence is an awkward place to sit.

Re: The Land of Lisp

#64

This book is destined to be a classic programming book, just as "The C programming language", "The Little Schemer" or "Operating systems: Design and implementation". I would really like to meet Conrad Barski and give him a great hug. And invite him a good beer. Be sure to read the comic that is on the bottom of the page!! Now, to be honest, a quicker or more practical introduction to Lisp would be the "Practical Comm…

Am I mistaken or is that Alan Kay smashing bugs in the comic? :)

LOL! He must be Alan Kay!!

"Gotcha!" -- Alan Kay smashing a bug

Re: The Land of Lisp

#65

Earlier quoted context omitted.

A common complaint about Lisp code in general is that programmers tend to write code that is idiosyncratic [ED: I previously used the word "idiomatic" here in reply to the OP but was conflating terms, making this post rather irrelevant but at least it provoked a discussion] (i.e. rather than looking like templated design patterns with standard names, the program is heirarchically built of modules in a domain-specific…

> rather than looking like templated design patterns Speaking about another lisp, Clojure, it is a goal that each program finds its own design pattern. That's kinda the whole idea. Design patterns can really get in the way, unless your language requires them, which some languages do (i.e. Java where everything must be an object, so OO it is, or Apple's platforms where the MVC pattern is deeply interwoven into all the…

>By contrast, design patterns are about forcing a common solution onto a range of different problems.

This is one of the best criticisms of Design Patterns i've ever read. Great point.

Re: The Land of Lisp

#66
post #51

Earlier quoted context omitted.

That might be (perhaps) true in other languages, but that is not the point in Lisp.

Best practices, patterns, idioms are all important no matter what language. Lisp is not special in this regard (although, I admit, Lisp developers may stick around a bit longer).

>Lisp is not special in this regard

In reality, yes, at least because of two differences:

1. Lisp is a significantly more powerful language, compared to most non-Lisp languages. Thus, many patterns and practices that are needed in other languages, are simply not needed at all in Lisp, or become far simpler.

2. Lisp is a "programmable programming language" where code is a "first class citizen" and can be manipulated as well as any other kind of data such as numbers. This opens a very different approach to programming, with its own, different "best practices".

Re: The Land of Lisp

#67

When I discovered lisp several years ago, it was indeed the textbook moment of enlightenment that you've heard about. This book was a part of that introduction for me (along with Practical Common Lisp). After working in C-like languages, I had no idea that programming could work this way as in lisp, the idea of code and data being inseparable, I even had dreams at night about run-time data structures getting expresse…

My first go at lisp was working through SICP. I loved it. But I couldn't see myself using it for a medium-sized project just because static typing is that valuable to me.

Now I'm learning Racket, and Typed Racket feels great so far (despite a few awkward spots). You don't have to sit on that fence; you can switch between typed and untyped code at will.

Re: The Land of Lisp

#68

This book comes up in #lisp on freenode every so often, and the channel is generally split on whether or not to recommend it. I generally do. It's fun and lighthearted. Using games as a medium to teach the language is something some people enjoy, and is a lot less dry than most programming books. It avoids taking sides on the editor war, by just ignoring it altogether and teaching Lisp . This is refreshing compared t…

> The main issue people have with the book is that it uses CLISP-specific code in a few places. CLISP's last release was seven years ago, and because it hasn't really been maintained it's beginning to bitrot. Folks in #lisp generally don't recommend using CLISP these days, instead recommending actively-maintained implementations like SBCL, CCL, ECL, ABCL, etc.

Note that CLISP is actively maintained; the most recent change was three hours ago: https://sourceforge.net/p/clisp/clisp/ci/63508ea11cf0b2062ca...

I have no idea why the maintainer hasn't released a new version since 2010. Doesn't make any sense to me.

I use SBCL, but CLISP is still alive.

Re: The Land of Lisp

#69

When I discovered lisp several years ago, it was indeed the textbook moment of enlightenment that you've heard about. This book was a part of that introduction for me (along with Practical Common Lisp). After working in C-like languages, I had no idea that programming could work this way as in lisp, the idea of code and data being inseparable, I even had dreams at night about run-time data structures getting expresse…

>Without type annotations and checked structured data for everything

I guess this problem you mention must be Clojure-specific, because in Common Lisp you can declare the data types of the input parameters and all return parameters, and have the compiler (i.e. SBCL) do static type checking; also the compiler can tell you which data types are accepted and returned by your function, by use of the "describe" function.

Furthermore, you can define your own types, structs, and classes, and the declarations (and static type checks) will work with them as well.

Re: The Land of Lisp

#70

When I discovered lisp several years ago, it was indeed the textbook moment of enlightenment that you've heard about. This book was a part of that introduction for me (along with Practical Common Lisp). After working in C-like languages, I had no idea that programming could work this way as in lisp, the idea of code and data being inseparable, I even had dreams at night about run-time data structures getting expresse…

My first go at lisp was working through SICP. I loved it. But I couldn't see myself using it for a medium-sized project just because static typing is that valuable to me. Now I'm learning Racket, and Typed Racket feels great so far (despite a few awkward spots). You don't have to sit on that fence; you can switch between typed and untyped code at will.

>But I couldn't see myself using it for a medium-sized project just because static typing is that valuable to me.

See my comment above, you can have static-typing in Lisp with no problem: Type declarations are part of the Common Lisp standard[1], and implementations like SBCL (one of the best Lisp implementations out there, and free) will do static type checking.

[1] type declarations: http://clhs.lisp.se/Body/d_type.htm

"the" (type specifier for return values): http://clhs.lisp.se/Body/s_the.htm#the

EDIT: a good example here:

https://news.ycombinator.com/item?id=8598149

Post reply on HN