Source Code Translation
   HOME

TheInfoList



OR:

A translator or programming language processor is a
computer program A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
that converts the programming instructions written in human convenient form into machine language codes that the computers understand and process. It is a generic term that can refer to a
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
, assembler, or interpreter—anything that converts code from one computer language into another. These include translations between high-level and human-readable computer languages such as C++ and
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
, intermediate-level languages such as
Java bytecode Java bytecode is the instruction set of the Java virtual machine (JVM), the language to which Java and other JVM-compatible source code is compiled. Each instruction is represented by a single byte, hence the name bytecode, making it a compact ...
, low-level languages such as the
assembly language In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
and
machine code In computer programming, machine code is computer code consisting of machine language instructions, which are used to control a computer's central processing unit (CPU). For conventional binary computers, machine code is the binaryOn nonb ...
, and between similar levels of language on different
computing platform A computing platform, digital platform, or software platform is the infrastructure on which software is executed. While the individual components of a computing platform may be obfuscated under layers of abstraction, the ''summation of the requi ...
s, as well as from any of these to any other of these. Software and hardware represent different levels of abstraction in computing. Software is typically written in high-level programming languages, which are easier for humans to understand and manipulate, while hardware implementations involve low-level descriptions of physical components and their interconnections. Translator computing facilitates the conversion between these abstraction levels. Overall, translator computing plays a crucial role in bridging the gap between software and hardware implementations, enabling developers to leverage the strengths of each platform and optimize performance, power efficiency, and other metrics according to the specific requirements of the application.


Programming language processors

The software development process is noticeably different depending on the type of translator used by a developer, this of course differs from translator to translator. Stages of the development process that are influenced by a translator include the initial programming stage, the
debugging In engineering, debugging is the process of finding the Root cause analysis, root cause, workarounds, and possible fixes for bug (engineering), bugs. For software, debugging tactics can involve interactive debugging, control flow analysis, Logf ...
stage, and most notably the execution process. Factors that are affected during these stages include code performance, feedback speed for the debugging process, language features, and platform independence. Some of the more notable programming language processors used to translate code are
compilers In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
, interpreters, and
assemblers Assembler may refer to: Arts and media * Nobukazu Takemura, avant-garde electronic musician, stage name Assembler * Assemblers, a fictional race in the ''Star Wars'' universe * Assemblers, an alternative name of the superhero group Champions of ...
.


Compilers

Compiler software interacts with
source code In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer. Since a computer, at base, only ...
by converting it typically from a higher-level programming language into
object code In computing, object code or object module is the product of an assembler or compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' ...
that can later be executed by the computer's
central processing unit A central processing unit (CPU), also called a central processor, main processor, or just processor, is the primary Processor (computing), processor in a given computer. Its electronic circuitry executes Instruction (computing), instructions ...
(CPU). The object code created by the compiler consists of machine-readable code that the computer can process. This stage of the computing process is known as compilation. Utilizing a compiler leads to separation in the translation and execution process. After compilation, the new object code is saved separately from the source code resulting in the source code no longer being required for the execution process. With compiler programs, the translation process occurs one-time which results in efficient code that can be executed quickly for any number of times. There are clear benefits when translating high-level code with a compiler. * Compilation leads to faster run time when executing the program. Since code is translated before execution, its results are optimized and fast. * Compilers are more ideal when protecting code from
plagiarism Plagiarism is the representation of another person's language, thoughts, ideas, or expressions as one's own original work.From the 1995 ''Random House Dictionary of the English Language, Random House Compact Unabridged Dictionary'': use or close ...
and preventing the use of source code from an unauthorized party. * Object code only needs to be created once when compiling source code. There are clear disadvantages when translating high-level code with a compiler. * Object code produced during compilation is specific to a machine's
instruction set architecture In computer science, an instruction set architecture (ISA) is an abstract model that generally defines how software controls the CPU in a computer or a family of computers. A device or program that executes instructions described by that ISA, ...
(ISA). This results in object code that is dependent on a specific type of machine in order to run. * The debugging stage of the development process cannot start until the program is fully compiled. Errors are only viewable after compilation. * Any source code that is modified must be fully recompiled to be executed again. Some notable programming languages that utilize compilers include: * C * C++ *
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural, and, since 2002, object-oriented language. COBOL is primarily ...
* Fortran *
PL/I PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has b ...
*
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
*
REXX Rexx (restructured extended executor) is a high-level programming language developed at IBM by Mike Cowlishaw. Both proprietary and open-source software, open source Rexx interpreter (computing), interpreters exist for a wide range of comput ...


