3 ms·
Learning C++ is a big endeavor, I think you first need to think about what you want to achieve. As I read it, I think it would be easier to just write a little
by nuancebydefault 4y ago
Learning C++ is a big endeavor, I think you first need to think about what you want to achieve.
As I read it, I think it would be easier to just write a little simple Cpp class layer or even rather simple functional C API on top of the functionality you need from the templated lib, and then bind that to Rust. For those bindings, you can find more easily simple examples. Saves you entering a big rabbit hole, the hassle of needing to know about many cpp aspects, they are plentiful.
- iudqnolq 4y agoThat's close to my plan, but I quickly realized I needed to rigorously learn a minimum amount of cpp to write that layer correctly. I've never bound to this templated and complex a cpp library before. (My exact plan is to expose a tiny API with very straightforward data structures. I'll then write simple Rust bindings to that. I need web and native. I've explored enough to think that compiling the cpp to a wasm module via emscripten and then manually writing Rust to call functions in a different wasm module should be feasible)