what's even cooler is when the language comes with first class support for this: https://www.erlang.org/docs/18/man/escript
Or the venerable https://babashka.org/