This is not the first solution for that problem, you can find similar projects on github. The more important thing is how to add this to wordpress shortcode api?

i was thinking to add a new callback function to add_shortcode() function.

add_shortcode( $tag , $func, $ui );

this way we have backwards compatibility and forwards compatibility.