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

Referential equality is possibly an optimization, and makes re-rendering efficiently at least simpler.

Debugging and rewind/replaying application state is also greatly simplified by keeping states immutable.

Having the state mutable would also need some kind of locking between the render view and updateState method




> Having the state mutable would also need some kind of locking between the render view and updateState method

That's right, but that's exactly the main strength of Rust : the borrow checker deals with that locking at compile time with zero runtime overhead.

Not arguing on the other points though.


> Having the state mutable would also need some kind of locking between the render view and updateState method

You may want to brush up on Rust, the language has been designed explicitly to deal with these kinds of situations.


You're certainly right that in the mutable Rust land you don't have rewind/replaying state out of the box.




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

Search: