﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Venus of Savignaro</title><link>http://www.cppblog.com/xingzhoupku/</link><description>Venus berg</description><language>zh-cn</language><lastBuildDate>Tue, 09 Jun 2026 17:43:53 GMT</lastBuildDate><pubDate>Tue, 09 Jun 2026 17:43:53 GMT</pubDate><ttl>60</ttl><item><title>编译型语言和解释型语言的区别</title><link>http://www.cppblog.com/xingzhoupku/archive/2011/12/10/161906.html</link><dc:creator>Venus</dc:creator><author>Venus</author><pubDate>Sat, 10 Dec 2011 14:55:00 GMT</pubDate><guid>http://www.cppblog.com/xingzhoupku/archive/2011/12/10/161906.html</guid><wfw:comment>http://www.cppblog.com/xingzhoupku/comments/161906.html</wfw:comment><comments>http://www.cppblog.com/xingzhoupku/archive/2011/12/10/161906.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/xingzhoupku/comments/commentRss/161906.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/xingzhoupku/services/trackbacks/161906.html</trackback:ping><description><![CDATA[<div><p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">The  difference between compiled and interpreted code lies in the point  where the source code is transformed to machine level instructions,  which provides two very different conceptions of running applications.  In compiled languages as C, C++, Cobol or Fortran, a compiler, which is  specific to the machine and often to the operating system, transforms  the source code into executable code. On the other hand in interpreted  languages like JavaScript, PHP, Perl, Python, Java or C# , the ultimate  transformation to machine language is done at run time.</span></span></p> <p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Compiled  programs are already in the executable form native to the hardware and  operating system that runs it and do not need to suffer any intermediate  processing to be run (Brookshear, 2008). Therefore, compiled programs  usually run faster than interpreted ones, which can be designed, like  Java and C#, so they can call compiled languages to run application  parts that have a critical performance (Spell, 2000). However, there are  situations where just-in-time (JIT) compilers that use  platform-specific, application-specific, environment or language  optimization techniques (Bertino, 2000) can make an interpreted program  to run faster. </span></span></p> <p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">For  example, if a function or component is called multiple times, JIT  compilers can optimise the code so that it can run potentially faster  than compiled code. Another example, if a program is compiled for a i386  processor, it will not be optimised for a Core 2 Duo, however a JIT  compiler can optimise the code to the particular hardware (Spell, 2000).  Below, there is a comparison of languages performance and can be  observed that the fastest language (for this particular benchmark) is  C++ running on GNU/Linux and the second Java running on GNU/Linux, which  is faster than C++ running on Windows (Warren, 2009).</span></span></p> <p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Interpreted  languages, on the other hand, can be separated into the ones that use a  virtual machine, like Java and C# and those who don't, like JavaScript,  PHP, Perl and Python. While Java and C# compile the source code to an  intermediary level that, at runtime, is interpreted into native calls by  the virtual machine, scripting languages are not pre-compiled.  Nevertheless, it is possible to say that Java and scripting languages  have a common origin in their success, the growth of Internet (<span style="font-weight: normal;">Vinoski, 2006; Spell, 2000</span>). </span></span></p> <p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">With  the appearance of Internet, emerged the necessity to create software  applications that could be run in all the different systems the network  interconnected. This internet applications where intended to people  running many different operating systems on many different platforms  with different browsers. To resolve that problem, in the early 90s some  engineers at Sun Microsystems designed the platform-independent Java  programming language (<span style="font-weight: normal;">Spell, 2000)</span>.</span></span></p> <p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">On  the other side, interpreted scripting languages suffered a different  evolution. For example, Perl, grew out of the system administration  world and Python as an improvement to Perl, concerning PHP and  JavaScript, they were designed to work in web environments. These  languages were perfect for the constant need in the Web sites to change  frequently, because in order to perform a small change in the code, the  whole application has not to be compiled an redeployed (<span style="font-weight: normal;">Vinoski, 2006). </span></span></span></p> <p style="margin-bottom: 0cm; font-style: normal; font-weight: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Another  type of interpreted programs are languages that want to take advantages  of the scripting languages and the use of virtual machines. This  projects use the JIT compiler in the virtual machines to interpret the  scripting code. For example Jython is a Python implementation that runs  on the Java VM and IronPython is a Python implementation for the Common  Language Runtime used by C#. </span></span></p> <p style="margin-bottom: 0cm; font-style: normal; font-weight: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Concluding,  even native code execution is faster than interpreted code execution,  it might not always be the best solution. Interpreted languages can make  worth the trade-off between the loss of speed and the benefits form  interpreted languages such as less memory consumption, straightforward  cross-platform compatibility, easier deployment and maintenance and  JIT's compilers runtime optimization.</span></span></p><p style="margin-bottom: 0cm; font-style: normal; font-weight: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;"><br /></span></span></p><p style="margin-bottom: 0cm; font-style: normal; font-weight: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">src link:</span></span>&nbsp; http://www.raulvm.com/information-systems.php/2010/12/09/interpreted-vs-compiled-languages</p><p style="margin-bottom: 0cm; font-style: normal; font-weight: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;"><div><p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;"><strong>References:</strong></span></span></p> <p style="font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Bertino, E., (2000), 'ECOOP 2000--object-oriented programming', <em>14the European Conference Sophia Antipolis and Cannes, France.</em> Springer. pp. 362-363.</span></span></p> <p style="margin-bottom: 0cm; font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Brookshear, J.G., (2008). 'Computer Science: An Overview 10th  ed.', Addison Wesley. pp. 296-311.</span></span></p> <p style="font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Spell, B., (2000), 'Professional Java Programming 1st ed.', Peer Information, pp. 1-21.</span></span></p> <p style="margin-bottom: 0cm;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;"><span style="font-style: normal;"><span style="font-weight: normal;">Vinoski, S., (2006), 'The language divide', </span></span><em><span style="font-weight: normal;">Internet Computing, IEEE</span></em><span style="font-style: normal;"><span style="font-weight: normal;"> , vol.10, no.2, pp. 82- 84, March-April 2006.</span></span></span></span></p> <p style="font-style: normal;" align="JUSTIFY"><span style="font-size: small;"><span style="font-family: arial,helvetica,sans-serif;">Warren, M. R., (2009), 'C# versus C++ versus Java performance comparison', C# Architect [Online]. Available from: <a href="http://www.csharp-architect.com/">http://www.csharp-architect.com/</a> (Accessed: 2 April 2010).</span></span></p></div><br /></span></span></p></div><img src ="http://www.cppblog.com/xingzhoupku/aggbug/161906.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/xingzhoupku/" target="_blank">Venus</a> 2011-12-10 22:55 <a href="http://www.cppblog.com/xingzhoupku/archive/2011/12/10/161906.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>