bugKawa - Bugs: bug #43131, Poor support for re-defining...

 
 

bug #43131: Poor support for re-defining toplevel variables

Submitted by:  Helmut Eller <ellerh>
Submitted on:  Wed 03 Sep 2014 11:52:44 AM UTC  
 
Category: Scheme languageSeverity: 3 - Normal
Item Group: Unexpected resultStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 15 Sep 2014 07:05:07 PM UTC, comment #3:

I checked in a fix and the test-case. Thanks

It does require using the -no-inline flag, at least for now. Later I'd like to work out some better handling of re-definitions for repls and other interactive develpment. This may include tracking dependencies between functions and recompiling functions if dependencies have chaged.

I may tweak the behavior of --no-inline, but the goal is that it should support more dynamic behavior including redefinitions. Let me know if you see area where it could be improved. We may also at some point need a separate flag fo interactive modes separate from -no-inline - not sure yet.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sat 13 Sep 2014 03:18:43 AM UTC, comment #2:

I'm working on it. It's a little tricky because we have to handle multiple threads, deal with constant bindings - and it ties in with the initial bindings of the default environment - which ties in with r7rs imports and defaults.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Fri 05 Sep 2014 07:00:35 AM UTC, comment #1:

Yes, this kind a re-definition works poorly. One problem is the interaction with inlining.

Using --no-inline doesn't help - in fact it makes it worse:
version 1: 1
version 2: 1
version 3: 1
version 4: 1
version 5: 1
That seems like a bug which should be investigated.

Because of type propagation etc it difficult for redefinition to work "correctly" in general. What I'd like to do is implement a "development" mode where we keep the source (or S-expressions) for each function. We also keep track of dependencies between functions. Then if f depends on g, and g is redefined or re-compiled, then we also re-compile f.

We should also have a mode where a function can be redefined, as long as the parameter and returns types are compatible. This can be done without automatic function-level recompilation, as long as we keep the necessary indirection (without inlining). There is some code for this, but it isn't quite right. That at least could be fixed moderately easily I think.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Wed 03 Sep 2014 11:52:44 AM UTC, original submission:

This script

when executed with kawa -r7rs -f test.scm prints:

but according to R7RS 5.3.1 "Top level definitions" the result should be:

Helmut Eller <ellerh>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  • -unavailable- added by ellerh (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 15 Sep 2014 07:05:07 PM UTCbothnerStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Sat 13 Sep 2014 03:18:43 AM UTCbothnerStatusConfirmed=>In Progress
    Fri 05 Sep 2014 07:00:35 AM UTCbothnerStatusNone=>Confirmed
      Assigned toNone=>bothner

    Back to the top


    Powered by Savane 3.1-cleanup1