writestatement generator and typesystem