Live data from Hacker News

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

postabon.posterous.com

111–120 of 143 posts

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

#111
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…

Come on, man. If you're doing something worthwhile, it likely takes 2-3 months (if you're lucky) to just understand the problem. Common Lisp is an amazing language and development environment, but it won't help you actually solve the problem any faster, only to implement the solution. No silver bullets and all. I love Common Lisp, but the whole "code this in a weekend" thing has got to stop. Good software takes a dam…

I agree with both of you. Mahmud at that point was talking about all those projects that aren't worthwhile, by your (our) crazy definition.

Edit: but yeah, the "coding over a weekend" thing annoys the hell out of me too... but that's orthogonal to Lisp.

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

#112
post #78

Earlier quoted context omitted.

As a beginner just grab the XML lib which is easiest to install and looks comfortable to use. If it doesn't work out try another one. I really don't get all the complaints in this thread about the lack of a central library repository. How hard is it to use Google? Libraries aren't suddenly bad because they're not from Lib Grand Central. In other languages, Perl specifically, I've tried libraries from CPAN that were t…

Perhaps it's possible to get lucky and find good libraries using nothing but Google and patience, but I'm baffled that anyone would deny the value of something like CPAN. CPAN's structure enforces good practices: (e.g., tests, docs, bug tracking). CPAN provides not one but two excellent search pages. It also contains many reviews, and makes it trivial to see the source of any library or app before you download it. CP…

it goes beyond CPAN - it would have been nice to have a "batteries-included" version that packs in most useful libraries (like Python's Image, lxml, etc libraries).

The very argument that choice > standardization is something I dont get - even in Rails, you have the choice of not using the default templating engine, JavaScript framework, etc. But it doesnt mean that they dont package it in anyway. This accelerates adoption, since it gets out of your way - and later when you mature as a developer, you can of course customize it wildly.

It may or may not also have the happy side-effect that the quality of the packaged libraries increase, because of a much larger user-base. I'd much rather that people fork mature libraries than hack the one-millionth version of an XML library that just does 2 things.

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

#113

Earlier quoted context omitted.

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.…

Indeed, we figured out recently that it's basically embedded Algol 68... which seems superbly fitting somehow.

Common Lisp is very, very old. Tagbody and progv, anyone?

It's an influential language, for sure, but I prefer Clojure for a number of reasons.

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

#114

"The completely broken implementation of closures." That's what the nonlocal keyword is for.

When the fundamental design of the language is stacked against your style of working, the cognitive dissonance of using so many workarounds is a serious problem. I just switched to Lua during the Python 2 to 3 transition, and I haven't looked back. Real closures and tail calls, no GIL, a vastly more tasteful design, a dead-simple C API, and the whole shebang is a tenth the size of Python.

Meant to add: Lua's not perfect, but its whole design favors embedding it in another language, so it's a hell of a lot better about gracefully getting out of the way when it's better to write the parts that matter in other languages.

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

#115
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…

aside: Tim Bray on corporate sponsorship of languages: http://www.tbray.org/ongoing/When/200x/2009/10/01/C-dot-next...

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

#116
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…

Come on, man. If you're doing something worthwhile, it likely takes 2-3 months (if you're lucky) to just understand the problem. Common Lisp is an amazing language and development environment, but it won't help you actually solve the problem any faster, only to implement the solution. No silver bullets and all. I love Common Lisp, but the whole "code this in a weekend" thing has got to stop. Good software takes a dam…

Right, however don't forget there is a continuum of software types. The great majority of the code I write is customization of previous software for a new client. If you write enough business software, you will find out there are about 5-10 main components that they all have, and each new project differs only in how they're assembled, and the per-client business rules used to orchestrate them.

For example, it took me months to implement a decent RBAC system in CLOS; prototyping it literally took hours, just reading the wikipedia page. However, I had to refine that after every client, not just customizing it for the client, but iterating over it to make future customization unnecessary.

Billing, accounting, collaboration, knowledge management, human resources, lead management, CRM, inventory, etc. Do web-based implementations of those for a year and you will end up with the core necessary to ship any business software product in a very short time, assembling from your own repo. Augment that with web APIs (which I happily pay for) and you're there.

Another thing that I have become expert at is using other people's software. I am a hopeless cliki addict, mainly because I rarely code to scratch an itch; I have been writing Lisp code for years now, and for the last year, that's what I did full time :-) I have come to know huge libraries so intimately, including their quirks, that I can patch together something fairly quickly and get it out of the door.

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

#117

Earlier quoted context omitted.

Come on, man. If you're doing something worthwhile, it likely takes 2-3 months (if you're lucky) to just understand the problem. Common Lisp is an amazing language and development environment, but it won't help you actually solve the problem any faster, only to implement the solution. No silver bullets and all. I love Common Lisp, but the whole "code this in a weekend" thing has got to stop. Good software takes a dam…

I agree with both of you. Mahmud at that point was talking about all those projects that aren't worthwhile, by your (our) crazy definition. Edit: but yeah, the "coding over a weekend" thing annoys the hell out of me too... but that's orthogonal to Lisp.

I worked 8 months on a small-business management package in MFC/C++ using the "RAD" Visual Studio 6. That was the last piece of major code that I have written in something other than Lisp. Immediately after that, I wrote a similar package in CL with a web-based interface, using the free allegro serve; this one took me about a month, though it was functional after the first week.

I know what you're thinking; the previous project gave you the hindsight necessary to implement the second so quickly. Well, not really. The stuff I did in Lisp where things that have been on my requirements for the first project but was never able to implement without huge investments in time. MFC is the most brittle, most fickle and fidgety POS of all time; it generates the boilerplate for you and it expects to you to use its skeletons just the way they are. It took me months to experiment with the various data access APIs, ADO, DAO, and ODBC, moving from one to the next as problems arose, and each change of backend requiring a complete code overhaul.

Now I write database code in native idiomatic code; I can change the backend with a feature. I would sometimes forget to #+postgres on deployed code and find everything working but not see any change in the postgres logs, just to realize I have :sqlite3 pushed into my features ;-)

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

#119
post #98

Earlier quoted context omitted.

IMO, it's generally bad form for a program to be dynamically creating named functions, filling the namespace. That's what inner functions are for. This isn't the best example, but you get the idea: def foo(mylist): def n_to_the_n(n): if n > 1: return n**n return 1 return [n_to_the_n(i) for i in mylist]

Do the inner functions get cleaned up after you exit the function body? I'm used to Lisps, where def/defun/define/defn imply internment. For example, in Clojure: (defn foo [list] (defn n-to-nth [n] (Math/pow n n)) (map n-to-nth list)) Would intern the symbol 'n-to-nth in the current namespace. So every time I see "def", I think of something that has that (mild, almost always innocuous) side effect.

The inner function just falls out of scope, and is presumably collected.

  >>> def foo(mylist):
  ...   def n_to_the_n(n):
  ...     if n > 1:
  ...       return n**n
  ...     return 1
  ...   return [n_to_the_n(i) for i in mylist]
  ... 
  >>> print foo([1,2,3,4,5])
  [1, 4, 27, 256, 3125]
  >>> foo
  
  >>> n_to_the_n
  Traceback (most recent call last):
    File "", line 1, in 
  NameError: name 'n_to_the_n' is not defined
  >>>
Note that I only made the inner function longer than necessary for illustrative purposes :-)

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

#120
post #118

Earlier quoted context omitted.

Mahmud is a boy's name.

It could also be a man's name. teshekkur adamyrat ;-)

Sorry :-)

It's just that I wrongly thought you had referred to yourself as a female in an earlier post.

Post reply on HN