#clojure log - Mar 27 2012

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

0:01 dnolen: duncanm: I think CS is well on its way to being the most widely used transpile-to-JS lang.

0:02 duncanm: dnolen: yeah, and i dearly wish it could be this nice non-lisp language with a sensible repl that i'd like ;-P

0:03 dnolen: duncanm: you could probably hack swank-js to make it work right?

0:03 duncanm: dnolen: the version installable from ELPA i think is quite old compared to what's available on github

0:04 dnolen: and the version from ELPA requires some bleeding-edge (non-ELPA) Swank/Slime

0:04 dnolen: i could probably look into doing it, but hacking elisp so that i can hack coffeescript seems kinda, backwards

0:04 dnolen: duncanm: yeah. Lisp folks have a very specific perspective on development that only Smalltalk people seem to understand.

0:05 duncanm: dnolen: yeah, i was a squeaker before i hacked on scheme48/scsh

0:05 dnolen: and after that, i used clojure

0:05 dnolen: duncanm: which why I'm glad Bret Victor's talk resonated - maybe it'll encourage people to you know, adopt 1970s ideas today.

0:05 * duncanm nods

0:07 duncanm: dnolen: i had one nagging thought while watching that video - it was probably more work to write the code to make those demos work (the changes to the dev env) than it is to write the code to cause those effects

0:07 i dunno if i articulated that properly...

0:07 dnolen: do you get what i mean?

0:07 dnolen: duncanm: I doubt that, the demos were pretty much hard coded prototypes as far as I know.

0:07 duncanm: right

0:08 seancorfield_: can i get some extra eyes on a pull request for clj-time? https://github.com/seancorfield/clj-time/pull/19

0:08 duncanm: dnolen: i just think, for most people, they're more interested in getting the work they need done, than to spend the time to hack the environment, so that they might get the work done quicker

0:08 with a spiffier environemnt

0:09 seancorfield_: it feels a bit... um... idk... not clojure-y with the alter-var-root stuff and all...

0:09 duncanm: seancorfield_: is clj-time a wrapper around joda-time?

0:09 seancorfield_: yes, duncanm

0:09 dnolen: duncanm: I disagree - I think most people are just oblivious to Lisp or Smalltalk

0:10 duncanm: dnolen: well, i agree that most people have no idea how lisp/smalltalk worked

0:10 dnolen: duncanm: which why I was also annoyed with Bret's talk - but I understand his goal was to speak to a wide audience - not nerd out on CS.

0:12 seancorfield_: Bret? Who are we talking about at which conference? *curious*

0:12 duncanm: seancorfield_: http://computinged.wordpress.com/2012/02/21/bret-victors-inventing-on-principle-and-the-trade-off-between-usability-and-learning/

0:12 with comments from Alan

0:13 seancorfield_: ah, inventing on principle... that rings a bell... thanx for the link...

0:14 duncanm: dnolen: this is kinda neat, https://github.com/Benvie/Node.js-Ultra-REPL

0:14 mk: that was a good talk, with great demos

0:15 amalloy: seancorfield_: set-timezone! looks like a disaster to me - what if two different libraries in the same program want to use clj-time, and one of them works in utc while the other wants to work in some other timezone?

0:15 yoklov: yeah, that talk definitely blew me away, especially because i've struggled with that in game development

0:16 the delay between making a change and seeing it

0:16 duncanm: amalloy: i was wondering how *in* gets defined

0:17 dnolen: duncanm: neat!

0:17 duncanm: seancorfield_: you basically want it to be a fluid binding, in scheme terms - which i think is called binding in clojure

0:17 the difference between let and binding

0:17 i'm kinda rusty with clojure

0:18 dnolen: it reminds me of things like turbo pascal - people who were wholy out of the lisp/smalltalk culture, and built these IDEs that are completely different from the lisp world

0:18 amalloy: it wouldn't be as horrible to have *default-timezone* and let it be thread-bindable (though i still don't like it - what if lib a binds a timezone and later calls into lib b, not knowing that lib b uses clj-time)

0:19 duncanm: amalloy: you'd want it to work like *in*, right?

0:19 dnolen: do you read alan's fonc list?

0:20 dnolen: he mentioned something about semantic typing the other day, and i thought that was a neat idea

0:20 amalloy: that's what i just said wouldn't be as horrible, duncanm

0:20 duncanm: amalloy: right

0:20 dnolen: duncanm: my thoughts exactly.

0:20 duncanm: I do follow fonc

0:20 mk: yoklov: yeah - his main point is spot on, about delay being harmful. I wonder, though, about how to generalize his ideas beyond the examples he gave

0:21 duncanm: dnolen: i guess the struggle is to give up on insisting that (f x) will definitely call some function 'f'

0:21 dnolen: mk: spend a week with Squeak, scales pretty darn well

0:22 duncanm: dnolen: message passing/dispatch meant that there's a dispatch thing between the caller and 'f', and then the logic/search/prolog stuff that you've been working on brings that distance even further

0:22 mk: the talk was good on its own, but it also got me thinking about how the final interface the user sees, and the code the programmer sees - those are just interfaces into a single process

0:23 duncanm: mk: you mean user interface?

0:23 yoklov: dnolen: is that what writing code in squeak is like?

0:23 mk: duncanm: sure - any interaction the user has with the system, really

0:24 duncanm: yoklov: i used to code in squeak

0:24 yoklov: is that what it's like?

0:24 duncanm: yoklov: like that video?

0:24 not quite, but it's more immediate, yeah

0:24 yoklov: or even that level of interactivity?

0:24 dnolen: duncanm: oh yeah I read that AK email. Some deep stuff ...

0:25 duncanm: you can pick up UI objects and drop into an inspector (like a REPL)

0:25 yoklov: wow

0:25 duncanm: yoklov: you can look at the lively kernel stuff

0:26 it's basically an implementation of morphic (squeak's GUI system) in JS and SVG and all that

0:26 squeak runs faster than morphic, but the ideas are the same

0:26 i mean

0:26 squeak runs faster than lively

0:26 dnolen: Eclipse is the result of Visual Age Smalltalk

0:27 duncanm: dnolen: oh i know!

0:27 dnolen: Interface Builder is the result of ExperLisp

0:27 duncanm: that's one of my favorite stories, the story of VisualAge for Java

0:27 dnolen: oh, i knew that IB had some lisp roots

0:27 dnolen: is there anything written down on the history of ExperLisp?

0:27 (this is a new thing for me)

0:28 yoklov: the unfortunate thing is that squeak is kinda hard to use for people used to using modern GUIs

0:28 gf3: dnolen: oh neat, is there a place I can read more about that?

0:28 dnolen: re: IB roots

0:28 dnolen: Jean Marie Hullot & Steve Jobs & NeXT great read http://fds.oup.com/www.oup.com/pdf/13/9780192862075.pdf

0:28 duncanm: yoklov: so it's best that you find someone who knows their way around and have them show you

0:29 in some sense, emacs is the same way, but a bit easier because it's still files and directories

0:29 yoklov: i see

0:29 duncanm: cool

0:29 dnolen: nice find!

0:29 dnolen: Hullot was at INRIA studied under Huet (zippers)

0:29 duncanm: oh coo

0:29 dnolen: i always think of INRIA as this ML place, because they did OCAML there

0:29 seancorfield_: thanx for the feedback folks - reinforces my concerns - i was off reading that blog post (thanx for the link duncanm)

0:30 duncanm: but i forget that there's also a scheme impl. done at INRIRA

0:30 INRIA

0:30 dnolen: duncanm: it's easy to forget that ML was first programming in LISP :)

0:30 programmed

0:30 duncanm: dnolen: wow, how did you find this Hullot story?

0:30 dnolen: i've gone looking for this stuff in the past

0:31 dnolen: duncanm: I knew some fuzzy details and I got obsessed one night - went digging on the Internets

0:31 duncanm: dnolen: oh, now that we're trading stories - i wrote to the fonc list once about this

0:31 dnolen: the story of swing is funny too

0:31 java swing

0:31 dnolen: sun had access to *two* java implementations of NeXTStep AppKit (lighthouse and netscape's IFC)

0:32 IFC even had a working IB

0:32 dnolen: and they merged the team, tons of office politics, and the AWT team came ahead, and re-org'ed everyone

0:32 and so they decided to throw that stuff away and start fresh, and they ended up with Swing ;-P

0:33 imagine what java on the desktop would have been like if they went with a framework like IFC....

0:33 technomancy: seancorfield_: this makes me wonder if there isn't room for certain functionality that's specified as explicitly off-limits for libraries; allowed to be set by applications only

0:33 duncanm: it would be like Cocoa + GC in the late 90s

0:34 technomancy: seancorfield_: perhaps reading a system property at boot would be a way to enforce that

0:34 stuff that's not composable on purpose, somewhat parallel to the way people should be doing AOT

0:36 dnolen: duncanm: interesting, maybe we'd be further along :) though I doubt it - good ideas like IB eat their children. From what I can tell the essential idea remains unchanged since '84 or so.

0:38 duncanm: dnolen: i don't really know how IB works - the main thing that i got is that it persists the objects into NIB files, which is very different from what most GUI designers do, which is that they generate code

0:39 dnolen: duncanm: that's pretty much it and you can network message sends visually

0:39 duncanm: dnolen: hmm, i read the section on Hullot, too bad it doesn't say anything about lisp

0:39 dnolen: the object persistance thing is just like smalltalk images ;-)

0:40 dnolen: duncanm: he published a couple of papers - sadly not available on the Internet far as I could tell.

0:40 duncanm: yoklov: ah, another thing that's a learning curve, in smalltalk, you don't save your code in files

0:40 yoklov: yeah i knew that

0:40 always sounded insane

0:41 but kind of cool

0:41 duncanm: yoklov: so you need to learn the discipline to not mess up the image, or if you do, learn how to fix it up

0:41 dnolen: yoklov: and then everything got virtualized anyway and it sounds pretty normal ;)

0:41 duncanm: using the ChangeSorter and tools like that

0:42 dnolen: did you ever play with genera?

0:42 dnolen: duncanm: I have not

0:42 duncanm: olin has it running on his laptop at some point, and i think he actually knows how to use it, but i never got him to show me

0:42 dnolen: duncanm: oh, was Olin Shivers your prof?

0:43 duncanm: dnolen: yeah, i was his summer intern for a while, we tried to write an emacs in scheme, but i failed

0:43 dnolen: duncanm: one day I'll try to understand his dissertation

0:43 duncanm: heh

0:43 dnolen: if you're ever in Boston, i can make introductions

0:44 sigh

0:44 dnolen: alan is completely right about lisp/smalltalk eating their young

0:44 i really need to stop reminising this history stuff, and get with the program! ;-P

0:45 * duncanm tries to write more coffeescript

0:45 dnolen: duncanm: speaking of Olin I came across this paper - http://www.cs.indiana.edu/~adamsmd/papers/fast_flow_sensitive_cfa/, seems neat

0:45 cfa fast enough for JITs

0:46 duncanm: dnolen: i didn't do any compiler work with him - i wrote a scheme implementation of termininfo in one summer, and i started on porting mit scheme's edwin to more modern scheme the next

0:46 terminfo

0:46 dnolen: duncanm: I would be more depressed about the eating young part if the rest of the world had actually caught up.

0:48 duncanm: dnolen: yeah, that alan e-mail was good stuff (http://vpri.org/mailman/private/fonc/2012/003318.html)

0:48 * duncanm spreads the link love

0:50 duncanm: dnolen: i can't help but think that if there's a search algorithm between me and the function i want to call (maybe i've already lost the battle thinking in those terms), that the thing must be really fragile?

0:50 what if it couldn't find it?

0:50 dnolen: duncanm: well Alan's is conservative about the idea. I'm assuming you've read up on Eurisko & CyC

0:51 duncanm: oh, no, not really, i saw the references, but that's it

0:51 dnolen: also, i kinda wish i got alan to clearly write down why he thinks the architecture of the web is no good

0:51 dnolen: duncanm: http://www.newyorker.com/reporting/2009/05/11/090511fa_fact_gladwell about Eurisko, hilarious read

0:51 duncanm: that conversation sorta drifted off

0:51 newyorker?

0:52 dnolen: duncanm: just skip down the Eurisko bit

0:53 duncanm: oh

0:53 i read this article when it first came out, i remember this

0:55 dnolen: duncanm: I don't know where AK is going with those ideas, but it is interesting to ponder. Maybe someone will make a core.logic prototype :P

0:59 duncanm: dnolen: well, that posting is the first that made me feel like i understand his objections to things like ML

0:59 dnolen: if what he's looking for is like what he said, then of course something like ML wouldn't fit the bill

1:00 hmm

1:00 dnolen: duncanm: have you read any William Cook's stuff, a very good analysis of the kinds of issues you run into in ML

1:00 duncanm: honestly I really take a closer look at Martin Ordersky's papers - I'm sure some of the same points arise.

1:01 duncanm: maybe this is a stretch, but say, ST-80 is a way of not having ABI breakages anymore, because everything is late-bound

1:01 i feel like he's trying to make a system where API-breakages are also impossible

1:02 dnolen: you're talking about the Scala guy?

1:02 dnolen: duncanm: yeah

1:02 marchtemp: duncanm: What's wrong with ML?

1:03 duncanm: marchtemp: it's not that it's wrong, we're just talking about a discussion on the fonc list

1:03 http://vpri.org/mailman/private/fonc/2012/003318.html

1:03 dnolen: marchtemp: http://www.cs.utexas.edu/~wcook/Drafts/2009/essay.pdf

1:03 duncanm: dnolen: is that the ADT vs objects one? i re-read that over the weekend

1:04 dnolen: duncanm: yep

1:04 duncanm: dnolen: for a moment, i thought i got it - and i was trying to tell someone about it today, and i lost it again ;-P

1:04 it's like, my 4th time reading this paper

1:06 marchtemp: It seems like a very old paper written by Backus decades ago.

1:07 I meant it's similar to it.

1:08 duncanm: dnolen: that whole thing between wcook and that ML guy was really strange

1:08 bob harper

1:08 dnolen: duncanm: well Bob Harper is a bit of SML zealot

1:08 duncanm: yeah

1:09 dnolen: i liked the batches stuff that cook did, it'd be nice to see it in a production language

1:09 dnolen: duncanm: I haven't seen that.

1:09 duncanm: he said that they might get it in java 8, or java 9

1:09 dnolen: it's a simple idea - you come up with a bit of syntax that marks off a section to be executed remotely

1:10 dnolen: and then make sure that results from remote execution doesn't get used on the right-hand side within the block

1:11 then you can use that to batch RPC calls

1:11 http://research.microsoft.com/apps/video/dl.aspx?id=157246 -- it's a 30 min video

1:12 Batches: Unified and Efficient Access to RPC, WS, and SQL Services

1:12 dnolen: duncanm: thx, will watch that later!

1:12 duncanm: boo, i didn't get that much coding done tonight

1:12 dnolen: thanks for the link to the hullot story, i've been wanting to learn about that history for quite a while

1:13 dnolen: duncanm: heh, why code when you can nerd out on PL and history?!

1:13 duncanm: dnolen: you earned your right to nerd out, you implemented core.logic ;-)

1:13 i need to implement something cool to get some brownie points too ;-P

1:17 dnolen: duncanm: I try not to take too much credit for core.logic - other people had already poured years of work into it - I spent like 6 months :P I was always surprised that Scheme folks weren't more interested in it.

1:17 duncanm: i really want to read reasoned schemer

1:17 but i have too many books

1:17 i got this other AI book a while back, barely made a crack at it

1:18 i did finish reading the Hunger Games this weekend

1:19 dnolen: you might find this fun, http://www.amazon.com/gp/product/0262061570/ref=oh_o02_s01_i00_details

1:19 dnolen: it's an AI book, with lisp code

1:19 dnolen: i think it came up in a fonc thread

1:20 "After working through Building Problem Solvers, readers should have a deep understanding of pattern directed inference systems, constraint languages, and truth maintenance systems."

1:20 sounds like a good deal, right?

1:20 dnolen: duncanm: neat

2:35 echo-area: Has anyone read Agent.java? Isn't it possible some send/send-off's will be dropped when executing an action?

2:37 W.r.t. the use of the thread local variable `nested'.

3:03 wei_: I'm trying to write a DSL for making about 15 different types of rpc calls (on top of clj-http). the rpcs differ by method(get/post), headers, etc. should I use a macros (say, defrpc or with-session) or can this be done with functions only?

3:11 osa1: where can I see list of clojure gsoc projects looking for students?

3:14 ok, found it

3:50 muhoo: baffling https://refheap.com/paste/1398

3:52 Raynes: muhoo: Why?

3:52 muhoo: "baz" is not a keyword. It is a string.

3:52 Keywords *are* functions of maps.

3:52 Strings are not.

3:52 They don't magically gain that ability by being inside of a map.

3:53 Also, don't use clj-json. Use cheshire.

3:56 muhoo: aha, thanks

3:57 Raynes: muhoo: Cheshire (and surely clj-json) has an option for making the keys be keywords. You probably want that.

3:58 muhoo: that's what i thoguht it'd do by default, but i guess not

3:58 i'm using clj-json because it's built into noir

3:58 Raynes: Not in 1.3

3:58 We moved to Cheshire.

3:59 muhoo: hmm, then my project is using an old noir then.

3:59 must fix

3:59 Raynes: Well, it isn't released yet.

3:59 It's currently a beta release.

3:59 muhoo: oh

3:59 Raynes: http://clojars.org/noir

3:59 muhoo: must wait

3:59 Raynes: However, I recommend using it.

3:59 I use it in refheap and tryclojure and it is perfectly stable.

3:59 The difference is the official docs might not be completely up-to-date, but you can just ask ibdknox if something goes wrong.

4:12 Lajla: &(symbol? (symbol "I worship His Shadow"))

4:12 lazybot: ⇒ true

4:13 Lajla: &(let [some-symbol (symbol "I worship His Shadow")] (print (list '+ some-symbol)))

4:13 lazybot: ⇒ (+ I worship His Shadow)nil

4:13 Lajla: Seems legit

4:13 Is that a bug by the way?

4:14 Seems to me from the definitions on that page that symbol should barf on strings containing the characters of malformed symbols, and print should certainly not barf it out like that

4:15 gf3: ??

4:15 lazybot: gf3: Definitely not.

4:16 gf3: Lajla: I don't see anything about characters of malformed symbols

4:17 Lajla: gf3, look at what it prints

4:17 "(+ I worship His Shadow)" reading that with the reader

4:17 Would most definitely not satisfy =

4:18 &(read-string "(+ 1 2 3)")

4:18 lazybot: ⇒ (+ 1 2 3)

4:18 Lajla: Okido, ehhh

4:18 Observe the magic

4:20 &print-string

4:20 lazybot: java.lang.RuntimeException: Unable to resolve symbol: print-string in this context

4:20 Lajla: Nahh, doesn't exist

4:22 &print-str

4:22 lazybot: ⇒ #<core$print_str clojure.core$print_str@1e35be2>

4:22 Lajla: &(print-str '(+ 1 2 3))

4:22 lazybot: ⇒ "(+ 1 2 3)"

4:22 Lajla: Okido

4:22 So, where I was going at

4:23 &(let [some-datum (list '+ (symbol "I worship His Shadow"))] (= some-datum (read-string (print-str some-datum))))

4:23 lazybot: ⇒ false

4:23 Lajla: See?

4:23 &(let [some-datum (list '+ (symbol "iWorshipHisShadow")] (= some-datum (read-string (print-str some-datum))))

4:23 lazybot: java.lang.RuntimeException: Unmatched delimiter: ]

4:23 Lajla: Ohh

4:23 &(let [some-datum (list '+ (symbol "iWorshipHisShadow"))] (= some-datum (read-string (print-str some-datum))))

4:23 lazybot: ⇒ true

4:23 Lajla: Look, no spaces.

4:23 See

4:24 gf3, pingeling

5:17 echo-area: raek: ping

5:50 raek: echo-are`: pong

5:50 echo-are`: raek: Do you know the internal of Agent

5:51 raek: I think I find a fatal problem in Agent.java

5:51 DerGuteMoritz: hello everyone

5:51 I have a query!

5:52 ,(seq? [])

5:52 &(seq? [])

5:52 lazybot: ⇒ false

5:52 DerGuteMoritz: &(seq? '())

5:52 lazybot: ⇒ true

5:52 clojurebot: false

5:52 DerGuteMoritz: clojurebot: knock knock, who's there?

5:52 clojurebot: Pardon?

5:52 DerGuteMoritz: clojurebot: you mean "... very long pause ... Java"

5:52 clojurebot: excusez-moi

5:52 DerGuteMoritz: that's more like it!

5:53 anyway, what does the seq? predicate mean?

5:53 ,(doc seq?)

5:53 clojurebot: "([x]); Return true if x implements ISeq"

5:53 DerGuteMoritz: does it want to tell me that vectors don't implement ISeq?

5:54 this seems to be the case indeed

5:55 can anyone shed light on why this is the case?

5:55 and what use seq? has?

5:59 amalloy: DerGuteMoritz: seq? checks for "listiness"

5:59 &(map seq? [(range) '(1 2 3) [1 2 3]])

5:59 lazybot: ⇒ (true true false)

6:00 DerGuteMoritz: so why don't vectors implement ISeq

6:00 ?

6:00 hm

6:00 it's a bit surprising

6:00 but if ISeq is the "listiness" interface, well ...

6:00 then it makes sense, of course

6:00 amalloy: because they're not seqs, they're seqable

6:00 DerGuteMoritz: aha!

6:01 what interface signifies seqability?

6:01 I know I can use seq to check

6:01 but this does some implicit conversion, too

6:01 amalloy: that's not a question with a clean answer, unfortunately

6:01 DerGuteMoritz: ok, so sticking to seq it is, then

6:02 amalloy: there's no single interface, because java-land things like strings and arrays have to be seqable but can't implement your interfaces

6:02 DerGuteMoritz: ah, right

6:02 oh boy

6:02 well, we could have a seqable? predicate

6:02 amalloy: $google dnolen seqable protocol

6:02 lazybot: [#clojure log - Dec 01 2009] http://clojure-log.n01se.net/date/2009-12-01.html

6:02 amalloy: hmph

6:03 http://dosync.posterous.com/51626638

6:04 DerGuteMoritz: ah, right, I even remember reading this post

6:05 perhaps this should be folded into clojure.core?

6:05 is there a ticket for that?

6:18 raek: echo-are`: I have looked through the code some time

6:19 echo-are`: have you described the problem on the clojure-dev mailing list?

6:26 tomoj: interesting trick: since the clojure log search is google custom search, one can (among other things) sort and filter by date

6:28 I suppose I will have to scrape this and make pretty pictures

6:31 http://www.google.com/cse?cx=partner-pub-1237864095616304%3Ae7qm3gycp2b&ie=UTF-8&q=tomoj&sort=date:a

6:48 echo-are`: raek: No, only clojure google group now

6:51 fliebel: how would I convert 2 bytes to an integer? I got them from somewhere primitive, and they represent a word.

6:52 clgv: fliebel: shifting the higher one 8 times?

6:52 and then add them together^^

6:54 fliebel: clgv: hm.. lets try

6:55 &(+ (byte 0) (bit-shift-left (byte 1) 8))

6:55 lazybot: ⇒ 256

7:19 echo-are`: raek: It seems that `nested' is only seen as non-null value in the thread _that executes the action_, so there is no such problem I described.

7:20 Hmm, understanding such concurrent programs is a bit hard

7:49 fliebel: clgv: erm, java bytes are signed, right? :(

7:50 clgv: fliebel: their output via system.out.print is signed. but you know the mechanics of two-complement?

7:52 fliebel: clgv: two-complement? I kinda know how the bist should behave, I think...

7:52 anyway, with your trick, I end up substracting up to 127 from my value.

7:53 &(+ (byte -20) (bit-shift-left (byte 1) 8))

7:53 lazybot: ⇒ 236

7:53 clgv: fliebel: well you can first cast it to int or long before shifting

7:53 fliebel: &(+ (int -20) (bit-shift-left (int 1) 8))

7:53 lazybot: ⇒ 236

7:54 clgv: looks about right

7:55 fliebel: clgv: well, depends on what you want. That -20 is actually a 148 or so.

7:56 clgv: fliebel: ah you have a signed byte value that hass actually an unsigned intepretatioN=

7:56 fliebel: clgv: Right. Maybe <<< would help?

7:58 &(bit-and -20 0xFF)

7:58 lazybot: ⇒ 236

8:00 clgv: fliebel: you could just add 128

8:01 uhm or I am confused now^^. have to make an example...

8:01 fliebel: clgv: I think you are.

8:02 clgv: 0xFF = -1 as signed byte. ok adding would be wrong ^^

8:03 bit-and looks fine

8:06 fliebel: clgv: yay, works! I now have BASIC and JVM running on top of ARM and PIC chips talking to each other over I2C.

8:08 clgv: fliebel: a what? I guess you'll be blogging about it? ;)

8:09 fliebel: clgv: I'll at least post a video of it driving around.

8:09 clgv: Not to much Clojure is involved though.

8:39 _phil: what web server supports ajax out of the box?

8:40 bradwright: Ajax is just HTTP, so all of them?

8:40 clgv: _phil: everyone, since its only javascript html xml?

8:41 or json ;)

8:42 vojd: _phil: AJAX is basically just an HTTP-call made through an object called XML Http Request

8:43 _phil: yes ofc :) the only thing i need the server to support is a custom timeout per http connection... is this easily done with noir, ring etc?

