There are unfortunately no native cross-platform scripting languages. But that does not mean we cannot hack together our own terrible solution. Such as a hybrid Bastch or Batsh...
Hybrid A:
date > /dev/null # >nul <nul & goto Batch
#Bash
echo Hello World
exit 0
:Batch
@echo off
echo Hello World
exit /b 0
Hybrid B:
: '"
:: Batch
@echo off
echo Hello World
exit /b 0
"'
#Bash
echo Hello World
exit 0
This still requires duplication of logic, but at least they share the same file. Note that the extension must be .bat or .cmd for the files to run correctly on Windows.