OpenNARS-for-Applications icon indicating copy to clipboard operation
OpenNARS-for-Applications copied to clipboard

Compiling to DLL for use in a C# application?

Open d-vyd opened this issue 3 years ago • 1 comments

Hi! I've been reading about the various NARS implementations. I primarily work in C# and noticed ALANN but ONA seems to be the current development focus, correct? Is it possible to compile ONA down to a DLL for embedding within a C# application?

d-vyd avatar Apr 10 '22 11:04 d-vyd

Hi! We only stick to an implementation as long as it's the best-performing one according to the growing set of tests we have, if ALANN or 20NAR1 gets better than ONA we will of course welcome it.

If you want to use ONA in C#: libbuild.sh creates a dynamic link library, which can be wrapped with C#. A more flexible approach which works for any target language: spawn ./NAR shell as a sub-process and make the target language code (C# in your case) communicate with it via standard-IO, as already done for the Python interface: https://github.com/opennars/OpenNARS-for-Applications/blob/master/misc/Python/NAR.py

Any such effort is very welcome!

patham9 avatar Apr 10 '22 18:04 patham9

dotnet can call the functions of the .so, same for JVM (via JNI) and others.

patham9 avatar Sep 07 '22 11:09 patham9