8:45 vojd: _phil: indeed so, jetty would probably be the actual webserver while noir is the framework :)

8:46 _phil: ah, sounds logical :) last question, what is the preferred web server framework right now? should be as lightweight as possible for my needs

8:47 vojd: _phil: think of it as: noir holds your code and ring passes data between your code and the webserver which is jetty

8:48 _phil: i would say Noir but then again i haven't examined the other clojure frameworks out there

8:48 _phil: vojd: thanks a lot :)

8:49 vojd: _phil: you're welcome! :)

8:51 antares_: _phil: http://webnoir.org/ is probably your best starting point. Compojure and a few others are also good (especially for API services) but lower level.

8:52 _phil: antares_: im checking aleph right now, the event driven architecture seems cool

8:53 antares_: _phil: aleph is not really a web framework

8:53 _phil: antares_: but it does have http serving functionality?

8:54 antares_: _phil: last time I tried it it was very rough around the edges (the HTTP server and client part). But it was a long time ago, maybe a bit over a year.

8:54 gfredericks: it's definitely been worked on since

8:54 antares_: _phil: event-driven is oversold by node.js kids. I suggest that you start with "boring" Noir and Jetty and only go event-driven if you really need to.

8:55 gfredericks: I used aleph to do some proxy stuff

8:55 antares_: gfredericks: the networking part is solid, no doubt about it

8:55 I only was referring to the http bits

8:55 gfredericks: I did use the http bits

8:55 _phil: antares_: what are the disadvantages of being event driven? i havent done much backend work so id like to know more :)

8:56 harder to organize sequential logic?

8:57 antares_: _phil: harder to manage state. In Clojure and Erlang it is a lot saner than in other languages but still fairly hard for any non-trivial logic

8:58 _phil: plus, there are so many different approaches to concurrency on the JVM (including all kinds of async approaches) that you don't have to use tools like aleph to get most of the benefits

8:58 the most ridiculous part about event loops is that if something blockes them, you are completely screwed

8:58 *blocks

8:58 fdaoud: _phil: ring is the lowest-level framework; compojure builds on top of ring; and noir builds on top of compojure. if you're in for the long run, I think it's worth having at least a basic understanding of what each part does.

8:58 antares_: but aleph and clojure suffer from this a lot less, fortunately

9:00 _phil: fdaoud: ill definately do more research before i chose a framework... but what im after is definitely something as low-level as possible

9:01 antares_: so if a request handler writes to a database and the database takes forever all other requests are gonna have to wait for it?

9:02 antares_: _phil: why? if requests are submitted to a thread pool, they will be executed concurrently

9:02 fdaoud: _phil: ring is the lowest-level, gives you control over everything. compojure is nice to add on for convenience, and you still have access to ring.

9:03 antares_: _phil: typically app servers like Jetty take care of a lot of things like that for you, unless you are after Web Scale, you often won't have to think about it for a long time

9:03 _phil: antares_: so what did you then mean by if something blocks the event loop youre screwed?

9:03 fdaoud: and then noir gives you even more convenience.

9:04 antares_: _phil: event loop is basically a while(true) { poll for events; run callbacks if any } kind of thing

9:04 _phil: fdaoud: yeah i like to have control and a good understanding of everything before "going up a step"

9:04 antares_: so when a callback takes forever to write to a database all other callbacks are gonna have to wait, right?

9:04 antares_: _phil: if your thread that does it is blocked by one of the callbacks and your runtime does not let you start new threads, you are completely screwed. if your network protocol has hearbeats, for example, they won't be delivered

9:05 _phil: yes. But I was mostly referring to tools like twisted, eventmachine or node.bs

9:05 aleph has plenty of tools to work around it on the JVM and I am sure they use some of them

9:06 but in general, event-driven frameworks require so much ceremony that often I just don't see the point in using them

9:06 proxies are an exception

9:06 some systems are inherently event-driven, though

9:07 fdaoud: antares_: node.bs? :D

9:08 antares_: fdaoud: well it is bs, isn't it

9:08 _phil: antares_: well im doing a little project on the side mainly in order to learn about the more tricky parts of writing a backend, and scalability is definitely one of them so maybe thats a plus in my case...

9:08 fdaoud: antares_: that's funny.. reminds me of when the .NOT platform came out..

9:08 antares_: _phil: if your goal is to learn, then just start with anything that seems fun

9:09 fdaoud: .NOT has wide applicability and lots of languages, tools and so on. .bs has one approach to everything and applicability as wide as Web Scale websites

9:09 clgv: Yo dawg, we herd you liek web scripting, so we put some JS into your PHP so you can script while you script! ;) :D

9:41 edw: 09:07 *** solussd JOIN

9:41 D'oh.

10:08 Chiron: Hi, would you please have a look at this question? http://stackoverflow.com/questions/9891155/how-to-share-a-dependency-that-isnt-in-clojars

10:10 gtrak: Chiron, you can 'lein install' it

10:11 rhc: Chiron: or you can add it to the project in the 'checkouts' directory

10:11 if you want to avoid 'lein install'ing it

10:13 Chiron: the team don't have a central repository, so I guess lein install won't help

10:13 cemerick: Chiron: answer posted.

10:16 Chiron: I see, thanks

10:17 cemerick: Chiron: FWIW, the project looks pretty well fleshed out given its documentation, etc. You might be able to needle the maintainer to produce a proper release.

10:26 Chiron: when I run lein repl inside a project, what this is going to offer to me?

10:26 gtrak: flowers

10:27 m0smith: morning

10:29 I am writing a noir app and want to do user authentication and authorization, any suggestions?

10:29 gtrak: Chiron, just messing with you, but, what's the question? lein repl runs a repl, but it'll use your project.clj to configure the classpath, ie you'll have all your dependencies

10:30 Chiron: Ok, I see. sorry but I'm pretty new to Clojure / Lein world

10:31 m0smith: have you check apache shiro?

10:31 m0smith: chiron: nope, not yet

10:32 cemerick: m0smith: I'm in the process of fleshing out a Clojure library for exactly that

10:32 m0smith: cemerick: what are you basing it upon?

10:32 fdaoud: oh yeah

10:32 I remember cemerick you mentioned that yesterday

10:32 m0smith: no Google IO this year for me apparently

10:33 Chiron: speaking of Noir, doesn't it support templating system (like freemarker, thymeleaf)?

10:33 cemerick: m0smith: nothing; neither shiro or spring-security are suitable if you're building a mostly-Clojure webapp IMO.

10:33 fdaoud: Chiron: yes, via hiccup

10:33 Chiron: but with hiccup I'm going to build the page by hand coding, right?

10:33 cemerick: Chiron: right, hiccup is the default, but you can use anything you like

10:34 Chiron: (html: div: span:) for example

10:34 m0smith: chiron: I am using stencil for the markup

10:34 fdaoud: Chiron: what do you mean? freemarker doesn't build templates for you, you still have to write them..

10:35 Chiron: I was unclear, I saw a couple of hiccup examples. to build pages, they use hard-coded clojure forms

10:35 m0smith: cemerick: I am interested in what you are going to be doing then, security wise. that is a long row to hoe.

10:35 cemerick: m0smith: yes and no

10:36 fdaoud: Chiron: you can do dynamic stuff of course!

10:36 Chiron: you mean with Noir, I can forward the request to a template page?

10:37 fdaoud: Chiron, like [:ul (for [item items] [:li (item :name)])]

10:37 Chiron: yes for example

10:38 fdaoud: Chiron: well, your templates are in Clojure code, so you define functions to produce them, and call them from the place where you handle the request

10:38 cemerick: m0smith: with not too much trouble, I have a basis for a Clojure analogue to everyauth / warden. People that build the workflows for each authentication method (e.g. oauth, facebook, dropbox, etc etc) have the harder job.

10:39 Chiron: Thanks a lot, forgive my ignorance :)

10:39 cemerick: the base library has simple form-based authentication, HTTP Basic, and role-based authentication middleware, macros, etc.

10:39 m0smith: cemerick: I gotta run but can you send me an email.

10:40 fdaoud: Chiron: no problem, I understand it can be a bit to wrap your head around

10:40 m0smith: where I can see it, when you are ready

10:40 cemerick: m0smith: better to just follow http://twitter.com/cemerick

10:41 m0smith: will do thinks

10:45 edw: I was pointed to an generic templating library recently, and I can't remember the damn name. It's an extremely simple, elegant library. But I forget the name.

10:47 fdaoud: edw: clojure or something else? was it stencil?

10:47 gtrak: edw, stringtemplate?

10:47 there are some things I don't like about it, but it's quite fast

10:48 actually, I may use it to solve my current problem now that you've reminded me of it :-)

10:48 babilen: edw: What kind of "templates" are you talking about? enlive (html templating) comes to mind as well ...

10:48 edw: It had a nice short name. Maybe four chars.

10:49 cemerick: edw: https://github.com/weavejester/comb ?

10:49 edw: Yes!

10:49 Thank you!

10:49 fdaoud: *ding ding ding ding ding*

10:49 edw: I went through his list of projects but missed it.

10:51 fdaoud: no offense but that can get ugly fast.. and we're back to JSP 1.0 :P

10:52 babilen: edw: What do you plan to use it for?

11:01 pandeiro: anyone know what causes the SLF4J StaticLoggerBinder error when starting a Noir server? I had this problem before but forget what I did to fix it... lein clean didn't do it

11:04 fdaoud: pandeiro: maybe something along the lines of excluding commons-logging or other logging frameworks from another dependency?

11:08 pandeiro: fdaoud: nice call i saw commons-logging in there somewhere

11:14 fdaoud: pandeiro: :)

11:38 simard: I have some java code running in its own thread that calls an exported static function of a clojure class (:gen-class). On some computer, this works fine, while on another that has more cores, this crashes with a "java.lang.ExceptionInInitializerError" caused by a "java.lang.NullPointerException". Running the program with java -verbose reveals clojure defs are still being loaded when this happens, and the actual function I'm trying to

11:38 call from java has NOT yet been loaded, resulting in the exception. Does this description of the problem ring a bell to anyone ? Note that this is my interpretation of what's happening, I could be wrong about it.

11:53 patrikkarlin: http://browserquest.mozilla.org/ :D

12:05 dnolen: patrikkarlin: neat

12:07 patrikkarlin: killed the final boss yet :D

12:09 gfredericks: (defmacro if [cond t f] `(({true (fn [] ~t) false (fn [] ~f)} (boolean ~cond))))

12:17 jimduey: dnolen: I got a version of core.logic working with fork/join. Only fresh, all and conde work, though.

12:17 Tabling doesn't, though it could.

12:17 _phil: is it possible to auto-reload some namespace in an aleph handler? so i dont have to start / stop the server all the time

12:17 jimduey: conda and condu seem to me of limited use in a multi-threaded scheme.

12:18 And it searches the entire search space, so (run n ...) is irrelevant.

12:21 dnolen: jimduey: WHOA! is this all in your fork?

12:22 jimduey: not yet. will push shortly.

12:23 dnolen: jimduey: excellent! I'll create a fork-join core.logic branch as soon as you do and take an extended look later.

12:24 jimduey: BTW, your fj.clj gist made it a breeze. :)

12:24 dnolen: jimduey: heh, excellent I was trying to look for that for you the other day :)

12:28 jimduey: dnolen: Just pushed. It's on the master branch of my fork. Lots of polishing is needed. Deleting #_ code and the like.

12:29 dnolen: jimduey: mind creating a fork-join branch w/ the changes as well so I can track that?

12:30 jimduey: Performance on the zebra benchmark is on par with standard core.logic. Overhead of splitting work up, I suspect.

12:30 There's now a 'fork-join' branch on my fork.

12:30 I guess I should do a blog post about it now. :)

12:32 dnolen: jimduey: whoa perf parity is incredible, can't wait to dive in and see if we can't optimize :)

12:33 jimduey: a million thx for taking this on! :D

12:34 jimduey: my pleasure. Leveled up on my grasp of the continuation monad.

12:34 gtrak: oh cool, it's implemented with continuations?

12:35 jimduey: Yeah, except I ended up removing the monad because I didn't need it anymore after I understood the semantics.

12:36 gfredericks: you refactored away a monad?

12:36 dnolen: jimduey: hmm ... that's a good blog post - monad as tool for thought!

12:36 jimduey: dnolen: I'd be real interested in optimizations since I basically stripped out everything I could.

12:37 gfredericks: Yep. Using the monad, I limited the complexity in the code to just a few places. Then, as an optimization I just inlined that code.

12:37 romanandreg: Is "extend-protocol" supported on INamed, ISeqable, etc on Clojurescript? I'm getting a JS error saying their prototypes are undefined :-/

12:37 dnolen: jimduey: it would be absolutely lovely to hear the entire development process - starting with the monad, your insight and then it's removal :)

12:37 gfredericks: jimduey: that's cool

12:38 jimduey: Well, I guess I know what I'm doing the afternoon. :)

12:40 `fogus: dnolen: or maybe monad as thought-exercise for tools. ;-)

