logoalt Hacker News

quotemstrtoday at 6:19 AM2 repliesview on HN

No, a spec is not code. It's possible to describe simple behavior that's nevertheless difficult to implement. Consider, say,

  fn sin(x: f16) -> f16
There are only 64k different f16s. Easy enough to test them all. A given sin() is either correct or it's not.

Yet sin() here can have a large number of different implementations. The spec alone under-determines the actual code.


Replies

mungoman2today at 6:36 AM

Well, the spec can of course define constraints of how the function is implemented.

9rxtoday at 6:36 AM

It says a sufficiently detailed spec is code. Your spec lacks details that could be added.

show 1 reply