什么是计算机编程语言? [英] What is a computer programming language?
At the risk of sounding naive, I ask this question in search of a deeper understanding of the concept of programming languages in general. I write this question for my own edification and the edification of others.
What is a useful definition of a computer programming language and what are its basic and necessary components? What are the key features that differentiate languages (functional, imperative, declarative, object oriented, scripting, etc...)?
思考这个问题的一种方式.想象一下，您正在查看现代台式机或笔记本电脑的硬件.假设不存在 C 语言或其任何变体.根据我们今天对个人计算机的期望，您会如何向其他人描述使计算机具有表现力和功能所需的所有东西?
One way to think about this question. Imagine you are looking at the hardware of a modern desktop or laptop computer. Assume, that the C language or any of its variants do not exist. How would you describe to others all the things needed to make the computer expressive and functional in terms of what we expect of personal computers today?
I would be satisfied with a list of concepts that can be looked up or researched further.
Like any language, programming languages are simply a communication tool for expressing and conveying ideas. In this case, we're translating our ideas of how software should work into a structured and methodical form that computers (as well as other humans who know the language, in most cases) can read and understand.
What is a useful definition of a computer programming language and what are its basic and necessary components?
我想说一种编程语言的定义特征如下:用这种语言编写的东西最终会被转换成可以执行的东西.因此，伪代码虽然可能具有编程语言的结构和严谨性，但实际上并不是一种编程语言.同样，UML 可以像编程语言一样以抽象的方式表达许多强大的思想，但它有不足之处，因为人们通常不会编写 UML 来执行.
I would say the defining characteristic of a programming language is as follows: things written in that language are intended to eventually be transformed into something that is executed. Thus, pseudocode, while perhaps having the structure and rigor of a programming language, is not actually a programming language. Likewise, UML can express many powerful ideas in an abstract manner just like a programming language can, but it falls short because people don't generally write UML to be executed.
How would you describe to others all the things needed to make the computer expressive and functional in terms of what we expect of personal computers today?
Even if the word "programming language" wasn't part of the shared vocabulary of the group I was talking to, I think it would be obvious to the others that we'd need a way to communicate with the computer. Just as no one expects a car to drive itself (yet!) without external instructions in the form of interaction with the steering wheel and pedals, no one could expect the hardware to function without being told what to do. As noted above, a programming language is the conduit through which we can make that communication happen.
Tangentially related, what is it about computer languages that allow other languages to exist?
All useful programming languages have a property called Turing completeness. If one language in the Turing-complete set can do something, then any of them can; they are said to be computationally equivalent.
然而，仅仅因为它们同样强大"并不意味着它们同样适合人类工作.这就是为什么许多人愿意牺牲您从编写汇编代码中获得的无与伦比的微观管理，以换取您在 Ruby、Python 或 C# 等高级语言中获得的表现力和功能.
However, just because they're equally "powerful" doesn't mean they're equally nice to work with for humans. This is why many people are willing to sacrifice the unparalleled micromanagement you get from writing assembly code in exchange for the expressiveness and power you get with higher-level languages, like Ruby, Python, or C#.