Closed behrica closed 2 years ago
I am not sure, about the use case of "not boot/up kill the vm". Is it a "python developer", which wants to use Clojure (maybe due to one specific library)?
My use case is the equivalent of "clj hello.clj",
in which hello.clj contains some libpython-clj code.
Concretely I run it like thgis:
docker run ..... ..... my-lib python3 -c "import sys;sys.path.append('/home/user');import cljbridge;cljbridge.load_clojure_file(clj_file='hello.clj)"
But indeed, I can see the "need" to "load" several clojure files, one after the other.
Maybe we should put this on hold. I see know a more generalise requirement of configuring the "bootstrap" of the JVM/Clojure process. Example would be to start "a notespace server together with the nrepl": I could look like this in python
require("notespace.api")
resolve_call_fn("notespace.api/init")
resolve_call_fn("libpython-clj2.embedded/start-repl!",
py_dict_to_keyword_map(kw_args))
I am not sure, if this belongs here, or should that be done in Clojure side ?
My use case would be a Docker container, which start nrepl and notespace on startup
I now went a bit more into a general "init_clojure" function, with 3 option flags, which controls:
The default could be current behaviour, so:
I think this looks good to me at this point. I think we should integrate this, let it be and see if people respond.
I have not implemented any default . Is this needed ?
I just came to an other use case, namely running of unit tests. I started to develop libraries which rely on "libpython-clj" , so I started to write unit tests. They need of course a working libpython-clj. (embedded)
maybe teh "real need" is a cli tool, so a replacement for the "clj" launcher,
clj-py
which starts libpython clj on startup and then does the "right" think, supporting all options to execute clojure (as the clj
) tool does.
Is this even feasable ?
I think it is feasible but this right now is a reasonable half step.
I think "both functions" is best compromise. I can see three use cases:
Sounds good to me. Are you OK if I merge this? I need to release a version of libpython-clj that works on m-1 mac.
yes, thanks
as discussed here: https://clojurians.zulipchat.com/#narrow/stream/215609-libpython-clj-dev/topic/embeded.20cli.20apps