For the C# interface, we will wrap our existing unmanaged C++ code with Managed C++ classes that are compiled with the C++/CLI switch. The ultimate authority for all things C++/CLI is the Microsoft manual https://msdn.microsoft.com/en-us/library/68td296t.aspx. However that is a bit like drinking from a fire hose.
I found a simpler description at http://www.delmarlearning.com/companions/content/1592009638/bonus/009638_BonusCh02.pdf
This appears to be a chapter from a book…but I don’t think we need the book.
My thinking is to add a new folder nupic.core\src\nupic\cs_support that will contain all Managed C++ wrappers, one file per managed C++ class. C# can directly link to the Managed C++ wrappers.
We will also need a test program in nupic.core\src\test\integration, probably a C# program to verify that the integration works. Ideally this should be written BEFORE we write the wrappers, using the API document as the guide.
And we will need a CMake module (comparable to nupic.core\src\NupicPythonInterface.cmake that I made for the Python build) which will build everything for the C# interface into a new dynamic library nupic_core_cs.dll that C# can link to.
We don’t need the SWIG interfaces. We can pass-through the capnproto calls for archiving serialization but I don’t think we need any new capnp definitions. We will not need anything like the PyRegion because the callback can be handled by the managed code wrappers. Since C# is primarily a Windows thing we don’t have to verify that this builds or even runs under Linux.
We will need to port at least part of the Python code in the nupic repository to C#…at least some of the sample code. The majority of the effort will be writing the wrappers. If either of you already have some Managed C++ wrappers written or would like to take on some of them, let me know so we don’t duplicate effort. I will Identify the classes that need to be wrapped based on Numenta’s API document then we can start coding.
@chhenning I think that when you have the pybind11 interface working we can fold that into the package without affecting the C# project. Remember that the Python code in the nupic repository (or at least part of it) needs to be ported to Python 3.x at some point.