<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Ruby Colored Glasses</title>
	<atom:link href="http://phi.cs.indiana.edu/Andy/feed/" rel="self" type="application/rss+xml" />
	<link>http://phi.cs.indiana.edu/Andy</link>
	<description>Just another PHI Blogs weblog</description>
	<pubDate>Fri, 05 Dec 2008 21:13:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Progress 12/05/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/12/05/progress-12052008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/12/05/progress-12052008/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 21:13:46 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[weekly_goals]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=74</guid>
		<description><![CDATA[Mostly this week I&#8217;ve been focused on trying to get work done for the DSL paper deadline tonight (yikes!) and trying to find some Ruby sources that I can hand translate into a meaningful demonstration of what we&#8217;re hoping to do with the not yet working Ruby partial evaluation code.  Unfortunately this has proved [...]]]></description>
			<content:encoded><![CDATA[<p>Mostly this week I&#8217;ve been focused on trying to get work done for the DSL paper deadline tonight (yikes!) and trying to find some Ruby sources that I can hand translate into a meaningful demonstration of what we&#8217;re hoping to do with the not yet working Ruby partial evaluation code.  Unfortunately this has proved pretty difficult, since benchmark style code tends to either not allow much partial evaluation, because it is already so tightly written, or allows partial evaluation down to a single number, which I&#8217;m not sure is really a good demonstration of the technique.</p>
<p>Next week, eScience poster for Wednesday!</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/12/05/progress-12052008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Determining Safety at a Call Site</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/12/04/determining-safety-at-a-call-site/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/12/04/determining-safety-at-a-call-site/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 18:47:50 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[partial_evaluation]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=72</guid>
		<description><![CDATA[One of the really challenging things I&#8217;ve run into with the Ruby partial evaluator is determining a way to discover what the properties of a given function are at a given call site.  Specifically, I want to find what member variables are ultimately modified and what arguments (if any) are changed, and determine if [...]]]></description>
			<content:encoded><![CDATA[<p>One of the really challenging things I&#8217;ve run into with the Ruby partial evaluator is determining a way to discover what the properties of a given function are at a given call site.  Specifically, I want to find what member variables are ultimately modified and what arguments (if any) are changed, and determine if any unsafe functions are called within the context.</p>
<p>Part of what makes this really difficult is managing the session scope in the running Ruby session, while we&#8217;re running the method.  This is because we don&#8217;t really want to run the method, which is normally opaque to us, instead we want to construct an appropriate scope for the method code, and walk through the method execution, tracking at each step, what the source does.  Unfortunately constructing this scope is challenging, and complicated by things like <code>yield</code> which steps between the called method scope and the calling location scope and may be arbitrarily nested.</p>
<h4>Ruby&#8217;s Tracing Functions</h4>
<p>Earlier, I had looked at trying to use Ruby&#8217;s tracing functions to accomplish the whole task of determining what was happening.  Tracing has it&#8217;s problems of course, especially in that a given program trace may not exercise a given section of code, because we failed to feed it the correct input information, which we can really only guess at.  Similarly, the tracing information is not always rich enough to determine what exactly is going on.</p>
<h4>A Hybrid Approach</h4>
<p>I&#8217;m not sure why I hadn&#8217;t thought of this before, but it occurred to me yesterday, that we might be able to use a hybrid approach for this, where our tracing function is started when we go off to a method invocation, and used to give us information about what happens at this call site.  This frees us from having to construct the proper scope for the method invocation and single stepping, since it allows us to use the Ruby interpreter to do this work for us.  It will require a fairly fancy tracing function, because we&#8217;ll want to get back to the source code being executed, but it does free us from worrying about not tracing all code, since we will only use it for those method calls where the receiver and all arguments are already known.</p>
<p>Of course, even this approach is not without it&#8217;s limitations, and I&#8217;ve not thought through it enough to see how this might interact with traditional looping and branching constructs (i.e. if, for, while, etc.), but may provide enough support to solve one of the really difficult problems.</p>
<p>I&#8217;ve not yet had a chance to code this up (and unfortunately the end of the semester is keeping me pretty busy), but I&#8217;m hopeful that this won&#8217;t prove to be another up-hill battle!</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/12/04/determining-safety-at-a-call-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekly Goals: 12/01/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/12/01/weekly-goals-12012008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/12/01/weekly-goals-12012008/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 19:45:01 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[weekly_goals]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=70</guid>
		<description><![CDATA[Just two weeks of classes left in the semester, and much to do!  I&#8217;ve been working on the partial evaluator and also trying to put together some testing for our still underdevelopment DSL for writing tree transformations directly in Ruby.
Poster Session
Next week we have the poster session for eScience 2008, and I&#8217;ll need to [...]]]></description>
			<content:encoded><![CDATA[<p>Just two weeks of classes left in the semester, and much to do!  I&#8217;ve been working on the partial evaluator and also trying to put together some testing for our still underdevelopment DSL for writing tree transformations directly in Ruby.</p>
<h4>Poster Session</h4>
<p>Next week we have the poster session for eScience 2008, and I&#8217;ll need to get things together for a poster session.</p>
<ul>
<li>Finish up any work for the poster</li>
<li>Generate the poster</li>
<li>Get poster printed (service on campus?)</li>
</ul>
<h4>RubyWrite: Tree transformer DSL</h4>
<p>In order to help out with a write up of the tree transformer DSL that we&#8217;ve been working on (and my advisor has been implementing),  I&#8217;ve been working on implementing constant propagation and folding for a simple imperative language.</p>
<ul>
<li>Implement constant propagation and folding for branches (if) and looping (while)</li>
<li>Implement constant propagation and folding for arrays</li>
<li>Test out with a few programs</li>
</ul>
<h4>Ruby Partial Evaluation</h4>
<p>Finally, I continue to make slow progress on the Ruby constant propagation. I&#8217;d like to get this to a point where we can make some tests of it this week, because I&#8217;d especially like to be able to put something on the poster for eScience 2008, but realistically with everything else going on, I&#8217;m not sure I&#8217;ll be able to get it to that point.</p>
<ul>
<li>C-base Ruby session management
<ul>
<li>Finish implementing proper handling of method scope for determining method safety</li>
<li>Implement session handling for swapping scopes to accommodate block/yield</li>
</ul>
</li>
<li>Stratego/XT Safety Decision Maker
<ul>
<li>Special handling for <code>new</code> calls</li>
<li>Implement Stratego/XT side of session handling</li>
<li>Finish handling other Ruby node-types</li>
<li>Normalize safety information</li>
</ul>
</li>
<li>Stratego/XT Partial Evaluator - simple evaluator using safety information</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/12/01/weekly-goals-12012008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Last week at SC08</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/11/24/last-week-at-sc08/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/11/24/last-week-at-sc08/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 17:47:55 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[Conferences]]></category>

		<category><![CDATA[Chapel]]></category>

		<category><![CDATA[PGAS]]></category>

		<category><![CDATA[sc08]]></category>

		<category><![CDATA[UPC]]></category>

		<category><![CDATA[X10]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=68</guid>
		<description><![CDATA[Last week, my colleagues and I, along with our advisor, headed down to SC08 the 20th anniversary of the annual SuperComputing conference.  The conference is huge (they claim 10,000 people attended) and covers everything from new parallel programming paradigms to new high performance computing architectures to new techniques for scientific computing, and there are [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, my colleagues and I, along with our advisor, headed down to <a href="http://sc08.supercomputing.org/">SC08</a> the 20th anniversary of the annual SuperComputing conference.  The conference is huge (they claim 10,000 people attended) and covers everything from new parallel programming paradigms to new high performance computing architectures to new techniques for scientific computing, and there are exhibitors there from traditional vendors like Sun, SGI, and Microsoft, to universities like Indiana University, to national labs like Oak Ridge and Los Alamos.  There is so much to do there, it is hard to decide which talks to attend, when to skip out and visit the exhibits, or when to go to the other various interesting talks, workshops what have you.  All of that said, I wanted to highlight a couple of things I found particularly interesting.</p>
<h4>PGAS</h4>
<p>Partitioned Global Address Space (PGAS) programming is a different programming paradigm that sort of spans the difference between shared memory programming (like Pthreads/OpenMP) and message passing programming (like MPI).  It instead allows you to treat memory as if it was shared (like shared memory), but gives you control over the &#8220;affinity&#8221; of that memory for a given process.  This means you are aware of what process a block of memory likely lives in, and have the ability to move it locally, perform operations on it in parallel, and in some of the PGAS languages operate with processes as &#8220;teams&#8221; on the data.</p>
<p>All of this is pretty cool, but two things really stuck out.  The first, is that the most mature of the PGAS languages Unified Parallel C (UPC) is implemented as a handful of extensions on top of ISO C99, and hence it might be possible to roll a version of Ruby that could take advantage of concepts from PGAS by compiling Ruby using UPC, and writing a UPC extension to all for experimenting with Ruby PGAS.
<p>The other thing I thought was really interesting about the PGAS languages, are that two of the languages (X10 from IBM and Chapel from Cray) are targeted at high productivity and both provide some concept of object-oriented programming along with closures, making them a great deal more flexible then the traditional Fortran or C/C++ with MPI.</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/11/24/last-week-at-sc08/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekly Goals: 11/24/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/11/24/weekly-goals-11242008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/11/24/weekly-goals-11242008/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 17:11:13 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[weekly_goals]]></category>

		<category><![CDATA[partial_evaluation]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=65</guid>
		<description><![CDATA[This week is a short week, since we&#8217;ve got off for Thanksgiving the last half of the week, and I&#8217;m heading home to Connecticut to visit the folks.  That said, I still hope to make some progress this week on the partial evaluator, since the poster deadline for eScience 2008, is drawing nigh.
Partial Evaluator
My [...]]]></description>
			<content:encoded><![CDATA[<p>This week is a short week, since we&#8217;ve got off for Thanksgiving the last half of the week, and I&#8217;m heading home to Connecticut to visit the folks.  That said, I still hope to make some progress this week on the partial evaluator, since the poster deadline for eScience 2008, is drawing nigh.</p>
<h4>Partial Evaluator</h4>
<p>My number one priority this week is getting the basics of the safety checking working for methods, and finishing the parts of the partial evaluator that will let me walk a full Ruby AST. The list of the work to be done, more or less in order, though some of the more advanced handling may be done after a first pass of the partial evaluator is finished for simpler cases.
<ul>
<li>Safety check
<ul>
<li>Safety checking of <code>initialize</code> methods for newly created objects</li>
<li>Safety checking of non-initialize methods for existing objects and their parameters</li>
<li>&#8220;Kill list&#8221; for variables that have not yet gone out of scope in the Ruby session, but can no longer be used because they may have been changed by an unsafe expression</li>
<li>Finish tree-walking for other node types, including handling of branching and looping</li>
<li>Special handling for non-<code>new</code> initializers</li>
<li>Special handling for <code>require</code> and <code>load</code> and code that calls it</li>
</ul>
</li>
<li>Simple partial evaluator
<ul>
<li>Evaluate safe statements once (and only once)</li>
<li>Output evaluated versions of anything that results in a literal</li>
<li>Dead code elimination step, after partial evaluation</li>
</ul>
</li>
</ul>
<p>While I probably will not be able to get all of this done, I&#8217;d at least like to get the basic safety parts working for full Ruby ASTs under the assumption that <code>require</code> and <code>load</code> will not be called.</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/11/24/weekly-goals-11242008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Progress 11/14/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/11/14/progress-11142008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/11/14/progress-11142008/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 20:35:39 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[weekly_goals]]></category>

		<category><![CDATA[partial_evaluation]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=63</guid>
		<description><![CDATA[Slow progress this week.  I can&#8217;t really point to anything inparticular, but I just had trouble getting focused and getting things done this week.  Not having my MacBook Pro, also put me a bit off beat as I&#8217;m just so used to it as my development environment.
Fellowship Applications
I did finish up my fellowship [...]]]></description>
			<content:encoded><![CDATA[<p>Slow progress this week.  I can&#8217;t really point to anything inparticular, but I just had trouble getting focused and getting things done this week.  Not having my MacBook Pro, also put me a bit off beat as I&#8217;m just so used to it as my development environment.</p>
<h4>Fellowship Applications</h4>
<p>I did finish up my fellowship applications, with the exception of getting information to my reviewers which I should get done tonight.</p>
<h4>Ruby Partial Evaluator</h4>
<p>I haven&#8217;t really made much progress on this, though I did get a chance to start working on this again a little today. In reflecting on it a little bit, I had mentioned treating calls to <code>new</code> special in two ways:</p>
<ol>
<li>We need to check the <code>initialize</code> function for the implementation, rather then <code>new</code></li>
<li>We can allow code in <code>initialize</code> (or functions it calls) to set instance variables on the newly created object</li>
</ol>
<p>The second condition here though, I think could be broader.  Since any method call can potentially add a new instance variable, I think it may be helpful to maintain a hash of the defined instance variables for a given instance of a class, and always allow the first assign to go without counting it as a modification (since it is really just an extension of the object, rather then a modification of its state).  I think this will give us more precise information, though it may make it a little more difficult to be precise about this, since it is not uncommon to have initializer methods other then <code>new</code> or methods that add new instance variables the first time they&#8217;re called.</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/11/14/progress-11142008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekly Goals: 11/10/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/11/10/weekly-goals-11102008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/11/10/weekly-goals-11102008/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 15:50:19 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[weekly_goals]]></category>

		<category><![CDATA[partial_evaluation]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=59</guid>
		<description><![CDATA[Ruby partial evaluation is the focus this week, with just a little bit of work to finish up for fellowship applications before I get started on this.
Fellowship Applications

Send references requests off, with a packet of the information I had sent off to NSF
NPSC Fellowship Application

Finish up these essays, largely rewriting and polishing at this point
Complete [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby partial evaluation is the focus this week, with just a little bit of work to finish up for fellowship applications before I get started on this.</p>
<h4>Fellowship Applications</h4>
<ul>
<li>Send references requests off, with a packet of the information I had sent off to NSF</li>
<li>NPSC Fellowship Application
<ul>
<li>Finish up these essays, largely rewriting and polishing at this point</li>
<li>Complete their online forms</li>
<li>Put together an equivalent packet for my reference writers for this stuff as well</li>
</ul>
</li>
</ul>
<h4>Ruby Partial Evaluation</h4>
<ul>
<li>Finish code that extracts properties of a method call (specifically constant, global, class, and instance variables modified or referenced, methods called, and which methods are called on objects passed in as arguments)</li>
<li>Use properties of method call for special casing <code>new</code> method call (i.e. have it look at <code>initialize</code></li>
<li>Begin working on algorithm for determining which side-effects we can partial evaluate, and which will need to wait for runtime.</li>
<li>Create simple partial evaluator that uses the safety information from the offline analysis to create the partially evaluated code.</li>
</ul>
<h4>Sad Mac News</h4>
<p>Also, in sad mac news, my MacBook Pro started to randomly kernel panic on me over the weekend and by Sunday afternoon, was pretty consistent at dieing after 10-15 minutes of up time (at this point it is even less!)  So I&#8217;m a little off schedule from this weekend.  On the plus side, I didn&#8217;t loose anything, as I&#8217;ve pulled stuff I&#8217;ve been working on recently onto my home Linux server, and I&#8217;ve got AppleCare on the laptop, so hopefully they&#8217;ll be able to fix me up.  Still, sad not to have a working laptop!</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/11/10/weekly-goals-11102008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Progress: 11/07/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/11/07/progress-11072008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/11/07/progress-11072008/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 19:50:51 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[weekly_goals]]></category>

		<category><![CDATA[partial_evaluation]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=57</guid>
		<description><![CDATA[It was a busy week, this week, but I managed to make progress on both fellowship and Ruby partial evaluation implementation
Fellowships
It was a little down to the wire, but I managed to get my NSF Graduate Student Fellowship application in.  The NPSC folks, extended the deadline by a week, so I&#8217;ll be finishing that [...]]]></description>
			<content:encoded><![CDATA[<p>It was a busy week, this week, but I managed to make progress on both fellowship and Ruby partial evaluation implementation</p>
<h4>Fellowships</h4>
<p>It was a little down to the wire, but I managed to get my NSF Graduate Student Fellowship application in.  The NPSC folks, extended the deadline by a week, so I&#8217;ll be finishing that up over the weekend.</p>
<h4>Ruby Partial Evaluation</h4>
<p>I&#8217;ve started working again on the Ruby partial evaluator, specifically focusing on the safety analysis piece of this code.  I&#8217;ve gotten back to roughly the point where I was before, starting to look at extracting the properties of a function call at a given call site in order to figure out if it is safe or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/11/07/progress-11072008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Weekly Goals: 11/03/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/11/03/weekly-goals-11032008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/11/03/weekly-goals-11032008/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 18:34:46 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[weekly_goals]]></category>

		<category><![CDATA[partial_evaluation]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=55</guid>
		<description><![CDATA[For the first half of this week, I&#8217;ll be primarily focused on finishing a couple of fellowship applications that are both due this Wednesday, after that I&#8217;ll be getting back to work on the partial evaluator, with our revised algorithm
Fellowship Applications

Write application essays
Finish filling out application sheets (by Wednesday)

Partial Evaluator

Start work on iterative analysis to [...]]]></description>
			<content:encoded><![CDATA[<p>For the first half of this week, I&#8217;ll be primarily focused on finishing a couple of fellowship applications that are both due this Wednesday, after that I&#8217;ll be getting back to work on the partial evaluator, with our revised algorithm</p>
<h4>Fellowship Applications</h4>
<ul>
<li>Write application essays</li>
<li>Finish filling out application sheets (by Wednesday)</li>
</ul>
<h4>Partial Evaluator</h4>
<ul>
<li>Start work on iterative analysis to determine which expressions are safe to evaluate and which are not
<ul>
<li>Initial pass: data-flow analysis to setup known variables/objects and initial method call safety list</li>
<li>Iterative pass: using discovered data, extend safety to new expressions, and re-evaluate</li>
</ul>
</li>
</ul>
<p>At a guess it will be at least next week before I get a chance to begin implementing the partial evaluator that uses this data, even if the safety analysis tool goes fairly smoothly, but once the safety stuff is working, it should make the partial evaluation run relatively quickly.</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/11/03/weekly-goals-11032008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Progress: 10/31/2008</title>
		<link>http://phi.cs.indiana.edu/Andy/2008/10/31/progress-10312008/</link>
		<comments>http://phi.cs.indiana.edu/Andy/2008/10/31/progress-10312008/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 19:32:10 +0000</pubDate>
		<dc:creator>akeep</dc:creator>
		
		<category><![CDATA[weekly_goals]]></category>

		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://phi.cs.indiana.edu/Andy/?p=53</guid>
		<description><![CDATA[A bit of a slow week this week, but I did make at least a little bit of progress on my two goals for the week.
Fellowship Applications
Unfortunately, I didn&#8217;t get a lot done this week.  I realized on Tuesday night, that the fellowships I&#8217;m applying for are due on the 5th not the 9th, [...]]]></description>
			<content:encoded><![CDATA[<p>A bit of a slow week this week, but I did make at least a little bit of progress on my two goals for the week.</p>
<h4>Fellowship Applications</h4>
<p>Unfortunately, I didn&#8217;t get a lot done this week.  I realized on Tuesday night, that the fellowships I&#8217;m applying for are due on the 5th not the 9th, so I&#8217;ve been mostly focused on getting these applications ready, though I&#8217;ve still got quite a bit to do on that front before I&#8217;m finished.</p>
<h4>Ruby Partial Evaluator</h4>
<p>While I didn&#8217;t get a chance to look much at the coding aspects of this, I did have a very good conversation about how to approach this with my advisor, and once my fellowship applications are ready, I&#8217;m looking forward to getting back to this.</p>
<p>The basic idea is pretty straight forward, we&#8217;re going to treat determining the safety of running expressions in Ruby as an iterative data-flow analysis problem.</p>
<ul>
<li>Initial pass</li>
<ul>
<li>A Ruby session, with fresh scope will be started</li>
<li>Assignments of literals will be evaluated in the session</li>
<li>Assignments of newly created objects will be evaluated, if no global or class variables are accessed, or functions called (other then known safe functions)</li>
<li>The <code>require</code> and <code>load</code> functions (and methods that call them) will need special treatment to properly handle library inclusion.</li>
<li>All other method calls will be evaluated into one of three categories</li>
<ul>
<li>Safe: No global, class, or instance variables accessed, and only known safe functions are called</li>
<li>Unsafe: A known unsafe method is called</li>
<li>Unresolved: Global, class, or instance variables are accessed, or unresolved functions are called, then an annotation is added to list the global, class, or instance variables set or read, and the methods called by each, along with what arguments are updated (if known) or what methods are called on these</li>
</ul>
</ul>
<li>Iterative Pass</li>
<ul>
<li>The current Ruby session scope is thrown away, and a fresh one established</li>
<li>The same assignments are originally computed are performed, along with any new method calls determined safe</li>
<li>Once a method is determined to only be unsafe because of modifying variable state, we look to prove that these modifications can be propagated to all method calls referencing a given global, class, or instance variable, and can all be executed.</li>
<li>Now that more methods can be executed, more information is known about the program, and it can be refined</li>
<li>Once no more refinements can be made (i.e. a fixed-point is reached) we stop, the result is the original AST annotated with what is and is not safe</li>
</ul>
</ul>
<p>Once the basics are implemented, we&#8217;re hoping to extend this method to handle things like libraries and partial evaluation within methods, where properties (such as core library method definitions) hold.</p>
]]></content:encoded>
			<wfw:commentRss>http://phi.cs.indiana.edu/Andy/2008/10/31/progress-10312008/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
