The ‘Scenic’ GUI library written in Elixir handles all these problems very elegantly, and Elixir is completely functional (no traditional OO, classes or objects)* and immutable.
*of course Elixir/erlang is actually OO done right (actor model) but that’s another story