#clojure log - Sep 07 2013

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

0:02 brehaut: uvtc: https://github.com/technomancy/better-defaults/blob/master/better-defaults.el has replaced it i think

0:12 zanes: weavejester: You might enjoy prelude. https://github.com/bbatsov/prelude

0:13 weavejester: zanes: I'll take a look

0:14 zanes: weavejester: Not sure what's stymying you with paredit, but you'd probably at least need to understand hooks and such to get any of these kits set up the way you want.

0:14 weavejester: If I remember, prelude uses smartparens instead of paredit, even for Lisps.

0:15 weavejester: Don't' know what you've tried already, but I would imagine the problem with ESK is with some errant hook that's still hanging around.

0:15 Anyway.

0:16 weavejester: zanes: ESK sets up hooks for lisp modes for paredit. I couldn't figure out a way to disable it without creating my own copy of it.

0:16 zanes: Yikes.

0:17 weavejester: Now I just need to figure out why eldoc isn't working :/

0:17 zanes: ESK was enabling it via some unnamed hook or something? I always felt like that shouldn't even be possible.

0:18 weavejester: zanes: The hook was named, but fixed as (paredit-mode t). Overriding the name didn't seem to work.

0:18 zanes: weavejester: Hum. Can't you just remove-hook?

0:20 weavejester: zanes: Ah, I didn't know about that one.

0:20 I'll try that

0:20 zanes: weavejester: \o/

0:21 weavejester: Although I'm still puzzled as to why eldoc isn't showing up :/

0:21 zanes: weavejester: I'd still recommend prelude as a better base, though.

0:21 weavejester: I'll take a look at it tomorrow

0:21 zanes: weavejester: eldoc-mode is enabled?

0:22 weavejester: zanes: Yep, and it's connected, and auto-complete works fine

0:22 zanes: Alas.

0:25 seabre: Anyone know if this is a good lein template to get started with playing around with clojurescript?: https://github.com/konrad-garus/cljs-kickoff

0:26 timg1: I used that recently and thought it was good, yes

0:27 seabre: sweet

0:27 timg1: I also found this to be pretty helpful if you haven't seen it: https://github.com/magomimmo/modern-cljs

0:30 weavejester: Hm, it looks like nrepl.el is having trouble talking to the nrepl in the latest lein...

0:32 Ahah: https://github.com/clojure-emacs/nrepl.el/issues/356

0:32 Looks like I need to update my emacs

0:34 SegFaultAX: timg1: That project has always confused me. How can you have a "modern" of something that's only 2-3 years old.

0:34 gfredericks: Ping.

0:35 timg1: I know, it's not like there's a ton of antique implementations around

0:35 supersym: current-cljs might be more suitable

0:36 SegFaultAX: supersym: It's all current. ;)

0:36 timg1: So would you say that's a bit more, ah… modern?

0:36 supersym: nah

0:36 seabre: timg1, thanks that's perfect

0:37 supersym: timg1: dang.. I can be slow sometimes.. oh and its late ^^

0:37 SegFaultAX: gfredericks: Just wanted to let you know I really enjoyed your talk. Most of it wasn't new content for me, but it was pretty good all the same. I did appreciate how you wrote out all the macros long hand before showing the how/why of syntax quote.

0:38 timg1: np. I like the kickoff one because it's small, but I liked all the tutorial stuff in the modern-cljs one (though I didn't wind up using domina myself)

0:43 seabre: Haha SegFaultAX, at the rate webdev land moves, 2-3 years is old

1:10 dissipate_: SegFaultAX, which talk?

1:13 amalloy: dissipate_: presumably his introductory macro talk at clojure/west

1:14 zanes: Yeah, SegFaultAX. You can't throw something like that out there without a link. Haha

1:17 seabre: https://github.com/strangeloop/clojurewest2013/tree/master/slides/sessions/Fredericks-Macros

1:17 amalloy: $google gary fredericks macro talk

1:17 lazybot: [Macros: Why, When, and How - InfoQ] http://www.infoq.com/presentations/macros-clojure-west-2013

1:17 amalloy: not that hard to find without a link

1:25 wastrel: i will watch your video

1:25 dissipate_: seabre, ah, i have that one bookmarked

1:26 seabre, unfortunately, there aren't any books on clojure macros

1:31 clj_newb_2345: besides nrepl + paredit, what else should I use for editing clojure in emacs?

1:31 dissipate_: amalloy, where is the advanced talk?

1:40 seabre: dissipate_: I'm pretty sure this is still *the* book on macros: http://www.paulgraham.com/onlisp.html

1:45 dissipate_: seabre, too bad it's not on clojure macros. :(

1:54 seabre: dissipate_: http://blog.fogus.me/2009/01/15/on-lisp-clojure-prolog-pt-1/

2:06 sdegutis: Made it a little better: http://clojuretip.herokuapp.com/

2:09 uvtc: sdegutis, neat.

2:10 sdegutis, might be useful to also provide a link with each tip to the relevant clojuredocs.org page.

2:10 sdegutis: Oh yeah good idea.

2:12 seabre: sdegutis: whoa, where's your HTML doctype?

2:12 sdegutis: seabre: I thought hiccup.core/html gave me one :(

2:12 seabre: nope

2:12 * sdegutis never knows what's automatic and what's not anymore

2:16 seabre: Something like: (html (html5 [...])) should do the trick

2:54 sdegutis: Fixed. Thanks seabre.

2:55 Huh, this looks neat: http://clojuretip.herokuapp.com/line-seq

2:59 vijaykiran: hmm - random isn't too random

3:00 sdegutis: vijaykiran: it changes every 5 sec

3:00 vijaykiran: Ah - I should wait 5 seconds :)

3:00 sdegutis: Well, I mean, you still have to refresh.. I should reword that.

3:00 vijaykiran: yeah, I was waiting for auto-refresh

3:01 johnmn3: aloha

3:01 sdegutis: vijaykiran: I'm not sure if auto-refresh would be a good idea or a bad idea.

3:01 johnmn3: I am attempting to chain a few functions together, which lazily consume a potentially large collection.

3:01 vijaykiran: sdegutis: It'd be bad, IMHO

3:01 seabre: if you do it, give the user a way to turn it off.

3:02 sdegutis: oh neat, http://clojuretip.herokuapp.com/rseq

3:02 johnmn3: for one of the functions, I need to "look ahead" about three elements...

3:02 vijaykiran: seabre: may be "autorefresh" enable disable could be nice

3:02 johnmn3: the way I've constructed it though, it wants to consume the whole collection.

3:02 jack_rabbit: johnmn3, well...

3:02 sdegutis: johnmn3: use lazy-seq and take (or nth)

3:02 johnmn3: How do I lazily consume three elements at a time?

3:03 lazy-seq...

3:03 SegFaultAX: Or perhaps lazy-cat

3:03 seabre: isn't partition lazy?

3:03 vijaykiran: So, who else is on ClojureCup ?

3:04 SegFaultAX: What's that?

3:04 johnmn3: https://www.refheap.com/18420

