Store the information in a fast <key, value> store and then manipulate from other language. I did this before with BDB and Java and it was lightning fast. Check Tokyo Cabinet and its successor Kyoto Cabinet.
You could use HDF5 and then use Java, Python, C, C++ or whatever. This is how CERN does...