<p>Interpreted languages give programs dynamic typing and smaller size. Compilied languages tend to be faster and more efficent. What other advantages and disadvantages are there of each?</p>
<p><em>(Originally suggested by <a href="https://languagedesign.stackexchange.com/users/5/rydwolf-programs">Rydwolf Programs</a> as an example question <a href="https://area51.stackexchange.com/proposals/127456/programming-language-design-and-implementation/127457#127457">here</a>)</em></p>

<compilers><interpreters>
What are the advantages of compiling/interpreting a programming language?
CC BY-SA 4.0
2023-05-21T11:05:03.313Z
How does this still not meet the referencing requirements
Starship
CC BY-SA 4.0
2023-05-23T00:36:14.167Z
"*Compiled languages are converted directly into machine code that the processor can then go and execute*" as opposed to interpreted languages where "the processor can then go and execute"? This sentence doesn't provide any significant information. ¶ "*Interpreted languages give programs certain extra flexibility*" but we have no idea what that "certain" something is. ¶ "*What other advantages and disadvantages are there of each?*" — other than what?  The question doesn't actually mention any advantages or disadvantages. ¶ This question isn't bad, it's just *asked* badly.
Ray Butterworth
CC BY-SA 4.0
2023-05-23T00:39:01.577Z
Fixed your complaints @RayButterworth
Starship
CC BY-SA 4.0
2023-05-23T08:07:31.920Z
@Jasmijn failing to meet referencing requirements as defined in [/help/referencing](/help/referencing) is _plagiarism_. If you see plagiarism in a question, you should custom mod-flag it and explain what happened- not close-vote.
starball
CC BY-SA 4.0
2023-07-08T01:46:27.827Z
Since someone else who wasn't Rydwolf posted the question, and there's was well-received anyway, I undeleted this question. Why would theirs be treated differently?
CPlus
CC BY-SA 4.0
2023-05-16T19:34:59.717Z
Please, do not blindly copy/paste the [top questions](https://area51.stackexchange.com/proposals/127456/programming-language-design-and-implementation?phase=definition&tab=votes#tab-top) - especially if you mistype the tags. It's better if the author of that question posts it; right now, it even fails to comply to the [referencing requirements](/help/referencing).
Glorfindel
CC BY-SA 4.0
2023-05-16T22:04:56.323Z
I’m voting to close this question because it fails to meet referencing requirements
Jasmijn
CC BY-SA 4.0
2023-05-16T22:38:22.797Z
Hows this off-topic of all the complaints?
Starship
<p><strong>Interpreted Language Advantage</strong></p>
<ul>
<li>Portability: Programs written in interpreted languages can be transferred as source code (or bytecode) to different platforms that have the interpreter implemented, without having to change the program.</li>
</ul>

CC BY-SA 4.0
2023-05-20T17:57:30.520Z
2023-05-20T17:57:30.520Z
springogeek
CC BY-SA 4.0
2023-05-20T19:25:51.767Z
Languages compiled to VM bytecode also have this advantage
Seggan
CC BY-SA 4.0
2023-05-20T20:20:14.120Z
The line gets blurry, but I consider bytecode machines interpreters, which is why my answer also referenced bytecode.
springogeek
<h2>Compiled Languages Advantages</h2>
<ul>
<li><p>Performance: Since compiled languages are translated into machine code, they can generally achieve better performance compared to interpreted languages.</p>
</li>
<li><p>Security: Since the source code is converted into machine code, it is not directly accessible or readable by users. This can provide an additional layer of security, as the compiled code can be distributed without exposing the original source.</p>
</li>
</ul>
<h2>Interpreted Languages Advantages</h2>
<ul>
<li>Making changes: When you make a change to a program in a compiled language, you have to go through the compilation process again. For larger projects, this can take several minutes. This does not happen with interpreted languages.</li>
</ul>

CC BY-SA 4.0
2023-05-20T17:29:19.223Z
2023-05-20T17:29:19.223Z
The Thonnu
<h2>There is no hard line</h2>
<p>There are various techniques that blend the line between compiled and interpreted languages various techniques blur the line, like:</p>
<ul>
<li>JIT compilation</li>
<li>Interpreting bytecode</li>
<li>Virtual Machines</li>
<li>Runtime Libraries</li>
<li>and much more</li>
</ul>
<p>Still there is a sliding scale of how much work you do at compile time and how much you do at run time.</p>
<p>Some benefits from doing things ahead of time are:</p>
<ul>
<li>Code is generally faster to run
<ul>
<li>Interpreted code can get some of these benefits too with JIT or bytecode</li>
</ul>
</li>
<li>Can run natively without requiring users of a program to download something extra
<ul>
<li>Can be mitigated by building executables that embed the interpreter, eg. py2exe</li>
</ul>
</li>
</ul>
<p>However, it also comes with downsides:</p>
<ul>
<li>Compiling takes time, thus slowing down iteration time during development</li>
<li>Compiled code needs to be built specifically for every platform it's intended to run on, while interpreted code can run on any platform with a interpreter available
<ul>
<li>Can be mitigated with virtual machines</li>
</ul>
</li>
</ul>
<p>Overall you can quite easily mix and match what interpreted or compiled features you like best.</p>

CC BY-SA 4.0
2023-05-20T18:36:13.793Z
2023-05-20T18:36:13.793Z
mousetail 'he-him'
# What are the advantages of compiling/interpreting a programming language?
Posted by: username_0 on 2023-05-16
Interpreted languages give programs dynamic typing and smaller size. Compilied languages tend to be faster and more efficent. What other advantages and disadvantages are there of each?

*(Originally suggested by [Rydwolf Programs](https://languagedesign.stackexchange.com/users/5/rydwolf-programs) as an example question [here](https://area51.stackexchange.com/proposals/127456/programming-language-design-and-implementation/127457#127457))*
**Tags:** compilers interpreters
> **Comments:**
> **username_4**: Please, do not blindly copy/paste the [top questions](https://area51.stackexchange.com/proposals/127456/programming-language-design-and-implementation?phase=definition&tab=votes#tab-top) - especially if you mistype the tags. It's better if the author of that question posts it; right now, it even fails to comply to the [referencing requirements](/help/referencing).  
> **username_5**: I’m voting to close this question because it fails to meet referencing requirements  
> **username_0**: Hows this off-topic of all the complaints?  
> **username_0**: How does this still not meet the referencing requirements  
> **username_1**: "*Compiled languages are converted directly into machine code that the processor can then go and execute*" as opposed to interpreted languages where "the processor can then go and execute"? This sentence doesn't provide any significant information. ¶ "*Interpreted languages give programs certain extra flexibility*" but we have no idea what that "certain" something is. ¶ "*What other advantages and disadvantages are there of each?*" — other than what?  The question doesn't actually mention any advantages or disadvantages. ¶ This question isn't bad, it's just *asked* badly.  
> **username_0**: Fixed your complaints @RayButterworth  
> **username_2**: @Jasmijn failing to meet referencing requirements as defined in [/help/referencing](/help/referencing) is _plagiarism_. If you see plagiarism in a question, you should custom mod-flag it and explain what happened- not close-vote.  
> **username_3**: Since someone else who wasn't Rydwolf posted the question, and there's was well-received anyway, I undeleted this question. Why would theirs be treated differently?  
---
## 3 answers
### Answer by username_9 on 2023-05-20. Score: 5 | Accepted answer
## There is no hard line

There are various techniques that blend the line between compiled and interpreted languages various techniques blur the line, like:

* JIT compilation
* Interpreting bytecode
* Virtual Machines
* Runtime Libraries
* and much more

Still there is a sliding scale of how much work you do at compile time and how much you do at run time.

Some benefits from doing things ahead of time are:

* Code is generally faster to run
  + Interpreted code can get some of these benefits too with JIT or bytecode
* Can run natively without requiring users of a program to download something extra
  + Can be mitigated by building executables that embed the interpreter, eg. py2exe

However, it also comes with downsides:

* Compiling takes time, thus slowing down iteration time during development
* Compiled code needs to be built specifically for every platform it's intended to run on, while interpreted code can run on any platform with a interpreter available
  + Can be mitigated with virtual machines

Overall you can quite easily mix and match what interpreted or compiled features you like best.
---
### Answer by username_6 on 2023-05-20. Score: 2
**Interpreted Language Advantage**

* Portability: Programs written in interpreted languages can be transferred as source code (or bytecode) to different platforms that have the interpreter implemented, without having to change the program.
> **Comments:**
> **username_7** (2023-05-20): Languages compiled to VM bytecode also have this advantage  
> **username_6** (2023-05-20): The line gets blurry, but I consider bytecode machines interpreters, which is why my answer also referenced bytecode.  
---
### Answer by username_8 on 2023-05-20. Score: 1
## Compiled Languages Advantages

* Performance: Since compiled languages are translated into machine code, they can generally achieve better performance compared to interpreted languages.
* Security: Since the source code is converted into machine code, it is not directly accessible or readable by users. This can provide an additional layer of security, as the compiled code can be distributed without exposing the original source.

## Interpreted Languages Advantages

* Making changes: When you make a change to a program in a compiled language, you have to go through the compilation process again. For larger projects, this can take several minutes. This does not happen with interpreted languages.
---
