I'd like to write a very tricky elisp code that does the following in a non-compiled .el file. If we are being byte compiled, use the secure-hash function with sha-256 to compute the whole file's sha256, and emit code into the byte compiled result, that when will be read in later, will compute the sha256 of the .el that is belonging to the .elc being loaded and errors on difference. E.g. we solve the problem of not loading outdated result without depending on timestamps (that is incompatible with git commits). We obviously have to define a defmacro for this at least, since we want to have difference between initial .el and compiled .elc. Can you design this macro for me, and show me the result with a minimal usage example? Make sure to think a lot about this and be concise in presenting your results.
Let's break down the problem:
- We need to create a macro that, when a file is byte-compiled, computes the SHA-256 hash of the entire file.
- The byte-compiled .elc