3 ms·
Also related in a bit different vein, there's work on unifying parsing and pretty-printing (sometimes called "unparsing"): http://www.informatik.uni-marburg.de/
by mjn 11y ago
Also related in a bit different vein, there's work on unifying parsing and pretty-printing (sometimes called "unparsing"): http://www.informatik.uni-marburg.de/~rendel/unparse/ http://www.informatik.uni-marburg.de/~rendel/unparse/
- j-pb 11y agoI'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.