answersLogoWhite

0


Best Answer

Source code and target code are the input and output of programming language translation programs such as assemblers, compilers and interpreters.

An assembler is used to convert low-level assembly instructions into native machine code, thus the source code is assembly language and the target code is native machine code. The target code is typically saved to a file known as an executable. Once converted to native machine code, no further translation is required; the executable can be executed at a later date and as often as required upon any machine of the same type and equivalent system and supporting libraries and software, and with optimal execution speed.

An interpreter is used to convert a high-level language source to machine code while the source code is executing. The source code is executed by the interpreter but, unlike an assembler, the resultant machine code is not saved to a file. As such, the source code must be re-interpreted every time it is executed, thus execution speed is extremely slow. However, the source code is extremely portable and can be executed upon any machine that has a suitable interpreter. The main advantage of interpreted languages is that the source code can be changed while it is executing, so the programmer can see the effect immediately.

A compiler is used to convert source code written in a high-level programming language to that of a lower-level target language. Typically the lower-level language is native machine code and, as with assembly, the target code can be saved and executed at a later date with optimal performance.

However, not all compilers compile to machine code. Some compile to assembly (which requires an assembler to complete the translation) while others convert to an intermediate code known as byte code. Byte code is intended to be interpreted by a virtual machine and can be thought of as being the native language of the virtual machine. As with all interpreted languages, the byte code is extremely portable and can be executed upon any physical machine that supports the appropriate virtual machine implementation. Java is an example of this.

Compilers can also translate code between two high-level languages so long as the target language is a lower level than the source language. The original C++ compiler worked this way, translating the C++ source into a C target which could then be compiled to machine code using the C compiler.

User Avatar

Zechariah Mayert

Lvl 10
2y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between source code and target code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between open-source and closed-source software?

The answer is in the question itself. Open-source software has it's source code available to everyone. Closed-source software does not.


What the difference between codes and standards?

Generally speaking a Code is something which must be adhered to, but a Standard is a guide, or target to be aimed at.


What is the difference between target code and source code?

Source code and target code are the input and output of programming language translation programs such as assemblers, compilers and interpreters. An assembler is used to convert low-level assembly instructions into native machine code, thus the source code is assembly language and the target code is native machine code. The target code is typically saved to a file known as an executable. Once converted to native machine code, no further translation is required; the executable can be executed at a later date and as often as required upon any machine of the same type and equivalent system and supporting libraries and software, and with optimal execution speed. An interpreter is used to convert a high-level language source to machine code while the source code is executing. The source code is executed by the interpreter but, unlike an assembler, the resultant machine code is not saved to a file. As such, the source code must be re-interpreted every time it is executed, thus execution speed is extremely slow. However, the source code is extremely portable and can be executed upon any machine that has a suitable interpreter. The main advantage of interpreted languages is that the source code can be changed while it is executing, so the programmer can see the effect immediately. A compiler is used to convert source code written in a high-level programming language to that of a lower-level target language. Typically the lower-level language is native machine code and, as with assembly, the target code can be saved and executed at a later date with optimal performance. However, not all compilers compile to machine code. Some compile to assembly (which requires an assembler to complete the translation) while others convert to an intermediate code known as byte code. Byte code is intended to be interpreted by a virtual machine and can be thought of as being the native language of the virtual machine. As with all interpreted languages, the byte code is extremely portable and can be executed upon any physical machine that supports the appropriate virtual machine implementation. Java is an example of this. Compilers can also translate code between two high-level languages so long as the target language is a lower level than the source language. The original C++ compiler worked this way, translating the C++ source into a C target which could then be compiled to machine code using the C compiler.


What is the difference between an open-source and a closed-source operating system?

Open-source means the source code is available to the end-user. The user can modify and change it, following the guidelines in the accompanying license. Close-source means that the source code is held by the developer, and only they can make any changes or study it.


What is the difference between source code and specially written software?

Source code means the form of the software which is the most suitable for human understanding; while 'specially written software' is... well, okay, I admit I have no idea what do you mean by that...


What are the differences between a compiler and a translator?

A compiler transforms source code from a source file into low-level machine code, which is able to be executed directly on the CPU. A translator feeds the source code of a script into a different program that determines what the code is doing and executes the instructions.


What is the difference between an open system and a closed system?

Open-source means the source code is available to the end-user. The user can modify and change it, following the guidelines in the accompanying license. Close-source means that the source code is held by the developer, and only they can make any changes or study it.


Do open source operating systems use binary code as a base like WindowsTM?

All operating systems have to use binary code in order to operate. The difference between open-source operating systems and Windows is that you can see the code before it is converted into a binary format.


What is the difference between debugger and translator?

debugger find error and tell us and we remove them manually.interpreter is a translatol that translate source code to macihne statement by statement.


What are the uses of compiler besides translation?

compiler is complex software compounding of scanner,parser,intermediate code generator , object code generator etc. Actually its tasks is to convert one language to another target language. then it may be possible that source language may be c# ,java , C source code and target language one of them or assembly language code.


What is the basic Difference between flow chart and pseudo-code?

what's the difference between flow chart and structure diagrams and pseudo code


Difference between pin code and postal code?

There is not much of a difference between a pin code and a postal code. A pin code is used in India while other countries such as the U.S. use postal codes.