Language primitive
In computing, language primitives are the simplest elements available in a programming language. A primitive can be defined as the smallest 'unit of processing' available to a programmer of a particular machine, or can be an atomic element of an expression in a language.
Machine level primitives
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 single operation such as copying a byte or string of bytes from one memory location to another or adding one processor register to another.
Micro code primitives
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 vendors programmers.
High level language primitives
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 more abstract 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,
- calculate the address of both operands in memory, based on their positions within a data structure,
- convert from one data type to another
before finally
- performing the final store operation to the target destination.
Some HLL statements, particularly those involving loops, can generate thousands or even millions of primitives in a low level language - which comprise the genuine instruction path length the processor has to execute at the lowest level. This perception has been referred to as the "Abstraction penalty" [1][2][3]
Interpreted language primitives
An interpreted language statement has similarities to the HLL primitives but with a further added 'layer'. Before the statement can be executed in a manner very similar to a HLL statement, first, it has to be processed by an interpreter, a process that may involve many primitives in the target machine language.
Fourth and Fifth-generation programming language primitives
4gls and 5gls do not have a simple one-to-many correspondence from high-to-low level primitives. There are some elements of interpreted language primitives embodied in 4gl and 5gl specifications but the approach to the original problem is less a procedural language construct and are more oriented toward problem solving and systems engineering.
See also
References
- ↑ Surana P (2006) (PDF). Meta-Compilation of Language Abstractions.. ftp://lispnyc.org/meeting-assets/2007-02-13_pinku/SuranaThesis.pdf. Retrieved 2008-03-17.
- ↑ Kuketayev. "The Data Abstraction Penalty (DAP) Benchmark for Small Objects in Java.". http://www.adtmag.com/joop/article.aspx?id=4597. Retrieved 2008-03-17.
- ↑ Chatzigeorgiou; Stephanides (2002), "Evaluating Performance and Power Of Object-Oriented Vs. Procedural Programming Languages", in Blieberger; Strohmeier, Proceedings - 7th International Conference on Reliable Software Technologies - Ada-Europe'2002, Springer, pp. 367, http://books.google.com/books?id=QMalP1P2kAMC&dq=%22abstraction+penalty%22&lr=&source=gbs_summary_s&cad=0
File:HelloWorld.svg | This programming language-related article is a stub. You can help Wikipedia by expanding it. |
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...