Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the pros and cons of interpreted languages? [closed]

I'm now learning Perl. What are the pros and cons of the interpreted languages?

like image 469
Nathan Campos Avatar asked Oct 22 '09 23:10

Nathan Campos


2 Answers

Blatant copy from wikipedia so I'll make this community wiki.

Advantages of interpreted languages

Interpreted languages give programs certain extra flexibility over compiled languages. Features that are easier to implement in interpreters than in compilers include (but are not limited to):

  • platform independence (Java's byte code, for example)
  • reflection and reflective usage of the evaluator (e.g. a first-order eval function)
  • dynamic typing
  • ease of debugging (it is easier to get source code information in interpreted languages)
  • small program size (since interpreted languages have flexibility to choose instruction code)
  • dynamic scoping
  • automatic memory management

Disadvantages of interpreted languages

An execution by an interpreter is usually much less efficient than regular program execution. It happens because either every instruction should pass an interpretation at runtime or as in newer implementations, the code has to be compiled to an intermediate representation before every execution. The virtual machine is a partial solution to the performance issue as the defined intermediate-language is much closer to machine language and thus easier to be translated at run-time. Another disadvantage is the need for an interpreter on the local machine to make the execution possible.

like image 164
2 revs, 2 users 97% Avatar answered Sep 23 '22 07:09

2 revs, 2 users 97%


Pros:

  • Rapid prototyping (no write, compile, execute cycle)
  • Cross-platform (assuming interpreters exist for each platform)

Cons:

  • Performance (won't be as fast as compiled languages)
like image 35
tscho Avatar answered Sep 22 '22 07:09

tscho