编程语言分类

发布于 2024-08-08 22:22:50 字数 285 浏览 11 评论 0 原文

到目前为止,我曾使用过 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

尤怨 2024-08-15 22:22:51

在这篇开创性的计算机科学论文(其中早于 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.

你另情深 2024-08-15 22:22:51

有点离题,但 O'Reilly 根据Éric Lévénez 的原作制作了一张很棒的海报,它追踪了主要编程语言的历史。


http://cdn.oreillystatic.com/news/graphics/history-poster20.gif

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.


http://cdn.oreillystatic.com/news/graphics/history-poster20.gif

A君 2024-08-15 22:22:51

这些特征(范式)已被充分理解和接受。但它们不一定定义语言。 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.

我不是你的备胎 2024-08-15 22:22:51

维基百科的按类别列出的编程语言列表很难被超越。它使用四十个类别。

It would be hard to beat Wikipedia's List of Programming Languages by Category. It uses forty categories.

乖不如嘢 2024-08-15 22:22:50

您可以在这篇同名维基百科文章中找到大量编程范例。尤其是右边的树非常有用且全面。

我担心,许多编程语言可能属于多个类别,例如,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.

  • Structured because it includes flow-control statements.
  • Imperative, since you write what the computer should do.
  • Object-oriented because you can model problems with classes.
  • Event-driven because of the inclusion of multi-cast delegates and events directly in the language syntax, making some design patterns obsolete.
  • Functional because delegates are functions as first-class objects and allow you to write programs in a functional way.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文