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

I think there's a good insight here, related to Clojure's atoms and Facebook's Flux.

If you start by making everything in your program 100% immutable and timeless, how do you introduce any kind of time-dependence? A nice clean answer is that there is a global clock, and when it ticks, everything changes.



Time dependence is just like an async dependence (like waiting for a mouse click) in that, in a profound sense, a program doesn't "know when it will happen". The only time a program's state changes is with new information, and the clock is just another source of information. (There's no reason why you couldn't specify timeouts in "ticks" and give the user a button that represented a "tick" such that they could advance the program.)


Interestingly, I'm building an app in Flux/React that lets you do exactly that.


Cool. It's a style I've been working with, too. I'd be interested to check out your work.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: