Fork me on GitHub
#clojure
<
2016-01-10
>
esnunes00:01:21

thanks @meow it is nice to know that in 8 months you achieved a lot, I've been reading clojurians channels for a week and you are very active on them

meow00:01:05

Lein and boot are the two standard build tools. I use lein for simple things or if there is a good template or with figwheel. For more sophisticated stuff I use boot. Both will be around for some time so it pays to learn something about both.

meow00:01:28

The #C053K90BR channel provides great support as boot can sometimes be a bit of a learning curve depending on your background.

meow00:01:11

For unit tests I've just used the regular test library, but there are several good variations like the expectations that @akiva and @donmullen mentioned. There are also libraries that can do generative tests. It really depends on what style of testing best matches your domain and personal preferences, which is not a bad thing at all.

akiva00:01:30

I’m 100% Spacemacs but that’s mostly because of my vim background. There’s a #C09C8GRLY channel, too, btw.

esnunes00:01:51

thanks, I will definitely bother you guys a lot simple_smile

donmullen00:01:50

@esnunes: Definitely check out simulation testing / generative testing at some point. Good resources are Mike Nygard’s talk https://www.youtube.com/watch?v=N5HyVUPuU0E and podcast : http://blog.cognitect.com/cognicast/059-michael-nygard

msattel00:01:33

Anybody using bool.clj ? After updating boot I get the following exception: Multiple jar entries match : .*/pom.xml Anybody has an idea what could cause that exception.

danielsz00:01:13

@msattel You may want to ask this in the #C053K90BR channel. They are very quick to respond.

msattel01:01:24

thanks for that hint

danielsz01:01:08

@esnunes: It may take time, but Boot will probably become the build tool of choice for Clojure development. I don't know anyone who switched back. It's just that good.

meow03:01:01

Is clojuredocs broken? The link to source for if is: https://clojuredocs.org/clojure.core/if

meow03:01:47

@danielsz: I do. But I still agree with your point. Boot is great. But lein will be around for some time. They work well enough together.

akiva03:01:57

@meow, coming up fine for me.

meow03:01:17

not for me

meow03:01:26

the source code link

meow03:01:03

probably because, you know, what mike is pointing out on #C053AK3F9

srdjan04:01:23

@jonahbenton: I just wanted to let you know that I got the thing working and wanted to really thank you for your help

jonahbenton04:01:42

thank you- glad to have helped, i learned something too

hans07:01:01

Can anyone recommend a maintained for of clj-oauth2 that they use? The original owner did not update it since 2012 and there exists a forest of forks to chose from 😞

hans07:01:22

That library is in a depressing state, I must say. Are there any precedent cases that show how to consolidate such a mess? I mean, I need to make a change, and given that there are also dozens of published versions of clojars (with the more recent ones pointing to nonexistent upstream sources), the only way to make progress for me seems to also fork, make the modifications in my own repository and then, eventually, publish yet another version in clojars, which seems to be not very good.

hans07:01:53

Or, alternatively, can anyone suggest another, better-maintained oauth2 library that works with Google's APIs?

meow08:01:02

@hans: is anything about this problem unique to clj versus cljs because surely the cljs folks are using oauth2 as well so you might want to ask there as well

meow08:01:34

as well as well as well

meow08:01:04

#C03S1L9DN

hans08:01:04

@meow: Ah, thanks! friend may indeed me my best option. I've avoided it because I thought it did too much, but it may be better than fiddling around with clj-oauth2

meow08:01:11

anything is better than a broken 4 year old library

hans08:01:50

It is not that it is broken, it just was missing a feature that I needed.

meow08:01:05

oops, my bad

meow08:01:19

but close enough

hans08:01:41

And as the article you've linked to (thanks) describes, OAuth is not a rigid protocol, but rather a set of guidelines, so once you have something working with the provider you need (Google in my case), there is quite some reluctance to change horses.

hans08:01:57

