English 中文(简体)
汇编者的语言是什么? 他们是否用不同语言书写?
原标题:What is the language of compilers? Are they written with different languages?
  • 时间:2010-04-29 21:43:44
  •  标签:

编辑是否使用不同语言?

最佳回答

下面举几个例子:

  • the Rubinius Ruby compiler is written in Ruby,
  • the YARV Ruby compiler is written in C,
  • the XRuby Ruby compiler was written in Java,
  • the Ruby.NET Ruby compiler was written in C#,
  • the MacRuby Ruby compiler was written in Objective-C,
  • the IronJS ECMAScript compiler is written in F#,
  • the MS Visual F# compiler is written in F#,
  • the MS Visual C# compiler was originally written in C++, is now written in C#,
  • the MS Visual Basic.NET compiler was originally written in C++, now written in Visual Basic.NET,
  • the GCC C compiler is written in C,
  • the Clang C compiler is written in C++,
  • most Pascal compilers are written in Pascal,
  • most Oberon compilers are written in Oberon,
  • the 6g/8g Go compiler is written in Go, originally written in C.
  • the gccgo Go compiler is written in C.

一般而言,汇编者可使用 任何<><>>m>语言书写,这些语言实际上足够强大,足以撰写汇编者。 这显然包括任何 Tur语。 但甚至有可能用非土耳其语书写汇编。 (例如,我看不出任何明显的原因,即编造者不能完全发挥职能,但总的职能显然不是 Tur。)

然而,在实践中,汇编者大多以三种特定的语文撰写,其不同之处和组合:

  1. the same language that the compiler implements (pros: larger community, because everybody who knows the language can work on the compiler, otherwise they would need to know both languages; cons: the bootstrap problem)
  2. the primary low-level systems programming language of the platform the compiler is supposed to run on, e.g. C on Unix, Java on the JVM, C# on the CLI (pros: very fast; cons: oftentimes those languages are simply not very good for writing compilers, also I don t actually believe that the performance benefits are real)
  3. a language that is very good for writing compilers like ML, Haskell, Lisp, Scheme (pros: those compilers tend to be very easy to understand and hack on; cons: you still need to know both languages)
  4. special case of the above: a domain-specific language for writing compilers, like OMeta or for the parsing frontend ANTLR, YACC (pros: same as above but even more so; cons: same as above)

所有这些都是权衡的:用同样语言撰写汇编者,使人们更容易理解,因为你不必学习另一种语言。 这样做还可能使人难以理解,因为语文在撰写编辑时实际上并不好。 (例如,Imagine,在编组中撰写一份文件。) 甚至可能还有impossible<>em>来写汇编者,例如(关于“语文”和“比较”的相当松散的定义),不可能在中央支助事务中写出中央支助事务汇编员或以超文本撰写的超文本。

反之,用专门的汇编者书写文字,可能更容易理解,但同时需要你学习新的语言。

请注意,这三类课程并非相互脱节:汇编者可分成不止一类。 例如,编写专门汇编者书写语言的汇编者本身属于第1类(本身写成)和第3类(用书面编辑的语文撰写)。

在某些情况下,你实际上能够打上血清点。 例如,F#是本土语言,在文化、文化、文化、文化、文化、文化、文化、文化、文化、文化、文化、文化、文化、文化、文化、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言、语言 因此,在F#中撰写F#汇编者给你第1号(书面本身)、第2号(用本地语、快速语言撰写)和第3号(用对撰写人有利的语言撰写)。 这一点同样适用于Schala。

问题回答

有时甚至没有。 通常要尽快尝试并落实编辑用该语言本身的新语言,部分地证明它能够做“重提”。

但当然,你首先需要一名编辑或至少需要一名口译员来管理<>><>><><>><>><>>> >编辑,并自行汇编成册,因此,你首先必须以不同语文执行。

而对于许多专业语言来说,用语文本身撰写汇编者并不实际,因为语言并非像编辑一样。

What is the language of anything? gcc for instance is written in C.
There was once a story about a Lisp interpreter that was written in Lisp.

这就提出了以下问题:如果C汇编者在C中撰写,那么第一名C汇编者汇编了什么? 为此,





相关问题