reminds me of nix-shell shebang [0] which enables a similar pattern for scripts of arbitrary languages.
[0]: https://nixos.wiki/wiki/Nix-shell_shebang