Live data from Hacker News

Official proposal for Type Unions in C#

github.com

301–310 of 315 posts

Re: Official proposal for Type Unions in C#

#301
post #299

Earlier quoted context omitted.

You can make a single file executable that does not require any dependencies with just the following. No runtime is required on the host, which I assume you allude to as lacking necessary package in the official feed might cause issues if it's required (and given it's present in everything that is not Debian, it is a Debian issue and something Debian must address). JIT: dotnet publish -p:PublishSingleFile=true -p:Pub…

> You can make a single file executable that does not require any dependencies Which is not distribution friendly. Thanks for finally understanding you were wrong all along.

> Which is not distribution friendly.

Why is that?

Re: Official proposal for Type Unions in C#

#302
post #281

Earlier quoted context omitted.

I use regular proper debian. The fact that it's not there (and it can't be there) was exactly my point. I use toilets normally. I don't throw excrements.

I have no idea why he gave you some random link literally first link under "dotnet debian" is: https://learn.microsoft.com/en-us/dotnet/core/install/linux-... __________ wget https://packages.microsoft.com/config/debian/12/packages-mic... -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb rm packages-microsoft-prod.deb sudo apt-get update && sudo apt-get install -y dotnet-sdk-8.0

How is this "distribution friendly"?

Re: Official proposal for Type Unions in C#

#303
post #299

Earlier quoted context omitted.

> You can make a single file executable that does not require any dependencies Which is not distribution friendly. Thanks for finally understanding you were wrong all along.

> Which is not distribution friendly. Why is that?

Can such a monstruosity be part of a distribution? No. Then...

Re: Official proposal for Type Unions in C#

#304
post #303

Earlier quoted context omitted.

> Which is not distribution friendly. Why is that?

Can such a monstruosity be part of a distribution? No. Then...

What makes it a monstrosity? Why should it be (or not be) a part of distribution?

Re: Official proposal for Type Unions in C#

#306
post #303

Earlier quoted context omitted.

Can such a monstruosity be part of a distribution? No. Then...

What makes it a monstrosity? Why should it be (or not be) a part of distribution?

Don’t bother he is just saying things in bad faith.

Re: Official proposal for Type Unions in C#

#308
regarding ad hoc unions the article mentions this:

  Siamese pet = ...;
  (Cat or Chihuahua) mostlyCats = pet;
  Dog dog = (Dog)mostlyCats;
Note: This works for implemented interfaces too.

I am unsure what that section entails...

Let's say I have a function like this:

  void ConsumeAB(T ab) where T: IA, IB;  
And implementing classes like this:

  class ABC : IA, IB {}
  class ABD : IA, IB {}
Will I be able to use this function like this:

        var items = new (ABC or ABD)[] { new ABC(), new ABD() };
        foreach (var item in items)
        {
            ConsumeAB(item);
        }
In other words will the ad hoc union act as it would implement all interfaces that all cases have in common? My guess it won't work, as it gets lowered to code that uses object. Would a custom union help me here?

Re: Official proposal for Type Unions in C#

#309
post #278

Earlier quoted context omitted.

> Do you have a specific scenario and a package name in mind when you say "Nontrivial programs mostly don't run"? Not a specific single program (not package) just my general experience of how "find useful-sounding program written in C#" -> "download it, try to run it" usually goes. I could probably dig up the name of the most recent thing I tried it with if you really want (I think it was a video renaming tool) but t…

> If most package owners act a certain way that's what culture is. I doubt either of us has the time to do a statistically valid survey of what's out there. Maybe your experience is different, but let me ask: are you actually using C# programs on non-Windows, and e.g. reporting bugs in them? And finding maintainers take them seriously when you do? Yes, I do, but only those that I personally encounter, which almost ne…

> I can't actually believe we still have to have this kind of conversation in 2024. It's like talking to a street madman who keeps asking "no but is the sky blue? are you sure?". Yes, it is.

