wagjo: i'd like to get dunaj support in boot
micha: OK, will look into it
wagjo: if you could explain the relationship between clojure and dunaj from the classloader perspective, and the dunaj bootstrapping process
that's the information i need to get boot support working
does clojure.RT work the same in dunaj?
micha: dunaj lite is just a library so you load it as any other library
regular dunaj uses custom patched clojure, so I don't know how hard is in boot to remove clojure from dependency tree. In lein I have to explicitly exclude clojure for most of deps...
Regarding bootstrapping, Dunaj first loads a small bootstrapping namespace that introduces enhancements to protocols, deftypes, and provides defXXX macros that support type signatures. Then I gradually introduce more and more features, starting with boolean, host primitives, math facilities ..., while trying to use already implemented Dunaj's features as soon as possible. There were of course some issues with cyclic dependency, toughest one was with core.async. Also dynamic vars cannot be aliased so this was a bit of a pain too. The order in which I've implemented stuff can be seen in a namespaces tab at https://docs.google.com/spreadsheets/d/1J8ndX6C1fuXGdIeekOWsmiqS2tmVb_OMZRKs3SphGPA/pubhtml#
clojure.RT was slightly patched to use Dunaj's collection protocols for seq, get and nth. Otherwise its the same.
micha: yeah one thing that may cause issues in boot. Do not assume some var is referred in namespace you are evaling. always fully qualify symbols/vars if you are evaling them in project's namespace, even stuff from clojure.core.
wagjo: thanks for the explanation! I think that's a good start for my experimentation with dunaj+boot. It's good that RT is more or less compatible because that's something that boot itself uses for its own bootstrapping. I'm hoping to be able to first simply create dunaj pods in boot in which a dunaj repl server can be started. From there we can explore how to fully integrate dunaj, if possible
micha: I'm just learning how boot works and what it provides, so I can't help you with details much
no worries, i was just a little overwhelmed trying to wrap my head around dunaj bootstrapping
i think i should be on the right track now :simple_smile:
great!
is it correct to say that in a full dunaj environment i can use regular clojure libraries? or are there limitations like maybe libraries that depend on access to clojure's java implementation won't necessarily work?
I tried hard to make Dunaj 'backwards' compatible. Most Clojure libraries should work. I'm using it with datomic, ring and friends without problem
great!
boot can help out there by providing pods
i can imagine using clojure pods from a dunaj application
Dunaj has its own fork of core.async so this dependency has to be excluded from others libraries you are using together with Dunaj
One more thing, I don't know if it is of any importance, but Dunaj is AOTed before packed into .jar.
as it is >40kloc of clojure code, nonAOTed loading took some time :simple_smile:
interesting!
i think that should work fine for what i will try to do
does dunaj provide benefits in terms of decreased startup time?
vs clojure?
no, you have to load clojure and dunaj too, so its actually slower. It was not my goal to lower the startup time, as I wanted it to be backwards compatible...
i see, yes