Interpreters

Interpreter programs function by interpreting high-level code into machine useable code while simultaneously executing the instructions line by line. Unlike compilers, interpreters do not need to compile the code prior to executing the instructions. The translation and execution process are done simultaneously and is interrupted in the event of an error in the program. The use of an interpreter allows developers to test and modify code in real-time. It makes the debugging process easier as well as aids in making more efficient code. Since the translation and execution process is done simultaneously, the execution time for interpreter programs is substantial. There are clear benefits when translating high-level code with an interpreter. * Since object code is not created in the interpretation process, less memory is required for the code. * Interpreter languages do not create machine-specific code and can be executed on any type of machine. * The development and debugging process is typically quicker due to less complexity and it has more flexibility. There are clear disadvantages when translating high-level code with an interpreter. * Programs require that an interpreter is installed on the machine in order to run and interpret it. * The execution time of the program is slower than a compiler. Some notable programming languages that utilize interpreters include: * Python *
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
*
Perl Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
*
Ruby Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...


Assemblers

An assembler program functions by converting low-level assembly code into a conventional machine code that is readable by the CPU. The purpose of assembly language, like other coding languages, is to make the programming process more user-friendly than programming in machine language. Assembler languages utilize mnemonic devices and symbolic addresses to differentiate between opcode, operands, and specific memory addresses. Many of these components are not easily readable by humans and therefore mnemonics, symbols, and labels make the code decipherable. The assembler works by processing code one line at a time and then moves on to the next instruction. To eliminate issues that occur due to addressing locations, the translation process known as assembly is typically done in a two-pass process. The first pass of assembly is done in order to identify binary addresses that correspond to the symbolic names. This is essential in order to guide pass two which is the line-by-line translation into machine language. Commonly used assemblers include: * x86 assembly languages (used in Intel and AMD processors) * ARM assembly language (used in mobile devices) * MIPS assembly language (used in gaming consoles) *
PowerPC PowerPC (with the backronym Performance Optimization With Enhanced RISC – Performance Computing, sometimes abbreviated as PPC) is a reduced instruction set computer (RISC) instruction set architecture (ISA) created by the 1991 Apple Inc., App ...
assembly language * LC-3 assembly language (used primarily in education to program the LC-3 computer)


See also

* Binary translator (binary-to-binary, typically code) * Assembly language translator (low-level source-to-source, code) * Source-to-source translator (high-level source-to-source, code) * Rewriter (source-to-source, typically code) * Source-code formatter (source-to-source, typically code) * File converter (binary-to-binary, typically data) * Transcoder (binary-to-binary, data)


References


Further reading

* (2+xiv+270+6 pages) * * * {{cite encyclopedia , title=Computer science , author-first1=Allen , author-last1=Tucker , author-first2=Geneva G. , author-last2=Belford , encyclopedia=
Encyclopædia Britannica The is a general knowledge, general-knowledge English-language encyclopaedia. It has been published by Encyclopædia Britannica, Inc. since 1768, although the company has changed ownership seven times. The 2010 version of the 15th edition, ...
, url=http://www.britannica.com/EBchecked/topic/130675/computer-science/168860/High-level-languages , access-date=2020-02-02 , url-status=live , archive-url=https://web.archive.org/web/20190723203047/https://www.britannica.com/science/computer-science , archive-date=2019-07-23 Programming language implementation