This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-10
Channels
- # adventofcode (76)
- # announcements (7)
- # aws (3)
- # babashka (75)
- # beginners (25)
- # calva (37)
- # cider (9)
- # clara (4)
- # clj-kondo (17)
- # cljsrn (1)
- # clojure (106)
- # clojure-europe (4)
- # clojure-india (2)
- # clojure-italy (12)
- # clojure-nl (27)
- # clojure-spec (33)
- # clojure-uk (20)
- # clojurescript (103)
- # clojutre (3)
- # core-async (1)
- # cryogen (10)
- # cursive (24)
- # datomic (113)
- # dirac (5)
- # emacs (12)
- # events (4)
- # fulcro (64)
- # garden (5)
- # jobs (1)
- # kaocha (5)
- # luminus (2)
- # malli (14)
- # off-topic (53)
- # planck (11)
- # re-frame (9)
- # reagent (16)
- # reitit (26)
- # remote-jobs (2)
- # shadow-cljs (137)
- # spacemacs (34)
Two questions about planck:
- It adds the current working dir + the src folder on the default classpath, is that correct?
- If you are adding a bunch of jars to the classpath and you do a require, does it walk through the list and searches for entries in each jar file until it found the correct entry, every time you do a require for a previously unloaded namespace? Or does it have some sort of caching about what file belongs to which jar file?
I briefly skimmed through the C code: it seems the former.
I'm asking because I'm considering similar --classpath
option for for babashka and want to have some information about best practices.
@borkdude If I recall correctly, Planck itself doesn't actually cache JAR entries, but there is evidence that the underlying library is faster if the archives are left open: https://github.com/planck-repl/planck/issues/566
For your first question, raw planck
doesn't add anything to the classpath, but plk
behaves like clj.
I get:
$ plk -e "(require '[foo]) (require '[bar])"
WARNING: foo is a single segment namespace at line 1
foo
WARNING: bar is a single segment namespace at line 1 /private/tmp/src/bar.cljs
bar
with PWD /tmp and /tmp/foo.cljs, /tmp/src/bar.cljs
so it seems that PWD is also added to the classpath, contrary to clj
.I think I had Planck originally doing that, and perhaps just left it as is so as to not break anything.
@mfikes fwiw clj-kondo had a weird issue which was caused by keeping jar files open: https://github.com/borkdude/clj-kondo/issues/542 it hit the OS limit for open files for some people who had a huge list of dependencies on their classpath