help-octave
[Top][All Lists]
Advanced

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

Re: compiling .m files


From: John W. Eaton
Subject: Re: compiling .m files
Date: Tue, 12 Nov 2002 19:42:11 -0600

On 12-Nov-2002, Mike Miller <address@hidden> wrote:

| On Tue, 12 Nov 2002, A S Hodel wrote:
| 
| > An octave m-file compiler is one of the wish-list items out there, along
| > with a block-diagram simulation tool, symbolic math (some work done here
| > I think), etc.
| 
| I'm not quite clear on the original question.  I believe that Octave, like
| MATLAB, compiles .m functions in memory the first time they are executed.

Compiled in this case means "translated from the textual form of the
M-file to a tree representation that Octave's interpreter can handle",
not "translated to machine code that the processor can quickly
execute".

I believe Matlab now has some "just in time" compilation feature that
improves performance, and that does mean translating to native machine
code and executing, probably with the help of some run-time library
functions that do much of the work.

| If the question was about making a binary executable from an .m file so
| that the executable can be called from the command line, I assume we don't
| have that.

Right, we don't have that.

| I don't know how much faster it would be for large, time-
| consuming jobs than writing an octave script that can be called from the
| command line, compiling the needed .m files in memory and executing them
| within Octave.

It could be a lot faster, if you can determine that some variables
will only be ints, doubles, double precision matrices, etc., and not
have to worry about the possibility that a variable can hold many
different kinds of values at different times during the lifetime of
the program.  But doing that automatically is what makes writing the
compiler far from trivial.

| Certainly, unless the binary executable is to call Octave
| to get it's work done, it will usually need to have a lot of Octave
| compiled into it, no?

Some parts, probably.  It would presumably not need the interpreter,
but it would need some of the run-time library (i.e., the Matrix
classes, the solvers, and things like that which are written in
C++/C/Fortran).

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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