Initial CFFI reimplementation