Hacker News new | past | comments | ask | show | jobs | submit login

It's a great illustration of what a pure and an impure (effectful) function is.

The author complains that getting some bits as a result of function f() is seen by the legal system differently than when these bits are obtained via another function g(), even though f() ≡ g()

The problem is, of course, that f() and g() are not pure functions. They produce effects as a part of their being computed, such as accessing various sources of information. The colour thus obtained is one of the effects: accessing a medium while breaking a license agreement that forbids doing so is not the same as obtaining the very same bits from a random number generator by a blind chance. (Note that usually an RNG is also a stateful thing.)

It is easy to provide an analogy of colour in another pair of impure functions computing the same result.

Assume a predicate (theorem) P, which we assume is true. Let f(P) be true iff P is true, but producing a detailed proof of truthiness of P while computed (say, as a log output). Let g(P) be true iff P is true, but providing no explanation whatsoever. They return the very same one bit result: true, and this is the correct result, by construction. But there true values definitely have different colours, don't they?




I take it somewhat differently: the function by itself may be pure, but executing it is a real action in a physical universe - an event with causes and effects.

The colour of a thing isn't obtained from any state changes - rather, it's computed by going back down the causal chain leading to the thing in question. A pirated video file has a different colour than the bit-for-bit identical file that fell out of an RNG, for a very simple reason: in the first case, you actually got a pirated file. In the latter, you didn't. The provenance of data is what determines the colour.

I feel viewing colour as effects of an impure function implies that the colour is a thing that gets created due some events, and exists on its own. But it doesn't. Rather, the colour of a thing is a pure function of how that specific thing came to be, and also of the "colour palette" at the time of interest. That is, the same bytes can bear the colour "illegal" today, but be of "perfectly OK" colour tomorrow, due to a law change you aren't even aware of.

Curiously, while the article implies that the CS POV is grounded in hard reality and the legal POV is focused on make-believe constructed universe abstractions, I'm starting to think the opposite is the case. The legal POV is really about discovering how things came to be or happen. Looking at the causal network. That's as real as it gets. CS POV, in contrast, purposefully discards provenance and gives everything value semantics. That is clearly a fantasy view (though a very useful one for certain tasks).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: