High-level programming language
View on Wikipedia
A high-level programming language is designed to be easy for humans to write and read. It hides the complex details of how the computer actually works, letting you focus on the program's logic instead of the machine's internals. The amount of abstraction provided defines how "high-level" a programming language is.[1]
High-level refers to a level of abstraction from the hardware details of a processor inherent in machine and assembly code. Rather than dealing with registers, memory addresses, and call stacks, high-level languages deal with variables, arrays, objects, arithmetic and Boolean expressions, functions, loops, threads, locks, and other computer science abstractions, intended to facilitate correctness and maintainability. Unlike low-level assembly languages, high-level languages have few, if any, language elements that translate directly to a machine's native opcodes. Other features, such as string handling, object-oriented programming features, and file input/output, may also be provided. A high-level language allows for source code that is detached and separated from the machine details. That is, unlike low-level languages like assembly and machine code, high-level language code may result in data movements without the programmer's knowledge. Some control of what instructions to execute is handed to the compiler.
History
[edit]In the 1960s, the term autocode was commonly used to describe a high-level programming language that relied on a compiler. Notable examples of such autocodes include COBOL and Fortran.
COBOL (Common Business-Oriented Language)
[edit]- Developer: Committee, with Grace Hopper's influence (1959)
- Explanation: Like FORTRAN, COBOL is a monumental successor to the autocode idea, but for business data processing. Its defining feature was its syntax, which was designed to read almost like English.
- Example:
ADD PRICE TO TOTAL. - This made it possible for business professionals (like managers and accountants) to read and understand the program's logic, even if they weren't expert programmers. COBOL's English-like structure is a direct evolution of the "autocode" goal of being more human-readable.
- Example:
FORTRAN (Formula Translation)
[edit]- Developer: John Backus and team at IBM (1957)
- Explanation: While not always labeled an "autocode" today, FORTRAN is the most famous and successful direct descendant of the autocode concept. It was designed specifically for scientists and engineers. Its key innovation was allowing programmers to write instructions using familiar mathematical formulas.
- Example: Instead of writing complex machine instructions, a programmer could simply write something like
X = (A + B) / C. The FORTRAN compiler would then translate this into efficient machine code. Its success proved that high-level languages could be both practical and efficient.
- Example: Instead of writing complex machine instructions, a programmer could simply write something like
The first high-level language to achieve widespread adoption was Fortran, a machine-independent evolution of IBM’s earlier Autocode systems. Around the same time, the ALGOL family emerged—ALGOL 58 in 1958 and ALGOL 60 in 1960—created by joint committees of European and American computer scientists. ALGOL introduced key innovations such as recursion, nested functions under lexical scope, and a clear distinction between value and name parameters with their respective semantics. It also pioneered several structured programming concepts, including the while-do loop and if-then-else statements, and became the first language whose syntax was formally defined using Backus–Naur Form (BNF).
Meanwhile, COBOL brought the concept of records (also known as structs) into mainstream programming, and Lisp became the first language to implement a fully general lambda abstraction.
Abstraction penalty
[edit]A high-level language provides features that standardize common tasks, permit rich debugging, and maintain architectural agnosticism. On the other hand, a low-level language requires the coder to work at a lower-level of abstraction which is generally more challenging, but does allow for optimizations that are not possible with a high-level language. This abstraction penalty for using a high-level language instead of a low-level language is real, but in practice, low-level optimizations rarely improve performance at the user experience level.[2][3][4] None the less, code that needs to run quickly and efficiently may require the use of a lower-level language, even if a higher-level language would make the coding easier to write and maintain. In many cases, critical portions of a program mostly in a high-level language are coded in assembly in order to meet tight timing or memory constraints. A well-designed compiler for a high-level language can produce code comparable in efficiency to what could be coded by hand in assembly, and the higher-level abstractions sometimes allow for optimizations that beat the performance of hand-coded assembly.[5] Since a high-level language is designed independent of a specific computing system architecture, a program written in such a language can run on any computing context with a compatible compiler or interpreter.
Unlike a low-level language that is inherently tied to processor hardware, a high-level language can be improved, and new high-level languages can evolve from others with the goal of aggregating the most popular constructs with improved features. For example, Scala maintains backward compatibility with Java. Code written in Java continue to be usable even if a developer switches to Scala. This makes the transition easier and extends the lifespan of a codebase. In contrast, low-level programs rarely survive beyond the system architecture which they were written for.
Relative meaning
[edit]This section needs additional citations for verification. (October 2018) |
The terms high-level and low-level are inherently relative, and languages can be compared as higher or lower level to each other. Sometimes the C language is considered as either high-level or low-level depending on one's perspective. Regardless, most agree that C is higher level than assembly and lower level than most other languages.
C supports constructs such as expression evaluation, parameterized and recursive functions, data types and structures which are generally not supported in assembly or directly by a processor but C does provide lower-level features such as auto-increment and pointer math. But C lacks many higher-level abstracts common in other languages such as garbage collection and a built-in string type. In the introduction of The C Programming Language (second edition) by Brian Kernighan and Dennis Ritchie, C is described as "not a very high level" language.[6]
Assembly language is higher-level than machine code, but still highly tied to the processor hardware. However, assembly may provide some higher-level features such as macros, relatively limited expressions, constants, variables, procedures, and data structures.
Machine code is at a slightly higher level abstraction than the microcode or micro-operations used internally in many processors.[7]
Execution modes
[edit]This section needs additional citations for verification. (October 2018) |
The source code of a high-level language may be processed in various ways, such as:
- Compiled
- A compiler transforms source code into other code. In some cases, a compiler generates native machine code that is interpreted by the processor; however, many execution models today involve generating an intermediate representation (i.e. bytecode) that is later interpreted in software or converted to native code at runtime (via JIT compilation).
- Transpiled
- Code may be translated into source code of another language (typically lower-level) for which a compiler or interpreter is available. JavaScript and the C are common targets for such translators. For example, C and C++ code can be seen as generated from Eiffel code when using the EiffelStudio IDE. In Eiffel, the translated process is referred to as transcompiling or transcompiled, and the Eiffel compiler as a transcompiler or source-to-source compiler.
- Software interpreted
- A software interpreter performs the actions encoded in source code without generating native machine code.
- Hardware interpreted
- Although uncommon, a processor with a high-level language computer architecture can process a high-level language without a compilation step. For example, the Burroughs large systems were target machines for ALGOL 60.[8]
Note that a language is not strictly interpreted or compiled. Rather, an execution model involves a compiler or an interpreter and the same language might be used with different execution models. For example, ALGOL 60 and Fortran have both been interpreted even though they were more typically compiled. Similarly, Java shows the difficulty of trying to apply these labels to languages, rather than to implementations. Java is compiled to bytecode which is then executed by either interpreting in a Java virtual machine (JVM) or JIT compiled.
See also
[edit]References
[edit]- ^ "HThreads - RD Glossary". Archived from the original on 26 August 2007.
- ^ Surana P (2006). "Meta-Compilation of Language Abstractions" (PDF). Archived (PDF) from the original on 17 February 2015. Retrieved 17 March 2008.
{{cite journal}}: Cite journal requires|journal=(help) - ^ Kuketayev, Argyn. "The Data Abstraction Penalty (DAP) Benchmark for Small Objects in Java". Application Development Trends. Archived from the original on 11 January 2009. Retrieved 17 March 2008.
- ^ Chatzigeorgiou; Stephanides (2002). "Evaluating Performance and Power Of Object-Oriented Vs. Procedural Programming Languages". In Blieberger; Strohmeier (eds.). Proceedings - 7th International Conference on Reliable Software Technologies - Ada-Europe'2002. Springer. p. 367.
- ^ Manuel Carro; José F. Morales; Henk L. Muller; G. Puebla; M. Hermenegildo (2006). "High-level languages for small devices: a case study" (PDF). Proceedings of the 2006 International Conference on Compilers, Architecture and Synthesis for Embedded Systems. ACM.
- ^ Kernighan, Brian W.; Ritchie, Dennis M. (1988). The C Programming Language: 2nd Edition. Prentice Hall. ISBN 9780131103627. Archived from the original on 25 October 2022. Retrieved 25 October 2022.
{{cite book}}: CS1 maint: bot: original URL status unknown (link) - ^ Hyde, Randall. (2010). The art of assembly language (2nd ed.). San Francisco: No Starch Press. ISBN 9781593273019. OCLC 635507601.
- ^ Chu, Yaohan (1975), "Concepts of High-Level Language Computer Architecture", High-Level Language Computer Architecture, Elsevier, pp. 1–14, doi:10.1016/b978-0-12-174150-1.50007-0, ISBN 9780121741501
External links
[edit]- http://c2.com/cgi/wiki?HighLevelLanguage - The WikiWikiWeb's article on high-level programming languages
High-level programming language
View on GrokipediaDefinition and Fundamentals
Core Definition
A high-level programming language is a type of programming language designed to facilitate human-readable code through syntax resembling natural language, symbolic operators, and advanced control structures such as loops and conditionals, thereby abstracting away low-level hardware specifics like registers, memory addresses, and direct processor instructions.[7] This abstraction enables developers to express computational intent without delving into the intricacies of machine architecture, making software development more accessible and efficient.[2] In contrast to low-level languages like assembly, which demand explicit management of hardware resources and result in code that is machine-specific and verbose, high-level languages prioritize expressiveness and portability, allowing a single program to be compiled or interpreted across diverse hardware platforms without modification.[8] For instance, a task that might require dozens of assembly instructions to manipulate memory can often be accomplished in one or two high-level statements, enhancing developer productivity while reducing error-prone details.[7] Core attributes of high-level languages include their emphasis on human readability, which supports easier comprehension and maintenance of code, and a primary focus on algorithmic logic and problem-solving rather than granular hardware manipulation.[7] The concept emerged in the 1950s, with FORTRAN, developed by IBM, marking the advent of the first such language to translate formulaic expressions into machine code, thereby revolutionizing scientific computing by insulating users from binary-level programming.[9]Key Characteristics
High-level programming languages are distinguished by their syntax, which employs English-like keywords and natural language constructs to enhance readability and reduce the cognitive load on developers. For instance, commands such asprint in Python or if statements mimic everyday phrasing, while structural elements like indentation in Python or curly braces {} in languages like C++ delineate code blocks without requiring machine-specific notations such as binary or hexadecimal addressing. This design avoids the intricate register manipulations and memory addressing typical of low-level code, allowing programmers to focus on logic rather than hardware details.[7][10]
These languages incorporate built-in data types, including primitives like integers, strings, and booleans, as well as composite structures such as arrays and lists, which abstract away low-level memory allocation and management. Control structures like loops (for, while) and conditionals (if-else) are predefined to automate repetitive tasks and decision-making, often with automatic handling of bounds checking and type conversions to prevent common errors. Functions and procedures further encapsulate reusable code, promoting efficiency in development.[7][11]
Portability is a core trait, enabled by compilers that translate source code into machine-independent intermediate representations or interpreters that execute code directly across diverse hardware platforms without significant modifications. This cross-platform compatibility, exemplified in languages like Java, facilitates deployment on various operating systems and architectures.[12][13]
Support for modularity is achieved through libraries, modules, and import mechanisms that allow reuse of pre-built code, alongside paradigms like object-oriented programming (OOP) in languages such as Python and Java, which use classes, inheritance, and encapsulation to organize code into self-contained units. This fosters collaborative development and maintainability by isolating components and reducing interdependencies.[7][14]
Error handling in high-level languages typically involves structured mechanisms like exceptions, where runtime errors trigger try-catch blocks to gracefully manage issues such as division by zero or file access failures, contrasting with the manual checks required in low-level programming. This approach separates normal execution from error recovery, improving robustness without pervasive debugging code.[15][16]
Historical Development
Early Innovations
High-level programming languages emerged in the 1950s as a direct response to the limitations of machine code and assembly languages, which required programmers to manage low-level hardware details and resulted in tedious, error-prone coding processes.[9] Early efforts sought to abstract these complexities, allowing developers to express computations more intuitively and portably across machines. This shift was driven by the growing scale of computing applications, particularly in scientific and defense sectors, where manual coding consumed excessive time and resources.[17] A pivotal milestone was the development of FORTRAN (Formula Translation) in 1957 by John Backus and a team at IBM, marking the first widely adopted high-level language designed for scientific computing.[9] FORTRAN introduced the ability to write mathematical expressions directly, such as algebraic formulas, which the compiler would translate into efficient machine code for systems like the IBM 704.[18] This innovation stemmed from Backus's 1954 proposal to drastically reduce the effort required for programming complex numerical problems, addressing the fact that programmers spent up to half their time on debugging assembly code.[9] In 1958, Lisp (LISt Processor), developed by John McCarthy at MIT, became another foundational high-level language, emphasizing symbolic computation and recursion, which laid groundwork for artificial intelligence and functional programming paradigms.[19] Also in 1958, ALGOL (Algorithmic Language) was introduced through an international committee, establishing foundational structured programming concepts like block structures for scoping variables and control flow.[20] ALGOL 58, its initial version, emphasized clarity in algorithm description and influenced subsequent language designs by promoting modular code organization, though it saw limited commercial implementation.[21] This was followed by ALGOL 60 in 1960, which gained wider adoption and further standardized structured programming.[22] The 1960s brought further innovations, including BASIC (Beginner's All-purpose Symbolic Instruction Code) in 1964 by John Kemeny and Thomas Kurtz at Dartmouth College, designed for ease of use by non-experts and enabling interactive computing on time-sharing systems.[23] Additionally, Simula, developed between 1962 and 1967 by Ole-Johan Dahl and Kristen Nygaard at the Norwegian Computing Center, introduced class-based object-oriented programming for simulation, influencing later OOP languages.[24] COBOL (Common Business-Oriented Language), released in 1959 under the leadership of Grace Hopper as part of the CODASYL committee, targeted business data processing with an English-like syntax to enhance readability for non-technical users.[25] Hopper's prior work on compilers like FLOW-MATIC informed COBOL's focus on verbose, self-documenting code for applications such as payroll and inventory management. These early languages were motivated by the need to minimize development time and errors in large-scale projects, including military simulations on early computers, where assembly programming proved inadequate for teams of varying expertise.[17]Modern Evolution
In the 1970s, the C programming language, developed by Dennis Ritchie at Bell Labs between 1969 and 1973 with the most significant advancements occurring in 1972, marked a pivotal advancement by combining high-level abstractions such as structured programming constructs with direct low-level access to hardware, making it ideal for systems programming and the development of the Unix operating system.[26] This design influenced subsequent languages by demonstrating how high-level features could support efficient, portable code without sacrificing control. The 1980s and 1990s saw the emergence of object-oriented programming paradigms in high-level languages, exemplified by Smalltalk-80, released in 1980 by Alan Kay and the team at Xerox PARC, which introduced core concepts like classes, objects, inheritance, and message-passing as a foundational model for encapsulating data and behavior.[27] Building on this, C++, created by Bjarne Stroustrup starting in 1979 and first released in 1985, extended C with object-oriented features including classes, inheritance, and polymorphism, enabling more modular and reusable code for large-scale software development.[28] These innovations shifted focus toward abstraction for managing complexity in growing applications, such as graphical user interfaces and simulations. During the 2000s, scripting languages gained prominence for their emphasis on simplicity and rapid development. Python, initiated by Guido van Rossum in late 1989 and first released in 1991, saw widespread adoption in the 2000s due to its readable syntax and extensive libraries, facilitating quick prototyping in areas like web development and data analysis.[29] Similarly, JavaScript, developed by Brendan Eich at Netscape in 1995, became essential for web development by enabling dynamic client-side interactivity through event-driven scripting integrated with HTML.[30] These languages prioritized developer productivity over raw performance, supporting the expansion of the internet and automated scripting tasks. From the 2010s to 2025, high-level languages increasingly incorporated functional programming elements for enhanced safety and expressiveness. Rust, initiated as a Mozilla Research project in 2009 and publicly released in 2010, emphasizes memory and thread safety through ownership and borrowing mechanisms, reducing common errors like data races while maintaining high performance for concurrent systems programming.[31] Julia, developed by Jeff Bezanson, Stefan Karpinski, Viral B. Shah, and Alan Edelman and first released in 2012, focuses on high-performance numerical computing with AI and machine learning applications, offering just-in-time compilation and multiple dispatch to bridge the gap between productivity and speed in scientific workflows.[32] Contemporary trends highlight concurrency support, as seen in languages like Go with its goroutines, to handle parallel execution efficiently, and sustainability through code efficiency measures that minimize energy consumption in data centers.[33][34] Advances in hardware, particularly the widespread adoption of multi-core processors since the mid-2000s, have driven language features for parallelism, such as built-in concurrency primitives in languages like Erlang and Scala, enabling high-level abstractions to exploit multiple cores for scalable applications without manual thread management.[35] Execution modes in modern high-level languages have also adapted to cloud computing environments, supporting asynchronous and concurrent execution via frameworks like Python's asyncio.[22]Abstraction and Design Principles
Levels of Abstraction
High-level programming languages employ hierarchical levels of abstraction to distance programmers from hardware-specific details, enabling focus on problem-solving logic rather than machine intricacies. These layers build upon one another, starting from basic structural simplifications and progressing to specialized conceptual models. The foundational layer, syntactic abstraction, introduces high-level syntax that replaces verbose low-level machine or assembly code with intuitive constructs. For instance, a conditional "if" statement in languages like Fortran or Python encapsulates the equivalent of assembly-level jump instructions (e.g., conditional branches based on flags), allowing programmers to express logic in a readable, English-like form without managing register states or unconditional jumps.[36] This level emerged prominently in early high-level languages from the 1950s, marking a shift from machine-oriented coding to human-centric expression.[36] Building on syntactic simplicity, the semantic abstraction layer conceals operational details of program execution, such as memory allocation and data handling. Automatic garbage collection in languages like Java and Python automatically detects and frees unused memory, eliminating the manual malloc/free calls and pointer arithmetic required in C, which can lead to errors like dangling pointers or leaks. A clear example is file input/output: Python'sopen('file.txt', 'r').read() provides a straightforward interface that internally manages buffers and streams, contrasting with C's explicit fopen, fread, and pointer-based buffer handling via FILE* structures.
At the highest layer, domain-specific abstraction tailors language features to particular application areas, modeling real-world concepts directly while hiding implementation complexities. SQL, for database management, allows declarative queries like SELECT * FROM users WHERE age > 30 to abstract away indexing strategies, join algorithms, and storage optimization performed by the database engine. These layered abstractions collectively facilitate rapid prototyping and code maintenance by promoting reusability and reducing boilerplate, though they inherently trade off direct hardware control for enhanced productivity.[37]