3 ms·
I don't think that's gonna happen at any time. And if it does, we have an AI that is as smart as a human, so we will all be out of our jobs. Because, a>b could
by valenterry 5y ago
I don't think that's gonna happen at any time. And if it does, we have an AI that is as smart as a human, so we will all be out of our jobs.
Because, a>b could also mean a should become 6. So you need to understand the intent to decide what you should do. In that sense, it's not even prolog, it's "worse" (read: harder to achieve).
- akomtu 5y agoA better example would be sorting. Most of the time we don't care about how numbers are sorted, we only care about the result. In this hypothetical new language, sorting would look like "input: A1..An. output: for all k, Ak < Ak+1." It's implied somewhere in the constraints of the upper function that it'a a permutation, but if you want to be pedantic, you can add "for all k exists m such that Bk=Am."
- valenterry 5y agoYou are making things more complicated than they currently are. Currently I call "list.sorted" and I get a sorted list. What you propose is essentially what some languages like Idris already offer: general purpose programming with constraints that allow the compiler to generate an implementation, given that the constraints are precise enough.