<ruth2345345>
Does writing cached functions make sense with PyPy, or will repeated calls to the same function with the same arguments get optimized away anyway?
<cfbolz>
ruth2345345: depends what the function is doing
<cfbolz>
ruth2345345: if the function is straightline code, and mostly functional operations, pypy will optimize it away
<ruth2345345>
And if it's a method providing a (potentially rather complex) string representation of an object, often accessed, but rarely changed (only when object's properties are altered) - in that case, should I manually cache it?
<cfbolz>
ruth2345345: yeah, that sounds like a case where caching could help? but it's always best to try and measure
<cfbolz>
ruth2345345: what are you using pypy for?
<ruth2345345>
Not using it, but kinda wanting to run a small experiment and maybe try implementing a very simple version of Tcl on top of it, just for fun. In the original Tcl interpreter everything has a string and internal representation, either updated lazily from the other and cached. So I was wondering if maybe that's something that a tracing JIT would effectively take care of anyway