Lisp Web Tales

My attempts at learning web development, foolishly using common lisp, and even more foolishly, writing about it in public

337 readers

100% Happiness guarantee Learn more

Minimum: FREE!

Suggested: $10.00+

Ways to buy

  • Free sample download
  • 337 readers
  • 91 pages
  • 100% complete
  • Book language: English
  • Cc-by-nc-sa

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.

About the Author

The Leanpub Unconditional, No Risk, 100% Happiness Guarantee

♥♥♥♥♥

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks. We process the refunds manually, so they may take a few days to show up. See full terms.

If you buy a Leanpub book you get all the updates to the book for free! All books are available in PDF, EPUB (for iPad) and MOBI (for Kindle). There is no DRM. There is no risk, just guaranteed happiness or your money back.

Causes Supported

Eff-huge

Electronic Frontier Foundation

Based in San Francisco, EFF is a donor-supported membership organization working to protect fundamental rights regardless of technology.

From the Internet to the iPod, technologies are transforming our society and empowering us as speakers, citizens, creators, and consumers. When our freedoms in the networked world come under attack, the Electronic Frontier Foundation (EFF) is the first line of defense. EFF broke new ground when it was founded in 1990—well before the Internet was on most people's radar—and continues to confront cutting-edge issues defending free speech, privacy, innovation, and consumer rights today. From the beginning, EFF has championed the public interest in every critical battle affecting digital rights.

10.0% of Pavel Penev's royalties are going directly to Electronic Frontier Foundation.

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

Last updated

This Book is for Sale Through Leanpub

Authors and publishers use Leanpub to publish amazing in-progress and completed books like this one.

Leanpub_logo_medium

Read

Leanpub has a wide selection of in-progress and completed books available to browse, purchase, and enjoy.

Browse the Bookstore

Write

Leanpub is free for authors and publishers to use. We pay authors or publishers 90% royalties minus 50 cents per sale.

Write a Book