24 ms·
If I'm reading this correctly, the "modern C++" part of the library is in fact supplied by a C++ wrapper around a C-style API.
by SloopJon 8y ago
If I'm reading this correctly, the "modern C++" part of the library is in fact supplied by a C++ wrapper around a C-style API.
- hsivonen 8y agoCorrect. The Rust API is recreated in C++ using the corresponding C++ facilities with a C API in between.
- lightedman 8y ago"with a C API in between." I smell vulnerabilities miles away with that sort of implementation. Hope the Rust programmers remember basic garbage collection in C, since C itself doesn't have it automated.
- kibwen 8y agoJust because it's using a C-style API doesn't mean there needs to be any C code involved at all (I don't know if there is in this case, but in general it's not necessary). You have one side say "hey, pretend this code I've got here is C", and the other side says "hey, let me call this function that I think is C". Every language has a way of calling C functions, so you don't even necessarily need a C compiler.
- hsivonen 8y ago> I don't know if there is in this case In this case, there indeed is no .c compilation unit between the C++ and Rust code that see each other via C linkage.
- msbarnett 8y agoYou should really consider reading the article before commenting on it. The mechanisms for deleting heap memory obtained from Rust are discussed in depth.