==== Channel ##pypy: 03/12/05 ====

[00:20] stakkars (hvdghgt@i3ED6B329.versanet.de) joined #pypy.

----- silence for 50 minutes -----

[01:10] Continuity (kittish@host81-156-154-23.range81-156.btcentralplus.com) left irc: Remote closed the connection

----- silence for 1 hr and 13 minutes -----

[02:23] pedronis (~Samuele_P@c-1e8b70d5.022-54-67626719.cust.bredbandsbolaget.se) left irc: "Chatzilla 0.9.66 [Mozilla rv:1.7.5/20041107]"

[02:29] dialtone (~dialtone@host116-56.pool80117.interbusiness.it) left irc: Read error: 60 (Operation timed out)

[02:42] stakkars (hvdghgt@i3ED6B329.versanet.de) left irc: Read error: 113 (No route to host)

----- silence for 1 hr and 14 minutes -----

[03:56] Jerub (~gideon@CPE-203-45-251-238.qld.bigpond.net.au) left irc: "Lost terminal"

----- silence for 4 hr and 44 minutes -----

[08:40] esteban (esteban@DWM-59-231.go.retevision.es) left #pypy.

----- silence for 2 hr and 5 minutes -----

[10:45] dialtone (~dialtone@host116-56.pool80117.interbusiness.it) joined #pypy.

----- silence for 2 hr and 33 minutes -----

[13:18] pedronis (~Samuele_P@c-1e8b70d5.022-54-67626719.cust.bredbandsbolaget.se) joined #pypy.

----- silence for 3 hr and 53 minutes -----

[17:11] arigo (~arigo@d83-176-36-251.cust.tele2.ch) joined #pypy.

[17:12] <arigo> hi

----- silence for 42 minutes -----

[17:54] stakkars (~tismer@82.144.60.19) joined #pypy.

[17:55] stakkars (~tismer@82.144.60.19) left irc: Client Quit

[17:56] <mwh> arigo: hi!

[18:01] <pedronis> hi

[18:06] <arigo> back in a minute (hopefully)

[18:06] stakkars (~tismer@82.144.60.19) joined #pypy.

[18:08] arigo (~arigo@d83-176-36-251.cust.tele2.ch) left irc: Read error: 60 (Operation timed out)

[18:18] <mwh> oh

[18:18] <mwh> i won't be...

[18:23] arigo (~arigo@d83-176-36-251.cust.tele2.ch) joined #pypy.

[18:26] <mwh> arigo: have you had a chance to look at my mro patch yet?

[18:26] <arigo> pedronis: apparently translate_pypy0's only use of setattr on PBC is with ThreadLocals

[18:26] <arigo> mwh: a quick look yes

[18:26] <pedronis> arigo: that's true for translate_pypy0

[18:27] <pedronis> but the spaces

[18:27] <pedronis> have things like

[18:27] <pedronis> recursion_limit

[18:27] <arigo> argh

[18:27] <mwh> arigo: ok

[18:27] <arigo> looks like this belongs somewhere else, but where?

[18:27] <pedronis> anyway I think that simple and limited way to handle global state

[18:28] <pedronis> makes sense as a feature for the annotator

[18:28] hpk (~holger_kr@d83-176-36-251.cust.tele2.ch) joined #pypy.

[18:29] <arigo> probably, but at the same time global state is evil

[18:29] <arigo> recursion_limit is actually on space.sys, but I guess it's also SomePBC

[18:29] <pedronis> yes

[18:30] <pedronis> well, you could have a sort of post bootstrap init

[18:30] <pedronis> that setup objects to attach such state

[18:31] <pedronis> and settings things up properly

[18:31] <pedronis> the annotator would go over their creation

[18:32] <pedronis> but they would need at least some non-constant param to the ctr

[18:34] <pedronis> but then is probably messier than teaching the annotator the notion of global state object

[18:35] <hpk> armin and me just discussed a bit if we couldn't turn some of the SomePBCs into SomeInstances (or maybe even have a heursitic approach doing that)

[18:35] <pedronis> well what I proposed is a marker that ask for that

[18:36] <pedronis> but as I said we don't want for example all the space

[18:36] <hpk> yes, makes sense if we can't find some heuristic way

[18:36] <pedronis> to be a someisntance

[18:36] <hpk> well, but i think we really shouldn't have a setattr(space, ...)

[18:37] <pedronis> the problem with the heuristic

[18:37] <pedronis> if it needs to go through some code

[18:37] <pedronis> you have to restart the annotation

[18:37] <pedronis> because some assupmtion about constants

[18:37] <pedronis> maybe then become invalid

[18:38] <hpk> so i guess we would have to know early if something is a SomePBC or a SomeInstance

[18:38] <hpk> so a flag would be the easiest way i guess

[18:39] <pedronis> what kind of heuristic did you have in mind?

