Fork me on GitHub
#clojure
<
2015-06-05
>
ghadi05:06:44

a JDBC library built for clojure 1.7

ghadi05:06:26

reducible sql result-sets, really clean impl.

chris05:06:12

Where do I store my config for environ? I figured it was supposed to be in .lein-env, but that seems to get overwritten. Do I have to use a local project.clj file? That seems a little kludgy, there has to be a better way

arrdem05:06:16

I'm gonna have a fairly monster Clojure patch/fork for y'all to test in a minute...

arrdem05:06:42

chris: use lein-environ and then yeah it goes in your leiningen profiles why is that clunky

chris05:06:59

Then I have a copy of my project.clj file that isn’t getting checked into source control

chris05:06:04

that feels off to me

arrdem05:06:18

why would you... oh you want to have secret keys in your env?

chris05:06:33

yeah, it’s passwords for dbs

chris05:06:24

heroku manages it when it’s deployed, but I feel like there is a good solution locally without copying and git ignoring

arrdem05:06:40

tbqh not one that I know of.. heroku uses environment variable so I'd look at a make task or something that builds the environment from an ignored vars file and then runs your program

chris05:06:49

oh, profiles.clj, not project.clj. Does lein-environ handle the merging of the two

arrdem05:06:51

should be like 6 lines of bash

chris05:06:05

I guess it must

chris05:06:08

thanks for your help

arrdem05:06:20

or yeah you could put that stuff in your global profiles...

arrdem05:06:31

also kinda kludgy but it'll work

arrdem05:06:42

ghadi: what of this?

ghadi05:06:22

arrdem: reducible glory, of course

chris05:06:42

well, it looks like it supports having a local profile that merges into the project.clj at runtime. You can then just ignore that file and not worry about duplication. There is a PR to make the readme a little clearer, which would probably help.

arrdem05:06:16

"glory" more like gory

arrdem05:06:24

congrats ghadi

jonas05:06:06

@ghadi: squee looks really nice!

srihari05:06:21

ghadi: neat!

kongeor09:06:21

Hello, do you know how can I prevent a (use-fixtures :once ...) from being run when I use test-selectors in leiningen ?

ul10:06:14

what is correct, lein do clean, trampoline figwheel or lein trampoline do clean, figwheel if i want to get target clean and figwheel running alone in the end? ps aux | grep lein says that both end up with single process, but to be sure, what is the way to go usually?

xeqi10:06:19

@ul: both work. I don't bother w/ trampoline, but if I had to choose I'd use the first

placeboza13:06:05

anyone tried writing any games with Clojure yet?

jackjames13:06:30

@placeboza: zach oakes talk may have been the best of the conj last year: https://www.youtube.com/watch?v=0GzzFeS5cMc

chris13:06:27

@martinklepsch: thanks for your help. that blogpost was exactly what I needed. I’ve got it up and running now

martinklepsch13:06:11

@chris: nice! Just published it yesterday so that was a neat coincidence simple_smile

placeboza13:06:13

@jackjames: Cool, I did try using play-clj already, just checking if that's still the way to go

chris13:06:25

great timing!

placeboza13:06:27

also interested in how I would do it for a monbile

placeboza14:06:48

ooh. Unity. worth a look. tx @jcsims

mystery14:06:41

The Arcadia library is pretty good, but if you haven't done any prev game development, the learning curve is intense because you both need to learn Unity and the Arcadia bits. I also recommend getting your stuff off their develop branch, a lot's been added and I don't think master's been updated in a pretty long while.

mystery14:06:36

https://github.com/selfsame this guy's made the most Arcadia games, so his stuff's a good resource. His hard library is also full of stuff you might wanna use in Unity.

placeboza14:06:38

k noted. I have access to pluralsight, so I'll probably do the unity course first

mystery14:06:02

Good luck!

placeboza14:06:00

we'll see if I actually get the time

maio15:06:20

(fn [biiig-data] (fn inner [] nil)) will the inner function capture biig-data if it doesn’t use it?

