#clojure log - Aug 13 2013

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:00 callen: brehaut: definitely sold me on trying out Instaparse.

0:00 noprompt: Phil_D: what lib are you using to talk to Mongo?

0:00 brehaut: callen: i had success with instaparse on a little project recently; its certainly nice

0:01 callen: Phil_D: no but seriously, are you using Clang to integrate CLJS with Angular? Because if you aren't, I'm surprised your code is working.

0:01 brehaut: pros/cons, error messages?

0:02 brehaut: callen: error messages seem reasonable? i didnt dig into them much though; you get a 'failure' that tells you where and what it expected

0:02 noprompt: callen: i had some trouble with clang. i kept getting weird error messages about add-watch or something.

0:02 callen: brehaut: cool :)\

0:02 brehaut: callen: i need to try out its combinator notation

0:02 callen: noprompt: good to know.

0:02 `cbp: maybe we could get some line info on the errors if we use that? it seems hard to add to selmer atm with the precompilation stuff. Also the errors could tell us which template it happened on :p

0:02 brehaut: before i can fairly judge it

0:02 noprompt: callen: maybe tomorrow i'll hit you up about it if you are around.

0:03 callen: noprompt: I will mostly be looking for a repro/github issue.

0:03 fair warning

0:03 noprompt: callen: i will mostly be sending you a gist.

0:03 callen: fine

0:04 noprompt: callen: the customer is always right.

0:04 Phil_D: noprompt: I'm using Monger.

0:04 callen: I'm using purnam. It's killer: https://github.com/zcaudate/purnam

0:04 callen: Phil_D: nifty, thanks.

0:05 Phil_D: callen: It integrates seamlessly with Jasmine testing as well. I'm so happy it's around. :D

0:05 callen: the jasmine testing bit is important.

0:05 noprompt: Phil_D: interesting. i use monger/cheshire in app at work and haven't run in to that problem. did you require monger.json, etc.?

0:06 Phil_D: noprompt: I was about to update everyone, actually. I was using cheshire.core and cheshire.generate instead of monger.json. My problem's solved now. :P

0:06 noprompt: Phil_D: good deal then. :)

0:07 dnolen: Phil_D: ;)

0:09 Phil_D: Gotta run, everyone. Thanks for the help! I'll be around often. Clojure's been the most challenging programming language I've encountered, but the raw power (and I say power as in the way Darth Vader says it while clenching his fist) of it doesn't cease to blow my mind. I want to make it my goto language because it's totally expanded my way of thinking about programming.

0:11 * noprompt somehow feels as if he is being trolled

0:11 * noprompt is now almost certain he is being trolled

0:12 noprompt: getting close to a 1.0.0 for garden. gonna break some stuff and smash some things.

0:12 callen: noprompt: if you were being trolled, I'd be showing you my menagerie of macros.

0:13 noprompt: callen: ever heard of autoit?

0:13 callen: don't google it, just say yes or no.

0:14 callen: it sounds familiar, don't recall precisely.

0:14 Why?

0:14 clojurebot: http://clojure.org/rationale

0:14 callen: ...thank you bot.

0:14 Apage43: callen: right now I'm just surfacing the standard instaparse error to the UI.

0:15 dnolen: core.async folks, what do you all think about take-until and siphon? http://gist.github.com/swannodette/6217767, seems like it could eliminate the redundancy from bhauman's post earlier today

0:15 noprompt: callen: i guess some kid in a forum brought up this gist https://gist.github.com/noprompt/6106573 and apparently people were trying to use it from autoit.

0:15 callen: Apage43: well, my point is that if the instaparse message is human friendly enough and comes with enough metadata, I could re-render that into a nice error page for my users.

0:15 Apage43: callen: https://www.youtube.com/watch?v=KIaoQhfpMPg video

0:15 noprompt: callen: of course, it failed because they're trying to use a regular expression that's 1.5M.

0:16 Apage43: callen: it has quite a bit of metadata, so I could easily use it to build my own error message that was a bit friendlier

0:16 callen: noprompt: that is absurd.

0:16 Apage43: (or, end goal, highlight their error)

0:16 callen: Apage43: oh yeah, that works for me.

0:16 now I'm *REALLY* excited.

0:16 noprompt: callen: yes. one even said it was hoax.

0:17 ah, "The Great Regular Expression Hoax of 2013", it'll go down in history.

0:19 callen: so i move in to my new house this month. you and Raynes should come visit me. we were supposed to have that bacon tournament of destiny or whatever.

0:19 callen: I mean, it's just breaking the words into parts and OR'ing into an existential qualifier for a population right?

0:19 and conflating redundant cases

0:20 noprompt: callen: pretty much. just a trie and a few functions for converting it in to a regex.

0:20 Raynes: noprompt: I need to spend all my money on gas getting to Santa Barbara this month. Perhaps in a month or two I can hop up to Fresno.

0:20 Or, near Fresno.

0:20 Wherever the hell you live.

0:20 :p

0:20 noprompt: callen: i still have a few more kinds to work out.

0:21 callen: I like that you turned the trie into something much slower.

0:21 the mark of a pro.

0:21 noprompt: callen: but the regexes are good. they minimize backtracking and have efficient state tables under the hood.

0:22 callen: you still turned a trie into a regex.

0:22 noprompt: callen: well i had a good reason too.

0:22 callen: click the link under the "Why?" section.

0:23 Raynes: yes, fresno. lol.

0:23 callen: noprompt: I liked ztellman's response to you on twitter.

0:23 noprompt: callen: he responded to me on twitter?

0:24 callen: maybe not directly, h/o

0:24 he responded to the regex

0:24 noprompt: link?

0:24 clojurebot: unlink: and constantly is just a function that takes any arguments and returns whatever argument is given

0:24 callen: noprompt: https://twitter.com/ztellman/status/366721010982060032

0:25 noprompt: haha!

0:26 callen: noprompt: oh christ @ vimclojure

0:27 noprompt: i need to follow these people.

0:27 shit. i guess i need to open twitter more than once a week too.

0:27 callen: noprompt: Twitter for Clojurians is pretty great.

0:27 Apage43: buh

0:27 the next part may or may not be fun

0:28 noprompt: callen: yeah. i'm pretty proud of the work guns and i did on vims regex highlighting.

0:28 Apage43: which is resurrecting a Clojure <-> Erlang JInterface binding I wrote years ago

0:28 noprompt: callen: i challenge you to find another syntax file for vim with a more thorough and accuate treatment of regular expressions.

0:29 you hear that? i *challenge* you.

0:30 actually, it'd b awesome if that could some how get hooked up to clojure-mode.el.

0:30 good regex highlighting turns out to be pretty frak useful. *buh-dum-tsh*

0:30 callen: noprompt: o_O

0:30 you clearly have not seen my todo.txt backlog.

0:31 sorry, todo.org

0:31 because I am a civilized human being

0:33 noprompt: callen: is that in your dotfiles?

0:33 callen: no, but I guess it should be. not like it's private.

0:34 noprompt: todo lists... god i hate them.

0:35 callen: noprompt: I like having a list of nifty ideas to implement.

0:35 some being more OSS focused, some more side projecty..

0:35 s/\.\./\./g

0:36 noprompt: callen: i find the ideas i'm most interested in tend to stick in my mind and bug me until i do something about them. my todo lists always end up in the trash.

0:37 callen: noprompt: that's sorta true for the larger ones, but I have to evaluate and optimize how I spend my time on an ongoing baiss.

0:37 noprompt: i'm a terrible person.

0:37 callen: basis*

0:37 omnisis: can someone help me transform a non tail recursive clojure function into a version that doesn't eat up the stack? Unfortunately, it's not a straightforward loop/recur issue?

0:37 callen: I have a lot of small and medium sized ideas that will help support larger ones later.

0:37 noprompt: callen: oh, well there i agree with you. yeah, i tend to write stuff down when i've solidified what i want to do. it's much easier to manage at that point.

0:38 callen: I have maybe 2 or 3 long term goals that I'm not really well positioned to work on yet

0:38 but a lot of still very important and useful intermediate work that will support the later effort

0:38 so I like to shuffle my todo list around in response to new data and what seems to have worked and not worked.

0:39 noprompt: omnisis: do you have gist?

0:39 omnisis: I have a pastebin here: http://pastebin.com/WM9gknX9

0:40 the fn is calc-max-value

0:41 noprompt: omnisis: one tip is use dec instead of (- i 1)

0:41 ,(doc dec)

0:41 clojurebot: "([x]); Returns a number one less than num. Does not auto-promote longs, will throw on overflow. See also: dec'"

0:41 omnisis: ahh nice...that'll def make it easier to read

0:42 the main issue is that recursive calls are made early and used in following if exprs

0:45 amalloy: omnisis: this algorithm uses 2^n time and space, doesn't it? you can move that space from stack to heap, but it's not going to get fundamentally better

0:46 omnisis: so i tried to memoize it outside the fn, i think a better approach is to store the memo table in an accumulating paramter...it's a dynamic programming algorithm, it's suppossed to use space on the order of i*w

0:48 this was a quick hack at trying to translate an iterative solution into something vaguely functional..i am very new to clojure so it's prolly not very idiomatic

0:48 amalloy: omnisis: i think you'll find things easier if you don't try to do it tail-recursively but instead lazily

0:49 produce a lazy sequence of candidate solutions, and walk over them to find the best one

0:55 TEttinger: omnisis: is the goal of this code explained somewhere? I'm not sure what knapsack is, and I guess it is a vector of hashmaps?

0:56 omnisis: page 3 of this PDF has the orginal code: http://cse.unl.edu/~goddard/Courses/CSCE310J/Lectures/Lecture8-DynamicProgramming.pdf

0:57 it essentially tries to build up a 2d array and then uses that array to find a solution to the problem

0:57 the code is basically a nested for loop that builds up a 2d structure

0:59 i guess i could bust out a javaish 2d-array soln in clojure but i was trying to do it more functionally

1:00 noprompt: omnisis: do what makes your program work.

1:11 TEttinger: omnisis, the 2d array of all combinations of 2 items (including duplicates) could be done with ##(let [items [1 2 3 4 5 6 7]] (for [x items, y items] (str x ", " y " ")))

1:11 lazybot: ⇒ ("1, 1 " "1, 2 " "1, 3 " "1, 4 " "1, 5 " "1, 6 " "1, 7 " "2, 1 " "2, 2 " "2, 3 " "2, 4 " "2, 5 " "2, 6 " "2, 7 " "3, 1 " "3, 2 " "3, 3 " "3, 4 " "3, 5 " "3, 6 " "3, 7 " "4, 1 " "4, 2 " "4, 3 " "4, 4 " "4, 5 " "4, 6 " "4, 7 " "5, 1 " "5, 2... https://www.refheap.com/17553

1:11 TEttinger: that also shows you the order it would work in

1:12 err

1:13 not a 2d array, but you could make a similar structure with that. it does combine all rows and columns

1:14 omnisis: since the algo is basically just a nested for loop i think i can just use the for comprehension with the proper bounds

1:14 gonna try this

1:14 TEttinger: omnisis, be advised, that could be the brute force solution? it might be the really slow version I suggested D:

1:16 omnisis: the solution is basically O(i*w) which are the two parameters to the function....without memoizing the values its O(2^n)... in my case i and w will be small (hundreds at most) so it's okay

1:50 TEttinger: omnisis, I see a possible problem with the for comprehension approach -- I don't think it can look back

1:51 omnisis: i am using aset/aget with the for

1:51 TEttinger: I think the lazy seq solution may be better and more FP

1:51 agh

1:51 omnisis: yeah i know

1:51 ;-)

1:51 TEttinger: for doesn't generate an array though

1:51 it generates a seq

1:52 omnisis: you can do (make-array Integer/Type x y) in a let over the for

1:52 TEttinger: yeah, but... I guess that will let you read what you already wrote, since arrays are mutable...

1:52 omnisis: code looks very imperative but it's tricky anyhow and I can't wrap my head around a completly fp solution with memoization right now

1:53 TEttinger: amalloy, which function does the lazy walking? I don't think I've used it

1:56 omnisis: yes arrays are very much mutable...i will say that the :let expression inside the for form is kinda nice...saves you from a nested let in the for

1:57 TEttinger: and you can use :when (>= W whatever weight is calculated)

1:57 then if you know weight is higher than W you don't calculate the rest

2:00 omnisis: i saw that but the array mutation version has to do an aset no matter what ...

3:11 nonuby: struggling with good approach to allow nrepl based inspection without putting everything into globally accessible atoms

3:49 a better more/idiomatic way when dealing with a code that matches a pattern like this https://www.refheap.com/17556?

4:41 TEttinger: nonuby, that's at least clear. anything with more functions would only obfuscate the odd bits, like the call to some-fn with one arg and another with 2

5:08 mpenet: anyone is having issues with eldoc arglist view in the minibuffer (it disapeared for me) using the latest nrepl?

5:38 turbopape: is it possible to use a record as a function of its fields (and the other way around) or no ? I think this was not possible in older versions,... Am I right ?

5:40 Anderkent: turbopape: I think the only way to access records fields is with host access: (.field record-instance)

5:40 actually

5:41 turbopape: (:field-name record-instance) works too

5:43 turbopape: Anderkent, Thank you. In deed, this was not possible in older versions.

5:44 I mean for (:field record)

6:18 clgv: turbopape: this was possible since at least 1.2

7:12 shafire: hi

7:24 magmag: hola, what is the 'goto' clojure css generator (im looking for something similar to sass)

7:26 ordnungswidrig: magmag: what's wrong with sass?

7:26 magmag: nothing, i just like clojure

7:27 supersym: magmag: garden is pretty nice

7:27 https://github.com/noprompt/garden

7:27 magmag: thank-you, I'll take a look

7:29 ordnungswidrig: ah, garden looks nice

7:29 magmag: it does

7:29 supersym: I agree on the 'clojure for css part', I guess... wrote nice functions in stylus, doing sweet tricks, then realized I could do even more if I wasn't constrained by stylus JS :P

7:29 ordnungswidrig: ah

7:30 magmag: i like stylus too

7:30 i just want something in clojure

7:30 garden looks good

7:30 supersym: plus the fact that it had some serious bugs and obfuscated a whole bunch of stuff

7:30 ordnungswidrig: that looks like fun: (+ 20 (c/hsl 0 0 0) 1 (c/rgb 255 0 0))

7:30 => #ff1515

7:30 supersym: :)

7:30 ordnungswidrig: parametric stylesheets!

7:30 magmag: :)

7:31 supersym: noprompt also rewrote semantic.gs to garden for me :P

7:31 https://gist.github.com/noprompt/5873715

7:31 magmag: oooh

7:31 i like that

7:31 supersym: clj grid ;)

7:31 yeah its sweet

7:32 ordnungswidrig: uuh

7:32 crazy shit

7:32 magmag: haha

7:33 supersym: hehe, enjoy playtime

7:34 antares__: European Clojure folks: there will be an 2 day Clojure workshop in Munich in October, just 35 EUR/person. Please spread the word: https://twitter.com/ClojureWerkz/status/367239501388992512

7:38 ordnungswidrig: /whois antares__

7:38 clgv: antares__: the payment information is missing on the website clojureworkshop.de

7:39 antares_: ah it shows up under "register" ..

7:39 antares__: clgv: I asked someone who maintains the site to make it more visible

7:40 shafire: do you program clojure with sublime?

7:41 antares__: ordnungswidrig: I am @michaelklishin everywhere :)

7:41 shafire: antares__: hotel costs?

7:42 ordnungswidrig: antares__: ah, my irc-xmpp gateway plays tricks on me

7:42 antares__: shafire: I don't think the organizers have any offerings for accommodation, so it's up to you

7:42 mid-October is not really a high season in Munich, though

7:43 I believe Oktoberfest is in late September, ending in early October

7:43 shafire: Motel One maybe :)

7:43 I read on the page that they use sublime, do you have any howto how they do that?

7:44 clgv: antares__: I spread the news in our working group ;)

7:45 shafire: If anyone have a clojure job for me, I am happy to do it. anywhere in the world expect USA

7:45 except*

7:48 openbotnet: Doing (clojure.pprint/pprint (ns-map *ns*)) crashes emacs when run inside emacs nrepl session (created using M-x nrepl). It's not a problem in command line nrepl.

7:49 antares__: clgv: thank you!

7:51 drguildo: could somebody please explain why (re-find #"\\d+" "abc123def") is not returning any matches?

7:52 ordnungswidrig: ,(re-find #"\d+" "abc123def")

7:52 clojurebot: "123"

7:54 drguildo: something very strange is going on

7:54 or i'm being very dumb

7:54 http://puu.sh/40WWS.png

7:55 squidz_: what is the best strategy to build a string url out of parts using clojure. I am using clojurescript so using libraries like ring probably aren't applicable

7:55 drguildo: i guess i pasted using an encoding it doesn't like?

7:58 squidz_: I though of using a cond/condp to test whether certain 'parts' of the url should be appended but there is some state needed to keep the previously added parts in the URL

8:00 katratxo: squidz_: https://github.com/cemerick/url ?

8:02 squidz_: katratxo: hm this is kind of a one time deal, so i'm not sure I need an additional library. I was looking more for a strategy on how to build it myself

8:04 Anderkent: squidz_: if you don't need validation or anything.. just (URL. (apply str parts)) :P Otherwise pull in the library - it's trivial with lein

8:05 squidz_: Anderkent: yeah I just thought of the (apply str ....). Thanks

8:25 Anderkent: What's the easiest way to run a clojure 'script' - i.e. one main file with no dependencies except the core, prefferably without needing any scaffolding around it (no lein project etc)

8:27 tbaldridge: Anderkent: use lein uberjar, and then java -jar jarfile.jar

8:28 Anderkent: that means I need a project

8:28 lein-exec seems like what I want

8:35 zilti: Does someone in here use the most recent (as in marmalade-repo) versions of nrepl.el and auto-indent-mode? On my PC they refuse to work together

8:42 Anderkent: Anyone know a nice way of constructing multiline strings? If join was vararged, I could just do (join "\n" \n "First string line." \n "Second string line."), but it's not. Wrapping it in a vector looks awkward

8:43 llasram: Anderkent: What about?: ##(str "First line" \n "Second line" \n)

8:43 lazybot: ⇒ "First linenSecond linen"

8:43 llasram: hah

8:44 &(str "First line" \newline "Second line" \newline)

8:44 lazybot: ⇒ "First line\nSecond line\n"

8:44 llasram: Yeah -- kind of verbose

8:45 Anderkent: Actually, what are you trying to do exactly? You can include literal newlines in strings

8:45 Anderkent: As in multiline strings or just \n

8:45 I'm trying to write an usage string in a way that reads easily

8:45 both in code and when printed out

8:46 llasram: And including a literal newline in the string doesn't achieve what you want?

8:47 Anderkent: hah. Didn't know that worked!

8:48 zilti: Does someone in here use the most recent (as in marmalade-repo) versions of nrepl.el and auto-indent-mode? On my PC they refuse to work together

8:49 llasram: zilti: Not using auto-indent-mode, I'm afraid

8:50 ToxicFrog: So when I run 'lein repl' in a readonly directory, I get a two page stack trace about how it can't open/create target/repl-port

8:50 zilti: Oh no :( Are there alternatives? Not using any indentation-mode will drive me nuts...

8:50 llasram: ?

8:50 ToxicFrog: (although it appears to work fine anyways)

8:50 mdrogalis: zilti: I recall auto-indent mode got yanked out of there.

8:50 ToxicFrog: Shouldn't that go in /tmp, not .?

8:50 mdrogalis: zilti: I'm pretty sure I hacked it back in. :P

8:50 llasram: zilti: Is just using newline-and-indent or paredit-newline not enough?

8:51 zilti: Newline-and-indent? Gotta try that.

8:51 llasram: It's a builtin command

8:51 zilti: mdrogalis: Who fixed what where with auto-indent-mode?

8:51 llasram: Usually bound to C-j by default

8:52 Anderkent: llasram: geh, but with literal newlines the indentation gets messier. Guess I just need to def it at top level :P

8:52 mdrogalis: zilti: One moment. Searching for it.

8:52 zilti: https://groups.google.com/forum/#!topic/clojure/YI4IfthcycU

8:52 zilti: llasram: Well, I got quite used to auto-indenting a whole block and stuff

8:52 mdrogalis: I literally put that line back in myself.

8:53 llasram: zilti: Are you using paredit? Just hit Meta-q within a form

8:53 zilti: mdrogalis: My problem is that having (require 'nrepl) somewhere in the code breaks C-y as soon as I open a file that loads auto-indent-mode, even if it is not a clojure file

8:54 llasram: mdrogalis: I believe zilti is talking about an externally packaged minor mode named `auto-indent-mode`

8:54 zilti: yes, llasram

8:55 The point is that I use emacs for other stuff than just clojure, and auto-indent-mode has proven to be very reliable and to do everything the way I want it

8:56 mdrogalis: llasram & zilti: Ah, my bad. Sorry.

8:57 llasram: zilti: That's fair. I wasn't sure how experienced you were with Emacs -- I thought perhaps you were using auto-indent-mode because you didn't know about the whole C-m vs C-j (newline vs newline-and-indent) thing

8:58 zilti: llasram: Actually not that experienced, I know where to look stuff up when I need to know something, and I know some elisp, that's it :) I indeed didn't know about C-m / C-j.

8:58 Well, I guess I'll be looking at some elisp source code this afternoon.

8:59 llasram: Best of luck to you

9:01 zilti: llasram: Thanks, I'll need it

9:02 ToxicFrog: OH what the hell is this, I've got like a dozen empty target/classes directories lying around the system from my habit of running 'lein repl' when I want a clojure REPL

9:03 Anderkent: ToxicFrog: I know your pain :(

9:04 clgv: Anderkent: ToxicFrog: file an issue?

9:05 Anderkent: I think the right solution is to get it to run via nailgun somehow :P

9:05 hyPiRion: oh, the target directory is back? Dang.

9:05 Anderkent: clgv: too shy! :P

9:05 (also usually I notice it, groan, then forget about it immediately)

9:05 hyPiRion: Right. That little bugger managed to get back in.

9:05 ToxicFrog: Hmm. Looks like it gets it from (defaults :target-path) in leiningen/core/project.clj

9:06 Which is "target/%s"

9:06 So if you run it without a project.clj, it cheerfully vomits stuff all over .

9:06 hyPiRion: it was out at some point?

9:07 hyPiRion: ToxicFrog: it happened before, then it was fixed. I can reproduce, so it's obviously back now

9:07 Anderkent: bisect to the rescue!

9:07 hyPiRion: I think I already know how to fix it.

9:08 Anderkent: oh well. Move on, bisect, nothing to see here.

9:08 ToxicFrog: Awesome

9:08 hyPiRion: leiningen.core.main generates an empty project, if one can make an empty/nil :target-path, it should be resolved

9:09 otherwise it takes the default "target/%s" one

9:09 anyhow I'll put up an issue, so I don't forget it

9:10 ToxicFrog: Thanks.

9:11 hyPiRion: ToxicFrog: wait, you're on 2.3.1?

9:11 check if it's fixed there. It seems like it is.

9:12 ToxicFrog: 2.1.2, which is what "lein upgrade" gave me yesterday.

9:12 mdrogalis: Is it possible to solve things like Puzzle #1 with logic programming? http://www.brainbashers.com/showpuzzles.asp?formpost=Y&field=ctop10a&page=1&puzzletext=A

9:12 * ToxicFrog makes the mistake of typing "lein version" in a git clone of the leiningen repositority, gets all of the dependencies

9:13 mdrogalis: It seems like the uniqueness constraint is problematic, maybe.

9:13 hyPiRion: Yeah, we fixed some a critical bug in 2.3.0 yesterday, so `lein upgrade 2.3.1` should give you the latest

9:13 ("we" meaning technomancy and not me)

9:14 ToxicFrog: Success! Tahnks.

9:14 hyPiRion: great!

9:14 ordnungswidrig: hypirion: just make sure the access rights to the download location are correct :)

9:15 hyPiRion: ordnungswidrig: haha, we're doing "pairing" to ensure that doesn't happen again

9:16 Amazing how much trouble you can produce with some wrongly configured ACL.

9:20 xeqi: yep, beware as I now know how to make a lein release

9:20 hyPiRion: That's good though. Imagine if Phil was hit by a bus and noone could release an official Leiningen version again, ever.

9:21 Anderkent: ./script/release ? :P

9:21 one can dream ^^

9:21 xeqi: Anderkent: mostly right

9:21 +/- performance testing, and correct credentials

9:22 oh, and news updates

9:24 zilti: I "fixed" auto-indent-mode. I just commented out the code that modifies yank and yank-pop.

9:24 hyPiRion: But you didn't learn the hardest part: how to get back to snapshot.

9:25 ToxicFrog: What is the naming convention for clojure applications? ca.ancilla.appname, or just appname?

9:25 Anderkent: appname usually

9:25 xeqi: ToxicFrog: there are people in both camps

9:25 ToxicFrog: I know libraries are meant to be fully qualified, not sure about apps.

9:26 Anderkent: ToxicFrog: if you feel like you need to fully qualify, you can use the groupname. But it's common practice to just have the groupname and artifact names be 'appname'

9:26 ToxicFrog: Alright.

9:27 Anderkent: most clojure libs use that convention, which is why you can just say [clj-time "version"] instead of [clj-time/clj-time "version"] in lein project config

9:27 * ToxicFrog is rewriting one of his old and exceptionally messy lua projects in clojure, and will probably actually release this one

9:27 Anderkent: good lucl :)

9:27 *luck

9:29 ToxicFrog: Anderkent: just having an http library that supports multipart/form-encoded POST will make it a lot cleaner~

9:32 Anderkent: uhoh. Welcome to logging hell :P

9:39 ambrosebs: core.typed now accepts var annotations in `def` metadata. This may please some of you https://groups.google.com/forum/?fromgroups#!topic/clojure-core-typed/qM4Fc1Quqd0

9:40 mpenet: very nice

9:42 ambrosebs: If there is anywhere else you'd like to squeeze annotations into metadata, I'm all ears.

10:04 Ember-: hmm, I have a strange problem.

10:04 trying out clojurescript for the very first time and for some strange reason my dependencies don't end up as part of the generated javascript file

10:05 leiningen finds the dependency, downloads it no problemo and the clojurescript build succeeds

10:05 but when it is ran I get an error from google closure require

10:06 and just checked the (gigantic) javascript and there's no such library

10:10 cmdrdats: hey guys, is there a way to destructure metadata out? something like: (let [^{foo :foo} {bar :bar} ^{:foo 1} {:bar 2}] (str foo ":" bar))

10:10 dnolen: Ember-: what library are you trying to use?

10:11 Ember-: dnolen: domina

10:11 I did everything the way I'd do it with Clojure

10:12 so, am I missing some critical stage or what?

10:12 dnolen: Ember-: paste your namespace form.

10:13 hyPiRion: cmdrdats: Closest I can imagine is ##(let [input ^{:foo :bar} {:a 1}] (let [{a :a} input, {foo :foo} (meta input)] (str foo \: a)))

10:13 lazybot: ⇒ ":1"

10:13 hyPiRion: hrmph.

10:13 well, you get the idea

10:13 Ember-: dnolen: https://www.refheap.com/3f82cd9888aba9845384a1d4b

10:14 zilti: Ember-: :use-macros, not :use, sel is a macro

10:14 cmdrdats: hypirion: thanks - I thought I'd have to (meta)

10:14 Ember-: and oops, todoapp.cljs, not .clj

10:14 zilti: oh, that explains it

10:15 asaleh: hi, I seem to have problem \w traversing xml-zip with clojure.zip/next

10:15 jtoy: hi

10:15 zilti: Btw, you probably want to use dommy instead of domina? Last time I looked it seemed that dommy is the successor.

10:16 dnolen: zilti: they are unrelated similar libs as far as I know

10:17 Ember-: no, it's not a macro but it's domina.css namespace

10:17 it seems

10:17 zilti: Ember-: Hmm ok. I guess I mixed it up with dommy's sel then

10:18 Oh wow. My post about clojurescript testing got 2.3k views... Impressive.

10:18 Ember-: and stuff started to work

10:18 nice, thanks

10:19 I'm suprised the build didn't complain though

10:20 zilti: Ember- not even a warning?

10:20 asaleh: I try to use clojure.zip/next to traverse my xml tree (of a parsed html page), but instead of sequence of visited nodes {:tag :span, :attrs {:id "experimental_indicator"}, :content ["\nexperimental\n"]} -> :span -> {:id "experimental_indicator"} -> ["\nexperimental\n"] ... I only get ... {:tag :span, :attrs {:id "experimental_indicator"}, :content ["\nexperimental\n"]} -> "\nexperimental\n" ... any hints how to fix this?

10:20 clgv: zilti: link?

10:20 Ember-: zilti: nothing

10:20 "Successfully compiled" and so forth

10:20 zilti: clgv: https://coderwall.com/p/-sawaa

10:21 Ember- That's kinda weird. I usually get a warning that I'm using an undeclared function/var when I'm missing an import

10:21 I guess since it was part of the ns form that was enough for it not to notice

10:22 Ember-: yeah, I guess so

10:22 so I just happened to stumble in a rare landmine with my first ever clojurescript import

10:22 tbaldridge: zilti: Ember-: the cljs compiler only looks at a single ns

10:22 Ember-: :)

10:22 tbaldridge: so if you say (:require [foo.bar :refer [baz]]) it won't complain when you use baz

10:23 Ember-: even if baz doesn't exist in the first place in foo.bar?

10:23 tbaldridge: the compiler basically says "errmmmm....okay, you said baz comes from foo.bar so if it's not there, that's your bad.

10:23 zilti: yes, that's what I meant. If it's in the ns form, it doesn't complain, even if it refers into nothingness

10:23 tbaldridge: yep

10:23 Ember-: that sucks

10:23 tbaldridge: the CLJS compiler operates on single files

10:23 now you should have seen an error in your JS console

10:23 in the browser

10:23 Ember-: I did see it

10:23 zilti: Only happened once to me, though. Took me half an hour to figure out

10:24 Ember-: oh well, life goes on and so forth

10:24 good to know that one though

10:24 tbaldridge: One of the good things about doing it that way though, is that stuff like lein cljsbuild auto is super fast. Some of my stuff compiles in < 1sec

10:24 after the compiler's jit is warmed up

10:25 zilti: It's impressive how fast it is even for the initial build, considering how many thousand lines of js code it has to write

10:26 Ember-: tbaldridge: yeah, I kinda guessed already why it is the way it is

10:30 dnolen: TimMc: tbaldridge: that's a bug and I made a ticket for it a while back

10:30 Ember-: oops that was for you ^

10:31 we actually analyze all required libs first otherwise we can optimize calls - easy to confirm that :refers exists

10:31 "otherwise we cannot optimize calls"

10:31 tbaldridge: eh, cool, learn something new every day

10:32 dnolen: tbaldridge: yeah I added dependency analysis back when I optimized function invokes

10:35 jasonbray: I'm writing a function that instantiates a protocol buffer from a clojure map, with the possibility of nested maps should there be nested messages in the protocol buffer. I need to use reflection to instantiate the nested message builders, as I don't know what the classes will be at runtime. I can inspect the protocol buffer type to find the name of the message, but all it gives me is the inner classname of the message.

10:35 It appears that you need to use outer$inner semantics with clojure.lang.Reflector/invokeStaticMethod - any thoughts on how I can pull this off? A user of the function will import the required classes, but afaik there is no way to make an inner classname "first class" in import.

10:47 llasram: jasonbray: Why do you need to make it "first class"? The actual JVM class name of the inner class is `outer$inner`

10:48 jasonbray: it's almost like I need an :as on import.. it seems so hokey regardless

10:48 zilti: What is the core.logic equivalent of minikanren's _ lvar?

10:48 llasram: jasonbray: You can always `def` vars which hold Class objects

10:51 jasonbray: llasram thanks, perhaps I'll go that route.. every solution seems to smell a bit bad, but it may be the nature of the beast

10:52 llasram: jasonbray: There might be a better solution though... Do you have more details on what you're trying to do at a higher level? If this is iterop between protobuf gen'd classes and Cljure maps, why do users ever need to see the classes?

10:53 wakeup``: Hi all, is there a lein plugin that gives me a task for compiling

10:53 HTML documentation based on my docstrings?

10:53 llasram: jasonbray: Or if you're not completely tied to protobufs, you might consider Avro instead :-D https://github.com/damballa/abracad

10:53 hyPiRion: wakeup``: yes, it's named codox

10:53 $google weavejester codox

10:53 lazybot: [weavejester/codox · GitHub] https://github.com/weavejester/codox

10:53 zilti: wakeup`` there's more than one. https://github.com/technomancy/leiningen/wiki/Plugins#documentation

10:54 wakeup`` Though I don't think that list is complete, e.g. codox isn't on that list

10:54 wakeup``: which would you recommend?

10:55 jasonbray: llasram love the embedded schema in avro, probably much easier to use here.. I'm introducing clojure into an existing architecture and atm trying to create a data simulator

10:55 llasram have to step away, thanks for the convo

10:55 wakeup``: zilti: I would prefer something as minimal as possible.

10:56 hyPiRion: zilti: heh, I added it in.

10:56 marshalization: Has anyone tried using Clojure for stock simulations? Encounter a blogpost on use Clojure for simulation and found it interesting

10:57 zilti: I'm a fan of marginalia, though it's a little unconventional (Shows 2 columns, documentation on the left and code on the right). Codox is nice and minimal too

10:57 wakeup`` ^^

10:58 wakeup`` Marginalia looks like this: http://fogus.github.io/marginalia/ Codox looks like this: http://weavejester.github.io/compojure/

10:59 wakeup``: zilti: both awful imho, trying lein-html5-docs right now

11:00 http://mr.gy/software/riff-wave/api.html <- this is my taste ;)

11:01 zilti: wakeup`` really? Not exactly mine, but to each his own

11:02 wakeup``: true

11:02 zilti: wakeup`` has this been generated with lein-html5-docs?

11:02 wakeup``: no

11:02 this is my own CL doc util

11:06 when I do 'lein licenses' I get: clojure-complete - 0.2.3 - Unknown

11:06 Any ideas what that is?

11:07 zilti: What is the core.logic equivalent of minikanren's _ lvar?

11:07 llasram: wakeup``: What the dependency is, or what it's license is?

11:08 wakeup``: llasram: Both?

11:09 llasram: wakeup``: It's a dependency Leiningen injects for completion in REPLs. Not sure why it's leaking at that point though -- what version of Leiningen are you using?

11:09 wakeup``: And looks to be EPL: https://github.com/ninjudd/clojure-complete/blob/master/LICENSE

11:09 wakeup``: thank you

11:10 kasterma: zilti: https://github.com/clojure/core.logic/search?q=lvar%3F&ref=cmdform suggests maybe it is lvar?

11:10 wakeup``: llasram: Leiningen 2.2.0 on Java 1.7.0_25 Java HotSpot(TM) Client VM

11:11 hyPiRion: most likely is it peeking on the dev dependencies too, for some reason.

11:12 zilti: kasterma: You misunderstood me. In minikanren there's _ which does essentially the same as _ in clojure argument vectors: It just states "it doesn't matter what's here".

11:14 kasterma: zilti: I see a fair number of _ in my core.logic files. What makes you think that doesn't work?

11:15 tbaldridge: kasterma: _ in logic programs is way different from _ in functional code

11:15 if you used _ you'd have to bind it to something, and if you bound it to a fresh lvar it would unify all the uses of _

11:16 zilti: kasterma: The "CompilerException java.lang.RuntimeException: Unable to resolve symbol: _ in this context" message

11:16 kasterma: I guess my use is in matching. Maybe ask in #minikanren.

11:16 tbaldridge: just ping dnolen

11:16 zilti: dnolen: ping

11:17 It anyway seems that there's not much documentation for both minikanren and core.logic :(

11:18 dnolen: zilti: paste

11:18 zilti: _ is not really the same as in Clojure

11:19 close but not quite

11:19 zilti: dnolen: I tried to write this: (& q ["When" | _]) in clojure

11:19 I understand that it's not exactly the same

11:19 dnolen: I'm working through http://www.intensivesystems.net/tutorials/logic_prog.html

11:20 dnolen: zilti: yeah that's not miniKanren, that another miniKanren port, mK doesn't have _

11:20 clojurebot: helphelp |is| <reply>A bug report (or other request for help) |has| three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it is awfully hard to help you.

11:20 dnolen: zilti: if you need _, just use (lvar)

11:20 zilti: or use tools.macros.symbol-macrolet

11:20 zilti: dnolen thanks!

11:21 dnolen: bbiab

11:21 zilti: (inc dnolen)

11:21 lazybot: ⇒ 12

11:23 zilti: dnolen Do you by any chance know other minikanren tutorials?

11:27 deg: cemerick: you back online?

11:57 wakeup``: So I have built a jar using uberjar, how do I run it with command line arguments?

11:58 mpenet: java -jar foo.jar

11:58 wakeup``: and the arguments go where?

11:58 mpenet: java -jar foo.jar x y z I think for the args

11:58 well I am sure actually

12:00 TimMc: (dec /usr/bin/java)

12:00 lazybot: ⇒ -1

12:01 wakeup``: good

12:01 TimMc: I mean, it's the right answer here, but it doesn't seem to have a way of saying "OK none of the remaining args are options to me"

12:02 mpenet: there was a contrib lib for that

12:02 tools.cli or something

12:02 unless I am misunderstanding what you mean

12:03 dnolen: zilti: there's a few on the core.logic wiki

12:04 zilti: also worth picking up a copy of The Reasoned Schemer

12:04 noncom: i have a collection "coll", what is the fastest way to realize a many-to-many relationship within that collection? in particular what is the best way to avoid self-crossing for every element?

12:04 say, the collection is of type []

12:10 justin_smith: I see a weird nrepl bug, both using the latest git and marmalade, in the ubuntu emacs version and built from the latest gnu.org source

12:10 I connect via M-x nrepl and I just get an empty window with no prompt

12:11 it gives me a "connected" message in the minibuffer but sends nothing I type to the repl

12:11 llasram: noncom: Can you give a more complete example?

12:12 upwardindex: If I include my js compiled file in the <head> nrepl won't work but if I include it in <body> it does, huh?

12:12 brepl sorry

12:14 justin_smith: if I try to evaluate a region via nrepl I get "wrong type argument, stringp, nil" but no elisp stack trace (I have debug-on-error turned on for elisp)

12:15 noncom: llasram: here is my current code: https://www.refheap.com/17583

12:15 llasram: now i wonder for speed and footprint optimisations

12:17 mmitchell: anyone know if it's possible to create a route (using compojure) that responds only to https?

12:17 dnolen: upwardindex: we follow the Closure notion that putting stuff in head just slows down loading the page.

12:19 noncom: llasram: at the end i want to have a collection of collections of results of interaction of every element of the original collection with every other element of that collection... maybe that sounds stray, but the idea is very simple and found everywhere.. i'm sure you know

12:19 upwardindex: dnolen: oh, I wasn't aware of that, many sites mention to put code in head for various reasons. Is the end of body the right place to import my js?

12:20 Fer`: noncom: does the order of the arguments matter?

