哪些编程语言不被视为高级语言?

发布于 2024-08-28 23:58:53 字数 1431 浏览 8 评论 0原文

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

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

发布评论

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

评论(8

醉生梦死 2024-09-04 23:58:53

你会发现

我们坚持的许多真理都取决于我们自己的观点。

对于 C 程序员来说,汇编语言是一种低级语言。
对于Java程序员来说,C是低级语言等等。

我怀疑用 1 和 0 编程第一台存储程序计算机的人们会想到汇编器一种高级语言。这都是相对的。

(引自绝地归来

You will find that

many of the truths we cling to depend upon our own point of view.

For a C programmer, Assembler is a low-level language.
For a Java programmer, C is a low-level language and so on.

I suspect the folks programming the first stored-program computer with 1s and 0s would have thought Assembler a high-level language. It's all relative.

(Quote from Return of the Jedi)

土豪 2024-09-04 23:58:53

根据维基百科,低级语言是机器代码和汇编。

从源头看:

在计算机科学中,低级
编程语言是一种编程
提供很少或没有提供的语言
从计算机中抽象出来
指令集架构。这个词
“低”是指小或
不存在的抽象量
语言和机器之间
语言;正因为如此,低水平
语言有时被描述为
“靠近硬件”。

然后,回答:

如果汇编程序确实是唯一的低级语言,为什么每个人都不断提及高级语言和低级语言。

我不知道“每个人”是谁,但我大胆猜测,当高级语言不像今天这样普遍时,谈论低级语言与高级语言更相关(因为有相当多的程序员编写汇编代码)。在现代,这是一个不太重要的区别。就我个人而言,我很少听到人们使用这些术语,除非是为了区分汇编与非汇编(除非您可能会听到有人在 Python 中将 C 或 C++ 称为低级,但这不符合原始定义的精神) )。

According to Wikipedia, the low level languages are machine code and assembly.

From the source:

In computer science, a low-level
programming language is a programming
language that provides little or no
abstraction from a computer's
instruction set architecture. The word
"low" refers to the small or
nonexistent amount of abstraction
between the language and machine
language; because of this, low-level
languages are sometimes described as
being "close to the hardware."

Then, to answer:

So why does everybody keep mentioning high and low-level languages if assembler is really the only low-level language.

I don't know who "everyone" is, but I would venture a guess that back when high-level languages were not as commonplace as they are today, it was more relevant to talk about low-level vs. high-level (because there was a relatively significant amount of programmers writing assembly code). In modern times it is a less important distinction. Personally, I rarely hear people using these terms except to differentiate between assembly or not (except for those times when you might hear someone raised on Python referring to C or C++ as low-level, but this is not in the spirit of the original definition).

余生共白头 2024-09-04 23:58:53

你问的是一个相对主观的问题;这是一个关于术语、白话和观点的问题。

例如,Lisp 是高级语言还是低级语言?如果实现在 Lisp 机器上运行怎么办?

通常,当人们试图构建从低级到高级的频谱时,他们试图量化的是“与硬件的接近程度”,而不是“抽象”程度。

影响实现与硬件的紧密程度的质量:

  • 程序员直接控制数据的内存布局,并在运行时访问数据的内存地址。
  • 数学运算是根据硬件定义的,或者是松散定义的,以便符合不同类型的硬件。
  • 可能有一个库提供动态内存分配,但动态内存的使用是手动的。
  • 字符串操作期间的内存管理是手动的。

考虑到实现从硬件中的抽象的相反质量:

  • 程序员无法在运行时访问数据地址(引用而不是指针)。
  • 数学运算以特定术语定义,不依赖于特定硬件。 (例如,ActionScript 3 支持 Number 类型,该类型会从整数自动转换为浮点数,而不会发生溢出。)
  • 动态内存的管理由环境处理,可能通过引用计数、垃圾收集、或其他自动内存管理方案。
  • 字符串操作期间的内存管理始终对程序员隐藏,并由环境处理。

与运行该语言的硬件相比,其他品质可能会使语言变得非常抽象:

  • 声明性、基于搜索的语法。 (例如Prolog)

考虑到这些因素,我将修改您编写的频谱如下:

最低级别:

  • 相关平台的汇编语言。

比汇编具有更高级别流程控制的低级语言:

  • C、C++
  • Pascal

高级语言:

  • FORTRAN
  • COBOL
  • Python
  • Perl

最高级别语言:

  • PROLOG
  • Python
  • 方案

Python 故意出现两次——它跨越了一部分范围,具体取决于代码是如何编写的。

You're asking a relatively subjective question; it's a question about terminology, that vernacular, and perspective.

For example, is Lisp a high-level or a low-level language? What if the implementation is running on a Lisp Machine?

Often, when people attempt to build a spectrum from low-level to high-level, what they are trying to quantify is a degree of "closeness to the hardware" as opposed to the degree of "abstraction."

Qualities which count toward an implementation's closeness to the hardware:

  • The programmer directly controls the memory layout of data and has access at run-time to memory addresses of data.
  • Mathematical operations are defined in terms of the hardware or loosely defined in order to conform to different types of hardware.
  • There may be a library providing dynamic memory allocation, but use of dynamic memory is manual.
  • Management of memory during string manipulation is manual.

Converse qualities which count toward an implementation's abstraction from the hardware:

  • The programmer does not have run-time access to address of data (references instead of pointers).
  • Mathematical operations are defined in specific terms not tied to specific hardware. (e.g., ActionScript 3 supports the Number type which self-converts from integer to floating-point rather than experience overflow.)
  • Management of dynamic memory is handled by the environment, possibly through reference counting, garbage collection, or another automated memory management scheme.
  • Management of memory during string manipulation is always hidden from the programmer and handled by the environment.

Other qualities might render a language very abstract compared to the hardware on which it runs:

  • Declarative, search-based syntax. (e.g. Prolog)

With factors like these in mind, I would revise the spectrum you have written as follows:

Lowest level:

  • Assembly language of the platform in question.

Low-level languages with higher-level flow control than assembly:

  • C, C++
  • Pascal

High-level languages:

  • FORTRAN
  • COBOL
  • Python
  • Perl

Highest-level languages:

  • PROLOG
  • Python
  • Scheme

Python appears twice by intent -- it spans a portion of the spectrum depending on how the code is written.

ヤ经典坏疍 2024-09-04 23:58:53

作为低级,我会添加:

  • .NET IL
  • Java JVM
  • 在 VB6 等环境中使用的其他 P 代码

As low-level, I would add:

  • .NET IL
  • Java JVM
  • Other P-Code used in environments like VB6
最美的太阳 2024-09-04 23:58:53

语言的“级别”是一个不断变化的目标。1973年,PL/I被认为是高级语言。如今,C 被认为(至少被语言专业人士认为)是一种低级语言 [参见脚注]。一些原因:

  • 公开数字的机器级表示
  • “整数”算术可能会溢出
  • 对字符串没有真正的支持,或者至少字符串不是一流的 手动
  • 内存管理
  • 地址算术
  • 不安全

高级语言可能包括

  • 支持对于独立于目标机器的整数类型
  • 默认整数算术永远不会溢出,除非机器耗尽内存
  • 字符串作为一流的值,例如内置串联
  • 自动内存管理,无地址算术
  • 安全

一些候选者作为“高级语言”根据这个定义,可能包括 Icon、Scheme、Smalltalk 和一些您最喜欢的脚本语言。

当我还是一名年轻学者、恐龙在地球上漫步的时候,人们将 Icon 称为“非常高级的语言”。就在 15 年前,您甚至还可以参加有关甚高级语言的学术研讨会。但这个词已经不再使用了。

为什么每个人都不断提及高级语言和低级语言?

尽管“高”和“低”之间的差异不断变化,但上面列出的区别仍然很重要。并且存在如此多的区别,以至于“高”和“低”这两个词可以成为有用的速记。但没那么有用——对于愤世嫉俗的人来说,高级语言看起来至少和我最喜欢的语言一样强大,而低级语言就是其他一切。换句话说,“水平”很容易沦为谩骂。

脚注:很难找到专业会议上使用的术语的引用,特别是当专业人士不使用术语“低级”和“高级”时,因为它们的技术性不强。但是 danben 询问了引用情况,我发现了一些:


PS 不要过分依赖维基百科来获取有关编程语言的良好信息,特别是如果维基百科参考文献未引用任何参考资料或来源

The "level" of a language is a moving target. In 1973, PL/I was considered a high-level language. Today, C is considered (at least by language professionals) as a low-level language [see footnote]. Some of the reasons:

  • Exposes machine-level representations of numbers
  • "Integer" arithmetic can overflow
  • No real support for strings, or at the very least, strings are not first-class
  • Manual memory management
  • Address arithmetic
  • Unsafe

A high-level language might include

  • Support for integer types independent of the target machine
  • Default integer arithmetic never overflows unless the machine runs out of memory
  • Strings as first-class values with, e.g., concatenation built in
  • Automatic memory management with no address arithmetic
  • Safe

Some candidates as "high-level languages" by this definition might include Icon, Scheme, Smalltalk, and some of your favorite scripting languages.

Back in the day when I was a young scholar and dinosaurs roamed the earth, people referred to Icon as a "very high-level language". As recently as 15 years ago you could even attend a learned symposium on Very High Level Languages. But that term isn't used much any more.

Why does everybody keep mentioning high and low-level languages?

Even though the difference between "high" and "low" keeps changing, distinctions like the ones listed above are still important. And there are so many distinction that the words "high" and "low" can be a useful shorthand. But not that useful—to a cynic, a high-level language is one that looks at least as powerful as whatever my favorite language is, and a low-level language is everything else. In other words, "level" can easily degenerate into mere name-calling.

Footnote: It's hard to find citations for terminology used at professional meetings, especially when professionals don't use the terms "low-level" and "high-level" because they're not so technical. But danben asked about citations, and I found a couple:


P.S. Don't count too heavily on Wikipedia for good information on programming languages, especially if the Wikipedia reference cites no references or sources

故人如初 2024-09-04 23:58:53

这里纯粹是猜测,但这可能是语言转变的一个例子,低级语言和高级语言之间的区别在人们的头脑中慢慢演变为托管语言和非托管语言、类型化语言和非类型化语言之间的区别等等等等(至少在人们使用术语的方式上)。

Purely guessing here, but this may be a case of language-shift, whereby the distinction between low- and high-level langauges is slowly evolving in peoples' minds into the difference between managed- and unmanaged-languages, typed-and untyped-languages etc.etc. (at least in the way people are using the terminology).

想你只要分分秒秒 2024-09-04 23:58:53

在很大程度上,“低级”和“高级”不是二元类别,而是一个连续体。有些语言显然是低级的(汇编、机器代码),但除此之外实际上只有“高级”和“低级”。

在我看来,“较低级”语言需要看起来更像计算机体系结构的代码,而“高级”语言接受看起来更像问题结构的代码。但这样一来,语言对于一个问题就可以是高级语言,而对于另一个问题则可以是低级语言。

To a large extent, "low-level" and "high-level" not binary categories but are a continuum. There are some languages that are clearly low-level (assembly, machine code), but beyond that there is really only "higher-level" and "lower-level".

As I see it, "lower-level" languages require code that looks more like the architecture of the computer, and "higher-level" languages accept code that looks more like the structure of the problem. But with that, languages can be high-level for one problem and low-level for another.

耀眼的星火 2024-09-04 23:58:53

低级
二进制
汇编器

ET IL
Java虚拟机
在 VB6 等环境中使用的其他 P 代码

绝对不是低级

C
基本的
福尔坦语言
科博尔
Python
珀尔
帕斯卡

高级
C++
红宝石
Python
PHP
普洛格
方案

Low-level
Binary
Assembler

ET IL
Java JVM
Other P-Code used in environments like VB6

Definitely not low-level

C
BASIC
FORTRAN
COBOL
Python
Perl
Pascal

High-level
C++
Ruby
Python
PHP
PROLOG
Scheme

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