maio15:06:35

s/biig/biiig/

arrdem15:06:39

But you can always dump the class and look for yourself

tcrayford15:06:39

yeah, I think it won't either. Easy to just look at the bytecode for the inner fn though

tcrayford15:06:56

think you'd cause huge perf/gc issues if it did

tcrayford15:06:02

and clojure is too sensible for that 😉

thomas15:06:59

Does anyone know how to catch an instaparse exception?

thomas15:06:27

I tried this:

thomas15:06:28

(try (command-parser s ) (catch java.lang.IllegalArgumentException e [:d :d]))

thomas15:06:42

but it doesn't seem to work for some reason

thomas15:06:11

(and yes I do want to return [:d :d] in case the exception fires.

yogsototh15:06:14

@thomas I don’t try to (catch Throwable t … ) It will catch everything

thomas15:06:05

@yogsototh: hmm catching throwable doesn't seem to work either

tcrayford15:06:32

if catching throwable doesn't work, nothing will work 😉

tcrayford15:06:45

@thomas: do you get an error message? What does it look like?

thomas15:06:09

Exception in thread "main" java.lang.IllegalArgumentException: No matching clause: [:reason [

thomas15:06:22

is what I get back when I enter something that is invalid

tcrayford15:06:39

that seems like it should work…

tcrayford15:06:06

thomas: just checked instaparse's docs - they don't throw exceptions upon failure

tcrayford15:06:22

according to their docs and my production code which uses them

tcrayford15:06:40

is your illegal argument exception coming from somewhere else? or does the stacktrace point at instaparse?

tcrayford15:06:46

see instaparse/failure?

thomas15:06:06

@tcrayford: hmm ok. what should happen if you give it something it can't parse?

tcrayford15:06:24

you get a thing upon which instaparse.core/failure? returns true

tcrayford15:06:33

then do whatever you like with it

tcrayford15:06:45

super easy to wrap that in a thing that throws illegal argument exception if you want

tcrayford15:06:57

cmd-f for "parse errors" in the instaparse readme: https://github.com/Engelberg/instaparse

thomas15:06:04

hmmm... Ok I think I begin to understand it.

thomas15:06:14

I might fail on the next time

tcrayford15:06:33

seems very possible. Them confusing clojure stacktraces eh 😉

thomas15:06:38

let me try something.... brb

thomas15:06:36

ok got it... Instaparse return a failure object.... and I needed to check for that. DOH

andrevdm15:06:06

Does anyone have any links to blogs / vids / papers that discuss maintaining a code base in a dynamic lang vs a (properly) statically typed one? Bonus points if it discuss how gradual typing changes things or not

andrevdm15:06:01

Any comments from personal experience would be great too

noisesmith15:06:33

andrevdm: not what you asked for, but anecdotally things like prismatic/schema and unit tests make things much easier

tcrayford15:06:17

@andrevdm: my favorite thing on this topic is this takedown of many of the studies done on static typing: http://danluu.com/empirical-pl/

mystery15:06:08

Ooo, interesting article. That's @tcrayford

andrevdm15:06:32

Thanks, reading now. I've really enjoyed static typing lately but want to be kept honest about the actual advantages

tcrayford15:06:37

the real tldr is that there are no reliable/good studies of static typing vs dynamic typing, or programming languages, or any other thing measuring programmer productivity. If you ever dig even slightly into any study, it always falls apart super fast. We (as an industry) literally have no even slightly evidence-based idea of what is good or bad that holds up.

tcrayford15:06:53

So uh, just do whatever works for you and hope it works out ok 😉

xeqi15:06:49

hurray "software engineering"

gary15:06:30

No clojure, clojurescript, datomic, simulant, or generative testing talks at this years No Fluff Just Stuff conference =(

markstang15:06:36

Ah, No Stuff, Just Fluff (NSJF)

gary15:06:27

exactly, now I'm seriously considering setting up a meeting with my boss to talk about sending me to clojure conj instead

tcrayford15:06:54

the real fun thing about that whole situation: I was reading a book published in *1971* that bemoaned exactly the same thing

bsima16:06:54

Does anyone use Clojure on the CLR?

mystery16:06:52

I think most people that use CLR use it for Arcadia

bsima16:06:24

That's actually why I asked, mystery . I recently learned about Arcadia and wanna try it out

mystery16:06:54

Best place to ask about any Arcadia stuff is right here: https://gitter.im/arcadia-unity/Arcadia

bsima16:06:34

thanks mystery 👍

borkdude19:06:29

sanity checking: what's the benefit of putting lein plugins in the dev profile? smaller uberjar?

borkdude19:06:38

does it ever make sense to not put them there?

noisesmith19:06:59

borkdude: for a lib, that can ensure that your plugin is not pulled in to a project using the lib

noisesmith19:06:03

which usually is the right thing

xeqi19:06:48

I didn't think a :plugin became a downstream dependency

noisesmith19:06:17

yeah, you guys are probably right

xeqi19:06:17

@borkdude: I can't think of a good reason for putting them in :dev offhand. I have put some in their own profiles in profiles.clj and aliased commands like lein eastwood = lein with-profile +eastwood eastwood

xeqi19:06:45

so that they wouldn't always be active and pulling in their transative deps and messing with other plugins

borkdude19:06:57

@xeqi: I'll double check in #leiningen on IRC

arohner19:06:55

borkdude: if you’re building a library, :dev deps are good for dev/test, and aren’t part of the runtime deps

arohner19:06:08

oh, I misread

arohner19:06:46

borkdude: a minor benefit is faster load time for lein tasks that don’t need them

borkdude19:06:42

do some lein plugins depend on other plugins? yeah, in the case of figwheel that's true I think

arohner19:06:04

borkdude: plugins aren’t transitive, but :dependencies are

arohner19:06:21

figwheel’s deps get loaded into the lein process

borkdude19:06:00

so tasks are always independent

borkdude19:06:24

then leiningen doesn't probably load dependencies of other tasks if you call one specific right? or maybe it does, because you can call multiple at once with do

arohner19:06:14

this is where I start getting unclear, but I believe all plugins in the active profile get loaded

arohner19:06:23

and all their deps

xeqi19:06:28

that is correct. All plugins in the active profiles are added to the lein' process's dependencies, downloaded, and checked for hooks/middleware

shriphani20:06:33

hi guys. a q about the 1.8 release - are there any perf numbers for the clojure lean runtime?

arrdem20:06:19

1.7 not 1.8 and no not yet.

arrdem20:06:39

As I recall, lean runtime is a feature that was more or less dropped from this release. Rich didn’t want to go with a static linking approach and the various proposed lazy loading techniques don’t perform as well as desired. lein-skummet continues work on the lazy loading stuff and I have some static linking stuff on the back burner.

arrdem21:06:05

ghadi has something in the oven as well for CLJ 1.8 when JDK7 gets dropped and invokeDynamic can be used

ghadi21:06:59

build profiles have to come too. I've done no work on that, but Alex might have

ghadi21:06:18

we're going to want to control invokedynamic because of android

arrdem21:06:56

I’ll want to pick your brains on those eventually, I haven’t seen anything concrete about build profiles yet.

arrdem21:06:11

but I also haven’t been paying attention for a few months

ghadi21:06:11

many people have different definitions of lean, too

danielcompton21:06:37

@arrdem: don’t we have to drop Java 6 first?

arrdem21:06:12

@danielcompton: I thought we already dropped 6 and invokeDynamic was new in 7

arrdem21:06:57

one of us has to 😛

arrdem21:06:18

so yeah “we" are on 6 thinking about moving to 7

danielcompton21:06:51

wonder about jumping straight to Java 8, as 6 and 7 are both EOL

danielcompton21:06:05

although I guess some orgs may have support contracts to extend this

ghadi21:06:32

7 has invokeDynamic just not a great impl

ghadi21:06:08

JRuby has turned off their indy bytecode option twice