Fork me on GitHub
#clojure
<
2019-02-19
>
devth00:02:33

has anyone hit clojure jira's api? i tried a few paths under http://dev.clojure.org but getting 404. not sure if it's enabled.

andy.fingerhut00:02:06

I use it every week to collect numbers of votes on each JIRA ticket.

andy.fingerhut00:02:00

The URLs I use are in this code somewhere: https://github.com/jafingerhut/clj-prescreen/blob/master/src/clj_prescreen/presc.clj Search for occurrences of http and you should see them.

devth00:02:09

awesome, thanks!

andy.fingerhut00:02:23

I do not necessarily exercise parts of the API that you want to use...

devth00:02:40

sure. i will poke around and see if i can figure it out

andy.fingerhut00:02:39

I notice that my code never uses 'rest' in any of its URLs. Also note that Clojure JIRA may be an older version than the most recent, by several years.

dpsutton00:02:56

@hiredman built a neat looking way to query jira with core.logic but mentioned that the clojure jira doesn't send a lot of stuff back in the api

devth00:02:19

yeah i don't recognize the sr in the urls, or the jira.issueviews fragment

dpsutton00:02:21

i'm assuming it is quite old and unloved

andy.fingerhut00:02:42

Well, loved by a few, and stable. Updating it can be a pain, I am sure.

devth00:02:52

