A common pattern I see in game code that leads to a large % of branches is the: get object by ID or type, if it's not null, execute code.

Has there been any research into flatenning this? Like, language design, exposing code block dependencies and doing pre-lookups, etc.
Note null conditional operators don't scale and are only syntactic sugar. I'd like to eliminate the branching and make game code more linear.

State machines at language level would already go a *long* way to increasing game code parallelism. This could reach another level.
Also, I'm more interested in solutions that allow game programmers to just write code. Getting them to think about memory layouts and branch complexity is not what they want to do and it interferes with their creative process.

Not asking for the world. Really.
One example is message passing, especially in actor model languages like Erlang and Smalltalk. Instead of branching you just send your message, which gets put into some execution list. Each handler is predicated on the target existing. Good, but a debuging model we're not used to
Any engines that already use IDs for dependencies and don't allow calls into systems for those dependencies will naturally support this.
The other big issue with message passing is that getting results from dependencies requires deferring execution and that's never pretty. Obviously something coroutines can alleviate.
Another variant that gets around the deferred response issue is the read/modify/copy model. You have access to dependencies from the previous frame. Any writes to those dependencies makes a copy of the whole target and commits. Kinda like transactional writes.
You can follow @Donzanoid.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: