编程语言之间的关系 [英] Relation between programming languages

查看:56
本文介绍了编程语言之间的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道以下问题:

  1. 这是什么意思?"某些语言是另一个子集/超集?可以用数学来定义吗?是吗与子集/超集有关基本集理论中的概念?
  2. 几乎所有现有语言以小部分实现/编写多少种低级语言?为了例如,大多数语言都是书面的在C中?C ++是用C编写的吗?

  1. What does it mean "some language is a subset/superset of another"? Can it be defined in mathematics? Is it related to the subset/superset concept in elementary set theory?
  2. Are almost all existing languages implemented/written in some small number of low-level languages? For example, are most languages written in C? Is C++ written in C?

执行关系和子集/超集的概念语言?

Is there some relation between the implementation relation and the concept of subset/superset of languages?

在语言功能方面,有些语言比其他语言具有更多的优势.在某些情况下,有些具有所有其他一些功能,例如,C ++是否具有C的所有功能?

In terms of language features, some languages have more than some other. In some cases, some has all the features of some other, for example, does C++ have all the features of C?

子集/超集关系功能集和子集/超集之间的关系语言?

Is there some relation between the subset/superset relation in terms of the set of features and the subset/superset relation between languages?

感谢和问候!

推荐答案

某种语言是另一种语言的子集/超集"是什么意思?

What does it mean "some language is a subset/superset of another"?

从语法上说,如果在语言A中有效的每个程序在语言B中也有效,则语言A是语言B的子集.在语义上,如果它是语法子集并且每个有效的A程序也表现出相同的语言,则语言A是语言B的子集.语言B的行为.

Syntactically a language A is a subset of a language B if every program that is valid in language A is also valid in language B. Semantically it is a subset if it is a syntactic subset and each valid A program also exhibits the same behavior in language B.

可以在数学中定义它吗?它与基本集理论中的子集/超集概念有关吗?

Can it be defined in mathematics? Is it related to the subset/superset concept in elementary set theory?

语法子集:如果 P_A 是语言A中所有有效程序的集合,而 P_B 是语言B中所有有效程序的集合,则语言如果 P_A P_B 的子集,则A 是语言 B 的语法子集.

Syntactic subset: If P_A is the set of all valid programs in language A and P_B is the set of all valid programs in language B, then language A is a syntactic subset of language B exactly if P_A is a subset of P_B.

语义子集:让 A(p)是一个函数,该函数描述语言A和 B(p) p 的行为>描述语言B中程序 p 的行为.当且仅当对于 A(p)的所有 p ,A是B的子集>已定义, B(p)也已定义,并且 A(p)= B(p).

Semantic subset: Let A(p) be a function which describes the behavior of program p in language A, and B(p) describe the behavior of program p in language B. A is a subset of B if and only if for all p for which A(p) is defined, B(p) is also defined and A(p) = B(p).

几乎所有现有的语言都以少量的底层语言实现/编写吗?

Are almost all existing languages implemented/written in some small number of low-level languages?

这当然取决于您对几乎所有"的定义,但是我倾向于拒绝.

This depends on your definition of "almost all" of course, but I'm inclined to say no. Many compilers and interpreters are written in C and C++ (simply because a lot of software in general is implemented in C and C++), but by far not all.

例如,大多数语言是用C编写的吗?C ++是用C编写的吗?

For example, are most languages written in C? Is C++ written in C?

正如已经在评论中指出的那样,C ++是一种语言,而不是一种软件.作为GNU C ++编译器的 g ++ 用C编写,但是也有C ++编译器用不同的语言编写(可能).

As has been pointed out in comments already, C++ is a language not a piece of software. g++ which is the GNU C++ compiler is written in C, but there are also C++ compilers which are written in different languages (probably).

就语言功能而言,某些语言比其他语言具有更多的功能.在某些情况下,有些具有其他某些功能,例如,C ++是否具有C的所有功能?

In terms of language features, some languages have more than some other. In some cases, some has all the features of some other, for example, does C++ have all the features of C?

是的(除非您将简单性视为一项功能).

Yes (unless you count simplicity as a feature).

就特征集而言,子集/超集关系与语言之间的子集/超集关系之间是否存在某种关系?

Is there some relation between the subset/superset relation in terms of the set of features and the subset/superset relation between languages?

如果一种语言是另一种语言的超集,则该语言的功能集也必须是另一种语言的功能的超集(同样,除非您将简单性或诸如该语言不允许X"之类的内容计为功能).

If a language is a superset of another language, the set of that language's features will also have to be a superset of the other language's features (again unless you count simplicity or things like "the language does not allow X" as a feature).

但是,这不适用于另一个方向(即,仅因为A的特征是B的特征的超集,所以A不必是B的超集).

This is not applicable in the other direction however (i.e. just because A's features are a superset of B's features, A does not have to be a superset of B).

这篇关于编程语言之间的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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