AW: [scilab-Users] Why an interpreter?

Constellation Athome constellationathome at googlemail.com
Sun Oct 3 01:55:57 CEST 2010


Hi,

as Sumit Adhikari said, for some cases interpreted scriptcode can be more
flexible because you can add changes more easily and see a quick and dirty
result.
I experienced, that it's sometimes nice not to think about how to code to do
it as fast/efficient as possible, when you want to use external datas like
formulas. For example I wanted to add formulas that describe the atmosphere.
I also have done that with CSV values and interpolate the steps in between,
but those files are hugh. If you can just use formulas it's faster and more
precise. But how to teach a compilation code to interprete those external
stored formulas? Luckily a friend coded something for my javacode that
offers what I needed, but that was difficult to code. This wouldn't have
happend with scripted languages, because there is no difference between
scripted sourcecode or external "library" data, both are handled almost the
same.

Greetings,

Andreas Hornig
--------------
AerospaceResearch.net/Constellation

2010/10/2 Sumit Adhikari <sumit.adhikari at gmail.com>

> It is very simple. How do u want to see your result of 5 + 3 = ? . Do you
> want to write a program and then save it and then compile it and then run it
> to see the result ?
> Best way to do such operation is a shell. Thats why these programs are
> shell and also an interpreted language so that you can load a particular
> functions for
> for this purpose. It is only user perspective.
> Regards
>
> P.S : If you want to run simulations then compiled codes are good, but for
> algorithm design this is possibly the best way.
>
>
> On Sat, Oct 2, 2010 at 3:18 PM, Pedro Ledoux <p_ledoux at yahoo.com.br>wrote:
>
>> About compiled languages the best alternative for numerical methods is
>> Fortran standart 95. Unlike C and othe common languages, Fortran is
>> dedicated to numerical aplications thus it's intrinsic functions are almost
>> dedicated to it. In common languages like C, Pascal etc you have Integer and
>> real types. Fortran gives you integer, real and complex. All math functions
>> like sin, sqrt etc are completly ready to support complex type.
>>
>> Fortran 95 was an great advance compared with Fortran 77. To turn the
>> things more easy to numerial implemetation Fortran let you manipulate a
>> vector with 1 line of command, ex: v=cos(i) will turn each element of vector
>> v in the cossine of each element of vector i, in a conventional language
>> you'd have to use a loop to do it.
>>
>> Fortran 95 has incorporated also commands for high performance and
>> paralelization. When you do something in a loop for i=0:1:10 you says to
>> computer that this process must run in order, first for i=0, i=1 i=2 etc. In
>> Fortran 95 the command Forall acts in a way like for however you says to
>> computer thar the process can be done in any order, as consequence it can
>> run in more than one CPU if possible.
>>
>> Was told thar Scilab let you use Fortran code in the same way as C code.
>>
>> --- Em *sáb, 2/10/10, Harald Galda, Dr. Eng. (J) <haraldgalda at yahoo.com>*escreveu:
>>
>>
>> De: Harald Galda, Dr. Eng. (J) <haraldgalda at yahoo.com>
>> Assunto: AW: [scilab-Users] Why an interpreter?
>> Para: users at lists.scilab.org
>> Data: Sábado, 2 de Outubro de 2010, 9:44
>>
>>
>> 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?
>>
>>
>>
>>
>>
>
>
>
>
> --
> Sumit Adhikari,
> Institute of Computer Technology,
> Faculty of Electrical Engineering,
> Vienna University of Technology,
> Gußhausstraße 27-29,1040 Vienna
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20101003/52bddd5f/attachment.htm>


More information about the users mailing list