How does a compiler work in IDEs
Editors, compilers and integrated development environments
Editors, parsers and interpreters
One question: what does an editor have in common with a trowel?
Answering the question shouldn't be particularly difficult, as the trowel is just as much a hand tool of every bricklayer as an editor is a hand tool of every programmer. No bricklayer could erect a wall of bricks without materials and hand tools, and likewise no programmer could write source code for a program without a suitable editor. In this context, the bricklayer was only mentioned as a representative of all skilled trades in which no job would be really satisfactory without job-specific hand tools.
In the simplest case, a programmer will be satisfied with a pure text editor that can only display and save the ASCII character set or a related ANSI character set.
On the other hand, an editor that can highlight the syntax of the preferred programming language is much better suited, and an editor with syntax and brackets highlighting is even better. Especially with nested instructions, an editor with highlighted brackets can make troubleshooting much easier. Notepad ++, which is available free of charge, would be perfectly suitable as an all-round editor for Windows operating systems, for example, as it supports the syntax of a large number of markup, script and programming languages.
PHP (Hypertext Preprocessor) is, however, already parsed and interpreted by the web server. A small snippet of code could certainly be produced with any editor, inserted into an HTML page and tested on a server after a file has been uploaded, but an entire application cannot. In order to be able to test PHP applications on a PC, a server, a parser, an interpreter and a browser must be installed on the computer. In contrast to a markup language, the source code is not transmitted to a client-side browser, but first processed by a parser for the server-side interpreter and the finished HTML document (also other file types or file formats generated with PHP) transmitted to the browser. In addition to an Apache server, the XAMPP software package contains all the tools required to successfully test PHP applications on a home computer.
Preprocessors, compilers and linkers
The situation is completely different with the programming languages C and C ++, as well as with many other high-level languages. With these programming languages, the source code of the program files is translated by a compiler into a program that can be read by machines. The process of translating in this process is called compilation. The compiler includes a preprocessor and a linker, the job of the preprocessor being to prepare source programs for compilation. This preparatory work of the preprocessor consists, among other things, in the integration of header files, in the removal of comments and superfluous empty spaces (Whitespace) from the source code, as well as in the evaluation and implementation of other preprocessor directives marked with a # hash.
After the preprocessor has prepared the source code of the program file, the compiler will translate it into machine-readable code and optimize this code in the course of the translation. If the compilation is successful, the compiler creates an object file. If a program consists of more than one program file, the compiler will also create more than one object file.
After the compiler, it is the turn of the linker. This merges several object files (if the program consists of several source files) and links to required runtime libraries, provided they contain functions declared in the corresponding header files. Functions that are contained in the C standard library, on the other hand, are not linked dynamically, but statically linked.
If the compilation went smoothly and the preprocessor, the compiler and the linker have reliably dealt with the respective obligations, a finished program with the extension "exe" should be available, at least insofar as it is a normal computer program. The situation is somewhat different with a program for a microcontroller, since the finished program is still made with the help of special hardware (Burner) must be transferred to the microcontroller in order to write it into its memory.
Graphic: Simplified representation of the compilation of a C program in the order program.c -> preprocessor -> compiler -> linker -> program.exe.
Integrated development environments
Integrated development environments for programming more extensive software applications are much better suited than individual compilers. Usually this includes an integrated development environment (called IDE for short) all necessary tools for programming and debugging, such as editor, compiler, linker, debugger and project manager. The free Visual C ++ Express Edition from Microsoft is very popular in the hobby sector. For the microcontroller sector, the MPLAB development environment from Microchip, which is also available free of charge, is worth mentioning. We would like you to have both IDEs (in the foreseeable future) introduce a little more detail.
Creating a C program with:
- How do I start using stock marketing
- How crazy an Indian father can get
- You can consistently trade money a day
- How does Eventbrite work
- What kind of alcohol is Alize
- What's the worst vehicle ever built
- Johnny Cash liked rock music
- What is your best forex trading tip
- What sports are there
- Who is Warren Buffett's daughter
- Do coyotes and wolves ever cross
- You may be overdosing on birth control pills
- How will Sagarmala affect the logistics
- How is a fern habitat
- What are some more revolutionary military innovations
- Can we eat cashew nuts in summer?
- Was Henry Clay against slavery
- Should we go back to teaching sentence diagrams
- Why do sports unite our hearts
- What are NUST FSC requirements
- Affect windmills air currents
- What are your favorite QuickBooks apps
- What is the future of veganism
- What are the natural antifungal drugs