August 2010
3 posts
Micro languages in Clojure - part 2
In the previous article we constructed a tiny DSL for generating SQL statements using a more Clojure like syntax.  It works, but it has a couple of problems:  It doesn’t parameterize SQL variables, and nesting doesn’t work properly.  In this article we’ll rectify those issues, and add a bit of addition functionality. So to parameterize the SQL statements we obviously need to...
Aug 18th
Micro languages in Clojure via macros and let.
While working on a couple of web projects using moustache I’ve been slowly building up some abstractions for dealing with SQL for data durability.  The abstractions are built on top of the clojure.contrib.sql library which works great.  However I was interested in being able to express my queries in a more “Clojuresque” way. The library that immediately popped to mind was the...
Aug 12th
Clojure simple threaded web server performance...
After reading David Nolen’s post about Aleph I was curious to see how scalable a simple Clojure threaded web application could be when paired with good old Postgres 8.4.  To make things just slightly more realistic, two queries will be generated per request, and a basic listing of the data will be produced. I’m running this experiment on an iMac with a 2.8 Ghz Intel Core i7 with 8...
Aug 3rd
4 notes
March 2010
1 post
Named routes for Compojure
I’ve been itching for named routes in Compojure for a few weeks now.  I tend to change my site structure often in the beginning of a project, and string literals for links was making my life difficult. Here’s my, probably naive, solution:
Mar 6th
February 2010
1 post
Sending email from Clojure.
I’m working on several small projects in Clojure, and for one of them I needed to be able to send email.  Quick googling revealed this.  Java Mail API?  Just what I wanted.  However since I’m using leiningen, I needed to find a maven repository with javamail.  In my search for javamail I happened across Apache commons-email, the description is as follows: “Commons Email aims to...
Feb 23rd