The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Need Opinion: use Python or Lisp?

Hey guys,

I have a little side-project I want to play with, which may or may not turn into anything. Without going into gory detail, I need a language that's good at recursing into trees & such, so I've narrowed it down to Python or SBCL. I've done some medium-sized projects in Python before, & I've diddled with Lisp enough to be comfortable with it. I don't really need Lisp macros for this project, but I don't need Python's cross-platform capability either.

I've followed the Reddit wars online. If I use Python, I'm afraid of how it will bog down as the input data sets start to get large. If I use SBCL, I'm afraid of running into some fatal flaw or weird, non-standard behavior in the sockets or threads.

Opinions? Experiences? What language to the geeks at universities use for things like AI and agent-based modeling? Thanks.
Johnny the Geek
Sunday, December 03, 2006
 
 
I would suggest python (as would Joel based on his systems ready for the enterprise article), as it appears to be a more stable enviroment with more future.

>What language to the geeks at universities use for >things like AI and agent-based modeling?

At my university it seems that they mainly use prolog.... ARGGGGHHH!!!
Martin Schultz Send private email
Sunday, December 03, 2006
 
 
Ask reddit ?
Pakter
Sunday, December 03, 2006
 
 
If recursing into trees is what you're doing, avoid Python like the plague - its creator has consistently and stubbornly refused to implement tail-call optimisation (apparently efficient recursion would be too confusing for Python programmers to comprehend), so you'll blow the stack and crash out.

Lisp will avoid this problem, if you can put up with the parentheses.

An alternative would be to choose a modern functional language that was designed to work with trees (Lisp was designed for lists, not trees).  Haskell would fit the bill quite nicely.
Iago
Sunday, December 03, 2006
 
 
Wow. I actually hacked up a call-tree cost analyzer in Python  once (piggybacked onto a free C call tree analyzer). It recursed through the function call tree of an entire C project to find the most expensive path. I guess the only reason I got away with it is that the C being analyzed was an embedded firmware project & therefore not very big.
Johnny the Geek
Sunday, December 03, 2006
 
 
Both Franz (http://www.franz.com) and LispWorks (http://www.lispworks.com) have evaluation versions of their platforms available for download.
Maurice
Monday, December 04, 2006
 
 
Python is slow compared to compiled Common Lisp.

That may or may not make a difference in what you're doing.
dot for this one
Tuesday, December 05, 2006
 
 
Repeat after me:

TAIL RECUSION IS NOT RECURSION

How do you optimize tail calls? Turn them into iterative loops.  Why not just use loops in Lisp? Because the look ugly  (and require special forms).  It takes about 5 minutes to write a tree structure that you can climb through in pretty much constant space in python.
Grant
Wednesday, December 06, 2006
 
 
Actually after a couple weeks of diddling on the web I've decided to go with Python even though I like Lisp more as a language. I'm not willing to deal with the fragmentation of tools & libraries in the Lisp world, not to mention the complex & inscrutable licensing terms. Too bad, I really like it as a language.
Johnny the Geek
Thursday, December 07, 2006
 
 
What about Scheme?
*myName
Saturday, December 09, 2006
 
 
If you need access to lots of libraries (mail, networking, regular expressions, databases, etc.) then use Python.

If you want the path of least resistance in terms of having standard tools and libraries that are well-documented, covered in books, and work identically across multiple platforms, then use Python.

If the tricky part of your application is algorithmic and involves lots of fancy data structure work, then consider using Lisp (but only you don't have either of the other two issues).
James Send private email
Tuesday, December 12, 2006
 
 
MyName: at first glance Scheme seems to have the same library incompleteness for things like sockets & threads. (If you know of a scheme that has good cross-platform sockets & threads, please enlighten me. There are a lot of Schemes out there).

James: yep, that's what I'm going to do. This project is such that I think I can simplify my models & still get an acceptable result while remaining within the limits of Python's computing power.

An aside: the world could really use a unified Lisp project. Call it "monolisp" or something. My wish list would be:
-- Open-source, but doesn't force your app to be open-source

-- Standardized cross-platform socvkets, threads, & C interface (maybe by wrapping the Boost libraries?)

-- Standardized cross-platform gui widgets (maybe by wrapping wxWidgets?)

-- Standardized cross-platform package management

-- One-stop shopping to download all the junk you need

I think most people are introduced to new languages by dabbling in them, & only later decide to use them in a real project. Lisp's problem is it's not friendly to dabblers. An open implementation that you can use for commercial projects is also highly desirable. Most of us have had bad experiences with our tools being yanked out from under us. I've been there often enough that I'm reluctant to put all my eggs in a proprietary basket.

Clisp would be just about perfect as a base if its creators could be persuaded to offer say a $200 license that allows you to use sockets & CLOS without making your app open-source.
Johnny the Geek
Tuesday, December 12, 2006
 
 
Special misinformation alert: I misunderstood the Clisp license. Your app only becomes open-source if you link to the INTERNAL parts of CLOS or sockets (i.e. your app extends CLISP). If your app only accesses EXTERNAL stuff (i.e. you are a plain old user), your app is exempt. My mistake.
Johmmy the Geek
Thursday, December 14, 2006
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz