到目前为止,我曾使用过 Java、Prolog、SQL 和 C# 语言。我知道 Java 和 C# 是命令式语言,Prolog 是声明式语言,而 SQL 是某种声明式语言。 Java和C#是面向对象的,你可以用它们开发面向方面的程序。
这已经是某些语言可能适合或实现的四种不同特征:命令式、声明式、面向对象、面向方面,而且我还遇到过各种其他类别:函数式语言、汇编语言以及可能还有更多我没有听说过的语言。
是否存在某种一致和/或逻辑分类或多维分类,其中编程语言可以以某种一致的方式进行分类?
I've worked among others with Java, Prolog, SQL and C# languages so far. I know that Java and C# are imperative, Prolog declarative and SQL somewhat declarative languages. Java and C# are object-oriented and you can develop aspect-oriented programs with them.
That's already four different characteristics that certain languages might fit in or implement: imperative, declarative, object-oriented, aspect-oriented and I've come across various other categories: functional languages, assembly languages and probably lots more I haven't heard.
Is there some kind of agreed and/or logical categorization or multi-dimensional categorization among which programming languages can be classified in a somewhat consistent way?
发布评论
评论(5)
在这篇开创性的计算机科学论文(其中早于 Peter Landin 的 OO,顺便说一句),其中我们可以看到最基本的区别是命令式语言与声明式语言的区别。仍然在基础层面上,类型系统类别提供了高级语言分组。语法的可扩展性是另一个相当高层次和基本的分类。
我认为多维矩阵比层次结构更适合您的目的,并且我认为上面概述的 3 个维度绝对是基础。
There is an interesting discussion at the end of this seminal CS paper (which predates OO, btw) by Peter Landin, where we can see that the most fundamental distinction being made is that of imperative vs. declarative languages. Still at the fundamental level, the type system categories afford high level grouping of languages. The extensibility of the syntax is yet another fairly high level and fundamental categorization.
I think a multi dimensional matrix is far better suited for your purpose than a hierarchy, and I think the 3 dimensions outlined above are absolutely fundamental.
有点离题,但 O'Reilly 根据Éric Lévénez 的原作制作了一张很棒的海报,它追踪了主要编程语言的历史。
Slightly tangential, but O'Reilly did a great poster based on Éric Lévénez's original that traces the major programming languages through their history.
这些特征(范式)已被充分理解和接受。但它们不一定定义语言。 C# 既具有命令式特征,又具有函数式特征,并且是面向对象的,F# 也具有命令式特征。
These characterizations (paradigms) are well understood and accepted. But they don't necessarily define the language. C# has both imperative and functional characteristics as well as being object-oriented, and F# has imperative characteristics as well.
维基百科的按类别列出的编程语言列表很难被超越。它使用四十个类别。
It would be hard to beat Wikipedia's List of Programming Languages by Category. It uses forty categories.
您可以在这篇同名维基百科文章中找到大量编程范例。尤其是右边的树非常有用且全面。
我担心,许多编程语言可能属于多个类别,例如,C# 是结构化的、命令式的、面向对象的、事件驱动的、函数式的。
另一方面,Java 只共享该列表中的结构化、命令式 和面向对象,使其更像是一种“纯粹”的 OO 语言,没有受到太多其他语言的玷污。范式。
注意:这些分类取自相应的维基百科页面。
每个分类都彼此正交,并且与上面提到的许多分类相互正交。文章是。它们描述了如何处理语言、语法或执行的不同方面。
You can find a whole host of programming paradigms in this Wikipedia article of the same name. Especially the tree on the right is pretty helpful and comprehensive.
And I fear, many programming languages might fit in more than one category, for example, C# is structured, imperative, object-oriented, event-driven, functional.
Java, on the other hand, only shares structured, imperative and object-oriented of that list, making it more of a "pure" OO language, unsullied by too many other paradigms.
Note: Those categorizations were taken from the respective Wikipedia pages.
Each of these classifications are orthogonal to each other and many of the ones mentioned in above article are. They describe how different aspects of the language, syntax or execution are handled.