#clojure logs

2013-05-23

00:01tomojthere we go https://www.refheap.com/paste/19106d9f53136ada764dd4792
00:01tomojugly! :)
01:02ivandid korma's defentity go away with no doc update?
01:03ivanoh, it's in korma.core now
01:03ivanheh, c3p0 tries to repeatedly load the postgresql driver when it doesn't exist
01:04ivanI'm sure it'll show up in the classpath any day now
01:33sinistersnarehey, when i type the code into my text editor, it returns a syntax error, its from this page: http://java.ociweb.com/mark/clojure/article.html#Vars
01:34sinistersnarealso, what does (def ^:dynamic v 1) do? i understand it makes a variable, but what does the ^:dynamic do?
01:35tomojforking I think https://www.refheap.com/paste/d4c12399534de8b4938e4f3ac ...
01:35tomojer. https://www.refheap.com/paste/74d4de4330a2bbc3fc71ed29d
01:35sinistersnaretomoj: what?
01:36tomojwasn't responding to you
01:37tomoj^:dynamic lets you give the var a thread-local binding
01:38sinistersnarecan you explain why that gives me a syntax error?
01:38sinistersnaretomoj: forgot to site you
01:39sinistersnarecite*
01:41ivansinistersnare: give us your REPL history
01:42tomojsinistersnare: only if you upload the code and the entire error at refheap.com
01:42sinistersnarei gave you the link
01:42sinistersnareits that entire thing
01:42sinistersnarei put it in my text editor
01:42sinistersnareand hit run
01:42ivanthe page does not include the error or what your REPL received
01:42sinistersnareits not in the repl
01:42sinistersnareits ran
01:42sinistersnarefully
01:43sinistersnareoh hold on
01:43sinistersnareit may be something else
01:43sinistersnareok
01:45sinistersnarehow about another question: how do you run a clojure program? do you do it thru lein? or how can i add clojure to my path to run it
01:45ivanyes, run it through lein
01:45sinistersnarewhat command?
01:46ivanlein repl, lein run, lein test
01:46ivansee lein help
01:46sinistersnareoh thanks, i put in an invalid command, and it gave me suggestions, and i thought those were all the commands
01:47sinistersnareivan: im sorry for so many questions, never done this before
01:47sinistersnarebut it says i need to define a namespace?
01:47clojurebotsingle-segment namespaces are unsupported. (foo instead of foo.core) they may work in a few circumstances, but you shouldn't rely on them.
01:48sinistersnareclojure: whats a namespace needed for?
01:48sinistersnareis it that namespaces are required unlike in java where it just goes to the default package by defaultt?
01:49ivanif you use lein new myproj your files should have a namespace
01:50sinistersnareanyone?
01:50clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
01:50sinistersnareclojurebot: i am... im guessing youre a bot, so i dont know why im replying
01:52tomojmost vars have namespaces
01:52tomojso if you want to def a var, you need a namespace
01:52tomojthere is a user namespace by default in the repl
01:53tomojyou could just do stuff in there
01:53tomojbut if you are building a project you'll put all the code into namespaces
01:53tomojthen other projects can access your public vars through the namespace
01:54sinistersnareoh ok
01:54sinistersnareso i need to do what the top answer does here?: http://stackoverflow.com/questions/14027774/no-main-namepsace-error-while-running-a-web-app-in-clojure-using-noir
01:55tomojif you want to run some clojure with `lein run`, yeah
01:55sinistersnareok cool
01:55tomojyou could also skip the :main and (defn -main ..) stuff, just put some code in a namespace and load and run it in a repl
01:56sinistersnarepackage control for sublime text is pissing me off right noow
01:56sinistersnareok
01:56sinistersnarelemme try
01:56devndeploying to heroku is hard
01:56tomojdevn: custom buildpack?
01:56devnbarely any change to my code, redeploy, of course something is wrong.
01:56devnno, on the cedar stack
01:57tomojyou don't even know, then :)
01:57devnmy app connects to my elasticsearch database
01:57devni log it when it does
01:57devnbut then i make a request and i get a connection refused
01:57devnterrible logging, so no idea what's up
01:57tomojsrc/example/foo.clj: (ns example.foo) (defn foo [] 42)
01:58tomojin `lein repl`: (require '[example.foo :as foo]) (foo)
01:58tomojer, (foo/foo)
01:58tomojsinistersnare: ^
01:58sinistersnareoh ok lemme see
01:59sinistersnarecool
01:59tomojin the repl you can also do (use 'example.foo) and then just (foo)
01:59sinistersnaretomoj: what does the leading quote do?
02:00tomoj&(type 'foo)
02:00lazybot⇒ clojure.lang.Symbol
02:00tomoj&(type foo)
02:00lazybotjava.lang.RuntimeException: Unable to resolve symbol: foo in this context
02:00sinistersnarethats pretty nifty
02:00sinistersnareit evals it? cool
02:00tomojthe quote prevents it from being eval'd
02:00sinistersnareahhh
02:00sinistersnareinteresting
02:00tomoj(let [x 42] [[x x] '[x x]])
02:01tomoj> [[42 42] [x x]]
02:01devntomoj: sigh -- any ideas on debugging clojure on heroku? I'm running locally using the heroku config vars and everything works. i deploy and see the connection succeed. when I go to search it explodes with a ConnectException
02:01sinistersnarehow could i run the following in the repl? https://www.refheap.com/paste/14911
02:02tomojdevn: does `heroku run lein repl` work? :)
02:02tomojI'd be pleasantly surprised
02:03tomojwhat makes you think the connection succeeded?
02:03tomojwhat does 'succeed' mean?
02:04tomojthe biggest chunk of my uncertainty says you just don't have heroku authorized in your elasticsearch security group or whatever
02:21devntomoj: my own damn fault. slamhound was fun and all, but i made a mistake when reviewing
02:22devnhttp://getclojure.org/search?q=-%3E%3E&num=0 got a better analyzer on the index and query side
02:25devnit no longer supports AND, OR, and the host of other things, but it also means I can quit removing half of the features of the advanced query parser and see -, ->, ->>, /, \, etc work without incident
02:36sritchiedo you guys have any tips on how to concatenate two zipper data structures?
02:39nightflyconcat?
02:50supersymlt
02:50sritchienightfly: nope
02:50sritchienightfly: it'snot a zipper any more
03:07supersymwow...lighttable + enlive together is so sweet
03:11nibinhi all
03:12nibinwhat is the best path to learn clojure.. ? I am good in Java/Groovy
03:12nibinI have also tried learning scheme (SICP) but couldn't finish the book..will start again
03:12nibinthe problem is I am not able to think the problems in a functional way..how to solve this ?
03:13nightflyUse a functional language for a while
03:14nightflyI couldn't pick up haskell when I tried, but clojure I was able to manage because it doesn't force everything to be purely functional
03:14nightflyjust highly encourages it
03:15nibinhaskell is a language I tried long time back..failed to learn it
04:01xificurCanyone had issues creating a clean project via `lein new project-name` on windows? I get java skyrocketing to 180MBs of RAM and using up one whole cpu while not being able to ever finish the job, it just hangs on
04:09Pure_Loulouhello room
04:16Pure_Loulouhow do i force a peristentlist that might contains lazyseq,to realize
04:16Pure_Louloui want to track the time a function make to create the list,so i dont want it to have lazy members
04:18noncomxificurC: I use CCW and when my main prog hangs, the REPL is still there and yest, it can be hanging forever, taking up about that space.. and if I do not kill the java processess with the process man, they accumulate thhere
04:18noncomtends to be due to the fact that leinuses two jvms to do it's job, i think...
04:19noncomPure_Loulou: try (doall (your-lazi-calculation-here)
04:19noncom)
04:21noncomPure_Loulou: or you can try like (into [] your-persistent-col)
04:21Pure_Loulouok thanks noncom
04:22Pure_Loulouwhen i use (doall (function ...)) everything is calculated?
04:22xificurCnoncom: and no solution?
04:23noncomPure_Loulou: yes, examine docs for doall, doseq, dorun... also (into []) will force an existing col to be calced
04:24Pure_Louloui have read them but i dont trust them much :P,thanks
04:24noncomxificurC: I did not find a solution, but I did not look thoroughly.. I think that someone who knows leiningen well might know.
04:25clgvnoncom: there is a kill button for the current evaluation in CCW
04:32noncomclgv: yes, there is the eclipse "stop" button, and there is "interrupt" button in the repl window, but none of them help. I press interrupt, I press stop, then(!) I close the still running app of mine, which handles killing it's inner processes I'm pretty sure... and then there is one more java proc in the memory. and they accumulate with every run. what is interesting, each of them has an accompanying "conhost" process
04:33noncom* accumulate on every repl start
04:34clgvnoncom: interupt is the one I mean
04:35clgvnoncom: the "stop" button on the "console view" will kill the whole repl
04:35clgvnoncom: they work reliably on all of my machines. one machine I use 5 of 7 days.
04:36clgvnoncom: what is your scenario?
04:46lpetitHello: Which FTP client do OS X guys use ?
04:49clgvlpetit: good morning. how are you?
04:49lpetitclgv: good morning. Fine, and you ?
04:50clgvlpetit: fine and busy.
04:50clgvlpetit: whats new on the CCW front-line?
04:50lpetitYou may wonder why no new CCW release has occurred lately. It's simple: I haven't touch the code for a while. Instead, I've been working on full automatic build via maven, then I was on holidays, then I worked on automation of the publication
04:51clgvyou anticipated that question :D
04:51lpetitI expect to have a full tool chain by the end of the day. I should have done that months (years ?) ago, so I decided now's the time :-)
04:51clgvI didnt touch CCW code neither for quite some time ;)
04:52lpetitThen the next step will be to add some automated smoke tests to the build (via SWTBot I guess)
04:53lpetitclgv: fact is, I thought, that if I don't stop what I'm doing and do this boring but important stuff, I will never do it, and continue to lose time building, testing, etc. So I re-read my classics and kicked my (own) ass.
04:54lpetitSo … which FTP client for a poor OS X user? :)
04:54clgvlpetit: good. so all of CCW will be built with one maven command?
04:55lpetitclgv: yes.
04:55clgvhmm my reference os x user is not in our room right now...
04:56lpetitas easy as: git clone http://github.com/laurentpetit/ccw && cd ccw && mvn clean install
04:57lpetit(and drink a coffee or 2 the first time it downloads the Internet, of course ;-) )
04:59lpetitclgv: and so there will be revamped update sites : for stable versions, for beta versions, and for the latest successful build via the continuous integration (travis-ci)
04:59lpetitclgv: https://code.google.com/p/counterclockwise/wiki/UpdateSites
04:59testingtesterhi
04:59clgvlpetit: ah great
05:00clgvlpetit: you got your own server running for those sites now?
05:00lpetitclgv: yeah, and I bought the ccw-ide.org domain
05:00clgvor "soon" as it reads
05:01lpetitclgv: yeah, still playing with it, don't expect a public announcement today
05:01clgvlpetit: so I should revisit my repl enhancement branches in a few weeks ^^
05:01lpetitclgv: I resorted to good old filezilla
05:02lpetitclgv: sure, I won't touché them. Next release will probably just be a release to test that everything's ok with the new build toolchain (maybe just with one bug fix for good mesure)
05:14noncomclgv: i just pres ctrl+alt+s and the repl starts. then no matter how i shut everything down, the java process remains there.
05:14noncomclgv: just tried with almost empty file - same thing
05:20edolough1lpetit: Cyberduck is pretty good on OS X
05:20lpetitedolough1: ah indeed I saw it quoted a lot. Thx.
05:32testingtesterwhere can i get free book on clojure?
05:34clgvnoncom: I just did start a repl and close it. there is only the java process from eclipse
05:34edoloughlintestingtester: Some good pointers at http://www.elangocheran.com/blog/2012/03/the-newbies-guide-learning-clojure/
05:38devnhello all
05:39devnElixir's website makes me jealous
05:39devnClojure needs a similar Getting Started section
05:40noncomclgv: ok, i have found out something. when i close the repl, the repl does not stop. I can then reconnect to it and it will execute clojure forms like if all is ok.
05:41noncomi think that this is the source of this issue in the first place
05:42noncomclgv: also, maybe it is relevant that i use 0.13 beta
05:42noncomof ccw
05:45noncomclgv: interrupt command does nothing except for writnig ;; Interrupting... to the output. maybe it is used to interrupt some long-running calculations
05:45noncombut not to kill the repl
06:26llasramArgh, Delays don't implement IObj? What the hell
06:29tomojand if you make a new class force breaks
06:31tomojwhat would with-meta mean?
06:31tomojthe meta of the delay has no connection to the meta of the result I guess?
06:31llasramIn what sense?
06:31llasramYah
06:31tomoja less sensible thing occurred to me first :)
06:31llasramAh :-)
06:34clgvnoncom: switch to 0.12.3
07:27tomojsay you want to save off the &env in a macro and use it later
07:29tomojyou could just save the symbols
07:29tomojoh
07:29tomojI was worried if they have metadata you're going to evaluate that metadata multiple times
07:29tomojbut you'd just expand so that they wind up in binding position as appropriate, where metadata does not appear to be evaluated
07:29tomojI suspect I'm confused..
07:43asalehanybody using necessary-evil for xml-rpc? I have a few questions
08:22clgvI remember a private repository solution for jar artifacts with a web frontend that was either mentioned here or on the ML but I cant find the information. does someone know such repository applications?
08:32clgvare sonatype nexus and apache archiva the solutions to choose from?
08:36Anderkentclgv: there's also artifactory
08:37clgvAnderkent: ah thanx just saw it a minute ago in this feature matrix http://docs.codehaus.org/display/MAVENUSER/Maven+Repository+Manager+Feature+Matrix;jsessionid=411E8A348FE3F04C025E07FC988DD79E
08:37clgvAnderkent: do you use one of them?
08:38AnderkentI don't personally use any, I think we have a nexus local mirror, but I don't manage it at all
08:38nibinwe use archiva..
08:39clgveven with the matrix I am unsure what to use
08:42Anderkentclgv: that would mean they look equally good to you, so just pick any and try setting it up :P
08:42clgvAnderkent: or that I do not know which features are important ;)
08:42Anderkentor google for 'setting up {archiva,artifactory,nexus}' and see which one has best setup guides
08:43Anderkenthttp://www.gluster.org/2013/04/maven-repo-management-with-archiva/ seems pretty simple
08:58bordatouehello, I am trying to compile a java class file using lein 2.x , java file depends on few api .jar I had added the .jar references in :resource-paths and java-source-paths to point to my java class directory. However when I start the repl I still get compilation error saying it cannot find reference to the library required to compile the class file.
09:03bordatoueok, how do i set the classpath for lein javac
09:06luxbockI'm trying to use a small Java library for my project but I'm having trouble with calling it from Clojure
09:07luxbockI have compiled the java source code into a .jar, then added the directory where the .jar is located to my CLASSPATH, but Clojure still won't find the library in question
09:07clgvluxbock: can you use it a dependency via your project.clj? or the simplified question: is it available on http://search.maven.org/ ?
09:07luxbockit's not
09:08luxbockit's not so much a library as it is just someone elses code that I would like to use for my project but I'm not very good with Java
09:08clgvwill you need it permanently for your project?
09:08luxbockyes
09:10clgvthen build a minimal my-lib.pom file and deploy it on clojars.org - you can then add it as dependency to your project.clj
09:10xeqi* only if it has an appropriate license for distribution
09:10clgvhm right. I assumed an open source license
09:11luxbockis there any way for me to use it, even if just temporarily (I don't know if anyone else will ever use the program besides myself) without uploading it?
09:11clgvyou can install it in your local maven repository
09:12luxbockalright, thanks
09:12tomojclojure-metal -> llvm.js ?
09:12xeqiif you are using leiningen, you can install it in the local maven cache with lein-localrepo, or abuse :resource-paths if it really is only you
09:14luxbockI'd just like to try it out first so I'll try to do that
09:24bbloomtomoj: is closing channels manually really necessary? shouldn't the garbage collector take care of most of that?
09:25bbloomtomoj: https://groups.google.com/forum/#!msg/golang-nuts/pZwdYRGxCIk/qpbHxRRPJdUJ
09:34mefestoGood morning all.
09:35pterygotamorning! ridiculous newb question involving quil and interactive evaluation ...
09:40Pupnikjust ask pterygota no need to wait
09:41pterygotaI want to be able to reevaluate my defn from the emacs buffer while the quil app is running
09:42pterygotabut I get a compiler exception myfunction already refers to etc error when I do that
09:42pterygotathe only way I've figured out to get something like what I want is to do a (use :reload 'whatever.core) in the repl, but that starts a whole new app
09:43pterygotathe idea that I could actually achieve this came from example2.clj in the quil project source, where it says ";; here's a function which will be called by Processing's (PApplet)
09:43pterygota;; draw method every frame. Place your code here. If you eval it
09:43pterygota;; interactively, you can redefine it while the applet is running and
09:43pterygota;; see effects immediately
09:43pterygota"
09:43Anderkentpterygota: clojure 1.4 or 1.5?
09:44Anderkenthttp://dev.clojure.org/jira/browse/NREPL-31 seems to suggest this is fixed for 1.5
09:44pterygotalooks like I'm running 1.5.1
09:44Anderkentoh wait nvm
09:44Anderkenti misread the bug
09:45Anderkentpterygota: can you post the exact exception?
09:47jcromartieI like it when the code for a whole namespace fits on the screen
09:48pterygotaCompilerException java.lang.IllegalStateException: draw already refers to #'myproject.core/draw in namespace: user compiling:(NO_SOURCE_PATH:1:1)
09:49pterygotaso I'm thinking this is just something that I'm doing wrong because I have no knowledge of how to do the thing I'm trying to do
09:50pterygotathat's the message I get when I try to reevaluate the draw defn while the app is running
09:50jcromartiepterygota: are you just pasting it into the REPL?
09:50jcromartieor typing it in, i.e. (defn draw …) in the REPL
09:51jcromartiepterygota: try (in-ns 'myproject.core) first
09:51jcromartiethen (defn draw …)
09:51Anderkentpterygota: you have to evaluate your (defn ) in the myproject.core ns, not in the user one
09:51pterygotaI was doing a C-x C-e
09:51jcromartieyeah you need to change to the ns you want to evaluate in
09:52Anderkentdo (in-ns 'myproject.core) then evaluate that form
09:52jcromartieC-c M-n in NREPL
09:52pterygotaokay great yeah thats it, doing an eval-buffer gets me into the right ns
09:52jcromartieC-c C-k is good
09:52pterygotathen after that I can reeval to my hearts delight
09:52jcromartieto recompile a whole file
09:52jcromartiethat should do the trick too
09:52pterygotak noted
09:52Anderkentyes. So basically the problem was you were trying to evaluate a defn that would hide a function imported from a different ns
09:53pterygotaokay, that makes sense and is meaningful to this total newb
09:53pterygotathanks so much!
09:57luxbockhmm I managed to add the file via 'lein localrepo install' and I can see it with 'lein localrepo list -f'
09:57luxbockand I used 'lein deps' afterwards in the project directory after having added the file as a dependency for my project
09:57luxbockbut yet I still can't call it from the REPL via import
09:57luxbockdid I miss something I was supposed to do?
09:58clgvluxbock: you import classes from the jar right? you do not try to import the jar-name?
09:58pandeiroif i do (defroutes a (GET "/" [] :foo)) and (defroutes b (GET "/abc" [] :bar)) and then (defroutes app (wrap-middleware a) b), why does the wrap-middleware affect 'b'?
09:59luxbockyes, the Java file in the class declares itself as: package pokerai.game.eval.indiana;
09:59luxbockso I'm trying to (import '(pokerai.game.eval.indiana))
10:00luxbockor (import pokerai.game.eval.indiana)
10:00clgvluxbock: that wont work. you need to import the class not the package
10:00luxbockahh
10:02luxbockyeah that does it, thanks!
10:05Anderkentpandeiro: it shouldn't. Do you have an actual example?
10:06pandeiroAnderkent: i would need to extract it from my actual project, let me see
10:07jjttjjany particular reason why cljx doesn't seem to be catching on as much as lein-cljsbuild crossovers? the former seems much more flexible and I'm not really seeing any reasons why someone would prefer the latter
10:07pandeirowhat is happening though is that the middleware affects subsequent routes, so if I do (defroutes app b (wrap-middleware a)), b is no longer effected
10:10pandeiroAnderkent: if u don't mind sorting through my app's gobbledygook, here's what i'm using: http://sprunge.us/dMAh?clj
10:10pandeiroi'm still not fully understanding how routes and middleware can (and can't) be composed, i guess
10:12pandeiro(if i list the dashboard routes and their middleware *above* the auth routes, i get an endless redirect loop)
10:15pandeirothinking about it, i guess it makes sense... defroutes is just compiling a sequence of functions to try on the request map one after another, so if the first results in a redirect w/o auth, i never break out of that loop
10:16pandeiroso i guess the question is, besides putting that middleware-affected collection of routes last, is there another way i could set up that authenticated-or-redirect-to-signin as middleware?
10:30gtrakpandeiro: defroutes doesn't do anything special, think of compojure's 'routes' as a big 'some' across a nil-punning contract.
10:30gtrakeach 'GET' or whatever just returns a function that follows that contract
10:30gtrakthe 'some' bit in 'routes' handles the composition
10:30pandeirogtrak: k yeah i'm grokking that
10:31pandeironow i'm just trying to see where in that sequence of functions to put redirects
10:31pandeirowhen the user isn't authorized to get a particular route
10:31pandeiroso that i don't have to write that logic into each particular handler
10:34pandeiroi could just have the wrap-admin-only middleware return nil, but then where do i execute the redirect? (i have catch-all type routes for serving resources and 404/500 at the end... what i want is for the user trying to access a privileged route to simply be redirected to the login page)
10:34pandeiroi think i will separate the main route / and the privileged access json routes and handle them differently
10:35pandeirosorry for spamming the channel with my sluggish brainstorming :)
10:36gfredericksdoes it sound plausible that clojure error messages and docstrings and code comments aren't well developed because most people don't consider it worth the effort to do the JIRA thing for any particular small improvement?
10:38noidinot just the JIRA thing, but the send-the-contributor-agreement-by-postal-mail thing
10:38gfrederickswell that's a one-time thing
10:38gfredericksI guess I'm asking about the people who've already done that
10:38noidiit seems that sending a letter to the US can be quite expensive from some countries
10:39gfredericksI was just wondering about alternatives to the jira process. maybe some sort of batch ticket based on a github fork w/ pull reqs
10:40gfredericksthat might still require separate patches to give everybody credit though :/
10:41clj_newbHi, it is possible to create an array of functions? to pass to a variadic function as a parameter
10:42gfredericksI'm having trouble interpreting those two sentences together
10:42gfredericksin any case yes
10:42bbloomclj_newb: your question is really hard to parse, but i'm gonna assume you need to know about ##(doc apply)
10:42lazybot⇒ "([f args] [f x args] [f x y args] [f x y z args] [f a b c d & args]); Applies fn f to the argument list formed by prepending intervening arguments to args."
10:42clj_newboh, sorry, trying to use fancy words here hehe
10:42tomojI assumed he meant a variadic java method, but then why is it taking an array of fns? :)
10:43TimMcgfredericks: Absolutely. Well, Jira is one part; I think Rich is hostile to code comments and detailed docstrings.
10:43gfredericksTimMc: hostile to contributions of them?
10:45clj_newbwell, just learning clojure, I came across this doubt, with the function (fn f[n & fs], if I try to call like (f 4 [inc -] it takes the second argument as a vector (because it is)
10:45gfredericks(apply f 4 [inc -])
10:45clj_newbthanks gfredericks
10:46clj_newbbbloom: and tomoj thanks too
10:46clj_newbsorry
10:47TimMcgfredericks: Not just contributions. I think he would consider them clutter or something.
10:48gfredericksI guess this kind of muttering is where clojuredocs came from
10:56bbloomtomoj: ok so i'm attempting to port this: https://github.com/lintide/GoConcurrencyPatterns/blob/master/googleSearch05.go
10:56bbloomit's kinda tricky :-)
10:57bblooma few issues: 1) i'm not sure i like how alt works, it feels verbose 2) it's idiomatic in go to write blocking code, but with the async block you get channels instead of values more often than you'd like 3) i'm concerned about unwrapped <! operations being unportable to cljs
11:04bbloomtomoj: https://www.refheap.com/paste/14917
11:04bbloomdoesn't work b/c alt is throwing an error
11:05bbloomalso, that's a DIRECT PORT. uses transients for the mutable results collection
11:05bbloomobviously that won't work on cljs b/c of the blocking reads
11:15pjstadigprotip: (:map :id foo) doesn't really do the same thing as (map :id foo)
11:24jaleyanyone here experienced with aleph? I'm getting a nullpointerexception from some intCast() in http.core but can't figure out what's going on
11:25gfredericksany guesses how to get C-u C-x C-e to pretty-print (nrepl.el)?
11:25gfrederickspjstadig: crap I gotta go change all my function calls
11:25yogthosdoes anybody know if lein has some way to do namespace exclusions when creating the jar?
11:30trptcolinyogthos: file exclusion regexes are an option (:jar-exclusions)
11:31trptcolinbut no way to do a 1-1 mapping that i know of
11:31yogthostrptcolin: yeah I saw that one, was wondering if that was the best way to do it
11:31trptcolin[in case you had done something crazy like defined 2 nses in 1 file]
11:31yogthosoh nothing that bad :)
11:31yogthosI think I can just move my ns to test package instead
11:34gtrakpandeiro: I think your missing link:
11:35gtrak(routes (GET ..) (POST ..) (POST_2 ..)) is equivalent to (routes (GET ..) (routes (POST ..) (POST_2 ..)))
11:35gtrakso, you can compose functionality that way, ie a specific middleware
11:36gtrakin pseudocode (some pred [1 2 3 4]) = (some pred [1 2 (some pred [3 4])])
11:38gtrakthis is why I hate defroutes, it's easy to miss the point
11:38gtrakit took me some digging to figure out the actual contract
11:39gtrakthe second pred would be your access-control-redirect middleware
11:42gtrakI think of it like the linked-list portion of a hash-map lookup
11:43gtrakyou could always use a bigger hashmap and have more buckets, and have no need for a list-traversal
11:57justin_smith"parsing html? sorry, that's for the parsers union, we regexes aren't allowed to handle that, union rules"
11:58gfredericksdo a web crawl, figure out what the deepest html tree is, and then write a regex that handles one level past that
11:58justin_smithheh
11:59TimMcregex + stack can parse HTML just fine
11:59TimMcOf course, what you have now is a pushdown automaton.
12:00gfredericksthe playground bully of automatons
12:00pandeirogtrak: thanks a lot for the explanation, i've just sketched out a whole new route scheme and it's working exactly how i want it to :)
12:01gtrakexcellent :-) glad that was helpful
12:04noncomclgv: hi again! so don't you have any more ideas on why java processes are hanging there? hem are repls - i can reconenct to them if i close the repl window. as i see, there is no way to actually kill a repl from ccw.
12:04noncomi'm using 0.13 beta
12:05clgvnoncom: in 0.12.3 closing the repl view shutsdown the whole repl
12:05noncomclgv: yes i too remember that it was so. maybe it is a 0.13 bug?
12:05clgvnoncom: you should use the stable updatesite. the beta update site is for developers
12:06clgvnoncom: might be a not completed feature
12:06noncomclgv: i had to use this development version because it has some features in project management that i make use of.
12:06clgvnoncom: huh? which?
12:10clgvnoncom: I do not see related feature commits on github
12:10noncomclgv: something with the run config. it would not find java library classes, i got like "ClassNotFoundException com.jme3.app.SimpleApplication java.net.URLClassLoader$1.run (URLClassLoader.java:366)" with 0.12, and atkaaz in clojure google group adviced to move to 0.13
12:10noncomupdating relly resolved the problem
12:12noncomdo you think this is a mistake?
12:12clgvnoncom: when did you get that exception? maybe you just had an error with your project.clj or something...
12:13noncomlgv: well, as ar as i remember, solely updating to 0.13 solved the issue. in my project.clj i have :resource-paths ["lib/*"] and it won't find the jars there, with this error message.
12:13noncomsry keyboard issue with typing your nic
12:15noncomi am using a bunch of jars that arent on clojars
12:15noncomturns out to be a real pain in clojure world
12:15clgv~repeatability
12:15clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
12:15clgv;)
12:15noncom:D ahahah
12:15noncomyeah
12:15clgvit saves you from much pain later on ;)
12:16noncomagree, but then i wish clojars pushing was easier.
12:16clgvit is pretty easy
12:16clgvI did it with pure java projects myself...
12:17clgvnoncom: humm might be that 0.13.0 beta has a more recent leiningen version - I dont remember that wildcards where allowed in resource-paths
12:17justin_smithgpg will hold your hand through creating a key
12:18noncomi could not find a definite step 1-2-3.. instruction anywhrere, and in clojure user group nobody really told me too. that solution is the best what community adviced... see, the library i use, a 3d engine, is a set of 30 jars and in order to push them i have to invent to much stuff.. all these pom descriptions which are not used in there... and asking the creators to do this is useless - they dont care
12:19noncomyeah, probably the wildcards thing is really a leinengen thing, not directly a ccw issue
12:20llasramI'm pretty sure that the `resource-paths` are just directly added to the classpath. So if the JVM interprets the wildcard, it should work.
12:20llasramYou can do `lein classpath` to see what the constructed classpath looks like
12:20noncomoh and about clojars: i spent about 2 days trying to figure out what to do, searching instructions on internet
12:21ianeslickProtocol design question. I'm writing a proper inspector for nrepl and want to extend it so you can easily implement inspectors for new types like Datomic Entities.
12:21ianeslickCurrently I pass an 'inspector' object to a render method for each primitive type (inspect inspector value) => inspector
12:21noncomllasram: yeah, probably, maybe i will try to use 0.12 with classpath in the run config. as i remember, i tried that with 0.12 and it did not work. but i'll setup a testing environment for that to check again.
12:22ianeslickSo the method knows about the internals of the inspector object and maintains the inspector invariants
12:22ianeslickI can modify this as a protocol method (inspect [obj inspector]) and keep the same approach, but then it feels like protocol extends need to know too much about inspector internals.
12:23llasramnoncom: Run config?
12:23ianeslickSo perhaps a protocol for extracting the primitive elements so there is no inspector object being passed into the protocol methods...
12:25llasramianeslick: Why `inspect` function implementations need to know about some sort of `inspector` object?
12:26ianeslick(defprotocol Inspectable
12:26ianeslick "Types implementing this protocol can be inspected by the nREPL inspector"
12:26ianeslick (header [obj] "Key-value pairs describing the object")
12:26ianeslick (inspect-shape [obj] ":atom|:seq|:map")
12:26ianeslick (contents [obj] "The value to render; a seq if :seq or a seq of pairs if :map"))
12:27ianeslick(Mostly talking out loud here, didn't like a protocol that depended on an inspector. Don't use protocols much so thinking through the design space)
12:27technomancyprotocols are really not the right thing for this
12:27ianeslicktechnomancy: why not?
12:27technomancybecause inspecting is I/O bound; dispatch speed is not an issue
12:28ianeslickHow to solve the dependency injection problem for things like Datomic Entities so they can more easily be inspected (because even slime didn't get that righT)
12:29technomancyyou could search the classpath for namespaces under a specific prefix which contain defmethods to be loaded at boot
12:29ianeslickI've got most of a new inspector implemented, much simpler / more functional now I think but I want to be able to allow external libraries extend the inspector to make it easier to inspect custom state.
12:29llasramianeslick: I believe technomancy is expressing a preference for multimethods > protocols
12:30noncomllasram: yeah, the run config
12:31ianeslickI don't think I grok all the implications for load time resolution / extension of an inspector. For example we don't want project.clj to depend on nrepl-inspector to load a library, but we want a library to provide support for customized inspection if the nrepl-inspector is loaded in your profile.clj
12:31llasramnoncom: Er. I meant: what is "the run config"?
12:32technomancyright; you would put the inspector in your user profile and it would detect any other inspect-method-providing namespaces on the classpath somehow and load them
12:34ianeslicke.g. (ns inspector.ext.datomic (:require inspector.methods :only [inspect])) is loaded if inspector core is present, otherwise that file is ignored so while it depends on the inspector for namespace resolution, it is ignored in cases where the inspector is not present?
12:34noncomllasram: it is a part of project run configuration in eclipse
12:34technomancyianeslick: right
12:35llasramnoncom: Ohhhh. Well, have fun with that :-)
12:35noncomllasram: hehe :) thanks
12:38llasramI wish CCW's Leiningen integration just did everything via Leiningen. The people on my team trying to use CCW have run into all kinds of weirdness from e.g. CCW launching REPL JVM's itself
12:38ianeslickHmmm...
12:39ianeslicktechnomancy: I guess I have to change the multimethod dispatch to return primitive types so it's generic?
12:40technomancyor at least fall back to types
12:40llasramWouldn't the dispatch function just be `type`?
12:41ianeslickIt can be convenient to use type predicates for things like numerics.
12:42llasramYou mean like: (if (number? x) ::number (type x)) ?
12:42ianeslickbasically
12:42llasramThat makes sense
12:44ianeslickJust means we can only extend the inspector for concrete types, but that's the same as protocols.
12:44ianeslickGood enough for now
12:45ianeslicktechnomancy: thanks
12:45llasram##(type (with-meta [:what-am-i?] {:type :whatever-i-want}))
12:45lazybot⇒ :whatever-i-want
12:45ianeslickllasram: Ah, good point
12:46ianeslick:default (or (:inspector-tag (meta obj)) (type obj))
12:52ianeslickThere is probably good work along these lines in Lightroom, now that I think about it.
12:52ianeslickOops, lighttable
12:57ianeslickMycroft is interesting, unmaintained though.
13:00vrmanOk guys, I've just started learning clojure and I don't get the point of keywords
13:01vrmanWhy not just have quoted literals?
13:01ianeslickvrman: quoted literals (you mean symbols) are namespace specific
13:02ianeslickvrman: keywords also double as functions, so it makes for a nice convention for accessing associative objects
13:02vrmanOh kewl. Thanks man
13:03nDuffvrman: ...also, being automatically interned means identity comparison works for them
13:03technomancyright; symbols are not singletons, because they have to be able to carry metadata in order to be useful for building code out of
13:03technomancy(line/file positions, etc)
13:04hiredmankeywords roundtrip through printing and reading
13:10clgvcan I get the bytes of a double array to write it to a file as one?
13:11gfredericks8 bytes per double?
13:12pepijndevosThis would be fun in C.
13:12clgvwell. in C++ I'd just cast ^^
13:12gfredericks,(.toHexString 7.4)
13:12clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: toHexString for class java.lang.Double>
13:12noncomin proxy how can i access "this"?
13:12gfredericks,(Double/toHexString 7.4)
13:12clojurebot"0x1.d99999999999ap2"
13:12gfrederickswat
13:13pepijndevosclgv: http://stackoverflow.com/questions/4485128/how-do-i-convert-long-to-byte-and-back-in-java
13:13clgvI just saw that in "kryo" the default array serializer for double arrays writes the doubles one by one
13:14tomjackguava primitives doesn't even do that :(
13:14llasramclgv: The JVM JIT makes it faster than one would naively expect
13:14clgvbut it is the function that needs most of the time according to the profiler
13:15pepijndevosclgv: so you;re looking for a faster way to do the whole aray at once, like a C cast?
13:15llasramAh! Numbers!
13:15clgvpepijndevos: indeed
13:15gfredericksllasram: how do they work?
13:15llasramI think with tiny magnets
13:16tomjackclgv: I think you'd need nio for that?
13:17pepijndevosThe ByteBuffer looks like the way to go :/
13:18gfrederickswhat is java.nio about?
13:18gfredericksnot clear from the javadocs what distinguishes it from generic java.io
13:18nDuffgfredericks: basically, not being horrid..
13:18nDuffgfredericks: ie. adding proper support for the select() call
13:18nDuffgfredericks: ...which the original java IO subsystem saw no need for.
13:19llasramclgv: I'm afraid I think you're out of luck. You might be able to do something crazy with JNI, but myself I don't know it well enough to know for certain you wouldn't end with a copy step
13:20pepijndevosI'm thinking of a way to is JNA to do some horrible thing to the array.
13:20pepijndevos*use
13:44gfredericksis there some sort of consistency with lein tasks taking arguments in -x style and :foo style?
13:45technomancygfredericks: :keywordy is better
13:46gfredericksother style is legacy?
13:46technomancyish
13:53stirfoois it possible to catch an exception thrown during macro expansion using clojure.test?
13:53stirfoothe thrown? predicate works fine if the exception is thrown in the expanded code
13:55technomancystirfoo: if your tests require code that won't compile, then your tests won't compile.
13:56stirfooah =)
13:57technomancyyou could test compile-time behaviour by compiling at runtime though
13:57dsabaninhey guys
13:58stirfoothanks technomancy, that's at least an option
13:59dsabaninstarting to learn Emacs here for Clojure development, can someone recommend a good plugin to manage the project files? Something with file tree browser
13:59mthvedtif you want a new kind of exception, is there something more clojure-y than subclassing Exception in java
14:00mthvedtor proxying
14:00dsabaninmthvedt check out https://github.com/scgilardi/slingshot - it's awesome
14:00technomancydsabanin: file tree browsers are not really a good use of screen space
14:00technomancymthvedt: use ex-info
14:00llasramdsabanin: Most Emacs users don't use that sort of thing, honestly. I know of ECB and Speedbar, but not of their current states
14:00llasramdsabanin: You might have better luck asking on #emacs
14:01dsabanintechnomancy well at least something like textmate's / sublime's Cmd + T command. Picking up files with C-x C-f is tiresome
14:01justin_smithdsabanin: I use ido
14:01technomancydsabanin: sure, check out find-file-in-project
14:01justin_smithido has fuzzy completion, which helps quite a bit
14:02dsabaninthanks for the suggestions, looking up
14:03justin_smithhttp://www.emacswiki.org/emacs/InteractivelyDoThings
14:03justin_smithbind C-x C-f to ido-find-file (I think you can do that via the custom buffer for ido)
14:05dsabaninjustin_smith checking, thanks
14:08rabidsnailCan you write methods in java that expect clojure functions on primitives? It looks like the requisite interfaces (O, D, L, OD, OL, …) aren't accessible from java code outside of that file?
14:08gfredericksthey aren't?
14:08rabidsnailthey're nested inside IFn
14:09gfredericksthey're public though
14:09gfredericksdoes clojure.lang.IFn.L compile in java?
14:10gfredericksI don't really know anything about nested interfaces but it would be weird if you couldn't get at it
14:10rabidsnailclojure.lang.IFn.L raises ClassNotFoundException in the repl
14:11rabidsnailso does clojure.lang.L
14:11gfredericksyeah the clojure repl is different
14:11gfredericksthe clj syntax for an inner class is clojure.lang.IFn$D
14:11gfrederickswhich works for me in the repl
14:11rabidsnailok, cool
14:12rabidsnailso if I `import clojure.lang.IFn.*;` in java I should be able to reference L as an interface?
14:12gfrederickshopefully
14:12rabidsnail:)
14:12gfredericksmaybe would have to do clojure.lang.IFn; and then IFn.L
14:13gfredericksjust let eclipse type it for you :P
14:13rabidsnailI'm not installing eclipse :P
14:13rabidsnailI'm only writing this one class in java
14:23gfredericksaw man I just spent a half hour trying to figure out why with-redefs didn't work
14:24gfredericksI had (defn foo ...) and (def bar (partial foo ...)) and redef'd foo and wondered why bar called the old code :(
14:25gfredericksdynamic runtimes are tricksy
14:25bbloomgfredericks: yup. use #'foo if you want that. or, better yet, avoid partial & comp for top level defns
14:26gfredericksbbloom: this makes me want even more a defn-partial that fixes this _and_ puts good metadata on the var
14:26gfrederickscould have a little lib of related macros
14:27gfrederickswould that be totally terrible?
14:27gfredericksseems lame to not be able to do functional programming
14:28technomancygfredericks: ML has this problem for all top-level definitions
14:28technomancythough I suppose if everything works like that you're less likely to let your guard down
14:28bbloomeh, if you're making a public function, you're gonna want a doc string & sensible metadata for arguments and things. if you use partial, you get a variadic function instead of real arglists. without runtime metadata for signatures, you can't sensibly create doc strings
14:29gfredericksbbloom: this is the stuff my hypothetical lib would address
14:29gfredericksthe semantics of HOFs with the benefits of defn
14:29technomancyyeah, partial blowing away arglists is a huge drag =\
14:29technomancynot a fan
14:29bbloomyou'd have to redef partial, etc
14:29bbloomb/c partial occurs at runtime
14:29technomancybbloom: more than that; you'd need to move metadata from vars to functions themselves
14:30bbloomyeah
14:30technomancywhich would be *awesome*
14:30gfredericksbbloom: I'm suggesting defn macros for this. defn-partial, defn-comp, and whatever else makes sense
14:30bbloomtechnomancy: and expensive
14:30technomancybbloom: can't be bothered to care =P
14:30bbloompersonally, i don't like any runtime code at the top level of my namespaces. i think it's a misfeature necessary for form-at-a-time evals
14:30bbloomit twarts static analysis
14:30bbloomthwarts*
14:31gfredericksis this an objection to my idea?
14:31bbloomso if you want to do it w/ a macro & look at the var metadata, sure
14:31technomancygfredericks: your idea is too good for clojure in its present state
14:31gfrederickso_O?
14:31clojurebotreverse psychology is even less rigorous than forward psychology
14:32technomancygfredericks: clojure throws away too much fn-level metadata for it to be practical IMO
14:32gfrederickstechnomancy: if it's a macro you can get at the underlying var
14:32technomancyoh, yeah I see
14:33bbloomseems like a lot of work b/c you're too lazy to write a function signature out for a public API :-)
14:33technomancyI'm just talking about partial behaving sensibly modulo reloading
14:33technomancywhich is different
14:33bbloomi appreciate the whole DRY thing as much as anyone, but macroizing every little redundant thing ever seems like overkill
14:33gfredericksbbloom: yes, doing anything too much is too much
14:34technomancyI agree in that you should probably just get in the habit of adding #' yourself
14:34technomancyjust like with defmulti dispatch functions
14:34gfredericksI feel icky when my app code has something that's only useful for interactive dev or testing
14:34bbloomtechnomancy: which dnolen won't let me add to cljs :-P
14:34technomancybbloom: I don't think I want to know
14:34tomjackbbloom: nice
14:34tomjackbbloom: alt doesn't work yet with async so it's hopeless for cljs for now I guess
14:35technomancyvars are my favourite part of clojure; programming in a variant that lacks them doesn't sound much fun
14:35gfredericksbbloom: let's make a slow fork of cljs
14:35gfredericksit'll have numbers and vars and namespaces and...
14:35bbloomgfredericks: ignoring full reified vars, i just wanted #' to produce an object that implements IDeref for interactive development purposes
14:35bbloomand IFn
14:36gfredericksthat doesn't sound like it would hurt perf when you're not using it
14:36bbloomgfredericks: that would still be fast b/c you'd only pay for the indirection if you explicitly wrote #'
14:36tomjackbbloom: oh and the <! hidden in fake-search won't get async'd :(
14:36bbloomtomjack: yeah, it will block :-/
14:36bbloomdoesn't seem quite ready for prime time yet
14:36tomjacknope. even if it were a macro or inline fn, the dispatch is on '<! not `<! for ssa
14:37tomjackI hope this causes rich to improve macros, but am not hopeful..
14:38gfrederickshow ofter do lein releases get minted?
14:38gfredericksoften*
14:38tomjackhttps://github.com/technomancy/leiningen/tags
14:39gfrederickswhat's the opposite of a power user? that's what I am with github
14:39technomancygfredericks: shooting for next week
14:39gfrederickstechnomancy: w00t
14:40gfrederickstechnomancy: colin and hyPiRion and I did a design thing last night and decided it was cleaner to keep the :main support of java classes and just get better errors
14:41technomancygfredericks: yeah, it's something we can delete in 3.0
14:48technomancymuhoo: speaking of jazz game soundtracks: http://www.gamemusicbundle.com/ <- jazz jackrabbit 1 & 2 =)
14:50tomjackanyone interested in remote pairing, there's a meetup for that in #pairprogrammers at 7pm PDT today http://www.meetup.com/remotepairprogrammers/
14:51muhootechnomancy: nice. woudln't really call it jazz tho. more like 90's synth music
14:51technomancymuhoo: but it has jazz in the name!
14:51technomancy(I haven't downloaded it yet) =)
14:51muhooi'm listening to their in-browser player. it's taking me back to korg M1's and alesis HR16's
14:52clgvjazz jackrabbit was awesome
14:55muhoosee, i'm not a gamer, i'm a musician. when it comes to coding music, i'm rather more partial to stuff like http://www.youtube.com/watch?v=30Acy8Z9jkw . or 90's acid-jazz of the soma.fm "groove salad" variety.
14:57devnspeaking of game soundtracks
14:57devni have some hot fire to share with you...
14:58muhoohttp://somafm.com/play/groovesalad <-- was my coding music staple for a long time
15:00devnhttp://www.youtube.com/watch?v=k-pG8Hq6T6c
15:00devnive got a beter one that i need to share with you
15:01devnit's the craziest, most jazz-fusion game soundtrack ive ever heard
15:01technomancyI actually don't play games much either; I just find music that works well for games works well for hacking.
15:02devni dont game at all
15:04devnBah! "The YouTube account associated with this video has been terminated due to multiple third-party notifications of copyright infringement"
15:04devnso sad.
15:05devnHa! Found it. This is pretty amazing chiptune music: http://www.youtube.com/watch?v=D_QXD8tjjpw&amp;list=PL758041D2D82928C7&amp;index=2
15:06TimMcFor jazz-ish stuff to listen to while programming, I use http://www.jamendo.com/en/list/a2225/increase-the-dosage ; for electronic/chiptune, I go to http://binaerpilot.no/
15:06TimMc(free downloads!)
15:07devnTimMc: Check this out: http://ubiktune.com/
15:07devnthis album in particular is rad: http://ubiktune.com/releases/ubi045-joshua-morse-waveform-3 -- listen to Turtle Dance 2 or C.S. Bossa
15:08TimMcThanks, I'll check it out!
15:08TimMcI need some hard-driving music today: I'm writing JMock tests. :-/
15:08technomancythe zeta force album from the ubiktune bundle was pretty great
15:09devntechnomancy: ha, I thought my interest in chiptunes was some kind of weird thing that other people wouldn't relate to or know about.
15:10technomancythis is my personal favourite though: http://ubiktune.com/releases/ubi028-big-giant-circles-impostor-nostalgia
15:10devnCool! I haven't heard this one. Thanks technomancy.
15:11technomancy=)
15:11devntechnomancy: i lost my irc buffer recently. RE: clucy and the bug you said you had fixed... Any word on that?
15:12technomancyI will have to copy these links somewhere; my new music ingestion queue depth is already dangerously high with the retro bundle that was released today
15:12technomancydevn: I had it in a stash, and the upgrade to lucene 4 which just happened broke it
15:13technomancyit wasn't a bug fix, just added the ability to set a custom analyzer on a per-field basis
15:13devnI think my situation may have been different looking back -- I was trying to use the query-string parser and allow people to type in things like ->>, \, /, +, -, etc. and finally realized I should just quit messing with it and opted to use terms queries instead
15:13devntechnomancy: gotcha
15:14devntechnomancy: /go clojurebot
15:14devnwhoops
15:15technomancydevn: I can gist the stash if you want to have a go at it, but I don't think I have the bandwidth to merge it right now
15:15devntechnomancy: i'd be down to take a peek
15:15technomancyactually I should put it on a branch
15:15devntechnomancy: I'd be very open to suggestions on getting the best results out of the data I have: https://github.com/devn/getclojure/blob/master/src/getclojure/search.clj
15:16technomancyhm; actually I didn't get that far
15:16devnI was messing with a dis-max query last night that included some fuzzy-like-this-field and more-like-this-field stuff, but I'm not much of a search expert.
15:17devnI should probably quit reading elasticsearch docs (pretty sparse) and just go dig into clucy/lucene
15:17technomancylooks like this is just for providing a custom analyzer at query time, which might be what you want?
15:17devnelastisch's docs are better than the elasticsearch guide
15:17technomancyraw lucene is great for corpuses which will never outgrow a single node
15:17technomancydevn: https://github.com/weavejester/clucy/tree/analyzers
15:18antares_devn: thanks!
15:18devntechnomancy: that may actually have been my issue! i tried permutations until something worked. I was trying to set :analyzer "my_analyzer" on query-string and was getting errors
15:18devnantares_: for what?
15:19technomancydevn: cool. maybe you could get it merged with master =)
15:19devntechnomancy: maybe! :) I'm not exactly "free" much lately either. :\
15:20antares_devn: for the compliment about Elastisch's docs?
15:20devnoh, hey. I didn't know was you. Yeah, those docs are legit. I think I'll submit a PR to show some more examples of building up queries and using custom analyzers
15:21devnantares_: it took me awhile to figure out: "oh, right... I can do (q/filtered :query (q/dis-max :queries [...]))" or whatever
15:24antares_devn: yeah, using s-expressions for nested data structures is so unusual ;)
15:24devnantares_: one other thing I was thinking: a lot of the analyzers, filters, etc. take [& {:as options}] -- It would be wildly handy to enumerate the list of options in the docstring or merge the users' options with defaults
15:24antares_devn: it would be nice but there are so many of them and ES constantly adds new ones
15:24antares_so it's a massive undertaking
15:24devnantares_: yeah, i figured that was the case
15:25devnthey need a way to query for what options a damned filter, tokenizer, etc. can take and what the default values are
15:25antares_we can hopefully document most
15:26devnantares_: im guessing it's just a lot of "make-work" to look at the elastic source and type them out. I'd be happy to help, just show me how you want them done and I'll work on it.
15:26devn(as in, should they be in the source and merged with the user's options, or should they be in the docstring, or both?)
15:27antares_devn: I think we have some options in docstrings? If not, Langohr and Monger have examples
15:27devncool.
15:27antares_devn: you can pretty easily decipher it from ES's *Request and *Response classes, they follow a strict structure
15:27antares_I think any option that will have effect should be documented
15:28antares_but, of course, index or document-specific ones should be explained in general
15:28antares_like, "pass a document property name here"
15:28devnantares_: some of the elasticsearch guide is like: "WAT?" -- "This token filter handles most of the options as token filter XYZ, except some are different. It also has some extra options, but this isn't the complete list..."
15:28n_bWere resource scopes as discussed here: http://dev.clojure.org/display/design/Resource+Scopes ever implemented in any form?
15:29antares_devn: they are written by people who know how Lucene works for people who know how to use Lucene :)
15:29amalloyn_b: no
15:29antares_devn: the ES team is very much aware of that, they are working on the docs
15:30devnantares_: I would be completely comfortable with links to Lucene docs or source or something. They just sort of gloss over it. Their guide is certainly better than SOLR's, so they're on the right track!
15:30n_bamalloy: Thank you
15:30antares_devn: Lucene docs is a whole other can of worms
15:30devn:X
15:30n_bwasn't sure if they might have been in a core.* something
15:31devnantares_: haha oh my god. I hadn't even peeked at their docs. This is unbelievably daunting.
15:32devnhttp://lucene.apache.org/core/4_3_0/core/index.html -- *brain explodes when looking at the left pane*
15:32technomancylol frames
15:32antares_devn: well, it's a little bit more powerful than a K/V store ;)
15:33devnantares_: oh i know, that's totally fair, it's just like... whoa. I had no idea it was *that* big.
15:34antares_devn: Elastisch docs took over 2 months to write, a couple of hours every evening. Part of that was spent on testing examples and re-reading Lucene in Action, though.
15:34antares_devn: and there are holes in the docs, I was too bored to document yet another damn rarely used query type or filter
15:34technomancyLucene in Action is pretty good
15:34bbloomdevn: i used https://github.com/sunspot/sunspot for a rails app w/ active record & it was reasonably pleasant in taht horrifying active record does too much magic sort of way
15:35antares_technomancy: yeah, it's the best material on the subject, I'd say
15:37devnbbloom: ewwww! no sunspot for me! I chose to just use RSolr and manage my own solrconfig.xml, schema.xml, and add a hook or 3 for :after_save, :before_destroy, etc. and then implement to_solr on the model
15:38devnbbloom: to_solr is basically just a giant map: {'id' => id, 'solr_field_name' => some_method_or_val}
15:39devnantares_: i dont blame you. there's a ton to document.
15:40antares_devn: but now Elastisch runs a huge (one of the two largest) online newspapers so it was worth it :)
15:40nathanielkas a very new clojure developer clojuredocs.org is helpful and comes up high in google; but it appears to stop at clojure 1.3. is there a similar resource i should use if i'm working in 1.5?
15:40antares_well, parts of teh, more to come
15:40devnantares_: it also seems like it shouldn't be necessary to do that assuming elasticsearch updates their guide -- most of those functions just have a body of {:dis_max options} or whatever
15:41antares_nathanielk: no. Unfortunately, the new clojuredocs hasn't had much progress lately. It needs a complete rewrite to not be locked to a particular version.
15:41antares_nathanielk: there are http://clojure-doc.org and http://getclojure.org
15:42antares_devn: if you have a description for getclojure.org, we should probably link to it from clojure-doc.org
15:42devnnathanielk: i slurped a bunch of examples from clojuredocs on getclojure -- I'm planning to add ratings so we can get idiomatic examples moved to the top
15:43devnNOM
15:45amalloydevn: you were working on the data-collection for that like a year ago, right? i'm impressed you got it to work; could be a useful resource once you get sorting...sorted out
15:45devnantares_: I'm not really sure what to say other than: It has lots of examples, some idiomatic, some not. You can see the input, value, and output from an expression. If you're curious how other people have used function x in the past, you can look at getclojure.org and see.
15:45devnamalloy: this is like the first project I ever started in Clojure. I started this in like 2009 and just kept rewriting it as more libraries and what-not became available.
15:46devnamalloy: Patches and contributions are very much welcome.
15:47devn(not saying that in a snarky way at all) I could use some fresh eyes on a lot of it.
15:47nathanielkdevn: antares_ cool, thanks for the information.
15:47devnnathanielk: np
15:47akhudekin java, instance fields are public by default, no?
15:48amalloyakhudek: no
15:48amalloythey're package-private, which is a basically useless designation
15:48akhudekoooohh, that explains it
15:51bmentgeswhats the best way to learn clojure in your opinion ? besides the docs, are there any good references that introduces clojure to java/python programmers in a more quick fashion ?
15:52amalloyquick, someone recommend 4clojure.com so it doesn't look like i'm tooting my own horn
15:52justin_s`bmentges: I think the clojure koans are OK https://github.com/functional-koans/clojure-koans
15:52bmentgesjustin_s`: oh ive heard of koans and used it to learn ruby a while ago... thanks
15:52RaynesI hear if you drink the blood of a Rich Hickey that you instantly become a Clojure expert.
15:52bmentgesamalloy: thanks :)
15:53jcrossley3bmentges: +1 for both. i say start here: http://clojurekoans.com/
15:53naeg2
15:53devnRaynes: Then you get the mark of the beast. Hair like Rich and Ambrose.
15:53RaynesAmbrose has excellent hair.
15:53bmentgesRaynes: lol Rich Hickey has some lengthy videos out there... im not a watching lectures for hours fan :P but I could give it a try
15:53TimMcI think you also get a restraining order.
15:53devnbmentges: it's worth it man. I know a lot of people who say that, but just meditate for a moment, start the video and unplug your keyboard and mouse.
15:54devnamalloy: Raynes: yay 4clojure!
15:54devnjcrossley3: I didn't even know about that!
15:54devnjcrossley3: radical.
15:54RaynesMan, I always feel like devn is chewing on acid when he says things like that.
15:54bmentgesdevn: well, I will then. :) thanks
15:54TimMcdevn: By the way, I don't like all of Binärpilot's music; some of it is a bit too glitchy. Nordland is a very nice middle-of-the-road album.
15:54devnmaybe I am... @_@
15:55nathanielkthe koans were helpful
15:56devnRaynes: i want to be like this guy: http://www.youtube.com/watch?v=LhiIezSVJAY
15:57Raynesdevn: Heh, saw him on Tosh.0 recently.
15:58devnhe has a ton of videos, and he's not kidding around about it. i can't watch it and not crack a smile.
15:59devnalso, Raynes: http://www.youtube.com/watch?v=QvAkyoA7l4U
15:59devnimportant stuff.
15:59RaynesI revel in his surfer dude accent.
16:01Raynesdevn: http://www.youtube.com/watch?v=VLTkD8WI8VU
16:01Raynes<3 California
16:02jcrossley3bmentges: look at 4clojure *after* you've completed the koans. the trick to getting the most out of 4clojure imho is following experienced folks (eg amalloy) so you can compare your answers to theirs.
16:02bmentgescool
16:02bmentgesthanks jcrossley3 for the tips
16:03djwonki'm deploying to clojars for the first time. running `lein deploy clojars`. not sure why I'm getting asked for "You need a passphrase to unlock the secret key for ..."
16:03Raynesdevn: I used to watch this in Alabama and think that the running street/highway joke was silly, but people really seem to do that here. I've seen 10 minute long discussions about which routes to take to and from work.
16:14tcrawleydjwonk: lein is trying to gpg sign your artifacts using your default gpg key
16:14djwonktcrawley: ok, i deployed a snapshot version for now -- when ready I'll do the GPG stuff
16:15tcrawleydjwonk: see https://github.com/technomancy/leiningen/blob/master/doc/GPG.md
16:15djwonkI'm figuring out why Clojars is yelling at me for whatever I did wrong in my project :)
16:18TimMcbmentges: By the way, some of the people on 4clojure are code-golfing; not all of the solutions you see are good coding style.
16:18TimMc...but they should at least be interesting. :-)
16:20djwonktcrawley: thanks. is there a way to find who has signed my key? I asked a few people at ClojureConj last year.
16:20bmentgesTimMc: yeah, good warning, do you know someone that consistently writes good coding style in the solutions ?
16:20bmentgesjust to keep an eye and compare :)
16:20djwonki recommend the swearjure fork of clojure koans :P
16:21tcrawleybmentges: sure, search for it at pgp.mit.edu, then click through via the email address in the search results
16:22bmentgestcrawley: oops I guess that answer wasnt supposed to be for me lol
16:22tcrawleybmentges: oops. sorry
16:22tcrawleydjwonk: ^
16:22djwonktcrawley: got it :)
16:22bmentges:)
16:23bmentgesthanks for all the support... now im going to work hard here and watch 1:48:00 of rich hickey talking "clojure for java programmers - part 1" :)
16:23djwonktcrawley: no signers yet. I'll find some people here in DC next time
16:33jweissapparently this is bad. (let [[a b] (infinite-seq-fn)] ... ) i'm not sure what destructuring does internally but apparently that will consume the whole seq?
16:34jweiss,(let [[a b] (iterate inc 1)] a)
16:34clojurebot1
16:35jweisshm, that simple example works but my code which does something similar goes OOM
16:35gfredericksjweiss: destructuring shouldn't be the issue. some other subtle sort of head-holding maybe?
16:35gfredericksis there an explicit or implicit closure that has the seq in lexical scope?
16:36jweissgfredericks: yeah, i am doing tracing
16:36jweissbut i have some code in there to avoid consuming more of the seq than is already realized, when printing out seqs in the trace
16:37jweissi guess that does not work in this case.
16:37gfredericksa function can hold on to the head when you wouldn't naively expect it
16:37jweissnot sure why.
16:37gfredericksI'd have to look at your code to say for sure if that's relevant
16:40jweissgfredericks: why would head-holding matter? something has to be consuming more of the seq besides just the first two items in the destructure.
16:40jweissi would think it must be some failure in my trace code, that is supposed to avoid printing more of the seq than has already been realized (which in this case should be 2 items)
16:42jweissthe relevant code: https://www.refheap.com/paste/14931
16:50mefestohey all
16:51darrickwjweiss: would it help if you moved the lazy-seq up over the let in take-while-realized?
16:51mefestothinking about using enlive templates for a web project in an attempt to maintain a nice separation between designers and developers. has anyone applied enlive for this reason and can speak to their experience doing so?
16:52mefestoi've been enjoying hiccup but it's painful to have to re-translate things that designers come up with into the html. so im hoping enlive will help alleviate some of that pain
16:55jweissdarrickw: looking closer at the trace, i don't think that is the problem, i think gfredericks is right, but i'm not sure. what i see in the trace is, as expected, the first two items are taken in the let. more trace, moving into the let body, calling functions there. then later on i see the trace where a huge number of new items are taken. but i have no idea how that can happen, nothing is referring to the head.
16:55jweiss nothing is referring to the original seq at all.
16:56jweissi mean, if i have (let [[a b] (iterate inc 1)] ... ) there can't be anything inside that let that refers to the head, can there?
16:57robinkQuick question: What's the fastest way to turn [[:keyword "val" 123 456] [:anotherkeyword "Some" "more" "vals" 789] [:lastkeyword "Only" "one level" "of nesting"]] into {:akeyword "[val" 123 456] :anotherkeyword ["Some" "more" "vals" 789] :lastkeyword ["Only" "one level" "of nesting"]}?
16:57robinkI'm still playing with hiccup-style collections
16:58gfredericksjweiss: you get the OOM when you're not tracing as well?
16:58robinkOnly this time, rather than using nested fors that do a fixed level of recursion, I'm using the tools given by the API that'll transform a given vector (they all start with keywords) into whatever at any level of depth.
16:58jweissgfredericks: uh, i am not sure, i haven't tried it
16:58jweisscan try now
16:59robinkalso s/\{\:akeyword\ \"\[/\{\:akeyword\ \[\"/
17:00darrickwrobink: I think this might do it (->> data (map (fn [a & b] [a b])) (into {}))
17:00gfredericksjweiss: it doesn't look suspicious to me
17:00robinkdarrickw: I'll try it
17:00gfredericksdarrickw: robink: that function can also be (juxt first rest)
17:00amalloydarrickw: yeah, although (fn [a & b] [a b]) is (juxt first rest)
17:01amalloyfwiw i wouldn't use ->> there. it obscures the "main point", which is to make the thing into a map, by putting it at the end
17:01gfredericks"The savages from the amalloy tribe ran down the hill with their swords drawn, screaming of juxt..."
17:02darrickwOh you're right, it's one char shorter!
17:07hyPiRion,(reduce (fn [a [k & v]] (assoc a k v)) {} [[:a "hey"] [:b "yo"]])
17:07clojurebot{:b ("yo"), :a ("hey")}
17:08frozenlockI've made a script to run a clojure program at startup. Contrary to when I run it by hand, it seems the program can't fetch some data from the net (via https). Is there some kind of root commnand I need to run before running the clojure program on startup?
17:10frozenlockI also tried to run it from the NetworkManager (on new connection), and from the startup file. Both fail :(
17:10frozenlockOh btw, I'm on lubuntu
17:13rgrinberganyone has experience with clojure on gae?
17:15akurilinShameless newb question: I like the ruby/irb model of being able to require whatever gem I like that's been already downloaded onto the system. I'm trying to figure out if there is such an option with clojure, or if I don't have much of an alternative to creating lein projects with the right dependencies to place the right libraries on the classpath.
17:15scottjrgrinberg: there was a blog a year or two ago about a task program hosted on gae in clojure
17:15scottjrgrinberg: some assitant style program maybe by a german company.
17:16technomancyakurilin: you can use pomegranate to load code as you go for experimental coding. it's not a good fit outside exploratory exercises though.
17:16robinkLast question (gfredericks, amalloy, your variant of darrickw's suggestion works best): If (rest coll) returns a single value, what's the best way to unwrap it from a list? '(1 2 3) or [1 2 3] is fine, '(123) or [123] is less ideal.
17:17rgrinbergscottj: i'll try and look it up
17:17gfredericksrobink: conditionally unwrap you mean?
17:17robinkgfredericks: Right, I want to transform '(1 2 3 '(4 5 6) '(7)) into '(1 2 3 '(4 5 6) 7).
17:18akurilinakurilin, part would be exploratory repl usage, and the other would be perhaps along the lines of scripting. Is scripting really forcing clojure to do what it's not well suited for?
17:18gfredericks(fn [[a & b]] [a (if (= 1 (count b)) (first b) b)]) for the first/rest example before
17:18robinkgfredericks: Gotcha
17:18akurilinOops, redirected that to myself.
17:18robinkgfredericks: I assumed there was a clever way to conditionally unwrap, but I guess doing it explicitly is fine too.
17:18akurilintechnomancy, part would be exploratory repl usage, and the other would be perhaps along the lines of scripting. Is scripting really forcing clojure to do what it's not well suited for?
17:19amalloygfredericks: count isn't going to work well if the value for a key is (range) :P
17:20amalloy(defn length-one? [coll] (and (seq coll) (not (next coll)))) would be a more robust approach
17:21scottjakurilin: cljr was kind of like what you're looking for. (it appears abandoned though)
17:21jweissgfredericks: i do get the OOM even without tracing
17:22technomancyakurilin: I don't know what "scripting" means
17:22gfredericksrobink: it's subject to the same criticism as flatten
17:22gfredericks~flatten
17:22clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
17:22gfrederickssomewhat
17:22gfredericksduck-unwrapping :)
17:23jweissalthough oddly even without trace, the OOM occurs in clojure.core/print-map. i'll have to figure out what is calling that.
17:23akurilintechnomancy, something along the lines of "hey clojure take this random clj file that might have requirements beyond the standard library and run it without any sort of previous setup". I guess it sounds like pomegranate would handle that situation.
17:24technomancyakurilin: usually you would generate standalone uberjars for that
17:25akurilinscottj, I remember hearing Stuart Halloway mention that clojurescript might do that at some point soon, following the model of nodejs
17:25hiredmanhttps://gist.github.com/hiredman/5033484
17:26hiredmanstandalone clojure with shebang and pommy
17:26robinkgfredericks: No worries, I'm still fairly confident that the collection I'm operating on has a fixed level of depth, and well-known types.
17:29akurilinhiredman, what does the shell command to run that look like?
17:29hiredman./decay-db-dump.clj
17:29hiredmandumps
17:30akurilinOh awesome, that's pretty fantastic.
17:30akurilinI guess the only downside is the scary boilerplate header.
17:30hiredmanI run it on as schedule as one of those launchd job things
17:30akurilinBut what you gonna do :)
17:35robinkTrying to figure out how to shoehorn an if statement with conditional return values into #(juxt first rest) %1)
17:35akurilinOk another terrible question: say I'm running an app with lein ring server and I have a bunch of defs in the code. I read that defs are per-thread. Does that mean that the def is executed every time a new thread is spawned, or do all threads share the same ones through immutability until over overwrites it?
17:35hiredmandef is not per thread
17:36hiredmandon't re-def things
17:37technomancyderef, don't redef
17:37technomancy(should have done that as tired/wired; joke ruined)
17:37akurilin:)
17:38amalloytechnomancy: tired/wired? i don't even get the implied replacement joke
17:38akurilinWell I haven't run into a case where I need a thread-specific var value yet, so it's good to know that it's just one single value.
17:40technomancyamalloy: wired magazine sidebar thingy where they list things they think are hot and things that are lame
17:40amalloyah
17:40akurilinOn a different note, is there a true and tried approach for making lein ring apps init.d-friendly?
17:41hiredmanservlets
17:41hiredmantomcat or jetty as a init.d service, your ring app as ware file
17:41hiredmanwar
17:41hiredman.win 5
17:42technomancyakurilin: clojars uses upstart with a ring-jetty-adapter uberjar
17:42technomancyhttps://github.com/ato/clojars-web/blob/master/SYSADMIN.md
17:44akurilinOk cool, thanks you two. Options are good. I guess I should at least look into upstart, haven't spent much time with it.
17:44technomancycomplex deployments might outgrow upstart, but it's a simple way to get started
17:45llasramI'll +1 technomancy's solution, but s/upstart/runit/
17:46llasramupstart is pretty straightforward bad, but you pretty much can't get any simpler than runit
17:47technomancyI've heard good things about runit
17:47llasramer, s,bad,, in above (started to say "not bad")
17:47akurilinWhat's the reason for people to switch off of init.d generally speaking? Is it just the pain of writing init scripts for it?
17:47technomancythe only problem I've had with upstart is that restarting a job doesn't allow config changes to be applied
17:48technomancyyou have to explicitly stop and then start
17:48technomancythe idea that restart is different from stop+start is really stupid
17:48llasram`runit` scripts are pretty much literally the simplest things you can have -- just exec whatever process you want to be the service. And the runit service monitor will automatically restart services if they exit
17:49llasramIt's about as Unix-y as you can get
17:49lynaghkllasram: if you want Unix-y, look at daemontools
17:49technomancyisn't it a djcb classic or something?
17:50llasramYeah, runit is basically a re-impl of the ideas daemontools which plays slightly nicer with the FHS etc
17:50lynaghkllasram: ah, I hadn't seen it. I was reading the documentation on launchd this past weekend, and that looks very good to me
17:50lynaghkthough I have no experience using it outside of OS X
17:51technomancydjb I mean
17:51lynaghktechnomancy: yep.
17:52llasramI haven't looked into launchd yet... Probably about time to do another sweep of reviewing all the init system out there again
17:53lynaghkllasram: I revisited launchd after reading this blog post about systemd: http://0pointer.de/blog/projects/systemd.html unfortunately the author never clearly explains why he didn't think launchd was good enough, so I'm not sure what the particular differences are between those two.
17:53technomancysystemd is bonkers
17:53technomancyjust completely nuts
17:53lynaghktechnomancy: yeah? what about it?
17:53technomancylynaghk: it logs in a binary format
17:53llasramhuh
17:54technomancykinda feel like it's an exercise in lennart showing everyone how clever he is
17:54justin_smithas a linux user, one of the weirder aspects of learning to use osx for work was the whole binary systemd format thing
17:54lynaghktechnomancy: I'm not surprised about that, after reading that post.
17:55justin_smithnever mind, I was thinking of some other thing
17:55technomancylynaghk: he is a clever person, admittedly
17:55lynaghktechnomancy: ohh, there's even a line in the FAQ: "If you love launchdo so much, why not adopt that?" "launchd is a great invention but I am not convinced it would fit well into Linux..."
17:56technomancybut he's also the guy behind pulseaudio
17:56justin_smithlennart will never be forgiven for pulseaudio
17:56justin_smithfucking mess
17:57lynaghkSpeaking of DJB, I have been spending a bit of time desgining a redo-like build tool, and one of my design goals is that I think process execution should be a valid target, just like building a file.
17:57lynaghkbut I'm wary about reinventing the init.d/launchd/systemd/upstart wheel yet again (and in userspace)
17:58llasramlynaghk: OOC, what's the use-case you have in mind?
17:58justin_smithto poetter: to recreate something that worked well enough already in an overengineered and brittle "clever" replacement
17:59lynaghkllasram: OOC?
17:59llasramOut Of Curiosity. You know, as opposed to *inside* of the Curiosity rover. Not much room
17:59technomancyjustin_smith: the timing on that was the worst. just when alsa got to the point where it Just Worked always, that must mean it's time to throw it away and start over woooo
17:59TimMcclojurebot: OOC is "out of curiosity"
17:59clojurebotIn Ordnung
17:59TimMcERR_OUT_OF_CURIOSITY
18:00llasramnice
18:01lynaghkllasram: to build things, of course! =P In particular the work we do is spread across several languages and toolchains (mainly Clojure/ClojureScript with Ruby for HTML/CSS templating) and most of the tools I've seen are pretty language-specific silos. Redo has a very interesting design, but shelling out to build targets doesn't scale well with tools built in VMs with non-trivial startup times---i.e., the JVM, ruby with any gems, &c.
18:02lynaghkso basically I want to slice out all of the dependency tracking/management stuff into a single tool, rather than duct taping together a bunch of things that half-ass the job (e.g., "lein cljsbuild auto", "bundle exec guard", "lein midje :autotest")
18:03justin_smithlynaghk: so a dependency manager manager?
18:03llasramAhhh, I see. Interesting... Or maybe a tool for multilingual programming?
18:04lynaghkit's more of a lib than a tool; I want something that solves dependency tracking in a general, pluggable way.
18:04frozenlockOk so I have a little more details on my problem: when I run my clojure program at boot, (slurp "https://google.com&quot;) might return java.lang.nullpointerexception. Any ideas why? o_O
18:04frozenlockI don't know if it's a Clojure problem, a Java problem, or an OS problem... :(
18:05lynaghkllasram, justin_smith: an analogy: right now everyone is writing a half-assed implementation of gzip in their own programs because no one has written a suitable zlib.
18:06llasramlynaghk: I haven't used it in years, but how closely have you looked at SCons? It's about as far as you can get from the `redo` model, but has a completely flexible idea about what pretty much every step of the "build" process means
18:07Okasu,(str "Guys we need dependency " (clojure.string/join " "(repeat 3 "manager")) ". ")
18:07clojurebot"Guys we need dependency manager manager manager. "
18:07lynaghkllasram: I haven't looked closely at it---most of my reading has been on Redo and Tup. Thanks for the pointer
18:07bbloomllasram: build systems and dependency systems are subtly different…. even though build systems (generally) require a depdency system
18:08bbloomand then when you get to namespaces & modules, code presents very different (and more complex) problems for dependency management than build systems
18:08justin_smithOkasu: but then we would also need the dependency manager manager dependency manager, for when the various dependency manager managers have conflicting dependencies
18:08lynaghkbbloom: what makes them fundamentally different?
18:08bbloomcoherence.
18:09Okasujustin_smith: We are doomed.
18:10bbloomlynaghk: ok i can't find a good reference right now that isn't drowning in haskell and ocaml nonsense
18:10bbloomlynaghk: in short the problem is similar to that of protocols: two people can't define the same protocol for the same type
18:10bbloomlynaghk: the problem is similar to if you had two java apps load the same class file with a static variable in there
18:11bbloomdo you have two static variables? how do you differentiate? what if each library depends on different versions?
18:12lynaghkbbloom: that would be a problem with any kind of scheme that uses fixed (rather than content-based) addresses
18:12djwonklein question: can I push a new clojar if I don't change the version (currently at 0.1.0-SNAPSHOT)
18:12lynaghkbbloom: built artifacts at fixed places on the filesystem would have the same problem.
18:12bbloomlynaghk: it's worse than that. there is just no general way to resolve conflicting dependencies
18:13lynaghkbbloom: sure, but that's true for builds too.
18:13technomancydjwonk: yeah, that's fine. snapshots are designed to change.
18:13lynaghk("build" being traditionally interpreted as some process that makes some artifact at a place on the filesystem)
18:13frozenlock&(take 2 (slurp "https://google.com&quot;))
18:13lazybotjava.security.AccessControlException: access denied (java.net.SocketPermission google.com:443 connect,resolve)
18:13djwonktechnomancy: should I expect clojars to pick up the change pretty quickly?
18:13bbloomlynaghk: transient dependencies are just a fundamentally complex problem & there isn't an obvious solution, so each language community comes up with their own half-assed solution sorta out of necessity
18:14technomancybbloom: not without manual input as to where the right boundaries for isolation are anyway
18:14lynaghkbbloom: ah, I see what you're getting at. Yeah, really it's a problem for everyone except people using Nix.
18:14lynaghkbbloom: that is another avenue I'd like to explore, but I gotta take it one thing at a time =)
18:15technomancydjwonk: clojars will serve it immediately. clients will usually cache it for 24h, but you can use `lein -U deps` to force a fetch.
18:15bbloomnix doesn't magically solve the problem
18:15technomancydjwonk: simpler to just use `lein install` and skip clojars if it's on the same machine though.
18:15bbloomnix is nice though
18:15technomancynix has a natural unit of isolation already: the process
18:15lynaghkbbloom: all of the dependencies of Nix packages are content addressed; doesn't that solve the problem of transitive conflicts?
18:15bbloomand yes, a huuuge design improvement over most packaging systems
18:15djwonktechnomancy: thanks. should I expect the clojars Web UI to pick up changes quickly?
18:15lynaghktechnomancy: not Unix, NixOS.
18:15technomancybetween processes you're only ever sharing text
18:15technomancylynaghk: I know
18:16technomancyyou don't have to worry about changing formats of data structures typically because it's a lot harder to share implementation details
18:16djwonktechnomancy: b/c in my first deploy, I neglected to namespace the project (in defproject)
18:16bbloomlynaghk: no not really. it does solve other problems tho
18:16technomancydjwonk: there should be no delay in seeing it in the web UI
18:17lynaghkbbloom: we may have to Skype about this at some point, if you have time.
18:17bbloomlynaghk: technomancy: process isolation is helpful if your components are all communicating via pipes or sockets or whatever
18:17lynaghkbbloom: I can buy you all the beers when I'm in NYC in August.
18:17bbloomlynaghk: i had to make sense of .NET's absolutely insane class loader thinggie & how they solved this problem is kinda mind melting (and ultimately wrong)
18:19djwonktechnomancy: ah ha! the only non-namespaced project is still around. should I use namespacing or not? I see examples of both.
18:19djwonk*delete 'only'
18:19technomancydjwonk: depends on the name you are using
18:20technomancyif it is a common word you should probably use a group-id
18:24djwonktechnomancy: thanks. I don't think I need a group ID. should I clean up the other groups and names hanging around?
18:25technomancydjwonk: I can manually delete it if no one is using the bad name
18:27djwonktechnomancy: ok, please remove "com.bluemontlabs/validata"
18:28djwonk(yes, another validation library, just what we all need)
18:28technomancyhaha
18:28technomancyit's like test frameworks in ruby
18:28djwonkright
18:28technomancypoof
18:28technomancygone
18:29djwonkthey are easy enough to write and there are hundreds of ways to do it; therefore I'm surprised we have so few
18:29djwonktechnomancy: thanks
18:34technomancyno problem
18:38amalloydjwonk: so few? i'm pretty sure i've seen like ten of them
18:40RaynesTweet about downtime from the refheap twitter user that nobody knows about\n get followers\n take over the world\n ??????? \n profit!
18:41mischovConds sure can get ugly...
18:41djwonkamalloy: out of the possible validation library universe, only about 0.1% have been implemented
18:43djwonkbut, if anyone wants to make another, I've got a better name than validata
18:43djwonkvladinator
18:44technomancyheh
18:44mischovCan we skip to the point and call it Impaler?
18:44technomancynot bad as mascots go: https://upload.wikimedia.org/wikipedia/commons/thumb/a/af/Vlad_Tepes_002.jpg/220px-Vlad_Tepes_002.jpg
18:45seangrovemischov: Hrm, I think there's already vlad-the-deployer
18:45djwonkhe's ready for a Manning book cover
18:45justin_smithvladinator should have a special logging behavior - "THREE THREE FORMS FAILED TO VALIDATE"
18:46technomancydjwonk: how convenient
18:46justin_smith"AH AH AH"
18:46djwonkseriously, thought, some of the implementation details in the validator libraries are kind of intense
18:47djwonkmonads, for example
18:49robinkSo, now I have: (mapcat #(conj [] (first %1) (let [lv (rest %1)] (if (= (count lv) 1) (first lv) (vec lv)))) hiccup-vector)
18:51llasramrobink: What are you trying to do?
18:51robinkllasram: I'm trying to turn [[:a 1 2 3] [:b 4 5 6] [:c 7]] into {:a [1 2 3] :b [4 5 6] :c 7}.
18:52llasramWhy not `:c [7]` ? Uniform structure is usually easier to deal with, consuming as well as producing
18:54robinkllasram: A little hard to do since it's basically coming in from the transformed parse tree as [[:a 1 2 3] [:b 4 5 6] [:c 7]]
18:54robinkllasram: It would be more work to wrap everybody in a seq/vec.
18:54robinkllasram: Oh, output
18:54llasramExactyl
18:54llasramExactly, even
18:54justin_smith(into {} (map (fn [[k & v]] [k v]) input))
18:55llasramYeah, then you could do what justin_smith suggests
18:55robinkjustin_smith: Hm
18:55hyPiRionjuxt man, juxt
18:55robinkllasram: It's not critical, but it's nice to have a single value attached to a keyword if that's all there is.
18:55amalloythis conversation already happened like two hours ago
18:55llasramhah!
18:55robinkhyPiRion: Should I have gone back to juxt?
18:56robinkamalloy: I know that, I just ended up only managing to make it work with mapcat.
18:56hyPiRionrobink: well, pick the one which is most evident for you
18:56llasramrobink: Then I think you have what you want
18:56llasram~juxt
18:56clojurebotjuxt is a little hard to grok but it's the best thing ever
18:56robinkhyPiRion: OK
18:56hyPiRion~amalloy
18:56clojurebotamalloy is <amalloy> just use juxt, it'll be great
18:56seangrovehah
18:56amalloyi'm sure clojurebot knows more factoids about me than that; i dunno why that's the one that always comes up
18:57llasram~amolloy
18:57clojurebotexcusez-moi
18:57justin_smith,(into {} (map (fn [[k & v]] [k v]) [[:a 1 2 3] [:b 4 5 6] [:c 7]]))
18:57amalloybut maybe someone deleted the others
18:57clojurebot{:a (1 2 3), :b (4 5 6), :c (7)}
18:57llasram~amalloy
18:57clojurebotamalloy is the spotlight illuminating my dumb mistakes
18:57justin_smithrobink: see, it works
18:57robinkjustin_smith: aha
18:57llasramamalloy: Hey, you're right! I was honestly skeptical
18:57amalloyllasram: so was i. i PMed him six times and got juxt every time
18:57hyPiRionhm
18:57amalloyonly got spotlight after you did it
18:58amalloyi'm pretty sure he also used to know "amalloy is nuts for juxt"
18:58amalloy(a Raynes quote)
18:58llasramThere are worse legacies
19:00robinkBah, if I use juxt I have to nest #()s
19:00justin_smithnesting #()?
19:00robinkOh wait, no I don't
19:00hyPiRionthat's not possible (to next #())
19:00hyPiRionnest*
19:01robinkhyPiRion: I know that
19:02mthvedtis there a practical reason for no nested #()s, or is it an anti-smelly-code thing
19:02llasramWhat would the `%` in #(#(%)) mean?
19:05hyPiRionwhat would the % in (fn [%] (fn [%] %)) mean?
19:06mthvedtwell here's a question
19:06llasramWell, fair enough. So I guess the semantics would be obvious
19:06mthvedtwhat does the %2 in #(%#(% %2)) mean
19:07metellus,(#(inc %2) :only-one-arg)
19:07clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval31$fn>
19:08mthvedtbut does %2 belong to the inner or the outer
19:08hyPiRionmthvedt: well, it's not legal
19:08metellusbut if it was
19:08mthvedtadd args until it's legal, and re-ask the question
19:08metellus#(#(% %2) 1 2) or something
19:08mthvedt:P
19:09metellus(#(#(% %2)) 1 2) I mean... I think
19:09hyPiRionIt would probably make the outer #() a fn with two arguments, and the inner with two arguments.
19:09mthvedtthe outer could have 0 or 1 arguments
19:10mthvedtthe point is in those semantics the outer has an indeterminate number of arguments
19:10mthvedtand making it match the inner is un-lispy
19:10mthvedtthe way an expr compiles shouldn't depend on a subexpr
19:11hyPiRionmthvedt: as the reader works today, it's "dependent" on subexprs
19:11mthvedthypirion: but as an implementation detail
19:12hyPiRionsure thing
19:12hyPiRion,((#(fn [% %2] [% %2]) 1 2) 3 4)
19:12clojurebot[3 4]
19:13hyPiRionbut it's not evident, which is why it's not allowed.
19:16mthvedtwhat's the arity of #(+ #(+ % %2) % %)
19:16mthvedthang on
19:17mthvedt#(#(+ % %2) %)
19:17mthvedt#(#(+ % %2) % %)
19:18seangrovelynaghk: Did you ever play around with building a bigger app using cljs + angular?
19:18mthvedtno, that's also not right
19:18seangroveThinking about building a frontend to Kandan using those two together as a test project to see how it is
19:28robinkOK, now I have (into {} (map (juxt first #(let [lvals (rest %1)] (if (= (count lvals) 1) (first lvals) (vec lvals)))) [[:a 1 2 3] [:b 4 5 6] [:c 7]]))
19:28robinkWhich is still silly, it's destructuring and then restructuring and then destructuring the same data.
19:29justin_smithwanting to take c out of the list is a bad idea
19:29robinkjustin_smith: I don't lose :c, I lose the [] around 7.
19:29justin_smiththat is what I mean
19:29robinkjustin_smith: Output is {:a [1 2 3], :b [4 5 6], :c 7}
19:29justin_smitheventually you feed the data somewhere else, and it needs a special case for seq or non-seq input
19:30robinkjustin_smith: Except it knows exactly what it's getting
19:30justin_smithwhich just spreads the ugliness
19:30robinkjustin_smith: A ({:c 7} :c) will never be dispatched to a function expecting a vector.
19:30callenmuhoo: nice meeting you today! PM me your email so I can send you an article about AngularJS
19:31robinkjustin_smith: It'll always go to something that doesn't want to have to bother with unwrapping a seq with a single cell.
19:31callenRaynes: muhoo survived meeting me. Odds are looking good for you.
19:31djwonkHow can I debug "#<FileNotFoundException java.io.FileNotFoundException: Could not locate validata__init.class or validata.clj on classpath: >" -- this is my first attempt to use a library I pushed to clojars
19:31Raynescallen: muhoo is equally as nuts as you are. I am not optimistic.
19:32callenRaynes: really? I hadn't noticed.
19:33callenRaynes: OTOH, as we were walking around SF a curious path of destruction was left in our wake.
19:33callengood mexican food though.
19:34callenRaynes: I managed to explain my position on template libraries over lunch, so at least one person can act as interpreter for me now.
19:35callenin case I start speaking in tongues and crawling up the walls.
19:35Raynescallen: Pretty sure I'd just punch you in the face and run away giggling.
19:35justin_smithrobink: (juxt first #(let [lvals (rest %1)] (if (= (count lvals) 1) (first lvals) (vec lvals)))) is identical to
19:36justin_smith(fn [[k & [v & vs :as vals]]] [k (if vs vals v)])
19:36technomancydjwonk: it looks like you're trying to require a single-segment namespace; that's not recommended
19:36robinkjustin_smith: Oh wow, nice
19:36callenRaynes: lol
19:37callenjustin_smith: destructuring ftw?
19:37justin_smith<3 destructuring
19:37robinkjustin_smith: Indeed
19:37robinkjustin_smith: The nice thing about that one is it's actually explicit about the fact that what I'm wanting to do is destructure, not compose a bunch of function-returning functions.
19:38justin_smiththough I still contend that on principle it is better to treat items consistently and not have special cases for single element sequences
19:38robinkjustin_smith: 'k
19:38robinkjustin_smith: You're probably right, but coming from C it looks weird
19:39justin_smithit is about composability - special cases expnonentially increase the complexity of any code that interacts with them
19:40djwonktechnomancy: where would you suggest I make the change? in the `defproject` line?
19:40technomancydjwonk: namespaces are different from a project's artifact/group id
19:41djwonkok, but I see lots of projects using 'my-name.core'. that's what is not recommended?
19:41technomancy.core is kind of a crappy name, but it's better than a single-segment namespace
19:41djwonkwhere am I using single segment namespaces?
19:41technomancyyou can probably come up with something better since you know more about your project than `lein new` does
19:41amalloydjwonk: it's the least-creative solution possible to the problem that single-segment namespaces are bad news
19:42technomancydjwonk: you're running the equivalent of (require 'validata) somewhere
19:42djwonkd'oh. i am. got it now
19:42djwonktechnomancy: thanks
19:42lynaghkseangrove: yeah, we've shipped several client projects with cljs+angular, and we are going to be releasing an iOS weather app built on that stack
19:42lynaghkseangrove: there will be a big open source drop once the app is available for purchase on the various app stores =)
19:45frozenlockIf any of you is interested in my weird https problem, I've made a simple little test: https://github.com/Frozenlock/httpstest/blob/master/src/httpstest/core.clj On my main machine it seems to work flawlessly everytime, but on my other one the result is quite inconsistent.
19:45tomjacklynaghk: phonegap or?
19:46frozenlockThe uberjared file: https://dl.dropboxusercontent.com/u/40737386/httpstest-0.1.0-SNAPSHOT-standalone.jar
19:47lynaghktomjack: phonegap, yeah.
19:48tomjacksweet
19:48lynaghkat times, yes. At other times, it's painfully clear how jacked the web stack is for building rich apps =P
19:50robinkjustin_smith: Would it be OK to say (fn [[k & [v & vs]] [k (or vs v])?
19:50robinkjustin_smith: Or does :as do more than bind vs to vals?
19:51tomjacklynaghk: it's sort of like "sweet, you actually managed to make it work!"
19:51llasram##((fn [[v & vs :as vals]] [v vs vals]) [:a :b :c])
19:51lazybot⇒ [:a (:b :c) [:a :b :c]]
20:05callenyogthos: boo
20:06seangrovelynaghk: Very nice - did you use https://github.com/pangloss/clang or use a different method?
20:11callenseangrove: this...I didn't know this existed..
20:11callenson of a bitch
20:12technomancythat's like... a textbook case for when you *should* use a group-id
20:13callenmuhoo: something to show you when you're back around
20:14seangrovemuhoo: You mean clang?
20:14callenseangrove: hey hey, I'm over here.
20:16seangroveHaha, yes, that's right, slightly distracted
20:16seangroveahem - callen, you mean clang?
20:16callenseangrove: if it actually works reliably, I'm very interested.
20:16callenAngularJS was one of my dealbreakers for CLJS
20:16technomancyshoulda called it angljure, sheesh
20:17seangroveThere's also https://github.com/zcaudate/purnam which looks slightly more maintained
20:17hyPiRiontechnomancy: but lein-ironic-jure would kick in
20:22lynaghkseangrove: clang came out after we started; the philosophy we used is very different---we're manipulating JS with cljs, whereas clang is more about having angular use cljs.
20:22lynaghkseangrove: I Skyped with the author a while back, though. There's definitely room for both approaches.
20:22clojurebotauthor is hiredman
20:23lynaghkseangrove: the reason we went with our approach is that JS data structures integrate a bit better with Angular's model, and are faster in some key places (which is crucial on mobile)
20:24lynaghkseangrove: I've written a series of blog posts about all this--they will start to be released once the app is completed in a week or two.
20:26seangrovelynaghk: That seems a bit closer to what purnam is about, making the angular js interop less painful
20:27lynaghkseangrove: the purnam syntax stuff seems unnecessary to me. The approach I took was to extend cljs protocols to js objects
20:27lynaghkand then just use, e.g., transient "assoc!" to set keys/values on js objects.
20:27lynaghkthere is an old sketch of this approach on the angular/cljs todoFRP source.
20:28tomjackinteresting
20:28tomjackonly thing is persistent! is not constant time, is it?
20:29tomjacknor transient?
20:29tomjackmaybe that could be considered an optional feature of transients..
20:29lynaghktomjack: I'm just using the names; there is no shared implementation with clojurescript's data structures.
20:29tomjackI'm saying that maybe the names don't apply :)
20:30seangroveDid the performance come out alright on mobile? And did that level of integration matter?
20:31tomjackwait, you mean you extend ITransientCollection to object or no?
20:33lynaghktomjack: yes, but "persistent!" throws an error since conj! just bashes in place
20:34lynaghkseangrove: perf is okay; there hasn't been any slowdown from using cljs compared to straight js---largely because we're not doing crazy stuff in cljs, we're just using it as a glorified coffeescript to get macros and better syntax for throwing around JS objects.
20:35tomjackpersistent! could just be js->clj right?
20:36lynaghksure, no reason why not
20:36tomjackwell it doesn't get poisoned after that..
20:36lynaghkbut the way we were using Angular we didn't want to deal with cljs data structures
20:36tomjackah
20:36Pupnik-as I understand you are locked out of a lot of clj fancy features in clojurescript anyway?
20:37tomjackand it's just convenient not to have to require and require :exclude :)
20:40tomjackI wonder if there is a discipline to CSP that ensures you don't get screwed by mutation, which can be encoded with nominal logic
20:41tomjacklike you always use 'fresh' channels?
20:52seangrovetomjack: CSP?
20:52seangroveAh, got it
21:50seangroveDo I have to configure my project.clj to get checkouts to work, or should lein automatically pick up on them?
21:54tomjackautomatically, but you need the dep in project.clj still
21:54tomjackand if you don't already have that version installed, you must `lein install` it
21:55seangroveAh, ok
21:55seangroveIt
21:55tomjackso I guess not quite automatically..
21:55seangroveIt's not available on clojars, so I'm getting an error
21:55seangroveLet me try lein installing it
21:57seangroveProject: https://www.refheap.com/paste/14941 Output: https://www.refheap.com/paste/14940
22:07tomjackseangrove: hmm
22:08tomjack~/.m2/clang/clang/0.1.0-SNAPSHOT exists?
22:08clojurebotHuh?
22:10tomjacker, ~/.m2/repository of course
22:13robinkllasram: Actually what I meant was: (fn [[k & [v & vs]]] [k (or vs v)]), which works.
22:21r0bgleeson~ ()
22:21clojurebot() is awesome
22:21r0bgleesonhehe
22:25jcromartieand this is why I'll never really learn Haskell http://upload.wikimedia.org/wikibooks/en/3/36/Functor.png
22:25bmentgesdevn: earlier you said it would be worthwhile to watch Rich Hickey's videos on clojure for java programmers... man, those videos are awesome. Yeah it was like 2:30 hours of awesomeness! Thanks :)
22:25gfredericksnobody who has listened to rhickey talk for 150 minutes has lived to regret it
22:27bmentgesgfredericks: yeah, its just awesome. :)
22:29bmentgesand im not really into watching lectures... but that guy really knows a lot. The audience is a bit chatty and keeps interrupting, but even this adds up because it makes him explain in detail a lot of stuff.
22:30tomjackanybody up for random remote pairing, otherwise I'm going to have to tell this room full of rubyists and js'ers "uh nevermind" :)
22:30tomjackor just sneak away quietly..
22:31r0bgleesoni use ruby everyday almost :p
22:32bmentgesim stumbling into clojure now, still learning... my day to day tool is python right now :P wanting to change that a bit.
22:32r0bgleesonsame
22:34bmentgesone question in coding style... for maps, do you guys use commas to make it more readable or is it ok to go with just spaces {:a 1 :b 2} or {:a 1, :b 2} ?
22:36brehaut~style
22:36clojurebotstyle is http://paste.lisp.org/display/81021
22:36brehautಠ_ಠ
22:36brehautbmentges: commas are acceptable, but you can ignore them if you prefer
22:36bmentgesInvalid paste number 81021! :(
22:37brehauthttp://mumble.net/~campbell/scheme/style.txt
22:37brehautthats a good basis for style questions
22:37bmentgesbrehaut: thanks :D
22:37brehautclojurebot: forget style
22:37clojurebotMan, the living creature, the creating individual, is always more important than any established style or system. -- Bruce Lee
22:38brehautclojurebot: forget style is http://paste.lisp.org/display/81021
22:38clojurebotc'est bon!
22:38brehaut~style
22:38clojurebotMan, the living creature, the creating individual, is always more important than any established style or system. -- Bruce Lee
22:38bmentgeslol
22:38tomjackI'd say don't put commas at the end of a line
22:38tomjackbut otherwise completely discretional
22:52gfredericksman half of my commas go at the end of a line
22:52gfredericksapparently I'm really inconsistent about it though
22:52amalloybrehaut: you've just taught him another factoid named "forget style", not removed the existing one :P
22:53gfredericksclojurebot: forget?
22:53clojurebotyou need to put the verb in pipes
22:53brehautamalloy: bah
22:53brehauti can never remember the commands properly
22:53amalloy(inc clojurebot)
22:53lazybot⇒ 27
23:25tomjackare there more problems with protocol<->protocol extension besides that people will misuse it?
23:26tomjackI was thinking what if you require both sides of the arrow, so that it can only be used to express a natural isomorphism between two protocols
23:26dchHow can I do a regex match, and if successful, extract different parts of the match? I can't find a suitable example, but I can do it with repeated (take / drop / of the splitted line).
23:26bbloomtomjack: what do you mean by proto<->proto ?
23:26bbloomdch: (find-doc "re-")
23:26tomjacklike (extend-protocol AProtocol BProtocol (b [b]))
23:26dche.g. I've got a string (actually via graphite protocol) (def line "stats.vm.foo.dfw.rs.process.more.values") and if stats.vm matches, I want to get out foo.dfw.fs and process.more.values separately
23:27alandipertbbloom: do you do much perf dowsing in firefox?
23:27dchbbloom: I've read those already and I can't see how to extract this in one go, I'm very new to clj.
23:27bbloomdch: you can use destructuring
23:27dchatm I am doing (take 3 (drop 2 (clojure.string/split line #"\."))) repeatedly for each section.
23:29alandipertbbloom: hit a perf wall in ff w/ a cljs thing, would much appreciate any insights
23:29bbloom,(let [[match x y z] (re-find #"x(.*)y(.*)z(.*)w" "x123y45z6w")] {:match match :x x :y y :z z})
23:29dchooh I think I just figured it out
23:29dch(clojure.string/split line #"^stats\.vm\.(\w+\.)")
23:29clojurebot{:match "x123y45z6w", :x "123", :y "45", :z "6"}
23:29bbloomdch: see that ^^
23:29dchgets me halfway there, just need to fix my regex
23:29bbloomalandipert: i'm not the perf expert, dnolen is. but i can try to help
23:29bbloomalandipert: what's the problem?
23:29dchbbloom: that is much tidier, tyvm!
23:30alandipertbbloom: check out http://micha.github.io/todofrp/ in chrome and then ff and notice the supreme suckage
23:30alandipertbbloom: the ff tools are horrible but i think it's GC
23:31bbloomalandipert: is this using hlisp etc ?
23:31bbloomalandipert: ey gads, that is extreme suckage
23:32alandipertit's compiled w/ no gclosure optimizations
23:32alandipert:simple gives it a 50% boost, :advanced makes it totally usable
23:32bbloomso use advanced ;-)
23:32alandipertwell
23:32alandipertour $dayjob app that uses this has a lot more markup and won't compile in advanced
23:33alandipertNPE in gclosure after generating a 2.5gb working file
23:33bbloomthat's why cljs was built on gclosure: b/c clojure idioms are slow on js boxes w/o static analysis
23:33bbloomalandipert: ouch.
23:33alandipertbbloom: btw, which version of ff did you run that you saw suckage?
23:34bbloomalandipert: 21.0
23:34alandipertbbloom: ok yes, that one seems to suck the most
23:34bbloomalandipert: seems like set-text! and set-editing! are your hot spots
23:35bbloomupdate-state! is the common element
23:35alandipertyeah, we've been in the propagator for 2 days lol
23:35alandipertdespite the profile i'm confident it's not cpu bound
23:35alandiperteliminated apply from javelin, we inline everything
23:35bbloomlooks like the problem is IO to storage
23:36alandipertturning off storage makes it slightly faster, yeah
23:36bbloomsome quick profiling shows 13% of one branch of the profile going to pr-str in the storage backend commit
23:36alandipertyeah but peanuts compared to GC run
23:36bbloomhow large is the thing you're printing?
23:36bbloomi haven't profiled GC yet
23:36alandipertdo you know how on FF? i haven't found any decent tools
23:37alandipertjust very rudimentary things, can't see heap snapshot like in chrome
23:37alandipertabout:memory is wiggid lame
23:38tomjackwhat if r/reducer used a protocol
23:38bbloomhave you tried asking somewhere on irc.mozilla.org? seems like the FF folks are excited about the persistent data structures in cljs & are interested in optimizing their js engine
23:38tomjackthen maybe (nth (r/map inc [1 2 3]) 2) is 3 or other less crazy stuff
23:38bbloomcan probably provide you more experienced advice
23:38tomjacker, 4
23:38alandipertbbloom: thanks, and yeah i'm in #memshrink
23:39bbloomalandipert: curious that advanced optimizations helps that much only on FF
23:39bbloomalandipert: also, have you emailed the gclosure mailing list about the NPE?
23:40bbloomalandipert: they are pretty friendly over there too
23:40alandipertbbloom: re: data structures my working theory is advanced mode eliminates a lot of array creation, pending any real insight
23:41alandipertbbloom: re gclosure, still workin' it, we were on an old cljs and are hoping for best
23:41alandipertbbloom: thank you on all points tho
23:41alandiperti wish the mozilla dudes were excited about... a better garbage collector :-(
23:41bbloomalandipert: is there a reason you're not on cljs master?
23:41bbloomalandipert: cljs is kinda allocation heavy… yeah
23:41alandipertbbloom: is there a nightly or similar?
23:42alandiperti guess we could do a submodule thing
23:42bbloomalandipert: lien's checkouts feature works great w/ cljs-build
23:42alandipertcool
23:43bbloomiirc anyway
23:43bbloomalandipert: how old of a cljs are you on?
23:45xeqihugod: does nrepl-ritz have breakpoints?
23:46bbloomalandipert: also, are you using a lot of #{:constant "local" 'values "like this?"}
23:47bbloomalandipert: that's something dnolen told me is a huuge perf hit that we can fix in cljs
23:47bbloomcauses boat loads of allocations
23:48bbloomgclosure can't do constant lifting for cljs composites
23:54frozenlockI'm getting a weird error when trying to start a repl... https://www.refheap.com/paste/14944