12:40 :-O

12:41 jimduey: just kidding sir

12:41 jimduey: LOL

12:47 dnolen: romanandreg: CLJS prototypes are not backed by anything like interfaces so that's not going to work.

12:48 romanandreg: dnolen: meh :-/... so if I want to make a protocol extension for all seq-like types I have to write one by one right?

12:48 dnolen: romanandreg: if you absolutely need that feature you'll have to handle that in the default case - this is actually done in CLJS core.logic

12:48 romanandreg: dnolen: what is the type you are using there? object?

12:48 dnolen: (extend-type default ...)

12:49 romanandreg: dnolen: uhmm… and then you do (if (extend-protocol? X ob) …)?

12:49 dnolen: satisfies?

12:50 romanandreg: https://github.com/clojure/core.logic/blob/master/src/main/cljs/cljs/core/logic.cljs#L390

12:50 I use sequential? here, but really it's just a call to (satisfies? ISequential x)

12:51 `fogus: Every time I want to dig deeply into core.logic it takes some massive leap forward!

12:51 romanandreg: dnolen: exactly I meant that… well that should do it for now I guess, any plans in the future to emulate "interfaces" in cljs, is that even possible?

12:52 `fogus: I don't even try yet… I have to go through the reasoned schemer first hehe :-/

12:52 `fogus: I've done that part, but now I feel like I might need to read it again ;-)

12:52 dnolen: romanandreg: probably not possible, interface inheritance actually brings it's own bag o' works.

12:52 romanandreg: that said, predicate dispatch can save us all :D

12:52 bag 'o worms I meant

12:53 `fogus: I hope that Manning commissions a 2nd edition of JoC, I would love to add a chapter on core.logic

12:53 dnolen: `fogus: EPIC post

12:53 `fogus: dnolen: Thanks man

12:53 http://himera.herokuapp.com/index.html

12:53 Many bugs, but useable

12:53 romanandreg: dnolen: :-), how far are you from the presentation you had last Clojure Conj, I saw some real challenges there?

12:53 muhoo: um, what post is epic?

12:54 `fogus: I hope this one http://blog.fogus.me/2012/03/27/compiling-clojure-to-javascript-pt-3-the-himera-model/

12:54 pandeiro: lynaghk: any idea how i could debug geo->svg in c2? even with your vomnibus.geo.us/states (geo->svg (second (first us/states))) is returning nil... i notice it works as expected in vrepl but not in my server code or at the slime repl

12:54 dnolen: romanandreg: sadly, not very far I've been working on ClojureScript a lot lately as you can probably tell. But the major pieces really are there.

12:54 antares_: `fogus: I am curious why you spell Himera in Russian?

12:54 dnolen: `fogus: man, himera is PURD-EEE

12:55 `fogus: antares_: ?

12:55 antares_: `fogus: in the tweet

12:55 `fogus: Just for giggles

12:55 gfredericks: `fogus: is that heroku link supposed to work?

12:56 muhoo: that is indeed very cool!

12:56 romanandreg: dnolen: yeah, CLJS has required some work, hehe

12:57 dnolen: thanks for the feedback, I know now where I'm standing

12:57 `fogus: gfredericks: which link?

12:57 gfredericks: `fogus: second paragraph, "Himera on Heroku"

12:57 links to http://warm-wind-7890.herokuapp.com/index.html

12:58 `fogus: gfredericks: Thanks. Will fix

12:58 gfredericks: np

12:58 mk: why is not-empty implemented as (when (seq coll) coll), when empty specifies that its opposite is (seq coll) ?

12:58 `fogus: gfredericks: http://himera.herokuapp.com/index.html is the sauce

12:59 gfredericks: `fogus: cool, thanks!

12:59 mk: I mean "empty?"

13:00 pandeiro: `fogus: is the right third of the console div being used for anything?

13:00 fdaoud: mk: empty? is implemented as (not (seq coll))

13:00 `fogus: pandeiro: no. the console needs some love.

13:01 fdaoud: mk: you were right the first time, it is not-empty that is (when (seq coll)).

13:01 mk: ,(doc empty?)

13:01 clojurebot: "([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"

13:01 mk: so the documentation seems outdated, because there's a not-empty function that presumably should be used instead of (seq x), right?

13:02 but, strangely, that function is implemented using (when (seq coll) coll) - why?

13:02 TimMc: welp

13:02 I guess I don't need to work on TryCLJS anymore.

13:03 muhoo: i can see this being turned into something like a jsfiddle

13:03 pandeiro: `fogus: i see the purpose is to introduce cljs, ergo the cheatsheet, but i still think a setup like jsfiddle where folks could actually throw html, css, and code together would be the best way to let people really try out cljs

13:03 fdaoud: I thought RH said in his talk that ClojureScript isn't for TryCLJS? ;)

13:03 muhoo: pandeiro: jinx

13:03 TimMc: fdaoud: Too bad!

13:03 pandeiro: muhoo: i was on this rant 2 months ago at least! :)

13:04 but yeah, `fogus pardon me for the unsolicited suggestion... awesome work as it is

13:04 fdaoud: pandeiro: +1, with the optional availability of Google Closure or (yes, no sense in pretending it's not popular), jQuery

13:04 muhoo: pandeiro: my guess is you'll be solicited for pull requests if you keep up the suggestions :-)

13:05 `fogus: pandeiro: Agreed. A project for another day perhaps

13:05 dnolen: `fogus: Himera! just in time for my NYC.js and JSConf talks :)

13:05 `fogus: muhoo: I solicit pull-requests with impunity

13:06 muhoo: as well you should. this is great work, i'm sure it'll breed many forks.

13:06 pandeiro: yes it's an awesome base

13:06 patrikkarlin: dnolen: anny talk i can watch streamed?

13:06 `fogus: muhoo: I hope so!

13:06 dnolen: patrikkarlin: JSConf for sure

13:07 patrikkarlin: dnolen: you gonna talk about clojureScript?

13:08 pandeiro: fdaoud: seems like he's already got jQuery in there... js/jQuery?

13:09 dnolen: patrikkarlin: yes - but I only have 20 mins or so, so it'll be kind of high level about JS & Lisp with hopefully enough tasty tidbits to encourage people to play around with Himera :D

13:10 jimduey: fogus: re. core.logic. It'd be great to see it in JoC. It's an awesome piece of code that does some amazing things. And it's really simple at the core of it.

13:10 dnolen: jimduey: speaking of which, glad you found the code approachable.

13:11 jimduey: Actually, I just deleted all the stuff I didn't understand. :)

13:11 dnolen: jimduey: haha, that works too :)

13:11 fdaoud: pandeiro: golly gee you're right.. try (-> (js/jQuery "div") (.remove))

13:11 jimduey: Seriously, it's great code and I need to go back and read Byrd's thesis.

13:11 fdaoud: *poof!*

13:13 jimduey: I'm pretty sure tabling could be added back to the fork/join version. But I'm kind of burned out on that ATM. So I'll leave that to you. I'd be glad to talk about it later.

13:14 dnolen: jimduey: not a big deal - I ran into the same thing with CLJS core.logic, disequality, tabling still need to be done. All in good time.

13:14 jimduey: disequality was actually easy to do with fork/join.

13:14 At least all the unit tests pass.

13:14 dnolen: jimduey: that's good to hear.

13:15 jimduey: Will Byrd is already very, very curious about your work ;)

13:17 jimduey: Seriously? It actually doesn't seem that big a deal.

13:18 dnolen: jimduey: well they tried with explicit threads and of course that didn't work - so this is a big deal for them.

13:19 jimduey: I mean, the concept could be described pretty succinctly. The hard part was getting my head far enough into continuation to actually implement it.

13:19 Which is what the monad really helped with.

13:20 dnolen: jimduey: I'll definitely direct Will & Dan to your post when it goes up, they'll be interested in your story.

13:21 jimduey: Ok. Working on it now. Hopefully in a couple of hours.

13:22 mk: is there any difference at all between (when (seq coll) coll) and (seq coll) ?

13:23 Bronsa: ,(let [coll [1]] [coll (seq coll)])

13:23 clojurebot: [[1] (1)]

13:27 mk: I see, thanks

13:28 fdaoud: cljs question: I have a map that is the resource bundle for the web app, either in english or french. It is constructed on the server according to the user's language. Now, I want to use that on the client side in cljs.. how do I do this without getting into a mess?

13:29 gfredericks: interesting himera error when I enter (/ 3 4)

13:29 dnolen: fdaoud: a Clojure map? just print it and send it to the client and use the cljs reader to read it.

13:30 patrikkarlin: gfredericks: to much recursion?

13:30 fdaoud: dnolen: ok..in the context of an ajax request?

13:30 gfredericks: patrikkarlin: but what's so recursive about it?

13:31 dnolen: fdaoud: absolutely

13:31 patrikkarlin: gfredericks: its in the compilation not the function call

13:31 gfredericks: it says on github: ClojureScript's / function is not munged properly

13:32 dnolen: fdaod: (cljs.reader/read-string (.-responseText xhr))

13:32 gfredericks: patrikkarlin: oh gotcha

13:32 fdaoud: dnolen: I'm with you so far, but how do I now handle the synchronization of it all? I have to make sure no one tries to use the map before the ajax call has completed..

13:33 dnolen: fdaoud: CLJS doesn't ship out the box with tools to deal w/ async issues - you'll have to sort that out the same way you would in JS

13:34 fdaoud: dnolen: I see. when I was in straight JS, I was just printing out the map (as json) into the page, so generating javascript code really.

13:35 dnolen: I suppose I could use an atom..

13:35 hhutch: fdaoud: have you seen fetch?

13:36 fdaoud: hhutch: yes

13:37 hhutch: doing the ajax part is fine. it's the sync of it all that I'm worried about

13:38 how do I make sure the call to get the language map has completed before the other calls try to use it, without getting into a callback mess

13:38 gfredericks: you could go back to printing it to the page

13:38 as a sexp string

13:39 fdaoud: perhaps everyone could subscribe to an "i18n" event, and the ajax call fires it when the map has loaded

13:39 gfredericks: true, that is probably the simplest solution

13:42 dnolen: thank you

13:42 gfredericks: fdaoud: you'll still have to use read-string of course

13:43 dnolen: fdaoud: np

13:46 mk: what are 'if and 'do style forms called?

13:47 gfredericks: oh no he did not just use the word "furcated"

13:47 fdaoud: gfredericks: right, thanks

13:47 gfredericks: mk: special forms? symbols?

13:48 mk: gfredericks: I'm looking at (list 'if true [1 2 3]) and am confused... for some reason

13:49 gfredericks: mk: sounds like you're looking at a macro?

13:49 mk: gfredericks: mystery solved - thanks :)

13:49 gfredericks: np

13:54 pandeiro: once you've defined a var (non-dynamic) at the SLIME repl that's it, no changing it?

13:55 gfredericks: you can change it

13:55 but only globally

13:55 you can't use it with (binding)

13:55 pandeiro: i can't re def it, slime throws an error

13:55 gfredericks: (which has only thread-local effects)

13:55 then I don't know what's going on

14:11 solussd: any korma users in the room? :)

14:12 sorenmacbeth: technomancy: fixes for both of my major lein headaches in 1.7.1. thank you for that!

14:13 technomancy: sorenmacbeth: great!

