对于“等同于C”的语言,是否有一个词?

时间:2022-04-11 15:04:01

I'm trying to find a word to categorize some languages, and don't quite have it.

我正在试图找到一个词来对某些语言进行分类,而且还没有。

  • Category 1 Example: A Ruby program must be interpreted; it is really instructions for the ruby program. Python and Javascript are like this, too.
  • 第1类示例:必须解释Ruby程序;它确实是ruby程序的说明。 Python和Javascript也是这样的。

  • Category 2 Example: A compiled C program needs no interpreter; it is really instructions for the computer. C++ , Rust and Go are like this, too.
  • 类别2示例:编译的C程序不需要解释器;它确实是计算机的说明。 C ++,Rust和Go也是这样的。

I would say "compiled vs interpreted", but there are languages that compile to bytecode. Eg, Java compiles, but you can't run a Java program without having Java installed.

我会说“编译vs解释”,但有些语言可以编译为字节码。例如,Java编译,但是如果没有安装Java,则无法运行Java程序。

I would say "compiles to machine code", but I've read that C compilers may compile to assembler instead, and I'm fuzzy on that distinction anyway. Which raises the question "are we even talking about a feature of the language itself?" You can write a C interpreter, after all.

我会说“编译到机器代码”,但我已经读过,C编译器可能会编译成汇编程序,而且无论如何我对这种区别都很模糊。这引出了一个问题“我们甚至在谈论语言本身的一个特征吗?”毕竟你可以写一个C解释器。

Informally, I'd say "you can use Rust or Go to do the kinds of things you'd use C for - to produce efficient binaries with no runtime dependencies."

非正式地,我会说“你可以使用Rust或Go来做你使用C的东西 - 来生成没有运行时依赖性的高效二进制文件。”

Is there a word for "equivalent to C" in this sense?

在这个意义上,是否有“相当于C”的词?

2 个解决方案

#1


No.

As you've already alluded to, there are various ways of classifying a language.

正如您已经提到的那样,有多种方法可以对语言进行分类。

  • How it is executed (compiled vs interpreted)
  • 如何执行(编译与解释)

  • How it exists at the lowest level (byte code vs machine code)
  • 它是如何存在于最低级别的(字节码与机器码)

  • Similarity of the language syntax
  • 语言语法的相似性

  • Problem domain (scripting language, general purpose, functional programming)
  • 问题域(脚本语言,通用,函数式编程)

Even the first of these falls down with C. It is perfectly possible to write a C interpreter - see Herbert Schildt's C : The complete reference for such an example.

即使是第一个也倒下了C.完全有可能写一个C解释器 - 参见Herbert Schildt的C:这个例子的完整参考。

#2


I think that if you want really categorize languages you should pass through metaprogramming and programming paradigms (http://en.wikipedia.org/wiki/Metaprogramming) and metalanguage because even if a language is mainly compiled and another is mainly interpreted, it's the compiler/intepreter which decides to pass through bytecodes/opcodes or to compile in machine language, to incrementally compile or to interactively compile and so on..

我认为如果你想真正对语言进行分类,你应该通过元编程和编程范式(http://en.wikipedia.org/wiki/Metaprogramming)和元语言,因为即使一种语言主要是编译而另一种语言主要被解释,它也是compiler / intepreter决定通过字节码/操作码或用机器语言编译,递增编译或交互式编译等等。

I hope to be helpful.

我希望能有所帮助。

#1


No.

As you've already alluded to, there are various ways of classifying a language.

正如您已经提到的那样,有多种方法可以对语言进行分类。

  • How it is executed (compiled vs interpreted)
  • 如何执行(编译与解释)

  • How it exists at the lowest level (byte code vs machine code)
  • 它是如何存在于最低级别的(字节码与机器码)

  • Similarity of the language syntax
  • 语言语法的相似性

  • Problem domain (scripting language, general purpose, functional programming)
  • 问题域(脚本语言,通用,函数式编程)

Even the first of these falls down with C. It is perfectly possible to write a C interpreter - see Herbert Schildt's C : The complete reference for such an example.

即使是第一个也倒下了C.完全有可能写一个C解释器 - 参见Herbert Schildt的C:这个例子的完整参考。

#2


I think that if you want really categorize languages you should pass through metaprogramming and programming paradigms (http://en.wikipedia.org/wiki/Metaprogramming) and metalanguage because even if a language is mainly compiled and another is mainly interpreted, it's the compiler/intepreter which decides to pass through bytecodes/opcodes or to compile in machine language, to incrementally compile or to interactively compile and so on..

我认为如果你想真正对语言进行分类,你应该通过元编程和编程范式(http://en.wikipedia.org/wiki/Metaprogramming)和元语言,因为即使一种语言主要是编译而另一种语言主要被解释,它也是compiler / intepreter决定通过字节码/操作码或用机器语言编译,递增编译或交互式编译等等。

I hope to be helpful.

我希望能有所帮助。