* Released 26 AUGUST 2011 *


BRAID, the Braid system for Rewriting Abstract Descriptions, is a compiler-like tool to generate the glue code necessary for language interoperability. Developed by the Components project at Lawrence Livermore National Laboratory, BRAID supports the Scientific Interface Definition Language (SIDL) for the language-independent declaration of interfaces associated with scientific software packages.

Relation to Babel

The language bindings generated by BRAID are binary-compatible to those generated by the related Babel tool. While Babel handles traditional programming languages (such as C, C++, Fortran (77-2008), Python, and Java), BRAID adds support for modern PGAS languages.

In practice, this means that if you want to, for example, let a Chapel program use a component implemented in Fortran 95, you would invoke Babel for the Fortran code and Braid for Chapel code:

braid --makefile --client=Chapel interface.sidl
babel --makefile --server=F95    interface.sidl

Supported Languages

At this moment Chapel client code is well-tested and considered stable. Chapel server support exists, but will be redesigned after the next release of the Chapel compiler, which will have support for building Chapel libraries.

Language | Client   Server
Chapel   | stable   experimental
UPC      | planned  planned
X10      | planned  planned


In addition to all regular Babel/SIDL features, the Chapel backend also extends the Chapel runtime to support borrowed arrays; i.e. Arrays that are initialized by an external function and can be passed to Chapel code without copying. It also provides an interface for distributed arrays which allow non-Chapel code to access non-local data residing in the PGAS-space.

The following features are not yet implemented:

Generic arrays, arrays of objects, structs, contracts, hooks and RMI.


BRAID uses an autotools-based build system, so the regular

./configure && make install

will work just fine. Below is the step-by-step break-down of the the installation process:

tar xvf braid-0.2.2.tar.bz2 && cd braid-0.2.2
mkdir build && cd build
../configure --prefix=<INSTALL_PATH>
make [-j<N>] && make install

# other useful commands
../configure --help
make check

Patching the Chapel compiler

You will need to patch your Chapel 1.3.0 compiler using the following command after running ./configure:

bash <builddir>/

The script will patch and recompile the compiler automatically. You can undo this operation by running

bash <builddir>/ --undo

this will reverse the effects of the patch.

User-visible dependencies

If you just want to compile and install BRAID, you will need: - Python: Version 2.6 or higher - gcc, ld, Perl, AWK, sed

If you want to run the regression tests, you will also need: - Babel: Version 2.0 or higher - Chapel: Version 1.3.0 - Java: JVM 1.6 or higher - NumPy: Version 1.0.4 or higher

Developer-only dependencies

Development status

BRAID is written in 98% Python; the SIDL scanner is implemented in flex (C). Some of the Python sources are automatically generated from a high-level specification (sidl.def, ir.def) by a Prolog script. The implementation language choice is motivated by Python being the highest-level language that we can assume to be pre-installed on all our target systems. So far we have three components:

This diagram shows the work-flow implemented in BRAID:

             Parser               Conversion
+-------------+  +------------------+  +---------------------+
| SIDL        |--| SIDL-based       |--| Language indep. IR  |
|             |  | declarative IR   |  | (s-expressions)     |
+-------------+  +------------------+  +---------------------+
                                         |       |
                                         |       | Code
                                         |       | Generators
                                         |       |
                                       +-----------+ +----------+
                                       | Chapel    | | C, ...   |
                                       |           | |          |
                                       +-----------+ +----------+

The idea to use the s-expression-based IR to interface with ROTE at some later point. Other components (e.g. PAUL) can also generate this IR to get access to the code generators.

Further Information

The following files are available at the top of the release directory structure provide additional information on the Babel release: