separate generic compilation dispatch function and specialized compilation implementation