lumo

:lumo: Standalone ClojureScript environment. Currently at version 1.9.0
2017-09-28T14:24:48.000719Z

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

richiardiandrea 2017-09-28T15:43:57.000497Z

@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)

2017-09-28T15:45:14.000139Z

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

2017-09-28T15:45:25.000433Z

wondering if anyone is doing anything to get around that

dominicm 2017-09-28T15:45:26.000080Z

it probably would expect jvm instrumentation even if it could

2017-09-28T15:45:55.000663Z

how do you all develop with lumo? use emacs?

anmonteiro 2017-09-28T15:46:18.000318Z

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

dominicm 2017-09-28T15:46:41.000584Z

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

anmonteiro 2017-09-28T15:47:48.000109Z

@jaydeesimon look at Tubular by Mike Fikes

anmonteiro 2017-09-28T15:47:58.000026Z

My phone is not letting me copy the link

anmonteiro 2017-09-28T15:48:12.000043Z

http://Github.com/mfikes/tubular

dominicm 2017-09-28T15:48:33.000095Z

https://github.com/mfikes/tubular

dominicm 2017-09-28T15:48:36.000572Z

oh wow, that's interesting

anmonteiro 2017-09-28T15:48:38.000733Z

Thanks

anmonteiro 2017-09-28T15:48:59.000050Z

Please avoid spreading false information that just confuses people

anmonteiro 2017-09-28T15:49:52.000759Z

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

richiardiandrea 2017-09-28T15:50:24.000695Z

It is not false information

dominicm 2017-09-28T15:50:24.000839Z

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

richiardiandrea 2017-09-28T15:51:37.000514Z

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

2017-09-28T15:53:24.000484Z

sounds good everyone

2017-09-28T15:53:31.000292Z

i will look into using tubular

2017-09-28T15:54:05.000089Z

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

2017-09-28T15:54:13.000117Z

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

dominicm 2017-09-28T15:54:21.000166Z

I use vim

dominicm 2017-09-28T15:54:28.000738Z

2 others working on lumo use emacs

dominicm 2017-09-28T15:54:33.000484Z

None of us use special integration

richiardiandrea 2017-09-28T15:55:18.000666Z

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

richiardiandrea 2017-09-28T15:56:33.000605Z

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

2017-09-28T15:58:17.000853Z

i will try out tubular and report back

2017-09-28T15:58:54.000358Z

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

2017-09-28T15:59:03.000558Z

cursive doesnt really support that well

2017-09-28T15:59:29.000315Z

i mean cursive is optimized for leiningen and boot projects

2017-09-28T16:00:41.000573Z

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

richiardiandrea 2017-09-28T16:02:03.000338Z

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

richiardiandrea 2017-09-28T16:03:57.000036Z

So yeah definitely only working in Clojure: https://github.com/mfikes/tubular/blob/master/src/tubular/core.clj#L27

2017-09-28T16:04:35.000501Z

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

anmonteiro 2017-09-28T16:04:45.000375Z

Exactly

anmonteiro 2017-09-28T16:05:03.000215Z

I’m almost 100% certain it works

richiardiandrea 2017-09-28T16:05:24.000604Z

Oh cool didn't get that

2017-09-28T16:05:29.000404Z

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

anmonteiro 2017-09-28T16:05:48.000646Z

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 😛

richiardiandrea 2017-09-28T16:06:50.000158Z

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

2017-09-28T16:07:23.000035Z

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

anmonteiro 2017-09-28T16:08:07.000026Z

Yes and @mfikes has totally done that

anmonteiro 2017-09-28T16:08:14.000581Z

Perhaps even has a video or blogpost

2017-09-28T16:08:16.000214Z

:thumbsup:

richiardiandrea 2017-09-28T16:08:17.000049Z

Yeah well I guess it really is just a socket client

2017-09-28T16:08:38.000228Z

ok thanks for the input everyone

2017-09-28T16:09:10.000105Z

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

mfikes 2017-09-28T16:09:25.000481Z

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

2017-09-28T16:09:56.000622Z

yeah i saw that it’s pretty lightweight 🙂

anmonteiro 2017-09-28T16:10:01.000088Z

@jaydeesimon search for tubular in the planck guide

2017-09-28T16:10:06.000806Z

will do

anmonteiro 2017-09-28T16:10:10.000631Z

Again mobile slack doesnt let me paste links

anmonteiro 2017-09-28T16:10:28.000562Z

The same should work with Lumo

mfikes 2017-09-28T16:10:44.000429Z

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

anmonteiro 2017-09-28T16:10:50.000610Z

Thanks!

2017-09-28T16:10:54.000479Z

oh perfect!

2017-09-28T16:11:02.000458Z

thanks!

2017-09-28T16:11:21.000299Z

exactly what im gonna try to do

2017-09-28T16:12:54.000120Z

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

richiardiandrea 2017-09-28T16:14:20.000406Z

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

mfikes 2017-09-28T16:17:18.000429Z

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

richiardiandrea 2017-09-28T16:17:53.000271Z

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

richiardiandrea 2017-09-28T16:18:16.000583Z

Will suggest my colleagues to try it out

2017-09-28T17:59:00.000326Z

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

2017-09-28T17:59:10.000271Z

found some interesting behavior in cursive

2017-09-28T17:59:36.000014Z

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

anmonteiro 2017-09-28T17:59:56.000167Z

please share

2017-09-28T18:01:05.000292Z

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

2017-09-28T18:06:01.000507Z

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

2017-09-28T18:06:29.000033Z

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

2017-09-28T18:06:38.000210Z

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

mfikes 2017-09-28T18:06:49.000476Z

Right, you definitely need to follow that step 🙂

2017-09-28T18:07:11.000491Z

just curious about what the difference is?

mfikes 2017-09-28T18:09:00.000459Z

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

2017-09-28T18:10:07.000230Z

i see

anmonteiro 2017-09-28T18:11:37.000622Z

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

anmonteiro 2017-09-28T18:11:44.000245Z

not in ClojureScript

cfleming 2017-09-28T21:33:08.000498Z

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

👍 3
anmonteiro 2017-09-28T21:34:02.000277Z

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

cfleming 2017-09-28T21:34:15.000212Z

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

cfleming 2017-09-28T21:34:22.000349Z

@anmonteiro Will do, thanks!

cfleming 2017-09-28T21:34:43.000182Z

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

cfleming 2017-09-28T21:35:02.000042Z

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

cfleming 2017-09-28T21:36:01.000308Z

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

👍 1
metametadata 2017-09-28T22:50:32.000039Z

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

anmonteiro 2017-09-28T23:02:36.000102Z

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

anmonteiro 2017-09-28T23:02:44.000173Z

please open an issue with this information

metametadata 2017-09-28T23:09:47.000290Z

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