News for hackers. Stuff that matters.
Re:Imperative Haskell by smilliken on Wednesday May 31, 2017 @04:22AM (#14451062)
> if you can measure how much time a computation takes, then Haskell is impure

gettimeofday requires IO, so the computation would depend on dynamic inputs, but that doesn't make it impure. If the program knows how long one of its computations took, that's only because an oracle (outer layer of abstraction) told it.

> Another problem with seeing purity as fundamental is that our physical reality isn't a persistent data structure

I like this line of reasoning, but would take the opposite conclusion. The universe is symmetric with respect to time, and indeed, information is conserved. Past states aren't easily accessible, but they have not been erased. This sounds like a fine working definition for persistent data structures.

> there's a strong suspicion that the (pure) type signature of runST has no pure implementation

Interesting, thanks for bringing it up!

Re:Imperative Haskell by cousin_it on Wednesday May 31, 2017 @04:41AM (#14451116)
> The universe is symmetric with respect to time, and indeed, information is conserved. Past states aren't easily accessible, but they have not been erased. This sounds like a fine working definition for persistent data structures.

That line of research exists, but it's different from persistent data structures. The search term is "reversible computing", and the main idea is that you never erase bits because that would irreversibly increase entropy. One difference is that persistent data structures allow access to past states in O(1), while reversible computing requires you to spend time on uncomputing. Right now it's mostly a curiosity because it requires hardware that doesn't exist, so I'd be wary of using it as a foundation of CS. It might well become important in the future though, due to lower energy requirements.

Re:Imperative Haskell by enqk on Wednesday May 31, 2017 @04:54AM (#14451162)
> The universe is symmetric with respect to time, and indeed, information is conserved.

Bringing a snowflake back to its previous shape after it has melted?

Re:Imperative Haskell by empath75 on Wednesday May 31, 2017 @09:04AM (#14452122)
Congrats, you've discovered entropy. The reason time seems to flow in one direction is only because there was an extremely low entropy state at the beginning.
Re:Imperative Haskell by AnimalMuppet on Wednesday May 31, 2017 @12:30PM (#14453779)
Yes, but entropy means that the universe is not symmetric with respect to time, doesn't it? That is, enqk's statement is in fact a refutation of smilliken's claim. Dismissing it with "Congrats, you've discovered entropy" doesn't answer it at all.
Re:Imperative Haskell by sidek on Wednesday May 31, 2017 @01:16PM (#14454184)
Entropy is not due to the equations of our universe, but rather the initial conditions. So the asymmetry might be apparent but the equations might still be symmetric. Related is the idea of spontaneous symmetry breaking.

Of course, we don't have time symmetry in the equations anyway because of the weak force. But because the weak force is weak//doesn't matter much for the physics of many systems, we can often write the equations of physics as a time-symmetric term which essentially decides the motion plus a very small time-asymmetric term. So we can deal with the small term using techniques like perturbation theory, and use time symmetry for the rest.

Re:Imperative Haskell by AnimalMuppet on Wednesday May 31, 2017 @02:07PM (#14454640)
> Of course, we don't have time symmetry in the equations anyway because of the weak force.

Could you expand on what you mean here? I've expected for a while that there was going to be something non-time-reversal-symmetric with the weak force, on the basis of parity violation (space-reversal doesn't give you the same equations) plus relativity (space and time are the same thing, at least kind of). But getting there directly from parity violation might require a faster-than-light frame of reference to observe it from, which is... let's just say it's experimentally difficult.

How does the weak force break time symmetry?

Re:Imperative Haskell by sidek on Wednesday May 31, 2017 @06:28PM (#14456439)
The answer, as you point out, is that CP violation implies T violation. Experimentally testing T violation is much, much harder, and I don't think has really been done in many systems (look at Fitch and Cronin's work for an example), but we know CP violation implies it. So it's there. Or at least, to our best knowledge, it's there -- T violation is not very well understood.
Re:Imperative Haskell by quadrupleslap on Wednesday May 31, 2017 @06:15AM (#14451418)
I think the idea is that with perfect knowledge of the current state of the universe, you could deduce that yes, that water was once a snowflake of some known configuration.
Re:Imperative Haskell by mac01021 on Wednesday May 31, 2017 @09:14AM (#14452194)
Is there any evidence that this is true?
Re:Imperative Haskell by jerf on Wednesday May 31, 2017 @09:50AM (#14452460)
Even if it is true in theory, it is not practically true, as the information required to reverse such a transform rapidly exceeds what you can collect even in theory in a single coherent system. While this is by no means the end of your problems, one simple question you can ask yourself is how exactly you intend to re-collect the photons that the snowflake emitted while melting as they head off to the ends of the universe at light speed?

If the universe is externally a pure value, it doesn't matter to us on the inside. The universe is impure from our point of view.

Also, a pure data structure doesn't just imply that you have a puddle of water that you can put back together into a snowflake; it practically (that is, in practice, not in the colloquial sense of the term) implies that you have both at the same time. When I'm working with pure data structures I don't have to laboriously translate back and forth, I have them both in hand. This is partially because pure data structures simply have no concept of time at all in them. And you can't save this argument by claiming you can transform them back and forth at will, because as I mentioned, no, you can not. Common sense can be clad with solid mathematical arguments here; you can not, in our real universe, ever do that, so even the superficially appealing theoretical answer must give way to a more sophisticated and correct theoretical analysis in which in fact you can't reverse arbitrary transforms in practice. (You can do it at a small scale for small numbers of qubits. You can do it for a constrained number of qubits specially set up and isolated for just such an occasion, aka "quantum computer".... and note how hard even that is, we've still not managed to isolate very many qubits at a time that way! But you can not do it in general.)

Whether an entity external to our universe could do it is something you'd have to take up with them.

Re:Imperative Haskell by pdpi on Wednesday May 31, 2017 @06:34AM (#14451473)
sure. As long as time is symmetrical, and advancing time by -t cancels out advancing time by t.