Separate to the library plus the application
Please consider to separate the crate to the library and the application. So it would be possible easily to link it in another Rust or non-Rust project (with a wrapper then) without modifying the original code. Ideally, it would be nice to provide two levels of the interface (similar to how Lua can be embedded):
- Embedding the Prolog source parser and interpreter, so the program can use it for evaluating statements on the fly
- Low-level interface to run the pre-formed/precompiled WAM bytecode, probably with the standard library functions accessible.
We have the almost opposite proposal in #565 about the parser: For several reasons outlined in that issue, it would seem desirable to integrate more of the code into the main repository.
Please note also that for example library(crypto), library(pio) and others depend on specific predicates that must be implemented in the core. How would these be placed in a separate crate?
Regarding FFI, please note the observations in https://github.com/mthom/scryer-prolog/issues/231#issuecomment-556548042.
As I noted, it's possible to have many crates in the same repository, so it's not an issue: https://github.com/mthom/scryer-prolog/issues/565#issuecomment-635859227
Does this address the things I said about library(crypto), library(pio) and others which need features in the core in addition to being written in Prolog?
@triska no, but I think the Prolog libraries can be kept inside this library anyway.
with #838 and further changes merged I think this is done, or it could be closed in favor of #765