|chunked-hello-world||demonstrate chunked data transfer with two one-second delays|
|compress-response||send a response body compressed if the client supports it|
|cookie||set cookies from server and client side|
|echo-get||parse and echo a GET query string|
|echo-post||parse and echo a POST parameter|
|error-hook||provide custom error pages|
|eventsource||eventsource emitter and consumer|
|hello-world||simplest example application|
|markdown-middleware||static file handler with markdown preprocessor|
|rest-hello-world||return the data type that matches the request type (html, json or text)|
|rest-basic-auth||basic HTTP authorization with REST|
|rest-pastebin||create text objects and return the data type that matches the request type (html, text)|
|rest-stream-response||stream results from a data store|
|ssl-hello-world||simplest SSL application|
|static-world||static file handler|
|web-server||serve files and list directory entries|
This is a tutorial on how to implement a programming language. If you ever wrote an interpreter or a compiler, then there is probably nothing new for you here. But, if you’re using regexps to “parse” anything that looks like a programming language, then please read at least the section on parsing. Let’s write less buggy code!
The ToC on the right is in “simple-to-advanced” order. I’d recommend you not to skip forward, unless you know the subject well. You can always refer back if you don’t understand something. Also, questions and feedback are very much appreciated!
What are we going to learn
- What is a parser, and how to write one.
- How to write an interpreter.
- Continuations, and why are they important.
- Writing a compiler.
- How to transform code to continuation-passing style.
- A few basic optimization techniques.
In between, I’m going to argue why Lisp is a great programming language. However, the language we will work on is not a Lisp. It has a richer syntax (classical infix notation that everybody knows) and will be about as powerful as Scheme, except for macros. Sadly or not, macros are the ultimate bastion of Lisp, something that other languages just can’t conquer (unless they are called Lisp dialects). [Yes, I know about SweetJS… close but no cigar.]
But first, let’s dream up a programming language.
Videos of the talks given at the European Lisp Symposium
ELS 2016, May 9-10, AGH University, Krakow, Poland
Part of what makes Lisp distinctive is that it is designed to evolve. As new abstractions become popular (object-oriented programming, for example), it always turns out to be easy to implement them in Lisp. Like DNA, such a language does not go out of style.
LISP/c is a powerful macrolanguage for C. It basically turns this:
(@printf (str “Hello, world!”))
into (after it being cleaned up (more on this later)) this:
int main(int argc,char **argv)
First, you might check out this video. Because LISP is expressive and C is fast and I wanted the best of both worlds is the short answer. The longer answer has something to do with macros. But instead of immediately boring you with that, I’ll answer what you really want to know:
Why Should I Care?
First let’s discuss if you can use it. Not to be elitist (I wish everyone would use this tool), but you must know both C and LISP fairly well to be able to use LISP/c.
Suppose, however, that you do already know both LISP and C pretty well. You might want to use LISP/c because it features access to LISP to write C code both implicitly and explicity. You might also want to use it if you like writing CUDA code, because it has built-in support for CUDA as well.
But really, to see why you might like to use LISP/c, check out a few examples, and feel free to skip around a little.
Lisp aliens have infected the terrestrial memetosphere with the meme complex of Common Lisp. The mindless human hosts find themselves helpless spreaders of the glory and joy of Lisp Development. Join us and become a great Lisp Programmer! Learn how to build and deploy modern Lisp applications in the booming ecosystem of modern software inhabited by lesser technologies!
Welcome to Composing Programs, a free online introduction to programming and computer science.
In the tradition of SICP, this text focuses on methods for abstraction, programming paradigms, and techniques for managing the complexity of large programs. These concepts are illustrated primarily using the Python 3 programming language.
Instructors: If you are interested in adapting any of these materials for your courses, please fill out this short survey so that we can support your efforts.
LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang compiler. Code produced with it is compatible with “normal” Erlang code. An LFE evaluator and shell is also included.