Sort:  

I believe Hive Engine is JavaScript, not the most performance for such a thing, but doable. C++ is usually the language of choice when doing anything chain level.