gpt4 book ai didi

compiler-construction - 是否曾经编写过一种编程语言?

转载 作者:行者123 更新时间:2023-12-04 08:39:22 26 4
gpt4 key购买 nike

好的,我知道通常情况下,一种语言是用另一种语言编写的(例如Python是用C编写的)。

但是,有没有一种语言是使用它自己编写的?显然,他们必须使用该语言先前版本中的编译器/解释器,这意味着,至少在最初,它是用其他语言编写的。

我意识到使用现有语言为新语言开发编译器,只是立即放弃它并以您的新语言编写新的编译器(然后您将使用原始编译器进行编译),将是非常令人讨厌和毫无意义的,但是我真的看不出为什么无法完成的原因(不过,我再次看到了为什么无法完成的原因)。

尽管如此,它曾经发生过吗?

最佳答案

是的,它叫做Bootstrapping

In computer science, bootstrapping is the process of writing a compiler (or assembler) in the target programming language which it is intended to compile. Applying this technique leads to a self-hosting compiler. Many compilers for many programming languages are bootstrapped, including compilers for BASIC, ALGOL, C, Pascal, PL/I, Factor, Haskell, Modula-2, Oberon, OCaml, Common Lisp, Scheme, Java, Python, Scala and more.

关于compiler-construction - 是否曾经编写过一种编程语言?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18862622/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com