Live data from Hacker News

Why I chose Common Lisp over Python, Ruby, and Clojure

postabon.posterous.com

61–70 of 143 posts

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#61
post #17
post #15

Earlier quoted context omitted.

Most times you are interested in doing the simple, e.g.: filtered = [x for x in seq if x>10] Python's list comprehension is much more readable than using map/filter/reduce - at least for Python programmers :) Anyhow, I really like Guido's decision on dropping these - it creates a cleaner language and forces people to think Pythonic when programming in Python.

> Python's list comprehension is much more readable than using map/filter/reduce - at least for Python programmers For simple cases, yes. But I wouldn't say [each for each in [expensive_call(x) for x in seq] if cond(each)] is more readable than filter(cond, map(expensive_call, seq)) at least for functional-thinking minds. The level of thinking in abstract is different here. Now the problem is, some people see Python…

At first, I thought "wow, Python generator expressions are really ugly nested". This is especially true after working with C#3/Linq because query expressions have natural places for line breaks and read in a more consistent order.

Later, I ran into some cases where I wanted a multi-line lambda. And my thought was "aaragh134!#?!"

Then, a weird thing happened. I started making a conscious effort to follow PEP 8. 79 column limit? Seriously? That sucks. But after weeks of struggling with it, something finally hit me. I realized I was writing better code by forcing myself to reduce code density. Sure, it was a little bit longer, but I spend way more time reading it than writing it.

Stop trying to fight it; assign a name to that lambda. Readability counts.

Stop trying to be clever; assign a name to that inner expression. Flat is better than nested.

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#62
post #16