14:13 hopefully that's the last release for the 1.x branch

14:14 chouser: Interesting that there's no deref-apply

14:14 (defn deref-apply [iref f & args] (apply f @iref args))

14:26 eggsby: when people say 'mapreduce' they mean to first map a function over a list and then reduce it to a single value by means of some other function?

14:28 rhc: eggsby: sorta, they mean an algorithm that can be described by a series of map and reduce operations

14:31 eggsby: ah rhc so what I described was one possible (the simplest possible?) mapreduce?

14:31 edw: Hey guys, I'm doing some tech recruiting for the start-up I'm working for. If you're in NYC and looking for an opportunity, please check out http://actionx.com/tech-jobs.html

14:32 zakwilson: mongodb, eh? Where's my 11 foot pole?

14:32 edw: Yeah, yeah, yeah.

14:32 muhoo: hmm, i tried cheshire, got this: VerifyError class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B java.lang.ClassLoader.defineClass1 (ClassLoader.java:-2)

14:33 uppon use

14:33 fdaoud: zakwilson: mongodb specifically or NoSQL in general?

14:33 edw: Cassandra is the shit, yes, yes...

14:33 muhoo: whoops, nm. i imported the wrong ns

14:33 zakwilson: fdaoud: mongodb ate my data.

14:33 muhoo: though i gives the same error if i do :-<

14:33 edw: zakwilson apparently missed the "right tool for the job" reference.

14:33 juhu_chapa: edw: nice site!

14:34 edw: Thanks. So far every bit on it is mine.

14:34 fdaoud: zakwilson: so you don't have anything against NoSQL or documented-oriented or whatever persistence?

14:34 edw: (Trying to change that; I'm the product designer/manager who happens to be a fine art programmer.)

14:35 zakwilson: fdaoud: no, not in principle. I have something against mongodb for losing data in a situation that should have been pretty low-stress for any data store.

14:36 fdaoud: zakwilson: ok, I was just curious. I have yet to try a NoSQL (if that is the right appelation) persistence solution.

14:36 zakwilson: fdaoud: I hate the term NoSQL. The filesystem is a "NoSQL persistence solution". I have nothing against document stores though.

14:37 cemerick: "nonrelational database" seems like a much more sensible term to me.

14:37 zakwilson: In fact, something just like MongoDB that didn't lose my data would be a great fit for a lot of Clojure apps since the data types line up nicely.

14:37 gfredericks: so apparently "CoSQL" never took off

14:37 * technomancy hums the http://vimeo.com/11852209 song

14:37 zakwilson: Don't call it what it isn't. Call it what it is: document DB, column store, graph DB, etc...

14:38 fdaoud: zakwilson: so is "document store" a better term for CouchDB, MongoDB, etc.?

14:38 zakwilson: fdaoud: Yes, I think so.

14:39 fdaoud: zakwilson: fair enough. I don't have anything against SQL so I don't particularly like "NoSQL" either, as if SQL was evil or something.

14:39 juhu_chapa: edw: you are the almighty.

14:39 zakwilson: fdaoud: I have something against SQL. I think the language is *awful*. I don't have anything against relational databases though.

14:40 fdaoud: zakwilson: ok. I don't mind SQL but I'm not passionate about it so I won't argue. :)

14:41 muhoo: it's sad when you google an error message, and the only reference you find is yourself answring the question.... and no answer

14:41 zakwilson: fdaoud: fortunately, on Clojure we have Korma and don't have to do much actual SQL.

14:41 muhoo: https://refheap.com/paste/1410

14:41 RickInGA: technomancy: thanks, that was very educational

14:42 technomancy: RickInGA: now you know all you need to know about non-relational data stores.

14:43 RickInGA: actually, I think all I need to know is when to use them instead of relational. I have read articles on the subject and am still not sure

14:43 seems like

14:43 seems like 'big stuff' is the general answer

14:44 technomancy: depends where you're deploying

14:44 pandeiro: strange bug: a fn returns nil given param a, then i re-evaluate the same fn (from the same jar) in slime and it returns non-nil given param a.

14:44 * cemerick facepalms @ the couchio rap

14:44 technomancy: big stuff is the only place where you can't use SQL, but there are smaller cases where something like couch would be more convenient, just probably not as well-supported by sysadmins etc.

14:45 cemerick: technomancy: too bad 'leiningen' is so hard to lay down a rhyme for

14:45 fdaoud: zakwilson: on wikipedia they distinguish between "document store", "graph database", "key-value store", and "object database"

14:45 pandeiro: cemerick: sighin' again

14:45 pjstadig: cemerick: fleiningen, zeiningen, shinengen

14:45 muhoo: cemerick: oh, it could be worse: http://www.youtube.com/watch?v=NbTEVbQLC8s

14:45 zakwilson: fdaoud: yes, those are common types of databases that aren't relational.

14:46 There are also column stores, which I briefly understood and now do not due to never having had to use that information.

14:46 cemerick: muhoo: wow, you're right

14:48 muhoo: well, sadly, cheshire is a non-starter for me.

14:48 can't get the damn thing to even load

14:50 Raynes: i tried though

14:51 gtrak: I'm trying to execute generic shell commands and having some trouble, is there a more right way to do what I'm trying to do? https://gist.github.com/2219080

14:51 TimMc: muhoo: I had no trouble with Cheshire.

14:53 zamaterian: cemerick, have you had time looking over my pr for pomegranate ?

14:54 joegallo: gtrak: remove the str call.

14:54 and i don't think you need escaped quotes

14:55 gtrak: ah, (sh "sh" "-c" "\"ls -l\"") seems to work

14:56 joegallo, why wouldn't I need quotes? in a real shell, I do

14:56 cemerick: zamaterian: join me in #leiningen :-)

14:56 joegallo: wfm

14:56 fdaoud: so what is the best "document store" for clojure?

14:56 gtrak: it works in clojure without them, but that seems odd

14:57 joegallo: in your shell, you need to be able to tell one argument from another.

14:57 zakwilson: fdaoud: that may depend on what you're trying to do with it.

14:57 TimMc: gtrak: Quoting is only necessary when you are using a command line.

14:57 joegallo: in java, when you are runtime/exec'ing, you don't. 1 string = 1 arg.

14:57 gtrak: ah

14:57 TimMc: sh takes pre-parsed args

14:57 gtrak: learn something every day :-)

14:58 fdaoud: zakwilson: point taken. say I am trying the simplest possible solution just to "try things out". as Sqlite3 is to a relational db.

15:00 zakwilson: fdaoud: I hear couchdb is great for lazy people. I'm not sure about using it from Clojure.

15:01 pandeiro: couchdb is cool but you have to write some javascript (or set up the clojure view server) to query your data

15:01 cemerick: pandeiro: not true; see https://github.com/clojure-clutch/clutch-clojurescript

15:02 pandeiro: cemerick: sorry, that's right, been meaning to check that out again

15:03 fdaoud: and actually you could also use couch's _all_docs?include_docs=true in lieu of a design document with views and stuff

15:03 dakrone: muhoo: what issues are you seeing with cheshire?

15:03 pandeiro: if you're just testing it out i mean

15:04 is it idiomatic to nest (defn ...)s?

15:04 Bronsa: no

15:15 emezeske: Noo! We're back to level zero on the "Don't Reply to the Alternative set literal syntax Thread" achievement!

15:15 Zoka: pandeiro: nested (defn ..) is still vidible outside, can be bit misleading

15:15 s /vidible/visible/

15:16 pandeiro: Zoka: huh b/c i'm seeing the weirdest behavior with the geo->svg fn here: https://github.com/lynaghk/c2/blob/master/src/clj/c2/geo/core.clj

15:17 when i require the ns and call that fn, it only returns nil, but if i highlight and eval the fn explicitly, it works as expected

15:21 beffbernard: How do you run an app from command-line from lein uberjar w/o using :gen-class

15:21 ?

15:23 TimMc: beffbernard: There's probably some way to use the clojure.core jar as your entry point and then tell it to call some main method over in your uberjar, but...

15:23 beffbernard: it may be easier to use lein-otf to make a mostly-non-AOT uberjar: https://github.com/timmc/lein-otf

15:24 beffbernard: TimMc: What's the canonical way to launch a clojure process?

15:24 TimMc: pandeiro: I'm not surprised, nested defns do weird shit.

15:25 pandeiro: TimMc: thank you for returning a tiny part of my sanity

15:25 TimMc: beffbernard: On what code format? lein run for projects, java -jar for an uberjar

15:25 beffbernard: TimMc: From a line project

15:25 TimMc: beffbernard: lein run

15:25 beffbernard: s/line/lein

15:25 TimMc: Even in prod?

15:25 TimMc: beffbernard: specify a :main in your project

15:29 Zoka: []

15:29 (defn b

15:29 []

15:29 (println "I am b"))

15:29 (println "I am a"))

15:29 (a)

15:29 (b)

15:29 noirmon.server=>#'noirmon.server/a

15:29 I am a

15:29 noirmon.server=>nil

15:29 I am b

15:29 noirmon.server=>nil

15:30 Znudzon: Hi is there anyway to use enclojure with netbeans 7.1 ?

15:30 TimMc: Zoka: Please use a pastebin for non-one-liners.

15:30 beffbernard: How do you guys run clojure in prod? By using "lein run" or some other means?

15:30 TimMc: beffbernard: uberjars

15:31 or lein run, in some cases

15:31 gfredericks: bundle exec clojure go

15:31 Zoka: Sorry

15:36 Znudzon: So any idea how to work with enclojure ant netbeans 7.1 ?

15:36 beffbernard: TimMc: Gotcha.. I might still be missing something I think. In order to use the uberjar, I have to use gen-class and define :main correct? Is there a way to to eval the .clj source w/o compiling it ahead of time?

15:37 gfredericks: beffbernard: you could just compile a main ns and have the rest of your code uncompiled elsewhere

15:38 beffbernard: gfredericks: ahh, gotcha

15:39 TimMc: beffbernard: Check out the link I gave you.

15:39 SergeyD: Hi, how can I see the expansion of "definline"? The following does not work:

