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: Andrew Janke
Subject: Re: Is there a command that shows the C-code the interpreter creates?
Date: Wed, 17 Apr 2019 18:44:23 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1


On 4/17/19 6:11 PM, Nicholas Jankowski wrote:
> On Wed, Apr 17, 2019 at 5:13 PM GoSim <address@hidden
> <mailto:address@hidden>> wrote:
> 
>     So basically every m-file-variable becomes many C-file-variables. It
>     changes
>     name everytime it changes type. The names and types are stored and
>     these are
>     used to create runnable code.
> 
> 
> how well would that scale? we often have people generating
> approaching-memory-limit sized data.  
> 
> 

I believe this could be done automatically, and if you placed some
limits on the use of assignin(), evalin(), and eval() (probably
forbidding them outright like GoSim says), it would have the same memory
use properties as existing code, because you could just automatically
clear the variables immediately after their last reference. (Of course,
you'd have to implement your own reference counting if you weren't
simply using octave_value objects for everything; and if you're still
using octave_value objects for everything, than what's the point of
converting to C? This also begs the question of what data structures you
_would_ use to represent arrays, and how you would pass them to all the
existing Octave functions that take Octave Array objects.)

This is a known approach called Static Single Assignment.
https://en.wikipedia.org/wiki/Static_single_assignment_form

It would probably be heck of hard to do to this based on the existing
bison/yacc approach instead of an IR that you could transform
programmatically. My guess is this would be like a year or more of work
for an experienced compiler hacker.

Cheers,
Andrew



reply via email to

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