dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
2016-10-10T21:21:50.001439Z

Friends with Figwheel: https://github.com/binaryage/dirac/releases/tag/v0.7.0

šŸ‘ 1
richiardiandrea 2016-10-10T21:43:14.001446Z

@darwin so what do I need for this to work with figwheel? only sidecar on the classpath?

richiardiandrea 2016-10-10T21:44:39.001447Z

I have a setup with dirac already in place and although I prefer to eval in cider...the lure of having good error messages might be what breaks my habit šŸ˜„

richiardiandrea 2016-10-10T21:45:16.001448Z

and if this work lambone will include it as option to boot dev

richiardiandrea 2016-10-10T21:48:32.001449Z

btw lambone aims to be Cursive+cider compatible..

2016-10-10T22:30:16.001450Z

@richiardiandrea this is what I did: https://github.com/binaryage/dirac-sample/blob/5ebcfbfb0ce3c7e66b66f5b32d894cc3e94894a1/project.clj#L132-L155 starting it with lein repl-figwheel

richiardiandrea 2016-10-10T22:35:59.001452Z

awesome thanks!

2016-10-10T22:37:40.001453Z

btw. I think that emacs + dirac + figwheel setup should be possible, the hard part would be to make nrepl middleware play together (if you use some advanced ones)

2016-10-10T22:38:51.001454Z

Iā€™m assuming that emacs can connect to nREPL clojure session, so then it should be able to :join dirac session from within it

2016-10-10T22:38:54.001455Z

like Cursive

2016-10-10T22:39:52.001456Z

the more difficult part would be to get code completions and others bells and whistles working, Iā€™m assuming that Cider is using various nREPL middleware to do that

richiardiandrea 2016-10-10T22:49:12.001457Z

@darwin isn't dirac replacing piggieback completely?

2016-10-10T22:49:17.001458Z

yes

2016-10-10T22:49:34.001459Z

piggieback + weasel

2016-10-10T22:50:18.001460Z

but I can imagine you could be running diracā€™s ā€œweaselā€ and ciderā€™s own client-side piece of code side-by-side

2016-10-10T22:50:43.001461Z

diracā€™s weasel will be used for evals, and ciderā€™s stuff for code completions or whatever they need to do on client-side

richiardiandrea 2016-10-10T22:50:48.001462Z

ah yeah if you add some kind of similar layer that's possible

2016-10-10T22:51:00.001463Z

Iā€™m not familiar with cider and whole emacs stack, sorry

richiardiandrea 2016-10-10T22:51:34.001466Z

no problem I can investigate on that and report back, because it would be awesome and boot/`lein` agnostic

richiardiandrea 2016-10-10T22:52:05.001467Z

yes it has a bunch of middleware for clj

2016-10-10T22:52:32.001468Z

but it also has some middleware for cljs, right?

2016-10-10T22:52:34.001469Z

which one?

richiardiandrea 2016-10-10T22:52:36.001470Z

just the cljs part is trickier, but tbh I am not that familiar with that as well

richiardiandrea 2016-10-10T22:52:46.001471Z

let's check šŸ˜„

2016-10-10T22:53:33.001472Z

clj-related middleware should not interfere with diracā€™s, because dirac's is just rewritten piggieback with some cljs-related stuff added

richiardiandrea 2016-10-10T22:53:54.001474Z

yep true that, I am skimming in cider

2016-10-10T22:54:46.001475Z

if I were cider, knowing what I know now, I would provide just one middleware and all the stuff would be just inside cofigurable via options

2016-10-10T22:54:57.001476Z

this middleware list looks scary\

richiardiandrea 2016-10-10T22:55:03.001477Z

ahah

richiardiandrea 2016-10-10T22:55:05.001478Z

https://github.com/clojure-emacs/cljs-tooling

2016-10-10T22:56:34.001480Z

Iā€™m afraid, this does not sound good enough to me, it will give you cljs autocompletions, but not javascript ones, also cljs env can differ from runtime state in the browser

2016-10-10T22:56:55.001481Z

I thought there is something which talks to browser to give you autocompletions

2016-10-10T22:57:10.001482Z

the real ones in the js env

2016-10-10T22:57:49.001483Z

btw. dirac is using sourcemaps machinery to map real existing javascript names back to cljs names

2016-10-10T22:58:30.001484Z

tons of work put into this by devtools devs, I think that is pretty advanced stuff no one else has

2016-10-10T22:58:41.001485Z

utimately this could be exposed to cider or cursive

2016-10-10T22:58:51.001486Z

but that is maybe going too far

richiardiandrea 2016-10-10T22:59:01.001487Z

yeah I think dirac has more sophisticated ways of fetching stuff

richiardiandrea 2016-10-10T22:59:20.001488Z

I see there the same util functions I use in replumb for self-host

richiardiandrea 2016-10-10T22:59:29.001489Z

using the classic compiler environment

richiardiandrea 2016-10-10T23:00:52.001490Z

so probably dirac already provides more and we just need to find a way to talk back to cider...

richiardiandrea 2016-10-10T23:04:35.001491Z

if we do this, it is huuge, and it is going to only probably be yet another middleware šŸ˜‰

2016-10-10T23:05:03.001492Z

that would be part of dirac middleware, I think šŸ™‚

richiardiandrea 2016-10-10T23:05:35.001493Z

so my next question would be, where to start digging ?

richiardiandrea 2016-10-10T23:06:38.001494Z

so cool ah ah...a cider+`dirac`+`figwheel` setup would be my holy setup indeed

2016-10-10T23:07:11.001495Z

we are almost there, I think cursive + dirac + figwheel already works, but havenā€™t done any real work with this setup yet

2016-10-10T23:07:40.001496Z

and it is lein/boot agnostic I believe, because figwheel sidecar works with boot just fine

2016-10-10T23:07:52.001497Z

at least what I heard

richiardiandrea 2016-10-10T23:08:33.001498Z

yes there is boot-fighweel indeed

2016-10-10T23:08:39.001499Z

so what is stopping you to: 1. setup your own nREPL server 2. add dirac middleware 3. add dirac agent 4. add fighweel-sidecar

2016-10-10T23:08:51.001500Z

then connect to it from emacs

2016-10-10T23:09:05.001501Z

and do (dirac! :join)

2016-10-10T23:09:44.001502Z

(dirac :ls) should show you figwheel compiler as well, and you could (dirac! :switch) to it

richiardiandrea 2016-10-10T23:10:00.001503Z

probably nothing, I have just never tried it, but I will...then I'll need to add cider middleware in there...that's it...I have a deadline soon so I will try probably next weekend

2016-10-10T23:10:54.001504Z

ok, no hurry, I will probably have to test this config on some real work to see if it can fly

richiardiandrea 2016-10-10T23:11:17.001506Z

great, thanks for the chat, I'll report back!

šŸ‘ 1