Published 2025-10-21
tag(s): #smallweb #meta #programming
I don't think I've written this many "techie" posts in a row since I started the blog 🤔
In this post I
mentioned that I now have a small dynamic site. Yes, it is written in Common Lisp. How could
it not be? 😎 Here is the repo.
I set up the site, and created a Pastebin clone, which seemed like an easy enough thing to get
started with web development in CL.[1]
You can play with it here: Hoagiebin
Now, the version I published on the the very first try worked only via curl. The
next day I added a page to paste text.
A couple days ago, I figured it could support file uploads from the browser too, and while
thinking about it I realized it had...other problems.
Take for example this paste
created from the main function in ColibrÃ:

Even before testing it, I knew it would display like crap. Because the text was returned
as-is, without even setting the Content-Type response header.
I had two options[2], set the header to text/plain, or render
the output in a pair of <pre><code> tags. The advantage in the
second case is that I can also set a nice title for the page. So I did that:

Later, when testing, I realized I also needed to escape HTML characters.
And I put this feature behind (brittle) detection, via the User Agent request
header, of whether the request came from a browser or something else.
So that curl requests still get plain text directly.[3]
The renovated Hoagiebin homepage has a button to upload files. Pretty early on I thought I didn't want validation of file types, but after testing for a bit, that opened the door to a bunch of errors. Instead of trying to predict the problems, the error message is printed back in a very plain page, with a link to go back.
I find this one the most "scary" features in the tool, but I think I did just enough to prevent
something/someone from breaking the site.
If they aren't actively trying, I mean. I am sure there are a lot of ways to break it :) but
my concern was that it wouldn't break during normal usage.
And also, the textarea is probably as vulnerable as the uploads... 🤷
Ahhh, who doesn't love a good template, right? That's how all the posts in this site start
their life as: a "sample" file with some example markup, and some markers here and there.
I moved the all three pages in Colibrà out of the code, and into template files. And then I
added a bunch of other pages! And made the pages more beautiful...for my extremely
limited design sensibilities. I mean, look around this site. Right?
But, I still didn't want to invest the time to learn a proper HTML generation framework (I think the one I would use is Spinneret), in part because I am only replacing one or two values in each template. And also because I wanted to focus in Hunchentoot and the routing part first.
I moved around some of the code, because I think long term, the colibri.lisp
source file will have only the routing/pure web parts, and I will divide the system in
smaller files, one for each site (hoagiebin.lisp, tool2.lisp,
etc).
So I removed more things from the routing definitions and moved them to individual functions.
And the vibe that gives me is that of ASP.NET MVC applications, and the routes would be the
Controller part.
But that's were the similarities end. So far?
I will still keep everything in the same package, as I don't anticipate anything I can build being big enough to justify living in a separate namespace (that's what packages are in CL, more or less).
And then I had to deal a bit with reading and changing headers, and
revisit with-output-to-string, which I discovered somewhat recently. I could have
imported another library for that string clean up, and probably eventually will. But for this
single project, that is all.
Earlier this morning I could have shared a snippet using Hoagiebin, but felt like I shouldn't because the tool was unstable and ugly. It still is ugly, but I would like to think now it is stable, which is why I am writing this post talking about it.
And other than fixing bugs in it, I don't know what else I could add.
OK, there are things to add, stuff like syntax highlighting for example. But I have no
interest in such features.[4]
All that is left now is using the site, and thinking of the next tool.
Or finishing the dict server...