I use general memoizers (those that work on functions with 0-M arguments
returning 0-N values) fairly frequently. A string serialization approach
can certainly work (though table and function argument handling gets a bit
dicy). But in the profiling tests I've done, an implementation that stores
the arguments in a tree of tables is often significantly faster. There's
at least one such implementation already linked from the lua users wiki:
https://github.com/kikito/memoize.lua