Wednesday, March 30, 2011

Source Code vs. Executable Code

Source code and executable code are two terms for different levels of computer code.  They could both mean different things depending on the context they are spoken in.  Source code is generally the code given to a compiler or interpreter to create object code or target code.  In short it is the input code, while object or target code is the output.  Source code is generally a high-level language.  Computer code can go through several transformations before it is turned into machine code that is directly readable by the computer’s processor.  Therefore, the object code or target code of one device could be the source code of another.

Executable code is code that is directly executable by a computer’s processor.  Usually, it is machine code, an array of 1’s and 0’s that a computer can understand depending on the organization of these 1’s and 0’s.  However, in a general sense, executable code can also be a file containing instructions for an interpreter, such as bytecode or scripting language.

An Interpreter is an application that translates a higher-level computer language to a lower one and executes it at the moment the program is run.  Relating this to say a music program, it’s like hitting the space bar on a song you’ve recorded.  You instantly get to hear every track you’ve recorded, along with all the effects, automation, etc.  You can use this to listen to your work in progress and make tweaks to your song (program) in order to make it better and fix any flaws (bugs).

A Complier on the other hand does basically the same thing.  It translates your program from the high level language that you’ve written it into a lower one but it doesn’t do it in real time.  Instead it takes time to interpret your code and outputs object or target code.  Once completed you have your program but transferred to a different computer programming language.  In my mind this relates to a music program as an offline bounce to disk.  This is when you believe you have recorded everything you need to record, made all the edits you need, added all the effects you want, and completed all automation on every track.  When you are done with everything you can do to your song (program), you bounce it to a two track.  You choose the file format you would like your song to be converted into, the program then runs through the song and turns your multi-track project into a two-track stereo version, which can be played by any music player or burnt to a Compact Disc.

Assemblers take assembly language and convert it into machine code a computer’s processor can understand.  Assembly language is unique to each processor in language, but most use the same instruction statements that are used to define program operations.  Assembly language is the closest language to machine code.  Assemblers are used to squeeze the last bit of performance out of a processor by working near machine code level.  Because of this I relate it to the mastering process in music.  Once you have mixed all tracks of your multi-track recording and performed an offline bounce, creating a stereo two-track.  Mastering is the next step in which you make small tweaks to the equalization and compress the two-track to bring out every bit of feeling in your music.  This is similar because it squeezes every last bit of performance out of your two-track.  Also your mixed two-track before mastering is the closest representation of your song before it is finished, just as assembly code is one step away from machine code.

No comments:

Post a Comment