编译器设计中的过程语言和非过程语言有什么区别?

程序语言

过程语言是命令驱动或面向语句的语言。一个程序包括一系列语句,每条语句的执行都会生成解释器来修改其内存中一个或多个进入新状态的区域的值。

过程语言的格式是

声明1;

陈述2;

C、Pascal、FORTRAN 和等效语言是过程语言。该语言中的每个语句都与计算机进行通信以执行某些操作。过程语言中的程序是一个指令列表。对于非常小的程序,不需要其他的编排原则。这种语言包括一系列在被调用时执行的过程。每个过程都包含一系列语句,其中每个语句处理的数据可以是过程的本地数据、来自调用过程的参数,也可以是全局定义的数据。

非程序语言

在非过程语言中,所有指令都不是按照确定的顺序编写的。它被称为声明性和函数式语言。非过程语言不需要编写传统的程序逻辑。用户更加注重描述输入和输出,而不是程序的步骤。非过程语言的示例,例如 Java、C++、SQL、RGP 等。

程序语言非程序语言
The procedural languages are command-driven or statement-oriented.
非过程语言是面向事实的。
The programs in procedural language specify what is to be accomplished by a program and instruct the computer on accurately how the evaluation is completed.
非过程语言的程序指定要做什么,但没有确切说明如何评估结果。
Procedural languages are used for application and system programming.
非过程语言用于 RDBMS、专家系统、自然语言处理和教育。
It is complex.
它比程序简单。
These are imperative programming languages.
这些是声明式编程语言。
The textual context or execution sequence is considered.
无需考虑文本上下文或执行顺序。
As an example of a program, the sorting is completed by defining in a C++ program all of the elements of some sorting algorithm to a computer having a C++ compiler. The computer after translating the C++ program into machine code or some interpretive intermediate code follows the instructions and produces the sorted list.
在非过程语言中,只需要定义排序列表的特征。根据这个描述,非过程语言系统可以产生排序列表。
Machine efficiency is good.
使用唯一分辨率的逻辑程序面临着机器效率的严重问题。
The procedural paradigm leads to a large number of the probable network between functions and data if there are many functions and many global data items.
在非程序范式中不存在这样的联系。
An example of procedural languages is C, ADA, Pascal, C++, etc.
非过程语言的一个例子是 Prolog、USP、SQL Scheme 等。
猜你喜欢