What is a programming language, IDE and compiler?

Asked

Viewed 41,109 times

133

Starting in programming is not always easy, besides having 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, my question is: what is a programming language, an IDE and a compiler? What is the relationship between these items?

  • 14

    +1. Will help many new people ;)

  • 2

    This is the intention @Wallacemaxters I would even post direct with response, but I think there are a lot of people here on the site that can give a good answer (including better than one of mine).

  • 6

    +1. It was a great question :D

  • 2

    Related: http://meta.pt.stackoverflow.com/q/4617/101

9 answers

87


TL;DR

Programming language is a more abstract concept, are the rules specified governing how a code should behave to produce computer programs. The language is not a program that executes.

Compiler is what embodies the programming language, is what applies these rules and transforms what a human understands in the code that the machine understands and is able to execute. It is a transformation program. Usually it is a program that runs on the 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. Its main function 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 process of software development, all theory of computation, and the role of each tool in this process. IDE is not the programming language.

IDE

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

The IDE (Integreted Development Environment) is the integrated development environment (note that it is masculine), that is, it is the program that integrates the various tools necessary for software development helping the whole process to become easier.

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

Another very important thing that all Ides do is to call the compiler, or interpreter, within certain parameters to generate and/or run the created program if it contains no errors.

It also helps:

  • debug programs while running with various facilities;
  • manage projects and your settings
  • run tests, assemble the deploy or even do so;
  • do static analysis;
  • versioning;
  • access database;
  • generate codes automatically for certain coding standards such as screens and reports;
  • provide easy access to documentation;
  • various aids during the process of editing the code.

This can vary from IDE to IDE and how it is configured. As the name says, these tools are usually 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 (having specific tools to support certain language usage).

Compiler

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

Obviously it is not a magical, special program. It is just a data processor like so many others. It reads texts and transforms them. In a way, it’s 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 done, and a new generation of 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 particular programming language was built, and must ensure that all of them were followed by transforming the written code 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 that support several languages, although there is usually a certain separation (in general there is a single compiler platform but different compilers).

Understand How is a compiler made?.

Programming language

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

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 has a strong point, besides better meeting a specific type of problem, meets the tastes of different people. There are cases that it is not the language itself that makes it viable for a problem but rather the infrastructure that has been built 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 what defines how the language behaves. In general this occurs in non-standard languages that only have one compiler for it.

Understand How a programming language is developed?.

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

Not all languages are programming languages.

Where 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 with 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 with it. Comparing again, when you are unable to do 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 with it specifically. This may be up to the compiler, but rarely is a compiler problem itself.

Most of the flaws or difficulties a person 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 programming language.

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 person beginner in programming find a bug, mainly 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 particular IDE for a language does not make it part of the language.

A 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 the GCC support languages such as C, C++, Objective C, Fortran, Java (it’s very rare for someone to use it for her) 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 of Windows. In this operating system we usually use the Mingw, but in the background the compiler is GCC. Some also use the distribution Cygwin, but rarely.

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++ which would be the IDE for this language, despite the name, the compiler works in command line and has nothing visual, this part is in the IDE) and Intel C++ Compiler, only to name the best known and active.

Code::Blocks is one of the most widely used "independent" Ides. Anyone using the Qt library uses Qt Creator. Some people like the Codelite, C++Builder, or Xcode. Clion begins to have adherents.

These are languages where there are plenty of Ides and all the important ones that allow the use of various languages offer some level of support to them at some level. Unfortunately there are some very bad 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 a little off the grid and there are controversies whether it should be called the Java compiler, until Microsoft already had one. Another well known is the compiler for Android that has features of its own. In addition to Eclipse and Android Studio, already cited, the Netbeans is widely used with this language or C/C++. Intellij is another.

C#

C# has the old compiler, the which is now a compilation platform, and the compiler of Mono. Visual Studio is the most used IDE for this language, but there are others like Sharpdevelop or Monodevelop. Today is the Visual Studio Code is widely 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 together with Visual Studio.

Javascript

Javascript is usually 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 of the Ides cited support the JS well, another is the Webstorm.

PHP

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

Other

Python and mainly Ruby have compiler options, but they are not very successful either. Several Ides are available, including extensions to the Ides mentioned above, 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, Delphi.

I could go on quoting several other languages with their compilers and Ides, but I think this gives a good basis for more specific questions later.

Ides online

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

Completion

It is important to understand these differences in order to develop better.

And it’s important to know this to use the tags correct and better describe the problem. Do not say that your problem is in the IDE when it is actually in your code written in a certain language (use the tag the language and not the IDE you are using). Using an IDE usually does nothing 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.

  • 14

    If there is something wrong in the answer, please let me know so that I can fix it, it is important not to have anything wrong informing people and I want to improve what is here.

60

Ensō, o símbolo da iluminação, força, elegância, o universo e o vazio

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


