is there a simple compiler for a small language

前端 未结 18 2102
有刺的猬
有刺的猬 2021-01-29 22:55

I am looking for a simple compiler that compiles a simple language, I need it to write a paper about it and to learn how compilers work, I am not looking for a sophisticated thi

18条回答
  •  离开以前
    2021-01-29 23:17

    The smallest practical compiler I know is MetaII, which has a 40 line self-description and can compile itself, using a special runtime system which admittedly hides some interesting computation (but then, most of the compilers listed here assume some kind of runtime system, surely bigger than the one for MetaII. I've build real compilers starting with this as a foundation, although meta-self-enhanced rather spectacularly.

    There's been work to make that even smaller. I don't think there are any practical compilers based on this direction.

    These are worth writing a paper about.

提交回复
热议问题