[18:40] <pedronis> hpk: if we needed state attached to the space we would have spac.state which would be an instance of some marked class

[18:40] <arigo> e.g. if it's a built-in type or a user-defined instance, but it doesn't fully work

[18:40] <arigo> e.g. Cache instances should still be SomePBCs

[18:41] <pedronis> I think that explict is probably saner for the user in the end

[18:41] <arigo> yes

[18:41] <arigo> note also that since rev numbers are gone, instance creation points aren't recorded any longer, so SomePBCs and SomeInstances aren't so different any more

[18:41] <hpk> pedronis, yes

[18:42] <pedronis> well, as I said yesterday

[18:42] <pedronis> the problem is that in a lot of places

[18:42] <pedronis> we check whether something is constant

[18:42] <pedronis> and special case

[18:42] <pedronis> it's is hard to grasp how much of that would be undone

[18:42] <pedronis> when reflowing

[18:42] <pedronis> etc

[18:43] <arigo> but that's a general problem:

[18:43] <arigo> it's basically wrong to do things that can't be undone

[18:44] <pedronis> well but the warning is there in the first place

[18:44] <arigo> reflowing with more general values should give more general results, etc.

[18:44] <pedronis> because we assume that pbc are constants

[18:44] <arigo> yes, turning SomePBC into SomeInstance doesn't easily work, I agree

[18:44] <arigo> what I had in mind is that bookkeeper.getpbc()

[18:45] <arigo> already checks if the constant object "looks like" an instance

[18:45] <arigo> and makes a Class for its class

[18:45] <pedronis> yes that would be the place

[18:45] <pedronis> to check for the marker

[18:45] <pedronis> too

[18:45] <arigo> yes

[18:45] <arigo> but what I'm saying is that

[18:46] <arigo> we could reuse the code of SomeInstance.getattr in SomePBC

[18:46] <arigo> i.e. record the getattrs

[18:46] <pedronis> but that's the problem

[18:46] <pedronis> some of the getattr

[18:46] <pedronis> done internally

[18:46] <pedronis> don't go through that

[18:48] <arigo> I see

[18:48] <pedronis> I'm not saying it is impossible

[18:49] <pedronis> I'm just saying that I don't see much value in the effort right now

[18:49] <pedronis> because we would have to review much of the code

[18:49] <pedronis> anyway global state should be the exception

[18:50] <pedronis> so complicating everything for it would seem a bit strange

[18:50] <hpk> probably right

[18:50] <arigo> makes sense

[18:51] <hpk> about which cases of "global state" are we talking anyway?

[18:51] <pedronis> recursion_limit

[18:51] <pedronis> compare_nesting

[18:52] <pedronis> this kind of small stuff

[18:52] stakkars (~tismer@82.144.60.19) left irc: Read error: 110 (Connection timed out)

[18:53] <pedronis> other stuff on sys I imagine too

[18:57] <hpk> note that e.g. recursion_limit is not on the space anymore

[18:59] <pedronis> yes

[18:59] <pedronis> but the last time I tried translate_pypy

[18:59] <pedronis> I got a warning for it anyway

[19:00] <pedronis> as I said, unless you move some intialization after bootstrap

[19:00] <pedronis> and analyse that too

[19:00] <pedronis> it is hard to eschew the problem

[19:01] <arigo> do we need this bootstrap code?

[19:02] <arigo> isn't it enough to have a flag to tell getpbc() to return a SomeInstance ?

[19:02] <pedronis> sorry, I was not clear

[19:02] <pedronis> either we have the flag

[19:02] <pedronis> or we need to muck with init code

[19:02] <hpk> yes, i think having the flag is kind of agreed upon

[19:02] <arigo> ah, ok

[19:02] <arigo> yes

[19:03] <pedronis> yes

[19:03] <hpk> so e.g. Modules should have that flag

[19:03] <pedronis> as I said is a meaningful although

[19:03] <pedronis> to be used rarely feature

[19:03] <hpk> we'll see :-)

[19:04] Action: pedronis needs to go buy stuff

----- silence for 35 minutes -----

[19:39] tic (~vision@c-996e73d5.019-35-67626717.cust.bredbandsbolaget.se) left irc: "BeOS - Because you don't eat soup with a fork!"

[19:42] tic (~vision@c-996e73d5.019-35-67626717.cust.bredbandsbolaget.se) joined #pypy.

----- silence for 1 hr and 4 minutes -----

[20:46] tic (~vision@c-996e73d5.019-35-67626717.cust.bredbandsbolaget.se) left irc: "BeOS - Because you don't eat soup with a fork!"

----- silence for 27 minutes -----

[21:13] tic (~vision@c-996e73d5.019-35-67626717.cust.bredbandsbolaget.se) joined #pypy.

[21:18] Continuity (~kittish@host81-155-190-218.range81-155.btcentralplus.com) joined #pypy.

