现代和旧的编译器是用什么编写的? [英] What are modern and old compilers written in?

查看:170
本文介绍了现代和旧的编译器是用什么编写的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为编译器,而不是解释器,只需要翻译输入而不运行它,其自身的性能就不会像解释器那样有问题. 因此,您不会用Ruby或PHP编写解释器,因为它太慢了.

As a compiler, other than an interpreter, only needs to translate the input and not run it the performance of itself should be not that problematic as with an interpreter. Therefore, you wouldn't write an interpreter in, let's say Ruby or PHP because it would be far too slow.

但是,编译器呢?

如果您要使用脚本语言编写编译器,甚至可能具有快速开发的功能,就可以将源代码和初始开发时间减少一半,至少我认为是这样.

If you would write a compiler in a scripting language maybe even featuring rapid development you could possibly cut the source code and initial development time by halv, at least I think so.

可以肯定的是:对于脚本语言,我的意思是解释语言具有典型的特征,这些特征通常至少会使程序员更快,更轻松,更愉快地进行编程.例如:PHP,Ruby,Python,也许是JavaScript,尽管对于编译器而言这可能是一个奇怪的选择

To be sure: With scripting language I mean interpreted languages having typical features that make programming faster, easier and more enjoyable for the programmer, usually at least. Examples: PHP, Ruby, Python, maybe JavaScript though that may be an odd choice for a compiler

  • 编译器通常用什么编写?我想您会用诸如C,C ++甚至是Assembler之类的低级响应,为什么?

  • What are compilers normally written in? As I suppose you will respond with something low-level like C, C++ or even Assembler, why?

有没有用脚本语言编写的编译器?

Are there compilers written in scripting languages?

使用低级或高级编程语言进行编译器编写有(不利)优势吗?

What are the (dis)advantages of using low or high level programming languages for compiler writing?

推荐答案

大多数编译器都是以它们所针对的编程语言编写的(引导).

Most compilers are written in the programming language they target (bootstrapping).

当然有很多例外.

这篇关于现代和旧的编译器是用什么编写的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