News for hackers. Stuff that matters.
Re:Super Tiny Compiler by peter_d_sherman on Thursday March 31, 2016 @04:24PM (#11400321)
In my opinion, the core function "compiler" -- is absolutely beautifully written (The crowning gem of this well-written compiler).

It's abstract without being too abstract (exactly the right level of abstraction), and it's a model of simplicity, comprehensibility (especially for people new to compilers), and elegance:

function compiler(input) {

  var tokens = tokenizer(input); 
  var ast    = parser(tokens); 
  var newAst = transformer(ast); 
  var output = codeGenerator(newAst);

  // and simply return the output!
  return output;
}

In short, a great starting point (especially for beginners) to conceptualize and subsequently delve into the depths of what goes on in a compiler.

An A+ and Two Thumbs Up for your efforts. The teaching potential of this compiler (which is always what I'm looking for in compilers) is huge!

Re:Super Tiny Compiler by typon on Thursday March 31, 2016 @04:51PM (#11400476)
Isn't this exactly what functional programming people have been harping on about for decades now?