#clojure log - Mar 12 2013

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

0:01 ambrosebs: technomancy: There's a couple of reasons why I'm sceptical about inference for Clojure code.

0:02 There are usually some subtle invariants which are best expressed by a function intersection. I don't know if we could retrieve this information.

0:02 technomancy: I've heard conflicting reports about how it would work on a VM designed for OO languages. The scala people say it's impossible to do HM on the JVM because of subclasses, but the F# people claim to have implemented it on .NET.

0:03 ambrosebs: eg. We might know that (Fn [Integer -> Symbol] [Number -> Keyword]), but we will probably infer something more like (Fn [(U Integer Number) -> (U Symbol Keyword)])

0:03 brehaut: technomancy: F# uses extremely strict ordering of modules and module contents to limit the scope of inference

0:03 technomancy: i dont know how much of that it acquired from ocaml

0:04 technomancy: explicit ordering also ensures that inference is deterministic

0:04 technomancy: brehaut: hm; so probably only possible if you design for that from the ground up?

0:04 brehaut: technomancy: it may be the case. they certainly sell it as a feature of their design

0:06 ambrosebs: There's an extension to ML call CIDRE which adds refinement types to ML. It's kind of similar to adding intersections and unions to ML. They can model the kinds of invariants Clojure code often has, but it relies on annotations.

0:07 I don't know if it's possible.

0:07 technomancy: I guess I'd rather have something less powerful that I'm more likely to actually use than a system that can tell me practically everything once I've given it a lot of data.

0:08 ambrosebs: technomancy: Ok, more like the Erlang Dialyzer?

0:08 technomancy: I'm not familiar with that

0:09 but in the event that all vars have to be typed, the use case of wanting to typecheck just one or two namespaces within a larger project would be more compelling to me than typechecking the whole program

0:09 usually I have a feel for which parts of the codebase are trickier and if there's a place where bugs keep resurfacing, I might be inclined to do some grunt work there whereas if I had to do it for the whole program I wouldn't bother

0:10 ambrosebs: Dialyzer is less strict about type errors, but IIRC you don't need as many annotations. More of a linter than a type system (kinda).

0:11 technomancy: certainly, that's probably the best use case.

0:13 technomancy: I guess the main thing I'm interested in is catching NPEs

0:13 and I understand that's impossible to do in the presence of un-annotated Java interop

0:13 but it might help encourage separating out the Java bits into their own defns

0:14 ambrosebs: Yes, you need to help core.typed if you know some extra information about Java methods.

0:14 By default, method paramters are non-nilable, return types are nilable.

0:14 And you can adjust as needed.

0:14 technomancy: cool

0:16 ambrosebs: technomancy: I guess core.typed fills the niche "sometimes you just need a strict type system". What you're looking for probably couldn't be as strict about type errors.

0:18 jjjddd0: Guys, getting this error in REPL startup

0:18 FileNotFoundException Could not locate clabango/parser__init.class or clabango/parser.clj on classpath: clojure.lang.RT.load (RT.java:443)

0:18 any ideas ?

0:19 * technomancy lights the danlarkin symbol

0:21 clifton: anyone know why a very simple clojure app rendering hiccup templates would benchmark poorly? i see that the hiccup templates mostly macroexpand out the markup, but with a very contrived example a single-core server maxes out at 300 req/s

0:21 which feels slower than a similar ruby or nodejs app

0:22 arohner: ambrosebs: are there any plans to include any (sorry, I don't know the type lingo) "imaginary" types?

0:22 clifton: its a pretty contrived example, but it doesn't feel *too* far away from reality, aside from making a call out to I/O

0:22 ambrosebs: arohner: please elaborate :)

0:22 arohner: i.e. types that are user created, and have nothing to do with the java class

0:23 so for example, I have a fn that returns a SHA1

0:23 "SHA1" is actually a j.l.String

0:23 but poking around w/ typed, I couldn't figure out how to tell typed that it's (U String SHA1)

0:24 because then I want other fns that only take SHA1s and not strings

0:24 ambrosebs: arohner: I definitely want it (and it's probably the most requested feature). I'm not sure the best way to approach it though.

0:24 It needs more thought.

0:25 bbloom: technomancy: personally, i want a way to have type annotations added for me

0:25 technomancy: bbloom: you mean so they remain as part of the source?

0:25 arohner: ambrosebs: keep up the good work. I can't wait until I can actually check "real" code

0:25 bbloom: technomancy: i don't mean just inference, i mean going all the way to inserting them into the code

0:26 technomancy: yeah, so then when i know i got a piece of code right, i can just `git add .; lein type-me; git add -p .`

0:26 technomancy: bbloom: that could be nice for the public interface. wouldn't want it everywhere though.

0:26 bbloom: sorta how i do unit tests.... i generally run the code, visually inspect the result, and then copy paste the correct results into a unit test

0:26 technomancy: yeah, agreed

0:27 devn: clabango, lol

0:27 bbloom: ambrosebs: brehaut: do F#'s ordering requirements mirror those of clojure?

0:27 devn: how did i not hear of this?

0:27 this is really cool

0:28 TheBusby: any consensus on which is better, accessing private vars or copy/pasting code?

0:30 technomancy: in other news I have been having tons of fun hacking on https://syme.herokuapp.com/faq

0:30 bbloom: TheBusby: depends on the nature of the copy paste

0:31 technomancy: github really needs to improve the granularity of their oauth system

0:31 technomancy: bbloom: in this case I don't care; I only use GitHub to avoid having to write my own login system

0:31 all I care about is getting a username back

0:31 bbloom: technomancy: yes, but i care :-P

0:31 technomancy: I trust allowing Syme to read your public profile data isn't too nerve-wracking? =)

0:32 devn: technomancy: really cool

0:32 technomancy: bbloom: but yeah, allowing access to a specific private repo would be nice

0:32 bbloom: technomancy: oh, i guess they have read and write tokens & you only need read... hm ok

0:32 technomancy: devn: thanks!

0:32 devn: clocked in at just a shade under 500 LOC

0:32 well, I guess a bit over if you count the JS and the shell script

0:32 devn: technomancy: one of the first things i think i remember about your stuff is the work on gobby was it?

0:33 TheBusby: bbloom: the 1.5's reducer's fjpool stuff

0:33 devn: the collaborative thing?

0:33 * devn cant remember

0:33 technomancy: devn: yeah, that was possibly my first actual OSS code?

0:33 devn: was it really?

0:33 crazy

0:33 ohpauleez: technomancy: WHOA?!?!?! I didn't know you were behind Gobby too cool

0:33 TheBusby: bbloom: I copy/pasted it into another project to allow for reducers/fold to work, and just got a pull request to replace that with access to the private var...

0:34 technomancy: ohpauleez: well, not Gobby itself, but I wrote an elisp client for it.

0:34 ohpauleez: ahhh, badass

0:34 devn: what was it called?

0:34 technomancy: by reverse engineering the protocol from a packet sniffer; that was a trip =)

0:34 devn: ebby

0:34 devn: ah yeah

0:35 bbloom: TheBusby: I'd probably just access them via vars rather than copy paste, but i might just copy paste if i'm doing any other explicit forkjoin work

0:35 devn: Anyway, Syme looks great. I have wanted to do a pair.io thingy for awhile, but never got around to it.

0:35 bbloom: especially since if you can assume JDK7+ and only need half of it

0:35 TheBusby: can't assume that unfortunately :(

0:35 devn: I used pair.io and wished Zak would have kept it going

0:35 technomancy: devn: I realized it's drastically simpler if you make the user bring their own AWS creds

0:36 no billing headaches to deal with =)

0:36 devn: technomancy: brilliant

0:36 technomancy: every time I spun up a pair.io instance I felt vaguely guilty about increasing Zack's amazon bill =)

0:36 devn: same

0:36 they were not small instances either

0:36 err "micro"

0:36 technomancy: also: curl https://github.com/devn.keys

0:36 ^ simplifies things a ton =)

0:37 no need to get the collaborators to authorize Syme

0:37 TheBusby: bbloom: ahh, I see what you mean now

0:38 devn: technomancy: ha, i knew about that

0:38 technomancy: devn: let me know if you get a chance to use it. I'm keeping a list of feature ideas here: https://github.com/technomancy/syme/issues

0:38 devn: technomancy: can i use it with myself if i have two different github user accounts, but not two different aws accounts?

0:39 bbloom: technomancy: your swarm coding monopoly is under attack! http://www.meetup.com/Mob-Programming-Seattle/events/105744122/

0:39 technomancy: devn: sure; the AWS account is only used for launching the instance. sharing it is not a problem.

0:39 I want to document how to do it with IAM users though

0:39 bbloom: whoa nice

0:40 devn: technomancy: im not familiar with AIM

0:40 err IAM

0:40 technomancy: we actually used Syme to hack on Syme at the last seajure meetings

0:40 devn: basically you create sub-users with restricted permissions

0:40 devn: ahhhh

0:41 that would be interesting for business that want to have their projects more "separate"

0:41 businesses*

0:41 technomancy: devn: or if you don't trust "some guy with a herokuapp" with credentials that have access to your secret sauce

0:41 devn: yeah

0:43 technomancy: im going to try this out and report back

0:44 we've tried "pairing" a room away from one another a couple of times

0:44 clifton-: anyone know how to use jvisualvm with lein-ring -- its not letting me connect

0:44 technomancy: devn: cool; let me know how it goes

0:44 devn: also might be interested in adding a mumble server to the default AMI so you can get hassle-free voip.

0:45 devn: technomancy: one thing i would do is bring the faq to the front page

0:46 technomancy: it would be cool to try and just randomly invite another github user

0:46 technomancy: heh

0:46 devn: and having people see that it's not a scam would be cool

0:46 technomancy: yeah I'm trying to think of a way to make it more obvious, but I don't want a wall of text when you first hit the site

0:46 brehaut: bbloom: im not properly qualified to answer the question, but as i understand things, F# requires your program has exactly one compilation order for all modules within an assembly, whereas clojure its based on whats imported when i think? within a module things are ordered for a single pass, with recursive definitions, and types (and implicitly classes) being explicitly stated with let rec and type … and …

0:47 technomancy: I guess pair.io's idea of putting a video on the splash page is pretty good

0:47 devn: technomancy: yeah i like it simple. i think you could make the "what's this" link more front-and-center

0:47 maybe it's a subtle drawer that expands down and shows the text

0:47 bbloom: brehaut: in theory, if you banned the non-ns-form versions of require, load-file, etc (like clojurescript defacto does) and then start with the file that contains "defn main", then clojure's NS forms have a single topological sort of dependency order too

0:48 technomancy: subtle... that's beyond my skills =)

0:48 devn: technomancy: there isn't much that's subtle about this site: http://www.snowbird.com/

0:48 bbloom: brehaut: recursive types & functions already need to be explicit via 'declare

0:48 devn: but if you hover over the weather you'll see sort of the effect i was imagining

0:48 technomancy: devn: my secret when it comes to design is to ask brehaut what to do

0:49 that is pretty slick though

0:49 devn: you should see their mobile app

0:49 err mobile version of the site

0:49 brehaut: bbloom: i am not a compiler guy ;) the words you are saying make sense, but i cant honestly give you any more feedback on it

0:49 devn: it's very, very impressive

0:50 bbloom: ambrosebs: ?

0:50 since brehaut is deferring to the experts :-)

0:51 brehaut: wait, this is IRC isnt it? i should just be claiming things and mansplaining

0:51 my bad guys

0:51 technomancy: aw geez.... past self, what the heck https://github.com/technomancy/technomancy.us/blob/master/public/code/ebby.el#L117

0:51 bbloom: lol mansplain, that's a good word i've never seen before

0:51 devn: brehaut: go nuts

0:52 technomancy: did you write that comment at the same time you wrote the macros?

0:52 technomancy: "my first two macros" you mean? I think so.

0:52 brehaut: devn: im still not going to because it'd be worse than line noise

0:52 technomancy: OTOH it's good to know that the lack of egal in elisp has been a problem for me as long as I've been doing lisp

0:52 (the other macro is to work around broken string equality in elisp)

0:52 devn: because it's funny either way, but that makes it even better if you marked that moment, like you sang Oh Danny Boy after you finished those macros

0:53 bbloom: technomancy: argh! boolean names in the negative are a major pet peeve of mine too!

0:53 sshack: Is there any reason why leon trampoline repl would fail where leon repl wouldn't? (stack trace: http://pastebin.com/rrmaXVVM)

0:53 ambrosebs: bbloom: It doesn't seem to make much sense to compare the two, F# is much stricter with order because of its type system.


0:53 devn: technomancy: this week is equality week. i re-read the baker egal paper again after a discussion about equality in ruby

0:53 technomancy: yay!

0:53 ambrosebs: But, I dont' really know :)

0:54 anyway, I'm off. cya

1:01 devn: ambrose just dropped the mic

1:02 technomancy: sshack: lein trampoline repl uses a direct connection whereas regular repl uses nrepl. so theoretically it should be simpler.

1:03 sshack: technomancy: Interesting.

1:03 So what are the moving parts that could break?

1:04 clifton-: any nrepl hooks or plugins?

1:04 technomancy: sshack: trampoline repl loads the "reply" library into the project :dependencies rather than running it from Leiningen's JVM. so some of its dependencies could be interfering.

1:04 you can open up leiningen's repl.clj and just grep for "trampoline" to see all the differences

1:05 clj_idiot: so I used processbuilder to create a process; I now have it's inputstream dn outputstream. How do I read its output (from the inputstream) in clojure but _NOT_ block; i.e. if there is input, I want to read all of it; if no input, I want the function to return immediately.

1:05 technomancy: most of the time trampoline is pretty transparent, but the repl task is one place where it's more complicated

1:05 sshack: Let me try with a fresh project

1:05 technomancy: clj_idiot: IIRC that's really, really hard

1:05 clj_idiot: technomancy: are you serious?

1:05 technomancy: clj_idiot: http://www.hypirion.com/musings/how-to-cancel-a-blocking-read

1:05 clj_idiot: technomancy: this seems like a very simple/common operation

1:05 technomancy: hm, you're not kidding

1:05 technomancy: it's hard in the context of Leiningen at least

1:06 your requirements might be simpler

1:06 clj_idiot: technomancy: just ot of courisity, how did you have that URL off the top of your head? according to time stamps, you provided that uril within 60 seconds

1:07 sshack: Right. a Fresh project works fine.

1:07 technomancy: clj_idiot: hyPiRion is an active Leiningen contributor, and that problem is one of the few remaining issues blocking Leiningen 2.1.0

1:07 so it's fresh in my browser history

1:08 eep... I guess not so few issues

1:09 sshack: Yup. It's one of my project dependencies.

1:09 technomancy: 12 remaining issues... guess I better stop playing around with Syme for a while =)

1:10 brehaut: clj_idiot: technomancy claims that it was fresh, but when you've seen him pull out apropos webcomics in zero time, you'll begin to wonder if somethings really afoot

