Clojurians
#lumo
<
2017-09-28
>

This page is not created by, affiliated with, or supported by Slack Technologies, Inc.

jaydeesimon14:09:48

anyone here have a setup where they use Lumo and Cursive together?

richiardiandrea15:09:57

@jaydeesimon the two don't work together at the moment. The problem is that Cursive assumes nRepl middleware (take it with a pinch of salt, it closed source so we cannot really see what is going on)

jaydeesimon15:09:14

yeah i noticed that there isn’t a cursive-way to connect to a socket repl

jaydeesimon15:09:25

wondering if anyone is doing anything to get around that

dominicm15:09:26

it probably would expect jvm instrumentation even if it could

jaydeesimon15:09:55

how do you all develop with lumo? use emacs?

anmonteiro15:09:18

You should be able to connect to cursive though I never tried

dominicm15:09:41

@jaydeesimon there's no special integration. Just text editing really.

anmonteiro15:09:48

@jaydeesimon look at Tubular by Mike Fikes

anmonteiro15:09:58

My phone is not letting me copy the link

dominicm15:09:36

oh wow, that's interesting

anmonteiro15:09:59

Please avoid spreading false information that just confuses people

anmonteiro15:09:52

Telling users that X is not supported if you don’t know or never tried will only scare them away

richiardiandrea15:09:24

It is not false information

dominicm15:09:24

Apologies. Given my experiences with all the other tooling in this area, I didn't expect cursive to work on a plain socket repl.

richiardiandrea15:09:37

It's not officially supported, at least last time I spoke with Colin, but it is great to have a workaround for at least being able to send forms

jaydeesimon15:09:24

sounds good everyone

jaydeesimon15:09:31

i will look into using tubular

jaydeesimon15:09:05

im really excited to try out lumo. i just need to my development process down pat the way I have it with clojure

jaydeesimon15:09:13

out of curiousity, do you most of you use emacs?

dominicm15:09:28

2 others working on lumo use emacs

dominicm15:09:33

None of us use special integration

richiardiandrea15:09:18

Btw I am super interested in seeing if it works with Cursive, my colleagues use it :)

richiardiandrea15:09:33

Also, Atom just released very nice integration for Language Server Protocol and probably an accept function could be written very easily for lumo

jaydeesimon15:09:17

i will try out tubular and report back

jaydeesimon15:09:54

the thing is, I really just want to write a script (one file) but be able to eval expressions through the editor

jaydeesimon15:09:03

cursive doesnt really support that well

jaydeesimon15:09:29

i mean cursive is optimized for leiningen and boot projects

jaydeesimon16:09:41

im trying to convince myself that maybe just using emacs is a better way to go. but id have to brush up on my emacs

richiardiandrea16:09:03

I have actually looked at tubular, but it seems it depends on clj-sockets, which unfortunately is Java only

jaydeesimon16:09:35

but I think the point is that you can use it to connect to lumo’s socket repl

anmonteiro16:09:03

I’m almost 100% certain it works

richiardiandrea16:09:24

Oh cool didn't get that

jaydeesimon16:09:29

the workflow would be something like this. Create a lein project, add tubular, create a repl in cursive, then use that to connect to lumo socket repl

anmonteiro16:09:48

Doesnt matter what language your client is running. By the same logic, emacs can’t connect to a Clojure REPL because it’s running emacs lisp :stuck_out_tongue:

richiardiandrea16:09:50

True, just thought you would integrate it in your lumo code at the beginning, sorry folks

jaydeesimon16:09:23

basically, it should allow me to create some glue code which will let me do things through cursive

anmonteiro16:09:07

Yes and @mfikes has totally done that

anmonteiro16:09:14

Perhaps even has a video or blogpost

richiardiandrea16:09:17

Yeah well I guess it really is just a socket client

jaydeesimon16:09:38

ok thanks for the input everyone

jaydeesimon16:09:10

and thank you to @anmonteiro and the lumo team. really excited to try it out

mfikes16:09:25

No need to really fear Tubular as a heavy dep. Here is all of its code :slightly_smiling_face: https://github.com/mfikes/tubular/blob/master/src/tubular/core.clj

jaydeesimon16:09:56

yeah i saw that it’s pretty lightweight :slightly_smiling_face:

anmonteiro16:09:01

@jaydeesimon search for tubular in the planck guide

anmonteiro16:09:10

Again mobile slack doesnt let me paste links

anmonteiro16:09:28

The same should work with Lumo

mfikes16:09:44

It is in the Cursive section of http://planck-repl.org/ides.html

jaydeesimon16:09:21

exactly what im gonna try to do

jaydeesimon16:09:54

pasting here for future reference: Cursive section in http://planck-repl.org/ides.html

richiardiandrea16:09:20

@mfikes when is saying "syncing namespace" in the manual , what is actually sending over the socket? I am curious :smile:

mfikes16:09:18

@richiardiandrea IIRC, Cursive knows which namespaces are dirty and issues some load commands when you ask the IDE to do that.

richiardiandrea16:09:53

Oh cool that's a nice feature, thanks @mfikes

richiardiandrea16:09:16

Will suggest my colleagues to try it out

jaydeesimon17:09:00

just had a free 10 mins to try out connecting to a socket repl in cursive

jaydeesimon17:09:10

found some interesting behavior in cursive

jaydeesimon17:09:36

not really a lumo issue but figured some of you might be interested

anmonteiro17:09:56

please share

jaydeesimon18:09:05

cursive/intellij seems to take over and only lets you input through this window once you connect to the socket repl

jaydeesimon18:09:01

i realized I didn’t follow the instructions exactly in the planck guide

jaydeesimon18:09:29

i didn’t “Use clojure.main in normal JVM process”

jaydeesimon18:09:38

when I do that, it doesn’t exhibit that behavior

mfikes18:09:49

Right, you definitely need to follow that step :slightly_smiling_face:

jaydeesimon18:09:11

just curious about what the difference is?

mfikes18:09:00

I think without it some layer in the nREPL stack gets in the way, perhaps something with stream handling

anmonteiro18:09:37

@jaydeesimon also :gen-class doesn’t do anything

anmonteiro18:09:44

not in ClojureScript

cfleming21:09:08

@jaydeesimon I’m planning to add support for both Lumo and the socket REPL soon. I’d hoped to have it by now, but what I’m working on has taken much longer than expected.

anmonteiro21:09:02

@cfleming that’s awesome. let me know if you need anything from Lumo and I’ll add it

cfleming21:09:15

@richiardiandrea @mfikes Right, the sync command works out the dependency hierarchy of all namespaces, works out which are modified and send the modified ones in dependency order.

cfleming21:09:22

@anmonteiro Will do, thanks!

cfleming21:09:43

I think that with the SDK dump command I’ll have everything, but I’ll let you know if that’s not the case.

cfleming21:09:02

I also have to add support for all the node resolution stuff that’s gone in recently.

cfleming21:09:01

@jaydeesimon BTW that input popup is an nREPL thing, you’ll get it from any nREPL client when the server tries to read from stdin.

metametadata22:09:32

@anmonteiro some follow-up about my obscure issue with executing Lumo 1.8.0 from Jenkins. It looks like I hit this (also obscure) NodeJS bug: https://github.com/nodejs/node/issues/11257 Relevant stacktrace I managed to catch from js/lumo.js:readSource (when it tries to read bar.cljs on interpreting (require 'bar)):

TypeError: assertEncoding is not a function
    at getOptions (fs.js:81:5)
    at Object.fs.readFileSync (fs.js:552:13)
    at Object.Oe [as readSource] ([eval]:1:21106)
    at <embedded>:6359:439
    at Object.lumo.repl.load_external (<embedded>:6359:509)
    at Object.lumo.repl.load_and_cb_BANG_ (<embedded>:6368:429)
    at Object.lumo.repl.load_other (<embedded>:6371:147)
    at lumo.repl.load (<embedded>:6375:336)
    at Function.cljs.js.require.cljs$core$IFn$_invoke$arity$5 (<embedded>:5850:77)
    at Function.cljs.js.load_deps.cljs$core$IFn$_invoke$arity$7 (<embedded>:5860:507)
Not sure what to do next actually. I guess I could file an issue to Lumo repo to track the problem. But currently the minimal reproduction example will require installing Jenkins :slightly_smiling_face: Also it doesn't help that upstream NodeJS issue has no reliable reproduction example. I'll see what I can do, e.g bisect lumo.js commits to see when the issue starts manifesting itself.

anmonteiro23:09:36

@metametadata perhaps in a Node.js upgrade in Lumo or something

anmonteiro23:09:44

please open an issue with this information

metametadata23:09:47

@anmonteiro okay, thanks, I'll check that and file an issue