Currently, it's possible to build very interesting apps with interpreted code. I guess it all depends on the kind of apps you're building Note that you have to be careful with labeling a language as "interpreted" and consequently "slow".
For example JavaScript always was interpreted and slow , but in the recent generation of JS engines when running expensive computational tasks, it gets compiled to native instructions. Lothar Lothar Think of the interpeter as an emulator for a machine you don't happen to have The short answer is that the compiled languages are executed by machine instructions whereas the interpreted ones are executed by a program written in a compiled language that reads either the source or a bytecode and then essentially emulates a hypothetical machine that would have run the program directly if the machine existed.
DigitalRoss DigitalRoss k 23 23 gold badges silver badges bronze badges. Greg Greg k 52 52 gold badges silver badges bronze badges. Loop a times, the contents of the loop are interpreted times into low level code.
Not cached, not reused, not optimised. In simple terms, a compiler interprets once into low level code Edit, after comments: JIT is compiled code , not interpreted. It's just compiled later not up-front I refer to the classical definition, not modern practical implementations.
Of course: en. That's the description of a very lame implementation of an interpreted language. I do not doubt some interpreters did do this thing in the past, but today the only one I would expect being caught parsing forever and ever would be cmd. Greg: It's true, although the answer was worded rather poorly no offense gbn. I think he meant that the bytecode for the loop is interpreted times, rather than simply being executed times.
This is not an issue for JIT-capable VMs, however, because they would compile the loop down to native code, thus it would be just as fast as in a compiled program. As soon as you introduce a JIT into the mix, I don't think you can call it an interpreted language - at least not a purely interpreted one.
Interpretation per se does this. Of course, once you have it working you'd immediately start thinking about doing something smarter, which all the big "scripting" languages do. Many are bytecode compiled at run time, some use JIT compilers, etc. Show 3 more comments. Eloff Eloff NET is a framework, not a VM.
A VM-friendly language typically but not always isolates the code from the hardware and OS, and provides an abstract "machine code" that source is compiled to which the VM then, at run time, translates into instructions compatible with the target OS or hardware. Kaleb Brasee Kaleb Brasee That's not entirely correct. C and Java are compiled, but compiled to IL, not native instructions. To say that they are interpreted implies that the source is analyzed at runtime, which is not the case with C though I am not sure about Java - not that familiar with it.
That's true, the source isn't analyzed at runtime, the compiled bytecode instructions are. Java CAN be interpreted if the VM you're using does that, and a few of them do, but the majority do not for obvious performance reasons. Yeah, interpreted languages are slow Nestor Nestor Jonathan Feinberg Jonathan Feinberg Community Bot 1 1 1 silver badge. Manjula Manjula 4, 3 3 gold badges 27 27 silver badges 38 38 bronze badges. BTW, did you notice that the question you linked to has the same poster Nathan shows every sign of not being serious.
Update: no, I didn't see that my answer is the same as the accepted one, to a degree ;-. Wikipedia says , Interpreting code is slower than running the compiled code because the interpreter must analyze each statement in the program each time it is executed and then perform the desired action, whereas the compiled code just performs the action within a fixed context determined by the compilation.
In our hummus example, the entire translation is written before it gets to you. If the original author decides that he wants to use a different kind of olive oil, the entire recipe would need to be translated again and resent to you.
Interpreters run through a program line by line and execute each command. Here, if the author decides he wants to use a different kind of olive oil, he could scratch the old one out and add the new one. Your translator friend can then convey that change to you as it happens. Interpreted languages were once significantly slower than compiled languages. But, with the development of just-in-time compilation , that gap is shrinking.
Most programming languages can have both compiled and interpreted implementations — the language itself is not necessarily compiled or interpreted. Python, for example, can be executed as either a compiled program or as an interpreted language in interactive mode. On the other hand, most command line tools, CLIs, and shells can theoretically be classified as interpreted languages.
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. 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. In my experience they also tend to be higher-level, which makes them easier as well. 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. Here is an excellent presentation on the latest trends in the Dynamic Language area:. The significant benefit of an interpreted language is that it does not have to be compiled for each hardware target separately.
Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. The major disadvantage with runtime environments is that a program that is not designed well will force the runtime environment to compile almost all of the code up front and then make redundant calls to the interpreter.
This makes the program slower to load and run. This is document agsz in the Knowledge Base. Last modified on Skip to: content search login. Knowledge Base Toggle local menu Menus About the team. Knowledge Base Search. Log in. Options Help Chat with a consultant. Include archived documents. This content has been archived , and is no longer maintained by Indiana University.
0コメント