Creating a small programming language for beginners

后端 未结 7 2228
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 11:42

I would like to create my own programming language. Maybe not exactly a programming language from scratch but maybe base it on another language.

I\'ve heard of Yacc. So

7条回答
  •  不思量自难忘°
    2021-02-06 11:45

    You might consider learning to build a compiler from a fabulous 1964 (yes, you read that right) paper META II: A Syntax-Oriented Compiler Writing Language on how to build "meta compilers".

    This paper contains, in 10 pages, a compiler writing philosophy, a definition of a virtual compiler instruction set that is easy to implement, a compiler-compiler, and an example compiler built using the compiler-compiler.

    I learned initially how to build compilers from this paper back in 1970 odd. It is astonishing how clever and conceptually simple it is.

    If there was a paper I'd make every computer science student read, this would be it.

    You can get the paper, see a tutorial and an implementation of MetaII in JavaScript here. The guy behind the tutorial is Dr. James Neighbors, source of the term "domain analysis".

提交回复
热议问题