News for hackers. Stuff that matters.
Re:Official proposal for Type Unions in C# by LtWorf on Wednesday August 07, 2024 @06:30PM (#41186236)
If it wasn't so linux distribution unfriendly…
Re:Official proposal for Type Unions in C# by abcde777666 on Wednesday August 07, 2024 @06:58PM (#41186372)
I've found it quite easy to build and deploy to Linux, also curious what challenges you've run into.
Re:Official proposal for Type Unions in C# by LtWorf on Thursday August 08, 2024 @04:04PM (#41195615)
If it can't be included in the distribution, it's not "distribution friendly"
Re:Official proposal for Type Unions in C# by mlhpdx on Wednesday August 07, 2024 @07:06PM (#41186419)
Almost everything I build in C# runs on some flavor of Linux.
Re:Official proposal for Type Unions in C# by LtWorf on Thursday August 08, 2024 @04:04PM (#41195620)
I said nothing about running. I said about distributions.
Re:Official proposal for Type Unions in C# by nickcox on Wednesday August 07, 2024 @06:45PM (#41186314)
In what ways?
Re:Official proposal for Type Unions in C# by LtWorf on Thursday August 08, 2024 @04:08PM (#41195650)
Basically it's not included in any distribution. Mostly for license problems.

Which means anything you write with it can't be included in any distribution.

It's quite limiting. Basically it's only useful for proprietary software shipped by 3rd party.

Re:Official proposal for Type Unions in C# by neonsunset on Thursday August 08, 2024 @07:31PM (#41197493)
The entirety of https://github.com/dotnet/dotnet (which is a VMR for full-source build of Roslyn, runtime and everything else that goes into runtime-only and SDK packages) is MIT, which is as permissive as it gets, save for CC0 or Unlicense.

Quick search shows that SDK and runtime packages are available in the official feeds for

Archlinux: https://archlinux.org/packages/?sort=&q=dotnet

Fedora: https://packages.fedoraproject.org/pkgs/dotnet8.0/

Ubuntu: https://pkgs.org/search/?q=dotnet

I always wondered what is the motivation behind the negative comments like these on .NET submissions. Is this because .NET is mostly made by MS employees instead of Google (which is an AdTech company) or Oracle (which has a license trap JDK distribution)?

Re:Official proposal for Type Unions in C# by LtWorf on Friday August 09, 2024 @01:05AM (#41198918)
> I always wondered what is the motivation

This is the motivation ↓

    apt install dotnet-sdk-8.0
    Error: Unable to locate package dotnet-sdk-8.0
    Error: Couldn't find any package by glob 'dotnet-sdk-8.0'
Re:Official proposal for Type Unions in C# by neonsunset on Friday August 09, 2024 @05:11AM (#41200119)
A lot of otherwise excellent software is not present in, for example, official Debian feeds. As a sibling comment pointed out, that’s no reason to throw a tantrum and is a trivially solvable issue.
Re:Official proposal for Type Unions in C# by LtWorf on Friday August 09, 2024 @09:00AM (#41201420)
Lol trivially… unless you want to distribute your software that is.
Re:Official proposal for Type Unions in C# by neonsunset on Friday August 09, 2024 @10:39AM (#41202308)
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:PublishTrimmed=true

AOT: dotnet publish -p:PublishAot=true -p:OptimizationPreference=Speed*

Use -o to specify destination.

By default targets the host's OS RID, but can be overriden with e.g. `-r linux-musl-arm64`. Cross-architecture compilation is supported within OS, and there is a nuget package that switches the publish to Zig toolchain to allow publishing for Linux under Windows without relying on WSL2: https://www.nuget.org/packages/PublishAotCross This only concerns AOT as .NET uses the same linker to produce the final binary as your regular C/C++ code. It is a true native executable through and through that is understood by all standard tooling like native code profilers. For JIT binaries, anything that .NET supports can be published for under any other OS and ISA.

* my recommendation as the size impact is negligible but codegen quality in edge cases improves quite a bit. Other flags that may be useful are -p:IlcInstructionSet=x86-x64-v3 (AVX2 and friends) and -p:IlcFoldIdenticalMethodBodies=true (it's disabled by default because it can mess up stack traces, naturally, in .NET 9, disabling stack trace information enables it as well).

Re:Official proposal for Type Unions in C# by LtWorf on Friday August 09, 2024 @12:57PM (#41203536)
> 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.

Re:Official proposal for Type Unions in C# by neonsunset on Friday August 09, 2024 @01:26PM (#41203761)
> Which is not distribution friendly.

Why is that?

Re:Official proposal for Type Unions in C# by LtWorf on Friday August 09, 2024 @03:53PM (#41204867)
Can such a monstruosity be part of a distribution? No. Then...
Re:Official proposal for Type Unions in C# by neonsunset on Friday August 09, 2024 @04:04PM (#41204952)
What makes it a monstrosity? Why should it be (or not be) a part of distribution?
Re:Official proposal for Type Unions in C# by metaltyphoon on Friday August 09, 2024 @06:45PM (#41205985)
Don’t bother he is just saying things in bad faith.
Re:Official proposal for Type Unions in C# by LtWorf on Saturday August 10, 2024 @01:33AM (#41207548)
I think you replied to the wrong comment.
Re:Official proposal for Type Unions in C# by latentsea on Wednesday August 07, 2024 @09:47PM (#41187338)
What distributions specifically have you had a problem developing on?

I've developed on Ubuntu and Pop_OS! in C# for years and never hit a problem.

Re:Official proposal for Type Unions in C# by LtWorf on Thursday August 08, 2024 @04:04PM (#41195622)
Can I apt-get install your software? If not, then you've just hit the problem.
Re:Official proposal for Type Unions in C# by metaltyphoon on Wednesday August 07, 2024 @09:56PM (#41187393)
Oh yeah so unfriendly.

  sudo dnf install dotnet-sdk-8.0. 
  sudo apt install dotnet-sdk-8.0
  sudo apk add dotnet-sdk-8.0
Re:Official proposal for Type Unions in C# by LtWorf on Thursday August 08, 2024 @04:06PM (#41195632)
apt install dotnet-sdk-8.0 Building dependency tree... 0% Error: Unable to locate package dotnet-sdk-8.0 Error: Couldn't find any package by glob 'dotnet-sdk-8.0'

Works like a charm.

Any more irrelevant things to say?

Re:Official proposal for Type Unions in C# by metaltyphoon on Thursday August 08, 2024 @07:09PM (#41197369)
All this means is Pop OS doesn’t have it published. You don’t have to throw a piss because MS doesn’t publish it for Pop

https://github.com/dotnet/core/blob/main/linux.md#packages

Re:Official proposal for Type Unions in C# by LtWorf on Thursday August 08, 2024 @07:23PM (#41197455)
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.

Re:Official proposal for Type Unions in C# by tester756 on Friday August 09, 2024 @01:15PM (#41203690)
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

Re:Official proposal for Type Unions in C# by LtWorf on Friday August 09, 2024 @03:53PM (#41204861)
How is this "distribution friendly"?