AW: [scilab-Users] Why an interpreter?
Harald Galda, Dr. Eng. (J)
haraldgalda at yahoo.com
Sat Oct 2 14:44:18 CEST 2010
Hello everyone.
Even though I am no expert in the field of compilers and interpreters I would
like to share some thoughts and observations.
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.
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.
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.
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.
For these reasons, I conclude that numerical software will continue to run
interpreted code for the time being.
Best regards
Harald Galda, Dr. Eng. (J)
________________________________
Von: Pedro Ledoux <p_ledoux at yahoo.com.br>
An: users at lists.scilab.org
Gesendet: Samstag, den 2. Oktober 2010, 4:01:50 Uhr
Betreff: [scilab-Users] Why an interpreter?
Hello everyone.
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20101002/a0948def/attachment.htm>
More information about the users
mailing list