rewrite compiler