3:04 sdegutis: ,(nth (repeatedly #(println "hi")) 3)

3:04 clojurebot: hi\nhi\nhi\nhi\n

3:04 seabre: SegFaultAX: http://clojurecup.com/

3:04 vijaykiran: SegFaultAX: http://clojurecup.com .. if your question was directed towards me ..

3:05 SegFaultAX: johnmn3: Try this

3:05 ,(apply = (take 3 (range)))

3:05 clojurebot: false

3:05 SegFaultAX: ,(apply = (take 3 (repeat 1)))

3:05 clojurebot: true

3:05 sdegutis: johnmn3: what is "s" and what should (drop-three-in-a-row s) return?

3:06 SegFaultAX: sdegutis: A seq of some kind, probably.

3:06 seabre: vijaykiran: I'd like to. I even have an idea, but I'm not confident enough in my clojure skills to get enough done in 48 hours.

3:06 johnmn3: it is supposed to eliminated long strings of characters that are the same, with the threshold being 3 in a row

3:07 vijaykiran: seabre: You can always try :)

3:08 johnmn3: the (if (> 4 (count l)) ... is simply to prevent index out of bounds... so it just throws away the last few.

3:08 vijaykiran: seabre: I registered as well .. with a couple of things in my mind .. but I need to work on designs and such

3:08 seabre: btw there's #clojurecup channel

3:08 johnmn3: sdegutis: S is just a collection of things

3:08 sdegutis: johnmn3: ah I see. Hmm interesting problem.

3:09 SegFaultAX: vijaykiran: Neat!

3:09 johnmn3: I was thinking partition, but...

3:09 it has to be a sliding window

3:10 sdegutis: johnmn3: why wouldn't partition work? I don't understand what you mean by sliding window.

3:10 johnmn3: it has to compare three elements each iteration, but iterate by one

3:10 sdegutis: Ah right.

3:10 SegFaultAX: ,(take 4 (parition 3 1 (range)))

3:10 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: parition in this context, compiling:(NO_SOURCE_PATH:0:0)>

3:10 SegFaultAX: ,(take 4 (partition 3 1 (range)))

3:11 clojurebot: ((0 1 2) (1 2 3) (2 3 4) (3 4 5))

3:11 johnmn3: er we are

3:11 sdegutis: SegFaultAX: you could do that but you'd have to remove offending matches from the prev/next tuples too

3:11 SegFaultAX: which gets ugly anyway

3:12 SegFaultAX: sdegutis: Meh

3:12 sdegutis: Oh wait! You could do partition *twice*.

3:12 johnmn3: I think it will work

3:12 SegFaultAX: johnmn3: Why cap it at 3?

3:13 johnmn3: SegFaultAX: it's subjective really.

3:13 sdegutis: So for [1 2 3 4 5] you'd get ((0 1 2) (1 2 3) (2 3 4) (3 4 5)), and then you partition it again to get (((0 1 2) (1 2 3) (2 3 4)) ((1 2 3) (2 3 4) (3 4 5)))

3:13 johnmn3: just trying to make noisy data more noisy

3:14 sdegutis: This way you get to compare ((0 1 2) (1 2 3) (2 3 4)) all at once, and if the middle set is all equal, then filter that whole set-triple out... or something

3:15 Actually no, because then your next set-triple will still have dups. This plan no worky.

3:15 amalloy: johnmn3: you really shouldn't use (> x (count coll)) unless you know coll is counted - it breaks on infinite seqs, and is unnecessarily slow for large, finite sequences

3:15 instead, (nthnext x coll) does the same thing

3:15 johnmn3: amalloy: thanks!

3:16 sdegutis: http://clojuretip.herokuapp.com/nthnext for reference

3:17 ,(dec' 1.5)

3:17 clojurebot: 0.5

3:17 sdegutis: ,(dec 1.5)

3:17 clojurebot: 0.5

3:17 SegFaultAX: ,((fn rle [s] (when (seq s) (let [run (take-while #(= (first s) %) s) c (count run)] (cons [c (first s)] (rle (drop c s)))))) "111111222222333333abccccd")

3:17 clojurebot: ([6 \1] [6 \2] [6 \3] [1 \a] [1 \b] ...)

3:18 SegFaultAX: I meant to make that lazy, but yea. RLE.

3:18 amalloy: &((fn rle [s] (map (juxt count first) (partition-by identity s))) "111111222222333333abccccd")

3:18 lazybot: ⇒ ([6 \1] [6 \2] [6 \3] [1 \a] [1 \b] [4 \c] [1 \d])

3:18 SegFaultAX: Or that.

3:19 Oh yea, partition-by

3:19 Man I love clojure.core

3:19 amalloy: that's a classic rle impl, actually

3:20 SegFaultAX: amalloy: Yea, I didn't think of it.

3:20 Not sure why. :/

3:20 amalloy: the decoder is even simpler: ##((fn rld [s] (mapcat (partial apply repeat) s)) '([6 \1] [6 \2] [6 \3] [1 \a] [1 \b] [4 \c] [1 \d]))

3:20 lazybot: ⇒ (\1 \1 \1 \1 \1 \1 \2 \2 \2 \2 \2 \2 \3 \3 \3 \3 \3 \3 \a \b \c \c \c \c \d)

3:20 amalloy: SegFaultAX: eh. these tricks all look easy when you've already seem them once

3:20 johnmn3: what's rle stand for?

3:20 SegFaultAX: Run-length encode

3:21 It's a standard compression technique

3:21 sdegutis: Reworded http://clojuretip.herokuapp.com/ to make it clearer how randomness is cached.

3:21 SegFaultAX: amalloy: No I've definitely implemented it in terms of partition-by before (thought not juxt).

3:21 johnmn3: ah, k

3:22 SegFaultAX: Though*

3:22 I started mentally from implementing it in Ruby instead of doing it properly in a Clojure mindset.

3:22 amalloy: sdegutis: it's not clear to me why anyone would care about your randomness source?

3:23 sdegutis: amalloy: mainly because people might get confused why clicking random twice in a row isn't changing anything

3:23 amalloy: except that it makes the app way worse IMO: now i can't just pound on refresh until i get something i don't already know

3:23 sdegutis: amalloy: hmm yeah that was annoying to me too.. maybe the cache should be optional or just taken off

3:23 amalloy: off. there's no reason for it at all

3:24 sdegutis: Fixed.

3:25 seabre: sdegutis: That's way better

3:26 sdegutis: Yeah, not sure why I added the caching.

3:26 amalloy: anyway, without the cache it's a neat little toy that will probably help some people. thanks for making it

3:27 sdegutis: thank TimMc

3:27 his idea :)

3:27 kohkane: Hey guys, I was just wondering if there was any way to recursively call an anonymous functions?

3:27 SegFaultAX: kohkane: Y-combinator

3:27 sdegutis: Oh neat, http://clojuretip.herokuapp.com/replace

3:28 SegFaultAX: kohkane: Or just give your thing a name. ;)

3:28 ddellacosta: sometimes my repl just freezes, there is some key command (ctrl-<something>) I'm doing to cause it, but I can't do anything without killing it and restarting the repl

3:28 very frustrating, anyone else experienced this?

3:29 sdegutis: not I

3:29 amalloy: &((fn ! [x] (if (zero? x) 1 (* x (! (dec x))))) 5) ;; kohkane

3:29 lazybot: ⇒ 120

3:29 amalloy: ddellacosta: if you're in emacs, you can C-h C-l to see what keys you just pressed

3:29 ddellacosta: amalloy: yeah, I'm not

3:30 amalloy: I use a repl from outside emacs mostly

3:30 amalloy: although I really need to start using it in emacs. Just haven't bothered yet since this mostly works for me beautifully

3:30 amalloy: so...surely you have readline support, at least, right?

3:31 kohkane: amalloy: Thanks

3:32 amalloy: i'm just trying to rule out the possibility that it's your tty STOP character, ddellacosta (which is C-s in most non-readline instances)

3:32 if it's that, C-q should free it back up

3:33 ddellacosta: amalloy: yeah, I've tried that and it doesn't work--I figured I was doing exactly that and no dice. Ah well, I guess this is the thing that is telling me I really need to get comfortable with emacs repl

3:34 amalloy: if you're already happy with emacs, slime (or i guess nrepl these days, though i still prefer the Old Ways) is so so much better than a standalone repl

3:35 ddellacosta: amalloy: it's really stupid but I haven't bothered yet because I don't know all the key bindings to push stuff to the repl, and I find it really frustrating looking at the repl always at the bottom of the buffer--I'm constantly hitting ctrl-l in my terminal. I'm sure it's just configuration but it's something I'll have to sit down and figure out, and since what I have works quite well, I haven't tried yet. But there are a number of

3:35 reasons I really need to give it a shot.

3:36 I'm going to have to just sit down one of these days and slog through learning everything I need to get productive in emacs + nrepl

3:36 amalloy: ddellacosta: all you really need are C-c C-k, C-M-x, C-c C-z (optional), and C-c M-n (for nrepl; slime uses C-c M-p)

3:37 respectively, those are: eval entire file; eval one form; switch to repl buffer; set repl namespace to current file's namespace

3:38 ddellacosta: amalloy: thank you!

3:38 amalloy: oh, and bind nrepl-jack-in to something; i like C-c j

3:39 ddellacosta: amalloy: alright, now I have no excuses. ;-)

3:40 amalloy: and now that I'm playing with it, really not sure what I was complaining about re: repl being stuck at bottom of buffer…responds to ctrl-l just like any other emacs buffer it would seem.

3:40 huh, maybe it was an older version? dunno

3:41 omg it is really so much better what was I thinking

3:41 amalloy: that was fast!

3:41 * ddellacosta sobs at his own stupidity

3:42 ddellacosta: amalloy: I swear, the last time I tried it it did not work this smoothly for me

3:42 amalloy: now it's just, like, bam

3:42 amalloy: i've tried nrepl a couple times, but i keep going back to swank

3:42 * ddellacosta what is the major difference that brings you back to swank?

3:43 amalloy: mostly i can't stand how nrepl behaves when an exception is thrown

3:43 ddellacosta: whoops, meant that to be a question

3:43 ah, hmm--let me see

3:43 amalloy: there are one or two other minor things, mostly related to keybindings that wouldn't be too hard to fix. i forget, really; just a lack of polish that someone will get around to fixing eventually

3:44 ddellacosta: amalloy: gotcha.

3:44 sdegutis: ,(memfn length)

3:44 clojurebot: #<sandbox$eval31$fn__32 sandbox$eval31$fn__32@5e6f01>

3:44 sdegutis: ,((memfn length) "foo")

3:44 clojurebot: 3

3:44 ddellacosta: amalloy: well, sincerely, thanks for that little push, it was just what I needed. Now I have to get my CLJS flow integrated with this too, which hopefully won't be too hard.

3:45 xeqi was giving me some tips last week or something, and it seems like it shouldn't be hard either

3:45 amalloy: you're on your own with cljs, though. i don't really remember who uses nrepl+cljs

3:46 johnmn3: can flatten work lazily?

3:46 like (take 5 (flatten (stuff large-coll)))

3:46 ddellacosta: amalloy: hmm, how do I get access to the namespace of the directory I'm in? Do I need to connect to a repl session explicitly started up in that dir.?

3:47 SegFaultAX: johnmn3: Why do you need flatten? Using it sometimes indicates that you've done something you shouldn't have.

3:47 Sometimes, not always.

3:48 seabre: johnmn3: I'm pretty certain flatten does not work lazily.

3:48 johnmn3: well, the function I am mapping returns a seq but I need the end result to be in one collection.

3:48 ddellacosta: ah, nevermind

3:48 amalloy: ~flatten

3:48 clojurebot: flatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.

3:48 seabre: johnmn3: http://stackoverflow.com/a/12627760

3:49 johnmn3: got it

3:50 looks like mapcat worked out of the box.

4:38 dobry-den: wow. there's nothing like wrestling with strings for an hour wondering why (get {"cat" "Mittens"} "cat") => nil. until finally deciding to (map int "cat") => [65279 99 97 116]

4:39 i need to find a repl setting that displays every nondisplayable character as a flaming gif.

4:55 callen: dobry-den: lol :)

4:55 dobry-den: happens to the best of us.

5:19 TEttinger: ,(char 65279)

5:19 clojurebot: \?

5:47 roybatty: what's the political channel on #freenode?

5:47 yogothos you're a machine

5:47 TEttinger: roybatty: I'm guessing after not too long, #suicide

5:48 roybatty: TEttinger: are you european?

5:48 TEttinger: no.

5:48 I just think politics discussions on IRC are futile

5:48 roybatty: american?

5:48 TEttinger: and will make you consider the futility of life itself

5:48 yes

5:48 roybatty: futility of life

5:49 that somehow reminds me of my favorite movie Blade Runner

5:49 TEttinger: it reminds me of monty python

5:49 roybatty: you an atheist?

5:49 TEttinger: yes

5:49 roybatty: i'm agnostic

5:50 atheist is a hard hard life

5:50 TEttinger: religion is very hard to talk about on IRC as well

5:50 roybatty: this is clojure...sorry

5:50 TEttinger: my religion is lisp

5:50 language holy wars

5:50 roybatty: my religion is static typing

5:50 TEttinger: crusade!

5:51 roybatty: my religion is syntax

5:51 what am i doing here

5:51 TEttinger: clojure.typed shows up to merge the two, gets crucified

5:51 roybatty: no, no

5:51 no, and another no

5:51 i like static for the tools

5:51 godamn javascript errors

5:51 TEttinger: if you don't know if god exists, how can he damn javascript errors?

5:52 roybatty: fucking jquery let's $("whatever)

5:52 stalin is a loosey goosey javascript asshole

5:52 TEttinger: this is entertaining

5:52 roybatty: i'm not bothering yet?

5:52 ;)

5:52 TEttinger: nope!

5:52 roybatty: cool

5:53 TEttinger: http://dimethyltryptamine.info/ link this when you find a politics channel, see what happens

5:53 roybatty: TEttinger: : you american?

5:53 TEttinger: yes

5:53 roybatty: ahh

5:53 i love semantics, but hate syntax

5:54 i want python syntax and static typing and clojure semantics

5:54 perfect

5:54 then we have perfection

5:54 TEttinger: someone needs to finish salmon. the craziest type system

5:54 roybatty: nobody can read everybody elses clojure

5:54 there's no fucking types

5:55 TEttinger: http://salmonpl.net/docs/features/type_system.html

5:55 there are

5:55 roybatty: and we're told we don't need a fucking debugger

5:55 TEttinger: we have a repl

5:55 roybatty: i can't step through

5:56 no, no, no

5:56 i want a debugger

5:56 i'm not hardcore like you guys

5:56 either are 99.99% of others

5:56 give a brother a break-point and a step

5:56 and a inspect

5:56 there we go

5:56 TEttinger: but yeah, if you want to make a programming language, the salmon type system would be a good thing to copy

5:57 roybatty: shit, if i could just get a breakpoint in counterclockwise just to check things out

5:57 but that's bullshit anyway..

5:57 TEttinger: if I could figue out why light table can't eval a file that would be nice

5:58 roybatty: light table is cool

5:58 downloaded 4.0 or whatever a few days ago

5:58 but it doesn't give us anything we don't already have

5:59 fuck this animation javascript/clojurescript crap

5:59 how does it help us in the field

5:59 i just love the semantics of clojure

5:59 so beautfiul

5:59 no OO, no OO!

6:00 like Milton in Office Space, No salt!, NO Salt!

6:00 danielszmulewicz: What is more idiomatic regarding passing arguments to a function: a map with keys and values or named parameters?

6:01 roybatty: danielszmulewicz: : without types, nobody knows

6:01 TEttinger: danielszmulewicz, I've seen destructuring a lot to get named params from a map

6:01 roybatty: can i pay some kid in Bulgaria to translate clojure to python syntax?

6:02 with gradual typing

6:02 danielszmulewicz: Yes, you can destructure both with just an ampersand difference.

6:03 roybatty: danielszmulewicz: : yeah you think you're cool with your polish last name don't you!

6:03 TEttinger: it is a cool name

6:03 roybatty: how

6:03 just kidding

6:03 messing around ;)

6:03 danielszmulewicz: thanks! As a matter of fact, I don't think about too much

6:03 roybatty: so many consonants

6:04 danielszmulewicz: it's a jewish/polish name

6:04 roybatty: yeah, you're american

6:04 danielszmulewicz: it means "son of samuel"

6:04 roybatty: it's cool, just busting balls

6:04 danielszmulewicz: not american

6:04 roybatty: israel?

6:04 danielszmulewicz: yup

6:05 roybatty: cool bro

6:05 love me a cool israeli brother

6:05 i'm american

6:05 danielszmulewicz: you're a bored american

6:06 :-)

6:06 roybatty: ;waiting for obamacare to lob some cruise missiles

6:06 what a dork

6:06 americans are sick of fighting

6:07 that's a lie

6:07 americans are never sick of fighting

6:07 we're american, it's our nature to fight

6:08 TEttinger: danielszmulewicz, this might be handy http://clojure-doc.org/articles/language/functions.html#extra_arguments_aka_named_parameters

6:08 roybatty: back to clojure

6:08 why does clojure have the best community?

6:08 Rich is a svengali or something

6:10 TEttinger: because clojure is productive and focuses on getting things done, as a language it's pragmatic. also it's really slow, so we were able to steal a bunch of ruby type programmers who were used to slow but wanted more power

6:10 danielszmulewicz: TEttinger: thabks!

6:10 TEttinger: there are caveats to clojure is slow, parts can be fast, but idiomatic clojure is slow

6:12 roybatty: here's the deal

6:12 on hacker news and other places

6:12 clojure is read-only

6:12 Brand0: just like its data

6:13 roybatty: if we had clojure semantics with python syntax and gradual typing it would rule

6:13 and i'll shut up

6:13 because i know that's sacrilegi

6:14 we can't figure things out without types

6:16 TEttinger: roybatty, people do figure plenty out without types, but definitely use type hints and it gets clearer. and faster

6:17 roybatty: TEttinger: : i understand that

6:17 TEttinger: I don't. I have visual studio, C#, and resharper

6:18 TEttinger: roybatty, this IS sacrilege but you can do exactly what you said with racket, by using one of their different syntaxes and type contracts

6:18 roybatty: i let the machine figure out my refactoring for me

6:18 with dynamic i can't

6:18 with resharper its a given

6:18 TEttinger: oh and roybatty, there are some utility libs for racket to get clojure data types I think

6:18 roybatty: with static i'm guaranteed my refactoring is good

6:19 resharper never lies to me:)

6:20 well, most of the time she don't lie

6:20 i love the non-OO of clojure

6:20 which is easy for intellisense

6:20 code-completion

6:22 brothers...but what hacker news people and me always dig down to is that once you get down to s-expression after s-expression you can't read that without machine help or type

6:23 s-expression after s-expression

6:23 not

6:23 not in a team environment, no way

6:24 we need types in the core of the language

6:45 bahh,,

6:46 if you man up

6:46 and lob missiles in

6:46 then man up and put man in

6:49 man up and lob something at Iran

6:49 obama says

6:50 iran is a real war

6:51 real boots on the ground

6:51 sorry clojure, but i know you guys love a little side commentary

6:57 straight outta comptan

9:06 grandy: comments on using sqlite in clojure?

9:24 muhoo: grandy: works, last i tried it. warning: jdbc, though.

9:24 grandy: muhoo: any alternatives you'd recommend?

9:31 anyone have recommendations for similar/better approaches to this: https://clojars.org/validation-clj

9:33 hyPiRion: grandy: perhaps bouncer?

9:33 https://github.com/leonardoborges/bouncer

9:33 grandy: hyPiRion: thanks!

10:21 sdegutis: Why does nrepl-eval-last-expression (in nrepl.el) lately say "Namespace not found." instead of just doing good stuff?

10:21 * sdegutis hates doing "carton update" these days

10:24 sdegutis: Oh, you have to manually do (ns user) in the repl first now.

10:25 grandy: Hello, looking for advice on displaying an incanter chart in a seesaw ui frame ...

10:39 sdegutis: ,(+ 1 2 3)

10:39 clojurebot: 6

11:12 stanislavsobolev: hello guys, can anybody help me with parsing big xlsx file?

11:13 smart man say to me, that i need using Apache POI streaming API, but i cant find any wrapper for that api, all wrapper build on org.apache.poi.xssf.usermodel

11:13 and not on org.apache.poi.xssf.streaming SXSSFWorkbook

11:58 coventry`: sedgutis: C-c M-n to evaluate namespace form in current buffer.

12:21 jjttjj: anyone know how hard it would be to do an emacs plugin that allows quick toggling between html and hiccup, ie so i can edit html files in hiccup then toggle them back? Is it a realistic first emacs lisp project?

12:23 hiccup + paredit, etc totally spoiled me and I can hardly look at normal html anymore

12:44 seangrov`: jjttjj`: That's a pretty sizeable first emacs project

12:44 I'd definitely use it though

12:46 arrdem: jjttjj`: A while ago I built an html -> hiccup reader only to find that someone else had a better one already. I'm sure you could cobble something together using nrepl, a html reader lib and hiccup itself

12:46 jjttjj`: I too would use such a thing heavily

12:50 how would you guys represent "mixin" attributes in data?

12:51 sdegutis: arrdem: assoc?

12:52 arrdem: sdegutis: I'm thinking I'll wind up with a :mixins {}

12:52 sdegutis: arrdem: I don't understand what you're asking for or why.

12:52 arrdem: so I'm trying to describe the models in a table top game

12:52 for the most part they're all the same with a fixed bunch of stats

12:53 but some have "special rules" that apply

12:54 so I'm trying to think of a nice way that I can indicate the involvement of such rules while keeping my data structure JSON serializable

12:54 sdegutis: arrdem: I assume by "model" you're talking about an ORM you're using?

12:54 arrdem: sdegutis: nope, physical model like a chess piece

12:56 sdegutis: arrdem: Why not hierarchical data? They can each include a :stats key.

12:57 arrdem: sdegutis: yeah that's probably the right approach


12:58 ,(= ::cold :cold)

12:58 clojurebot: false

12:59 bbloom: arrdem: ##(prn ::cold :cold)

12:59 lazybot: ⇒ :clojure.core/cold :cold nil

13:00 arrdem: ,(do (in-ns 'arrdem-derpin) (read-string "::cold"))

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

13:00 * arrdem gets his own repl

13:06 sdegutis: ,*ns*

13:06 clojurebot: #<Namespace sandbox>

13:07 arrdem: ,::foo

13:07 clojurebot: :sandbox/foo

13:07 arrdem: ##::foo

13:08 &::foo

13:08 lazybot: ⇒ :clojure.core/foo

13:08 sdegutis: ,(find-var 'clojure.core//)

13:08 clojurebot: #'clojure.core//

13:08 sdegutis: ,(find-var (symbol "clojure.core//"))

13:08 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No such namespace: clojure.core/>

13:08 sdegutis: wat

13:10 Bronsa: sdegutis: that's weird, it works on my repl

13:10 sdegutis: Bronsa: Clojure 1.5.1 ?

13:11 Fails in my repl.

13:11 Bronsa: 1.6.0-SNAPSHOT

13:11 sdegutis: o

13:13 Bronsa: sdegutis: https://github.com/clojure/clojure/commit/88cad2510243289d2bbe28cf8bd14007d9df5fc3#L1L60

13:13 sdegutis: :D

13:14 arrdem: w00t!

13:15 bbloom: Bronsa: that change too waaaayyy too long to show up :-P

13:20 sdegutis: ,(find-var (symbol "clojure.core" "/"))

13:20 clojurebot: #'clojure.core//

13:20 sdegutis: Gud nuff.

13:30 TimMc: ping

13:53 ,..

13:53 clojurebot: #<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/.., compiling:(NO_SOURCE_PATH:0:0)>

13:53 sdegutis: ,.

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

13:53 sdegutis: :(

14:01 llasram: &@#'..

14:01 lazybot: ⇒ #<core$_DOT__DOT_ clojure.core$_DOT__DOT_@159e10c>

14:18 callen: gahhhh unhappy people :(((

14:21 seangrov`: Unhappy people?

14:24 mimmo: QUIT

14:26 callen: seangrov`: trying to catch up on Korma issues/PRs this weekend, some are a little derelict and need dealt with quickly.

14:27 seangrov`: people get (and not without reason) unhappy if contributions languish. I feel bad :|

14:27 konr: Apparently I can't `read-string` some strings, like "\" \\ABC \""

14:28 ,(read-string "\" \\ABC \"")

14:28 clojurebot: #<RuntimeException java.lang.RuntimeException: Unsupported escape character: \A>

14:28 konr: Is there any way around that?

14:28 callen: seangrov`: had a lot of fun last night, thanks for your time and the food/drinks :)

14:29 seangrov`: callen: Same here, very enjoyable.

14:32 sdegutis: konr: what's it supposed to be?

14:36 konr: sdegutis: the string " \ABC "

14:38 brainproxy: https://groups.google.com/forum/#!topic/clojure/KQhMkNl6RDs

14:38 ^ mentioned DevDocs last night in channel; if you're so inclined, go vote for Clojure docs to be ported to it

14:38 details in the gg thread

14:41 sdegutis: konr: ##(read-string "\" \\\\ABC \"")

14:41 lazybot: ⇒ " \\ABC "

14:56 callen: brainproxy: I'm really not a huge fan of community resources, especially documentation, wikis, etc that the community cannot step in an improve themselves.

14:57 We got in the same exact situation with clojuredocs.org, and lo-and-behold, that damnable Rails app is still on Clojure 1.2 and 1.3

14:57 brainproxy: callen: as i noted in the gg thread, i prefer that too

14:57 sdegutis: I wonder if clojuretip could reasonably be extended to be more like clojuredocs

14:58 callen: sdegutis: no.

14:58 sdegutis: callen: why not?

14:58 brainproxy: that being said, i've found devdocs saving me time (and serving as a learning resource) over and over again, so if i had the clojure documentation in the same tool, it would be all the sweeter

14:59 callen: brainproxy: you...could use clojuredocs.org

14:59 brainproxy: callen: have, still do

14:59 sdegutis: callen: stuck on 1.3

14:59 brainproxy: well that

15:00 callen: sdegutis: that's not a complete roadblock for basic Clojure.

15:00 sdegutis: Okay Mr "you can't make it perfect so don't even try at all"

15:01 Starting on http://clojuredocs.herokuapp.com/ now.

15:01 callen: more of a root cause issue.

15:01 sdegutis: Can you elaborate?

15:01 callen: it's not really worth it unless you address it. 5 whys and all that.

15:02 sdegutis: I am so confused in this conversation.

15:02 Let's start over. Hi, my name's Steven.

15:02 brainproxy: lol

15:03 zanes: brainproxy: If you're on a Mac you might like Dash. It seems pretty similar. http://kapeli.com/dash

15:03 brainproxy: Already supports Clojure.

15:03 brainproxy: let me put it this way, if the maintainer ports the clojure docs into it, I'll make good use of that and will be grateful

15:03 callen: zanes: I already pointed it out to him, I don't really know why he didn't take it seriously.

15:04 brainproxy: callen: it's fine, it's neat

15:04 zanes: callen: Ach. Sorry; I missed that.

15:05 callen: zanes: no it's fine, this is from...like last night.

15:05 brainproxy: i like DevDocs, i would like to see clojure's docs available in devdocs, if other's feel the same way, just wanted them to know they may be able to help make it happen

15:05 that's all i'm saying

15:05 and I did bookmark dash

15:05 callen: you'd be able to port them yourself if it was a wiki or dash.

15:05 brainproxy: that is a true statement

15:06 seangrov`: callen sdegutis I might take a stab at an implementation of clojuredocs

15:06 Have it hosted on github and allow updates to it via PR's

15:06 sdegutis: seangrov`: https://github.com/sdegutis/clojuredocs/commit/445d44d4c0b9e2e80823e9c1c32937a343ad3ecd

15:06 callen: seangrov`: I'm a wiki nut, is there a good way to discuss it?

15:07 seangrov`: my problem with clojure-doc was that it was github PRs, I'd really like to see something lower friction like EmacsWiki.

15:07 sdegutis: I think I'll have a decent prototype in about 20 mins.

15:07 callen: so that more people actually contribute.

15:07 sdegutis: Oh yeah, I hadn't thought of the examples part of clojuredocs.

15:08 brainproxy: there's also wikemacs, which is mediawiki based

15:08 not nearly as popular though

15:08 sdegutis: I think it's still doable without being a wiki.

15:08 callen: it's not about being "doable", but rather dealing with the problem more conclusively so that we don't get stuck with something like clojuredocs for multiple years again.

15:08 seangrov`: callen: Yeah, makes sense

15:09 callen: seangrov`: so, my idea is to have a split in the wiki, some parts are semi/fully automatically generated, but then sections underneath the auto-generated bits are open to community editing, including examples and the like.

15:09 from there, it's a wiki, so any of the unprotected pages can be fully modified and you can make new content as you'd expect.

15:09 konr: I have clojurewiki.org. It was overrun by spambots, then I turned it off, but perhaps it's time to ressurect it

15:10 callen: konr: I own clojurewiki.com :P

15:10 seangrov`: hah

15:11 callen: seangrov`: I used to be notorious for complaining about template libraries (until we made Selmer)

15:11 seangrov`: the other leg to that chair of complaining for the last couple years has been the lack of a decent wiki.

15:12 seangrov`: callen: emacswiki has been useful, but it's so incredibly messy and at times incoherent that it took me awhile to figure out how to get value from it

15:12 Inline discussions, etc.

15:13 callen: seangrov`: yeah that's why I was imagining having curated content at the top, contributed and refined content in the middle, and discussion at the bottom.

15:13 seangrov`: I never minded the old-fashioned wiki style because I was weaned on c2 wiki.

15:13 konr: Cliki is pretty well-organized ttp://cliki.net/

15:13 http://cliki.net

15:13 callen: it's pretty good, yeah.

15:15 I'm headed out, bbl - looks like my weekend is spoken for :)

15:15 bbloom: dnolen: I remember you telling me about "nanopass". have you read Sarkar's dissertation?

15:15 dnolen: bbloom: haven't

15:16 bbloom: dnolen: took me a while to find it, since the earlier Dybvig paper dominates the results.

15:17 dnolen: i'll let you know how it is

15:17 dnolen: bbloom: I chatted some with Andy Keep about Chez, not sure if/when the new nanopass version will see the light of day.

15:18 brainproxy: callen: downloaded dash, will play with it

15:19 bbloom: dnolen: i'm interested both for cljs & for another project. this other thing i'm working on has some input tree structure & several different output targets, so it's starting to get pretty unwieldy. hoping to learn some tricks for dealing with the proliferation of traversal & dispatch logic

15:19 dnolen: bbloom: actually, looky here - http://github.com/akeep/nanopass-framework

15:20 bbloom: dnolen: yeah, already got it started :-)

