Compiled programminglanguages

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ing System (OS) is The Operating System (OS) is the Primary Caller Our OS will be Linux The OS allows input via the keyboard and output via the screen. Input and output can also take place to files on disks, speakers, microphones, etc. Caller (Linux OS) The OS can My Program only directly Data input call machine Data language output executables. Data Interpreted vs. Compiled Interpreted vs. Compiled Programming Languages Let’s say you are working on Project 1 and need to ask the other engineers a question. The problem is they are from may different countries and may actually speak another language… Call the associate with an interpreter on the line. Write down what you need to say. Have it translated, and fax it to your colleague. Interpreted vs. Compiled Interpreted vs. Compiled Programming Languages Interpreted languages are flexible but slow. Each line gets translated independently but you always have to pay the price of having an interpreter around. Compiled languages are less flexible but more efficient. The entire program gets translated at once so when it is executing the CPU only deals with native code. Interpreted vs. Compiled Interpreted vs. Compiled Programming Languages Interpreted languages: BASIC, MATLAB Compiled languages: C, C++, Fortran Compiling a C++ Program Compiling a C++ Program In order to utilize our program, we must first translate it into machine language so that the computer can understand it. Only once it is translated can it be called by the operating system. This is done by running a compiler. On our computer systemthe C++ compiler is called g++. Creating and Compiling Creating and Compiling a C++ Program STEP 1: You use OS to start a machine code executable called a text editor. machine code files You (the user) The computer OS text editor g++ compiler text files Creating and Compiling a C++ Program STEP 2: Using that program you create a text file called Project1.cpp machine code files You (the user) The computer OS text editor...
View Full Document

Ask a homework question - tutors are online