Add static generator

Close #163
Could you note that it will most likely segfault if the function is not supported?