简体   繁体   English

计算模型,计算机系统架构和编程范例之间的链接

[英]Link between models of computation, computer system architectures and programming paradigms

I have been reading about these topics for a while and may have understood something. 我阅读这些主题已有一段时间了,可能已经了解了一些。 But I am confused with some connections: 但是我对某些联系感到困惑:

i. 一世。 Turing Machine (RAM model to be exact) & Imperative Programming 图灵机(精确的RAM模型)和命令式编程

Lambda Calculus & Functional Programming Lambda微积分与函数式编程

ii. II。 Von Nueman System Architecture & Imperative Programming Von Nueman系统架构和命令式编程

I almost got the connection in (i) but I got nothing for (ii). 我几乎在(i)中获得了连接,但在(ii)中却一无所获。 However, from the Turing lecture of Backus , I think there is some link between the 2. In many places I even saw imperative paradigm written as 'Von Nueman Paradigm'. 但是,从BackusTuring演讲中 ,我认为两者之间存在某些联系。在许多地方,我什至看到命令式范式写为“ Von Nueman范式”。 So did the Von Neuman System Architecture somehow help in the growth of Imperative Languages and had the situation be different if we followed some other system architecture - say the Howard Architecture? 那么冯·诺伊曼系统架构是否在某种程度上帮助了命令式语言的发展,如果我们遵循其他系统架构(例如霍华德架构),情况是否会有所不同?

Backus's paper, which you linked, addresses this directly (emphases mine): 您链接的Backus的论文直接解决了这个问题(强调我的观点):

…we can crudely characterize three classes of models for computing systems… …我们可以粗略地描述计算系统的三类模型…

2.2.1 Simple operational models. 2.2.1简单的操作模型。 Examples: Turing machines , various automata. 例如: 图灵机 ,各种自动机。 ...

2.2.2 Applicative models. 2.2.2适用模型。 Examples: Church's lambda calculus [5], Curry's system of combinators [6], pure Lisp [17], functional programming systems described in this paper. 示例: Church的lambda演算 [5],Curry的组合器系统[6],纯Lisp [17],本文描述的函数编程系统。 Foundations: concise and useful. 基础:简洁实用。 History sensitivity: no storage , not history sensitive. 历史敏感度: 不存储 ,对历史不敏感。 Semantics: reduction semantics , no states. 语义: 归约语义 ,无状态。 Program clarity: programs can be clear and conceptually useful. 程序清晰:程序可以清晰明了,并且在概念上有用。

2.2.3 Von Neumann models. 2.2.3 冯·诺依曼模型。 Examples: von Neumann computers, conventional programming languages. 示例:冯·诺依曼计算机, 常规编程语言。 Foundations: complex, bulky, not useful. 基础:复杂,笨重,无用。 History sensitivity: have storage , are history sensitive. 历史敏感度: 有存储 ,对历史敏感。 Semantics: state transition with complex states. 语义:具有复杂状态的状态转换 Program clarity: programs can be moderately clear, are not very useful conceptually. 程序清晰:程序可以比较清晰,从概念上讲不是很有用。

The above classification is admittedly crude and debatable. 上面的分类是公认的粗略和值得商bat的。

If I could distill this even further: 如果我可以进一步提炼:

  • the Von Neumann architecture allows (programmer-written) instructions to update memory (that is, to mutate state). 冯·诺依曼(Von Neumann)架构允许(程序员编写)指令来更新内存(即更改状态)。
  • functional programming has no concept of mutable state. 函数式编程没有可变状态的概念。

FP languages, eg Haskell, currently compile to imperative machine code which executes on Von Neumann computers. FP语言(例如Haskell)当前可编译为在冯·诺依曼计算机上执行的命令性机器代码。 Functional programmers generally avoid thinking about mutating memory to an extent, preferring the compiler to figure that part out. 函数式程序员通常避免在某种程度上考虑更改内存,而宁愿编译器将其分解。

One way to look at this is that FP languages provide a total abstraction over the physical plumbing of the Von Neumann architecture. 解决这一问题的一种方法是,FP语言对Von Neumann体系结构的物​​理管道提供了完全的抽象。 However, this does beg the question of whether a fundamentally different architecture might be a better match to functional languages. 但是,这确实引出了一个问题,即根本不同的体系结构是否可能与功能语言更好地匹配。

