Fork me on GitHub
#clojure-dev
<
2018-02-22
>
rymndhng00:02:58

@alexmiller do you have any suggestions how I should go about getting eyes on https://dev.clojure.org/jira/browse/TNS-48. I'm not sure what's the best way to reach out to stuart sierra or clojure contrib to start a conversation about it

Alex Miller (Clojure team)03:02:22

Sorry, I don’t have a good suggestion for you. Stuart is the current project owner and I would defer to him on this enhancement. I think it would be reasonable to bring it up on the clojure mailing list.

rymndhng05:02:34

^ on that point would it be preferable to use the clojure or clojure-dev mailing list?

Alex Miller (Clojure team)05:02:04

I’d suggest the clojure list as that’s a wider audience

seancorfield05:02:51

I'd use the clojure-dev mailing list first and give it a few days. Then try clojure.

seancorfield05:02:22

But it could just be that Stuart is busy -- he's definitely gotten your emails from JIRA -- and hasn't yet formulated a response.

seancorfield05:02:39

Sometimes you need to be patient with project maintainers.

seancorfield05:02:14

I try to acknowledge comments within a day or two but often don't have a considered response for several weeks on the projects that I maintain @rymndhng

rymndhng05:02:11

thanks for the advice, i definitely want to tread lightly, not trying to stalk 👻 haha

seancorfield05:02:11

@rymndhng I've been maintaining open source projects for about 25 years... it's always interesting how "urgent" one user's issue can be compared to the hundreds or thousands of other users of any given piece of software 🙂 It's hard, as a maintainer, to ensure everyone feels listened to -- but it can also be pretty overwhelming when users demand your time, especially if you maintain a number of projects and you have a full time job too.

seancorfield05:02:35

There are issues that have been open on clojure.java.jdbc for years, not because I don't care, or I think they're not important, but because I don't have a good solution even after lots of thought and the solutions suggested in the issues don't really work for me.

seancorfield05:02:23

I took a look at TNS-48 and my initial reaction was discomfort with your proposed solution but I can't immediately put my finger on it.

seancorfield05:02:08

I don't know that namespace metadata is really a good solution -- is there a precedent for it out there? I also wondered about how developers would always know whether there's a specific dependency between an individual namespace and a specific set of files... Would they always be files on the classpath? What about code that depends on files elsewhere on the file system?

rymndhng06:02:28

it isnt, however it’s de-coupled from the rest of the tooling by using the namespaced key. if you aren’t using tools.namespace, the metadata doesn’t impact your code

rymndhng06:02:05

i definitely agree with you on not burdening maintaners. I definitely want to approach this change as a conversation with back & forth. As a relative outsider to contrib, it’s tricky to know if I’m going about it the right way b/c it’s a different circle of peers I’m interacting with, so I’m currently skimming on the edges 🙂

Alex Miller (Clojure team)06:02:22

Namespace metadata used to be broken in AOT but that was fixed in Clojure 1.8 (CLJ-130)

Alex Miller (Clojure team)06:02:37

I don’t know if there are any cljs considerations with it

seancorfield06:02:58

HugSQL is kind of an interesting case because it relies on a function call in a namespace to read external files and generate new or updated functions. I'm not sure how common that is as an idiom, which also makes me wonder if the solution shouldn't be pushed off on HugSQL somehow...

Alex Miller (Clojure team)06:02:15

I think it’s good that it’s a) out of band in metadata and b) tied to a namespace for namespace reloading functionality

Alex Miller (Clojure team)06:02:55

it’s possibly bad in that it embeds “dev” concerns in your code

Alex Miller (Clojure team)06:02:11

you could envision an external source of this info instead for example

seancorfield06:02:25

Yeah, that was my gut reaction to it, to be honest.

rymndhng06:02:29

HugSQL is one case. Another case may be re-loading confg files perhaps.

seancorfield06:02:02

Well, reloading config files is the situation we'd face at work, but that's completely handled by Component.

seancorfield06:02:33

Part of me feels that the problem is HugSQL itself, in the way that it dynamically injects functions based on an external file. Is that idiomatic? Is that something that HugSQL should negotiate with c.t.n for the reloading?

rymndhng06:02:15

I’d argue that HugSQL and c.t.n shouldn’t be negotiating because it’s not universal that all def-db-fns should auto-reload. I was thinking more of putting the power it in the user’s hands and avoid magic behind the scenes negotation.

seancorfield06:02:21

Right, but you're asking c.t.n for a mechanism to call for reloads that has nothing to do with the code. What about a library that works like HugSQL but keeps the SQL files in external dynamic storage?

seancorfield06:02:45

What about a library that dynamically defines functions based on data in Zookeeper, for example?

seancorfield06:02:20

That's why I asked about files that aren't on the classpath. How far away from the classpath and "file modified" timestamps should you go?

rymndhng06:02:33

That sounds like feature creep. c.t.n is a development tool and it’s focused on changes to source files & how it maps to namespaces.

seancorfield06:02:23

But HugSQL files aren't really "source" files -- they're configuration files that are used by function calls to add new functions to the running image.

rymndhng06:02:47

They’re source in the way they’re files you check into your repo with your clojure code.

seancorfield06:02:33

But as I've said, that's a very limited view of those sorts of extensions -- configuration files aren't always going to be under version control with your code, for example.

seancorfield06:02:06

I'm just echoing Stuart's response that some sort of extension to "when to reload this namespace" clearly has value -- but how should that be structured?

seancorfield06:02:52

Should the metadata be classpath files? Should it be symbols that resolve to functions that should be invoked?

seancorfield06:02:00

The general problem is that "some metadata" may change and may cause changes to a given namespace without the source file for that namespace actually changing.

seancorfield06:02:58

I'll give you an example from work: we have specs that we use to drive macros that generate functions. We'd need a way to say "reload this namespace when those specs have changed in certain ways".

rymndhng06:02:14

can you clarify further? i don’t see the point you’re making

seancorfield06:02:22

All I'm saying is that there are lots of ways a reload dependency could be introduced -- and in my opinion HugSQL is a pretty narrow use case.

rymndhng06:02:22

For sure, I see your point as going about smaller API is better for consistency and not having feature creep. Again, HugSQL is only one possibility so far for use of this.

seancorfield06:02:49

I think it's something that needs a lot of hammock time...

dominicm10:02:38

We have this issue with clojurescript, macros and localization files. For now it requires us to touch things to resolve them. I believe that enlive also suffers from this.

cgrand10:02:07

My own half baked attempt at reloading (in enlive) used namespace metadata but dynamically (so no metadata in the source, only in the “image”), when a resource was used in a defsomething, the macro was adding an entry for it to the live ns metadata.

dominicm10:02:39

@cgrand you wrote your own reloader right? So that if the dependency updated, you reloaded the namespace yourself?

dominicm10:02:54

I'm guessing there was a thread involved with polling the file too.

cgrand11:02:18

@dominicm indeed https://github.com/cgrand/enlive/blob/master/src/net/cgrand/reload.clj but it was half hearted as it wasn’t a pain point for me but users kept asking for it

dominicm11:02:06

@cgrand it makes sense. It's definitely something that feels outside of what enlive should have been providing.