This is cool. It's very reminiscent of https://github.com/plv8/plv8 for Javascript on Postgresql.
I use plv8 - it's great!