compiler implementation with javascript