Hacker News new | ask | show | jobs
by chriswarbo 3649 days ago
> it can find things like the "sine function" via examples of inputs and outputs

I think this is a really important idea. On one hand, it can save us from re-inventing code which already exists (e.g. "this existing code will satisfy your test suite"), it can help us discover relationships between existing things ("the function 'sine' behaves like the function 'compose(cosine, subtract(90))'"), it can aid refactoring/optimisation/etc.

On the other hand, it could also help us discover services/information which we could not obtain by ourselves. For example, discovering a database mapping postcodes to latitude/longitude.

There's some interesting work applying this to pure functions, using testing https://hackage.haskell.org/package/quickspec and proofs https://github.com/danr/hipspec

It's also closely related to inductive programming (e.g. inductive logic programming, inductive functional programming, or even superoptimisation), where combinations of existing functions are checked against the specification. Of course, that leads down the path to genetic programming, and on to AI and machine learning in general!