Fork me on GitHub
#clojure
<
2016-07-06
>
Doug Kirk00:07:54

pretty bold putting an Alpha in production

donaldball00:07:14

With the exception of core.spec, everything else seems very stable. We’re using it in staging without issue.

seancorfield01:07:33

We’ve run Alpha builds in production since we got started with Clojure back in 2011 (1.3.0 Alpha 7 or 8 was our first production build, I believe). We do multi-version testing against master and our current stable selection all the time. Clojure is extremely stable across versions these days.

seancorfield01:07:16

FWIW, a breakdown of our code base:

Clojure build/config 10 files 1047 total loc
Clojure source 151 files 31907 total loc,
    2284 fns, 692 of which are private,
    344 vars, 10 macros, 36 atoms
Clojure tests 106 files 11149 total loc

seancorfield01:07:22

"build/config" is our build.boot file and the various EDN files we use to specify dependencies and environmental configuration across dev/qa/prod. Our tests are either Expectations-based "unit" tests or clj-webdriver Selenium UAT tests.

seancorfield01:07:04

(actually the Expectations stuff includes a few large suites of tests for our REST API as well, so not all "unit" level stuff)

mj_langford02:07:29

There is already a backport of spec to 1.8 as well out there

seancorfield04:07:47

That backport would be (more) interesting if it also worked on 1.7 and maybe 1.6 I think. After all, 1.9 is basically 1.8 + clojure.spec anyway so I don't quite see the point of a 1.8-only backport... But that's probably because I'm happy running prerelease builds in production anyway.

mj_langford04:07:00

The optics of pre-release in production is the pure reason I looked at the backport 😄

seancorfield04:07:29

What industry are you in @mj_langford ? And who oversees your production systems (i.e., what kind of departmental structure do you have there)?

seancorfield04:07:24

I suspect if we had a "fire" in production that was directly traceable to using prerelease builds, we'd change our policies... but it was the same at my last place (small, startup like) and my previous place (Adobe, not so small).

ezmiller04:07:28

if i have a fn that imports data from a csv and I want to make that data available in the global namespace, what’s the best practice way of doing that it in clojure?

mj_langford05:07:42

@seancorfield: I do iOS development along with the associated backends. The use of Clojure at all is something I can sell reasonably well when they care at what is used for their backends, however I see a lot of sharp intakes of breath over version numbers in libraries among other things when they’re acclimating to it.

mj_langford05:07:31

I personally think Clojure is so stable it’s silly sometimes next to everything else in the ecosystem, and if there was budget to test more thoroughly I’d probably go with your approach.

mj_langford05:07:09

Realizing I didn’t answer your question: I’m a consultant, I bring companies up on apps (and if needed, backends to go with them, which are Clojure these days, with cljs front ends when required). I’m sometimes the end all be all of the structure next to business folks, sometimes there are dozens of others.

ido05:07:50

hey guys, in test.check.generators is there a way to generate values that are randomly chosen from a collection?

ido05:07:46

oh I just realized that this is what

generators/elements
does

seancorfield05:07:56

@mj_langford: Interesting. Given how bleeding edge a lot of mobile app development is, I'm a bit surprised they don't view the server side in the same light. It's always fascinating to see the different standards applied to different parts of the equation.

mj_langford05:07:29

Yeah, we don’t want to be riding razor blades into lakes of salt all the time

mj_langford05:07:33

that’s apple pushing us down them

mj_langford05:07:07

And if you have lots of risk in one part, you want very little in the other parts.

seancorfield05:07:43

@ezmiller: Take a look at delay for creating a global that is evaluated just once on demand and caches the result.

seancorfield05:07:41

@mj_langford: We have both Android and iOS apps and it's really the wild, wild west in some ways (esp. Android!), and it makes Clojure look very mature and stable by comparison 😆

mj_langford05:07:38

iOS dev is basically great fun from Feb till June with nothing changes and everyones on the new stuff. Then June-Sept is running in terror getting things ready for the new stuff that’s coming out. Then Sept-Feb is supporting 2-3 versions of the OS until Feb when you can drop the old ones.

mj_langford05:07:13

Clojure is like “oh, new fun stuff from a conference, new alphas, oh look they work pretty much without change"

mj_langford05:07:26

But I can ignore it when in the terror periods, Perfect complement

iku00088805:07:49

Hi, has anyone ever implemented request size restriction in ring + immutant/web?

jcrossley312:07:22

iku000888: i have not, but there are some relevant undertow options described here: http://undertow.io/undertow-docs/undertow-docs-1.3.0/index.html#listeners-2

dominicm14:07:06

> Call getNextException to see the cause. What is the reasoning behind SQL stuff doing this? It just seems to frustrate me 😛

ezmiller15:07:32

@seancorfield: thanks. will checkout delay.

