Fork me on GitHub
#dunaj
<
2015-06-23
>
micha00:06:49

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

wagjo07:06:52

micha: OK, will look into it

micha12:06:55

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

micha12:06:15

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

micha12:06:51

does clojure.RT work the same in dunaj?

wagjo14:06:24

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

wagjo14:06:32

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

wagjo14:06:15

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#

wagjo14:06:50

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

wagjo17:06:56

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.

micha17:06:15

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

wagjo17:06:18

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

micha17:06:54

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

micha17:06:05

i think i should be on the right track now simple_smile

micha17:06:02

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?

wagjo17:06:54

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

micha17:06:13

boot can help out there by providing pods

micha17:06:34

i can imagine using clojure pods from a dunaj application

wagjo17:06:01

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

wagjo17:06:43

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

wagjo17:06:26

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

micha17:06:05

interesting!

micha17:06:27

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

micha17:06:04

does dunaj provide benefits in terms of decreased startup time?

micha17:06:08

vs clojure?

wagjo17:06:25

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

micha17:06:50

i see, yes