February 20, 2005
Puma C++ transformation library
It seems to be quite robust. For example, looking through some of the tests, I saw that it can parse templates and even template metaprograms. I was also pleased to see that it is used as the back-end of AspectC++, which is relatively mature aspect oriented programming system for C++.
I considered using AspectC++ instead of CDL. Aspect oriented programming has a lot of cross-over with metaprogramming. One thing it wouldn't let me do though is generate a schema from C++ class definitions. It provides no way of outputting anything other than C++ as far as I can tell. I'll take a closer look at it soon.
I am considering using Puma to parse CDL. If it works out, it will eliminate one of the big risks and most of the development effort for my C++ metaprogramming system. As with my C# and Java to C++ translators, I think the key to getting a prototype up and running quickly is to find a library that will do most of the parsing and analysis for me.
Puma is GPL. I am not sure if that would be a problem for a commercial project. The game would not be compiled with or link to any of the GPLed code. But some of it would be automatically generated by GPLed code. Is code that is generated by a GPL tool also GPL? I'll do some research.
I haven't had a chance to actually try it out yet. It took me all day to get it to compile in Visual C++. I had to upgrade from Visual C++ 7.0 to 8.0 beta. 7.0 was not sufficiently standards compliant. Then I had to wade through GCC makefiles and figure out how to set up a VC++ project with all the necessary preprocessor definitions. Grr, C++ makes things too difficult for a lazy programmer like me!
I hope you can find a good solution, but make sure you think long and hard about whether finding that solution is actually worth it.
btw. PUMA does look pretty cool.
The way C++ is so entrenched in games development does frustrate me sometimes. I think there are two big obstacles slowing the adoption of other languages. The first is the lack of tools. If I want to program a console game in C#, I have to write my own compiler. The second is the performance-centric mindset of your typical game programmer. But that is beginning to change with the adoption of scripting languages and "higher level" languages for tools programming.
C++ isn't so bad though, especially if you are doing real OO, unit testing, refactoring, etc. Just look at all the awesome games that are written in C++. It can't be that bad!
You wrote that you compile Puma using Visual C++ and spend full day for it. Cold you share your VC solution with people who more lazzy and not ready repeat this heroic deed?