News for hackers. Stuff that matters.
Re:Lisp vs Python by lwat on Sunday February 20, 2011 @06:19PM (#2243479)
Why does Lisp provide macros? Because they make code easier to read.

To the person writing the code, yes. To the next coder maintaining the code, not likely.

Re:Lisp vs Python by pavelludiq on Sunday February 20, 2011 @06:36PM (#2243542)
Do you have any data(even if anecdotal) to back up your claim? My experience is that macros don't obfuscate code at all(unless misused, I'm talking about idiomatic use of course). If i have the code loaded i just type (documentation 'macro-or-function-name 'function) to get its docstring. Slime can also show me its documentation and its argument list. Not to mention that a good macro(like any other well written code) is obvious. On the internet Lisp is the most unmaintainable language, in practice its pretty maintainable.
Re:Lisp vs Python by cesarm on Sunday February 20, 2011 @08:03PM (#2243765)
true, but i still find the loop macro confusing.
Re:Lisp vs Python by lwat on Sunday February 20, 2011 @07:57PM (#2243745)
Here's an anecdote from the other day:

http://news.ycombinator.com/item?id=2240461

On another note, why do you think lisp isn't more widely used?

Re:Lisp vs Python by cesarm on Sunday February 20, 2011 @08:05PM (#2243774)
Re:Lisp vs Python by rayiner on Sunday February 20, 2011 @10:04PM (#2244075)
Why isn't Smalltalk, Prolog, Modula, ML, Eifel, FORTRAN, Ada, APL, etc, more widely used? Because there can only be a couple of "mainstream" languages, and C/C++ took up all the mindshare in that period.

In fact, a more useful question is: "why is Lisp even used as much as it is?" The current Common Lisp standard is 20 years old, and yet it supports a pretty active if small user community, which is more than can be said of most of its contemporaries.

Re:Lisp vs Python by euccastro on Sunday February 20, 2011 @09:48PM (#2244035)
Well, that anecdote talks about some people _fearing_ powerful, expressive languages.

In a previous job I had workmates arguing for banning "nested" Python list comprehensions. And as an example of such horrible nesting he proposed something like:

  some_list = [some_function(blah)
               for blah in some_other_function()
               if some_condition(blah)]
What this says to me is that this guy didn't get list comprehensions at all and didn't want to. Sure enough, there's no nesting whatsoever going on here. He was just scared by non-C++-like syntax.

My point is: popularity, though desirable in itself, is a poor measure of anything else. Most people run away from good things for no valid reason.

(Not saying there are no valid reasons why Lisp is not more popular, only that none would really be needed. Obscurity is quite a stable default.)

Re:Lisp vs Python by pavelludiq on Sunday February 20, 2011 @08:52PM (#2243891)
Others already pointed out the AI winter. Reading about the history of lisp is very interesting, it almost feels like you are reading about a lost civilization, so ahead of its time. On the other hand, the AI winter is in the past, why isn't lisp used NOW? I think its getting better, the scheme people are working on sorting out their issues, and of course theres Racket, which is awesome. You have the clojure people attracting a lot of java and ruby developers(among others) to at least give lisp a chance. And even the Common Lisp world is on the rise. The biggest problem IMHO is that there are too many non lisp programmers with strong opinions on lisp that spread FUD, even though all their lisp experience can be summarized as "read a scheme tutorial, and wrote a recursive factorial function".
Re:Lisp vs Python by rayiner on Sunday February 20, 2011 @09:56PM (#2244053)
Look through some really old Lisp code sometime. SBCL is highly readable despite being: 1) 25 years old and touched by tons of different people since then; 2) a program that does some really complicated things in a pretty small space (~60 KLOC for the arch-independent portion).

When you see (def-ir1-transform ...) in the SBCL source, it's immediately obvious what is about to come along (at least if you know about compilers). Similarly old C code (eg: GCC) is completely incomprehensible in comparison.

Re:Lisp vs Python by flatline on Sunday February 20, 2011 @06:58PM (#2243595)
Isn't this true of all forms of encapsulation? Deeply nested type hierarchies, event chains, and even method calls can be nearly impossible to decipher, even with a graphical debugger, syntax highlighting and static typing. Writing maintainable code is a skill in any language. Lisp offers a lot of advantages to this end.
Re:Lisp vs Python by lwat on Sunday February 20, 2011 @07:04PM (#2243611)
Isn't this true of all forms of encapsulation?

Yes it is.

Re:Lisp vs Python by gnosis on Sunday February 20, 2011 @06:33PM (#2243533)
Have you ever actually programmed in Lisp? Macros can and often do hide all sorts of ugliness that would otherwise make the code a hundred times more unreadable. Much of Lisp's syntax sugar is built with macros.