Which brings us to: the Reduceron . 这带来了我们: Reduceron The Reduceron in its current form is a Field-Programmable Gate Array (FPGA) which demonstrates potential benefits that a physical machine tailor-made for FP evaluation might have. Reduceron的当前形式是现场可编程门阵列(FPGA),它演示了为FP评估量身定制的物理机器可能具有的潜在优势。

In short, the Reduceron takes a functional program, which is a stateless graph of function applications, and breaks it up into a massive collection of parallel function applications. 简而言之,Reduceron接受了一个功能程序,该程序是功能应用程序的无状态图,并将其分解为大量的并行功能应用程序。 It then runs those parallel applications on input data. 然后,它对输入数据运行那些并行应用程序。

It can get away with parallelizing your entire program because in FP it doesn't usually matter when a function application is performed, since there is no mutable state and therefore no possible race condition. 它可以逃脱,因为在FP并行整个程序通常它不会无论何时一个功能应用中进行,因为没有可变状态,因此没有可能的竞争条件。 The only possible delay is in terms of dependency availability – do you have an input or not. 唯一可能的延迟是依赖关系可用性–您是否有输入。 If you do, it is always safe to feed the input to the function. 如果这样做,则始终可以将输入提供给函数。

Now, as I understand it (and here I am going out on a limb a bit), an FPGA is a relatively cheap way for researchers to see how these ideas hold up in the physical world. 现在,据我所知(在这里,我有点不知所措),对于研究人员来说,FPGA是一种相对便宜的方法,让他们可以看到这些想法在物理世界中的地位。 Instead of designing and printing an integrated circuit, and then ordering wholesale numbers from eg Intel or AMD, academicians can just program a gate array on an individual off-the-shelf FPGA (again, if I understand correctly – I am not a hardware guy). 院士们无需设计和印刷集成电路,然后从例如Intel或AMD处订购大量产品,而只需在单个现成的FPGA上对门阵列进行编程(同样,如果我理解正确,我不是硬件专家。 )。

Initial results appear very promising! 初步结果似乎很有希望! But in practice we don't see hardware manufacturers flocking towards actually putting out entire new chip lines for FP languages. 但是实际上,我们没有看到硬件制造商趋向于为FP语言推出全新的芯片系列。 The existing knowledge, infrastructure, and demand for something like an Intel CPU is massive. 现有知识,基础设施以及对诸如Intel CPU之类的需求的需求量很大。 Imperative programming remains far more common than functional, and that seems unlikely to change in the near future. 命令式编程仍然比功能性编程更为普遍,并且在不久的将来似乎不太可能改变。


Side note: I'm assuming that your question about the "Howard" architecture is a misspelling of "Harvard". 旁注:我假设您有关“霍华德”体系结构的问题是“哈佛”的拼写错误。 The Harvard Architecture is quite similar to the Von Neumann architecture for the purposes of this topic. 就本主题而言,哈佛架构与冯·诺依曼架构非常相似。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 编程范例:带继承的强类型参数 - Programming Paradigms: Strongly Typed parameter with Inheritance 用于描述系统架构的受控自然语言方案? - Controlled Natural Language scheme for describing system architectures? 乘法和除法O(1)是在大多数常用的计算机体系结构上实现的方式吗? - Are multiplication and division O(1) the way they are implemented on most popularly used computer architectures? 卷积神经网络架构之间的差异 - Differences between Convolutional Neural Network architectures 与 OOP(或其他范例)相比,ECS(实体-组件-系统)架构模式有哪些缺点? - What are the disadvantages of the ECS (Entity-Component-System) architectural pattern, compared to OOP (or other paradigms)? 干净和 n 层架构之间有什么区别? - What is the difference between the clean and the n-tier architectures? 从C程序员的角度来看,ARM架构之间的差异是什么? - Differences between ARM architectures from a C programmer's perspective? 在图层之间复制模型 - Copying Models Between Layers IA-32体系结构软件开发人员手册2C中abbr E和abbr M之间的区别 - Difference between abbr E and abbr M in IA-32 Architectures Software Developer Manual 2C 混合架构? - Mixing Architectures?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM