Low-level Programming in High-level Languages
Experiments with hardware support in high-level languages in the late 1960s led to such languages as PL/S, BLISS, BCPL, and extended ALGOL for Burroughs large systems being used for low-level programming. Forth also has applications as a systems language. However, the language that became pre-eminent in systems programming was C.
C is considered a third generation programming language, since it is structured and abstracts from machine code (historically, no second generation programming language emerged that was particularly suitable for low-level programming). However, many programmers today might refer to C as low-level, as it lacks a large runtime-system (no garbage collection etc.), basically supports only scalar operations, and provides direct memory addressing. It therefore readily blends with assembly language and the machine level of CPUs and microcontrollers. C's ability to abstract from the machine level means that the same code can be compiled for different hardware platforms; however, fine-grained control at the systems level is still possible providing that the target platform has certain broadly-defined features in place, such as a flat memory model, and memory that is divided into bytes. C programmes may require a certain amount of 'tweaking', often implemented by conditional compilation, for different target platforms. The process of adapting a systems programme for a different platform is known as porting.
Example - a function that calculates the nth Fibonacci number in C
unsigned int fib(unsigned int n) { if (n <= 0) return 0; else if (n <= 2) return 1; else { int a,b,c; a = 1; b = 1; while (1) { c = a + b; if (n <= 3) return c; a = b; b = c; n--; } } }Read more about this topic: Low-level Programming Language
Famous quotes containing the words low-level, programming and/or languages:
“The Republicans hardly need a party and the cumbersome cadre of low-level officials that form one; they have a bankroll as large as the Pentagons budget, dozens of fatted PACs, and the well-advertised support of the Christian deity.”
—Barbara Ehrenreich (b. 1941)
“If there is a price to pay for the privilege of spending the early years of child rearing in the drivers seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.”
—Melinda M. Marshall (20th century)
“The trouble with foreign languages is, you have to think before your speak.”
—Swedish proverb, trans. by Verne Moberg.