apparently Atlassian JIRA (v4.4#649-r158309)

devth00:02:14

circa 2011

andy.fingerhut00:02:37

I am sure it gets more fun to update to the latest version, the more intermediate versions there are 🙂

devth00:02:15

good reason to use a service and let someone else worry about upgrades 😄

andy.fingerhut00:02:46

Until and unless they break APIs you use without telling you

💥 5
devth00:02:47

looks like we're on v7.6.6 at work, which is what i've developed against previously. so i bet none of my code will work against clojure's

devth00:02:19

ha parts of it work 🙂

Alex Miller (Clojure team)00:02:52

When you’re using the api, please be kind. It’s not on a mammoth server or anything

5
Alex Miller (Clojure team)00:02:30

I’ve unsuccessfully spent weeks trying to upgrade this jira instance to their cloud version. It’s a nightmare.

😞 5
henrik06:02:12

Jira is brilliantly engineered in that it's extremely hard to get out of once you're in. On the other hand, the same indeed applies to Jira itself.

urzds13:02:46

Where is the difference between clojure.edn and clojure.tools.reader.edn?

ghadi13:02:08

The latter is implemented in Clojure

ghadi13:02:57

The former in Java. The Clojure library that tools.reader.edn lives in, also works in ClojureScript

rtacconi14:02:38

Hi, I reinstalled Java and lein, but lein seems to be broken:

lein
clojure.lang.Compiler$CompilerException: Syntax error compiling at (cider/nrepl.clj:1:1).
#:clojure.error{:phase :compile-syntax-check, :line 1, :column 1, :source "cider/nrepl.clj"}
...
Caused by: java.io.FileNotFoundException: Could not locate clojure/tools/nrepl/server__init.class, clojure/tools/nrepl/server.clj or clojure/tools/nrepl/server.cljc on classpath.
 at clojure.lang.RT.load (RT.java:466)

rtacconi14:02:23

java --version
openjdk 11.0.2 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
but same issue with java 8

rtacconi14:02:40

lein installed with brew and I tried from the cli command tool

Alex Miller (Clojure team)14:02:26

the latest cider has moved to a new nrepl - that exception indicates the old nrepl. I don't know quite enough to point you at where things are amiss

👍 5
Alex Miller (Clojure team)14:02:01

I think things that would help someone answer this better would be which leiningen version and cider version you have

dpsutton14:02:47

usually lein 2.9.0 is enough. check your deps for the presence of tools.deps.nrepl which is poisonous to have now

dominicm14:02:58

Looks to me like an old cider version? the error is that t.d.n can't be found. You might have cider in your ~/.lein/profile.clj

rtacconi14:02:25

Yes, you are right, I completely forget this file ~/.lein/profiles.clj which was pointing to an old version of cider, I put the version displayed on clojars and it worked. Thank you.

cider 10
yedi15:02:09

thanks @andy.fingerhut @dpsutton, I was asking for a "max value" value only out of convenience

🦕 5
yedi15:02:22

i just ended up writing my own comparator for the specific use case

didibus17:02:20

So, anyone knows what's up with pRepl and what is it?

didibus17:02:49

Given there is already nRepl and unRepl. I'm not sure what it can bring to the table

didibus17:02:13

Though I would like it if it was more like unrepl

didibus17:02:30

Or it seems maybe it can be used in conjunction with unRepl?

ghadi17:02:23

it cannot be used with unrepl

dominicm18:02:10

I think this is untrue

dominicm18:02:01

Unrepl can start a nested session within a single frame of prepl

dominicm18:02:15

I think, anyway

ghadi18:02:23

i don't see how that could work

ghadi17:02:06

it does framing on output -- unrepl expects a raw stream

seancorfield17:02:45

It'll be nice to see more tooling using prepl so less dependencies need to be involved.

cupello17:02:12

Hi folks! Is there a way of compiling clojure files to clojuresctipt/js ?

manutter5117:02:14

Well, the usual caveats apply--JS doesn’t support Java interop or Java-style threads. If your Clojure code isn’t running into any Java/JS incompatibilities, it probably compiles as CLJS already.

manutter5117:02:59

I may not have understood what you’re asking for tho.

cupello17:02:10

No, you understand correctly. =D But, just because I have the org.clojure/clojurescript dependency it will compile to cljs? (if I have no incompatibilities)

manutter5117:02:07

I would tend to expect so, that was one of the goals of CLJS. You might also want to use .cljc files if you’re interested in code that compiles to both.

manutter5117:02:58

Here’s the link if you haven’t seen the docs for this: https://clojure.org/guides/reader_conditionals

cupello18:02:29

Thanks! I am using lein-cljsbuild. Is there better one?

manutter5118:02:33

That’s what I’ve always used, I haven’t really looked for a better one.

👍 5
cupello18:02:30

Just to clarify: I have an application written in Clojure and I would like to compile it to cljs/js and run it in a Node VM.

cupello18:02:43

This is possible, right?

manutter5118:02:10

Sounds plausible, but you’ll have to port the code that works with dependencies, so anything to do with, say, databases or web servers

manutter5118:02:43

That can be a bigger rabbit-hole than you might think because you may have Clojure libraries that depend on something Java-specific internally, meaning you’ll have to find a CLJS replacement for the whole library.

manutter5118:02:17

Depending on the application, it may prove to be simpler/faster to use the Clojure implementation as a reference, and write the CLJS from scratch. But that’s a worst-case scenario.

cupello18:02:36

Right, make sense! Thanks! Do you have any doc/post about compiling clj to cljs? I just would like to run some " lein comile clj to cljs" and see some exceptions popping up (because of some Java/JS incompatibilities).

manutter5118:02:35

I would just start by copying the files into a cljs directory instead of clj, and changing the file extensions from clj to cljs. (Actually, I’d inspect them as I copied them just to see what I was getting into.)

😲 5
👍 5
didibus17:02:36

Hum, I'm not sure I'm onboard with pRepl then. Unrepl seems just all around better

didibus17:02:46

Which already allows for zero dependencies

Alex Miller (Clojure team)17:02:03

Actually, I’d say prepl is not framing, but data over a stream

didibus17:02:36

Is the data also streamed though? Otherwise it would be less efficient no?

didibus17:02:47

Well, I mean. Say you return a long printed string. Can you start decoding the characters before the full string is returned?

Alex Miller (Clojure team)17:02:58

It’s packed in an edn string, so in general you would wait to read the whole data structure response (unless your client was very clever)

Alex Miller (Clojure team)17:02:50

But the key here is that in general your interactions with a repl are short, not a streaming video

didibus17:02:17

If it is packed in a data notation, I feel you'd need to wait for the whole thing

didibus17:02:50

Where as with unrepl bytestream, you can do whatever you want. You could return streaming video for that matter

chrisulloa17:02:29

Would replacing a node in a tree with clojure.zip be an example of path copying?

chrisulloa17:02:42

With the path copying method a copy of all nodes is made on the path to any node which is about to be modified. These changes must then be cascaded back through the data structure: all nodes that pointed to the old node must be modified to point to the new node instead. These modifications cause more cascading changes, and so on, until the root node is reached.
I think it pretty much describes zipping up a tree. Just realized that stuff I’ve been reading about Scala is described as path copying rather than anything related to functional zipper.

didibus17:02:04

I guess pRepl is more a replacement for nRepl then. Which would be bundled with Clojure. It seems like the advantage over unRepl might just be easier for tooling to build on, because of the defined data-format.

Alex Miller (Clojure team)17:02:56

I see all of them as different approaches

Alex Miller (Clojure team)17:02:55

Prepl and unrepl are built over streams and certainly Rich has expressed at great length the heritage and benefits of streams for composability and portability

didibus17:02:22

I guess I'm not seeing the value proposition of pRepl over nRepl except for it being bundled in the Clojure jar.

didibus17:02:50

Sure, there's some implementation details differences.

Alex Miller (Clojure team)17:02:33

Every Unix thing already knows how to work with character streams

Alex Miller (Clojure team)17:02:12

Stream repls compose, so you can nest one inside another

didibus17:02:47

Maybe I don't know enough about nRepl then. What does it return if not a stream?

Alex Miller (Clojure team)18:02:09

It’s a framed protocol

didibus18:02:11

What does that mean?

Alex Miller (Clojure team)18:02:33

Probably better for you to go read their well written docs than for me to explain

👆 5
Alex Miller (Clojure team)18:02:56

It’s bencoded messages over a socket

hiredman18:02:24

that is not strictly accurate

hiredman18:02:57

nrepl in practice is mostly bencoded messages over a socket, but you can define different transports

hiredman18:02:40

I must admit I am some what baffled at the turn prepl has taken, because it has been my experience that tunneling framed messages is easier to do both over on framed message protocols (like websockets) and over streams (like a socket), and when nrepl as a project started I seem to recall rich suggesting looking at STOMP(a message bus protocol) for inspiration

hiredman18:02:45

(tunneling is near and dear to me because at work I do a lot with an nrepl tunneled over http://socket.io)

☝️ 5
hiredman18:02:55

but then, like reading the doc string on prepl, most of the doc string is example framed messages that out-fn is called with

hiredman18:02:10

so the idea that that you can differentiate between prepl and nrepl saying one is framed messages and the other is streams, rings rather hallow

yezdee18:02:02

What is the best possible way to generate list using clojure on a map like

(def somemap {:name 'John Doe' :gender 'male'})
and generate
(some-ns/property :name 'John Doe')(some-ns/property :gender 'male')

noisesmith18:02:01

if you want a list of those lists (map (fn [entry] (cons 'some-ns/property entry)) somemap)

noisesmith18:02:39

but often lists aren't the right data type

hiredman18:02:48

generate is kind of an ambiguous word there

hiredman18:02:59

and the def isn't even valid clojure

yezdee18:02:15

@noisesmith @hiredman , I m trying to generate this form from a map

(traverse g (add-V :person)
              (property :name "John Doe")
              (property :gender "male")))

shooit22:02:12

@UFURXR7PT Luckily you don't have to try to chain property calls together as they mutate the underlying traversal object. Something like

(defn add-properties
  [traversal m]
  (doseq [[k v] m]
    (o/property traversal k v))
  traversal)
will work. That saves you from a fairly nasty macro that I didn't enjoy trying to write

shooit22:02:55

For once I was happy with mutable state :man-shrugging:

hiredman18:02:42

generate is again ambiguous

hiredman18:02:15

but, assuming traverse is a function, and property is a function, and what you want to do is call the traverse function with those arguments (instead of creating a that as a datastructure)

hiredman18:02:03

(apply traverse g (add-V :person) (for [[k v] somemap] (property k v)))

yezdee18:02:10

yes traverse and property are functions

hiredman18:02:11

assuming you fix the broken quotes on somemap

hiredman18:02:17

although, my (wild)guess is you are using clojurescript, not clojure, and for in clojurescript might not work on maps like that

yezdee18:02:07

@hiredman I m dabbling with ogre library for JanusGraph and trying to create a graph traversal in clojure

noisesmith18:02:37

"generate this form" makes me think you might be trying to do a macro - is traverse a function where you can precalculate args, or a macro that needs another macro around it?

yezdee18:02:15

so, here is how ogre lets us create a vertex in Janusgraph with traverse function. so I am wondering if there is a macro approach - https://github.com/clojurewerkz/ogre/blob/master/test/clojure/clojurewerkz/ogre/suite/add_vertex_test.clj#L22

noisesmith18:02:59

don't use a macro if you dont' need one - if traverse is a function, use a function like hiredman demonstrated

noisesmith18:02:54

macros can do a few things a function can't, but are less flexible / usable in other code, so if either a macro or a function would work, use a function

yezdee18:02:27

sure, thank you. I will check his approach

hiredman18:02:45

I saw single quoted strings and swung for the fence

eraserhd18:02:27

philosophical design question: what makes some data metadata?

Michael Griffiths18:02:26

Equality and hashing ignore metadata, so it’s best used for annotations that you would not consider part of an object’s value

didibus18:02:47

I'm not sure I see the difference between bencode, and EDN. Both sound framed to me. And neither seem to be streamable protocols. They both require the full payload to be received before decoding can proceed. That said, EDN in Clojure-land seems more natural. So I still feel pRepl is more like a new take on nRepl, with Clojure jar bundling. Which is fine, better then nRepl. But unRepl still seems like the wholy grail to me. That said, I recognize it might be harder to implement a tool with unRepl, since you're left implementing the protocol you want on your own. So, maybe pRepl is the right compromise in this case.

hiredman18:02:07

I haven't seen anything in unrepl that couldn't be done in nrepl

hiredman18:02:50

in fact technomancy had a proposal for using hypermedia kind of things to build emacs/vim/whatever uis for tooling on top of nrepl instead of having to build them again for every editor

didibus18:02:05

Well, for me the differentiator for unRepl, is really just the idea that you inject your repl code through a standard socket repl or clojure.main repl.

didibus18:02:45

So if nRepl injected itself like that, to bootstrap, instead of requiring hard dependencies. Then it would be totally fine

cgrand18:02:29

I started working on injectable nRepl.

didibus19:02:21

Yes! Awesome, I was just thinking that in theory, unrepl could inject nRepl or even pRepl (:p), though that one is just part of Clojure so no reason to do so. That's great.

eraserhd18:02:13

@hiredman I've seen hints of this in nREPL, but not sure where this was going. Do you know of a blog post or something?

hiredman18:02:42

I don't recall, it was a billion years ago

hiredman18:02:04

I think he even proposed a talk at the conj about (I don't recall if it was accepted)

didibus18:02:33

It's like ultimate REPL reification

hiredman18:02:03

nrepl if I recall shipped with a teletype transport which was a socket repl

Alex Miller (Clojure team)18:02:58

prepl being streaming means that you can connect remotely and still nest new repls, which you can't with nrepl afaik. I think cgrand was even looking at deploying unrepl that way over prepl?

hiredman18:02:37

depends what you mean by nest repls, but nrepl middleware can pretty much do whatever it wants

Alex Miller (Clojure team)18:02:50

I mean like run clojure.main/repl

hiredman19:02:15

I have a repo somewhere that runs swim (clustering) over nrepl, and then lets you proxy in to different members of the cluster

😮 5
didibus19:02:21

By the way, is there currently a way to start the socket repl from within a REPL? Or you need to have the JVM arg on app startup ?

Alex Miller (Clojure team)19:02:59

it has a programatic api

Alex Miller (Clojure team)19:02:08

so you can start it yourself if you like

didibus19:02:10

Ah awesome, I was looking for that, but couldn't find it.

didibus19:02:46

So, does each socket repl get a dedicated thread?

Alex Miller (Clojure team)19:02:12

each socket server has a thread, and each incoming client gets its own thread

Alex Miller (Clojure team)19:02:42

you could just go read the code for this too, it's pretty straightforward

didibus19:02:47

Ah yes, I see from the source. Cool

didibus19:02:39

So, what does the "p" stand for, just curious?

Alex Miller (Clojure team)19:02:01

as in not, designed for humans but for programs (like rebl) to talk

didibus19:02:16

I see, that makes sense.

Alex Miller (Clojure team)19:02:36

https://groups.google.com/forum/#!msg/clojure-dev/Dl3Stw5iRVA/IHoVWiJz5UIJ is some stuff from rich when the socket repl was added that you might find useful to read if you're interested in his opinions on it

didibus19:02:26

I see that haha.

Alex Miller (Clojure team)19:02:09

this pre-dates prepl but I think you can project most of what's said there to prepl as well

didibus19:02:07

Hum, havn't read it all. But I wonder if pRepl is a realization that no one used the Socket Repl. And thus, a thin RPC, or lets call it more, a easier time building REPL based programs was needed to gain more adoption. Thus pRepl

Alex Miller (Clojure team)19:02:06

it's important to separate the socket server from the socket repl

Alex Miller (Clojure team)19:02:16

the socket server is the more important bit imo

Alex Miller (Clojure team)19:02:45

the socket repl is the clojure.main repl, with a few minor tweaks, over the socket server

Alex Miller (Clojure team)19:02:47

to some degree, it is mostly a minimal example to be in the box - we never expected it by itself to be used much

Alex Miller (Clojure team)19:02:50

we expected more people would build interesting custom remote repls (unrepl is a great example)

Alex Miller (Clojure team)19:02:34

stepping away... need to get some work done :)

hiredman19:02:14

the whole thing is so frustrating to read, the stream vs. messaging framing because streams are an ordered sequence of messages, the rpc vs. repl framing because after saying a repl is not an "Eval RPC Server/Window", rich turns around and releases prepl, which I mean, a programatic repl, how is that not an rpc server?

Alex Miller (Clojure team)19:02:25

It supports streamed messages which are independent. If you have a thread pumping out, you’ll keep getting messages independent from the repl

ghadi19:02:14

like tap messages get pushed

didibus19:02:15

I'm taking this bit: With the improved read-ability of REPL output, I think an edn-based REPL makes a fine RPC server for program-to-program communication, especially since the set of 'verbs' supported is bounded only by what you can evaluate, and the types of things you might discover is open. This sounds a lot like pRepl. And I feel it is. I can see how the Socket server is the true primitive. And then unRepl, happened to be the only take on it. So maybe, it is true that people seemed to have been baffled by how bare bones socket server was, and just having to decide of a serialization format to exchange was too hard for tooling to adopt it. So maybe pRepl is trying to solve that. Adding a basic edn serialization on top.

hiredman19:02:30

Which is that a response to? I can see how that could be used to argued against it being rpc, but then again plenty of rpc frameworks have someway to stream information. As for streams vs. messages you can't describe what the stream is doing without calling it messages, so I dunno.

hiredman19:02:21

I feel like my parents got divorced so I get more toys (so many repls) but then they keep making digs at the toys the other parent got me

hiredman19:02:48

and like, it is pretty clear they are all legos

ghadi19:02:02

It's really important to separate Socket Server vs. Socket REPL Socket REPL is clojure.core.server/main running as the "connection accept" function for a Socket Server You can conceivably run a JSON-RPC endpoint, or some HTTP server as your "connection accept" function

ghadi19:02:01

prepl is another thing you can run on a Socket Server -- specifically clojure.core.server/io-prepl would be the accept function for that

hiredman19:02:24

I am not sure what point you are trying to make?

ghadi19:02:44

just re-articulating a previous point

hiredman19:02:37

diverse transports? nrepl has them (as I said nrepl ships with bencoded data over sockets and a plain socket repl, and there are throd party transports for things like message queues and http)

didibus19:02:32

Right, I see that. I guess the thing is. Once you have a socket server, and an accept function that can take a char-stream and eval it, and return a char-stream of the result. You have all the power as a client. So now, you can send to be evaled the entire code of pRepl if you wanted. And eval a swap of the socket server accept-fn to be the one you just sent.

didibus19:02:17

That to me is fantastic. And from my understanding, its the idea behind unRepl

didibus19:02:32

Now, pRepl, or nRepl, or wtv else. Those are just protocols or middleware, etc. over your foundation. Maybe as a tool writer, I prefer to exchange EDN back and forth. Or maybe I prefer bencode.

didibus19:02:47

unRepl lets me choose which

didibus19:02:25

That said, its also an added responsibility to the tool writer. So maybe, I don't care. And its best that Rick just says, it'll be EDN from now on.

ghadi19:02:25

transport encoding is the least interesting part of this. How the REPL handles *in* is really important

didibus19:02:44

Hum, go on

ghadi19:02:07

I haven't looked recently so I don't know if this is out of date information w.r.t. nREPL, but that old thread above brought up some difficulties with issuing (read *in*) in nREPL

ghadi19:02:46

(defn user-prompt [s]
  (println s)
  (read *in*))

hiredman19:02:21

yeah, it is tricky, but doable

ghadi19:02:33

so that is fundamental to a REPL

dpsutton19:02:37

"Returns a LineNumberingPushbackReader suitable for binding to *in*.
   When something attempts to read from it, it will (if empty) send a
   {:status :need-input} message on the provided transport so the client/user
   can provide content to be read."

hiredman19:02:39

but it also illustrates the problems transporting streams over messages

ghadi19:02:41

and shouldn't be tricky

ghadi19:02:46

nesting repls, etc.

ghadi19:02:15

transport encoding is as simple as swapping the R and P in REPL.

hiredman19:02:21

and most intresting protocols these days (http, websockets, etc) are message based

hiredman19:02:41

so defining a repl entirely on streams limits its reach outside of a single machine

dpsutton19:02:49

I remember Stu saying something like that on the apropos cast i think? His daughter was making a program and requested the users height or something. And he said it should read from in, not send a message.

dpsutton19:02:04

But i don't see the full importance of that

hiredman19:02:16

as I have said in the past, I have a nrepl repl tunneled over http://socket.io

hiredman19:02:21

and I just typed (read) in to it

hiredman19:02:33

emacs prompted me for input

hiredman19:02:36

I typed ':a'

hiredman19:02:44

the result was :a

hiredman19:02:11

like, even tcp socket "streams" are not streams

hiredman19:02:25

they are sequence of messages

hiredman19:02:59

so framing streams as some fundamental answer that will give us super powers is kind of silly

ghadi19:02:01

there are molecules too but we're talking about the user-facing abstraction

ghadi19:02:19

what was that in reference to? ^

didibus19:02:22

Rich sais: > There must be some source (stream) of things read. That source is the same source that should be used should the code being evaluated call 'read'.

hiredman19:02:35

the read input

didibus19:02:41

And that seems hard to argue against. But maybe nRepl supports this now.

hiredman19:02:58

when I said "tricky but doable" and then did it, I was imply it is tricky but has been done

hiredman19:02:09

not "it is tricky, and you kind of have to hack around to make it work"

didibus19:02:44

I think streaming matters. But I'm not sure pRepl qualifies as streaming.

didibus19:02:53

When I think streaming, I think, partial.

didibus19:02:12

Like if I wanted to return a big image from the REPL, and have it rendered in my tool.

hiredman19:02:16

what you mean is you want results split over multiple messages

hiredman19:02:23

"streaming"

didibus19:02:55

Yes, where the messages don't add considerable overhead to the stream. And where you can begin to deserialize very early.

hiredman19:02:15

you can write an nrepl middleware that recognizes java Image objects and starts and a webserver and serves them over http and just sends a link to the client repl

didibus19:02:30

That's a lot of roudabout

didibus19:02:55

If my REPL just returns bytestreams. It could just return the image bytes with a byte header and done

hiredman19:02:20

I think you think more about it that is not enough

hiredman19:02:51

but you can also certainly write an nrepl middleware that detects java Image objects and sends them back as a bunch of bytes

dpsutton19:02:03

ardem added this to cider-nrepl i believe

hiredman19:02:09

(but for example, if you are transporting over something that json encodes things will be tricky)

didibus19:02:34

Yes, but now I'm having to add middleware dependencies ahead of time. So to use a tool, the user is forced to add code to their program. That's why I love unRepl

didibus19:02:14

With unRepl, the tool is in full control. And can choose to be as sophisticated, or as little.

didibus19:02:40

With no pre-req from the user, appart for starting a socket repl.

hiredman19:02:43

all critiques of nrepl I have seen so far instead of making me think "well nrepl could be better" leave me thinking "oh, I guess so and so hasn't used nrepl much"

didibus19:02:10

My critique seems very real. I don't want to have to add nRepl to my code.

didibus19:02:18

Or any additional middleware

hiredman19:02:35

you can add it the way you use any other library

didibus19:02:06

Yes, but that is a burden.

didibus19:02:12

Which I don't want.

hiredman19:02:28

if you want to inject it right in to an existing repl, I don't know if I buy there being a lot of demand for that, but if there is, while nrepl can't do that now, I don't see why reason why it couldn't do that

didibus19:02:49

If it were to do that, it basically becomes unRepl.

hiredman19:02:33

at one point, and this may predate nrepl in the slime/swank days that is how a lot of the functionality was done, it would inject code in to the clojure process

hiredman19:02:53

version that is a nightmare, and making sure extensions work together, etc

ghadi19:02:59

what did it use to inject code into the process?

hiredman19:02:17

the swank-clojure repl

hiredman19:02:38

so of course there was a backlash, and now I guess we are scheduled for a backlash to the backlash

didibus19:02:50

Ya, so this is where unRepl comes into play as well. Once you say, let's inject things into a socket repl. You have so much freedom, that you can also mess up, and different tools could inject incompatible things. Which is where, you want a framework around it. That's where unRepl goes beyond just the idea of injecting REPL functionality into a socket repl, into an actual library to use.

didibus19:02:26

That said, nRepl isn't free of that issue also. Different middlewares need to play well with each other.

hiredman20:02:02

they do, but atleast if you have to included them in a versioned manner in your project.clj or deps.edn or whatever you can try to pin them to something that works together

hiredman20:02:28

but if we just have a free for all of all your tooling just evaling whatever

didibus20:02:05

Well, I can't speak of more details, since it is beyond my knowledge. But in my experience, I've had less issues overall with unRepl then nRepl.

hiredman20:02:22

because unrepl is new and the field is empty

hiredman20:02:53

I don't use any middleware with nrepl and have also never had the problem

didibus20:02:09

Yes, possibly. I'm just not sure that it would create a worse field.

didibus20:02:29

For tooling, nRepl seems non ideal to me.

hiredman20:02:40

the idea that unrepl is better because people haven't written terrible tools around it yet, well, just wait

hiredman20:02:02

and in a year or two you can move on to the next repl

hiredman20:02:36

what tooling have you written for unrepl and nrepl?

didibus20:02:42

Oh, you want refactoring, add this to your project.clj file. Oh, you don't want the refactor lib deployed to prod, okay, figure out a way to use profiles, or aliases to only depend on it in dev. Oh but now, you actually do want to connect to a prod remote repl, and miss your auto-complete? Well too bad, maybe just include that middleware when going to prod?

Michael Griffiths20:02:27

Would you really rather inject some tooling code into prod than include it as a normal dependency though?

Michael Griffiths20:02:06

I agree that sideloading/upgrading is a cool feature but having to add a dep or two surely isn’t a blocker. lein and boot bundle nrepl anyway 🙂

didibus22:02:52

I would actually yes.

didibus22:02:36

Normally my flow is, have issue, ssh to prod host, start a second instance of my app with socket.repl flag. Connect to REPL and debug.

didibus22:02:29

Well, actually, I start a second instance into clojure.main to be more precise. And then I use unRepl to enhance the clojure.main repl to support all kinds of cool features.

didibus22:02:59

That bypasses my server from instantiating, and thus avoids binding to an existing port, as well as make sure it is not serving traffic

didibus22:02:30

I don't think the dependencies are a huge ordeal. But, its a pain point. Especially to newcomers. There's a reason cider-jack-in choose to inject them into lein.

didibus20:02:18

By the way, I'm not bashing on nRepl.

didibus20:02:33

It is great, and does a lot. The functionality is what matters to me.

hiredman20:02:40

I am not interesting in being the defender of nrepl

didibus20:02:42

Which one gives me a better user experience.

souenzzo20:02:51

my generator generates invalid inst 's Is it a know issue? clj -Srepro -Sdeps '{:deps {org.clojure/test.check {:mvn/version "0.10.0-alpha3"}}}' -e "(do (require '[clojure.test.check.generators :as gen] '[clojure.spec.alpha :as s]) (gen/generate (gen/vector (s/gen inst?)) 120 6))" [#inst "1970-01-01T01:24:38.462-00:00" #inst "1969-12-06T11:54:24.666-00:00" #inst "820499-07-18T05:28:23.398-00:00" #inst "1969-08-08T01:04:53.430-00:00" #inst "1970-01-01T00:00:00.000-00:00" #inst "1970-01-01T00:00:00.001-00:00"] The 3 one: #inst "820499-07-18T05:28:23.398-00:00" the reader can read it.

Alex Miller (Clojure team)20:02:06

not a known issue, file a jira

hiredman20:02:08

I take issue with people making bad comparisons to bolster their preferred solution

hiredman20:02:25

I get it, you like whatever, everyone likes things

didibus20:02:11

Well, I'm not feeling like I'm making bad comparisons. I'm only stating a difference, which I think is not mistaken. nRepl requires hard dependencies to it and its middlewares. UnRepl does not.

didibus20:02:46

And others seem to say that nRepl handles input and output in a way that makes certain code not behave normally. I can't speak to that fact. Maybe nRepl is handling all that correctly now, so it isn't an issue anymore.

didibus20:02:10

Finally, I feel neither nRepl nor pRepl can allow for streaming data. So there use case suffers when you need to return gigantic results. Obviously, no tools needs this as of yet. But I like that UnRepl doesn't limit that, because the tool could choose its own mechanism.

didibus20:02:11

Or might be more fair for me to say, limited streaming capabilities

didibus20:02:02

I'm not totally sure about that last one though. I might be wrong about both nRepl and pRepl in that regards, I admit.

didibus20:02:16

I also understand that, none of these might seem like good enough differentiator to warrant splitting the REPL ecosystem in three. And ya, maybe that'll end up worst, now having some tools use nRepl, others pRepl, and some more unRepl.

didibus20:02:04

Anyways, I just wanted to understand where pRepl differentiated itself from nRepl, or unRepl. So thanks everyone for helping me understand that better.

Michael Griffiths20:02:04

nrepl can “stream” evaluation results over one or more messages since 0.6, and it was always possible with middleware (cider’s pretty printing middleware has done that for a long time). So you can interrupt an evaluation while printing a large (or infinite) result

didibus20:02:06

Hey thanks for that piece of info @cichli I know you've been hard at work on the cider orchard and nRepl. I love all the improvements being done. And actually agree with @bozhidar choice to stick with nRepl and double down. Lots of good stuff uses it, and it makes sense to just keep improving and making better what we already have.

Michael Griffiths20:02:48

I think it’s a good thing if there are other REPL implementations tbh, tooling ecosystems can be diverse without being fragmented. If nrepl makes tradeoffs that dont make sense in some circumstances (i.e. how it handles *in* / *out*) then we should have other options

seancorfield20:02:01

I think once the nREPL clients can side-load the nrepl dependency over a Socket REPL or pREPL, no one will really care about the differences.

seancorfield20:02:42

It'll just become more and more common to start from a simple Socket REPL or pREPL, initiated by Clojure itself based on JVM options, and any and all tooling will start from that point and build up.

seancorfield20:02:02

For me, that's the main benefit: you can start an arbitrary JVM process (that contains Clojure), using JVM options to start a basic REPL, and then connect to that process from any editor, command-line tool, whatever, using whatever set of tooling features you like best.

john20:02:39

WRT nrepl to a cljs target, interrupt doesn't actually work.

Michael Griffiths20:02:26

That depends on which cljs repl you’re using – e.g. Nashorn handles interruption how you’d expect since it’s in the same runtime. Any kind of browser or foreign runtime and it gets complicated

hiredman21:02:29

I spent lunch thinking about streams vs. messages, and it seems like what differentiates nrepl and socket repl/prepl in that regard is, nrepl has different message types for "user input" and "forms to evaluate input" where as for socket repl/prepl there is effectively one "input" message type for both

gfredericks21:02:05

are there any libraries that modify clojure.test output for exceptions to also show the ex-data?

Alex Miller (Clojure team)21:02:06

clojure 1.10 does now I think

😮 5
Alex Miller (Clojure team)21:02:33

yeah, that was CLJ-1209

gfredericks21:02:47

does it print everything?

gfredericks21:02:52

is it pretty printed?

gfredericks21:02:00

*print-length*?

Alex Miller (Clojure team)21:02:11

what do I look like, a go-try-it-machine?

😛 10
rodsenra21:02:12

Dear Clojurists, any recommendations for DynamoDB API's? So far, Faraday https://github.com/ptaoussanis/faraday looks the most promising, even though last commit was on 2017 :thinking_face:

Alex Miller (Clojure team)21:02:56

you could use the new cognitect-labs aws-api

10
😮 10
rodsenra21:02:25

I will give it a shot

hiredman21:02:14

I've used faraday a little, ended up ripping it of a project in favor of the java sdk (and ultimately getting rid of dynamo altogether and the deployment target changed). faraday was a little too magic for my taste, if you try and do anything actually database like with dynamo vs. just using it as a key value store, a lot of the decisions faraday makes with regards to serialization will bite you

Alex Miller (Clojure team)21:02:36

aws-api doesn't use java sdk, just makes web calls, so it's much lighter weight

hiredman21:02:03

yeah, that example looks great

hiredman21:02:07

working with the java sdk is also frustrating because you can tell it is all json under the hood but you have to build all these java objects, which the aws-api stuff avoids

Alex Miller (Clojure team)21:02:28

what, you don't like needless data -> object -> data transformations?

🙃 20
gfredericks21:02:15

I first parsed that as "needless data" -> "object" -> "data transformations" and that was much weirder

noisesmith21:02:25

that's like the spring module for monads right?

🤷 5
johanatan22:02:15

Is there a way to expose an nrepl port (remote) to cider for a clj/deps instantiated repl?

gfredericks22:02:40

ssh port forwarding?

hiredman22:02:45

there is a lot to unpack there

lilactown22:02:47

@johanatan are you asking how to use CIDER to connect to a remote REPL, or how to setup your project to include nREPL

hiredman22:02:57

what is a clj/deps instantiated repl?

hiredman22:02:31

the clojure.main repl? the socket repl? a nrepl server in your code?

johanatan22:02:42

@lilactown the former. I know how to do it generally just not for a repl started via clj (with a backing deps.edn)

lilactown22:02:10

M-x cider-connect or something to that effect

☝️ 5
johanatan22:02:12

@hiredman it’s literally what you get if you just run the ‘clj` executable

johanatan22:02:38

I know how to do it on the cider/emacs side. But doesn’t the repl server have to somehow include nrepl?

lilactown22:02:54

oh, okay, so you meant the latter

hiredman22:02:54

the old nrepl project has a great readme that explains how to embed an nrepl server

hiredman22:02:21

the new project has moved it all in to some fancy docs site that doesn't work without javascript

dominicm22:02:27

Sorry, my fault!

dominicm22:02:55

Although I expected antora not to be js dependent, I might report this upstream

johanatan22:02:33

So no one has made this automatic as it is for Leiningen?

dpsutton22:02:57

(nrepl-server/start-server :bind "0.0.0.0" :port nrepl-port
                               :handler cider-nrepl-handler)

johanatan22:02:17

@dpsutton thx! 👍:skin-tone-2:

dpsutton22:02:29

i did this about two hours ago at my new job 🙂

johanatan22:02:52

Good timing lol

didibus22:02:25

clj -Sdeps '{:deps {nrepl/nrepl {:mvn/version "0.5.3"}}}' -m nrepl.cmdline

johanatan23:02:35

@didibus that's what i was looking for. thx!

seancorfield23:02:49

That (and a whole lot more) is in my .clojure/deps.edn file @johanatan https://github.com/seancorfield/dot-clojure/blob/master/deps.edn#L47 as some inspiration of what you can do with CLI / deps.edn

rainbow-mouth 10
johanatan23:02:29

what does your clj invocation to utilize the main-opts look like?

johanatan23:02:47

is it just: clj -R:nREPL ?

seancorfield00:02:10

I pretty much just use -A for everything -- so for aliases where I might want just the dependencies sometimes and also the main opts other times, I tend to break them into two aliases. Hence -A:test:runner for example, and the ability to combine the REBL aliases with others to add dependencies, start a Socket REPL Server, and so on.

johanatan00:02:30

Hmm, I’ll have to learn about that. My clj usage is rather shallow at this point

seancorfield01:02:29

Happy to answer any questions -- we switched over from Boot to CLI / deps.edn completely last year, after being on Boot for three years (we were on Leiningen for four years before that). Feel free to DM me about it.

johanatan02:02:52

👍:skin-tone-2:Thanks!