I use Deno for this. It's the only scripting system where you can actually have a single file script with no compilation needed and use third party libraries reliably.
Yeah! F# has native support[1] and C# can do it with a third-party tool[2]. For both, the syntax for referencing a third-party NuGet package inside the script is e.g.:
Deno is pretty nice for that. There are other systems that automatically satisfy dependencies for single-file scripts. I have gathered a list at https://dbohdan.com/scripts-with-dependencies. I am not sure about their individual reliability, because I have only written one example for most of them, but some are old, have users who rely on them for work, or both.
It didn't cross my mind to add IDE information. (I don't use an IDE, which may be a mistake. I want to give IntelliJ IDEA a serious try.) I'll be honest: I probably won't add this information. Sorry. N projects × M IDEs is a sizable number of fields to keep accurate by hand, and I've learned this kind of maintenance is best avoided.
I have tried https://github.com/dotnet-script/dotnet-script. It seemed like it could not download dependencies when you ran the script, only reference already installed dependencies. At that point I stopped and did not add it to the list, since it would not qualify. I may have been wrong. I have a mental note to look at it again.
I'll see what F# does. It may work differently from how I understood dotnet-script to work. (It isn't the criterion for inclusion, but as someone who enjoyed writing Standard ML and not so much Haskell, I am actually interested in F#.)
Yeah fair enough. Based on my experience anything that's a third party tool won't have IDE support and is really a bit useless. Even Deno is slightly annoying because it obviously conflicts with the official Typescript IDE support, so at least in VSCode you have to enable it on a workspace-by-workspace basis. And I've had one project where I had "normal" NPM-based Typescript and a Deno script, and it just doesn't work.
F# support looks really interesting though; I'm definitely going to check it out.
I was wrong about dotnet-script: it does download dependencies. (Which makes more sense than the alternative. It would need a good reason to not copy this feature from F#.) I have added C# and F# to the list.
You also get great static types which is nice.
reply