Something about the csharp-mode package in the upcoming GNU Emacs 29

8 replies [Last post]
CustardPie
Offline
Joined: 01/23/2023

Hey! New here, mostly a lurker but recently there was something that's been on my mind for awhile and I decided to write this topic since there's something slightly contradictory going on.

The upcoming version of Emacs 29 is the new major development of the GNU Emacs editor. It will include new features such as a native treesitter implementation, a native way to interface with LSP via a package known as Eglot and even includes new things for typical users of non-free platforms like Windows such as double-buffered rendering, along with many, many other things.

But there's something that I felt was relatively off, at least speaking in general terms. Emacs has support for several languages via third-party packages provided by the package manager of choice of your own configuration. One of those languages is csharp, a language that, historically in this forum at least has been the subject of one major source of controversy: The fact that its implementation, even if it is free software, is patent-encumbered. This has been shown repeated times in the forum several times and has been explained in quite a bit of detail, here are some relevant links for your pleasure: https://trisquel.info/en/forum/new-member-who-needs-helpadvise, https://trisquel.info/en/forum/net-core-open-source, https://trisquel.info/en/forum/what-state-microcoft-patent-threat-2021, https://trisquel.info/en/forum/should-c-mono-be-allowed-trisquels-repository and even https://trisquel.info/en/forum/monogame-it-free-software (MonoGame is a sort of reimplementation of XNA, the latter being wrappers for DirectX written in C# with the aim of MonoGame being more portable than that, it is relevant to this discussion because it is one of the most important and popular packages that C# itself has to offer)

With evidence in hand, we can see why it is heavily discouraged here to make new developments of most projects in C# given these patent issues. Ergo, we go back to Emacs once more. GNU/Emacs is one of the most important works of the GNU project. Is one of the oldest and also one of the most respected editors out there in regards to both its flexibility and extensibility and said editor will include a mode for editing files and having direct support for C# build systems integrated into the core of Emacs, yes, the core of Emacs for 29, according to: https://elpa.gnu.org/packages/csharp-mode.html ("This mode is now strictly in maintenance mode. That means that no new features will be added, and the mode itself will be moved into core. Thus development of support for C# will continue in core Emacs")

So now you can see that I am a bit confused. Obviously, given Emacs extensibility one could simply ignore this package and move on with life, no need to bother with new projects or developments with C# even if it's there as the package is something that can be disabled or deleted from the repo and moving on. But this also means that most default installations of Emacs 29 will come with this package by default, not only that, Emacs 29 also comes with facilities to allow you to also install a treesitter for C# too.

Given this. I can only take this with the intent that Emacs developers are, one way or another, encouraging developers to work with C# related codebases or to have it as a way to quickly edit or participate in discussions related to C# codebases, as, quite obviously, there isn't much else that csharp-mode will be doing outside of that specific role. And I just find that strange. Why would you add a package of a language whose implementations (dotnet/.NET and Mono) has those patent issues.

I have been racking my brains for days if this is a topic worth discussing honestly. In the grand scheme of things, is not something that matters a lot. It is a package, it can be easily removed and then move on. But then the topic of patents related to Mono and Dotnet came to mind once more and we go back starting from scratch.

So I'd like to hear opinions on the matter at hand. It'd be reassuring to know for someone to tell me that this is not really a problem and that now people can be happy with writing free software using C#. But the prior evidence and the podcasts on software patents don't make this a reality to me, so I'd like to hear some more point of views about it if possible. They say new perspectives can help with broadening one's horizons so that'd be helpful to have right now.

Cheers!
CustardPie

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

I can only take this with the intent that Emacs developers are, one way or another, encouraging developers to work with C# related codebases or to have it as a way to quickly edit or participate in discussions related to C# codebases, as, quite obviously, there isn't much else that csharp-mode will be doing outside of that specific role.

Emacs developers would probably disagree. In fact, rms himself would probably disagree. When he initially warned about the danger of depending on C# (when Microsoft was showing signs it would use the patents on .NET to attack the free software community), he included those paragraphs:

This is not to say that implementing C# is a bad thing. Free C# implementations permit users to run their C# programs on free platforms, which is good. (The GNU Project has an implementation of C# also, called Portable.NET.) Ideally we want to provide free implementations for all languages that programmers have used.

The problem is not in the C# implementations, but rather in Tomboy and other applications written in C#. If we lose the use of C#, we will lose them too. That doesn't make them unethical, but it means that writing them and using them is taking a gratuitous risk.

https://www.fsf.org/news/dont-depend-on-mono

prospero
Offline
Joined: 05/20/2022

The idea of "taking a gratuitous risk" is probably what led him to conclude with:

"We should systematically arrange to depend on the free C# implementations as little as possible. In other words, we should discourage people from writing programs in C#. Therefore, we should not include C# implementations in the default installation of GNU/Linux distributions or in their principal ways of installing GNOME, and we should distribute and recommend non-C# applications rather than comparable C# applications whenever possible."