12:20 dnolen: upwardindex: yes, putting stuff in the foot is just as common as the head

12:20 noncom: Fer`: no

12:20 Fer`: noncom: like (f c1 c2) != (f c2 c1) ?

12:20 llasram: noncom: Then I don't really see how you can do any better than what you already have

12:21 upwardindex: dnolen: thank you!

12:21 noncom: Fer`: oh that may matter sometimes. there can be two kinds of cases i think... depends on f. i could pick the right one each time if that would speed up things some

12:21 llasram: O(n^2), but if that's your requirement....

12:21 Fer`: noncom: you could at least make sure your collections are sets

12:21 and use disj instead of filter

12:22 noncom: Fer`: they are sets for sure

12:22 so i better use #{} instead of []?

12:23 llasram: i thought that (filter) may slow down things and maybe tehre is a more effective way for that stuff... ? sure maybe not..

12:23 Fer`: you should reduce + conj over a set instead of mapv

12:23 noncom: (disj my-set c) is better than (filter #(not= c %) coll)

12:25 noncom: Fer`: so it is a general recommendation to use sets where possible? like i have a particles simulation which calculates forces of interaction, and the particles are always unique

12:25 Fer`: noncom: if you're doing relational algebra it's best to use sets

12:25 noncom: if you know theyre unique then yeah use sets

12:26 noncom: Fer`: cool! do you know about costs of vector->set and set->vector transformations?

12:26 just thought i ask you if you know..

12:27 Fer`: noncom: i think its constant time

12:27 noncom: ok then! thanks, people!

12:28 llasram: It's O(n)

12:28 Fer`: oh

12:29 noncom: well, anyway, it is good to know..

12:41 seangrove: Is there a quick way to map slurp over all files in a directory?

12:42 TimMc: (map slurp (.listFiles d)) or whatever isn't good enough?

12:43 seangrove: Yeah, that works well, I was trying to use file-seq, but that included the directory itself

12:43 Thanks TimMc

12:44 TimMc: I don't know what your needs are regarding symlink and directory exclusion, or ordering.

12:45 seangrove: Nothing in particular, .listFiles works well enough for this toy project

12:45 wakeup``: So I am building a standalone jar using lein uberjar, I am using clojure.tools.logging with log4j. I am wondering how I can make log4j output the logs to *err*.

12:45 any ideas?

12:47 justin_smith: wakeup``: there is some magic xml config file, iirc. There is clj-logging-config or something like that for specifying log behavior from clojure code, but I found it flaky

12:48 wakeup``: -.-

12:48 justin_smith: I gave up on java logging libs because I don't like configuring with xml files

12:49 wakeup``: Alternative tools.logging backends?

12:49 justin_smith: https://github.com/ptaoussanis/timbre

12:50 even has an irc appender (log to an irc channel)

12:52 tbaldridge: wakeup``: I also like pedestal's logger: https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/service/log.clj

12:52 it stores logs as hashmaps, so post-processing of logs is super easy

12:52 and it's macro based, so you can re-compile without logging and all the log exprs are removed from the code.

12:53 hiredman: wakeup``: the thing is, how many times do you reconfiguring your logging backend?

12:53 wakeup``: timbre looks promising

12:53 I need runtime configurable logging to file

12:55 btw, is there something like with-input-from-string in clojure?

12:55 would save my ass right now

12:56 tbaldridge: http://clojuredocs.org/clojure_core/clojure.core/with-in-str

12:56 justin_smith: ,(with-in-str "1" (read))

12:56 clojurebot: 1

12:56 wakeup``: thank you!

12:57 glosoli: `(books)

12:57 is there some sort of list of books ? :D

13:03 noncom: how do i do something for all elems of a set? like (map) for vectors?

13:03 justin_smith: glosoli: http://clojure.org/books

13:03 noncom: you can map on a set

13:04 noncom: oh thanks

13:04 justin_smith: ,(map (partial + 2) #{0 1 3})

13:04 clojurebot: (2 3 5)

13:04 shafire: ,(map (partial * 3) #{0 1 3})

13:04 clojurebot: (0 3 9)

13:05 shafire: ,(map (partial ** 2) #{0 1 3})

13:05 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ** in this context, compiling:(NO_SOURCE_PATH:0:0)>

13:05 justin_smith: of course, input being a set, the order is arbitrary

13:05 shafire: ,(map (partial ^ 2) #{0 1 3})

13:05 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Metadata must be Symbol,Keyword,String or Map>

13:06 justin_smith: (defn ** [x y] (Math/pow x y))

13:06 clojurebot won't let you defn, but anyway

13:09 to get multi-arity the way you get with other clojure math functions: (defn ** [arg & args] (reduce #(Math/pow %1 %2) arg args))

13:11 noncom: is disj on sets constant-time?

13:12 hyPiRion: noncom: almost constant-time

13:12 log32 n

13:12 that's for hash-sets though. For sorted-sets, that may be log n only.

13:13 rkneufeld: tbaldridge: we've actually run into some trouble with the way the current logger is written. It's really difficult to programmatically do certain things with it.

13:13 justin_smith: ,(do (time (disj (set (range 1000)) 88)) nil)

13:13 clojurebot: "Elapsed time: 5.764852 msecs"\n

13:13 justin_smith: ,(do (time (disj (set (range 10000)) 88)) nil)

13:13 clojurebot: "Elapsed time: 18.555542 msecs"\n

13:14 justin_smith: etc.

13:14 noncom: right

13:15 tbaldridge: rkneufeld: I know, but I still prefer the syntax/output to any other logger I've used. :-P

13:15 rkneufeld: tbaldridge: I'm interested in playing with Timbre <https://github.com/ptaoussanis/timbre>

13:15 justin_smith: noncom: though I guess that does not account for the extra time for making the larger and larger sets

13:16 noncom: but that'd work ok with pre-made sets

13:16 justin_smith: yeah

13:24 silasdavis: how can I dispatch on the value of a destructured list

13:24 like

13:25 (fn ([[x & xs] tail) ([[x & nil]] "foo"))

13:25 I know that doesn't work, but if I had pattern matching I might do it that way

13:25 I'm just trying to return a base case for a list of a single element

13:25 dnolen: not possible

13:26 silasdavis: so how would you achieve the same effect in clojure

13:26 dnolen: silasdavis: I've been hoping someone would add fn support to core.match, but it would need to be comprehensive

13:26 Fer`: no pattern matching in here :P

13:26 silasdavis: what would be the idiomatic way to return a base case in a a recursive function then, just put an if in?

13:26 dnolen: silasdavis: it cannot be done at the fn level in Clojure out of the box, you could augment core.match to do this.

13:27 silasdavis: you can of course do that easily inside of your fn body w/ core.match

13:27 today

13:28 silasdavis: ok thanks

13:29 zilti: silasdavis: you could also use multimethods

13:32 tbaldridge: bbloom: I think what Eff is doing is possible with the core.async IOC macros. I'm going to think on this one for a bit, but I like the design

13:34 bbloom: tbaldridge: yeah, i'm experimenting with it. i've got two sets of terminators for two mutually recursive state machines: the handlers & a "computation"

13:34 the handlers have 'continue and :Return, and the computations have 'effect, 'value, and :Return

13:35 the processes will be mutually recursive with a pair of state machine stacks

13:35 trying to figure out how to get that to work nicely

13:35 tbaldridge: bbloom: yeah and I think with a few small changes to the ioc macros we could make that tied to var metadata, so it would know that <! is a member of a handler.

13:35 bbloom: i want to implement most/all of the examples in the paper, just as a proof of concept

13:36 tbaldridge: yeah, i haven't thought that far yet. my plan was to just have a general purpose "effect" function with a keyword arg, like (effect c :decide)

13:36 at least for the first attempt

13:36 tbaldridge: yeah, that's the way it should be for a POC

13:37 bbloom: i'll make some progress on it today & then push that up to github & add you as a contributor :-)

13:39 callen: Raynes: that mailing list really makes me appreciate Clojure.

13:39 m0smith: morning, anyone familiar with nrepl-inspect?

13:44 shiranaihito: should i worry about these: "Reflection warning, ring/util/response.clj:95:15 - reference to field getFile can't be resolved." .. ?

13:44 (a warning from Lein)

13:44 technomancy: shiranaihito: not unless your profiling

13:44 tbaldridge: shiranaihito: in the rare case, no. It's a fairly massive perf loss, but if you only call that fn once every 10 minutes you may not care

13:45 in the rare case = when you rarely call the fn

13:45 shiranaihito: hm..

13:45 technomancy: arg; you're

13:45 shiranaihito: well, how do i know which of those warnings are a problem? you seem to be saying the idea is that reflection is slow (is it, anymore?), and that might be a problem?

13:46 it's been a while since i was up-to-date with Java

13:46 but iirc reflection stopped being a perf problem at some point.. ? :)

13:46 technomancy: shiranaihito: is your code unacceptably slow?

13:47 shiranaihito: technomancy: nah.. i'm just trying to get to grips with clojure.. just starting out, basically..

13:47 i've just run "lein deps"

13:47 technomancy: cool; you should probably turn off reflection warnings then

13:47 shiranaihito: oh erm.. "lein run", actually

13:47 ok

13:47 so there's a warning any time reflection is done?

13:48 technomancy: any time you compile code that will result in reflection when run iirc

13:48 if you have the warnings turned on

13:48 shiranaihito: well then.. time for the next mystery.. why does "lein run" work fine, but "lein uberjar" crashes with: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)" ?

13:48 alright, i'll turn the warnings off

13:49 do i need to set "aot" on or something.. or is that a thing of the past?

13:50 tbaldridge: shiranaihito: you need to typehint some args/locals to get rid of the reflection warning.

13:50 technomancy: uberjars need :aot :all and :main my.namespace in project.clj, and (:gen-class) in the ns form of the main namspace

13:50 shiranaihito: tbaldridge: well, ring is not my code, so i probably shouldn't fiddle with it

13:50 technomancy: yeah, don't get rid of the reflection

13:50 Anderkent: technomancy: what? why do you need :aot :all for uberjars? Clojure can compile .clj files from jars no problem

13:51 technomancy: Anderkent: eh; it's not strictly needed, but still a good idea

13:52 shiranaihito: technomancy: but i read somewhere that using "aot" is somehow a bad idea or whatever..

13:52 Anderkent: shiranaihito: if you're doing :aot :all on a larger project, you probably want to build on a ramdisk. My aot-compilation went from 3 minutes to 0.5s just by putting target/classes under /dev/shm

13:52 technomancy: shiranaihito: it's a bad idea for libraries. it's a great idea for uberjars

13:52 TimMc: ~aot

13:52 clojurebot: http://i.qkme.me/3vb225.jpg

13:52 technomancy: actually... try this: :profiles {:uberjar {:aot :all}}

13:52 TimMc: ^ how I explain all transient weird bugs

13:53 Anderkent: :D

13:53 shiranaihito: TimMc: that aot stuff causes weird bugs?

13:53 Anderkent: sometimes

13:53 esp with protocols and other deftypes

13:53 callen: technomancy: what did you use to generate Racket binaries? Raco?

13:53 technomancy: callen: yeah

13:54 shiranaihito: this stuff is making me a bit hesitant to use clojure for real :/

13:54 TimMc: shiranaihito: Just avoid AOT. :-)

13:54 Anderkent: shiranaihito: it's all stuff that you don't need most of the time

13:54 shiranaihito: TimMc: but i need it on for the uberjar.. ? :p

13:54 uberjar seems handy for deployments

13:54 Anderkent: no you shouldn't. I think that's not your problem with uberjar

13:54 technomancy: if you put it in the :uberjar profile you'll only have it when producing the uberjar but it won't affect development

13:54 TimMc: shiranaihito: Take a look at lein-otf.

13:54 Anderkent: I think your :main declaration is not correct :P

13:55 darth10: ok a really noob question ... but why do i get "FileNotFoundException Could not locate incanter__init.class or incanter.clj on classpath: clojure.lang.RT.load (RT.java:443)" when i load a file that uses incanter in emacs?

13:55 shiranaihito: though a several megabyte jar with various commons-whatever.jar turdnuggets is somewhat disgusting

13:55 technomancy: if you're using lein 2.3.1 the AOT classes will be completely isolated

13:55 Anderkent: shiranaihito: try a 70mb jar :D

13:55 darth10: i saw the github issue .. this issue was fixed LONG ago too >.<

13:55 shiranaihito: Anderkent: yeah.. yuck.. :(

13:55 TimMc: shiranaihito: AOT mostly interacts badly with 1) interactive development, and 2) advanced langauge features that involve bytecode generation.

13:55 shiranaihito: technomancy: isolated? does that mean "AOT" is no longer a problem? :P

13:56 technomancy: shiranaihito: yeah

13:56 Anderkent: it's ok, the worst thing that can happen is that heroku doesn't clean the git repo we use for deploy.. .Oh wait.

13:56 (heroku-push to the rescue :P)

13:56 TimMc: technomancy: Non-transitive AOT? Can this be true?

13:56 shiranaihito: technomancy: well, i've got 2.2.0 now

13:56 Anderkent: technomancy: non-transitive aot is in?

13:56 technomancy: TimMc: not non-transitive, just isolated from everyday work

13:56 Anderkent: ah.

13:56 TimMc: Oh.

13:56 technomancy: each profile gets its own :target-path

13:57 * TimMc puts away the confetti

13:57 shiranaihito: what exactly are "profiles" in lein, btw?

13:57 technomancy: so it's impossible for dev/user deps to affect uberjars, and it's impossible for uberjar AOT to affect development

13:57 Anderkent: shiranaihito: config changes that are applied conditionally

13:57 shiranaihito: i'm imagining something like.. "settings bundles" or ..

13:57 hmm

13:57 Anderkent: the :dev profile is active (i.e. merged into main config) when you're doing stuff like test, but not when you're packaging, etc.

13:57 technomancy: shiranaihito: your project is a map. profiles are just other maps that get merged in for certain situations

13:58 shiranaihito: and judging by your ":profiles {:uberjar {:aot :all}}".. a profile is chosen based on the lein "target" or "command", like "uberjar" etc.. ?

13:58 technomancy: shiranaihito: yeah, exactly

13:59 only applied when generating uberjars

13:59 callen: technomancy: http://learnxinyminutes.com/ this needs OCaml :)

13:59 technomancy: callen: not bad

14:00 seangrove: What's the cleanest way of turning this blob of text into a hashmap with lower-cased keywords as keys? https://www.refheap.com/f16c60dba32f407cc5d0fc3fa

14:00 technomancy: shiranaihito: if you want the extended edition you can run `lein help profiles` but it'd probably be more fun to just smile and nod and get to the coding

14:00 shiranaihito: :P:P

14:00 yeah well.. i've been getting a bit worried that clojure might be too complicated

14:01 callen: seangrove: split-by separator, split each subsection by :, sequence of left and right hand seqs into map.

14:01 oh and string/lower the left-hand side before (keyword ...)

14:01 Anderkent: (and get confused when there's a : in X-Folder ;D)

14:01 technomancy: shiranaihito: compiling is complicated. you can use tools that hide it from you, or you can have transparency.

14:01 callen: Anderkent: not my fault his format is fucked.

14:01 darth10: shiranaihito: well the road is long :) but the truth is that clojure is in fact one of the most simple langauages out there

14:01 technomancy: that is to say, deployment is complicated

14:02 m0smith: I have been trying to get nrepl-inspect to work in emacs and I just get a blank buffer. Any ideas?

14:02 darth10: ugh... redundancy

14:02 shiranaihito: technomancy: say i've got a "main.clj" in a directory called "application".. do i then put "(ns application.main .." inside the "main.clj"? that doesn't seem to be working (except for running the damn thing)

14:02 seangrove: callen: You're saying your not responsible for this?

14:02 Heh, I blame technomancy for the second misuse of your in under 5 minutes

14:02 technomancy: worrying about uberjars at this point is like trying to figure out bundler before writing any code; it's enough to scare anyone away

14:02 clojurebot: c'est bon!

14:03 shiranaihito: :P

14:03 mgaare: shiranaihito: if you want simple, you could always go to a ruby stack and enjoy the simplicity of puppet... or a straight-on java stack and benefit from the simplicity of multi-megabyte xml files ;)

14:03 darth10: mgaare: or common lisp... nothing like lein in CL

14:03 shiranaihito: mgaare: well, i've got a java background, but lately i've been reasonably happily using python.. i'm looking to move over to clojure for performance and async stuff

14:04 i imagine clojure is a good fit for websockets, for example.. ?

14:04 darth10: shiranaihito: clojure is good for almost everything these days

14:04 but the new core.async lib sure helps for websockets

14:04 mgaare: shiranaihito: Well, the point I was making was that almost everything has a somewhat complicated deployment story

14:05 shiranaihito: darth10: yeah, it looks cool.. but i'm not sure it's necessary for working with websockets?

14:05 mgaare: but clojure's is really quite nice

14:05 darth10: not at all

14:05 but u can useclojurescript :)

14:05 use clojurescript

14:05 zilti: Huh? What's complicated about Clojure compilation and deployment?

14:05 shiranaihito: mgaare: i guess.. but python is relatively easy to deploy.. "pip install whatever-you-need" and you're good to go.. except when you sometimes need to fight with some C-extensions that don't want to build nicely etc :P but yeah, mostly it's smooth sailing

14:06 darth10: zilti: nothing, people just havent looked at how awesome CL is and how bad managing packages in CL is

14:06 technomancy: no no no

14:06 rasmusto: :o

14:06 technomancy: performing dependency resolution on the actual node is wrong

14:06 zilti: darth10: I never looked at CL. I don't like that functions and variables aren't in the same namespace.

14:06 xeqi: technomancy: vendor everything

14:07 shiranaihito: technomancy: huh? :P

14:07 callen: darth10: you didn't need core.async for websockets...aleph and http-kit exist...

14:07 you don't need deep magic like core.async, as cool as it is, for that.

14:07 darth10: well the older names dont easily come to mind callen :)

14:07 zilti: [19:43] <technomancy> that is to say, deployment is complicated

14:07 callen: darth10: you just don't use them.

14:07 shiranaihito: callen: yeah, i've been planning to use http-kit for websockets

14:08 technomancy: zilti: just the fact that AOT is a mess during development but helpful for deployment

14:08 zilti: shiranaihito: I'm using http-kit for web sockets right now, it's great

14:08 darth10: callen: well it was just an example

14:08 shiranaihito: zilti: sweet :)

14:09 mgaare: shiranaihito: that seems an unfair comparison, since you could can do `lein deps` in deployment and you're good to go with clojure too. However, that's not generally considered a good practice for the same reason that pip install on a production server

14:09 darth10: nomancy> so it's impossible for dev/user deps to affect uberjars, and


14:10 shiranaihito: mgaare: i'm still unclear on why it's a bad thing

14:12 mgaare: shiranaihito: well that's honestly more a devops concern and may be outside the scope of this kind of discussion... the point is though that it's an unfair comparison of python pip and clojure advanced options uberjar compiling

14:12 ;)

14:12 darth10: zilti: on the client side, websockets are available in goog.ns if I'm not wrong

14:12 shiranaihito: mgaare: i'm sure it could be summed up in a sentence or two :P

14:12 darth10: a little messy... but gets the job done ... lots of examples out there too

14:12 zilti: darth10: Oh I didn't even bother to use any API stuff. I just used plain websockets and send serialized clojure data structures over it

14:13 llasram: shiranaihito: It increases the complexity of deployment, increases the number of dependencies required on deplolyment systems, increases the risk of deployment non-determinism, and all while providing no benefits

14:13 technomancy: shiranaihito: basically it's a repeatability concern; if you can't spin up a new node guaranteeing it's running the exact same bytes all the way up the dependency tree, you're in trouble

14:14 shiranaihito: so what's wrong with this: https://www.refheap.com/17590 .. "lein run" works, but "lein uberjar" crashes saying: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"

14:14 technomancy: you need to resolve all your dependencies a total of once per deployment

14:14 llasram: (inc technomancy)

14:14 lazybot: ⇒ 66

14:15 shiranaihito: technomancy: well, by default, pip installs stuff globally.. once it's installed, it's there, and usable for future deployments too, right?

14:15 technomancy: shiranaihito: not if you have multiple servers

14:15 shiranaihito: llasram: .. and you can give pip the exact version numbers of the libs you want

14:16 technomancy: remote repositories can go down or serve up corrupted checksums

14:16 shiranaihito: technomancy: well yeah, pip can't install stuff on all of your servers at the same time.. you kind of have to run it separately on each :P

14:17 but can someone see something wrong with this: https://www.refheap.com/17590 .. "lein run" works, but "lein uberjar" crashes saying: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"

14:17 technomancy: shiranaihito: something's wrong with the project layout

14:17 shiranaihito: "lein jar" crashes the same way

14:17 technomancy: try `lein new app myapp`

14:18 shiranaihito: i've been scraping up a lein template of my own

14:18 but really, why would "run" find "application.main" just fine, but other targets not?

14:18 hyPiRion: shiranaihito: Are you on 2.3.0?

14:18 shiranaihito: 2.2.0

14:18 is there an easy way to upgrade?

14:18 hyPiRion: `lein upgrade 2.3.1`

14:19 or just `lein upgrade`

14:19 anyway, the 2.3.0 had some AOT compilation issues, that's why I asked.

14:22 shiranaihito: well, lein seems to have broken itself now :P

14:22 i originally installed from Homebrew

14:22 technomancy: homebrew =\

14:22 shiranaihito: technomancy: it's great! :P

14:22 technomancy: I told them to disable upgrade function

14:22 darth10: hah

14:22 hyPiRion: heh

14:23 shiranaihito: well then.. i guess i need a separate install :p

14:24 would running "/.lein/self-installs/leiningen-2.3.1-standalone.jar" work?

14:24 dobry-den: Right now I have 5 clojure apps running on one server. each one sits behind nginx on a port. each one is run with `java -jar <appname>.jar` in its own tmux tab. i like being about to ssh into the server, `tmux attach`, and see realtime log output for each website. -- But obvious if the VPS reboots or a jar fails somehow, it doesn't restart. What's the next step?

14:25 hyPiRion: shiranaihito: not without the script, no

14:25 shiranaihito: hm

14:25 technomancy: dobry-den: clojars uses upstart for that

14:25 dobry-den: thanks

14:25 technomancy: dobry-den: good for simple things: https://github.com/ato/clojars-web/blob/master/SYSADMIN.md

14:25 shiranaihito: dobry-den: this might be interesting too: http://www.skarnet.org/software/s6/

14:25 technomancy: better than tmux =)

14:27 hyPiRion: man, that diagram. I bet it's made with OmniGraffle, which is not available for linux. =(

14:28 dobry-den: that diagram is hot

14:30 bbloom: i impulse purchased omnigraffle not too long ago

14:30 great software, but expensive as hell

14:30 i'd have impulse purchased it many years earlier if it was a bit cheaper

14:31 zilti: damn. http-kit stopped working.

14:31 eric_normand: dobry-den: I use supervisord

14:31 shiranaihito: so how do i find out what the latest version for a lib is? is there a lein command for that?

14:32 nDuff: shiranaihito: there's a lein plugin which adds a command for it, yes

14:32 hyPiRion: $latest ring

14:32 lazybot: [ring "1.2.0"] -- https://clojars.org/ring

14:32 zilti: shiranaihito: lein-ancient

14:32 shiranaihito: lein seems unhappy about using "LATEST" for a version number

14:32 nDuff: shiranaihito: https://github.com/xsc/lein-ancient

14:32 ahh.

14:32 shiftyeyes: ...indeed; using "LATEST" is not a way to get reproducible builds.

14:33 hiredman: shiranaihito: don't do that

14:33 shiranaihito: nDuff: well, i just wanted the latest stuff for now

14:33 xeqi: shiranaihito: does it fail to resolve, or just warn?

14:33 shiranaihito: yes yes.. i'm aware of the dangers :p

14:33 rasmusto: nDuff: shiranaihito ^^^

14:33 shiranaihito: it says "Aborting due to version ranges."

14:34 $latest http-kit

14:34 lazybot: [http-kit "2.1.8"] -- https://clojars.org/http-kit

14:34 shiranaihito: i guess i can expect ring-<something> to be at 1.2.0 too.. ? :p

14:35 xeqi: shiranaihito: do you have :pedantic :abort set?

14:35 shiranaihito: xeqi: yeah, it's set, actually

14:35 xeqi: try removing that temporarily

14:36 shiranaihito: well, now that i set specific version numbers, it moved forward.. oh.. well, apparently ring-something has a different ver number from plain ring

14:36 alrighty.. :P

14:36 $latest ring-devel

14:36 lazybot: No project by this name exists on clojars.

14:36 xeqi: $latest ring/ring-devel

14:36 lazybot: [ring/ring-devel "1.2.0"] -- https://clojars.org/ring/ring-devel

14:37 shiranaihito: $latest ring-cors

14:37 lazybot: [ring-cors "0.1.0"] -- https://clojars.org/ring-cors

14:37 shiranaihito: ah..

14:37 $latest ring/ring-json

14:37 lazybot: [ring/ring-json "0.2.0"] -- https://clojars.org/ring/ring-json

14:37 nDuff: shiranaihito: ...you could, you know, use the lein-ancient plugin instead of asking the bot in here all the time. :)

14:37 zilti: http-kit just fails to start with "lein run". It only works from the REPL, what could be the reason?

14:37 shiranaihito: well, this kind of stuff is why i'd just rather say "LATEST" and be done with it (until i deploy "properly" and set the specific version numbers etc :p)

14:38 nDuff: sure, but how do i install a plugin? :P

14:38 hyPiRion: you can also message lazybot privately

14:38 rasmusto: shiranaihito: you lose tracability if you do that

14:38 nDuff: shiranaihito: ...by following the directions on the plugin's homepage, which you were linked to? :)

14:38 kmicu: NEVER "LATEST" NEVER

14:38 hyPiRion: oh, I know what I shall create now

14:38 zilti: shiranaihito: :plugins [[lein-ancient "0.4.4"]] inside your project file, or :profiles {:user {:plugins [[lein-ancient "0.4.4"]]}}

14:38 hyPiRion: A plugin which accepts the keyword "LATEST", just to make people angry.

14:39 kmicu: ;]

14:39 llasram: Highly focused trolling is the best trolling

14:39 shiranaihito: :p

14:39 llasram: i'm not trolling btw, if that's what you're implying

14:39 xeqi: hyPiRion: LATEST should already be accepted, the template system uses it

14:39 llasram: shiranaihito: oh, no -- commenting on hyPiRion's joke

14:39 xeqi: or was that RELEASE...

14:39 hyPiRion: xeqi: really? That's awful news, now I can't make my new obscure lein plugin

14:40 xeqi: lein-obscure? for obfuscating your clojure code?

14:40 Phil_D: Quick question: I'm using LiveReload (http://livereload.com/) for reloading CSS/JS changes in the browser automatically. Is there a way to detect .clj file changes since Compojure "reloads" the server?

14:40 shiranaihito: hm.. it seems ring-json wants an older ring-core

14:41 weird

14:41 hyPiRion: xeqi: no, that's lein-swearjurize

14:41 I'm not completely done with that one yet

14:41 llasram: hyPiRion: Or you could make it accept WHATEVER instead, which picks the most recent version, but with a <p> probability of picking a different version

14:41 shiranaihito: can i make my own lein "targets" like with Ant back in the day? :p

14:41 hyPiRion: llasram: and with a probability to not include it at all too

14:41 shiranaihito: i mean, something else than a lein template etc

14:41 llasram: hyPiRion: Perfect!

14:41 hyPiRion: man, this sounds like an awesome plugin.

14:42 dobry-den: Does anyone know anything about mmcgrana? He seems to be a machine. Created projects like Ring a few years ago and simply seems to have moved on.

14:42 llasram: shiranaihito: Check out aliasing in the lein doco -- aliasing to `run` is what you need like 90% of the time. For the rest, you can write plugins trivially

14:42 dobry-den: Baller.com

14:43 TimMc: "Programming not frustrating enough? (hyPiRion inc) has just the toolchain for you!"

14:43 shiranaihito: :P

14:44 zilti: What's the best way to prevent an application main thread from terminating? http-kit seems to put itself into the background, and then the -main method terminates.

14:44 hyPiRion: TimMc: Actually I'm wondering about calling my own firm "'); DROP DATABASE companies;-- Olympos AS" because it's technically legal in Norway

14:45 zilti: hyPiRion: Just for that http://xkcd.com/327/ short moment?

14:45 pjstadig: hyPiRion: i approve

14:46 TimMc: You might need to register a few companies with slightly different names just to be sure.

14:47 hyPiRion: zilti: Well, almost. My last name is L'orange (with an apostrophe), so I'm always a bit annoyed that I can't register stuff online from time to time.

14:47 It's more like revenge, I guees.

14:47 seangrove: Wouldn't be too bad an idea - you'd have a chance at helping all the companies scraping the listings to improve their code a bit

14:48 shiranaihito: oh. my. fucking. god.. this is starting to feel like fighting with Maven

14:48 seangrove: I especially like the idea that everyone who spammed me after creating a company in the US having to rebuild their dbs

14:48 zilti: shiranaihito: What kind of obscure dependencies do you mess with?

14:48 * seangrove incidentally just got two calls from recruiting companies

14:48 shiranaihito: zilti: none, as far as i know..

14:48 TimMc: $ curl -I http://www.reddit.com/

14:49 Server: '; DROP TABLE servertypes; --

14:49 xeqi: zilti: the jvm should stay alive as long there is a non-Daemon thread

14:49 shiranaihito: zilti: https://www.refheap.com/17594

14:49 that's about it..

14:49 zilti: xeqi: It doesn't for me.

14:49 shiranaihito: aaand now: "[lein-ancient "0.4.4"] -> [ancient-clj "0.1.3"] -> [clj-aws-s3 "0.3.6"] -> [com.amazonaws/aws-java-sdk ""] -> [commons-codec "1.3"]" ..

14:50 .. the glorious plugin i just installed(?) as per someone's recommendation here :P

14:50 zilti: shiranaihito: ...and where's the problem?

14:50 Running out of HDD space?

14:50 shiranaihito: now it's unhappy about whatever

14:50 nah

14:50 plenty of space

14:50 seangrove: TimMc: interesting, any idea why it's there?

14:50 hyPiRion: you can never be sure when downloading jar dependencies.

14:50 * seangrove googles

14:51 zilti: xeqi: For me it doesn't. It terminates right away.

14:51 shiranaihito: hyPiRion: well, i guess the main point of Lein is still to avoid having to mess with dozens and dozens of shitty, pointless little jars.. just like Maven's point was back in the day

14:52 but sadly, it seems Clojure carries on Java's legacy in this area

14:52 TimMc: seangrove: Presumably it's an executable message to script kiddies.

14:52 shiranaihito: anyone remember working on java projects where you'd have a "lib" directory for the project and then just pour _eeeveeerryyytthhiiingg_ in there, to avoid having to deal with the damn mess of what jars are _actually_ needed? :P

14:52 zilti: I've never had any build system as effortless and simple as Leiningen. Not even simple-build-tool (lol)

14:54 shiranaihito: i was perfectly content working with Ant, and making sure i only had the necessary jars in my projects.. but then people adopted Maven, which happily downloaded half the fucking world every time you built your project :p

14:54 hyPiRion: shiranaihito: it just seems you've had a bad experience with some bad dependencies, really.

14:54 shiranaihito: hyPiRion: yes :P

14:54 i have

14:54 darth10: zilti: scala's sbt turned out to be NOT so simple after all

14:54 shiranaihito: but i'm having a bad experience now, again

14:54 "The Java Way" rears its ugly head again

14:55 it's seriously weird how people keep having their projects depend on various useless commons-jars etc

14:55 tbaldridge: we should all adopt the Go lang model. Put repo urls in your project and pull master on every compile

14:55 </sarcasm>

14:56 zilti: shiranaihito: Rather reinvent the wheel each time?

14:56 clojurebot: multimethods is http://clojure.org/multimethods

14:56 shiranaihito: the java world had a mentality of overzealous re-use, basically.. if there was a jar for something somewhere, it should be used.. and that's how all those silly commons jars got included in everything

14:57 zilti: yes, i would have.. it's silly to bring in a dependency for some small thing you could write yourself in like 10 mins or whatever

14:57 zilti: What's the best way to prevent an application main thread from terminating? http-kit seems to put itself into the background, and then the -main method terminates. I can only keep it running right now from the REPL

14:59 shiranaihito: zilti: is there a setting in http-kit for that?

15:01 zilti: shiranaihito: No, or at least I didn't find anything

15:01 shiranaihito: aww :x

15:02 weeell.. now i've got "lein run" and "lein jar" working, but "lein uberjar" still says: "Compilation failed: java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"

15:02 "lein jar" working is a step up from lein 2.2.0, apparently :p

15:02 llasram: shiranaihito: It sound like your `project.clj` has something like `:main application.main` in it w/o that namespace (and file) existing

15:02 arohner: what is the best way to generate EDN data? pr-str can generate strings that can't be read

15:03 hyPiRion: shiranaihito: I'd have a guess that main.clj is not within the src/application/ folder

15:03 zilti: arohner: str

15:03 amalloy: zilti: he said best, not worst

15:03 shiranaihito: llasram: yes, it's got: ":main application.main" .. and then i have a "source" folder (:source-paths ["source"]), with a folder called "application" inside it, and a "main.clj" in that

15:03 tbaldridge: arohner: use clojure.edn

15:04 shiranaihito: llasram: but isn't it weird how "run" and "jar" find it just fine, but "uberjar" doesn't?

15:04 Raynes: tbaldridge: clojure.edn doesn't have generating functions

15:04 arohner: tbaldridge: I'm asking about *generating* EDN that can be read by clojure.edn

15:04 tbaldridge: arohner: eh, my bad

15:04 mdrogalis: arohner: What's it generating that can be read back?

15:04 TimMc: A printer that freaks out when the output won't be EDN?

15:04 arohner: TimMc: yes

15:04 hyPiRion: shiranaihito: is the namespace of that file application.main ?

15:04 arohner: ,(clojure.edn/read-string (pr-str (ref 1)))

15:05 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.edn>

15:05 llasram: shiranaihito: Not a fan of the defaults, are you? :-) I was just thinking about `jar`. `lein run` w/o specifying a namespace/function works?

15:05 hyPiRion: and more importantly, is it a gen-class file?

15:05 Raynes: arohner: I'm not sure what you'd expect to happen.

15:05 arohner: What printing function could print that?

15:05 You're probably just going to have to make sure you don't give it unreadable/printable data.

15:05 arohner: Raynes: I'd like an exception for "this can't be read as EDN", at print time, rather than read time

15:05 amalloy: arohner: i think such a printing function is #(doto (pr-str %) read-string)

15:05 shiranaihito: hyPiRion: https://www.refheap.com/17595

15:06 mdrogalis: amalloy: Aha. :D

15:06 shiranaihito: hyPiRion: see a problem?

15:06 llasram: yeah, i feel like having a "main.clj" instead of "core.clj" :P

15:07 it's just more.. "zen" :P

15:07 hyPiRion: well, I guess ring.middleware.cors should be ring.middleware.core, but other than that, not really

15:07 llasram: shiranaihito: I was mostly thinking of "source" vs "src", but that too

15:07 shiranaihito: llasram: yeah, that too.. but it should be fine, right? :P lein should be possible use even like this, yes? :P

15:07 llasram: hyPiRion, shiranaihito: Oh good catch -- which would make it unlikely that `lein run` was working to run this ns either

15:07 amalloy: hyPiRion: i imagine he's using the cors middleware

15:07 llasram: OH, nm

15:07 shiranaihito: yes there's that ring-cors thing

15:07 llasram: blorp

15:08 hyPiRion: amalloy: at least I said it was a guess.

15:08 shiranaihito: but "lein run" works

15:08 llasram: shiranaihito: Yeah, it should work. It just seems like kind of a difference just to be different sort of thing

15:08 shiranaihito: llasram: well, it's not like i'm a teen-goth or anything :P

15:09 llasram: shiranaihito: Are you *sure*? You should double-check

15:09 shiranaihito: :p

15:09 no but seriously

15:09 hyPiRion: sounds like you've managed to do something very strange at least

15:09 or that you've found a very strange lein bug

15:09 shiranaihito: it shoudn't be difficult to use lein with this kind of small variations in settings, right?

15:09 hyPiRion: lein clean, does that work?

15:09 shiranaihito: it does

15:10 hyPiRion: then lein uberjar?

15:11 mdrogalis: shiranaihito: What exactly are you trying to do? Can you describe it if it's that small in terms of pertinent variations?

15:11 shiranaihito: uberjar doesn't work

15:11 mdrogalis: huh? i'm trying to run "lein uberjar" but it crashes: "java.io.IOException: No such file or directory, compiling:(application/main.clj:1:1)"

15:11 llasram: shiranaihito: Could you push up a git repo / tarball of the whole project-thus-far?

15:11 shiranaihito: hmm

15:12 i guess, but i wonder what the most effortless way to publish this would be

15:12 mdrogalis: Or at least show your project.clj and main.clj

15:13 llasram: shiranaihito: You can do a multi-file gist

15:13 shiranaihito: project.clj: https://www.refheap.com/17596

15:14 main: https://www.refheap.com/17595

15:14 llasram: whoa

15:15 mdrogalis: Haha.

15:15 hyPiRion: that project.clj is probably the issue

15:15 mdrogalis: Yeah, I'm gonna say this is more than a little variation :)

15:15 shiranaihito: hm?

15:15 clojurebot: benchmarking is https://github.com/hugoduncan/criterium

15:15 llasram: This at least is especially suspect: `:eval-in :leiningen`

15:15 xeqi: haha, :test-paths []

15:15 shiranaihito: mdrogalis: well, i've just taken the sample project file from the lein website and modified it

15:16 llasram: shiranaihito: It's about 5-10x as long as most project.cljs :-)

15:16 shiranaihito: i do realize it contains more settings than necessary

15:16 yes

15:16 but i just left them there kind of like as a reminder of what settings are available, in case i'd want to change some of them later on

15:16 mdrogalis: rm the unnecessary ones until you find the problem.

15:16 xeqi: yeah, :eval-in :lieningen is def

15:16 mdrogalis: Or comment them.

15:16 xeqi: blah

15:17 bbloom: tbaldridge: here's what i've got so far: https://github.com/brandonbloom/cleff/blob/master/src/cleff/core.clj -- that's just the shape of it. gonna try to fill in the implementation now

15:17 shiranaihito: xeqi: wow.. that was it :P

15:17 xeqi: :eval-in :leiningen is usually for plugins

15:17 means eval in the leiningen jvm instead of the project one

15:18 and :bootclasspath false is probably slowing your invocations down

15:18 shiranaihito: well then.. it would be interesting to know why Lein's sample project file would be "broken" like this.. :p

15:18 hyPiRion: I'm not even sure what uberjar would do in such a situation. That's something I'll have to look at.

15:18 brianwong: hey guys, i have a feeling that I can DRY up this code snippet even more but I cant quite figure out how. I may be way off, but basically the 'then' part of my 'if' is a 'let' binding. Though I want to use the 'let' binding in my 'else' form. How can I rewrite the the following code snippet where the 'let' binding is not out of scope for the 'else'? https://www.refheap.com/17598

15:19 hyPiRion: shiranaihito: as it says in the header, it shouldn't be considered a representative configuration.

15:19 shiranaihito: a sample should contain safe & sane defaults, right?

15:19 no, not "representative", sure.. but how about "not broken"? :P

15:19 xeqi: shiranaihito: you mean like the one created by `lein new`?

15:19 hyPiRion: Hm, perhaps we should be even more explicit about it.

15:20 mattmoss: brianwong: Aren't you being contradictory? You want, in the else clause, to use something that will only work if the if test passes.

15:20 shiranaihito: xeqi: no, i mean the sample file: https://github.com/technomancy/leiningen/blob/master/sample.project.clj

15:20 xeqi: shiranaihito: the "not broken" part

15:20 shiranaihito: xeqi: well, i was talking about that sample file over there.. it's something a new user might find, and then decide to use as a "template" for his project files

15:20 .. and then he'd be fucked

15:21 .. and left wondering why

15:21 it's not unreasonable to expect a sample file to work

15:21 brianwong: mattmoss: i tried to make it generic, but say the test was something like (seq coll), i then run a function that does something with part of the collection, but would like to use the result in both the 'then' and the 'else', depending on the test. So I want to make the 'let' binding the "parent" of the 'if', but that wont work because i need the test first

15:22 llasram: shiranaihito: Except for the comment at the top. I agree I can see some potential for confusion, but in practice it seems to have been pretty small so far

15:23 shiranaihito: llasram: well this would be the relevant bit: "it shouldn't be considered a representative configuration" -- but we've already covered this.. i know this is not a representative file, but i did expect it to not be broken and send me off to a wild goose chase for a couple of days

15:24 i even saw and noted that before i copied the file, but didn't expect it to be broken

15:24 mattmoss: brianwong: Can you provide sample? What you're saying doesn't make sense to me.

15:24 llasram: It's not exactly broken - it'd work great for a project which was a plugin (and needed all the other wacky settings)

15:24 brianwong: mattmoss: here is the specific problem. i just made a simple infix calculator as per the 4clojure problem. It may not be efficient or the best solution, but it demonstrates my scoping issue. https://www.refheap.com/17599

15:24 zilti: it should be pretty clear that this file is for explanation purposes, not usage...

15:25 brianwong: the 4clojure problem is http://www.4clojure.com/problem/135

15:25 llasram: shiranaihito: If you've got an idea how to improve things to prevent the problems you ran into, the project is very open to PRs

15:25 b

15:25 hah

15:25 shiranaihito: llasram: it says nothing about making a plugin though

15:25 (in the beginning notice anyway)

15:26 mattmoss: brianwong: How can you be sure that ((second args) (first args) (nth args 2)) is safe if (> (count args) 3) fails?

15:26 llasram: shiranaihito: That's true, but is called out in the comment by the relevant `:eval-in` option

15:26 mattmoss: Or maybe "safe" isn't right word, but "reasonable."

15:26 ordnungswidrig: brianwong: you're missing recursion, right?

15:27 brianwong: oh, sorry

15:27 brianwong: why do you need result there?

15:28 deg: cemerick: you back online?

15:28 brianwong: mattmoss: i cant, but arguments to an infix calculator must be a sane number of args

15:28 shiranaihito: llasram: there's no warning about setting it to :leiningen breaking uberjar though

15:28 cemerick: deg: eh, marginally

15:28 brianwong: this function assumes that you gave the correct number

15:28 mattmoss: brianwong: Do you see what I'm getting at? Either it's safe or it isn't. If it's safe, then you can pull that part out of the (let outside of the (if

15:29 shiranaihito: wow.. oh well.. life goes on.. maybe i can finally actually do something with clojure now

15:29 boblarrick: I'm doing some java interop and have a instance of a java class, is there something equivalent to ruby's ".methods" method that I can use in clojure to see what I can do with this java object?

15:29 cemerick: Currently trying to get the macbook air's fans to settle down, of all things. :-P

15:29 brianwong: ordnungswidrig: i just feel i dont have to repeat myself

15:29 mattmoss: i see your point now

15:29 deg: cemerick: ok. Just wanted to give you a heads-up that my problem earlier (w/ pprng) was a total red herring. I had put the :libs [""] one level too high in the map (under each build, not inside :compiler).

15:30 cemerick: deg: oh, good to know :-)

15:30 deg: Took me embarassingly too long to find the typo, but all's good now.

15:31 llasram: boblarrick: check out the `clojure.reflect` namespace

15:31 xeqi: &(-> "instance" .class .getMethods)

15:31 lazybot: java.lang.IllegalArgumentException: No matching field found: class for class java.lang.String

15:31 brianwong: mattmoss: i am still unsure how to approach the test or rewrite this then. if i pull the 'let' out and make it the parent of the test, i am guessing it will only fail near the end of the recursion

15:32 ill have to give it more though

15:32 thought

15:32 approach the problem again

15:33 xeqi: &(-> "instance" class .getMethods seq)

15:33 lazybot: ⇒ (#<Method public boolean java.lang.String.equals(java.lang.Object)> #<Method public java.lang.String java.lang.String.toString()> #<Method public int java.lang.String.hashCode()> #<Method public int java.lang.String.compareTo(java.lang.String)> #<Method public int ja... https://www.refheap.com/17602

15:33 xeqi: boblarrick: ^

15:33 mattmoss: brianwong: Check https://www.refheap.com/17603

15:34 brianwong: If we asssume that your result calc is safe, then moving it out of the (if looks like the second expression.

15:34 excusing bad spacing

15:36 boblarrick: @xeqi and @llasram thanks, those are both helpful

15:37 cemerick: deg: no worries

15:37 glad it worked out

15:42 mabes: eldoc has stopped working for me w/nrepl so I've paired my init.el down to these 20 lines and it still is not working: https://gist.github.com/bmabey/22efcee4d204da36d0fb

15:42 any ideas on what I'm doing wrong? ^

15:42 jcromartie: something's not right here: http://imgur.com/J8HV3B1

15:47 tbaldridge: jcromartie: something left in the stencil buffer?

15:47 brianwong: thanks mattmoss, i am not completely sure this is the best way yet, but I understand that if I make the assumption of the args being safe after the 'if', it doesnt make much difference that I assume it is safe outside the if. I still have this feeling that there is a better way to approach this that is safer and more concise. Thanks for your help

15:47 jcromartie: tbaldridge: not sure, it's someone else's LWJGL example

15:48 but looking into it

15:49 swarthy: jcromartie: tbaldridge: is that a clojure LWJGL lib like Penumbra you are using or something new, or just plain Java? I got curious for such thing recently and was wondering what was out there.

15:49 jcromartie: swarthy: I'm digging into this stuff now. Penumbra was last updated a year ago, and it is pretty decent.

15:50 but that's about it

15:50 swarthy: jcromartie: Yeah that is what I found. I haven't looked into Penumbra enough to see how much functionality it has with in it.

15:50 For the time my hobbyist game stuff is staying in Love2D, though that is not as exciting.

15:51 jcromartie: I'm a fan of Lua, but I'd rather just use SDL and host Lua itself from C code.

15:51 SegFaultAX: I thought penumbra was dead.

15:51 jcromartie: it's basically dead

15:51 SegFaultAX: I mean officially dead.

15:51 jcromartie: ys

15:51 swarthy: jcromartie: is that not what Love2D is doing?

15:51 ToxicFrog: swarthy: C++, but yes.

15:51 jcromartie: swarthy: it wants you do to everything in Lua

15:51 SegFaultAX: As in the maintainer has decided to stop working on it permanently.

15:51 jcromartie: SegFaultAX: yes, it's ztellman's

15:52 "Penumbra is not under active development. However, it’s still a fun way to play around with OpenGL and Clojure. Bugs will be fixed, time permitting, but new features are unlikely."

15:52 SegFaultAX: It's easy to extend love2d.

15:52 swarthy: ToxicFrog: jcromartie: ah I see. Yeah it works for me at the moment as that stuff is a bit above my head. But I would like to learn more about hosting lua in another language.

15:53 SegFaultAX: swarthy: Join #lua

15:53 Lua is /very/ easy to embed.

15:53 swarthy: SegFaultAX: haha, probably a good place to start.

15:53 jcromartie: SegFaultAX: extend it with C? or Lua?

15:54 ToxicFrog: swarthy: yes, that. And #lua is pretty friendly.

15:54 jcromartie: I did Lua full-time for like a year

15:54 SegFaultAX: jcromartie: Yes.

15:54 ToxicFrog: jcromartie: with either, although of course you'll have to work from source to do the former.

15:54 jcromartie: man, the Löve library names are worse than Ruby :|

15:54 ToxicFrog: jcromartie: yeah :/

15:55 jcromartie: AnAL, Goo, HUMP, HardonCollider (not Hadron), LUBE, Quickie, Pölygamy, Swingers

15:55 SegFaultAX: I've also used Moai for some medium sized projects.

15:55 ToxicFrog: Is data.xml currently the best way to turn XML source into something I can xml-seq?

15:55 SegFaultAX: Another excellent C++/Lua framework.

15:55 ToxicFrog: jcromartie: yeah, I kind of feel like the love2d devs picked exactly the wrong name for their project.

15:55 Or possibly the wrong community.

15:56 swarthy: ToxicFrog: but they can say "Made with Love"

15:56 jcromartie: when it came out, it was very similar to what I was doing with Lua

15:56 (in personal projects)

15:56 but my approach was more of "virtual console" with more of an IoC approach

15:57 it's probably not too late to resurrect that idea

15:58 ToxicFrog: Hmm. clojuredocs implicitly recommends data.xml, so let's go with that.

15:59 kurisuPhone: ToxicFrog, but those names are awesome! :)

16:00 ToxicFrog: kurisuPhone: until you view the source for something using them while at work~

16:00 TimMc: ...not really.

16:00 They're *funny*, but that doesn't mean they're *good*.

16:01 kurisuPhone: ToxicFrog, only a problem if you work at enterprise

16:01 glosoli: What's ad-hoc hierarchy ?

16:02 jcromartie: kurisuPhone: or anywhere whose entire employee and customer base is not just a bunch of hipsters

16:02 kurisuPhone: Theyre not descriptive, yeah, but then I'm not sure "pedestal" or "leiningen" are either

16:02 ToxicFrog: leiningen is totally descriptive if you know the story

16:03 jcromartie: The problem is not the level of description.

16:07 nDuff: kurisuPhone: you don't have to be an "enterprise" for that to matter.

16:08 * nDuff lives very much on the tiny-startup side of the world, but wouldn't touch those projects with a 10-foot pole... if for no other reason because of their authors' public disdain for professionalism.

16:08 kurisuPhone: Yeah, I just wanted to imply that it depended on how conservative were ones views on sexuality

16:08 nDuff: (as implied by the naming).

16:09 kurisuPhone: ...again, I can't agree with that at all.

16:09 llasram: s,conservative,mature,

16:09 nDuff: kurisuPhone: Personal and professional lives are two entirely different things.

16:09 * kurisuPhone dislikes the word "professionalism" as generally used

16:10 kurisuPhone: I can't agree with that, theyre intrinsically intertwined

16:11 jcromartie: kurisuPhone: so, being so very sexually liberated, would you put your kid in a daycare called "anal lube enterprises"?

16:11 they may be the pinnacle of professionalism

16:11 :|

16:11 anyway, waaaaaay off topic

16:12 thank you #clojure for not naming libraries after anything you wouldn't feel comfortable talking about with any old lady on the bus

16:12 kurisuPhone: I dont see why not, even though the analogy wasn't the best one. But yeah, offtopic

16:13 jcromartie: on topic: I have given in and tried Emacs Live, and it seems to be a great set of defaults

16:13 I have completely forgot about my old config

16:14 hugod: I'm trying to find a sane packaging strategy for clojurescript libs that depend on plain js - one that allows the library consumer to override or provide the js lib, either on the classpath or through the js runtime (eg. via a cdn on browser)

16:14 using :libs prevents the use of a cdn, iiuc

16:15 ztellman: jcromartie SegfaultAX: yeah, penumbra's dead, I've been looking at maybe creating some lower-level opengl 2.0+ bindings

16:15 dnolen: hugod: is that what :foreign-libs is for?

16:16 jcromartie: ztellman: the hard part is all the byte bufffer juggling for VBOs, arrays, etc. that are really needed to do anything serious

16:16 ztellman: immediate mode is all well and good for playing around

16:16 but if anything is dead, it's glBegin()

16:16 hugod: dnolen: not sure - it requires the consumer of the cljs library to specify :foreign-libs

16:17 jcromartie: tbaldridge: see if you spot the problem here :) (GL11/glClear (or GL11/GL_COLOR_BUFFER_BIT GL11/GL_DEPTH_BUFFER_BIT))

16:17 ztellman: jcromartie: https://github.com/ztellman/vertigo

16:17 hugod: maybe that's not a bad thing - i.e. always provide the js in a resource, and allow the consumer to decide to use it with :foreign-libs

16:17 ztellman: problem solved-ish

16:17 jcromartie: ztellman: ah, wow, nice

16:18 ToxicFrog: death to xml

16:18 jcromartie: ztellman: you just crank this stuff out man

16:18 ztellman: haha

16:18 TimMc: like frog eggs

16:18 ztellman: I have this pyramid of projects I've had in my head for years

16:19 most of them have certain problems that need to be solved before I could undertake it

16:19 I'm cranking out prerequisite libraries right now

16:19 whether I have any energy left over once I'm done is the real question

16:20 bbloom: tbaldridge: are there still some issues w/ case statements in ioc?

16:20 technomancy: candle at both ends =)

16:20 tbaldridge: jcromartie: rofl, nice! (not= or bitwise-or)

16:20 bbloom: what problem are you hitting? I'm not aware of anything

16:20 ztellman: technomancy: burns twice as bright etc. etc.

16:20 jcromartie: ztellman: what's your final plan? to take over the world?

16:20 bbloom: tbaldridge: dunno yet, trying to make sense of it. i'll let you know

16:21 jcromartie: "I just need to be able to declaratively specify a binary protocol for automated goat feeders, then I can..."

16:21 :P

16:21 ztellman: jcromartie: short term goal is to decouple pretty much everything useful I've written from Lamina's channels

16:21 jcromartie: sounds like a good plan

16:21 ztellman: should have done this ages ago, core.async gave me the kick in the ass I needed

16:22 jcromartie: yeah I was impressed with the size and scope of what Lamina internals were doing, wished they were in discrete libs

16:22 so that's great

16:22 ztellman: yeah, I have this tendency to build towers of abstractions

16:23 a few people have scaled it all the way to the top, and are using my stuff productively, but objectively they're crazy to have done it

16:23 amalloy, I'm looking at you

16:23 so instead of a big tower, I'm making a village of libraries

16:23 it's surprisingly fun

16:25 zilti: ztellman: So then you're splitting up lamina?

16:25 bbloom: tbaldridge: ah no, not case: fn

16:25 tbaldridge: seems that if i build a state machine from (fn [x] x), then i get x not defined

16:25 ztellman: zilti eventually, right now I just have duplicate functionality all over the place

16:25 amalloy: speaking of being crazy to use ztellman's software, you all may be amused to know that lamina is currently spending 50% of all CPU time on Object#hashcode

16:25 tbaldridge: bbloom: ioc translation stops at (fn []) forms

16:25 ztellman: amalloy: this is in query-seq?

16:26 zilti: ztellman: Because in the end pretty much everything inside lamina belongs together, so that's why I wonder

16:26 bbloom: tbaldridge: it's the root form

16:26 amalloy: yeah, like i was looking at a few weeks ago. finally getting back to it

16:26 tbaldridge: bbloom: root forms need to be expressions

16:26 *non - fn expressions

16:26 bbloom: tbaldridge: OK, that makes sense. is there some way to get a parameterized thunk then?

16:26 ztellman: I choose to take that as "lamina's so fast, only the hashCode lookups are left"

16:26 Raynes: zilti: Not all of it. The querying stuff, for example.

16:26 jcromartie: ztellman: that's also how I read it

16:26 bbloom: like i guess i can just make some terminal like get-message or whatever & start w/ that

16:27 tbaldridge: then i presumably need to run-state-machine to kick it off & get to that point

16:27 ystael: technomancy: I feel like we're still seeing the no-AOT'd-classes-in-uberjars bug in 2.3.1

16:27 ztellman: zilti Raynes: and the code instrumentation, and the connection life-cycle stuff, and ...

16:27 tieTYT: i'd love for you guys to comment on this if you have time: http://programmers.stackexchange.com/questions/208154/everything-is-a-map-am-i-doing-this-right

16:28 Raynes: tieTYT: I've read the title and can objectively say yes.

16:28 ztellman: for the most part, if I created a simple event source and promise abstraction, everything could just sit on that

16:28 Raynes: :p

16:28 tieTYT: Raynes: hah, that's all I wanted to hear :P

16:29 tbaldridge: bbloom: you should be able to use closures, so (gofn [a b] (+ a b)) becomes (fn [a b] (go (+ a b)))

16:29 bbloom: tbaldridge: except in my case, i am cloning the the state machine to make them reusable with *different* parameters each time :-)

16:30 tbaldridge: just gonna add an extra terminal and prefix the state machine with `(let [args# (that-terminal)] …

16:30 tieTYT: stuartsierra: especially you, if you have time. Since it's your talk

16:30 tbaldridge: bbloom: in that case, we'd be looking at USER-IDX stuff

16:30 stuartsierra: tieTYT: eh, what?

16:30 jcromartie: (^^^ This is why I love IRC)

16:30 bbloom: tbaldridge: oh yeah, dur. forgot about that. that's even better

16:30 tieTYT: stuartsierra: http://programmers.stackexchange.com/questions/208154/everything-is-a-map-am-i-doing-this-right

16:30 Raynes: tieTYT: I think this is very nice.

16:31 tieTYT: You can take ideas obtained from FP-focused languages and apply them elsewhere.

16:31 That's what people mean when they say that FP influences how you write code in other languages.

16:31 zilti: Is there no -> equivalent in JavaScript?

16:31 jcromartie: Raynes, tieTYT it's not that easy to do in JS though, without doing lots of deep copying

16:31 bbloom: tbaldridge: oh, well actually that's basically precisely the same thing as adding an extra terminal. i need the terminal so that the machinery will give me a handle to the state array

16:31 jcromartie: which is not always trivial

16:32 tieTYT: jcromartie: you must be focusing on the immutability. I just had to skip that part

16:32 jcromartie: yeah

16:32 tieTYT: and that's part of my question. Did I lose out on everything by skipping that part?

16:32 did I just architect something horrible w/o the immutability?

16:32 tbaldridge: bbloom: yeah, you'll still need terminals

16:32 stuartsierra: tieTYT: It's a trade-off, like everything else.

16:32 jcromartie: well, what's the point of a functional approach if everything is achieved via mutation?

16:33 tieTYT: jcromartie: that's kind of MY question

16:33 jcromartie: tieTYT: yeah I see

16:33 Raynes: tieTYT: Well, you're contradicting yourself a bit.

16:34 tieTYT: i feel like I'm getting all the same benefits mentioned in step 3

16:34 Raynes: how so?

16:34 Raynes: tieTYT: If you're mutating everything, what do you mean by everything takes and returns objects? What's the point of that? If you're just mutating the underlying objects then you're not gaining anything at all afaict.

16:34 I mean, I guess I'd have to see your actual code or something to make actual sense of what you're doing, but I'm very confused by what's going on at this point.

16:35 callen: jcromartie: Common Lispers would object to that sentiment, even if I agree

16:35 jcromartie: I think you can mix it up just fine

16:35 tieTYT: you're right, more often than not the "return" is ceremony more than really necessary

16:36 jcromartie: for a game, mutation is pretty handy

16:36 callen: s/handy/critical/g

16:36 jcromartie: callen: not strictly

16:36 it depends on what you're doing

16:36 callen: anything high churn...

16:36 jcromartie: yes

16:36 physics

16:36 tieTYT: Raynes: so I could do the same thing except no return types ever

16:37 Raynes: so besides that point, I still get all of the benefits afaict

16:37 jcromartie: I think you could have a low-level mutation based engine with highl-evel pure functional AI/logic

16:37 callen: it's pretty common to use const all over the place in games, but it can't be done everywhere.

16:39 tbaldridge: callen: jcromartie: I'm interested in seeing what carmack comes up with in haskeel. In his talk he mentioned that he used monads only for IO, 90% of the rest of his engine was pure functions. I wonder how he did that without trashing the Haskell GC.

16:39 jcromartie: callen: John Carmack and the Unreal guys are advocating functional programming

16:39 tbaldridge: *haskell

16:39 jcromartie: tbaldridge: ah yeah you beat me to it

16:40 bbloom: i'm sure he did just trash the gc, but wolfenstin had few enough objects that it couldn't have been too bad

16:40 jcromartie: Time Sweeny, that's the guy

16:40 s/Time/Tim/

16:41 callen: jcromartie: I know, I've been following TS and JC closely for years

16:41 jcromartie: :) cool, I am just an armchair game dev, wish I did more

16:41 that's what I'm doing now :P

16:43 juhu_chapa: hiredman: Hi! Does java.jmx have a connection pool option?

16:43 hiredman: uh, beats me

16:44 jcromartie: juhu_chapa: I would try #java for that one

16:44 hiredman: my java.jmx repo is a non-active fork of https://github.com/clojure/java.jmx

16:45 tieTYT: stuartsierra: not sure if you're interested in my question or not, but I just wanted to say that was a great talk and it definitely affected the way I think. Thanks for that presentation

16:45 hiredman: oh, and I don't even have a repo for it on github, I just published something to clojars

16:45 juhu_chapa: jcromartie: clojure/java.jmx?

16:45 jcromartie: oh derp, I thought you meant the plain Java JMX

16:45 stuartsierra: tieTYT: Thank you.

16:46 juhu_chapa: jcromartie: Does exist a clojure connection pool manager?

16:46 I mean socket connection pool

16:46 callen: juhu_chapa: clj-bonecp

16:46 er, that's for JDBC, sorry.

16:46 juhu_chapa: :O

16:46 jcromartie: I've always used c3p0 directly

16:46 callen: well you could use bonecp the same way.

16:47 and bonecp is faster >:)

16:47 jcromartie: hm, I'll try bonecp next time

16:48 callen: http://jolbox.com/index.html?page=http://jolbox.com/benchmarks.html

16:49 TimMc: amalloy: Huh, I wonder how many of the Java and Clojure base objects memoize their hashcodes.

16:49 *base classes

16:49 amalloy: TimMc: in this case it was actually Object#hashcode, not any overridden version, so it was looking up a memory address

16:50 TimMc: Oh, I see.

16:50 That's... OK, that's a good sign then!

16:51 technomancy: sooooo

16:52 ztellman: amalloy: https://github.com/ztellman/narrator is going to get a formal release soon, it fixes any of the time skew issues

16:52 also is probably faster

16:52 technomancy: if you have a project that depends on Leiningen's :main-implies-aot behaviour, you'll need to add explicit :aot for 2.3.1

16:53 ystael: technomancy: testing...

16:55 technomancy: awesome, thank you!

16:56 * TimMc sets `:main-implies-aot true`

16:56 TimMc: :-P

16:59 hyPiRion: hah, :monkeypatch-clojure-test, :main-implies-aot, what's next?

16:59 technomancy: we actually already have ^:skip-aot on :main

17:04 TimMc: How about :max-lein-version ?

17:04 technomancy: TimMc: happy to take a pull for that

17:05 justin_smith: I finally figured out the issue with the totally blank nrepl buffer in emacs

17:05 TimMc: Nah, sounds too useful.

17:05 justin_smith: it was slime stuff, I guess I can only have one or the other loaded now

17:05 TimMc: I'll send a PR for :cowsay-compile-errors

17:06 technomancy: TimMc: yes please

17:07 hiredman: I would love to see stacktraces in cowsay

17:08 ystael: one cow with a big speech bubble, or a stack of cows standing on each other's backs?

17:09 hiredman: ystael: obviously configurable via a dynamic binding

17:09 ystael: (binding [*max-cow-stack* Long/MAX_VALUE] ...

17:11 hiredman: maybe this is complected

17:11 clojure.pprint should have a cowsay mode, and then you just need a library that turns exceptions in to data

17:12 hyPiRion: actually, I know that some of my plugins will break in 3.0.0, so it kind of makes sense

17:13 not yet saved in the pom, but that we can fix

17:28 dobry-den: `lein uberjar` on my server creates `target/uberjar+provided/app.jar` and then steps through all the `Including...` steps to produce `target/app-standalone.jar`. But i believe ever since i upgraded leiningen locally, `lein uberjar` locally creates `target/uberjar/app.jar` (not uberjar+provided) and `target/app-standalone.jar` without including any deps.

17:29 jcromartie: what's a better way of doing this: (doseq [[x y] (map identity x-seq y-seq)] …)

17:29 for [1 2 3] [4 5 6] I'm looking for a seq of [[1 4] [2 5] [3 6]]

17:30 dobry-den: i think the way you have it is pretty good and obvious

17:32 technomancy: dobry-den: lein 2.3.1 fixes the target path issues

17:32 jcromartie: oh, that's wrong, no I used (map list ...)

17:32 technomancy: though there's still a caveat around AOT if you haven't set :aot

17:33 jcromartie: this is what I'm using: (defn slices [& seqs] (apply map list seqs))

17:33 would that be better named as "pivot"?

17:33 slices makes sense though

17:33 dobry-den: technomancy: i just have (:gen-class) in myapp.handler. in project.clj i have `:main myapp.handler`. so i need to start using the :aot key?

17:33 technomancy: dobry-den: yeah; hang on I'm in the middle of writing an email about this =)

17:38 bbloom: tbaldridge: what exactly are "persistent" values? closed-over variables?

17:46 technomancy: dobry-den: https://groups.google.com/forum/#!topic/clojure/V7mC8PKq1Kg

18:02 wolfjb: I am trying to read a file which has data like (order-line (quantity 2) (product "foo") (description "descr") (line-number 1)), I have created a record to match (defrecord order-line-type [quantity product description line-number]) and I would like to just "execute" the incoming file. I have created (defn quantity [num] num) so I can call (order-line-type. (quantity 2) ...) but I'm trying to understand how to make that work when I ge

18:02 the file

18:02 when I run (symbol "(quantity 2)") I get the result of (quantity 2) which I would like to execute

18:02 but I'm not having any success

18:03 what am I missing?

18:04 a description of the problem is at https://bitbucket.org/wolfjb/shootout

18:08 supersym: wolfjb: so what are you trying to exec exactly? just read a line of the file or parse back to csv?

18:09 wolfjb: read a line of the file

18:09 eventually, i'll write back the data as csv

18:10 so if I read (quantity 2), I would like to "exec" the quantity method and get the 2 out

18:10 Fer`: wolfjb: if you have a function called quantity you can use eval

18:10 wolfjb: ideally this would work (order-line-type. (read-line) (read-line) (read-line) (read-line))

18:11 or something like that

18:11 Fer`: (eval (read-string "(quantity 2)"))

18:11 wolfjb: Fer`: Ah!!!

18:12 I was trying (eval (read "(quantity 2)")) without success

18:12 supersym: ah ok... right so its tied to some method, that I didnt get yet

18:12 Fer`: wolfjb: read takes an input stream

18:12 a string is not an input string

18:12 wolfjb: I haven't checked in all the code, just updating the readme at the moment, just now trying things in repl to try

18:12 Fer`: stream*

18:13 wolfjb: Fer`: I see.. that make sense

18:13 * wolfjb == n00b

18:13 wolfjb: :-)

18:13 Thanks Fer`

18:13 supersym: right... anyway you can read a file (with-open [r (clojure.java.io/reader "/etc/passwd")] (doall (line-seq r)))

18:14 also destructuring the form in the file might help e.g. (let [a (quote (foo (baz 1) (bar 2))) [b c d :as s] a] [a b c d])

18:14 Fer`: wolfjb: if the format is that then the problem is very simple and you dont need a protocol

18:15 you just need to use clojure's reader which will give you lists and then eval the lists

18:16 wolfjb: Fer`: but wouldn't (quantity 2) fail to evaluate? maybe I'm not understanding you

18:16 Fer`: only if you havent defined the fn quantity

18:16 wolfjb: ok

18:16 Fer`: you just need to define all the functions you need, the format is pretty much already clojure

18:18 bbloom: tbaldridge: holy hell. i have this working!

18:26 swarthy: can anyone tell me what is good/bad about this article? http://fragmental.com.br/2011/08/14/clojure_maps_are_not_the_answer.html

18:29 callen: swarthy: sounds very hypothetical.

18:29 technomancy: swarthy: it's correct that returning nil instead of throwing an exception is not a good default, but that ship has sailed in Clojure IMO. if you try to fight that you're just going against the grain and are going to isolate yourself in a weird sub-dialect of clojure.

18:29 callen: using struct everywhere? just lol.

18:30 swarthy: callen: technomancy: I was just curious about the author's stance sat within the community\idioms. As I stumbled across it while browsing.

18:30 thanks for your input

18:30 Fer`: my programs are mostly maps and functions

18:30 technomancy: if you're concerned about the wrong maps getting passed around I feel like preconditions are a much better solution

18:30 callen: swarthy: the reason for maps, as the article states, is primarily about composability. Identity/class shouldn't really matter in most of your functions.

18:30 dnolen: swarthy: mostly don't agree, though it's true that with larger code bases it can be challenging to know what a map might need to look like.

18:31 technomancy: they will get you errors much closer to the root cause

18:31 callen: I agree on using pre/postconditions.

18:31 asteve: I hate to say it but don't write code that makes absolutely no sense in context

18:31 dnolen: swarthy: there are various shape/scheme libraries floating about, you have preconditions, and Typed Clojure can type heterogenous maps.

18:31 callen: I think you'll write much more reliable code with the educated use of pre/post conditions than you will trying to kill off maps.

18:31 dnolen: s/scheme/schema

18:32 callen: proliferating structs is...misguided.

18:32 dnolen: and structs are deprecated

18:33 asteve: defstruct is deprecated?

18:33 callen: yep

18:33 should be using defrecord/deftype

18:33 asteve: ah, right

18:33 callen: depending on use-case. Probably defrecord most of the time.

18:34 swarthy: So maps the majority of the time defrecord if it is really important seems to be the consensus?

18:34 callen: swarthy: the way I would put it, is that "if you have to ask, just use a map"

18:34 technomancy: inc

18:34 callen: most people coming to need defrecord will know when they need it.

18:35 technomancy: introducing a defrecord that isn't driven by a need for fast polymorphism really bugs me

18:35 callen: ditto.

18:35 it's almost always unnecessary.

18:36 swarthy: Would you mind giving a simple example of that, or is it useful only in the non-trivial?

18:36 callen: it's only useful in a non-trivial, highly performance driven use-case

18:36 swarthy: fair enough

18:36 callen: pretty much only people like ztellman or aphyr have an excuse.

18:37 swarthy: haha, (not-for-newbies defrecord)

18:37 callen: yep.

18:37 swarthy: Thanks for all the input\help.

18:37 callen: swarthy: np

18:37 swarthy: Its hard to know what is of value on the internet.

18:37 jkj: well.. at least for a java programmer like me... my brain seems to want dispatch by type that defrecord and implementing protocols gives

18:37 callen: jkj: don't. your code is cleaner and more reusable if you don't complect your code together more than it needs to be.

18:38 if your code can be simplified to only caring about associative keys and pairs, and the transformation thereof, *do so*

18:38 jkj: resist the urge to pimp thy cdoe

18:38 code*

18:38 jkj: trying to :D

18:39 callen: case in point, Selmer was extremely performance focused and we still didn't use defrecord.

18:39 wasn't worth our time.

18:39 we *did* use protocols, but that was it.

18:40 and even the protocols were arguably not that big of a win.

18:40 jkj: callen: where did you use protocols?

18:41 callen: FunctionNode/TextNode dispatch.

18:41 jkj: callen: deftypes?

18:41 callen: ...no.

18:41 well yes'ish

18:41 h/o

18:42 it was the dispatch we cared about.

18:42 Selmer isn't really a shining example of idiomatic Clojure code.

18:42 it was, as I said, highly performance focused.

18:42 jkj: i used a defmulti for converting getparameters in http://dxsummit.remod.fi/ int query conditions

18:42 callen: relative to other libraries solving the same problem.

18:42 jkj: the query conditions are defrecords

18:42 callen: defmulti is usually better.

18:43 it was deftype and defprotocol, but again, we were concerned primarily with the dispatch.

18:43 dobry-den: What's the best way to refer to files in your resources folder so that your paths still work when you run your app from outside your myapp/ root?

18:43 callen: it was still maps for everything.

18:44 jkj: so the original dispatch by parameter name is used to call the proper constructor... that makes records that e.g. know how to make negative versions of themselves

18:44 callen: dobry-den: actually, Selmer can answer this too.

18:44 jkj: https://github.com/yogthos/Selmer/blob/master/src/selmer/node.clj

18:44 dobry-den: https://github.com/yogthos/Selmer/blob/master/src/selmer/parser.clj#L90-L107

18:45 Fer`: dobry-den: you can use (clojure.io/resource "path")

18:45 which will turn the path into an url that you can use

18:45 clojure.java.io that is

18:46 dobry-den: the file must be in the classpath though

18:46 callen: ours works the same way, classpath.

18:47 Fer`: you can make a resources folder inside your project and that will be inside the classpath

18:48 jkj: any ideas for caching rest api query results?

18:48 http gets are slow

18:49 (get-me-something-from-the-internets-and-cache-it-please "foo")

18:49 jonh: i like it

18:49 kristof: jkj: But how will you invalidate that cache? And name the procedure to do so?

18:49 jkj: kristof: the things i'm after are good for at least 24h or so

18:50 so ttl

18:50 kristof: jkj: It was a reference to the adage about the two hardest things in computer science.

18:50 jkj: kristof: ok :D

18:51 quite true

18:52 Fer`: jkj: a map of query -> time & result inside an atom?

18:53 jkj: Fer`: might work nicely

19:03 callen: a brief note on defrecords, structs, and maps.

19:03 Most Python written by veterans, especially in larger codebases, ends up having a LOT of usage of setattr/getattr.

19:03 This is a glorified hack to work around the rigidity of class instances and to treat them like dictionaries (maps)

19:03 try not to repeat their mistakes.

19:03 clojurebot: No entiendo

19:03 callen: just use maps.

19:06 ztellman: defrecord also acts as implicit schema documentation

19:07 rasmusto: callen: ah, that explains why I was getting confused at my python classes

19:07 ztellman: there are maybe better ways to encode this, but having a Widget defrecord makes it clear what fields/properties a Widget has

19:07 which is valuable, especially in larger codebases

19:07 dobry-den: How come this attempt to grab all files within resources/public/ fails with NullPointerException when run in uberjar but works when run through `lein run server`?: (.getPath (clojure.java.io/resource "public"))

19:09 er i didn't even get to the part of finding all files within `public/` with that code. but that code doesn't work within uberjar

19:10 justin_smith: dobry-den: in a jar, you cannot do File operations

19:11 jkj: callen, ztellman: any examples / docs / war stories / best practices on the issue would be hot. i'm still trying to bend my mind around what kind of polymorphism and multiple dispatch should i do and when not to

19:11 technomancy: if you have an instinct to frame everything in terms of classes the best thing to do would be to stay the hell away from defrecord until you get that sorted out =)

19:11 jkj: i quess reading other people's code would solve this if i just knew where to start

19:13 an example: http://dxsummit.remod.fi/spots?band[]=-vhf <- there are thingies parsed from url query string

19:14 ...that are shown in the UI and also generate SQL queries

19:14 dobry-den: justin_smith: ah, basically i have a jekyll-like system that dynamically renders posts out of `resources/posts/`. when the app starts, i've been looping through the contents of `resource/posts/` and i've been trying to look for a replacement for my now-defunct (.listFiles (File. "resources/posts") code.

19:15 jkj: they are e.g. BandCondition{:value "vhf" :negative true :ranges [[1 2][3 4]]}

19:15 dobry-den: That code works with older Leiningen when the uberjar is run from app root

19:16 callen: jkj: like I already said. If you have to ask, you *do not need it*

19:16 jkj: ended up using defrecords as i wanted to make the protocols explicit

19:16 justin_smith: dobry-den: probably because it actually seeing the file on disk

19:16 callen: jkj: stop trying to pimp out your code and just use maps.

19:16 supersym: :)

19:16 jkj: callen: yup. i just have a problem that i don't know how to not need it :D

19:17 if there is no type, there is no explicit key for multiple dispatch

19:17 well... there is if i make one, but :P

19:17 dobry-den: justin_smith: oh. i guess i don't understand the distinction which explains why i don't yet understand why the uberjar works when run with local relative path rather than absolute path.

19:19 Is there another way to, say, loop through all .markdown files in resources/posts/ and (markdown-to-html %) them on the fly then within a jar?

19:20 jkj: i quess there is no listing files in jars?

19:20 justin_smith: there is a way to open them using java.util.zip.ZipInputStream

19:21 I was just playing with it in a repl to see if I could just hand you a working recipe

19:21 here we go http://stackoverflow.com/questions/5419125/using-java-api-from-clojure-reading-zip-file

19:21 top answer

19:22 dobry-den: justin_smith: thanks, i'll play with that

19:23 jkj: callen: i think i figured out how it could've worked without optimizing prematurely.... it's just that just hard to get to use all the language features in one small code base ;)

19:25 benedikt: http://pastebin.com/RjwNZnZC # can i make (start-threads) return a list of futures (it is nil)? should i use something other than doseq?

19:26 Fer`: benedikt: use for + doall?

19:26 benedikt: Fer`: what is the differense between that and doseq?

19:27 Fer`: doseq is for sideeffects and returns nil

19:27 justin_smith: for returns a sequence, unlike doseq

19:27 Fer`: for returns a lazy seq and has the same semantics as doseq

19:27 benedikt: does doseq always return nil?

19:27 Fer`: yes

19:27 benedikt: i learned about something similar in haskell the other day. but ive forgot what so i'ts a moo point.

19:28 Fer`: doall forces the whole lazy seq to be realized and returns the seq

19:28 benedikt: sounds like what i was looking for

19:32 callen: technomancy: I didn't know you actually favored exceptions over nil for error conditions.

19:33 Fer`: maybe he favors any exception over nullpointerexceptions :P

19:33 technomancy: callen: ocaml is teaching me how terrible nil actually is

19:34 benedikt: Fer`: what happens with the stdout for the futures when usong doall and for? Using println doesn't write to my stdout

19:36 justin_smith: are you sure the futures are being realized?

19:36 benedikt: justin_smith: they start listen on the sockets.

19:36 justin_smith: also, is this in emacs by any chance?

19:37 benedikt: justin_smith: it is :o

19:37 Fer`: benedikt: nothing happens with the stdout. Maybe you should try dereferencing the future to make sure it completes

19:37 justin_smith: sometimes things in emacs that should print to your nrepl window instead print to the stdout of the nrepl process

19:37 that is why I always manually run lein repl and then m-x nrepl rather than jack-in

19:37 to catch that oddness

19:37 Fer`: but if you're sending a bunch of futures that write to stdout that sounds like a bad idea

19:38 benedikt: Fer`: dangit, there it is.

19:38 Fer`: the output will be mixed up at best

19:38 benedikt: i used to do that until i discovered jack-in

19:38 better go back

19:38 justin_smith: meant to highlight you

19:39 justin_smith: I figured it out, thanks

19:49 callen: technomancy: because of option or their support for exceptions?

19:50 technomancy: I don't have a problem with nil as long as there's an explicit or implicit "maybe/option" to the API.

19:50 Clojure's GIGO is effectively an implicit maybe/option, which I'm fine with.

19:51 justin_smith: the difference is that a failure to check for nil cannot be caught until run time, not using a maybe type properly can be caught at build time

19:51 but that is another can of worms

19:51 callen: does core.typed have maybe/option?

19:52 * Fer` hears something related to haskell and runs away in the opposite direction

19:52 callen: justin_smith: you're scaring the muggles, stop it.

19:52 justin_smith: Fer`: ocaml, there's a difference

19:52 callen: the difference is being able to read other peoples' code.

19:52 Fer`: do i need a phd for that too

19:52 callen: no, OCaml is a pretty "lightweight" feeling language.

19:53 Haskell is smashing you in the face over and over with a wifflebat named "Category Theory"

19:54 hyPiRion: In Clojure, you only need to know the difference between simple and easy.

19:55 cmatheson: callen: what is GIGO?

19:55 justin_smith: garbage in garbage out

19:56 callen: I answer that question 3-4 times a week.

19:56 I think I'll outsource it to justin_smith here on out.

19:56 justin_smith: related to pebkac

19:56 problem exists between keyboard and chair

19:56 callen: hyPiRion: lolwut

19:58 hyPiRion: callen: why you! think! category on the other shoe to spell for etc. Haskell, Clojure,

19:58 jmnoz: what do you use to babel-execute scheme code? racket?

19:58 hyPiRion: And other smart words to live by from horse_ebooks and friends

19:58 callen: hyPiRion: I actually really like https://github.com/uncomplicate/fluokitten

19:59 cmatheson: thanks justin_smith

20:01 hyPiRion: I don't mind fluokitten either, but I don't understand the name of the lib

20:01 But at least it's very easy to google, so there's that

20:12 kmicu: flu-o-kitten

20:16 You do not need to understand IO monad to use it and you do not need have a PhD to create let form in clojure.

20:16 http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/

20:16 just sayin'

20:16 kristof: ^

20:16 let's not fight, guys =)

20:17 kmicu: This is not a fight.

20:17 This is simple morphizm.

20:19 kristof: It's a functor!

20:19 Between two categories =)

20:20 kmicu: Functor is so basic, that we shouldn

20:30 Call it extreme if you like, but I propose we hit it hard and hit it fast with a major - and I mean major - leaflet monad campaign.

20:38 jimduey: for monads and more: http://clojure.net

22:18 Foxboron: Is there any twitter or mailing list dedicated to promote new clojure libs?

22:20 `cbp: Foxboron: maybe you could try def newsletter?

22:23 Foxboron: `cbp: actually following the twitter but not signed too the newsletter. Thanks ^^

23:32 callen: Foxboron: Planet clojure has a twitter feed, the official Clojure mailing list has [ANN].

23:32 Foxboron: callen: thanks ^^

Logging service provided by n01se.net