1:12 clj_idiot: dumb question: why is my prroblem not solved via; http://stackoverflow.com/questions/5200187/convert-inputstream-to-bufferedreader

1:12 seems like I can just wrap the inputstream

1:13 sshack: Incanter seems to be the problem.

1:13 Which is a shame, I was hoping to use it. But it seems to have died anyways.

1:14 technomancy: sshack: you can use the lein-pedantic plugin to isolate a more specific dependency conflict

1:14 (it's probably not incanter, but one of incanter's deps)

1:14 clj_idiot: ah, I just figured out why ... java won't let me cast it

1:14 sshack: technomancy: Thanks for the tip. I'll give that a try.

1:14 But it's not too important. I wasn't actually using any of in canter yet.

1:15 clj_idiot: okay, n/m, I got a bufferedreader now

1:15 is ther ea way in clojure, to do a non-blokcing read of everything from a buffredreader?

1:18 sshack: technomancy: What's the version string for leon-pedantic?

1:18 nm found it

1:18 technomancy: whoa nrepl.el merge frenzy

1:18 nice

1:23 sshack: Oh boy. Dependancy hell.

1:24 technomancy: is it jackson? I bet it's jackson.

1:25 sshack: technomancy: No, it wasn't. IT was some leon plugins.

1:26 Here's a question. Is there a way to leave a port open for a REPL in a ring app?

1:43 Right so leon trampoline repl *randomly* crashes now.

1:43 As in sometimes does, sometimes doesn't.

1:44 May you live in interesting times.

3:21 rmrfchik: i remember i read why letter "lambda" is used for functions. can't google it now.

3:25 p_l: from lambda notation?

3:26 rmrfchik: p_l: yes. and I just googled it. (when you report your problem to anyone, the solution just popped up immediatelly)

3:27 lambda is transformed ^

3:49 p_l: Has anyone here tried to develop a Google App Engine application in Clojure using Immutant (clojure support for jboss) and Cape Dwarf (jboss implementation of GAE apis)?

4:20 hyPiRion: ah, that clj_idiot guy left. Well, his requirements were far simpler than Leiningen's.

5:04 augustl: what do most people use for XML parsing?

5:05 pimeys: do you need it to be fast?

5:05 augustl: not really :)

5:05 currently using clojure.xml, can't figure out how to manually specify the encoding.. Also, xpath would be nice

5:06 pimeys: ok, otherwise sax parsing would be nice

5:10 ebaxt: What's the difference between clojure.xml and data.xml?

5:10 augustl: anyone know how to specify encoding with clojure.xml?

5:10 ejackson: augustl: I heard laser was about to, or did already support xml. I've been using enlive.

5:12 augustl: seems clojure.data.xml also doesn't support manually specifying the encoding

5:18 ebaxt: augustl: data.xml parsing function takes a Reader or InputStream, maybe you can set the encoding on it: new InputStreamReader(new FileInputStream(filePath), encoding)

5:21 ro_st: if i am using checkouts with lein, how can i be sure that the code being used is from checkouts rather than the jar that was "lein install"ed?

5:21 i ask because i have a stacktrace which refers to both the name of the source file AND the jar

5:21 and i'm not sure where the code is actually coming from:

5:22 at app.server.resource.resources$resource.invoke(resources.clj:21) ~[server-0.0.1-SNAPSHOT.jar:na]

5:22 anyone know?

5:22 augustl: ebaxt: the issue is not file encoding, but the fact that the actual encoding is utf-8 and the encoding attribute of the <?xml> tag says utf-16, so the xml parser gets confused :)

5:23 ebaxt: augustl: ah :)

5:24 augustl: so I need to tell the parser to ignore the encoding specified in <?xml>

5:24 seems clojure.data.xml works though, it probably doesn't guess encoding based on the attr..

5:26 ucb: ro_st: can you remove the jar installed with lein install?

5:31 ebaxt: augustl: I use clojure.data.xml with clojure.data.zip.xml. Took me some time to understand zippers, but well worth it :)

5:32 augustl: ebaxt: got a favorite getting started tutorial? ;)

5:33 ebaxt: augustl: long time ago but I think I read something by Brian Marick, and this video: http://blip.tv/clojure/luke-vanderhart-clojure-zippers-4521622

5:34 augustl: If you're not doing any transformations I suppose understanding xml-> and xml1-> and the how that affects the three is enough

5:44 thalassios_xelon: hello room :))

5:45 is there a way to trace a exception?

5:46 except the default,and the (pst)

5:46 to see where is the error in my clojure code...

5:47 sometimes it show me the error,sometimes i find it with (pst) sometimes i cant find it..........

5:50 augustl: ebaxt: how do you typically get the text? I tried (zx/xml-> zipped :Foo :Bar zx/text), it gives me a lazy sequence of one item, containing the actual text

5:50 I could wrap it in (first), but what if it returns nil? etc..

5:52 ebaxt: augustl: (xml1-> loc :foo :bar text) should give you nil or a string (you got a seq because you used xml->

5:52 augustl: ah

6:50 jcrossley3: p_l: i don't know of anyone who's attempted to mix GAE with Immutant

6:59 p_l: jcrossley3: I was thinking mainly of using immutant as "container" for running a GAE clojure app in JBoss.

6:59 Cause so far my experience with setting up a sensible nREPL environment was... bad

7:00 jcrossley3: p_l: i'm curious what about GAE specifically appeals to you?

7:00 p_l: jcrossley3: I was thinking of using it for deployment of few things where I can't be arsed to manage them

7:01 and Heroku, while fine, might not fit without paid account

7:01 jcrossley3: p_l: looked at OpenShift?

7:04 p_l: jcrossley3: the free plan would work... if I dropped Clojure :>

7:04 (frankly speaking, it's more that because of GAE I am looking at Clojure, not the other way around)

7:04 jcrossley3: p_l: why drop clojure? you can run anything on OS.

7:05 p_l: jcrossley3: the resource constraints on small gears in the free plan

7:06 jcrossley3: p_l: which limits concern you?

7:06 p_l: memory, mainly

7:06 also... OpenShift so far is running on EC2 US-East

7:06 that datacenter seems to be cursed :D

7:07 jcrossley3: p_l: fwiw, i've deployed non-trivial immutant apps to openshift fine.

7:08 p_l: jcrossley3: I am wary because back when I tried "normal" setup for REPL, I ended up blowing half a gig of ram just to start, ending up with three heavy weight processes.

7:09 jcrossley3: p_l: with immutant?

7:09 p_l: jcrossley3: no, just plain clojure with nrepl and lein2

7:09 jcrossley3: p_l: have you read this? http://bit.ly/poorsmatic

7:09 p_l: immutant made me interested again because it might run it... more compact

7:12 hmmm... looks interesting

7:12 still, if I had "custom stack" available, I wouldn't be using clojure (probably)

7:15 cemerick: p_l: what was this "normal" setup you tried?

7:16 * jcrossley3 was curious about that, too :)

7:16 p_l: cemerick: lein2 + nrepl and I think that one middleware that handled debugging

7:16 cemerick: p_l: ritz?

7:16 p_l: I was trying to get to the level of comfort I had on my existing stack, but with Java support

7:16 cemerick: think so

7:16 that was.... hmm... november/december 2012

7:17 cemerick: right; so, that's only necessary (a) when debugging, and (b) when using e.g. emacs, since you need a jvm to connect to another jvm for the debug info

7:17 If you just want a REPL, you can `lein trampoline repl`, and get one process

7:18 p_l: cemerick: and I was using Emacs (eclipse or CLI repl... it's like going to stone age or asking spanish inquisition to incarcerate me)

7:19 cemerick: p_l: so, trampoline will get you down to 2 processes. But, why do you care about process count?

7:20 Actually, I'd be shocked if nREPL ran on GAE at all.

7:20 p_l: cemerick: nREPL is for developement side (and would work on the SDK container, afaik)

7:22 if I were to go with OpenShift... hmm... I'd probably just run SBCL on it :)

7:23 cemerick: p_l: In any case, I think you'll be happier with just about anything other than GAE. Use beanstalk, use openshift, use a linode, use a bare EC2 instance.

7:23 p_l: cemerick: EC2 & Linode are out due to price (and it's for a non-commercial proof of concept project)

7:24 I am no longer eligible for the free plan on EC2 :)

7:24 cemerick: p_l: next thing you know, you'll be threatening to use ABCL ;-P

7:24 michaelr525: p_l: heroku maybe?

7:27 cemerick: p_l: you'll get what you pay for, most likely

7:28 michaelr525: i'm paying for a Hetzner dedicated server, and it's cheap if you compare it to Amazon

7:28 costs me 40 euros a month

7:30 cemerick: is AWS supposed to be a discount provider? Odd comparison if so.

7:31 michaelr525: Hetzner is a discount provier?

7:31 But I agree that it's a bad comparison

7:32 cemerick: I've no idea. The only context I see them mentioned in is around cost though.

7:32 mpenet: ifesdjeen: hey

7:32 michaelr525: cemerick: i'm satisfied with my dedicated server :)

7:33 cemerick: michaelr525: noted :-)

7:33 michaelr525: basically what i'm saying is that if all you want is to run one or a few small projects it could be a viable alternative to Amazon.

7:34 It's a case when you don't really need a cloud

7:42 p_l: cemerick: ABCL is a bit unwieldy, requires Java, and its interop (or at least the documented stuff) is more annoying than clojure's ;)

7:42 CCL and SBCL run fine ;P

7:43 cemerick: except for that whole CL thing.

7:43 p_l: cemerick: which I prefer over Clojure :>

7:43 cemerick: as you like :-)

7:43 p_l: (but that's the realm of personal preferences)

7:59 pwned: what's the difference between clojurescript and clojure and why do they both exist ?

8:02 I mean what's the point? why not have a clojure compiler emit js instead?

8:04 algernon: pwned: even if the clojure compiler would emit js, that wouldn't help in cases where you're using java libraries from clojure.

8:04 the platforms are wildly different, and interoperability with the host is required. so you can't just flip a bit in the compiler and target another platform.

8:05 pwned: challenge accepted.

8:06 algernon: https://github.com/clojure/clojurescript/wiki is also a good read (esp. the Rationale and Differences from Clojure)

8:07 pwned: I wasn't satisfied with the way they put forth V8 and say "woohoo it runs on a fast vm!"

8:08 I think clojure could be reused to target v8

8:08 all the work of parsing and lexing done again

8:09 Ember-: pwned: v8 and javascript are NOT multithreaded (web workers != real threads in the sense)

8:09 that's one huuuuge thing missing from clojurescript (and from javascript) compared to JVM

8:10 and like algernon said, it's really a *lot* more complicated than one might think

8:11 Pupnik-: doesnt that defeat a large part of the purpose of clojure?

8:11 (not having access to multithreading)

8:11 Ember-: Pupnik-: indeed

8:11 that's why I brought that up as the first thing

8:12 there are so many other problems too that I don't even want to go there - not when I have work to do

8:12 but to keep it short: it's a *bad* idea to think that one could just dump clojure and go completely the clojurescript way

8:12 those can and should co-exist

8:12 but they are in no way anything which would rule the other

8:13 now, back to work

8:13 :)

8:13 pwned: I meant to say that clojurescript could have been a branch of closure with compatible syntax that simply targets a different vm

8:14 instead it is a whole new project with much of the work re-done

8:15 algernon: it's much more complicated than that :)

8:15 pwned: alright alright! :-)

8:15 Ember-: I'm guessing "branch of closure" should read "branch of clojure"?

8:16 since google closure has absolutely nothing to do with clojure

8:16 pwned: Ember-: you're right I misspelled

8:16 dealing with too many closures right now

8:17 Ember-: but anyway, both need to be done pretty much from ground up at least on the compiler and core library side of things

8:17 due to the extremely different platforms

8:17 jvm == static typed bytecode virtual machine, v8/javascript == dynamically typed interpreted virtual machine

8:18 jvm has threads, v8 doesn't

8:18 Chousuke: the clojure compiler is written in java so it made sense to rewrite the compiler for clojurescript.

8:18 Ember-: indeed

8:18 Chousuke: later on they may be unified but it's obviously not high priority work :P

8:19 Ember-: clojure is first class citizen project, clojurescript comes second for now

8:19 may change

8:19 wouldn't bet for it though :)

8:19 Chousuke: nah, clojurescript is as much first class as clojure is.

8:19 it's just a separate project

8:20 Ember-: but damn it, I was supposed to be working!

8:20 :P

8:20 ->

8:40 ebaxt: cemerick: Any thoughts on how you would add acl support to friend?

8:43 cemerick: ebaxt: ACLs are so often app-, domain-, and data-model-specific that "ACL support" is undefined. You can certainly check your ACLs and call throw-unauthorized upon a failure (which I just wrote and pushed a docstring for, BTW).

8:46 ebaxt: cemerick: OK, so what did you mean in the doc by "maybe something compelling can fall out of existing treatment of roles?"

8:46 cemerick: under fine-grained authorization that is :)

8:48 cemerick: ebaxt: I dunno, waiting for something compelling to present itself. :-)

8:48 ebaxt: cemerick: Gotcha :) This what you referred to btw? https://github.com/cemerick/friend/commit/b526dd47c1d51f8fb57ee7572c51fc5a5ba35063

8:49 cemerick: https://github.com/cemerick/friend/commit/2707c7da2a350c4851dc7bbabe6724f3a48b1a89

8:49 ebaxt: cemerick: thx

8:50 cemerick: ebaxt: what I do know is that RBA mapped so gorgeously onto clojure's hierarchies...I'd want to have a similarly awesome approach for ACLs to "bless" it for inclusion in Friend.

8:54 mpfundstein: hoi clojure guys. is there a possibility to iterate over a list of key val parts? '(key1 val1 key2 val2 key3 val3) -> [k v]

8:56 ebaxt: cemerick: I understand. What would be nice is an abstraction over something like spring-security of PicketLink's IdentityManagement and reuse the LDAP and RDBMS implementations from there, but comping up with a clean abstraction is probably not trivial :)

