I went through a phase of mixed-language programming. It included mixing tcl and C (or [incr tcl] and C++) using SWIG, and mixing SQL with C++. Neither experience was good:
- Marshalling non-trivial data between the different languages can be painful when they don't match perfectly.
- It's rarely just "one little piece" of the system that needs to be fast; it will be a selection of inner loops in different places, and as the application evolves, they will change.
- You end up structuring your system along the language-divide, when that is not the natural grain of the design.
- It requires more "book learning" before you can start. (And since the features needed for mixed-language programming are inevitably "advanced" features of each language, you need to be an "advanced" user of all of them.)
My conclusion now is that it is better to choose one language that is going to be sufficiently performant, and use it for everything. I've chosen C++, but there are other possibilities.