当前位置:网站首页>编程语言是什么
编程语言是什么
2022-07-31 22:38:00 【JIeJaitt】
其实,程序指的就是一系列指令,用来告诉计算机做什么,而编写程序的关键在于,我们需要用计算机可以理解的语言来提供这些指令。
虽然借助 Siri(Apple)、Google Now(Android、Cortana(Microsoft)等技术,我们可以使用汉语直接告诉计算机做什么,比如“Siri,打开酷狗音乐”,但使用过这些系统的读者都知道,它尚未完全成熟,再加上我们语言充满了模糊和不精确因素,使得设计一个完全理解人类语言的计算机程序,仍然是一个有待解决的问题。
为了有效避开所有影响给计算机传递指令的因素,计算机科学家设计了一些符号,这些符号各有其含义,且之间无二义性,通常称它们为编程语言。编程语言中的每个结构,都有固定的使用格式(称为语法)以及精确的含义(称为语义)。换句话说,编程语言指定了成套的规则,用来编写计算机可以理解的指令。习惯上,我们将这一条条指令称为计算机代码,而用编程语言来编写算法的过程称为编码。
本教程要讲解的 Python就是一种编程语言,除此之外,你肯定也听说过其他一些编程语言,如 C、C++、Java、Ruby 等。至今,计算机科学家已经开发了成百上千种编程语言,且随着时间演变,这些编程语言又产生了多个不同的版本。但无论是哪个编程语言,也无论有多少个版本,虽然它们在细节上可能有所不同,无疑它们都有着固定的、无二义性的语法和语义。
以上提到的编程语言,都是高级计算机语言,设计它们的目的是为了方便程序员理解和使用。但严格来说,计算机硬件只能理解一种非常低级的编程语言,称为机器语言。
比如说,让计算机对 2 个数做求和操作,那么 CPU 可能要执行以下指令:
- 将位于内存空间位置在 2001 的数加载到 CPU 中;
- 再将位于内存空间位置在 2002 的数也加载到 CPU中;
- 在 CPU中,对这 2 个数做求和操作;
- 将结果存储在位置为 2003 的内存空间。
可以看到,对 2 个数执行求和操作需要做这么多工作,且这还只是笼统地描述,实际会更加复杂。
而使用 Python 这样的高级语言,对 2 个数求和可以很自然地用 c = a + b 表示,但由此带来的问题是,我们需要设计一种方法,将高级语言翻译成计算机可以执行的机器语言,有两种方法可以实现,分别是使用编译器和解释器。
使用编译器将自身等效转换成机器语言的高级语言,通常称为编译型语言;而使用解释器将自身转换成机器语言的高级语言,称为解释型语言,Python 就是解释型编程语言的一种。
关于编译型语言和解释型语言的含义和区别,有机会会进行详细介绍。
边栏推荐
- HTC using official firmware as bottom bag made ROM brush card bag tutorial
- What is customer profile management?
- Niuke.com brush questions (1)
- 网络安全--通过握手包破解WiFi(详细教程)
- VOT2021比赛简介
- Dry goods | 10 tips for MySQL add, delete, change query performance optimization
- "APIO2010" Patrol Problem Solution
- 「SDOI2016」征途 题解
- Istio introduction
- The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
猜你喜欢
一文概述:VPN的基本模型及业务类型
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
Judging decimal points and rounding of decimal operations in Golang
Unity-LineRenderer显示一条线
Daily practice——Randomly generate an integer between 1-100 and see how many times you can guess.Requirements: The number of guesses cannot exceed 7 times, and after each guess, it will prompt "bigger"
Chapter Six
The difference between adding or not adding the ref keyword when a variable of reference type is used as a parameter in a method call in C#
Golang - from entry to abandonment
VOT2021 game introduction
ThreadLocal
随机推荐
20. Support vector machine - knowledge of mathematical principles
Network security - crack WiFi through handshake packets (detailed tutorial)
Write a database document management tool based on WPF repeating the wheel (1)
Pytest first experience
TestCafeSummary
Douyin fetches video list based on keywords API
Shell常用脚本:Nexus批量上传本地仓库脚本
Document management and tools in the development process
HTC使用官方固件作为底包制作rom卡刷包教程
MLP神经网络,GRNN神经网络,SVM神经网络以及深度学习神经网络对比识别人体健康非健康数据
[QNX Hypervisor 2.2 User Manual]9.14 set
The latest masterpiece!Alibaba just released the interview reference guide (Taishan version), I just brushed it for 29 days
基于RT1052 Aworks nanopb string 类型固定长度使用方式(二十七)
UVM RAL model and built-in seq
Linux environment redis cluster to build "recommended collection"
基于simulink的Active anti-islanding-AFD主动反孤岛模型仿真
不知道该怎么办的同步问题
VOT2021 game introduction
Pytorch lstm time series prediction problem stepping on the pit "recommended collection"
嵌入式开发没有激情了,正常吗?