ddellacosta16:07:52

@dominicm: don't hate on SQL, it's not its fault! 😉

ddellacosta16:07:11

I assume this is just how JDBC works

dominicm16:07:46

Yeah, there's gotta be a historic reason though I guess? I've never written Java, so I have no idea.

ddellacosta16:07:18

I dunno—I would assume it's so distinct exceptions can be made out of more complex errors coming from the RDBMS in a Java-y way. But this is just part of the Java SQLException interface I believe, and has been for a while: http://docs.oracle.com/javase/8/docs/api/java/sql/SQLException.html#getNextException--

mbertheau16:07:28

(let [label (if restore? "Restore" "Delete") action (if restore? :restore :delete)] (f label action)) How can I simplify this so that (if restore? ...) is not repeated?

ddellacosta16:07:36

mbertheau: among other possibilities, (apply f (if restore? ["Restore" :restore] ["Delete" :delete])

ddellacosta16:07:26

or simply (if restore? (f "Restore" :restore) (f "Delete" :delete))

ddellacosta16:07:41

dunno, lots of context I'm missing there

mbertheau16:07:11

@ddellacosta: Hmm, the (f ..) is actually more complex, and I need label and action in separate places, not as arguments to the same function.

ddellacosta16:07:54

@mbertheau yeah, like I said, I'm missing context—a more complete snippet/pastie/gist etc. would be better for getting good suggestions

mbertheau16:07:32

Ah, what I'm looking for seems to be (let [[label text] (if restore? ["Restore" :restore] ["Delete" :delete])] (f label text))'

ddellacosta16:07:40

sure, that works

ddellacosta16:07:03

destructuring for the win

ddellacosta16:07:50

sure, not sure how much I helped, but you're welcome 😄

gfredericks17:07:11

reading emojis in emacs never stops being weird https://www.refheap.com/121165

stephen_turley17:07:52

Hello everyone. Do you folks have any suggestions for mocking/stubbing/spying in tests?

bostonaholic17:07:15

@stephen_turley: with-redefs works for 90% of my use cases

flyboarder18:07:14

Hello everyone, what is the correct way to handle multi arity functions when used with cljc? Right now I am trying to use the reader conditional inside my defn, but im wondering if I should just use a root level conditional?

settinghead19:07:38

anyone else having encoding issue with transit-clj with Clojure 1.9.0-alpha8 and above? if I use namespace qualified keyword in my map, the resulting encoded message looks strange: {::some.namespace/foo 1} becomes {#:some.namespace {:foo 1}}

settinghead19:07:06

(i’m using sente, and my sente server is complaining about bad package after the version upgrade. not quite sure if it’s a sente issue, a transit-clj issue or a Clojure issue)

settinghead19:07:43

@alexmiller: i noticed you recently made a commit in the alpha (https://github.com/clojure/clojure/commit/6d48ae372a540903173be2974b66b8911371e05d#diff-3a5dca122734225f3f60263876401aebR605), and i suspect it has something to do with it ^. any insights what might be causing the issue? (sorry for singling you out if this turns out to be unrelated)

Alex Miller (Clojure team)19:07:02

@settinghead: that’s the new namespace map literal syntax

settinghead20:07:33

@alexmiller that’s it! thanks. i’ll file a bug to the lib author

Alex Miller (Clojure team)20:07:01

the edn reader (in 1.9.0-alpha8 +) should also understand this syntax

Alex Miller (Clojure team)20:07:21

tools.reader has also been updated, but depending on the clojurescript version you’re using, it might not

settinghead20:07:04

@alexmiller: yes, upgrading ClojureScript to latest master branch solved the issue. thanks

sorenmacbeth21:07:24

anyone else having trouble with time outs pushing to clojars lately?

tcrawley21:07:28

@sorenmacbeth: no one else has reported that

tcrawley21:07:45

to the clojars admins, at least

tcrawley21:07:20

what library are you pushing?

tcrawley21:07:28

I can look in the logs for any clues

sorenmacbeth21:07:34

ok. last couple of times it’s happened to me. so just 3 times or so in the last few weeks, but probably 60% of the deploys I’ve done over that time all for yieldbot/vizard

tcrawley21:07:59

can you gist the error you get?

tcrawley21:07:45

I only see 201's in the logs in response to vizard PUTs. Are you using a proxy?

danielcompton21:07:19

Huh actually I had that too recently

danielcompton21:07:26

forgot to mention it

iku00088823:07:51

@jcrossley3: Thanks! Will investigate!

vincentjames50123:07:00

Anyone know of any good clojure spec youtube videos?

jm23:07:13

Not on youtube, but this is a good intro: https://lambdaisland.com/episodes/clojure-spec

vincentjames50123:07:38

Thanks jm. I’m specifically looking for a talk on it for a little lunch series I’m putting on.