Ocean of Awareness

Jeffrey Kegler's blog about Marpa, his new parsing algorithm, and other topics of interest

Jeffrey's personal website


Marpa resources

The Marpa website

The Ocean of Awareness blog: home page, chronological index, and annotated index.

Mon, 21 Nov 2011

Which Marpa distribution to use?

Which distribution of Marpa should you use? Marpa::XS or Marpa::PP or the "bare name" Marpa? Use Marpa::XS if you can, Marpa::PP otherwise. The "bare name" Marpa is a legacy distribution, and should be avoided by new users and in new implementations.


Marpa::XS incorporates all of my C language speedups. As well as the fastest of the Marpa distributions, it is also the only one in beta -- in particular, I will be at pains to keep the interface stable. Marpa::XS is best both for the casually curious, and for those intending to use the Marpa algorithm in their applications. Note that since Marpa::XS remains beta, caution is still advised.

Marpa::XS DOES require a C compiler, as well as glib and a few other GNU prerequisites. To run and install Marpa::XS and its documentation, you DO NOT need POSIX, glibc, gcc or TeX.


If you can't install Marpa::XS, the other choice is Marpa::PP. Marpa::PP is Pure Perl; it has most of the features of Marpa::XS; and it has fewer prerequisities. But Marpa::PP remains in alpha; it is 5 times slower than Marpa::XS; and it will have a lower priority for bug fixes.

"Bare name" Marpa

The "bare name" Marpa distribution is a legacy. If you are new to Marpa, please do not use it. I leave it on CPAN only as a service to Marpa's past users. If I could remove it without impacting them, I would.


  1. "POSIX": In theory, Marpa::XS runs on Windows. I say "in theory" because while all of Marpa::XS's prerequisites run on Windows, to my knowledge nobody has ever assembled them and actually run Marpa::XS on Windows. I am not "anti-Microsoft", but I do not at this moment have access to a Windows machine.
  2. "glib and glibc": It's easy to confuse glib and glibc. Both are GNU libraries. glibc is GNU's C standard library, which implements parts of POSIX and requires others. Marpa::XS does NOT require glibc or POSIX.

    glib, on the other hand, is GNU's cross-platform software utility library. Marpa::XS DOES require glib. glib does NOT require UNIX, POSIX, or glibc. glib is not tiny, but the alternative to Marpa::XS's use of glib would be my attempt at a portable reimplementation of those parts of it that Marpa::XS uses. For the moment, glib is the safest and easiest way to go.

  3. "gcc": Marpa::XS's C code consists of its core library (libmarpa) and an XS wrapper. The XS wrapper compiles with any compiler which compiles Perl. libmarpa compiles clean with the -ansi and -pedantic flags and therefore any C89 compiler should work.

  4. "TeX": If you poke into the subdirectories, you may be alarmed to see places where TeX and/or CWeb is used. No TeX or CWeb is required to install or run Marpa::XS or its documentation. They are for DEVELOPMENT ONLY. In fact, if you plan on hacking the Perl interface code, or even the XS wrapper, you still don't need to have TeX and CWeb on your system. It is only the highly mathematical core of Marpa, libmarpa, that uses CWeb and therefore TeX. If you look at the libmarpa code, I think you'll see that, when it came to documenting libmarpa, POD, C comments, and man pages were simply not going to be enough to do the job.

posted at: 20:52 | direct link to this entry

§         §         §