gpt4 book ai didi

javascript - javascript 是一种并发语言还是 javascript 引擎使该语言并发?

转载 作者:行者123 更新时间:2023-11-28 15:22:36 27 4
gpt4 key购买 nike

说 javascript 是一种并发编程语言是否正确,还是不同的 javascript 引擎使 javascript 并发?

Javascript 作为并发语言并未在维基百科上列出,但 Node.js 是: http://en.wikipedia.org/wiki/Concurrent_computing#Concurrent_programming_languages .

我希望获得更多有关 javascript 并发行为来源的信息。

最佳答案

为了最好地回答这个问题,了解什么是 javascript 很重要。

来自 ECMAScript 语言规范

http://www.ecma-international.org/ecma-262/5.1/

ECMAScript is an object-oriented programming language for performing computations and manipulating computational objects within a host environment. ECMAScript as defined here is not intended to be computationally self-sufficient; indeed, there are no provisions in this specification for input of external data or output of computed results. Instead, it is expected that the computational environment of an ECMAScript program will provide not only the objects and other facilities described in this specification but also certain environment-specific host objects, whose description and behaviour are beyond the scope of this specification except to indicate that they may provide certain properties that can be accessed and certain functions that can be called from an ECMAScript program.

具体实现由主办方决定。 Node.js 是这样的主机,浏览器是另一个这样的主机。任何主机都可以选择按照规范实现该语言,并且主机可以提供自己的信息处理环境。

那么,回答一下这个问题

Is it correct to say that javascript is a concurrent programming language or is it rather the different javascript engines that makes javascript concurrent?

我想说不,说 javascript 是并发编程语言是不正确的,因为答案取决于主机环境(或引擎);但是,可以通过支持并发的主机环境(引擎)来实现并发。

关于javascript - javascript 是一种并发语言还是 javascript 引擎使该语言并发?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30626129/

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