[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave/Matlab gcc front end?

From: John Utz
Subject: Re: Octave/Matlab gcc front end?
Date: Tue, 12 Sep 1995 21:55:25 -0700 (PDT)

Hi Niles;

A darn good idea, but probably much easier said then done :-(

On Tue, 12 Sep 1995 address@hidden wrote:

> I've seen many engineers spending lots of time converting large
> Matlab/Octave m-files into C or Ada code to make them run faster.

        I myself have actually thought of this as being the natural 
course of events.. octave, matlab/tutsim.. et all provide one with a 
chance to beat on ideas and try and quickly evaluate ( relatively 
speaking :-) ) their possiblity of success by evaluating the numerical 
and graphical results that can be easily ( again, relativly speaking :-) )
generated by these tools.

> As just as an idea, would it be possable to make an Octave front end
> for gcc so you could compile your matlab functions?

        I think this might be pretty complex. I have watched the mail 
concerning the development of the *fortran 77* ( g77 ) frontend to gcc 
and have seen the suprising degree of difficulty in getting even a 
relativly old ( 35 years, remember? ) and primitive language that was 
designed * at the outset * to have a near correspondence to native ( 
assembly ) instructions to work with gcc.

        To take a highly abstracted language such as octave and build a 
front end would be much more difficult ( in my humble and largely 
ignorant of the specific issues opinion ).

> Would it improve preformance significantly?  I would think so if there are
> many for loops. 

        Oh, heck yes! Remember, matlab and octave are * interpreters *. 
not compilers. This means that for each line the interpreter must read, 
parse and execute as opposed to reading the entire file, parsing it once, 
and spending a substantial period of time converting the hi level 
instructions into native format that, once converted, are available, in 
effect, forever in their predigested form.

        This also means that since octave has no " overall picture "
 of where the function is going ( since it is looking only at one line 
at a time ) it is unable to do all the nifty optimizations ( in 
peoplespeak : shortcuts! ) that a compiler can make since it knows the 
beginning and end of the journey, so to speak.

        Your point about loops is also well taken for the reasons stated 
in the above paragraphs, only ever so much more so!

        octave and matlab are like gwbasic or qbasic on an msdos machine, 
as opposed to quickC or QuickBasic on the same platform.

        This is why matlab has a fortran hook, and jwe has c++ hooks for 
octave planned or implemented, i forget which :-) .

> In a way this is a variation of the MEX-file concept, but
> in this way your m-file could be independent programs.
> What do you think?
>       Thanks,
>       Rick Niles.

 John Utz       address@hidden
        idiocy is the impulse function in the convolution of life

reply via email to

[Prev in Thread] Current Thread [Next in Thread]