Php Chinese network (www.php.cn) provides the most comprehensive basic tutorial on programming technology, introducing HTML, CSS, Javascript, Python, Java, Ruby, C, PHP, basic knowledge of MySQL and other programming languages. At the same time, this site also provides a large number of online instances, through which you can better learn programming... Reply: Python interpreter implemented in Python, the most famous and completed Python interpreter
Does not belong.
However, if you want to use Python to implement A simple Interpreter with the same idea as CPython, refer to this: A Python Interpreter Written in Python.
For more information, please jump to the portal:
- Is there any content similar to "Python source code analysis", but the content has been updated, for the new version of Python books? -Redna xelafx
- What is the meaning of the JavaScript interpreter written in JavaScript? -Redna xelafx
Of course, yes, but unlike the compiler, the compiler can compile itself, and the interpreter cannot explain and run itself. the interpreter at the outermost layer always needs to run with other programs. However, the interpreter at the outermost layer can only interpret a subset of the language, and the interpreter at the lower layer can use this subset to implement more and more complete functions, in this way, the interpreter of the outer C can remain unchanged. when adding new functions, you only need to upgrade the interpreter written in Python. The idea of PyPy is similar to this. Languages with complete functions make self-X easier. For example, C/C ++ compilers are all developed using C/C ++. Of course you can. for example, the famous PyPy, I think the question is, can you use a language to implement a language compiler (the same language )?
A: Not at the beginning. later, you can.
To put it simply, it is "self-raising"
Why?
Because from the machine perspective, we must use a machine that can now recognize other languages to compile a compiler for a new language.
Once the compiler is made, if you can use this binary compiler to compile a compiler written in the same language.
This is "self-raising"