8:57 xeqi: &(partition-all 2 '(key1 val1 key2 val2 key3 val3))

8:57 lazybot: ⇒ ((key1 val1) (key2 val2) (key3 val3))

8:58 xeqi: &(for [[k v] (partition-all 2 '(key1 val1 key2 val2 key3 val3))] v)

8:58 lazybot: ⇒ (val1 val2 val3)

9:00 cemerick: ebaxt: I'm not familiar with PicketLink; but, yes. A complicating factor is that relatively few(er) Clojure apps are written using either LDAP or RDBMS'. The truly common abstraction is probably, per usual, "just a function".

9:01 ro_st: is there a ring middleware for measuring render time?

9:01 jcromartie: ro_st: I think I've written it a few times :P

9:01 mpfundstein: xeqi: thanks :-)

9:02 ro_st: does yourst put the time into http body as a comment?

9:02 jcromartie: no, as a header

9:02 you don't want to do that (as a comment)

9:03 because your response will always contain headers, but it might not always be HTML

9:05 ro_st: something like (defn with-time [handler] (fn [req] (let [start (current-time!) resp (handler req) end (current-time!)] (ring-util/header resp "RenderTime" (str (- end start) "ms")))))

9:06 clintnewsom: n00b question..i'm trying to swap into a nested nested atom to reset state of a game…I know this is probably not the idiomatic way of doing this, but right now I can't even get the values to assoc properly

9:06 https://gist.github.com/newsomc/5142729

9:06 jcromartie: ro_st: but I think it's really better to just measure the real-world performance with ab or just in Chrome or whatever

9:06 ro_st ab = apachebench

9:06 clintnewsom: just use one function to swap!

9:07 clintnewsom: and update-in

9:08 clintnewsom: better yet, have an initial ghost state you can just use instead of updating all these things

9:08 clintnewsom: ok

9:09 make sense

9:10 there is still a part of me that wants to understand how to do something like this :)

9:10 even though its probably an antipattern!

9:14 ro_st: thans jcromartie!

9:16 jcromartie: clintnewsom: this is my take on it https://gist.github.com/jcromartie/5142741

9:16 ro_st: jcromartie: i actually want to do similar to what github did with their staffmode bar https://github.com/blog/1252-how-we-keep-github-fast

9:17 that little progress bar they have, showing the pre-render/render/network split

9:17 jcromartie: clintnewsom: you are really looking for how to update a map structure

9:17 clintnewsom: which is update-in

9:17 ro_st: for now, though, i'll be happy with a render time

9:18 clintnewsom: jcromartie: woah, awesome

9:18 jcromartie: i will study this

9:19 antares_: clintnewsom: see http://clojure-doc.org/articles/language/concurrency_and_parallelism.html

9:19 clintnewsom: it explains how reference types work and how to work with atoms specifically

9:20 clintnewsom: antares_: thank you

9:21 jcromartie: ,(update-in [{:pos {:x 0 :y 0}}] [0 :pos :x] inc)

9:21 esmo: regarding clojurescript and the use of 'this' (which is needed in a bootstrap component i'm using) via this-as or otherwise.. is there a way to avoid the "dangerous use of this in static method" warnings during compilation?

9:21 clojurebot: [{:pos {:y 0, :x 1}}]

9:21 jcromartie: clintnewsom: but generally, you don't want to iterate over a range if you can just map over the sequence itself

9:21 esmo: is it possible to provide jsdoc annotations using metadata, for example?

9:21 clintnewsom: antares_: i'm actually doing this in clojurescript...

9:22 jcromartie: got it

9:22 jcromartie: ro_st: you could definitely inject the bar into the top of the page if the response was HTML

9:22 clintnewsom: jcromartie: i could tell the way I am approaching this is not very functional

9:23 jcromartie: clintnewsom: actually, the better way to do it would be to send it as JSON

9:23 antares_: clintnewsom: as far as I know ref types (including atoms) in clojurescript work the same way

9:23 jcromartie: so, like, at the end of the page <script>myPageStats = {…}</script>

9:24 clintnewsom: antares_: though i believe you only get atoms

9:25 jcromartie: ro_st: or you could just keep performance stats in some cache on the server and get them async with JavaScript

9:25 ro_st: yea

9:25 jcromartie: but now I'm overthinking it :)

9:27 ro_st: so yeah, just stick the stats in a <script> tag at the end

9:27 ro_st: jcromartie: your ring-util alias there, what ns is that?

9:28 jcromartie: http://ring-clojure.github.com/ring/ring.util.response.html#var-header

9:28 ring.util.response

9:28 ro_st: thanks

9:31 danieroux: ro_st: An alternative approach: http://yahoo.github.com/boomerang/doc

9:32 ro_st: nice one!

9:34 jtoy_: how do you guys typically tell if you are in dev or prod mode from your clojure apps?

9:36 hyPiRion: jtoy_: usually I uberjar/uberwar it and run it standalone in prod mode, otherwise I do lein run or lein ring server etc.

9:36 the lein commands usually tend to go in dev mode unless you explicitly set the profiles in the command line

9:37 jtoy_: hyPiRion: right, but what do you use to set dev mode? a os var like ENV ?

9:39 jcromartie: jtoy_: you mean how does your clojure code know if it's dev mode

9:39 jtoy_: jcromartie: yeah

9:50 hyPiRion: jtoy_: lein runs in dev mode by default, you can bypass it by doing lein with-profile -dev ...

9:51 for standalones and libraries, the dev profile isn't included.

9:52 ravster: hello all

9:53 ambrosebs: hi

9:55 jimduey: ambrosebs: hey. starting to dig into core.typed. Looking forward to learning more about what you did.

9:56 ambrosebs: jimduey: sweet!

9:56 jimduey: and did you see this from Oleg? http://okmij.org/ftp/ML/generalization.html

9:57 ambrosebs: jimduey: I haven't had the courage to dig in ;)

9:57 cheers for the reminder

9:57 jimduey: remember, you eat an elephant one bite at a time. Very small bites.

9:58 ambrosebs: sheesh :)

9:59 jtoy_: is it worth it to upgrade from lein1 to lein2

10:00 nDuff: jtoy_: Absolutely.

10:01 ro_st: jtoy_: without hesitation.

10:02 ejackson: jimdue: how was Aruba ?

10:02 jimduey: how was Aruba ?

10:03 jtoy_: is it supposed to be a dropin replacement? my app doesnt work with lein2

10:04 clgv: jtoy_: you have to make some minor modifications provided you have a standard lein 1 project.clj - see the migration guide

10:09 jimduey: ejackson: awesome. got to meet some great people. good presentations. lot's of fun.

10:30 gfredericks: so lein's :repl-options {:init-ns user} can't create a namespace for me?

10:31 owengalenjones: could anyone explain what is happening here? http://d.pr/i/rij2 I cant understand why using map would have such different results from using the for in a ThreadPool

10:33 gfredericks: owengalenjones: the equivalent for to your map would remove the octothorp

10:33 (for [i (range 5)] (task i))

10:33 the body of the for is implicitely the map function you're using, you don't have to use an explicit function literal

10:34 in this case tasks becomes a list of functions that call task instead of the return values of task

10:34 on another note (map #(task %) (range 5)) can be reduced to (map task (range 5))

10:37 owengalenjones: gfredericks: thank you, that is a great explanataion

10:39 awesome: http://d.pr/i/rb2g

10:54 devn: good morning all

10:56 jcrossley3: devn: morning!

11:03 bhenry: out of nowhere, one of my apps suddenly doesn't decode the + for whitespace in form params. now i get "this+is+a+test" strings in my database.

11:16 TimMc: bhenry: Does it decode %20 properly?

11:18 bhenry: TimMc: spaces " " turn to "+"; "%20" stays "%20"

11:18 TimMc: OK, so you've suddenly lost URL decoding entirely.

11:18 bhenry: yeah. and i didn't change anything related to that, so i'm completely lost.

11:19 they are post params

11:19 TimMc: Wait, there may be a miscommunication here.

11:19 If you put an = into the data that is POSTed, what does it look like in the DB?

11:20 The data, mind you, not the POSTDATA.

11:21 By the way, I blame version ranges.

11:21 bhenry: TimMc: what's a version range?

11:21 in the project.clj?

11:22 text area input: "ignore this test = = = "

11:22 db storage result: "ignore+this+test+=+=+=+"

11:22 TimMc: Fascinating.

11:22 I think I've seen this before.

11:23 The version ranges thing is half snark, half hunch.

11:24 bhenry: relevant part of code (get (:params ring-request) "notes")

11:24 so probably my ring params middleware is broken?

11:31 gfredericks: ,(doc bit-shift-left)

11:31 clojurebot: "([x n]); Bitwise shift left"

11:32 gfredericks: ^ great for figuring out which arg is which :P

11:32 ystael: should be [victim severity] or something

11:32 TimMc: Yeah, relying on naming conventions as documentation is not so great.

11:35 bbloom: I wish `extend were more useful....

11:36 bhenry: TimMc: i should also note that this only happens on the production box and not on my dev box.

11:36 any ideas?

11:38 ambrosebs: bbloom: what's wrong with extend?

11:38 bbloom: ambrosebs: doesn't work with java interfaces, produces slower code, not available on cljs

11:38 ambrosebs: right

11:39 slower code compared to what?

11:39 bbloom: ambrosebs: implementations inside the body of deftype

11:39 ambrosebs: ah

11:39 that kinda sucks.

11:40 bbloom: hence my complaint :-)

11:40 ystael: bhenry: do you have something in the way that's eating the request's Content-Type: header?

11:40 ambrosebs: ;)

11:40 bbloom: ambrosebs: when you define impls inside the deftype, it emits real methods for real java interfaces

11:41 ambrosebs: otherwise, it does some sideways hackery, so you get an Fn object in a map of some sort

11:41 ambrosebs: right. Is that because of a real restriction?

11:41 bhenry: ystael: not that i know of. again this works on dev and suddenly broke in production after the last deploy, which changed code unrelated to any of this problem. arg.

11:42 bbloom: i think it's b/c you can't edit a type after you create it on the JVM

11:43 i've got a deftype that i want to reuse between clj and cljs, but it's just such a royal pain in the ass, i might as well maintain two totally different implementations

11:43 and implementing clojure.lang.Fn makes me cry

11:45 ambrosebs: :/

11:46 yay, jvm.tools.analyzer is all set up https://github.com/clojure/jvm.tools.analyzer

11:46 0.3.0 should be on Maven in 24 hours.

11:49 bbloom: What's your latest opinion on AST children?

11:50 bbloom: ambrosebs: i still think it's a broken/bad idea for the most part

11:54 ambrosebs: bbloom: It reminds me of trying to squeeze a method call into a literal map. :/ Doesn't really make sense.

11:54 dnolen: ambrosebs: bbloom: it would be nice to get the basic AST sorted out now that we have an official analyzer

11:55 ambrosebs: Yes.

11:55 bbloom: ambrosebs: so i've found the :children thing to be useful once or twice, but i'd rather it be a multimethod. i don't think it's a bad thing to require an API as long as the essential information remains "just data"

11:55 ambrosebs: bbloom: ditto, exactly

11:57 bbloom: ambrosebs: do you know of anyone but you and me who are trying to do real/interesting things with the AST outside of the compilers?

11:57 ambrosebs: nope

11:57 bbloom: dnolen: ?

11:57 dnolen: bbloom: ambrosebs: rhickey was pretty adamant about no API - I think it's worth sticking to that.

11:58 ambrosebs: Chris Frisz is working on CPS stuff.

11:58 dnolen: bbloom: I believe ibdknox may use it, anybody doing any serious tooling needs it.

11:58 ambrosebs: but Chris has his own custom AST deftype/record thing

11:58 bbloom: dnolen: yeah, i was gonna say, i think he just wrote his own analyzer for his own needs

11:58 ambrosebs: Chris' CPS uses a custom representation

11:58 ambrosebs: Yep, but he's told me he might move to the standard AST.

11:58 He liked what he saw.

11:59 :children is a serious problem for AST manipulations.

12:00 frozenlock: ,(= "asd" "asd")

12:00 clojurebot: true

12:00 frozenlock: ,(= #"asd" #"asd")

12:00 clojurebot: false

12:00 bbloom: dnolen: there already *is* an API tho... you can't avoid it

12:00 dnolen: you need to re-analyze if you make any new forms

12:00 dnolen: analyze is an API.... a poorly specified one

12:01 frozenlock: ... What's so magical about regexp that makes them not equal?

12:01 Kototama: hi, I have put my JS libraries in closure-js/libs but cljsbuild doesn't not compile them. Is the path correct?

12:02 dnolen: ambrosebs: I'm pretty sure everyone agreed that :children was a expedient hack and it's probably wise to just remove it.

12:02 ambrosebs: ok good.

12:03 bbloom: dnolen: heh, what did that happen? either way, i'm OK with it, but I think the children multimethod should come back

12:03 dnolen: ambrosebs: bbloom: also there should be some way to get an AST that removes unnecessary env cruft

12:03 bbloom: probably not going to happen

12:03 bbloom: dnolen: yes. i have a few little helpers for that

12:04 jonasen: dnolen: bbloom: ambrosebs: Ah, the good'ol :children discussion

12:04 technomancy: ambrosebs: would it be easy to wire up a "who calls this defn" extension for nrepl with analyze?

12:04 TimMc: bhenry: Run `lein classpath` on both boxes, and compare them.

12:05 jonasen: dnolen: Have you had a chance to look at http://dev.clojure.org/jira/browse/LOGIC-118

12:05 bbloom: fundamentally, AST transformations involve producing new nodes, so you need to either support creating new nodes via {:op :foo :bar :baz} without having to magically know any other keys, or you need to provide factory functions

12:06 ambrosebs: technomancy: Should be easy. I swear there was an example of that somewhere...

12:06 bbloom: I'd much rather not have factory functions, but then you need to analyze-ast or analyze-form to get an AST with ancillary keys in it

12:06 dnolen: bbloom: ambrosebs: looking back over the old thread from May last year - the issue isn't :children, it's how it's used - the nodes should just be inside - :children shouldn't be some kind of weird lookup.

12:06 TimMc: frozenlock: True regular expressions could easily support an equality check, but Java regexps include backreferences and such.

12:06 frozenlock: Or do you mean just pattern string equality?

12:07 technomancy: maybe we'll make that a seajure hack project some month =)

12:07 dnolen: jonasen: thanks for the ticket+patch - I need to take a closer look.

12:07 jonasen: dnolen: ok

12:07 gfredericks: are watchers for atoms invoked on the same thread as the swap?

12:08 bbloom: dnolen: personally, i prefer it as a weird lookup

12:08 gfredericks: nm read the docs

12:08 ambrosebs: technomancy: eastwood is a linter based on analyze. This is along the same lines of what you're asking https://github.com/jonase/eastwood/blob/master/src/eastwood/linters/unused.clj

12:09 bbloom: dnolen: but the bottom line is that you need to call analyze on any map or form you produce via a transformation, so with that in mind, it doesn't bother me much any more

12:09 either way is fine really

12:09 frozenlock: TimMc: I mean why arent' #"asd" and #"asd" equal, even if they are obviously the same thing.

12:09 bbloom: the problem is that :env, :children, etc are synthesized properties -- there is no distinction between essential AST data and memoized data

12:09 technomancy: ambrosebs: cool; thanks

12:10 bbloom: dnolen: ambrosebs: we should spec out two schemas for the AST: essential & synthesized. essential should be a proper subset of synthesized

12:11 dnolen: ambrosebs: also, you should both read up on Attribute Grammers, since that's what we're effectively making here

12:11 TimMc: frozenlock: Again, which kind of equality? Are #"[0-9]" and #"[0-56-9]" equal?

12:12 ambrosebs: dnolen: bbloom: core.typed types might be useful here https://github.com/clojure/core.typed/blob/master/src/test/clojure/clojure/core/typed/test/compiler.clj#L61

12:13 bbloom: ambrosebs: nice

12:13 frozenlock: TimMc: they have the same result, but they look different, I would say no.

12:13 https://github.com/clojure/clojurescript/commit/e35c3a57472fa62ae41591418a73794dc8ac6dde

12:13 jtoy: is there a simple method like slurp that I can use but also parse each line? like (slurp "/tmp/test.txt" #(clojure.string/split #"\\s") )

12:13 ambrosebs: bbloom: :)

12:13 johnmn3: in clojurescript, I'm having some odd behavior with an atom. when I run my update-atom! command in the brepl it updates the atom and fires off the watcher and everying... when that function is fired off from a button in the browser, the atom doesn't get updated.

12:14 bbloom: ambrosebs: does that only buy us validation of ASTs? or could we, in theory, also extract known fields?

12:14 johnmn3: I added some printlns in the functions that get ran while inside the swap!'s function, and the printlns run and print! but somehow, afterward, the atom is still the same as before.

12:14 ambrosebs: bbloom: what do you mean?

12:15 bbloom: ambrosebs: so let's look at :op :var for a moment

12:15 ambrosebs: the essential information is {:op :var :name Symbol}

12:15 ambrosebs: but there is this :info table and then :env and :children

12:15 ambrosebs: and :info can have a bunch of other stuff, like type hints, etc

12:16 ambrosebs: sure

12:16 johnmn3: so, I am probably going to be setting up an example project with just the elements related to the behavior, to try to isolate it... but before I go down that road, is anyone already familiar with any odd behavior related to cljs atoms and possible workarounds?

12:16 bbloom: ambrosebs: i'm wondering if we could somehow use the type information to extract only the essential data out of the structure, so that we could have some kind of (essentials-only some-ast) that returns a nice pretty-print-ready AST

12:16 ambrosebs: ie without :env or :children

12:17 ambrosebs: bbloom: If you make a new copy of the type, sure?

12:18 bbloom: ambrosebs: i guess the question is: Can I reflect over the types such that I can create a generic function to walk the AST and select interesting fields?

12:19 ambrosebs: (i also realize now that :children could also be implemented via such a reflection on types)

12:20 frozenlock: So cljs was fixed, but not clj?

12:20 * frozenlock grumps a little

12:20 ambrosebs: So you can generate a walk/fold function from a recursive AST type?

12:21 jweiss: huh, so records created before a protocol was extended to that type, will never satisfy that protocol? wasn't expecting that

12:21 gfredericks: jweiss: wat?

12:21 TimMc: frozenlock: Open a Jira ticket, I guess... http://rbxbx.info/images/fault-tolerance.png

12:22 ambrosebs: bbloom: The types are certainly not just syntax, there's lots of core.typed infrastructure to interrogate them.

12:22 bbloom: ambrosebs: i guess of course they need to be inspectible... that was a silly question i guess... haha

12:22 jweiss: gfredericks: (def jeff (MyUser. "jeff")) (extend MyUser Proto1 {:foo (constantly :foo)}) (foo jeff) -> error

12:23 frozenlock: TimMc: Oh yay...

12:23 bbloom: ambrosebs: i need to limit myself to a single simultaneous complex thought process :-)

12:23 gfredericks: jweiss: oooh, you mean instances

12:23 ambrosebs: bbloom: Well there's a few tricks with recursive types and aliases etc.

12:23 jweiss: yeah sorry

12:23 ambrosebs: bbloom: But you'd be up for that ;)

12:23 TimMc: frozenlock: :-/

12:23 hiredman: /win/win 15

12:23 gfredericks: jweiss: that is kind of gross

12:23 TimMc: /for /the /win

12:23 rasmusto: hiredman: winwin situation

12:24 bbloom: ambrosebs: heh. hurraaaaay :-P

12:24 ambrosebs: bbloom: :D

12:24 hiredman: window 15 is the one window I go to often that I can't use keyboard shortcuts to jump to

12:25 jweiss: gfredericks: i'm not entirely sure yet whether recompiling the namespace that defined the record had anything to do with this, trying now

12:25 trptcolin: jweiss: that doesn't error for me on 1.4, assuming i've done (defprotocol Proto1 (foo [_])) and (deftype MyUser [name]) or (defrecord MyUser [name])

12:26 jweiss: trptcolin: yeah, maybe you have to re-eval the (defrecord ...) for this to go wrong

12:26 i added a new record and recompiled the namespace where MyUser was also defined

12:28 ugh, well, my simple repl case works fine. not sure what was going on

12:30 rasmusto: hiredman: I'm bad at irssi and use C-n/C-p to change windows

12:31 hiredman: rasmusto: since I have more then 15 windows walking linearly through the list is not great

12:31 rasmusto: hiredman: definitely, I'm not saying my way is efficient at all :p

12:32 TimMc: rasmusto: M-4 should get you to window 4.

12:32 rasmusto: TimMc: that's surprising actually, I guess it handles escape-4 from my terminal emulator properly

12:58 lynaghk: gfredericks: pong

12:59 gfredericks: sorry about that, I went to a conference in Aruba and seemed to have left IRC running =P

12:59 bbloom: you're coming to Clojure/West? Awesome, I'd be happy to talk rewrites.

12:59 bbloom: lynaghk: definitely, i'm speaking :-)

13:00 lynaghk: ohhh, well you should certainly come then

13:00 bbloom: lynaghk: but yeah, i'm curious how it's working out with partial map rewrites for your grammar of graphics

13:02 lynaghk: bbloom: ah, that work has stalled out a bit---most of the time I've been able to spend on that project has been fighting with core.logic

13:03 bbloom: so I'm taking a break to see if there are nicer ways to go around it---if only just coming up with my own custom DSL and writing code to walk everything

13:03 bbloom: that code never used the fancier parts of relational logic (i.e., "going backwards")

13:03 bbloom: lynaghk: hm, i figured as much...

13:08 bhenry: TimMc: on production it's running from an uberjar. how can i get the classpath from in there?

13:17 frozenlock: Hrmph... I'm really bad with `types'... How could I use extend-type to fix the regexp equality? I tried https://www.refheap.com/paste/12439, but I get error :(

13:17 jtoy: can resources be used with a rdr? like so: (with-open [rdr (clojure.java.io/resource "dist.male.first")]

13:18 technomancy: jtoy: try it and see? =)

13:18 jtoy: i dont thinkso: I'm geting java.lang.IllegalArgumentException: No matching field found: close for class java.net.URL

13:18 llasram`: jtoy: Well, you probably want to actually io/reader it

13:18 jtoy: i think im doing something wrong though

13:19 llasram`: bhenry: How are you running the uberjar? With `java -jar ...`?

13:19 jtoy: I defintely need resource

13:20 because the file is packed in a jar and sent to hadoop

13:20 dnolen: frozenlock: you cannot fix regexp equality

13:20 llasram`: jtoy: (a) Sure. So check and see what io/resource returns. Then consider what io/reader may take as arguments

13:21 jtoy: (b) In Hadoop context, is a resource the right solution vs the distributed cache?

13:21 frozenlock: dnolen: Didn't you do it with cljs?

13:22 bhenry: llasram`: java -cp uberjar.jar runscript.clj

13:22 oops

13:22 dnolen: frozenlock: I don't think so

13:22 jtoy: llasram`: i have never used the distributed cache, i will look into that, but ive been using resources a lot befoire, but I typically just slurp them in which works

13:22 bhenry: llasram`: java -cp uberjar.jar clojure.main runscript.clj

13:22 jtoy: i need to process my file though so i cant use plain slurpo

13:22 frozenlock: dnolen: https://github.com/clojure/clojurescript/commit/e35c3a57472fa62ae41591418a73794dc8ac6dde ??

13:22 lazybot: frozenlock: What are you, crazy? Of course not!

13:23 llasram: bhenry: Hmm. So when using the -jar option, the classpath should be limited to just the boot classpath + the JAR contents

13:23 dnolen: frozenlock: heh, yeah I forgot. You can't do that on the JVM.

13:24 frozenlock: Arggg

13:24 dnolen: frozenlock: or well not until Clojure JVM is based on protocols and not Java interfaces

13:25 bbloom: dnolen: grumble grumble interfaces

13:25 frozenlock: So if I have a regexp somewhere in a vector, which in turn is in a map, I can't test for this map equality. Ever? o_O

13:25 bbloom: equality is hard.

13:25 jtoy: I believe this should work: [rdr (clojure.java.io/reader (clojure.java.io/resource "dist.female.first"))] but I get java.lang.RuntimeException: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn

13:26 resource Returns the URL for a named resource; reader: If argument is a String, it tries to resolve it first as a URI, then

13:26 as a local file name

13:26 llasram: jtoy: Yeah, not immediately applicable, but I do suggest looking into the distcache for side-data. You get all the benefits of distributing via your jar file, but you can change the data being loaded w/ rebuilding your JAR

13:27 jtoy: Are you sure that's where your exception is coming from? It looks like you have too many parens somewhere or are otherwise trying to call a string as a function

13:27 dnolen: frozenlock: appears not, I guess you could put a regex string in there instead.

13:28 frozenlock: Such a little thing... and yet so much pain

13:28 jtoy: llasram: yeah, you are right, thx

13:43 technomancy: anyone know when the link to leiningen.org from clojure.org was added?

13:44 ohpauleez: technomancy: A few days ago

13:44 I think Alex Miller made the link updates

13:44 stuartsierra: technomancy: A couple of months ago I think.

13:44 technomancy: ohpauleez: traffic to leiningen.org got a ~70% boost starting a week ago

13:44 43% of referrers from clojure.org

13:45 stuartsierra: Well, that was probably it, then. :)

13:45 ohpauleez: ahh, maybe it was a little longer than a few days

13:45 All the doc and tool sites got added to clojure.org

13:46 technomancy: yeah, no referrers from clojure.org over 10 days old

13:46 jtoy: is therea version of case that is evaluated? I a simpel way to do multiple if elses?

13:46 technomancy: cool; I owe Alex a high-five

13:46 (for many reasons)

13:46 amalloy: jtoy: cond

13:46 bbloom: awesome! glad that link is on there now

13:47 jtoy: amalloy: thx

13:47 ambrosebs: dnolen: bbloom: how about :children are a vector of 2 place vectors, with path and child type information.

13:47 ieure: Has anyone seen issues with Clojure projects taking significantly longer to start than other JVM langs?

13:47 bbloom: ambrosebs: "path"?

13:48 ambrosebs: :if would be [[:then] :single] [[:else] :single] ...]

13:48 ieure: I have a fairly straightforward codebase, and it pegs the CPU for 60s before my -main is ever called.

13:48 technomancy: ieure: jruby has a lot of tricks up their sleeves, but we're catching up: https://github.com/technomancy/leiningen/wiki/Faster

13:48 oh... 60s; yeah that's terrible.

13:48 ieure: technomancy, Yeah, nothing to do with lein.

13:48 I build a fat jar and `java -jar blah'

13:49 bbloom: ambrosebs: so i left some comments on the design page just now

13:49 stuartsierra: I've seen large apps take up to 30 seconds just to load & compile Clojure source files.

13:49 bbloom: ambrosebs: the more i think about it, the more i think it should be left the way it is, but moved into a separate AST pass

13:49 ambrosebs: then consuming is (for [[path info] (:children expr)] (let [c (get-in expr path)] (if (= :single path) ... ))

13:49 technomancy: ieure: any AOT?

13:49 bbloom: ambrosebs: and passes should be configurable

13:49 ieure: technomancy, No.

13:49 ambrosebs: bbloom: ok sounds interesting.

13:49 technomancy: ieure: I recommend :aot :all when you build your uberjar

13:49 bbloom: ambrosebs: in the meantime, i'd be happy with refactoring it into a multimethod :-P

13:49 ieure: stuartsierra, So when I build a JAR and `java -jar' it, Clojure compiles at that time?

13:50 hiredman: rich seemed dead set against making it a multimethod

13:50 dnolen_: ambrosebs: bbloom: any discussion of the AST should separated from passes IMO

13:50 bbloom: ambrosebs: see my notes: basically the thing that a few folks (including me) were complaining about was the book keeping on :children, but i found that you have the same book keeping on :env, etc

13:50 ieure: technomancy, I build with maven, assume there's something similar there?

13:50 stuartsierra: ieure: Clojure doesn't compile anything to disk unless you tell it to.

13:50 dnolen_: ambrosebs: bbloom: it also probably a good idea to seriously look at JS AST JSON projects for inspiration.

13:50 technomancy: ieure: probably; not sure how

13:52 ieure: So inside my fat jar, I see .class files for the Clojure code in the project.

13:52 bbloom: dnolen_: i think that configurable passes would make the question of what to do with children obvious....

13:53 dnolen_: ambrosebs: this is a topic we can discuss more in person, but now (finally) i think i understand this well enough to speak intelligently about it... and it's a radically different perspective from my original

13:54 dnolen_: bbloom: ambrosebs: this is definitely a case of don't design something when there's some really good prior art as AST as data full-stop - JS AST projects are doing the right thing in this regard.

13:54 or rather, don't design something without looking very long and hard at something similar first

13:54 bbloom: dnolen_: i think they are doing what i'm suggesting: configurable passes to add optional data, always recreate from essentials and re-analyze

13:56 dnolen_: bbloom: ambrosebs: http://esprima.org/demo/parse.html

13:56 bbloom: dnolen_: yeah, that's exactly what i'm suggesting :-P notice the checkboxes for "index-based range"

13:56 dnolen_: add a checkbox "children" and it's what i'm saying

13:57 ambrosebs: bbloom: dnolen_: I see what you mean. It would it pretty painless to perform transofmrations

13:57 bbloom: the bottom line is that this has one API method: parse. and it's configurable with optional data, whether that be passes or conditionals in existing passes

13:58 we have one API function: analyze

13:59 dnolen_: bbloom: to me :children should be similar to Body in JST AST here, are you suggesting the what :children does now to be preserved in some form as extra information?

13:59 bbloom: dnolen_: i'm saying that :children is no different than :env

14:00 dnolen_: bbloom: where do you store the equivalent of the JS Body information then?

14:00 bbloom: dnolen_: there are essential fields, that form a minimal set to fully specify the AST node (assuming the node is attached)

14:00 nDuff: ieure: Your own Clojure code may exist as .class files, but how about your dependencies? Hence :aot :all

14:01 technomancy: nDuff: actually it's not possible to AOT your own code without AOTing dependencies yet

14:01 unless you do resolve or eval at runtime

14:01 bbloom: dnolen_: that "body" is specific to the node type you're looking at

14:01 dnolen_: that's :statements and :ret basically

14:01 nDuff: Ahh.

14:01 bbloom: dnolen_: try just "x" as the only code (without the quotes)

14:01 dnolen_: you'll see the "Program" has body, but the "ExpressionStatement" doesn't

14:02 dnolen_: body is essential to a block

14:02 hiredman: it does seem sort of weird that :ret and :statements are not just a single array, similar to body there

14:02 bbloom: dnolen_: what i'm saying is that 'parse should provide *essential fields only* and analyze should be considered an AST pass that adds additional information

14:04 dnolen_: and additional information is inherently optional.... ie env, info, shadow, children, tag, etc

14:04 each of those can and should be a separate pass

14:05 ambrosebs: bbloom: this way we can present eg. children any way we like, with no complications right?

14:06 bbloom: ambrosebs: sure, but the simplest representation is just to duplicate them the way it currently works

14:06 ambrosebs: yes, exactly

14:06 as in, no complications for AST manipulators

14:06 bbloom: ambrosebs: not quite... go see my notes about 'assoc

14:06 on the wiki

14:06 ambrosebs: ok

14:07 atyz: Hey guys, I'm currently using kormasql to pull data from 2 database tables. However it seems to format the data strangely. If someone wouldn't mind looking at this paste and pointing me in the right direction i would be very grateful. http://slexy.org/view/s2rwV8HegL

14:07 bbloom: i think i should implement an attribute grammar system.... & take a crack at porting the analyzer to use that

14:07 ambrosebs: dnolen_: http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue4/Why_Attribute_Grammars_Matter

14:07 because too many passes will make the analyzer slllloooow b/c it requires many traversals

14:08 but an attribute grammar could be compiled via a topological sort to make a minimal number of passes

14:08 craigbro: atyz: that's not how sql works 8)

14:08 bbloom: and then "passes" are really just attribute grammar "aspects"

14:08 dnolen_: bbloom: I guess you still haven't looked at the Chez Scheme stuff, nano-pass compiler designs work

14:09 bbloom: dnolen_: d'oh, no i forgot

14:09 * bbloom adds that to the queue

14:09 dnolen_: bbloom: and I recall Mitchell Wand or someone saying they thought Attribute Grammars are dumb ;) But I don't know much about them, I should look at it more closely.

