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.
我不知道“每个人”是谁,但我大胆猜测,当高级语言不像今天这样普遍时,谈论低级语言与高级语言更相关(因为有相当多的程序员编写汇编代码)。在现代,这是一个不太重要的区别。就我个人而言,我很少听到人们使用这些术语,除非是为了区分汇编与非汇编(除非您可能会听到有人在 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).
数学运算以特定术语定义,不依赖于特定硬件。 (例如,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.
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:
"To provide the required precision, experimental programs are usually written in a low-level language (eg C or Pascal)," in a refereed article on computer vision.
"The C programming language is well-known for its flexibility in dealing with low-level constructs," in an important paper by Necula et al.
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
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).
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.
发布评论
评论(8)
你会发现
对于 C 程序员来说,汇编语言是一种低级语言。
对于Java程序员来说,C是低级语言等等。
我怀疑用 1 和 0 编程第一台存储程序计算机的人们会想到汇编器一种高级语言。这都是相对的。
(引自绝地归来)
You will find that
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)
根据维基百科,低级语言是机器代码和汇编。
从源头看:
然后,回答:
我不知道“每个人”是谁,但我大胆猜测,当高级语言不像今天这样普遍时,谈论低级语言与高级语言更相关(因为有相当多的程序员编写汇编代码)。在现代,这是一个不太重要的区别。就我个人而言,我很少听到人们使用这些术语,除非是为了区分汇编与非汇编(除非您可能会听到有人在 Python 中将 C 或 C++ 称为低级,但这不符合原始定义的精神) )。
According to Wikipedia, the low level languages are machine code and assembly.
From the source:
Then, to answer:
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).
你问的是一个相对主观的问题;这是一个关于术语、白话和观点的问题。
例如,Lisp 是高级语言还是低级语言?如果实现在 Lisp 机器上运行怎么办?
通常,当人们试图构建从低级到高级的频谱时,他们试图量化的是“与硬件的接近程度”,而不是“抽象”程度。
影响实现与硬件的紧密程度的质量:
考虑到实现从硬件中的抽象的相反质量:
与运行该语言的硬件相比,其他品质可能会使语言变得非常抽象:
考虑到这些因素,我将修改您编写的频谱如下:
最低级别:
比汇编具有更高级别流程控制的低级语言:
高级语言:
最高级别语言:
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:
Converse qualities which count toward an implementation's abstraction from the hardware:
Number
type which self-converts from integer to floating-point rather than experience overflow.)Other qualities might render a language very abstract compared to the hardware on which it runs:
With factors like these in mind, I would revise the spectrum you have written as follows:
Lowest level:
Low-level languages with higher-level flow control than assembly:
High-level languages:
Highest-level languages:
Python appears twice by intent -- it spans a portion of the spectrum depending on how the code is written.
作为低级,我会添加:
As low-level, I would add:
语言的“级别”是一个不断变化的目标。1973年,PL/I被认为是高级语言。如今,C 被认为(至少被语言专业人士认为)是一种低级语言 [参见脚注]。一些原因:
高级语言可能包括
一些候选者作为“高级语言”根据这个定义,可能包括 Icon、Scheme、Smalltalk 和一些您最喜欢的脚本语言。
当我还是一名年轻学者、恐龙在地球上漫步的时候,人们将 Icon 称为“非常高级的语言”。就在 15 年前,您甚至还可以参加有关甚高级语言的学术研讨会。但这个词已经不再使用了。
尽管“高”和“低”之间的差异不断变化,但上面列出的区别仍然很重要。并且存在如此多的区别,以至于“高”和“低”这两个词可以成为有用的速记。但没那么有用——对于愤世嫉俗的人来说,高级语言看起来至少和我最喜欢的语言一样强大,而低级语言就是其他一切。换句话说,“水平”很容易沦为谩骂。
脚注:很难找到专业会议上使用的术语的引用,特别是当专业人士不使用术语“低级”和“高级”时,因为它们的技术性不强。但是 danben 询问了引用情况,我发现了一些:
“为了提供所需的精度,通常会编写实验程序使用低级语言(例如 C 或 Pascal),”在 有关计算机视觉的参考文章。
“C 编程语言以其处理低级结构的灵活性而闻名”,位于 Necula 等人的重要论文。
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:
A high-level language might include
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.
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:
"To provide the required precision, experimental programs are usually written in a low-level language (eg C or Pascal)," in a refereed article on computer vision.
"The C programming language is well-known for its flexibility in dealing with low-level constructs," in an important paper by Necula et al.
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
这里纯粹是猜测,但这可能是语言转变的一个例子,低级语言和高级语言之间的区别在人们的头脑中慢慢演变为托管语言和非托管语言、类型化语言和非类型化语言之间的区别等等等等(至少在人们使用术语的方式上)。
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).
在很大程度上,“低级”和“高级”不是二元类别,而是一个连续体。有些语言显然是低级的(汇编、机器代码),但除此之外实际上只有“高级”和“低级”。
在我看来,“较低级”语言需要看起来更像计算机体系结构的代码,而“高级”语言接受看起来更像问题结构的代码。但这样一来,语言对于一个问题就可以是高级语言,而对于另一个问题则可以是低级语言。
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.
低级
二进制
汇编器
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