5 ms·
Next question: is there such a thing as a derivative of code?
by amelius 12y ago
Next question: is there such a thing as a derivative of code?
- teraflop 12y agoThere is such a thing as a derivative of a context-free language, which turns out to be useful for writing parsers: http://matt.might.net/articles/parsing-with-derivatives/ http://matt.might.net/articles/parsing-with-derivatives/
- wetmore 12y agoThis derivative (the Brzozowski derivative) is in fact applicable to any language, in the sense of a set of words over some alphabet. The language doesn't need to be context-free.
- ivank 12y agohttp://www.informatik.uni-marburg.de/~pgiarrusso/papers/pldi14-ilc-2014-02-05.pdf http://www.informatik.uni-marburg.de/~pgiarrusso/papers/pldi... defines one for programs as something that "maps changes in the program’s input directly to changes in the program’s output, without reexecuting the original program."
- nwhitehead 12y agoThe derivative of a type is its "zipper", a datatype for representing a "hole" that moves around the data structure. http://strictlypositive.org/diff.pdf http://strictlypositive.org/diff.pdf
- Strilanc 12y agoYou could take the continuous differential equations that describe the elements of a CPU, consider what's going on as the program feeds through, and take the derivative of that. For quantum computers all programs correspond to unitary matrices. You could take the logarithm of the matrix M, define f(x) = e^{ln(M) x}, then compute the derivative of f at 1. You might need a factor of i to make it work. (It works extremely nicely for single-qubit operations.) (Alternatively, you could apply that process separately to all of the individual gates making up the circuit, vary them all at once, and get a different continuous transformation with a derivative.)
- thechao 12y agoAlgorithmic differentiation has been around since at least 1957. Here's a paper I co-authored, dealing with derivatives and generic programming: http://www.axiomatics.org/~gdr/ad/issac07.pdf http://www.axiomatics.org/~gdr/ad/issac07.pdf.
- deleted 12y ago[deleted]