Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You really don't get that for free though, since you saved versions of everything you'd quickly exhaust the heap. Also, one could bother with delta checkpointing (only copy dirty pages) to get something like this in an imperative language, or build a programming model especially suited for it [1]. Functional programming doesn't really make this much easier (even if you use persistent data structures).

[1] http://research.microsoft.com/en-us/people/smcdirm/managedti...



You don't have to save versions of everything because your functions are pure, so you just save your inputs and you can recompute what happened.


I saw the demo yesterday; it looked like you still had state in the form of a world value (at least storing Mario's physical state information). Those world values would have to be kept around.

Elm code is only pure in that it doesn't have implicit side effects, it definitely has state.

However, if you have deterministic execution, you can always just re-execute from the beginning to get the same execution. This works for functional and non-functional code.


> ... if you have deterministic execution ...

Is deterministic execution the same as referential transparency?

I think what you are saying is that you get the benefit of a functional language when you use a functional style regardless of the language.


No, as long as multi threading isn't involved and event streams are replayed in order, execution is generally deterministic.


Yeah, on the topic of [1], that's basically FRP in a different wrapper and using different terminology. Fundamentally there's little difference between the two approaches, you're just hiding some of the details that FRP normally exposes.


It's FRP without event streams or signals. So basically, it's not FRP. Or if you think everything reactive is frp, I guess.


> You really don't get that for free though, since you saved versions of everything you'd quickly exhaust the heap.

Why would you save versions of everything? That sounds like a pessimistic strategy that you would need in a stateful environment where anything can be destructively updated at any time, which doesn't apply in this case.

> , or build a programming model especially suited for it [1].

Sorry if I don't take the claim "especially suited for it" at face value, seeing as you are the co-author and you are criticizing something which seems to try to achieve the same thing in a different manner. Maybe that's unfair of me.




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

Search: