Common Lisp/Case Studies in CL< Common Lisp
The purpose of this chapter is to provide a set of in depth examples, or case studies, in implementing programs in Common Lisp. The goal here is to provide some a taste of what a full fledged Common Lisp application might look like. This is important as a typical Common Lisp application usually doesn't look like many little parts tacked together. The unique level of abstraction that the programmer can achieve in Common Lisp tends to promote programs that tailor the language to the purpose, and leads to overall efficiency of development.
A secondary purpose for this chapter is to highlight some packages that were passed up in other sections. Some Common Lisp applications/projects, for whatever reason, just didn't fit in elsewhere in this book. Some were excluded because a Common Lisp beginner wouldn't find it interesting, others due to a large learning barrier to using them and too much text would be required to explain, and even others still that are perhaps unstable due to recent development or stagnant and suffering from bitrot. These projects still have some very cool parts to them and now that you have a firm footing in everything Common Lisp, we can introduce these packages and spend the extra time explaining what is necessary.
Writing Web ApplicationsEdit
- A web based game in Common Lisp
- Uncommon Web (UCW)
Solving NP Problems, NondeterminismEdit
Bear with us, since this is a rather computation theory intense subject. By writing nondeterministic code, one can trivially write down a solution to an NP problem. There is no such machine that can execute that code in polynomial time, but there are nondeterministic emulators that can execute the code in exponential time. Even though such an emulator would take a very long time to find a solution given a large enough input, it is still useful prototype a dumb implementation in a few minutes. More importantly, however, this prototype can be developed to provide better performance or use approximations to find near solutions efficiently.
Several languages have nondeterministic emulators. Prolog (via backtracking search) and Scheme (via continuations) come to mind. Common Lisp has a package that provides this functionality; it's called Screamer. We have discussed Screamer before, but it warrants further in depth examples. Screamer performs what's known as CPS transformation on your code, producing an emulation of the nondeterministic behavior.
- Do something neat with Screamer
Screamer on CLiki
Context Oriented ProgrammingEdit
Context Oriented Programming is a new paradigm of programming where the context in which code is executed modifies what it does. The designers envision it as further development of the ideas that Object Oriented Programming and Aspect Oriented Programming where meant to address.
- Do something with ContextL
Computer Algebra and Automated Theorem ProvingEdit
Earlier dialects of Lisp pioneered work in Computer Algebra (computer aided manipulation and solving of algebra and calculus problems) and Automated Theorem Proving (computer aided proofs of mathematical theorems).
- A mathematical simplification program
- Using Common Lisp from Maxima and Maxima from Common Lisp
- Proving with ACL2