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

Could this library benefit from C++/CLI? #1

Closed
nikeee opened this issue May 18, 2021 · 2 comments
Closed

Could this library benefit from C++/CLI? #1

nikeee opened this issue May 18, 2021 · 2 comments

Comments

@nikeee
Copy link
Owner

nikeee commented May 18, 2021

We could probably write the C++-wrapper in C++/CLI. If that would be the case, we wouldn't need any p/invokes for accessing that from C#. We could just reference that directly.

Some refs:

Maybe there are other things like C#9's function pointers that could enhance performance.

@nikeee nikeee changed the title Could this library benefit from C++/CLI Could this library benefit from C++/CLI? May 18, 2021
@nikeee
Copy link
Owner Author

nikeee commented May 18, 2021

dotnet/core#4975 (comment)

It's legacy technology. So don't opt-in for that.

@nikeee nikeee closed this as completed May 18, 2021
@nikeee
Copy link
Owner Author

nikeee commented Sep 5, 2021

Maybe C#9's function pointers?

If this p/invoke source code generators?
dotnet/runtime#43060
https://github.com/dotnet/runtime/blob/main/docs/design/features/source-generator-pinvokes.md

They maybe they will be part of the compiler, so we won't need to change anything to benefit from this?

But, however, this is important:

Ability to innovate in support of modern .NET types (e.g., ReadOnlySpan/Span).

If they support Span<T> in p/invokes, it would be a game changer (currently, this is not supported because generics cannot be marshalled in general).

Also:

Non-Goals:
Zero code change for the developers.

So we might need to change something.

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

1 participant