I want to implement some sort of custom cashing for idempotent compute functions, and I'd need to know whether the proc to be cached has changed since last time it was used with the exact same inputs.
Any idea how I could do that in nim? Maybe a macro that somehow hashes the AST? Failing that, maybe I could just hash the string value of the proc body, but I'm not sure how to capture if any dependency packages has changed...
Easiest way would probably be to just use the existing memo package which sounds like it does exactly what you want: https://github.com/andreaferretti/memo
Barring that I assume it's implementation is very close to what you're actually looking to do.