Skip to content

Latest commit

 

History

History
70 lines (65 loc) · 5.04 KB

todo.org

File metadata and controls

70 lines (65 loc) · 5.04 KB

Genie - Todo

Reflective access warning

When creating an uberjar, a warning is shown:

$ lein uberjar
Compiling genied.classloader
Compiling genied.client
Compiling genied.core
Compiling genied.diagnostics
Compiling genied.state
Compiling genied.util
Created /home/nico/cljlib/genie/genied/target/uberjar/genied-0.1.0-SNAPSHOT.jar
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by clojure.lang.InjectedInvoker/0x0000000840065840 to method com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(org.xml.sax.InputSource,org.xml.sax.HandlerBase)
WARNING: Please consider reporting this to the maintainers of clojure.lang.InjectedInvoker/0x0000000840065840
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Created /home/nico/cljlib/genie/genied/target/uberjar/genied-0.1.0-SNAPSHOT-standalone.jar

This probably has something to do with Pomegranate, but further investigation is needed.

Other library dependencies

Currently only Maven/Clojars style libraries are supported. This includes local libraries in your .m2 folder. Using libraries in git-repo’s is currently not possible.

Also check periodically if hotload-dependency or standard Clojure functionality (clojure.tools.deps.alpha.repl?) is working again.

The sideloader mentioned in nRepl might be handy, although it’s the other way around, with the nRepl server process asking the client for libraries: https://nrepl.org/nrepl/design/middleware.html#sideloading

A non-dynamic alternative would be to put all your libraries in the project.clj of genied, and maybe generate a user/specific genied.jar uberjar, so dynamic loading is not needed. This depends on the direction Clojure will take.

Classloader handling

Currently all clients/scripts use the same base/root classloader. This might be problematic if we want to use different versions of a library at the same time, maybe from different scripts. A workaround is to run these scripts in different daemons, listening on different ports. Maybe each script can use a unique classloader that is a child of the current base/root classloader. Building a dynamic classpath before starting the daemon might be an option, if more dynamic classloading proves to be problematic. This classpath would then be given on the command line like ’ java -jar genied.jar -cp <dynamic-list>’

For both loading and unloading the Java way-of-working might be useful. See the following links:

Other Repl implementations

nRepl is very versatile, with great support for sessions and stream-handling. But maybe simpler repl’s are faster and/or easier. Distinguishing between stdout and stderr might be an issue then, as well as handling stdin. Web- and app-servers might be useful, also as inspiration.

Other wire protocols

Use bencode over TCP/IP now. Maybe local unix sockets or named pipes are faster.

Other clients

Babashka works very well here, but it is a binary of 80MB. Some possible alternatives:

  • Tcl with rep(.exe) - the first implementation. This works, but a 2-process overhead is less than ideal.
  • Tcl with bencode (or other protocl)
  • Tcl/Tk, for local GUI applications. Tk in Java/Clojure has been tried before, but not really successful or complete.
  • A C implementation (maybe using rep as inspiration)
  • A better C, such as Go or Rust. Joker might be of use then.
  • Compile the Babashka client to GraalVM binaries (system dependent)
  • Using https://fennel-lang.org/
  • Run within Closh, if the client can be a part of Closh

Support Inlein style dependencies

In Inlein scripts the depencies are contained in the script itself, not in a separate deps.edn file. Maybe support this as well.

Improve stability

Using Genie in practice on different systems should prove the stability of the solution. Although I have used this on my Lubuntu 18.04 system and Windows 10 laptop for some time, Genie has not been battle-tested on a lot of systems. Some areas for improvement:

  • Adding timeout-handlers for all calls and requests.
  • Handling binary data on both input- and output-streams
  • Unload scripts and libraries - maybe using Stuart Sierra’s component library and workflow

Show daemon status

Currently only the active sessions can be listed. Some further options:

  • Loaded libraries including versions and hierarchy, compare lein deps :tree.
  • Loaded scripts
  • Some statistics on scripts: number of calls, runtime.
  • Client and protocol versions

Preloading scripts

Currently the genie.edn config file can contain only libraries to be preloaded at daemon start-up time. Preloading scripts might also be useful, and better for runtime performance.

Improve performance

See also performance.org