What is programming language, IDE and compiler?

Starting in programming is not always easy, in addition to terms to learn to "write the code", there are dozens of terms, technologies, among other things that need to be studied.

In order to help those who are starting out, my question is: what is a programming language, an IDE and a compiler? What is the relationship between these items?

Author: Maniero, 2015-12-03

9 answers

TL; DR

Programming language is a more abstract concept, it is the specified Rules that govern how a code should behave to produce computer programs. The language is not a program that runs.

Compiler is what concretizes the programming language, it is what applies these rules and transforms what a human understands into the code that the machine understands and is able to execute. It's a transformation program. Usually it is a program that runs in console via the command line.

IDE is a tool (a software) that helps the entire software development process by integrating other tools and facilitating their use. The main function of it is the text editor.

Nowadays it is very common for people, especially when they are starting to program, not to understand very well all aspects of what involves the software development process, the whole theory of computing, and the role of each tool in this process. IDE is not the programming language.

IDE

Since people start out as computer users where the normal thing is to use a Microsoft Word for example, and that does everything it needs in terms of text editing, when she goes to program and has her install Visual Studio, Eclipse, Android Studio or some other IDE she thinks that's the programming language.

O IDE (Integrated Development Environment) is the Integrated Development Environment (note that it is male), that is, it is the program that integrates the various tools necessary for the development of software helping the whole process get easier.

Its main function is to help the programmer edit the code that will be used to create his program.

Another very important thing that all IDEs do is to call the compiler, or interpreter, within certain parameters to generate and/or execute the program created if it does not contain errors.

It also helps:

  • debug programs during execution with various facilities;
  • manage projects and their settings
  • run tests, mount the deploy or even do it;
  • do static analysis;
  • version control;
  • access database;
  • automatically generate codes for certain coding patterns, such as screens and reports;
  • give easy access to documentation;
  • various aids during the code editing process.

This can vary from IDE to IDE and how it is configured. As the name says, these tools are often integrated. Of course, some are there by default, but many of them rely on an external program to perform the task. The language compiler itself is usually something external.

An IDE can support multiple languages (have specific tools to support the use of certain language).

Compiler

The compiler is the program that parses and generates the executable of what is being created. It takes human - readable text-what the programmer wrote - and turns it into machine-readable code, a binary code that has instructions of what the processor should execute (there are instances of intermediate code).

Obviously it's not a magic program, special. It is just a data processor like so many others. He reads texts and transforms them. In a way it is a relatively simple program. Of course there is complexity in interpreting the entire grammar of a language and each has its degree of complexity.

During this process syntactic and semantic errors are checked, optimizations can be made, and a generation of new target code is performed.

In some cases it is possible to interpret this code instead of the traditional compilation process, although the interpretation involves an internal compilation process.

The compiler must understand the rules that a given programming language was built on, and must ensure that all of them were followed by transforming the code written by obeying these rules.

In general the compiler is a console program, but there are cases that they are libraries that can be used in conjunction with other programs.

There are compilers which support several languages, although there is usually a certain separation (in general there is a single compilation platform but different compilers).

Understand How is a compiler made?.

Programming language

The programming language is this set of rules. It is what defines the syntax and semantics to be obeyed. Just like any natural language, but in this case it is a more limited, more logical and purposeful language specific.

These languages can be C, C++, C#, Java, basic, COBOL, FORTRAN, Pascal, Go, D, PHP, JavaScript, Python, Ruby, Perl, Lua, Lisp, Haskell, etc.

There are so many because each one has a strong point, in addition to better serving a specific type of problem, it caters to different people's tastes. There are cases that it is not quite the language itself that makes it viable for a problem but rather the infrastructure that has been assembled around it.

This set of rules is defined by a grammar and probably a formal specification, although some more specific cases the compiler implementation is that it defines how the language behaves. In general, this occurs in non-standard languages that have only one compiler for it.

Understand How is a programming language developed?.

It is common for compilers not to follow the 100% specification, in general for failure, or even more so for adding capabilities that specification does not determine. Evidently this is the exception, otherwise it would start to turn into another language.

Not all languages are programming .

Where do you program?

You use the IDE to facilitate development work, but it is only a facilitator and cannot be confused with the programming language. Any problem you are having with the code you are writing is a problem with the language and not the IDE. Making a comparison with other languages, if you do not know how to write a word in Portuguese or how to build a sentence can not say that this is a difficulty you are having with Word, it is a difficulty with Portuguese.

A problem with the IDE occurs during the general development process, when something fails or the difficulty encountered is in the IDE you have a problem in it. Comparing again, when you are not able to make a paragraph in Word, it is a difficulty with Word.

When any of the tools used fail or you encounter difficulty in isolation you have a problem in it specifically. This can be down to the compiler, but rarely a problem is from the compiler itself.

