News for hackers. Stuff that matters.
Re:IncPy: Automatic memoization for Python by pgbovine on Friday February 11, 2011 @12:39PM (#2207304)
(IncPy author here ...)

yup agreed, but the programmer needs to figure out:

1.) when it's safe to memoize

2.) when it's worthwhile to memoize

also, your memoization decorator doesn't save data to disk. if you wrote a persistent memoizer, then you would need to also track all dependencies for the data you memoized, so that you can know when it's safe to invalidate on-disk cache entries.

IncPy takes care of all of this automatically ;)

Re:IncPy: Automatic memoization for Python by newtonapple on Friday February 11, 2011 @02:54PM (#2207873)
I have a question. How does IncPy keep track of data dependency coming from IO layer e.g. sockets. Say I want to write a simple web crawler. The function crawls a website, spits out the HTML in raw string, sleeps for 5 seconds and then crawls the site again. Will IncPy not memoize the function at all, knows that the data coming from the network layer has not changed and return the memoized string immediately, and/or smart enough to detect when input (the website) has changed and expires the cache automatically?
Re:IncPy: Automatic memoization for Python by ippisl on Friday February 11, 2011 @04:53PM (#2208311)
incPy need checks the functions it caches to be pure and determinstic. determinstic function is a function that when given the same input , always returns the same output. incPy tests for a few options of non-determinism , and will allow in the future to define non determinstic sources in a config file.