Compiler for free

Programs that manipulate other programs are powerful, interesting and fun. I’ll use Ruby to take you on a tour of how interpreters and compilers work, introduce the ideas behind a technique called partial evaluation, and explain a surprising computer science result which allows compilers to be generated automatically. - Codon / [HN]

Here be dragons / compiler books caption

  • interpreter
  • compiler
  • partial evaluator
  • Futamura projections

  • Why is it that 35 years after the Futamura projections were first described, when we want to produce a new compiler, we don’t write an interpreter and pass it through a high quality, general partial evaluator?
    • As far as I know, it has been tried numerous times and has been an area of active research in the past, but results turned out unsuccessful.
      • TruffleRuby is a Ruby implementation that works exactly by writing an interpreting and passing it through a general partial evaluator. It’s successful enough to pass almost all the Ruby spec and to run real Ruby applications including their C extensions. TruffleRuby

see also

Written on January 30, 2019, Last update on September 27, 2024
compiler parser ruby