Did you really choose Lisp over alternatives? Before learning CL I was a fairly decent, C, C++ and Perl programmer. Did assembly, Pascal, TCL and Awk. Up to that point, I always had to pause a for a minute when starting a new project/script, think about its scope, and choose a language based on the necessary performance, development speed, expressiveness, available libraries, etc. (and whether whoever was going to re…

> Cliki was launched, C-L.net, and the #lisp IRC channel was born and

Google doesn't see any uptrend: http://www.google.com/trends?q=common+lisp

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#63
post #30
post #27

Ok, so Rails is too heavy weight for you? What about Merb? Or Sinatra, which was designed for just that reason? Dismissing Ruby as language because only one of a dozen available web frameworks is too "heavy-weight"sounds a bit short-sighted to me.

Not everybody has time to keep up with the continuous and rapidly increasing micro-speciation of all ruby projects from the VMs down to template formats.

" ...continuous and rapidly increasing micro-speciation of all ruby projects from the VMs down to template formats."

This is simply bullshit. There are merely a fair number of solid choices, as one would hope any decent language would offer. Being able to select appropriate tools for basic Web framework, ORM,and template language is a Good Thing.

There are only a handful of viable VMs, and for Web development the practical choices are MRI, REE, and JRuby.

"micro-speciation"? That's hysterical. Literally.

If Ruby doesn't interest you, fine. Bogus characterizations don't help anyone though.

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#64
post #33
post #27

Ok, so Rails is too heavy weight for you? What about Merb? Or Sinatra, which was designed for just that reason? Dismissing Ruby as language because only one of a dozen available web frameworks is too "heavy-weight"sounds a bit short-sighted to me.

I am not the OP, but I have a problem with Rails and alternatives: there does not seem to be a viable alternative to ActiveRecord around? I looked into DataMapper (I think that was it's name) which initially looked great. But then I could not find any information on how to use transactions, and also received no answers on the newsgroup. I guess I should have read the source, but I gave up at that point. Since I hate…

" ... there does not seem to be a viable alternative to ActiveRecord around?"

Sequel, which seems to be the most common ORM used with Ramaze, and DataMapper.

(I had been a fan of Og from years back, but development has, I think, stopped. )

Ramaze lets you swap in the ORM of choice and is the best alternative for folks who find Rails heavy-weight or heavy-handed.

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#65
post #48

Earlier quoted context omitted.

I have to second this. I switched from CL to Python years ago because of problems with the infrastructure, but now I'm in the process of switching back, largely due to Clozure becoming really ready for prime time, and tremendous improvements in the stability and usability of available libraries. The situation is still not perfect, but it vastly improved and getting better all the time.

Are you Erann? http://groups.google.com/group/comp.lang.lisp/msg/6f75cfb5a2...

AKA (also known as) Ron Garret.

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#66
post #21

Earlier quoted context omitted.

Really? What has improved in Common Lisp in the past two years? Thanks for this comment.

In the last two years? Clozure Common Lisp at least: an open source multithreaded Lisp implementation with unicode on Win32. Before then it was all Unix. Lisp platform independence is so good, I hack on win32 all day and when I am ready to deploy on Linux, the only warning I get is from git telling me it's converting line endings to Unix style. The staggering number of new and maturing infrastructure libraries; borde…

As a beginner to lisp, I have always been bothered by the lack of standardization - especially in terms of libraries.

For example, a couple of weeks back, there was an article about a python-based tool on HN (I forget which). There was a lot of opinion, however was generally about BeautifulSoup vs lxml.

Coming to CL, I dont even know where to begin for XML parsing (http://www.cliki.net/XML). Which is why, it seems like black magic when people make amazing software (quantz, postabon) .

I just get too intimidated on where to begin... it is similar to the javascript library fights that keep erupting on comp.lang.js : you ask about one and are made to feel like you should have chosen another.

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#67

Earlier quoted context omitted.

I like lambda because it allows anonymous functions-- functions that can be defined on the fly (dynamically) and then thrown away. IMO, it's generally bad form for a program to be dynamically creating named functions, filling the namespace. Also, I like map and filter because they aren't just functions in the procedural sense but combinators: you can pass them around, using them as arguments and returning them. It's…

You bring up a good point about passing map and filter around. I hadn't really thought of that. I still prefer to user list comprehensions, and don't think it would be so bad to have map, filter, reduce live in the itertools module. This would stylistically match what is done with the comparison operator functions living in their own module, which you can import if you need to pass the functions around.

List comprehensions are great, but they're sort of a DSL-- something the syntax recognizes as special and converts to something else. It's unusual that you can pass around higher-order syntactic elements, while every modern language worth its salt allows you to pass around functions.

Common Lisp has something similar, called LOOP. Implemented as a macro, it's a within-Lisp DSL for expressing looping constructs, e.g.

(loop for i from 1 to 10 sum i) => 55

(loop for c across "bar" collect c) => (#\b #\a #\r)

It's controversial within the CL community, because the loop language looks much more like traditional languages than Lisp.

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#68
post #16

Did you really choose Lisp over alternatives? Before learning CL I was a fairly decent, C, C++ and Perl programmer. Did assembly, Pascal, TCL and Awk. Up to that point, I always had to pause a for a minute when starting a new project/script, think about its scope, and choose a language based on the necessary performance, development speed, expressiveness, available libraries, etc. (and whether whoever was going to re…

> Cliki was launched, C-L.net, and the #lisp IRC channel was born and Google doesn't see any uptrend: http://www.google.com/trends?q=common+lisp

Not only that, it's noise compared to a few other dynamic languages:

http://www.google.com/trends?q=perl%2C+python%2C+ruby%2C+com...

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#69

Earlier quoted context omitted.

> Cliki was launched, C-L.net, and the #lisp IRC channel was born and Google doesn't see any uptrend: http://www.google.com/trends?q=common+lisp

Not only that, it's noise compared to a few other dynamic languages: http://www.google.com/trends?q=perl%2C+python%2C+ruby%2C+com...

I'm not disagreeing, but to be fair, "common lisp" is often referred to as "lisp" or "CL". So the phrase is good for (down)trends, but not for comparisons.

Re: Why I chose Common Lisp over Python, Ruby, and Clojure

#70
post #16

Did you really choose Lisp over alternatives? Before learning CL I was a fairly decent, C, C++ and Perl programmer. Did assembly, Pascal, TCL and Awk. Up to that point, I always had to pause a for a minute when starting a new project/script, think about its scope, and choose a language based on the necessary performance, development speed, expressiveness, available libraries, etc. (and whether whoever was going to re…

> I could write code faster than I would in Perl, Awk or TCL, it ran as fast as C++

Was that GUI code (as the rest of your post seems to imply)? CL is not competitive with C++ in terms of raw speed, in my opinion. Without type declarations, it's close to Perl.

Post reply on HN