<div class="document" id="brainfuck"
     title="Brainfuck in Lisp -- Lisp in Brainfuck"
     description="BASIC in Common Lisp"
     author="Pascal J. Bourguignon"
     keywords="Brainfuck, Common Lisp, Lisp, virtual machine, compiler, emulator"

  <H1>Brainfuck in Lisp</H1>

  <p>This file contains:

      <li>a brainfuck virtual machine in Lisp</li>

      <li>a brainfuck optimizing compiler, translates to lisp and compiles
        lisp to native code</li>

      <li>a sketch for an implementation of a lisp on brainfuck. Nothing
        much actually, some macros to generate brainfuck code from lisp,
        some lisp "vm" primitives.  I kind of abandonned this, given the
        time complexity of any non-trivial brainfuck program and space
        limitations of the brainfuck virtual machine (however, this
        brainfuck to lisp compiler reduces the time complexities by using
        some random access to the memory, so it might be practical. Not
        that there is no limitation on the size of the
        programs...).<br>Instead of implementing a lisp system over the
        brainfuck virtual machine, it might be more practical to implement
        a lisp compiler generating optimized brainfuck code.</li>


    <LI><A HREF="bf.lisp">bf.lisp</A></LI>
    <LI><A HREF="99botles.bf">99botles.bf -- the "99 Bottles" program in brainfuck</A></LI>