octave-maintainers
[Top][All Lists]
Advanced

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

Re: JIT - automated mexing


From: Judd Storrs
Subject: Re: JIT - automated mexing
Date: Wed, 28 Jul 2010 17:00:43 -0400

On Wed, Jul 28, 2010 at 5:25 AM, Jaroslav Hajek <address@hidden> wrote:
Don't you feel it's just simpler to use the C++ API?

To be fair, if it was "just simpler" to use the C++ API, then automatic translation of m files to C++ API-based code would be simple, too. Right?

I think the idea of markup is interesting, but maybe there are probably better ways of achieving useful type information than marking up the entire code stack with type contracts. Perhaps by tracing parameter types while executing the m-code in a special mode. In any case, because the language itself is dynamically typed and does not include type information in function declarations, it will always be very easy to invent nasty functions. For example a function that changes return types based on the output of a random number generator. On the other hand, I think what Alexander is suggesting is that something simple may work for many real-world cases. It would put the onus on the user to structure their code to avoid nasty functions similar to how currently it is the user's responsibility to vectorize.

In any case it seems to me that whether the type annotation ultimately comes from manually marked-up code/declarations or is automatically generated by profiling, the mex translation step should be nearly identical. i.e. if the auto-mex works based in input of type-annotated code, octave could very likely be modified to output type-annotated code in a profiling mode.


--judd

reply via email to

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