15:20 dnolen: reference [2] was easy to find, but took me a bit to dig up [1]

15:21 dnolen: let me know if you want it

15:23 callen: bbloom: reddit.com/r/scholar ?

15:23 bbloom: s/started/stared/

15:23 callen: didn't know about that. thanks

15:24 dnolen: bbloom: found it thanks

15:24 callen: bbloom: you seemed to need papers on a regular basis, figured it could help you out.

15:24 bbloom: callen: i usually have very good luck w/ scholar.google.com

15:24 callen: always nice to have a fallback though.

15:25 bbloom: yup

15:26 callen: they're stealing our toys: "Okay, managed to get #clojure http-kit server working from #jruby. Rack adapter will be next. Eager to have fastest http server in jruby! ;D"

15:28 sdegutis: brainproxy, seangrov`: thoughts? http://clojuredocs.herokuapp.com/

15:28 bbloom: callen: i don't understand jruby...

15:28 it just seems like a game of kick the can

15:28 callen: bbloom: "lets make libraries thread-safe for a runtime nobody uses while people continue to make thread-unsafe libraries"!

15:28 headius: kick the can?

15:28 bbloom: "oh, your rails app is too slow? rather than factor out components, why don't you just make it less compatible with everything else!"

15:28 callen: bbloom: I think the real reason is you don't have to give up Ruby if you need to use JVM tooling/libraries.

15:28 bbloom: headius: heh, we had this chat on twitter already

15:28 headius: did we?

15:29 brainproxy: sdegutis: what is your goal?

15:30 bbloom: headius: yeah on Jun 24th :-P I won't rehash it here

15:30 headius: did I win?

15:30 bbloom: headius: i think by viewing it as win or lose, you de facto lose :-)

15:30 brainproxy: sdegutis: i like the simplicity of it, btw

15:30 headius: bbloom: or I could be joking

15:31 bbloom: headius: *shrug* ok

15:31 sdegutis: brainproxy: For starters, to be kind of like clojuredocs.org but for Clojure 1.5.1

15:31 headius: I think the point you guys are missing is that some people *like* Ruby, but don't like the C runtime

15:32 bbloom: headius: i quite like Ruby/Rails

15:33 mtp: rails was way too magicky for me

15:33 callen: ditto, but I was a Django user. Might be biased.

15:33 mtp: i lean towards frameworks like Sinatra/dancer/flask :p

15:33 * callen high fives mtp

15:33 bbloom: headius: I just don't think that it's a good move to port large apps to another platform hoping for access to some particular JVM library or marginal performance improvement, at the cost of dramatic ecosystem complexity

15:33 mtp: because i can actually read the code for these things and explain to, e.g., my nontechnical partner{,s}

15:33 whereas rails immediately jumps off the rails into metametaprogramming

15:34 :)

15:34 headius: bbloom: we don't recommend porting large apps either...we recommend starting new apps on JRuby

15:34 bbloom: headius: that makes even less sense to me….

15:34 headius: and the ecosystem complexity is no worse than the nonsense people put up with on C Ruby

15:34 bbloom: headius: sure it is. there are tons of libs that don't work on jruby

15:35 headius: funny thing...there's tons of libs that don't work on MRI

15:35 bbloom: headius: … that are written in ruby for MRI? lol

15:35 headius: I don't think it's a good idea to stay on MRI just for libraries when you have a crap garbage collector, no concurrency, and need to spin up two dozen processes just to run a site

15:36 of course what makes even less sense is you being a clojure fan and not getting why JRuby is a good idea

15:36 the JVM is awesome...unless it's JRuby, which is dumb!

15:37 callen: headius: we get lisp, performance, power, ease of use, and the JVM. #FirstWorldLispProblems ?

15:37 we even get to use our own language on the frontend with the same async concurrency library.

15:38 headius: callen: and JRuby users get ruby, performance, power, ease of use, and the JVM

15:38 bbloom: if GC or concurrency are your issues w/ a ruby app, then you're gonna need to ditch rails & tons of other things that actually make ruby interesting (to me)

15:38 callen: headius: no STM though right?

15:38 mutable semantics, so you're still in the tar pit.

15:38 headius: you can use an STM library...I have a gem for JRuby that exposes clojure's

15:38 bbloom: clojure being on the JVM is probably the least interesting bit for me, btw. i could care less & i use very few java libraries

15:38 callen: headius: I'm not trying to diminish your work, it's just that the trade-offs don't make sense for me. I'd rather make a bigger leap from MRI Ruby if I needed srs-mode JVM than JRuby.

15:39 headius: well, I won't get into the mutability versus immutability argument because that's more religious than anything

15:39 callen: I don't think it really is.

15:39 sdegutis: Cool, this already does most of what I need: http://clojuredocs.herokuapp.com/

15:39 bbloom: callen: lol i was gonna say that, but then realized that we're pretty religious about it :-P

15:39 callen: Clojure offers both, but the better defaults make things like core.async possible.

15:39 headius: I'll believe that immutability is the only answer when everything is implemented immutably down to the metal

15:39 until then, it's always a continuum

15:40 callen: headius: that's like saying because houses are made of wood and concrete, we shouldn't use carpet.

15:40 headius: that's a sibling of the ridiculous turing-completeness false-equality arguments people make.

15:40 bbloom: headius: i think JRuby is a neat piece of tech & i think you've done great work on it. From a scientists point of view: good shit! From an engineers point of view: I don't understand why I'd ever choose to use it

15:41 callen: cars have steering wheels, you don't manipulate the rack-and-pinion with your bare hands.

15:41 headius: my argument is not that we shouldn't hold up immutability as the right way to build concurrent programs...my argument is that saying everything should be immutable all the time is ignoring the fact that you *can't* write everything that way

15:41 callen: headius: I just got done making a point of the fact that Clojure makes mutability *available*, just not the *default*

15:41 bbloom: headius: clojure isn't saying that. in fact it's saying THE OPPOSITE of that

15:41 headius: how is it not the default?

15:41 bbloom: headius: clojure is saying that you need to give deeper thought to *which* things are immutable

15:42 callen: headius: and much of what makes "mutable" semantics usable in Clojure is that the foundation is immutable, enabling STM and trivially thread-safe code.

15:42 bbloom: er i mean which are mutable

15:42 headius: oh, I read that wrong

15:42 sure... and in Ruby immutability is available but not the default

15:42 callen: headius: (def blah (atom {})) (swap! blah assoc :a 1) @blah => {:a 1}

15:42 headius: so where on the continuum is the right place? there is no one place

15:42 bbloom: headius: sure, and i used Hamster.rb a few client projects to great effect

15:42 callen: headius: we only have the STM to express the mutation I just demonstrated because the foundational data structures are immutable

15:42 headius: you are needlessly impoverishing yourself.

15:43 headius: impoverishing myself?

15:43 dnolen: heh, I don't recall this being the Clojure vs. JRuby channel

15:43 callen: you can have the semantics you want, but you can make them more powerful, safer, and more flexible if you use the right, simple foundations for everything.

15:43 headius: dnolen: I didn't start it :-)

15:43 callen: headius: so yes, you are impoverishing yourself. Using mutable foundations and a smattering of immutability on top is eating your corn seed instead of planting it.

15:44 headius: callen: I'm saying there's no one "right" foundation

15:44 callen: I'm not either, but there are better ways than what Ruby does.

15:44 just because we haven't achieved perfection doesn

15:44 headius: I never said there wasn't

15:44 bbloom: I don't wanna argue about whether or not ruby is worthwhile at all

15:44 it's got it's place

15:44 callen: doesn't mean we shouldn't strive to improve things.

15:44 headius: indeed...that's the point of JRuby

15:44 thank you for making it for me :-)

15:45 FWIW, I love clojure's principals and lament the lack of pervasive immutability in Ruby on a daily basis

15:46 what I like about working on JRuby is that I'm helping to build a foundation for future versions of Ruby to make better decisions in that regard

15:46 seabre: Immutability as a default in ruby would be nice.

15:46 callen: headius: but what worries me is that I can't tell if you've noticed the many, many things immutable foundations win you beyond simply being a safer default.

15:46 hyPiRion: I'm not even sure what you guys are discussing.

15:46 headius: callen: I'm aware

15:47 are you saying we should just throw Ruby away because it isn't immutable by default?

15:47 bbloom: headius: I guess it boils down to this for me: If I'm gonna start a new project that needs to be fast/concurrent, then Ruby (be it MRI or JRuby) is not an ideal choice because of weak concurrency support in the language and ecosystem

15:47 headius: as bbloom says...Ruby has its place, and there's a lot you can do in Ruby even with the mutability tarpit

15:48 bbloom: sure, I agree in general... but if you're going to start a new project that needs to fast/concurrent and you want to use Ruby, JRuby would be the better of the two choices

15:48 I'm not trying to make JRuby the best language impl...I'm just trying to make it the best Ruby

15:49 bbloom: headius: If I'm porting an application to a faster host, I expect very-high compatibility with low cost of porting, but I don't get that: I get serious library compatibility issues and dramatically slower startup time (and i view fast startup time as a primary reason to use ruby, which rails kills too)

15:49 headius: being the better of two choices in a sea of 100s of choices seems moot

15:49 particularly when scala & clojure are right next door....

15:49 headius: well...as I said, if you *want* to use Ruby, there's not 100s of choices

15:50 whether Ruby is the right choice in the first place is a debate I won't get into

15:50 bbloom: headius: and as a polyglot, that makes no sense to me :-P

15:50 callen: is JRuby designed to accommodate mono-language programmers?

15:51 sdegutis: headius: "my argument is that saying everything should be immutable all the time is ignoring the fact that you *can't* write everything that way" -- heh, you'd be surprised

15:51 headius: callen: it's designed to accommodate Ruby programmers :-)

15:51 bbloom: sdegutis: heh, i've written some pretty large programs that have ONE atom in them :-P

15:51 callen: sdegutis: the issue isn't can/can't, but rather how awkward certain things can be to express in one semantic model vs. another.

15:52 bbloom: entertaining bit: that one client who's day i saved w/ Hamster (immutable collections in Ruby)…. he had his whole team go watch the Value of Values

15:52 sdegutis: Like I said. You'd be surprised.

15:52 bbloom: lol

15:52 s4muel: headius: You should check out the talks 'simple made easy' and 'the value of values' if you haven't already. Might give you some more perspective, aside from being great talks on programming in general

15:53 headius: yep, I've seen them

15:53 bbloom: headius: sorry to pile it on, you are in hostile territory. for all the nice things about ruby and it's ecosystems, many folks here are refugees :-)

15:53 headius: we do try to learn from other communities here though

15:53 headius: I've also seen clojure evolve to make it possible to do mutable things within controlled contexts

15:53 anyway, I actually have to run, as fun as this is

15:54 callen: can someone email headius those links?

15:54 sdegutis: headius, callen: I'm well aware that mutability is sometimes necessary for either making things work or making them look good or making them work well. I just know from (tons of) experience that it's a lot less necessary than we think.

15:54 bbloom: he says he's seen them

15:55 callen: oh woops/

15:55 sdegutis: The (very) few times you need mutability in Clojure, you already have plenty of ways to use it, without having to resort to a really insane language.

15:55 dnolen: I think headius is pretty familiar with Clojure's value propositions, he's been in this channel for years :)

15:56 callen: dnolen: on to the rubber hose and ski masks then?

15:57 sdegutis: To me, using Ruby instead of Clojure just to solve problems mutably is like trying to stun someone by shooting them on the very edge of their torso with a real gun instead of just using a stun gun.

15:57 Worst analogy ever, I know, but it's the best I can do right now.

15:57 callen: http://martintrojer.github.io/clojure/2013/09/07/retrofitting-the-reloaded-pattern-into-clojure-projects/

15:58 bbloom: callen: i think that core.async offers an interesting alternative to start/stop style lifestyle management objects

15:59 callen: bbloom: the content was relevant to me because that's what I've been wrangling the last week.

15:59 bbloom: (defn run [c] ((init-here) (loop [] (when whatever (recur))) (shutdown-here)))

16:00 sdegutis: Oh wait, why am I writing a dynamic web app when I could just build a static site generator and deploy to github pages? What a crazy person I am.

16:01 bbloom: callen: try a go-loop instead of LifeCycle protocol. you might like it :-)

16:01 basically, you just replace your start with run and your stop with send-shutdown-message

16:02 s4muel: that's an interesting take -- just have a lifecycle controller listening for messages?

16:03 bbloom: s4muel: yeah, basically. think about it. that's how you write collections of processes if you're doing several collaborating C servers, instead of a bunch of java threads

16:04 s4muel: the model works great! you fork/join with go (or thread) and <! (or <!!)

16:04 s4muel: then you don't need a complex stateful object with various states

16:04 s4muel: that's really interesting. Seems like it would work well distributed too

16:05 bbloom: s4muel: see this: https://code.google.com/p/guava-libraries/wiki/ServiceExplained


16:05 the reason for new & terminated are to have state without process: so that's input args and return value

16:06 starting/running/stopping are basically just before/inside/after a message pump

16:06 you've got start, then startAndWait… isn't that just (run-server input) and (<! (run-server input)) ?? :-)

16:07 if you care about the transition from initialization to running, you can just send a message

16:17 s4muel: bbloom: any opinion on core.async vs other similar stream/channel libs? I'm doing event processing and kind of evaluating the landscape

16:18 bbloom: s4muel: we've been discussing this a bunch here in irc, you can go back in the logs & see mentions of core.async w/ me, dnolen, ztellman and a few others

16:18 s4muel: but in short:

16:18 1) write a lot less asynchronous code than you think you have to. just like you need less state with fewer identities than you'd think, you need fewer message pumps / asynchronous devices than you'd think

16:19 2) core.async is not about "streams" as lamina & Rx and others are. Streams are a special case of asynchronous messaging for a use case that, in my recent opinion, is less common than general communicating services. Think long and hard if you've actually got a linear stream or some very one-directional pipeline before choosing a stream library over a more general purpose concurrency library

16:20 s4muel: I'm not concerned about the asynchronicity as much as I am about streams and a stream API

16:20 Yeah.

16:20 bbloom: s4muel: consider instead replacing your entire stream with functionally pure synchronous code bounded on either end by a consumer/producer pair

16:22 s4muel: Well, the general design plan was essentially -- open tcp, stream messages directly to a dispatch handler that are eventually bounded by network output or writing to disk, in is bounded by incoming events rate

16:23 bbloom: (loop [state init-state] (when-let [x (<! in)] (let [[y state*] (pure-function x state)] (>! out y) (recur state*))))

16:23 s4muel: and a bunch of pure stream processing functions in the middle

16:23 bbloom: stream processing is inherently impure unless you memoize, which is what lazy sequences basically do

16:23 purity requires that you can ask the same question tiwce and be sure you'll get the same answer

16:23 purity requires that you can back up and try again and be sure that your two branches will be consistent

16:24 streams offer neither

16:27 s4muel: Hrm, what I meant here was stuff like tokenizing input. I can guarantee that the same input will be tokenized to the same output, or that given a message certain fields would be added, etc

16:28 bbloom: s4muel: sure, use lazy-seqs

16:29 s4muel: Not necessarily manipulating the stream primitives like split this stream X into X->Y X->Z. I get what you're saying here in that it's impure because it's not the result of a computation, it's a side effect like 'create another lightweight process'. I think that's what you're saying.

16:41 yedi: so i want to see if a string ends with either .png .gif .jpg... + more defined extensions. What would be an idiomatic way in clojure to test this

16:41 s/test/do . I know there's the .endswith fn

16:42 bbloom: yedi: just stick the extensions in to a set, then strip off a string with a regex & test set membership

16:43 dissipate_: the lack of in depth literature on clojure macros is really bad

16:43 arrdem: yedi: yep, just take the match of something like #".*(\.\w+)" and follow bbloom's advice

16:44 dissipate_: something in particular you're looking for?

16:46 dissipate_: arrdem, a comprehensive book on clojure macros. everyone just keeps referring me to Paul Graham's books on common lisp

16:46 bbloom: dissipate_: that's b/c pg's books on common lisp are excellent & cover macros in extreme depth

16:46 turbopape: I really love intellij IDEA for doing clojure. How come I didn't try it sooner ?

16:46 Litterally fell in love. And it is open source (for the community edition)

16:47 bbloom: dissipate_: the biggest differences between clojure's macros and common lisps will be *mega easy* to understand, if you can understand pg's stuff

16:47 dissipate_: bbloom, but CL macros are not clojure macros, especially because clojure macros deal with the JVM

16:47 bbloom: dissipate_: what does the JVM have to do with clojure's macro system?

16:47 arrdem: dissipate_: not really...

16:48 dissipate_: the scope semantics and code generation that PG shows off totally works

16:48 dissipate_: bbloom, watch this talk and find out: http://www.infoq.com/presentations/Clojure-Macros

16:48 arrdem: dissipate_: it's just the exact notation for macros that differ

16:49 dissipate_: arrdem, are you saying a book on clojure macros would be worthless?

16:49 bbloom: dissipate_: i don't need to watch that. I understand Clojure's macro system quite deeply.

16:49 dissipate_: He's saying that the book would basically be On Lisp with an extra chapter :-P

16:49 arrdem: bbloom: yerp and a few syntax changes

16:50 dissipate_: once you grock the idea of code writing code through AST transforms everything else kinda falls away....

16:50 dissipate_: the fact that i have to read a book on another language. that's sad

16:50 arrdem: what part of lisp as a language _familly_ are you missing here?

16:51 dissipate_: arrdem, i want to study clojure, not old lisps

16:52 bbloom: dissipate_: That's like saying "Why are there no books on algorithms in Python?!?!? I want to study python, not algorithmic pseudo code"

16:52 coventry`: dissipate_: I think the CL-specific parts of On Lisp would be near-trivial to absorb if you know clojure well. I read On Lisp knowing only emacs lisp, and found those sections very accessible.

