Hacker News new | past | comments | ask | show | jobs | submit login
The Internet of code (haskellforall.com)
39 points by psibi on May 18, 2015 | hide | past | favorite | 3 comments



On the subject of super-optimization...

I was imagining a language which would super-optimize only for specific inputs. As an example, let's say you have a program which solves a Project Euler problem. The first time you run it, it takes a while. But the next time you run it, the result is "memoized" (on disk maybe, or embedded into the source code as a constant) and the program returns the value instantly.

This is similar to compile-time function execution, but there's a tradeoff. With compile-time execution, you only have to compile and run once, which is nice. But you also lose some flexibility, because you can't optimize for any values that are provided at run-time.


You can optimize in some cases, even when you don't know what the input would be.

A great example is the one from the post where `morte` optimizes the function `#and #True` to the identity function on `#Bool`s even though it doesn't yet know what the second argument would be.


Partial evaluation is (sort of) similar to what you're proposing (if I'm interpreting your idea right): http://en.wikipedia.org/wiki/Partial_evaluation




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: