Using Lisp or Scheme for runtime configuration of Java programs

后端 未结 4 1327
梦毁少年i
梦毁少年i 2021-02-05 22:59

I have now seen several projects ending at a point where the actual configuration depended on things only available at run-time.

The typical way to configure a Java prog

4条回答
  •  情深已故
    2021-02-05 23:58

    Clojure is excellent, it is embeddable and has very good interoperability for calling Java libraries. However it is not particularly small (you get a full compiler and quite a decent runtime library included). Still worth considering if you have a broader requirement for this kind of functionality - I've found Clojure to work as an excellent dynamic "glue" for Java code.

    Otherwise, your best bet is probably a tiny embedded Scheme interpreter.

    It may be possible to use the early (1998) version of JScheme at this link, which is only about a 30k jar file: http://norvig.com/jscheme.html

    Otherwise, it's probably possible to write something even more minimal in a few hundred lines of Java.... it's probably only a weekend project considering how small the core of Scheme is. The following page is quite interesting if you want to write a mini-interpreter for Scheme: http://archives.evergreen.edu/webpages/curricular/2000-2001/fofc00/eval.html

提交回复
热议问题