16:53 sdegutis: I've been thinking of having a ClojureDocs clone that would generate static doc pages via Clojure. It would be hosted on github and where examples/see-also's are added via pull requests.

16:53 bbloom: dissipate_: numerous knowledgable people have recommended a particular resource to you, but you write them off & call the community "sad". We've done our part...

16:53 sdegutis: Thoughts?

16:53 dissipate_: bbloom, there are books on algorithms in python

16:54 arrdem: dissipate_: sure, and they add _nothing_ to the original papers or pick your algo textbook in any other language.

16:54 bbloom: dissipate_: *sigh* forrest => trees

16:54 coventry`: sdegutis: What's the licence on the existing clojuredocs examples? Can you rip them off? It is the examples which really make clojuredocs valuable. Otherwise, might as well read the source.

16:55 sdegutis: coventry`: yeah that was my plan.. didn't check the license

16:55 coventry`: new examples would be added via pull-requests though

16:55 dissipate_: arrdem, actually, there are idioms in languages that significantly impact how algorithms are expressed in those languages

16:55 bbloom: dissipate_: yeah, making it HARDER to learn the algorithms

16:56 arrdem: (inc bbloom)

16:56 lazybot: ⇒ 15

16:56 yedi: bbloom: how would I go about stripping up until the final "." with regexes? (I know how i'd do it without them, but I'm tryna wrap my head around working regex in clojure)

16:56 bbloom: dissipate_: learning macros in clojure actually obscures some of the complexities of variable capture b/c clojure has facilities/idioms to minimize the impact of such problems. Learning macros in common lisp is actually easier to get started.

16:56 dissipate_: bbloom, your claim is that macros are independent of language implementation?

16:57 bbloom: dissipate_: my claim is that there are underlying ideas that can be understood in any language and PG covers them very well…. in common lisp

16:57 coventry`: sdegutis: Looks like they make it easy to pull the examples out: https://github.com/zk/clojuredocs/downloads

16:57 bbloom: dissipate_: you wouldn't repaint the sistine chapel because you don't like the color of the front door

16:57 arrdem: yedi: (re-find #".*(\.\w+)" "foo.bar.baz")

16:58 dissipate_: bbloom, BTW, the talk i linked you to specifically mentions an issue the JVM causes with macros, namely limits on the number of arguments to java methods.

16:58 yedi: &(re-find #".*(\.\w+)" "foo.bar.baz")

16:58 lazybot: ⇒ ["foo.bar.baz" ".baz"]

16:58 arrdem: yedi: the .* matches the entire string lazily, and the (\.\w+) group matches the _last_ dot in the string and all trailing word characters

16:59 bbloom: dissipate_: again, that's missing the forest for the trees. I could have the same limitation in a particular common lisp implementation. Nevermind the fact that I've never experienced that problem in practice & i've written A LOT of macros

17:00 dissipate_: bbloom, well, maybe you should watch the talk and see the example.

17:00 coventry`: You can find translations into clojure of most of PG's early macros, anyway, if you google "on-lisp clojure."

17:01 bbloom: dissipate_: I don't need to. I know precisely what you're referring to

17:02 dissipate_: coventry`, how many people trying to learn clojure are going to google common lisp?

17:02 arrdem: dissipate_: anyone who takes our advice, which you seem unwilling to do

17:02 dissipate_: i know i haven't

17:02 bbloom: dissipate_: how many people trying to learn macros are gonna google macros?

17:03 * bbloom gives up

17:03 dissipate_: arrdem, i will take your advice

17:04 but only begrudgingly. now i have to buy another book that isn't even on clojure.

17:04 bbloom: On Lisp is free

17:04 http://www.paulgraham.com/onlisp.html

17:04 * arrdem snickers

17:04 bbloom: dissipate_: if you bothered to look at all, you'd have discovered that

17:04 coventry`: The bandwidth is a killer, though.

17:04 sdegutis: bbloom: I've had a heard time swallowing the "it's never been a problem for me in practice" argument ever since I tried Go and realized they don't/won't have filter/map/reduce/etc.

17:05 bbloom: sdegutis: the issue he's referring to is that clojure has a max EXPLICIT argument limit

17:05 sdegutis: LOL

17:05 bbloom: sdegutis: in practice, it's not an issue b/c you can use apply, which works with extremely large lazy sequences

17:05 arrdem: sdegutis: THANK YOU

17:05 bbloom: sdegutis: it can SOMETIMES be an issue in macros if you are generating a very long list

17:05 sdegutis: but you can trivially replace `(f ~@args) with `(apply f [~@args])

17:06 sdegutis: but I've never written such a macro that would need such craziness :-P

17:07 technomancy: sdegutis: why doesn't Go have map/reduce?

17:08 dissipate_: arrdem, are you saying i can start reading 'on lisp' after learning clojure? seems like i would probably have to read an intro book on common lisp first

17:08 sdegutis: technomancy: "just use a for loop"

17:09 technomancy: sdegutis: I... but...

17:09 seabre: even php has map/reduce

17:09 technomancy: sdegutis: does it have lambda?

17:09 arrdem: seabre: now there's damning with faint praise

17:09 bbloom: dissipate_: page V, "Preface", first four words: "This book is intended for"

17:09 sdegutis: technomancy: a type-strict one

17:09 seabre: AND closures

17:10 technomancy: sdegutis: because of no generics? or are generics just for collections?

17:10 sdegutis: technomancy: no generics

17:10 bbloom: technomancy: Go has this weird relationship w/ higher order functions

17:10 sdegutis: technomancy: "in practice I've never missed them"

17:10 coventry`: dissipate_: Speaking as someone who read it without knowing common lisp, I can say with a fair degree of confidence that basic understanding of clojure will be enough. On Lisp explicitly tries to give a self-contained treatment of Common Lisp.

17:11 dissipate_: bbloom, how do you know he isn't implying "common lisp" when he says "lisp"?

17:11 sdegutis: technomancy: half this page is dedicated to mutual-back-slapping on being okay without generics: http://golang.cat-v.org/quotes

17:11 Ignore the quote with my name in it, that was ages ago. I'm a better man now.

17:11 technomancy: sdegutis: "if I keep telling myself everything is OK, eventually I'll believe it"

17:11 bbloom: dissipate_: because I've read the fucking book and I'm telling you, as an expert in both macros and the implementation of Clojure, it's a good book from which you will learn a lot about all sorts of lisps and macros

17:12 technomancy: out of curiosity, are generics specific to collections, or is that just a java-ism?

17:13 (or is it not even a java-ism? I don't know java)

17:13 bbloom: technomancy: sdegutis: the bigger thing is that side effects and higher order operations don't mix. so the fact that you'd have a Map function would make you try to send or receive a message in there & that would be bad

17:13 sdegutis: technomancy: I don't think it's specific to collections. You can have a custom type that has an instance variable of a given type.

17:13 bbloom: Go is a systems language by default & a logic language only by necessity

17:13 which is the opposite of Clojure & core.async :-P

17:13 sdegutis: :)

17:13 technomancy: so like type variables in OCaml would be a kind of generics?

17:13 sdegutis: technomancy: wait, hold on now, am I being trololololed?

17:14 http://trololololololololololo.com/

17:14 technomancy: sdegutis: I am a type noob

17:14 three weeks in

17:14 bbloom: technomancy: lol

17:14 * sdegutis fell for it

17:14 arrdem: (inc sdegutis)

17:14 lazybot: ⇒ 5

17:14 sdegutis: Oh sweet, this nick must be lucky, I have way more karma than when I was futile.

17:14 $karma futile

17:14 lazybot: futile has karma 2.

17:15 technomancy: the "I like that Go forces you to clean up little messes" guy is a co-worker =\

17:15 sdegutis: Heroku's got all kinds.

17:16 dissipate_: i haven't heard of any theoretical language breakthroughs in Go. if it's a better C++, then more power to it.

17:16 bbloom: technomancy: is that the comment about unused variables?

17:16 technomancy: bbloom: yeah

17:17 sdegutis: Oh man. I *hate* that feature.

17:17 bbloom: technomancy: reminds me of some build failures I've seen where my java import statements weren't in alphabetical order

17:17 sdegutis: One of the most annoying aspects of Go.

17:17 dissipate_: bbloom, why not use haskell as a systems language?

17:17 bbloom: dissipate_: OK, at this point I'm quite certain you're a troll

17:17 sdegutis: dissipate_: why not use C?

17:17 arrdem: sdegutis: bbloom[-1]

17:18 sdegutis: arrdem: undefined symbol bbloom

17:19 dissipate_: bbloom, who isn't using google now? http://book.realworldhaskell.org/read/systems-programming-in-haskell.html

17:20 arrdem: sdegutis: I'm failing to come up with an idiomatic fetch of "bbloom" from "#clojure" referencing send -1 :/

17:20 bbloom: dissipate_: Oh, Hey, Haskell has an FFI. I didn't know! This changes everyting!

17:20 * bbloom apologies, he's acting like callen

17:20 bbloom: s/apologies/apologizes/

17:20 Raynes: Let's call out everyone all at once! That'll go over well!

17:21 Also, that's not like callen.

17:21 callen isn't into passive aggression and sarcasm.

17:23 dissipate_: sdegutis, C isn't expressive

17:23 Mendor|scr: newbie's question: what is the difference between 'binding' and 'let'? They looks like doing same things

17:24 bbloom: Mendor|scr: binding=dynamic, let=lexical

17:24 Mendor|scr: let assigns values to names in a particular space, where as binding assigns values to names for a span of time

17:25 Mendor|scr: bbloom: thank you

17:25 arrdem: dissipate_: I beg to differ, have you checked out libchello?

17:26 * arrdem appologizes for feeding the troll

17:26 dissipate_: arrdem, no, looks interesting though.

17:26 arrdem, can you give any good reason not to do systems programming in haskell?

17:27 arrdem: dissipate_: the rest of my embedded OS team would crucify me?

17:27 dissipate_: I would have to port 4.1M lines of C to Haskell?

17:28 dissipate_: I would have to deal with Haskell?

17:28 dissipate_: arrdem, and would you not have to do the same with Go?

17:34 Raynes: arrdem: You just got LOGIC'D

17:35 arrdem: Raynes: I just got asked about a language I don't write... my language learning latency is being incurred on the answer

17:42 coventry`: It seems that the :reload keyword to (require) causes reloading of all namespaces. If I just want one namespace reloaded, should I do that in a separate require?

17:44 (causes reloading of all (require)d namespaces, that is.)

17:44 sdegutis: dissipate_: C is perfectly expressive

17:44 dissipate_: sdegutis, you mean compared to asm?

17:45 sdegutis: dissipate_: you just need to learn how to express yourself in C first, that's all

17:45 hyPiRion: Swearjure is perfectly expressive too. It's turing complete and all that.

17:45 arrdem: Raynes: ^ dat logic yo

17:45 amalloy: arrdem: language learning latency combined with haskell reminds me of http://ro-che.info/ccc/11.html

17:46 arrdem: (inc amalloy) ;; day made

17:46 lazybot: ⇒ 71

17:47 dissipate_: sdegutis, i did embedded linux development in C for a short while. wasn't expressive enough for me.

17:47 benkay: ,(+ 1 2)

17:47 clojurebot: 3

17:47 bbloom: amalloy: nice.

17:48 amalloy: bbloom: credit goes to brehaut (i think?), who's linked http://ro-che.info/ccc/12.html a few times

17:48 bbloom: amalloy: i also enjoy the first/prev/current/next/last navigators

17:48 sdegutis: ,(defmacro with-all-due-respect [& body] `(binding [*in* (java.io.StringReader. "")] ~@body))

17:48 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

17:48 sdegutis: ##(defmacro with-all-due-respect [& body] `(binding [*in* (java.io.StringReader. "")] ~@body))

17:48 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

17:49 sdegutis: Meh, gud nuff.

17:49 dissipate_: amalloy, the funny thing about that comic is: who is hiring for haskell positions in the first place? :P

17:51 arrdem: http://ro-che.info/ccc/20.html

17:51 * arrdem gives up

17:51 bbloom: arrdem: zing.

17:53 sdegutis: ouch, http://ro-che.info/ccc/17.html

17:53 Do not want.

17:53 bbloom: sdegutis: I think 9/10 of the people in that little red/green section are in this room :-P

17:54 sdegutis: But.. but.. Clojure is dynamically typed!

17:54 bbloom: sdegutis: but people in this room understand type theory!

17:54 sdegutis: Oh.

17:55 hyPiRion: I don't believe in the type theory. It's just a theory, it's not proven or anything.

17:56 Hm, I wonder if such arguments would actually work in IT?

17:56 sdegutis: Just like set theory!

17:57 Anyway I really liked that with-all-due-respect joke.

17:57 I should make a website for it.

18:03 wink: I think the diagram is off a little

18:03 I've hardly seen any mathematicians argue for typing in programming :P

18:04 so the blue/red crossover should be smaller imho

18:05 then again I think I read that blog post linked on the bottom already

18:07 bbloom: wink: we just discussed that article in here yesterday

18:07 wink: bbloom: I missed that, I meant.. a lot earlier, maybe 2011 :)

18:09 sdegutis: Can anyone recommend Java Swing (O'Reilly) vs The Definitive Guide to Java Swing (Apress)?

18:19 * devn wakes up to find random characters entered into practically every open app with a text field filled with random characters.

18:20 sdegutis: Oh never mind, JavaFX seems to be the new hotness.

18:20 arrdem: devn: sleeping on your keyboard is awesome, isn't it?

18:20 * devn walks over to printer and finds 17 pages of a crappy arstechnica article

18:20 * devn glares at his cat

18:23 llasram: arrdem: devn's cat apparently thinks so

18:23 devn: We've all been there (where "all" is cat-owners)

18:23 arrdem: llasram: that or the above cat has learned C-p in which case I'm impressed

18:24 devn: i was impressed too

18:24 it was kind of amazing how many apps had text in them

18:24 i started looking through my terminal windows filled with random text to make sure she didn't commit some code and git push

18:25 moving through those tab windows requires Cmd + {

18:25 i feel like she's learning how this machine works

18:25 * arrdem doesn't know what to make of a cat git-committing

18:28 wink: devn: I can only suggest xmonad, changing windows is not so easy anymore

18:29 devn: M-j?

18:29 wink: well, it's only one workspace. so Super-0-9 and then Super-jk yes

18:29 devn: sure, but then i get back and see 200 spawned terminals

18:30 all with scary text in them

18:30 S-RET * 1000000000

18:30 arrdem: devn: in one lurks an `rm -rf /`

18:32 gfredericks: does anybody have opinions about enhancing pre/post conditions to allow an error msg in the metadata?

18:32 sinistersnare: do you guys know if asm.js is a viable backend for cljs? i know that asm.js is basically statically typed, so maybe it should be for core.typed clojurescript

18:32 arrdem: gfredericks: please elaborate

18:32 bbloom: sinistersnare: how familiar with asm.js are you?

18:32 sinistersnare: none! im just curious :p

18:33 bbloom: sinistersnare: you should go read up on it. the spec is like a 1 pager, then you'll probably have a much different question :-)

18:33 sinistersnare: :D ok ill see then

18:33 gfredericks: arrdem: I often want to use pre/post conditions but the fact that the resulting error message is likely unhelpful compels me to not use them or do a manual assert in the function body

18:33 sinistersnare: http://asmjs.org/spec/latest/ 1 page? o.O

18:34 gfredericks: arrdem: so if I could (fn [a] {:pre [^{:msg "arg to this fn must be positive"} (pos? a)]} ...)

18:34 then I would use them a lot more often

18:34 bbloom: sinistersnare: it seams to have grown :-) h/o 1 sec

18:34 gfredericks: and obviously anything along those lines is fully backwards compatible

18:34 another option is a vector pair

18:34 arrdem: gfredericks: yerp by dint of abusing reader metadata

18:34 gfredericks: which is technically backward-breaking but not for significant things

18:34 sinistersnare: i think i realize that its for more unsafe langauges, and is supposed to be c/c++ like, but isnt it very efficient, therefore a good idea? idk...

18:35 bbloom: sinistersnare: http://ejohn.org/blog/asmjs-javascript-compile-target/ is a decent intro

18:35 gfredericks: arrdem: what is the principle of reader metadata usage by which that is an abuse?

18:35 bbloom: sinistersnare: in short, it's more like C with bad syntax

18:35 sinistersnare: we'd have to write a VM too

18:35 sinistersnare: you basically just get arrays of integers & can use other integers as pointers

18:35 arrdem: gfredericks: it's not an abuse at all... but that's a cute way to sneak in the string.

18:35 sinistersnare: oh ok, so its not as viable as just changing the compile target?

18:36 arrdem: gfredericks: it's been too long since I've used :pre and :post to comment but in theory I'm a fan

18:36 gfredericks: arrdem: does [(pos? a) "a must be positive"] seem cleaner?

18:36 * arrdem wanders off to mess with preconditions

18:36 sinistersnare: i mean thats a task in itself, but not just comforming to it? im just confused i guess

18:36 SegFaultAX: gfredericks: Did you get my note from earlier?

18:36 gfredericks: SegFaultAX: prolly not lemme look

18:36 bbloom: sinistersnare: like i said, you should go read up on asm.js & then it will be much clearer. it's probably not what you think it is

18:37 SegFaultAX: gfredericks: Oh I just was letting you know that I really enjoyed your talk. Most of it was not new content for me, but one thing I really appreciated was how you wrote out all the macros longhand before introducing the awesomeness of syntax quote.

18:37 gfredericks: SegFaultAX: oh cool -- thanks for the feedback

18:37 sinistersnare: true, i figured there was a miscommunication somewhere; i knew it wouldnt be some end all be all superfast javascript. thanks :)

