3 ms·
There has been some interesting work published recently on "resugaring" that you might be interested in: http://cs.brown.edu/~sk/Publications/Papers/Published/
by cyrus_ 11y ago
There has been some interesting work published recently on "resugaring" that you might be interested in:
http://cs.brown.edu/~sk/Publications/Papers/Published/pk-resuarging/ http://cs.brown.edu/~sk/Publications/Papers/Published/pk-res...
and more recently:
http://cs.brown.edu/~sk/Publications/Papers/Published/pk-hyg-resugaring-comp-desugaring/ http://cs.brown.edu/~sk/Publications/Papers/Published/pk-hyg...
- mjn 11y agoAlso 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.
- alehander42 11y agoYes, I read a blog post about it, and it was in my take-a-deeper-look list, seems excellent