#clojure logs

2014-10-17

00:02TEttinger,`('~list 1 2 3)
00:02clojurebot((quote #<clojure.lang.PersistentList$1@3d6600>) 1 2 3)
00:02tbaldridge,(eval `(~'list 1 2 3))
00:02clojurebot(1 2 3)
00:02TEttingerwe have eval in clojurebot too!
00:02TEttingerwow
00:03TEttinger(inc tbaldridge)
00:03lazybot⇒ 11
00:03tbaldridgehrm....
00:03TEttingerthe ~ and ' are reversed
00:03tbaldridge,(clojure.java.shell/sh "rm -rf /")
00:03clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.java.shell>
00:03tbaldridge,(eval '(clojure.java.shell/sh "rm -rf /"))
00:03clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.java.shell>
00:03tbaldridgewell that's good at least...
00:03TEttingertbaldridge: there's a sandbox anyway
00:03TEttinger,(File. "/")
00:03clojurebot#<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: File, compiling:(NO_SOURCE_PATH:0:0)>
00:04amalloyright, TEttinger. ~'list evaluates to the symbol list, whereas '~ evaluates to a quoting of the function list
00:04TEttinger,(java.util.File. "/")
00:04clojurebot#<CompilerException java.lang.ClassNotFoundException: java.util.File, compiling:(NO_SOURCE_PATH:0:0)>
00:04TEttinger,(java.io.File. "/")
00:04clojurebot#<File />
00:04TEttingerhuh
00:04rntz^2amalloy: right, and quoting the function list is what I was trying to do
00:04amalloyTEttinger: there's nothing wrong with *making* a File object; clojurebot just doesn't let you do anything with it
00:04amalloyno it's not, rntz^2
00:04rntz^2,(eval `('~list 1 2 3))
00:04clojurebot#<ExceptionInInitializerError java.lang.ExceptionInInitializerError>
00:05rntz^2amalloy: no, trust me, it absolutely is.
00:05amalloyi mean, i guess there's no law against trying to do things which are bad
00:05rntz^2the code in question is actually passed in a function, it's not using list specifically.
00:05rntz^2I'm writing a... rather strange implementation of quasiquote
00:06rntz^2and it uses this, and it works in scheme, but because of this it doesn't quite work in clojure
00:06amalloyyou cannot embed arbitrary objects (including functions) into the middle of code and have them evaluate to something meaningful
00:06rntz^2well. maybe. but it does work for functions other than list. in fact, the problem seems to have something to do with the fact that list is not exactly a function.
00:07TEttingeris list a macro?
00:07amalloyit works, more or less by coincidence, for functions which are not closures
00:07amalloylist is a weird special case, i agree
00:07rntz^2oh, interesting.
00:08amalloyTEttinger: list has no clojure source code; it's defined in PersistentList.java or somewhere like that
00:08rntz^2huh, it fails for closures. weird
00:08rntz^2,(let [x 0] (eval `'~(fn [] x)))
00:08clojurebot#<ExceptionInInitializerError java.lang.ExceptionInInitializerError>
00:08amalloyrntz^2: anything you couldn't type in, you should not embed in code
00:09rntz^2look, I'm not here to get lectured at. you can just tell me it doesn't work and be on your way :P.
00:09amalloyi have been, and yet here you are
00:15tbaldridge~gentlemen
00:15clojurebotYou can't fight in here. This is the war room.
00:17TEttingerclojurebot: gentleman |is| not as good as Gangnam Style.
00:17clojurebotIk begrijp
00:18kenrestivogentlemen is http://www.youtube.com/watch?v=_oD3pbOBP50
00:25ddellacostawoah, that is kickass
00:38razum2umdoes anyone know why "clojure"? is it changed "closure" (but why?) or anything else?
00:42ivanrazum2um: http://groups.google.com/group/clojure/msg/766b75baa7987850
02:08andyf,*clojure-version*
02:08clojurebot{:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}
02:08andyf,(apropos “replace")
02:08clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
02:09andyf,(apropos “str”)
02:09clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: “str” in this context, compiling:(NO_SOURCE_PATH:0:0)>
02:11dysfun_have there been any experimental reader replacements for clojure, out of interest?
02:12TEttingersmart quotes, andyf
02:12TEttinger,(apropos "replace")
02:12clojurebot(clojure.core/replace clojure.string/re-quote-replacement clojure.string/replace clojure.string/replace-first)
02:12andyfHuh, didn’t know I was producing smart quotes. Thx.
02:13TEttingernp
02:14andyfAnyone know how to disable Colloquy client on Mac OS X from generating smart quotes?
02:15TEttingerit may be a mac thing...
02:16andyfFound it via Google, which is what I should have checked first for such a non-Clojurey question
02:16andyf,(apropos "walk")
02:16clojurebot()
02:34andyfdysfun_: I don't know if it woud be categorized as experimental, but the tools.reader contrib library is not identical to the built-in reader
02:35andyfWhat kind of differences from the built-in reader would you consider experimental?
02:50dysfun_andyf: well in particular i was wondering whether someone had just replaced the reader with a parser that compiled down to clojure, but y'know, a real parser, not an AST reader
02:51andyfdysfun_: So that Clojure got a different syntax available for developers?
02:51dysfun_yes
02:52dysfun_syntax is just sugar. i'm wondering how it would play out in practice
02:52dysfun_i mean obviously you lose a lot of the utility of macros if you go non-homoiconic
02:54dysfun_i'm experimenting with a pythonic syntax sugar. the code isn't too horrible
02:54dysfun_well, the pythonic syntax isn't too horrible, i mean
02:55andyfAlmost every lisp dialect has had a "fewer parentheses" alternate syntax proposed for it (often more than once), e.g. a discussion thread from 2009 here: https://mail.google.com/mail/u/0/#search/clojure+alternate+syntax/11fa43cf06119121
02:56andyfI haven't seen one of those go past the stage of a curiosity, though.
02:56dysfun_yes, it's a common thing in lisp communities :)
02:56dysfun_and the historical solutions are interesting
02:57dysfun_fexprs, for example. i think they only really fell out of favour because they played badly with dynamic scoping, which most lisps were using at the time
02:59andyfI don't recall hearing of someone working on Python-y syntax that compiles to Clojure before. There was a project to create an implementation of Clojure that compiled to Python, but that isn't the same thing at all.
03:00dysfun_yes, i saw that
03:00dysfun_i liked his quote: "those who don't understand the work of rich hickey are doomed to repeat it poorly"
03:04dysfun_hrm, i see that <> are not documented as permitted values in symbols. i wonder if there was an idea at some point to use them for new literal syntax? obviously too many libraries do use them already and the auto-generated record functions do
03:06dysfun_i'm not sure what you might use more kinds of brackets to denote
03:08amalloydysfun_: i mean, there's clojure.core/>. it's pretty clear that's intended to be a valid symbol
03:08andyfdysfun_: http://dev.clojure.org/jira/browse/CLJ-1527 may bring the implementation and documentation into closer agreement some day
03:09dysfun_:)
03:18dysfun_i can't think of a reasonable use for <> anyway. And we could still have #<>
03:20andyfdysfun_: Not sure I understand: do you mean that you think < and > should be renamed in core?
03:21andyfdysfun_: Oh, you mean what a new set of 'brackets' could be used to mean in Clojure, the way that {} [] () and #{} are defined now for collections
03:21dysfun_yes
03:22hyPiRionPerhaps sensible to use #[] before we get to <>. And we already got #<> so
03:27dysfun_what's #<> ?
03:27dysfun_,(class #<>)
03:27clojurebot#<RuntimeException java.lang.RuntimeException: Unreadable form>
03:27rpaulowhen's 1.7.0 coming out?
03:28hyPiRiondysfun_: unreadable forms, like ##(Object.)
03:28lazybot⇒ #<Object java.lang.Object@1c25dc5f>
03:29dysfun_hrm
04:24hellofunkdoes anyone know how on Ring to use this fix that normally involves an .htaccess file? http://wpvkp.com/font-awesome-doesnt-display-in-firefox-maxcdn/
04:25dysfun_you can do that with a middleware
04:26dysfun_there may even be a general purpose middleware that can do it already
04:26clojurebotGabh mo leithscéal?
04:39clgvhellofunk: yeah you can definitely implement setting of that header data as ring middleware and maybe there is already one for similar tasks
04:42inad922Hi
04:42inad922How do you parse and format dates in clojure?
04:43ssiderisinad922: https://github.com/clj-time/clj-time
04:43inad922ssideris: Thanks
04:43ssideristhis is a pretty popular wrapper of Joda time
04:43xsynwhat's the syntax for using an anonymous function with multiple arguements in a thread ?
04:44clgvxsyn: what?
04:44xsyner...
04:44inad922Joda time?
04:44inad922What is that?
04:45xsynclgv: I'm trying to filter a dataset
04:45clgvinad922: just have a look at clj-time ;)
04:45clgvxsyn: can you give an example to the above question? I really do not understand what you want exactly
04:45inad922k :)
04:46inad922Is there like a package repository for clojure? I come from python and I look for something like Pypi.
04:46inad922leiningen is like pip I guess
04:47xsyn(defn getuser [user] (-> data (filter (= (nth (split data ", ") 11) user)))
04:47xsynis kinda what I want to do
04:47algernoninad922: clojars
04:47inad922algernon: Thanks
04:50inad922Can you suggest a good book/tutorial on clojure? I prefer something where I have to create a working application.
04:51dysfun_Clojure in action has a lot of examples you can type out. Although it's quite outdated now.
04:52dysfun_I think TJOC is probably the best book, but it's not really that style of book
04:53dysfun_is there a way to get at the typing information of some code without executing and instrumenting it?
04:54dysfun_what types clojure thinks it might contain, i mean
04:54dysfun_that's a really bad explanation. i would like to be able to ask clojure what it thinks the type of an expression is
04:56dysfun_i appreciate in a lot of cases it's going to come back java.lang.Object
04:57hyPiRiondysfun_: If you use core.typed, you can use holes.
04:58dysfun_hrm, that's an idea
04:58hyPiRionThat's for definitions only though. If you want to go into expressions like (+ 1 2), then I guess tools.analyzer could probably do some inference?
04:59SagiCZ1dysfun_: i really hated TJOC, Clojure Programming is way better IMO
05:00SagiCZ1maybe i just read it with athe wrong level of prior understanding
05:01dysfun_perhaps. i read it after many years of using other lisps
05:02dysfun_but i think language design is really interesting, and they helped to build up a better picture of the reasons why clojure is designed in given ways
05:03hellofunkdoes anyone know why the second Om/build only displays if I remove the first om/build in this snippet: https://www.refheap.com/91883
05:10clgvxsyn: and you want to have the `filter` expression parallelized?
05:10clgvxsyn: or run a get-user invocation in a different thread?
05:13xsynthe way I understand the thread macro is that it will work on the first thing that you are threading (in this case data), my question is if I have another variable that I want to look at (say in this case I want to look up a user) how to I pass that arguement into the thread macro.
05:13xsynthat's the question really
05:14clgvxsyn: ah you are talking about the threading macros.
05:15clgvxsyn: if `data` is a collection and I interpret your code right, you just need to use `->>` instead of `->`
05:15clgvxsyn: though there is no real advantag to use threading for a single form
05:16clgvxsyn: ah no, sorry there is another error. so what is `data` and `user`?
05:16xsyndata is a coll
05:17xsynand user is a string
05:17xsyncollection*
05:17xsynwhat's the difference between -> and -->
05:18xsynerr ->>
05:18dysfun_-> threads to second place, ->> to last place
05:22clgvxsyn: so you actually want (defn getuser [user] (filter #(= (nth (split % ", ") 11) user) data)) ?
05:23clgvxsyn: in this case you should have tried to get a working `filter` expression first and then introduce threading macros in case you need to apply seq functions on the result
05:31dysfun_i can't seem to find the source for in-ns
05:32xsynjust found the macro-expand function which has helped a lot
05:32xsynthanks guys
05:35xsyncool, working like I want it to.
05:36xsynthank you
05:43dysfun_macroexpand-1 is useful too where you want to not expand everything
06:21clgv,(macroexpand '(let [a 1] (-> 1 inc (* 2)))
06:21clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
06:21clgv,(macroexpand '(let [a 1] (-> 1 inc (* 2))))
06:21clojurebot(let* [a 1] (-> 1 inc (* 2)))
06:21clgvdysfun_: ^^ ;)
06:56szymanowskiHi, is there a way of reimplement "invoke" on vectors and/or lists?
06:56clgvszymanowski: with which gal?
06:57clgv*goal
06:57szymanowskitreat them as functions that do what i want
06:57clgvszymanowski: which is?
06:58clgvszymanowski: why not just write a function that does what you want with a vector?
06:58szymanowskifor exemple apply all the fns they contain on the argument
06:59clgvszymanowski: that's to specific to be part of some vector implementation. just write a function that does that
07:00szymanowskiyes i could do like this but it seems more handy to just treat them as functions when i want
07:00szymanowskiin a particular namespace it should be handy
07:00clgv,((apply juxt [inc dec #(+ % 10)]) 0)
07:00clojurebot[1 -1 10]
07:01szymanowskiyes i know i can do that
07:01szymanowskibut... it seems great to me to be able to reimplement invoke
07:01szymanowskithank you
07:02clgvszymanowski: but you are conflicting with a general clojure principle here. you dont want to treat vectors as simple data anymore but you want to build some kind of special object that does application specific stuff. I guess this is the approach you'd choose in OOP
07:02szymanowskiyes you're probably right, i'm new to FP
07:03clgvszymanowski: honestly, I really do not see the advantage over a once defined function
07:04szymanowskiin the program i'm writing every type is also an invokable, so much of the mecanics lay on that fact
07:05szymanowskiand i have to create custom type that behave exactely like vecs or lists with just the invoke impl changed
07:05szymanowskiit's quite inelegant
07:05szymanowskiin my opinion
07:08dysfun_then you probably don't want this
07:16szymanowskiok thank you
07:54dysfun_are there any useful symbols that are reserved that could be abused as reader syntax?
07:54dysfun_preferably ones that aren't likely to be used
07:57clgvszymanowski: you know that you can use `partial` to combine a function and a vector to pass them into the context where you need the "invokables"
08:02szymanowskiyes i know partial, it seems like a way, i will try
08:48cYmen_, [a b]
08:48clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)>
08:51TEttinger,[1 2]
08:51clojurebot[1 2]
08:52clgv,'[a b]
08:52clojurebot[a b]
08:53clgv,(mapv type '[a b])
08:53clojurebot[clojure.lang.Symbol clojure.lang.Symbol]
08:53clgvteaching by example ;)
08:55clgvthe combination ":(" should be mandatory for exceptions and every editor/ide should render it as smiley. Then Clojure would communicate that it is sad about Exceptions ... :D
08:56TEttinger;( for NPEs
08:58TimMcGruh, `lein release` with :deploy-via :clojars tries to use Clojars' disabled SCP endpoint.
08:59TimMcDo I need to say {:deploy-via :shell, :shell ["lein" "deploy" "clojars"]} or something?
09:00clgvTEttinger: hehe yes
09:01TEttingerTimMc: what version of lein?
09:01TimMc2.4.2
09:02clgvTimMc: oh. do you have a working setup for "lein release" with version increment and such? (except from deploy)
09:02TimMcyeah
09:02clgvavailable on github?
09:02TimMcLooks like :shell works, it's just silly.
09:03TimMcclgv: Well, no -- my .lein/credentials.clj.gpg is not public. :-)
09:03clgvI didn't upgrade my projects to "lein release" yet. I only use "lein deploy" after everything is built
09:03clgvTimMc: doesn't matter I am only interested in project.clj ;)
09:03TimMcclgv: Don't you have to roll back to the tagged commit before deploy, then?
09:04TimMcI just accidentally lein deploy'd a SNAPSHOT because I failed to do that.
09:04clgvTimMc: I didnt use leiningen for anything git related so far
09:04TimMcOh, misread.
09:04CookedGryphonthe lein release stuff needs more sanity checking
09:05clgvTimMc: I usually do "lein do clean, install" followed by "lein deploy clojars" on success ;)
09:05TimMc`lein release` is a little annoying. It's opinionated about various things that it oughtn't.
09:05CookedGryphonfor example if you do a lein release, then half way through it realises you haven't yet set your GPG key, you have half a release and commits floating around and have to revert things manually
09:05clgvoh
09:05TimMcyeah
09:06clgvdoes it offer hooks to customize like for the rest of leiningen?
09:06TimMcNot really.
09:06CookedGryphonare you sure? I thought you could customise every step
09:07CookedGryphonjust set the release process to include some code in a plugin?
09:08CookedGryphonMy main annoyance is that I can't decide to release say 0.1.8-SNAPSHOT as 0.2.0 if I decide the snapshot warrants a major version change. Obviously for libraries these changes should happen along with the changes that cause them to add features/break compatibility or whatever
09:08CookedGryphonbut I'm developing an application, and want to release versions when I decide it's got enough new features
09:09TimMcclgv: https://github.com/timmc/handy/blob/master/project.clj
09:10TimMcCookedGryphon: I bump the version as soon as I make a minor or major change -- right on the branch, or even in the same commit.
09:10TimMcI think it's a good habit to get into.
09:12CookedGryphonTimMc: Yeah, as I said, that's a perfectly good workflow for libraries
09:12CookedGryphonbut I'm releasing an application so can't really say ahead of time what constitutes a version change
09:12CookedGryphonas it's not as simple as "does this break back compatibility" because there's no such thing
09:12TimMcJesus, what's wrong with my reading comprehension recently. :-/
09:13TimMcI blame lack of sleep.
09:13CookedGryphon:P
09:16stainCookedGryphon: if you use something like Artifactory as your Maven repository, then you can deploy to a staging repository and then do a click in the web interface to make it live once finished. Simiarly you can do the git work on a different staging repository that you push yourself from afterwards.
09:16staina bit more heavyweight Java enterprise style than the Clojure leiningen clojars approach though..
09:17TimMcAnyway, I just pushed an addition to org.timmc/handy -- tabular-delta, a more reliable way of writing midje tabular tests when you're only perturbing things from a working baseline. https://github.com/timmc/handy/blob/master/src/org/timmc/handy.clj#L158
09:18CookedGryphonstain: I use github releases for deployment of an intermediate, then the exact same package gets promoted to beta testing, and if it's all good the same package gets pushed out as a release
09:18CookedGryphonas a result I have a version scheme of <marketing-hoo-ha>.<user-visible-version>.<candidate-build>
09:19CookedGryphonwhere a candidate build is not a snapshot, but something I've prodded to say, there's a good number of features, this is a candidate for putting out to people to try
09:21CookedGryphonand actually, if I skip past version 0 and don't show the candidate-build number to the user, this works quite well
09:21stainCookedGryphon: yeah, that sounds good enough.. not quite semantic versioning, but close enough
09:39clgvTimMc: thx
09:40clgvTimMc: "lein release" switches to non snapshot, builds and deploys the project and then increments the last position in the version number?
09:48CookedGryphonthat's right, lein release :minor does the same but increments the minor version number and resets the :patch nmumber
09:48CookedGryphonand :major does the obvious
10:09m1dnightis there an updated document about the low-level workings of refs in clojure? Atm I have this one, which is kind of old (5 years): http://java.ociweb.com/mark/stm/article.html
10:12Bronsam1dnight: the STM hasn't changed in a long time
10:15m1dnightoh okay :) thanks
10:15m1dnightthey mentioned in the article that big changes were underway, so I though I could ask
10:21Bronsam1dnight: there have been only 2 non-cleanup commits since August 2009
10:24Duke-_is there any reason for the 'gres' local in condp source? it doesn't seem to be used https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6071
10:27AshtonKemMornin.
10:28BronsaDuke-_: looks like a leftover
10:29arrdemagreed leftover.
10:32AshtonKemAh, this web client won't do.
10:32AshtonKemShame.
10:32ToxicFrogWhy not?
10:33AshtonKemon an iPhone.
10:33AshtonKemSo it loses its connection the moment I go to another app.
10:33AshtonKemI was hoping to get irc on here without signing up for another account on a random irc service for iOS
10:38edwAnyone happen to recall the Mac Homebrew IRC channel? Last time I went to #homebrew I learned a lot about beer nerds.
10:42edwIt's #machomebrew, btw.
10:43winklol
10:49m1dnightnot to be rude, but why is there so little java doc in the java code for clojure?
10:49m1dnightlike, summaries for a method or something
10:50arrdemofficially most of the Clojure Java code is "implementation details" which will never be documented.
10:50arrdemI think IFn and ISeq are the only things that are officially not imp'l details.
10:50Bronsathere's also a public API since 1.5 or 1.6
10:50clgvCookedGryphon: ah good there is an option :D
10:51Bronsaclojure.java.api.Clojure
10:53clgvm1dnight: follow up question: why are there almost no comments in Clojure's implementation?
10:54stuartsierrahttp://clojure.github.io/clojure/javadoc/
10:54arrdemclgv: I'll bite :D
10:54clgvarrdem: please, don't bite me!
10:55arrdemI've got some self-documenting verilog over here if anyone believes that's a thing...
10:56clgvwhat is verilog?
10:57arrdem$google verilog
10:57lazybot[Verilog - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Verilog
10:58clgvmuhaha
10:59the-kennyAnyone using core.match in core.async's go-blocks with ClojureScript? It seems broken here.
10:59clgvarrdem: my favorite example https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4439
10:59the-kenny(match [:foo] [[:asdf _]] 42 :else 23) returns 42 if used outside of a go block.
10:59the-kennyIf I wrap it in (go ...) it fails with "Uncaught Error: :foo is not ISeqable"
10:59the-kennyehh returns 23 outside of a go-block.
11:00Bronsathe-kenny: I believe it's a known issue that go and match can't work together
11:00Bronsaclgv: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L1011-L1014 this is my favourite
11:00Bronsaclgv: followed closely by https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7918
11:01arrdem(inc Bronsa)
11:01lazybot⇒ 62
11:01clgvBronsa: woah! dummyThis gets actually used later on... X(
11:01arrdemRich 2009. lol.
11:01Bronsaclgv: no it's in a dead code path actually
11:02clgvBronsa: ok, github is not doing this analysis ;)
11:02Bronsahttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7980-L7981 clgv
11:02the-kennyBronsa: aw :( This is bad
11:02Bronsa>if (foo != null) foo == null ? dummy : else
11:02Bronsadummy can never be reached there
11:02the-kennyBronsa: do you know what's the reason? I never heard of that.
11:02clgvright
11:03clgvBronsa: this is intentionally left there so that the clojure compiler doesnt get too fast on modern computers, eh? :P
11:04Bronsaclgv: I doubt that has any performance impact
11:04Bronsathe-kenny: no idea, you might want to ask that question to dnolen_ though
11:05hhutchthe-kenny: http://dev.clojure.org/jira/browse/MATCH-87
11:06the-kennyoh, such an old issue
11:06clgvBronsa: you took that comment too serious ;)
11:06hhutchthe-kenny: right, but this is why http://dev.clojure.org/jira/browse/MATCH-87?focusedCommentId=31926&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-31926
11:08the-kennyheh, yeah :) Knowing this I'll just work around this
11:09Bronsathe-kenny: core.async might get ported to tools.analyzer.js relatively soon and get in par with the clojure impl, that might solve those issues
11:11the-kennyyay!
11:12arrdemidle curiosity, how many people here are using core.match?
11:14hhutchi have in the past
11:14the-kennyI really like it - it makes some kind of code much easier to understand
11:15Bronsaarrdem: http://crossclj.info/ns/org.clojure/core.match/0.2.2/project.clj.html mentions 41 direct usages
11:15Bronsaoh version usage got added, awesome
11:17Bronsaso 1.5.1 seems to be the most used clojure version ATM
11:23puredangeraccording to the clojure survey, it's overwhelmingly 1.6
11:24arrdemI would guess that there's a lot of bias there in GH projects that aren't actively maintained
11:24puredangermany libs depend on a version but when used downstream the app's version is higher
11:25puredanger91% of people claim to be using 1.6 for dev or prod in survey
11:25Bronsacool
11:25Bronsapuredanger: will the raw data be available eventually?
11:25puredangeryes
11:26puredangereventually being early next week
11:26Bronsagreat
11:26puredangerI have a report with some of the things that are easy to report and will flesh that out a bit more and it includes a link to the raw data
11:27puredangerI'm going to leave it open at least for today
11:27puredangergoing through the text responses will take a long time - I haven't even looked at them yet
11:28puredangerif anyone wants to help, would be happy for it
11:29rurumatesince I got not answer from #cascalog, I'll ask this again here ; The cascading javadoc on CoGroup says that pipe order is important for join performance. Cascalog joins are implemented as CoGroups, so, is there a way to control the pipe order in the generated cascading flow?
11:33clgvO_o
11:33puredangerrurumate: I don't know the answer, but I do know from having done a lot with cascalog a few years ago that questions like this are what drove us to ultimately toss cascalog and write our own layer directly to cascading. unfortunately that code is lost in a dead proprietary code base now.
11:36rurumatepuredanger: thanks, I've thought about that too. Cascading seems a bit harder to read than cascalog though
11:37rurumateoh well you wrote a layer on top of it, too bad it's lost
11:38puredangerdefinitely. cascalog is effectively in charge of "planning" how to build your flow, which is great to make it easier to use. but you give up a lot of control if you actually know what you want that to be
11:39rurumatealso it sucks that cascalog uses so many defrecords internally, they should use hash maps instead
11:39rurumateI still like it, but the project seems slow moving now
11:39llasramrurumate: Have you checked out https://github.com/damballa/parkour/ ? </plug>
11:39rurumatenot really no
11:40rurumatellasram: that's not on top of cascading
11:40llasramNope
11:40puredangeror PigPen https://github.com/Netflix/PigPen
11:41puredangeralso not on top of cascading
11:41puredangerbut both of those have more current traction I think
11:41llasramMeh. I can see PigPen being of value for shops which already have significant investment in Pig, but compiling a subset of Clojure to Pig still just seems pretty nuts to me
11:42puredangerindeed but I think it's a pretty nice entry point
11:42puredangerPig is imo really terrible seen through FP eyes
11:42llasrampuredanger: "entry point" in what sense?
11:42puredangerfrom Clojure
11:42CookedGryphonDoes anybody have any suggestions for how to write tests for core.async code which depends on timeouts?
11:43puredangerrurumate: might take a look at pig/cogroup for example
11:43clgvCookedGryphon: that again? ;)
11:44alejandro3CookedGryphon: parameterize the timeout value?
11:44alejandro3what exactly do you want to test?
11:46llasrampuredanger: I... guess? I'm obviously biased, but I think being able to write Hadoop MapReduce jobs, just in Clojure a la Parkour is better
11:48puredangerI have used neither in anger and they both seem to be good projects to me. I could see Pig output being useful in some shops as you said.
11:49justin_smithCookedGryphon: I put together a test for a core.async worker pool thingy that established that verious invarients about the worker pool were consistent with the design. This isn't testing timeouts, but something of this structure may be helpful? https://www.refheap.com/91899
11:50mdrogalisDang, rurumate is gone. I had the answe to his question. :(
11:50mdrogalisanswer*
11:51justin_smith$mail mdrogalis about this cool feature
11:51lazybotMessage saved.
11:51CookedGryphona number of things are supposed to happen according to a timing sequence plus state machine and I want to test that the state machine transitions at the appropriate times and teh appropriate control events come out the other end
11:51mdrogalisjustin_smith: What sorcery is this!
11:52justin_smithCookedGryphon: in my test, which I pasted above, I used atoms over sets, numbers, and vectors to instrument what was happening
11:52CookedGryphonso I sort of want to say "Stop the clock, put this event onto the channel, pretend 50ms have elapsed, put this event on, pretend 300ms have elapsed. What's in the output channel now?"
11:52mdrogalisAnyhow, it's a little involved. But the main point is that joins in Cascading can become *really* slow, and there's not much you can do about it.
11:52mdrogalispuredanger: I saw another shop write a layer ontop of Cascading, too. Common route, unfortunately.
11:53justin_smithCookedGryphon: in that case, maybe you want something you can modularize - either something that fakes timeouts but doesn't take that long, or short enough delays so the test running isn't painfully slow?
11:56literaryWell,
11:56literaryyou see,
11:58literaryNever mind, I figured it out.
11:58justin_smithLIES I never got to see
12:02rwblueI'm curious how Clojure-like notions of immutability could be implemented on a web-scale. If anyone has seen ideas along these lines, I'd like to hear them.
12:03arrdemClojure: no really it's webscale. unlike mongodb.
12:03rwbluearrdem: I'm talking about identity and values as applied to URIs
12:04SagiCZ1how do i import other namespace? (ns this-namespace (:require [other-namespace :refer :all])) should work right?
12:04stuartsierrarwblue: I've heard it brought up in ReST discussions
12:04nkozarwblue: check datomic
12:04rwbluestuartsierra nkoza thanks
12:05arrdemrwblue: interesting. I've seen a bunch of different ideas (git/gittorent/DHTs) but very few actual products (gnunet & bittorent being the exceptions, maybe urbit)
12:06stuartsierrarwblue: I think this also came up in Joe Armstrong's talk at Strange Loop 2014 https://www.youtube.com/watch?v=lKXe3HUG2l4
12:06SagiCZ1any help?
12:06arrdemSagiCZ1: yeah that'll work
12:06rwbluesome discussion here too: https://news.ycombinator.com/item?id=5622209
12:07SagiCZ1arrdem: and will it load namespaces that are required in other-namespace as well<
12:07SagiCZ1?
12:07arrdemSagiCZ1: yes. (ns) is not declarative, it's an imperative statement that forces loading just like (load).
12:07SagiCZ1arrdem: thanks
12:08technomancybut but ... it looks declarative =D
12:08arrdemtechnomancy: quiet you.
12:08arrdemtechnomancy: that ns is not declarative is one of my great bugbears following the Oxcart project
12:08stuartsierraIt is in ClojureScript :P
12:09arrdemstuartsierra: right but ClojureScript isn't Clojure :P
12:09SagiCZ1thats wierd.. i can use functions from other-namespace but no functions from namespaces required by that other-namespace
12:09SagiCZ1unabel to resolve symbol
12:09justin_smithSagiCZ1: you need to qualify them with their namespace
12:09arrdemSagiCZ1: no that's the expected behavior. dependencies are transitive, but aliases are not.
12:09justin_smithSagiCZ1: there is no such thing as recursive use, and even use is terrible
12:10SagiCZ1wait so.. they are "loaded" but not qualified?
12:10stuartsierraSagiCZ1: They are "loaded" but not *referred* into your current namespace.
12:10SagiCZ1i see.. that actually makes perfect sense
12:10stuartsierra`:refer :all` only refers symbols defined *in* the namespace you `require`d
12:11SagiCZ1and what happens when you "set a repl to a namespace" ?
12:12stuartsierraSagiCZ1: As with `in-ns`, that just makes a particular namespace the "current namespace" for that REPL session.
12:12stuartsierraYou can use any symbols defined or referred into the current namespace without qualification.
12:12SagiCZ1and by qualification you mean?
12:13stuartsierraSagiCZ1: namespace-qualification, like `clojure.string/replace`
12:13SagiCZ1i see
12:13SagiCZ1and i can use anything by using its fully qualified name?
12:13arrdemanything loaded, yes
12:13stuartsierraSagiCZ1: Yes, IF it has already been loaded.
12:14justin_smithit isn't good to use transitive dependencies directly - if you use functions from a namespace you should require it explicitly
12:14SagiCZ1stuartsierra: okay
12:14SagiCZ1justin_smith: yes i understand.. it makes sense
12:16justin_smithSagiCZ1: where this stuff becomes important is if you ever edit your code - what if you move a function to a new namespace? What if someone changes how the other namespace is implemented and they don't require the transitive dependency that they used to? too many weird ways for things to break
12:18SagiCZ1yeah taht would be a mess
12:21SagiCZ1have you ever been dissapointed by some part of clojure?
12:21stuartsierraWell that's a loaded question.
12:21justin_smithSagiCZ1: and using (require '[clojure.string :as string]) vs. (require '[clojure.string :refer :all]) means that if you refactor and split up a namespace or move a function, things are much easier
12:22SagiCZ1stuartsierra: i was just wondering.. from my newbie point of view.. it all just seems too good to be true
12:23SagiCZ1justin_smith: i usually avoid using :refer :all for this reason
12:23mdrogalisSagiCZ1: Total illusion. It's just stuartsierra in here. Everyone else is a Clojure IRC bot. :)
12:23justin_smithSagiCZ1: start up time, RAM usage - but for my needs those concerns are minor
12:23justin_smith(long running process on its own server - works great)
12:23AeroNotixI would write more Clojure if the start-up time didn't suck.
12:23SagiCZ1even java itself has a long start up time
12:24stompyjSagiCZ1: the only thing that frustrates me about clojure is it’s growth/acceptance curve
12:24AeroNotixI pretty much relinquished Clojure to server-side stuff.
12:24SagiCZ1stompyj: elaborate?
12:24BronsaI don't find this claim true. my repl starts up in .5 seconds
12:24AeroNotix(which I absolutely love)
12:24AeroNotixBronsa: you mean a crappy repl?
12:24AeroNotixwho cares
12:24AeroNotixBronsa: try doing one which loads an application's worth of code
12:24BronsaAeroNotix: that's not "clojure's startup time" then
12:25AeroNotixBronsa: same difference to people using Clojure for anything other than "a bare repl"
12:25AeroNotixdon't be so obtuse.
12:25SagiCZ1AeroNotix: isnt that something that is bound to improve somewhat in the future?
12:25AeroNotixSagiCZ1: of course
12:25arrdemI get 6.7s for a "bare" Clojure instance of `lein repl`.
12:25AeroNotixand it has been getting better.
12:25AeroNotixarrdem: lein repl isn't a bare repl, to be fair.
12:25stompyjSagiCZ1: The only worry I have is that Scala and Go will outpace it, and it will have a hard time getting wide enough adoption, as that affects ability to hire, cost of devs, ability to sell into companies, etc
12:25Bronsaarrdem: lein repl does *a lot*
12:25arrdemBronsa: sure, but it's also the common case.
12:25MrJones98so i’m completely stumped t this point… using clojure+clojurescript in a web app and came across this issue in cljsbuild https://github.com/emezeske/lein-cljsbuild/issues/303
12:25Bronsaarrdem: sure but lein isn't clojure
12:25arrdemBronsa: I literally never use java -jar clojure.jar clojure.main, so it's disingenuous to say it's the metric here.
12:25MrJones98basically cljs compiler results in stack overflows
12:26BronsaAeroNotix: look, startup time and compilation time are two completely differnt issues
12:26SagiCZ1stompyj: i understand.. but the fact that clojure and java understand each other well you can basically use javas popularity
12:26SagiCZ1stompyj: and i thought that Go is as obscure as clojure is
12:26AeroNotixBronsa: they're inextricably linked
12:26MrJones98i increased my stack to 1g just to make it obscenely large… and now i get a FileNotFoundException during compilation with a too many files open
12:27dnolen_MrJones98: that's not a cljsbuild issue - are you using core.async w/ core.match?
12:27technomancyBronsa: load time is still poor with AOT
12:27MrJones98i’m usring core.async a lot
12:27MrJones98i’m not using core.match mysself
12:27MrJones98but don’t know if some other library might be
12:27MrJones98let me check my deps
12:27technomancyBronsa: so conflating it with compilation time is also disingenuous
12:27AeroNotixSagiCZ1: Go at least as much easier to learn.
12:27dnolen_MrJones98: no it only matters if you use a core.match macro in a go block
12:27AeroNotixand has very familiar syntax to what typical devs know
12:28dnolen_MrJones98: however if you're are mixing very complex macros in a go block you can also run afoul of this problem
12:28stompyjSagiCZ1: Go adoption seems to be outpacing Clojure here in NYC, I think they’re both growing well, but I think Go’s story is simpler and the value prop is clearer, if for no other reason that its more like hte other language you were probably using
12:28literaryrwblue: the spirit of Clojure was embodied in Datomic, which hates garbage collectors, and the enmity has proven mutual
12:28MrJones98dnolen_: so i’m not using core.match in a go block
12:28SagiCZ1AeroNotix: i agree that learning clojure has been a little more daunting than i expected..
12:28MrJones98cljx is the only reason core.match is in my deps
12:28AeroNotixstompyj: yes, this.
12:28literaryrwblue: so, immutability is, well, slow as a turtle driving a race car with no engine
12:29MrJones98dnolen_: most things were working fine until i tried to add some external libs to my preamble
12:29MrJones98just some external js stuff
12:29dnolen_MrJones98: gist your stacktrace somewhere
12:29dnolen_MrJones98: include CLJS compiler info please
12:29dmatysiakI have a macro that looks like this: (defmacro eval-expr [vars vals expr] `(let [~vals ~vars] ~expr)). The problem is that I won't be passing literal expressions in, only bound symbols, i.e., while I can do (eval-expr [a b] [1 2] (+a b)), I can't do (eval-expr x y z) where x, y and x are bound to the respective expressions. Any suggestions on how to make something like this work?
12:30dnolen_MrJones98: i.e. version etc
12:30Bronsatechnomancy: I'd be surprised if compilation time was dominated by load time
12:30stompyjSagiCZ1: The best thing about clojure imo, is the community, and the projects the community seems to tackle. Without attacking other communities, Clojurists seem to have a great ability to focus on solving problems that make complex problems simpler
12:30literaryI am just waiting for `lein run` to start. It takes almost a minute these days.
12:30literaryThat's why I'm in here wasting time.
12:31stompyjliterary: if lein run takes a minute, that feels like a computer issue, more then a lein run issue
12:31MrJones98dnolen_: capturing the stack trace now and was using cljs 0.0-2227 and upped it to 0.0-2371 and still having the issue
12:31SagiCZ1stompyj: Well I was never learning clojure for the sake of getting a job.. I think that only company using Clojure in my country would by a company I founded myself. However I understand that language popularity is important for the healthiness of its community
12:31rwblueliterary: I'm not really following. I was asking about if/how Clojure's notion of identity and state has been applied to URIs. I've found a few leads so far
12:31literarystompyj: 32gb of RAM, 3.2 GHz Quad Core Intel Xeon, SSD... so I really doubt that
12:32Bronsatechnomancy: not to say load time doesn't play a role in compilation time, but as CLJ-1529 showed, there are significant % improvements in compile time that are completely unrelated to code loading
12:32literarystompyj: More likely, it's that I'm loading up both Clojure and JRuby in the same Clojure web app.
12:32stompyjliterary: wow. agreed. that’s crazy tho, lein run usually works in sub 5 seconds, even on my mba
12:32stompyjliterary: it might be jruby, the startup time on that when I was using it was *brutal*
12:33stompyjthat was about 2 years ago tho, so I assume it’s much better now
12:33MrJones98dnolen_: https://gist.github.com/andrew-nguyen/b718036ab06b469a2b6a
12:33literarystompyj: Even without JRuby, it takes a good 15 seconds to start the web server.
12:33literaryrwblue: I only saw your first question, so...
12:33MrJones98dnolen_: i can copy more of it if you want
12:33stompyjliterary: wow
12:33arrdemliterary: cold start? that's not entirely crazy..
12:33literary`lein run`
12:34literaryIt's surprising given how fricken fast this computer is in every way.
12:34literaryAnd disappointing.
12:34arrdemI get 3.78s to go from a cold JVM to a running webserver
12:34stompyjSagiCZ1: yeah, I mean, I’m not even overly worried about this, but since you asked, it is the one thing I think about, when I think about trying to build a end-to-end clojure/clojurescript project
12:34dnolen_MrJones98: no, that's the open files problem - not sure why you have "target" in your list of sources
12:34literaryI mean, it makes me disappointed in the human race's inability to make fast software given all the time we've had.
12:34stompyjeverything else has been pretty nice
12:34MrJones98dnolen_: i have target only cause that’s where i stick my cljx generated files
12:35literaryOh look, it started. Brb, seeing if my middleware isn't broken yet.
12:35SagiCZ1stompyj: yeah i see.. thanks for answering the question :)
12:35MrJones98dnolen_: should i be sticking that somewhere else?
12:35literary(I'd just reload it from within the app, but that's broken too, because I'm using Clojure libs.)
12:36justin_smithliterary: the more powerful computers get, the lazier developers can be about performance. developers are more expensive than hardware, so they get away with it. See also: no matter how powerful batteries get for mobile, the latest phone will need daily charging - the limit is the user's tolerance for charging, and with more power, you get lazier / more ambitious power hungry apps.
12:37literarySo we're lazy and spoiled and ignorant.
12:37literaryMakes sense.
12:37dnolen_MrJones98: hmm I don't know I don't use cljx
12:37technomancyonly ignorant if you aren't aware of the tradeoffs
12:37literaryI should probably go. Clojure is pissing me off too much.
12:37arrdemjustin_smith: have you seen Alan Kay talk about buying your way into the future for dev productivity?
12:37justin_smith(I use a dumb phone that holds a charge for a few days, a full week if I am feeling antisocial)
12:37MrJones98dnolen_: i can’t think of a reason why what i have wouldn’t work though
12:37justin_smitharrdem: rings a bell, not sure
12:37MrJones98that dir just contains cljs files
12:37MrJones98liike any other src dir
12:38literarytechnomancy: I meant ignorant in that we can't see how much our own laziness is hurting us as developers, by writing crappy software on top of crappy software on top of cr.
12:38dnolen_MrJones98: there's not really enough info here for me to go on - sorry - we've haven too many open file issues in the past - but we've received patches for that.
12:38MrJones98dnolen_: hmm… might’ve had a bad require in one of my source files
12:38MrJones98but normally, that results in a compiler warning
12:38arrdemjustin_smith: idea is that you overpay for hardware by a factor of ~100x or more to get hardware equivalent to what will be "consumer" in 10 years so that you can be as lazy now as you will be in 10 years and still deliver osum
12:39dnolen_MrJones98: always possible to miss a case
12:39justin_smitharrdem: "the future doesn't have to be incremental" maybe?
12:39arrdemjustin_smith: I think he mentions it there too.
12:40arrdemjustin_smith: he's come back to that idea a couple times that I've seen
12:40justin_smitharrdem: google for buying your way into productivity gives me no direct hits
12:41MrJones98dnolen_: any idea why a require of [secretary.core :as secretary :include-macros true :refer [defroute]] was working in 2227 and now causes a warning in 2371 of “secretary.core/defroute does not exist….” ?
12:41MrJones98also, removed the other bad require and it compiled
12:42dnolen_MrJones98: because the compiler improved
12:42dnolen_MrJones98: defroute is a macro so you need to use :refer-macros
12:42arrdemjustin_smith: https://www.youtube.com/watch?feature=player_detailpage&amp;v=gTAghAJcO1o#t=2176
12:43literaryJust typed this whole sentence and joined #clojure and my server still hasn't started yet.
12:43justin_smitharrdem: that's the exact title I asked you about
12:43literaryEr, also started my entire IRC client.
12:43arrdemjustin_smith: I know, that's the timestamp where he starts talking about it
12:43literaryOh there it goes.
12:43MrJones98dnolen_: i knew it’d be something simple - thanks!
12:43justin_smitharrdem: ahh, OK
12:43MrJones98btw, we’re making extensive use of om
12:45arrdemjustin_smith: 39:30
12:45arrdem"because this machine was so fast we didn't have to optimize, we could go out, drink a couple pitchers of beer and play all afternoon"
12:46MrJones98dnolen_: it’s now compiling but takes ~150-180 seconds… does that pass the sniff test?
12:46dnolen_MrJones98: ok good
12:46dnolen_MrJones98: are you using advanced compilation?
12:47MrJones98dnolen_: whitespace only for now in my dev profile
12:47dnolen_MrJones98: also all bets are off if you are using cljx I have no idea what that things does or what kind of perf hit you are taking by using it
12:47dnolen_also sourcemaps on any setting other :none will kill you due to RAM requirements
12:47MrJones98cljx runs before cljsbuild
12:47the-kennydnolen_: cljx + :optimization :none is fine.
12:47dnolen_MrJones98: in general using anything other :none and :advanced is a waste of time IMO
12:47MrJones98so it’s just a basic cljs file with some defs in it
12:47the-kennyIt takes about twice as long, but that's still <2s
12:47MrJones98some constants i share between the front/backend
12:48MrJones98dnolen_: oh - i thought whitespace/simple/advanced were the only options
12:48MrJones98let me drop to none
12:48clojurebotHuh?
12:49dnolen_MrJones98: anyways sounds like something else may be wrong w/ your setup, I've seen CLJS projects with 40K LOC under advanced compilation take ~50secs on my machine
12:49MrJones98dnolen_: figured…. just needed some ballpark to indicate if something is wrong
12:49MrJones98thanks
12:49dnolen_that's processing around near 200KLOC of generated JS in ~50secs on an iMac
12:50dnolen_if you can't do that then something is wrong w/ your config
12:50justin_smitharrdem: I am watching from the beginning, the thing about the funding disappearing in the '80s is something I have heard about multiple places - just imagine the world we could live in if DARPA hadn't changed
12:51justin_smith(well DARPA and the corparate stuff from xerox / bell etc.)
12:52arrdemjustin_smith: eh. we're where we are today because of old DARPA investments that are finally paying off. I think it's disingenuous to lament the changes in funding because most of those projects overpromised and didn't/couldn't deliver. the AI stuff being the classic example of this.
12:52MrJones98dnolen_: dropping it to none from whitespace now takes 13 seconds the first time and 0.3 seconds after that
12:52MrJones98haven’t tried with advanced optimization yet
12:52dnolen_MrJones98: sounds about right
12:53justin_smitharrdem: the funding rules changed and they stopped funding pure research outright. A lot of good stuff comes from pure research.
12:53arrdemjustin_smith: #clojure-offtopic, dnolen_ is working :P
13:13ag0rexhello, i was looking through ibdknox/gambit and i saw this:
13:13ag0rex(defmacro ? [obj k]
13:13ag0rex `(aget ~obj ~k))
13:13technomancythat doesn't look like scheme
13:13ag0rexwhy would you create a macro in this case instead of creating a function called ? that does the same thing?
13:15ag0rexright.. i am talking about this: https://github.com/ibdknox/gambit :)
13:15arrdemag0rex: there is no good reason for ? to be a macro here. It's just sugar that does no transformation and could trivially be a function.
13:15technomancyag0rex: weird. there is already a lisp implementation called gambit.
13:15Bronsaarrdem: not sure about that, actually
13:15Bronsaag0rex: arrdem that might have to do with inlining and avoiding run time reflection
13:16dnolen_ag0rex: looks like an inlining macro
13:17dnolen_ag0rex: stuff like that is less relevant in modern JS engines - but there are less than efficient JS engines to contend with still
13:17Bronsaah, clojurescript
13:17Bronsawell, just drop the run time reflection bit then
13:19ag0rexdnolen_: so one would do this to avoid a another call to a different function?
13:19dnolen_ag0rex: yes inlining
13:19dnolen_ag0rex: but there's really no need to do this kind of thing unless your writing inner loops
13:22literaryHi! Is it a stupid idea to have a background loop that calls (System/gc) every few hours in my web app?
13:23arrdemprobably.. the JVM will likely GC more frequently than that anyway..
13:23literaryOh!
13:23puredangerliterary: don't do that
13:23literaryThanks!
13:23Gurkenmasterstrange
13:23Gurkenmasterwrong channel
13:23hiredmanpuredanger means "yes, that is stupid"
13:24literaryWell now!
13:24puredangerI thought my way was nicer :)
13:24hiredmansure, but literary asked if it was stupid
13:24literaryIndeed!
13:25puredangerI don't think it's a stupid question if you lack JVM context
13:25literaryI didn't ask if it was a stupid question!
13:26vermais there a lein plugin which serves my project directory over http?
13:26puredangerI don't think it's a stupid idea, just unnecessary :)
13:26vermalike just static
13:26literaryMy gratitude! I am indebted to your service!
13:26vermaso that I can serve the output of my cljsbuild stuff
13:26seancorfieldliterary: I've known systems on top of the JVM that used to call GC periodically to stay stable - on earlier versions of Java - but I don't know many systems that feel the need to do it now
13:27seancorfieldesp. with the G1 collector (if that works for your app)
13:27vermalein pdo repl, cljsbuild auto, server
13:27literaryMy boss is adamant that we use Datomic, so the GC dies every so often!
13:27literaryIt spins out of control!
13:27seancorfieldwhich collector are you using? which JVM version?
13:28hiredmanliterary: the gc dies?
13:28literaryI will say this much: I no longer believe experimenting with Datomic to be a worthwhile endeavor!
13:28literaryI'm using the latest of both!
13:28noonianyou had to manually call the gc all the time with the initial versions of android heh, especially when doing anything with the camera or big files
13:28hiredmanliterary: what do you mean the gc dies?
13:28seancorfieldno, which garbage collector strategy are you using?
13:28literaryGarbage collection is the past, Rust's way is the future, whatever it is!
13:29hiredmanliterary: what do you mean the gc dies?
13:29literaryI don't know!
13:29technomancyverma: python -m SimpleHTTPServer 3001
13:29literaryThe app just suddenly stops responding to everything!
13:29hiredmanliterary: and why do you think that is a gc issue?
13:29seancorfieldyou specify which GC strategy as part of the JVM options at startup
13:29literaryBecause I've checked everything else!
13:29literaryI don't specify it!
13:29hiredmanliterary: are you monitoring the gc at all?
13:30seancorfieldthat's your problem then :)
13:30literaryWhat does that mean?
13:30literaryI don't know how to monitor it!
13:30hiredmanliterary: use jstat
13:30hiredmanor some kind of profiler
13:30vermatechnomancy, I don't want to run separate terminal sessions :( .. I already have node.js' http-server
13:30seancorfieldmaybe you should hire a consultant who understands the JVM?
13:30literaryThe way my boss set up our website is very bare-bones and configuration-less!
13:30vermatechnomancy, may be this? https://github.com/tailrecursion/lein-simpleton
13:30hiredmanlook at how many full gc pauses there
13:30technomancyverma: yeah, there's undoubtedly something
13:30hiredmancheck the usage of each of the spaces
13:30technomancythis is like the one thing I actually use python for
13:31clojurebotAlles klar
13:31literaryMy gratitude! I am indebted to your service!
13:31technomancyclojurebot: forget this |is| like the one thing I actually use python for
13:31clojurebotI forgot that this is like the one thing I actually use python for
13:31technomancy._.
13:31vermatechnomancy, lol
13:31vermatechnomancy, then you should just use http-server from npm, and let python go :)
13:32hiredmanliterary: it doesn't sound like you've done a very thorough job of figuring out what the issue is, so I would not be so quick to assume a gc issue
13:32technomancyverma: lol no
13:32literaryI don't even know how to figure out what it is!
14:25SagiCZ1No matching ctor found??? cant we just spelled out "constructor" so people dont waste time googling what that obscure word means? :)
14:26technomancyc9r
14:26llasramOh man, best convention ever
14:26SagiCZ1i hate i18n too
14:28nullptrt9y: nice
14:32SagiCZ1,(float (/ 5 7))
14:32clojurebot0.71428573
14:32SagiCZ1shorter way to do this?
14:33nullptrinteresting core.async question -> http://stackoverflow.com/questions/26431207/why-is-the-threadpool-for-core-async-in-clojure-created-with-fixed-thread-pool-o
14:35llasramSagiCZ1: ##(/ (double 5) (double 7))
14:35lazybot⇒ 0.7142857142857143
14:35llasramThat doesn't initially create a Ratio object
14:35justin_smith,(/ 5 (double 7))
14:35clojurebot0.7142857142857143
14:35justin_smithdoes that?
14:36llasramI believe that also works
14:36justin_smith(/ 5 7 1.0)
14:36justin_smith,(/ 5 7 1.0)
14:36clojurebot0.7142857142857143
14:36justin_smithdefinitely creates a ratio, but it's "shorter"
14:36justin_smithlol
14:36SagiCZ1cool, thanks
14:37justin_smith(defn to-days [ms] (/ ms 1000 60 60 24))
14:39justin_smith(defn to-ms [days] (* days 1000 60 60 24))
14:42johnwalkernullptr: it's a duplicate, unfortunately
14:51TimMcllasram: I t3k i2s a f2e c8n.
15:08llasramTimMc: Early and recent-extra-minimal Forth systems frequently use/d only 4 bytes for "word" names -- first 3 bytes + a 1-byte length
15:09llasram(or well, 1-byte length + first 3 bytes)
15:09clojurebotGabh mo leithscéal?
15:10llasramI 5thi 3it' 1a 6pre 10rea 10con
15:10justin_smithlol
15:10justin_smithl3l
15:10sveriHi, I have a piece of code I don't understand. I am using enlive as a templating engine and in my library I always returned this: (ring.util.response/response (apply str template)) where template is the enlive code, now I played around and tried to embed my library into a current luminus created webapp, all of a sudden the templates are downloaded now, because they have the wrong content type, but when I change my render function to t
15:12justin_smithsveri: (apply str template) should be redundant with ring
15:13justin_smithsveri: also, that message was too long, it got cut off at "I changed my render function to t"
15:13sverijustin_smith: ok
15:15bbloomi really wish i could instantiate java classes w/ namespace aliases
15:15bbloomgot a class called "Client" in a long ass namespace
15:16bbloomwould be so nice if it could (foo/Client. blah blah) instead of (com.omg.this.is.a.long.name.Client. blah blah) or just the ambiguous (Client. blah blah)
15:18dnolen_http://arcadia-unity.tumblr.com/post/100257212548/arcadia-0-1a-launched
15:20bbloomdnolen_: cool, get timsg and ra-whatever-his-irc-handle in here :-)
15:21cflemingdnolen_: That looks really great
15:21danneubbloom: it wouldn't be clojure anymore if you weren't constantly reminded that Java is right there behind the scenes
15:22bbloomdanneu: meanwhile, that unity stuff is on the clr ^^ :-)
15:22bbloomor mono, really
15:22cflemingdnolen_: Maybe that'll help clojure-clr get some love, it seems to be the great project that no-one uses.
15:22dnolen_being able to target XBox, iOS, etc with ClojureCLR is pretty cool
15:22dnolen_cfleming: yep people care about platforms - this open up some new platforms
15:22cflemingYeah, I guess ClojureCLR works with the Xamarin stuff?
15:22dnolen_cfleming: yes
15:48justin_smiththe thing that makes me sad about arcadia is unity won't run on Linux :(
15:48justin_smithwhich is ironic, given that it is based on mono
15:54AimHereWell Unity exports to Linux; is the editor mono-based too?
15:55justin_smithAimHere: they provide no dev env for linux, and no web player
15:55AimHereRight, dev env or editor is what I'm talking about
15:55justin_smithyeah, not available for linux at all
15:56justin_smithhttp://feedback.unity3d.com/suggestions/platforms-unity-editor-for-linu
15:56AimHereYeah, but is it built on Mono or something else? Given that it's a full-on game engine, I suspect there's big chunks of native code that needs porting
15:56justin_smithtustex is spamming
15:56AimHereAlso tutus
15:57justin_smithAimHere: yeah, most likely, but yeah, they built it on mono
15:57justin_smithwell, a forked mono
15:57justin_smithso they could have more control than they get with the ms. impl of clr
15:58AimHereThe devs did say that it was purely a business decision; that they didn't think there'd be enough Linux devs willing to shell out the £1500 to use the Pro version
15:59AimHereThough I'd have thought that would be a good use of something like Kickstarter. Get the money pledged in advance.
16:16ayarnahi
16:17stompyjhello
16:22bbloomlet's say i've got a lein plugin, what's the easiest way to exclude the version of a dependency it includes? i want to include my own version of it, but `lein deps :tree` shows my dependency seems to be overridden by the plugin
16:23technomancybbloom: the plugin should attach ^:displace metadata to the dependency vector
16:24bbloomtechnomancy: shouldn't project dependencies always override plugin dependencies?
16:24technomancybbloom: there's no such thing as plugin dependencies
16:25technomancyI mean, it's not a first-class concept, just a thing that you can do well or badly
16:25bbloomtechnomancy: https://github.com/greglook/whidbey/blob/master/src/whidbey/plugin.clj
16:25bbloomwhat's done badly about that? i can fix it
16:25bbloomi want to supply my own version of puget
16:25mdrogalisWhat a champ.
16:25technomancybbloom: try attaching ^:replace metadata to your own maybe
16:26technomancybbloom: why is this a plugin though?
16:26bbloomtechnomancy: i have no idea, i still don't understand lein, no matter how much i try to
16:26technomancyoh, because nrepl middleware can't be configured from within project space?
16:26bbloomi guess so, this thing actually monkey patches nrepl
16:27technomancythat's a shame; there really ought to be a way to make it manifest-driven
16:27technomancyproject.clj seems like the wrong place for it
16:27bbloomnot sure what you mean by that
16:27technomancywell, embedding an nrepl in your project is a thing
16:27bbloomadding ^:replace to my dep seems to fix it
16:27technomancyso having the middleware depend on constructs that aren't present in production seems like a problem
16:29technomancybbloom: cool
16:30technomancybbloom: IMO plugins adding dependencies is so easy to do wrong that it's rarely worth the trouble
16:30bbloomtechnomancy: that's been my impression of most of my interactions with lein
16:30technomancybbloom: but if you're in a bug-reporting mood, maybe recommend adding ^:displace in the plugin so others don't have this same problem
16:31technomancybbloom: people get carried away with magic =(
16:31technomancy"just add this one line and it does everything[1] for you"
16:31technomancy[1] everything *I* think you should need
16:32technomancythe way cljsbuild uses project middleware has made me regret adding that feature to lein
16:32bbloomin general, i distrust plugins of any kind
16:33technomancythat's a healthy default
16:33technomancyat least, plugins that execute project code
16:33bbloomonce you have a plugin that executes code, you're not in the operating system business
16:33bbloomnow*
16:33bbloom"not" totally fails to make my point :-P
16:34technomancymost eval-in-project plugins should really just be -main namespaces that run entirely in project-land
16:34mrb_bkReminder for conj attendees http://www.meetup.com/Papers-We-Love-DC/events/212419432/
16:35AeroNotixREMINDER for people, we need moar EU stuff
16:35bbloomtechnomancy: it's totally a human problem. you made a plugin system... then you documented it! that's where you went wrong :-)
16:35technomancybbloom: even the ones that ship with lein itself that run code like repl and test are really just there to work around problems in the contribution process for upstream
16:35technomancyhaha
16:36hiredmantbd? who does he think he is, rich?
16:36technomancythere's very little reason repl should be anything other than an alias for `lein run -m org.clojure.tools.nrepl`
16:36bbloomtechnomancy: agreed, and then if you wanted a "plugin" you'd just make a custom main and parameterize it
16:36technomancysame with lein test
16:37technomancybbloom: IIRC the first thing in the plugin docs right no is a paragraph that tries to convince you not to write a plugin
16:37technomancybut it's too late
16:37bbloomtechnomancy: can you move the current plugin system in to a custom main and then deprecate the plugin system?
16:38bbloomseems like a good idea to me :-)
16:38technomancybbloom: hah; that would work if all plugins called eval-in-project
16:39justin_smithbbloom: technomancy: I wonder if there isn't a larger underlying issue, design wise, that gives rise to both lein plugin/middleware issues and instability in various emacs / clojure integration... pitfalls of AOP or something?
16:40technomancyjustin_smith: I think it's a matter of failing to decompose first before packaging up good defaults
16:40technomancy"the framework problem"
16:40bbloomjustin_smith: there's at least two orthogonal problems: #1 is the AOP side of it, but #2 is that whenever you have dynamic code loading, you've got a shadow world of dependency management, process/job control, evaluation ordering, etc
16:41justin_smithinteresting
16:41bbloomyeah, i guess "the framework problems" comes in these two forms: the static decomposition of parts and their dynamic behavior
16:41technomancyso on the bright side, you can now read profiles out of plugins
16:42technomancywhich should allow anything that's currently done as middleware to be redone in a declarative way that's easy to override
16:42technomancyI'm sure whidbey could be rearranged to do that
16:43technomancyrather than having a profile that's embedded in the code as a def, it's looked up in the project map, so you can override it easily
16:43technomancyI don't know enough about cljsbuild to speak authoritatively, but my gut tells me the "magic" should be able to be replaced there too
16:46bbloomi don't think lein succeeds in being "declarative" at least not in a positive way
16:46bbloominstead, it's config file magic
16:47bbloomas for cljs build, i've had dramatically more success w/ manual jetty/closure/etc code
16:48bbloombasically write build and clean functions, parameterize them as i need, then a util function or two like rebuild, and then wrap that up in a namespace with an explicit jetty server for my static assets, and wire in a weseal socket to that server
16:48bbloomwhole thing is like 20 lines of code
16:48bbloomand 100X more flexible and easier to work w/ than lein
16:48bbloommuch faster too
16:48bbloomyou get per file re-eval in repl, rather than auto-build nonsense
16:49nullptrbbloom: do you have that packaged somewhere?
16:49bbloomi'll post a gist
16:50justin_smithbbloom: "100X more flexible and easier to work w/ than lein" are you using something else for dep management?
16:50bbloomlein-cljsbuild, i mean
16:50dnolen_bbloom: pfaw - who evals cljs files anymore? let figwheel sort it out
16:51bbloomdnolen_: does figwheel do auto eval on save? i hate that.
16:51dnolen_bbloom: it does, it's great!
16:52bbloomdnolen_: i hate that.
16:52bbloomdnolen_: i don't want to eval on save. i want to eval in a very particular order sometimes
16:52bbloomnullptr: https://gist.github.com/brandonbloom/60a3dc87969965573271
16:52bbloomthat's hacked up from anothe rproject
16:52dnolen_bbloom: well there you go - people problems not technology ones
16:52bbloomi deleted a bunch of shit that was project specific
16:53nullptrbbloom: thanks, i get the idea -- simpler than expected
16:54bbloomnullptr: dramatically simpler than a lein plugin!
16:54nullptr"thanks, cljs.closure!"
16:54dnolen_bbloom: yeah that file is gross
16:54mlb-is there a way I can create functions without using defmacro, or (eval `(defn ...)) ?
16:54dnolen_bbloom: I'd take lein over that stuff anyday
16:54mlb-rather, can I create functions without using a macro, but instead a function *without* using eval?
16:55dnolen_bbloom: and I've suffered bad lein days too
16:55technomancybbloom: I luckily have avoided cljsbuild, but from what I've heard the situation there is pretty dire
16:55amalloymlb-: that's kinda a weird question. (fn [x] (inc x)) is a function, and you don't need defn to make it. do you have a more overarching goal?
16:55technomancywhich ... I mean it's been abandoned for how many years now?
16:55bbloomdnolen_: i get that you like auto-compile, but are there any other advantages that lein-cljs provide you?
16:55technomancytwice?
16:56mlb-amalloy: I'm trying to see if I'm needlessly using macros. I've a set of macros to provide covers to JavaScript implementations in a JVM ScriptEngine
16:56bbloomdnolen_: b/c the cost is that every time i try to set it up, i spend a ton of time and the result is that i get a workflow i don't like
16:57dnolen_bbloom: not putting that crap in a source file - `lein with-profile (dev|prod) cljsbuild (auto|once)` works for me
16:57bbloomdnolen_: what's wrong with having it in a source file?
16:57dnolen_bbloom: because I can't configure it without changing the source file
16:58bbloomdnolen_: isn't changing source file what you do all day long when working anyway?
16:58dnolen_bbloom: anyways look at chestnut - it's a sensible config and a sane use of profiles and lein-environ
16:58bbloommy actual version of that file has a bunch of crap in a (comment ...) block
16:58technomancyinc on preferring changing source to changing project.clj-level stuff
16:58bbloomdnolen_: if it's built around auto-recompile, i'm not interested
16:58amalloymlb-: have a look at ##(doc intern). but that doesn't sound like a terrible use of macros
16:58lazybotjava.lang.SecurityException: You tripped the alarm! intern is bad!
16:58mlb-amalloy: the meat of it is something like: `(defn ~fn-name [&~'args] (apply js/js-new ~engine ~classname ~'args))
16:58technomancylol
16:58technomancyshame on you amalloy, trying to hack lazybot
16:58dnolen_bbloom: which fine, but this is not what most people want
16:59mlb-amalloy: ah, okay. Just getting a sanity check to see that I'm not that far off the deep end
16:59bbloomdnolen_: seems weird to me, since i've never heard of anyone doing "auto compile" for normal jvm clojure projects
16:59bbloomdnolen_: i think autocompile is a goofy idea from rails etc universe that web devs have adopted b/c of the refresh cycle in browsers
17:00technomancybbloom: or people who don't know how after-save-hooks work =)
17:00bbloomi want to press the refresh button in my browser as infrequently as i restart lein in my dev env
17:00technomancy(I'm sure there's a vim equivalent)
17:00dnolen_bbloom: ^
17:00dnolen_bbloom: people already do this via various means in Clojure
17:00bbloomtechnomancy: do you use after-save-hooks to eval clojure files?
17:00dnolen_bbloom: reload namespaces is a thing - there's even middle ware for it
17:00dnolen_for ring
17:01technomancybbloom: no, but if I wanted instant feedback, I sure as heck wouldn't be doing it in a lein plugin
17:01bbloomi save files so frequently and instinctually, i usualy save when the files would FAIL to compile
17:01technomancybut I don't actually want it, so yeah
17:01bbloomif it were up to me, files would always auto save w/o no save action
17:02bbloomon every damn keystroke
17:02bbloombut undo and commit are two different features
17:02mlb-technomancy: a hack I use is to start a nrepl with my ring server, then I can connect my vim to it and re-eval stuff in that JVM
17:02bbloomand save complects them
17:02bbloomi want durable undo to be automatic
17:02bbloomand commit (to my running env) to be explicit
17:03bbloomand i want to be able to commit individual expressions, not whole files
17:03bbloomi'm also a fan of git add -p :-)
17:03AeroNotixbbloom: I know someone who has their editor set up to commit to a branch on every save and then rebase squashes them before sending PRs
17:03bbloomAeroNotix: that sounds awesome
17:04technomancyinb4 smalltalk images
17:04bbloomtechnomancy: smalltalk images complect save and commit too, but standardize on commit instead of save :-P
17:04amalloyman, i save my files way too often for that to make sense. add a space, delete a space, save just in case
17:04technomancynever actually used it, other than via scratch
17:04bbloomalthough i guess "worlds" in the VPRI stuff is their solution
17:04mdrogalistechnomancy: Haha :)
17:05technomancymy default assumption is that they got everything right decades ago and no one noticed
17:05AeroNotixamalloy: I know a monster who writes whole functions before saving
17:05bbloomamalloy: git can auto squash hundreds of commits, no problem
17:05bbloomthousands even
17:05amalloybbloom: i'm aware of how to use git
17:05AeroNotixshots fired
17:05bbloomlol
17:05bbloomto me, it seems like vim's undo tree should just be git :-P
17:05technomancybbloom: I once wrote a collaborative editing engine that used git rebase+auto-commit+mdns
17:06technomancyit sort of worked
17:06AeroNotixtechnomancy: wasn't that the thing on aws that used tmux sessions too?
17:06technomancyAeroNotix: same problem, different solution
17:06AeroNotixah, that looked interesting
17:06amalloybut auto-squashing a zillion commits is so low-class. i prefer to squash manually so that i can come up with a legible commit log, not a single "do a million things" commit
17:06devntechnomancy: what was that called again?
17:06AeroNotixtechnomancy: I always forget how to share tmux sessions ;)
17:06AeroNotixamalloy: nothing is stopping you from doing that
17:07bbloomamalloy: i prefer iterative refinement
17:07amalloyAeroNotix: if my editor made a new commit every time i saved, there would be a lot of commits that it would be hard to put together sensibly
17:07bbloomi usually have like 37973573 commits w/ the message "wip"
17:07technomancydevn: the git one? http://technomancy.us/113
17:07bbloomand i squash every so often after a logical unit of work
17:07bbloomthen i re-arrange multiple sensible commits before making a PR
17:07technomancyAeroNotix: http://tmate.io is actually a lot simpler for many cases
17:08devntechnomancy: ah yeah, ebby
17:09amalloybbloom: your approach is reasonable too, of course. git is flexible enough to support a lot of completely different workflows
17:09bbloomamalloy: i'm just saying i wouldn't mind if i had 237957935793 commits that were labeled with messages the same way MS Word labels the "Undo" menu entry
17:09bbloom"Undo typing 'the'"
17:10AeroNotixtechnomancy: I don't use a MacOSX operating device
17:10AeroNotixoh it's x-platform
17:10AeroNotixscratch that
17:10bbloomalso, i love typing numbers with 3537953 digits
17:10bbloomit's 309753753 kinds of fun
17:10amalloybbloom: i'd be interested in trying it, too. it sounds neat. i don't think i'd like it long-term, but who knows
17:10technomancyAeroNotix: it's pronounced macosecks
17:10AeroNotixI'm surprised how accurately you get the same set of numbers
17:10AeroNotixtechnomancy: make sex?
17:11technomancybetter than war
17:15AeroNotixis there a function somewhere to take a compojure request/response map and turn it into what would get sent on the wire?
17:16justin_smithAeroNotix: ring? (lol)
17:16rmarianskiAeroNotix: https://github.com/ring-clojure/ring/blob/dd98af112bd5d94d006570b84f507ac0df9b8068/ring-servlet/src/ring/util/servlet.clj#L105-L115
17:17rmarianskiit's the job of the adapters
17:17AeroNotixjustin_smith: why lol?
17:17numbertenthis should be a oom error right? (let [[t d] (split-with #(< % 12) (range 1e8))] [(count d) (count t)])
17:17justin_smithAeroNotix: you could call ring a program that turns requests into request maps, and response-maps into responses, that's pretty much what it is for - so it trivially does what you describe
17:18numbertenwhenever I run it lein repl hangs :/
17:18AeroNotixjustin_smith: but i want a function that takes the request map and returns the string
17:18AeroNotixjust for debugging
17:18justin_smithring doesn't send a string, it sends a response, it has things like headers etc.
17:18justin_smithwell I guess there is a string form...
17:18AeroNotixnevermind
17:19justin_smithAeroNotix: it sounds like a great idea for a ring adaptor: one that gets a request as a string, and returns the response as a string, for testing and debugging
17:19technomancyAeroNotix: shell out to curl? =)
17:19justin_smithyou could call it ring-string
17:19justin_smithor maybe string-ring
17:19justin_smithI should make that project
17:20bja(inc justin_smith)
17:20lazybot⇒ 94
17:20AeroNotixjustin_smith: ring-sting?
17:20rmarianskist-ring
17:20stuartsierraHTTP is surprisingly complicated when you get down into the details.
17:21AeroNotixjustin_smith: I need to look up how to make a ring-adapter then
17:22justin_smithstuartsierra: yeah, I would have no intention of making a fully http-complient thing, just enough to be able to feed it a request and get a testable response for a fairly vanilla handler function
17:22amalloynumberten: you'll run out of memory eventually
17:22AeroNotixMethod, headers, body
17:22AeroNotixall it really needs
17:23marcoslamuriahello
17:23numbertenamalloy: over an hour of waiting :/
17:24numbertenamalloy: and the version that releases the head only takes a few seconds, wouldn't you expect to see a oom exception in roughly the same time it takes to realize the whole seq?
17:24amalloyno. you're making a lot more work for the GC
17:25amalloyyou allocate ten numbers, say, and then to allocate another you need to GC. so it scans the heap, finds ten million numbers it needs to keep, and a little ephemeral garbage it can clean up
17:25justin_smithnumberten: the head does not escape scope, so it is not held onto
17:26amalloyjustin_smith: yes it is. he has two references to the original seq
17:26justin_smithnumberten: I have verified similar code in a profiler (amalloy probably remembers this, I had a weird bug)
17:27justin_smithamalloy: oh, count is enough to hold the head? I would have hoped it was smart enough to just have accumulated count + rest
17:27amalloythe value d isn't held onto, but while he's counting d he needs to hold onto t in order to count it
17:27amalloyand t needs to hold onto the range
17:27amalloycount doesn't hold any heads itself, of coruse
17:32numbertenamalloy: yeah i'd just expect it to run out of space really quickly
17:32numbertensince it can't gc any values
17:32amalloynumberten: it can gc some other stuff, though. cons cells in the split-with lazy seq
17:32justin_smithnumberten: if you want to see a graph of gc / space usage, open up jvisualvm (comes with the jdk) and connect to your repl
17:33justin_smithnumberten: it's a gui profiler, pretty self explanitory, gives nice graphs of metrics over time among other things
17:33numbertenalright thanks
17:33amalloyyou've made the job O(n^2) instead of O(n), where most of the time taken is inside the garbage collector
17:34numbertenbut wouldn't the non-head-retaining one also have to gc as much stuff?
17:34numbertencan you explain where the ^2 comes from in that?
17:34amalloyyes, but the extra work is not "things it can gc", but "things it has to scan over while gcing"
17:35numbertenahhhh
17:35numberteni see
17:35numbertenthanks :)
17:35amalloybecause a huge portion of the process's memory is uncollectable
17:35numbertenyeah
17:35numberteni get it
17:35numbertenthat's interesting
17:35numbertenvery cool
17:37numbertenso gc time grows proportionally with the number of allocated things?
17:37numbertenand when many of the those can't be gc'ed, it won't shrink
17:37numbertenand possibly continue to grow?
17:37numbertenamalloy: just to make sure I followed you :)
17:38amalloywell, the time taken to do a full gc
17:38amalloybut for minor collections, where most stuff is collectable, you don't really pay that cost
17:39numberteni see
17:39amalloybecause the gc algorithm the jvm uses for minor collections is just "copy anything that's still alive into a new place, and mark the entire old place as reusable"
17:40amalloyso there's no cost that scales with things that are collected, until they've been alive long enough to be promoted into oldgen
17:42amalloytldr gc is really complicated and anytime you think you know what's going on you're wrong
17:43bbloomamalloy: case in point, if you've got finalizers or weak refs, the copying collector needs to visit dead objects too!
17:45amalloyuhhhhh, weak refs, or phantom refs? i don't really know how weak refs fit into the gc plan, but kinda thought it would be in a way that doesn't create substantial extra work
17:45bbloomweak and phantom refs have the same mechanism, but just have a slightly different policies
17:46bbloomthey basically go in a big table of special refs
17:46bbloomsame time as finalizers, i believe
17:46bbloomor another table problem too
17:46bbloomprobably*
17:46bbloomlots of tables
17:46bbloomheh
17:48amalloybbloom: interesting. do you know where i can read about the mechanism?
17:49bbloomamalloy: http://www.amazon.com/The-Garbage-Collection-Handbook-Management/dp/1420082795
17:49bbloomamalloy: i'm sure there's somewhere else, heh
17:50bbloombut i just finished reading that, and it's covered reasonably well in there
17:50amalloyhm. i've read his "Garbage Collection: Algorithms for Automatic Dynamic Memory Management"
17:50amalloyor maybe i only got halfway through
17:50bbloomthe jvm gets a fair bit of plan, since lots of GC researchers use ibm's research jvm as a test env
17:50bblooms/plan/play
17:50bbloomman, i can't type even more than usual today
17:51DomKMAre there any good examples out there of a transient set implementation with deftype? I'm having trouble finding the right interfaces.
17:51bbloom,(transient #{})
17:51clojurebot#<TransientHashSet clojure.lang.PersistentHashSet$TransientHashSet@1351137>
17:52bbloom,(-> #{} transient class supers)
17:52clojurebot#{java.lang.Runnable clojure.lang.ATransientSet clojure.lang.Counted clojure.lang.AFn clojure.lang.ITransientSet ...}
17:52amalloyDomKM: i kinda have one
17:52bbloomDomKM: run that locally, start there
17:52amalloyhttps://github.com/flatland/ordered/blob/develop/src/flatland/ordered/set.clj#L97
17:52DomKMbbloom: my background isn't in Java; I was hoping to avoid stumbling around for a few hours
17:53bbloom(doc supers) ; DomKM
17:53clojurebot"([class]); Returns the immediate and indirect superclasses and interfaces of c, if any"
17:53DomKMthanks amalloy!
18:22mdeboardHow do you guys do code-folding in Emacs+CIDER
18:26justin_smithmdeboard: hs-mode
18:26justin_smithhs-minor-mode that is
18:26mdeboardok
18:26justin_smithit's nice, but you need to fix the default keybindings (those suck)
18:26mdeboardThe keybinds for that are pretty onerous,I'm rebinding to C-c M-s and C-c M-h
18:27mdeboardhaha
18:27mdeboardyeah
18:27justin_smithjynx
18:27mdeboardC-c @ C-h ?
18:27mdeboardI mean, good god
18:27mdeboardWhat do you use?
18:27justin_smithmdeboard: rember that C-c [a-zA-Z] are all reserved for your use and will never be used by a behaving emacs mode
18:27mdeboardOh, right
18:27mdeboardgood call
18:30amalloyi love that rule. i have like six or eight things on C-c [letter]
18:32justin_smithmdeboard: I use the following file full of keybindings that I call "outline-stuff.el" https://www.refheap.com/91922
18:32justin_smithI have a super-decomposed .emacs
18:33justin_smithit's using outline mode not hide-show, I had forgotten
18:33mdeboardhm
18:33mdeboardNever heard of that minor mode, sweet, thanks
18:40justin_smithmdeboard: hmm - that code is not working for the global "hide sublevels" command, but it does work for collapsing individual blocks
18:40mdeboardya I'm chalking it up to look up later
18:40mdeboardFor now hs-mode and C-c h/s works quite well
18:40mdeboardthanks for that reminder
18:41justin_smithyeah, I may go back to hs-mode myself now that I take a closer look...
18:53arrdemis there a good writeup of core.match somewhere? I'm not even seeing a writeup of the pattern notation.
19:00Bronsaarrdem: https://github.com/clojure/core.match/wiki/Basic-usage
19:04arrdemyeah. found that link reading a copy of the clojure cookbook I found googling.
19:26dopamean_why does (clojure.string/split "dopamean" #"") return a vector starting with an empty string?
19:32justin_smith,(clojure.string/split "dopamean" #"")
19:32clojurebot["" "d" "o" "p" "a" ...]
19:32justin_smithweird, it does that here, but not in my local repl
19:33justin_smith&(clojure.string/split "dopamean" #"")
19:33lazybot⇒ ["" "d" "o" "p" "a" "m" "e" "a" "n"]
19:33dopamean_every time i needed a list of chars from a sring like that i was doing (rest ....
19:33dopamean_then i recently discovered (char-array
19:33hiredman,(seq "foo")
19:33clojurebot(\f \o \o)
19:33justin_smith,(seq "dopamean")
19:33clojurebot(\d \o \p \a \m ...)
19:33dopamean_interesting
19:33dopamean_that actually may have been more useful
19:33hiredman,(map int "foo")
19:33clojurebot(102 111 111)
19:34justin_smithbut string/split does not return a list of chars, it returns a vector of strings
19:34dopamean_,(char-array "dopamean")
19:34clojurebot#<char[] [C@59b2e>
19:34hiredman,(map int (char-array "foo"))
19:34clojurebot(102 111 111)
19:35dopamean_,(apply list (char-array "dopamean"))
19:35clojurebot(\d \o \p \a \m ...)
19:35bostonaholicthis is the behavior of http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#split(java.lang.CharSequence)
19:35bostonaholicas well as http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String)
19:35dopamean_right. i guess for my basic use today it didnt really matter if i got back a vector of string or a list of chars
19:35justin_smith,(apply str (map (comp char dec int) "IBM"))
19:35clojurebot"HAL"
19:36amalloythe problem with using #"" as a split is that it matches anywhere, without consuming even one character
19:36justin_smithamalloy: any idea why my local clojure 1.7-alpha java 8 repl would not match the first empty string?
19:37amalloyjustin_smith: clojure version certainly doesn't matter. maybe java 8 changed how split works
19:38dbaschamalloy: why would they change something like split?
19:38justin_smithyeah, that has to be the difference, it's a weird one though
19:38dbaschhttp://stackoverflow.com/questions/22718744/why-does-split-in-java-8-sometimes-remove-empty-strings-at-start-of-result-array
19:38justin_smithbut I am sitting here with a java 8 repl, and not getting the empty string at the beginning
19:39justin_smithahh!
19:39justin_smith(inc dbasch)
19:39lazybot⇒ 14
19:39dopamean_man
19:39dopamean_i was beginning to feel a little crazy here
19:39nullptrhey, at least we can "blame java"
19:40dopamean_as long as its not me
19:41dopamean_,(type (char-array "dopamean"))
19:41clojurebot[C
19:41dopamean_wtf is that
19:42dopamean_was expecting something more along the line of clojure.lang.Charsomethingortheother
19:42amalloydopamean_: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3
19:43dbaschdopamean_: the string representation of the class arrays of native types is something like [X
19:43dbasche.g. [B for byte array
19:43dopamean_ahhhh. ok. thanks a lot
19:43dbasch&(class (float-array [1.0]))
19:43lazybot⇒ [F
19:53squeedeeI'm having a blast learning some clojure
20:03squeedeeIs there a way to map two colls such that the longest collection is used, and nil stands in for the shorter one?
20:04technomancyconcat the shorter with (repeat nil) maybe
20:05amalloytechnomancy: works iff you know which is shorter
20:05technomancyindeed
20:05technomancyeh just do it on both; what's the worst that could happen
20:06justin_smith,(def worst-that-could-happen (repeatedly #(nil)))
20:06clojurebot#<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0:0)>
20:06amalloythat special-casing of (nil) has always seemed silly to me
20:07justin_smith,(def almost-as-bad (repeatedly #(/ 0 0)))
20:07clojurebot#'sandbox/almost-as-bad
20:08squeedeehmm
20:09amalloylike, why doesn't clojure let me compile (fn [] (nil)) if i don't plan to ever call it? i can imagine a macro generating code like that
20:10EvanRhas any one had success setting up vim and fireplace.vim
20:10technomancyhuh that's the first time I've ever heard anyone complain about clojure being *too* strict around nil
20:10technomancyactually now I can't tell if it's serious
20:10justin_smithEvanR: rumor has it there is at least one user
20:11EvanRi can use the repl functionality, but it cant find any of my jars when i try to run my code
20:11technomancyI heard the pope uses fireplace
20:11EvanRi really wonder if he does
20:12justin_smithEvanR: do you connect to a project repl? if you run (.getCanonicalPath (java.io.File. ".")) do you see the expected project directory?
20:12EvanRyes
20:12justin_smithand when you say "cant find your jars" do you mean you try to require namespaces and it can't find them? what does your code to require the ns look like?
20:13EvanRi was wondering the same thing but didnt know how to test, whether the repl was running on the project correctly
20:13EvanRi was trying :Require
20:13EvanRwhich did...
20:13justin_smith(require '[your.ns :as alias])
20:13EvanR(require 'gangway.google-cloud-storage :reload)
20:13justin_smith,(:require 'anything :reload) ; is a noop
20:13clojurebot:reload
20:14justin_smithyou need to leave off the :
20:14EvanRseems like a bug in the command right
20:14justin_smithnope
20:14justin_smith,(:any-keyword 'whatever :something-else)
20:14clojurebot:something-else
20:14justin_smiththat's how keywords work
20:14justin_smithyou want 'require' the function, not ':require' the keyword
20:15justin_smithoh wait...
20:15EvanRyeah, thats just the command that fireplace is emitting when i use the :Require command in vim
20:15justin_smithI totally misread
20:15EvanRim trying the no colon version to make sure it works
20:15justin_smithoh, :Require the vim command
20:15justin_smithyeah, just try it in the repl first, sorry - I don't know the vim commands so I was confused
20:16EvanRtry what exactly
20:16EvanRright now my requires work in intellij with :require because its inside of a ns macro
20:16EvanRit seems
20:16dustingetzi am a clojurescript newbie, i have a cljs project with one .cljs file that i want to include via a git submodule in a second cljs project
20:16justin_smithEvanR: right, that's now the ns macro works
20:17dustingetzhow do i configure the parent project's project.clj to know about the submodule
20:17justin_smithso, after (require 'gangway.google-cloud-storage :reload) runs, can you call foo as (gangway.google-cloud-storage/foo ...)
20:17justin_smithsubstitute an actual function of course
20:17justin_smithif so, use the :as version I described above to get a usable alias
20:17EvanRjustin_smith, yeah, that results in the same thing. which is: ClassNotFoundException com.google.api.client.http.GenericUrl java.net.URLClassLoader$1.run (URLClassLoader.java:372)
20:17nullptrdustingetz: so there are two project.clj files?
20:18EvanRjustin_smith, the require
20:18justin_smithahh
20:18dustingetzthat is correct, both are trivial other than standard cljs stuff
20:18justin_smithso, how are you specifying the class dependency for google.blah.GenericUrl?
20:19EvanRthe dependencies are listed in my project.clj
20:19nullptrdustingetz: i haven't seen that done -- normally they would be side-by-side and communicate via lein deps
20:19dustingetzHow can I do that, while keeping the git repos separate
20:19dustingetzjust a pointer in the right direction is enough
20:19justin_smithEvanR: and if you run lein deps :tree in the project directory do you see the artifact you expect in the output?
20:20EvanRjustin_smith, sorry, still getting used to this damned laptop keyboard
20:20EvanRcan you repeat that
20:20justin_smithlein deps :tree
20:20nullptrdustingetz: i suppose you could have each being a submodule with a parent that just organizes them, not sure if that makes sense in your case
20:20justin_smithif you run that in the project dir, do you see the artifact in there that would include that class?
20:21dustingetzthanks i think that's enough of a hint, thank you
20:23nullptrdustingetz: no problem -- did your work on react-cursor inspire a closer look at cljs?
20:23EvanRjustin_smith, no particularly, now that i look at project.clj, i dont even know what that would be
20:23EvanRnot*
20:24EvanRi assumed it was working in intellij due to some anonymous dependency
20:24dustingetzha! no, i'm just finally disentangled from all my javascript commitments
20:24EvanRthis error is about the first import in my file, but maybe its a coinsidence and i need to list the actual library
20:25justin_smithEvanR: how do you manage your deps with this project?
20:26justin_smithsorry, back scrolling, you are using lein and project.clj, I just mis-parsed a statement
20:26EvanRjustin_smith, theres a project.clj and intellij occasionally says "synchronizing leiningin"
20:27justin_smithEvanR: clearly the solution is to explicitly include the artifact that includes that google lib in your project.clj
20:27EvanRim still in the process of understanding what any of this even means
20:27justin_smithOK
20:27EvanRi dont see anything google relateed in my project so wtf
20:27EvanRi will try that
20:28justin_smithproject.clj describes your deps - all external code other than stuff that comes with the jvm should be specified there
20:28EvanRdoes the system support downloading and installing deps and using them without them being in that project.clj?
20:29justin_smithEvanR: it's possible, but it's not worth it, it's a pain in the ass
20:29technomancyis this cljs?
20:29EvanRi am realizing
20:30justin_smithtechnomancy: com.google.api.client.http.GenericUrl java.net.URLClassLoader$1.run (URLClassLoader.java:372) makes me think no
20:30technomancyoh gotcha.
20:30EvanRyou know what the ssue might be, there is a plausible dep listed in a project clj which is in a sibling dir to my project dir, but both are shown in the intellij file tree. maybe it is just downloading all deps in sight and treating this as one huge big project
20:30EvanRcljs?
20:30justin_smithtechnomancy: to me it looks like he was using intellij which was doing some magic with the deps, and is now transitioning to vim
20:30clojurebotcljs is not the place to be if you want your code to stay the same month to month.
20:30technomancyEvanR: one of your dependencies needs a dependency on a google lib or something maybe
20:31justin_smithEvanR: I bet that is it - but if your project uses an artifact, it should be declared in the deps of that project
20:31EvanRyes
20:31EvanRdoing it
20:32EvanRwould be really stupid if i dump a working vim environment because of something unrelated
20:33EvanRok vim took a little while to load, seems plausible
20:34justin_smithEvanR: were you using cursive previously?
20:34EvanRwhat was the command i was supposed to run, :Require did not succeed
20:34EvanRyes
20:35alexbaranosky_requie
20:35justin_smithyou may want to report what happened as a but in the project sync - cfleming is the cursive dev
20:35alexbaranosky_oops mistype... :)
20:35alexbaranosky_irc on the phone. uts a beautiful world
20:36justin_smith(require 'gangway.google-cloud-storage :reload) - and maybe just try this in a lein repl instance
20:36justin_smiththat takes out at least one point of failure
20:36EvanRok
20:37EvanRah
20:37EvanRnew error, cant load something else, also not in my deps i think
20:38EvanRlight at the end of the tunnel
20:38justin_smithshortcut: "lein check"
20:38justin_smiththat will compile all your namespaces, and report any errors
20:38justin_smithwithout any repl interaction needed
20:38EvanRreflection warnings
20:38justin_smiththen just chase down the missing classes
20:38justin_smithyeah, that too :)
20:38justin_smithI guess lein compile would be more straightforward in this case maybe
20:39justin_smithbut anyway, a missing class should throw an error
20:39EvanRthis particular program is doing a bunch of network and db connections at the top level, so its having trouble compiling because those remote hosts arent running, im glad you made me run that so i realize how much that needs to not happen
20:40justin_smithright, this would be a problem eventually no matter waht :) top level side effects are bad
20:41EvanRgotta love several shitstorms at once lol
20:42justin_smithheh
20:42justin_smithnow who lined up the feces and did the rain dance, you might ask?
20:44EvanRwhat the hell library is this supposed to be in
20:44justin_smithgoogle is often very helpful finding a mvn dep to go with a random class name, in my experience
20:45arrdemBronsa: is there a way to exclude class aliases?
20:45EvanRright
20:46Bronsaarrdem: what do you mean? exclude from the auto import?
20:46arrdemBronsa: yeah
20:46Bronsaarrdem: no, you have to manually ns-unmap them
20:46arrdemBronsa: use case being (defrecord Package)
20:46arrdemdamnit. okay thanks.
20:46arrdem(inc Bronsa)
20:46lazybot⇒ 63
20:47EvanRok all these deps were already in the project, i think something happened with git and they got reverted
20:47EvanRprobably my fault
20:47justin_smithahh, some weird git / intellij interaction then
20:48EvanRyeah, closing intellij right now
20:49arrdemBronsa: yeah that worked. thanks.
20:51arrdemBronsa: hey hey check this out
20:52arrdemBronsa: (do (ns-ummap *ns* 'Class) (defrecord Class []))
20:54mdeboardpwned
20:54EvanRi cant believe it, it all works now
20:54EvanRjustin_smith, thanks
20:54EvanRim probably going to be lurking here a lot for a while
20:55Bronsaarrdem: ummap?
20:55clojurebotI don't understand.
20:55arrdemBronsa: that's me failing at typing. unmap.
20:56arrdemthis may be a reloading related issue not a strict compiler bug, but that's killing my 1.6 instance
20:56Bronsaarrdem: uhm, it works fine on my repl
20:56amalloyyou and 700 other people, EvanR
20:57dbaschmost of us are bots
20:57Bronsaarrdem: I'm not sure I would recommend ns-unmapping java.lang.* Classes TBH. really weird things might happen w/ type hinting
20:57arrdemdbasch: speak for yourself. some of us have feelings.
20:58dbascharrdem: tell me more about some of us have feelings
20:58EvanRautomatic love
20:58arrdem(inc dbasch)
20:58lazybot⇒ 15
20:58EvanR(/ 99 0)
20:58dbasch&(/ 99 0)
20:58lazybotjava.lang.ArithmeticException: Divide by zero
20:58arrdemBronsa: https://github.com/clojure-grimoire/grimoire/blob/3c285da0e77b8d5e45d5be1b93e6bbf7b26be319/src/grimoire/web/api.clj
20:59EvanR(/ 99.0 0.0)
20:59justin_smithEvanR: inc is a bot command that only looks kind of like clojure code, it actually just mutates a database of karma
20:59EvanRoh
20:59justin_smithyou need , or & to activate the bots
20:59arrdemsome of us only get &
20:59justin_smith,(= (/ 99.0 0.0) (/ 99.0 0.0))
20:59clojurebottrue
21:00EvanR&(unsafe-launch-missiles :fort-knox)
21:00lazybotjava.lang.RuntimeException: Unable to resolve symbol: unsafe-launch-missiles in this context
21:00justin_smith,(launch-missiles! intern)
21:00clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: launch-missiles! in this context, compiling:(NO_SOURCE_PATH:0:0)>
21:00EvanRtime to figure out these god awful Meta-keycombos to do slurp and barf
21:01EvanRwhich do not work as advertised
21:01justin_smith,(= (/ 0.0 0.0) (/ 0.0 0.0))
21:01clojurebotfalse
21:01EvanRno NaN constants, as usual
21:02EvanR&(+ 4 NaN)
21:02lazybotjava.lang.RuntimeException: Unable to resolve symbol: NaN in this context
21:02EvanR&(+ 4 4.0)
21:02lazybot⇒ 8.0
21:03justin_smith,(= Double/NaN Double/NaN) ; EvanR
21:03clojurebotfalse
21:03EvanRah
21:04EvanRseeing double now
21:04EvanRdouble NaN gum
21:07dustingetzanyone know if lein cljsbuild compatible with lein "checkouts" directory?
21:08dustingetzas soon as I started using a checkouts directory to refer a sibling project, I stopped seeing js files for my cljs dependencies
21:08dustingetz*compiled js files
21:08EvanRjustin_smith, and if i try to use [d to jump to definition for symbol, i get ClassNotFoundException clojure.repl java.net.URLClassLoader$1.run (URLClassLoader.java:372)
21:10justin_smiththat's very weird - try (require 'clojure.repl)
21:10justin_smithand if that makes it work, maybe report an issue with fireplace
21:11justin_smithafk going out to a show
21:12sevvieArcadia is very impressive.
21:13EvanRit works thanks
23:42ddellacosta,(println "hello")
23:42clojureboteval service is offline
23:51quizmei'm trying to use subseq on a sorted-set of hash-maps, sorted by a particular key, but it doesn't seem to be working. can somebody give me an example of how to do this?