Jul 24

Spirit is 10 years old!

It’s hard to pinpoint exactly the birthday of Spirit. Looking back, Spirit 1.0 which was uploaded to SourceForge in July 27, 2001 contains this comment in its main header file:

8/28/1999    Original Implementation [ run time polymorphic version ] (JDG)
4/30/2001    Template meta-programming implementation (JDG)
5/13/2001    Major redesign using iterators (JDG)
5/26/2001    Port to G++3.0 and BCC 5.5.1 thanks to Vladimir Prus
5/27/2001    Bug fixes in Difference and Xor classes (JDG)
5/30/2001    Added Iterators (JDG)

And then, there’s the original post to Boost developer’s list dated May 21, 2001:

Hello there,

Spirit is an object oriented recursive descent parser generator framework implemented using template meta-programming techniques. Expression templates allow us to approximate the syntax of Extended Backus Normal Form (EBNF) completely in C++. The Spirit framework enables a target grammar to be written exclusively in C++. EBNF grammar specifications can mix freely with other C++ code and, thanks to the generative power of C++ templates, are immediately executable. In retrospect, conventional compiler-compilers or parser-generators have to perform an additional translation step from the source EBNF code to C or C++ code.

The documentation and source code can be found at http://isis-tech.n3.net. I would appreciate feedback and comments.

Joel de Guzman

Let me declare that the July 27, 2001 SF upload should mark Spirit’s birthday. That’ll be 3 days from now.

Happy 10 years, Spirit!

7 Responses to “10 Years of Spirit”

  1. Jamboree says:

    Congratulations! 🙂

  2. Michael S. says:

    … and Spirit still haven’t proven that it can parse C++.

    • Joel de Guzman says:

      Michael, no parser *ever* can parse C++. Although some claim they can parse C++, give it a complex source like Boost and it will barf all over the place.

      • chila says:

        Nice work on Spirit!
        What do you think about SPECS?

        • Joel de Guzman says:

          SPECS is nice, but it’s not C++. It’s a new language. One crucial point in writing a C++ parser is to be able to parse existing code.

          It’s not that it’s undoable. It just takes a lot of time to do right. And, there is already at least one (hand-written) C++ parser that does it right (can compile complex c++ like boost): Clang. Clang has widespread support that’s hard to beat. Bottom line: IMO there is very little incentive to invest in writing a C++ parser.

          Having said that, Scalpel (see below) is still interesting though.

  3. metagoto says:

    @Michael S.
    The Scalpel project http://42ndart.org/scalpel/ is pretty advanced in that manner. Using Spirit classic, though.

    • Jamboree says:

      That’s cool! The project seems active.

      quoted from the site:
      Why not Spirit v2?

      When the Scalpel project started, Spirit v2 wasn’t stable yet. The (painful) migration just has to be done!

      Spirit V2 is much better now, and I do hope the bugs (at least those shown in trac) would be fixed soon.

Leave a Reply to Jamboree

preload preload preload