is there a simple compiler for a small language

前端 未结 18 2101
有刺的猬
有刺的猬 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:08

    If you want to look at code, I'm very impressed with Eijiro Sumii's MinCaml compiler.

    • It's only 2000 lines long.

    • It compiles a pretty interesting source language.

    • It generates real machine code, none of this namby-pamby C or LLVM stuff :-)

    • Speed of compiled code is competetive with gcc and the native OCaml compilers.

    • The compiler is designed for teaching.

    Did I mention I've been very impressed?

提交回复
热议问题