This seems very interesting, however also dangerous.
I mean, this seems to make Bash a modern programming language, however if you do need something like this a modern scripting language like Python would be better in those cases.
Why is that dangerous? I mean I have seen tons of things in python where I'd say "Why didn't you just do this in bash.
Neither python nor bash exclude the other. Some things are easily solved in one, others are more easily solved in the other. And both have "escape hatches" to the other.
I mean, there is some things that Bash really shines, specially for gluing code or working with pipelines.
However, not rarely this ends in a trap: "oh, I already have this small shell script here, I will just add another feature". After sometime, you get a gigantic shell script full of lines that nobody understand anymore, since Bash lacks so many things as a programming language that you end up with multiple hacks just to support that feature you wanted.
I went with the trap above more than once, and sometimes I get myself in it again, until I decide that enough is enough and just rewrite the script in something else.
I mean, this seems to make Bash a modern programming language, however if you do need something like this a modern scripting language like Python would be better in those cases.