Libmarpa is the C language library that implements the parse engine
at the core of Marpa.
It is used by
the Perl CPAN module,
but it is completely separate,
and resides in
its own github repo.
These instructions describe how to install the separate Libmarpa.
Unless reading Libmarpa is your only interest,
you may also wish to install Marpa::R2.
Libmarpa contains a few tests,
but the most extensive test suite for Libmarpa
is that for Marpa::R2.
To install Libmarpa, do the following:
the github repo.
At the top level, make dists.
Be aware that Libmarpa requires a lot of associated software,
including Knuth's literate programming system, Cweb.
All the software is freely available and open-source,
but getting it all together
may be complicated. Sorry.
This done, there will be four standard distribution
directories at the top level:
In the case of the autoconf directories,
proceed as you would with any other standard autotools distribution directories.
In the case of the CMake directory,
proceed as you would with any other standard CMake distribution directory.
- ac_dist/ for building the library itself using autoconf.
- cm_dist/ for building the library itself using CMake.
- doc_dist/ for building the documentation using autoconf.
This distribution builds a multi-page version of the HTML.
- doc1_dist/ for building the documentation using autoconf.
This distribution builds a single-page version of the HTML.
In reading and working with Libmarpa, the following documents will be useful:
- The Libmarpa API document, which is online in
The Marpa theory paper,
which has the formal description,
a proof of correctness,
and proofs of my complexity claims.
Pseudo-code for the Marpa parse engine is also included.
Working on Libmarpa
I worked hard to limit the prerequisites needed to
configure, compile and run Libmarpa.
Working on Libmarpa's internals is another matter.
Libmarpa is literate programming --
and work on Libmarpa's internals requires,
among other things,
Knuth's CWeb and therefore Tex.
Libmarpa is highly mathematical code.
Its internals are, frankly, daunting.
For me, Marpa has a real beauty,
but nobody could claim it achieves that beauty through simplicity.
I once had hopes that reading
Marpa would be like experiencing the effortless
power of a late Picasso.
But Angkor Wat and Hieronymous Bosch show that beauty
comes in many forms.
a "bleeding edge" version of the Libmarpa API document,
formatted as a single page of HTML.
Please be aware that this version may be untested and unchecked.
Unless you are assisting in Libmarpa development,
you will want to ignore this page,
in favor of the API documentation for a stable release.