Choosing between importing a c++ library or writing code instead, in an existin golang projectg

I have a golang project and in the need of expanding a small functionality i have two option:

  1. the new module exists in the form of a C++ lib and this can be imported to my golang project.
  2. write the code for the module to avoid any limitation between golang and c++.

which one to choose?

We don’t know your library. It may be trivial or it may be a behemoth with complex state or algorithms. You need to consider tradeoffs with the extra complexity of competing memory management and marshalling when call C++ from Go, or extra time spent and introducing errors in porting, etc.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.