15:39 ,(definline ti [x] `(+ ~x ~x))

15:40 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

15:40 SergeyD: ,(macroexpand '(ti 4))

15:40 clojurebot: (ti 4)

15:40 daniel: how can i GET a url and assign the response to a variable?

15:41 gfredericks: enlive? clj-http?

15:41 TimMc: slurp

15:41 with a URL

15:42 daniel: ring?

15:42 clojurebot: ring is http://github.com/mmcgrana/ring/tree/master

15:42 beffbernard: TimMc: I left a tab open to consume later, thanks.

15:42 gfredericks: TimMc: damn

15:42 daniel: using noir, so already have ring

15:42 clojurebot: No entiendo

15:43 TimMc: clojurebot: botsmack

15:43 clojurebot: Owww!

15:43 TimMc: that's for last night

15:43 gfredericks: TimMc: I'm disgusted that that works and I didn't know.

15:44 TimMc: slurp isn't a cure-all, but it's pretty great

15:44 gfredericks: slurp is no substitute for spit

15:45 TimMc: Technically, that is correct.

15:52 ibdknox: `fogus: lol.. please stop "destroying programming" :p

15:52 I <3 people

15:59 `fogus: idbknox: I can't stop myself! Send help!

16:00 gtrak: why does everything have to be so complicated!!

16:00 ibdknox: haha

16:01 TimMc: Oh man, context?

16:01 gtrak: http://news.ycombinator.com/item?id=3762466

16:01 TimMc: wow

16:01 gtrak: he created an account just for that..

16:01 `fogus: He had a point to make dammit!

16:02 Bronsa: lol

16:02 `fogus: http://ancomment.com/

16:05 alexyakushev: Cool, I like this one: http://ancomment.com/jbzbgl

16:05 daniel: im getting VerifyError class org.codehaus.jackson.smile.SmileParser overrides final method getBinaryValue.(Lorg/codehaus/jackson/Base64Variant;)[B java.lang.ClassLoader.defineClass1 (ClassLoader.java:-2)

16:05 gtrak: haha

16:05 daniel: when trying to require clj-http in a noir project

16:05 `fogus: I want to add that to my README

16:06 dakrone: daniel: what version of clj-http and noir?

16:07 Zoka: daniel: This may be conflict related to JSON parsers

16:07 daniel: i tried clj-http 0.3.0 and 0.3.3

16:07 noir 1.2.1

16:07 i'm trying to do this https://gist.github.com/2219768

16:08 i'm wondering if i can do it without the extra library, with something already packaged in noir?

16:09 dakrone: daniel: let me see if I can reproduce it

16:10 Zoka: Noir 1.2.1 uses clj-json that needs conflicting jacskon version

16:11 dakrone: yep, that's the issue, lemme see what version that was fixed in

16:11 Zoka: I had the same problem and ended taking the nits of cheshire directly in may code

16:11 s /nits/bits/

16:11 dakrone: daniel: try 1.3.0-beta2 for the noir version

16:11 ibdknox: noir 1.3.0-beta2 uses cheshire

16:12 daniel: ibdknox: does that mean it's also conflicting?

16:12 ibdknox: daniel: hm?

16:12 daniel: with clj-http

16:13 chesire instead of clj-json?

16:13 i dont know what these libraries are or do

16:13 dakrone: daniel: no, so clj-json and cheshire are incompatible, noir used clj-json in earlier versions and clj-http uses cheshire, switching to 1.3.0-beta2 for the noir version should fix it

16:13 ibdknox: the problem is the java dependency that underlies clj-json and cheshire are conflicting

16:13 and noir use clj-json in 1.2.*

16:14 daniel: it did indeed

16:14 ibdknox: uses*

16:14 daniel: thanks people

16:14 TimMc: `lein pom && mvn dependency:tree | less` is a standard incantation for debugging this stuff

16:14 ibdknox: I'm not sure why that ended up so screwed up really

16:15 given that the major versions are the same those two jacksons should be compatible

16:15 technomancy: TimMc: or now: lein2 deps :tree

16:15 thanks to xeqi

16:15 Zoka: daniel: you can untanfgle depedencies with lein pom folowed by mvn dependency:tree

16:15 dakrone: ibdknox: jackson had some really breaking changes between 1.5.x and 1.9.x

16:15 ibdknox: I see

16:16 TimMc: technomancy: niiiice

16:17 technomancy: TimMc: should be in 2.0.0-preview3

16:17 dakrone: I need to figure out how to make cheshire an optional dependency for clj-http, instead of always pulling it in

16:17 ibdknox: daniel: one thing to note about the upgrade to 1.3.* is that it uses the new hiccup, which has reorganized a couple things

16:17 dakrone: you can do what I did with jetty

16:18 dakrone: ibdknox: that totally threw me for a loop while giving a presentation on noir

16:18 technomancy: someone ought to spike how crazy it would be to isolate stuff like that in a classloader

16:18 since these kinds of conflicts are only going to get more common with time

16:18 ibdknox: technomancy: yeah, I'm worried

16:18 dakrone: haha the way I included jetty?

16:18 technomancy: ibdknox: just never break anything, ever.

16:18 dakrone: ibdknox: do you have an example of the jetty one?

16:19 ibdknox: dakrone: I just require it inline so that you can use :exclusions in project.clj to get rid of it

16:19 dakrone: https://github.com/ibdknox/noir/blob/master/src/noir/server.clj#L70

16:19 hiredman: immutant gives each app it's own environment, so you could have 1.2 servies living with 1.3

16:20 ibdknox: hiredman: I'm more worried about intra-app

16:22 technomancy: ibdknox: even more scary is that "lein repl" now brings in clj-http and clojuredocs-client

16:22 ibdknox: oh seriously?

16:22 hiredman: ibdknox: intra-app being library level?

16:22 technomancy: ibdknox: yeah, but it should defer to the version in your project.clj if one is present

16:23 ibdknox: that jackson incompatibility is going to cause a lot of unintelligible errors there..

16:23 technomancy: better teach it to clojurebot

16:24 Zoka: technomancy: lein-wrepl & ringMOn has embedded cheshire because of this problem

16:24 dakrone: it's not really a problem, things just need to stop using clj-json :)

16:24 ibdknox: hiredman: say all of the sudden I realize I need to use x lib which has some incompatibility, I now need to do that in a separate env or refactor all of my code to remove one of them

16:25 technomancy: dakrone: was the cheshire bump to 3.0.0 around jackson incompatibilities?

16:25 I noticed the changelog was a bit short on entries for such a major bump

16:25 * dakrone goes to look at the tags

16:26 dakrone: oh, it was a significant performance boost/refactorization

16:26 technomancy: oh, ok

16:26 dakrone: and I have even more perf stuff that's in but not released yet

16:28 * technomancy better make sure lein repl gracefully degrades if it can't load cheshire/clj-http and friends

16:28 dakrone: technomancy: I will work on cheshire being an optional dep for clj-http, that should really help

16:28 technomancy: dakrone: I think that's a good idea, but that's not enough on its own

16:28 dakrone: although I guess clojuredocs-client will still need it

16:28 technomancy: yep

16:29 technomancy: looks like it gives you an error message without completely freaking out if the wrong cheshire is found

16:29 ibdknox: what about clj-json?

16:30 dakrone: ibdknox: what about it?

16:31 ibdknox: I was curious what happened if that was included as a dependency (since technomancy was trying things in the new repl)

16:32 * technomancy tries it

16:33 technomancy: whoa; it's pulling in contrib 1.1.0

16:33 I get a VerifyError printed, but the repl still works

16:33 ibdknox: huh

16:33 well that's good :)

16:33 technomancy: https://github.com/technomancy/leiningen/issues/475

16:34 ibdknox: dependencies are such a nightmare

16:34 I worked on versioning for a bit at MSFT, it made me cry

16:34 Zoka: cheshire seems to be better, for example clj-json can not convert project.clj to JSON

16:34 ibdknox: cheshire is certainly better

16:34 and what everyone should be using from here on out

16:34 buuuut there are things that still have the clj-json dep

16:35 technomancy: ibdknox: I remain optimistic that most of the problems should be addressable with classloaders

16:35 ibdknox: I don't know enough to comment :)

16:35 but I hope so, since that sounds like it might be "easy"

16:36 dakrone: that would be very nice, if it were

16:36 I suppose I should add a disclaimer on the readme for cheshire/clj-http also, that may help

16:38 technomancy: dakrone: a simple "getting a VerifyError? here's what to do!" would go a long way

16:38 dakrone: technomancy: excellent idea

16:45 ivan: are fexprs hard to implement? I ask because I tried to use `definline` without the syntax quote and unquoting, and Axis of Eval tells me fexprs are great

16:48 http://axisofeval.blogspot.com/2012/03/should-i-really-take-time-to-learn.html

16:50 I guess I should look at Kernel

16:52 dakrone: technomancy && ibdknox: I have changes for clj-http that make cheshire an optional dependency, now the only question is whether cheshire should default to being included or not

16:54 technomancy: dakrone: what's it used for?

16:55 dakrone: technomancy: json-encoding form-param bodies, and auto-decoding json responses

16:55 jimduey: dnolen: core.logic fork/join post is up: http://www.clojure.net/2012/03/26/Messin-with-core.logic/

16:55 hacker news: http://news.ycombinator.com/item?id=3763515

16:58 technomancy: dakrone: synergistic!

16:58 dakrone: technomancy: err...hooray?

16:59 technomancy: dakrone: I think I'm too out of the loop on web APIs to make the call for the default; I defer to Mr. Ibd Knox.

16:59 ibdknox: always sensible defaults!

16:59 oh, wrong question ;)

16:59 umm

17:00 dakrone: I'd include it by default, and add something to the readme about excluding it if you need to

17:00 dakrone: probably pretty easy to just include it and tell people about :exclusions

17:00 joegallo: ibdknox++

17:00 dakrone: so let it be written, so let it be done

17:00 ibdknox: haha

17:01 aperiodic: anyone have experience getting slimv set up? i installed it with pathogen, and i suspect that for some reason it's not getting loaded. does anyone know of an easy way to check?

17:10 kurtharriger: @dakrone I was just trying to use cheshire to data serialize to smile... however I have a joda date in my data structure, was looking to see if there is an alternative to pre/post processing data by extending multimethod or protocol or something but it seems closed.. anything I'm missing

17:10 dakrone: kurtharriger: you can do pre-processing by specifying your own custom encoder for Joda datess

17:11 post-processing is kind of out of scope for a json lib

17:11 dnolen: jimduey has an awesome write up on parallel core.logic - http://www.clojure.net/2012/03/26/Messin-with-core.logic/

17:12 kurtharriger: where do I specify an encoder? currently have (generate-smile myobj)

17:16 dakrone: kurtharriger: check the "Custom Encoders" part of the readme on https://github.com/dakrone/cheshire , or look it the cheshire.custom namespace for how it's implemented

17:18 kurtharriger: ah okay, that looks like might do what I need

17:24 muhoo: dakrone: jackson explosion. looks like that version collijsion you guys were just talking about, serindipitously enough

17:24 dakrone: muhoo: were you using noir?

17:25 muhoo: dakrone: yes, an old one. problem isolated

17:25 dakrone: muhoo: okay, let me know if you have more issues with it

17:25 ibdknox: when will noir 1.3.x be out so it becomes the default? :)

17:26 muhoo: thanks! raynes hyped it pretty good, i'm looking forward to trying it

17:27 ibdknox: dakrone: soon :)

17:29 muhoo: lol, "martin sheen as a service" made my day

17:41 aperiodic: will i run into any issues connecting to the same swank server from multiple editor instances?

17:42 kurtharriger: dakrone: so custom encoding only does the obj -> json/smile, decoding is always standard.. dates are read back as strings correct? no custom decoding logic right?

17:42 dakrone: kurtharriger: that is correct

17:42 kurtharriger: ok

17:43 amalloy: aperiodic: that should be fine

17:50 dakrone: okay, released clj-http 0.3.4, where cheshire is now an optional dependency (along with other things)

17:50 and some documentation around that Verify issue

18:18 kurtharriger: is there any way to :use a namespace and automatically import defrecord types defined in it? it seems like :use only refers the record factory functions not the records themselves? missing something? or is this just how it is for now?

18:20 ordnungswidrig: kurtharriger: for 1.3 this is so.

18:21 kurtharriger: ok, thought I was going crazy for a second

18:21 dnolen: kurtharriger: it's better to either use those factory fns or produce new ones. I doubt automatic importing of deftype/record will happen.

18:22 ordnungswidrig: I didn't think so, tho I could be wrong.

18:22 ordnungswidrig: dnolen: huh?

18:22 kurtharriger: its when I want to do extend-protocol SomeProtocol RecordTypeHere that I run into issues

18:23 dnolen: ordnungswidrig: I did not think records were automatically imported on :use

18:23 ordnungswidrig: kurtharriger: in this case, yes.

18:23 dnolen: I did not either?!

18:23 dnolen: ordnungswidrig: oh sorry confused :)

18:23 ordnungswidrig: dnolen: for pre 1.3 I do not know :)

18:23 dnolen: if you where for this.

18:25 kurtharriger: that and I was bitten by the replace - in ns with _ in import

18:26 ordnungswidrig: kurtharriger: that's a hard one. it catches my every other time.

18:27 kurtharriger: this seems to work: in record namespace (def rtypes {:typea TypeA}) then I can just use (rtypes :typea) instead of importing the class

19:38 Lajla: is ##(let [some-datum (list (symbol "I worship His Shadow"))] (= some-datum (read-string (print-str some-datum)))) a bug or a feature?

19:38 lazybot: ⇒ false

19:43 eggsby: lexx reference?

19:45 today is jimduey day for me, reading his article on core.logic after watching his talk from strangeloop 11

19:45 danlarkin: careful you don't OD

19:46 a jimduey hangover is brutal

19:46 eggsby: D:

19:49 danlarkin: are you danlarkin the auther of the clojure lib clojuredongs

19:49 danlarkin: the one and only

19:49 eggsby: well, I never

19:50 * Frozenlo` duckduckgo clojuredongs

19:50 Frozenlo`: O-M-G

19:50 Why?

19:50 clojurebot: why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

19:55 mk: does infoq have any sort of rating/views/sorting system? Seems a bit hard to find the best talks

19:56 Frozenlo`: Is there a `mapconcat' equivalent in clojure?

19:56 qbg: mapcat

19:57 Frozenlo`: ,(str (mapcat #(.toString %) [3 4 5]))

19:57 clojurebot: "clojure.lang.LazySeq@13a53"

19:58 Frozenlo`: I suppose it will be evaluated when I will use it?