14:09 craigbro: atyz: aka, it can't return results like that

14:09 ambrosebs: bbloom: wouldn't you just have the essential data in your AST transformations? ie. assoc new things that look like the output of `parse`, then feed it through `analyze`?

14:09 bbloom: dnolen_: they might be awkward to use without fully lazy evaluation....

14:10 craigbro: atyz: one way to do something like that is to make a query for your events, then, do anotehr query using the where venue.id IN event.venue_id

14:10 and then merge them

14:10 nDuff: ...well, one could formulate a query with a sigil in the returned column names, and build into a nested-tree structure based on those sigils...

14:10 ...but it'd be work that would have to be done.

14:11 bbloom: dnolen_: if you have a reference for him saying they are dumb, i'd love to see his thoughts :-P

14:12 ambrosebs: yeah, you can assoc into them, but then you need to call analyze again & the analyze pass only adds stuff, doesn't remove it. so if there is some field that isn't unconditionally added, you have a bug now

14:12 dnolen_: bbloom: ambrosebs: in any case I don't mean to muddy the waters. I think writing up what the miniml AST looks like + how what a generic walker looks like (no API) + benchmarks on multiple passes to add the extra information actually needed by complier would be useful.

14:12 bbloom: ambrosebs: because the condition can be unsatisfied, so then the attribute doesn't get added, but it was already there!

