3 ms·
There are a few responses here who seem not to have read the article or watched the video (note I didn't read the paper). This is pretty amazing, and totally d
by pbiggar 16y ago
There are a few responses here who seem not to have read the article or watched the video (note I didn't read the paper).
This is pretty amazing, and totally different from a memoizing decorator, and anything which could be done at the application level (unless it did deep deep magic; the kind you can't really do in Python).
Firstly, it is fully automatic. You don't need to annotate anything.
Secondly it works on impure functions! (as opposed to pure functions like fib.) It tracks data dependencies through the program, including global variables, external files(!), etc. If they do not change, then it uses a cached value.
Assuming that it works as he explains it in the video, this is properly amazing (and I've a PhD in compilers).
In comparison, a memoization decorator:
- requires you to annotate functions,
- can be accidentally put on functions which are not pure, which would lead to bugs and unsafe behaviour,
- does not (safely) support functions where data in the body of the function changes (such as global variables, external files, etc). Instead, it would only check the arguments.
Anyway, I'm impressed.
- crystalis 16y agoThanks greatly for your post. I had the misfortune of reading the earlier comments and writing this off as a trivial accomplishment that could be disregarded, but now I know it is actually a useful tool to have in my arsenal.
- pgbovine 16y agothanks for such a great summary and 'sales pitch' of my project ;) i couldn't have put it any better. if you have any further suggestions, please email me personally.