19:58 qbg: &(apply str (mapcat #(str %) [3 4 5]))

19:58 lazybot: ⇒ "345"

20:00 mk: ,(mapcat #(.toString %) [3 4 5])

20:00 clojurebot: (\3 \4 \5)

20:00 Frozenlo`: Oh right.. str is already using .toString

20:01 qbg: That is a terrible way to join strings though

20:02 Frozenlo`: ,(str 4 5 6)

20:02 clojurebot: "456"

20:02 Frozenlo`: Hurray for me doing everything the worse possible way :)

20:02 qbg: Also checkout #'clojure.string/join

20:05 mk: I'm not quite sure what mapcat is for. As far as I can tell, it's for messing with the inners of a 2d list, just prior to 2flattening/concatenating that list

20:06 qbg: mapcat is really useful for macros, among other things

20:06 mk: is there some obvious case where it's best to use it?

20:06 I see

20:06 qbg: You can mapcat together binding forms

20:06 (which I find useful)

20:09 eggsby: mapcat just maps a function over something then concatenates the result

20:11 or rather, applies the result of mapping over a sequence to concat

20:13 say your f takes in a value and returns a sequence of values, it would go from 1 -> (1 2), so if you mapped that function over (1 2 3 4) you would get ((1 2) (2 3) ...) but using mapcat you'd get (1 2 2 3 ..)

20:17 kurtharriger: are there any clojure libraries for validating data structure schemas in a nice declarative way. I parse json from http post and I want to ensure it has certain required fields and such before doing to much more with it, currently I'm creating a validate method for each structure but its getting bit messy wondering if there might be something that does this already?

20:45 bitpimp: yo from the Chicago Clojure Meetup

20:45 :vsp

20:45 * gfredericks was just looking up info on that meetup

20:46 bitpimp: around 26 people here

20:46 technomancy: wow, big group

20:47 gfredericks: don't pass up the opportunity to biject the attendees with the alphabet

20:49 greeneggsandspam: danlarkin: should clonjure.dongs really have a default of 8?

20:50 That seems a little self serving

20:50 muhoo: dongs?

20:50 danlarkin: pull requests accepted

20:50 greeneggsandspam: muhoo: https://github.com/danlarkin/clojuredongs/blob/master/src/clojure/dongs.clj

20:50 gfredericks: man brehaut was just talking to me about that library

20:50 #clojure is going through the last hour of my life

20:51 muhoo: oh ffs

20:51 qbg: "0 contributors"

20:51 technomancy: danlarkin: what, no CA required?

20:51 muhoo: i guess it had to happen

20:51 though i have to wonder

20:51 with a spit function

20:51 if the "slurp" function was originally called "swallow"

20:52 gfredericks: muhoo: add (def swallow slurp) and send a pull request

20:52 muhoo: gfredericks: naw, i'll keep that one in my own private library

20:52 gfredericks: well notify us if you obtain a patent

20:52 muhoo: i'm going to take out a patent on chewing food

20:55 TimMc: muhoo: No, but spit is often called barf.

20:55 amalloy: kurtharriger: i recently wrote https://github.com/flatland/schematic - not a ton of documentation, but you can probably see how to use it from the tests

20:59 greeneggsandspam: Is there clean way to specific a minimum for rand[-int]?

20:59 gfredericks: greeneggsandspam: add to the result

21:01 greeneggsandspam: yeah. I was hoping there was a more readable way. the + min to result seems too C for me :P

21:01 (rand-nth (range 4 13)) works

21:01 TimMc: ew

21:01 gfredericks: you just made TimMc here go ew

21:01 greeneggsandspam: not efficientely,, but..

21:02 lol i'm just saying

21:02 gfredericks: (defn rand-eggs-and-spam [min max] (+ min (rand-int (- max min))))

21:02 brehaut: math saves the day

21:03 gfredericks: (inc math)

21:03 lazybot: ⇒ 1

21:03 greeneggsandspam: i'll submit the pull request for rang-eggs to clojure.core

21:04 mk: is there anything actually wrong with rand-nth (range...? It's lazy, after all

21:04 gfredericks: mk: it'll walk down the seq till it gets the result

21:04 rand-int will work in constant time

21:05 greeneggsandspam: "Will have

21:05 the same performance characteristics as nth for the given

21:05 collection."

21:05 TimMc: &(doc rand-int)

21:05 lazybot: ⇒ "([n]); Returns a random integer between 0 (inclusive) and n (exclusive)."

21:05 qbg: range is lazy

21:06 TimMc: gfredericks: Be careful with the upper bound in that defn.

21:06 [min max] is misleading.

21:06 mk: gfredericks: hmm, you're right, I just did a (time on that, and it's not nice

21:06 gfredericks: TimMc: I think I intended it to be the way it is, but didn't bother giving intuitive names or docstrings

21:06 kurtharriger: amalloy: thanks I'll check it out

21:06 greeneggsandspam: TimMc: You see? Such a everyday function should be included in the language :)

21:07 mk: greeneggsandspam: what are you going to use it for? There might be an easier way

21:08 greeneggsandspam: improving clojuredongs. it defaults to 8. i want to make that a random number within 4-13

21:08 TimMc: greeneggsandspam: From the perspective of how easy it is to get wrong, yes.

21:08 greeneggsandspam: ([] (dong (rand-nth (range 4 13))))

21:08 gfredericks: greeneggsandspam: you might also make it configurable via a dynamic var

21:09 (def ^:dynamic *dong-length* nil)

21:09 TimMc: That should be *rand-nth*, which can be dynamically rebound for testing.

21:09 and initialized to rand-nth

21:09 gfredericks: not everybody is confortable with the nondeterminism

21:09 oh wait

21:09 you can just use the arg'd version

21:09 nevermind

21:10 muhoo: what's the simple (heh) solution for logging?

21:10 greeneggsandspam: I should have it detect your location and then check the wikipedia article on average size per country

21:10 gfredericks: is this on clojars?

21:10 TimMc: muhoo: println :-)

21:10 muhoo: no

21:10 i mean, i don't want spew in my repl

21:10 gfredericks: TimMc: prn

21:10 muhoo: i want the error messages going to a file or some other facility

21:10 mk: it's going to be really embarrassing explaining that you wrote a probability-distribution library for the sake of drawing an ascii penis

21:10 greeneggsandspam: gfredericks: dunno

21:10 mk: don't go down that road

21:11 qbg: Should multiply by (-> (rand-int 2) (* 2) (- 1))

21:11 gfredericks: mk: only if you're embarrassed by that sort of thing

21:11 beffbernard: mk: HA

21:11 greeneggsandspam: mk: I have to contribute to the clojure community somehow

21:11 beffbernard: mk: what distributions?

21:12 gfredericks: greeneggsandspam: have you asked on the clojuredongs mailing list if this changed is wanted?

21:13 greeneggsandspam: gfredericks: I went to the head-dong himself and he suggested i fork and pull

21:13 TimMc: Write a Jirum.

21:14 danlarkin: I would rather not be called head-dong

21:14 gfredericks: as the only other contributor to clojuredongs I think I deserve the title of tail-dong

21:14 mk: beffbernard: half of the time when I'm generating randoms, what I really want are various probability curves. I was simulating a file store for example, and that required long-tail style curves, and so on

21:14 TimMc: danlarkin: Wait, how are you going to have an audit trail if you just accept pull requests willy (heh) nilly?

21:14 No corporation will feel safe using your software!

21:15 danlarkin: oh no! clojuredongs will be barred from inclusion in clojure-contrib!

21:15 how will I, or my ego, survive!

21:15 beffbernard: mk: have you heard of uncommons-maths?

21:15 it's a java lib but I've used it in the past

21:15 gfredericks: time to start an underground contrib

21:15 TimMc: gfredericks: Join the crowd.

21:16 beffbernard: mk: http://maths.uncommons.org/

21:19 mk: beffbernard: I haven't. Looks interesting. I was using a bunch of functions in a single class from somewhere online.

21:20 gfredericks: TimMc: another advantange to the (format "lib-%04d" (rand-int 10000)) naming scheme is that you can probably obtain a matching domain name

21:22 greeneggsandspam: &(format "lib-%04d" (rand-int 10000))

21:22 lazybot: ⇒ "lib-5468"

21:22 greeneggsandspam: &(format "lib-%04d.io" (rand-int 10000))

21:22 lazybot: ⇒ "lib-4120.io"

21:25 mk: I'm a fan of the scheme. It can be used for people, too. We could all call each other by the first characters of our numeric hashes, and as the channel grows, we would simply disambiguate by adding more characters - like a long sequence of last names

21:25 methodmissin: Hello!

21:27 mk: hi, methodmissin

21:27 TimMc: mk: We had The UUID Conversation sometime last year.

21:27 muhoo: hmm, ok, i guess bufferedwriter is going to be my simple log solution

21:27 TimMc: It wasn't pretty.

21:28 greeneggsandspam: danlarkin: pull request send (i'm autodidakto on github)

21:29 mk: TimMc: uuid for what purpose?

21:29 danlarkin: greeneggsandspam: merged

21:30 greeneggsandspam: yay! My first contribution to clojure open source.

21:31 TimMc: mk: Why, everything, of course!

21:32 gfredericks: TimMc: we could use the uuid's hash to refer to it

21:33 TimMc: mk: http://clojure-log.n01se.net/date/2011-09-12.html#17:16c

21:34 mk: TimMc: using a uuid is silly, but using a hash isn't

21:35 Lajla: eggsby, ahh, you worship His Divine Shadow too I see.

21:35 methodmissin: I'm pretty new to clojure, but having a pretty good time trying to learn it. Naturally, I came because I have a problem I can't figure out.

21:36 mk: methodmissin: glad to see you're having fun :) ask away

21:37 methodmissin: I'm going through Land of Lisp and in the second chapter decided that while there are clojure core functions that accomplish the same, more or less, as CLISP functions, that I would learn and practice more by implementing those CLISP functions called for in the book in clojure, where I could see a solution.

21:37 The first being ash

21:37 Lajla: methodmissin,I'm not

21:38 I much desire you to whither away in pain

21:38 methodmissin: I've already got bit-shift-left and bit-shift-right, which was easy, and stuck them in an if, got clojure.math.numeric-tower/abs, and seem to have a working implementation... sometimes.

21:39 Because in my test (using expectations) (ash 11 1) returns 1.

21:39 And if I paste the defn into repl, it returns 22.

21:39 :|

21:40 mk: what does ash do?

21:40 methodmissin: Arithmetic shift

21:40 amalloy: methodmissin: the number of people in here who know what ash does is very small

21:40 methodmissin: Takes a number, converts to binary, then moves it +-X number of bits, dropping off or adding 0's

21:40 greeneggsandspam: *tries to remember* it's a bit or... bit offest... bit something operator... *googles*

21:41 methodmissin: Can I paste the defn? You'll understand

21:41 amalloy: ~gist

21:41 clojurebot: gist is https://refheap.com/

21:41 amalloy: very funny

21:41 methodmissin: https://refheap.com/paste/1421

21:41 mk: methodmissin: http://clojure.org/cheatsheet

21:42 Frozenlo`: Should I actively try to change strings into keyword? For example: {:name :Albert}

21:42 gfredericks: (defn bit-shift-north-west [...] ...)

21:42 Frozenlo`: Instead of {:name Albert}

21:42 er.. "Albert"

21:42 amalloy: usually not

21:43 mk: Frozenlo`: is a name like "albert" a keyword?

21:43 muhoo: ooh cool, (binding [*out* log] (println "fubar"))

21:43 amalloy: keywords are for things where all you ever want to do with them is (a) look them up as map keys, or (b) compare them for equality with other keywords

21:44 ivan: every time I go into a Python REPL now the commas drive me crazy

21:44 Frozenlo`: In this case I will use it as a property and use it to filter from maps.

21:45 ivan: Warning sign: comma-free zone

21:45 greeneggsandspam: methodmissin: by the way, the author of land of lips translated the adventure game into clojure. It might give you clues. http://www.lisperati.com/clojure-spels/casting.html

21:46 mk: Frozenlo`: a human name? If you're talking about mappings to keywords (which perhaps you'll look up to get values), then sure, but most things that are strings are... strings

21:47 methodmissin: greeneggsandspam, Thanks, I just think I'm hung up on project management and testing and stuff right now. Having a hell of a time with requiring or using my other .clj files.

21:47 gfredericks: it's also unusual to make use of keywords that don't appear as literals in your code anywhere

21:47 sorta

21:48 methodmissin: For the (guess-my-number) game I know I can just use bit-shift-right and forget about ash, but I'm determined to challenge myself where it makes sense and helps me learn.

21:48 greeneggsandspam: methodmissin: yeah. it's those little 'getting setup' things that are real roadblocks to getting started

21:48 ivan: it took me about 20 minutes today to figure out that java -jar clojure.jar was messing up my -cp

21:48 (if it was. who knows.)

21:49 greeneggsandspam: methodmissin: also where books help the least, being quickly outdated

21:49 TEttinger: can anyone explain the advantages ClojureScript has over Sibilant, at http://sibilantjs.info ? I know ClojureScript has better data structures, but Sibilant has clean macros...

21:50 methodmissin: greeneggsandspam, Tell me about it. :) Still this is a very fun book to work through.

21:50 I made another gist of the test output and the test file

21:50 https://refheap.com/paste/1422

21:50 ibdknox: TEttinger: clean macros?

21:50 mk: TEttinger: clojurescript is more popular

21:50 greeneggsandspam: methodmissin: some of the practicalities of clojure are talked about in this guide: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/toc.html

21:50 TEttinger: ibdknox, sibilant just has really simple and convenient macros. you get to control how a macro translates to JS

21:51 methodmissin: greeneggsandspam, Looks awesome, thanks. :)

