#clojure logs

2012-04-30

00:07muhooAOT compilation is good on heroku to reduce spin-up times. however, AOT is not good for cljs, i'm told. should i bother trying?
00:20emezeskemuhoo: AOT compiling the cljs compiler will appear to work, but you will run into subtle problems
00:20emezeskemuhoo: That's (partially) why I wrote lein-cljsbuild, so that I could do all the cljs compilation at dev time
00:23Raynesibdknox: https://github.com/Raynes/lein-gitify
00:30Caomai!reset
00:35technomancyyou can get the AST out of Ruby, it's just not part of the stable API, so it breaks during minor version bumps
00:35technomancyhttp://rubyforge.org/projects/parsetree/
00:37technomancyit sounds like the reasoning is along the lines of "we value the ability to change things easily over the ability to make good tooling?
00:38ibdknoxtechnomancy: interesting
00:39Raynestechnomancy: https://github.com/Raynes/lein-gitify My answer to "plz rite git tmplat
00:39Raynes"
00:39ibdknoxI saw that and didn't realize it was official
00:39Raynestechnomancy: Do you approve?
00:39technomancyRaynes: this makes me think that templates should compose
00:40technomancynot that I have any idea how that would look, but it makes you wonder
00:40RaynesThis makes me have no idea what you're talking about and why you want to make things even more complex than they are.
00:40ibdknoxRaynes: that's neat
00:40ibdknoxI do that a lot
00:40ibdknoxand am annoyed by it
00:40ibdknoxso well done
00:40ibdknoxlol
00:42Raynestechnomancy: I think I get what you're saying, but this isn't a template.
00:42Raynestechnomancy: I thought about it more, and this couldn't really be a template.
00:42RaynesIt is exactly what a Leiningen plugin is for.
00:42RaynesWe could have extended existing templates to add the functionality, but that seems like overkill.
00:43RaynesAnyways, I'm off. We can talk more about this stuff later.
00:43Raynes<3
00:47yoklovHm, anybody know how javascript's `this` ends up working in a multimethod?
00:47ibdknoxalmost guaranteedly not how you'd want it to
00:48ibdknoxyou probably want to pass this in
00:49yoklovi'm trying to use it as an onload callback
00:50yoklovbut… yeah.
00:50yoklovpretty much doesnt work how i'd like
01:21muhoois there a cleaner way to do this kind of destructuring: https://refheap.com/paste/2455 ?
01:22yoklov why not (defn save! [{:keys [email name picture]}])
01:22yoklovor (defn save! [{:keys [email name picture] :as m}])
01:22yoklovbut i'm tired and there might be a difference there i'm not picking up on
01:29Raynesmuhoo: Define 'cleaner'?
01:30Raynesmuhoo: You can do the destructuring in the argument list.
01:30RaynesUsually it's better to do it in a let though, like you have here.
01:30RaynesI don't see anything wrong with this.
01:30yoklovRaynes: why is it usually better to do it in a let?
01:30Raynes&(meta #'println)
01:30lazybot⇒ {:ns #<Namespace clojure.core>, :name println, :arglists ([& more]), :added "1.0", :static true, :doc "Same as print followed by (newline)", :line 3325, :file "clojure/core.clj"}
01:31yoklovarglist metadata?
01:31Raynesyoklov: If you do it in the argument list, the :arglists keys gets that destructuring form. It makes it ugly.
01:31yoklovthat makes sense.
01:31RaynesIt makes API documentation cleaner.
01:31RaynesUnless, of course, you want to document the destructuring. Usually you don't though.
01:32yoklovyeah and it gets ugly after a while if you have a couple things being destructured
01:32yoklovtends to make the arglist huge.
01:33yoklovthanks, i think i'll try to do that.
01:37muhoointeresting, thanks
02:09mebaran151does lein2 no longer make a lib directory for dependencies?
02:13muhoohmm, i like this render thing in noir, but control-r resubmits the form that way
02:15muhoooic, i should only be doing that upon error
02:16raekmebaran151: lein2 does not copy the files anymore. it uses the files from ~/.m2/ directly
02:20jhicknerdoes lein-swank work with leiningen 2?
02:21jhicknergetting a weird error: Incompatible minimum and maximum heap sizes specified
02:25_KY_How do I generate all possible pairs from (1 2 3 4...)?
02:25_KY_Like (1 2) (one 3) (one 4)... (2 3) (2 4)...
02:26_KY_Like (1 2) (1 3) (1 4)... (2 3) (2 4)...
02:26jhickner(let [a '(1 2 3)] (for [x a y a] [x y]))
02:27_KY_I see...=)
02:28jhickner(take 20 (let [a (iterate inc 1)] (for [x a y a] [x y])))
02:28LuminousMonkeyNice
02:29LuminousMonkeyHmm actually, that last one won't work properly?
02:29jhicknerheh, with that actually all you get is pairs of [1 to n] where n approaches infinity :)
02:30emezeske&(= (take 5 (range)) (take 5 (iterate inc 1)))
02:30lazybot⇒ false
02:31emezeske&(for [x (range 1 5) y (range 1 5)] [x y])
02:31lazybot⇒ ([1 1] [1 2] [1 3] [1 4] [2 1] [2 2] [2 3] [2 4] [3 1] [3 2] [3 3] [3 4] [4 1] [4 2] [4 3] [4 4])
02:37_KY_It's funny that I posted this answer a few days ago... and I'm asking for it today
02:39justinlillyhi all. -- anyone have thoughts as to how these two are different? carousel-entry gets called with the same arguments, but doesn't do what its expected in the loop example but works in the for example. Any thoughts? http://pastebin.com/67PAnksL
02:40justinlillyhrm. nevermind. I think the difference is that the value isn't being accumulated properly.
02:43muhooibdknox: would you be open to additions to noir to make form handling more abstract and less bolierplatey?
02:43muhooor do you want to keep it kind of thin?
02:44ibdknoxmuhoo: do you have an example?
02:44muhoonot in clojure, but in other frameworks
02:45muhoolike, maybe pass in a map and get back the add and edit forms
02:45muhoowith save/add buttons already placed and laid out
02:45muhoothe routing created
02:45ibdknoxdefinitely sounds like a companion lib :)
02:45muhooi've just done tons of copy/pasting and it seems very unclojureish to do it that way
02:46muhooi'll see what i can come up with.
02:46ibdknoxin my experience those things can't really be usefully generalized, but I don't always work with "normal" stuff :)
02:47muhooi'm doing very normal stuff. :-)
02:48ibdknoxsounds like a great thing to add to the ecosystem though :)
02:48ibdknoxnobody likes boilerplate lol
02:49muhooyeah, i mean, 100 lines of view code to handle a tiny form with 3 fields seems way too much to me, but, then again, in other languages that'd probably be several hundred lines
02:53justinlillyIs there an easy way to determine if you're on your first iteration in a (for) ?
02:53justinlillyI'm resorting to loop-recur and I'm making a mess of it all :-/
03:01emezeskejustinlilly: What are you trying to do?
03:03justinlillyemezeske: (myfn arg (if (first-iteration?) :first))
03:03justinlillyso on 3 iterations: (myfn arg :first) (myfn arg) (myfn arg)
03:04justinlillyI finally managed to get something working, but it feels awful.
03:05emezeskejustinlilly: Hmm, I think I'd need more context to be able to help
03:05justinlillyhttp://pastebin.com/50uZVxk9
03:06justinlillythis is currently working. I was hoping to have something more akin to the for loop commented out. Any tips would be appreciated.
03:07emezeskejustinlilly: Regarding your first comment, "some" is the right way to do that.
03:07emezeskejustinlilly: regarding the div id, just do [:div {:id ...}, if you need to set it based on what's passed in
03:07justinlillyThis just feels like a lot of work for what seems like (in python) for i, foo in enumerate(bar):...
03:09emezeskeI'm looking at your loop atm
03:09emezeskeI think what you need is map-indexed
03:12justinlillyThanks. I'll play around with it :)
03:14emezeskePaste incoming in a sec
03:15emezeskejustinlilly: Totally untested: http://pastebin.com/0gECfXMz
03:16emezeskejustinlilly: Oops, there's a bug, sec
03:17emezeskejustinlilly: There we go: http://pastebin.com/LZXwxZ44
03:20emezeskehaha I should have tested it: http://pastebin.com/32k0w2qF ^_^
03:20justinlillyyep. :) Totally works.
03:20justinlillynice to know that my "this should be easier" filter is working. Now I just need to learn my way around the stdlib.
03:21justinlillyso & [id] in method args makes id an optional, positional argument?
03:21emezeskeYeah, it's an idiomatic trick to do that. It's value will be nil if not supplied
03:22_KY_Is "clojure-contrib-1.1.0.jar" needed if I did not use it explicitly?
03:22emezeske~contrib
03:22clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
03:22emezeske_KY_: ^
03:22justinlillyIn python, I would probably do this as: defn carousel(cool, id="myCarousel"): .. is there a nifty way to do kwargs?
03:22justinlillys/cool/coll
03:23emezeskejustinlilly: Yeah, I think it's like [a b c & {:keys [id] :or [:id "myCarousel"]}]
03:23emezeskejustinlilly: That might be a bit wrong, though, I don't do that too much
03:24justinlillyyea. doesn't look pretty. This works for me for now. Thanks for your help :)
03:24emezeskeNo problem!
03:25emezeskeI am still a noob myself, so I try to help with the problems I can for practice
03:26mmarczykanybody willing to run some cljs data structure perf tests? links in http://dev.clojure.org/jira/browse/CLJS-190?focusedCommentId=28320#comment-28320
03:33_KY_There are some large jar files in the lein directory that I don't want to upload to the repository... what can I do?
03:35emezeskeCould you be more specific about what the "lein directory" and the "repository" are?
03:38emezeske_KY_: ^
03:38_KY_The project directory created by lein
03:38_KY_And I want to upload the project to google code
03:39_KY_But I don't want to include jars such as clojure-1.3.0.jar
03:39LuminousMonkeyAre you using Git, Mercurial?
03:39emezeskeSo, just set the subversion ignore property?
03:40_KY_Mercurial
03:40LuminousMonkeyCreate .hgignore in the directory.
03:40_KY_So, later if a user checks it out, they can find the jars automatically?
03:40_KY_I already did that... just worrying if the users can't run it
03:41LuminousMonkeylein deps should take care of getting the jars?
03:41emezeskeIIRC you don't want to use lein, right?
03:41LuminousMonkeyOhhh.
03:41_KY_I am using lein by default
03:41LuminousMonkeyGeez, why not use lein? :P
03:41emezeskeOh, then 'lein deps'
03:41LuminousMonkey:)
03:41_KY_Just planning to provide the option of not using it (but that will be later)
03:42_KY_I see... so they'll run "lein deps" first
03:42LuminousMonkeyJust make sure they're ignored by Mercurial and that lein deps pulls them in.
03:42emezeske_KY_: Look at the .gitignore file that "lein new" made for you -- you'll likely want to translate that whole thing to .hgignore (or whatever it is)
03:43LuminousMonkeyA dirty way is to rename .gitignore to .hgignore and add a line "syntax: glob" at the top.
03:43emezeske_KY_: Also, "lein deps" of course assumes that you have set your :dependencies in the project.clj file appropriately
03:43emezeskeLuminousMonkey: nice!
03:43faust45hi guys
03:43_KY_Great...
03:44LuminousMonkeyemezeske: I use Mercurial. :)
03:44faust45can any one suggest how i can make code reloading in runtime. notice (require 'test :reload) i try it but not working
03:46LuminousMonkeyfaust45: I don't know how to do it, trying to look.
03:49LuminousMonkeyCould try adding :verbose to see what is going on?
03:50faust45LuminousMonkey: :verbose ? which place
03:51LuminousMonkey(require 'test :verbose) Should print info about what it's loading in.
03:51LuminousMonkeySo (require 'test :verbose :reload)
03:51faust45not :reload ?
03:51faust45ok
03:51faust45thanks
03:52LuminousMonkeySee what it's trying to load, maybe you need :reload-all instead?
03:52LuminousMonkeyI'm new to Clojure, so I have no idea.
03:54faust45LuminousMonkey: https://friendpaste.com/4OzVMOWaDnAnFhUtemklbd
03:55LuminousMonkeyAnd it's not updating your functions, etc? What are you trying to do exactly?
03:57_KY_"hg add" does not seem to ignore the jar files or any files I told it to ignore in .hgignore
03:57LuminousMonkey_KY_: Could you paste your .hgignore file?
03:58_KY_http://pastebin.com/GbtB5s5A
03:59LuminousMonkeyLine 23-24 should be clojure\lib\*.jar?
04:00LuminousMonkeyHmm, here's mine: http://pastebin.com/qppwYnxQ
04:00_KY_I thought it would apply to all sub dirs?
04:01LuminousMonkeyIt should... I'm wondering if you have to hg add .hgignore I've never noticed if I had to before.
04:02faust45LuminousMonkey: i have loop while which wiring accept socket than process http req, in beginning of while i what make (code reload). but routing handler i define object before loop while so when i change handler behavior nothing changed
04:02_KY_It doesn't seem to have any effect...
04:02LuminousMonkeyAhh, no, it should work without being commited
04:02_KY_But it "added" all the crap...
04:03RaynesOh wow, hg users. Quite a rare breed in these parts.
04:04LuminousMonkeyfaust45: You will have to restart your (Jetty?) for it to pick up the changes as well...
04:05faust45LuminousMonkey: i am not using Jetty. using org.apache.http
04:05LuminousMonkeyfaust45: Still the same thing I think? I might have an example somewhere...
04:05_KY_If I use "hg status" it shows the unwanted files
04:06LuminousMonkeyRaynes: I'm thinking of moving to git. :)
04:06RaynesI highly support this thought.
04:06LuminousMonkeyfaust45: https://gist.github.com/2495345
04:07faust45LuminousMonkey: https://friendpaste.com/4OzVMOWaDnAnFhUtemkkyZ
04:07LuminousMonkeyfaust45: That's the code I use for my webapp using jetty. I've just recently found out about the #' which causes that var to be reread on each access. You might be having a similar issue?
04:08faust45LuminousMonkey: dunno
04:10LuminousMonkeyfaust45: Really out of my area now. On line 53: (.handleRequest #'http-service conn context)
04:11faust45LuminousMonkey: CompilerException java.lang.RuntimeException: Unable to resolve var: http-service in this context, compiling
04:13LuminousMonkeyfaust45: Beyond me I'm sorry, when I was using the Jetty stuff, using :reload, I had to start and stop the jetty process for it to pick up the changes.
04:13faust45LuminousMonkey: #' mean re tead var?
04:13faust45re read
04:14LuminousMonkeyfaust45: Yeah, though, that won't work, I think you need line 48 to be rerun after your require on line 51 as well...
04:15LuminousMonkeyfaust45: Sorry, I really have no idea.
04:15faust45LuminousMonkey: how i can assign var in while loop?
04:17LuminousMonkeyfaust45: Could make it an atom or something?
04:18faust45LuminousMonkey: maybe but its depend on other vars in let block
04:20faust45LuminousMonkey: any case thanks!
04:24LuminousMonkeyRaynes: Makes sense to switch to Git since everyone seems to use Github. :)
04:25LuminousMonkeyfaust45: I'll take any compliment on my useless ramblings, thanks. :)
04:34tutysra_hi room
04:35tutysra_how do i use clojure.math.combinatorics package in my code
04:36tutysra_i am getting an exception - Could not locate clojure/math/combinatorics__init.class or clojure/math/combinatorics.clj on classpath on SLIME repl, I am running clojure1.3 - this is the output from *clojure-version* - {:major 1, :minor 3, :incremental 0, :qualifier nil}
04:41tutysra_i guess clojure.contrib.combinatorics was moved into clojure.math.combinatorics from version 1.3, should i have to include any separate config details in project.clj to use these functions?
04:53tutysra_ok, got the solution from src (pom file) - included 0.2.2 version. thx.
05:16mengu_what one must read in order to understand the fundementals of clojure?
05:17luciantry http://www.clojurebook.com/
05:18mengu_lucian: i'm already reading "programming clojure"
05:19mengu_but then it took me some time to understand that (let [x y]) means x = y in that scope
06:31bensonHello Room
06:55ssedano1Hi, I want to create Properties. Is clojure.java.data the best choice?
06:59ssedano1or I just (def prop (doto (java.util.Properties.) (.putAll {:myKey "n"})))
08:49mduerksenhmm, max-key prefers the latter argument when (k x) and (k y) are equal. is this considered an implementation detail, or can i rely on it?
08:54fdaoudmduerksen: if they are equal, why do you need to care which one it returns?
08:56mduerksenfdaoud: it matters when x and y have the same key-value, but are otherwise different, like here: ##(max-key {:timestamp 1 :value "bla"} {:timestamp 3 :value "blub"})
08:56lazybot⇒ {:timestamp 3, :value "blub"}
08:56mduerksen##(max-key {:timestamp 1 :value "blub"} {:timestamp 3 :value "bla"})
08:56lazybot⇒ {:timestamp 3, :value "bla"}
08:57mduerksenin my case, i want to merge 2 hash-maps, the "old" one and the "new" one. and only when the "new" one has an older timestamp should the old one "win"
08:59mduerksena wait, my example was of course wrong: ##(max-key {:timestamp 1 :value "bla"} {:timestamp 1 :value "blub"})
08:59lazybot⇒ {:timestamp 1, :value "blub"}
08:59mduerksenand ##(max-key {:timestamp 1 :value "blub"} {:timestamp 1 :value "bla"})
08:59lazybot⇒ {:timestamp 1, :value "bla"}
09:01bhenry#(apply merge (if (> (:timestamp %1) (:timestamp %2)) [%1 %2] [%2 %1]))
09:01bhenrymduerksen: hacky, but simple
09:01mduerksenbut my question remains: i can only merge with max-key if i can be certain that max-key will *always* prefer the latter argument. otherwise i'll have to write something like bhenry just wrote
09:03mduerksenbhenry: i know i can write my own dedicated conflict function, but i hoped i could use the more elegant one from clojure.core. i'm inclined to do so, because merge itself has similar semantics (left-to-right), but since the doc for max-key doesn't explicitly say so (as opposed to merge), i'm not sure if its a good idea
09:04fdaoudmduerksen: I think you're right
09:04mduerksenit could break in future versions, except if the function commits itself to its current semantics with its doc
09:06mduerksenbut i would love to write this: (merge-with (partial max-key :timestamp) old-apps new-apps)
09:09bhenryirc://irc.freenode.net:6667/#%23(max-key :timestamp {:timestamp 1 :value "blub"} {:timestamp 1 :value "bla"})
09:38dgrnbrghey clojurians, I just released a branch coverage analyzer for clojure
09:39dgrnbrgit's kind of rough around the edges, so if you give the plugin a shot and find an issue, let me know :) [lein-guzheng "0.2.3"]
09:40mdeboarddgrnbrg: as in test coverage?
09:40dgrnbrgyeah
09:41dgrnbrgIt's a trampoline task, so you can run any other lein task under the instrumentation
09:41dgrnbrgSuppose you want to see the coverage report for ns foo.core
09:41dgrnbrgwhen you run all the unit tests
09:41dgrnbrglein guzheng foo.core -- test
09:41dgrnbrgor maybe you want to see which parts of foo.core don't get executed when you run the program normally:
09:42dgrnbrglein guzheng foo.core -- run
09:42wmealingwill this work for things like midje ?
09:42dgrnbrgafter the -- is any other lein test
09:42dgrnbrgthe idea is that it'll work for anything
09:42wmealingnice
09:42dgrnbrgit hooks eval-in-project to reinstrument the given namespaces before running the task
09:42dgrnbrgand then after they finish, it prints a report
09:42dgrnbrgit's a work in progress, so when you find bugs, let me know
09:43mdeboardneat
09:59jweissi'm a little confused how load-file works. "The loading functions occur in a temporary context, in which *ns* has a fresh binding. That means that, should any form have an effect on that var (e.g. `in-namespace), the effect will unwind at the completion of the load." what exactly does that mean?
10:00jweissa "fresh binding" to *what*?
10:00jweissa gensym'd ns, essentially?
10:01jweissthat just doesn't seem to be true, it seems to load the file into the current namespace.
10:02jweissi guess it means it's just run in a binding form, but with the same value as the current ns?
10:03sattvikjweiss: I think so, i.e. (binding [*ns* *ns*] (file contents))
10:07_KY_How do I specify to "read" from standard input?
10:07_KY_ie, what's the name of the stream for standard input
10:07sattvik_KY_: *in*, thought it can be rebound
10:08_KY_It works in REPL, but in Lein, input is frozen
10:09sattvik_KY_: Ah, yes. I just finished dealing with that issue. Is this within an eval-in-project?
10:09_KY_It's in a test
10:09sattvikThat generally won't work. It should work if you use trampoline, i.e. 'lein trampoline test'.
10:10_KY_What does trampoline do?
10:11sattvikIt makes the task run within Leiningen rather than in a subprocess.
10:11dgrnbrgother way around, sattvik, iirc
10:11dgrnbrgtrampoline runs in a subprocess, normally just runs in a new classloader
10:12_KY_I see...
10:14sattvikStill, you may want to reconsider whether or not you want to have a test that relies on console I/O. For testing something that relies on *in*, you could use something like (with-in-str).
10:16sattvikdgrnbrg: You may be right; I haven't actually looked at the code. For plug-ins, it seems like I/O within in eval-in-project context seems to require sockets if no trampoline is involved.
10:16dgrnbrgthat would make sense, since lein probably is hooking all the streams into the project
10:17dgrnbrgsince every plugin you install can mess with those things
10:39hcumberdaleHi ;)
10:39timvisheris it expected that defrecord performs an order of magnitude worse than a hash-map unless you do the lookup many times?
10:39timvisherhi hcumberdale
10:40timvisherRE defrecord/hash-map: in terms of speed of field lookup
10:40hcumberdaledoes anyone know how amazon s3 bucket & key correspond to the url
10:41timvisheras far as i understood things, field lookup is supposed to be _way_ faster with a record, but i see performance gains of about double when I dotimes 1000000 but they take longer to construct, it seems, and the field lookup is slow in the beginning
10:41hcumberdalehttps://s3.amazonaws.com/&lt;bucket&gt;/&lt;key&gt; << right?
10:41timvisherwhich leads me to believe that even in the case of performance optimization, you would only want to use defrecord in low-write, high read situations
10:42timvisherhcumberdale: are you referring to objectid as key?
10:42hcumberdaleyes
10:43hcumberdaleI'm using the framework https://github.com/weavejester/clj-aws-s3
10:43hcumberdaleI get a map with metadata from the objects
10:43timvisheri think it's actually https://&lt;bucket&gt;.s3-website-us-east-1.amazonaws.com/&lt;objectid&gt;
10:43hcumberdaleand they contain a "key"
10:43hcumberdaletimvisher, seems it depends on where the bucket is?!
10:44timvisherwell, it depends on what end-point you're using
10:44timvisheri think end-point is the right term there
10:44timvisheryou can host the bucket at different server farms
10:44hcumberdaleCode: NoSuchWebsiteConfiguration
10:44hcumberdaleOnly if you configure the bucket as website
10:44timvisherthe default is us-east-1
10:44timvisherah
10:44timvisherthat may be what i'm looking at
10:44timvisher:)
10:44hcumberdalelook at the object properties
10:45hcumberdalehttps://s3.amazonaws.com/mkr_cblog/finished.jpg
10:45hcumberdalehttp:// seems to work too
10:45timvisherit's a shame because i was just reading about this last night but i left that book at home
10:46timvisherthere's a section on this exact topic
10:46hcumberdale!google using http://s3.amazonaws.com
10:47hcumberdalehttp://s3.amazonaws.com/bucket/key << seems to be secure
10:48timvisherlooks interesting: http://onjava.com/pub/a/onjava/2007/11/07/introduction-to-amazon-s3-with-java-and-rest.html?page=last&amp;x-showcontent=text
10:48timvisherseems the bucket name can be used as a sub-domain as well
10:48hcumberdaleI'll write a 305 header router
10:48jsmonkeyHi, I am totally new to clojure and want to learn it. Is there any free ebooks or very good free resources?
10:48hcumberdaleahhh mean 301
10:49timvisherjsmonkey: http://www.4clojure.com/, http://tryclj.com/
10:50timvisheroh, and, http://blog.twonegatives.com/tagged/clojure ;)
10:50jsmonkeytimvisher: thanks! free today and tomrow so thought why not learn something totally different :)
10:51timvisherindeed, and now for something completely different…
10:54nDuffjsmonkey: if you can grok clojure enough to be effective in it in two days, I'll be very jealous. :)
10:55jsmonkeynDuff: since when did I write that I would be effetive in two days :) I have two days off so it is a perfect kickstart to learn a new language.
10:55hcumberdaleyeah, it works
10:56hcumberdalesimply generate thumbnails now and the s3 integration is ready
10:56nDuff*nod* -- I wish you luck. If it's something you take to enough to want to buy dead-tree material, by the way, I strongly recommend The Joy Of Clojure.
11:00mefestomorning everyone
11:01mefestoanyone know how to listen for a window load event using domina?
11:01mefesto(events/listen! js/window :load f) isn't working for me
11:04fdaoudmefesto: (children/listen! father) isn't working for me either
11:04fdaoudj/k :)
11:05mefestofdaoud: is that a recent breakage? :)
11:05fdaoudmefesto: it worked well for about 1.5 years, but hasn't worked much since :)
11:23TimMcfdaoud: Reproduction instructions?
11:23TimMcErr, wait, this is a family channel.
11:26AWizzArdHow can I do: (into (java.util.HashMap.) {"a" 1}) ?
11:27timvisher&(hash-map (java.util.HashMap.))
11:27lazybotjava.lang.IllegalArgumentException: No value supplied for key: {}
11:27timvisher&(hash-map (.put (java.util.HashMap.) "foo" "bar")
11:27lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
11:28timvisher&(let [t (.put (java.util.HashMap.) "foo" "bar")] (hash-map t))
11:28lazybotjava.lang.IllegalArgumentException: No value supplied for key: null
11:28timvisherAWizzArd: not sure. ;)
11:29timvisher&(let [t (java.util.HashMap.) t2 (.put t2 "foo" "bar")] (hash-map t))
11:29lazybotjava.lang.RuntimeException: Unable to resolve symbol: t2 in this context
11:29timvisher&(let [t (java.util.HashMap.) t2 (.put t "foo" "bar")] (hash-map t))
11:29lazybotjava.lang.IllegalArgumentException: No value supplied for key: {foo=bar}
11:32fdaoudTimMc: http://xkcd.com/674/
11:33yoklov,(reduce #(doto %1 (.put %2)) (java.util.HashMap.) {"a" 1})
11:33clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: put for class java.util.HashMap>
11:33yoklov,(reduce #(doto %1 (.put (%2 0) (%2 1)) (java.util.HashMap.) {"a" 1})
11:33clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
11:33yoklov,(reduce #(doto %1 (.put (%2 0) (%2 1))) (java.util.HashMap.) {"a" 1})
11:33clojurebot#<HashMap {a=1}>
11:33yoklov,(reduce #(doto %1 (.put (%2 0) (%2 1))) (java.util.HashMap.) {"a" 1 "b" 2 "c" 3})
11:33clojurebot#<HashMap {b=2, c=3, a=1}>
11:34yoklovthat seems to work
11:34yoklovthough
11:34yoklovcan't you do
11:34yoklov,(java.util.HashMap. {"a" 1})
11:34clojurebot#<HashMap {a=1}>
11:35yoklov,(java.util.HashMap. {"a" 1 "b" 2 "c" 3})
11:35clojurebot#<HashMap {b=2, c=3, a=1}>
11:36TimMcfdaoud: I had https://xkcd.com/583/ in mind, actually, but that works too. :-)
11:37fdaoudTimMc: lol
12:06jtoyis it normal/possible for namespaces to reference each other?
12:07jtoyi have a core namespace I want to load and it calls in other namespaces, some of the namespaces need stuff that is in core
12:08solussdis it possible for clojure-mode in emacs to highlight symbols in libraries I'm using? E.g. defpage in Noir
12:09joegallojtoy: circularity is not allowed, you have to turn it all into a directed acyclic graph
12:10joegallosolussd: yes, let me find a github reference for you
12:13joegallosolussd: http://eschulte.me/emacs-starter-kit/starter-kit-lisp.html look for font-lock-add-keywords, under Clojure.
12:13joegallothat'll get you started
12:13jtoyjoegallo: ok, thanks
12:14jweisssolussd: you meant telling emacs manually which new symbols to highlight, right?
12:14jweissnot just highlighting any symbol from libs
12:17joegalloit's relatively easy to have it highlight (def... ) specially, and treat it as a macro, not matter what ... is. not sure if that's in clojure-mode proper yet, these days.
12:18joegallothat would get you defpage automatically, of course, which is rather nice.
12:20joegallommm, doesn't look like it's in. that's unfortunate.
12:23technomancyjoegallo: it might be in the latest from git?
12:23technomancyI need to get a release out; lots of new stuffs in clojure-mode
12:23nappingcan slime recognize an & body) in the argument list and indent as a macro?
12:23joegallonot sure, i looked for the magic from my dotfiles and didn't find it. of course, that doesn't mean you didn't do it some other way. ;)
12:24nappingIt doesn't seem to work for me, but I
12:24technomancynapping: yes, but then you have code that indents differently whether slime is connected or not, which is kind of gross
12:24technomancynapping: I mean, it can do it in CL, not yet with clojure
12:24nappingthat's about what I heard
12:25hcumberdalehi :)
12:26hcumberdaletechnomancy, you've also written slamhound right?
12:26technomancyhcumberdale: yes, though it's sadly neglected
12:27hcumberdaleI'd some problems with it when things get complicated
12:27technomancyyes, unfortunately it really only works on a subset of ns forms for the time being
12:27hcumberdaleahhh ok!
12:27hcumberdaleIs there another import manager
12:28technomancyno, but slamhound is pretty easy to hack on
12:28technomancyI even wrote a blog post containing a walkthrough of the codebase
12:28hcumberdaleand is it possible to shrink the librarys to the functionality really needed?
12:28technomancyhttp://technomancy.us/148
12:30hcumberdalethx
12:30jayunit100how come (filter #(> 500 %) (range 0 1000)) doesnt run when I simply call (use 'simplefunc ) from the repl
12:31jayunit100(but in contrast, (print "okay this is working") does .... )
12:31TimMcjayunit100: How do you know it doesn't?
12:32RaynesTimMc: It just *feels* like it isn't running.
12:33joegalloYou guys are a riot. :)
12:33jayunit100:)
12:33jayunit100I see what you mean tim
12:33jayunit100the input is just being lost.
12:33jayunit100forest tree thingy
12:35jayunit100im so used to the repl barfing everything out for me.... i forgot that its different when its in a file.
12:36solussdjoegallo: thanks
12:43dnolenlynaghk`:
12:43dnolenping
12:46technomancydgrnbrg: hey, did you consider having the guzheng task argument first?
12:47technomancydgrnbrg: that may feel more natural since the other args can be of unknown lengths, plus then it looks a bit more like a lein test invocation: lein guzheng test my.ns.test my.other.test
12:47technomancyjust a thought
12:47technomancylooking forward to trying this out =)
12:48technomancythough I guess the similarity to the test task may be misleading; it would look like the ns args are getting passed to the test task, which isn't the case
12:48technomancyso maybe that doesn't make sense
12:49technomancydgrnbrg: you should take a look at the leinjacker lib though; it has compatibility functions to work across lein1 and lein2
13:01hcumberdaleIs there a thing like "pipe" in clojure
13:01hcumberdaleFor Output to Input Streams?
13:02hcumberdaleI know the PipedInputStream / PipedOutputStream things,... but there must be an easy way?
13:02joegallolike what?
13:02hcumberdale??
13:02lazybothcumberdale: Definitely not.
13:03joegallomaybe describe more of the problem first (also, how much data are you talking about?)
13:03hcumberdaleThumbnails ;) I generate them with http://code.google.com/p/thumbnailator/
13:03hcumberdaleIt writes to an Output Stream
13:03technomancyleiningen has a `pump` function to take from an input stream to an output stream
13:04hcumberdaleamazon s3 API needs an InputStream
13:04joegallothat sounds a lot like clojure.java.io/copy, technomancy, yes?
13:04joegallohcumberdale, you can ByteArrayOutputStream to a byte array to a ByteArrayInputStream if you don't mind holding the whole object in memory
13:05technomancyyeah, I'm trying to remember why we didn't use copy
13:05joegalloyou didn't want things to be automatically closed or something?
13:05hcumberdaleIf possible, yes!
13:05hcumberdaleBut copy does IN=>OUT
13:05nappingPipedInputStream doesn't look bad if you really want a pipe pair
13:06hcumberdaleI need OUT=>IN
13:06technomancy(let [#^"[C" buffer ; uuuugh gross
13:06hcumberdalehttp://stackoverflow.com/questions/1225909/most-efficient-way-to-create-inputstream-from-outputstream
13:07technomancyah, c.j.io/copy doesn't flush
13:07hcumberdaleThere is a clojure example with pipes
13:07hcumberdalebut it has no auto-close, flush,... thigns
13:08nappingwhat will be writing into the output stream?
13:10hcumberdale(t/of url) (.size 150 150) (.outputFormat "jpg") (.toOutputStream out-stream) )
13:10hcumberdalemissed out beginning (->
13:13nappingwhat is t/of?
13:13hcumberdalehttp://code.google.com/p/thumbnailator/wiki/Examples
13:14nappingIf you want it in memory, asBufferedImage looks convenient
13:14hcumberdalemaybe it does the stream handling already?
13:15FrozenlockIf I make a standalone jar with java7 on my machine, will it work with java6?
13:22hcumberdaledamn, the include does not work
13:22TimMchcumberdale: Are you shelling out?
13:22hcumberdale[net.coobird/thumbnailator "0.4.1"]
13:22hcumberdale$ ls lib/ | grep thum
13:22hcumberdalethumbnailator-0.4.1.jar
13:23TimMcNever mind, completely misread.
13:23hcumberdaleFileNotFoundException: Could not locate net/coobird/thumbnailator/Thumbnails__init.class ...
13:23nappingwhere are you sending the data once you have it?
13:23hcumberdalenapping amazon s3
13:24nappingand you can't set up an output stream that goes directly there?
13:24hcumberdaleno, s3 api uses inputstream
13:25nappingI've never programmed against S3
13:25hcumberdalewhy does my require not work?
13:27hcumberdaleIt is in my classpath!
13:32FrozenlockI'm trying lein-bin (from https://github.com/Raynes/lein-bin). Any idea what should be the file extension for windows?
13:40hcumberdaleI can't call a static method of an imported java class
13:41hcumberdale#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: of>
13:41hcumberdaledamn!
13:44hcumberdale(. net.coobird.thumbnailator.Thumbnails (of (as-url "http://s3.amazonaws.com/mkr_cblog/finished.jpg&quot;)))
13:44hcumberdale#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: of>
13:44hcumberdaleboth with / and . ...
13:50antares_hcumberdale: is it a static method? are you sure you are passing all the necessary arguments?
13:52hcumberdaleyes antares_
13:52antares_hcumberdale: is it a static method?
13:52hcumberdaleyes
13:52hcumberdale(. net.coobird.thumbnailator.Thumbnails (of (new java.net.URL "http://s3.amazonaws.com/mkr_cblog/finished.jpg&quot;)))
13:52hcumberdalethe method "of"
13:53hcumberdalepublic static Builder<URL> of(URL... urls)
13:53hcumberdalemaybe the dynamic parameter list is the problem?
13:56antares_hcumberdale: yes
13:56hcumberdaleyes, that was the problem
13:56hcumberdaleand now,...
13:56hcumberdale#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment>
13:57antares_hcumberdale: it should be (net.coobird.thumbnailor.Thumbnails/of (into-array java.net.URL [(URL. "http://s3.amazonaws.com/mkr_cblog/finished.jpg&quot;)])
13:57hcumberdalethx very much
13:57antares_hcumberdale: that library may need Sun/Oracle JDK or something
13:59xeqihcumberdale: what
13:59xeqiwhat os are you usgin?
14:01hcumberdaletechnomancy , can I set java.awt.headless=true with lein ?
14:01muhoothanks for this: http://technomancy.us/148 great explanation. also "asplode", lol.
14:02antares_hcumberdale: you can, :jvm-opts ["-Djava.awt.headless=true"]
14:04hcumberdale$ cat Procfile
14:04hcumberdaleweb: lein trampoline run -m cblog.core
14:04hcumberdalehow to set it here?
14:05technomancyhcumberdale: you can export JVM_OPTS
14:06hcumberdaleon heroku? with the procfile?
14:06technomancyif you want it always present, you should use :jvm-opts
14:08nDuffIs there a way to tell whether a class is public? I have 3rd-party library returning an instance of a private class with public members, but am only allowed to call those methods defined by public interfaces, so introspecting with (bean x) is failing; I'm trying to figure out what needs to be changed to detect that situation.
14:08technomancymuhoo: I had a lot of fun with that code =)
14:24jonasendnolen: sorry for the mess...
14:24ibdknoxjonasen: eh, it's not a mess, it's something that should be thought through
14:24lynaghkdnolen: pong.
14:25dnolenjonasen: haha, no mess. AST as data was just not something I'd thought about much - clearly that's what Rich wants.
14:25dnolenlynaghk: just pinged you to say I'm following your cljs-profile stuff, good to see real world issues you're encountered. Would be nice to see a real summary from you at some point.
14:26lynaghkdnolen: definitely. Performance is something I'd like to sit down and think about
14:26jonasendnolen: I agree. I'm interested in getting the contents of :children corrected. If Rich want it attached to the ast that's fine by me
14:26lynaghkdnolen: I want to tidy up the C2 API this week and get an official 0.1.0 release out, then I'm going to go back and check out perf stuff.
14:27dnolenlynaghk: excellent that would be very, very helpful.
14:27ibdknoxdnolen: I don't feel super strongly one way or the other, but right now I just see something that's unwieldy and confusing
14:27ibdknoxdnolen: that no other AST I've ever seen has, which is only a half argument
14:28dnolenibdknox: I don't feel strongly about it either - it's also hard to tell what the actual goal was considering the gaps that jonasen uncovered
14:28ibdknoxdnolen: I agree, that's why I'm hoping rich comes in and explains why he cares about it
14:29lynaghkdnolen: we're working on a map visualization right now, but I'm worried we might have to drop to D3 for parts of it since D3 is still a few orders of magnitude faster in some cases.
14:29jonasendnolen: ibdknox: I can put together a patch which moves back to :children, but with the problems fixed.
14:30dnolenlynaghk: "few order of magnitude faster" is not something I want to hear :) If we're not within one order of magnitude that's a problem.
14:30dnolenjonasen: just make a new patch the :children re-added, multimethods removed.
14:31jonasendnolen: without the bugfixes?
14:31dnolenjonasen: bugfixes are good, Rich didn't mention those at all :)
14:31lynaghkdnolen: one of the constraining issues for C2 is that I want to keep the code idiomatic Clojure, and I just don't know a ton about optimizing JVM Clojure performance idiomatically (e.g. using arrays instead of seqs)
14:33jtoyso re-gsub is not part of the core?
14:33dnolenlynaghk: in bottlenecks - arrays, loop/recur are big wins. I haven't looked at C2 closely so I can't say much at this point.
14:33lynaghkdnolen: actually, loop/recur is slower than doseq
14:33lynaghkhttps://github.com/lynaghk/profile-cljs/blob/master/src/cljs/seq_test/test.cljs
14:34dnolenlynaghk: I doubt that but I can't say what's going on w/o seeing the generated code.
14:34lynaghkThe "iter" library macro-expands doseq-like-loops into loop/recurs, and (on chrome) it's slower.
14:37dnolenlynaghk: loop/recur compiles to a while(true) loop w/ break - you're not going to get faster than that.
14:37lynaghkdnolen: I'll have to look into the generated code then. I'd love some faster loops = )
14:38dnolenlynaghk: and all your profiling is done w/ advanced opts right?
14:38lynaghkdnolen: though I don't think looping is the slow part of C2's core functionality. It might be DOM stuff (D3 uses the native APIs, while C2 goes through layers of indirection.
14:39dnolenlynaghk: I noticed you mentioned string concatenation - that's crazy slow.
14:39dnolenlynaghk: I added an optimization yesterday for non-higher order call to str
14:39lynaghkdnolen: no. We've been forced to stay at :simple on some projects so that's what I've been doing. I'll try to find some time to turn that hodgepode repo into a more organized suite that automatically runs the different levels.
14:40dnolenlynaghk: yeah under :simple optimizations you're going to get punished a bit. no lambda lifting.
14:40dnolenlynaghk: why are you forced to use :simple?
14:40lynaghkdnolen: yeah, I saw that and used it this morning. I got a big performance boost from just redefining join to use the native JS array join, so it bypasses ClojureScript's str.
14:40solussdI'm trying to write a 'snippet' using enliven that selects the first anchor element in a <ul> with an id of "files". I'm using the selector [:ul#files :> :a] and a selector within my snippet of [:a]. I never get a match. any ideas? code here: https://gist.github.com/f12e699eefb950a43536
14:40FrozenlockIf anyone is interested, I've found an app to make an exe from a jar. (You still need to have java on your machine, but at least it's easier for the common windows user!) ---> http://launch4j.sourceforge.net/
14:41lynaghkdnolen: right now we are using cljs-chosen on a few projects and haven't had the time to make sure it works correctly under advanced optimzations
14:42yoklovhm, I think there might be a bug in cljs transients
14:42dnolenlynaghk: I see, and you can't just provide an exports file for that?
14:42dnolenyoklov: quite possible, new stuff.
14:42lynaghkdnolen: I bet we can, we just need to find half an hour somewhere = )
14:42dnolenlynaghk: heh, gotcha :)
14:42yoklovthe definition of frequencies from clojure uses them, and breaks in cljs
14:43dnolenyoklov: hm, yeah file a bug
14:43yoklovokay, i'll find a small broken case
14:44dnolenlynaghk: advanced opts makes a huge difference especially on browsers that aren't Chrome. IME most browsers make you pay for deep property access.
14:45yoklovlynaghk: yeah, you can tell a huge difference between no opts and advanced in firefox
14:45yoklovyou can *often
14:47lynaghkdnolen: I just tried checking the timeline on a redraw for the map. A single redraw triggers something like two dozen GC events (15 MB collected each time)
14:47yonkeltroni heard about some awesome interactive tutorials for clojure for learning the stdlib and such but can't dig them up now that i want to do them. could someone help me find them? also, i'd love to know where to look in the future so i can help myself.
14:47technomancyyonkeltron: probably 4clojure?
14:48yonkeltronperhaps...
14:48dnolenlynaghk: are you using master or 1011?, also w/o looking at your code I don't know what's involved in a redraw :)
14:48technomancyyonkeltron: or tryclj.com
14:48lynaghkdnolen: by redraw I mean "unify!" here: https://github.com/lynaghk/c2/blob/master/src/cljs/c2/core.cljs
14:49lynaghkdnolen: I'm using whatever comes with lein-cljsbuild 0.1.8.
14:49yonkeltrontechnomancy: ah. thanks, then.
14:50technomancyyonkeltron: also you mentioned earlier being interested in more background re: clojure vs cl; if you are in the mood to read a paper or two I recommend Out of the Tarpit and Equal Rights for Functional Objects to get a good grasp on the benefits of the functional approach
14:50yonkeltrontechnomancy: perhaps i shall do this. thank you.
14:52dnolenlynaghk: what fns rise up when you actually profile?
14:53lynaghkdnolen: bottom up profile gives 56% program, then 35ish percent for applyTo, seq, do_dispatch
14:54dnolenlynaghk: I think apply may be very, very, very slow it's been something I've been looking into lately.
14:54lynaghkdnolen: I'm not sure how I'm supposed to actually glean useful info from that stuff---I've been kicking around the idea to just make a "profiler" that wraps every form in "time", aggregates the results, and then colors your source code accordingly.
14:55lynaghkdnolen: function application is one of my favorites, definitely make that faster if possible = )
14:56dnolenlynaghk: yes apply and rest fns are what I'm looking at.
14:59mega_ibdknox: You online?
14:59ibdknoxmega_: yeah
14:59lynaghkdnolen: okay, rad. I've got to run, but I'll keep you posted on the cljs-profile stuff. Any idea when a new official cljs release will be coming out?
15:00mega_ibdknox: in crate theres a as-content function. would you min if i made a pull request of the code where that is a multimethod instead?
15:01ibdknoxmega_: sounds like a reasonable thing to do :)
15:01mega_ibdknox: whanted to use it for a project :P
15:02dnolenlynaghk: I think soon as we re-precate ObjMap and close a couple outstanding bugs.
15:02dnolenlynaghk: so hopefully this week?
15:04lynaghkdnolen: okay, sweet.
15:05yonkeltronassume i wanted to buy a clojure book. do i want CP (o'reilly) or PC (pragprog)?
15:05lynaghkdnolen: thanks for all your work on this stuff. even if some parts of the runtime are slow, cljs is still hella faster for development =)
15:05dnolenlynaghk: good to hear :)
15:05anieroyonkeltron: you want CP
15:06yonkeltronaniero: sounds good. i figured as much but what makes you say that?
15:06anieroit's more up to date, and seems better organized. more thorough introduction to the ecosystem too
15:06yonkeltrondoes it cover lein?
15:06anieroyep!
15:06yonkeltroni sort of want some input about best practices for code org and workflow
15:06aniero"joy" is equally good, although it's older (e.g. no lein, that i remember)
15:06yonkeltronobviously differs from CL
15:10muhooibdknox: so i think what i want to do with forms is make them like ring or hiccup: i want to make HTML/HTTP CRUD forms composable
15:10ibdknoxinteresting
15:11muhooabstract away all the POST/GET machinery
15:12muhoogive it a map, including the field names, types, what kind of form it is (edit/add), the validation functions, pass in functions for it to use to read/write the db, and have it spit out defpage's, basically.
15:15muhooa tually, no, have it spit out defpages for the edit page, the add page, and the POST to receive both of those, so 3 defpages
15:16muhooneeds a lot more hammock time still :-)
15:31emezeskeibdknox: Hey, did you see my jayq pull request? I basically grepped my app for "(." and added all the raw jquery calls it made. I figured if everyone did that, jayq would get fleshed out pretty quickly :)
15:32ibdknoxemezeske: I think I merged it in already, didn't I? :)
15:32clojurebotexcusez-moi
15:32emezeskeibdknox: Oh? I thought github would tell me about that. Awesome, thanks!
15:33emezeskeibdknox: Also, if I get around to it, would you accept a test suite (probably written against phantomjs)?
15:33ibdknoxemezeske: that would be aweosme
15:34emezeskeibdknox: Okay, cool! No idea when I'll have the time/motivation, but I really want to do that
15:35emezeskeibdknox: If/when I get around to it, I'll probably add tests for crate as well.
15:35ibdknoxsweet :)
15:40yonkeltronany os-level work done with clojure?
15:41AimHereClojure's generally been targeting virtual machines and javascript so far, so no
15:42AimHereMaybe someone's emulated an OS or something in Clojure
15:42yoklovyonkeltron: the GC makes that sort of thing harder, especially given it's startup time and whatnot
15:42yonkeltronAimHere: i fancy the idea of an os written in lisp and i know that a CL project was in effect
15:42yonkeltronsadly, i think it died: http://common-lisp.net/project/movitz/
15:43yoklovi'd suspect it would be hard to get fast enough
15:43AimHereThere was always ye olde Lispe Machines
15:44AimHereCommon Lisp is reasonably fast, I'm led to believe
15:44yonkeltronyes
15:44AimHereSomething of the order of 1/2 to 1/4 the speed of C according to those TIOBE benchmarks
15:45yonkeltronsbcl was able to run some of my simulations in school with sufficient speed a few years ago
15:45yonkeltroni have never had speed issues with sbcl, actually.
15:45yonkeltronand things go even faster if you use declare
15:46TimMcyonkeltron: Have you looked at Rust?
15:46yonkeltronTimMc: i have not.
15:46yonkeltronTimMc: still having some anxiety about clojure and as yet new to the world
15:47halgarithe other issue with a native clojure is that you either loose eval, or you have to develop your clojure compiler in such a way that it can compile code on-the-fly, and that's no easy task
15:47yoklovI'd imagine that the GC would cause you to have trouble supprting real time user applications, as you wouldn't really know when the GC would trigger
15:47yonkeltronAimHere: i had a reasonably-fast machine running a 2m scenario simulation and it did it safely in around 20 min
15:48yonkeltronhalgari: not entirely true! consider the guestvm research done at sun
15:48yonkeltronyoklov: assuming stop-the-world, yes.
15:48yoklovthats sort of what i mean by speed. you don't have the same control as with C
15:48yonkeltronclojure does not do its own gc, right?
15:48yoklovit relies on java
15:48yonkeltronit lets the jvm do the needful, correct?
15:48halgaricorrect, it uses the platform's gc
15:49AimHerehalgari, native lisps manage to compile on the fly; Is there some reason why compiling to native code is necessarily harder than compiling to all those virtual machine bytecodes that everything runs on these days?
15:50yonkeltronAimHere: i think that depends
15:50halgariOh yes, there's a major difference between the two.
15:51yonkeltronhalgari: go on
15:51AimHereThat Doug Hoyte book points out that Clisp outperforms C at regexing precisely because it compiles on the fly; though I wouldn't call you a liar if you said that book told people that Common Lisp cured his AIDS
15:52halgariOn the JVM, CLR, Python-vm the lowest common denominator is an object. So you can have bytecode that says: "PUSH 1; LOAD_METHOD toString; CALL_FUNCTION"
15:52yonkeltronAimHere: you mean it doesn't cure aids?
15:53hiredmanhalgari: that is just not true, the jvm has primitive non-objects
15:53halgariso the Vtables are actually handled by the VM. on a native implementation you have to first define what a vtable is, then figure out how to call it in an efficient way
15:53yonkeltronTimMc: oh the rust language stuf?
15:53halgarihiredman: well yes...you are correct..I oversimplified
15:54hiredmanarrays are also technically not objects on the jvm (even though the java language makes them look like objects)
15:54halgarilet me correct myself....objects are first-class items in CLR/Java
15:56halgariback to what I was originally saying, things like "is instance of" and "is subclass of" are way harder in a native runtime than they are in a VM. In the native world, you just don't have much metadata at all...
15:56yonkeltronTimMc: i have now read up a little bit on the rust stuff. why did you ask about it?
15:56yonkeltronhalgari: in light of what you've said, may i ask about type erasure on the jvm?
15:58halgaritype erasure is more a side-effect of the way generics are handled in the JVM. that sort of thing actaully doesn't extist in the CLR.
15:59yonkeltronhalgari: which, iiuc, was why java lacked reified types (which continues, i think...)
16:00halgaricorrect
16:00halgaribasically generics in Java are just syntactic sugar to keep you from doing something you didn't mean to
16:00yonkeltroni once heard odersky talk about the first version of generics and how he implemented it
16:01yonkeltronquite an enjoyable story involving late nights, coffee and an angry spouse
16:02halgariBut back to native code compile, I don't think CL even supports eval in a compiled context. I've never run CL, but I rememer some doc stating that you lost a few features when compiling to native code, and eval was one of them.
16:03yonkeltrondoes anyone have familiarity with MS's singularity OS project?
16:03yonkeltronafaict, it was a project to boot directly into a CLR vm and then hoist everything up on top of it from there
16:04yonkeltronso you'd have the whole OS running on top of the vm
16:04yonkeltronwith JIT stuff, etc.
16:04scottj_ibdknox: have you found any libraries you plan to use for bundling a self-contained webkit app for the big 3 OSes? if you build one for Light Table that would make a really nice by-product.
16:04hiredmanscottj_: javafx
16:04ibdknoxscottj_: nothing yet. I built a very simple mac one for me to mess around with
16:06scottj_hiredman: Doesn't whatever webview feature javafx has require the user to already have a webkit browser installed?
16:07hiredmanscottj_: I dunno, I haven't seen such a requirement mentioned anywere
16:07ibdknoxSWT definitely does
16:07ibdknoxdunno about javafx
16:10TimMcyonkeltron: I mentioned Rust because I think it's the best shot right now at having a reasonable language to write kernels in.
16:11yonkeltronTimMc: i see. what about it, in particular?
16:11Raynesinb4 technomancy is all like "wtf no repl"
16:11yonkeltrontechnomancy: dude, i think i owe you a beer from like a year ago
16:12RaynesEverybody owes him a beer.
16:12yonkeltrontechnomancy: sorry, meant for that in #emacs
16:12RaynesGet in line, friend.
16:12yonkeltronRaynes: fair enough
16:12ibdknoxI just sent an email to Tim O'Reilly :)
16:13Raynesibdknox: You need to get Bill Gates to tweet it dude.
16:13ibdknoxMy bet is he doesn't read it... but we'll see :)
16:13RaynesOtherwise you're doomed.
16:13ibdknoxhaha
16:13ibdknoxRaynes: Hi Bill, I left your company to do this thing...
16:13RaynesBahaha
16:14Raynes"Hi Bill, wanted to see if you'd like to help support competition."
16:14RaynesThough I guess light table isn't competition, since C# sucks too hard for light table to be viable for it.
16:14TimMcyonkeltron: I actually have forgotten most of the specifics, but Dave Herman (at Mozilla) gave a pretty convincing talk on it. The optional GC stuff was pretty great.
16:14ibdknoxactually
16:14ibdknoxbuilding light table for C# would be relatively straightforward
16:15Rayneswut
16:15ibdknox:)
16:15RaynesSo Ruby is a problem, but C#...
16:15RaynesMind blown.
16:15ibdknoxRaynes: microsoft invests a lot in tools. The new language stuff called "Roselyn" is far above and beyond what exists for virtually any other language
16:15ibdknoxClojure doesn't need it because it's so much simpler
16:17TimMcibdknox: "Microsoft invests a lot in tools." <-- I'm going to quote you out of context on that.
16:17ibdknoxlol
16:17yonkeltronTimMc: awesome, thanks. i appreciate languages with non-thread concurrency options as i have always found threads a bit...um...let's say clumsy.
16:18TimMcRust is still *really* young, though. :-(
16:18TimMcCan't be soon enough.
16:18yonkeltronTimMc: yeah and also mozilla
16:18yonkeltronTimMc: i mean, it worries me because mozilla
16:18ibdknoxspeaking of mozilla
16:18halgariyonkeltron: someday I'd like to look at doing what MacRuby did. They somehow compile Ruby down to the ObejctiveC runtime...
16:18RaynesTimMc: I was going to use Rust for something until I realized there wasn't an http client yet.
16:18ibdknoxEich retweeted one of the light table things the other day
16:18RaynesPretty hardcore that a language can be so new it doesn't have one of those.
16:19yonkeltronhalgari: some day. i happen to adore ruby.
16:19yonkeltronibdknox: whoa! dude, huge news for you
16:19ibdknoxRaynes: lol not sure you get much earlier than that
16:19TimMcRaynes: Last time I looked, they didn't have any code samples -- because they hadn't decided on syntax yet.
16:19RaynesTimMc: They've got a solid release now though.
16:19yonkeltronRaynes: yeah even dart has useful shit
16:19RaynesBut syntax could, of course, change.
16:19RaynesIt's a 0.1 release IIRC.
16:19yonkeltronRaynes: plus if you study up on dart, you get schooled by gilad bracha
16:20RaynesDart is the least interesting thing I've seen in recent months.
16:20yonkeltronas a language?
16:20yonkeltroni think it has very interesting aspects, actually
16:20yonkeltroni think gilad's work on optional typing has gotten me thinking
16:20yonkeltroni appreciate some of the vm considerations like the images and language-only vm decision
16:20RaynesWell, it's mostly that I don't do much (any) Javascript, so I have problems with my care cup regarding replacements.
16:20yonkeltronalso the isolate concept
16:21technomancywriting an OS on a platform that used UTF-16 as its internal string encoding would be a memory hog
16:21mmarczykdnolen: hi
16:22mmarczykdnolen: just fixed the transient bug yoklov reported a little earlier -- CLJS-219
16:22TimMctechnomancy: We shouldn't have to know what the internal encoding is!
16:22yonkeltronRaynes: linguistically, yeah vanilla braces and shit all over dart. however, the adjacent language concepts have held my attention if not my direct interest. i don't know if that distinction makes sense...
16:22mmarczykdnolen: also CLJS-220 replaces frequencies with Clojure's implementation with transients (which now appears to work fine)
16:22yonkeltronok i must step out for a bit
16:22technomancyTimMc: yeah, it would be interesting to hack hotspot to change it and find out how spectacular the failures are on various large-ish projects =)
16:22TimMctechnomancy: I don't see why Java can't have ASCII strings, UTF-16 strings, UTF-8 strings... under the covers.
16:23technomancyTimMc: "good" code would continue to work everywhere, but I can bet you it wouldn't work out in practice =)
16:23TimMcWell, sure. Oracle refused to change j.l.String hashing because that would somehow break some things.
16:23TimMcStill boggles my mind a little.
16:23technomancyOTOH dalvik uses UTF-8
16:24mmarczykdnolen: need to dash now, but I'll be back & working on the ObjMap ticket soon
16:24technomancyso who knows
16:24TimMcOh, ouch -- switch statements.
16:24halgaritechnomancy: well dalvik isn't really java....or is it...I guess we'll find out in a few weeks when the judges tell us the truth
16:25technomancyhalgari: yeah, but it's able to run a surprising amount of code written in the Java Programming Language™
16:29muhoodalvic is java, but it's not the jvm, IIRC
16:29muhooer dalvik
16:30ibdknoxdnolen: his argument is that let's say he has the ast, and makes some transformations. He then wants to run another tool over it that uses children. He now has to duplicate his changes to the children nodes otherwise all of his transformations will not be taken into account
16:32mmarczykoh btw, transient vector perf test if anybody wants to run it: http://jsperf.com/cljs-transient-vector
16:43danielhow would this Long be represented in clojure? 0x101010101017eL
16:47AimHere,0x101010101017e
16:47clojurebot282578800148862
16:47mebaran151I'm having trouble running trampoline tasks in lein2 on windows. Any reason why it never finds the task?
16:47dnolenibdknox: heya, no I get that. I think we were talking past each other. I don't see any problems with :children + :children-keys
16:48dnolenmmarczyk: cool!
16:48dnolenmmarczyk: wow, nice nearly 3x faster on Chrome
16:48mebaran151dalvik is Java the same way that Visual C++ and G++ and both C++
16:49jonasendnolen: I don't think something like :children-keys will be useful
16:49danieli see, thanks AimHere
16:49dnolenjonasen: that was his idea not mine, but why not?
16:50jonasendnolen: for most expressions there are no keys for the children
16:50jonasenthey must be computed
16:51jonasenand then you're back to :children
16:51technomancymebaran151: lein1 or lein2? batch file or shell script?
16:51technomancy
16:51mebaran151lein2 batch file
16:52dnolenjonasen: as in keys can't be added?
16:52technomancymebaran151: to debug change 'del "%TRAMPOLINE_FILE%"' in lein.bat to print out the contents of the trampoline file instead and see if the command makes sense
16:52ibdknoxjonasen: dnolen: thinking more about the transformation then reading thing, we absolutely cannot duplicate that data
16:52technomancymebaran151: actually what's the specific error?
16:53mebaran151lein2 trampoline repl => trampoline repl is not a task
16:53technomancyoh strange, so it's treating "trampoline repl" as a single argument?
16:53mebaran151looks like it now that you put it that way
16:53technomancysounds like a problem with the way the batch file is parsing arguments then
16:53dnolenjonasen: what mean is why can't we add more keys?
16:54mebaran151if I have some free time, I mighttry to create a powershell port of teh batch file; should be easier to maintain than the .bat monster
16:54dnolenibdknox: people who want to transform can ignore :children, and just work via :children-keys no?
16:54ibdknoxdnolen: the issue is downstream
16:55jonasendnolen: sure we can. But I don't think it would be useful. For example, what keys would you add to :children-keys for e.g., :let
16:55dnolenibdknox: ?
16:55ibdknoxdnolen: if I transform it can no longer be reliably consumed later
16:55technomancymebaran151: someone has ported it already; search the mailing list
16:55mebaran151oh, neato
16:55ibdknoxdnolen: unless I duplicate all my changes to the child nodes
16:55ibdknoxdnolen: rather, :children nodes
16:55technomancymebaran151: at the time it was determined powershell didn't have the installed user base to replace the batch file, but maybe that's changed?
16:55technomancymebaran151: this was nearly two years ago
16:56ibdknoxdnolen: example. I have a transformer that changes all the invokes of foo to foo2
16:56technomancymebaran151: it would also allow the windows side to avoid the ridiculousness of having to manually do a self-install
16:56dnolenjonasen: :let, :children-keys are :bes and :body
16:56ibdknoxdnolen: I now have to propagate that change to all parents of those nodes that happen to have me as a child, because that invoke node is duplicated
16:57ibdknoxdnolen: otherwise a tool that *just* looks at children would be working on invalid information
16:58jonasendnolen: :bindings is not an expression object (there is no {:op :binding ...})
16:58ibdknoxdnolen: so if we really want to treat the AST as data, we cannot duplicate that information unless we mandate all transformations must modify the nodes in :children too, which is a disaster waiting to happen
16:58dnolenibdknox: are you talking about interop between tools that use :children and those that don't?
16:58ibdknoxdnolen: yes
16:58ibdknoxdnolen: there needs to be one way here
16:58dnolenibdknox: not sure about that
16:58ibdknox?
16:59mebaran151powershell I think is standard on Windows 7
16:59dnolenibdknox: you do your transformations and when you want it to be consumed by other tools you construct :children.
16:59ibdknox:(
16:59dnolenjonasen: I don't see the problem, we can add new keys to work around this right?
16:59technomancymebaran151: yeah, the question is how long do we need to support XP users
16:59ibdknoxdnolen: so basically we're saying composition is not something we support by default...
17:00ibdknoxdnolen: that's against Clojure's own principle
17:00dnolenone second.
17:00technomancymebaran151: though honestly they are going to have to do a manual download (either curl or the standalone jar) to make it work anyway, so maybe they might as well download powershell? I don't know.
17:01mebaran151you wouldn't need curl from powershell I don't think (it comes with a builtin webclient)
17:01technomancyyeah, I meant that it would replace the need to download curl
17:01mebaran151the only thing is that setting up powershell scripts to run can be a bit tedious (the permissions etc)
17:02@rhickeynew toys pushed
17:02@rhickeyhttps://github.com/clojure/clojure/commit/96e8596cfdd29a2bb245d958683ee5fc1353b87a
17:02@rhickeyit's the start of a reduce-based library
17:02@rhickeymap/filter etc as reduction combinators
17:03@rhickeywhen combined with the internal reduce support recently solidified, yields allocation-free pipelines
17:03dnolenrhickey: wow
17:04@rhickeyan be much faster
17:04@rhickeycan
17:04@rhickeythan seqs
17:04dnolenrhickey: btw, care to share some brief thoughts on the :children issue?
17:04pjstadigrhickey: is the comment header correct on Reduced.java? doesn't mention EPL
17:04@rhickeycrap
17:05TimMcheh
17:07@rhickeyok, better now with the key file :)
17:07@rhickeyhttps://github.com/clojure/clojure/commit/4a22e3a44df48ea0d37dd034bc3f6cb3092117a9
17:07jamiiuser=> (defrecord Bar [y] Foo (foo [_] (->Bar nil)))
17:07@rhickeyso, you just require c.c.reduce :as r, then you can swap r/map etc
17:07jamiiuser.Bar
17:08jamiiuser=> (deftype Baz [y] Foo (foo [_] (->Baz nil)))
17:08jamiiCompilerException java.lang.RuntimeException: Unable to resolve symbol: ->Baz in this context, compiling:(NO_SOURCE_PATH:17)
17:08jamii:(
17:08jamiiIs there a reason this only got fixed for defrecord?
17:08TimMcjamii: deftype is intended to be much more bare.
17:08@rhickeyreducer makes it easy to build these combinatos, as long as they can be defined in terms of a transformation of the next reducing fn in chain
17:09@rhickeywhen not, (e.g. flatten), you can just reify CollReduce
17:09jamiiTimMc: I'm trying to use it to implement IPersistentSet. Which doesn't really work when you can't call the constructur
17:09jamiiTimMc: Isn't implementing core datastructures the use-case for deftype?
17:11@rhickeythe other key thing is the ability to terminate reduce
17:11jamiiThe original issue only mentioned defrecord (http://dev.clojure.org/jira/browse/CLJ-874), I kind of assumed that deftype was just an oversight
17:12hiredmanrhickey: looks like manual stream fusion
17:12@rhickeywhat's manual?
17:13hiredmanwell the compiler/runtime just doesn't figure it out and insert it
17:13hiredmanyou have to use the ops from the namespace to get it
17:13@rhickeyhiredman: patch welcome
17:14hiredmanhey, I am not knocking it, just figuring out what it is
17:15kovasblooks pretty cool. is that all the functions that make sense?
17:15kovasbmap filter remove take take-while drop flatten
17:16dnolenrhickey: sounds an applicable strategy for CLJS as well no?
17:17hiredmandnolen: you inc'ed clj-899? say it ain't so...
17:17jamiiIs there any way for a deftype implementing IPersistentSet to call its own constructor?
17:18technomancyI wonder if it would be possible to make drop on lazy-seqs avoid the generation of potentially expensive values if it could be determined that they were going to be discarded.
17:18technomancykind of the reverse of early-terminating a reduce
17:19mega_ibdknox: still here?
17:20TimMctechnomancy: As long as you could somehow indicate whether the value generation required shared state...
17:21TimMcOr I guess, split each iteration into two pieces: Generating the new cell's value, and generating state for th next iteration.
17:21technomancyshared?
17:21TimMcshared over time
17:21TimMci doesnt has language
17:21technomancyoh, as in whether the next value is based on the value of the current element
17:22technomancyright; I'm thinking it would be great if pagination in a web service API could be implemented in terms of lazy seqs, but pagination would need drop to be free
17:22technomancyobviously for something like clojure.core/iterate it wouldn't make any sense
17:23TimMctechnomancy: Well, if you had a seq of the squares of an incrementing counter, you'd need to run the counter forward for every iteration, but could skip the squaring.
17:23TimMcMaybe split it into (map #(* % %) counting) where counting is a lazy-seq that just does the counter.
17:24TimMc(Counting and squaring are just stand-ins here for more expensive operations.)
17:24jamiiAh, Foo. does work. I just misread the error message.
17:27austinhI'm trying to get started with Korma, but I'm getting a SQLException: "Connections could not be acquired..." Any clues to debug?
17:30mebaran151technomancy: I think I found why trampoline was being parsed as one argument: the unquoting "%1" at "%1"=="trampoline" fixes stuff
17:31@rhickeyhiredman: there are no streams to fuse, you might as well say Haskell's http://www.haskell.org/haskellwiki/Enumerator_and_iteratee are manual stream fusion - they're not
17:31@rhickeyit is simply reduce, but now reduce has advantages in almost always being internal
17:32@rhickeydnolen: should work for cljs yes
17:32dnolenrhickey: and prim collections seems like?
17:32@rhickeytechnomancy: not sure what you mean re: drop
17:33@rhickeydnolen: harder since the fns need to combine, but possibly
17:33@rhickeythis will also work swimmingly with parallel ops, I hope to get to soon - since we can then base them all off of reduce, rather than parallel this and that
17:34@rhickeysince parallel is always eager
17:34technomancyrhickey: I guess it's only vaguely related to the reduced stuff, but imagine if you had a function invoked like (paginated-rest-seq "http://myapp.com/articles.json&quot;) that used standard page/offset GET parameters
17:35@rhickeyso you want to (drop n (map expensive ...)) ?
17:35technomancyyou'd want to be able to drop N items to get at the range you wanted, but if you used clojure.core/drop that would mean fetching and discarding everything up to N
17:35technomancyright; if it would be possible to prove that the elements would be discarded, you could opt out of calling the expensive fn
17:36danielim trying to do this little bit of java in clojure: databaseIndex = (int)((bbBlockers * magicNumberRook[C3]) >>> rookMagicShifts[C3])
17:36danielim getting an integer overflow when i * my two 64 bit longs
17:36TimMctechnomancy: As opposed to (map page-for (drop n (page-numbers)))
17:36technomancynot sure it would be possible to propagate that discard bit outside the trivial case of calling drop directly; haven't thought through whether dynamic binding would work for that
17:36@rhickeytechnomancy: well, the new stuff does exactly that
17:37technomancyrhickey: oh, no kidding? I missed that.
17:37technomancyI thought it only went the other direction
17:37@rhickeybasically the reducing fns form a chain, so drop goes first and simply counts
17:37technomancyslick
17:38@rhickeyI don't think that's possible with seqs
17:38@rhickeysince there each nested thing is first realized
17:38@rhickeyhere there are no intermediates
17:38@rhickeynot even iterators
17:40technomancyI was thinking it might have to be opt-in; a bit that the seq-generating function could check
17:41@rhickeytechnomancy: could you map delays?
17:42@rhickeythen if you don't realize, no charge
17:43Bronsarhickey: https://github.com/clojure/clojure/commit/96e8596cfdd29a2bb245d958683ee5fc1353b87a#L2L58 i think ret should be deref'd
17:43@rhickeyBronsa: no, that happens above
17:43technomancyyeah, but the consumer has to explicitly deref the delays
17:43Bronsaoh ok
17:43@rhickeythat reduce isn't the outer reduce
17:44@rhickeyderef on non-delays is harmless
17:44jweiss"Wrong number of args (-1) passed to: core$assoc" that error message appears to have a bug in it :)
17:44Bronsaoh i see, it gets derefed by coll-reduce
17:44@rhickeyer, force that is
17:45technomancyyeah, it's not terribly onerous
17:45hiredmanrhickey: force?
17:45technomancyI'd prefer something seamless though. you could always provide your own discard-aware drop function too.
17:45@rhickeydoc force
17:46hiredmanderef on non-derefables throws, but force on non-delays is harmless
17:46hiredman(doc force)
17:46clojurebot"([x]); If x is a Delay, returns the (possibly cached) value of its expression, else returns x"
17:46@rhickeytechnomancy: then maybe some delaying map that did the force on first
17:48@rhickeymap could have done that had it not been also used for I/O
17:49technomancyif drop bound a dynamic var, map and other lazy-seq callers could just check that before calling their f, right? since drop always realizes you don't have any nasty binding/laziness complications.
17:49@rhickeytechnomancy: I'm not going to go there :)
17:51technomancyyeah, binding+laziness admittedly sets off alarms in my head too
17:52@rhickeywell, have fun with the bits - termination for reduce will keep you from having to resort to loop, and we can add a few more seq ops if they make sense, probably also do -kvversions
17:52@rhickeythen fork/join
17:52technomancycool
17:53hiredmandamn
17:53technomancyah, binding would probably interact badly with chunking
17:53technomancyoh, he's gone
17:53hiredmanwas just going to as if rich see's this as the basis for io stuff like iteratees
17:53technomancytoo bad; he missed me telling him he's right
17:54technomancynot sure if that's an argument against drop binding or chunking though
17:54nappinghow would binding work with nested drop calls?
17:55technomancynapping: the nested drop would be discarded, probably
17:55technomancycan you even have nested drop calls that aren't no-ops?
17:55nappinglike (drop 2 (drop 3 <seq>))?
17:55dnolenibdknox: jonasen: well I guess that means we have to decide amongst ourselves about the :children issue :)
17:56technomancynapping: oh, I see. well since drop doesn't call any functions that would check the discard bit it should be a no-op?
17:58nappingNow I really don't follow you, but anyway explicit laziness on list items sounds like a better way to go
17:59daniel http://www.rivalchess.com/magic-bitboards/ <- what kind of operation is the occupancy * Magic Number for rook on c3?
17:59danielif i try to multiply two 64 bit longs, i get an integer overflow error
17:59jonasendnolen: for me, there are no (known) issues left. I've corrected the inconsistencies I found.
18:00mebaran151daniel: if the number might overflow, you might have to move to BigNum math
18:00jonasen:children-keys or not is a seperate issue
18:00dnolenjonasen: yes
18:00mebaran151have you tried (* 1N my-big-long my-other-long)
18:01hiredmanmebaran151: he most likely wants unsafe math, since he is copying java code
18:01technomancymebaran151: can you submit a patch for the .bat issue?
18:02mebaran151should I fork and submit a pull request?
18:02danielmebaran151: that gives me value out of range for long
18:03technomancysure, or a patch to the mailing list would be fine
18:03danielthe result i get from this operation should be another 64 bit long, it shouldnt overflow
18:03dnolenjonasen: ibdknox: huh I don't really see any reason why we can have :children and a children multimethod?
18:03dnolencan't have.
18:03mebaran151I'm relatively noobish with regard to git: how do I make it make a patch?
18:03jonasendnolen: I've thought about that too
18:03ibdknoxdnolen: the only thing I care about is the duplication, the rest I think is relatively straight forward
18:04technomancymebaran151: you can make the changes; do `git commit -a -m "fixed thingy"` and then do `git format-patch origin/master` to generate the patch
18:05dnolenjonasen: (add-children ast-node)
18:06nappinghow do you get wrapping arithmetic?
18:06dnolennapping: unchecked math ops.
18:07nappingah, I wasn't looking for a dynamic
18:07danieli know what the result of the operation should be http://www.rivalchess.com/magic-bitboards/
18:07daniel(magic result)
18:07danielbut i dont know what the operation is
18:08mmarczykyoklov: hi, thanks for catching the transient bug! fix @ CLJS-219, see also CLJS-220 for transient-based frequencies
18:09yoklovmmarczyk: wow, thanks for the hasty response
18:09dnolenibdknox: jonasen: I like the add-children idea. People can just interact w/ data and a standard way to sync a node.
18:10mmarczyk:-)
18:10napping,(binding [*unchecked-math* true] (* 0x1000000000000000 0x10))
18:10clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
18:11pjstadig,(unchecked-add Long/MAX_VALUE 1)
18:11clojurebot-9223372036854775808
18:11ibdknoxdnolen: sounds much better :)
18:11pjstadig,(unchecked-multiply Long/MAX_VALUE Long/MAX_VALUE)
18:11clojurebot1
18:11pjstadigetc.
18:13mebaran151technomancy: patch made, where's the mailinglist?
18:13technomancymebaran151: https://groups.google.com/group/leiningen; thanks
18:13dnolenibdknox: I like it. I think keeps everyone happy.
18:15Bronsanapping: i think that has to do with + being inlined
18:16dnolennapping: it's not a dynamic var - it's a compiler flag you need to set! it.
18:16hiredman^- excellent modularity, fyi
18:17danielcan anyone see what that operation is?
18:17napping,(binding [*unchecked-math* true] (eval '(* 0x10000000 0x1000000000)))
18:17clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
18:17nappingaww
18:17nappingbut that works
18:19mebaran151technomancy: posted
18:20technomancymebaran151: thanks
18:21yoklovmmarczyk: oh, i filed that bug as CLJS-217
18:23mmarczykyoklov: oh, missed that -- thanks for the heads-up -- just posted a comment w/ pointer to CLJS-219
18:23yoklovmmarczyk: awesome
18:23goodieboyweavejester: i'm attempting to use "lein ring uberwar" but my app is hanging, can you tell me what the uberwar task does and what it expects in my app?
18:23aphyrWhat's the idiomatic way to catch a checked exception in Clojure?
18:24yoklovgotta run for a bit
18:24weavejestergoodieboy: It compiles the Clojure project into a war file with all dependencies included. Which version are you using?
18:24mebaran151aphyr: (catch ExceptionClass ex (do-stuff-with-error e)) ?
18:24nappingisn't it try?
18:24TimMcaphyr: (try ...)
18:25aphyrReferring to http://dev.clojure.org/jira/browse/CLJ-855
18:25goodieboyweavejester: 0.4.5
18:25mebaran151/s/e/ex
18:25TimMcOh, that lossage.
18:25aphyrclojure.lang.Util.RuntimeException is wrapping it. :/
18:25weavejestergoodieboy: Try using a later version 0.4.5 is pretty old.
18:25goodieboyweavejester: ok, what is the latest?
18:25weavejestergoodieboy: 0.6.5 should work
18:25aphyrLooks like there was a patch to try which offers transparent unwrapping, but I guess that's not a part of 1.3?
18:26dnolenibdknox: jonasen: I also don't see a problem with a dynamic var *cljs-add-children*
18:26weavejestergoodieboy: 0.6.6 works with lein2 but has a problem with lein1
18:26goodieboyweavejester: ok we're using lein1
18:26goodieboyweavejester: ok will try now
18:27ibdknoxdnolen: hm that would leave my issue still open, right? While having the function forces you to call it once you're handed a tree
18:28dnolenibdknox: yeah I think you're right. We just want a standard a rep, and standard add-children method helper so it's not a hassle.
18:31goodieboyweavejester: does "lein ring uberwar" call the application :init function?
18:32technomancygoodieboy: any particular blockers for upgrading to lein2, or just haven't looked into it yet?
18:32goodieboytechnomancy: actually, we just haven't looked into it yet. Does it require clojure 1.3?
18:33technomancyno, should be pretty seamless transition in most cases
18:33goodieboytechnomancy: that's good to hear, maybe i'll try to do the upgrade
18:33aphyrShould I (catch RuntimeException, inspect the class of the cause?
18:33technomancygoodieboy: let me know if you run into any blockers; want to make sure it's seamless and well-documented for others
18:33technomancyclojurebot: lein upgrade guide?
18:34clojurebotLeiningen pronunciation is LINE-ing-en ['laɪnɪŋən]
18:34goodieboytechnomancy: excellent, i will thanks
18:34technomancythere's an upgrade guide on the wiki, though clojurebot apparently doesn't remember
18:34goodieboyhaha
18:35mega_ibdknox: any probs with this patch (its small) https://github.com/megakorre/crate/commit/b332ddf9b2123bb20bd3eeb9fbcb2f8da9649e45
18:37ibdknoxmega_: :node should probably be :dom and that let should be a when-let now :)
18:38weavejestergoodieboy: It will when the war is installed
18:38goodieboyweavejester: ok you mean in the servlet container when starting up?
18:39weavejestergoodieboy: Right
18:39goodieboyweavejester: ok gotcha
18:39danielcan anyone see what type of operation the * is, resulting in the 'magic result'? http://www.rivalchess.com/magic-bitboards/
18:42mega_ibdknox, kk fixed
18:43austinhTo answer my own question from earlier, (korma.config/set-delimiters "") solved my "Connections could not be acquired..." issue with postgresql.
18:44clj_newbHi, is it possible to execute two conditions in a if ? Java: if(true) { a = 1; b = 1; } else { c = 1; }
18:45Bronsa,(if true (do 1 2) 3)
18:45clojurebot2
18:45clj_newbthank you!
18:46clj_newb,(if true (do (println "a") (println "b")) (println "c"))
18:46clojurebota
18:46clojurebotb
18:46clj_newbcool
18:51austinhActually, it wasn't (korma.config/set-delimiters ""), it was :delimiters "" in the defdb/postgres form.
18:53sorenmacbethtechnomancy: content in resources-paths in the :dev profile shouldn't be included in an uberjar correct (lein 2 preview 3)?
18:54technomancysorenmacbeth: there was a bug about dev profiles leaking through; check the issue tracker
18:54technomancynot sure if it affects the uberjar or just the pom
18:54sorenmacbethtechnomancy: thanks
18:56sorenmacbethtechnomancy: yep, there is one specifically about uberjar applying dev/user profiles: https://github.com/technomancy/leiningen/issues/537
19:01danielsolved my issue with (bit-shift-right (unchecked-long (*' (bit-and rookc3ap (nth rook-occupancy-mask 21)) (nth rook-mnumbers 21))) (nth rook-mnumber-shifts 21)))
19:02danielwas able to autopromote to bigint and then cast back to an unchecked-long
19:02danieldon't know if it can be improved
19:07sorenmacbethtechnomancy: is there a known workaround?
19:07sorenmacbeth(don't see one referenced in the issue)
19:07technomancyit may be fixed in master; I think the issue was just reopened as a reminder to do some cleanup around it
19:07technomancylemme see
19:08technomancysorenmacbeth: yeah, current master has some other issues surrounding pom generation and profiles, but it looks like the uberjar problem is addressed
19:09sorenmacbethtechnomancy: ok, thanks
19:09technomancy(wouldn't hurt to verify manually though =)
19:13mebaran151daniel: if you need the performance you might consider creating an array of say two longs and handling overflow manually
19:14mebaran151though it might not be worth the effort
19:17hiredman~gogurt
19:17clojurebotgogurt is just yogurt
19:18technomancywhat⁈ but it's like... mobile and stuff.
19:18technomancyit's nearly clomoso
19:18mebaran151and you don't need a spoon
19:20aphyrAha, so if you add enough type hints to prevent reflection, try/catch works properly.
19:20aphyrGuess the reflector is what was wrapping those exceptions up.
19:20yonkeltrontechnomancy: http://www.clomoso.com/
19:20hiredmanaphyr: it's a known issue with 1.3, fixed in 1.4
19:21aphyrSweet. Not a huge issue, this is the first time I've hit it in a lot of code.
19:22technomancyyonkeltron: gogurt is mobile and sort of social (you can share it, I guess?) so that's like 2/3
19:22technomancyif we can figure out how to get gogurt in the cloud I think we could have VCs all over this
19:23yonkeltrontechnomancy: also if we find some way to incorporate big data
19:23TimMcaphyr: Huh. Example?
19:23yonkeltrontechnomancy: like, we can process thousands of cases of gogurt in the cloud using either AWS or dynamite *and* we can do it in O(n) time!
19:24technomancyyonkeltron: with map/reduce it should be possible
19:24aphyrhttps://gist.github.com/2563560
19:24aphyr^-- TimMc
19:24yonkeltrontechnomancy: yeah, we'll write our own hadoop clone in like 10 lines of roflscript
19:26kovasbroflscript compiles to jvm bytecode right
19:27TimMcaphyr: I don't see the type-hinting.
19:27aphyr[^RiemannClient client event]
19:28aphyrNeeded to prevent the reflector on dispatching .send()
19:28TimMcAh, got it.
19:28TimMcI was busy looking at the try/catch.
19:28aphyrI'm calling it a feature, since that code needed type hints anyway, haha.
19:28emezeskeaphyr: Spoken like a true engineer.
19:40dnolenmmarczyk: ping
19:40mmarczykdnolen: pong
19:41dnolenmmarczyk: re: conversion on N updates. It shouldn't be possible to create large ObjMap outside of using the obj-map actor explicitly.
19:41mmarczykdnolen: agreed on that
19:41dnolenmmarczyk: so conversion on N updates could work I think.
19:41mmarczykdnolen: hm, except maybe through TransientObjMap -- assuming that would be its *only* purpose or there would be some flag to trigger that behaviour
19:42mmarczykdnolen: that would basically mean conversion on initial size + N
19:42mmarczykdnolen: if that works, we could just use (+ max-initial-size N)
19:42mmarczykdnolen: hm, actually
19:43mmarczykdnolen: you want to convert faster for maps which actually are updated
19:43mmarczykdnolen: makes sense, I guess
19:43dnolenmmarczyk: I don't think TOM should ever convert, on persistent! probably should create OM that won't convert
19:43mmarczykdnolen: assuming we don't want to see (count om) > 32, I'd say 16 updates?
19:44mmarczykdnolen: and have the compiler emit OMs for <= 16 entries
19:44dnolenmmarczyk: I think sticking w/ 32 is probably best.
19:44mmarczykdnolen: 32 for which constant :-)
19:44dnolen< 32 compiler emits OMs
19:45dnolen> 32 updates -> PHM
19:45mmarczykdnolen: about TOM -- that's no problem to implement, but for that sort of perf-sensitive scenarios, what's the advantage over fromObject ?
19:45dnolenTOM & explicit OM for special cases where people care
19:45mmarczykdnolen: you're not worried about the assoc perf at sizes 32-64 ?
19:46dnolenexplicit OM & TOM use probably means updates are rare.
19:46dnolenexplicit OM & TOM is about access heavy applications.
19:46mmarczykdnolen: ok, so TOM is basically for people who would call fromObject now, but more convenient since we're doing the keys bookkeeping and taking care of the unmodifiable flagging of the OM?
19:49mmarczykdnolen: so, I'd go with a convertible? flag on the OM -- there's one access per assoc at most (that's once we get to the conversion threshold), which should be no problem at all for the maps which will convert and also no problem for the maps which are hardly ever updated
19:50dnolenyes
19:50mmarczykdnolen: should unmodifiable OMs perhaps throw on assoc of complex key?
19:50mmarczykdnolen: "pour me into a hash map first, buster" or sth
19:52mmarczykdnolen: also, TransientObjMap no longer strikes me as the perfect name w/ this sort of impl :-(
19:52mmarczykdnolen: TransientCOWObjMap? dunno :-/
19:53mmarczykI'm not altogether certain the pure-lookup-perf-sensitive folks shouldn't just use js-obj, though.
19:55mmarczykgoing back and forth on this. but mostly I'm bothered by those lookup perf test results -- I must be missing something really big here, but I just can't see what's different now to how things were with the first lookup test :-(
19:56dnolenmmarczyk: yeah, we need to look into that.
19:56kovasbis this ObjMap thing similar to record, but optimizing for speed rather than memory?
19:56dnolenmmarczyk: good point about complex key assoc ...
19:56dnolenmmarczyk: we should think about it some more ...
19:56mmarczykdnolen: yeah, some extra hammock time is needed on this
19:58johnfnhow can i tell if a given value v is a function?
19:59sattvikjohnfn: fn?
19:59mmarczykdnolen: perhaps we should just pick a threshold and mark it as experimental, then revisit with some real-world data? with OMs + HMs only everybody's getting uniformly poor assoc perf and I wonder how common pure simple key maps are at huge sizes...
19:59S11001001johnfn: depending on your strength desire, fn? or ifn?
19:59dnolenmmarczyk: TOM is really a separate ticket, as is unconvertible OM
19:59S11001001johnfn: try both on different values (collections et al) and see what you mean
19:59mmarczykdnolen: oh, ok
19:59johnfnbrilliant, thanks!
20:00mmarczykdnolen: in that case, I'll tidy up the TOM code and post it on a new ticket
20:00dnolenmmarczyk: yes, lets make 32 the experimental threshold and re-precate OM, everything is we'll ponder further.
20:00dnoleneverything else
20:00mmarczykdnolen: cool
20:01mmarczykdnolen: thanks for thinking about this this thoroughly, btw
20:02mmarczykdnolen: so, I'll be posting that new OM-reprecating patch soonish, threshold of 32
20:02dnolenmmarczyk: excellent.
20:02mmarczykdnolen: incidentally, I've got some work done on a port of the new reduce goodies -- couldn't help myself
20:03mmarczykkovasb: ObjMap is a copy-on-write map type backed by a JS object (+ an array holding the keys)
20:04mmarczykkovasb: superb lookup performance since it's basically an object lookup; assoc performance is not great at all though, as one would expect
20:05mmarczykkovasb: so there's a bit of a balancing act in trying to pick which map type to use when... see CLJS-190
20:05kovasbmmarczyk: sounds useful. just wondering how it relates to the existing datastructure set
20:05dnolenkovasb: it's very JS specific.
20:05mmarczykkovasb: it's one of the original cljs map types, the other being HashMap
20:06kovasbis it different from backing it with a java hash map?
20:06kovasb(instead of a js object)
20:06mmarczykkovasb: Clojure isn't using maps backed with Java hash maps
20:07kovasbfor the purposes of the objmap, js maps and java hash maps are equivalent? or am i missing something
20:08mmarczykkovasb: on the JVM, there's just PersistentArrayMap (linear scan lookups for very small maps) and PersistentHashMap; but in CLJS we'd be missing out on the JS VMs' object lookup optimizations without a map type wrapping an object for the string-keys-only case
20:09kovasbmmarczyk: so you think there would be nothing to be gained to have a similar construct in jvm clojure?
20:10kovasbthe basis of my analogy is, record also imply a definite, regular structure on the keys
20:11kovasbso that is not a new constraint in the space of clojure design
20:11mmarczykkovasb: records are updateable in a persistent manner though
20:11mmarczykkovasb: which Java maps are not
20:12S11001001kovasb: moreover, java hashmaps do not exploit that structure either (though the enummaps do)
20:12mmarczykkovasb: I've actually written a library to wrap the immutable Guava collections for use with Clojure's collection library -- but the wrappers won't help you with updates, you'd have to unwrap, make your own copy + modifications, wrap again
20:13mmarczykkovasb: no problem for the particular use case this was meant to support, but probably no good to have this sort of thing in core
20:14mmarczykkovasb: and if you just want to use Java maps in Clojure through interop -- that's already a reasonably pleasant experience -- more so than using JS objects in CLJS, since JS objects are insane (hasOwnProperty :-P)
20:15kovasbmmarczyk: yeah, i see your point
20:21yonkeltronwhy have vectors?
20:22gfredericksin clojure? at all?
20:22yonkeltronin clojure
20:22yonkeltroni actually have an appreciation for vectors
20:22gfredericksthey do 3 things as I see it
20:23gfredericks1) increase code readability by giving an alternate form to use
20:23gfredericks2) allow consise data literals, especially when you want the contents evaluated
20:23gfredericks3) as data structures, allow random access/update, in contrast to lists
20:24yonkeltron3 makes the most sense
20:24gfredericksI think 3) is used the least though
20:24yonkeltronsee my earlier appreciation for vectors
20:24yonkeltronreally?
20:24yonkeltroni understand but dislike 1
20:24gfredericksat least in my experience
20:25emezeske4) make things a tiny bit easier for newcomers, as they don't have to understand quoting on their first day
20:25yonkeltronemezeske: new comers to lisp, you mean
20:25yonkeltron?
20:25emezeskeYes
20:25gfredericksemezeske: 2.1? :)
20:25emezeskegfredericks: Heh, yeah, 2.1. :)
20:26gfredericksemezeske: I've used clojure for years but it was only like 2 weeks ago that I conciously realized that '((+ 1 2)) != [(+ 1 2)]
20:26technomancyyonkeltron: 1) is weird for a few days, but most of the objections to vectors-as-bindings are basically a re-hash of the same "whoa; parens are weird" objections the algol-family-fans raise to any lisp
20:26gfredericksi.e., conciously realized that that was a difference between quoted lists and vectors
20:26emezeskegfredericks: I hear that.
20:27gfredericksemezeske: I would've known the difference if you'd shown them to me of course
20:27yonkeltrontechnomancy: fair i suppose. that actually didn't freak me out too much
20:27yonkeltronespecially not with maps!
20:27gfredericksbut not if you'd asked "What are the differences between vectors and quoted lists?"
20:27yonkeltroni loved seeing map literals
20:28technomancyyonkeltron: the advantage of using vectors for binding in source is that it means nearly any time you see "(foo ...)" it means "call foo"
20:28technomancythere are very few exceptions
20:28yonkeltroninteresting
20:28gfrederickstechnomancy: that is a good point
20:28yonkeltroni guess i should make a habit, then
20:28yonkeltroni have an inbuilt desire to pass around '(...)
20:29gfredericksyonkeltron: all those single-quotes! lisp is so weird!
20:30yonkeltrongfredericks: says the clojure fan...
20:30kovasbyonkeltron: unless you were born with it, it should be possible to unlearn :)
20:30yonkeltronkovasb: what if...um...what if you were born with it?
20:30yonkeltroni mean what if it was mabelline, also?
20:30yonkeltronbut let's begin with born with it
20:30kovasbyonkeltron: then i would subject myself to a genetic study :)
20:31gfredericksperhaps his mother ate a lot of quoted lists
20:31yonkeltronkovasb: got it, i'll walk next door to the uni and ask if they'd like me
20:31kovasbyonkeltron: relationship between evolution and syntax hunger
20:31yonkeltrongfredericks: don't talk about my mom that way!!!!
20:31kovasblol
20:31gfredericks"Did you just call my mother a function?"
20:31yonkeltronkovasb: computational biology, or, as i like to call it, a shortcut to publication for bullshit papers
20:31mmarczykdnolen: first cut at IKVReduce -- http://dev.clojure.org/jira/browse/CLJS-221
20:31yonkeltrongfredericks: yeah dude, and i let her map me off last night, etc. etc.
20:31kovasbhehe
20:32yonkeltronok but vectors.
20:32kovasb"but he said he was side-effect free, so its ok"
20:32yonkeltroni got tested, i swear
20:32yonkeltroni can *prove* it
20:32yonkeltroni suppose an implied-global proof in the case of the terminology of *prove*
20:33mmarczyk(reduce-kv (fn [i k v] (if (> i 1000) (reduced i) (+ i k v))) 0 (apply hash-map (range 100))) now evaluates to 1011 in CLJS :-)
20:33dnolenmmarczyk: oooh nice :)
20:33nDuff*whew*
20:33gfrederickswhy does clojurescript not like my ns form?
20:34gfredericks(ns foo.bar (:require [baz.bang :as booze]))?
20:34mmarczykdnolen: more complete port of the reduce lib forthcoming :-)
20:36mmarczykdnolen: btw, do you know off the top of your head if (extend-type default IKVReduce ...slow implementation assuming coll is IMap...) is the correct way to implement a slow path default?
20:37mmarczykgfredericks: really? could you paste the error message?
20:38gfredericksmmarczyk: oh it went away when I removed the docstring; guess cljs doesn't have ns docstrings?
20:38mmarczykgfredericks: ah, I believe not
20:38gfredericksoh well
20:38dnolenmmarczyk: we should avoid extend-type default, I'm trying to get rid of that from CLJS
20:39mmarczykgfredericks: introspection support for CLJS is something I'm planning to work on, so please bug me about this from time to time :-)
20:39mmarczykdnolen: well here I guess it's actually not a big deal, since we control all associative types
20:39mmarczykdnolen: coming to think about it.
20:39mmarczykdnolen: except possibly Object, which needs its own impl anyway
20:40yonkeltronso i guess you don't even need clos or cousins in clojure
20:42yonkeltronnot that you'd need it anyway if you didn't want it
20:44gfredericksokay so I have a crossover where I'm hoping to use shuffle, which apparently isn't present in cljs; what's the best way to supply it? If I (defn shuffle ...), wouldn't that make problems on the clojure side?
20:51gfredericksand what are the haps with dom libs for cljs?
20:51gfredericksI'm just doing something non-trivial with cljs for the first time
20:51gfrederickss/just//
20:54mmarczykgfredericks: domina & enfocus ?
20:54mmarczykgfredericks: https://github.com/levand/domina I think
20:54mmarczykgfredericks: and it links to enfocus in the readme
20:54gfredericksmmarczyk: cool, thx
20:54mmarczykgfredericks: oh, and of course ibdknox has jayq, which wraps jQuery
20:54gfredericksI remember those from the clj-west talk
20:55pandeirogfredericks: crate as well for templating
20:56yonkeltrondoes clojurescript have any frameworks on top of it for things like MVC in the browser, etc.?
20:56kovasbyonkeltron: not yet, but i suspect there will be in the next month or so :)
20:57pandeiroclojurescript one implements a sort of MVC
20:58kovasbthere are some partial solutions out there
20:58kovasbbut they all have pretty big holes
20:59pandeironothing 'framework' yet yeah
20:59yonkeltronkovasb: details exist?
20:59pandeirobut already the essential libs are there imho
20:59kovasbyeah lemme find my rant to the mailing list :)
20:59mmarczykkovasb: next month? :-)
20:59mmarczykwhew, done with the reprecating ObjMap patch -- at least for now
21:01kovasbyeah the problem with clojurescript one is that you can't have multiple copies of the same widget
21:01kovasbwithout manually engineering it for each situation like that
21:01pandeirokovasb: what widget do you mean?
21:02kovasbpandeiro: anything for which a view is defined
21:02mmarczykkovasb: which mailing list? the main ggroup? I'd like to read your rant :-)
21:02kovasbhttp://groups.google.com/group/clojure/browse_thread/thread/0291471d79972c58
21:03mmarczykthx!
21:03kovasbanyway, I have an alternate design I've been working on in conjunction with a larger-scale cljs app
21:03kovasbi suspect a few other people have their own solutions brewing
21:04mmarczykah yes, I've read that
21:05gfredericksare there any plans to enhance cljsbuild crossovers with that cljx project?
21:07emezeskegfredericks: Is there any reason cljx can't be used in cooperation with lein-cljsbuild?
21:07emezeskegfredericks: I might do some tighter integration at some point, but I think they can play well now (just turn off crossovers)
21:07mmarczykkovasb: looking forward to seeing your solution
21:08gfredericksemezeske: I must not be familiar enough with either project. I'll look closer :)
21:08gfredericksemezeske: any tips on my crossover issue? (defining shuffle)
21:08kovasbmmarczyk: yeah, i look forward to help optimizing it:)
21:09mmarczykkovasb: sounds great :-)
21:09emezeskegfredericks: sorry, crossover issue? do I need to scroll up?
21:09gfredericksemezeske: just not sure how to define shuffle for cljs only
21:10emezeskegfredericks: Oh, I see, uh, I am not sure I know how best to deal with that
21:12gfredericksit really doesn't come up that often?
21:24gfrederickshmm. lots of warnings of usage of undeclared vars within domina. is that expected?
21:26dnolengfredericks: domina wasn't particular about declaration order, luke knows now
21:29gfredericksdnolen: okay, so it should work anyhow?
21:30dnolengfredericks: domina works fine far as I know, JS doesn't care about declaration order.
21:32gfredericksright right. cool. thanks.
21:34mmarczykdnolen: new patch ready @ CLJS-190
21:35dnolenmmarczyk: I tried applying that on master, doesn't work.
21:36dnolenmmarczyk: oh so I need to apply 213 first?
21:36mmarczykdnolen: well yeah, and CLJS-218 & 220 too :-P
21:36mmarczykdnolen: BUT, 218 is a bug fix
21:36mmarczykdnolen: and 220 is, I think, a good feature & copy-and-paste from Clojure
21:36dnolenmmarczyk: yeah I applied those.
21:37mmarczykdnolen: great
21:37dnolenmmarczyk: doesn't Clojure have a TransientArrayMap?
21:38dnolenmmarczyk: sorry first time looking at 213
21:38davertronanyone here familiar with quil? I'm trying to figure out where my data directory is supposed to be because create-font seems to do nothing
21:38mmarczykdnolen: yeah, and that's ported too
21:38mmarczykdnolen: in CLJS-213
21:39dnolenmmarczyk: why no array-map fn?
21:39mmarczykdnolen: oh, ObjMap turns to PHM on (transient ...)
21:39mmarczykdnolen: hm, oversight
21:40mmarczykdnolen: good catch, will fix in a sec
21:40dnolenmmarczyk: please update devnotes/corelib.org too.
21:40ibdknoxand it hits 75% :)
21:41dnolenibdknox: woot!
21:41mmarczykdnolen: hm, I have the vaguest of recollections of what that file is about -- will look into it
21:41dnolenmmarczyk: just a .org of what's been implemented.
21:41mmarczykdnolen: ok, do you mind if it's a separate patch on the 190 ticket then?
21:42dnolenmmarczyk: not at all, and you might as well mark the transient, persistent!, assoc!, conj! etc as being done as well.
21:42dnolenmmarczyk: actually don't worry about it.
21:43dnolenmmarczyk: just add array-map, I'll update corelib.org
21:43mmarczykdnolen: cool
21:47mmarczykdnolen: just noticed cljs.core/hash-map is not using transients -> http://dev.clojure.org/jira/browse/CLJS-222
21:48gfredericksoh man I just put something in the dom with clojurescript
21:49gfredericksI am unstoppable.
21:49emezeskegfredericks: booyakasha!
21:49kovasbboomshakalaka
21:50gfredericksbroom
21:50kovasbwhoop there it is
21:50dnolenhaha
21:54mmarczyk:-D
21:54kovasbits awesome that so many people are hacking on cljs
21:55kovasbthough it will be funny if a year from now #clojure will be all cljs-lua
21:55kovasbpeople trying to get their iOS apps to work
21:55gfredericksoh man this is so beautiful I might cry
21:56dnolengfredericks: I take it that it's the first time you've done much w/ CLJS?
21:56kovasblol
21:56mmarczykdnolen: posted new patches on 213 & 190
21:56gfredericksdnolen: anything I really care about, yeah
21:57mmarczykgfredericks: that's exactly how I felt when Rich made the CLJS announcement
21:57gfredericksdnolen: I've done a surprising amount with CLJS considering I haven't done anything with CLJS
21:57mmarczyk"WJW... I too will now be able to hack on the DOM"
21:57mmarczykwell, maybe that's different
21:57mmarczykbut possibly same kind of feeling :-P
21:58gfredericksI too want to slow-jam the dom.
22:02dnolenmmarczyk: applied to master
22:02mmarczykdnolen: great! thx
22:08mmarczykok, need to take my mind off of this for a couple of hours, then I'll do the TransientObjMap thing
22:08gfredericksread-string is not defined?
22:08mmarczykturning to reduce lib for now
22:08gfredericksoh sep ns for reader
22:08gfredericksI remember
22:08dnolenmmarczyk: hmm I wonder about using dynamic binding for mutable locals for kvreduce.
22:08mmarczykdnolen: to be honest -- me too
22:09alex_baranoskywhat is a good IRC client that I can tell to open the same bunch of IRC channels everytime I turn it on?
22:10emezeskealex_baranosky: I use irssi for that.
22:10mmarczykdnolen: the problem is that the inner loop needs to return a couple of things to the outer loop
22:10emezeskealex_baranosky: It's not for the faint of heart though :)
22:10amalloyalex_baranosky: if you have an always-on computer somewhere (eg a vpn), you can run znc on that
22:10mmarczykdnolen: could use an array for that of course
22:11mmarczykdnolen: but that's a bunch of extra allocations :-/
22:11amalloymy znc server is always connected to freenode, and when i turn on my irc client i connect to znc instead of to freenode, and it "forces" my (dumb) irc client to join channels on startup
22:12alex_baranoskyamalloy, cool idea
22:13dnolenmmarczyk: mmarczyk well just one allocation right? on entering kvreduce.
22:13amalloythis gets you other nice things like logging the irc traffic even when you don't have an IRC client turned on
22:13mmarczykdnolen: one for each run of the inner loop
22:14mmarczykdnolen: oh, I mean in the PersistentVector impl
22:14dnolenmmarczyk: yeah that's what I'm looking at.
22:14mmarczykdnolen: incidentally, that impl is broken right now -- I've got a fix for one part of the problem here, working on the second part
22:15alex_baranoskydid anyone see Rich Hickey's commit to Clojure today ? https://github.com/clojure/clojure/commit/4a22e3a44df48ea0d37dd034bc3f6cb3092117a9
22:15dnolenalex_baranosky: yep
22:16dnolenmmarczyk: why do you need allocation inner loop? seems like you just something settable for step and init
22:16alex_baranoskywhat is the idea behind it?
22:16dnolenallocation in the inner loop
22:16mmarczykdnolen: ohhh. gotcha.
22:16mmarczykdnolen: fixing this with your approach now
22:17mmarczykdnolen: I'm slightly worried about boxing
22:18dnolenmmarczyk: boxing of what?
22:19mmarczykdnolen: boxing as in placing values in an array rather than their own variables
22:20mmarczykdnolen: but actually I'm sure I don't have a particularly clear picture of the implications of that, so nvm
22:20muhooibdknox: i just sent someone to you who, from his description of the prototype he wants, needs your cljs skillz
22:20dnolenmmarczyk: maybe worth making a benchmark - though I'd be suprised if it made a big difference.
22:21dnolenalex_baranosky: rhickey said allocation free pipelines
22:21dnolenalex_baranosky: http://clojure-log.n01se.net/#17:02
22:21muhooibdknox: feel free to pm me if you want to discuss
22:22mmarczykdnolen: ok, I'll get it working with an array first
22:22mmarczykdnolen: then maybe benchmark the binding approach too.
22:22alex_baranoskydnolen, I see now, I was looking at his second commit, the first one makes it clear that he's re-implementing reduce ... faster
22:24gfrederickswhat do I need to set to prn to the console?
22:24gfredericks(i.e., chrome console)
22:25dnolengfredericks: just call (.log js/console (str ...))
22:26gfredericksoh, I inferred from the error message that prn gives that I could hook it into the cljs print functions
22:27jroesanyone on osx know how to get the little incoming connections box that instantaneously pops up to stop happening?
22:27jroesusually pops up when clojure tries to listen on a port
22:27jroesor something clojure-related
22:28mmarczykdnolen: ok, posted new patch with a working impl of -kv-reduce for PV
22:28mmarczykdnolen: array based
22:28alex_baranoskydnolen, thanks for the link, reading through it now
22:30dnolenmmarczyk: excellent.
22:30dnolenmmarczyk: so for reduce combinators I imagine you'll make a seperate file?
22:32mmarczykdnolen: yeah, that would be most convenient, though then it should probably be clearly documented that the Reduced thing is WIP
22:32mmarczykdnolen: since it doesn't work with the regular reduce yet
22:32mmarczykdnolen: or I could work on this ticket a bit more to make it work with reduce and then port the combinators namespace in a separate ticket
22:34dnolenmmarczyk: but that's true for Clojure at the moment too right?
22:35dnolenmmarczyk: oh, actually, no that's not true.
22:36mmarczykdnolen: yeah
22:37mmarczykdnolen: so, not sure whether it's same ticket or separate -- also, no preference here, it doesn't affect my workflow much :-)
22:38dnolenmmarczyk: lets make them separate, if only for documentation reasons.
22:38mmarczykdnolen: sure
22:38dnolenmmarczyk: well that and I can apply kvreduce patch now.
22:39mmarczykdnolen: oh great :-D
22:43mmarczykdnolen: hm, apparently I missed PAM, though I could swear I had an impl earlier
22:44mmarczykdnolen: will post an updated patch in a moment
22:48mmarczykdnolen: done
22:48mmarczykgfredericks: cool :-)
22:48mmarczykgfredericks: would you consider posting it somewhere? :-)
22:49gfredericksoh I guess so
22:50gfredericksmmarczyk: https://refheap.com/paste/2482
22:50gfredericksI don't know that that exact version works in clj, given the (def shuffle ...)
22:52mmarczykgfredericks: I love you shuffle impl :-D
22:52gfredericksmmarczyk: thanks :)
22:53amalloy&(sort-by rand '(a b c d))?
22:53lazybotjava.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number
22:53gfredericksamalloy hates my shuffle impl
22:53amalloyeven if the input is all numbers it's a terrible sort algorithm
22:54amalloysorry bro
22:54amalloyer, terrible shuffle
22:54gfredericksI'm confused as to why it worked then
22:54gfredericksbecause I wasn't sorting numbers
22:55gfrederickswhere is cljs-bot when you need him?
22:55mmarczyk:-)
22:55amalloygfredericks: i have a lazy-shuffle implementation if you want it
22:55amalloyin useful.seq, i think
22:55gfredericksamalloy: will it work in cljs?
22:55amalloyit should
22:56amalloyi mean, you'll have to copy the code, since it's not in any cljs jars
22:56gfredericksof course
22:56amalloyhttps://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L143
22:56gfredericksthx
22:58gfredericksamalloy: in any case I think it's a little extreme to call O(n log n) "terrible"
22:58gfredericksI prefer "mildly slow"
22:58amalloygfredericks: no, i mean it does a terrible job of shuffling - the result is not very random
22:59gfrederickswth
22:59gfrederickswhy not?
22:59amalloyconsider ##(sort-by rand [0 1 1 1 1 1 1 1])
22:59lazybot⇒ (0 1 1 1 1 1 1 1)
22:59amalloythe 0 will always come first, because (rand 0) is always less than (rand 1)
22:59gfredericksoh rand is not doing what I wanted it to
23:00amalloyeven if you were tossing a coin at every comparison, which i assume is what you meant
23:00gfredericks(partial sort-by #(rand)) is apparently what I meant
23:00amalloythen i'm told it's still pretty bad, because sort algorithms have different goals from shuffle algorithms
23:00gfredericksbad in its ordering or performance?
23:01mmarczykwell it probably produces a non-uniform shuffle
23:01amalloyyou wind up with stuff like "the first item in the input list is very likely to be either the first or last item in the output list"
23:01amalloyright
23:01amalloy(though the particular error case there, i just made up - i doubt it's that simple)
23:01gfredericksI can't see why anything like that would happen
23:01gfrederickswe're assuming each item is associated with a random element of [0,1)?
23:02gfredericks&(rand)
23:02lazybot⇒ 0.3245122350535715
23:02tmciverWhat about just using ##(doc shuffle)
23:02lazybot⇒ "([coll]); Return a random permutation of coll"
23:02gfrederickstmciver: cljs
23:02clojurebotHuh?
23:02amalloygfredericks: but you're not associating each item with a random number *once*
23:03tmciverAh, can't do it, I guess. I know nothing of cljs.
23:03mmarczykhttp://dev.clojure.org/jira/browse/CLJS-223
23:03amalloyyou're changing, at random, the number it's associated with every time you compare it to something
23:03gfredericksamalloy: oh I thought caching the value was part of the contract
23:03amalloyno
23:03mmarczykgfredericks: ^ support for ns docstrings -- or rather for discarding of docstrings
23:03gfrederickswell poo poo
23:03amalloymmarczyk: is there some reason he can't just write (ns ^{:doc "..."} my.ns ...)?
23:03gfrederickswhy shouldn't it cache? the fn might be expensive, and what is there to lose from it?
23:04amalloy*shrug* perhaps the function is cheap to compute, but expensive to store
23:04mmarczykamalloy: oh sure, but (1) it's ugly, (2) it's doesn't actually work in Clojure
23:05amalloyif you want it cached, (map first (sort-by second (map (juxt identity sort-fn) coll))), right?
23:05gfredericksokay this starbucks is closing so I have to go
23:05amalloyaw, sad-face re (2) there
23:05mmarczyk(let [tag (memoize (fn [_] (rand)))] (sort-by tag ...))
23:06gfredericksthanks for the enlightening discussion :)
23:06mmarczyksee you :-)
23:09amalloymmarczyk: cute. still has problems if the list elements aren't unique, though
23:09mmarczykamalloy: take-shuffled is very pretty
23:09amalloyi'm glad you like it!
23:10mmarczykamalloy: I think I'll have an enjoyable session of reading through useful very soon :-)
23:10amalloyyeah, i had a lot of fun translating fisher-yates into a functional context
23:11mmarczykamalloy: a, good catch
23:11amalloysomewhere fliebel has a blog post comparing performance of a bunch of different shuffle implementations, including mine. there are tradeoffs, of course
23:11mmarczykamalloy: I'm pretty sure I've got a straightforward fisher-yates impl lying around somewhere, but can't find it
23:12mmarczykamalloy: but the take-shuffled idea is nice apart from the algo
23:12amalloyhow so? just the idea of a lazy shuffle, or...?
23:13mmarczykyeah, plus implementing it on top of lazy-loop
23:14mmarczykjust overall pretty :-)
23:14amalloyheh, i implement everrrrything on top of lazy-loop. i love that macro
23:14mmarczyk:-)
23:17TimMcgfredericks: (sort-by (memoize rand) ...) Done! :-P
23:17mmarczykamalloy: wow, haven't looked at useful in a pretty long while and only vaguely remembered how cool it is
23:17TimMcAw, someone already pulled out memoize.
23:17amalloymmarczyk: say, since you're already in there and seem to be educated on this sort of thing, would you mind looking at https://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L219 for me? in particular it's hard to believe that our implementation of the 3+ collection version is the fastest way to do it, but in the context of laziness it actually does seem to be
23:18mmarczykamalloy: an alternative / add-on core lib, basically
23:19mmarczykamalloy: looking now
23:28muhooibdknox: oops, nevermind. in 2 weeks, i predict you'll be the ceo of the newly-funded lighttable, inc. and won't be doing iwbyp's anymore.
23:29LuminousMonkeyWhat with all the narkyness some people get with Light Table anyway? It's odd.
23:30ibdknoxmuhoo: haha, yeah I'm not taking any projects right now :)
23:38mmarczykamalloy: no idea if it's going to be any faster, but here's what I'd do for a multiway merge: https://gist.github.com/2564705
23:39amalloyintersesting
23:40mmarczykamalloy: although apparently it's buggy... oh bother
23:41mmarczykamalloy: ah, fortunately it was my test that was buggy :-P
23:47mmarczykamalloy: but coming to think about it, useful's version is lazy in the binary case, right? so it should be optimal in the >= 3 arg case
23:47amalloyright, that's why i think it works, it just seems surprising that it comes out so easily as a result of laziness
23:48mmarczykyeah, however awesome one thinks that laziness is, it is more awesome still
23:49wmealingLuminousMonkey, re "narky", i think its jealousy.
23:49muhooLuminousMonkey: wasn't snark, i was realizing i made an error
23:49wmealingLuminousMonkey, resistance to change, and a bit of friendly jabs.
23:50LuminousMonkeymuhoo: No, sorry, I wasn't meaning you. It just reminded me of a post on the programming reddit I read this morning.
23:51muhoodamn, i dunno what to do then. what i'm being asked to do is above my skill level.
23:51muhooi'm 3 months into clojure, haven't touched cljs, and now being asked to do something along the lines of what ibdknox has done.
23:52muhooi have to turn this down.
23:52LuminousMonkeywmealing: Yeah, most of it sounds like sour grapes to me, sounds like ibdknox must be on the right track. :)
23:52wmealingi think of it this way
23:52wmealingeven if he fails, he's going to try something that people havn't done before
23:52wmealingand we can learn from it
23:52muhooit ain't gonna fail. no way.
23:53wmealingit may not be everyones "idealized" editor
23:53wmealingbut what will be.
23:53wmealingnothing
23:53wmealing"its not emacs, its not vim uwuwuwuw"
23:53LuminousMonkeyWell, I was thinking the same thing when I watched that presentation, I was thinking how cool it would be to write an IDE that does that. :)
23:53wmealingyup
23:54LuminousMonkeywmealing: Not sure about Vim, but I'm sure you could get something like that in Emacs, that's what I was considering.
23:54LuminousMonkeywmealing: But I lack talent. :)
23:54wmealingi'm a newbie emacser
23:54muhooask technomancy about trying to make major changes in emacs :-)
23:54wmealingemacsen
23:54wmealingi really only started using it for clojure
23:55LuminousMonkeymuhoo: I wish I could just have a Clojure based Emacs. :)
23:55ibdknoxI laugh everytime someone says "oh that could just be a (vim|emacs) plugin"
23:55wmealinggood luck with that.
23:55wmealingno canvas in either, from what i can see.
23:55ibdknoxthe UI layers are 20+ years old
23:56wmealinggetting anything changed will take multiple years.
23:56LuminousMonkeyWell, Steve Yegge was saying that browsers, etc, were catching up with Emacs, Emacs isn't innovating enough.
23:56wmealingsee, there was moz's bespin project
23:57wmealingi think its called something else now... that did some kind of IDE work in the browser.
23:57ibdknoxthey went about that the wrong way
23:57ibdknoxcloud9 ide
23:57ibdknoxand ACE
23:57ibdknoxis what bespin turned into
23:57wmealingyeah, i couldnt follow what happened there..
23:57wmealingit looked promising
23:57ibdknoxthe key isn't to compete with editors that already exist
23:57ibdknoxyou'll never win
23:57wmealingagree on that.
23:57LuminousMonkeyhttp://steve-yegge.blogspot.com.au/2008/04/xemacs-is-dead-long-live-xemacs.html
23:58ibdknoxemacs and vim have far too big of a headstart
23:58LuminousMonkeyThe "The bad news: the competition isn't the IDEs" part
23:58ibdknoxthe thing to do is to play a game that they can't play no matter how hard they try
23:58LuminousMonkeyI think..
23:59muhoothat's how it has always been, indeed. skate to where the puck is going, not where it's been.