Hacker News new | ask | show | jobs
by jjb 6225 days ago
The test suite will describe the desired behavior, regardless of all other dimensions.

The P=NP optimizer/generator will then generate an implementation that is optimal along one or more dimensions (like space or time efficiency).

Also-- regardless of that, It's "easier" in several senses to describe the desired behavior of an API than to implement that API.

Let's say we wanted to implement addition for a calculator. Here's a complete description:

-1 is the lowest number

-successor(N) is the successor to number N

That's a complete description of the natural number system, but it's not a useful addition function in any sense.

1 comments

Let's say we wanted to implement addition for a calculator. Here's a complete description:

-1 is the lowest number

-successor(N) is the successor to number N

In the first place, that is not a complete description of natural numbers. Natural numbers have to be integers. So if you're going to tell a computer program that "1 is the lowest number", you'd first have to tell it what you mean by "number" and "lowest". Also, "successor(N) is the successor to number N"? That seems rather meaningless. What is "successor" in the first place? If your generator already knows what "successor" means, why do you have to describe it again? If the generator doesn't know what "successor" means, why are you using it in your description of a successor function?

That's a complete description of the natural number system, but it's not a useful addition function in any sense.

Even assuming your description was complete, why would a description of the set of natural numbers imply the creation of an addition function? Unless we're talking about a code generator that reads minds! :)