#clojure logs

2013-03-12

00:01ambrosebstechnomancy: There's a couple of reasons why I'm sceptical about inference for Clojure code.
00:02ambrosebsThere are usually some subtle invariants which are best expressed by a function intersection. I don't know if we could retrieve this information.
00:02technomancyI'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.
00:03ambrosebseg. We might know that (Fn [Integer -> Symbol] [Number -> Keyword]), but we will probably infer something more like (Fn [(U Integer Number) -> (U Symbol Keyword)])
00:03brehauttechnomancy: F# uses extremely strict ordering of modules and module contents to limit the scope of inference
00:03brehauttechnomancy: i dont know how much of that it acquired from ocaml
00:04brehauttechnomancy: explicit ordering also ensures that inference is deterministic
00:04technomancybrehaut: hm; so probably only possible if you design for that from the ground up?
00:04brehauttechnomancy: it may be the case. they certainly sell it as a feature of their design
00:06ambrosebsThere'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.
00:07ambrosebsI don't know if it's possible.
00:07technomancyI 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.
00:08ambrosebstechnomancy: Ok, more like the Erlang Dialyzer?
00:08technomancyI'm not familiar with that
00:09technomancybut 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
00:09technomancyusually 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
00:10ambrosebsDialyzer is less strict about type errors, but IIRC you don't need as many annotations. More of a linter than a type system (kinda).
00:11ambrosebstechnomancy: certainly, that's probably the best use case.
00:13technomancyI guess the main thing I'm interested in is catching NPEs
00:13technomancyand I understand that's impossible to do in the presence of un-annotated Java interop
00:13technomancybut it might help encourage separating out the Java bits into their own defns
00:14ambrosebsYes, you need to help core.typed if you know some extra information about Java methods.
00:14ambrosebsBy default, method paramters are non-nilable, return types are nilable.
00:14ambrosebsAnd you can adjust as needed.
00:14technomancycool
00:16ambrosebstechnomancy: 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.
00:18jjjddd0Guys, getting this error in REPL startup
00:18jjjddd0FileNotFoundException Could not locate clabango/parser__init.class or clabango/parser.clj on classpath: clojure.lang.RT.load (RT.java:443)
00:18jjjddd0any ideas ?
00:21cliftonanyone 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
00:21cliftonwhich feels slower than a similar ruby or nodejs app
00:22arohnerambrosebs: are there any plans to include any (sorry, I don't know the type lingo) "imaginary" types?
00:22cliftonits a pretty contrived example, but it doesn't feel *too* far away from reality, aside from making a call out to I/O
00:22ambrosebsarohner: please elaborate :)
00:22arohneri.e. types that are user created, and have nothing to do with the java class
00:23arohnerso for example, I have a fn that returns a SHA1
00:23arohner"SHA1" is actually a j.l.String
00:23arohnerbut poking around w/ typed, I couldn't figure out how to tell typed that it's (U String SHA1)
00:24arohnerbecause then I want other fns that only take SHA1s and not strings
00:24ambrosebsarohner: I definitely want it (and it's probably the most requested feature). I'm not sure the best way to approach it though.
00:24ambrosebsIt needs more thought.
00:25bbloomtechnomancy: personally, i want a way to have type annotations added for me
00:25technomancybbloom: you mean so they remain as part of the source?
00:25arohnerambrosebs: keep up the good work. I can't wait until I can actually check "real" code
00:25bbloomtechnomancy: i don't mean just inference, i mean going all the way to inserting them into the code
00:26bbloomtechnomancy: yeah, so then when i know i got a piece of code right, i can just `git add .; lein type-me; git add -p .`
00:26technomancybbloom: that could be nice for the public interface. wouldn't want it everywhere though.
00:26bbloomsorta 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
00:26bbloomtechnomancy: yeah, agreed
00:27devnclabango, lol
00:27bbloomambrosebs: brehaut: do F#'s ordering requirements mirror those of clojure?
00:27devnhow did i not hear of this?
00:27devnthis is really cool
00:28TheBusbyany consensus on which is better, accessing private vars or copy/pasting code?
00:30technomancyin other news I have been having tons of fun hacking on https://syme.herokuapp.com/faq
00:30bbloomTheBusby: depends on the nature of the copy paste
00:31bbloomtechnomancy: github really needs to improve the granularity of their oauth system
00:31technomancybbloom: in this case I don't care; I only use GitHub to avoid having to write my own login system
00:31technomancyall I care about is getting a username back
00:31bbloomtechnomancy: yes, but i care :-P
00:31technomancyI trust allowing Syme to read your public profile data isn't too nerve-wracking? =)
00:32devntechnomancy: really cool
00:32technomancybbloom: but yeah, allowing access to a specific private repo would be nice
00:32bbloomtechnomancy: oh, i guess they have read and write tokens & you only need read... hm ok
00:32technomancydevn: thanks!
00:32technomancydevn: clocked in at just a shade under 500 LOC
00:32technomancywell, I guess a bit over if you count the JS and the shell script
00:32devntechnomancy: one of the first things i think i remember about your stuff is the work on gobby was it?
00:33TheBusbybbloom: the 1.5's reducer's fjpool stuff
00:33devnthe collaborative thing?
00:33technomancydevn: yeah, that was possibly my first actual OSS code?
00:33devnwas it really?
00:33devncrazy
00:33ohpauleeztechnomancy: WHOA?!?!?! I didn't know you were behind Gobby too cool
00:33TheBusbybbloom: 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...
00:34technomancyohpauleez: well, not Gobby itself, but I wrote an elisp client for it.
00:34ohpauleezahhh, badass
00:34devnwhat was it called?
00:34technomancyby reverse engineering the protocol from a packet sniffer; that was a trip =)
00:34technomancydevn: ebby
00:34devnah yeah
00:35bbloomTheBusby: 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
00:35devnAnyway, Syme looks great. I have wanted to do a pair.io thingy for awhile, but never got around to it.
00:35bbloomespecially since if you can assume JDK7+ and only need half of it
00:35TheBusbycan't assume that unfortunately :(
00:35devnI used pair.io and wished Zak would have kept it going
00:35technomancydevn: I realized it's drastically simpler if you make the user bring their own AWS creds
00:36technomancyno billing headaches to deal with =)
00:36devntechnomancy: brilliant
00:36technomancyevery time I spun up a pair.io instance I felt vaguely guilty about increasing Zack's amazon bill =)
00:36devnsame
00:36devnthey were not small instances either
00:36devnerr "micro"
00:36technomancyalso: curl https://github.com/devn.keys
00:36technomancy^ simplifies things a ton =)
00:37technomancyno need to get the collaborators to authorize Syme
00:37TheBusbybbloom: ahh, I see what you mean now
00:38devntechnomancy: ha, i knew about that
00:38technomancydevn: 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
00:38devntechnomancy: can i use it with myself if i have two different github user accounts, but not two different aws accounts?
00:39bbloomtechnomancy: your swarm coding monopoly is under attack! http://www.meetup.com/Mob-Programming-Seattle/events/105744122/
00:39technomancydevn: sure; the AWS account is only used for launching the instance. sharing it is not a problem.
00:39technomancyI want to document how to do it with IAM users though
00:39technomancybbloom: whoa nice
00:40devntechnomancy: im not familiar with AIM
00:40devnerr IAM
00:40technomancywe actually used Syme to hack on Syme at the last seajure meetings
00:40technomancydevn: basically you create sub-users with restricted permissions
00:40devnahhhh
00:41devnthat would be interesting for business that want to have their projects more "separate"
00:41devnbusinesses*
00:41technomancydevn: or if you don't trust "some guy with a herokuapp" with credentials that have access to your secret sauce
00:41devnyeah
00:43devntechnomancy: im going to try this out and report back
00:44devnwe've tried "pairing" a room away from one another a couple of times
00:44clifton-anyone know how to use jvisualvm with lein-ring -- its not letting me connect
00:44technomancydevn: cool; let me know how it goes
00:44technomancydevn: also might be interested in adding a mumble server to the default AMI so you can get hassle-free voip.
00:45devntechnomancy: one thing i would do is bring the faq to the front page
00:46devntechnomancy: it would be cool to try and just randomly invite another github user
00:46technomancyheh
00:46devnand having people see that it's not a scam would be cool
00:46technomancyyeah 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
00:46brehautbbloom: 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 …
00:47technomancyI guess pair.io's idea of putting a video on the splash page is pretty good
00:47devntechnomancy: yeah i like it simple. i think you could make the "what's this" link more front-and-center
00:47devnmaybe it's a subtle drawer that expands down and shows the text
00:47bbloombrehaut: 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
00:48technomancysubtle... that's beyond my skills =)
00:48devntechnomancy: there isn't much that's subtle about this site: http://www.snowbird.com/
00:48bbloombrehaut: recursive types & functions already need to be explicit via 'declare
00:48devnbut if you hover over the weather you'll see sort of the effect i was imagining
00:48technomancydevn: my secret when it comes to design is to ask brehaut what to do
00:49technomancythat is pretty slick though
00:49devnyou should see their mobile app
00:49devnerr mobile version of the site
00:49brehautbbloom: i am not a compiler guy ;) the words you are saying make sense, but i cant honestly give you any more feedback on it
00:49devnit's very, very impressive
00:50bbloomambrosebs: ?
00:50bbloomsince brehaut is deferring to the experts :-)
00:51brehautwait, this is IRC isnt it? i should just be claiming things and mansplaining
00:51brehautmy bad guys
00:51technomancyaw geez.... past self, what the heck https://github.com/technomancy/technomancy.us/blob/master/public/code/ebby.el#L117
00:51bbloomlol mansplain, that's a good word i've never seen before
00:51devnbrehaut: go nuts
00:52devntechnomancy: did you write that comment at the same time you wrote the macros?
00:52technomancy"my first two macros" you mean? I think so.
00:52brehautdevn: im still not going to because it'd be worse than line noise
00:52technomancyOTOH 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
00:52technomancy(the other macro is to work around broken string equality in elisp)
00:52devnbecause 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
00:53bbloomtechnomancy: argh! boolean names in the negative are a major pet peeve of mine too!
00:53sshackIs there any reason why leon trampoline repl would fail where leon repl wouldn't? (stack trace: http://pastebin.com/rrmaXVVM)
00:53ambrosebsbbloom: It doesn't seem to make much sense to compare the two, F# is much stricter with order because of its type system.
00:53bbloomNOT_DONT_DISABLE_ENABLED_ENABLER_OF_THINGS_THAT_ARE_DISABLED
00:53devntechnomancy: this week is equality week. i re-read the baker egal paper again after a discussion about equality in ruby
00:53technomancyyay!
00:53ambrosebsBut, I dont' really know :)
00:54ambrosebsanyway, I'm off. cya
01:01devnambrose just dropped the mic
01:02technomancysshack: lein trampoline repl uses a direct connection whereas regular repl uses nrepl. so theoretically it should be simpler.
01:03sshacktechnomancy: Interesting.
01:03sshackSo what are the moving parts that could break?
01:04clifton-any nrepl hooks or plugins?
01:04technomancysshack: 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.
01:04technomancyyou can open up leiningen's repl.clj and just grep for "trampoline" to see all the differences
01:05clj_idiotso 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.
01:05technomancymost of the time trampoline is pretty transparent, but the repl task is one place where it's more complicated
01:05sshackLet me try with a fresh project
01:05technomancyclj_idiot: IIRC that's really, really hard
01:05clj_idiottechnomancy: are you serious?
01:05technomancyclj_idiot: http://www.hypirion.com/musings/how-to-cancel-a-blocking-read
01:05clj_idiottechnomancy: this seems like a very simple/common operation
01:05clj_idiottechnomancy: hm, you're not kidding
01:05technomancyit's hard in the context of Leiningen at least
01:06technomancyyour requirements might be simpler
01:06clj_idiottechnomancy: 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
01:07sshackRight. a Fresh project works fine.
01:07technomancyclj_idiot: hyPiRion is an active Leiningen contributor, and that problem is one of the few remaining issues blocking Leiningen 2.1.0
01:07technomancyso it's fresh in my browser history
01:08technomancyeep... I guess not so few issues
01:09sshackYup. It's one of my project dependencies.
01:09technomancy12 remaining issues... guess I better stop playing around with Syme for a while =)
01:10brehautclj_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
01:12clj_idiotdumb question: why is my prroblem not solved via; http://stackoverflow.com/questions/5200187/convert-inputstream-to-bufferedreader
01:12clj_idiotseems like I can just wrap the inputstream
01:13sshackIncanter seems to be the problem.
01:13sshackWhich is a shame, I was hoping to use it. But it seems to have died anyways.
01:14technomancysshack: you can use the lein-pedantic plugin to isolate a more specific dependency conflict
01:14technomancy(it's probably not incanter, but one of incanter's deps)
01:14clj_idiotah, I just figured out why ... java won't let me cast it
01:14sshacktechnomancy: Thanks for the tip. I'll give that a try.
01:14sshackBut it's not too important. I wasn't actually using any of in canter yet.
01:15clj_idiotokay, n/m, I got a bufferedreader now
01:15clj_idiotis ther ea way in clojure, to do a non-blokcing read of everything from a buffredreader?
01:18sshacktechnomancy: What's the version string for leon-pedantic?
01:18sshacknm found it
01:18technomancywhoa nrepl.el merge frenzy
01:18technomancynice
01:23sshackOh boy. Dependancy hell.
01:24technomancyis it jackson? I bet it's jackson.
01:25sshacktechnomancy: No, it wasn't. IT was some leon plugins.
01:26sshackHere's a question. Is there a way to leave a port open for a REPL in a ring app?
01:43sshackRight so leon trampoline repl *randomly* crashes now.
01:43sshackAs in sometimes does, sometimes doesn't.
01:44sshackMay you live in interesting times.
03:21rmrfchiki remember i read why letter "lambda" is used for functions. can't google it now.
03:25p_lfrom lambda notation?
03:26rmrfchikp_l: yes. and I just googled it. (when you report your problem to anyone, the solution just popped up immediatelly)
03:27rmrfchiklambda is transformed ^
03:49p_lHas 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)?
04:20hyPiRionah, that clj_idiot guy left. Well, his requirements were far simpler than Leiningen's.
05:04augustlwhat do most people use for XML parsing?
05:05pimeysdo you need it to be fast?
05:05augustlnot really :)
05:05augustlcurrently using clojure.xml, can't figure out how to manually specify the encoding.. Also, xpath would be nice
05:06pimeysok, otherwise sax parsing would be nice
05:10ebaxtWhat's the difference between clojure.xml and data.xml?
05:10augustlanyone know how to specify encoding with clojure.xml?
05:10ejacksonaugustl: I heard laser was about to, or did already support xml. I've been using enlive.
05:12augustlseems clojure.data.xml also doesn't support manually specifying the encoding
05:18ebaxtaugustl: data.xml parsing function takes a Reader or InputStream, maybe you can set the encoding on it: new InputStreamReader(new FileInputStream(filePath), encoding)
05:21ro_stif 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?
05:21ro_sti ask because i have a stacktrace which refers to both the name of the source file AND the jar
05:21ro_stand i'm not sure where the code is actually coming from:
05:22ro_stat app.server.resource.resources$resource.invoke(resources.clj:21) ~[server-0.0.1-SNAPSHOT.jar:na]
05:22ro_stanyone know?
05:22augustlebaxt: 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 :)
05:23ebaxtaugustl: ah :)
05:24augustlso I need to tell the parser to ignore the encoding specified in <?xml>
05:24augustlseems clojure.data.xml works though, it probably doesn't guess encoding based on the attr..
05:26ucbro_st: can you remove the jar installed with lein install?
05:31ebaxtaugustl: I use clojure.data.xml with clojure.data.zip.xml. Took me some time to understand zippers, but well worth it :)
05:32augustlebaxt: got a favorite getting started tutorial? ;)
05:33ebaxtaugustl: long time ago but I think I read something by Brian Marick, and this video: http://blip.tv/clojure/luke-vanderhart-clojure-zippers-4521622
05:34ebaxtaugustl: If you're not doing any transformations I suppose understanding xml-> and xml1-> and the how that affects the three is enough
05:44thalassios_xelonhello room :))
05:45thalassios_xelonis there a way to trace a exception?
05:46thalassios_xelonexcept the default,and the (pst)
05:46thalassios_xelonto see where is the error in my clojure code...
05:47thalassios_xelonsometimes it show me the error,sometimes i find it with (pst) sometimes i cant find it..........
05:50augustlebaxt: 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
05:50augustlI could wrap it in (first), but what if it returns nil? etc..
05:52ebaxtaugustl: (xml1-> loc :foo :bar text) should give you nil or a string (you got a seq because you used xml->
05:52augustlah
06:50jcrossley3p_l: i don't know of anyone who's attempted to mix GAE with Immutant
06:59p_ljcrossley3: I was thinking mainly of using immutant as "container" for running a GAE clojure app in JBoss.
06:59p_lCause so far my experience with setting up a sensible nREPL environment was... bad
07:00jcrossley3p_l: i'm curious what about GAE specifically appeals to you?
07:00p_ljcrossley3: I was thinking of using it for deployment of few things where I can't be arsed to manage them
07:01p_land Heroku, while fine, might not fit without paid account
07:01jcrossley3p_l: looked at OpenShift?
07:04p_ljcrossley3: the free plan would work... if I dropped Clojure :>
07:04p_l(frankly speaking, it's more that because of GAE I am looking at Clojure, not the other way around)
07:04jcrossley3p_l: why drop clojure? you can run anything on OS.
07:05p_ljcrossley3: the resource constraints on small gears in the free plan
07:06jcrossley3p_l: which limits concern you?
07:06p_lmemory, mainly
07:06p_lalso... OpenShift so far is running on EC2 US-East
07:06p_lthat datacenter seems to be cursed :D
07:07jcrossley3p_l: fwiw, i've deployed non-trivial immutant apps to openshift fine.
07:08p_ljcrossley3: 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.
07:09jcrossley3p_l: with immutant?
07:09p_ljcrossley3: no, just plain clojure with nrepl and lein2
07:09jcrossley3p_l: have you read this? http://bit.ly/poorsmatic
07:09p_limmutant made me interested again because it might run it... more compact
07:12p_lhmmm... looks interesting
07:12p_lstill, if I had "custom stack" available, I wouldn't be using clojure (probably)
07:15cemerickp_l: what was this "normal" setup you tried?
07:16p_lcemerick: lein2 + nrepl and I think that one middleware that handled debugging
07:16cemerickp_l: ritz?
07:16p_lI was trying to get to the level of comfort I had on my existing stack, but with Java support
07:16p_lcemerick: think so
07:16p_lthat was.... hmm... november/december 2012
07:17cemerickright; 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
07:17cemerickIf you just want a REPL, you can `lein trampoline repl`, and get one process
07:18p_lcemerick: and I was using Emacs (eclipse or CLI repl... it's like going to stone age or asking spanish inquisition to incarcerate me)
07:19cemerickp_l: so, trampoline will get you down to 2 processes. But, why do you care about process count?
07:20cemerickActually, I'd be shocked if nREPL ran on GAE at all.
07:20p_lcemerick: nREPL is for developement side (and would work on the SDK container, afaik)
07:22p_lif I were to go with OpenShift... hmm... I'd probably just run SBCL on it :)
07:23cemerickp_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.
07:23p_lcemerick: EC2 & Linode are out due to price (and it's for a non-commercial proof of concept project)
07:24p_lI am no longer eligible for the free plan on EC2 :)
07:24cemerickp_l: next thing you know, you'll be threatening to use ABCL ;-P
07:24michaelr525p_l: heroku maybe?
07:27cemerickp_l: you'll get what you pay for, most likely
07:28michaelr525i'm paying for a Hetzner dedicated server, and it's cheap if you compare it to Amazon
07:28michaelr525costs me 40 euros a month
07:30cemerickis AWS supposed to be a discount provider? Odd comparison if so.
07:31michaelr525Hetzner is a discount provier?
07:31michaelr525But I agree that it's a bad comparison
07:32cemerickI've no idea. The only context I see them mentioned in is around cost though.
07:32mpenetifesdjeen: hey
07:32michaelr525cemerick: i'm satisfied with my dedicated server :)
07:33cemerickmichaelr525: noted :-)
07:33michaelr525basically 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.
07:34michaelr525It's a case when you don't really need a cloud
07:42p_lcemerick: ABCL is a bit unwieldy, requires Java, and its interop (or at least the documented stuff) is more annoying than clojure's ;)
07:42p_lCCL and SBCL run fine ;P
07:43cemerickexcept for that whole CL thing.
07:43p_lcemerick: which I prefer over Clojure :>
07:43cemerickas you like :-)
07:43p_l(but that's the realm of personal preferences)
07:59pwnedwhat's the difference between clojurescript and clojure and why do they both exist ?
08:02pwnedI mean what's the point? why not have a clojure compiler emit js instead?
08:04algernonpwned: even if the clojure compiler would emit js, that wouldn't help in cases where you're using java libraries from clojure.
08:04algernonthe 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.
08:05pwnedchallenge accepted.
08:06algernonhttps://github.com/clojure/clojurescript/wiki is also a good read (esp. the Rationale and Differences from Clojure)
08:07pwnedI wasn't satisfied with the way they put forth V8 and say "woohoo it runs on a fast vm!"
08:08pwnedI think clojure could be reused to target v8
08:08pwnedall the work of parsing and lexing done again
08:09Ember-pwned: v8 and javascript are NOT multithreaded (web workers != real threads in the sense)
08:09Ember-that's one huuuuge thing missing from clojurescript (and from javascript) compared to JVM
08:10Ember-and like algernon said, it's really a *lot* more complicated than one might think
08:11Pupnik-doesnt that defeat a large part of the purpose of clojure?
08:11Pupnik-(not having access to multithreading)
08:11Ember-Pupnik-: indeed
08:11Ember-that's why I brought that up as the first thing
08:12Ember-there are so many other problems too that I don't even want to go there - not when I have work to do
08:12Ember-but to keep it short: it's a *bad* idea to think that one could just dump clojure and go completely the clojurescript way
08:12Ember-those can and should co-exist
08:12Ember-but they are in no way anything which would rule the other
08:13Ember-now, back to work
08:13Ember-:)
08:13pwnedI meant to say that clojurescript could have been a branch of closure with compatible syntax that simply targets a different vm
08:14pwnedinstead it is a whole new project with much of the work re-done
08:15algernonit's much more complicated than that :)
08:15pwnedalright alright! :-)
08:15Ember-I'm guessing "branch of closure" should read "branch of clojure"?
08:16Ember-since google closure has absolutely nothing to do with clojure
08:16pwnedEmber-: you're right I misspelled
08:16pwneddealing with too many closures right now
08:17Ember-but anyway, both need to be done pretty much from ground up at least on the compiler and core library side of things
08:17Ember-due to the extremely different platforms
08:17Ember-jvm == static typed bytecode virtual machine, v8/javascript == dynamically typed interpreted virtual machine
08:18Ember-jvm has threads, v8 doesn't
08:18Chousukethe clojure compiler is written in java so it made sense to rewrite the compiler for clojurescript.
08:18Ember-indeed
08:18Chousukelater on they may be unified but it's obviously not high priority work :P
08:19Ember-clojure is first class citizen project, clojurescript comes second for now
08:19Ember-may change
08:19Ember-wouldn't bet for it though :)
08:19Chousukenah, clojurescript is as much first class as clojure is.
08:19Chousukeit's just a separate project
08:20Ember-but damn it, I was supposed to be working!
08:20Ember-:P
08:20Ember-->
08:40ebaxtcemerick: Any thoughts on how you would add acl support to friend?
08:43cemerickebaxt: 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).
08:46ebaxtcemerick: OK, so what did you mean in the doc by "maybe something compelling can fall out of existing treatment of roles?"
08:46ebaxtcemerick: under fine-grained authorization that is :)
08:48cemerickebaxt: I dunno, waiting for something compelling to present itself. :-)
08:48ebaxtcemerick: Gotcha :) This what you referred to btw? https://github.com/cemerick/friend/commit/b526dd47c1d51f8fb57ee7572c51fc5a5ba35063
08:49cemerickhttps://github.com/cemerick/friend/commit/2707c7da2a350c4851dc7bbabe6724f3a48b1a89
08:49ebaxtcemerick: thx
08:50cemerickebaxt: 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.
08:54mpfundsteinhoi clojure guys. is there a possibility to iterate over a list of key val parts? '(key1 val1 key2 val2 key3 val3) -> [k v]
08:56ebaxtcemerick: 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 :)
08:57xeqi&(partition-all 2 '(key1 val1 key2 val2 key3 val3))
08:57lazybot⇒ ((key1 val1) (key2 val2) (key3 val3))
08:58xeqi&(for [[k v] (partition-all 2 '(key1 val1 key2 val2 key3 val3))] v)
08:58lazybot⇒ (val1 val2 val3)
09:00cemerickebaxt: 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".
09:01ro_stis there a ring middleware for measuring render time?
09:01jcromartiero_st: I think I've written it a few times :P
09:01mpfundsteinxeqi: thanks :-)
09:02ro_stdoes yourst put the time into http body as a comment?
09:02jcromartieno, as a header
09:02jcromartieyou don't want to do that (as a comment)
09:03jcromartiebecause your response will always contain headers, but it might not always be HTML
09:05jcromartiero_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")))))
09:06clintnewsomn00b 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
09:06clintnewsomhttps://gist.github.com/newsomc/5142729
09:06jcromartiero_st: but I think it's really better to just measure the real-world performance with ab or just in Chrome or whatever
09:06jcromartiero_st ab = apachebench
09:06jcromartieclintnewsom: just use one function to swap!
09:07jcromartieclintnewsom: and update-in
09:08jcromartieclintnewsom: better yet, have an initial ghost state you can just use instead of updating all these things
09:08clintnewsomok
09:09clintnewsommake sense
09:10clintnewsomthere is still a part of me that wants to understand how to do something like this :)
09:10clintnewsomeven though its probably an antipattern!
09:14ro_stthans jcromartie!
09:16jcromartieclintnewsom: this is my take on it https://gist.github.com/jcromartie/5142741
09:16ro_stjcromartie: i actually want to do similar to what github did with their staffmode bar https://github.com/blog/1252-how-we-keep-github-fast
09:17ro_stthat little progress bar they have, showing the pre-render/render/network split
09:17jcromartieclintnewsom: you are really looking for how to update a map structure
09:17jcromartieclintnewsom: which is update-in
09:17ro_stfor now, though, i'll be happy with a render time
09:18clintnewsomjcromartie: woah, awesome
09:18clintnewsomjcromartie: i will study this
09:19antares_clintnewsom: see http://clojure-doc.org/articles/language/concurrency_and_parallelism.html
09:19antares_clintnewsom: it explains how reference types work and how to work with atoms specifically
09:20clintnewsomantares_: thank you
09:21jcromartie,(update-in [{:pos {:x 0 :y 0}}] [0 :pos :x] inc)
09:21esmoregarding 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?
09:21clojurebot[{:pos {:y 0, :x 1}}]
09:21jcromartieclintnewsom: but generally, you don't want to iterate over a range if you can just map over the sequence itself
09:21esmois it possible to provide jsdoc annotations using metadata, for example?
09:21clintnewsomantares_: i'm actually doing this in clojurescript...
09:22clintnewsomjcromartie: got it
09:22jcromartiero_st: you could definitely inject the bar into the top of the page if the response was HTML
09:22clintnewsomjcromartie: i could tell the way I am approaching this is not very functional
09:23jcromartieclintnewsom: actually, the better way to do it would be to send it as JSON
09:23antares_clintnewsom: as far as I know ref types (including atoms) in clojurescript work the same way
09:23jcromartieso, like, at the end of the page <script>myPageStats = {…}</script>
09:24clintnewsomantares_: though i believe you only get atoms
09:25jcromartiero_st: or you could just keep performance stats in some cache on the server and get them async with JavaScript
09:25ro_styea
09:25jcromartiebut now I'm overthinking it :)
09:27jcromartiero_st: so yeah, just stick the stats in a <script> tag at the end
09:27ro_stjcromartie: your ring-util alias there, what ns is that?
09:28jcromartiehttp://ring-clojure.github.com/ring/ring.util.response.html#var-header
09:28jcromartiering.util.response
09:28ro_stthanks
09:31danierouxro_st: An alternative approach: http://yahoo.github.com/boomerang/doc
09:32ro_stnice one!
09:34jtoy_how do you guys typically tell if you are in dev or prod mode from your clojure apps?
09:36hyPiRionjtoy_: usually I uberjar/uberwar it and run it standalone in prod mode, otherwise I do lein run or lein ring server etc.
09:36hyPiRionthe lein commands usually tend to go in dev mode unless you explicitly set the profiles in the command line
09:37jtoy_hyPiRion: right, but what do you use to set dev mode? a os var like ENV ?
09:39jcromartiejtoy_: you mean how does your clojure code know if it's dev mode
09:39jtoy_jcromartie: yeah
09:50hyPiRionjtoy_: lein runs in dev mode by default, you can bypass it by doing lein with-profile -dev ...
09:51hyPiRionfor standalones and libraries, the dev profile isn't included.
09:52ravsterhello all
09:53ambrosebshi
09:55jimdueyambrosebs: hey. starting to dig into core.typed. Looking forward to learning more about what you did.
09:56ambrosebsjimduey: sweet!
09:56jimdueyand did you see this from Oleg? http://okmij.org/ftp/ML/generalization.html
09:57ambrosebsjimduey: I haven't had the courage to dig in ;)
09:57ambrosebscheers for the reminder
09:57jimdueyremember, you eat an elephant one bite at a time. Very small bites.
09:58ambrosebssheesh :)
09:59jtoy_is it worth it to upgrade from lein1 to lein2
10:00nDuffjtoy_: Absolutely.
10:01ro_stjtoy_: without hesitation.
10:02ejacksonjimdue: how was Aruba ?
10:02ejacksonjimduey: how was Aruba ?
10:03jtoy_is it supposed to be a dropin replacement? my app doesnt work with lein2
10:04clgvjtoy_: you have to make some minor modifications provided you have a standard lein 1 project.clj - see the migration guide
10:09jimdueyejackson: awesome. got to meet some great people. good presentations. lot's of fun.
10:30gfredericksso lein's :repl-options {:init-ns user} can't create a namespace for me?
10:31owengalenjonescould 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:33gfredericksowengalenjones: the equivalent for to your map would remove the octothorp
10:33gfredericks(for [i (range 5)] (task i))
10:33gfredericksthe body of the for is implicitely the map function you're using, you don't have to use an explicit function literal
10:34gfredericksin this case tasks becomes a list of functions that call task instead of the return values of task
10:34gfrederickson another note (map #(task %) (range 5)) can be reduced to (map task (range 5))
10:37owengalenjonesgfredericks: thank you, that is a great explanataion
10:39owengalenjonesawesome: http://d.pr/i/rb2g
10:54devngood morning all
10:56jcrossley3devn: morning!
11:03bhenryout 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:16TimMcbhenry: Does it decode %20 properly?
11:18bhenryTimMc: spaces " " turn to "+"; "%20" stays "%20"
11:18TimMcOK, so you've suddenly lost URL decoding entirely.
11:18bhenryyeah. and i didn't change anything related to that, so i'm completely lost.
11:19bhenrythey are post params
11:19TimMcWait, there may be a miscommunication here.
11:19TimMcIf you put an = into the data that is POSTed, what does it look like in the DB?
11:20TimMcThe data, mind you, not the POSTDATA.
11:21TimMcBy the way, I blame version ranges.
11:21bhenryTimMc: what's a version range?
11:21bhenryin the project.clj?
11:22bhenrytext area input: "ignore this test = = = "
11:22bhenrydb storage result: "ignore+this+test+=+=+=+"
11:22TimMcFascinating.
11:22TimMcI think I've seen this before.
11:23TimMcThe version ranges thing is half snark, half hunch.
11:24bhenryrelevant part of code (get (:params ring-request) "notes")
11:24bhenryso probably my ring params middleware is broken?
11:31gfredericks,(doc bit-shift-left)
11:31clojurebot"([x n]); Bitwise shift left"
11:32gfredericks^ great for figuring out which arg is which :P
11:32ystaelshould be [victim severity] or something
11:32TimMcYeah, relying on naming conventions as documentation is not so great.
11:35bbloomI wish `extend were more useful....
11:36bhenryTimMc: i should also note that this only happens on the production box and not on my dev box.
11:36bhenryany ideas?
11:38ambrosebsbbloom: what's wrong with extend?
11:38bbloomambrosebs: doesn't work with java interfaces, produces slower code, not available on cljs
11:38ambrosebsright
11:39ambrosebsslower code compared to what?
11:39bbloomambrosebs: implementations inside the body of deftype
11:39ambrosebsah
11:39ambrosebsthat kinda sucks.
11:40bbloomhence my complaint :-)
11:40ystaelbhenry: do you have something in the way that's eating the request's Content-Type: header?
11:40ambrosebs;)
11:40bbloomambrosebs: when you define impls inside the deftype, it emits real methods for real java interfaces
11:41bbloomambrosebs: otherwise, it does some sideways hackery, so you get an Fn object in a map of some sort
11:41ambrosebsright. Is that because of a real restriction?
11:41bhenryystael: 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:42bbloomi think it's b/c you can't edit a type after you create it on the JVM
11:43bbloomi'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:43bbloomand implementing clojure.lang.Fn makes me cry
11:45ambrosebs:/
11:46ambrosebsyay, jvm.tools.analyzer is all set up https://github.com/clojure/jvm.tools.analyzer
11:46ambrosebs0.3.0 should be on Maven in 24 hours.
11:49ambrosebsbbloom: What's your latest opinion on AST children?
11:50bbloomambrosebs: i still think it's a broken/bad idea for the most part
11:54ambrosebsbbloom: It reminds me of trying to squeeze a method call into a literal map. :/ Doesn't really make sense.
11:54dnolenambrosebs: bbloom: it would be nice to get the basic AST sorted out now that we have an official analyzer
11:55ambrosebsYes.
11:55bbloomambrosebs: 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:55ambrosebsbbloom: ditto, exactly
11:57bbloomambrosebs: 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:57ambrosebsnope
11:57bbloomdnolen: ?
11:57dnolenbbloom: ambrosebs: rhickey was pretty adamant about no API - I think it's worth sticking to that.
11:58ambrosebsChris Frisz is working on CPS stuff.
11:58dnolenbbloom: I believe ibdknox may use it, anybody doing any serious tooling needs it.
11:58dnolenambrosebs: but Chris has his own custom AST deftype/record thing
11:58bbloomdnolen: yeah, i was gonna say, i think he just wrote his own analyzer for his own needs
11:58bbloomambrosebs: Chris' CPS uses a custom representation
11:58ambrosebsYep, but he's told me he might move to the standard AST.
11:58ambrosebsHe liked what he saw.
11:59ambrosebs:children is a serious problem for AST manipulations.
12:00frozenlock,(= "asd" "asd")
12:00clojurebottrue
12:00frozenlock,(= #"asd" #"asd")
12:00clojurebotfalse
12:00bbloomdnolen: there already *is* an API tho... you can't avoid it
12:00bbloomdnolen: you need to re-analyze if you make any new forms
12:00bbloomdnolen: analyze is an API.... a poorly specified one
12:01frozenlock... What's so magical about regexp that makes them not equal?
12:01Kototamahi, I have put my JS libraries in closure-js/libs but cljsbuild doesn't not compile them. Is the path correct?
12:02dnolenambrosebs: I'm pretty sure everyone agreed that :children was a expedient hack and it's probably wise to just remove it.
12:02ambrosebsok good.
12:03bbloomdnolen: heh, what did that happen? either way, i'm OK with it, but I think the children multimethod should come back
12:03dnolenambrosebs: bbloom: also there should be some way to get an AST that removes unnecessary env cruft
12:03dnolenbbloom: probably not going to happen
12:03bbloomdnolen: yes. i have a few little helpers for that
12:04jonasendnolen: bbloom: ambrosebs: Ah, the good'ol :children discussion
12:04technomancyambrosebs: would it be easy to wire up a "who calls this defn" extension for nrepl with analyze?
12:04TimMcbhenry: Run `lein classpath` on both boxes, and compare them.
12:05jonasendnolen: Have you had a chance to look at http://dev.clojure.org/jira/browse/LOGIC-118
12:05bbloomfundamentally, 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:06ambrosebstechnomancy: Should be easy. I swear there was an example of that somewhere...
12:06bbloomI'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:06dnolenbbloom: 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:06TimMcfrozenlock: True regular expressions could easily support an equality check, but Java regexps include backreferences and such.
12:06TimMcfrozenlock: Or do you mean just pattern string equality?
12:07technomancymaybe we'll make that a seajure hack project some month =)
12:07dnolenjonasen: thanks for the ticket+patch - I need to take a closer look.
12:07jonasendnolen: ok
12:07gfredericksare watchers for atoms invoked on the same thread as the swap?
12:08bbloomdnolen: personally, i prefer it as a weird lookup
12:08gfredericksnm read the docs
12:08ambrosebstechnomancy: 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:09bbloomdnolen: 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:09bbloomeither way is fine really
12:09frozenlockTimMc: I mean why arent' #"asd" and #"asd" equal, even if they are obviously the same thing.
12:09bbloomthe problem is that :env, :children, etc are synthesized properties -- there is no distinction between essential AST data and memoized data
12:09technomancyambrosebs: cool; thanks
12:10bbloomdnolen: ambrosebs: we should spec out two schemas for the AST: essential & synthesized. essential should be a proper subset of synthesized
12:11bbloomdnolen: ambrosebs: also, you should both read up on Attribute Grammers, since that's what we're effectively making here
12:11TimMcfrozenlock: Again, which kind of equality? Are #"[0-9]" and #"[0-56-9]" equal?
12:12ambrosebsdnolen: 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:13bbloomambrosebs: nice
12:13frozenlockTimMc: they have the same result, but they look different, I would say no.
12:13frozenlockhttps://github.com/clojure/clojurescript/commit/e35c3a57472fa62ae41591418a73794dc8ac6dde
12:13jtoyis 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:13ambrosebsbbloom: :)
12:13johnmn3in 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:14bbloomambrosebs: does that only buy us validation of ASTs? or could we, in theory, also extract known fields?
12:14johnmn3I 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:14ambrosebsbbloom: what do you mean?
12:15bbloomambrosebs: so let's look at :op :var for a moment
12:15bbloomambrosebs: the essential information is {:op :var :name Symbol}
12:15bbloomambrosebs: but there is this :info table and then :env and :children
12:15bbloomambrosebs: and :info can have a bunch of other stuff, like type hints, etc
12:16ambrosebssure
12:16johnmn3so, 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:16bbloomambrosebs: 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:16bbloomambrosebs: ie without :env or :children
12:17ambrosebsbbloom: If you make a new copy of the type, sure?
12:18bbloomambrosebs: 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:19bbloomambrosebs: (i also realize now that :children could also be implemented via such a reflection on types)
12:20frozenlockSo cljs was fixed, but not clj?
12:20ambrosebsSo you can generate a walk/fold function from a recursive AST type?
12:21jweisshuh, so records created before a protocol was extended to that type, will never satisfy that protocol? wasn't expecting that
12:21gfredericksjweiss: wat?
12:21TimMcfrozenlock: Open a Jira ticket, I guess... http://rbxbx.info/images/fault-tolerance.png
12:22ambrosebsbbloom: The types are certainly not just syntax, there's lots of core.typed infrastructure to interrogate them.
12:22bbloomambrosebs: i guess of course they need to be inspectible... that was a silly question i guess... haha
12:22jweissgfredericks: (def jeff (MyUser. "jeff")) (extend MyUser Proto1 {:foo (constantly :foo)}) (foo jeff) -> error
12:23frozenlockTimMc: Oh yay...
12:23bbloomambrosebs: i need to limit myself to a single simultaneous complex thought process :-)
12:23gfredericksjweiss: oooh, you mean instances
12:23ambrosebsbbloom: Well there's a few tricks with recursive types and aliases etc.
12:23jweissyeah sorry
12:23ambrosebsbbloom: But you'd be up for that ;)
12:23TimMcfrozenlock: :-/
12:23hiredman/win/win 15
12:23gfredericksjweiss: that is kind of gross
12:23TimMc/for /the /win
12:23rasmustohiredman: winwin situation
12:24bbloomambrosebs: heh. hurraaaaay :-P
12:24ambrosebsbbloom: :D
12:24hiredmanwindow 15 is the one window I go to often that I can't use keyboard shortcuts to jump to
12:25jweissgfredericks: i'm not entirely sure yet whether recompiling the namespace that defined the record had anything to do with this, trying now
12:25trptcolinjweiss: 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:26jweisstrptcolin: yeah, maybe you have to re-eval the (defrecord ...) for this to go wrong
12:26jweissi added a new record and recompiled the namespace where MyUser was also defined
12:28jweissugh, well, my simple repl case works fine. not sure what was going on
12:30rasmustohiredman: I'm bad at irssi and use C-n/C-p to change windows
12:31hiredmanrasmusto: since I have more then 15 windows walking linearly through the list is not great
12:31rasmustohiredman: definitely, I'm not saying my way is efficient at all :p
12:32TimMcrasmusto: M-4 should get you to window 4.
12:32rasmustoTimMc: that's surprising actually, I guess it handles escape-4 from my terminal emulator properly
12:58lynaghkgfredericks: pong
12:59lynaghkgfredericks: sorry about that, I went to a conference in Aruba and seemed to have left IRC running =P
12:59lynaghkbbloom: you're coming to Clojure/West? Awesome, I'd be happy to talk rewrites.
12:59bbloomlynaghk: definitely, i'm speaking :-)
13:00lynaghkohhh, well you should certainly come then
13:00bbloomlynaghk: but yeah, i'm curious how it's working out with partial map rewrites for your grammar of graphics
13:02lynaghkbbloom: 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:03lynaghkbbloom: 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:03lynaghkbbloom: that code never used the fancier parts of relational logic (i.e., "going backwards")
13:03bbloomlynaghk: hm, i figured as much...
13:08bhenryTimMc: on production it's running from an uberjar. how can i get the classpath from in there?
13:17frozenlockHrmph... 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:17jtoycan resources be used with a rdr? like so: (with-open [rdr (clojure.java.io/resource "dist.male.first")]
13:18technomancyjtoy: try it and see? =)
13:18jtoyi dont thinkso: I'm geting java.lang.IllegalArgumentException: No matching field found: close for class java.net.URL
13:18llasram`jtoy: Well, you probably want to actually io/reader it
13:18jtoyi think im doing something wrong though
13:19llasram`bhenry: How are you running the uberjar? With `java -jar ...`?
13:19jtoyI defintely need resource
13:20jtoybecause the file is packed in a jar and sent to hadoop
13:20dnolenfrozenlock: you cannot fix regexp equality
13:20llasram`jtoy: (a) Sure. So check and see what io/resource returns. Then consider what io/reader may take as arguments
13:21llasram`jtoy: (b) In Hadoop context, is a resource the right solution vs the distributed cache?
13:21frozenlockdnolen: Didn't you do it with cljs?
13:22bhenryllasram`: java -cp uberjar.jar runscript.clj
13:22bhenryoops
13:22dnolenfrozenlock: I don't think so
13:22jtoyllasram`: 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:22bhenryllasram`: java -cp uberjar.jar clojure.main runscript.clj
13:22jtoyi need to process my file though so i cant use plain slurpo
13:22frozenlockdnolen: https://github.com/clojure/clojurescript/commit/e35c3a57472fa62ae41591418a73794dc8ac6dde ??
13:22lazybotfrozenlock: What are you, crazy? Of course not!
13:23llasrambhenry: Hmm. So when using the -jar option, the classpath should be limited to just the boot classpath + the JAR contents
13:23dnolenfrozenlock: heh, yeah I forgot. You can't do that on the JVM.
13:24frozenlockArggg
13:24dnolenfrozenlock: or well not until Clojure JVM is based on protocols and not Java interfaces
13:25bbloomdnolen: grumble grumble interfaces
13:25frozenlockSo 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:25bbloomequality is hard.
13:25jtoyI 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:26jtoyresource Returns the URL for a named resource; reader: If argument is a String, it tries to resolve it first as a URI, then
13:26jtoyas a local file name
13:26llasramjtoy: 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:27llasramjtoy: 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:27dnolenfrozenlock: appears not, I guess you could put a regex string in there instead.
13:28frozenlockSuch a little thing... and yet so much pain
13:28jtoyllasram: yeah, you are right, thx
13:43technomancyanyone know when the link to leiningen.org from clojure.org was added?
13:44ohpauleeztechnomancy: A few days ago
13:44ohpauleezI think Alex Miller made the link updates
13:44stuartsierratechnomancy: A couple of months ago I think.
13:44technomancyohpauleez: traffic to leiningen.org got a ~70% boost starting a week ago
13:44technomancy43% of referrers from clojure.org
13:45stuartsierraWell, that was probably it, then. :)
13:45ohpauleezahh, maybe it was a little longer than a few days
13:45ohpauleezAll the doc and tool sites got added to clojure.org
13:46technomancyyeah, no referrers from clojure.org over 10 days old
13:46jtoyis therea version of case that is evaluated? I a simpel way to do multiple if elses?
13:46technomancycool; I owe Alex a high-five
13:46technomancy(for many reasons)
13:46amalloyjtoy: cond
13:46bbloomawesome! glad that link is on there now
13:47jtoyamalloy: thx
13:47ambrosebsdnolen: bbloom: how about :children are a vector of 2 place vectors, with path and child type information.
13:47ieureHas anyone seen issues with Clojure projects taking significantly longer to start than other JVM langs?
13:47bbloomambrosebs: "path"?
13:48ambrosebs:if would be [[:then] :single] [[:else] :single] ...]
13:48ieureI have a fairly straightforward codebase, and it pegs the CPU for 60s before my -main is ever called.
13:48technomancyieure: jruby has a lot of tricks up their sleeves, but we're catching up: https://github.com/technomancy/leiningen/wiki/Faster
13:48technomancyoh... 60s; yeah that's terrible.
13:48ieuretechnomancy, Yeah, nothing to do with lein.
13:48ieureI build a fat jar and `java -jar blah'
13:49bbloomambrosebs: so i left some comments on the design page just now
13:49stuartsierraI've seen large apps take up to 30 seconds just to load & compile Clojure source files.
13:49bbloomambrosebs: 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:49ambrosebsthen consuming is (for [[path info] (:children expr)] (let [c (get-in expr path)] (if (= :single path) ... ))
13:49technomancyieure: any AOT?
13:49bbloomambrosebs: and passes should be configurable
13:49ieuretechnomancy, No.
13:49ambrosebsbbloom: ok sounds interesting.
13:49technomancyieure: I recommend :aot :all when you build your uberjar
13:49bbloomambrosebs: in the meantime, i'd be happy with refactoring it into a multimethod :-P
13:49ieurestuartsierra, So when I build a JAR and `java -jar' it, Clojure compiles at that time?
13:50hiredmanrich seemed dead set against making it a multimethod
13:50dnolen_ambrosebs: bbloom: any discussion of the AST should separated from passes IMO
13:50bbloomambrosebs: 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:50ieuretechnomancy, I build with maven, assume there's something similar there?
13:50stuartsierraieure: Clojure doesn't compile anything to disk unless you tell it to.
13:50dnolen_ambrosebs: bbloom: it also probably a good idea to seriously look at JS AST JSON projects for inspiration.
13:50technomancyieure: probably; not sure how
13:52ieureSo inside my fat jar, I see .class files for the Clojure code in the project.
13:52bbloomdnolen_: i think that configurable passes would make the question of what to do with children obvious....
13:53bbloomdnolen_: 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:54dnolen_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:54dnolen_or rather, don't design something without looking very long and hard at something similar first
13:54bbloomdnolen_: i think they are doing what i'm suggesting: configurable passes to add optional data, always recreate from essentials and re-analyze
13:56dnolen_bbloom: ambrosebs: http://esprima.org/demo/parse.html
13:56bbloomdnolen_: yeah, that's exactly what i'm suggesting :-P notice the checkboxes for "index-based range"
13:56bbloomdnolen_: add a checkbox "children" and it's what i'm saying
13:57ambrosebsbbloom: dnolen_: I see what you mean. It would it pretty painless to perform transofmrations
13:57bbloomthe 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:58bbloomwe have one API function: analyze
13:59dnolen_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:59bbloomdnolen_: i'm saying that :children is no different than :env
14:00dnolen_bbloom: where do you store the equivalent of the JS Body information then?
14:00bbloomdnolen_: there are essential fields, that form a minimal set to fully specify the AST node (assuming the node is attached)
14:00nDuffieure: Your own Clojure code may exist as .class files, but how about your dependencies? Hence :aot :all
14:01technomancynDuff: actually it's not possible to AOT your own code without AOTing dependencies yet
14:01technomancyunless you do resolve or eval at runtime
14:01bbloomdnolen_: that "body" is specific to the node type you're looking at
14:01bbloomdnolen_: that's :statements and :ret basically
14:01nDuffAhh.
14:01bbloomdnolen_: try just "x" as the only code (without the quotes)
14:01bbloomdnolen_: you'll see the "Program" has body, but the "ExpressionStatement" doesn't
14:02bbloomdnolen_: body is essential to a block
14:02hiredmanit does seem sort of weird that :ret and :statements are not just a single array, similar to body there
14:02bbloomdnolen_: 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:04bbloomdnolen_: and additional information is inherently optional.... ie env, info, shadow, children, tag, etc
14:04bbloomeach of those can and should be a separate pass
14:05ambrosebsbbloom: this way we can present eg. children any way we like, with no complications right?
14:06bbloomambrosebs: sure, but the simplest representation is just to duplicate them the way it currently works
14:06ambrosebsyes, exactly
14:06ambrosebsas in, no complications for AST manipulators
14:06bbloomambrosebs: not quite... go see my notes about 'assoc
14:06bbloomon the wiki
14:06ambrosebsok
14:07atyzHey 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:07bbloomi think i should implement an attribute grammar system.... & take a crack at porting the analyzer to use that
14:07bbloomambrosebs: dnolen_: http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue4/Why_Attribute_Grammars_Matter
14:07bbloombecause too many passes will make the analyzer slllloooow b/c it requires many traversals
14:08bbloombut an attribute grammar could be compiled via a topological sort to make a minimal number of passes
14:08craigbroatyz: that's not how sql works 8)
14:08bbloomand then "passes" are really just attribute grammar "aspects"
14:08dnolen_bbloom: I guess you still haven't looked at the Chez Scheme stuff, nano-pass compiler designs work
14:09bbloomdnolen_: d'oh, no i forgot
14:09dnolen_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:09craigbroatyz: aka, it can't return results like that
14:09ambrosebsbbloom: 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:09bbloomdnolen_: they might be awkward to use without fully lazy evaluation....
14:10craigbroatyz: 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:10craigbroand then merge them
14:10nDuff...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:10nDuff...but it'd be work that would have to be done.
14:11bbloomdnolen_: if you have a reference for him saying they are dumb, i'd love to see his thoughts :-P
14:12bbloomambrosebs: 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:12dnolen_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:12bbloomambrosebs: because the condition can be unsatisfied, so then the attribute doesn't get added, but it was already there!
14:13bbloomambrosebs: so the safe/smart thing to do is to throw out the map & recreate it, or just create a form directly
14:13bbloomfor the record: i think that generic transformations are impossible.... but generic analysis is sometimes reasonable
14:13bbloomand a non-generic transformation can often skip a known node which may contain unknown nodes
14:13ambrosebsbbloom: yes, I agree making a new map of just essential data is the way to go.
14:13bbloombut still perform generic analysis, like my 'serious? function
14:15ambrosebsbbloom: sounds reasonable.
14:16atyzcraigbro, I was hoping Kormasql would have some nice way to structure the results it receives behind the scenes - thanks though
14:17craigbroatyz: well, in some ORMs (DataMaper for example) that would be done for you somewhat automagically
14:17technomancybbloom: wait, I have to know what the serious? function does
14:17craigbroatyz: in AR for example, you could do .includes(:venues) or whatever
14:17craigbroand it would do that join
14:17bbloomtechnomancy: it determines if a form is non-trivial
14:18bbloomtechnomancy: where, in this context, trivial means "guaranteed not to use any continuation-based control forms"
14:18technomancyoh, ok; I was expecting NLP irony-detection or something
14:18craigbroatyz: 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:18technomancybut that's cool too I guess
14:19bbloomtechnomancy: the discussion is about ASTs, so if anything, it would be like "DID YOU SERIOUSLY WRITE SUCH A CRAPPY FUNCTION?"
14:19craigbroatyz: using the clojure fn group-by for example
14:19atyzcraigbro, yeah, i was hoping korma would have that hidden int eh docs. Yeah i've just started writing it myself
14:19atyzi appreciate your input :)
14:20craigbroatyz: 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:20craigbroatyz: in your case, you likely have few venues
14:24atyzactually an event would only correspond to one venue
14:25cemerickdnolen_: 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:26craigbroatyz: sure, but there are N venues in the whole system, where N is much ess than the number of events
14:26dnolen_cemerick: that would probably work yes.
14:26atyzOH yes, ofcourse
14:27craigbroatyz: in AR for example, it would do the same attribute name munging and then unmunge it and create that subordinate relationship you want
14:28jtoywhat 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:28jtoywith imperative langauges I know, but not sure in clojure
14:29cgagfilter over a line-seq and count the results would work
14:29arrdem^ that
14:29llasramOr just `reduce`
14:29jtoyis that whole thing lazy?
14:30dnolen_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:31blrmjtoy: line-seq and filter are lazy.
14:31ToBeReplacedjtoy: filter and line-seq both are... count/reduce aren't... if you want a running count though, you can use reductions
14:32jtoyit sounds like its ok for the count to not be lazy though?
14:32dnolen_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:34bbloomdnolen_: 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:34arrdemwhat are we compiling here?
14:34bbloomdnolen_: now i'm saying leave it the way it is, but yes, call analyze again, it's analyze's job to handle this
14:35bbloomdnolen_: in short, i say we start by specifying the output of 'parse without any call to analyze... that's the fundamental grammar
14:35bbloomdnolen_: anything else should be considered disposable data
14:35dnolen_bbloom: ok - that does sound OK. and the AST includes :children for generic walkers?
14:35bbloomdnolen_: ideally: only if requested
14:36dnolen_bbloom: huh, then I don't see how you can have a generic walker.
14:36bbloomdnolen_: does your generic walker need type hints? does it need :shadow information? does it need unique local symbol names?
14:37bbloomdnolen_: different down stream passes have different requirements
14:37bbloomdnolen_: 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:38blrmjtoy: 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:38bbloomdnolen_: 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:38dnolen_bbloom: I don't see why stuff matters as far as making it easy to write a generic walker.
14:38dnolen_bbloom: with :children you at least have the possibility of skipping over nodes you don't understand.
14:39lynaghkdnolen_: 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:39bbloomdnolen_: the issue has more to do with writing transformations, which might change essential values that invalidate computed values
14:40dnolen_lynaghk: I do not, seems like a dependency order bug in the compiler - perhaps due to incremental compilation.
14:40dnolen_bbloom: yes you keep focusing on transformation. I'm saying there are other things to consider.
14:40dnolen_so :children still might have utility in the minimal AST
14:41dnolen_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:41TimMcbhenry: 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:41dnolen_lynaghk: I thought I had resolved it but maybe not?
14:41bbloomdnolen_: these are the things to consider: analysis modularity, serialization/printing, walking, and transformation
14:41lynaghkdnolen_: 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:42bbloomdnolen_: you're missing what i'm saying about a "minimal" AST
14:42bbloomdnolen_: the minimal AST includes only the fields that would match the arguments you'd include if you had factory functions
14:42lynaghkdnolen_: 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:42bhenryTimMc: 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:42cemericklynaghk: hi :-)
14:43bbloomdnolen_: i keep discussing transformations b/c in writing a transformation, i've had exposure to the rest of the points
14:43bhenryTimMc: 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:44bbloomdnolen_: in a transformation, i need to worry about parsing, initial analysis, printing for debugging, creating transformed nodes, and re-analyzing after transformation
14:44dnolen_lynaghk: yeah nothing comes to mind. I've heard a couple of complaints but no tickets / minimal cases / patches
14:45bbloomdnolen_: 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:45bbloomdnolen_: and only bothered me during printing, but i had the same problem with :env
14:46dnolen_bbloom: ok, makes sense. some more things to think about.
14:46lynaghkdnolen_: yeah, it's a thankless problem.
14:49jtoyif i am going through a file, why does this print everyline instead of all lines? (println (first (line-seq rdr)))
14:49jtoyi thought if its lazy it wont process every line?
14:49harobDoes 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:51TimMcbhenry: 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:51bhenryi'll try to change the method to get and see what happens.
15:00sshackSo I'm using leon-pedantic to track down dependency version mismatches. What's the answer to everything wanting a different version of clojure?
15:01nDuffsshack: Unless something uses version ranges (kill it with fire!), just let the highest version win?
15:02sshack[korma "0.3.0-beta7"] -> [org.clojure/clojure "1.3.0"]
15:02sshack is overrulling
15:02sshack[org.clojure/clojure "1.5.0"]
15:02sshackI get miles of that.
15:06antares_sshack: use :exclusions: https://github.com/michaelklishin/monger/blob/master/project.clj#L37
15:06sshackSo the answer is pruning the graph manually?
15:07stuartsierraLeingingen supports global :exclusions
15:09sshackAlso, how do you pronounce leingingen?
15:09GlenjaminHi all, I'm trying to learn clojure but struggling to pick a decent editor
15:09cgagwhat do you currently use for other languages?
15:09amalloyGlenjamin: use whatever editor you're already comfortable with
15:09GlenjaminEmacs is probably a bit too different to what I'm used to while learning a new language - any suggestions?
15:10blrmGlenjamin: you've come to the right place to get 9 different opinions, what do you use to edit text normally?
15:10Glenjamincurrently using komodo, but having trouble managing all the parentheses
15:10patrkristpope: do you happen to know how to cancel spinning up the JVM, when loading a .clj-file in MacVim using vim-foreplay?
15:10tpopeyou can let g:no_foreplay_classpath = 1
15:10Glenjaminis there anything non-emacs with paredit and barf/slurp?
15:11tpopethat prevents it from doing much useful without a repl running
15:11cgagi mostly use vim/emacs, but eclipse and counterclockwise seemed pretty capable and easy to setup: http://clojure-doc.org/articles/tutorials/eclipse.html
15:11tpopemany don't seem to care
15:13blrmGlenjamin: 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:14Glenjamini was hoping there was a non-IDE that isn't vim or emacs, but i guess primarily people are in those camps?
15:14n_bLightTable?
15:14n_bI think Raynes uses SublimeText as well
15:14cgagI've heard sublimetext works
15:14RaynesI think you are entirely incorrect
15:15RaynesI'm an Emacs user who occasionally complains about ST2's shortcomings.
15:15trptcolinhttp://tempest.fluidartist.com/wp-content/uploads/2009/05/oh-snap-flowchart.jpg
15:15n_bAh, must've seen you complaining and thought you used it then
15:18patrkristpope: 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:19patrkristpope: I can't seem to do that in MacVim, and perhaps it is something specific to MacVim
15:19tpopeoh I didn't even think of that
15:19n_bGlenjamin: St2 is probably your best bet if you are currently using Komodo, I think there's even a paredit plugin
15:19Glenjamincool. i'll give it a whirl
15:19Glenjaminpeople keep telling me they like ST2
15:19tpopepatrkris: can you ctrl-c if you open macvim first, then :edit a clojure file?
15:20n_bIt's probably the least bad non-terminal editor ;) I'll grant it that
15:20Glenjaminheh
15:20patrkristpope: nope... it insists on waiting for the JVM to start (if I'm not already running a REPL)
15:20patrkristpope: which Vim variant do you personally use?
15:22tpopeseveral. 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:22tpopepatrkris: oh btw, if you install the extracted classpath.vim, it's much better at caching
15:22tpopeso maybe that will render this moot
15:22patrkristpope: i'll give it a try, thanks
15:24blrmtpope: is there a "c" command to eval the whole file with foreplay? or is :%Eval the way to go about it?
15:24tpopecpr requires the file
15:27blrmtpope: ty!
15:28patrkristpope: your advice worked wonders
15:28tpopeI'm going to remove the old version that ships with foreplay
15:28tpopewhenever I get around to renaming :(
15:29patrkristpope: tell me what to do, and I'll do it
15:29llasramtpope: What are you renaming it to?
15:29tpopeI think fireplace but I hate it
15:29Raynesvim-threesome
15:30RaynesHe is trying to get away from the sexual connotations obviously.
15:30tpopeRaynes haha that's actually taken
15:30RaynesOf course it is.
15:30RaynesVim people and their sex.
15:30tpopewell the guy later renamed
15:30tpopeif I loved fireplace I would have done it already. instead I'm like "meh, I'll do it this weekend"
15:30tpopeevery week
15:31bbloomwhat's wrong with fireplace?
15:31llasramWhy "fireplace"?
15:31bbloommy guess is fiREPLace, considering foREPLay
15:31tpopenothing's wrong with it, it's just kinda meh
15:31tpopeFUCK IT I'M DOING IT RIGHT NOW
15:32bbloomtpope: all names always suck until they don't suck
15:32bbloomwho names a computer company "apple"? seriously? wtf?
15:32SgeoFun name for an esolang: "Trustfuck"
15:32patrkrisvim-repel
15:32bbloombut now, it couldn't possibly have been named anything else :-P
15:32SgeoI really like that name, but don't really want to mention it to potential employers etc.
15:33llasramHuh, fewer words with 'repl' in them than I would have expected
15:33llasram`replete` doesn't quite code it, which pretty much leaves `fireplace`, I do see
15:33llasrams,code,cut,
15:33bbloombut, 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:34patrkriswhat a fucked up world
15:34bbloombest to change it, i mean
15:35frozenlockHow `foreplay` could be offending? o_O
15:35bbloomfrozenlock: as someone who has routinely offended people on accident, here's what i've learned:
15:35bbloomfrozenlock: it's a complete fucking waste of your time to be offended
15:36bbloomfrozenlock: but it's also a complete fucking waste of your reputation to offend people
15:37frozenlockWell yeah, I don't usually give a **** about what might offend people, but this is just silly.
15:37frozenlockWhat's next, 'hug'?
15:37Sgeobbloom, should I rename Trustfuck?
15:37RaynesI 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:37SgeoIt's not like it's ever going to see production...
15:37bbloomSgeo: if you want to increase the number of people who bother looking at it, then yes rename it
15:38frozenlockRaynes: Don't you get it? You are a guy! Thus, sexist.
15:38bbloomSgeo: if you don't care about contributors or users or your reputation, don't worry about it
15:38Raynesfrozenlock: Heh.
15:38patrkristhere will only be gender equality the day that women learn to take a joke for what it is ;)
15:38SgeoI care about reputation, but it's not exactly a thing that people would be using on a regular basis
15:38RaynesMy problem is that I make stupid immoral jokes about *everybody*.
15:38bbloomSgeo: until some easily offended person in HR reads your github profile
15:39frozenlockRaynes: you're young, white, and male. You shouldn't try to make jokes... it's dangerous :P
15:39RaynesI'm overweight though, so I can make all kinds of fat people jokes.
15:39bbloomfrozenlock: seriously.
15:39RaynesDid you hear bout them mericans?
15:39frozenlock:P
15:45cemerickRaynes: Jokes are generally a bad idea — esp. in text-mode — unless you (a) know your audience well, or (b) are a known comedian.
15:46cemerickSometime, 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:46bbloomin short, cemerick is now dead. true story.
15:46cemerickbbloom: I flinch every time I turn my car on.
15:47frozenlockcemerick: you don't ask passing children to turn the car on?
15:47Raynescemerick: I'm getting better at being quiet these days, but I've been pretty dumb in the past.
15:47cemerickfrozenlock: that's a good idea!
15:47bbloomRaynes: it's all OK as long as you avoid embarassing yourself publicly in a permanent medium... you know, like irc logs :-)
15:47Raynescemerick: 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:47RaynesAnd I hadn't even realized how horrible what I said was.
15:47bbloomRaynes: but seriously, avoid jokes in email.... trust me.....
15:48bbloomheh
15:48RaynesSo I apologized and deleted the tweet. I even offered to do a public apology but he didn't feel it necessary.
15:48cemerickRaynes: I believe it. Text-mode is *always* a bad scene for "humor".
15:48cemerickExcept in cases (a) and (b) ^^
15:48cgagRaynes, what'd you say, or at least, which group of people did you offend?
15:49frozenlockAt the same time, you don't get people to like you by saying nothing.
15:49Raynescgag: Everyone.
15:49frozenlockThose social skillz are hard!
15:49Raynescgag: Literally everyone, I think.
15:49winka good joke is worth a friend or two
15:49cgagha, bravo then
15:49cemerickfrozenlock: In general, if you follow Mom's advice, people will like you just fine ;-)
15:50bbloomfrozenlock: ignore that completely if your Mom is a loon.
15:50n_bwell, this was interesting scrollback to come back to :P
15:51tpopepatrkris, bbloom et al: try the rename branch
15:51frozenlockcemerick: seems like an eternal-friendzone advice.
15:53cemerickfrozenlock: 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:53bbloomtpope: first line of fireplace/zip.vim mentions incorrect filename
15:53bbloomthere are two occurrences of "foreplay" in that file
15:53bbloomboth in comments
15:53ivanthe more you offend people the faster they can burn out their be-offended-all-the-time circuits
15:54tpopebbloom: --amended and repushed
15:54nDuffivan: That assumes that you offend only people who are offended "all the time".
15:54bbloomivan: 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:55n_bThat stratagem has worked terribly well for 4chan ;)
15:56nDuffn_b: Which one? 4chan doesn't exactly have what I'd term a passable reputation.
15:56bbloomtpope: seems to work fine
15:56n_bthe "more you offend people..."
15:56tpopegreat. gonna give it a little time before making it official
15:57nDuffn_b: I'd argue that 4chan has selected its audience, not made the general public less susceptible to offense.
15:57bbloomtpope: dammit. gonna have to update a submodule link, what a pita, dammit offended people :-P
15:57tpopeyeah I know
15:57piranhaoctagon: hi, are you here by any chance? :)
15:57tpopeit's been eating me up for months
15:57n_bnDuff: and my original comment was facetious, we agree.
15:57nDuffn_b: As previously discussed here, text isn't a good substrate for non-serious content.
15:57nDuff(without explicit designation as such)
15:58frozenlocksome-text some-text some-text <recorded-youtube-joke> some-text some-text some-text
15:59n_bthe ";)" appended is essentially synonymous to adding the metadata {^:sarcasm true} to the statement
15:59patrkristpope: tried the amended rename branch and dabbled around a little - seems to work
15:59nDuffn_b: ahh; just so. :)
16:02bbloomdnolen_: is there a particular bit of chez scheme i should be looking at?
16:06dnolen_bbloom: http://www.cs.indiana.edu/~dyb/pubs/nano-jfp.pdf
16:06bbloomdnolen_: thanks
16:12dnolen_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:12bbloomdnolen_: thanks again, i'll read those later on
16:17harobDoes 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:17akhudekdnolen_: 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:20antares_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:22harobThanks 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:23antares_harob: Neocons can do that and with Cypher you can do many similar things
16:23antares_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:23arohnerdoes typed clojure have a type for Refs?
16:24arohneris it just Ref, or (Ref Vector)?
16:24hyPiRion,(class (ref nil))
16:24clojurebotclojure.lang.Ref
16:25craigbroantares_: hey, you work with neocons much?
16:25arohnerhyPiRion: 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:25craigbroantares_: and/or titan
16:26craigbrooh, you wrote the clojurewerkz libs 8)
16:26harobantares_ : Thanks, I'll look closer at Neocons + Cypher then!
16:26hyPiRionarohner: Ahh, I see. I didn't connect it to typed clojure
16:29antares_harob: sorry that Neocons' graph algorithm functions are not really documented, we got distracted by a few new clojurewerkz.org projects
16:29antares_craigbro: I maintain Neocons
16:30antares_craigbro: as well as Titanium. Can I help you?
16:30craigbroantares_: I'm investigating graphDBs for our next gen storage system. Favoring Titan now.
16:30harobantares_: 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:31craigbroantares_: I'm not building for another 6 months, so breaking API changes don't hurt
16:32antares_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:32craigbroantares_: the key needs are the clustering, write scaling, and the tinkerpop ecosystem
16:32antares_craigbro: the biggest issue with Neo4J is that it does not have dump/import tools in the Community edition, neither it has HA
16:32craigbroantares_: I need fast writes/imports
16:32antares_craigbro: and Titan is APL 2.0, plus the embedded library approach makes transactions support sane
16:33antares_craigbro: in such case Titan probably will beat Neo4J over REST by a wide margin
16:33craigbroantares_: I also need the HA and near real-time queries (the ones I need to be near real-time are relatively simple)
16:33antares_craigbro: also sounds like something Titan will be better at
16:33antares_because it keeps some data locally
16:33craigbroantares_: main issue twith Titan, is lack of search over indexed properties
16:33antares_and persists what needs to be persisted at the end of every transaction
16:33clojurebotdnolen: well feel free to throw some more in and send me a pull request. The format is pretty general
16:34antares_craigbro: Titan 0.3 will include Lucene integration
16:34craigbroantares_: I need IP/CIDR block searching, text search etc...
16:34craigbroantares_: well then, I'm set 8)
16:34antares_craigbro: also, I believe Titan has simple K/V indexing for everything?
16:34craigbroantares_: yah, simple K/V gets me 90% there
16:34antares_craigbro: see https://groups.google.com/forum/?fromgroups#!topic/aureliusgraphs/vlRg0ey735g
16:34antares_craigbro: well, I think titanium already supports that :)
16:34craigbroantares_: and as long as they make the indexing APIs extensible, I can add things like leventenshein distance etc...
16:35antares_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:35craigbroantares_: I need fast writes tho, that is where I am worried about Titan
16:35craigbroantares_: saw that -- it led me to consider have ES running side by side
16:36craigbroantares_: for some set of analysis we do, ES is the right tool
16:36craigbroantares_: it just means I have to provision storage for it, and get it's writes to scale etc...
16:36antares_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:36craigbroantares_: awesome 8)
16:37antares_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:38antares_craigbro: see the README https://github.com/thinkaurelius/titan
16:38craigbroantares_: I've read all those materials and am on the list already
16:38antares_craigbro: they say that they target billions of vertices/edges and multi-machine environments from the start
16:38antares_ok
16:38craigbroantares_: saying they target, and pulling off are two different things -- but their twitter simulation has me pretty much convinced
16:39antares_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:39craigbroantares_: I see Titan and the tinkerpop eco system and I think, "ok, so that's what the mature graphdb platform looks like"
16:40antares_craigbro: if you ask me, tinkerpop is young but nobody is getting as much right as they are
16:40craigbroi want gremlin in clojure 8)
16:40antares_and they have a license that you can actually mention to your boss
16:40antares_craigbro: have you seen https://groups.google.com/forum/?fromgroups=#!topic/gremlin-users/Del9DasqBcE?
16:41craigbroexcellent
16:41harobantares_: 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:42antares_harob: Neocons is a Neo4J Server client
16:43antares_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:43antares_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:43antares_harob: but Cypher is fantastic at that sort of problems
16:44harobantares_: 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:50jcromartieis there any way to wait for an agent to update?
16:50amalloyjcromartie: yes, but usually what you want to do is use something other than an agent instead
16:51jcromartieI suppose
16:51jcromartieI'm trying to model a resource that is periodically updated from a URL
16:51jcromartieand I want to make sure that it's been loaded at least once the first time
16:51jcromartiemaybe represent the loading/parsing as a future?
16:52jcromartiea future inside an atom?
16:53amalloya future inside an atom needs to be handled with extreme care, since starting a future is side-effectful
16:53jcromartiehm
16:54amalloyjcromartie: i actually have a function in useful that might do good work for you
16:55jcromartie(also: it seems like although atoms are lighter weight, refs are a more change-proof choice)
16:55amalloyhttps://github.com/flatland/useful/blob/develop/src/flatland/useful/state.clj#L83
16:55jcromartie(i.e. you will never find yourself missing features from atoms when you choose refs)
16:55jcromartieinteresting
16:57jcromartiebut if I created the future outside of swap! then it would be good
17:10jcromartiebut if I said (let [new-bar (future …)] (swap! foo assoc :bar new-bar)) that would do the trick right?
17:10jcromartiebecause assoc is side-effect free
17:15jcromartieamalloy: like so https://www.refheap.com/paste/12453
17:15gfredericksdoes anybody know about ClassNotFound: my-main.namespace-with-dashes ?
17:15gfrederickswhen doing `lein run`
17:15jcromartiegfredericks: only with "lein run"?
17:15gfredericksI think
17:15jcromartiei.e. it works in the REPL?
17:15gfredericksit's caused by a bad require
17:15gfredericksbut the error gives no indication of what/where
17:16gfredericksI don't know what the equivalent action in the repl is; it doesn't get as far as calling my main function
17:16gfredericksbecause there's a compile error
17:16jcromartiewell you shoud be able to work it out in the REPL
17:16jcromartiehopefuly
17:16gfredericksyes I know what the underlying problem is
17:16gfredericksI'm trying to figure out why `lein run` manifests it that way
17:17jcromartieOK got i
17:17jcromartiegot it
17:21myeHello. 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:22myeTrying to write functions that open two repls with nrepl connections is horrible, nrepl.el has lots of hardcoded assumptions
17:22myeeg. buffer names
17:23ljosambrosebs: 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:25brehautljos: ive had some trouble with Value and int-ish values not being equivalent in 0.1.8 master
17:26brehautljos: i think (no certainty) that an HMap is quite a distinct type to a IPersistentMap (which is homogenous)
17:27brehautim 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:29brehautljos: just to be clear though, i have only slightly more than no clue about what im talking about
17:29ljosbrehaut: I would think that anything that goes into a HMap should be able to go into a IPersistantMap, or?
17:30brehautljos: nope, i dont think so
17:31ljosbrehaut: how so? Isn't HMap just a specialisation of a normal map?
17:31brehautljos: it may be that anything that can go into an (IPersistentMap Keyworld Any) can go into an HMap though
17:32brehautljos: as i understand it, its a specialisation of of (IPersistentMap Any Any) for certain keys
17:32brehaut(thats an approximate analogy)
17:33brehautljos: 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:34ljosbehaut: That last sentence doesn't make any sense to me.
17:35brehautsay you have {def-alias Foo (HMap {:a AnyInteger}))
17:35ljosbrehaut: wait, I just read the definition of HMap again: HMap has ATLEAST the set of keyword/type pair.
17:35brehautyes
17:36brehautso (assoc {:a 1} :b "baz") would still produce a valid Foo
17:38arohnerooh, core.typed conversations
17:38ljosbrehaut: 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:38arohneris (typed/cf (filter even? [1 2 3 4])) supposed to work?
17:38arohnerin 0.1.7
17:40tyler__is there a lib that has static types in it?
17:40tyler__i thought i saw that somewhere
17:40brehautarohner: i read somewhere that filter frex doesnt always get enough type information from the predicate, and you need to ann-form it
17:41arohnerbrehaut: (typed/cf (filter (typed/ann-form even? [Integer -> Boolean]) [1 2 3 4]))
17:41arohnersame error
17:41brehautarohner: the example in the docs mentions identity as the predicate i recall
17:42pbostrommye: what are you trying to do with nrepl.el exactly? Open two sessions, one for Clojure, and one for cljs/piggieback?
17:42arohnerand ann-form is really ugly :-)
17:42brehautyeah
17:42brehautambrosebs is working on improving local inference to limit how often its required i think?
17:42myepbostrom: I'm trying to write a function that toggles between one repl running clojure, and one running clojurescript
17:43pbostromin elisp? sorry, can't help there
17:43ljostyler__: core.typed is the static types library.
17:43tyler__ljos: thanks
17:44myeyes elisp
17:45brehautarohner: http://clojure-doc.org/articles/ecosystem/core_typed/limitations.html has a section on "using 'filter"
17:46brehautarohner: the ann-form notation looks like it uses the :filters stuff for occurance typing. youch
17:47brehautarohner: the :filters docs are http://clojure-doc.org/articles/ecosystem/core_typed/filters.html
17:47arohnerbrehaut: thank you!
17:47arohnerdidn't know those were doc'd yet
17:47brehautarohner: no problem
17:48brehautarohner: the docs are a decent start, but i still ran into a huge swath of stuff i had to bug ambrosebs about
17:55jcromartieis there any "one true way" of designing a stateful repository of objects in clojure
17:55jcromartielike
17:55jcromartieI 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:56jcromartieI don't see a need to use a hash table just to act as an index on an ID/primary key
17:56jcromartiedo I design the API around the reference that holds the state?
17:57jcromartieor around the state value itself
17:57jcromartielike, do I do the swap! or dosync/alter inside my API?
17:57jcromartieI guess I answered that question for myself because that would mean that you need to know implementation details
17:57brehautjcromartie: gfredericks will tell you something about simple and easy any moment now.
17:58jcromartie:)
18:00brehautjcromartie: 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:00jcromartieyeah
18:01jcromartieRuby on Rails appeared 9 years after Ruby
18:01jcromartieI wonder how long before people figure out how to write systems in Clojure :)
18:01jcromartieseems like it's starting to gel
18:01jcromartieI want to see this talk http://lanyrd.com/2013/clojurewest/sccgkd/
18:01jcromartiekind of sounds like exactly what I am looking for
18:06sundbphi. 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:06sundbp(the instantiation of the right backend based on config that is)
18:17tyler__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:18dnolen_,(zipmap [:id :name] [112231 "foo"])
18:18clojurebot{:name "foo", :id 112231}
18:18dnolen_tyler__: ^
18:18tyler__dnolen_: thnx
18:19tyler__thats awesome
18:20tyler__super helpful for datomic queries
18:21frozenlockWow that was fast... http://dev.clojure.org/jira/browse/CLJ-1182
18:22tyler__e.g. (for [e (q '[:find ?e ?age :where [?e :person/age ?age]] (db conn))] (zipmap [:id :age] e))
18:23supersymfrozenlock: nice
18:25patchworkHow do I exclude files from lein jar?
18:25patchworkexclude resources that is
18:29brehautbbloom: 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:31bbloombrehaut: hmm interesting thought.... however, wouldn't it be the case that additional methods could only ever broaden the type, not ever narrow it?
18:31bbloomeg if all seen methods return a number, but some other random method returns a string, then the type broadens from number to object
18:31brehautbbloom: that does sound true
18:31tyler__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:32bbloomso then you'd correctly get a type error if you assumed you had a number... right?
18:32bbloombrehaut: yeah, you're right, that could be problematic....
18:33bbloom*shrug* types are over my head :-P
18:33brehautbbloom: mine too :)
18:34bbloombrehaut: 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:34bbloombrehaut: so you have linear code execution during initialization, and meta programming is interleaved with normal execution
18:35bbloombrehaut: 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:36tyler__so what you're saying is (> clojure haskell)
18:37brehauttyler__: not at all. (not= clojure haskell)
18:37tyler__(and (not= clojure haskell) (> clojure haskell))
18:37RaynesNice.
18:38mattmoss$findfn 3 4
18:38lazybot[clojure.core/unchecked-inc-int clojure.core/unchecked-inc clojure.core/inc clojure.core/inc']
18:38brehautbbloom: 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:39brehautbbloom: not to mention the types for methods are always bounded by interface / superclass
18:39bbloombrehaut: what gives you the impression that .net is more static than the JVM? my understanding is that the opposite is true
18:39bbloombrehaut: http://msdn.microsoft.com/en-us/library/dd233052.aspx
18:40technomancybbloom: rich told me the CLR does a lot more of its optimization up-front vs during runtime
18:40tickinghrm are (non-xml) zippers actually used by anything ^^?
18:40technomancypart of why he gave up onit
18:41bbloomtechnomancy: that's a statement about the profiler-driven JIT
18:41brehautbbloom: 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:41technomancybbloom: well, the up-front optimizations were largely type-driven, he said
18:41technomancythe more knowledge you can derive through static analysis, the more you can do up-front
18:42bbloomtechnomancy: yeah, but that doesn't mean that the runtime is "more static" it just means that it's optimized primarily by static information
18:42bbloombrehaut: technomancy: for example, with the CLR you can replace running instances when you redefine a type, if that instance uses a binding proxy
18:42technomancysure, but it's not like "more static" has a rigorous definition to begin with =)
18:42bbloomit's total black voodoo, but the debugger does that
18:43bbloomi think the CLR is more flexible than the JVM, but optimized mostly for C# rather than for, say, Clojure
18:43bbloomJava has less type info than C#, thanks to type eraser, so profiling-driven specialization is necessary
18:44bbloomwhere as C# can specialize via type hints during compilation
18:44technomancyyeah, IIRC rich was mostly complaining about the performance of the JIT
18:44bbloomyup
18:44bbloomthe CLR's JIT is less sophisticated because C# is more sophisticated
18:44bbloomand C# is more important for MSFT
18:44technomancythe curse of real generics
18:45brehautalso, a lot of .net is heavily organised around making desktop code fast
18:45brehautwhich favours doing your optimizations once, up front
18:45technomancywhich sun/oracle has shown a fanatical disinterest in
18:46bbloombrehaut: yes. process startup time & "first frame" speed is critical
18:46brehautsee also: GAC
18:46bbloomi have nothing nice to say about the GAC.
18:46brehautbbloom: im pretty sure thats a good indicator that you have worked as a .net dev at some point
18:47bbloomworse: i worked as a dev on .net ;-)
18:47brehauthaha
18:47bbloomvisual studio integration for C# & xbox, more specifically
18:48bbloomanyway, 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:49bbloombut 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:49bbloomin theory the DLR was supposed to fix that
18:49bbloomdunno much about the DLR other than what it promised, haven't worked with it for real
18:50bbloomi left C# just before v4, which added the "dynamic" keyword
18:50brehautbbloom: its entirely possible (probable?) that my perspective is colored by the culture of microsoft and the companies that use their tools.
18:52bbloombrehaut: 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:52brehautbbloom: indeed.
18:52bbloomC# is a massive gateway drug for functional programming
18:53brehautbbloom: 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:53jtoycan 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:53bbloombrehaut: shhhh don't tell anyone that MSR makes up the primary contributors to GHC
18:53brehautbbloom: :)
18:54brehautbbloom: not to mention the money they pour into research around the world
18:54amalloyjtoy: you told it to parse a string, and you gave it a list of stinrgs
19:00akhudekthe saddest thing about Microsoft is that their research divisions do all sorts of cool things that never seem to end up in products
19:00jtoyamalloy: 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:01kaoDakhudek: you mena, like Kinect ?
19:01kaoD*mean
19:01kaoDa R&D department is bound to ditch 99% of their good ideas
19:01kaoDcool != economically viable
19:01akhudekthere are a few recent examples where they are finally bringing some things to market
19:02brehautakhudek: like linq or Rx?
19:02jtoyamalloy: I just tried this: (filter #(= (cheshire.core/parse-string %) "m" ) (line-seq rdr)) and I get (java.io.IOException: Stream closed
19:02jtoyamalloy: am I still doing it wrong?
19:03akhudekbrehaut: also good examples. Things do seem better in the last 5 years or so.
19:08brehautakhudek: 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:09brehautakhudek: i think the Haskell → F# → C# pipeline of refinement* helps them a lot (* refinement partly means 'mainstreaming')
19:10akhudekbrehaut: 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:10brehautFWIW F# is at least the third project to get a ML family language running on .net
19:10akhudekmaybe they are isolated incedents though
19:10bytechunkynoob macro question: say I call a macro somewhere (deep) inside of a function. Can this macro manipulate the entire function? (it cant, right?)
19:10akhudekthis was pre .NET days too
19:10ubun22anyone knows the issue: https://github.com/Kodowa/Light-Table-Playground/issues/376
19:11akhudekso it's entirely possible things have changed a lot since then
19:12brehautakhudek: well, erik meijer is one of the main C# people these days, so i would say yes
19:13amalloybytechunky: correct, it canot
19:14amalloyie, 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:15bytechunkywhat if I want to manipulate (some of) my functions but dont want to put top-level-macros all over?
19:15bytechunkyis there some way to write a compiler plugin?
19:15jtoy?
19:16amalloya macro *is* a compiler plugin
19:16amalloyjust wrap your entire namespace in one (my-crazy-language ...) macro, and do whatever manipulations you want there
19:16amalloy(is an example of one reasonable approach you could take)
19:17bytechunkyamalloy: like (my-crazy-language (ns foo ...) (defn bar ....) (defn baz ...)) ?
19:18amalloywell, you can't put stuff before ns
19:18bytechunkyah ook
19:18amalloybut after that, sure
19:19bytechunkywell, thank you
19:39cmeiklejohnI 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:40cmeiklejohnI'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:40cmeiklejohnCould not find artifact lein-cljsbuild:lein-cljsbuild:jar:0.3.0 in central (http://repo1.maven.org/maven2)
19:40cmeiklejohnI must be doing something stupid
19:40cmeiklejohnThoughts?
19:42technomancycmeiklejohn: is it checking clojars?
19:42technomancythat message just says it can't find it in Central, which it shouldn't
19:42cmeiklejohnderpoh wait
19:42cmeiklejohnyea
19:42cmeiklejohni guess the success and errors together confused me
19:42cmeiklejohnCould not find artifact lein-cljsbuild:lein-cljsbuild:pom:0.3.0 in central (http://repo1.maven.org/maven2)
19:42cmeiklejohnRetrieving lein-cljsbuild/lein-cljsbuild/0.3.0/lein-cljsbuild-0.3.0.pom (2k)
19:42cmeiklejohn from https://clojars.org/repo/
19:42cmeiklejohnCould not find artifact lein-cljsbuild:lein-cljsbuild:jar:0.3.0 in central (http://repo1.maven.org/maven2)
19:42cmeiklejohnRetrieving lein-cljsbuild/lein-cljsbuild/0.3.0/lein-cljsbuild-0.3.0.jar (9k)
19:42cmeiklejohn from https://clojars.org/repo/
19:43Raynesmraow
20:26ambrosebsarohner: 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:27ambrosebsarohner: Actually, use ARef for now
20:27arohnerambrosebs: thanks. I figured that out later
20:27arohnerbut still ended up w/ some problems about polymorphic type, even after passing two args
20:27ambrosebsarohner: cool
20:27arohnersorry that code was on another branch that's difficult to repro at the moment
20:28ambrosebsok
20:28arohnermy code was (ref #{"foo" "bar"}), and the type I tried was (ARef (IPersistentSet String) (IPersistentSet String))
20:29arohnerthe checker was happy with that, but blew up at (dosync (set/union @ref1 @ref2))
20:29ambrosebsah I've never tried to check a dosync :)
20:29bttfi just pulled a clj project ... in the project.clj file, theres a :cljsbuild target but lein-cljsbuild is not in the dependencies
20:29bttfis it just me or does that not make any sense?
20:30bttfmind you, i'm working with a clean machine with no plugins installed ..
20:31arohnerambrosebs: 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:32ambrosebsarohner: ok, trying it out
20:32technomancybttf: yeah, it should be in :plugins. Leiningen won't do anything with :cljsbuild if that plugin isn't present.
20:32technomancyprobably a misconfigured project
20:34bttfis it possible they have a personal clojure package in the clojure repos that contains all the plugins that would be needed
20:35technomancybttf: they could have lein-cljsbuild declared in user-level plugins instead of in the project
20:35technomancy(which is wrong, but it would still work for them)
20:35ambrosebsarohner: which version are you using?
20:35arohner0.1.7
20:36technomancyhttp://p.hagelb.org/marty.gif
20:36technomancy(apropos of nothing but seeing the string "bttf")
20:37bttfexactly my reaction
20:38technomancythese 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:39technomancyhttp://btothef.tumblr.com/
20:40ambrosebsarohner: it's probably fixed in master. It's a bit more lenient with the polymorphic arguments error.
20:40bttfhaha never heard that one
20:40bttfbut i have seen that blog
20:40arohnerambrosebs: k, thanks. I'll bug you again if it isn't :-)
20:43DaReaper5Hi, I need to zip a bunch of xls files. Is there a good clojure lib for this or should i use java?
20:43ambrosebsarohner: works fine for me (ignoring set/union) after adding the following annotations https://www.refheap.com/paste/12470
20:45ambrosebsarohner: an entire ns could be a stretch ;) can't we just be happy with a quarter?
20:46ambrosebsarohner: but seriously, there are some outstanding issues. eg. core.typed cant' check doseq and for.
20:46arohner:-)
20:46ambrosebsarohner: so let me know what you come up against.
20:46arohnerk
20:46arohner(filter even? [1 2 3 4]) was a problem earlier
20:47DaReaper5Hi, I need to zip a bunch of xls files. Is there a good clojure lib for this or should i use java?
20:47ambrosebsarohner: yea that's a weird error :/
20:49brehautarohner: 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:51DaReaper5would java.util.zip be the best way to create a zip file in clojure?
20:52joegalloDaReaper5: it's a perfectly fine way, yes
20:52DaReaper5joegallo thanks
20:54tyler__the source for source is `(println (or (source-fn '~n) (str "Source not found")))
20:54tyler__where is source-fn defined?
20:55brehaut,(find-doc "source-fn")
20:55clojurebot-------------------------\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:55brehauttyler__: ^ clojure.repl
20:55joegalloDaReaper5: 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:59tyler__brehaut: thnx
21:01brehauttheres a rotated ampersand character‽ (⅋) now i want to use it for destructuring that has the rest args come first
21:04ambrosebsarohner: just pushed a fix for (filter even? [1 2 3 4])
21:04DaReaper5joegallo thanks, but hopfully i wont need those advanced features :)
21:04joegalloagreed, and you're welcome
21:13ambrosebsljos: arohner: on master core.typed we have (cf {}) ;=> [(CompleteHMap {}) {:then tt, :else ff}]
21:13ambrosebsljos: arohner: it allows us to have sound subtyping with IPersistentMap
21:14ambrosebs(CompleteHMap ..) has the subtyping you'd expect, but (PartialHMap ..) is subtype to (IPM Any Any)
21:14ambrosebsljos: arohner: atm there's no type syntax to introduce these.
21:15arohnerambrosebs: cool! I'll look into that
21:15ambrosebsalso brehaut ^^
21:19tyler__oh woah i didn't realize namespaces were part of clojure.core for keywords
21:20tyler__i thought that was just a datomic convention
21:21frozenlockMaking the switch from noir to compojure in one of my projects.... is there something similar to the old noi.option/dev-mode? ?
21:39technomancyfrozenlock: usually you'd check for a config value using carica or environ
21:58frozenlocktechnomancy: this? https://github.com/weavejester/environ
22:00jcromartiewhat is the difference between (:require [foo :refer :all]) and (:use foo)
22:00cgagnothing i'm pretty sure, i think using :use is frowned upon/depracated
22:01jcromartieit seems frowned upon, but I don't see anything about it being deprecated
22:01jcromartiebut yeah, makes sense to keep it simple
22:02frozenlockI don't really like :refer :all either. Makes thing a little harder to find.
22:03metajackDoes 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:04brehautmetajack: i'd speculate that that should just work if you give a range selector
22:04brehautmetajack: a range selector being {from to}
22:05metajackI was just looking that up.
22:05jameshasselmanQuick 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:14metajack brehaut: clone-for seems to choke if it gets more than one node as input:
22:14metajackuser=> (at src {[[:li first-child]] [[:li last-child]]} (clone-for [x [1 2 3]] (content (str x))))
22:14metajackIllegalArgumentException Key must be integer clojure.lang.APersistentVector.assoc (APersistentVector.java:316)
22:14brehauthuh. well there you go then
22:14brehautthat seems like a bug to me
22:14metajacki suppose i could have a clone-for on first child and then nil on the last n
22:15metajackit 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:15brehautmetajack: i'd just use a replace with a snippet mapped over the seq
22:15metajackmy mockups generally have more than one row of dummy data ;)
22:16brehautlikewise. i also prefer complex template bits to be packaged out as their own functions rather htan having a big honkin clone-for inline
22:16brehautbut i still think its a bug
22:16metajackKind of sucks to make a snippet for every place I need a list though. But better than these range contortions.
22:17metajackI'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:17brehautaha
22:17brehauthit up cgrand on the enlive mailing list?
22:17metajackI'll do that.
22:27jordan|sshjameshasselman: i'm totally new to clojure, but it's my impression that more is essentially re-bound in the loop bindings
22:29technomancyjcromartie: the intent is to move away from use in order to streamline the ns macro
22:29jcromartieexactly
22:29jcromartiemakes a lot of sense
22:32jameshasselmanjordan|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:36akhudekjameshasselman: initially, the value of x is bound to min
22:37akhudekwhen recur calls, the first arguement is bound to min for the next iteration, and the second argument is bound to more
22:37jameshasselmanOh, okay! Thanks, that makes a lot of sense!
22:43jameshasselmanAh, 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:46akhudekright!
23:12tenpaiyomiDon'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:12technomancytenpaiyomi: sure: https://github.com/technomancy/leiningen/wiki/Faster
23:13technomancytenpaiyomi: help is the pathological case though; it has to load every single task across all plugins.
23:13tenpaiyomitechnomancy: Thanks, looking at it now
23:14tenpaiyomitechnomancy: 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:14technomancyyeah that's nuts
23:49TheBusbytechnomancy: any trick with leiningen for travis-ci to include jsr166y for Java 1.6 but not 1.7?
23:57arrdemdoes anyone have a CL (loop) implemetation for clojure?