shop-planner / shop3

SHOP3 Git repository
https://shop-planner.github.io
145 stars 14 forks source link

Use SHOP3 from other languages #33

Closed gamagan closed 4 years ago

gamagan commented 4 years ago

Hello, There. Congrats on SHOP3. This work seems impressive.

It seems there's not many options for using a Common Lisp that can be embeddable into C/C++ applications, is cross-platform, and which is also (reasonably) performant. Embeddable Common Lisp seems to be one of the few that meets these criteria.

I noticed in a readme file in the repo that you guys mentioned, specifically, that SHOP3 does not work with ECL. You also alluded that you're only concerned with 3 implementations: SBCL, ACL, and CCL. I understand that you have priorities. However, if it is possible to support ECL, then this would open up the possibility for C/C++ programmers, as well as programmers from other languages, to use SHOP3, via C-interopt.

Personally, I'm a Lisp noob, so I don't have hope to be able to dig into the codebase and attempt to port it. I wish I could, though, really. I've been reading about SHOP# for years, because SHOP seems to be one of the better planners for use in the field of soft realtime AI. I would very much like to attempt to use SHOP3 for my work.

I hope you guys consider adding support for Embeddable Common Lisp, at some point in the future, to open the door for devs from other languages to use this amazing work.

Regards

rpgoldman commented 4 years ago

@gamagan SHOP doesn't support ECL because ECL is unable to successfully run its test suite.

Specifically, the code that ECL emits is not efficient enough to run the test suite without resource issues, and it's quite slow.

If you would like to have a try at this, I'd be happy to help with advice, but I'm not optimistic. If you wanted to, you could try using find-plans-stack instead of find-plans on ECL, because find-plans so heavily uses recursion, which I conjecture to be poorly supported on ECL.

If you want to integrate with SHOP from C or C++, then the best method is to run SHOP in a separate process, as a server, and talk to it over sockets. I do that all the time, usually running SHOP in a web server or a socket server. That's a more promising direction than trying to make SHOP (or, really, just about any large CL system) share a process with a C/C++ program.

I'm going to close this now: if you are interested in pursuing, you can reopen the issue and ask for help with ECL. A good first step would be to enable ecl testing in jenkins/run-tests.sh and then try run-tests.sh ecl. But again, I'm not optimistic.