I think high level control over control flow manipulation is really underrated and underutilised in programming languages.
For example, the decision where to jump is extremely powerful but the primitives we have for it are weak. (Exceptions, algebraic effects, if statements)
Inheritance controls control flow but doesn't actually solve the pattern of desired behaviour and code organisation most people want.
One idea I am exploring is the idea that efficient control flow can be compiled from the inferred relationships of a rule engine.
Information systems should be used to create all the relationships between data and associations of desired behaviour to data values or partial data values.
Then all the if statements, switch statements and vtables can be inferred.
In other words the types the code operates on is inferred from desired behaviour based on state.
I, too, once thought this way. The problem is that inference and implicit behavior is cognitively expensive. With any language, humans have to be able to act as an adhoc, likely unoptimized or even worst case compiler.
You can work around this by transcending text with all the comforts of a modern IDE, interacting with the toolchain directly, but this has a cost too. The toolchain is often out of reach during code reviews, in diffs, snippets, etc.
Now I much prefer the ability to comprehend printed code revealed in spots under flickering candlelight or rasterized on a pocket display consumed while in a moving vehicle, or a drunken stupor even.
You're right, of course - it does indeed have the potential to increase cognitive expense. I would hope it would only increase cognitive load in the rule engine interface. But I would want that to be a GUI. I think I would prefer that to parsing custom code each time (that's the tradeoff I'm making).
I just get very frustrated reading other people's code that encode complicated rules that I need to decipher how they've represented the mapping of code to behaviour.
In corporate Java projects, I think what gets created is complicated structures and abstractions to handle flexibility and abstract over details that are harder to understand than the English explanation of what they're trying to do. WHEN X DO Y.
When people reach for the visitor pattern, controllers, inheritance, runtime reflection control flow and annotations and object proxies, overridden methods and so on. It's a overcomplicated bespoke dance about managing control flow and they're all different strategies but they do the same thing.
The idea is in early stages. I'm currently working on something else, I am trying to understand the control flow of a coroutine and yield.
I think high level control over control flow manipulation is really underrated and underutilised in programming languages.
For example, the decision where to jump is extremely powerful but the primitives we have for it are weak. (Exceptions, algebraic effects, if statements)
Inheritance controls control flow but doesn't actually solve the pattern of desired behaviour and code organisation most people want.
One idea I am exploring is the idea that efficient control flow can be compiled from the inferred relationships of a rule engine.
Information systems should be used to create all the relationships between data and associations of desired behaviour to data values or partial data values.
Then all the if statements, switch statements and vtables can be inferred.
In other words the types the code operates on is inferred from desired behaviour based on state.