Something mysterious is formed, born in the void of silence. Waiting alone and immobile, he is at the same time still and still in constant movement. He is the source of all programs. I do not know his name, so I will call him Tao of Programming.

The Programmer dreams of the Tao, and by the Language his dreams take shape.

Your hands bind the Tao, and through the IDE your dreams flow into the Machine.

At the heart of the Machine, the Compiler transforms the Language into discrete instructions.

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

If the Tao is great, then the application is great. If the application is great, then the User takes pleasure. If the User has pleasure, the Administrator is satisfied, and there is harmony in the world.

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

Sources: 1, 2

  • 10

    Your nick never made so much sense.

  • 7

    The answer does not answer the question, nor does it clarify, nor does it help. But in the midst of the answers, his answer was the one that got the most wind.

  • Your answer is a mockery of a completely valid question.

  • 10

    @Pablo I don’t see the answer as a debauchery. It is definitely not technical content, explaining in detail each part asked, but gives a general and humorous overview about them. I see as something perfectly fitting, and even welcome, to break the monotony round and a half.

  • I believe the comments exist for that. If it doesn’t say what the AP wants to know, then it’s not an answer. I would have worked better the answer to meet both requirements: be informative and relaxed. That’s not what I saw here.

  • @Pablo I don’t question the quality of the answer as a whole. I also believe that it could be improved to achieve the 2 goals you mentioned. But that doesn’t mean I see the current shape - with problems and all - as a debauch

  • Unfortunately, I see it. Of course this is not something objective and demonstrable, but I don’t think it gives the right image, the way it is. If one person saw it that way, others will probably see it. I don’t think it’s healthy.

  • 4

    It’s different, but it’s cool. He was face-to-face and received 13 positive votes. A story-based explanation with similes and metaphors. In fact, I didn’t see any kind of humor in that answer, but I also didn’t see any debauchery. If there’s one attribute I didn’t see in that answer, it was debauchery. You even have the source with more examples of this type.

  • 3

    @Pablo no, I believe you have interpreted it in a way that was not originally proposed. Still your opinion is valid, and I thank you for feedback.

  • 1

    One for @Gabe on his dark throne was the best of all. 12mil in a year and 10 months, congratulations.

  • @Eduardoseixas I do not understand anything, but if it is to have a throne I particularly prefer that

  • @It’s just that I mention you in my profile. =)

Show 7 more comments

40

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 the instructions should be mounted.

Compiler/interpreter is responsible for reading an input(plain text language code), detecting all symbols and/or keywords this process is known as lexical analysis, once done the next step is to 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 a given programming language the main features are Highlight of the syntax, auto complement of language instructions. The IDE does the cutting edge to connect programming language with the compiler/interpreter, an example where this is quite evident would be, using C/C++ in windows, the language would be C/C++, the compiler usually is and gcc(through cwyng) and the IDE eclipse or codeblocks.

  • 1

    Do you have any problem or incorrect information in the answer? can I correct/supplement.

23

In practical and simple terms, it follows:

  • programming language is for informatics just as language is for humans - 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 as a lego to make it easier for you to identify the pieces, offers project file management and a number of very cool features that are worth mentioning when you start using.
  • 2

    Very good your answer.

  • 1

    Thank you. I try to be simple and practical, because it helps more than a lot of technical explanation.

20

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, from English 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 the Visual Studio for . NET, Eclipse and Netbeans for Java and etc.

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

It is worth mentioning that some programming languages do not have compiler, or are interpreted at runtime.

  • 7

    About programming language: I expected more.

  • 2

    I gave an improved programming language. thanks! :)

  • About your last paragraph we have that question that speaks just that. xD

  • As the author of the answer you mentioned informs: "Of course using these terms of the question cannot be considered totally wrong since everyone understands its meaning" @Randrade, but if you have any suggestion terminology I am open to changes.

  • 2

    I didn’t mean to add in your question, I’m sorry if you implied it. I just posted because it was mentioned by you. The reader will be able to access it if it calls attention. .

  • I believe that Delphi should not be listed as a programming language, since some say that Delphi is IDE used for programming in pascal.

  • There is a question right now talking about it, I do believe that Delphi is like IDE, also a language based on Object-pascal. however if you have any material to read on the subject, I can review the content and remove from the reply.

  • @Hoppy, the Miguelbast was the guy who just asked the question :D

  • 2

    I will remove soon Delphi to not generate controversy, kk. This is not the focus of sopt.

  • 3

    Delphi is clearly an IDE. Object pascal is the language. You can compile Pascal Object outside of the Delphi IDE. Just find the compiler (an EXE in the Delphi folder) and compile the files. The IDE only makes this work easier. The same obviously applies to C#, Java (with Eclipse or Intellij). Therefore, I would put Delphi only as IDE.

  • 1

    @Cantoni it seems to me that this definition is exceeded, I also thought http://answall.com/questions/101695/ide-e-linguagens-ofprogram%C3%A7%C3%a3o

  • I get your argument @bigown and it really makes sense. Well, regardless, I can still compile a Delphi code outside of the Delphi IDE and that only reinforces the idea that the IDE is a plus in the act of programming, but it’s not fundamental. I think this separation is important. I even quote this in my reply.

  • @Cantoni yes, but you will still be program "in Delphi" :) Only after I went to search to reply that I found out that this nomenclature transition had occurred. That makes sense. After researching some more I will improve there.

  • Yes @bigown, I agreed with you. Included in my last comment I quote: "I can still compile a Delphi code", that is to say I assumed that the language is called Delphi and not Object Pascal. What I tried was to reinforce the difference between Language, IDE and compiler.

