help-octave
[Top][All Lists]
Advanced

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

Re: Is there a command that shows the C-code the interpreter creates?


From: Ian McCallion
Subject: Re: Is there a command that shows the C-code the interpreter creates?
Date: Thu, 18 Apr 2019 08:20:12 +0100

On Thursday, 18 April 2019, GoSim <address@hidden> wrote:

Every m-file variable is turned in to many static m-file variables, not
C-file variables.

I don't think this works. How for example would it cope with:

    if condition
       A = 1;
    else 
       A = "1";
    end

    B = A;

By nature an untyped interpretive language starts to fail when inner loops need executing many times and arguably it is a shame that at those points it is necessary for performance to switch to a different language and IDE.  So here is an alternative approach to address this particular issue - a language extension to bracket the code needing compilation. For example:

function x()
  Octave code
  compile
     (Octave code with language restrictions)
  endcompile
  More octave code
endfunction

The code would be compiled and cached when the containing function is first encountered. You could start with some severe language restrictions (eg only numeric data and for loops) as proof of concept.  

Cheers... Ian

reply via email to

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