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

[Question] Plans to use the new cppwinrt project? #28

Open
pingzing opened this issue Dec 5, 2016 · 6 comments
Open

[Question] Plans to use the new cppwinrt project? #28

pingzing opened this issue Dec 5, 2016 · 6 comments

Comments

@pingzing
Copy link

pingzing commented Dec 5, 2016

Looks like Microsoft just released a new repo that contains Vanilla C++ projections for WinRT: https://github.com/Microsoft/cppwinrt (and the associated blog post)

Would using this be easier than generating the necessary metadata from the DLLs themselves? Mostly asking as a curious party.

@pingzing pingzing changed the title [Question] Planns to use the new cppwinrt project? [Question] Plans to use the new cppwinrt project? Dec 5, 2016
@Boddlnagg
Copy link
Collaborator

If by "using this" you mean "wrapping these C++ headers" from Rust (or generating the Rust wrappers from C++ headers instead of from the winmd files), that's probably not easier, because interfacing with C++ from Rust is not (yet) as easy as interfacing with C. Furthermore, they use co_await for asynchronous calls, which I think is only available in Microsoft's C++ compiler at the moment.

However, this also looks like it's also autogenerated (who would write code like this by hand?) and we might be able to get some inspiration how they solved certain things (especially since they say it's more efficient than using C# or C++/CX). Maybe they will even open-source the tools to generate these headers at some point. By the way, C(++) headers for WinRT (without C++/CX) already existed previously (available via the Windows SDK), and winrt-rust has already drawn some inspiration from there.

Anyway, thanks for pointing this new project out to us!

@pingzing
Copy link
Author

pingzing commented Dec 7, 2016

Ah, I wasn't aware that C++-from-Rust was notably trickier than C-from-Rust (though I guess I should have been). Anyway, thanks for satisfying my curiosity, and happy to at least give you a source of inspiration!

@Boddlnagg
Copy link
Collaborator

I have now looked at this again, and especially the information on https://moderncpp.com/ and https://kennykerr.ca/ (the author's blog) is very helpful and inspiring indeed!

@Boddlnagg
Copy link
Collaborator

There are also some talks from CppCon 2016 about this: https://www.youtube.com/watch?v=lm4IwfiJ3EU and https://www.youtube.com/watch?v=v0SjumbIips

@Boddlnagg
Copy link
Collaborator

Another interesting video from CppCon 2017: https://www.youtube.com/watch?v=7TdpWB_vRZM

@ZHOUYue67
Copy link

Now C++/WinRT compiler is open source with a project called xlang.
https://kennykerr.ca/2019/01/25/getting-started-with-xlang-and-cppwinrt/
https://github.com/Microsoft/xlang

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

3 participants