3 ms·
I'm always dreaming of an invertible compiler that automatically provides a decompiler for the language it implements. Then we could transpile every language i
by j-pb 11y ago
I'm always dreaming of an invertible compiler that automatically provides a decompiler for the language it implements.
Then we could transpile every language into every other language, as long as it compiles to a common platform.
Using a logic language for implementation might help, but a compiler is probably not surjective in general which makes this very hard :(
- deleted 11y ago[deleted]
- sklogic 11y agoThis is nearly impossible. Just imagine decompiling the result of lowering some deeply nested pattern matching.
- j-pb 11y agoOf course you won't get out what you put in, but you might get something. What I found most impressive was this scheme interpreter written in minikanren (schemes prolog) that can produce quine simply be expressing them as logic constraints over multiple programs. http://www.infoq.com/presentations/miniKanren http://www.infoq.com/presentations/miniKanren https://www.cs.indiana.edu/~eholk/papers/sfp2012.pdf https://www.cs.indiana.edu/~eholk/papers/sfp2012.pdf
- sklogic 11y agoInteresting. Yes, in some cases decompilation can return a higher level code than the original, which is quite an interesting an yet very much unexplored area. I only scratched that while I was working on a static code analysis.