Domain: gigamonkeys.com
Stories and comments across the archive that link to gigamonkeys.com.
Comments · 71
-
Re:Unix is not the FutureI think what he was probably thinking of was the fact that most modern languages prevent buffer overflows and the rest. Lisp actually partakes of both natures, though: by default the language is safe but not as fast as it could be; you can tweak it to make speed more important, and you can even tweak it to make safety less important. It's kinda cool, actually.
I urge anyone who's not read it to take a look at Practical Common Lisp, which is an excellent introduction to an excellent language.
-
Re:As if that article wasn't bad enough...
-
Re:beta books = draft copys?
One recent example of a non-academic book where the author had a public feedback loop in this way, is Peter Seibel's "Practical Common Lisp". The chapters were published on the web and got updated frequently, and the author was active on and consulted comp.lang.lisp throughout the process. It was quite interesting to follow the development of a book so closely, and I must say it really boosted my respect for the works of good technical authors.
(The book (which really is dead sexy): http://www.gigamonkeys.com/book/ ) -
Re:LISP is amazing.
What can it do practically, that Python can't?
Funny you should ask. There's this book called Practical Common Lisp... perhaps you've heard of it?
-
Re:LISP is amazing.
This, imho, is something every language should have, and yet the only new language I've seen that lets users create their own blocks that way is Ruby...
You're confusing codeblocks (more specifically, closures) with macros. They're very different. Closures exist in many languages, including Lisp, Scheme, Haskell, ML, Smalltalk, Perl, Ruby, and even Javascript. They are one of the foundations of the functional programming paradigm, and do allow for a good amount of abstraction and code reuse, but they don't allow you to extend the language the way that Lisp macros can. See chapter 7 of Practical Common Lisp for an intro to macros which shows how much of Lisp itself is implemented as macros. -
Re:LISP is amazing.
See What's with All the Parentheses? and the conclusion In other words, the people who have actually used Lisp over the past 45 years have liked the syntax and have found that it makes the language more powerful.
-
Re:C++/Java/LISP Side by Side Comparison?
You could check out the book being reviewed. It's very clear, and it's online for free.
-
Re:This is not a troll, but a query...
I am an ex-Lisper who strayed from the One True Language and am now in the process of regaining proficiency to rejoin the Lisp Priesthood. My motivation is that I am tired of the limitations I hit due to the deficiencies inherent in all the other supposed "modern" popular programming languages I've encountered. I also remembered really *enjoying* the whole process of rolling Lisp code, a joy I lost long ago when I strayed into the mass market of more socially acceptable programming languages.
The deficiencies of modern languages I speak of above are not necessarily those of capability (though those exist), but are primarily of language design. Most languages are designed with the goal of increasing the productivity of the average programmer. Lisp's design was entirely about elegance, simplicity and power. I can give you lots of reasons why Lisp is better than insert-your-favorite-programming-language-here, but that will just devolve the conversation into a jihad. So, let me tell you what Lisp is fantastic at.
Actually, you know what? I'm not going to reiterate that which others have stated. If you really are interested, let me just point you to a couple of sites to get you started on your journey of discovery. Read Paul Graham's essays/articles, the first two chapters of Peter Siebel's book available on-line, this essay on Lisp's prowess as a rapid prototyping language and this paper on why the future of the (semantic) Web may lie with Lisp. Then, if you appetite is whetted, Google for more info, download a flavor of Common Lisp, work thru Seibel's book, and experience it for yourself.
Or not. If you're perfectly satisfied with whatever flavor you how you do your work, there is absolutely no reason to learn ANYTHING new, is there?
Learning Lisp. It will take you back to the future. -
Re:LISP is amazing.Well, try looking at the PCL chapter on making an HTML-generation library that lets you intersperse Lisp code with a weird parenthesesified version of HTML. Here's an example of the code you can write with it:
(html (:ul (dolist (item stuff)) (html (:li item))))
(Sorry I had to put that on one line, but Slashdot doesn't handle code indentation very well.)
This HTML generation stuff is very useful, and it's pretty difficult to make without using macros. Also, this compiles down to efficient code, rather than being interpreted.
There are other examples. For example, the LOOP uber-macro doesn't require any special support from the Lisp implementation, but it's practically a mini-language for expressing common looping idioms.
-
Re:LISP is amazing.Well, try looking at the PCL chapter on making an HTML-generation library that lets you intersperse Lisp code with a weird parenthesesified version of HTML. Here's an example of the code you can write with it:
(html (:ul (dolist (item stuff)) (html (:li item))))
(Sorry I had to put that on one line, but Slashdot doesn't handle code indentation very well.)
This HTML generation stuff is very useful, and it's pretty difficult to make without using macros. Also, this compiles down to efficient code, rather than being interpreted.
There are other examples. For example, the LOOP uber-macro doesn't require any special support from the Lisp implementation, but it's practically a mini-language for expressing common looping idioms.
-
Re:This is not a troll, but a query...Chapter 1. Introduction: Why Lisp?
Here's an interesting snippet:
The nearest thing Common Lisp has to a motto is the koan-like description, "the programmable programming language." While cryptic, that description gets at the root of the biggest advantage Common Lisp still has over other languages. More than any other language, Common Lisp follows the philosophy that what's good for the language's designer is good for the language's users. Thus, when you're programming in Common Lisp, you almost never find yourself wishing the language supported some feature that would make your program easier to write, because, as you'll see throughout this book, you can just add the feature yourself.
Note: I don't quite qualify as proficient in LISP. I took two courses with LISP a long time ago. One with "Structure and Interpretation of Computer Programs" (linked in the original post) and one in AI.
-
Re:Ruby, etc....Dead right.
All those C dialects just add features that you mostly don't need. Ok, the C++ object syntax (foo = 5;
instead ofobj->foo = 5;
in C) is nice.
Still, the real shortcomings of C aren't fixed, such as braindead syntax, only a single return value for functions (but a function can have 5 parameters; why?), lack of tailcall optimization, braindead calling conventions...
You might even say thatpublic static final synchronized Bla
makes the syntax even more braindead.
I don't really know Ruby, but at least it does OO righter than Java&Co (like Smalltalk, too). My language of choice these days is Common Lisp. -
Re:Why, oh why, did they have to repeat the tag na
Or even (:tagname data)?
Get this man a copy of Practical Common Lisp!
-
Re:Please explainAnother example, adapted from Practical Common Lisp:
In XML, you might have something like this:
<albums>
In Lisp you could have:
<album><title>Home</title><artist>Dixie Chicks</artist><rating>9</rating><ripped>T</ripped ></album>
<album><title>Fly</title><artist>Dixie Chicks</artist><rating>8</rating><ripped>T</ripped ></album>
<album><title>Roses</title><artist>Kath y Mattea</artist><rating>7</rating><ripped>T</ripped ></album>
</albums>((:TITLE "Home"
or just: :ARTIST "Dixie Chicks" :RATING 9 :RIPPED T)
(:TITLE "Fly" :ARTIST "Dixie Chicks" :RATING 8 :RIPPED T)
(:TITLE "Roses" :ARTIST "Kathy Mattea" :RATING 7 :RIPPED T))(("Home" "Dixie Chicks" 9 T)
("Fly" "Dixie Chicks" 8 T)
("Roses" "Kathy Mattea" 7 T)) -
Re:No decent langauges...
If all you have is a hammer, all your problems start to look like nails. If all you have is LISP, all your problems start to look like recursion.
It simply isn't true that lisp forces you to do everything recursively. Common Lisp has a well documented iteration facility through the LOOP and DO macros. These macros have existed for decades. And yes, they are real iteration, not recursion.
Common Lisp also supports object oriented programming natively through the use of generic functions. Yes, it's a bit different from message passing architectures like C++ and Java, but it is much cleaner and natural than say Perl's bastardized OOP concepts.
And yes, I Lisp daily. -
Re:Static typing is great!!Does A (pass in a function) work in O'Caml? Back when I know much more about O'Caml than I do now, I could have sworn that you had to use the B approach. Otherwise, why would anybody do it with parameterized modules? Yet there are Map.OrderedType and Set.OrderedType, which are just wrappers around the concept of passing a function, so there must be some reason.
Setting the sort order explicitly doesn't bother me at all; what bothers me is needing to use parameterized modules, which looks like bloating your code just to get around the type system. What I would like is to simply pass a function that can be applied to the element type in the tree---but I don't know how.
The way you would do this in Lisp is to either pass in a comparison function or to use a generic function for comparison, which is close to what you're talking about doing in Haskell. I believe there's something similar in G'Caml, but I haven't seriously looked into it yet.
-
Re:CommonLisp for the 21st century?!
How do you return an anonymous function from a function in Python?
You don't use lambda. You define a function (with def) under a temporary name and return it. The temporary name is local to the enclosing function, so it doesn't pollute the namespace: Python def differs in this regard from CL defun.But seriously, Common Lisp is the Common Lisp for the 21st century. It's doing quite nicely; in the past couple of years folks have taken this "old" programming language and added excellent support for all kinds of current needs -- a Web application server (TBNL), a remarkable SQL interface (CL-SQL), general-purpose dataflow programming (Kenny Tilton's Cells), PDF typesetting and generation (CL-PDF, a rival to TeX!), OpenGL
....(Peter Seibel's Practical Common Lisp is highly recommended for the "modern" programmer interested in this "old" language. Practical examples include spam filtering, an MP3 database, and a Shoutcast server.)
-
Practical Common Lisp
If you like the more practical approach of books like this and always wanted to see what the fuss about Common Lisp is all about, then Practical Common Lisp is for you. The book isn't finished yet, but some chapters are already online for review.
Learn CL while writing a flexible MP3 database, a spam filter or a generic parser generator for binary files. How about a streaming MP3 server or a unit test framework? It's all in there without the boring stuff, which usually accompanies books like these. -
Simplicity, macros, conditions, multiple dispatch
I use Common Lisp.
Lisp has almost no syntax, so it's extremely regular (barring exceptions like LOOP). Because it's so regular, it's easy to build macros that do powerful things.
Macros can completely transform the source, at compile time, but with the full power of the language. Having that ability, together with simplicity, means that it's easy to build a complete mini-language for one's manager or web designer to use on the site, and easy for them to learn it, since you can explain the syntax in 5 minutes or less, and they don't have to learn 50 built-ins to use it.
Common Lisp's conditions system not only allows exception-handling, like Python, but can also have an entire protocol for controlling execution flow built on it. More about that in the conditions chapter of Peter Seibel's forthcoming book.
Lastly, having a generic-function-based object system means that a method can "belong" simultaneously to more than one class, at the same time. So, instead of having a method inside a class, you call a method with any number of objects of various classes, and it figures out from the type of the object what method to run, of all the similarly named methods. You can even specialize a method on a particular object or objects, instead of a particular class or classes! Multiple dispatch rocks. -
Re:"generics"
I don't think I'd be going out on a limb to say that you don't really know what generics are as they apply to C++ and Java.
I think I will have to agree with you here.Given that Lisp is a dynamically typed language in the first place, I'd imagine that "generics" are a very different feature entirely in that language. So what are generics in Lisp, exactly?
What the parent is probably referring to when he talks about Lisp "generics" is macros, which are a totally unrelated concept.* Like you said, Lisp is dynamically typed, and the closest parallel to C++ generics is multimethods.* - A Lisp macro is a function that manipulates it's arguments before they are evaluated, with the result spliced back in the place of the macro call (this is pretty much the same thing as parse-tree manipulation in languages without explicit program representation). Peter Seibel's upcoming book explains them very well.
PS - Note that when I say Lisp here, I'm referring to Common Lisp. Scheme macros ("syntax-case") are a bit different, and Scheme doesn't come with multimethods or other goodies.
-
Re:"generics"
I don't think I'd be going out on a limb to say that you don't really know what generics are as they apply to C++ and Java.
I think I will have to agree with you here.Given that Lisp is a dynamically typed language in the first place, I'd imagine that "generics" are a very different feature entirely in that language. So what are generics in Lisp, exactly?
What the parent is probably referring to when he talks about Lisp "generics" is macros, which are a totally unrelated concept.* Like you said, Lisp is dynamically typed, and the closest parallel to C++ generics is multimethods.* - A Lisp macro is a function that manipulates it's arguments before they are evaluated, with the result spliced back in the place of the macro call (this is pretty much the same thing as parse-tree manipulation in languages without explicit program representation). Peter Seibel's upcoming book explains them very well.
PS - Note that when I say Lisp here, I'm referring to Common Lisp. Scheme macros ("syntax-case") are a bit different, and Scheme doesn't come with multimethods or other goodies.