Live data from Hacker News

What .NET 10 GC changes mean for developers

roxeem.com

231–240 of 253 posts

Re: What .NET 10 GC changes mean for developers

#231
post #229

All of this is just a clone of features of java. They even copied the name from java: "escape analysis". https://en.wikipedia.org/wiki/Escape_analysis

.NET JIT developer here.

What else would we call it? It is what it is.

I believe there are some differences between what .NET does and what mainstream Java does. For instance, objects can be stack allocated even if they can't be turned into collections of scalars. This allows the JIT to stack allocate small known-sized arrays.

Re: What .NET 10 GC changes mean for developers

#232
post #223

Earlier quoted context omitted.

Some examples: - Attributes can do a lot of magic that is not always obvious or well documented. - ASP.NET pipeline. - Source generators. I love C#, but I have to admit we could have done with less “magic” in cases like these.

Attributes do nothing at all on their own. It's someone else's code that does magic by reflecting on your types and looking for those attributes. That may seem like a trivial distinction, but there's a big difference between "the language is doing magic" and "some poorly documented library I'm using is doing magic". I rarely use and generally dislike attributes. I sometimes wonder if C# would be better off without th…

> But I haven't used source generators in C# in at least 10 years

Source generators didn't exist in C# 10 years ago. You probably had something else in mind?

Re: What .NET 10 GC changes mean for developers

#233
post #200
post #45

Earlier quoted context omitted.

Having worked with C# professionally for a decade, going through the changes with LINQ, async/await, Roslyn, and the rise of .NET Core, to .NET Core becoming .NET, I disagree. I certainly think that C# is a great tool and that it’s the best it has ever been. It’s also relies on very implicit behaviour, it is build upon OOP design principles and a bunch of “needless” abstraction. Things I personally have come to view…

I have been coding in C# for 16 years and I have no idea what you mean by "hidden indirection and runtime magic". Maybe it's just invisible to me at this point, but GC is literally the only "invisible magic" I can think of that's core to the language. And I agree that college-level OOP principles are an anti-pattern; stop doing them. C# does not force you to do that at all, except very lightly in some frameworks wher…

> Just don't write bad code;

If we're writing good code then why do we even need a GC? Heh.

In decades of experience I've never once worked in an organisation where "don't write bad code" applied. I have seen people with decades of experience with C# who don't know that IQuerable and IEnumerable load things into memory differently. I don't necessarily disagree with you that people should "just write good code", but the fact is that most of us don't do that all the time. I guess you could also argue that principles like "foureyes" would help, but it doesn't, even when they are enforced by leglisation with actual risk of punishments like DORA or NIS2.

This is the reason I favour Go as a cross platform GC language over C#, because with Go are given fewer opportunities to fuck up. There is still plenty of chance to do it, but fewer than other GC languages. At least on the plusside for .NET 10 they're going to improve IEnumerable with their devirtualization.

> hidden indirection and runtime magic"

Maybe not in C#, but C# is .NET and I don't think it's entirely fair to decouple C# from .NET and it's many frameworks. Then again, I could have made it more clear.

Re: What .NET 10 GC changes mean for developers

#234

Earlier quoted context omitted.

Python is the world's most used scripting language, but for application programming languages there are other languages that are widely used and better to compare to F#. For example, C# and Java.

F# was pitched by Microsoft to be used in areas where Python dominates, especially for scripting in the finance domain and "rapid application development". So it doesn't make sense at all that C# and Java are a "better comparison".

> F# was pitched by Microsoft to be used in areas where Python dominates

Haha, no. Microsoft barely talks about F# at all, and has largely left the evolution of the language up to the open source community that supports it. Furthermore, you shouldn't take your cues about what a language is best suited for from marketing types, you should evaluate it based on its strengths as a language and broader ecosystem. If you seriously doubt that C# is a better comparison to F# than Python, then I suspect you haven't used either C# or F# and you're basing your views on marketing fluff.

Re: What .NET 10 GC changes mean for developers

#235

Earlier quoted context omitted.

F# was pitched by Microsoft to be used in areas where Python dominates, especially for scripting in the finance domain and "rapid application development". So it doesn't make sense at all that C# and Java are a "better comparison".

> F# was pitched by Microsoft to be used in areas where Python dominates Haha, no. Microsoft barely talks about F# at all, and has largely left the evolution of the language up to the open source community that supports it. Furthermore, you shouldn't take your cues about what a language is best suited for from marketing types, you should evaluate it based on its strengths as a language and broader ecosystem. If you s…

Less of the personal attacks please, you know nothing about me. I actually think it is you that is missing context here. Don Syme personally visited and presented at a variety of investment banks. He was the creator not a marketing type. I was present at one of his pitches and met him. One bank, Credit Suisse ended up adopting it. Any comparisons he made to C# where based around readability and time to market (C# is very verbose and boilerplate heavy compared to both Python and F#). This was all on the 2010-2015 timeframe. Python ended up winning in these markets. My point has always been that this now puts it in a difficult position, it's simply not radical enough to disrupt but still carries the perceived "functional programming" barrier to entry.

Re: What .NET 10 GC changes mean for developers

#236

Earlier quoted context omitted.

Except for F#, which also gets all the .NET10 cross-platform GC improvements for free and is a better programming language than C#.

+1 F# is criminally under-used

I used it for many years but ended up switching to C#. The language needs better refactoring tools. And for that it needs something like Roslyn. The existing compiler library is too slow.

Re: What .NET 10 GC changes mean for developers

#237

Earlier quoted context omitted.

+1 F# is criminally under-used

I used it for many years but ended up switching to C#. The language needs better refactoring tools. And for that it needs something like Roslyn. The existing compiler library is too slow.

That would be nice, but refactoring canonical F# is still far easier than C# due to its referential transparency.

https://dev.to/ruizb/function-purity-and-referential-transpa...

Re: What .NET 10 GC changes mean for developers

#238
post #55

I am considering dotnet Maui for a project. On the one hand, I am worried about committing to the Microsoft ecosystem where projects like Maui have been killed in the past and Microsoft has a lot of control. Also XML… On the other hand, I’ve been seeing so many impressive technical things about dotnet itself. Has anyone here used Maui and wants to comment on their experience?

Speaking as an experienced desktop .NET Dev, we've avoided it due to years of instability and no real confidence it'll get fully adopted. We've stuck with WPF, which is certainly a bit warty, but ultimately fine. If starting fresh at this point I'd give a real look at Avalonia, seems like they've got their head on their shoulders and are in it for the long haul.

My big issue with Avalonia is the lack of native WebView control. In fact, I could not find one at all that would work OK on mobile and desktop.

Re: What .NET 10 GC changes mean for developers

#239

Earlier quoted context omitted.

I used it for many years but ended up switching to C#. The language needs better refactoring tools. And for that it needs something like Roslyn. The existing compiler library is too slow.

That would be nice, but refactoring canonical F# is still far easier than C# due to its referential transparency. https://dev.to/ruizb/function-purity-and-referential-transpa...

No, it is not. Referential transparency Plus F# as a functional language has significant gaps that prevent effective refactoring, such as lack of support for named arguments to curried functions.

Re: What .NET 10 GC changes mean for developers

#240

Earlier quoted context omitted.

That would be nice, but refactoring canonical F# is still far easier than C# due to its referential transparency. https://dev.to/ruizb/function-purity-and-referential-transpa...

No, it is not. Referential transparency Plus F# as a functional language has significant gaps that prevent effective refactoring, such as lack of support for named arguments to curried functions.

Can you give me an example where lack of support for named arguments to curried functions makes refactoring difficult? I'm having trouble understanding how that would happen.
Post reply on HN