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

I'm not sure how this can scale since it is still not automatic and requires tweaking and maintenance of the bindings; or even if the library has a new update. (As there can be new errors, bugs generated from those bindings)

It still would be painful to maintain and update your Rust project and cargo configs with your C++ code alongside a third party crate maintained by one person in the project. D Lang is probably the only language that has this built into into the language and is done automatically.

I'd still rather go for a first party library with this support or C++ interop support feature built into the language like D with the whole requirement of it being completely automatic.




If you are in the unfortunate position of having to use swift....


What is wrong with Swift? It isn’t my favorite, but at least it was way easier to pick up and get productive with than Rust. The creator of Rust ironically works on Swift so they borrow many ideas from Rust. Rust is more systems programming and Swift more for application programming.


FFI is painful, to be sure. Making sure the bindings you say you're using match the ones you're actually using is tedious and error-prone.

Which is where CXX comes in: the static analysis tells you if you're holding it wrong. So to your first point, the compiler will tell you exactly what needs to change.

I don't know what the developer experience with D/C++ interop looks like, but unless I'm missing something big I'd assume you'd still need to make changes when the library has updates.


autocxx is a companion library that provides what you're looking for. https://github.com/google/autocxx


That attempts to provide it. I have been trying to use autocxx for a while, without success at the moment.

It is very actively developed though so I trust that we'll get there eventually.


It’s also built into Nim, for what it’s worth, though I do think D’s handling of C++ is more ergonomic.


I was under the impression that both .cpp and .cc were far more common.


You may have replied to the wrong comment thread


Right you are. I'm not sure how this happened.




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

Search: