dunaj

micha 2015-06-23T00:35:49.000031Z

wagjo: i'd like to get dunaj support in boot

wagjo 2015-06-23T07:16:52.000032Z

micha: OK, will look into it

micha 2015-06-23T12:02:55.000033Z

wagjo: if you could explain the relationship between clojure and dunaj from the classloader perspective, and the dunaj bootstrapping process

micha 2015-06-23T12:03:15.000034Z

that's the information i need to get boot support working

micha 2015-06-23T12:11:51.000035Z

does clojure.RT work the same in dunaj?

wagjo 2015-06-23T14:15:24.000036Z

micha: dunaj lite is just a library so you load it as any other library

wagjo 2015-06-23T14:16:32.000037Z

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...

wagjo 2015-06-23T14:17:15.000038Z

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#

wagjo 2015-06-23T14:20:50.000040Z

clojure.RT was slightly patched to use Dunaj's collection protocols for seq, get and nth. Otherwise its the same.

wagjo 2015-06-23T17:12:56.000041Z

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.

micha 2015-06-23T17:33:15.000042Z

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

wagjo 2015-06-23T17:35:18.000043Z

micha: I'm just learning how boot works and what it provides, so I can't help you with details much

micha 2015-06-23T17:35:54.000044Z

no worries, i was just a little overwhelmed trying to wrap my head around dunaj bootstrapping

micha 2015-06-23T17:36:05.000045Z

i think i should be on the right track now :simple_smile:

wagjo 2015-06-23T17:37:03.000046Z

great!

micha 2015-06-23T17:38:02.000047Z

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?

wagjo 2015-06-23T17:42:54.000048Z

I tried hard to make Dunaj 'backwards' compatible. Most Clojure libraries should work. I'm using it with datomic, ring and friends without problem

micha 2015-06-23T17:45:03.000049Z

great!

micha 2015-06-23T17:45:13.000050Z

boot can help out there by providing pods

micha 2015-06-23T17:45:34.000051Z

i can imagine using clojure pods from a dunaj application

wagjo 2015-06-23T17:46:01.000052Z

Dunaj has its own fork of core.async so this dependency has to be excluded from others libraries you are using together with Dunaj

wagjo 2015-06-23T17:47:43.000053Z

One more thing, I don't know if it is of any importance, but Dunaj is AOTed before packed into .jar.

wagjo 2015-06-23T17:48:26.000054Z

as it is >40kloc of clojure code, nonAOTed loading took some time :simple_smile:

micha 2015-06-23T17:50:05.000055Z

interesting!

micha 2015-06-23T17:50:27.000056Z

i think that should work fine for what i will try to do

micha 2015-06-23T17:51:04.000057Z

does dunaj provide benefits in terms of decreased startup time?

micha 2015-06-23T17:51:08.000058Z

vs clojure?

wagjo 2015-06-23T17:53:25.000059Z

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...

micha 2015-06-23T17:53:50.000060Z

i see, yes