Unless the other horse has a specific Google saddle, of course simple_smile

hans08:01:32

But anyway, thanks! I'll work with my fork for now and use friend next time I have to deal with this. I wanted to look at it anyway.

hans08:01:11

The discussion how a forest of forks can be reconsolidated would also be interesting, but it is not even clojure specific.

arrdem09:01:20

Is my google-fu just weak tonight or is there no existing Clojure IRC server worth speaking of?

jaen09:01:30

I don't think I've ever seen anything other than https://github.com/danlarkin/subrosa so yeah, probably no.

ag10:01:50

This has been asked many times probably. I still couldn’t find satisfying answer. How can I find what's the latest version of a particular library availible in Clojars, right from the command line? I guess I could use lein search but I can't find right combination of arguments. It keeps giving me crap

ag10:01:49

@hans from my understanding this helps you to update existing dependencies in a project. What if I’m starting a project from scratch and need to know latest available version of a library

hans10:01:55

ag: it is common to list the latest version on the project's github page. in fact, that is so common that I never saw that as a problem. is there a specific library that you're interested in?

arrdem10:01:28

+1 for lein ancient

ag10:01:37

it just doesn’t make sense to me that you actually need to go open a web page - either it’s github or http://clojars.org to figure out latest available version of a lib. I thought that’s what lein search for. I tried for example lein search “id:lein-cljsbuild version:SNAPSHOT” but the latest version didn’t come up

ag11:01:03

@arrdem: ancient helps you to update dependencies that you already added. But what about figuring out latest available version before adding a dependency?

arrdem11:01:59

@ag: I don't know of a good tool for doing that. Even the clj-refactor tooling for adding project deps only shows you versions in your ~/.m2

ag11:01:14

It may look like I’m complaining, I’m not. I’m just very new to Clojure and already see how amazing it is. Not just the language, but the entire ecosystem and the community and practices. It feels strange to me that I could’t find the equivalent of npm install or cabal install or pip install or gem install, but for clojars

meow11:01:51

@ag: I can see where you are coming from and sort of felt that same way but it just isn't an issue

meow11:01:06

find the github project or clojars page

meow11:01:20

super simple

meow11:01:51

not sure if boot has any kind of search like that

arrdem11:01:53

Eh... that I'm not sold on.

arrdem11:01:08

if you just want to add the latest one.

arrdem11:01:19

Due to performance limitations of Clojure startup time and transitively leiningen, lein is pretty minimal as language build tools go 😐

ag11:01:30

> Due to performance limitations of Clojure startup time and transitively leiningen, lein is pretty minimal as language build tools go yeah, now it makes sense to me, it’s just quicker to open clojars page

arrdem11:01:03

Right. You can start a JVM in milliseconds, but Clojure's self-bootstrap takes ~2.6s on a good day.

arrdem11:01:42

I had a project a while back.. Oxcart.. which tried to fully AOT Clojure so it didn't need to do that and well it's dead for reasons.

ag11:01:46

but dependencies are based on Maven structure, aren’t there generic java command line tools for what I want that would be a lot faster?

arrdem11:01:35

There may be mvn plugins to do this, but it looks like stock Maven does not have a user visible search feature either.

ag11:01:16

oh! I got an idea. maybe http://clojars.org have a public api and I could use curl or whachacallit to find things, no? simple_smile

ag11:01:11

@solicode: yay, nice! thanks

ag12:01:33

if anyone needs it

clj-search () {
    curl -s -H "Accept: application/x-yaml"  | grep latest_version;
}

bronsa12:01:48

@arrdem: 2.6s is nowhere realistic, java -jar clojure.jar takes 0.5/0.6 to start on my laptop

bronsa12:01:03

it's lein repl that takes ages, but that has nothing to do with clojure

hemmvm13:01:29

Hi there! I need some help understanding the exact flavor of laziness you get with sequence + transducers. Here's a little gist: https://gist.github.com/hemmvm/7be4c201735c29191b93#file-transducer_laziness_1-clj-L36 In particular, I'm wondering about partition-by running 331 times. Any help is greatly appreciated!