Show 9 more comments

14

IDE

Integrated Development Environment is a computer program that, when installed on your machine, offers several features that help the developer in his programming task. There is paid IDE and open source IDE. You don’t need an IDE to develop a system, just a simple notepad is enough, as you just type the words consistent with the programming language and the system will be ready.

PROGRAMMING LANGUAGE

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

The syntax is responsible for defining how programs can help resolve conflicts 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 written statements in a specific programming language and transforms 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 executing the compiler first analyzes all language instructions syntactically line after line and then builds the output code, making sure that the statements that refer to other statements are correctly referred to in the final code.

14

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

What is a programming language?

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

What is IDE?

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

What is a compiler?

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

In short:

To be a call 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 and white and there is no space for right middle (0 and 1).

  • 3

    I do not agree with the word language, the middle word and the word dictionary. Your answer does not help a novice, an apprentice. Imagine him looking for a language from a programming language to learn.

  • 3

    @Eduardo Seixas you are in your right not to agree, but try to keep your mind open to the following fact: My answer is consistent with the question in question, simply by fulfilling the goal as well as stimulating one of the most important factors of programming, the "ABSTRACTION".

10

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

So that we can 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, are they: syntax and semantics.

Basically, syntax is related to the form of words. By "Ezemplo": "There are several programming languages. Which 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 like Java, the syntax is composed of several words, such as if, Else, class, while, etc..

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

I’ll go to the park tomorrow. I’m going to the park tomorrow. I’ll go to the park tomorrow. I’m going to the park tomorrow.

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

In Java, some example phrases are:

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

But if we write the same:

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

That’s obviously not gonna work.

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

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

In order 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 learning to program, since many rules must be followed, such as ";" in the end, opening and closing keys, etc..

The wrong words and phrases in Portuguese that I wrote above have been correctly interpreted, because our brain is much more flexible and adaptable, so it accepts several errors of syntax and semantics. Anyway, we are beings who have intelligence, after all, who created the compilers? : -) No compiler, he’s extremely strict and if we don’t follow his rules, we won’t be able to use him.

Ides, in turn, are software that makes the process of programming easier, 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 FDI is not fundamental 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 to be 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 compilation process itself. Hardly anyone program without IDE nowadays, because programming has become something very complex, with several layers, several languages, several concepts and different aspects.

Personally, I think Ides are fundamental in everyday life, but not for beginners. For beginners Ides are harmful. I say this because Ides make everything seem magical. It’s so much automated that a beginner can’t see the complexity behind an IDE. And, who is starting to program, should be exposed to the exact opposite, ie, should program using a text editor and compiler, to understand in the flesh that nay there is magic in computing.

3

I like this topic.

Briefly:

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: It is the software that transforms written code into programming language for machine language.

IDE: It is a text editor with extra features that help programmers write code correctly and efficiently. Among the most sophisticated IDE features are: Indicate real-time typing errors so they are easily fixed, autocomplete during typing, hold key, and click parts of code to navigate between different portions of code and between files, thresh 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, which in turn calls the compiler that turns the code into machine language.

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

Weakly typed language:

These are the languages in which the programmer can create variables without first 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 the type of it, although initializing it with a suitable value, even if it is not necessary, can be seen as a 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 type. Note2: Say that the language is "weakly typed" nay is the same thing as saying that the language "has no typing". This second statement is a common mistake that should not be made.

Strongly typed language:

These are the languages in which it is necessary 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 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 beginners in Java is Nullpointerexception. This occurs when trying to manipulate an object that has not 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 the code does not compile and is called a scripting language. Ex: Javascript, PHP. Compiled language is one in which the code goes through the compilation process, ie 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 for bytecodes which are interpreted by the JVM (Java Virtual Machine), the java virtual machine, which is software responsible for executing the commands compiled for bytecodes.

  • 1

    Cool your answer, though, from the part where you say: "I will add the explanation of some other terms that are also asked a lot by beginners [...]" I think the answer has lost its way.

  • 1

    In fact I had written what came after all that was above. The top part was included to answer the question. ^_^!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.