Comment by BeetleB

2 years ago

True, but it's trivial to come up with things to dislike in C++ :-)

Great point on C++, but it’s harder for C#. The language and ecosystem are IMO pretty good.

I only hate that Microsoft stopped shipping modern .NET runtime with Windows. A few annoying things though, like the recent push towards AOT compilation (IMO strictly worse that JIT), and the lack of a good first-party cross platform GUI frameworks (for example Microsoft could compile d2d1.dll with DXVK, reimplement dwrite.dll API on top of FreeType / HarfBuzz, and copy-paste UWP).

  • What I dislike about C# is how much effort is needed to get a minimal environment. Rust and Python make simple code compilation quick and easy.

    Let's assume I want to use a C# script .csx file. The CSX filetype seems to be Microsoft's flavor of attempting to "make it simple". I write a hello world. Now what do I do with the .csx?

    I have no idea how to compile that with modern dot net.

    It appears csi.exe would have been the answer, but now Roslyn seems to be the current best practice. No idea what to do though

    • I'm not sure where you are coming from in terms of difficulty of setting it up, it's just

          - sudo apt install dotnet-sdk-8.0 / brew install dotnet-sdk
          - dotnet new console -o {folder} --aot
          - dotnet run -c Release
          - optionally dotnet publish -o .
      

      If you want to use it as a scripting language, you do `dotnet tool install -g dotnet-script` and use it normally[0]. Keep in mind that C# is not designed for this, but it will work (at the cost of first uncached script launch costing extra - it is a compiled language after all, but that's a niche scenario anyway).

      [0]: https://github.com/dotnet-script/dotnet-script?tab=readme-ov...

      6 replies →