octave-maintainers
[Top][All Lists]
Advanced

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

Re: Octave compiler


From: Paul Thomas
Subject: Re: Octave compiler
Date: Sun, 22 Feb 2004 19:51:45 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Yes, that is what I was getting at - or explicit type declaration. I had more than once wondered if the language would benefit from optional type assertion in some shape or form. This, however, brings to mind the discussion,a few months back, of passing arguments by reference or by value. Compatability with the other product makes them very undesirable. Equally, to judge by the other products performance on basic interpretation/evaluation, intelligence must exist..... I have started analysing typical .m functions to see how intelligence might be manifested in either interpreters or compilers.

Paul T

Paul Kienzle wrote:

In lieu of intelligence, one can always use pragmas to identify types.
E.g.,
    %% int i
    %% double t, x[]
    t=0; for i=1:n, t += x(i); end

You can even do this in octave code instead of special syntax:

    x=double(x);
    t=double(0); for i=int(1:n), t += x(i); end

but you need some way to make sure that double, int, etc. always
return values of the right type, even in the presence of dispatch, oct
files, user defined types, etc.

- Paul
On Feb 22, 2004, at 10:46 AM, Paul Thomas wrote:

JD and Jens,

Have you given any thought yet as to how you will do the C++ generation?
I suppose that a first order approach would be, in essence, to output the octave evaluator code. However, I suspect that the performance improvement over that of the interpreter/evaluator will not be as impressive as writing .oct files "by hand". Therefore, the trick is going to be to improve on the evaluator, particularly where type identification, indirect referencing and bound checking is concerned. Once you do that, the strategy you have adopted should allow to similarly improve octave's evaluator, should it not?

Paul Thomas







reply via email to

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