2008

2007

Dude where’s my charset!

▁ jan 29 2008

In 2001, Paul Graham announced that he was working on a new LISP dialect called Arc, and today it was released for the public (although still unfinished). There’s plenty of languages to choose from, and only time will tell how successful Arc will be, but it will certainly get attention.

Read more »

. o .

Common Lisp and darcs

▁ jan 26 2008

darcs seems to be the RCS of choice for Common Lispers, for some reason. From my experience, if a package isn’t downloadable and ASDF-Installable from cliki.net, there is usually a darcs repository available. Unfortunately, ASDF-Install can’t install directly from a darcs repo.

Even more unfortunately, I wasn’t able to install darcs (or more specifically GHC) using MacPorts. However, there is a darcs client written in CL available, which works fine for getting code from darcs repositories. Typing (darcs:get-repo URL local-directory) fetches the latest version of the repository and puts it into the specified directory.

2007 seems to have been the year of the version control systems, in particular the distributed version control systems, such as Git, Mercurial, and Bazaar. Darcs seems not to have gotten as much attention, but seems to be an interesting use case for Haskell, in addition to Pugs (the Perl 6 compiler and interpreter).

It seems like only yesterday that we got Subversion, that was to save us from the horror of CVS. How did we ever manage without all these other version control systems?

. o .

Implementation of a blog in Common Lisp: Part 3

▁ jan 26 2008

Part 3 of the blog/webapp tutorial is now up. Enjoy! Comments and suggestions for improvements are welcome.

It took a while longer to write this part, since I’ve been more busy than usual. This part covers creating a new blog post (previously only editing has been implemented), outputting HTML, HTTP authentication, and finally packaging with ASDF.

This ends this three-part tutorial, and it’s been very interesting learning more about Common Lisp.

. o .

Colorize

▁ jan 26 2008

When writing Implementing a blog in Common Lisp: Part 1, I wanted something to colorize the code snippets to make the appearence a little fancier. Surprisingly enough I stumbled upon colorize, an application written in Common Lisp for colorizing Common Lisp, Scheme, Elisp, C, C++, or Java code.

Here is a small example:

(defun foo ()
  “This is a function.”
  (let ((a 10)
        (b 20)
)

    (+ a b)
)
)

It looks ok, and most importantly it will highlight the parenthesis when you hover the different parts of the source code. Try it! It supports Lisp, Scheme, elisp, C, C++ and Java.

. o .

Implementation of a blog in Common Lisp: Part 2

▁ jan 06 2008

Part 2 of the blog/webapp tutorial is up.

I’d like to point out that I’m learning most of how to do this as I go along, perhaps not the best way to write a tutorial, but I’m having fun, and perhaps someone can make use of it. In other words; feel free to suggest improvements.

Hunchentoot and Elephant is a great combination for creating web applications. Unfortunately, the current methods for querying the database in Elephant is limited, but the roadmap supposedly includes significant improvements of this.

Btw, the Elephant comes with an example of an implementation of a blog, using Hunchentoot and CL-WHO.

. o .

Implementation of a blog in Common Lisp: Part 1

▁ jan 04 2008

The last few weeks I’ve been playing around with Common Lisp. I’ve been doing that off and on (mostly off) for a few years now, never really getting the hang of it because I’ve been too easily distracted. This time I thought I’d give it another try, and to make it more practical I’ve given myself a little project so that I’m using what I’m learning for something concrete.

For this project I’ve been looking into various frameworks for web application development, and I’ve come up with a combination I think works ok. To help others on their way, I’ve decided to create a small tutorial on how to create a blog with Hunchentoot, html-template and Elephant. This is just to introduce the frameworks and show how easy it can be.

Part 1 shows how data can be stored persistently, and HTML pages generated and served to the user. Enjoy!

. o .

Language choice

▁ jan 02 2008

So many languages, so many choices.

Python

reduce( lambda sum, current: sum + current, [1, 2, 3] )

Common Lisp

(reduce #'+ '(1 2 3))

Ruby

[1, 2, 3].inject(0) { |sum, current| sum = sum + current }

Perl

map {$sum += $_;} (1,2,3);

Which one do you prefer?

Update: I changed the Common Lisp version from using lambda to using the + function instead, it’s a lot less verbose. Thanks to everyone who pointed that out. ;)

powered by