14:13 ambrosebs: so the safe/smart thing to do is to throw out the map & recreate it, or just create a form directly

14:13 for the record: i think that generic transformations are impossible.... but generic analysis is sometimes reasonable

14:13 and a non-generic transformation can often skip a known node which may contain unknown nodes

14:13 ambrosebs: bbloom: yes, I agree making a new map of just essential data is the way to go.

14:13 bbloom: but still perform generic analysis, like my 'serious? function

14:15 ambrosebs: bbloom: sounds reasonable.

14:16 atyz: craigbro, I was hoping Kormasql would have some nice way to structure the results it receives behind the scenes - thanks though

14:17 craigbro: atyz: well, in some ORMs (DataMaper for example) that would be done for you somewhat automagically

14:17 technomancy: bbloom: wait, I have to know what the serious? function does

14:17 craigbro: atyz: in AR for example, you could do .includes(:venues) or whatever

14:17 and it would do that join

14:17 bbloom: technomancy: it determines if a form is non-trivial

14:18 technomancy: where, in this context, trivial means "guaranteed not to use any continuation-based control forms"

14:18 technomancy: oh, ok; I was expecting NLP irony-detection or something

14:18 craigbro: atyz: in my experience tho, clojure rovides nice enough list/map operations that you don't need that, and in fact, writing your own mechanism lets you get the best performance most of the time

14:18 technomancy: but that's cool too I guess

14:19 bbloom: technomancy: the discussion is about ASTs, so if anything, it would be like "DID YOU SERIOUSLY WRITE SUCH A CRAPPY FUNCTION?"

14:19 craigbro: atyz: using the clojure fn group-by for example

14:19 atyz: craigbro, yeah, i was hoping korma would have that hidden int eh docs. Yeah i've just started writing it myself

14:19 i appreciate your input :)

14:20 craigbro: atyz: for example, in a case where you get little duplication of venues, the form above is optimal. If you have relatively few venues that are repeated across events, then the "two select" method using "IN" is better

14:20 atyz: in your case, you likely have few venues

14:24 atyz: actually an event would only correspond to one venue

14:25 cemerick: dnolen_: I'd like to be able to usefully set *print-fn* when apps are advanced-compiled, but its name is currently obfuscated away. Does adding ^:export to it make sense to you off the top of your head?

14:26 craigbro: atyz: sure, but there are N venues in the whole system, where N is much ess than the number of events

14:26 dnolen_: cemerick: that would probably work yes.

14:26 atyz: OH yes, ofcourse

14:27 craigbro: atyz: in AR for example, it would do the same attribute name munging and then unmunge it and create that subordinate relationship you want

14:28 jtoy: what is the clojure way if i wanted to open a file, process the line to see if it returned true/false and then at the end know how mamy trues it got and how many falses

14:28 with imperative langauges I know, but not sure in clojure

14:29 cgag: filter over a line-seq and count the results would work

14:29 arrdem: ^ that

14:29 llasram: Or just `reduce`

14:29 jtoy: is that whole thing lazy?

14:30 dnolen_: bbloom: OK, after re-reading the design page from top to bottom, what you were saying earlier makes more sense. Basic AST, call analyze to add :children etc, if you change something on a node you'll need to start fresh and call analyze again?

14:31 blrm: jtoy: line-seq and filter are lazy.

14:31 ToBeReplaced: jtoy: filter and line-seq both are... count/reduce aren't... if you want a running count though, you can use reductions

14:32 jtoy: it sounds like its ok for the count to not be lazy though?

14:32 dnolen_: bbloom: or were you saying keep :children as vector of keys, and it's analyze's job to keep it in sync if you change a node?

14:34 bbloom: dnolen_: in the past, i was saying vector of keys, but only b/c i hadn't thought out how this generlizes to :env and all other computed values

14:34 arrdem: what are we compiling here?

14:34 bbloom: dnolen_: now i'm saying leave it the way it is, but yes, call analyze again, it's analyze's job to handle this

14:35 dnolen_: in short, i say we start by specifying the output of 'parse without any call to analyze... that's the fundamental grammar

14:35 dnolen_: anything else should be considered disposable data

14:35 dnolen_: bbloom: ok - that does sound OK. and the AST includes :children for generic walkers?

14:35 bbloom: dnolen_: ideally: only if requested

14:36 dnolen_: bbloom: huh, then I don't see how you can have a generic walker.

14:36 bbloom: dnolen_: does your generic walker need type hints? does it need :shadow information? does it need unique local symbol names?

14:37 dnolen_: different down stream passes have different requirements

14:37 dnolen_: i think it's satisfactory to always include :children for same-process analyze calls, but you surely don't want that extra info in there if you're printing the analyze results to a string or whatever

14:38 blrm: jtoy: count can be expensive depending on how its used. you can use the counted? predicate on a var to see if it will return in constant time or not

14:38 bbloom: dnolen_: but i think we need the inverse too: the ability to REMOVE non-essential attributes later, so it's satisfactory to always include them

14:38 dnolen_: bbloom: I don't see why stuff matters as far as making it easy to write a generic walker.

14:38 bbloom: with :children you at least have the possibility of skipping over nodes you don't understand.

14:39 lynaghk: dnolen_: you have any suggestions on how to debug a situation where goog.require("my-ns") is being emitted before goog.provide("my-ns")? "lein cljsbuild clean && lein cljsbuild once" sometimes resolves it, but that doesn't quite inspire confidence

14:39 bbloom: dnolen_: the issue has more to do with writing transformations, which might change essential values that invalidate computed values

14:40 dnolen_: lynaghk: I do not, seems like a dependency order bug in the compiler - perhaps due to incremental compilation.

14:40 bbloom: yes you keep focusing on transformation. I'm saying there are other things to consider.

14:40 so :children still might have utility in the minimal AST

14:41 lynaghk: if you can produce a minimal case, I can look into it. Though would really like a patch. Tracking a dep order bugs is a pain.

14:41 TimMc: bhenry: Have you debugged your URL-encoding thing yet? I'm guessing you're running with a different set of profiles in dev and prod. Where is production running?

14:41 dnolen_: lynaghk: I thought I had resolved it but maybe not?

14:41 bbloom: dnolen_: these are the things to consider: analysis modularity, serialization/printing, walking, and transformation

14:41 lynaghk: dnolen_: yeah, no joke. I'll see if I can find a minimal example---I suspect it's because my namespace has a hypen in it

14:42 bbloom: dnolen_: you're missing what i'm saying about a "minimal" AST

14:42 dnolen_: the minimal AST includes only the fields that would match the arguments you'd include if you had factory functions

14:42 lynaghk: dnolen_: I'll submit a patch if I figure it out. Just thought I'd ask in case there was some common knowledge ("Don't use hyphens, bro!")

14:42 bhenry: TimMc: i haven't been working on it, since it's a time suck not knowing what to look at. production is an ubuntu amazon box that uses nginx to direct to the jetty server that's started with ring.

14:42 cemerick: lynaghk: hi :-)

14:43 bbloom: dnolen_: i keep discussing transformations b/c in writing a transformation, i've had exposure to the rest of the points

14:43 bhenry: TimMc: if i run the production environment on my macbook the same way, i don't have the issue on the ubuntu box. my current hunch is that something changed in nginx on the server

14:44 bbloom: dnolen_: in a transformation, i need to worry about parsing, initial analysis, printing for debugging, creating transformed nodes, and re-analyzing after transformation

14:44 dnolen_: lynaghk: yeah nothing comes to mind. I've heard a couple of complaints but no tickets / minimal cases / patches

14:45 bbloom: dnolen_: and, IMO, :children was initially annoying b/c i was trying to 'assoc to change things, once i realized i just had to bite the bullet and always fully re-create forms, then i flip flopped: children had some usefulness for a generic version of the recursive `serious? predicate

14:45 dnolen_: and only bothered me during printing, but i had the same problem with :env

14:46 dnolen_: bbloom: ok, makes sense. some more things to think about.

14:46 lynaghk: dnolen_: yeah, it's a thankless problem.

14:49 jtoy: if i am going through a file, why does this print everyline instead of all lines? (println (first (line-seq rdr)))

14:49 i thought if its lazy it wont process every line?

14:49 harob: Does anyone know of a decent library of graph functions (e.g. computing the transitive closure)? clojure.contrib.graph seems to have died with clojure-contrib.

14:51 TimMc: bhenry: I don't see why nginx would be meddling with your postdata. Pretty weird. By the way, do GETs works as expected? That's something to check.

14:51 bhenry: i'll try to change the method to get and see what happens.

15:00 sshack: So I'm using leon-pedantic to track down dependency version mismatches. What's the answer to everything wanting a different version of clojure?

15:01 nDuff: sshack: Unless something uses version ranges (kill it with fire!), just let the highest version win?

15:02 sshack: [korma "0.3.0-beta7"] -> [org.clojure/clojure "1.3.0"]

15:02 is overrulling

15:02 [org.clojure/clojure "1.5.0"]

15:02 I get miles of that.

15:06 antares_: sshack: use :exclusions: https://github.com/michaelklishin/monger/blob/master/project.clj#L37

15:06 sshack: So the answer is pruning the graph manually?

15:07 stuartsierra: Leingingen supports global :exclusions

15:09 sshack: Also, how do you pronounce leingingen?

15:09 Glenjamin: Hi all, I'm trying to learn clojure but struggling to pick a decent editor

15:09 cgag: what do you currently use for other languages?

15:09 amalloy: Glenjamin: use whatever editor you're already comfortable with

15:09 Glenjamin: Emacs is probably a bit too different to what I'm used to while learning a new language - any suggestions?

15:10 blrm: Glenjamin: you've come to the right place to get 9 different opinions, what do you use to edit text normally?

15:10 Glenjamin: currently using komodo, but having trouble managing all the parentheses

15:10 patrkris: tpope: do you happen to know how to cancel spinning up the JVM, when loading a .clj-file in MacVim using vim-foreplay?

15:10 tpope: you can let g:no_foreplay_classpath = 1

15:10 Glenjamin: is there anything non-emacs with paredit and barf/slurp?

15:11 tpope: that prevents it from doing much useful without a repl running

15:11 cgag: i mostly use vim/emacs, but eclipse and counterclockwise seemed pretty capable and easy to setup: http://clojure-doc.org/articles/tutorials/eclipse.html

15:11 tpope: many don't seem to care

15:13 blrm: Glenjamin: if you are comfortable with vim, vim-foreplay is nice. eclipse and CCW is good if you want a full IDE. There is a clojure plugin for intellij IDEA but I haven't tried it.

15:14 Glenjamin: i was hoping there was a non-IDE that isn't vim or emacs, but i guess primarily people are in those camps?

15:14 n_b: LightTable?

15:14 I think Raynes uses SublimeText as well

15:14 cgag: I've heard sublimetext works

15:14 Raynes: I think you are entirely incorrect

15:15 I'm an Emacs user who occasionally complains about ST2's shortcomings.

15:15 trptcolin: http://tempest.fluidartist.com/wp-content/uploads/2009/05/oh-snap-flowchart.jpg

15:15 n_b: Ah, must've seen you complaining and thought you used it then

15:18 patrkris: tpope: well, actually I just want to be able to do what I can already do in terminal Vim, i.e. to press Ctrl-C to abort when opening a file

15:19 tpope: I can't seem to do that in MacVim, and perhaps it is something specific to MacVim

15:19 tpope: oh I didn't even think of that

15:19 n_b: Glenjamin: St2 is probably your best bet if you are currently using Komodo, I think there's even a paredit plugin

15:19 Glenjamin: cool. i'll give it a whirl

