本文介绍了是否“无类型”也意味着“动态键入”在学术CS世界?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读一个幻灯片,上面写着JavaScript是无类型的。这与我认为是真的相矛盾,所以我开始尝试去学习更多。

I'm reading a slide deck that states "JavaScript is untyped." This contradicted what I thought to be true so I started digging to try and learn more.

说JavaScript是无类型,并提供各种形式的静态,动态,强大的示例,这是我熟悉和满意的弱打字......所以这不是可行的方法。

Every answer to Is JavaScript an untyped language? says that JavaScript is not untyped and offered examples of various forms of static, dynamic, strong, and weak typing that I'm familiar and happy with.. so that wasn't the way to go.

所以我问过JavaScript的创建者Brendan Eich,他说:

So I asked Brendan Eich, the creator of JavaScript, and he said:

以学术为中心的计算机科学人员使用无类型作为动态类型的同义词(并且这是有效的) ?)或者是否有更深层次的东西让我失踪?我同意Brendan的观点是重要的,但任何解释的引用都会很棒,因为我目前的去书籍并没有在这个主题上发挥作用。

Do academically-focused computer science folks use "untyped" as a synonym of "dynamically typed" (and is this valid?) or is there something deeper to this that I am missing? I agree with Brendan that context is important but any citations of explanations would be great as my current "go to" books are not playing ball on this topic.

我想要把它钉了下来,这样我就可以提高我的理解力,因为即使维基百科也没有提到这种替代用法(无论如何我都能找到)。如果我错了,我不想在未来使用该术语或质疑该术语的使用: - )

I want to nail this down so I can improve my understanding and because even Wikipedia doesn't refer to this alternative usage (that I can find, anyway). I don't want to mess up with either using the term or questioning the use of the term in future if I'm wrong :-)

(我也是看到一个顶级Smalltalker说Smalltalk也是无类型,所以这不是一次性的,这就是让我完成这个任务!: - ))

(I've also seen a top Smalltalker say Smalltalk is "untyped" too, so it's not a one-off which is what set me off on this quest! :-))

推荐答案

是的,这是学术文献中的标准做法。要理解它,有助于知道类型的概念是在20世纪30年代发明的,在lambda演算的背景下(事实上,甚至更早,在集合论的背景下)。从那以后,出现了一个被称为类型理论的计算逻辑的整个分支。编程语言理论基于这些基础。在所有这些数学语境中,类型具有特定的,已确定的含义。

Yes, this is standard practice in academic literature. To understand it, it helps to know that the notion of "type" was invented in the 1930s, in the context of lambda calculus (in fact, even earlier, in the context of set theory). Since then, a whole branch of computational logic has emerged that is known as "type theory". Programming language theory is based on these foundations. And in all these mathematical contexts, "type" has a particular, well-established meaning.

术语动态类型是很晚才发明的 - 它是一个面对类型一词的常见数学用法的矛盾。

The terminology "dynamic typing" was invented much later -- and it is a contradiction in terms in the face of the common mathematical use of the word "type".

例如,这里是Benjamin Pierce用于类型系统的定义他的标准教科书

For example, here is the definition of "type system" that Benjamin Pierce uses in his standard text book Types and Programming Languages:

他还说:

有时会明确添加static这个词 - 我们说的是一个
静态类型编程语言,例如 - 区分
类别的comp我们在这里考虑的ile-time分析来自于诸如Scheme(Sussman
和Steele,1975; Kelsey,Clinger和Rees,1998; Dybvig,1996),
其中运行时类型标签用于区分堆中不同种类的
结构。像动态类型这样的术语可以说是
用词不当,应该用动态检查代替
,但用法是标准的。

大多数在该领域工作的人似乎都在分享这种观点。

Most people working in the field seem to be sharing this point of view.

请注意,意味着无类型和动态类型是同义词。相反,后者是前者特定案例的(技术上误导性)名称。

Note that this does not mean that "untyped" and "dynamically typed" are synonyms. Rather, that the latter is a (technically misleading) name for a particular case of the former.

PS:和FWIW,我碰巧都是类型的学术研究员系统,以及JavaScript的非学术实现者,所以我必须忍受schisma。 :)

PS: And FWIW, I happen to be both an academic researcher in type systems, and a non-academic implementer of JavaScript, so I have to live with the schisma. :)

这篇关于是否“无类型”也意味着“动态键入”在学术CS世界?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 07:39