#clojure logs

2014-08-01

00:27andreiWhat's the status of clojure debuggers? ritz seems to be dead
00:29justin_smithandrei: schmetterling is not complete, and has at least one really annoying bug (an exception inside its inspector causes a lockup requiring a restart) but is otherwise kind of nifty
00:30justin_smithandrei: on an exception, you get a browser based UI to evaluate code in the various stack frames where the exception was thrown
00:30justin_smithhttps://github.com/prismofeverything/schmetterling
00:30andreijustin_smith: Cool! Thanks. Anything with emacs integration?
00:31justin_smithalso it was written by the guy who talked me into learning clojure, who is an old and dear friend of mine, so don't say mean things about it
00:31justin_smithandrei: hmm
00:31technomancyyou should mention that in the readme justin_smith
00:31justin_smithnothing with nice integration that I know of
00:31technomancyotherwise people won't know
00:31justin_smithtechnomancy: I don't have commit rights to the repo!
00:31technomancyPR!
00:31andreijustin_smith: Thanks!
00:31andreiOne more question, any clojure profilers?
00:31justin_smithheh
00:32justin_smithandrei: java profilers (including jvisualvm and yourkit) will give slightly obscure class names, but accurate info
00:32justin_smithyou may not recognize your code at first, but it is hiding in that profile data somewhere :)
00:32andreijustin_smith: I've used jvisualvm but it's very poor for clojure. Doesn't integrate with any other tools, startup time is huge
00:34justin_smithyourkit gets talked about (and maybe thats not only because it gives you a free license to use it for open source if you mention it in your readme)
00:54andreijustin_smith: Thanks, I just tried yourkit. It doesn't seem to be able to print out line numbers, just functions
00:55justin_smithouch
00:55justin_smithbut at least you get function names I guess
00:56andreijustin_smith: Yeah.. it's a pretty lacklustre tool
00:57justin_smithandrei: to be frank, I would have contributed to schmetterling, but I find my best route to sort out my clojure code is to keep things small and as purely functional as possible (so that unit testing is trivial or nearly so to set up). Though I have had the good luck not to need to do serious performance profiling.
01:03andreijustin_smith: Yeah, that was good back when everything I had was small and performance didn't matter too much. But side effects are important for good performance and applications tend to grow over time
01:07justin_smithwith any luck I may have that problem some day :)
03:28arrdemhttp://grimoire.arrdem.com:3000/ <- 0.3.0 release candidate. please brake it. <3
03:28__daniel__break*
03:28arrdem:P
03:28arrdemit's late
03:29hyPiRionthe brakes
03:29hyPiRionarrdem: where are inc', dec', +' etc?
03:30arrdemhyPiRion: present.. http://grimoire.arrdem.com:3000/1.6.0/clojure.core/inc%27/
03:30arrdemin the functions section of http://grimoire.arrdem.com:3000/1.6.0/clojure.core/
03:30arrdemidk if they're indexed in the cheat sheet. that's andyf's project that I coopted
03:31hyPiRionarrdem: oh
03:31hyPiRionI just did a search and was confused it didn't pop up
03:31__daniel__they show up for me when i search
03:32hyPiRion__daniel__: the "inc'" function?
03:32hyPiRionnote the trailing quote
03:37__daniel__ah no hyPiRion, didn't notice the quote
04:54michaelr525hi
04:55michaelr525how can I tell emacs to indent clojure code like here: https://github.com/swannodette/om/wiki/Intermediate-Tutorial?
04:56michaelr525right now with a function call where the first argument is on the first line, the second line is indented so it aligns with the position of the first argument. and it's a bit too much for "html" type nesting
05:01michaelr525oh put-clojure-indent, define-clojure-indent
05:21dalzony안녕하세요. HELLO
05:22michaelr525Hello
05:23michaelr525dalzony: what lang is that?
05:23dalzonythat is Korean! :)
05:23michaelr525looks interesting
05:24michaelr525is that a whole sentence or a single word?
05:24dalzonywhole sentence, that means "hello"
05:25michaelr525haha
05:31TEttingerkorean is notable for being the only pretty-much-conlang in wide use today, unless you count modern hebrew (pretty different from ancient hebrew)
05:32TEttingerthe script is like no other script, it was made from scratch, rather than evolving like the latin alphabet (phoenician to greek to latin, etc.)
05:35dalzonyKorean(called 'Hanguel') was created by King Sejong
06:16clgv,(let [a 1] (eval '(inc a)))
06:16clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)>
06:16clgveval does not inherit the local variable scope I guess
06:17TEttinger,(let [a 1] (eval `(inc a)))
06:17clojurebot#<CompilerException java.lang.RuntimeException: No such var: sandbox/a, compiling:(NO_SOURCE_PATH:0:0)>
06:17clgv,(let [a 1] (eval `(inc ~a)))
06:17clojurebot2
06:17TEttingerthere we go
06:18clgvwell I guess the above is the way to go.
06:18clgvI have a complicated macro where I need two incarnations that differ only by an additional condition clause...
06:19clgvtrying to get it to work without copy&paste and not too much effort
06:19Glenjaminmacro-macro!
06:20clgvGlenjamin: yeah there are several macrolayers ;)
06:22clgvah well, guess I add two other params to the config-map to avoid relying on name capturing
06:31wizzois there a special way to handle functions failing during ->
06:31wizzoor just handle exceptions?
06:34clgvwizzo: no only normal exception handling if exceptions are involved. if you functions return nil or false on failure you can use `some->` and `some->>`
06:34wizzooh!
06:34wizzosome-> is exactly what i want. thankyou!
06:36blunteI see why my dissoc isn't doing what I want, but I'm not sure what the correct way to do this is:
06:36blunte,(let [junk [:a :b]] (dissoc {:a 1 :b 2 :c 3} junk))
06:36clojurebot{:c 3, :b 2, :a 1}
06:37blunteIt tried to dissoc [:a :b] instead of :a and :b
06:37nathan7apply!
06:37nathan7,(let [junk [:a :b]] (apply dissoc {:a 1 :b 2 :c 3} junk))
06:37clojurebot{:c 3}
06:38blunteHmm, I thought I had tried that already :). Guess not. map/apply/reduce shouldn't confuse me, but I'm not picking it up quickly for some reason. Thanks!
06:39nathan7(apply dissoc {:a 1 :b 2 :c 3} [:a :b]) is the same as (dissoc {:a 1 :b 2 :c 3} :a :b)
06:39blunteis it not more like (dissoc {...} :a) (dissoc {...} :b) ?
06:40blunteas in, calling dissoc one time for each element of the array
06:40wizzois splits the list you give it into separate arguments
06:40wizzofor the one function call
06:41blunteahh I see. I just misunderstood it. Thanks :)
06:41wizzoit wouldn't work if dissoc didn't allow multiple keys
06:41wizzomap is more like what you're describing though
06:41blunteah ha
06:43nathan7blunte: reduce would do that
06:43nathan7blunte: (apply f [x y z]) is just (f x y z)
06:43nathan7blunte: and (apply f x [y z]) is also just (f x y z), etc
06:43bluntenathan7: thanks, very clear example
06:44nathan7blunte: in most languages, apply just takes a function and a sequence
06:44nathan7blunte: in Clojure it takes extra args as a convenience
06:45wizzoapply takes extra args?
06:47blunteI think the x in the example is the "extra" argument
06:47nathan7,(apply list 1 2 [3 4])
06:47clojurebot(1 2 3 4)
06:48wizzooooh i see
06:48wizzoneat
06:48bluntequite handy
06:51tacwhat is , ?
06:51nathan7to tell clojurebot to evaluate it
06:51tacahh
06:51tac,'(1 2 3)
06:51nathan7tac: you can also use it inline, like this: ##(apply list 1 2 [3 4])
06:51clojurebot(1 2 3)
06:51lazybot⇒ (1 2 3 4)
06:51nathan7though that's a different bot
06:51tacI see ##'(1 2 3)
06:51lazybot⇒ (1 2 3)
06:55tac,(apply list [1 2] [3 4])
06:55clojurebot([1 2] 3 4)
06:56tac,(list 1 2 [3 4])
06:56clojurebot(1 2 [3 4])
06:56clgv,(list* 1 2 [3 4])
06:56clojurebot(1 2 3 4)
06:58TEttinger,(list* [1 2] [3 4])
06:58clojurebot([1 2] 3 4)
06:58nathan7apply uses list* internally
06:58tacSo apply then takes a function, hits it with all the supplied arguments, then hits it with any remaining arguments in a list?
07:00tac,(apply + 1 2 [3 4 5])
07:00clojurebot15
07:00tacwoo
07:01nathan7well, the base case is (apply f s)
07:01nathan7(apply f x y z s) is just (apply f (list* x y z s))
07:01clgvnathan7: but not literally ;)
07:01nathan7clgv: read the source of apply — it is
07:02taclist* is a macro then?
07:02clgvit's not defined recursively ;)
07:02nathan7well, no
07:02tac,(list* + [1 2])
07:02clojurebot(#<core$_PLUS_ clojure.core$_PLUS_@163b85> 1 2)
07:02clgvit uses (. f (applyTo ...)) in each case
07:02nathan7yeah
07:02taccrap. I created a closure.
07:03tacoh
07:03clgvtac: not really ;)
07:03tacno I didn't. That just printed the function
07:03tacI see now
07:03clgv,(list* '+ [1 2])
07:03clojurebot(+ 1 2)
07:03TEttinger,(eval (list* + [1 2]))
07:03clojurebot#<ExceptionInInitializerError java.lang.ExceptionInInitializerError>
07:03tactsk tsk. Trying to eval on a public bot!
07:03clgv,(eval (list* '+ [1 2]))
07:03clojurebot3
07:03clgv;)
07:04TEttingertac, it's a good bot!
07:04tacit's pretty neat
07:04TEttinger(inc clojurebot)
07:04lazybot⇒ 41
07:04tacAll the cool languages get bots in their channels nowadays
07:04TEttingerwe have two
07:04tac(get clojurebot)
07:04tacerr
07:04TEttinger$karma clojurebot
07:04lazybotclojurebot has karma 41.
07:04clgvtac: it's pretty useful to add examples to answers ;)
07:04clgv(inc 42)
07:04lazybot⇒ 6
07:05clgvway to go...
07:05Glenjamini like how it's 6
07:05TEttingerwhy does 42 have 6 karma?
07:05clgvshould be 23 right? :P
07:05TEttinger(inc 42)
07:05lazybot⇒ 7
07:07hyPiRion(inc 42) should be.. 43
07:08tac,42
07:08clojurebot42
07:10TEttinger,36rqwerty
07:10clojurebot1626557542
07:11tac,(hd '(1 2 3))
07:11clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: hd in this context, compiling:(NO_SOURCE_PATH:0:0)>
07:11GlenjaminTEttinger: what was that :s
07:11TEttingerradix 36 number
07:12Glenjaminah
07:12Glenjamin36r is the prefix?
07:12TEttinger,36rSENTENCE
07:12clojurebot2226111661742
07:12Glenjamin,16rFF
07:12clojurebot255
07:12Glenjaminright
07:20TEttinger,(map #(Long/parseLong (clojure.string/replace % #"[^A-Za-z0-9]" "") 36) (remove #{""} (clojure.string/split (doc map) #"\s|\pP")))
07:20clojurebot(15 591753 15 433 434 ...)
07:20TEttinger##(map #(Long/parseLong (clojure.string/replace % #"[^A-Za-z0-9]" "") 36) (remove #{""} (clojure.string/split (doc map) #"\s|\pP")))
07:20lazybot⇒ (15 591753 15 433 434 15 433 434 435 15 433 434 435 21303136 59669793928 10 994030 2226294739886 1288290580277164 879 38210 1657447409 879 839609736172 15 1068 38210 36821 879 26070077 31605076 879 666593 591753 1229011460869 430 839609736172 15 1068 38210 36821 879 ... https://www.refheap.com/88807
07:21TEttinger##(clojure.string/join " " (map #(Long/toString % 36) (map #(Long/parseLong (clojure.string/replace % #"[^A-Za-z0-9]" "") 36) (remove #{""} (clojure.string/split (doc map) #"\s|\pP")))))
07:21lazybot⇒ "f coll f c1 c2 f c1 c2 c3 f c1 c2 c3 colls returns a lazy sequence consisting of the result of applying f to the set of first items of each coll followed by applying f to the set of second items in each coll until any one of the colls is exhausted any remaining item... https://www.refheap.com/88808
07:23Glenjaminhow far can you go with the radix?
07:23Glenjamin,64rabc
07:23clojurebot#<NumberFormatException java.lang.NumberFormatException: Radix out of range>
07:23TEttinger36
07:23Glenjaminoh
07:23TEttingerit's a fun trick
07:26clgv,37r1
07:26clojurebot#<NumberFormatException java.lang.NumberFormatException: Radix out of range>
07:26clgv;)
07:27clgv1d6
07:27clojurebot2
07:31justin_smith,(apply + (rest (sort (repeatedly 4 #(inc (rand-int 6)))))) ;rolling up a paladin
07:31clojurebot8
07:31justin_smithoh man
07:31Glenjamindid you just get an 8 form 4d6?
07:31justin_smith3d6 drop the lowest
07:31clojurebot11
07:31justin_smithstandard d+d 2e
07:33justin_smith,(zipmap [:str :dex :con :int :wis :cha] (repeatedly 6 (fn [] (apply + (rest (sort (repeatedly 4 #(inc (rand-int 6)))))))))
07:33clojurebot{:cha 7, :wis 14, :int 9, :con 15, :dex 16, ...}
07:33justin_smithof all the stats to hide, it had to be str :(
07:34Glenjamin,(set! *print-length* 10)
07:34clojurebot10
07:35Glenjamin ,(zipmap [:str :dex :con :int :wis :cha] (repeatedly 6 (fn [] (apply + (rest (sort (repeatedly 4 #(inc (rand-int 6)))))))))
07:35clojurebot{:cha 11, :wis 12, :int 18, :con 6, :dex 13, ...}
07:35Glenjaminoh right, key/val is 2
07:35Glenjamin,(set! *print-length* 12)
07:35clojurebot12
07:35Glenjamin ,(zipmap [:str :dex :con :int :wis :cha] (repeatedly 6 (fn [] (apply + (rest (sort (repeatedly 4 #(inc (rand-int 6)))))))))
07:35clojurebot{:cha 13, :wis 10, :int 11, :con 10, :dex 14, ...}
07:35Glenjamin:s
07:37clgv3d6
07:37clojurebot8
07:38justin_smith,(zipmap (reverse [:str :dex :con :int :wis :cha]) (repeatedly 6 (fn [] (apply + (rest (sort (repeatedly 4 #(inc (rand-int 6))))))))) ; nobody care about cha anyway
07:38clojurebot{:str 13, :dex 15, :con 8, :int 8, :wis 14, ...}
07:39clgvjustin_smith: you can trick the bot via printlength ;)
07:39clgv,(str (zipmap (reverse [:str :dex :con :int :wis :cha]) (repeatedly 6 (fn [] (apply + (rest (sort (repeatedly 4 #(inc (rand-int 6))))))))) )
07:39clojurebot"{:str 14, :dex 15, :con 11, :int 13, :wis 18, ...}"
07:39clgv,(binding [*print-length* 100] (str (zipmap (reverse [:str :dex :con :int :wis :cha]) (repeatedly 6 (fn [] (apply + (rest (sort (repeatedly 4 #(inc (rand-int 6))))))))) ))
07:39clojurebot"{:str 4, :dex 11, :con 13, :int 10, :wis 12, :cha 7}"
07:40justin_smithoh man, str of 4, that is gonna be a really pathetic cleric
07:40justin_smithwell, barely qualifies to be a thief also
09:09XinUmbralis8d10
09:09clojurebot39
09:11clgvXinUmbralis: pretty average ;)
09:13justin_smith,(apply print (interleave [:str :dex :con :int :wis :cha] (repeatedly 6 (fn [] (apply + (rest (sort (repeatedly 4 #(inc (rand-int 6))))))))))
09:13clojurebot:str 15 :dex 8 :con 16 :int 9 :wis 16 :cha 17
09:14farhavenheh
09:15justin_smithrpgs were my gateway to programming, they are full of algorithmic thinking
09:21mnngfltgDo you guys run tests from the repl? If I use `(clojure.test/run-all-tests)`, it gives me: Ran 0 tests containing 0 assertions.
09:22justin_smithmnngfltg: have you loaded the namespaces with the deftests in them?
09:22mnngfltgProbably because the namespaces are not loaded..
09:22mnngfltgjustin_smith, no I haven't :)
09:23mnngfltgjustin_smith, but surely I don't have to remember all the testing namespaces and manually (require) them?
09:23justin_smithmnngfltg: you can make a namespace that requires all the rest to make it easier
09:23justin_smithor run "lein test" to do it all from the command line
09:24mnngfltgjustin_smith, `lein test` must have some way to discover all the testing namespaces, maybe it's exposed to the user?
09:24justin_smithusually, I am either double checking the whole repo is good before a push (lein test) or working on a specific namespace / feature (run tests on that feature / in that namespace)
09:24vermaso I am writing this module which has protocols in it and then a couple of defrecords that define records that satisfy this protocol? is it recommended that these protocol methods mutate the state of the original record and return it, or just modify an internal state (possibly an atom) which is a part of the record?
09:24justin_smithmnngfltg: very little info from lein is exposed at runtime, lein is a build tool
09:24vermasorry, misplaced "?"
09:24vermas/protocol? is/protocol, is/
09:25justin_smithverma: how does one mutate the internal state of a record?
09:25mnngfltgjustin_smith, right, I just thought this part might be handy (find all the testing namespaces in `:test_paths`)
09:25justin_smithmnngfltg: lein does not expose :test_paths to you at runtime
09:25hyPiRionverma: It's not possible to mutate records, and it's certaintly not recommended to attempt to do so either.
09:25mnngfltgalas!
09:26vermajustin_smith, not mutate really, just modify the record and return the new record, like using assoc etc, sorry incorrect term
09:26vermahyPiRion, ^
09:26clgvverma: since you use a datatype that is supposed to be persistent you shouldnt mutate the internal state of the current instance. that could lead suprising errors
09:26hyPiRionverma: oh yeah, that's completely fine
09:26justin_smithverma: a protocol method could return a modified record, it could return a string, it could return a number. Depends what you are trying to do.
09:27hyPiRion,(defrecord Foo [a b])
09:27clojurebotsandbox.Foo
09:27mnngfltgjustin_smith, I'll go with a function in my dev/user.clj that requires all the testing namespaces then
09:27justin_smithbut yeah, if you want to return a modified version of the record, that is pretty normal
09:27hyPiRion,(assoc (Foo. 1 2) :a :an-a)
09:27clojurebot#sandbox.Foo{:a :an-a, :b 2}
09:28hyPiRion,(update-in (Foo. 1 2) [:a] inc)
09:28clojurebot#sandbox.Foo{:a 2, :b 2}
09:28hyPiRionetc.
09:28clgvhyPiRion: how dare you?! :P
09:28vermajustin_smith, sure, e.g. one of my protocol methods is called become-available, which takes a record and then attaches "being online" related data to it (using assoc) and returns the record back
09:28vermajustin_smith, hyPiRion, I guess what I am asking is that is this what people usually do
09:28hyPiRionclgv: yeah, I'm such a rebel
09:29hyPiRionverma: yes, this is very normal to do
09:29clgvhyPiRion: that's probably it ;)
09:29vermahyPiRion, thanks :)
09:29vermaI guess I can always post the snippet here and get suggetions :)
09:30hyPiRionverma: yeah, there's always some person here able to comment on snippets =)
09:31vermahyPiRion, nice, thanks :)
09:32clgvverma: usually you post them on refheap.com or similar sites ;)
09:33mdallastellahola
09:40vermaclgv, got it
10:34michaelr`how to make these colors from cljsbuild show up on windows?
10:37gtrakmichaelr`: can you successfully develop cljs on windows? I gave up a long time ago.
10:38gtrakeasiest path for me was to run a VM and share folders.. also considered having node-webkit on windows host as a brepl talking to the linux VM, but haven't tried that yet.
10:38gtrakrather, I have no idea, I haven't tried to do clojure on windows in 3 years, since before cljs.
10:38gtrakmostly emacs's fault
10:42stuartsierradnolen_: what was the verdict on the Google closure Library release?
10:42michaelr`gtrak: yea.. everythink works fine for me more or less :)
10:42michaelr`gtrak: what was your show stopper?
10:42michaelr`everything
10:44gtrakI don't even remember, just the whole hassle with cygwin really.
10:45gtrakI was working on a particular task with git-svn, it was orders of magnitude slower, so at that point I went through the trouble of setting up a linux dev environment.
10:46michaelr`heh
10:49michaelr`I actually have a linux server where I work sometimes using tramp mode from my crappy laptop
10:58clojurefanhey #clojure, if i have a constant defined like (def ^:const foo "bar"), it looks like i can't match against the value of foo in a case statement. is there some way to do this?
11:00ucbI know cider replaced clojure-test-mode, though I do miss the ability to switch between a buffer with an ns and it's test counterpart (usually bound to C-c C-t in clojure-test-mode). Has this functionality been ported to cider as well?
11:02trptcolintechnomancy: got a link handy for your imports-should-use-parens argument?
11:03BobSchack1clojurefan: do you mean (case foo "bar" :success :failure) or (case "bar" foo :success :failure)?
11:04clojurefanBobSchack1: the latter
11:06rksmucb: C-h m gives you an overview of mode key maps. Cider uses C-c C-t to show a test report page and C-c , to run tests
11:06BobSchack1From the docstring "The test-constants are not evaluated. They must be compile-time literals, and need not be quoted." When you try to match foo you are matching the symbol foo not the value foo represents
11:07ucbrksm: yes, I am aware of those, I'm just wondering if the buffer-switch functionality had been ported :)
11:07clojurefanBobSchack1: right, i saw that, so is there no way to do this? i found cemerick.com/2010/08/03/enhancing-clojures-case-to-evaluate-dispatch-values/
11:08llasramclojurefan: Looks like you've found your solution :-)
11:08clojurefanllasram: except it's overkill
11:08clojurefani'd sooner not use a case since this is just a small example i'm trying to write
11:08hlshipI've really gotten to the point where I hate going back to Java, even to code Tapestry. Would rather just stay in Clojure land.
11:09BobSchack1clojurefan I've played around with case a lot recently and haven't found a way to do what you want yet
11:09llasramNot really. If you need `case` with compile-time evaluation of dispatch values, then you need something other than clojure.core/case
11:09clojurefanthanks guys. too bad
11:10llasramUsing a common-pattern utility function is pretty typical in many cases
11:10clojurefanllasram: not sure what that is, do you have a link handy?
11:11llasramI just mean "including a copy of a utility function which serves a common need is a common pattern."
11:11rksmucb: C-c , jumps to the test report buffer, dunno if this is what you mean
11:12ucbrksm: no, not the test report buffer, but rather the counterpart buffer/file in the test/ directory
11:12ucbrksm: basically a quick shortcut between code and its tests
11:12Bronsa,(case '(1) (1) 1 2) ;; I always find this counter-intuitive
11:12clojurebot2
11:13justin_smithclojurefan: also, :const doesn't really do anything to non-primitive values, so a const string doesn't mean much
11:13Bronsajustin_smith: :const will let the compiler inline the value
11:13justin_smithor wait, can a String be :const? is it considered primitive for those purposes? my hunch is no but now I am not so sure
11:13llasramBronsa: Agreed. Hmm, I wonder: &(case '(1) ((1)) 1 2)
11:13justin_smithBronsa: ahh, ok
11:14Bronsallasram: sure, that works
11:14llasramOh, right ##(case '(1) ((1)) 1 2)
11:14lazybot⇒ 1
11:14llasramThere we go
11:14llasramCool
11:14Bronsait's just a bit weird
11:14llasramBut still weird, yeah
11:15justin_smithI really don't like the way case handles ()
11:15justin_smithsingle case exceptions suck :(
11:15llasramWe should just write our `case`s always supplying a sequence of dispatch values for each case :-D
11:15llasram(case 1 (1) "one" (2) "two" #_else "many")
11:16Bronsajustin_smith: also I don't think ^:const can handle primitives at all
11:16justin_smithwait, I had it backwards?
11:16Bronsaprobably, yeah
11:17justin_smithdo you have a good reference for that annotation (anything more specific than "the source" would be helpful -- ie. a file if you don't have an article:))
11:18Bronsajustin_smith: there's probably something in the wiki or in the CHANGELOG, for 1.3
11:22justin_smithhttps://github.com/manutter51/Clojure-1.3-Changes-text#215-const-defs this claims const is only for primitives
11:23wizzowhy do regular expressions have special syntax instead of just being strings?
11:23justin_smithBronsa: but it is a good example of using a non-primitive to initialize a primitive, at compile time - I hadn't considered that :const could be used that way
11:23Glenjaminwizzo: probably so the reader can compile/cache them early
11:23Bronsajustin_smith: what's written there doesn't make any sense.
11:24puredangerwizzo: b/c you can avoid much of the special escaping required in strings, also b/c they create a different type (Pattern) under the hood
11:24justin_smithwizzo: because "\a" is erroneous in a string, but valid in a regex
11:24rksmucb: I see. There is a deprecation of `clojure-jump-to-test' in clojure-test-mode.el: "use projectile or toggle.el instead." I huess it won't be ported then.
11:24wizzooh ok
11:24justin_smithBronsa: oh, so the changelog is innacurate?
11:24wizzoi guess that makes sense
11:25Bronsajustin_smith: looks like so, or the wording is wrong
11:25Bronsajustin_smith: Vars can hold only Objects, not primitive values
11:25Bronsaall :const does is allows the compiler to inline the value skipping the .getRawRoot call for every Var access
11:25puredangerI think the use of const expanded to collections at a later time
11:26ucbrksm: ah, good catch, thanks!
11:26Bronsawell that might explain it then
11:26Bronsaah wait, I get it.
11:27justin_smithI wish metadata was as easy to look up and as well documented as vars
11:27Bronsaif you do e.g. (def ^:const x 1) (let [a x] a), a will be unboxed
11:37justin_smitharrdem: a) add documentation for metadata to grimoire b) light blue and gray on white, what the hell were you thinking?
11:54ahoenigmannwhat is best setup for emacs/clojure dev on mac?
11:54ahoenigmannstandalone emacs, iterm + emacs?
11:55ahoenigmannhad problems yesterday with a few keybindings not being passed from standard mac terminal to emacs
12:05clgvahoenigmann: I heard about aquamacs on macos
12:07stuartsierraahoenigmann: The keybindings thing is a well known problem with terminal emacs in any environment.
12:08ahoenigmannyeah
12:09ahoenigmannjust want to know what everyone else is doing
12:09stuartsierraEmacs compiled with Cocoa bindings via Homebrew.
12:10justin_smithahoenigmann: on Linux I just use the X11 version - that is likely the version a plurality of devs are using too
12:10justin_smithahoenigmann: on osx, when I was forced to use it, I liked emacs under the mac X compatibility environment, but I'm weird
12:12Jaoodwhat problemas are you having? did you set the option key to act as +Esc in iterm?
12:13Jaoodahoenigmann: ^^
12:15michaelr`has anyone used om-sync yet?
12:16michaelr`hmm
12:17michaelr`I'm not sure whether I'm missing something, DELETE request is sent to the collection URL and there doesn't seem to be a way to specify the actuall item URL. Such as DELETE /rest/products/1 instead of DELETE /rest/products
12:17ahoenigmannhi jaood
12:18ahoenigmanni dont have iterm
12:18ahoenigmannbut in mac term i did it
12:18ahoenigmannso the M- works :)
12:19Jaoodahoenigmann: iterm gives you more choices for rebinding keys
12:19ahoenigmanni see
12:20Jaoodahoenigmann: what emacs command didn't pass through?
12:21ahoenigmannit was a paredit binding to slurp
12:22ahoenigmannC-)
12:31Jaoodahoenigmann: yeah, you'll have to mess with the shortcut keys in iterm, if you don't care about running emacs remotely you should run the gui version
12:54justin_smithhaha, some of the unit tests in test/clojure/test_clojure/test.clj are commented out
12:55sdegutisIs there anything about Clojure that makes it more ideal than Ruby for writing simple web apps?
12:55sdegutisNote: I am not trying to start a flamewar. I am just curious. Serious responses only please. Thank you.
12:55clgvsdegutis: are you asking that question in both channels? :P
12:55sdegutisI am not in any Ruby channel.
12:55technomancyno bundler
12:56clgvguess you should ^^
12:57sdegutistechnomancy: Is that a serious benefit? The only problem I remember having with bundle is its speed, which is not much different than using lein (due to Java's library-loading time) for similarly sized projects.
12:57technomancyin clojure no one will ever try to redefine the cd function of your shell and fail with hilarious results because you don't use bash
12:57justin_smithsdegutis: reliable and repeatable builds
12:57technomancyhm; you've never had bundler pull in old versions that don't match your gemspec just because you had them left around on disk?
12:57justin_smithtechnomancy: that sounds like a funny store, got more details?
12:57sdegutistechnomancy: I've ditched rvm for rbenv years ago, so that doesn't quite hold as a disadvantage anymore. I've also been considering switching to chruby lately.
12:58technomancyjustin_smith: http://rvm.io
12:58sdegutisjustin_smith: https://github.com/sstephenson/rbenv/wiki/Why-rbenv%3F
12:58justin_smiths/store/story
12:58technomancysdegutis: yes, but there are people in the ruby community who thinks that's an ok thing to do and that you shouldn't go hunt down the people responsible with pitchforks
12:59sdegutistechnomancy: there are people in the Clojure community who also don't mind rvm.
12:59technomancy~guards
12:59clojurebotSEIZE HIM!
13:00justin_smithsdegutis: a few apathetic fools can by balanced by a few dedicated zealots. But what if there are no zealots ready to do god's work?
13:00sdegutisI won't name names though, on account of the light you've just put them in.
13:01sdegutisSo, the most compelling reasons for choosing Clojure over Ruby that I can think of are: ring; compojure; hiccup; garden
13:01technomancyI haven't actually built a webapp in clojure, so I'll shut up.
13:01justin_smithsdegutis: scaling without devops
13:01technomancy[over 500 lines]
13:01justin_smith(or with much less devops involved)
13:01sdegutisWhat I /don't/ see as particularly advantageous: macros; built-in easier concurrency support; Java.
13:02justin_smithsdegutis: clearly you don't pay for the hosting then
13:03ggreerhardware is cheap. it's cheaper to pay for a terabyte of RAM per month than to hire another dev
13:03justin_smithggreer: in my experience clojure does not require a larger dev team than ruby
13:03sdegutisWe've got about 10k LOC according to `cloc`.
13:03ggreerI agree. it's just that performance isn't a big deal for me most of the time
13:04justin_smithggreer: and a messier scaling scenario, in practice, often leads to devs messing with deployment issues / scaling hiccups
13:04sdegutisAnd 7k lines of testing Clojure code.
13:04ggreerI just like lisp but I want lots of libraries too
13:04justin_smithggreer: which is time being sysadmins when they should be working on code
13:04technomancysince you're limiting the scope to "simple web apps" IMO it's not that interesting of a question. simple stuff means there are a lot of different ways you can do it without screwing things up.
13:04clgvsdegutis: without macros compojure would suck ;)
13:05justin_smithoh yeah, simple
13:05sdegutisclgv: I am not entirely sure about that.
13:05justin_smithuse a static dir w/ apache or something
13:07technomancyif you have to write a simple web app, you should go with what you and the people likely to maintain the code in the future know best.
13:07clgvsdegutis: well than just have a look at compojure.core ;)
13:07clgvsdegutis: GET/POST ...
13:07sdegutisclgv: I'm not saying it would have the same interface it has now.
13:08sdegutisclgv: :GET, :POST would be fine alternatives not requiring a macro.
13:08clgvsdegutis: lol what makes it "compojure" if not its interface ? :P
13:08justin_smithclgv: maybe the routing? but yeah, its mostly macros
13:08clgvsdegutis: with a certain ugly overhead they could be functions yes
13:09sdegutisThe website I'm working on was written by a single Rubyist who fell in love with Clojure circa Clojure 1.3, and I am now the sole developer, having rewritten 99% of the website myself, still in Clojure, and moved away from Google App Engine with Mongo to AWS with Datomic.
13:09sdegutisThe original developer probably won't write any more of the code, he's no longer an active developer for the time being.
13:09justin_smithso now you are considering switching it to ruby?
13:09sdegutisNo.
13:10sdegutisI'm just reassessing the choice of language.
13:10Jaoodsdegutis: for sure you will find more libs in the ruby world, the ruby community is very webish
13:10clgvsdegutis: not a bad thing to do in general
13:10sdegutisPretty sure the reason he chose Clojure was because it was his new Ruby (he went Java -> Ruby -> Clojure) and it was his honeymoon period.
13:12justin_smithsdegutis: my main clojure contributions have all been related to a library (set of libraries) that evolved out of a need to overcome difficiencies my employer saw in ruby (in terms of business costs / resources)
13:12clgvis there a lein plugin for clojure code metrics? sexpr count or similar?
13:12sdegutisBut I'm not seeing many legitimate benefits of Clojure for web apps, over using another language. Compojure and Ring can be done in most other languages without sacrificing too much due to not having macros. But I'm not sure Hiccup can.
13:13JaoodI have seen some projects using Bidi instead of Compojure, Bidi doesn't use macros as Compojure
13:13technomancysdegutis: yeah, templating seems like a weak point in the ruby landscape
13:14technomancyway too many people settle for weak sauce stuff like erb
13:14technomancybecause it's "standard"
13:14technomancyunless you can stomach haml things seem pretty bleak
13:16sdegutisLately I'm feeling a little bit sketchy about the Clojure setup we have.
13:17sdegutisIn particular Datomic feels extremely heavy-weight and it feels like it's weighing down the app a significant amount.
13:17sdegutisAlso it takes quite a long time for the app to start up, and for tests to run, even after a file reloads, which should rerun tests automatically using the testing lib we're using.
13:19technomancyI don't get why you would use datomic for a small data set; it's so easy to get all the benefits of immutability and history with a few append-only postgres tables.
13:21sdegutisOur product data set is small, but we handle several orders and sell many licenses per day.
13:22technomancyrecording license sales is already immutable
13:22technomancy
13:22sdegutisWe switched to Datomic partially because when using Mongo our database became inconsistent (causing me to spend several days tracking down broken links several times); and because our statistics and reports pages were taking 20 minutes to cache, whereas now that takes only 1 minute.
13:23technomancysure but "look how much better than mongo it is" is pretty faint praise
13:23sdegutis(and similarly, individual pages were taking more than 60 seconds, thus hitting the HTTP timeout; now they take a second or two)
13:24s_kilkI'm going to concur with technomancy, a postgres setup with append-only tables sounds like it would suit your use-case
13:24sdegutisI probably wouldn't disagree.
13:25s_kilkwait, 60 second queries with Mongo?
13:25sdegutisThough when I tried using the Clojure wrapper for postgres, I ran into too many problems and had to abandon that avanue.
13:25sdegutisYes.
13:25sdegutisWe we using... an ORM.
13:25sdegutisA very inefficient ORM.
13:25sdegutisI won't name names.
13:25s_kilkyikes, that doesn't sound right at all.
13:25mthvedtsdegutis: does it start with h
13:25sdegutisYes.
13:26sdegutismthvedt: How did you know?
13:26mthvedtsdeguits: does it end with ibernate
13:26sdegutisNo.
13:26sdegutisSo you didn't know :)
13:26s_kilkmongo has plenty of faults, but slow queries are usually not one of them :)
13:26sdegutisYeah; to be honest I kind of want to go back to Mongo, just without using that ORM.
13:27s_kilkhmm, maybe give the YeSQL library a try with Postgres
13:29johncashwhats the url to that page with all the transit examples? I think it has a yellow background
13:30s_kilkand out of curiosity, why not just use the bare mongo clojure driver?
13:30technomancyhttps://www.panic.com/transmit/#t4numberone
13:32mthvedttrying to think of an orm that starts with h and isn’t hibernate
13:33JaoodHQL
13:33itruslovehyperion?
13:34sdegutiss_kilk: If we ever go back to Mongo then I probably would.
13:34sdegutisBut I pushed hard for the transition from Mongo to Datomic. I imagine my job could be at stake if I pushed to reverse it.
13:35sdegutisI like admitting my mistakes and apologizing. I don't like having no income.
13:35s_kilksdegutis: sure :) that's understandable. probably a good move to get away from mongo at least
13:36Jaoodsave your job with rails :D
13:36s_kilk*shudder*
13:36sdegutisI'm positive he would never allow that.
13:36sdegutisEven if we went with Ruby, Rails is out of the question.
13:37sdegutisAlthough to be honest, I like that Rails does a lot of security stuff for you out of the box.
13:37s_kilkso what are the upsides of datomic for your use-case? curious to hear what it's like in production
13:38sdegutisFor one thing, it's really simple to create an in-memory database for use in tests.
13:38sdegutisI love that fact a lot. I bet it would be just as easy with Mongo though. But not postgres.
13:39sdegutisBut I'm on the fence about the immutability. We don't really treat it too immutably, as we shadow the old database value with the new one immediately after a mutating operation, thus effectively making it mutable for our uses.
13:39technomancyyeah, being out of process is probably the biggest drag about postgres. especially the apt packaging is clearly meant for production and sucks for development.
13:40tuftsdegutis: do you end up using the "what-if" dbvals with a partial transaction applied? i work with a global state style rdbms orm, and having transactions represented as data and a dbval that can reflect part of the changes involved in processing a request is really appealing
13:40tufti think i'd miss the postgres extensions like postgis, though -- maybe use elasticsearch+datomic?
13:40sdegutistuft: I think we do that in one place, as a shortcut to extracting a calculation out into another function, to tell whether an order would be completely paid off if we apply the given payments, or something.
13:40sdegutistuft: but to be honest we don't really need that feature at all.
13:41sdegutisAlso, we don't currently do too much iterating over the database's own history. I think we do for one or two of the reports, but that could easily be replaced by manually creating a history table in Mongo or whatever.
13:41tufttuft: ah ok, interesting. i'm thinking about the problem where one piece of code makes data changes that need to be visible to other code within the same transaction
13:42sdegutissdegutis: I don't think we have any need for that.
13:42tuftalso i'm starting to use SERIALIZABLE in postgres and it's pretty useful. in datomic this would involve manually asserting the state of the world is still as it was to get the same isolation
13:43sdegutisAll our transactions are instant and built up within the same file (sometimes via private methods) and applied before the function returns.
13:43tuft.. which is surprising given all the great STM in clojure
13:44tuftah ok
13:44sdegutisOur web app is dead simple btw: we sell licenses to watch training videos about programming.
13:45sdegutisThat's all we do.
13:45tuftanyway, schema, transactions and entities as data and the database as a value is pretty hard to beat. =)
13:46tuftyeah, i'm doing a toy project with it currently
13:46tufthaven't hit the limits but just wondering about replacing my go-to tools with it
13:47gtraksdegutis: pretty meta..
13:47sdegutisgtrak: quite so.
13:47sdegutisIt's http://cleancoders.com/ fwiw.
13:48sdegutisAll the slowness that you see when hitting that page is due to loading all the episode entities into memory.
13:48justin_smithgtrak: my best meta moment today was reading the tests in clojure.core for clojure.test
13:48gtrakjustin_smith: nice!
13:49gtrakcycles are more meta for sure
13:49tuftsdegutis: are you the presenter on any of these?
13:50tuftsomeone at work brought this site up the other day
13:50sdegutistuft: Not yet.
13:58s_kilksurely the episode entities are crazily cache-friendly? how often would they really change?
14:00sdegutisYeah they rarely change.
14:00sdegutisThat's what's surprising; it should be way faster.
14:01sdegutisHonestly I want to just go back to Mongo and use a language that doesn't depend on Java.
14:01sdegutisMaybe Lua with some batteries-included language for its simplicity.
14:03justin_smithsdegutis: are you doing any cache of the video list results from the db?
14:03justin_smith(I mean explicit cache)
14:04sdegutisI'm just getting it from the db and letting Datomic cache it for me.
14:04sdegutisIt is faster than when we used Mongo, for sure.
14:04sdegutisErr, using Mongo with an inefficient ORM.
14:04justin_smithhow local is the datomic server to your web server?
14:04sdegutisright next to it; another aws server
14:05justin_smithOK
14:05bbloom_oh, i probably should come up with an idea for a conj talk, huh? that's kinda due today, isn't it....
14:05sdegutisconj talks were always too advanced for me, always felt like I needed a master's in something to understand them
14:05nickmbaileybah, who knows how i can get my hudson password for build.clojure.org reset
14:06sdegutisso I surely can't present on anything that'll be interesting to anyone there
14:07bbloom_sdegutis: were the clj/west talks more your style?
14:07sdegutisnever seen them
14:07bbloom_iirc, the /west talks were more approachable
14:07xeqisdegutis: I'm sure you could. there have been several explain a concept (vars, liberator, etc) talks
14:07sdegutisTo be honest I'm the wrong person to ask. I never attend talks. I prefer reading something about the topic instead. Much easier to skim and get to the important part that way, and much faster to learn.
14:08bbloom_the talks are just something to do in between drinking and chatting with people in the hallways :-P
14:08xeqiI mean, if technomancy can give a conj talk on his deathbed anyone can
14:08xeqi+1 to hallway track
14:08technomancyhaha
14:08sdegutisI just assumed the talks were there to be an excuse to go to conferences, and the main point was to socialize with like-minded people and hand out your business cards.
14:09xeqitechnomancy: did you submit this year?
14:09sdegutisIf that's universally understood, then I might as well submit a talk that explains how to use Hiccup and just go for it.
14:09technomancyxeqi: no. the lein release task is the only clojure I've written this year.
14:09sdegutisahh.
14:09sdegutiswell done sir.
14:11technomancyeh?
14:11lpvbwhen should I use gen-class and when should I use proxy?
14:12sdegutislpvb: never and never
14:13lpvbsdegutis: I need to subclass a swingx model though
14:14lpvbokay..
14:14aperiodiclpvb: use gen-class if something demands to be handed a java class *by name*. if you can pase an instance, use proxy
14:14xeqilpvb: if you can create the object and pass it to java then use proxy. Use gen-class if the java code needs to create it
14:14bbloom_or if you just need to do it once and it will have a small amount of code in it, just write some java
14:14lpvbwell I need to pass the model to the java view but within clojure
14:15lpvbis proxy okay for that
14:15aperiodicalso, before using gen-class, make sure to put an egyptian curse on the author of the framework or library that is making you do this
14:15aperiodicyeah, proxy works for that
14:16bbloom_if you need to subclass this a lot, one thing you can do is 1) define an interface and 2) write java for a delegation class that takes an instance of that interface to the constructor
14:16bbloom_then you can implement the interface in clojure and instantiate the delegation class, rather than subclass from clojure
14:16bbloom_much nicer
14:17lpvbI'd rather not write java at all
14:18lpvbgives me headaches when I try to develop java in leiningen
14:18bbloom_http://www.jetbrains.com/idea/webhelp/generating-delegation-methods.html
14:18bbloom_even if there's 379578395 methods, you can just generate all the java in ~5 seconds w/ intellij and then never touch that java code again
14:19bbloom_you may have to write the constructor by hand tho :-P
14:19amalloythere's an example of bbloom_'s suggestion in flatland.io: https://github.com/ninjudd/io/tree/develop/src/flatland/io/core
14:20amalloyinstead of proxying OutputStream or InputStream, you can write (InputStream. (reify InputStreamable ...))
14:21bbloom_performs much better than proxy too
14:41justin_smithtuft: tribe member speak of leaving tribe! must stop them for leaving or we lose face!
14:42tuftjustin_smith: quick! get the spears and block the door!
14:42justin_smith->
14:42justin_smith->>
14:42Jaoodtuft: I guess is a library problem and the java baggage
14:44Jaoodbut then, Clojure is not that old
14:45expezstuartsierra: do you have any rules of thumb in regards to the size of a component?
14:45stuartsierraexpez: sorry, busy now
14:45expezaight
14:52Rayneshttps://www.refheap.com/62eff49ffcd10438606161986 <-- How to not be a language maintainer.
14:55justin_smithRaynes: from ass import problems
14:55jjidoDid you write that Raynes?
14:56justin_smithRaynes: in all seriousness, what a nimrod, I'm glad I didn't spend more than 10 minutes checking that language out
14:58arrdemjustin_smith: what do you mean "metadata documentation"? this form preserves meta or doesn't?
14:59justin_smitharrdem: it was being a bit glib. I meant how various metadata would be used by the compiler.
14:59rlbjustin_smith: re session, my impression was that peridot handled that for you, but I may well misunderstand.
14:59justin_smithin particular we were discussing :const and there was much confusion (not least on my part)
14:59mdrogalisRaynes: D'oh
15:00justin_smitharrdem: and I realized I didn't even really know where to go to look up what a given metadata like :const would do (not even which source code files to look in)
15:00arrdemI decline this request to document the insanities of clojure.core's internals
15:00justin_smitharrdem: and for low hanging fruit we could of course document things like :file and :doc etc. etc.
15:00justin_smitharrdem: fair enough :)
15:01arrdemjustin_smith: some stuff, like your macro tutorial, and a reader tutorial may make it in
15:01expezwhy does it make sense that (= (set {:foo :bar} #{:foo :bar}) => false?
15:01justin_smitharrdem: surely not mine
15:01justin_smithI don't think I ever made one
15:01arrdemjustin_smith: but especially "compiler significant" metadata is just too insane to be considered stable
15:01arrdemimo
15:01expezbah. slight typo making that set literal with the map inside ><
15:02justin_smitharrdem: ok, it's just sad to realize I don't know where to look to see what a specific compiler significant metadata will do, not to mention where I would see a rundown of what exists
15:02justin_smitharrdem: guess that means I need to read a shitload of code, and write my own docs on the subject
15:03JaoodHow can I stop reading HN and Reddit?
15:03Bronsajustin_smith: there are not many "metadata options" the compiler actually uses though
15:03justin_smithJaood: did you see the thing with the guy who hired someone on craigslist to hang out and slap him whenever he slacked off?
15:04justin_smithBronsa: good news! but I still wish I knew an easy and authoritative source that documents them
15:04tuftJaood: just realize that they are mostly silly hamster wheels
15:05Bronsa:tag, :arglists, :const, :inline-whatever, :line, :column and uhm, I can't think of any other
15:05Bronsait's :inline and :inline-arities
15:05Bronsawell and :macro obviously
15:06Bronsaalso :once on fn*
15:06edwSomething I learned reading about Nimrod: Dr Dobb's still exists! Whoa!
15:07edwJaood: I went cold turkey on both a few years ago. Improved my quality of life immensely.
15:07Bronsajustin_smith: the issue with user-documenting those is that the official documentation isn't really clear wrt their behaviour
15:08justin_smith,(->> (all-ns) (mapcat ns-publics) (mapcat (comp keys meta second)) (into #{}))
15:08clojurebot#{:protocol :added :ns :name :special-form ...}
15:08justin_smithBronsa: OK, so part of the issue here is abstraction leakage, clearly
15:08Bronsaoh well, :dynamic :P
15:09arrdemjustin_smith: essentially. we only have one "definition" structure, so it must expose all kinds of information about the "type" of the definition.
15:10PigDudewhat is the practical difference between (into [] (map f coll)) and (mapv f coll)?
15:10justin_smithBronsa: https://www.refheap.com/88814
15:10justin_smith$source mapv PigDude:
15:10lazybotmapv is http://is.gd/n1z2gs
15:10Bronsajustin_smith: yeah well lots of those aren't used by the *compiler*
15:10justin_smithI think that should answer it
15:10amalloyexpez: because the map {:foo :bar}, when seq'd over, doesn't produce the two elements :foo and :bar, but the single element ("entry") [:foo :bar]
15:11justin_smithBronsa: right, I wasn't trying to correct you or anything, thought maybe that would freshen the memory regarding something
15:11amalloyPigDude: no difference at all, just mapv saves some performance
15:11PigDudejustin_smith: so mapv is faster for the simple case too
15:11PigDudegot it
15:12expezamalloy: I was surprised, though. When I called (set my-map) I expected the map to end up in the send, not the sequential view of the map. Was wondering if there was some logic behind this, to make it easier to remember :p
15:12Bronsajustin_smith: the issue I see is that the current implementation doesn't enforce those metadata options to be consistent, the compiler might crash if you provide a wrong :tag for example, or just ignore it, depending where you use it
15:13amalloyexpez: (set x) doesn't construct a set containing the single element x, it converts x to a set by seqing over it and adding each element
15:13amalloy,(hash-set {:foo :bar}) would create a single-element set containing the map {:foo :bar}
15:13clojurebot#{{:foo :bar}}
15:14justin_smithBronsa: OK. It's a weird corner of the language, and it would be nice to have some of it be more clear. Even if it was a question of making three lists "these are useful, these other ones are tricky, don't ever use these"
15:14Bronsaor :arglists, the compiler doesn't complain if you change :arglists to have a different format than the one used by defn but if you do, the primitive fns optimization will stop working
15:14expezamalloy: aha, thanks!
15:16Bronsajustin_smith: yeah the thing is that we as users of the language don't really have a way of telling what is considered undefined behaviour vs what is a misuse of a language feature, it's arbitrary until Rich steps in and clarifies it
15:17amalloyspeaking of rich, did you guys notice that he made the first commit to master snice march today?
15:17Bronsai did
15:19arrdemI did
15:20bbloom_http://dev.clojure.org/jira/browse/CLJ-1439
15:21puredangersurprised it took you guys this long to notice :)
15:21rlbIf anyone has time to take a look, here's a pared down example of the ring-session issue: https://www.refheap.com/0a7267752bd4bcd8e78d48b61
15:21rlbThese docs made me think the cookies would be preserved: https://github.com/xeqi/peridot#cookies
15:21amalloypuredanger: i only noticed because of your comment on aphyr's keyword patch
15:25Bronsajustin_smith: btw, I had a bug in tools.analyzer.jvm wrt ^:const handling & primitive vals that I only realized after talking with you about it earlier, thanks :P
15:26puredangerwould be happy to hear if anyone tries master and has feedback. I see ~2x improvement in cases that do lots of (already cached) keyword construction - like json parsing. General symbol construction should be faster as well (string interning removed).
15:27justin_smithBronsa: heh, np, glad to hear my confusion somehow led to someone else learning something, even if I still feel a bit confused
15:42dnolen_Om 0.7.0 is out, in sync with React 0.11.1
15:44lpvbif I do (first (filter cond? (map expensive data))) does map stop apply expensive computations after filter and first are satisfied?
15:45lpvbI don't know how lazy clojure seqs are
15:46justin_smithlpvb: I always forget the specific rules for chunking, but modulo chunking issues, that sounds right
15:46jeremyheiler,(first (map (fn [x] (println x) x) (range)))
15:46clojurebot0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n0
15:47jeremyheiler32 per chunk
15:47bbloom_subject to (unlikely) change
15:47lpvbwhy does it do chunks?
15:47lpvb._.
15:47justin_smith,(chunked-seq? (filter even? (map inc (range))))
15:47clojurebotfalse
15:47lpvboh
15:48justin_smithdunno if that actually helps much, since you care about map's chunkiness
15:48lpvbso when does it decide to chunk?
15:48Bronsa,(first (map (fn [x] (println x) x) (iterate inc 0)))
15:48clojurebot0\n0
15:48bbloom_tbaldridge: you seem to eat a lot of popcorn, that can't be healthy
15:48justin_smith,(chunked-seq? (map inc (range)))
15:48clojurebotfalse
15:48tbaldridgelpvb: that's a very interesting question, one that may take some time to discover
15:48tbaldridge,(chunked-seq? (map inc (vec (range 100))))
15:48clojurebotfalse
15:49tbaldridgeokay, now I'm confused
15:49stuartsierraOK, who had the question about Component?
15:49Bronsa, (chunked-seq? (seq (map inc (vec (range 100)))))
15:49clojurebottrue
15:49bbloom_LazySeq doesn't implement IChunkedSeq
15:50bbloom_seq will recursively unwrap concrete LazySeq instances to find the deepest head of the ISeq chain
15:50stuartsierraexpez: ?
15:50tbaldridge, (chunked-seq? (map inc (seq (vec (range 100)))))
15:50clojurebotfalse
15:50bbloom_,(supers (class (map inc (seq (vec (range 100))))))
15:50clojurebot#{clojure.lang.Obj clojure.lang.Seqable java.io.Serializable clojure.lang.IPending clojure.lang.Sequential ...}
15:50bbloom_arg
15:50bbloom_argh*
15:51bbloom_anyway, it does not include chunkedseq
15:51bbloom_IChunkedSeq rather
15:51bbloom_https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LazySeq.java#L17
15:51bbloom_tbaldridge: https://github.com/clojure/clojure/blob/c9e70649d2652baf13b498c4c3ebb070118c4573/src/jvm/clojure/lang/LazySeq.java#L54
15:52bbloom_that should clear it up
15:52tbaldridgebbloom_: yeah, but from my reading of clojure.core/map it looks like map returns chunked seq sometimes
15:52bbloom_tbaldridge: no, it's wrapped in the lazy-seq macro
15:52Bronsatbaldridge: it always returns a lazy-seq
15:52tbaldridgeah right
15:53bbloom_it always returns a LazySeq, but that lazy seq may contain a chunked seq
15:53tbaldridgeand thus hilarity ensues
15:53bbloom_it's kinda generally wonky that map has to think about chunking though
15:54bbloom_could be generally made faster & simpler by basing it on reducers (or something like it)
15:54bbloom_aka "traversable"
16:02bbloom_Fare: have you considered replacing your state monad with lazy seqs simulating the state monad?
16:03bbloom_tbaldridge: back me up on this one :-)
16:04tbaldridgeRecently I've been replacing my state monads with atoms/mutable data structures :-P
16:04bbloom_haha even better
16:04bbloom_assuming you don't need backtracking or anything like that
16:04tbaldridgeDo you need backtracking? Do you need to use multiple threads? If the answer to both of those is no, think about mutable data structures.
16:04Farebbloom: what's lazy seqs simulating the state monad?
16:05bbloom_Fare: basically instead of accepting/returning a monad, you accept/return a stream of states
16:07bbloom_just suggesting reifying the internal structure of the monad as printable/readable data, rather than hiding it behind opaque function objects
16:07justin_smithjust watch out for chunking!
16:07justin_smithj/k
16:08Fareso instead of having functions from S to [A S], you have functions from (S...) to [A (S...)] ???
16:08lazybotFare: Yes, 100% for sure.
16:08tuftdoes anyone here do property based testing, and if so is it your predominant testing style or do use more traditional unit tests?
16:08Farenot sure what you mean. My state monad state is readable enough.
16:09bbloom_Fare: sorry, let me clarify & tailor to your situation
16:09bbloom_you need state back tracking for your parser, right?
16:10bbloom_if not, definitely just use mutability as tbaldridge says
16:10tufti'm struggling a bit. have some property based tests working, but in other areas it feels like i'll have to reimplement the main code to express the properties. also figuring out how to express generators for all the important scenarios seems harder than manually writing input/actual output/expected output triples
16:11tufter input/expected output doubles that is
16:12Farebbloom: my parser is done, though yes, I'll need better backtracking some day to produce usable error messages
16:13FareI'm doing scope analysis right now
16:13FareI'm also wondering how macros fit in this compiler I'm writing.
16:18justin_smithFare: wouldn't building a vector as you go down the tree, then popping back up that vector as you go up again suffice to document how you got to the syntax error?
16:19bbloom_justin_smith: for an eager traversal, yeah that should work
16:20bbloom_just a stack of scopes that you push/pop in a try/finally
16:20Farejustin_smith, not sure what you mean. My plan was to add some fields to the monad's state to record just how far you got, and what was expected there
16:20justin_smithbbloom_: ahh, lazy parsing is a new concept to me
16:21bbloom_justin_smith: i don't think he's doing anything lazy, it's just that that's where much of the benefit of functional purity comes in with respect to back tracking
16:21justin_smithFare: does the state not have a concept of going down into a sub expression or coming back up out of it?
16:22Farebut right now I'm traversing the parse tree with an environment on the side, and trying to analyse its scoping structure -- though I believe macro expansion should go before that phase, because expansions can modify what's in the scope.
16:22bbloom_the push/pop scopes thing makes sense for scope analysis, which he mentioned, but an alternative for that is to just do multiple passes & gather intermediate results in ast nodes
16:22Farejustin: when doing analysis, it does
16:23bbloom_Fare: have you looked at tools.analyzer or the cljs compiler?
16:23Fareand my plan was doing one pass, with a new environment in each scope, and recording the results at the end in the ast node.
16:23bbloom_they do something very nice with :env for tracking scope
16:23Farebbloom_, not closely, yet
16:23Farepython scope analysis is a ugly
16:24Farecould be worse, though.
16:24bbloom_Fare: i imagine it could be done with a single recursive pass over the tree as long as you did some work on both the down and up parts of the traversal
16:25bbloom_in a lisp-like, there's a nice invariant that lexicals respect containment of nodes in the ast
16:25bbloom_for vars, which have dynamic extent, the various clj analyzers simply use a mutable atom
16:25bbloom_which mirrors the semantics of the vars themselves
16:26bbloom_but for lexicals in something without binders & with hoisting, you need something more complex
16:26bbloom_so in python, i'd imagine you could simply push/pop a stack of scopes and when popping, assoc that scope in to the current ast node as you back out of the recursion
16:28abaranoskyis the deadline for Clojure /Conj talks the end of today, or was it the end of yesterday?
16:28bbloom_formally speaking in terms of attribute grammars, clojure/scheme lexicals are an "inherited" property of the AST and in python, they are a "synthesized" attribute
16:29alandipertabaranosky, i think today is the last day
16:29abaranoskyalandipert: thx :)
16:30puredangertoday
16:31bbloom_Fare: but being a synthesized attribute means that you'd have to do multi-pass to use that info... so you can model it as a "chained" attribute to let you do it in one pass: utilizing state
16:32bbloom_puredanger: i feel like i surely could find something to talk about, but i've already procrastinated this long, why not procrastinate until it's too late?
16:33puredangerwould be happy to see something from you :)
16:33puredangertoday
16:33puredanger;)
16:34bbloom_but all my cool clojure projects aren't stable enough to justify standing on a stage and talking about them!
16:34Farebbloom_: well, I do one pass to gather the synthetised attribute, and another to use it, indeed
16:35bbloom_Fare: i'm not up on the finer details of python scoping rules, but i *think* you can do it with a chained attribute
16:35rlbjustin_smith: fwiw, it looks like the code causing the "problem" (assuming it's not just my understanding at fault) is here: https://github.com/xeqi/peridot/blob/6afae7b563ff1521dba6d04a7ec2dca91f807f7b/src/peridot/cookie_jar.clj#L63
16:35Farebefore I synthetize those attributes, I can't even tell which 'x' a python variable is referring to.
16:36puredangerbbloom_: having an upcoming talk tends to help focus the mind on making it stable I find :)
16:36Farei.e. it could be "local", "nonlocal" or "global".
16:36rlbperidot drops all the cookies whenever the "Set-Cookie" header is ()
16:36justin_smithrlb: yeah, the stuff I use always expects me to explicitly pass the cookies back out again
16:36Fareplus the entire function will behave very differently if the "yield" keyword appears in it.
16:36justin_smithrlb or maybe I am just doing some conservatively, but it just makes sense
16:37rlbwondering if that's intentional -- changing the (dissoc ...) to just cookie-jar "fixes" the behavior.
16:37Farebbloom: is there literature / examples on this "chained" attribute?
16:37justin_smithrlb: in that case, how would you clear the cookies from the server end?
16:38rlbI'd assume the normal way (though I'm still learning): i.e. "Set-Cookie: ... expires ..."
16:39bbloom_Fare: can't find a super simple example, but it appears in the literature under several different names. the other one i recall is "threaded attribute"
16:39rlbjustin_smith: what do you use/recommend wrt testing?
16:40bbloom_Fare: in short: inherited=pre-visit, synthesized=post-visit, and chained=visit-state
16:40bbloom_or visitor-state, rather
16:41justin_smithrlb: I make a synthetic request map as a literal in my test ns, and pass it to my handler function, and then verify the results I expect to see in the output (ie. there is a cookie in the request coming in, and also in the result coming out)
16:41justin_smithjust having that unit test on each page endpoint function is a great sanity saver
16:42FareI understand inherited and synthesized, but still not chained.
16:42bbloom_Fare: simple example: annotating a tree:
16:42bbloom_depth = inherited property
16:43bbloom_node count = synthesized
16:43Farehttp://en.wikipedia.org/wiki/Attribute_grammar has inherited and synthesized
16:43bbloom_node index = chained
16:43bbloom_where index is a depth first numbering
16:44Fareok, I think I see what you mean, kind of
16:44bbloom_a chained attribute is both inherited and synthesized
16:44bbloom_but can be done in a single pass
16:44Fareit's what in asdf I call sideway dependency vs upward dependency (inherited) or downward dependency (synthesized)
16:45Farebbloom: are you providing some infrastructure for attribute grammars?
16:46bbloom_Fare: i experimented with them, but there's not much benefit beyond a thought framework if you're doing explicit multipass operations
16:46bbloom_recursive functions work just fine for that
16:47rlbjustin_smith: ok, thanks
16:48bbloom_Fare: if you want something more interesting/declarative w/o having to explicitly schedule passes, then there are demand driven (ie lazy) attribute grammars, but then you get in to all sorts of trouble with that & performance
16:48bbloom_you need a pretty sophisticated evaluator for those
16:48ahoenigmannI have a clojure function that reads some info from a file. Now I want to do that in a separate Thread.
16:48Fareyes, I was vaguely thinking of that.
16:49bbloom_https://github.com/brandonbloom/ascribe
16:49ahoenigmann(It could block)
16:49FareOK, I'll retry naively with a state monad
16:49Fareand see where it leads me
16:49bbloom_i say try an atom :-)
16:49Fareand multiple passes, different state every pass
16:49justin_smithFare: asdf?
16:50Farejustin_smith, the Common Lisp build system.
16:50justin_smithahh, I figured you might mean that
16:50Farejustin_smith, I rewrote it, two or three times, and now it kind of makes sense (to me)
16:50justin_smithotherwise I was going to warn you of the naming conflict :)
16:50bbloom_i have a super cool UI-in-cljs prototype that is essentially a dynamic attribute grammar, but there's lots of low hanging perf fruit i just haven't put in the hours for yet
16:50justin_smithFare: wait, you wrote asdf?
16:51bbloom_Fare: this also mentions chained attributes: http://www.haskell.org/haskellwiki/The_Monad.Reader/Issue4/Why_Attribute_Grammars_Matter
16:51Fareno, just rewrote it — if you're interested, I wrote a 26-page essay on it earlier this year.
16:52FareFor a short comment on whether I wrote it, see the conclusion of this post: http://fare.livejournal.com/176185.html
16:54justin_smithFare: does cybernethics reference Weiner et. all? or just referencing cyber generically? I had a mentor who was one of the last to get a degree in Cybernetics before darpa ruined all that in the '70s
16:56mikerodWhen you define a type - like (deftype MyType [x])
16:56mikerodIt is obvious that you have a public field x, so you can do (.x (->MyType 1))
16:56technomancyjustin_smith: wow, cool
16:56mikerodBut why does this also work? (.-x (->MyType 1))
16:56mikerodwat
16:57mikerod,(deftype MyType [x])
16:57clojurebotsandbox.MyType
16:57mikerod(.-x (->MyType 2))
16:57mikerod,(.-x (->MyType 2))
16:57clojurebot2
16:57mikerod,(.x (->MyType 2))
16:57clojurebot2
16:57Bronsamikerod: .- is field access syntax introduced in 1.4 IIRC
16:57stuartsierramikerod: That's an artifact of older syntax.
16:57mikerodhmm
16:57justin_smithtechnomancy: cybernetics is kind of crazy, in that it gets closer to philosophy / generalism than most science is comfortable with
16:57xeqirlb: looks like your correct, glancing at the http spec and corresponding rack.test's tests indicates it should use "Expires" in the past for clearing
16:58justin_smithtechnomancy: I mean Margaret Mead was one of the members of the founding commitee
16:58mikerodSo this is an older syntax thing? I'm definitely curious why it exists.
16:58stuartsierramikerod: In Java, field and method names rarely clash, so you could use (.x …) for both. This turned out to be a problem in ClojureScript, so (.-x …) syntax was added specifically for fields.
16:59Farejustin_smith, yes, reference Weiner et al., with a twist
16:59technomancyI have a copy of the second edition of Cybernetics that I will probably never get around to reading =\
16:59mikerodstuartsierra: so which should be used in Java?
16:59stuartsierra(.x ..) stil works in Clojure on the JVM for backwards compatibility, but (.-x …) is the standard way to access fields now.
16:59mikerodstuartsierra: interesting.. I guess this is implemented somewhere in the compiler?
16:59stuartsierramikerod: yes
16:59mikerodstuartsierra: I don't see a field on the Java class
16:59justin_smithtechnomancy: they changed the darpa funding rules in the '70s, no more darpa money unless you could demonstrate "direct military usability" of your research, the cyberneticists dissolved their departments rather than collect the money by making war toys
16:59technomancyjustin_smith: but the whole idea of metacircularity and runtime compilation seems deeply intertwined with it
16:59Fareon my business card I spell it with a ħ
17:00mikerodlike _x or something
17:00justin_smithtechnomancy: cyberneticists in my experience are totally obsessed with recursion (or as they like to call it, circularity)
17:01mikerodstuartsierra: this is a bit interesting that the hyphen variety is the standard now. it would not be a convention that would work if you wanted your deftype'd things to be "Java beans"
17:01justin_smithtechnomancy: and they are a direct root of info theory as we know it today, as well as signal processing among many other examples
17:01justin_smithFare: nice
17:01mikerodstuartsierra: like if I'm using my types to interact with an external Java API that will try to find field "x" via a "getX" or a direct public field access
17:01stuartsierradeftypes definitely aren't Java beans. All fields are public and there are no getter/setter methods.
17:02Farejustin_smith, or "reflection"
17:02justin_smithFare: ?
17:02Fareor "autopoiesis"
17:02mikerodstuartsierra: Hmm. ok not Java beans. It seems that a lot of libs that do bean stuff will find public fields instead though.
17:02justin_smithyes, they like those terms too :)
17:03mikerodI guess it is just a specific case. The hyphen thing is just strange to me. I guess it is discussed on a mailing list or something somewhere.
17:03stuartsierramikerod: (deftype Foo [x]) creates a Java class with a field named just `x`. They hyphen is Clojure syntax only.
17:04mikerodstuartsierra: yes, I can reflect on that. That's why I think the hyphen variety is the preferred way to access it now.
17:04mikerodThat's why I think it is strange*
17:05stuartsierraThe hyphen is just there to distinguish field-access from method calls. In Java, field access is so rare that it seldom matters.
17:05dbushenkohi all!
17:06dbushenkohow to set default encoding to utf-8 for ring responses?
17:06mikerodstuartsierra: I see. This is even documented " The .- form will resolve only as field access (never as no argument public method) and should be preferred when that is the intent."
17:06mikerod@ http://clojure.org/java_interop#Java Interop-The Dot special form now
17:06rlbxeqi: ok, thanks -- for now, suppose I can just override merge-cookies
17:06mikerodso I guess I should have just stayed up to date on my clojure.org docs! :P
17:07mikerodstuartsierra: thanks for the explanation
17:07stuartsierrayou're welcome
17:07rlbxeqi: i.e. maybe something like this: https://www.refheap.com/d0c2645dd1ec472953cc4c874
17:12thesaskwatchHi, is CIDER the most actual current emacs mode for clojure?
17:13justin_smiththesaskwatch: cider is more actively developed, whether to use it (and which version) depends on how you feel about stability
17:14dbushenkothesaskwatch, yeah, CIDER is cool!
17:14xeqi&(empty? nil)
17:14lazybot⇒ true
17:14thesaskwatchjustin_smith: I'm a noob, but interested in productivity. For example, is there a way to debug using CIDER?
17:14xeqirlb: you can remove an if ^
17:14justin_smiththesaskwatch: are you new to emacs?
17:15rlbyeah -- noticed that, but then figured you'd probably clean up any real fix
17:15rlbxeqi: ^
17:15xeqibut something like that.. I'd have to go dive in to remember if the expires code is sufficent for removal
17:15stuartsierradnolen_: Latest Closure Library build has hit Maven Central http://search.maven.org/#artifactdetails%7Corg.clojure%7Cgoogle-closure-library%7C0.0-20140718-946a7d39%7Cjar
17:15thesaskwatchjustin_smith: not much, can use it for editing text, window management, simple configuration, etc. Also was able to edit and evaluate some clojure code with cider.
17:15xeqiI would hope its not sending expired ones
17:16bbloom_stuartsierra: does google publish a changelist?
17:16dnolen_stuartsierra: great thanks!
17:16justin_smiththesaskwatch: if you already have it, may as well try it, but I don't know that it has good stepping / debugging / live process inspection at this point
17:16stuartsierrabbloom_: They don't even have versioned releases any more.
17:16justin_smiththesaskwatch: I have heard you can do some of that with intellij idea+cursive
17:16stuartsierrabbloom_: Just a Git repo at https://github.com/google/closure-library/
17:17bbloom_stuartsierra: heh, i dunno what it's like now, but back in 2007, all of google's code was in one giant perforce tree
17:17thesaskwatchjustin_smith: I have it too, but suspected emacs would be more cannonical tool
17:17justin_smiththesaskwatch: and there is a cljs/ browser based inspector for investigating exceptions that get thrown, called schmetterling
17:17justin_smiththesaskwatch: more of us use emacs than everything else combined, but only jsut barely
17:18dnolen_stuartsierra: just waiting for an executor so that ClojureScript release can build now
17:18thesaskwatchok, one more thing - I"ve heard about autoreloading of code - what tools is the most fashionable now to do it? are you all using this feature? or maybe a different workflow?
17:19justin_smiththesaskwatch: it comes with ring, if you are developing a ring based server
17:20justin_smithotherwise I like to edit a def, and evaluate, and try a few things, etc. with more of a repl focus
17:20thesaskwatchjustin_smith: nope, I mean something more general - currently I'm writing a console app. What I want to do it to avoid having to restart emacs from time to time.
17:20justin_smiththesaskwatch: why would you have to restart emacs?
17:20stuartsierradnolen_: Oh boy, all the matrix builds are runnnig. This will take a while.
17:20justin_smith(require '[some.ns :as alias] :reload)
17:20dnolen_stuartsierra: yeah
17:20dnolen_stuartsierra: does that normally happen on Friday's?
17:21thesaskwatchjustin_smith: when I want to be sure that repl has loaded all the code that is on disk
17:21justin_smiththesaskwatch: unless you are playing with protocols or defmethods, you shouldn't even have to start clojure
17:21stuartsierradnolen_: It happens every time there's a commit to Clojure. It automatically rebuilds & tests all of contrib.
17:21dnolen_ah ok
17:21thesaskwatchjustin_smith: I don't even know how protocols work yest :)
17:21justin_smiththesaskwatch: you require and reload files as you edit them - the repl based workflow is very interactive, I never have multiple files to load - I usually only have one function or definition to update
17:22Bronsastuartsierra: the commit was 5 hours ago, have they been running since then?
17:22puredangeryes
17:22justin_smiththesaskwatch: that's how I work at least
17:22puredangerWHEEE
17:22Bronsawow
17:22thesaskwatchjustin_smith: is the :reload functionality builtin to clojure?
17:22puredangercontribs * jdks * clojure versions = I don't know, a lot
17:22stuartsierraBronsa: probably. 30+ libs, 10+ test builds for each…
17:22justin_smiththesaskwatch: also, not only do you not need to restart emacs to get a clean project reload, you can be connected to multiple projects simultaneously
17:23justin_smiththesaskwatch: yes, what I showed above was normal clojure syntax
17:23justin_smithnot cider at all
17:23thesaskwatchjustin_smith: yeah, I know that. However - is there a way to disconnect from repl?
17:23stuartsierraWe use the Hudson box to heat puredanger's house.
17:23puredangerit's an old 386 I had lying around
17:23stuartsierrahaha
17:23justin_smiththesaskwatch: you can close the process buffer for the connection if you want clojure to continue but not be connected, you can run (System/exit 0) to make the clojure process exit
17:23thesaskwatchjustin_smith: this :reload thing sounds very nice. Thanks!
17:24justin_smithnp
17:24justin_smiththere is also :reload-all for deeper levels of reloading
17:24stuartsierraI wonder if Clojure would even run on a 386?
17:24justin_smithstuartsierra: haven't people run it on arm?
17:24puredangerstuartsierra: occasionally (ok, every time there's a commit to Clojure) I wonder if we push not make all this stuff happen automatically
17:24puredangers/push/should/
17:25puredangerI'd often rather push that button before I go to bed or something
17:25stuartsierrapuredanger: a reasonable question. Easy enough: just remove the "build after" from Clojure's Hudson config.
17:25rlbxeqi: did you want me to file an issue, or are you good?
17:25rlbbtw
17:25thesaskwatchstuartsierra: if jvm runs on 386 (which AFAIK it does) than clojure should too (just guessing)
17:25puredangerstuartsierra: yeah, I've considered it
17:25Bronsapuredanger: testing the new snapshot after a commit to the contrib lib or before a new release seems reasonable enough
17:27puredangerthat's separate and already happens
17:27puredangerif I understand you right
17:27thesaskwatchthis looks useful: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
17:27puredangerthis is about what happens when there's a commit to clojure itself - right now every commit rebuilds the world
17:28puredangerI'd be happy to do that once a day or week or on demand
17:29puredangerthesaskwatch: shhh stuartsierra is right here! (don't inflate his ego!) :)
17:29xeqirlb: you're welcome to submit a PR with that change if you want an oss commit
17:29thesaskwatchpuredanger: ok .. actually this doesn't sound very useful ;)
17:29stuartsierrapuredanger: :P
17:29rlbxeqi: by all means, whatever's best for you -- I'm happy either way
17:30xeqirlb: patches welcome :)
17:31Bronsapuredanger: yeah, I was agreeing with you, rebuilding the world at every commit to clojure seems unnecessary given that a push on a contrib lib will test the new clojure snapshot anyway; I was suggesting that rebuilding the world before a clojure release just to double-check could be something to consider
17:31rlbok -- will send in a bit -- thanks again
17:32puredangerBronsa: gotcha, yes definitely. And actually I would like a periodic automated build all, but daily or even weekly would be sufficient I think.
17:33arrdemclojure-nightly would be nice
17:34stuartsierraYou can always get the latest -SNAPSHOT from Sonatype, so this would just be for testing I think.
17:34Bronsapuredanger: daily seems excessive, that'd mean hudson would be inusable for at least 5 hours a day, every day. more if a commit gets into clojure after the automatic build started
17:34puredangerstuartsierra: right, we'd still rebuild clojure itself, just not all the libs
17:35stuartsierrayse
17:35puredangerbut we could do rebuild-all on weekend
17:35Bronsa+1 on that
17:36Bronsapuredanger: maybe on weekends IFF a commit landed in clojure master during the week
17:36puredangeryou think we have that kind of technology? :)
17:36stuartsierraOur Hudson is old enough to vote.
17:36andyf_arrdem: I am ready to commit cheatsheet with updated Grimoire links
17:36Bronsaouch :)
17:36arrdemandyf_: send it. I already updated the site.
17:37puredangerseriously though, you can specify a crontab for it so that should be sufficient
17:39andyf_puredanger: The hudson builds have been done physically in your home since before you were cognitect employee?
17:39puredangerthat was a joke before :)
17:39puredangerContegix has been very kind to host the Clojure build box for many years
17:39puredangerand jira and confluence
17:40puredangeralthough Contegix is here in St. Louis, so….
17:40andyf_Ah. It sounded plausible enough that it might be true
17:41andyf_St Louis homes typically don't need extra sources of heat in August, I know from past experience
17:41puredangercorrect. :)
17:41Bronsaspeaking of confluence, is the Dashboard broken only for me? it's not showing updates that I can otherwise see if I look at a page history
17:42puredangerno, that's perpetually broken
17:42Bronsaah, ok.
17:42puredangerthere are some background jobs that are supposed to do that indexing but they … don't
17:43puredangerI'm a bit mystified by the admin controls on it and I can occasionally press the right buttons to make it work again, let me try
17:43bbloom_this may be a good time to point out this post from july 28: https://github.com/blog/1866-the-new-github-issues
17:43puredangerupgrading all of this infrastructure is on my todo list
17:44puredangerincluding looking at other alternatives bbloom_
17:44bbloom_puredanger: i can't hear you, i'm ducking
17:44puredangerquack
17:44bbloom_ow.
17:44hyPiRionbbloom_: I read that as "I'm a duckling" for some reason.
17:45bbloom_i laughed pretty hard when i saw that they used Microsoft/TypeScript as the project in the post's screenshot
17:45stuartsierraEnterprise-grade Emoji
17:46puredangerBronsa: boom, updated index
17:47andyf_arrdem: Updated. A few test clicks on symbols with non alpha chars in them worked, so probably all fine
17:47timsgI’m having a lot of trouble signing the Clojure contributor agreement. I’ve tried in Chrome, Safari, and Firefox. It’s difficult to enter text in any field, and impossible to even put the Name field in focus. Assuming this isn’t a filter for contributor competence, does anyone know a workaround?
17:47Bronsapuredanger: woot thanks!
17:47arrdemandyf_: it should be. Really I should just make a "grimoire" org and have a dep you can point to with a version range for the latest munge, but I don't expect to be changing it again.
17:48puredangertimsg: the name field is auto-filled by later parts of the form I think
17:48puredangerthe signing part that is
17:48timsgpuredanger: ok I’ll try that, thanks
17:48bbloom_timsg: what he's saying is that it is indeed a filter for contributor competence
17:48timsgbbloom_ o snap
17:48stuartsierrabbloom_: No, that's what JIRA is for.
17:48puredangerworst case, you can print and mail it to us - ping me at alex.miller@cognitect.com if you need more help
17:49bbloom_haha, no really, i've seen that adobe signature thing before. super confusing
17:49puredangeryou are all welcome to contribute :)
17:49bbloom_don't feel bad timsg
17:49bbloom_timsg: did you figure out the clr thing you pinged me about?
17:49Bronsapuredanger: that's something that confused a number of folks before, maybe it's worth pointing that out on the /contributing page?
17:49puredangerBronsa: I hadn't seen that, thx
17:50puredanger(the prior confusion that is)
17:50timsgbbloom_: It’s okay, I know I shouldn’t feel too bad for not being able to so much as sign the form registering me for contribution to a programming language
17:50timsgit’s flash, after all
17:50lpvbis clojuredocs.org a good website
17:51timsgbbloom_: yeah I figured it out. answer is the Clojure-CLR is broken, going to have to fix it. Hence the contributor agreement.
17:51lpvbI think it was the out of date one..
17:51puredangerin case anyone is curious, we average about 2 new CAs every day
17:52hiredmanpuredanger: there needs to be a chart showing CA's per day on the website
17:52arrdemlpvb: I'm biased, but http://grimoire.arrdem.com is in-date and maintained. better is subjective.
17:52puredangerhiredman: I'll put that at the top of my list ;)
17:52hiredman:)
17:52stuartsierra*Which* list, you'll never know.
17:53lpvboh was about to say there was no search
17:53puredangeractually, there is programmatic access to that data now, so that's actually feasible
17:53lpvbmaybe you should move that to the top
17:53andyf_lpvb: The doc strings and source code on ClojureDocs are older, but most if not all of the examples are as good as they ever were
17:53bbloom_http://crossclj.info/ is pretty interesting too
17:53arrdemcrossclj is osum. unfortunately they still have munging problems...
17:54bbloom_yeah i tweeted at them that clojure.core/< doesn't render correctly
17:54andyf_There are definite signs that ClojureDocs may be updated soon, e.g. New version has a test site up and running
17:54timsgbbloom_: unless there’s something I’m really really missing. Here’s the relevant thread, actually I’d love your feedback on this issue if you have a minute: https://groups.google.com/forum/#!topic/clojure-clr/YbPhOB-ILSE
17:54Bronsacrossclj could be really good, I find it has a somewhat confusing UI though
17:54bbloom_Bronsa: agreed
17:55bbloom_timsg: isn't this a case of "don't do that"?
17:56timsgbbloom_: as in, if everyone agrees not to mutate records, we can pretend they’re immutable?
17:56bbloom_timsg: well, i mean, the field (or on the clr, i guess it could be a property) should be read-only
17:56bbloom_but... just don't mutate it
17:57bbloom_don't use set! unless you know the thign you have is in fact mutable
17:57Bronsadeftype/record fields are private in the JVM btw
17:57bbloom_yeah, it generates getters
17:57bbloom_well getter methods
17:57bbloom_on the CLR it may actually generate property getters
17:57amalloyBronsa: record fields are public final, not private
17:58timsgbbloom_: there must be some way to enforce privacy, right?
17:58Bronsaamalloy: yeah right, I was thinking about mutable fields
17:58bbloom_timsg: sure, but it's not "broken" from your perspective
17:58amalloybbloom_: it sure looks like a bug in defrecord to me
17:58amalloy(in the clr version)
17:58andyf_timsg: Technically everyone is pretty much agreed on not mutating Clojure persistent data structures in place, too, although it takes more than set! in Clojure to mutate them
17:59bbloom_amalloy: yeah, it is
17:59bbloom_just saying it's not a problem really, there are plenty of public/mutable things in clojure too that should be private
17:59bbloom_but nobody notices
18:00bbloom_,(defn f [x] (* x 2))
18:00clojurebot#'sandbox/f
18:00bbloom_,(.__methodImplCache f)
18:00clojurebotnil
18:01bbloom_,(set! (.__methodImplCache f) (clojure.lang.MethodImplCache(nil, nil))
18:01clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
18:01bbloom_,(set! (.__methodImplCache f) (clojure.lang.MethodImplCache. nil nil)) ; heh, went java all of a sudden
18:01clojurebot#<MethodImplCache clojure.lang.MethodImplCache@70a698>
18:01bbloom_,(.__methodImplCache f)
18:01clojurebot#<MethodImplCache clojure.lang.MethodImplCache@70a698>
18:01bbloom_hurray! mutation of something that should be private
18:01bbloom_sshhh don't tell anyone
18:02Bronsa,(fn [] 2)
18:02clojurebot#<sandbox$eval142$fn__143 sandbox$eval142$fn__143@1ddbf6e>
18:02Bronsasandbox$eval142$fn__143/const__0
18:02Bronsa,sandbox$eval142$fn__143/const__0
18:02clojurebot2
18:03technomancyhaha wait, the electronic CA submission requires flash?
18:04bbloom_,(let [v [1 2 3]] (aset (.tail v) 1 5) v)
18:04clojurebot[1 5 3]
18:04bbloom_whoops! ^^
18:04justin_smithtechnomancy: it's an adobe conspiracy
18:04bbloom_arrays: the largest source of accidentally mutable public APIs in the history of programming!
18:05timsgbbloom_: It’s kind of broken. My understanding is that, while strictly speaking you *can* mutate “immutable” data structures, you have to do a weird dance that looks like cheating - hacking some cache, or aggressive reflection stuff, or whatever. That seems an acceptable (though still kind of disturbing) threshold for immutability.
18:05bbloom_timsg: see my array example ^^ not very aggressive :-P
18:05timsgIt should be a lot harder than just set!-ing an incoming value tho
18:05noobatronIs there a mute button
18:05timsgbbloom_: no it isn’t and I find it quite disconcerting
18:05bbloom_timsg: yeah, you're right, it should be immutable. i'm sure they would accept a patch
18:06timsgbbloom_: yeah, hence the contrib agreement
18:06timsgbbloom_: actually you can do the same thing in ClojureScript. Might be a better reason tho
18:06bbloom_timsg: well there's nothing you can do about it in cljs
18:06bbloom_there's no such thing as private fields
18:07timsgbbloom_: maybe something with closures?
18:07bbloom_explicit fields perform better than closure fields
18:07justin_smithwhat about freeze? or is that actually usable in js?
18:08bbloom_freeze isn't cross browser
18:08justin_smithoh, figures
18:08timsgbbloom_: hm. tradeoff I guess. And clearly other people aren’t as troubled by this as I am
18:08dnolen_justin_smith: bbloom_: it's also slow
18:08justin_smithtimsg: how many people are actually using clojure-clr?
18:08arrdemandyf_: is it reasonable to tweak the cheat sheet to float out to arbitrarily many columns wide?
18:08justin_smithdnolen_: the freezing process, or the frozen object, or both?
18:08bbloom_timsg: the compiler could (in theory) detect accessibility & mutability for deftypes, or assume fields with a leading underscore are private as a convention
18:08bbloom_but it's probably not worth the complexity
18:09timsgjustin_smith: not sure, but there’s ~40 members on the list
18:09bbloom_the rule is: if you're using set!, then you should know what you're doing
18:09dnolen_justin_smith: the frozen object, gets deoptimized
18:09technomancywhat's the word for things that you can just broadly tell everyone they shouldn't be doing, with the knowledge that the people who are OK doing it know enough to ignore your advice?
18:09timsgbbloom_: Maybe but there’s a reason you can’t set! eg an element of a persistent vector, right?
18:10andyf_arrdem: I don't mind adding options to the generation code for it, as long as I can continue to generate what it does today
18:10justin_smithdnolen_: ouch - somehow one would expect the opposite would be possible, good to know
18:10dnolen_justin_smith: things that no one uses gets deoptimized
18:10dnolen_justin_smith: maybe one day, but not today
18:10arrdemandyf_: okay. I'm just looking at https://github.com/arrdem/grimoire/issues/43 and pondering.
18:10bbloom_timsg: set! only works on fields and vars
18:10bbloom_timsg: but aset worked just fine on tail :-P
18:11justin_smithtechnomancy: o'reilly has an icon for it I think, maybe there is a unicode ☡
18:11timsgbbloom_: god you’re right. that’s awful.
18:11justin_smiththat doesn't look quite right here
18:12bbloom_timsg: in cljs, aset works on fields too, btw
18:12dnolen_bbloom_: you can enumerate undefined behavior in any language all day
18:12dnolen_:)
18:13bbloom_dnolen_: a fact i'm trying to convey to timsg :-)
18:14justin_smithdnolen_: one of my favorite things about esoteric languages (intentionally hard to use or weird little proofs of concept that are just barely turing complete) is that they can be so small as to be fully defined, or only have one or two cases of undefined behavior. While also being so crappy and small that doing anything at all with them is impressive.
18:15gfrederickseven BF is pretty ambiguous at the edges
18:15gfredericksit's not hard to nail down though, it just wasn't officially
18:16dnolen_justin_smith: hrm I don't think I've seen such a thing, there's alway so many edge cases
18:16dnolen_definition order, scope, floats etc.
18:16justin_smithdnolen_: these are toy languages, most of them don't have floats
18:17justin_smithheh
18:17technomancywell it helps that they're like 90% stack languages to begin with
18:17gfrederickssingle-threaded
18:17justin_smithtechnomancy: but fungoids!
18:17dnolen_justin_smith: someone should do a undefined behavior in esoteric languages, I'm sure it would be eye opening
18:17dnolen_even for what appear on the surface to be the most trivial well defined toy langs
18:17justin_smithhttp://catseye.tc/node/Esolang
18:18justin_smithdnolen_: indeed - though my suspicion is that unlambda may be without any undefined behavior (I have no proof)
18:18justin_smithhttp://www.madore.org/~david/programs/unlambda/
18:19bbloom_basically, the only meaningful language that has ever even attempted to eliminate undefined behavior is Standard ML
18:19justin_smithit's a purely functional obfuscated language
18:19justin_smithbbloom_: how far did they get with that?
18:20bbloom_and the fact that the spec gets revised for an otherwise "finished" language with formal semantics, should basically give you an understanding of how hard it is to eliminate undefined behavior
18:20justin_smithtechnomancy: regarding the whole stack machine thing, the only datatype available in unlambda is functions, no numbers, no stack...
18:20bbloom_http://www.typedynamic.com/2012/06/formal-language-semantics.html
18:21dnolen_bbloom_: and specs can't do much about the reality of things an implementation may wish to accomplish
18:21bbloom_dnolen_: right
18:21bbloom_even if you have a machine checked proof of some important property, such as memory safety, you're still bound to have good old fashioned bugs
18:21bbloom_not just in your implementation, but in your machine checker too!
18:23dnolen_http://sel4.systems/FAQ/#l4v
18:23timsgbbloom_, dnolen_: I think I get what you’re saying, that there’s a fuzzy region of tolerable deviations from the presumed spec, and we could all grow old trying to patch them. Still, I don’t think the ability to casually and accidentally mutate immutable data structures lies within that region. On the other hand, the loophole in question seems sufficiently subtle that it hasn’t hurt anyone enough yet for them to patch it, so maybe I
18:23timsgbeing too uptight about this
18:23bbloom_although, the kframework guys are doing some cool work on generating not-unreasonably-inefficient interpreters from formal semantics, which is cool
18:24dnolen_timsg: Clojure-CLR has a bug w/ respect to defrecord that's for sure
18:24dnolen_esp. if deftype works correctly
18:25timsgdnolen_: deftype doesn’t, nothing seems to generate private fields
18:25andyf_timsg: Create a ticket or two on that topic. It may get addressed if the language maintainer agrees
18:25timsgandyf_: yep, that’s that plan. Got swept away by this conversation tho :)
18:25andyf_Cool
18:26dnolen_timsg: so that's a bug too if the CLR can enforce it definitely should
18:26dnolen_timsg: that said for conformant Clojure code this mostly a non-issue
18:27dnolen_no one is going to port code from Clojure to Clojure-CLR or CLJS that mutates record fields
18:28timsgdnolen_: I’ll have a whack at it. This is probably more an issue for Clojure-Unity, which requires a lot of weirdness that wouldn’t come up otherwise
18:28dnolen_timsg: this my favorite part - poking at compiler really opens the dark corners of language design
18:31bbloom_dnolen_: timsg: i hope you guys aren't in the same room right now
18:31dnolen_bbloom_: lol we are
18:31timsgbbloom_: :-)
18:31bbloom_haha
18:31bbloom_you guys up for some beers later?
18:34timsgbbloom_: I am! dnolen’s otherwise engaged
18:34bbloom_k, i'll msg you
18:34bbloom_other nyc clojure folks welcome to msg me :-)
18:35lpvbis this ideal (.indexOf (vec (seq (Iterable.))) someObject) ?
18:36lpvbgiven that I have an Iterable
18:36lpvbthe (vec (seq looks a bit off
18:37justin_smithlpvb: what about (into [] ...) instead?
18:37lpvbwhat's the difference between that and vec?
18:37gfredericksnot much
18:38gfredericksyou probably don't need seq though
18:38lpvbwell I couldn't do (nth (Iterable.) number) so I think I had to seq
18:39gfredericksbut vec might do that for you
18:39justin_smithvec calls to-array if the argument is not an instance of java.util.Collection
18:39gfrederickshmm
18:39lpvboh okay
18:39justin_smithto-array may do your magic for you
18:40justin_smithoh weird...
18:40justin_smithlooking at the source for vec, it only calls to-array if the arg is not a java.util.Collection
18:41dnolen_
18:41dnolen_oops
18:41justin_smiththen the doc string for to-array says it expects a java.uti.Collection
18:41justin_smithsomething is out of sync here, unless I am out to lunch
18:42Bronsajustin_smith: it's the docstring for to-array
18:42justin_smithBronsa: oh, so the doc is out of date? I am looking for the java code now
18:43Bronsa,(instance? java.util.Collection "foo")
18:43clojurebotfalse
18:43Bronsa,(to-array "foo")
18:43clojurebot#<Object[] [Ljava.lang.Object;@44b0f8>
18:43justin_smithcool, once again Bronsa comes through with the answer
18:43justin_smith(inc Bronsa)
18:43lazybot⇒ 34
18:43justin_smith(inc Bronsa)
18:43justin_smith(missed one)
18:43lazybot⇒ 35
18:45lpvb(inc Bronsa)
18:45lazybot⇒ 36
18:45lpvb(inc justin_smith)
18:45lazybot⇒ 56
18:45justin_smithhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L1559 hrmph, looks like to-array won't turn an iterator into a collection (unless I am reading it wrong)
18:46amalloyjustin_smith: neither will seq, or much of anything
18:46amalloyyou can use iterator-seq, if you're keen to do that
18:47justin_smithlpvb: ^^^ looks like amalloy has your answer
18:48amalloyjustin_smith: it looks like he has an Iterable. why would he convert it to an iterator?
18:48amalloyiterators are seqable as normal
18:48amalloyer, iterables
18:49DomKMSo it looks like Java static fields aren't first-class. https://www.refheap.com/88823
18:49amalloyDomKM: indeed not
18:49DomKMIs there an idiomatic way to pass them around?
18:49amalloyalthough also that's not a field but a method
18:50justin_smithamalloy: d'oh, my confusion
18:50DomKMsorry, I don't know much about java
18:50amalloysure. wrap it in a function, as you've done
18:50DomKMok, thought there might be something like memfn
18:50DomKMthanks
18:54lpvbamalloy: The iterable object actually extends an abstract class that implements iterable and I get 'nth is not supported on this type' without seq
18:54justin_smithlpvb: yeah, that is what he meant by seqable
18:55lpvbso if the derived class implemented iterable directly I wouldn't need seq?
18:56arrdemandyf_: sorry about the churn :P
18:56arrdemandyf_: this is what happens when you give me free time and coffee
18:56justin_smithlpvb: no, it just means seq knows how to turn it into a sequence
18:57andyf_Exciting stuff, no apologies needed.
18:59stuartsierradnolen_: I made a Hudson job to do a *staging* release of G.Closure library. We can try it out next time. http://build.clojure.org/job/google-closure-library/
19:04noobatronYes
19:04noobatroneverything is working now
19:04noobatronMMM
19:04noobatronFUCK
19:04noobatron>:(
19:08justin_smithnoobatron: you OK?
19:22noobatronEpic crash
19:24pandeirogoing crazy with 401s from my own archiva instance when trying to `lein deploy releases` to it; anyone familiar with archiva?
20:32Farethat'll teach me about not running regression tests all the time.
20:33Fareoops, wrong channel
22:59Farehow do I get the name of a keyword? .getName ?
23:00arrdemis there a writeup somewhere on building clojure.core from source? I'm not finding one.
23:01justin_smithFare: name works
23:01justin_smith,(name :hello)
23:01clojurebot"hello"
23:01Farethanks
23:01Fare(inc justin_smith)
23:01lazybot⇒ 57
23:01justin_smithwoo, ketchup
23:02justin_smitharrdem: it has a pom.xml, have you tried "mvn build" ?
23:02arrdemlooks like I forgot to run the ant setup script :P
23:02arrdemant seems to be working now.
23:03justin_smithoh, I thought pom.xml meant maven