Language agnostic 语言特征正交?

Language agnostic 语言特征正交?,language-agnostic,assembly,programming-languages,Language Agnostic,Assembly,Programming Languages,我正在阅读《编程语言的概念》(Sebesta第10版),在文本中,它将正交性定义为“一组相对较小的基本结构可以以相对较少的方式组合,以构建语言的控制和数据结构”。但我不明白是什么使某种语言特征正交。因为我可能不会解释这篇文章的全部优点:),所以我在下面加入了相应的文章 We can illustrate the use of orthogonality as a design concept by comparing one aspect of the assembly languages of

我正在阅读《编程语言的概念》(Sebesta第10版),在文本中,它将正交性定义为“一组相对较小的基本结构可以以相对较少的方式组合,以构建语言的控制和数据结构”。但我不明白是什么使某种语言特征正交。因为我可能不会解释这篇文章的全部优点:),所以我在下面加入了相应的文章

We can illustrate the use of orthogonality as a design concept by comparing
one aspect of the assembly languages of the IBM mainframe computers
and the VAX series of minicomputers. We consider a single simple situation:
adding two 32-bit integer values that reside in either memory or registers and
replacing one of the two values with the sum. The IBM mainframes have two
instructions for this purpose, which have the forms

A Reg1, memory_cell

AR Reg1, Reg2

where Reg1 and Reg2 represent registers. The semantics of these are:

Reg1 ← contents(Reg1) + contents(memory_cell)

Reg1 ← contents(Reg1) + contents(Reg2)


The VAX addition instruction for 32-bit integer values is

ADDL operand_1, operand_2

whose semantics is

operand_2 ← contents(operand_1) + contents(operand_2)

In this case, either operand can be a register or a memory cell.
The VAX instruction design is orthogonal in that a single instruction can
use either registers or memory cells as the operands. There are two ways to
specify operands, which can be combined in all possible ways. The IBM design
is not orthogonal. Only two out of four operand combinations possibilities are
legal, and the two require different instructions, A and AR.>

所以我的主要问题是为什么VAX指令是正交的。这仅仅是因为它的构造需要更少的指令,并且所有的事情都可以在一行中完成吗?如果VAX系列计算机采用两条指令,IBM采用三条指令,VAX语言会更正交吗?任何帮助都将不胜感激

嗯。文本并不决定它是关于语言还是指令集。指令集的独特功能是寻址模式,您可以使用(或不能使用)。如果您可以将所有寻址模式与所有(或大多数)指令一起使用,则称指令集为正交(请参阅)。

一票反对Stiled语言。我的观点:在VAX中,寄存器与内存的选择与算术运算符的选择是正交的。但您仍然必须在VAX汇编程序中指定寻址模式,以区分btw寄存器和内存(我记得)。对我来说,不是正交就是不正交。观点:这种设计理念的真正力量在于,当你能使两种语言功能在功能上独立时,程序员就可以用许多有用的方法将它们结合起来,而不会被特殊情况绊倒。从实现方面来看,有时这也会降低复杂性,但并非总是如此。