15:19 people keep telling me they like ST2

15:19 tpope: patrkris: can you ctrl-c if you open macvim first, then :edit a clojure file?

15:20 n_b: It's probably the least bad non-terminal editor ;) I'll grant it that

15:20 Glenjamin: heh

15:20 patrkris: tpope: nope... it insists on waiting for the JVM to start (if I'm not already running a REPL)

15:20 tpope: which Vim variant do you personally use?

15:22 tpope: several. this particular setup doesn't sound that painful to me because if I'm in macvim, I'm in it for the long haul

15:22 patrkris: oh btw, if you install the extracted classpath.vim, it's much better at caching

15:22 so maybe that will render this moot

15:22 patrkris: tpope: i'll give it a try, thanks

15:24 blrm: tpope: is there a "c" command to eval the whole file with foreplay? or is :%Eval the way to go about it?

15:24 tpope: cpr requires the file

15:27 blrm: tpope: ty!

15:28 patrkris: tpope: your advice worked wonders

15:28 tpope: I'm going to remove the old version that ships with foreplay

15:28 whenever I get around to renaming :(

15:29 patrkris: tpope: tell me what to do, and I'll do it

15:29 llasram: tpope: What are you renaming it to?

15:29 tpope: I think fireplace but I hate it

15:29 Raynes: vim-threesome

15:30 He is trying to get away from the sexual connotations obviously.

15:30 tpope: Raynes haha that's actually taken

15:30 Raynes: Of course it is.

15:30 Vim people and their sex.

15:30 tpope: well the guy later renamed

15:30 if I loved fireplace I would have done it already. instead I'm like "meh, I'll do it this weekend"

15:30 every week

15:31 bbloom: what's wrong with fireplace?

15:31 llasram: Why "fireplace"?

15:31 bbloom: my guess is fiREPLace, considering foREPLay

15:31 tpope: nothing's wrong with it, it's just kinda meh


15:32 bbloom: tpope: all names always suck until they don't suck

15:32 who names a computer company "apple"? seriously? wtf?

15:32 Sgeo: Fun name for an esolang: "Trustfuck"

15:32 patrkris: vim-repel

15:32 bbloom: but now, it couldn't possibly have been named anything else :-P

15:32 Sgeo: I really like that name, but don't really want to mention it to potential employers etc.

15:33 llasram: Huh, fewer words with 'repl' in them than I would have expected

15:33 `replete` doesn't quite code it, which pretty much leaves `fireplace`, I do see

15:33 s,code,cut,

15:33 bbloom: but, i agree, foreplay is bad b/c i've heard several complains directly or indirectly from women. i think it's silly to be offended by it, but i can't change the way people feel, so i think it's best for your project & for the clojure/vim sub community

15:34 patrkris: what a fucked up world

15:34 bbloom: best to change it, i mean

15:35 frozenlock: How `foreplay` could be offending? o_O

15:35 bbloom: frozenlock: as someone who has routinely offended people on accident, here's what i've learned:

15:35 * Raynes rolls his eyes.

15:35 bbloom: frozenlock: it's a complete fucking waste of your time to be offended

15:36 frozenlock: but it's also a complete fucking waste of your reputation to offend people

15:37 frozenlock: Well yeah, I don't usually give a **** about what might offend people, but this is just silly.

15:37 What's next, 'hug'?

15:37 Sgeo: bbloom, should I rename Trustfuck?

15:37 Raynes: I get kind of scared to talk to women in tech who aren't Bodil or Carin Meier these days. It's so easy to say something stupid and get branded a sexist on twitter (which happens *all the time*, and usually ends up in a lot of ridicule for the poor soul who made the mistake of a stupid joke or something).

15:37 Sgeo: It's not like it's ever going to see production...

15:37 bbloom: Sgeo: if you want to increase the number of people who bother looking at it, then yes rename it

15:38 frozenlock: Raynes: Don't you get it? You are a guy! Thus, sexist.

15:38 bbloom: Sgeo: if you don't care about contributors or users or your reputation, don't worry about it

15:38 Raynes: frozenlock: Heh.

15:38 patrkris: there will only be gender equality the day that women learn to take a joke for what it is ;)

15:38 Sgeo: I care about reputation, but it's not exactly a thing that people would be using on a regular basis

15:38 Raynes: My problem is that I make stupid immoral jokes about *everybody*.

15:38 bbloom: Sgeo: until some easily offended person in HR reads your github profile

15:39 frozenlock: Raynes: you're young, white, and male. You shouldn't try to make jokes... it's dangerous :P

15:39 Raynes: I'm overweight though, so I can make all kinds of fat people jokes.

15:39 bbloom: frozenlock: seriously.

15:39 Raynes: Did you hear bout them mericans?

15:39 frozenlock: :P

15:45 cemerick: Raynes: Jokes are generally a bad idea — esp. in text-mode — unless you (a) know your audience well, or (b) are a known comedian.

15:46 Sometime, ask me about the time I slipped up and made an Irish joke (which I do all the time since my wife is largely Irish) at dinner in London with someone whose father happened to be an active member of the IRA back in the day. :-O

15:46 bbloom: in short, cemerick is now dead. true story.

15:46 cemerick: bbloom: I flinch every time I turn my car on.

15:47 * cemerick digs the hole ever-deeper

15:47 frozenlock: cemerick: you don't ask passing children to turn the car on?

15:47 Raynes: cemerick: I'm getting better at being quiet these days, but I've been pretty dumb in the past.

15:47 cemerick: frozenlock: that's a good idea!

15:47 bbloom: Raynes: it's all OK as long as you avoid embarassing yourself publicly in a permanent medium... you know, like irc logs :-)

15:47 Raynes: cemerick: I made a tweet once that, after a few months, resulted in a long angry email from a Clojurian who was concerned about me giving the entire community a bad reputation. One tweet, Chas.

15:47 And I hadn't even realized how horrible what I said was.

15:47 bbloom: Raynes: but seriously, avoid jokes in email.... trust me.....

15:48 heh

15:48 Raynes: So I apologized and deleted the tweet. I even offered to do a public apology but he didn't feel it necessary.

15:48 cemerick: Raynes: I believe it. Text-mode is *always* a bad scene for "humor".

15:48 Except in cases (a) and (b) ^^

15:48 cgag: Raynes, what'd you say, or at least, which group of people did you offend?

15:49 frozenlock: At the same time, you don't get people to like you by saying nothing.

15:49 Raynes: cgag: Everyone.

15:49 frozenlock: Those social skillz are hard!

15:49 Raynes: cgag: Literally everyone, I think.

15:49 wink: a good joke is worth a friend or two

15:49 cgag: ha, bravo then

15:49 cemerick: frozenlock: In general, if you follow Mom's advice, people will like you just fine ;-)

15:50 bbloom: frozenlock: ignore that completely if your Mom is a loon.

15:50 n_b: well, this was interesting scrollback to come back to :P

15:51 tpope: patrkris, bbloom et al: try the rename branch

15:51 frozenlock: cemerick: seems like an eternal-friendzone advice.

15:53 cemerick: frozenlock: Or something. Once you identify people's comfort zones, you can have fun. Until then, bbloom's points re: reputation risk apply, and hopefully empathy holds sway.

15:53 bbloom: tpope: first line of fireplace/zip.vim mentions incorrect filename

15:53 there are two occurrences of "foreplay" in that file

15:53 both in comments

15:53 ivan: the more you offend people the faster they can burn out their be-offended-all-the-time circuits

15:54 tpope: bbloom: --amended and repushed

15:54 nDuff: ivan: That assumes that you offend only people who are offended "all the time".

15:54 bbloom: ivan: ok, you go with that strategy and clear the path for me, just don't go around representing any communities i'm part of :-P

15:55 n_b: That stratagem has worked terribly well for 4chan ;)

15:56 nDuff: n_b: Which one? 4chan doesn't exactly have what I'd term a passable reputation.

15:56 bbloom: tpope: seems to work fine

15:56 n_b: the "more you offend people..."

15:56 tpope: great. gonna give it a little time before making it official

15:57 nDuff: n_b: I'd argue that 4chan has selected its audience, not made the general public less susceptible to offense.

15:57 bbloom: tpope: dammit. gonna have to update a submodule link, what a pita, dammit offended people :-P

15:57 tpope: yeah I know

15:57 piranha: octagon: hi, are you here by any chance? :)

15:57 tpope: it's been eating me up for months

15:57 n_b: nDuff: and my original comment was facetious, we agree.

15:57 nDuff: n_b: As previously discussed here, text isn't a good substrate for non-serious content.

15:57 (without explicit designation as such)

15:58 frozenlock: some-text some-text some-text <recorded-youtube-joke> some-text some-text some-text

15:59 n_b: the ";)" appended is essentially synonymous to adding the metadata {^:sarcasm true} to the statement

15:59 patrkris: tpope: tried the amended rename branch and dabbled around a little - seems to work

15:59 nDuff: n_b: ahh; just so. :)

16:02 bbloom: dnolen_: is there a particular bit of chez scheme i should be looking at?

16:06 dnolen_: bbloom: http://www.cs.indiana.edu/~dyb/pubs/nano-jfp.pdf

16:06 bbloom: dnolen_: thanks

16:12 dnolen_: bbloom: some historical context http://www.cs.indiana.edu/~dyb/pubs/hocs.pdf about the movement to micropass and I guess eventually nanopass design

16:12 bbloom: dnolen_: thanks again, i'll read those later on

16:17 harob: Does anyone know of a non-abandoned graph function library (e.g. with a strongly connected component implementation)? http://clojure.github.com/clojure-contrib/graph-api.html died with clojure-contrib and https://github.com/jkk/loom seems abandoned.

16:17 akhudek: dnolen_: that looks interesting, I'll read it as well. Need to redo the code synthesis part of the compiler project I'm working on. It's a mess of string concats right now. Very terrifying.

16:20 antares_: harob: maybe http://titanium.clojurewerkz.org or http://clojureneo4j.info will fit your needs? Note that Titanium will probably undergo some breaking API changes in the next release.

16:22 harob: Thanks antares_ : I looked at those two, and they look very cool but my understanding is that they are wrappers around graph data stores, and do not provide actual higher-level algorithms (such as finding strongly connected components, dijkstra's, etc). Is your understanding of them different?

16:23 antares_: harob: Neocons can do that and with Cypher you can do many similar things

16:23 harob: as for Titanium, it's based on the tinkerpop graph stack and graph algorithms there are not yet really baked (see tinkerpop.com)

16:23 arohner: does typed clojure have a type for Refs?

16:24 is it just Ref, or (Ref Vector)?

16:24 hyPiRion: ,(class (ref nil))

16:24 clojurebot: clojure.lang.Ref

16:25 craigbro: antares_: hey, you work with neocons much?

16:25 arohner: hyPiRion: yes, I understand the class of c.l.Ref, I was asking if typed clojure did things differently, because it also handles, e.g. (Seq Foo)

16:25 craigbro: antares_: and/or titan

16:26 oh, you wrote the clojurewerkz libs 8)

16:26 harob: antares_ : Thanks, I'll look closer at Neocons + Cypher then!

16:26 hyPiRion: arohner: Ahh, I see. I didn't connect it to typed clojure

16:29 antares_: harob: sorry that Neocons' graph algorithm functions are not really documented, we got distracted by a few new clojurewerkz.org projects

16:29 craigbro: I maintain Neocons

16:30 craigbro: as well as Titanium. Can I help you?

16:30 craigbro: antares_: I'm investigating graphDBs for our next gen storage system. Favoring Titan now.

16:30 harob: antares_: No worries, thanks for the great work! Where would be the best place to look to ramp up quickly on the Neocons algorithms? The source?

16:31 craigbro: antares_: I'm not building for another 6 months, so breaking API changes don't hurt

16:32 antares_: craigbro: if Titan's relative immaturity is not a problem for you, go with it. As soon as 0.3 ships, we will move Titanium to it. I hope the API won't change much but can't be completely sure :)

16:32 craigbro: antares_: the key needs are the clustering, write scaling, and the tinkerpop ecosystem

16:32 antares_: craigbro: the biggest issue with Neo4J is that it does not have dump/import tools in the Community edition, neither it has HA

16:32 craigbro: antares_: I need fast writes/imports

16:32 antares_: craigbro: and Titan is APL 2.0, plus the embedded library approach makes transactions support sane

16:33 craigbro: in such case Titan probably will beat Neo4J over REST by a wide margin

16:33 craigbro: antares_: I also need the HA and near real-time queries (the ones I need to be near real-time are relatively simple)

16:33 antares_: craigbro: also sounds like something Titan will be better at

16:33 because it keeps some data locally

16:33 craigbro: antares_: main issue twith Titan, is lack of search over indexed properties

16:33 antares_: and persists what needs to be persisted at the end of every transaction

16:33 clojurebot: dnolen: well feel free to throw some more in and send me a pull request. The format is pretty general

16:34 antares_: craigbro: Titan 0.3 will include Lucene integration

16:34 craigbro: antares_: I need IP/CIDR block searching, text search etc...

16:34 antares_: well then, I'm set 8)

16:34 antares_: craigbro: also, I believe Titan has simple K/V indexing for everything?

16:34 craigbro: antares_: yah, simple K/V gets me 90% there

16:34 antares_: craigbro: see https://groups.google.com/forum/?fromgroups#!topic/aureliusgraphs/vlRg0ey735g

16:34 craigbro: well, I think titanium already supports that :)

16:34 craigbro: antares_: and as long as they make the indexing APIs extensible, I can add things like leventenshein distance etc...

16:35 antares_: craigbro: not sure about that but you can always use ES with an addon as a last resort. See http://clojureelasticsearch.info if you need an ES client.

16:35 craigbro: antares_: I need fast writes tho, that is where I am worried about Titan

16:35 antares_: saw that -- it led me to consider have ES running side by side

16:36 antares_: for some set of analysis we do, ES is the right tool

16:36 antares_: it just means I have to provision storage for it, and get it's writes to scale etc...

16:36 antares_: craigbro: you can ask on their mailing list. I believe they have done projects with hundreds of billions of edges and it took < 24 hours to import.

16:36 craigbro: antares_: awesome 8)

16:37 antares_: craigbro: I'd say getting ES to scale for writes won't be that hard. But account for any possible failures in another component is certainly a valid concern.

16:38 craigbro: see the README https://github.com/thinkaurelius/titan

16:38 craigbro: antares_: I've read all those materials and am on the list already

16:38 antares_: craigbro: they say that they target billions of vertices/edges and multi-machine environments from the start

16:38 ok

16:38 craigbro: antares_: saying they target, and pulling off are two different things -- but their twitter simulation has me pretty much convinced

16:39 antares_: craigbro: well, the only thing I can add is that once Titan 0.3 is out, Titanium will quickly move to it and Orge (a new project, Gremlin-like queries in Clojure)

16:39 craigbro: antares_: I see Titan and the tinkerpop eco system and I think, "ok, so that's what the mature graphdb platform looks like"