Most of the glitches or difficulties one encounters during the process are during the build process, but because the code has some problem, not because the IDE or compiler is not working. So the problem is with the language of schedule.

And no, the bug is not in the IDE or compiler. The bug is in your written code. It is easier to hit the lottery than a programming novice to find a bug, especially in the compiler, preventing the correct use of the language.

An IDE can use different compilers, not only for different languages, but also for the same language. The language is unique (although it may have dialects), the compilers do not, and IDE even less. The fact that most people use a certain IDE for a language does not make it as part of the language.

An IDE is totally unnecessary to use a programming language (well, there may be some esoteric language that requires it). The compiler is absolutely necessary, although in some cases it is more of an interpreter.

Examples of compilers and IDEs

C / C++

Compilers like GCC support languages like C, C++, Objective C, Fortran, Java (it is very rare for anyone to use it for it) and others. Note that GCC is only one of the existing compilers for the C and C++languages. It works on all platforms mainstream and several others. Understand by platform, the architecture of the processor or operating system. In some it may require a differentiated distribution, as is the case with Windows. In this operating system it is usually used MinGW, but basically the compiler is GCC. Be who also uses the distribution Cygwin , but rare.

The C and C++ languages are standardized and have several compilers that meet their specifications. Among them the Clang, Visual C++ (Note that it does not call Visual Studio C++ that would be the IDE for this language, despite the name, the compiler works on the command line and has nothing visual, this part is in the IDE) and Intel C++ Compiler , just to name the best known and assets.

Code:: Blocks is one of the most used "independent" IDEs. Those who use the Qt library usually use the Qt Creator. Some people like CodeLite, C++Builder , or XCode . CLion starts having fans.

These are languages where there are plenty of IDEs and all important ones that allow the use of multiple languages offer some level of support to them, at some level. Unfortunately there are some pretty bad ones indicated in courses (Dev c++, cof cof).

Java

Java is another language that has several compilers. The best known is the made available by Oracle . Some run away a bit from the standard and there is controversy whether it should be called a Java compiler, even Microsoft has already had one. Another well-known is the compiler for Android that has its own characteristics. In addition to Eclipse and Android Studio, already mentioned, the NetBeans is very used with this language or C / C++. IntelliJ is another.

C #

C# has the old compiler, the new which is now a compilation platform , and the compiler of the Mono. Visual Studio is the most used IDE for this language, but there are others such as SharpDevelop or MonoDevelop. Today is the Visual Studio Code is very used, for other languages as well.

BASIC

BASIC has several dialects, each with its own compiler. But dialect may be different enough to consider as different languages. Visual BASIC is probably the best known of them, and it usually runs alongside Visual Studio.

JavaScript

JavaScript is often interpreted or compiled at the time of its use. In general this is done in the browser and each has its own compiler. IE / Edge, Chrome / Opera, Safari, etc. most Cited IDEs support JS well, another is WebStorm .

PHP

PHP is an interpreted language. There is an official platform from it that can be supplemented or distributed in different forms. It is rare for a different distribution and especially a separate implementation of the official to have any kind of traction in the market. There are a huge amount of IDEs for PHP, but it is rare to have one standing out more than others.

Other

Python e mostly Ruby, they have compiler options, but they don't usually have much success either. Several IDEs are available, including extensions for the above-mentioned IDEs, as they were made to support several languages.

There is at least one case of language and IDE getting confused, even if they are different things, the Delphi.

I could continue to cite several other languages with their compilers and IDEs, but I think this gives a good basis for then have more specific questions.

IDEs online

I don't know if you can call a real IDE, but there are several that can be used for quick codes like ideone, repl.it, .NET Fiddle, Compiler Explorer , etc.

Conclusion

It is important to understand these differences to develop better.

