Finding libraries for Lisp programming

If you’re interested in trying out Lisp programming, you might wonder how you can find libraries for useful functions.  Maybe you want to try your hand at some Mandelbrot set generation, but don’t want to have to figure out how to write out the graphical files for viewing.  Perhaps you want to do something with networking.

The starting point I’d recommend is the common lisp wiki at www.cliki.net. There, you can find links to working libraries that perform many useful duties, and let you concentrate on the code you’re trying to write.  For instance, under graphics libraries, you will find about 70 entries ranging from PNG/JPG output to the Cairo API, to OpenGL linkages.  Chances are you’ll find what you need for your project there, and if not, there are other possibilities, as we’ll see later, when I talk about CFFI.

5 thoughts on “Finding libraries for Lisp programming

    1. Yes, I have built software with Lisp. My Lisp prototype of an ongoing project for work was demonstrated to customers to show them what was under development. That was done by compiling and loading the Lisp code into sbcl and then dumping an executable core image, so my co-worker could run it like any other Linux binary, invoking it from the shell with switches and arguments on the command line.
      I’ve also written a little ncurses-based sudoku puzzle, available here.
      Also, many years ago, I wrote a graphical solver for Laplace’s equation. A bit of code to do SOR solutions for simple electrostatic problems that the user could input with a sort of primitive drawing program. That’s some of my oldest Lisp code, and likely shows some of my inexperience.
      Over the course of these projects, I’ve used external Lisp libraries like CL-PNG to generate diagnostic plots for the work project, the now deprecated CL-NCurses for the Sudoku puzzle program, and McCLIM to make the SOR GUI with mouse controls and plotting.

  1. many people said they use lisp just for prototyping, and i saw that you said that too, so what is prototyping at all, can you explain this to me , thanks 🙂

    1. Prototyping is really a phase of exploratory programming. There are some projects for which the solution is not obvious. You might try a solution to the problem, and find that it doesn’t work, but the failure gives you more insight into the problem, and you try again with a new approach. Prototyping code tends to be quick and dirty, not much effort put into comments or data structure design, it’s mostly about figuring out how to approach the problem.
      Once you have a working prototype, it’s typically a mess. Poorly-commented code, lots of dead code from experiments that didn’t work out, data structures that were adjusted as the code changed instead of being redesigned based on new insights, that sort of thing. The intended output of prototyping isn’t code, but understanding. When you’re done with the prototype, you know enough about the problem to write a proper program to handle it.
      The danger comes from two places. One hazard is the project manager who says “let’s just ship the prototype, and if we find time, you can clean it up in a later release”. You’re never given the opportunity to fix it, so you wind up shipping and maintaining buggy, poorly documented, poorly designed code, that was only ever intended to demonstrate how to solve the problem.
      The second hazard is that programmers are lazy. Once the prototype is working, and it’s time to write the real code based on the understanding from the prototype, there’s always the temptation to copy and paste a bit of code across from the prototype. Then, you start having to keep the old data structures because that’s what the copied code requires, and pretty soon your “real code” is a semi-cleaned up version of the prototype, rather than a proper rewrite. I avoid this issue by prototyping my C++ code in Lisp. No matter how lazy I might become, I’m not going to get anywhere by copying Lisp code into my .cpp files, so I’m forced to do a full, proper rewrite using the lessons learned in the prototype.

      1. first, thank you very much for writing so much to explain prototyping to me, it’s much much clear to me now 🙂 , in your previous reply you also mentioned some of your lisp projects which really give me a direction of where to go with lisp, i used to just read blogs like yours or hang around in comp.lang.lisp, didn’t do much work with lisp. anyway, thank you very much 🙂

Leave a Reply to hualet Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

反垃圾邮件 / Anti-spam question * Time limit is exhausted. Please reload CAPTCHA.