Tips on Writing Custom Compiler