Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Caching SOA

Received: by 10.14.2.130 with SMTP id 2mr11439848eef.1.1346520309215;
        Sat, 01 Sep 2012 10:25:09 -0700 (PDT)
X-BeenThere: rope-dev@googlegroups.com
Received: by 10.14.209.195 with SMTP id s43ls1482317eeo.5.gmail; Sat, 01 Sep
 2012 10:25:08 -0700 (PDT)
Received: by 10.14.205.5 with SMTP id i5mr11436174eeo.5.1346520308673;
        Sat, 01 Sep 2012 10:25:08 -0700 (PDT)
Received: by 10.14.205.5 with SMTP id i5mr11436173eeo.5.1346520308660;
        Sat, 01 Sep 2012 10:25:08 -0700 (PDT)
Return-Path: <aligr...@gmail.com>
Received: from mail-ee0-f51.google.com (mail-ee0-f51.google.com [74.125.83.51])
        by gmr-mx.google.com with ESMTPS id v3si10788422eep.1.2012.09.01.10.25.08
        (version=TLSv1/SSLv3 cipher=OTHER);
        Sat, 01 Sep 2012 10:25:08 -0700 (PDT)
Received-SPF: pass (google.com: domain of aligr...@gmail.com designates 74.125.83.51 as permitted sender) client-ip=74.125.83.51;
Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of aligr...@gmail.com designates 74.125.83.51 as permitted sender) smtp.mail=aligr...@gmail.com; dkim=pass header...@gmail.com
Received: by eeke50 with SMTP id e50so1252302eek.10
        for <rope-dev@googlegroups.com>; Sat, 01 Sep 2012 10:25:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:subject:message-id:in-reply-to:references
         :user-agent;
        bh=3kjWo06rlqFUW4JHQbigJWm+S+IWJGZCzBCIeXY7DQk=;
        b=TDp3vrn1LGtDXf7X3GYjBCuZxn4qc/PNB6uz0kWoFXVcDsuM/gnGH81mgk3Z1weQ7/
         IjDMG2M8WB6YH+d5dcyXgasGjalMJXgL5Cb39L0Q11oLX/hAcnUtTHsjN8S4JE77lJv9
         zsf5sroFwYsv0MD5q5rm9gp70grylstUTrvI5UflVGpfIuJ9DBwW4cPwGnCyJkZOIO94
         hVsXh0WpqhOrKd+u3TmJ8olehbxORjYg0VMvBdw0TsqZ2tJntouGjDTUwqYytIKcc22F
         Q6ILOCSFjQOQTB8pbfwmWAIfbl/+seKoYClLK0Zk5fJLWqPFcvDMDx2A0YpAb77PhCQM
         g9cQ==
Received: by 10.14.224.4 with SMTP id w4mr15357967eep.21.1346520308524;
        Sat, 01 Sep 2012 10:25:08 -0700 (PDT)
Return-Path: <aligr...@gmail.com>
Received: from lilem.mirepesht ([2.191.75.209])
        by mx.google.com with ESMTPS id i41sm22334821eem.7.2012.09.01.10.25.06
        (version=SSLv3 cipher=OTHER);
        Sat, 01 Sep 2012 10:25:08 -0700 (PDT)
Date: Sat, 01 Sep 2012 21:54:40 +0430
From: Ali Gholami Rudi <aligr...@gmail.com>
To: Joseph Schorr <jsch...@gmail.com>
Cc: rope-dev@googlegroups.com
Subject: Re: Caching SOA
Message-ID: <20120109215...@lilem.mirepesht>
In-Reply-To: <1c4648cb-9be3-44fd-8bdf-dce659eddf7e@googlegroups.com>
References: <89aca98b-2f2a-4987-8025-4829905f3462@googlegroups.com>
 <20123108122...@lilem.mirepesht>
	<1c4648cb-9be3-44fd-8bdf-dce659eddf7e@googlegroups.com>
User-Agent: git://repo.or.cz/mailx.git

Joseph Schorr <jsch...@gmail.com> wrote:
> I'd be willing to implement this import/export (since it would solve my 
> problems), if you could point me in the right direction.

On second thought, it may be a bit more involved that what I initially
thought.  I'll explain the main challenges.

First of all, I think the most important question is what kind of type
information should be included and what format should be used.  In rope
two kinds of object data are stored: function calls and the contents
of container types (more information later).  Are we going to include
both of them?

For the format, we can represent references based on their module and
containing scopes.  But how to represent built-in container types (like
tuples containing ints)?  For example, a function returning a tuple
containing an int and a str:

  (int, str) mod.Class.func(mod.Class(), int)

Question:
* What to include?
* The format

How rope does it?
-----------------

Most of rope's object inference is implemented in rope/base/oi/.  In what
follows, I'll describe the related files in this folder (forgive the
lack of organization).

* objectdb.py: stores textual object data in rope's objectdb file.
* transform.py: converts rope's internal types, references and objects
  to a textual format for storing in objectdb.  It also transforms the
  textual format to rope types when loading object data from objectdb.
  The format may not be ideal for our purpose but works as a good
  example of how it can be done.
* objectinfo.py: manages rope's objectdb.py, transform.py, looks up
  data in objectdb, and validates the data in objectdb.

objectdb stores only simple python types like tuples and strings.  But in
rope, types and references are represented as PyObjects and PyNames
(have a look at rope/base/pyobjects*.py and rope/base/pynames*.py).
So objectinfo.py converts rope's internal types to textual format using
transform.py.

objectdb.py stores two types of data: callinfos (see add_callinfo()
and get_callinfos() methods of objectdb) that describe a function call,
i.e. its type of parameters and its return value.  The path argument is
the file that contains the called function.  The key parameter describes
the function; for instance, it can be "C.g.f" for the local function f
in the method g of class C, AFAICR.

The other type of data stored in objectdb is pernames, which is mostly
used for storing what is inside built-in container types (have a look
at the calls to save_per_name() and get_per_name() in builtins.py).

ObjectInfoManager in objectinfo.py manages callinfo and pername data.
For instance, the get_returned() method looks up the return value
of a function call with the given arguments.

Implementing the import/export functionality:
A method can be added to PyCore in rope/base/pycore.py to import (or
export) the files in our data format.  It can read the input files
and call the appropriate methods of objectdb.  For exporting, a
new function should be added to objectdb to fetch type data.

Questions:
* Should we convert the input format to rope's PyObjects and
  PyNames and use objectinfo.py, or should we add them
  directly to objectdb.py.
* Should the new format replace the one rope uses internally?

	Ali