solicode13:01:46

@hemmvm: I don’t know how it works internally, but I’m guessing this has something to do with chunking.

solicode13:01:06

instead of doing things 1 at time, things being done by 32

hemmvm13:01:50

@solicode: Sure -- that's why identity* getting called 33x seems ok-ish to me. But 331x for magnitude ?

hemmvm13:01:30

@solicode: I would have expected magnitude to be called 33x -- i.e. for each of the 32 items of (range)'s first chunk

solicode13:01:00

Hmm, I’m not sure to be honest. I’d have to look at the source

hemmvm14:01:07

@solicode: I think I understand it... (I'll be right back in 5mins)

solicode14:01:43

ok simple_smile I’m curious too

hemmvm14:01:31

Transduction is fundamentally push based. So sequence basically works in reverse: lazily consuming inputs from the original source (pull), feeding it to the transducer (push).

hemmvm14:01:43

In the case of (first (sequence (partition-by* magnitude) (range))) you basically ask for 33 partitions (due to chunking!!), thus calling magnitude 33 * 10 times.

hemmvm14:01:55

Another catch is that some transducers may not produce any output for a given input (push) -- think filter. So sequence has to consume inputs from the original source (pull) until the transducer actually produces at least one output, i.e. possibly being somewhat less lazy than you might expect.

hemmvm14:01:14

More generally speaking, you'll pretty much get that partition-by kind of behaviour for any kind of "reductive transducer"

shanekilkelly15:01:14

Anyone know why promotion is disabled on http://clojars.org? All of my projects are showing a “promotion is currently disabled” message.

meow16:01:27

@hemmvm: don't understand how you see transduction as push?

hemmvm16:01:12

Basically, the transduction / any single transduction step will not run unless explicitly called. i.e. the transducing context is responsible for actively driving the process ("pushing into the transduction")

meow16:01:52

are you sure

hemmvm16:01:02

> The other thing that's tricky about this is it sort of changes the notion of what it means to be lazy. And I don't really want to change that. I just want you to think about another notion of lazy. Transducers are fundamentally push. You supply input and then the logic runs. They're not fundamentally pull like lazy sequences are. https://github.com/matthiasn/talk-transcripts/blob/master/Hickey_Rich/InsideTransducers.md

meow16:01:37

just thinking out loud I think this part is important:

You know, we like our words in Clojure, so reduce means to lead back. I'm not going to talk much about the ingestion part in the rest of this talk, but transduce means to lead across, and that's definitely what transducers do. They're leading the input across the series of transformations on the way to, well, maybe reduction or maybe something else, some other process. But they lead them across a transformation process, so the name makes sense.

meow16:01:04

Sequence will take a collection and produce a lazy view of that collection, having pulled it through a transducer.

hemmvm16:01:49

I have to catch the train -- I'll be back in about 4-5 hours

meow16:01:36

ok, I'll flesh this out

meow16:01:42

Okay, so what does transduce do? It calls reduce.

meow16:01:04

I think I see

meow16:01:56

rich is saying that transducers are fundamentally push. transducers not transduction

meow16:01:16

Sequence, the function, implements pull by going around the other end and saying, well, you wanted something, so I'm going to take another input and feed it to the step function. Now we just said one tricky bit is you may ask for something and I put it through the step function, and the step function gives me nothing, in which case I've got to keep doing this until I have one thing to return to.

meow16:01:15

But what else could this have done?

[Audience response]

It could have returned one thing each time I ask. It could return nothing. It also could return what?

[Audience response]

More than one thing. Where is that going to go? I asked for one thing. You called the step function. It gave you, like, six things. What's going to happen?

[Audience response]

Yeah, I'm just going to attach them to the linked list, which means that it's not quite this laziness we're used to.

meow16:01:22

We're used to saying, "Don't run any little part of the calculation until I ask for one thing, and then just do exactly that much work," which ends up being a huge amount of overhead. Now we're saying you're going to ask for one thing. What's actually lazy is not your consumption, but the production. In other words, we're lazily going to add only as much to this to produce an output to give you, but each step might produce more than one thing, so it's kind of pushy.

meow16:01:29

make sense now?

meow16:01:30

I wanna get with you, only you, and your sister, I think her name's Debra!!!!

meow16:01:42

sorry, beck, good stuff

meow16:01:52

It's lazy in the input consumption, which means if you have something that expands through an infinite sequence, it's not going to work. If you have something that, in a single step, expands to something that consumes all of your memory, that's also not going to work. In particular, it's not going to work because, even if your result produces something lazy, it's going to be eagerly consumed. Nothing inside any of the transducers uses laziness at all because we want to be able to have these other semantics.

meow16:01:17

That's something to be aware of. A lot of people initially trip up over, you know, trying to use something lazy in a step and are surprised that it got fully realized. But that's the nature of this.

tcrawley16:01:37

@ag: this isn't exactly what you were asking about, but you can always get the latest release (non-SNAPSHOT) or latest version (could be SNAPSHOT) with [foo/bar "RELEASE"] or [foo/bar "LATEST"], respectively. You can then see what version the tool actually downloads, and pin to that.

meow16:01:37

I still think this is a useful granularity for laziness. I don't think people are consuming all their memory in a single step. Otherwise, this gives you the best of both worlds because you get very high performance and only as much caching as you need per step, and it still is sort of windowed, so I think it would work for most things, but it's something to be aware of.

meow16:01:25

that should about do it

arrdem17:01:19

@bronsa: huh that's what I was measuring during Oxcart weirdness. Delighted to hear it's gone down.

bronsa17:01:47

I don't think it's ever been any different

arrdem17:01:31

1.47s via

time java -jar ~/.m2/repository/org/clojure/clojure/1.6.0/clojure-1.6.0.jar << EOF    
EOF

bronsa17:01:42

might have improved by a couple of deciseconds maybe, definitely not more than 2 seconds

bronsa17:01:53

@arrdem: well, that runs in 0.9s on my machine. I get it down to 0.55 by using -server -Xverify:none -XX:+AggressiveOpts -XX:+TieredCompilation

arrdem17:01:36

$ time java -server -Xverify:none -XX:+AggressiveOpts -XX:+TieredCompilation -jar ~/.m2/repository/org/clojure/clojure/1.6.0/clojure-1.6.0.jar 2&>1 > /dev/null <<<''
1.22s user 0.05s system 212% cpu 0.599 total

gfredericks18:01:48

most of that time is spent downloading more RAM

datajohnny20:01:35

Hi im running lein migratus create and getting this error: https://gist.github.com/datajohnny/923dfe46dbde698002dc. Does anyone have any insights?

Tim20:01:09

isn't it lein migratus migrate?

datajohnny20:01:54

@tmtwd: I want to to create the file

datajohnny20:01:15

I was under the impression that create would generate the file for me

Tim20:01:25

not sure tdh

jonahbenton20:01:02

@datajohnny: looks like the create fn is only in the lib, not in the plugin. so you would need to be in a repl to do migratus/create

esnunes20:01:15

@meow: I was thinking about Boot vs Lein, maybe the main difference is declarative vs functional.

esnunes20:01:35

comparing to nodejs world, webpack vs gulp

datajohnny20:01:20

@jonahbenton: I was able to figure it out, the issue was a bug on the version of the lib that I was on,

esnunes23:01:43

in case you would start a project today, would you use stuartsierra component or danielsz system (https://github.com/danielsz/system) library?

donmullen23:01:59

Although system has LOTS of great stuff.

jonahbenton23:01:03

yeah, the question is more between component and mount. system is component, with some pre-fab components.

esnunes23:01:44

thanks guys