16:40 antares_: craigbro: if you ask me, tinkerpop is young but nobody is getting as much right as they are

16:40 craigbro: i want gremlin in clojure 8)

16:40 antares_: and they have a license that you can actually mention to your boss

16:40 craigbro: have you seen https://groups.google.com/forum/?fromgroups=#!topic/gremlin-users/Del9DasqBcE?

16:41 craigbro: excellent

16:41 harob: antares_: Regarding neocons graph algorithms, is there somewhere else I should be looking than https://github.com/michaelklishin/neocons/blob/master/src/clojure/clojurewerkz/neocons/rest/paths.clj ? It looks like neocons delegates the algorithms to the underlying neo4j rest server, is that right?

16:42 antares_: harob: Neocons is a Neo4J Server client

16:43 harob: if you need specifically path traversals, see http://docs.neo4j.org/chunked/stable/cypher-query-lang.html and http://docs.neo4j.org/chunked/stable/graph-algo.html to learn what Neo4J can do :)

16:43 harob: sorry, http://docs.neo4j.org/chunked/stable/rest-api-traverse.html and http://docs.neo4j.org/chunked/stable/rest-api-graph-algos.html :)

16:43 harob: but Cypher is fantastic at that sort of problems

16:44 harob: antares_: Thanks for the links! The built-in graph algorithms ( http://docs.neo4j.org/chunked/stable/rest-api-graph-algos.html ) look fairly limited so I'll look into Cypher. Thanks!

16:50 jcromartie: is there any way to wait for an agent to update?

16:50 amalloy: jcromartie: yes, but usually what you want to do is use something other than an agent instead

16:51 jcromartie: I suppose

16:51 I'm trying to model a resource that is periodically updated from a URL

16:51 and I want to make sure that it's been loaded at least once the first time

16:51 maybe represent the loading/parsing as a future?

16:52 a future inside an atom?

16:53 amalloy: a future inside an atom needs to be handled with extreme care, since starting a future is side-effectful

16:53 jcromartie: hm

16:54 amalloy: jcromartie: i actually have a function in useful that might do good work for you

16:55 jcromartie: (also: it seems like although atoms are lighter weight, refs are a more change-proof choice)

16:55 amalloy: https://github.com/flatland/useful/blob/develop/src/flatland/useful/state.clj#L83

16:55 jcromartie: (i.e. you will never find yourself missing features from atoms when you choose refs)

16:55 interesting

16:57 but if I created the future outside of swap! then it would be good

17:10 but if I said (let [new-bar (future …)] (swap! foo assoc :bar new-bar)) that would do the trick right?

17:10 because assoc is side-effect free

17:15 amalloy: like so https://www.refheap.com/paste/12453

17:15 gfredericks: does anybody know about ClassNotFound: my-main.namespace-with-dashes ?

17:15 when doing `lein run`

17:15 jcromartie: gfredericks: only with "lein run"?

17:15 gfredericks: I think

17:15 jcromartie: i.e. it works in the REPL?

17:15 gfredericks: it's caused by a bad require

17:15 but the error gives no indication of what/where

17:16 I don't know what the equivalent action in the repl is; it doesn't get as far as calling my main function

17:16 because there's a compile error

17:16 jcromartie: well you shoud be able to work it out in the REPL

17:16 hopefuly

17:16 gfredericks: yes I know what the underlying problem is

17:16 I'm trying to figure out why `lein run` manifests it that way

17:17 jcromartie: OK got i

17:17 got it

17:21 mye: Hello. How can I use "sessions" in nrepl.el to open a clojurescript repl buffer with piggieback but still use only the one nrepl connection? It seems a very confusing subject...

17:22 Trying to write functions that open two repls with nrepl connections is horrible, nrepl.el has lots of hardcoded assumptions

17:22 eg. buffer names

17:23 ljos: ambrosebs: I am testing your core.typed library, but I am having some problems. Is it me doing something wrong or shouldn't (HMap {:k (Value 1}) be a subtype of (IPersistentMap Keyword Long) ?

17:25 brehaut: ljos: ive had some trouble with Value and int-ish values not being equivalent in 0.1.8 master

17:26 ljos: i think (no certainty) that an HMap is quite a distinct type to a IPersistentMap (which is homogenous)

17:27 im pretty sure you could go jam :foo :bar into your HMap type and it would still be valid, whereas putting that into a homogeous map would not be

17:29 ljos: just to be clear though, i have only slightly more than no clue about what im talking about

17:29 ljos: brehaut: I would think that anything that goes into a HMap should be able to go into a IPersistantMap, or?

17:30 brehaut: ljos: nope, i dont think so

17:31 ljos: brehaut: how so? Isn't HMap just a specialisation of a normal map?

17:31 brehaut: ljos: it may be that anything that can go into an (IPersistentMap Keyworld Any) can go into an HMap though

17:32 ljos: as i understand it, its a specialisation of of (IPersistentMap Any Any) for certain keys

17:32 (thats an approximate analogy)

17:33 ljos: i think the thing is that HMaps can always have key value pairs added to them that are not in the type definition and still be of that type

17:34 ljos: behaut: That last sentence doesn't make any sense to me.

17:35 brehaut: say you have {def-alias Foo (HMap {:a AnyInteger}))

17:35 ljos: brehaut: wait, I just read the definition of HMap again: HMap has ATLEAST the set of keyword/type pair.

17:35 brehaut: yes

17:36 so (assoc {:a 1} :b "baz") would still produce a valid Foo

17:38 arohner: ooh, core.typed conversations

17:38 ljos: brehaut: Now it makes sense, thanks. I still have the problem that when I write a {:a 1} in terminal it is automatically set to a HMap

17:38 arohner: is (typed/cf (filter even? [1 2 3 4])) supposed to work?

17:38 in 0.1.7

17:40 tyler__: is there a lib that has static types in it?

17:40 i thought i saw that somewhere

17:40 brehaut: arohner: i read somewhere that filter frex doesnt always get enough type information from the predicate, and you need to ann-form it

17:41 arohner: brehaut: (typed/cf (filter (typed/ann-form even? [Integer -> Boolean]) [1 2 3 4]))

17:41 same error

17:41 brehaut: arohner: the example in the docs mentions identity as the predicate i recall

17:42 pbostrom: mye: what are you trying to do with nrepl.el exactly? Open two sessions, one for Clojure, and one for cljs/piggieback?

17:42 arohner: and ann-form is really ugly :-)

17:42 brehaut: yeah

17:42 ambrosebs is working on improving local inference to limit how often its required i think?

17:42 mye: pbostrom: I'm trying to write a function that toggles between one repl running clojure, and one running clojurescript

17:43 pbostrom: in elisp? sorry, can't help there

17:43 ljos: tyler__: core.typed is the static types library.

17:43 tyler__: ljos: thanks

17:44 mye: yes elisp

17:45 brehaut: arohner: http://clojure-doc.org/articles/ecosystem/core_typed/limitations.html has a section on "using 'filter"

17:46 arohner: the ann-form notation looks like it uses the :filters stuff for occurance typing. youch

17:47 arohner: the :filters docs are http://clojure-doc.org/articles/ecosystem/core_typed/filters.html

17:47 arohner: brehaut: thank you!

17:47 didn't know those were doc'd yet

17:47 brehaut: arohner: no problem

17:48 arohner: the docs are a decent start, but i still ran into a huge swath of stuff i had to bug ambrosebs about

17:55 jcromartie: is there any "one true way" of designing a stateful repository of objects in clojure

17:55 like

17:55 I want to manage a set of things, so I put that set in an atom, and the atom has metadata containing the path where it should be saved (atomically) peridoically

17:56 I don't see a need to use a hash table just to act as an index on an ID/primary key

17:56 do I design the API around the reference that holds the state?

17:57 or around the state value itself

17:57 like, do I do the swap! or dosync/alter inside my API?

17:57 I guess I answered that question for myself because that would mean that you need to know implementation details

17:57 brehaut: jcromartie: gfredericks will tell you something about simple and easy any moment now.

17:58 jcromartie: :)

18:00 brehaut: jcromartie: i kinda thing that if you could potentially change the ref type used later (eg to STM) then write the API without respect to the type

18:00 jcromartie: yeah

18:01 Ruby on Rails appeared 9 years after Ruby

18:01 I wonder how long before people figure out how to write systems in Clojure :)

18:01 seems like it's starting to gel

18:01 I want to see this talk http://lanyrd.com/2013/clojurewest/sccgkd/

18:01 kind of sounds like exactly what I am looking for

18:06 sundbp: hi. let's say i have a couple of different storage backends each implementing a given protocol. i want to pick which to use in an EDN config file read at runtime. is there an idiomatic way to do this apart from something like a cond enumerating the alternatives ?

18:06 (the instantiation of the right backend based on config that is)

18:17 tyler__: is there a way to get a vector to 'fit' to a map? like i have [112231 "foo"] and i want to end up with {:id 112231 :name "foo"}

18:18 dnolen_: ,(zipmap [:id :name] [112231 "foo"])

18:18 clojurebot: {:name "foo", :id 112231}

18:18 dnolen_: tyler__: ^

18:18 tyler__: dnolen_: thnx

18:19 thats awesome

18:20 super helpful for datomic queries

18:21 frozenlock: Wow that was fast... http://dev.clojure.org/jira/browse/CLJ-1182

