Answers.Body: <p>Interpreted languages allow for a faster development cycle, as they don't require time for compilation, and fragments can often be run without having a complete program. They often also have fewer constraints for variable declaration or typing. That means they can be used to quickly scope out a problem and try different solutions.</p>
  
  <p>The drawback is the slower execution speed. But during development this is not a big factor; it only becomes important in a production environment. So one option would be to use an interpreted language during the R&amp;D phase, and then re-implement the algorithm in a compiled language for performance improvements.</p>
  
  <p>Since ML and NNs have become more prevalent in AI, numerical computing has become more important. This is an area where interpreted languages traditionally don't perform too well, so one would use a (compiled) library for, say neural networks, or genetic algorithms, and use 'glue code' to integrate this into a bigger system. The glue code would transform/prepare data and convert this between different formats required by libraries. This is often done in interpreted scripting languages, as they might have to be changed more frequently and are not performance critical.</p>
  
  <p>Apart from development, the type of computation is also key: as mentioned, numerical computing generally works better with compiled code, but interpreted languages often have advantages in symbolic programming. This is why Lisp and Prolog have become popular AI languages, as opposed to Fortran or C.</p>
  
  <p>In an ideal world you would use an interpreted language for development, and then compile this once you're done. However, due to the way these languages work, compilation is often non-trivial.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-21T02:06:29.680Z
Answers.Text: I think this answer is pretty good. It may be worth also mentioning that some interpreted languages (e.g. Python) have the ability to run high-performance compiled code directly for portions of the program where speed really matters. For example, something like PyTorch allows one to write high performance ML code in Python, by invoking lower-level libraries written in C in a way that looks like one is writing regular Python code.
Answers.UserDisplayName: John Doucette
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-20T10:41:02.063Z
Answers.LastActivityDate: 2019-11-20T10:41:02.063Z
Answers.UserDisplayName: Oliver Mason
Body: <p>When are interpreted languages more optimal?  When are compiled languages more optimal?  What are the qualities and functions that render the so in relation to various AI methods?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-20T08:31:42.077Z
Comments.Text: For AI in the broadest sense, I don't think the comparison is any different to general programming. If you could narrow this down to a specific task or problem, it might be possible to answer. Otherwise it seems rather broad and not well defined. See https://stackoverflow.com/questions/3265357/compiled-vs-interpreted-languages
Comments.UserDisplayName: Neil Slater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-20T08:47:27.770Z
Comments.Text: Depends.
  
  If it's just a local home project, only you will access, then any language is good. If you are working in a team, then decide together. In general, compiled languages are good because they proof the code before execution, but scripted languages don't take the time to build your project. Most optimal would be python, since it's the language with the [most](https://hackernoon.com/top-8-python-libraries-for-machine-learning-and-artificial-intelligence-y08id3031) AI libraries. [Read More](https://www.geeksforgeeks.org/top-5-best-programming-languages-for-artificial-intelligence-field/)
Comments.UserDisplayName: Someone
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-21T01:46:39.873Z
Comments.Text: @NeilSlater fair point—possibly I should reference in general the "Python vs. Java/C" debate.  (The intent here was not to be entirely specific, but address a fundamental aspect of that debate.)
Comments.UserDisplayName: DukeZhou
Tags: <comparison><programming-languages>
Title: When are compiled vs. interpreted languages more optimal in AI?
UserDisplayName: DukeZhou
ThreadText: # When are compiled vs. interpreted languages more optimal in AI?
  
  (Asked by: username_0 on 2019-11-20)
  
  When are interpreted languages more optimal? When are compiled languages more optimal? What are the qualities and functions that render the so in relation to various AI methods?
  
  **Tags:** comparison, programming-languages
  > **Comments:**
  > **username_1**: For AI in the broadest sense, I don't think the comparison is any different to general programming. If you could narrow this down to a specific task or problem, it might be possible to answer. Otherwise it seems rather broad and not well defined. See https://stackoverflow.com/questions/3265357/compiled-vs-interpreted-languages  
  > **username_2**: Depends.  If it's just a local home project, only you will access, then any language is good. If you are working in a team, then decide together. In general, compiled languages are good because they proof the code before execution, but scripted languages don't take the time to build your project. Most optimal would be python, since it's the language with the [most](https://hackernoon.com/top-8-python-libraries-for-machine-learning-and-artificial-intelligence-y08id3031) AI libraries. [Read More](https://www.geeksforgeeks.org/top-5-best-programming-languages-for-artificial-intelligence-field/)  
  > **username_0**: @NeilSlater fair point—possibly I should reference in general the "Python vs. Java/C" debate.  (The intent here was not to be entirely specific, but address a fundamental aspect of that debate.)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2019-11-20. Score: 5
  
  Interpreted languages allow for a faster development cycle, as they don't require time for compilation, and fragments can often be run without having a complete program. They often also have fewer constraints for variable declaration or typing. That means they can be used to quickly scope out a problem and try different solutions.
  
  The drawback is the slower execution speed. But during development this is not a big factor; it only becomes important in a production environment. So one option would be to use an interpreted language during the R&D phase, and then re-implement the algorithm in a compiled language for performance improvements.
  
  Since ML and NNs have become more prevalent in AI, numerical computing has become more important. This is an area where interpreted languages traditionally don't perform too well, so one would use a (compiled) library for, say neural networks, or genetic algorithms, and use 'glue code' to integrate this into a bigger system. The glue code would transform/prepare data and convert this between different formats required by libraries. This is often done in interpreted scripting languages, as they might have to be changed more frequently and are not performance critical.
  
  Apart from development, the type of computation is also key: as mentioned, numerical computing generally works better with compiled code, but interpreted languages often have advantages in symbolic programming. This is why Lisp and Prolog have become popular AI languages, as opposed to Fortran or C.
  
  In an ideal world you would use an interpreted language for development, and then compile this once you're done. However, due to the way these languages work, compilation is often non-trivial.
  
  > **Comments:**
  > **username_4**: I think this answer is pretty good. It may be worth also mentioning that some interpreted languages (e.g. Python) have the ability to run high-performance compiled code directly for portions of the program where speed really matters. For example, something like PyTorch allows one to write high performance ML code in Python, by invoking lower-level libraries written in C in a way that looks like one is writing regular Python code.  
  
  ---
  
  