And it is important to know this to use the correct tags and better describe the problem. Don't say your problem is in the IDE when it's actually in your code written in a certain language (use the tag of the language and not the IDE you're using). The fact of using an IDE, does not usually help anything in these cases. Only when it is some problem that can only occur in its use.

It is more important to inform the compiler when the language usually has several.

 85
Author: Maniero, 2020-10-08 12:30:14

Ensō, the symbol of enlightenment, strength, elegance, the universe and emptiness

thus said The Master Programmer: without the wind, the grass does not move. Without software, hardware is useless.


Something mysterious is formed, born in the emptiness of silence. Waiting alone and motionless, he is at the same time standing still and still in constant motion. He is the source of all programs. I don't know your name, so I'll call it The Tao of programming.

The Programmer dreams of Tao, and by language his dreams win way.

Your Hands bind the Tao, and by IDE your dreams flow into the machine.

At the heart of the machine, the compiler turns the language into discrete instructions.

The instructions control the rivers of information that escape, fast and flowing, through the data buses and beyond.

If the Tao is grandiose, then the application is grandiose. If the application is grandiose, then the user is pleased. If the user is pleased, the administrator is satisfied, and there is harmony in the world.

The Tao of the schedule flows away and returns in the morning wind.

Sources: 1, 2

 59
Author: OnoSendai, 2015-12-08 12:32:46

The programming language is a set of words and symbols that combined create instructions that are executed by a device(computer, mobile, etc.), basically the language defines the rules(syntax) of how instructions should be assembled.

Compiler / parser is responsible for reading an entry( language code in pure text), detecting all symbols and / or keywords this process is known as lexical analysis, once done the next step is check if the symbols respect the grammar of the language, in case there is no problem the code can be interpreted or an artifact will be generated (file with the instructions converted to machine language).

The IDE is a tool, for editing source code of certain programming language the main features are syntax highlight, auto complement of language instructions. The IDE makes the tip to connect programming language with the compiler / interpreter, an example where this is very evident would be, use C/C++ on windows, the language would be C / C++, the compiler is usually gcc(through cwyng) and IDE eclipse or codeblocks.

 39
Author: rray, 2015-12-03 11:21:34

In practical and simple terms, it follows:

  • programming language is for computing just as language is for humans - it has words, syntax, spelling, etc.
  • compiler is a tool that turns your cute code into machine language 00100111010101...
  • IDE is like an advanced notepad; it will indicate syntax errors, color your code like a lego to make it easier for you to identify the pieces, it offers project file management and a number of cool features that are worth mentioning when you start using.
 21
Author: Marcio Jalber, 2015-12-08 12:29:26

A programming language is a standardized method for communicating instructions to a computer. It is a set of syntactic and semantic rules used to define a computer program. It allows a programmer to specify precisely what data a computer will act on, how this data will be stored or transmitted, and what actions should be taken under various circumstances. Ex: C#, VB, Java, Python and etc.

IDE: IDE Integrated Development Environment or Integrated Development Environment, is a computer program that brings together features and tools to support software development in order to streamline this process. We have as an example Visual Studio for .NET, Eclipse and Netbeans for Java and etc.

A compiler is a computer program (or a group of programs) that, from source code written in a compiled language, creates a semantically equivalent but written program in another language, object code. Classically, a compiler translates a program from a textual language easily understood by a human to a machine language, specific to a processor and operating system. Nowadays, however, compilers are common that generate code for a virtual machine that is then interpreted by an interpreter.

It is worth noting that some programming languages do not have a compiler, that is, they are interpreted in time of execution.

 18
Author: Hoppy, 2015-12-03 11:26:21

IDE

IDE, from the English Integrated Development Environment or Integrated Development Environment, is a computer program, which when installed on your machine, offers various features that help the developer in his programming task. There are paid IDE and open source IDE. No IDE is required to develop a system, just a simple notepad is enough, as it is enough to type the words consistent with the programming language and the system he'll be here soon.

PROGRAMMING LANGUAGE

The programming language(LP) is composed of its own syntax and semantics (formed by rules with letters, digits and symbols endowed with meaning) and a restricted set of norms and aims to give instructions to a machine. They are languages that help programmers write programs more easily and quickly.

Syntax is responsible for defining how programs can assist in conflict resolution within the computer. In addition, they perform other functions such as providing security, translating languages, working on communication and creating files.

Compiler

A compiler is a special program that processes statements written in a specific programming language and turns them into machine language or "code". Typically, a programmer writes language statements in a programming language, one line at a time using a text editor or IDE. When running the compiler first parses all language statements syntactically line after line and then constructs the output code, making sure that statements that refer to other statements are referred to correctly in the final code.

 13
Author: durtto, 2015-12-04 16:50:30

Taking into account that the target are newbies (as well observed by @Eduardo Seixas), try to abstract the following concepts:

What is programming language?

Something like a language used by programmers to communicate with a machine.

What is IDE?

Something like a Medium used by programmers to communicate with a machine.

What is compiler?

Something like a dictionary used by programmers to communicate with a machine.

Summarizing :

To be a program boy it is necessary to communicate with the machine (programming language and IDE), for this communication to occur there can be no errors (compiler), it is all black on white and there is no room for right medium (0 and 1).

 13
Author: petersonfortes, 2015-12-07 11:35:49

To understand, let's make an analogy with Portuguese.

In order to communicate with each other in SOpt we use written Portuguese. In Portuguese (as in any other language), there are two very important concepts, which are also applied in programming languages, they are: syntax and semantics.

Basically, syntax is related to The Shape of words. By "Ezemplo": "there are several program languagesare. Which one to choose?".

The above error is easily identified and this is a syntax error. "Ezemplo", "linguajens" and "programassão" are words that do not exist in the Portuguese language.

In a programming language such as Java, the syntax consists of several words, such as if, else, class, while , etc.

Semantics define meaning. It is semantics that gives understanding when you put the words together. Examples:

Tomorrow at park I go. I'm going to the park tomorrow. I'm going to the park tomorrow. I'm going to the park tomorrow.

All these phrases make sense to you, as your brain performs an interpretation process and can understand the meaning.

In Java, some example sentences are:

if (a > 10) {
   System.out.println("a é maior do que 10");     
}

However, if we write the same way:

System.out.println("a é maior do que 10") if (a > 10);

This obviously won't work.

This happens because a programming language will not be translated into machine code by the being human, this will be done by a compiler .

Therefore, a compiler is software that receives as input a text written in a programming language and translates it into another language, commonly called a machine language (the famous Assembly). This is the language that the processor "understands".

For the compilation process to occur without errors, it is necessary to have very well defined rules for syntax and semantics. Therefore, many people suffer from C when one learns to program, since many rules must be followed, such as"; " at the end, open and close keys, etc.

The wrong words and phrases in Portuguese that I wrote above were correctly interpreted, because our brain is much more flexible and adaptable, thus, accepts various errors of syntax and semantics. Anyway, we are beings who have intelligence, after all, who created the compilers? :- ) Already a compiler not, it is extremely rigid and if we do not follow its rules, we won't be able to use it.

