A minimal self-hosted js compiler in 1k lines
github.com
github.com
Admirable effort to write the compiler in the language that it implements.
Perhaps it can be more compact if the tokens were organized as a dictionary (object with tokens as properties) instead of separate constants, so that they can be looked up simpler than a list of if statements.