Can I just create a single .cs file somewhere, and execute it by typing its name? No Visual Studio solution/project shenanigans? That’s my dream. Top-level programs to eliminate boilerplate is a nice related step.
gcc -x c -ggdb -Wall -Wextra -Wno-main -Wno-unused-parameter -o $out $CFLAGS -include $header - $LDFLAGS <<-CRUN_EOF
#line 2 "$1"
$(tail +2 $1)
CRUN_EOF
Obviously gcc would be replaced with csc, you wouldn't need CFLAGS and you might need a temp file or something.Me, on the other hand, I want Python to become a compiled language. And to those who's going to reply with "PyPy/Cython/Nuitka" I have a question for them: -do show me a .dll from those!
#!/usr/bin/env swift
print("Hello")
And after a chmod +x, it works. Granted, anyone who I distribute this to will need a swift compiler installed, but that’s to be expected (and similar for Python.)Golang and other “compiled” languages have similar ways of making this work too.
To use the swift example, often I want to double check whether something in the language works as I expect, so I write a quick test.swift and run it. It’s a useful thing even if you don’t personally want it.