by soheilpro on 5/29/25, 2:30 AM with 326 comments
by jbverschoor on 5/29/25, 7:33 AM
Swift does a much better job at this as interprets by default, and a compiled version starts instantaneously. I made a transparent caching layer for your Swift cli apps.Result: instant native tools in one of the best languages out there.
Swift Script Caching Compiler (https://github.com/jrz/tools)
dotnet run doesn't need it, as it already caches the compiled version (you can disable with --no-build or inspect the binaries with --artifacts-path)
by pjmlp on 5/29/25, 7:59 AM
https://ttu.github.io/dotnet-script/
Or that they on the wisdom of the C# Language Runtime, decided on an incompatible approach to how F# references dependencies on its scripts.
https://learn.microsoft.com/en-us/dotnet/fsharp/tools/fsharp...
by donatj on 5/29/25, 1:02 PM
Go prior to modules worked really well this way and I believe Ubuntu was using it like this, but the Go authors came out against using it as a scripting language like this.
by occz on 5/29/25, 7:02 AM
It's excellent for writing small scripts/prototyping where you need access to some Kotlin/JVM feature.
Ruby is still my preferred language for small scripts though - the backticks for running external programs is remarkably ergonomic
by pragmatic on 5/29/25, 5:15 AM
PowerShell is the ultimate Chatgpt language. For better or worse. Usually worse as most shops end up with "write only" PowerShell scripts running all the glue/infrastructure stuff.
by wiso on 5/29/25, 8:00 AM
by moogly on 5/29/25, 7:29 AM
by andix on 5/29/25, 6:55 PM
There is another thing I'm really missing for .NET projects. The possibility to easily define project-specific commands. Something like "npm run <command>"
by mrcsharp on 5/29/25, 6:57 AM
As much as I like Powershell and Bash, there are some tasks that my brain is wired to solve more efficiently with a C-like syntax language and this fill that gap for me.
by adzm on 5/29/25, 6:15 AM
by adzm on 5/29/25, 4:06 AM
by rjbwork on 5/29/25, 4:31 AM
by throwaway896987 on 5/29/25, 7:29 AM
Used it 10+ years in production, but usually no one I talk to in .net world has ever heard about it.
by WuxiFingerHold on 5/30/25, 2:35 AM
I wish Microsoft would just provide a LSP server for C#. Not just a half proprietary extension for VS Code.
by TowerTall on 5/29/25, 3:27 PM
by necovek on 5/29/25, 4:22 AM
by resoluteteeth on 5/29/25, 1:11 PM
by sirjaz on 5/29/25, 1:12 PM
by high_na_euv on 5/29/25, 11:06 AM
by jiggawatts on 5/29/25, 5:15 AM
So for there's...
C# scripting (CSI.exe): https://learn.microsoft.com/en-us/archive/msdn-magazine/2016...
PowerShell Add-Type that allows one-file inline C# scripting: https://learn.microsoft.com/en-us/powershell/module/microsof...
The Roslyn .CSX script files (RCSI.exe): https://devblogs.microsoft.com/visualstudio/introducing-the-...
.NET Interactive: https://github.com/dotnet/interactive
... and now this.
by zeroq on 5/29/25, 12:18 PM
I never understood why it has to be so hard on Windows to enable users to do just a little bit of scripting like it's not 80's anymore.
by masfoobar on 5/30/25, 7:49 AM
This feature is likely added to compete with Python, Ruby, etc. The fact you just create a file, write some code and run it.
However, I don't see C# being a competitor of said languages even for simple command lines. If anything, it could be a viable replacement to Powershell or maybe F# especially if you need to link it to other .NET DLLs and 'do things'
I am also interested in the performance difference compared to other languages. I mean even Dlang has a script-like feature for sometime, now.. rdmd. Not sure the status of that, but it still compiled and runs the program. Just seems overkill for something rather simple.
by nayuki on 5/29/25, 3:33 PM
by theanonymousone on 5/29/25, 1:06 PM
by DMiradakis on 5/29/25, 9:42 PM
by pipeline_peak on 5/30/25, 2:49 AM
Either way, this is a dream come true. I always hated Powershell and it’s strange fixation with OOP. Modern C# seems to acknowledge that sometimes all we want are functions, scripts, Linq and records.
by ComputerGuru on 5/29/25, 2:09 PM
by tgma on 5/29/25, 6:15 AM
by 90s_dev on 5/29/25, 2:48 PM
and now shebang C# scripts,
is everything converging into one meta language?
by xunil2ycom on 5/29/25, 2:25 PM
by replwoacause on 5/30/25, 1:56 AM
by GoblinSlayer on 5/29/25, 7:01 AM
Errm, so how is this different from a folder with a project file?
by zerr on 5/29/25, 7:50 PM
dotnetc app.cs
./app
by CommonGuy on 5/29/25, 4:24 AM
by DeafMan1983 on 5/30/25, 9:41 PM
If you run direct Dotnet App?
by naikrovek on 5/29/25, 12:57 PM
It is insane to me how long it takes people to realize that low barriers for execution and experimentation are important.
Imagine if the Commodore 64 or Microsoft Basic required you to scaffold your program with helper files containing very specific and correct information in order to run those programs.
by arrty88 on 5/29/25, 10:33 PM
by ThinkBeat on 5/29/25, 1:15 PM
It his basically:
gcc test.c -o test.exe test.exe.
and
#!/ comple and run gcc test.c -o test.exe test.exe.
by revskill on 5/29/25, 5:29 AM
by DiabloD3 on 5/29/25, 7:06 PM
Why is it being re-announced now?
by renatovico on 5/29/25, 4:12 PM
by mhh__ on 5/29/25, 5:34 AM
I really want to like C# but there is a reason why it has no ecosystem outside of enterprise and gaming slop
by thom on 5/29/25, 10:45 AM