18:37 bbloom: sinistersnare: there is no garbage collection, or object system, or anything like that. it's literally just byte buffers

18:37 sinistersnare: ok that makes more sense

18:37 coventry`: gfredericks, SegFaultAX: I skimmed through it today. It was good.

18:37 gfredericks: SegFaultAX: yeah I feel like macros and syntax-quote are both manageable independently, but if you do them at the same time the odds are against you

18:38 SegFaultAX: gfredericks: Totally. I think the biggest hurdle for most people (from my experience) is getting your head around the fact that you can do things at compile time.

18:38 irctc: I'm a newbie and just started studying books (clojure in Action and Prog Clojure). Both books does not use ^{ dynamic : true } in their samples but samples does not work. I have to put that declaration for defn to make them work for binding. Do anyone knows why those books fail to mention this or am I making a mistake. Thanks.

18:39 gfredericks: SegFaultAX: yeah separating the times is a big mental leap

18:39 yedi: when using elastisch, is there a way to see the query json that esd/search sense to the ES api?

18:39 SegFaultAX: Most of the time that's a closed phase, the compiler is a black box until run time.

18:39 gfredericks: SegFaultAX: but if you talk about it that way it sounds as if it can only be terribly hard; not that you're just writing regular code and dealing with familiar data

18:39 SegFaultAX: gfredericks: Second biggest hurdle is the idea of processing unevaluated lisp forms. There just isn't really anything like it in languages that don't support proper first class macros.

18:39 llasram: irctc: That was a change in... Clojure 1.3? Before then all vars were dynamic. So probably older books

18:40 gfredericks: SegFaultAX: yeah that's why I spent so much time up front playing with quote and eval

18:40 arrdem: gfredericks: ah ok just re-read fogus's pre/post post and my old code

18:40 SegFaultAX: gfredericks: The whole "code is just data" thing is a huge hurdle for some.

18:40 arrdem: gfredericks: I like what you're doing in that second one

18:40 ,(true? "foo")

18:40 clojurebot: false

18:40 SegFaultAX: gfredericks: Anyway, great work. I look forward to your future talks. :)

18:40 gfredericks: arrdem: it's technically breaking but you wouldn't have used a vector like that anyhow since it's trivially truthy

18:40 irctc: I see. So I should be typing that each time, right? Do you do that for that purpose?

18:40 gfredericks: SegFaultAX: the swearjure talk comes out in a month or two or something

18:41 coventry`: gfredericks: Loved the ->> quarter-quine.

18:41 gfredericks: coventry`: ha, I think that was due to TimMc

18:41 SegFaultAX: gfredericks: Oh that ought to be interesting.

18:41 llasram: irctc: Each time you want to use `binding` to change value of a var, yes. But those times should be pretty close to "never" in practice

18:41 gfredericks: coventry`: also fixed in 1.6

18:42 dissipate_: gfredericks, asm.js, another ridiculous project spawned from the fact that browsers should run bytecode, not javascript.

18:42 SegFaultAX: dissipate_: Haven't you heard? Javascript is the bytecode of the internet!

18:42 * SegFaultAX ducks

18:43 gfredericks: JavaScript is the node.js of the internet

18:43 arrdem: gfredericks: wat

18:43 gfredericks: the wagon wheel was the internet of the 19th century

18:43 * gfredericks has degenerated into nonsense

18:44 arrdem: gfredericks: is that change really breaking?

18:44 gfredericks: I'm playing with fogus's demo and haven't smashed 1.5.1 yet...

18:44 gfredericks: arrdem: sure; (fn [a] {:pre [[false "foo"]]} a)

18:45 dissipate_: SegFaultAX, i know it is. why not just have browsers run byte code so you could compile from any language X to that bytecode and not have to go through JS?

18:45 gfredericks: arrdem: ^ always succeeds in current code, always fails in my proposed version

18:45 irctc: llasram: I understand that dynamic binding can make the code a hairball easily if not used sparingly, however within the context of writing scaffolding code like test it makes sense to use dynamic. It is just weird to have to type that when I need it. Is there a special "declare" to do that so that my test code utilize this behaviour. Probably this is not how the "professionals" are doing it.

18:45 arrdem: gfredericks: I don't follow why that will always bomb for you.

18:46 gfredericks: that it succeeds currently is trivial

18:46 llasram: irctc: Oh, for tests etc just use `with-redefs`. That changes the root binding of vars within the dynamic scope of the `with-redefs`.

18:46 gfredericks: arrdem: because the left half of the pair is always falsy

18:46 that it fails in my version (as it should) is also trivial

18:47 arrdem: gfredericks: ah so you are proposing to unpack vector pairs into [pred msg]

18:47 gfredericks: arrdem: yes exactly

18:47 arrdem: s/into/of the form/

18:47 llasram: irctc: (without requiring the var to be dynamically thread-locally re-bindable)

18:47 gfredericks: arrdem: which doesn't "abuse" metadata but is technically (though not importantly) breaking

18:48 arrdem: gfredericks: could one not also write [(number? x) "x must be a number" true "how did that fail"]

18:48 gfredericks: that would seem to fit more with the let semantics

18:49 dissipate_: "What is the goal of Asm.js? Who do you see as the target audience for the project? Our goal is to make the open web a compelling virtual machine, a target for compiling other languages and platforms.

18:49 arrdem: gfredericks: but would also be breaking.... hum...

18:49 dissipate_: hilarious. absolutely hilarious.

18:50 arrdem: gfredericks: ok. I agree with your metadata approach as the best implementation but I hold that the optional trailing string would be nicer to read.

18:51 irctc: llasram: I changed the code to use with-redefs instead of binding, it worked like a charm. Thanks.

18:51 llasram: irctc: np!

18:52 gfredericks: arrdem: I'm gonna send an email to clojure-dev

18:52 arrdem: thanks for feedback

18:53 arrdem: gfredericks: np. who do I need to bug to get verified as a list subscriber?

18:54 bbloom: I use my Windows VM like once every 2 months, but somehow everytime, Windows seems to degrade…. this time, after about 3 minutes of use, it just goes to a black screen

18:55 callen: bbloom: Windows is one big experiment in software entropy.

18:55 SegFaultAX: s/windows/operating systems/

18:55 gfredericks: arrdem: man I have no idea; it's been a while. you've "applied" or something?

18:55 bbloom: I must say, I am impressed with Window 8s boot times, especially in my VM

18:56 Pupnik_: solar radiation corrupting your install

18:57 arrdem: gfredericks: yerp. I mean I'm kinda the lurnking script kiddie not a core contributor but I'm interested in what's changing so....

18:57 gfredericks: arrdem: huh; is there not some read-only subscription mechanism that doesn't require approval?

18:57 * arrdem can't type and goes back to reading papers

18:58 arrdem: gfredericks: doesn't seem to be... besides making googling clj-dev part of my daily news read

19:08 gfredericks: https://groups.google.com/forum/#!topic/clojure-dev/eNK9UZ5HklI

19:14 crocket: Does clojure have very little flaws to overcome?

19:14 in the langauge itself

19:15 llasram: crocket: I'm not sure what sort of answer you expect, asking in #clojure :-)

19:16 It's practically perfect in every way!

19:16 crocket: hmm

19:16 PHP people say clojure already has a flaw which is 'nil'.

19:16 gfredericks: it's not a very precise question

19:16 llasram: That's cool. I think PHP has a flaw which is 'PHP'

19:16 gfredericks: "to overcome" means to overcome by future language development? or by the programmer?

19:16 nightfly: PHP people judging another langauge?

19:16 crocket: I say PHP has "global" and "use" keywords.

19:17 gfredericks, by the programmer

19:17 gfredericks: there are plenty of little details and gotchas that could be different/better

19:17 it's the higher-level design that makes it really compelling

19:17 wkelly: doesn't php have null?

19:17 dnolen: wkelly: it does

19:17 wkelly: I am confused by this alleged criticism

19:18 crocket: I haven't learned clojuer yet. How is 'nil' a flaw?

19:18 llasram: crocket: The fundamental design of the language can make it difficult to provide sensible error messages for some kinds of structural errors. That's the biggest "flaw" for me

19:18 (not really a flaw -- a decision, with trade-offs)

19:19 crocket: llasram, Do you mean fundamental design flaws?

19:19 dnolen: crocket: if it's flaw it's precisely in the same way that null is a flaw in PHP

19:20 crocket: whatever you don't like about null in PHP is true for nil in Clojur

19:20 e

19:20 wkelly: crocket: a lot of people from languages with fancy type systems that can detect at compile time whether a null can get passed around, which can help to avoid lots of bugs that arise from failing to consider the special case of null

19:20 that wasn't really a great sentence :P

19:20 pmonks: Note: PHP is not one of those languages. ;-)

19:21 crocket: wkelly, That includes clojure.

19:21 Anyway

19:21 SegFaultAX: crocket: Hoare has already appologized profusely for inventing null, what more do you want?

19:21 crocket: I heard clojure has very little flaws to overcome in the language itself.

19:21 SegFaultAX: crocket: That's entirely subjective, I think.

19:22 coventry`: Is the signature for the special form case* documented anywhere?

19:23 sontek: Are there any good 'hello world' tutorials for doing clojure web apps? Whats a good default lib to start with for handling basic web requests? Good default webserver?

19:24 wkelly: crocket: this is the sensible null argument (as opposed to the php criticism :P): https://ocaml.janestreet.com/?q=node/78

19:24 dnolen: sontek: people like ring with jetty

19:25 sontek: dnolen: I'll check them out, thanks!

19:25 dnolen: sontek: http://mmcgrana.github.io/2010/03/clojure-web-development-ring.html

19:26 SegFaultAX: sontek: Check out luminus

19:26 dnolen: sontek: there are probably bits of this that need to be updated

19:27 SegFaultAX: sontek: Luminus will introduce you to a great many libraries commonly used in Clojure web dev including ring, compojure, and jetty.

19:27 dissipate_: wkelly, one rule of good function design is to not return nulls

19:27 sontek: Is there a decent template framework as well?

19:28 dnolen: sontek: http://www.luminusweb.net/

19:29 sinistersnare: lunimus uses the selmer template language

19:29 SegFaultAX: Plus you can check out enlive and hiccup if that's your cup of tea.

19:31 mheld: so. do I have to do anything crazy to get static resources set up with luminus?

19:31 it doesn't look like my instance is able to find my static resources (in like resources/public/css/)

19:32 arrdem: so just for my entertainment, who all has submitted a CA to Rich?

19:32 sontek: In general, static resources should usually be served via CDN or server like nginx, its usually not good to server from your app server

19:32 gfredericks: arrdem: http://clojure.org/contributing

19:32 mheld: sontek: I'm aware

19:32 sontek: but I'm not pushing my stuff to a CDN for development

19:32 * arrdem facepalms

19:32 arrdem: gfredericks: thank you.....

19:33 gfredericks: arrdem: I certainly wouldn't have thought to look there

19:33 arrdem: gfredericks: of course not, especially not after I clicked the CA link at the top of the page...

19:33 * arrdem gets more coffee

19:34 coventry`: What is the :tag metadata for? As in (with-meta (gensym) {:tag Object}) in the case macro?

19:34 Oh, it's just some type indication.

19:35 gfredericks: coventry`: yeah that's how type-hints work

19:35 coventry`: gfredericks: Thanks.

19:36 SegFaultAX: mheld: Luminus doesn't really do anything. It's just a collection of libraries.

19:36 mheld: Anyway, read the compojure docs.

19:37 sontek: That's just not true. Like, at all.

19:42 sontek: SegFaultAX: Maybe the clojure community is different than what I'm used to, but in my experience serving static assets via an appserver is always slower

19:43 nightfly: Slower, but not always slow enough to matter

19:43 SegFaultAX: sontek: Jetty serves static assets well enough for most small sites. nginx or varnish in from of it can speed it up dramatically.

19:44 arrdem: is fogus's trammel depricated for core.contracts?

19:44 SegFaultAX: In front*

19:44 mheld: SegFaultAX: yeah, I'm not finding anything of value

19:44 sontek: Do most of the db libraries in clojure take advantage of core.async?

19:45 SegFaultAX: sontek: None as far as I'm aware.

19:45 mheld: compojure.core/resources isn't what you're looking for?

