Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target older .NET verisons #217

Open
AnakinRaW opened this issue Jan 2, 2025 · 5 comments
Open

Target older .NET verisons #217

AnakinRaW opened this issue Jan 2, 2025 · 5 comments

Comments

@AnakinRaW
Copy link

Hey,
are there plans to release this package for older .NET versions, namely netstandard2.0?

Regards

@linkdotnet
Copy link
Owner

linkdotnet commented Jan 2, 2025

Hey @AnakinRaW

netstandard2.0 doesn't directly support ReadOnlySpan<T> and friends (ISpanFormattable), which would greatly reduce the library's value. Many functions wouldn't be available or wouldn't have the same benefit as they have with net6.0 and beyond.

EDIT: Even netstandard2.1 doesn't know some of the types.

@linkdotnet
Copy link
Owner

Just to clarify: I am interested in backporting this onto older .net versions, but the benefit might be neglectable (in comparison to System.Text.StringBuilder).

@AnakinRaW
Copy link
Author

AnakinRaW commented Jan 2, 2025

in some projects i already copied parts of the .NET's value string builder with positive, or at least not negative effects for netstandard2.0.
Sure you need to add a few more .AsSpan() there but allocs and perf still benefit from it.

A backport to older versions for me means having it far more easier writing code for all my target platforms.
In other words: As long as a backport on netstandard2.0 is fully functional, even with perf "as bad as " System.Text.StringBuilder , i personally would take it.

But i'd understand if you don't want to add that maintenance effort for this package.

@linkdotnet
Copy link
Owner

I tried to support netstandard2.0 - most fixes are done via the System.Memory package that backports System.Span and friends. Some other fixes are done via #ifdef !NETSTANDARD2_0. If it would be only for this, I would go a head and support netstandard2.0.
But: There is no support for ISpanFormattable in netstandard2.0 (also not in netstandard2.1), which would duplicate much of the code as some of the logic internally relies on those types. For the netstandard2.0 support I would have to write netstandard2.0 specific versions. I would like to avoid this as much as possible.

I will leave it open for now, because there might be something obvious I am missing.

@AnakinRaW
Copy link
Author

other than disabling some public APIs with #if directives for unsupported targets, i do not know anything more clever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants