BlockIt and PyF95++
What is BlockIt?
BlockIt is a fairly simple Python framework used to block parse your code (or any text file) into nested blocks. That doesn't sound terribly exciting, but each type of block is user defined, inheriting many useful methods from the parent Block class. The methods allow you to do such things as create dependencies between blocks, modify blocks based on state parameters; dynamically modifying the final realization of the block. In a nutshell, it allows you to create a fairly sophisticated pre-processor, more powerful than straight-up macros (we have the power of Python at our disposal here). The framework at its base defines a line scanner, a block parser and a symbol table used to globally store the blocks.
How has it been used?
PyF95++: Fortran templating and pre-processing
The BlockIt framework has already been used to create a templating capability for the Fortran 95/2003 language along with some language extensions. This is called PyF95++ and operates as a preprocessing tool. From this, it was straightforward to create a template library for the language, similar to the C++ STL. All of the containers in the library are reference counted as well. This extension is part of the BlockIt project so that a developer can quickly see how the framework was used to accomplish this extension. The library includes:
Also included with the library are some addons:
All of the templated types that have been introduced are reference counted, similar to Python, and provide consistent interfaces to manipulate data. Please visit the wiki at http://sourceforge.net/apps/mediawiki/blockit for more information.
1.5.3 and higher Currently we have been testing with Python 2.6.5 and GFortran 4.6 IS required.
1.5.0 and higher Currently we have been testing with Python 2.6.5 and GFortran 4.6 but we think 4.4 or 4.5 will work.
1.4.4 and lower We think Python 2.5 and GFortran 4.3.2 (if you are using PyF95++) are sufficient.
Where to get BlockIt and PyF95++
BlockIt is an open source Python package made available at sourceforge under GPL V2 license. Visit the BlockIt project here. and includes all of the blockit utility, PyF95++, a directory full of tests and examples, and unit-tests. We are also looking to continually add documentation regarding the programming patterns used.
BlockIt Developer Practices
Users can always be assured of reasonably well tested software. The unit tests provide coverage of many basic aspects of the framework, and the number of examples (even many not included with the distribution) are built regularly and checked for memory errors with Valgrind. The developers seek always to provide a high-quality product with high quality documentation (see the wiki) as features become available and fully tested.
That said, no product is perfect. If you experience issues, please contact the developers for assistance. We love feedback!
|Page last updated on 3 Jul 2011|