answersLogoWhite

0

Source code is code written in a programming language, such as C++ or Java. It is designed to be architecture-independent and human-readable. Source code must be converted to object code (aka machine code) before it can be executed. Object code is architecture-dependent and is not easily human-readable (think ones and zeros).

The point of this setup is that you can ensure that code you write in a programming language (source code) can be executed on ANY architecture that has a proper compiler.

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

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 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 compilar and interpreter?

compiler is a software translator used in ProgrammingLanguage: C,C++, Java etc ). This used for to translate High level language to Machine independent language. Interpreter is used to translate source code to machine code by line by line.


What are the difference between opcode and operand?

An opcode is an instruction. An operand is information used by the opcode. Not all opcodes require operands.


What is the difference between platform independent and portable in programming?

There is no difference. They mean exactly the same thing. Portable code is independent of the platform while non-portable code is platform-dependant.

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 source code and target 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 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.


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.