News for hackers. Stuff that matters.
Re:Update to the .NET Language Strategy by BenGosub on Wednesday February 08, 2023 @06:03PM (#34716885)
How well are F# and C# supported on the Linux platform?
Re:Update to the .NET Language Strategy by mythz on Wednesday February 08, 2023 @06:26PM (#34717200)
.NET 5+ (fka .NET Core) is cross-platform.

We've been developing on Windows and have been deploying exclusively to Linux since 2017, everything runs flawlessly. Only time where the deployed version was different was when the locale wasn't set in a Docker container.

Developing on macOS has an issue with running HTTPS/2 and gRPC endpoints which should be resolved in .NET 8 [1].

The notable part where .NET Core is lacking vs legacy Windows .NET Framework is graphics, i.e. System.Drawing and all Desktop GUIs, otherwise it's a first class cross-platform runtime.

[1] https://github.com/dotnet/runtime/issues/27727

Re:Update to the .NET Language Strategy by jchw on Wednesday February 08, 2023 @06:17PM (#34717080)
C# support should be pretty good. You've got options. You can use the Mono ecosystem, including the MonoDevelop IDE, Mono runtime, and libraries like GtkSharp; these have been around for a while and some Linux desktop apps use it. You can also use the official Dotnet SDK and runtime, which lacks some stuff that Mono has for compatibility (like Winforms) but should have a good developer experience in either VSCode or Jetbrains Rider, and supports the latest .NET and C# features.

I don't know much about F#, but it seems F# isn't far behind. There's a useful page about getting started and other than the omission of Mono it is similarly supported.

https://fsharp.org/use/linux/

Re:Update to the .NET Language Strategy by bmitc on Wednesday February 08, 2023 @06:23PM (#34717150)
F# comes with the .NET SDK. Once you install it, you get F#, so F# isn't behind at all. Mono is largely irrelevant except for legacy applications things like Godot and Unity that use Mono.
Re:Update to the .NET Language Strategy by jchw on Wednesday February 08, 2023 @06:32PM (#34717283)
On Linux, I don't think Mono is irrelevant. It would not be abnormal to have both upstream dotnet and Mono on the same machine for desktop Linux.
Re:Update to the .NET Language Strategy by bmitc on Wednesday February 08, 2023 @06:50PM (#34717508)
For a new project that isn't Unity or Godot based?
Re:Update to the .NET Language Strategy by jchw on Wednesday February 08, 2023 @07:16PM (#34717767)
Mono's toolchain is entirely open source, but crucial parts of Dotnet core are not, such as the debugger. Linux developers are significantly more likely to care about this discrepancy.
Re:Update to the .NET Language Strategy by mattmanser on Wednesday February 08, 2023 @06:48PM (#34717489)
This seems like completely out-of-touch info.

You can run C# with .Net Core on linux now easily, no Mono involved and have been able to for years.

TBH, I thought Mono was dead. If it's not it's an extremely niche thing of people who want to write desktop apps for linux in C#, a tiny slice of the market.

I've run production ASP.Net core apps on linux (basically websites in C#), trivial to setup, even though I develop on Windows.

Re:Update to the .NET Language Strategy by jchw on Wednesday February 08, 2023 @07:20PM (#34717822)
I mentioned the official Dotnet SDK. You're out of date; it's not called Dotnet Core anymore; just Dotnet.

Mono is not dead. It's used in a bunch of commercial software for one thing, including Unity and Godot.

> If it's not it's an extremely niche thing of people who want to write desktop apps for linux in C#, a tiny slice of the market.

Can you think of why, other than marketshare, that I might mention Linux C# desktop apps in a thread about C# on Linux?

Re:Update to the .NET Language Strategy by mythz on Wednesday February 08, 2023 @07:26PM (#34717884)
> it's not called Dotnet Core anymore; just Dotnet.

The platform has been renamed to ".NET" (since v5), the SDK is ".NET SDK" the executable is named "dotnet", but it has never been branded that way.

Re:Update to the .NET Language Strategy by jchw on Wednesday February 08, 2023 @07:35PM (#34717972)
The point I was making is that what was once called .NET Core is now just .NET, after the merge with what was once called .NET framework. However, I think the name .NET is annoying to read and type, and it's ambiguous in a similar manner to Go, so I say Dotnet and Golang. Dotnet is literally just .net with the dot spelled out. It's not really a separate name.
Re:Update to the .NET Language Strategy by mythz on Wednesday February 08, 2023 @07:57PM (#34718213)
> The point I was making is that what was once called .NET Core is now just .NET

Right, IMO it's important to use these official correct labels when correcting someone.

"Dotnet" looks like an unintentional Autocomplete error. The executable and repo names use "dotnet" since using ".NET" or previously ".NET Core" would be awkward and unconventional.

I'm assuming "Golang" is used because "Go" is a generic ungoogleable word, any language without this issue e.g. Python, Java, Kotlin wouldn't need to make such concessions.

Re:Update to the .NET Language Strategy by jchw on Wednesday February 08, 2023 @08:35PM (#34718546)
Sure, it's not like .NET is Googleable either though. I thought the fact that Microsoft uses the term Dotnet (obviously, only when necessary) was good enough.
Re:Update to the .NET Language Strategy by pjc50 on Thursday February 09, 2023 @09:20AM (#34724248)
I love C# but this kind of Microsoft naming nonsense drives me up the wall. I'm sure it's negatively impacted mindshare since people can easily be mistaken as to what they're referring to.
Re:Update to the .NET Language Strategy by kcb on Wednesday February 08, 2023 @06:12PM (#34717008)
First class. I would wager that most new .NET projects are primarily targetting Linux for deployment.
Re:Update to the .NET Language Strategy by capableweb on Wednesday February 08, 2023 @06:22PM (#34717136)
Besides battling Visual Studio, `dotnet` cli and C# as a language, deploying a binary built on Windows to Linux was a breeze. If you're more used to the development environment, I bet it'd even be pleasant.
Re:Update to the .NET Language Strategy by viraptor on Wednesday February 08, 2023 @06:15PM (#34717050)
* for serverside
Re:Update to the .NET Language Strategy by kcb on Wednesday February 08, 2023 @06:27PM (#34717218)
Yea I'm guessing there's not a ton of fresh WPF or forms desktop apps being created. We've mostly moved to ASP.Net backends with React frontends wherever possible.
Re:Update to the .NET Language Strategy by viraptor on Wednesday February 08, 2023 @08:09PM (#34718319)
Oh, there's definitely a huge amount of wpf and winforms created every day. That's what I meant. Those people just don't visit HN that often. (Then again, I created 4 windows specific wpf apps last year...)
Re:Update to the .NET Language Strategy by jameshart on Wednesday February 08, 2023 @07:03PM (#34717652)
Unity3D is probably one of the most widely used cross platform native app development platforms, and it’s taking c# .net code to Linux, macOS, android, iOS and browsers via wasm.
Re:Update to the .NET Language Strategy by mythz on Wednesday February 08, 2023 @07:14PM (#34717757)
This doesn't speak to the cross-platform .NET Core runtime as Unity3D is built with C++ and still uses their modified fork of Mono to run C# code whilst their WASM uses their IL2CPP tool to convert .NET byte code to C++ before using Emscripten to convert to WASM.
Re:Update to the .NET Language Strategy by mastax on Wednesday February 08, 2023 @07:56PM (#34718197)
Unity is moving to .NET 5+ and, if I remember their documentation correctly, the hold up is entirely on their side and not due to the .NET runtime not being cross platform enough.
Re:Update to the .NET Language Strategy by HyperSane on Thursday February 09, 2023 @12:51AM (#34720228)
So C# -> bytecode -> C++ -> Javascript? Wow.
Re:Update to the .NET Language Strategy by pjmlp on Thursday February 09, 2023 @02:19AM (#34720727)
Not really, plenty of VS tooling doesn't exist on VS4Mac nor VSCode.

GUI frameworks don't consider Linux a deployment target, not even MAUI with its Xamarin heritage.

Due to its Windows original focus, lots of libraries still rely on Win32, COM and other Windows specific issues. This also inhibits most big name CMSs, which still rely on .NET Framework, e.g. Sitecore, SharePoint, Dynamics,....

Targeting Linux containers is usually only done by us if writing greefield microservices without many dependencies outside the standard library.

Re:Update to the .NET Language Strategy by foepys on Thursday February 09, 2023 @06:31AM (#34722428)
Stop wasting time with VSCode when doing professional development on .NET and use Rider on Linux and Mac. The C# addon for VSCode is lacking so many features compared to VS and Rider that it's mostly a toy.

The Rider licensing cost is negligible when compared to a developer's compensation.

Re:Update to the .NET Language Strategy by pjmlp on Thursday February 09, 2023 @07:54AM (#34723221)
I don't waste time, we mostly target Windows with .NET, for UNIX workloads we usually use node and Java, as you can see by my last sentence there is very little .NET/UNIX for us, and even so, it is developed on Windows deployed on Linux.

No need to pay for Rider licenses on top of the VS ones we already have.

Re:Update to the .NET Language Strategy by pleb_nz on Thursday February 09, 2023 @12:29PM (#34727615)
Not quite true, people can choose to use other tools that do work well cross platform e.g. Rider. VS and VSC agent the only ponies in town.

I don't even use VS on subdued installs anymore, it's no longer the better option.

Re:Update to the .NET Language Strategy by jjtheblunt on Wednesday February 08, 2023 @06:15PM (#34717053)
I use both on Linux (and Windows, and MacOS) and they're excellent.

Some libraries thought of as C# are bindings to Windows OS things, so those are platform specific.

You've really got to read the Microsoft Learn pages to get higher resolution for an answer, though.

Re:Update to the .NET Language Strategy by bmitc on Wednesday February 08, 2023 @06:21PM (#34717131)
Great. Just install the .NET SDK, and you get both languages. You can start an F# REPL immediately after installing with `dotnet fsi`.
Re:Update to the .NET Language Strategy by LAC-Tech on Wednesday February 08, 2023 @06:55PM (#34717564)
I remember that being missing for years. Nice.
Re:Update to the .NET Language Strategy by bmitc on Wednesday February 08, 2023 @07:01PM (#34717633)
The transition from .NET Framework to .NET Core and then to .NET 5+ was rough on F#, but it's been a net positive in the end. The .NET SDK and thus F# is one of the easiest things to install on nearly machine.
Re:Update to the .NET Language Strategy by foobarbaz33 on Wednesday February 08, 2023 @07:11PM (#34717724)
> to .NET Core and then to .NET 5+

Just to nitpick. Core -> 5+ was not really a transition. Just a rename to drop the word "Core". Core is still itself, still Core, just no longer called Core.

The old .NET is frozen at version 4.8. So Microsoft felt there was no longer a need to refer to Core as "Core" once it hit version 5+. Maybe a bit premature as the old .NET is still in heavy use. Now it's always unclear which .NET someone is talking about because they say ".NET" which may refer to the old .NET or maybe the new .NET formerly known as "Core".

Re:Update to the .NET Language Strategy by Kwpolska on Friday February 10, 2023 @03:14PM (#34745157)
They went from .NET Core 3.1 to .NET 5 and a yearly release cadence. The idea with .NET 5+ was also to unify the platform with support for building Windows desktop apps (WinForms/WPF) and mobile apps (Xamarin/MAUI).
Re:Update to the .NET Language Strategy by rqtwteye on Wednesday February 08, 2023 @06:28PM (#34717226)
We have been running .NET Core C# on Linux servers for quite a while now. Works great.
Re:Update to the .NET Language Strategy by xupybd on Wednesday February 08, 2023 @06:43PM (#34717425)
We are running NopCommerce (https://nopcommerce.com/) on Linux with no problems. This is ASP on .Net Core and everything works well.

I have a handful of smaller programs built on the SAFE stack. They're all F# and run very well on Linux. We use a lot of Excel interop so that is a no go on Linux but that is the only limitation I've found. It's not hard to have a server with an Office 365 license to run all of our Excel processing.

Re:Update to the .NET Language Strategy by acedTrex on Wednesday February 08, 2023 @06:43PM (#34717430)
I exclusively do C# dev on macos for what thats worth
Re:Update to the .NET Language Strategy by ihateolives on Wednesday February 08, 2023 @11:06PM (#34719624)
With Rider or VS Code on Mac? I've been wanting to play around with C# but I already have Intellij Idea Ultimate subscription and I'm hesitant to add another one. I'm wondering how good of an experience would VSC be for C#.
Re:Update to the .NET Language Strategy by Clubber on Wednesday February 08, 2023 @11:27PM (#34719750)
I've used VSC as a professional for 4 or 5 years now and love it. I prefer it over Visual Studio because the latter is so feature bloated. I'm currently using and M1 Mac to develop on and it works fine. Once you learn the shortcuts, you'll be zooming around.

Azure Data Studio is on its way to being a nice cross platform environment for databases, but it's not fully cooked yet. It was progressing really well but the last few months, it's been really slow to start the execution of any query for some reason. Hopefully they will fix that soon.

Both environments are plug-in based and there are a lot of good free ones available. You should definitely check it out.

Re:Update to the .NET Language Strategy by zamalek on Wednesday February 08, 2023 @06:46PM (#34717460)
At work our C# codebase never touches Windows (all developers except me use MacOS, I am testing Linux). Production is Linux. We all use Rider, which pretty good (but extremely crashy when debugging). Probably in the region of 500Kloc.
Re:Update to the .NET Language Strategy by blevin on Wednesday February 08, 2023 @06:50PM (#34717506)
What sort of system is it? Linux is reportedly around 30Mloc, Chrome around 5Mloc.
Re:Update to the .NET Language Strategy by zamalek on Wednesday February 08, 2023 @06:52PM (#34717520)
My bad, I corrected the unit.
Re:Update to the .NET Language Strategy by andsoitis on Thursday February 09, 2023 @05:39AM (#34722073)
curious: what led the company to choose the CLR/C# over the JVM/Java?
Re:Update to the .NET Language Strategy by zamalek on Thursday February 09, 2023 @12:52PM (#34728139)
I wasn't around when the decision was made. However, we moved from Ruby to .Net. I'm not sure if Java was ever even a consideration.
Re:Update to the .NET Language Strategy by kevingadd on Wednesday February 08, 2023 @06:53PM (#34717533)
My day job is to work on the .NET runtime and I do 99% of my development in a debian VM (remoting in with VS code as my text editor). I can't remember the last time I hit a platform specific roadblock or needed Windows to do something.
Re:Update to the .NET Language Strategy by pleb_nz on Thursday February 09, 2023 @12:25PM (#34727546)
I do so my .net dev on macOS and Linux including backend, front end and xam mobile dev. No issues.

Rider is your friend.