Lisp Web Tales
Lisp Web Tales
My attempts at learning web development, foolishly using common lisp, and even more foolishly, writing about it in public
About the Book
Why Lisp
Today we have more programming languages than we can count. Somehow, Lisp still manages to stand out, at least for me. I've been obsessed with the lisp family of languages for four years now, and I've been especially interested in Common Lisp, which I consider to be the best general purpose dialect. It is an easy language to pick up, and a difficult language to master. So far, every day spend learning lisp has been a huge plus for me, so all those difficulties have been worth it. Lisp is fun, challenging and rewarding of such efforts. No language I've picked up since or before has felt the same way, they were all either needlessly complex(most of the complexity in Lisp is there for a reason), or too simplistic and lacking in sophistication when that is needed.
As for how practical this language is for web development, It's as practical as you make it. Lisp is the perfect language for the gray areas where were we still haven't quite figured out how to do things. I believe the web is one such area, and experimentation and playful exploration of ideas is vital. This is what Lisp was designed for, not for the web specifically, but for what it is, a new playground where flexibility and creativity have room to grow. Common Lisp has been a faithful ally in my self-education. Maybe it can be one for you too.
Whats in the book
The book is a set of tutorials and examples. It uses the Common Lisp language and some of the libraries we'll be using for the examples and tutorials include:
- The hunchentoot web server
- The Restas web framework
- The SEXML library for outputting XML and HTML
- Closure-template for HTML templating
- Postmodern for PostgreSQL access, and cl-reddis as a simple datastore
- Various utilities
Who is this for
This book is for anyone interested in Lisp and web apps. I assume you have some familiarity with both subjects, but I don't assume you are a Lisp expert, you can just read a few tutorials to get the basics and get back to my book to get started with web apps. I've linked some of them in Appendix B. So you need to know what (+ a b) means, I won't explain html and css to you, and HTTP shouldn't be a scary mystical acronym to you. Also some knowledge of databases would be good. In other words, I assume you are a programmer, know the basics and just want to play around with lisp. Happy hacking.
Table of Contents
- Preface
-
Introduction
- Why Lisp
- Whats in the book
- Who is this for
- What you need to get started
- Typographic conventions
-
1 The basics
- Raw example
- A simple blog
- The source code
- Source walk-through
- Conclusion
-
2 Setting up a project
- Systems
- Quicklisp and manual installation
- restas-project
- Setting up a hello-world project
- Running the project
- Conclusion
-
3 HTML generation and templating
- Exploring all the options
- closure-template
-
4 Putting it together: Updated blog example
- Creating the project
- Setting up defmodule.lisp
- Updating the templates
- Rewriting the routes
- Post chapter refactoring
- Running the app
-
5 Persistence part I: PostgreSQL
- Introduction
- Setting up PostgreSQL
- What is a policy?
- Creating the project
- The schema
- Connecting
- Defining the tables.
- Defining our interface
- Exporting the interface
- Conclusion
-
6 Persistence part II: The UI
- Introduction
- Set up
- The templates
- The routes
- Getting it to run
-
7 Persistence part III: Redis
- Introduction
- A note on redis
- The “schema” or lack there of
- The implementation
- Handling upvotes
- Handling links
- Conclusion
-
8 Modules as reusable components part I: restas-directory-publisher
- Introduction
- Handling static files in restas
- Mounting modules
- Adding a stylesheet to linkdemo
- Contexts
- Conclusion
-
9 Modules as reusable components part II: Implementing a reusable module
- Introduction
- The interface
- The templates
- The routes
- Using authdemo in an application
- Conclusion
-
Appendix A: Getting started
- Linux
- Windows
-
Appendix B: Recomended reading
- Online tutorials
- Cliki: The Common Lisp wiki
- IRC
Causes Supported
Electronic Frontier Foundation
Defending your civil liberties in a digital world.
https://www.eff.org/Based in San Francisco, EFF is a donor-supported membership organization working to protect fundamental rights regardless of technology.
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them