I mean, it's the same experience for me the other way round. Every few years someone tells me "yeah, .net works properly on non-windows these days", I file that away in my head, a while later I stumble across a C# tool for something I want to do, I try to run it on my machine, and it doesn't run.

Like, I do believe it's getting better - one of the things linked in this thread actually had Linux installation instructions in the README, which is the first time I've seen that - but in most cases there's no real push or reason to move. It reminds me of the move to Python 3, which didn't really gain momentum until 3.4/3.5 when there were new features that gave an actual motivation to switch.

> In fact, the first version which was called back then .NET Core 1.0 was released 8 years ago, and was already cross-platform.

Yeah, I remember the excitement of that happening, and then the awkward realisation that no existing .NET software was compatible with it. MS pushed out SQL Server remarkably quickly, but there was never really a reason to run it (and while I don't know their nominal support status, it certainly never felt like a first-class platform) and they didn't really follow through. E.g. I don't think Visual Studio proper ever made it over?

> By the time .NET Core 3.1 got released, it was battle-tested and stable, many businesses were moving their applications to linux hosts

OK that is more interesting and promising.

> I'm sure maintainers appreciate it and are grateful for this kind of attitude :)

Meh. Linux monoculture is just as bad as Windows monoculture, the point of open-source is to make it so that people can actually modify and improve your work and use the modified versions, not to publish the code and call it a day.

Re: Official proposal for Type Unions in C#

#310
post #278

Earlier quoted context omitted.

> Do you have a specific scenario and a package name in mind when you say "Nontrivial programs mostly don't run"? Not a specific single program (not package) just my general experience of how "find useful-sounding program written in C#" -> "download it, try to run it" usually goes. I could probably dig up the name of the most recent thing I tried it with if you really want (I think it was a video renaming tool) but t…

For the sake of productive conversation, I'm going to ignore irrelevant and imagined issues and will focus on the one that can be addressed. What is the name of the software that you expected to run on the OS of your choice? I briefly looked through your Github profile hoping to find it but it seems it mostly consists of Scala, Java and a few other non-.NET projects. I assume you haven't had the opportunity to use .N…

> I assume you haven't had the opportunity to use .NET tooling yet.

I've used it some, not to the same extent, and generally at work - another one of those cultural differences I've found is that most JVM/etc. companies are at least theoretically on-board with open-sourcing their non-core libraries, whereas in .NET land there's much less willingness to do that. The actual tooling is good (the best I've used in some ways), but that's only one piece of the puzzle.

> Are you interested in getting .NET SDK to run on FreeBSD?

The SDK itself runs great. I'm more interested in being able to drop in a small program that solves a problem for me - like, that's the way I started with Ruby or OCaml or Go or Erlang, there was a standalone thing that I could pick up and use as part of my system, I didn't have to rearchitect everything or buy into the whole ecosystem or change my workflow. I don't even know Erlang at all, but it's running in my stack in that I'm running Riak (with the Java driver), and that gives me a place where it's already adding value and I could dip my toe further into it if I wanted. That's the thing I've never found from the .NET world - a reason to run it in my system that doesn't require me to fully buy into it to get started. (I guess in theory SQL server could be that, but it's non-opensource and doesn't have any compelling selling point over the substitutes. Part of it's honestly probably just marketing, but that goes for any new language/tool - the most persuasive thing is hearing other people having success with it in a similar situation)

> Was "the evil" software just an ancient WinForms application?

Quite possibly, but I remember command-line tools also not working - just these random one-developer tools have no reason to publish versions for other platforms, and it's not the natural workflow, so they don't. Probably the issues are minor (like, I remember one that was using some windows-only part of the standard library to do something incredibly basic like base64 decoding - I'm sure someone who uses .NET every day would take 30 seconds to swap that out with using the right part of the .NET core standard library instead. But it doesn't make for an easy onramp)

Post reply on HN