Rewrite of compilation to JS