Monday, 12 September 2016

Let's be friends with Interpreter, Compiler, and IDE


What's Interpreter ?
Computer language processor that translates a program line-by-line (statement-by-statement) and carries out the specified actions in sequence. In contrast, an assembler or compiler completely translates a program written in a high-level language (the source program) into a machine-language program (the object program) for later execution. Whereas a compiled-program executes much faster than an interpreted-program, an interpreter allows examination and modification of the program while it is running (executing).

What's Compiler ?
A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or "code" that a computer's processor uses. Typically, a programmer writes language statements in a language such as Pascal or C one line at a time using an editor . The file that is created contains what are called the source statements . The programmer then runs the appropriate language compiler, specifying the name of the file that contains the source statements.

What's IDE ?
IDE (Integrated Drive Electronics) is a standard electronic interface used between a computer motherboard's data paths or bus and the computer's disk storage devices. IDE can be known too as a programming environment integrated into a software application that provides a GUI builder, a text or code editor, a compiler and/or interpreter and a debugger. Visual Studio, Delphi, JBuilder, FrontPage and DreamWeaver are all examples of IDEs.

What's the different between 
a Compiler and an IDE?
A compiler only compiles (and perhaps Links) your code from text to binary op codes that the computer (or a virtual machine like Java) can run.

An IDE -- INTEGRATED development environment -- runs your compiler, places your cursor on errors, may be able to run your program within a debugger and allow you to seemlessly step through the source code as the program runs.

It's INTEGRATING the editor, compiler, linker, syntax checker, debugger, and maybe other tools like graphical and other resource editors.

curious how to install the programs above? please check out below ...
note : I will use Codelite and MinGW as example in Windows 10


How to download Codelite ?
1. Open the link of Codelite's site and click Download CodeLite 9.2 (current version)

2.  Just click Not now, take me to the download »

3. Choose Windows Installer 64 bit 


How to install CodeLite ?
1. Open the installer, and then click Next

2. Click 'I accept the agreement' and click next

3. To avoid / prevent any error(s) on installing, please select the destination location in C, then click Next

4. Click Next

5. Do you want to create its desktop icon? Mark it, but if you don't want you can just click Next

6. Click Install and you're done


How to install MinGW
1. Download the MinGW from here (directly inform from Codelite sites)

2. Open the installer and choose create

3. Choose the second one

4. Click Next, you can read if you want

5. Choose where do you want to save the installation

6. Click Next

7. Wait until the installation is done
 note
- TDM-GCC already set the PATH, you don't need to make the other one -
- for ease in using the program, i recommend you to restart the system-

How to Compile a Simple Source Code
before you compile, you need codelite to scan your compiler. Click Settings -> Build Settings -> Scan icon (folder and lup, red) -> and click the compiler which we installed before -

1. Open the CodeLite and click New Workspace

2. Choose C ++ and name your Workspace


as you can see at the left side, you already made your workspace

3. Right Click at the name of the workspace, and select 'Create New Project'

4. Because we're already install MinGW, we'll choose the one with (gcc) 

5. Name your Project


6. Please follow like this setting and then click 

7. Click the arrow before your project's name, then src, and click the main.c


8.  Try to change 'hello world' to anything you like. 

9. To make sure that there's no anything wrong with the code, editor, or compiler, click Build -> Build Project and check the box below thw workspace and the layer. Make sure there's no error or warnings .

10. After that you can Build -> Build and Run Project and it would show like this


Reference(s) :
http://www.businessdictionary.com/definition/interpreter.html
http://whatis.techtarget.com/definition/compiler
http://searchstorage.techtarget.com/definition/IDE
http://www.webopedia.com/TERM/I/integrated_development_environment.html
https://www.quora.com/What-is-the-difference-between-a-compiler-and-an-IDE
https://www.youtube.com/watch?v=LGGHxaDxSK4

No comments:

Post a Comment