19:45 sontek: so if you wanted to do something like a websocket request inside ring, the calls to the DB are still going to block?

19:46 SegFaultAX: mheld: Whoops, that's in compojure.route

19:46 sontek: i'm coming from python, so my worries might not be valid on something like clojure + jvm

19:46 mheld: SegFaultAX: yeah, I'm using it but nothing's coming out of resources/public

19:46 sontek: In python, to do async we use coroutines but need to make sure we aren't blocking or we'll eatup all our workers

19:47 SegFaultAX: sontek: Python doesn't have coroutines.

19:47 Generators are not coroutines, rather.

19:47 mheld: Paste your routes.

19:47 bbloom: SegFaultAX: doesn't python have "send" now back for iterators?

19:48 SegFaultAX: bbloom: It always has, that's not what makes them not coroutines.

19:49 mheld: SegFaultAX: HA, figured it out -- turns out that it looks at :resource-paths in project.clj only

19:49 which.. makes sense

19:49 bbloom: SegFaultAX: a bidirectional generalization of generators has been proven to be equivilant to delimited continuations, and hence coroutines: http://lambda-the-ultimate.org/node/4349

19:49 mheld: SegFaultAX: (was using some local jars)

19:49 SegFaultAX: bbloom: You can still only yield from the top-level frame.

19:50 bbloom: Generators are degenerate coroutines.

19:50 bbloom: SegFaultAX: right, so they are lexical in extent, just like core.async

19:51 SegFaultAX: bbloom: Ok? They still aren't full coroutines.

19:51 bbloom: SegFaultAX: eh, ok now you added the word "full" :-P

19:51 SegFaultAX: It's a pointless modifier.

19:51 They aren't coroutines.

19:52 sontek: SegFaultAX: Have you heard of gevent?

19:52 SegFaultAX: sontek: Sure.

19:52 mheld: I don't know what the original value is for :resource-paths ["resources/jars/*"] is... which would be really helpful

19:52 anybody know?

19:52 sontek: SegFaultAX: gevent enabled you to do coroutines in python

19:52 SegFaultAX: which is what I'm talking about

19:53 SegFaultAX: sontek: That's not part of Python, though.

19:53 Not cpython anyway.

19:53 sontek: SegFaultAX: It sits on top of python and its how you do stuff like long running requests in python

19:53 SegFaultAX: Python is just as much about the libraries around it as it is the core built-in

19:54 SegFaultAX: the selling point of python isn't cpython, its gevent, numpy, sqlalchemy, etc

19:54 SegFaultAX: sontek: gevent is an extension module for Python.

19:56 sontek: The selling point for Python is different for each buyer. I use python these days mostly for sysadmin stuff (in place of perl, which is what I used to use)

19:56 sontek: SegFaultAX: Does the clojure community try to stick with only using the core library instead of the opensource libraries built on top of it?

19:56 SegFaultAX: sontek: You're missing the point. Cpython lacks coroutines. I didn't say there weren't libraries to add them. I didn't say there weren't alternative implementations of Python that has them built in. But the language by definition lacks them.

19:57 sontek: SegFaultAX: sysadmin stuff also benefits from the opensource community around it. Ansible, Salt, etc

19:57 SegFaultAX: sontek: I don't know what you're talking about anymore.

19:57 sontek: SegFaultAX: Well, I said I do coroutines in python and you said I can't ;)

19:57 SegFaultAX: sontek: No, I didn't.

19:58 sontek: so, back to the original question...

19:58 so if you wanted to do something like a websocket request inside ring, the calls to the DB are still going to block? How do you handle this in clojure?

19:58 In python, to do async we use coroutines but need to make sure we aren't blocking or we'll eatup all our workers

19:58 dnolen: sontek: it's unsolveable problem, if the think is blocking it's blocking you can't magically fix it.

19:58 sontek: ^ this isn't saying "do async using only the core libraries in cpython"

19:59 dnolen: s/think/thing

19:59 sontek: dnolen: In python we patch the db libraries to use "green threads" which are coroutines to make sure they don't block

19:59 SegFaultAX: sontek: Your question is also fundamentally flawed.

19:59 sontek: dnolen: was wondering if the same could be done in clojure

20:00 using core.async

20:00 but since python also has horrible threading, maybe with true threads and havine async built-in, it might not matter

20:00 coventry`: Anyone got some examples of what the shift, mask and skip-check arguments to case* mean? I don't think I need to know for my project, but am curious.

20:00 llasram: sontek: That's not the approach of core.async, but something similar is possible on the JVM: http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar

20:01 SegFaultAX: sontek: That's the thing, many Java webservers are threaded. So the blocking issue doesn't matter since you're only blocking that one thread for that one request.

20:01 (Not to say that threaded servers don't have other issues)

20:01 dnolen: sontek: what core.async gives you are knobs, so you can say drop this request instead of running out of resources.

20:02 sontek: ok, that makes sense

20:03 I'll just load up some sample apps and test to see, I'm assuming most of what I deal with for concurrency in python doesn't matter with a language that doesn't have a global interpreter lock

20:05 SegFaultAX: sontek: That's what makes core.async awesome compared to eg gevent or celluloid. We get coroutines /and/ we get to multiplex them over multiple cores since we have proper threading.

20:06 Well that, and that works in clojurescript and clojure seemlessly.

20:07 sontek: The future!

20:07 seangrov`: Is there a book that's worthwhile for a medium-to-advanced clojure user?

20:08 SegFaultAX: Joy of Clojure is pretty awesome.

20:08 coventry`: seangrov: Joy of Clojrue?

20:08 seangrov`: Just got a kindle and going on a few long flights, looksing for good material. Going through Lisp in Small Pieces again

20:08 augustl: +1 to joy of clojure

20:08 SegFaultAX: seangrov`: Also, not Clojure specific, but The Reasoned Schemer.

20:08 Do not get it for Kindle, though.

20:08 seangrov`: SegFaultAX: Oh, why not?

20:09 SegFaultAX: Completely unreadable.

20:09 dnolen: seangrov`: horrible formatting

20:09 bbloom: SegFaultAX: based on your definition, core.async does not provide co-routines

20:09 seangrov`: And The Joy of Clojure isn't meant as an intro to Clojure, right?

20:09 coventry`: It has some introductory material but it revs up pretty fast.

20:09 SegFaultAX: bbloom: Correct. I didn't know what to call them, just "go blocks" perhaps. And it isn't /my/ definition.

20:10 seangrov`: coventry`: Thank you

20:10 bbloom: SegFaultAX: I was just pointing out that while coroutines may have a formal definition, colloquially they include any sort of interleaving of control

20:10 coventry`: seangrov: It covers this fairly late in the book. It if seems passe, the book might be too easy for you: https://coderwall.com/p/xayyvq

20:11 (I.e., I think it's pretty representative of the level of the book.)

20:12 SegFaultAX: bbloom: And I was pointing out that generators lack necessary elements to be considered coroutines. That isn't a bad thing, per se.

20:13 In practice, it basically never matters in Python. Especially with `yield from`

20:21 dnolen: anybody see anything wrong with this CLJS change? http://github.com/clojure/clojurescript/compare/580-fn-name

20:21 a fix for http://dev.clojure.org/jira/browse/CLJS-580

20:22 I see no need to pass name into the analyze data literal cases, seems like it's only needed by analyze-seq for the fn case

20:23 bbloom: dnolen: i never quite figured out what the name was for in general

20:24 dnolen: bbloom: it's useless to me outside of special case for (def foo (fn [] ...))

20:24 it seems useless to me I mean

20:24 bbloom: dnolen: why is that special cased?

20:27 dnolen: bbloom: that's a good question ... thinking, probably something to do w/ recursive definitions and the REPL?

20:27 bbloom: ,(macroexpand '(defn id [x] x))

20:27 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

20:27 bbloom: booo

20:28 dnolen: the problem is that defn is bugged

20:28 that produces: (def id (clojure.core/fn ([x] x)))

20:28 it should produce:

20:28 (def id (clojure.core/fn id ([x] x)))

20:28 dnolen: if you do that, the special case goes away

20:29 dnolen: that said, your change looks good. i'd commit that as an intermediate step

20:30 dnolen: bbloom: I think fixing it at defn macro might be problematic? thinking about custom defn like macros, this way you can have a complex expression and the function will still get a name.

20:32 bbloom: dnolen: (def f (fn [x] (if (zero? x) :done (f (dec x))))), (f 5)

20:32 dnolen: wacky, that works.

20:32 dnolen: seems wrong to me

20:33 coventry`: Why is that surprising?

20:33 hfaafb: can i evaluate the body of 'for' *once* even if :while fails?

20:33 bbloom: coventry`: that's surprising because:

20:34 ((fn [x] (if (zero? x) :done (f (dec x)))) 5)

20:34 coventry`: the inner fn form is magically influenced by it's presence inside the def form

20:36 consider: (let [g (fn [x] (if (zero? x) :done (f (dec x))))] (def f g))

20:36 coventry`: bbloom: Gotcha. Interesting.

20:36 bbloom: clearly that doesn't work :-P

20:36 seangrov`: ((fn f [x] (if (zero? x) :done (f (dec x)))) 5)

20:36 bbloom: seangrov`: yeah, that's what i'm saying it *should* be, but apparently def is magic when an fn is inside it syntactically

20:36 seangrov`: bbloom: Ah, yes, I see that now

20:37 bbloom: dnolen: so you're saying that there are likely defn-style macros that depend on this odd behavior?

20:37 dnolen: bbloom: not completely sure

20:42 bbloom: doing some spelunking, the passing of name is from the earliest days

20:42 bbloom: present before my first commit 2 years ago

20:42 bbloom: dnolen: i suspect it was more or less directly copied from clojure

20:43 dnolen: bbloom: yeah but I'm trying understand it's purpose, I just don't see the point of passing name into map or set analysis

20:43 bbloom: after my change all tests pass

20:43 bbloom: dnolen: the point would be if you had something like #{(def f (fn …))}

20:43 dnolen: which seems absurd :-P

20:44 coventry`: bbloom: FnExpr has an emitForDefn, which DefExpr calls when the init form is a fn. emitForDefn doesn't seem to do much, though.

20:44 dnolen: bbloom: I don't see how that case is involved here, it appears this is meant for (def foo #{(fn []) ...}), but that doesn't really make sense to me either.

20:44 bbloom: coventry`: my guess is that emitForDefn predates the recursive fn syntax

20:45 coventry`: i've got the instincts of a professional software archeologist :-)

20:46 coventry`: bbloom: I'm pleased to meet another Vinge fan. :-)

20:46 bbloom: coventry`: sorry, i have no idea what that is

20:46 lol

20:47 coventry`: bbloom: Thought you were referring to this: http://en.wikipedia.org/wiki/A_Deepness_in_the_Sky#Interstellar_culture

20:48 bbloom: coventry`: oh, i think i've heard of that

20:50 coventry`: bbloom: What do you mean by recursive fn syntax?

20:50 bbloom: (fn THIS-NAME-HERE [...

20:50 coventry`: Oh, right.

20:56 sontek: dnolen: In the tutorial you sent me: http://mmcgrana.github.io/2010/03/clojure-web-development-ring.html it does things like :dependencies and then indents everything underneath that

20:56 dnolen: is that the standard way to indent in clojure?

20:56 dnolen: sontek: matter of personal preference

20:58 bbloom: yeah I can't really figure out what the point of name is even looking at the old code

20:58 sontek: dnolen: I was asking because emacs thinks its not a valid indention

20:59 bbloom: dnolen: lol, yeah, i was pretty confused by it so i ignored it

20:59 dnolen: i feel that way about a bunch of things in there :-P

20:59 dnolen: sontek: you can customize identation

21:00 sontek: dnolen: yeah, I just want to follow whats the community standard way of doing things

21:00 I couldn't find many best practices docs

21:01 dnolen: bbloom: I think you're right about this being copied over from Compiler.java ...

21:01 bbloom: sontek: just focus on getting working code, then you can worry about what it should look like later. as you look at more & more clojure, you'll get a feel for it

21:01 dnolen: bbloom: but actually ...

21:01 bbloom: in Compiler.java they don't pass name along to every case

21:01 bbloom: dnolen: heh

21:02 dnolen: bbloom: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6375

21:02 bbloom: this looks exactly like my change :P

21:02 bbloom: dnolen: history repeats itself

21:02 dnolen: bbloom: only analyzeSeq gets name

21:03 k I'm not crazy merging this in

21:05 sontek: Is my leinigen out of date if I get exceptions like this? http://paste2.org/ZzmZfCIC

21:05 thats from lein deps

21:06 Leiningen 1.7.1 on Java 1.7.0_25 OpenJDK 64-Bit Server VM

21:06 Maybe because i have openjdk instead of real java?

21:07 coventry`: sontek: Definitely out of date. Not sure whether that's the cause of your error.

21:07 sontek: Get the latest: https://github.com/technomancy/leiningen#installation

21:08 sontek: Thats the version shipped with Fedora 19, which came out a couple months ago

21:08 I'll grab latest

21:10 yeah, latest works way better

21:13 is there a way to define dependencies as "latest" instead of hardcoding versions?

21:17 coventry`: I've only experimented with it once, and I can't find documentation on it, but it seems that if you replace the version string with "RELEASE", you'll get the latest version.

21:17 s4muel: "LATEST" works.

21:18 sontek: I didn't see either of those listed on the leinigen docs

21:18 I'll dig around

21:21 coventry`: Oh, it's a maven thing: http://stackoverflow.com/a/1172371

21:22 s4muel: There's lein-ancient too

21:22 sontek: ahh, nice, good to know

21:22 not from the java world, so I have plenty to learn

21:59 clj_newb_2345: besides pedestal, is there any library which does the following: I have a data structure, and a function which mapps data to DOM tree; ... then, as I make incremental updates ot the data structure, the DOM tree gets incremental updates

22:00 coventry`: Isn't that the basic idea behind c2? http://keminglabs.com/c2/

22:00 gfredericks: clj_newb_2345: web-fui _maybe_

22:00 * gfredericks doesn't really know

22:01 clj_newb_2345: coventry`: I think c2 is about wrapping d3

22:01 and producint viosusalizations

22:01 I want something more generic

22:01 that I can say, write we bapps with

22:01 john2x: yeah web-fui does that.. but it's not production ready I think

22:02 pretty cool project

22:02 coventry`: clj_newb_2345: Yes, but D3 stands for "Data-driven documents."

22:02 sontek: Couldn't you just hook into something like backbone/angular from clojurescript?

22:03 callen: you can use it for another things, but d3 is generally best for "explanatory" rather than "exploratory" content.

22:06 coventry`: callen: Could you give an example of the distinction you're drawing?

22:06 callen: coventry`: a pre-prepared infographic vs. a dashboard for viewing dynamically loaded aggregate data with multiple views.

22:06 you can do the latter with d3, but it'll hurt.

22:09 coventry`: I will say this though, c2 does make things a lot less painful.

22:10 https://github.com/Mamun/clojure-web-app

22:10 coventry`: I thought c2 was released with demonstrations of visualisations which responses to data changes, but it was a while ago. I might be misremembering.

22:11 callen: I said you could do it, and that c2 made it a lot less painful.

22:11 doing that sort of thing in d3 and JS directly is incredibly tedious though.

22:11 * dnolen brain explode

22:11 callen: dnolen: okay, what'd I say?

22:12 dnolen: I just made CLJS incremental compilation like 10X faster :P

22:12 callen: whoa, congrats!

22:14 devn: wahhh!

22:14 dnolen: how?

22:14 * callen hands devn a cookie and a glass of milk

22:15 dnolen: devn: eliminating pointless analysis if you're running auto builds

22:15 bbloom: dnolen: ie not re-analyzing namespaces that haven't changed?

22:15 dnolen: bbloom: yes

22:15 bbloom: dnolen: heh.

22:15 dnolen: derp. shoulda figured that one out earlier

22:17 dnolen: https://github.com/clojure/clojurescript/compare/509-protocol-warn

22:17 bbloom: while you like to complain about analyzer/compiler.clj, I think closure.clj is a lot harder to understand :)

22:18 bbloom: dnolen: agreed. i only complain about analyzer/compiler .clj b/c i can articulate complaints :-P

22:18 dnolen: bbloom: haha :D

22:18 bbloom: dnolen: i have about 1/3rd the mental cache space that you have. that's why you think my code is so pretty: b/c i'm too dumb to understand it unless it's absurdly well factored

22:19 takes me 10X longer to make it look that nice, but shhh don't tell anybody :-P

22:20 dnolen: it's nice to see that ClojureScript can have CoffeeScript speed compile times

22:20 once JVM warm and core.cljs compiled

22:22 bbloom: dnolen: that's a big deal

22:22 dnolen: it is

22:23 sdegutis: What's a good way to inspect a Leiningen project from without but as if from within, i.e. with full access to all the Clojure files it contains?

22:24 callen: sdegutis: inspect?

22:24 sdegutis: do you mean checkouts?

22:24 sdegutis: Um, like all the introspective tools you could otherwise use if you were inside the project, like (the-ns 'hello.world) etc.

22:24 callen: sdegutis: use checkouts.

22:25 sdegutis: Oh.

22:25 I misunderstood your answer :)

22:26 sontek: Is there a thread.sleep in clojure?

22:26 sdegutis: callen: Ah, this solution won't work for me because my app will be a jar file, which won't have a source directory to create a 'checkouts' dir inside. But thanks :)