----- silence for 43 minutes -----

[22:01] <arigo> we tried some approach to the "immutable flag", actually a _freeze_() method

[22:01] <arigo> see pypy-svn.

[22:13] <pedronis> arigo: so now the spaces are considered mutable

[22:13] <arigo> at the moment yes

[22:13] <arigo> we're hacking at descroperation.py to remove the _comparing_nesting storage

[22:13] <arigo> it's just tedious

[22:14] <arigo> descroperation.py:481

[22:14] <arigo> there is a _compare_nesting += 1 with no matching -= 1 ??

[22:16] <pedronis> arigo: the flowspace in its constant handling code nees to consider _freeze_ too

[22:16] <arigo> well yes

[22:16] <arigo> right.

[22:17] <arigo> should that be done in wrap(x)?

[22:18] <pedronis> well you cannot consider them simplfy variables

[22:18] <pedronis> because you loose the information

[22:18] <pedronis> that they need to be created in the first place

[22:18] <arigo> right

[22:18] <arigo> non-unwrappable Constants maybe?

[22:18] <arigo> or simply tested for in generic_operator?

[22:19] <pedronis> one of those yes

[22:19] dialtone (~dialtone@host116-56.pool80117.interbusiness.it) left irc: Read error: 148 (No route to host)

[22:19] <pedronis> arigo: about compare_nesting I think

[22:19] <pedronis> is copied more or less from CPython 2.3

[22:20] <pedronis> but indeed there should be a decrement

[22:20] <arigo> Holger added it while rewriting it to use the ec_state_dict instead

[22:20] <pedronis> makes sense

[22:21] <pedronis> in fact in python it is a global

[22:21] <pedronis> because there's the GIL

[22:21] <pedronis> in CPython

[22:21] <arigo> waaa but user-defined __cmp__ can release the GIL of course

[22:21] <arigo> so strange things can occur in CPython I guess

[22:24] <arigo> plus, doing unrelated comparisons as the implementation of __cmp__ will only work up to a level of 20

[22:25] <arigo> I have a problem with the flow objspace

[22:25] <arigo> because in the annotator, a user-defined instance with no _freeze_ defaults to "mutable"

[22:26] Action: hpk commited the space -> somePBC changes

[22:26] <arigo> so in the flow objspace if there is no _freeze_ I have to check if it's a user-defined instance

[22:26] <arigo> this is the kind of hack that doesn't exist in the flow space so far

[22:27] <pedronis> well, well this the less backward compatible default

[22:27] <arigo> yeeesss

[22:27] <arigo> it also looked like the safest one

[22:28] <arigo> because putting too many SomeInstances is less bad than too many SomePBCs

[22:28] <arigo> there is another reason

[22:29] <arigo> instances of "nice-looking" classes like Module tend to be mutable

[22:29] <arigo> while instances of hackish classes like applevel(), not

[22:29] <arigo> adding yet another magic method to applevel is less strange than to Module&co.

[22:30] <arigo> for the flow objspace I am thinking that the getattr() operation specifically should not be constant-folded unless _freeze_() exists and returns True.

[22:31] <pedronis> that makes sense

[22:31] <pedronis> although I don't know if it covers all bases

[22:33] <arigo> what about not constant-folding getattr() at all?

[22:34] <pedronis> no, I was thinking about the other operations

[22:34] <arigo> what other operations make sense on instances of RPythonic user-defined classes?

[22:35] <pedronis> but the problem is that we don't check

[22:35] <pedronis> and then there's geninterp

[22:35] <pedronis> I'm thinking about classes defining __xxx__ methods

[22:37] <arigo> grumble

[22:39] <arigo> I see

[22:40] <arigo> so, we should really check for "user-defined instance with no _freeze_ or whose _freeze_ returns False" ?

[22:40] <pedronis> it seems so

[22:40] <pedronis> and wrap or unwrap

[22:40] <pedronis> seem the places

[22:40] <arigo> not wrap; unwrap or generic_operator

[22:43] <pedronis> mmh, unwrap

[22:51] <arigo> unwrap() is messy

[22:51] <arigo> it's used all over the place for various purposes

[22:51] <arigo> I'm basically going to bed now but I tried and kept having troubles with that idea...

[22:51] esteban (~esteban@DWM-59-231.go.retevision.es) joined #pypy.

[22:52] <hpk> good night

[22:52] hpk (~holger_kr@d83-176-36-251.cust.tele2.ch) left irc: "ChatZilla 0.9.61 [Mozilla rv:1.7.5/20041217]"

[22:52] <arigo> indeed

[22:52] arigo (~arigo@d83-176-36-251.cust.tele2.ch) left irc: "[x]chat"

[23:05] esteban (esteban@DWM-59-231.go.retevision.es) left #pypy.

[00:00] --- Sun Mar 13 2005