IDEs, in turn, are software that makes the programming process smoother, since they can not only identify errors before the compilation process, but also give tips for certain constructions to be made in different ways. Important: an IDE is not essential for us to be able to program. It is perfectly possible to program in C, Java, C#, etc, using any text editor and then call the compiler by passing these files so that they are compiled.

However, IDEs are widely used, as they allow the programmer to focus on solving the problem, on the business itself. The IDE takes care of helping you identify errors and automates many tasks, such as the build process itself. Hardly anyone program without IDE nowadays, because programming has become something very complex, with several layers, several languages, several concepts and aspects distinct.

Personally, I think IDEs are key in day-to-day life, but not for beginners. For beginners IDEs are harmful. I say that, because IDEs make everything look magical. It's so automated that a beginner can't see the complexity behind an IDE. And, who is starting to program, must be exposed to the exact opposite, that is, must program using a text editor and the compiler, to understand in the flesh that not there is magic in computing.

 10
Author: cantoni, 2015-12-03 12:50:16

I liked this topic.

In summary:

Programming language: it is the set of rules and conventions that one must follow to write code that will be translated into machine language.

Compiler: is the software that transforms code written in programming language to machine language.

IDE: is a text editor with extra features that help programmers write code correctly and efficiently. Among the features of the most sophisticated IDEs are: indicate typos in real time so that they are easily corrected, autocomplete during typing, hold key and click parts of the code to navigate between different portions of it and between files, debug code advancing line by line, etc.

Relationship between programming language, IDE and compiler:

The programmer writes the code using the programming language in the IDE, this by its instead calls the compiler that turns the code into machine language.

I will add the explanation of some other terms that are also very much asked by beginners:

Weakly typed language:

Are the languages in which the programmer can create variables without previously specifying the type of data that will be stored in them. PHP is a good example of weakly typed language because when creating a variable it is not necessary to define its type, although initializing it with an appropriate value, even if it is not necessary, can be seen as good practice. The interpreter specifies the type based on the contents of the variable. Ex: $variavelstring = ""; $variavelinteiro=0; Note1: the type of the variable changes every time the content changes its type. Note2: saying that the language is "weakly typed" not is the same as saying that the language "has no typing". This second statement is a common mistake that should not be made.

Strongly language typed:

Are the languages in which you need to specify the type of all variables in your declaration. Variables do not need to be initialized immediately, but the definition of their type is required in their declaration. The type of the variables is immutable. As an example of strongly typed language we have Java. Ex: String variavelstring = "Teste"; int numero = 1; Meuobjeto obj;

Note: A common mistake made by java novices is the NullPointerException. This occurs when you try to manipulate an object that does not it has been initialized yet.

Wrong: Meuobjeto obj; obj.toString(); - > NullPointerException.

Right: Meuobjeto obj = new Meuobjeto(); obj.toString();

Interpreted language vs compiled language:

Interpreted language is one that code does not go through compilation and are called scripting language. Ex: Javascript, PHP. Compiled language is one in which code goes through the compilation process, that is, it is transformed into machine code.

Java is interpreted or compiled?

That's a good question. Java is a compiled language, but its code is not compiled for machine code but rather for bytecodes which are interpreted by the JVM (Java Virtual Machine), the java virtual Machine, which is software responsible for executing commands compiled for bytecodes.

 3
Author: Antonio Alexandre, 2017-01-31 02:37:54