Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
用 Python 这样的解释语言为新语言编写解释器在各个方面(例如速度)都是一个坏主意。
在运行时执行的编程语言通常比编译语言慢,但这并不意味着创建自己的解释器是个坏主意。
您可以使用可以编译代码的 python 编写解释器语言。问题在于,您的解释器可能比用 C 或 ASM 编写的解释器慢。影响速度的另一个因素也是语言的复杂性。编译像 C++ 这样的复杂语言与编译您自己的自定义语言不同,后者可能有几个保留字并且它不是面向对象的。