21:51 TEttinger: mk, good point

21:51 ibdknox: TEttinger: you can do the same if you really need to in CLJS too

21:51 TEttinger: are there any good IDE plugins for CLJS?

21:51 ibdknox: but I'm not sure I understand why you'd *want* to control the JS. Seems like operating at the wrong level to me

21:51 mk: TEttinger: js readability (if that's your concern) might become irrelevant soon, with... I've forgotten the name (maps js to original source)

21:51 ibdknox: Source Maps

21:52 mk: ^

21:52 ibdknox: TEttinger: no, it's far too new

21:52 TEttinger: I thought CCW had some support

21:52 ivan: tettinger: I tell IDEA that .cljs is Clojure, but I guess most people use Emacs

21:52 ibdknox: luckily though, anything that works for CLJ basically works for cljs

21:52 TEttinger: nice

21:54 gfredericks: isn't cljs code read in with the normal clojure reader?

21:54 ibdknox: ye

21:54 s

21:54 gfredericks: that's so cool.

21:55 ibdknox: it's just clojure :)

21:55 that happens to emit JS instead of java bytecode

21:55 TEttinger: I thought that Clojure macros weren't supported in CLJS?

21:56 cemerick: what is the language/framework that allows you to use pipes to specify the left margin of docstrings so lines of documentation aren't ragged?

21:56 …groovy?

21:56 TEttinger: groovy is a scripting language...?

21:56 gfredericks: sibilant looks like lisp and coffeescript had a baby

21:56 TEttinger: gfredericks, yep

21:57 that's basically the idea :-)

21:57 but I like Clojure data structures more than I like JS translation control

21:58 gfredericks: yeah I wouldn't want to go back to mutable arrays

21:58 TEttinger: is there a good way to do something like Vaadin/GWT with Clojure?

21:58 gfredericks: it's really weird that most of the sibilant lib is macros

21:59 muhoo: if i need to keep a *gasp* global, for like the file descriptor of a log, should i make it a ^:dynamic *var* or an atom?

21:59 TEttinger: mostly I am looking for a way to use my halfway-OK server, and even though it is running Windows server (poor hardware support when I tried linux), I would rather not use C#

22:00 ivan: heh, clojure-spels goes into much hairier stuff than I would have expected

22:00 mk: TEttinger: when I first asked about macros here, I ended up finding out that they were only part of the reason to use clojure, and that I wouldn't need to use them that much. That seems accurate.

22:01 TEttinger: thanks mk, will keep that in mind

22:01 methodmissin: I just wish I knew what I was doing wrong with this test, so I could stop doing it. :P coming from a ruby background it's so crazy to me that what happens in the test doesn't match what happens in the repl.

22:01 Compiled my various gists into one that hopefully has all the pertinent info in one chunk. https://refheap.com/paste/1423

22:03 ibdknox: TEttinger: macros exist in CLJS

22:04 TEttinger: rather, macros exist for clojure, which since CLJS is just clojure, means macros exist for CLJS

22:04 muhoo: ah, of course. if macros are compile time, and compiling happens on the host, which is the jvm, ok.

22:04 ibdknox: exactly

22:05 methodmissin: Actually... the same thing is happening in the repl.

22:05 After pasting in everything from the pastebin

22:05 er, gist

22:05 ibdknox: macros just take one form and turn it into another - that happens before emitting, so the fact that what it's spitting out is "ClojureScript" is irrelevant at that stage :)

22:06 trptcolin: cemerick: i was thinking it was scala, and this seems to corroborate: http://stackoverflow.com/questions/2013709/scala-raw-strings-extra-tabs-at-the-start-of-each-line

22:06 but i can't repro in a scala repl

22:06 methodmissin: ...

22:06 muhoo: so, what is the idiomatic, best-pracice way to keep a global var, for something like the fd of a log?

22:06 methodmissin: If I paste just from my core file, it works. If I include the test, it doesn't.

22:07 muhoo: i'm thinking either ^:dynamic or atom, but can't decide.

22:07 ibdknox: muhoo: an atom most likely

22:07 muhoo: thanks

22:07 gfredericks: muhoo: if you're going to set it more than once, use an atom

22:07 cemerick: trptcolin: there's that .stripMargin call, which probably ropes in some implicit somewhere to do the munging

22:07 trptcolin: cemerick: doh, of course i missed that, yeah

22:07 cemerick: <scary>

22:07 thanks for the pointer

22:08 trptcolin: cemerick: sure thing

22:08 cemerick: Seems like a pretty sane way to indicate the left margin in general though. Worth writing a doc+ macro that does that or something.

22:09 eh, I suppose the margin could be inferred as long as there's at least one line that's not intended to be indented.

22:10 ibdknox: cemerick: I hear people who write lots of documentation and care about its presentation cater to noobs.

22:10 ;)

22:10 trptcolin: definitely agreed that docstring indentation needs *something*

22:11 i'm always waffling between having the code look good or the output of doc look good

22:11 beffbernard: muhoo: any reason why you aren't using lo4j or slf4j for logging? there is a convenience logging wrapper in clojure/tools.logging

22:11 trptcolin: solution: 1-line docstrings. done.

22:11 beffbernard: log4j

22:11 muhoo: beffbernard: oh cool, thanks, i'll try that. i ooked at log4j and went "aagggh! too complicated!"

22:11 ibdknox: trptcolin: those shouldn't have to compete

22:11 cemerick: ibdknox: assholes, all of 'em!

22:11 muhoo: but if there's a nice wrapper in clojure/tools.logging i'll look there

22:12 ibdknox: cemerick: haha :D

22:12 muhoo: without noobs, all things are just ways to keep your computer warm

22:14 cemerick: muhoo: don't mind us. We love noobs, 133t hax0rs, and everyone in between. :-)

22:14 muhoo: oh i know, and i appreaciate it. a lot.

22:14 ibdknox: yeah, twas a joke from ClojureWest :)

22:14 muhoo: speaking as a died-in-the-wool noob

22:14 trptcolin: ibdknox: hmm, yeah, i guess i should just go w/ the 2-space convention that seems to be the norm in core, now that i look more closely

22:14 gfredericks: "veteran noob"...

22:15 muhoo: i guess a dilletantte, or a DIY fanatic, is a perpatual noob, and i'm guilty as charged.

22:15 ivan: write a markup language similar to reStructuredText but sane, display formatted text in HTML docs

22:21 TEttinger: ivan: MultiMarkDown?

22:21 PanDoc supports practically every format, take a look at the existing stuff

22:22 ivan: I dunno. I kind of like some rST features like text roles

22:22 though they should be nestable

22:22 TEttinger: http://johnmacfarlane.net/pandoc/

22:23 methodmissin: I guess nobody knows what's going on with my tests? https://refheap.com/paste/1423

22:25 qbg: methodmissin: Looks like this: ((quote lol/ash) 11 1)

22:25 &('lulz 11 1)

22:25 lazybot: ⇒ 1

22:26 qbg: Don't quote your symbol!

22:26 TEttinger: &('(lulz 11 1))

22:26 lazybot: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IFn

22:27 TEttinger: &(print '(lulz 11 1))

22:27 lazybot: ⇒ (lulz 11 1)nil

22:33 autodidakto: Any vimclojure users? Does the repl (\sr) connect to the nailgun server? I'm trying to get it to see what I've previously evaluated (\ef, etc)

22:37 emezeske: autodidakto: Yeah, it is definitely supposed to.

22:39 methodmissin: qbg: !

22:40 qbg, Thanks! I kept quoting stuff because it was complaing about classpath and can't find this or that. I suppose i have to learn where to quote, and where not to.

22:40 qbg: If you want it evaluated, don't quote it :p

22:41 nsxt: "Write a function that returns a personalized greeting:" (= (__ "Dave") "Hello, Dave!")

22:41 I can't for the life of me figure out how to do this. str "Hello " works fine, but what about the exclamation point?

22:42 methodmissin: nsxt, str to construct the string and insert the arg?

22:42 qbg: methodmissin: Symbols are actually functions that look themselves up in maps, with the (optional) second argument being the value to return when the key is not found. If the first arg is not a map, the key is never found

22:44 &(#(str "Hello, " % "!") "Dave")

22:44 lazybot: ⇒ "Hello, Dave!"

22:44 qbg: But there has to be a cooler way

22:44 nsxt: methodmissing: I think I follow? (Total noob here.) It involves something with the %, right?

22:44 autodidakto: emezeske: So I'm supposed to be able to evaluate a function (i.e. \ep to evaluate paragaph), the start a repl (\sr) and start playing with that function and pass it arguments, correct?

22:45 nsxt: qbg: thanks... still learning syntax here.

22:45 methodmissin: qbg, Thanks for the explanation. nsxt, We're all learning the syntax. :)

22:48 gfredericks: &((partial format "Hello, %s!") "Dave")

22:48 lazybot: ⇒ "Hello, Dave!"

22:48 qbg: Quick, pull in cl-format!

22:52 autodidakto: emezeske: Ah. I see what I did wrong. I needed to load the namespace while in the repl

23:03 amalloy: i'd skip the #(... %) syntax sugar for now, nsxt, and look more at something like (fn [name] (str "Hello, " name "!"))

23:03 emezeske: autodidakto: I usually just use \ef, which loads the whole file, thereby picking up the namespace for you

23:03 amalloy: which is more explicit

23:06 autodidakto: emezeske: Hmm. Then I shouldn't have to switch namespaces when starting to reply (\sr)? I just did a \ef and my repl always opens with user=>

23:08 emezeske: maybe i should just not close the repl buffer

23:36 nsxt: amalloy, thanks. the example is from 4clojure, which is a great resource, but a little too heavy for a complete beginner.

23:37 amalloy: *chuckle* i know, i recognize it

23:37 nsxt: :) you must get a handful of people who come in here with 4clojure questions.

23:38 echo-area: A newbie question: How do I specify the dependency to commons-logging api in project.clj?

23:39 qbg: echo-area: Just add it as a dependency

23:39 echo-area: Like this? [commons-logging/commons-logging "1.0.4"]

23:39 qbg: Yeah

23:40 mk: nsxt: what sort of function takes a string on the left, and puts the stuff on the right into that string?

23:41 echo-area: qbg: But compiling my java sources still fails with message "package org.apache.commons.logging does not exist"

23:41 qbg: Did you do lein deps?

23:41 And restart your repl?

23:41 echo-area: Oh, I don't do that.

23:41 Let me try, thanks

23:42 qbg: Yeah it works. Thank you!

23:42 simard: amalloy: I'm using clojail, I have a java.policy file with AllPermission, and this works fine when running through a uberjar. However, when I build a jar instead and place it on the class path to use it from some java code (RT.loadResourceScript, clojure.lang.RT.var some func, func.invoke), I get security exceptions: https://gist.github.com/2223372

23:42 mk: nsxt: in 4clojure, you can follow a bunch of the people who've solved all of the problems. Once you solve a question, have a look at other solutions.

23:43 simard: would you have any hint for that ?

23:43 amalloy: i dunno, man

23:44 it looks kinda like your java code is being loaded (not just run) inside the clojail sandbox, but i don't really know much about that area

23:45 simard: what I really don't get is that I'm getting security exceptions when I do provide full access.

23:45 and I don't have this error when running a standalone uberjar.

23:50 nsxt: mk: yup, i followed all the guys who completed all 141 problems.

23:52 mk: nsxt: it's interesting how some questions have very diverse answers, and some have just one

23:58 nsxt: mk: How can a beginner best identify which are idiomatic and which aren't?

23:59 mk: the short ones :)

23:59 ibdknox: are often not idiomatic :p

Logging service provided by n01se.net