Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Common Lisp implementation of Google's protocol buffers

branch: master
Octocat-spinner-32 example
Octocat-spinner-32 google Add plugin.proto February 06, 2012
Octocat-spinner-32 protoc Use -stdc=c++0x argument so that GCC understands unique_ptr. January 24, 2014
Octocat-spinner-32 varint Use the nibbles library when encoding integers. January 24, 2014
Octocat-spinner-32 web-site Add initial web page. March 04, 2009
Octocat-spinner-32 COPYING
Octocat-spinner-32 README Note that the compilation steps for protoc-gen-lisp work for both January 19, 2012
Octocat-spinner-32 TODO Remove TODO item about generating code into different packages. February 05, 2012
Octocat-spinner-32 golden Initial commit of Common Lisp protocol buffer project. September 30, 2008
Octocat-spinner-32 lispworks-float.lisp Use Lispworks FLI to implement single-float-bits. September 30, 2011
Octocat-spinner-32 message-test.lisp Prefer a .proto file's "package" to its "java_package" when determini… February 09, 2012
Octocat-spinner-32 package.lisp
Octocat-spinner-32 portable-float.lisp Reindent code using latest version of Slime. November 29, 2011
Octocat-spinner-32 proto-lisp-test.lisp Generated protocol buffer code now lives in separate packages, the na… February 03, 2012
Octocat-spinner-32 protobuf-test.asd Fix the example code. February 03, 2012
Octocat-spinner-32 protobuf.asd Remove ASDF 2 compatibility code. Increment version. January 24, 2014
Octocat-spinner-32 protocol-buffer.lisp Rename %string-field% to %sf%. February 05, 2012
Octocat-spinner-32 testproto1.proto Add asdf:*PROTOC-RELATIVE-PATH* to control whether a relative or abso… December 21, 2010
Octocat-spinner-32 testproto2.proto Add asdf:*PROTOC-RELATIVE-PATH* to control whether a relative or abso… December 21, 2010
Octocat-spinner-32 wire-format.lisp Fix field skipping code. April 24, 2012
Octocat-spinner-32 wire-format_test.lisp
Protobuf is a Common Lisp implementation of Google's protocol buffers.

The protobuf repository contains a compiler from .proto files to Lisp and the
run time support needed by the generated Lisp code.  Not all protocol buffer
features are implemented, but the code works well enough that serialization
tests pass.

The protobuf code has been tested with ABCL, CCL, CLISP, Lispworks, and SBCL.
In the past it has also worked with Allegro Common Lisp, but I have not tested
it recently.


0.  Install the software needed to clone a git repository and compile C++ code.
You'll need at least git, G++, and libtool, which on a Linux system can often
be installed with a package manager:

    sudo apt-get install git g++ libtool

1. The Common Lisp protocol buffer compiler is implemented as a plugin to
Google's protocol buffer compiler, so you must first build and install Google's
compiler, which is called protoc.  The required code and documentation are
available here:

2.  Clone the protobuf git repository to get a local copy:

    git clone git://

3.  Compile protoc-gen-lisp, the Common Lisp protocol buffer plugin.  The steps
required for Linux and OS X are:

    cd protobuf/protoc/lisp
    Manually edit INSTALL_ROOT and PROTOC_ROOT in Makefile.
    make install

Eventually, I will add GNU configure support and the compilation steps for
installing protoc-gen-lisp to /local/software/package/protoc-gen-lisp will

    cd protobuf/protoc/lisp
    ./configure \
        --prefix=/local/software/package/protoc-gen-lisp \
    make install

4. Download and install other Common Lisp packages that protobuf depends on.
You'll need ASDF, but it comes pre-installed in most Common Lisp distributions.
You'll also need, which you can download by cloning its git

    git clone git://

If you're not using Allegro, CLisp, or SBCL, you may need trivial-utf8, which
is available here:

To run all the tests, you'll need the Stefil testing package and its


The trivial-utf-8 and hu.dwim.stefil packages and their dependencies are
available via Quicklisp:

5. Make and protobuf.asd available to ASDF.  There are
several ways to do this and you should consult the ASDF documentation to
determine what will work best for you.  ASDF and its manual are available here:

On my system, I tell ASDF where to find the and protobuf system
files by creating a file called source-registry.conf in directory
/home/brown/.config/common-lisp/ with the following contents:

   (:tree "/home/brown/src/base/")
   (:tree "/home/brown/src/protobuf/")

6. Tell ASDF where to find Google's protocol buffer compiler and the Common
Lisp plugin.  The file paths to use depend on where you have installed each.
You can either edit the pathnames used to initialize PROTOBUF-CONFIG:*PROTOC*
and PROTOBUF-CONFIG:*PROTOC-GEN-LISP* in protobuf.asd or you can set these
variables in a Lisp initialization file before protobuf.asd is loaded by ASDF.

7. Compile and load all the protobuf code:

    (asdf:load-system 'protobuf)

8. Optionally, load and run all the tests:

    (asdf:test-system 'varint)
    (asdf:test-system 'protobuf)

9. Compile and run the example code, which shows how to incorporate protocol
buffer definition files into your own projects:

    (asdf:load-system 'protobuf-example)

    (in-package address-book)
    (add-person :id 100
                :name "Robert Brown"
                :email-address ""
                :phone-numbers '((home . "718-555-1212")
                                 (work . "212-589-1212")
                                 (mobile . "917-555-1212")))


Please report bugs and send suggestions to or
contact me directly.  My email is robert.brown at the mail hosting site
Something went wrong with that request. Please try again.