*** Welcome to piglix ***

Language primitive


In computing, language primitives are the simplest elements available in a programming language. A primitive is the smallest 'unit of processing' available to a programmer of a given machine, or can be an atomic element of an expression in a language.

Primitives are units with a meaning, i.e., a semantic value in the language. Thus they are different from tokens in a parser, which are the minimal elements of syntax.

A machine instruction, usually generated by an assembler program, is often considered the smallest unit of processing although this is not always the case. It typically performs what is perceived to be one operation such as copying a byte or string of bytes from one computer memory location to another or adding one processor register to another.

Many of today's computers, however, actually embody an even lower unit of processing known as microcode which interprets the machine code and it is then that the microcode instructions would be the genuine primitives. These instructions would typically be available for modification only by the hardware vendor's programmers.

A high-level programming language (HLL) program is composed of discrete statements and primitive data types that may also be perceived to perform a single operation or represent a single data item, but at a higher semantic level than those provided by the machine. Copying a data item from one location to another may actually involve many machine instructions that, for instance,


...
Wikipedia

...