Hello,
I'm now learning Perl, but what are the pros and the cons of the interpreted languages?, because i started to learn Perl because my friend started, then it's only more one language to my experience. Thanks.
Hello,
I'm now learning Perl, but what are the pros and the cons of the interpreted languages?, because i started to learn Perl because my friend started, then it's only more one language to my experience. Thanks.
Con:
Pro:
Pros:
Cons:
To put for the obvious and broad point, compiled languages tend to have higher performance than interpreted ones, since compiling precludes the need for a runtime interpreter.
Compiled languages are more suitable for commercial desktop software, since the source code is not shipped along with it.
Interpreted languages tend to be a bit quicker to learn, insofar as they allow you to quickly edit/run/repeat without waiting on a compiler. In my experience they also tend to be higher-level, which makes them easier as well.
Biggest drawback? Most would say execution speed, but isn't always necessarily true. Most modern interpreted languages these days convert the files to be interpreted into an intermediate state upon building, which when executed is turned into bytecode just as any other language. With bytecode caching being mostly prevalent these days, it shouldn't be too much of an issue. This is certainly not to say that performance is not an issue with interpreted languages, just that it is often not as bad as most would suggest.
Keep in mind that even with the performance problems though, it is often easier to achieve the same tasks as a compiled language in less and more efficient code, making the performance loss during compilation negligible over the execution time of a program.
Personally for me, the biggest drawback is the need for the interpreter to always be present before execution can occur. This quite often reduces portability, especially because interpreted languages aren't always cross platform.
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):
Disadvantages of interpreted languages
An execution by an interpreter is usually much less efficient then 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 of an interpreter on the local machine to make the execution possible.
Wikipedia has a page on the advantages and disadvantages. Any significantly advanced interpreted language can be actual compiled into a native binary thus blurring the lines between the pro's and cons of an interpreted language.
PERL is one of those languages which blurs the lines. Whilst its famous for being a powerful scripting language, you could compile it to be native.
The "slowness" of Dynamic Languages such as PERL may not be an issue any longer. Here is an excellent presentation on the latest trends in the Dynamic Language area:
http://steve-yegge.blogspot.com/2008/05/dynamic-languages-strike-back.html