If you think of virtual functions in C++ which are function tables and switch statements in interpreters and emulators and pattern matching in Rust as essentially jumping to code based on data or state is a fundamental part of computing.
Unfortunately it is slow.
I thought of the possibility of a language that has a switch statement that automatically turns into a compiler. A bit like a futumura projection. You use the dynamic switch and you get a compiler in return.
I think Pypy's Rpython is essentially a JIT compiler generator.
I want to define relationships between objects and send messages between them. Even though files, sockets, pipes, containers, processes are all objects, the interfaces between them are all different. You need to use a different API for each. I think REST is a step in the right direction. Imagine managing files and sockets and operating system resources with REST.
The ultimate destination of OOP is this idea we can wire up objects based on their relationships to other objects and instruct them to behave according to some pattern.
One of my ideas is to think of every object as a while True loop that handles messages to behave in different ways.