22:27 sontek: ##(Thread/sleep 1000)

22:27 lazybot: ⇒ nil

22:28 sdegutis: Oh I wonder if tools.namespace will do this.

22:33 dnolen: bbloom: 0.2 seconds to recompile a single changed file w/ a couple of functions now w/ :whitespace optimizations

22:33 bbloom: dnolen: glorious

22:34 coventry`: ,(the-ns 'clojure.core) isn't a very informative example. Not clear how it relates to a Leiningen project's files.

22:34 clojurebot: #<Namespace clojure.core>

22:34 dnolen: bbloom: ~0.04s if you leave Closure out of it

22:36 sdegutis: dnolen: is cljs your day job?

22:36 dnolen: sdegutis: heh, no

22:37 bbloom: dnolen: I'd like to submit a patch via IRC. please run this in the root of the CLJS directory:

22:37 sed -i '' 's/ new//' README.md

22:42 sdegutis: dnolen: oh.

22:43 sed -i '' 's/Clojure/Lava/' **

22:44 smthn lk tht

22:47 dnolen: sdegutis: I work on ClojureScript because otherwise I'll be stuck writing JS or managing people that write JS, do not want that future.

22:48 sdegutis: dnolen: Ah. That makes sense. I've noticed that the only tools I ever actually do work on are ones I plan to use as soon as (before?) they're done.

22:55 sontek: So can you call into actual js libraries from clojurescript? So you can basically write all the clientside code in clojure?

22:55 That would be pretty wonderful

22:56 dnolen: sontek: calling in to JS libs from CLJS is easy, people are more or less doing what you're describing :)

22:56 sontek: oh my, I feel like I've wasted so much of my life all of a sudden

22:56 * sontek fires all the front-end engineers

22:56 dnolen: sontek: CLJS core.async is massively sick IMO http://swannodette.github.io/2013/07/12/communicating-sequential-processes/

22:59 sontek: I'm even happier I decided to checkout clojure now

22:59 Do you guys know where ring.middleware.stacktrace went?

23:00 sdegutis: OH!

23:00 IDEA.

23:01 sontek: I see it here: http://mmcgrana.github.io/ring/ring.middleware.stacktrace.html but not here: https://github.com/mmcgrana/ring/tree/master/ring-core/src/ring/middleware

23:01 sdegutis: I-FRICKEN-DEA.

23:01 * sdegutis has an idea

23:01 sontek: dooo itt

23:03 https://github.com/mmcgrana/ring/tree/master/ring-devel/src/ring/middleware its there though

23:03 callen: sontek: lib-noir and wrap-failsafe.

23:03 you can write your own trivially.

23:04 sontek: if you have lein ring it will display pretty stacktraces automatically for any uncaught exceptions.

23:05 caveat to lein ring being that it's jetty only.

23:05 if that matters.

23:10 sontek: nice, lein ring works pretty well

23:11 I've been doing all my testing with jetty, its seems like its more than enough for me. I'm actually doing a port of my existing app to see if I can squeeze more performance out of it

23:11 but the jvm seems to be way nicer than I was hoping for

23:12 callen: sontek: clojure is doing a fair to clean it up wrt APIs and tooling.

23:12 a fair bit*

23:14 SegFaultAX: sontek: You were hoping the JVM would be shittier?

23:16 sontek: SegFaultAX: haha, its just better than I hoped for

23:17 SegFaultAX: I've only ported 3 APIs but I'm seeing about a 4x speed improvement from my python code and concurrency wise, I couldn't get it to blow up with ab

23:18 in my python server, it degrades pretty quickly once you get a lot of concurrent requests

23:18 Pupnik_: say what you like about the JVM, but you can't say its slow

23:19 sontek: and this is knowing very little about clojure/jetty, I'm sure I could tweak both to get it even faster, since I've done all kinds of tweaks on the python side to get the current performance I have

23:21 callen: sontek: you don't really need to do much to make it acceptably performant - if anything. Hypothetically you could use http-kit if you needed async or expected high concurrency but that's not obligatory by any means.

23:21 Does enforce good habits in terms of not relying on thread-local state though :)

23:22 akurilin: With leiningen, is my only option for including non-clojure binary and text assets, to stuff them all under resources?

23:23 llasram: What other kind of option would you want?

23:24 That's what "resources" is for -- things other than source code which should end up in your project JAR

23:24 akurilin: Well I'm thinking with Rails in mind where you have app/views which contains .erb

23:24 llasram, would you create something like resources/views for that purpose?

23:25 callen: akurilin: for templates, I put things like that in src/templates or src/views/templates

23:25 akurilin: having erb files in a clojure project is pretty strange though.

23:25 ArthurZ: How hard would it be to pickup Clojure?

23:26 llasram: akurilin: I don't do that much Web stuff, so I yield to other in the common patterns here

23:26 akurilin: callen, do you have to change project.clj to have those folders included in the uberjar?

23:26 dnolen: ArthurZ: coming from what language/experience?

23:26 akurilin: callen, or is everything under src included?

23:27 callen: akurilin: I don't mess with my leiningen in order to do that.

23:27 akurilin: (I'm not fully clear on how uberjars work internally as you can tell, I'll need to look more deeply into it at some point soon)

23:27 ArthurZ: No functional languages

23:27 callen: Selmer uses the classpath (resources, src, test, etc) to find templates.

23:27 akurilin: what you're talking about is by no means specific to uberjars.

23:27 ArthurZ: Thinking of buying http://www.packtpub.com/clojure-data-analysis-cookbook/book?utm_source=Deal+Of+the+Day&utm_campaign=309e9282fe-8th_Sept_8_30_2013&utm_medium=email&utm_term=0_1299a68014-309e9282fe-54288189&mc_cid=309e9282fe&mc_eid=ab6778ae1d

23:28 callen: akurilin: the weird part about uberjars is the AOT.

23:28 ArthurZ: that looks neat, but you probably want http://clojurebook.com/ first.

23:28 dnolen: ArthurZ: getting your head around programming w/ immutable data structures is a hurdle - I personally recommend Clojure Programming

23:29 callen: which incidentally is what I just linked. Koans help too.

23:29 good to know I'm not the only one that thinks the immutable bits take some working through.

23:29 ArthurZ: I am a t-sql guy

23:30 akurilin: callen, I see, so as long as something is under one of the default folders, it will make it to the uberjar, and then I should be able to refer to that file through a path relative to the classpath?

23:30 callen: it's not about default vs. not default directories, it's about the classpath.

23:31 some stuff is in it, some stuff ain't. just start dumping the classpath in an empty project and learn what's in there.

23:31 ArthurZ: Thx callen: any free as in beer books are around?

23:32 sontek: callen: http-kit looks pretty nice, is there a reason not to use it upfront since it is compatible with ring?

23:33 akurilin: callen, got it.

23:33 callen: ArthurZ: any reason you can't afford it?

23:33 akurilin: callen, lein classpath is pretty handy here, I imagine that's what you were referring to

23:33 callen: akurilin: yes but I wanted you to go on your own path of enlightenment.

23:33 sontek: just that it has to be ran by its own async-server instead of jetty?

23:33 callen: sontek: uhm, you don't want to use thread-local state in http-kit. That's a blocker for some people, not for others.

23:33 no thread affinity.

23:34 akurilin: callen, I'm looking at the leiningen "specification" and it seems to support 4 default paths: source, java source, test and resource. Shouldn't those be considered "default"?

23:34 callen: being shen feng means not understanding the needs of mere mortals.

23:34 akurilin: callen, is that a java concept?

23:34 callen: akurilin: we can go with 'default' if you like, but the classpath is the real thing that decides what gets found and what doesn't :P

23:35 sontek: callen: I'm firmly against threadlocals

23:35 technomancy: akurilin: tests are on the classpath but don't get put into jars

23:35 callen: sontek: then go for it.

23:36 akurilin: callen, I guess the point is that you wouldn't really add more folders to that classpath unless you had some really specific needs, right?

23:36 ArthurZ: Callen: using an OSS product makes me think so

23:37 callen: akurilin: pretty much. you should avoid doing so unless you have an exceptionally good reason.

23:37 akurilin: (in fact I can't see an obvious way of doing that through lein configs)

23:37 callen, gotcha, thx for the explanation

23:38 dnolen: ArthurZ: you really can't beat the Clojure books, online resources are not quite up to snuff w/ the good books.

23:38 akurilin: technomancy, good reminder!

23:38 SegFaultAX: sontek: If you're doing your job right, your Clojure code should run circles around your Python code once the JVM warms up.

23:39 ArthurZ: Aha dnolen: figured as much

23:39 callen: and you can use drip for the latter if you want to cheat.

23:39 ArthurZ: What would you say about http://www.packtpub.com/clojure-data-analysis-cookbook/book?utm_source=Deal+Of+the+Day&utm_campaign=309e9282fe-8th_Sept_8_30_2013&utm_medium=email&utm_term=0_1299a68014-309e9282fe-54288189&mc_cid=309e9282fe&mc_eid=ab6778ae1d

23:39 callen: dnolen: might change someday, but for now, Emerick's book is king of the hill for new people.

23:40 akurilin: callen, and no I'm not using erb. Sticking to mustache for this one really basic email template I'm writing, and then I might seriously need to look into Enlive. I've used underscore.js's templating for a while so perhaps clostache would be the most similar to that.

23:41 callen: akurilin: 2 things: try Selmer - http://github.com/yogthos/Selmer/ - and - did you end up using Blackwater?

23:42 akurilin: callen, 1. any specific reason you'd recommend it over the more basic option I mentioned? 2. not yet, sorry!

23:45 callen: akurilin: mustache is fine if it works for you, but if you start needing smarter templates, give Selmer a try.

23:47 akurilin: callen, deal.

23:48 ArthurZ: Is there a Clojure driver for SQL Server?

23:49 callen: ArthurZ: anything in Clojure that uses JDBC supports whatever JDBC supports. This includes Korma and c.j.j

23:51 ArthurZ: Callen: no idea on Korma or cjj

23:51 mrcheeks: what about google ^^ :-)

23:52 ArthurZ: Google spies lol

23:52 callen: oh this is cool, I don't have to be the meanie that says to google anymore.

23:52 ArthurZ: then duck-duck-go-it.

23:52 mabes: ArthurZ: I've use the SQL server jdbc driver from clojure before without problems

23:52 ArthurZ: Seriously, I use duck-duck or Bing

23:53 callen: ArthurZ: okay?

23:53 akurilin: Oh actually on that note let me ask this here rather than on the groups. I'm trying to figure out a sane way of avoiding repetition when building different flavors of the same SQL query. For example I have a select, but I might want to add in a limit, an offset, a sorting order, perhaps a count etc all based on the same base query. Or for inserts, sometimes I want to add RETURNING at the end. Can I avoid doing this by hand? Is Korma/Honey what people

23:53 use for that?

23:54 ArthurZ: Mables: does it handle sql errors well? E.g. do schema errors bubble up?

23:55 Sorry callen: ok re what?

23:55 akurilin: I get the feeling that what I'm asking for must have been solved and resolved a few hundred times already.

23:57 ArthurZ: akurilin: AFAIK ANSII SQL was never implemented in any RDBMS

23:57 callen: akurilin: Korma.

Logging service provided by n01se.net