dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.18k stars 4.72k forks source link

Bring back Assembly Neutral Interfaces #7176

Open lilith opened 7 years ago

lilith commented 7 years ago

We were very close to achieving loose coupling in .NET via Assembly Neutral Interfaces... then victory was snatched from our grasp with its removal in 2015. I know this would also need to be added to .NET Full, but it is a very worthwhile feature.

Diamond dependencies are a problem, MxN adapter proliferation is madness, and this is a pain point even for basic tasks. This small thing would represent a significant reduction in pain/friction for OSS authors seeking interoperability with other packages. We're tired. We want our time and keystrokes to go farther, and preferably while remaining on .NET

True structural typing has been suggested for C#, but it looks like this is unlikely to get any attention. foreach + GetEnumerator alone gets this special ability. ANI consumption was supported by all CLR languages.

If the NuGet ecosystem is never able to expand past the interfaces in System.*, how will we ever start making progress on library compatibility?

Adding dependencies just for interface assemblies does not happen, particularly if interoperability is not absolutely crucial. It's not worth the risk and cost.

I'd like to reiterate the comments when the supporting ~900 lines of code for ANI were pulled.

"BOOOOOOOO!" - @ChrisMcKee "Why?" - @adamralph "yeah, whats with this?" - @Jetski5822 "NOOO!" - @markrendle

And kindly request that this feature be reconsidered for inclusion in both versions of .NET.

jkotas commented 7 years ago

The ANI prototype had bad performance characteristics. It would be performance disaster if it gets used broadly in the form that it was implemented.

@davidwrighton and @jaredpar are looking into how to do it properly.

davidfowl commented 7 years ago

That's the first I'm hearing about this and it makes me very happy 😊

damianh commented 7 years ago

@jkotas Is there an issue to track this or anything to share (even thoughts) at this point?

I, for one, look forward to killing LibLog.

graemechristie commented 7 years ago

Is there any update on this @davidwrighton and @jaredpar ? Is there somewhere we can track the progress of the new feature ?

jaredpar commented 7 years ago

@graemechristie no updates as of yet. A couple of other items have priority at the moment. Going to switch back to ANI / other type system innovations later in the summer.

graemechristie commented 6 years ago

Are there any more updates on this @davidwrighton and @jaredpar ?

kzu commented 4 years ago

Would love to see some movement on this one. I think it can be big to grow the ecosystem more easily and achieve quicker agreements on shared contacts.

adamralph commented 4 years ago

I guess now that .NET is going to be a single platform (.NET 5) and no more .NET Framework, this will be easier?

jaredpar commented 4 years ago

I plan to revisit this for the post .NET 5 world. Still heads down on .NET 5 at the moment though.