数据类型编程
我知道“命令式”和“函数式”编程,但我对“数据类型”编程知之甚少。是否存在这样的事情以及它与其他范式有何关系?
I know of "imperative" and "functional" programming but there was little I could find on "datatype" programming. Is there such a thing and how is it related to the other paradigms?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我从来没有听说过这个词。谷歌也没有。 (唯一的打击就是这个问题。)
我能想到的最接近的事情是类型化编程< /a>,这是 Luca Cardelli 在 1989 年的一篇 论文 中引入的编程范例相同的标题。
类型编程的思想是,广泛使用类型,主要是为了对领域进行建模、驱动设计、构建程序并总体上解决问题,就像在面向对象编程中使用对象、过程编程中的过程、函数一样。函数式编程中的子句、逻辑编程中的子句、Erlang 中的进程等等。这是 Haskell 中的典型风格。
[编辑:当我写这个答案时,我没有看到你对这个问题的评论。我想这第二个就是您正在寻找的。]
我在进行上述 Google 搜索时偶然发现的另一个术语是术语“数据类型通用编程”。这是一个研究项目,运行时间为 2003 年至 2006 年它的目标是创建一种新的机制来编写程序,使类型参数化的程度尽可能达到今天的水平,例如 Haskell 中的参数多态性或 C++ 中的模板。
I have never heard of that term. Google hasn't, either. (The only hit is this very question.)
The closest thing I can think of, is Typeful Programming, which is a programming paradigm introduced by Luca Cardelli in a 1989 paper by the same title.
The idea of typeful programming is that you use types extensively and primarily to model your domain, drive your design, structure your program and in general solve your problem, the same way you use objects in object-oriented programming, procedures in procedural programming, functions in functional programming, clauses in logic programming, processes in Erlang, and so on. This is a typical style in Haskell.
[EDIT: I hadn't seen your comments on the question, when I wrote this answer. I guess this second one is what you are looking for.]
Another term that I stumbled upon while doing the above-mentioned Google search, is the term datatype-generic programming. This is a research project that ran from 2003 to 2006 that aims to create a new mechanism for writing programs that parametrize over types much further as is possible today with, say, parametric polymorphism in Haskell or templates in C++.