About Portable.net: "As of December 2012, the DotGNU project has been decommissioned, until and unless a substantial new volunteer effort arises."
https://www.gnu.org/software/dotgnu

CustardPie
Offline
Joined: 01/23/2023

Ditto what prospero said, just following him up in adding a few more details. As far as I understand it (would love to be proven wrong), other than the DotGNU project, which has been decommissioned, there have been no major efforts to implement a C# runtime that would satisfy the requirements of them being not patent-encumbered (aka, not developed primarily by Microsoft)

And given the existing info. It doesn't seem like the patents for C# ran out either. So the inclusion of this csharp-mode package in core emacs by default becomes even more confusing to me now.

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

As far as I understand it (would love to be proven wrong), other than the DotGNU project, which has been decommissioned, there have been no major efforts to implement a C# runtime that would satisfy the requirements of them being not patent-encumbered (aka, not developed primarily by Microsoft)

There is Mono, which has always been in Trisquel's repository, but never in its default install (whatever the edition): https://www.mono-project.com

"Not developed by Microsoft" does not mean patent-unencumbered. You are probably confusing copyright, which protects the work as it is written, and patents, which grant monopolies on ideas. Those ideas do not even need to be implemented! One can develop nothing but own patents and attack those implementing the ideas the patents cover.

Patents on software are an absurdity: https://patentabsurdity.com

The risk patents on .NET raise looked higher because, at the time, Microsoft "declared itself the enemy of GNU/Linux and stated its intention to attack our community with patents": https://www.fsf.org/news/2009-07-mscp-mono

Fortunately, as far as I know, that intention was never put in practice and the free software community has not much embraced C# (Gnote replaced Tomboy, Shotwell replaced F-Spot, GNOME Shell replaced GNOME Do, etc.). Nowadays, Microsoft declares "it loves Linux". As a consequence, Microsoft will probably not use the patents on .NET to attack us: it would not hurt the free software community much but would hurt the image Microsoft now wants to show.

Anyway, for a lesser risk, I would still recommend Java (which is similar) over C#.

CustardPie
Offline
Joined: 01/23/2023

Ah, I understand now. Thanks for clarifying this. I have forgotten that Microsoft now considers itself that its 'love for linux' is pretty high now. With such a reputation behind, they have more to lose than the community with those types of possible lawsuits. I suppose I could see now the reasoning behind adding csharp-mode in emacs core. Since both current implementations (Mono and .NET) are free software, and MS hasn't pulled any of those patent moves, I guess there isn't that much harm in bundling that mode with Emacs (Also, as for that list of software you mentioned. Pinta (C#/GTK) is still actively updated, and is still recommended sometimes due to its complexity being lesser than that of GIMP, which helps beginners. Albeit I am not sure how used or known that package is anymore admittedly)

I do think your recommendation is probably the safer option in the future though, that of using Java over C# due to it not having the latter risks.

Magic Banana

I am a member!

I am a translator!

Offline
Joined: 07/24/2010

I am not sure how used or known that package is anymore admittedly

Personally, I believe I had never heard of Pinta before you mentioned it. I am not into drawing/editing images though. Searching about Pinta, I ran into LazPaint, which I did not know either: https://lazpaint.github.io

LazPaint targets as well the simpler-than-GIMP niche. It is written in Free Pascal (an uncommon choice, but one that does not raise known patent issues).

CustardPie
Offline
Joined: 01/23/2023

As far as C# projects go in the free software community, Pinta would be the most active of the original that came during the early Mono/GTK days (Most of what you have mentioned has been replaced as per your post, including Banshee as well). Nowadays they are working on a GTK4/.NET port though, I do agree that LazPaint covers what Pinta does in the niche it targets, and, as you mentioned, has no known patent issues with its implementation language.

I primarily came to know of Pinta due to an earlier recommendation but primarily knew of its updates due to a site known as librearts, where they write about creative software and its updates/development plans, here's an example of the latest one: https://librearts.org/2023/01/week-recap-22-jan-2023/

That's arguably the biggest project that represents C# in the free software community as a whole though (Pinta I mean). Other than frontends written in C# for existing free software, there isn't much else out there as it hasn't really caught on with the community. (And for good reason, what with this whole discussion about patents and all taking place)

andyprough
Offline
Joined: 02/12/2015

LazPaint is now the default graphics editing program in the MX distro. antiX (and my Libre-antiX respin) uses an even simpler one called mtpaint that is in the Debian stable repo.

mtpaint is interesting especially for very old hardware: "Due to its efficient design it can run on older PC hardware (e.g. a 200MHz CPU and 32MB of RAM)."
It is GPL3 and written in C: https://github.com/wjaguar/mtPaint