My first fifteen compilers
I find many people tend to use the terms <i>parser</i> and <i>compiler</i> almost interchangeably, which is a horrid mistake.  These terms are not the same and are not related.  So, lets get clear on terminology:<p>* lexer: A scanner.  It runs code, typically as a string, through an evaluator and builds pieces based upon known language syntax rules.<p>* parser: A rule evaluator. Parsers typically use lexers to reason about code and then evaluate the pieces to determine context, relationships, and categories that describes the code structure.<p>* compiler: A transformer.  Compilers change code from one format (syntax) to another different format.<p>---<p>&gt; With a parser combinator library, you write a parser by starting with a bunch of primitive parsers (say, that parse numbers or characters) and combining them, eventually building up the ability to parse a sophisticated language.<p>I do like that part of the article.  I am working on a universal language parser right now.  To be truly universal you have to accomplish two big goals:<p>1. parse all the languages<p>2. seamless interchange between the various different parsers (it is a single parser with interchange between the various lexers)<p>Seamless interchange is necessary for languages like JSX, which starts as JavaScript, but can contain XML code units that then escape back to JavaScript syntax.  Another example is code blocks in markdown documents where the code block can specific a name of the language described by the code block.