18:22 tyler__: e.g. (for [e (q '[:find ?e ?age :where [?e :person/age ?age]] (db conn))] (zipmap [:id :age] e))

18:23 supersym: frozenlock: nice

18:25 patchwork: How do I exclude files from lein jar?

18:25 exclude resources that is

18:29 brehaut: bbloom: re:topological module sort, and types. i wonder if things like multimethods might confuse things; ie because you could get a partial set of methods for a given multi depending on import (ie, if p.a and p.b implement methods for p.b, but if you require p.a and not p.b it might result in different inference than if you require p.b and not p.a)

18:31 bbloom: brehaut: hmm interesting thought.... however, wouldn't it be the case that additional methods could only ever broaden the type, not ever narrow it?

18:31 eg if all seen methods return a number, but some other random method returns a string, then the type broadens from number to object

18:31 brehaut: bbloom: that does sound true

18:31 tyler__: is there anything in clojureland where you can do given input A and output B give me a function and arguments to transform A to B

18:32 bbloom: so then you'd correctly get a type error if you assumed you had a number... right?

18:32 brehaut: yeah, you're right, that could be problematic....

18:33 *shrug* types are over my head :-P

18:33 brehaut: bbloom: mine too :)

18:34 bbloom: brehaut: clojure is in this weird spot, since it gets a bunch of dynamic behavior from the host, but it's just not quite anything like you can get in SmallTalk or Factor or some other image based system

18:34 brehaut: so you have linear code execution during initialization, and meta programming is interleaved with normal execution

18:35 brehaut: compared to something like a haskell, that generally cant handle new/changed types etc at runtime, because it requires a full recompile and global knowledge

18:36 tyler__: so what you're saying is (> clojure haskell)

18:36 * tyler__ goes back to his corner

18:37 brehaut: tyler__: not at all. (not= clojure haskell)

18:37 tyler__: (and (not= clojure haskell) (> clojure haskell))

18:37 Raynes: Nice.

18:38 mattmoss: $findfn 3 4

18:38 lazybot: [clojure.core/unchecked-inc-int clojure.core/unchecked-inc clojure.core/inc clojure.core/inc']

18:38 brehaut: bbloom: i dont know as much about the under the hood of .net, but i get hte impression its a much more static system than the jvm. i wonder if that aids F# wrt open extension via objects

18:39 bbloom: not to mention the types for methods are always bounded by interface / superclass

18:39 bbloom: brehaut: what gives you the impression that .net is more static than the JVM? my understanding is that the opposite is true

18:39 brehaut: http://msdn.microsoft.com/en-us/library/dd233052.aspx

18:40 technomancy: bbloom: rich told me the CLR does a lot more of its optimization up-front vs during runtime

18:40 ticking: hrm are (non-xml) zippers actually used by anything ^^?

18:40 technomancy: part of why he gave up onit

18:41 bbloom: technomancy: that's a statement about the profiler-driven JIT

18:41 brehaut: bbloom: the way code is organised into assemblies rather than class files, each compiler being responsible for more of its own optimizations (rather than the runtime), the generics being preserved

18:41 technomancy: bbloom: well, the up-front optimizations were largely type-driven, he said

18:41 the more knowledge you can derive through static analysis, the more you can do up-front

18:42 bbloom: technomancy: yeah, but that doesn't mean that the runtime is "more static" it just means that it's optimized primarily by static information

18:42 brehaut: technomancy: for example, with the CLR you can replace running instances when you redefine a type, if that instance uses a binding proxy

18:42 technomancy: sure, but it's not like "more static" has a rigorous definition to begin with =)

18:42 bbloom: it's total black voodoo, but the debugger does that

18:43 i think the CLR is more flexible than the JVM, but optimized mostly for C# rather than for, say, Clojure

18:43 Java has less type info than C#, thanks to type eraser, so profiling-driven specialization is necessary

18:44 where as C# can specialize via type hints during compilation

18:44 technomancy: yeah, IIRC rich was mostly complaining about the performance of the JIT

18:44 bbloom: yup

18:44 the CLR's JIT is less sophisticated because C# is more sophisticated

18:44 and C# is more important for MSFT

18:44 technomancy: the curse of real generics

18:45 brehaut: also, a lot of .net is heavily organised around making desktop code fast

18:45 which favours doing your optimizations once, up front

18:45 technomancy: which sun/oracle has shown a fanatical disinterest in

18:46 bbloom: brehaut: yes. process startup time & "first frame" speed is critical

18:46 brehaut: see also: GAC

18:46 bbloom: i have nothing nice to say about the GAC.

18:46 brehaut: bbloom: im pretty sure thats a good indicator that you have worked as a .net dev at some point

18:47 bbloom: worse: i worked as a dev on .net ;-)

18:47 brehaut: haha

18:47 bbloom: visual studio integration for C# & xbox, more specifically

18:48 anyway, the CLR is overall quite good and improves upon the JVM in many areas, but it's also "good enough" for Microsoft's needs which are quite different from Clojure's needs

18:49 but one thing that the CLR does that is interesting is that it supports proper proxy objects and call site bindings in such a way that you can swap in code at runtime. but perf SUCKS for that

18:49 in theory the DLR was supposed to fix that

18:49 dunno much about the DLR other than what it promised, haven't worked with it for real

18:50 i left C# just before v4, which added the "dynamic" keyword

18:50 brehaut: bbloom: its entirely possible (probable?) that my perspective is colored by the culture of microsoft and the companies that use their tools.

18:52 bbloom: brehaut: any non-open-source-zealot engineer should have massive amounts of respect for Microsoft Research and Developer Division, but any non-microsoft-zealot-engineer should have massive amounts of distain for Microsoft's executive management

18:52 brehaut: bbloom: indeed.

18:52 bbloom: C# is a massive gateway drug for functional programming

18:53 brehaut: bbloom: actually, even an OS zealot should be able to look at haskell and F# and see that they are doing amazing stuff in the OSS area too

18:53 jtoy: can someone help me with reading a file: https://www.refheap.com/paste/12459 I get java.lang.ClassCastException: clojure.lang.Cons cannot be cast to java.lang.String im sure its something simple but im not sure how to fix it

18:53 bbloom: brehaut: shhhh don't tell anyone that MSR makes up the primary contributors to GHC

18:53 brehaut: bbloom: :)

18:54 bbloom: not to mention the money they pour into research around the world

18:54 amalloy: jtoy: you told it to parse a string, and you gave it a list of stinrgs

19:00 akhudek: the saddest thing about Microsoft is that their research divisions do all sorts of cool things that never seem to end up in products

19:00 jtoy: amalloy: i thoguht it was tht so i tried doing the parsing in the fitler before, but i got different errors, ill try it again now

19:01 kaoD: akhudek: you mena, like Kinect ?

19:01 *mean

19:01 a R&D department is bound to ditch 99% of their good ideas

19:01 cool != economically viable

19:01 akhudek: there are a few recent examples where they are finally bringing some things to market

19:02 brehaut: akhudek: like linq or Rx?

19:02 jtoy: amalloy: I just tried this: (filter #(= (cheshire.core/parse-string %) "m" ) (line-seq rdr)) and I get (java.io.IOException: Stream closed

19:02 amalloy: am I still doing it wrong?

19:03 akhudek: brehaut: also good examples. Things do seem better in the last 5 years or so.

19:08 brehaut: akhudek: part of it is, i think, that what may start out looking like good ideas end up dying on the vine due to difficulties that make them impractical (dryad and .net STM come to mind)

19:09 akhudek: i think the Haskell → F# → C# pipeline of refinement* helps them a lot (* refinement partly means 'mainstreaming')

19:10 akhudek: brehaut: there may be some of that, but I hear stories from academia about people who tried hard to get research stuff used in practice and there was just no communication between engineering and the research departmetns

19:10 brehaut: FWIW F# is at least the third project to get a ML family language running on .net

19:10 akhudek: maybe they are isolated incedents though

19:10 bytechunky: noob macro question: say I call a macro somewhere (deep) inside of a function. Can this macro manipulate the entire function? (it cant, right?)

19:10 akhudek: this was pre .NET days too

19:10 ubun22: anyone knows the issue: https://github.com/Kodowa/Light-Table-Playground/issues/376

19:11 akhudek: so it's entirely possible things have changed a lot since then

19:12 brehaut: akhudek: well, erik meijer is one of the main C# people these days, so i would say yes

19:13 amalloy: bytechunky: correct, it canot

19:14 ie, supposing that m is a macro, then in (foo (bar blah) (m a b c)), m's job is to replace (m a b c) with whatever it wants, but it can't change anything else

19:15 bytechunky: what if I want to manipulate (some of) my functions but dont want to put top-level-macros all over?

19:15 is there some way to write a compiler plugin?

19:15 jtoy: ?

19:16 amalloy: a macro *is* a compiler plugin

19:16 just wrap your entire namespace in one (my-crazy-language ...) macro, and do whatever manipulations you want there

19:16 (is an example of one reasonable approach you could take)

19:17 bytechunky: amalloy: like (my-crazy-language (ns foo ...) (defn bar ....) (defn baz ...)) ?

19:18 amalloy: well, you can't put stuff before ns

19:18 bytechunky: ah ook

19:18 amalloy: but after that, sure

19:19 bytechunky: well, thank you

19:39 cmeiklejohn: I think I'm just confused as I've been off clojure projects for a few months and trying to update deps in my project:

19:40 I've changed a lein-cljsbuild dep from 0.2.7 to 0.3.0 and it's not finding it -- hwoever I see the jar listed on clojars

19:40 Could not find artifact lein-cljsbuild:lein-cljsbuild:jar:0.3.0 in central (http://repo1.maven.org/maven2)

19:40 I must be doing something stupid

19:40 Thoughts?

19:42 technomancy: cmeiklejohn: is it checking clojars?

19:42 that message just says it can't find it in Central, which it shouldn't

19:42 cmeiklejohn: derpoh wait

19:42 yea

19:42 i guess the success and errors together confused me

19:42 Could not find artifact lein-cljsbuild:lein-cljsbuild:pom:0.3.0 in central (http://repo1.maven.org/maven2)

19:42 Retrieving lein-cljsbuild/lein-cljsbuild/0.3.0/lein-cljsbuild-0.3.0.pom (2k)

19:42 from https://clojars.org/repo/

19:42 Could not find artifact lein-cljsbuild:lein-cljsbuild:jar:0.3.0 in central (http://repo1.maven.org/maven2)

19:42 Retrieving lein-cljsbuild/lein-cljsbuild/0.3.0/lein-cljsbuild-0.3.0.jar (9k)

19:42 from https://clojars.org/repo/

19:43 Raynes: mraow

20:26 ambrosebs: arohner: core.typed has a two parameter version of Ref. First for what you can write, and second for what you can read. They should almost always be the same.

20:27 arohner: Actually, use ARef for now

20:27 arohner: ambrosebs: thanks. I figured that out later

20:27 but still ended up w/ some problems about polymorphic type, even after passing two args

20:27 ambrosebs: arohner: cool

20:27 arohner: sorry that code was on another branch that's difficult to repro at the moment

20:28 ambrosebs: ok

20:28 arohner: my code was (ref #{"foo" "bar"}), and the type I tried was (ARef (IPersistentSet String) (IPersistentSet String))

20:29 the checker was happy with that, but blew up at (dosync (set/union @ref1 @ref2))

20:29 ambrosebs: ah I've never tried to check a dosync :)

20:29 bttf: i just pulled a clj project ... in the project.clj file, theres a :cljsbuild target but lein-cljsbuild is not in the dependencies

20:29 is it just me or does that not make any sense?

20:30 mind you, i'm working with a clean machine with no plugins installed ..

20:31 arohner: ambrosebs: no annotation for a dosync wouldn't have slowed me down much. The problem was something about number of arguments on a polymorphic type, pointing at the ref

20:32 ambrosebs: arohner: ok, trying it out

20:32 technomancy: bttf: yeah, it should be in :plugins. Leiningen won't do anything with :cljsbuild if that plugin isn't present.

20:32 probably a misconfigured project

20:34 bttf: is it possible they have a personal clojure package in the clojure repos that contains all the plugins that would be needed

20:35 technomancy: bttf: they could have lein-cljsbuild declared in user-level plugins instead of in the project

20:35 (which is wrong, but it would still work for them)

20:35 ambrosebs: arohner: which version are you using?

20:35 arohner: 0.1.7

20:36 technomancy: http://p.hagelb.org/marty.gif

20:36 (apropos of nothing but seeing the string "bttf")

20:37 bttf: exactly my reaction

20:38 technomancy: these days I typically use the b^f notation for Back to the Future, but I don't know if that's allowed by freenode

20:39 http://btothef.tumblr.com/

20:40 ambrosebs: arohner: it's probably fixed in master. It's a bit more lenient with the polymorphic arguments error.

20:40 bttf: haha never heard that one

20:40 but i have seen that blog

20:40 arohner: ambrosebs: k, thanks. I'll bug you again if it isn't :-)

20:41 * arohner is eager to get an entire NS checked on production code

20:43 DaReaper5: Hi, I need to zip a bunch of xls files. Is there a good clojure lib for this or should i use java?

20:43 ambrosebs: arohner: works fine for me (ignoring set/union) after adding the following annotations https://www.refheap.com/paste/12470

20:45 arohner: an entire ns could be a stretch ;) can't we just be happy with a quarter?

20:46 arohner: but seriously, there are some outstanding issues. eg. core.typed cant' check doseq and for.

20:46 arohner: :-)

20:46 ambrosebs: arohner: so let me know what you come up against.

20:46 arohner: k

20:46 (filter even? [1 2 3 4]) was a problem earlier

20:47 DaReaper5: Hi, I need to zip a bunch of xls files. Is there a good clojure lib for this or should i use java?

20:47 ambrosebs: arohner: yea that's a weird error :/

20:49 brehaut: arohner: i've been annotating ring.utils for practise. the shortest namespace i have hit so far turned out to be the hardest to check :P

20:51 DaReaper5: would java.util.zip be the best way to create a zip file in clojure?

20:52 joegallo: DaReaper5: it's a perfectly fine way, yes

20:52 DaReaper5: joegallo thanks

20:54 tyler__: the source for source is `(println (or (source-fn '~n) (str "Source not found")))

20:54 where is source-fn defined?

20:55 brehaut: ,(find-doc "source-fn")

20:55 clojurebot: -------------------------\nclojure.repl/source-fn\n([x])\n Returns a string of the source code for the given symbol, if it can\n find it. This requires that the symbol resolve to a Var defined in\n a namespace for which the .clj is in the classpath. Returns nil if\n it can't find the source. For most REPL usage, 'source' is more\n convenient.\n\n Example: (source-fn 'filter)\n

20:55 brehaut: tyler__: ^ clojure.repl

20:55 joegallo: DaReaper5: alternatively, i think you can get a few features from http://commons.apache.org/proper/commons-compress//apidocs/index.html (look at ...archivers.zip.ZipFile), but it's a very very java.util.zip-like API, so you could defer making that decision until after you've gotten your first approach working and you see if you need the things it offers (you probably won't).

20:59 tyler__: brehaut: thnx

21:01 brehaut: theres a rotated ampersand character‽ (⅋) now i want to use it for destructuring that has the rest args come first

21:04 ambrosebs: arohner: just pushed a fix for (filter even? [1 2 3 4])

21:04 DaReaper5: joegallo thanks, but hopfully i wont need those advanced features :)

21:04 joegallo: agreed, and you're welcome

21:13 ambrosebs: ljos: arohner: on master core.typed we have (cf {}) ;=> [(CompleteHMap {}) {:then tt, :else ff}]

21:13 ljos: arohner: it allows us to have sound subtyping with IPersistentMap

21:14 (CompleteHMap ..) has the subtyping you'd expect, but (PartialHMap ..) is subtype to (IPM Any Any)

21:14 ljos: arohner: atm there's no type syntax to introduce these.

21:15 arohner: ambrosebs: cool! I'll look into that

21:15 ambrosebs: also brehaut ^^

21:19 tyler__: oh woah i didn't realize namespaces were part of clojure.core for keywords

21:20 i thought that was just a datomic convention

21:21 frozenlock: Making the switch from noir to compojure in one of my projects.... is there something similar to the old noi.option/dev-mode? ?

21:39 technomancy: frozenlock: usually you'd check for a config value using carica or environ

21:58 frozenlock: technomancy: this? https://github.com/weavejester/environ

22:00 jcromartie: what is the difference between (:require [foo :refer :all]) and (:use foo)

22:00 cgag: nothing i'm pretty sure, i think using :use is frowned upon/depracated

22:01 jcromartie: it seems frowned upon, but I don't see anything about it being deprecated

22:01 but yeah, makes sense to keep it simple

22:02 frozenlock: I don't really like :refer :all either. Makes thing a little harder to find.

22:03 metajack: Does Enlive have something liek clone-for which replaces a group of elements with clones of the first one? All the examples I can find only show teh templates having single placeholders.

22:04 brehaut: metajack: i'd speculate that that should just work if you give a range selector

22:04 metajack: a range selector being {from to}

22:05 metajack: I was just looking that up.

22:05 jameshasselman: Quick question, I'm working through the tutorials in labrepl and in this code example I can't understand how this loop works http://pastebin.com/pbH6d02Z after calling recur, how does it know that 'x' and 'more' are arguments and 'min' and the other 'more' are local bindings?

22:14 metajack: brehaut: clone-for seems to choke if it gets more than one node as input:

22:14 user=> (at src {[[:li first-child]] [[:li last-child]]} (clone-for [x [1 2 3]] (content (str x))))

22:14 IllegalArgumentException Key must be integer clojure.lang.APersistentVector.assoc (APersistentVector.java:316)

22:14 brehaut: huh. well there you go then

22:14 that seems like a bug to me

22:14 metajack: i suppose i could have a clone-for on first child and then nil on the last n

22:15 it seems to me that this is what you want from clone-for by default though. i want to replace all the children with a clone of the first one in most cases

22:15 brehaut: metajack: i'd just use a replace with a snippet mapped over the seq

22:15 metajack: my mockups generally have more than one row of dummy data ;)

22:16 brehaut: likewise. i also prefer complex template bits to be packaged out as their own functions rather htan having a big honkin clone-for inline

22:16 but i still think its a bug

22:16 metajack: Kind of sucks to make a snippet for every place I need a list though. But better than these range contortions.

22:17 I've run into this lots of times in my own stuff, each time I work around it differently I think. Now that I'm writing a tutorial, I figured I best "Do It Right"

22:17 brehaut: aha

22:17 hit up cgrand on the enlive mailing list?

22:17 metajack: I'll do that.

22:27 jordan|ssh: jameshasselman: i'm totally new to clojure, but it's my impression that more is essentially re-bound in the loop bindings

22:29 technomancy: jcromartie: the intent is to move away from use in order to streamline the ns macro

22:29 jcromartie: exactly

22:29 makes a lot of sense

22:32 jameshasselman: jordan|ssh: Right, I get that part but how about min and x? Why does recur bind to x and not min? The language must have some way of knowing you intended to bind the first argument to x and then x to min.

22:36 akhudek: jameshasselman: initially, the value of x is bound to min

22:37 when recur calls, the first arguement is bound to min for the next iteration, and the second argument is bound to more

22:37 jameshasselman: Oh, okay! Thanks, that makes a lot of sense!

22:43 Ah, I get why too. Upon first entering the loop there has to be a way to assign an initial value to min and more and that's what I'm seeing. On the subsequent iterations those initial values are rebound to the values passed as arguments to recur.

22:46 akhudek: right!

23:12 tenpaiyomi: Don't suppose anybody would have any general idea why lein commands are so so slow, or how I can go about diagnosing it, would they? Doing a time leon help gives me this "lein help 50.16s user 2.13s system 203% cpu 25.736 total"

23:12 technomancy: tenpaiyomi: sure: https://github.com/technomancy/leiningen/wiki/Faster

23:13 tenpaiyomi: help is the pathological case though; it has to load every single task across all plugins.

23:13 tenpaiyomi: technomancy: Thanks, looking at it now

23:14 technomancy: Yeah, I know that much. I noticed some other people having issues too, but their times were in the range of 15s for the user. Mine is just crawling.

23:14 technomancy: yeah that's nuts

23:49 TheBusby: technomancy: any trick with leiningen for travis-ci to include jsr166y for Java 1.6 but not 1.7?

23:57 arrdem: does anyone have a CL (loop) implemetation for clojure?

Logging service provided by n01se.net