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

C# types as arguments and returns #121

Open
Laeeth opened this issue Aug 22, 2019 · 6 comments
Open

C# types as arguments and returns #121

Laeeth opened this issue Aug 22, 2019 · 6 comments
Assignees
Labels
C# C# wrapping enhancement New feature or request

Comments

@Laeeth
Copy link
Contributor

Laeeth commented Aug 22, 2019

I want to replace step by step a large c sharp codebase. 800k sloc!

I need to be able to take csharp classes and interfaces as parameters and return type. But how?

You could make a ClrClass(T) type. Two stage build. Stage one it just accepts any old opdispatch and generates csharp boilerplate. Stage two the same calls generate D mixin code to hook up to the boilerplate.

Exactly what boilerplate depends. But maybe see what you think of concept.

@atilaneves
Copy link
Collaborator

I need to be able to take csharp classes and interfaces as parameters and return type. But how?

I would assume in the same way that excel-d and pynih do it: convert at the seams.

@atilaneves atilaneves added C# C# wrapping enhancement New feature or request labels Aug 22, 2019
@Laeeth
Copy link
Contributor Author

Laeeth commented Aug 29, 2019

I don't see how excel-d does it. You don't have Excel types that don't exist at the time excel-d was written.

Python is dynamic so how do static types from alien code come to be relevant?

@atilaneves atilaneves changed the title Csharp types as arguments and returns C# types as arguments and returns Sep 2, 2019
@atilaneves
Copy link
Collaborator

Python is dynamic so how do static types from alien code come to be relevant?

At the moment, they all become Python classes in both python backends. I would expect C# to be similar, with the difference that it has more options for conversion, but since they map to D's interface, class and struct types anyway I don't foresee any problems.

@atilaneves
Copy link
Collaborator

But wait: this is wrapping C# for D then, right? So the opposite direction of what we're doing.

@Laeeth
Copy link
Contributor Author

Laeeth commented Sep 3, 2019

It's the opposite direction yes. But lambdas, return types and the ability to replace part of it at a time.

@Laeeth
Copy link
Contributor Author

Laeeth commented Sep 3, 2019

This is quite different from problems of python and excel. You never get an excel type that wasn't known at the time you wrote autowrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C# C# wrapping enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants