<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

    <link rel="icon"          href="/favicon.ico" type="image/x-icon">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
    <link rel="stylesheet"    href="../../../../../../default.css"  type="text/css">

    <TITLE>Brainfuck in Lisp -- Lisp in Brainfuck</TITLE>

    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
    <META HTTP-EQUIV="Description"
          NAME="description" CONTENT="BASIC in Common Lisp">
    <META NAME="author"      CONTENT="Pascal J. Bourguignon">

    <META NAME="keywords"    CONTENT="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>