<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:12pt">Hello everyone.<br><br>Even though I am no expert in the field of compilers and interpreters I would like to share some thoughts and observations.<br><br>Matlab does have a compiler. The compiler is a separate toolbox  and more expensive than Matlab itself or any other toolbox. However, a compiled program does not run faster than the interpreted program run in Matlab. Maybe a compiled program is a little faster if Matlab is not installed and therefore does not occupy any resources such as RAM and disk space. <br><br>There is another interesting effect: a function called for the first time during a session runs much slower than during all consecutive runs. So it seems that the interpreter translates the source code into some intermediate code. A function that runs on the Matlab level can access the
 resources of the basis software such as work space and it can display outputs on the basis software console. This would be completely impossible if the function were compiled as a stand alone program. Running selected parts of a script or function also requires interpreted code.<br><br>It is possible to call compiled programs written in C from Scilab, Matlab or Mathematica. However, these programs usually must exchange data with the basis software or functions calling these programs. It takes time to copy huge amounts of data or to write them to and read them from disk. Therefore, it is not desirable to compile each and any function as a separate program. A compiler is necessary for stand alone software, but not for functions run inside numerical software.<br><br>Stand alone programs are often written in C or C++. There are a lot of libraries written in these languages. Moreover, there are some wide spread development environments for C and C++.
 Embedded Matlab, Simulink and XCos can generate C code. Maybe there will be something like embedded Scilab to create C code in the future. Therefore, it is possible to combine the advantages of interpreted numerical software and fast C programs.<br><br>For these reasons, I conclude that numerical software will continue to run interpreted code for the time being.<br><br>Best regards<br>Harald Galda, Dr. Eng. (J)<br><div><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 12pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">Von:</span></b> Pedro Ledoux <p_ledoux@yahoo.com.br><br><b><span style="font-weight: bold;">An:</span></b> users@lists.scilab.org<br><b><span style="font-weight: bold;">Gesendet:</span></b> Samstag, den 2. Oktober 2010, 4:01:50 Uhr<br><b><span style="font-weight: bold;">Betreff:</span></b>
 [scilab-Users] Why an interpreter?<br></font><br><meta http-equiv="x-dns-prefetch-control" content="off"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">Hello everyone.<br><br>Scilab, Matlab, Octave and others softwares of this kind uses an interpreter not a compiler. Is there any specific rason to do it? I don't know deeply the technical details about interpreters and compilers but i've become curious about it. In long interative process a compiled code runs much more faster because in a interpreter to each interation the language commands should be converted to machine language and in a compiled one it happens only one time when the object code is generated. Was told me that in a interpreter debug is more easy. So why those everyoments chose do numerical process by an interpreted language?<br></td></tr></tbody></table><br>



       <meta http-equiv="x-dns-prefetch-control" content="on"></div></div>
</div><br></body></html>