Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there any progress on C++ to Rust? I know the whole language is huge, so maybe even a little support could be opening a can of worms.


We haven't worked on C++ yet. Templates are the big issue, as a sibling comment speculates.


Most of the language probably isn't too far from C to be done, but I can't even guess at what would have to be done for C++'s templates.


The closest Rusty feature to C++ templates is most likely macros. I don't think even const generics, specialization etc. (which are WIP anyway at the moment) would be enough to replicate templates in the fully general case.


I most surely misunderstand something: why are templates not replaceable with Rust generics?


The simple answer is that C++ templates can do more than Rust generics can, including some things that in Rust you'd use the macro system for, and probably some things that you'd have to translate by expanding out the template and turning that result into Rust.


This crate was actually announced a few days ago. https://github.com/dtolnay/cxx




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: