2013-07-28
| 00:29 | seangrove | dnolen: Will check on the bug for the patch tomorrow afternoon and update it |
| 01:05 | futile | its quiet |
| 01:05 | futile | yall must be hackin away at some cools tuff |
| 01:16 | Raynes | futile: Psh, I'm playing video games, eatin' fried chicken, and watching television. |
| 01:17 | futile | im sorry |
| 01:33 | futile | ok that settles it, im gonna write something cool |
| 01:34 | futile | wish me luck |
| 01:34 | egghead | hmm, I wonder if I could wrap a lamina channel in a core.async channel |
| 01:35 | egghead | seems to be foolhardy |
| 01:36 | egghead | is it enough to just implement the read-port write-port and close protocols? |
| 02:32 | functionform | !commands |
| 02:32 | functionform | oops, sorry forgetting my irc |
| 02:34 | functionform | check out my first macro guys, i'm really proud of it |
| 02:34 | functionform | http://pastebin.com/xRJw9Rtz |
| 02:35 | functionform | basically you can use it to thread over every item in a collection without having to type map or use anonymous functions |
| 02:35 | functionform | clojure blows me away. this is my first lisp granted, but its just so exciting how simple you can make your end code look |
| 03:03 | futile | (do (defmacro map-> [coll & clauses] (let [g (gensym)] `(for [~g ~coll] (-> ~g ~@clauses)))) (map-> [1 2 3] inc even?)) |
| 03:03 | futile | do not like. |
| 03:20 | callen | futile: brought that one on yourself mate :) |
| 03:20 | futile | callen: i did? |
| 03:20 | callen | futile: reading noobie code. Be nice to noobies. |
| 03:21 | futile | i was. |
| 03:21 | futile | he wasnt in here at the time |
| 03:21 | callen | logs exist. be nice. |
| 03:21 | futile | i would be happy to explain why i think its a bad idea if he comes back |
| 03:21 | futile | im not being un-nice |
| 03:21 | futile | btw i just made a cocoa-based fuzzy-matching widget |
| 03:22 | futile | now just gotta use it somewhere |
| 03:27 | futile | oh wait, its unrelated to clojure. |
| 03:27 | futile | sorry |
| 03:42 | stever | I am new to clojure and building a simple web app. Was wondering what is the best way to guard against cross side scripting. php has "htmlspecialchars" and "strip_tags". Is there equivalents in clojure/luminus? |
| 03:50 | hoeck1 | stever: looks like luminus is using https://github.com/danlarkin/clabango for templating, which in turn is modeled after the django templating engine |
| 03:51 | ddellacosta | stever: see also http://stackoverflow.com/questions/2897587/escape-sanitize-user-input-in-clojure-compojure |
| 03:52 | ddellacosta | I've had luck using the org.apache.commons.lang.StringEscapeUtils solution. |
| 03:52 | hoeck1 | so, at least in templates, everthing is save by default if you use {{foo}}, you have to issue a {{foo|save}} to *not* strip out html chars |
| 03:55 | futile | i vaguely remember a middleware for protecting against cross site scripting |
| 03:55 | futile | maybe it was in lib-noir? |
| 04:00 | sontek | This might be an odd question, but are elisp and clojure lisp similar? Would knowledge of one transfer to the other pretty well? |
| 04:02 | futile | no. |
| 04:02 | futile | sontek: no. |
| 04:03 | sontek | So the different dialects are pretty different? |
| 04:04 | futile | sontek: they have very different semantics, syntax, and idioms. |
| 04:04 | futile | sontek: clojure is immutable by default, focuses in higher-order functions, and has very different data types and core functions library |
| 04:05 | futile | sontek: see http://technomancy.us/169 |
| 04:05 | futile | its very informative on this topic |
| 04:06 | sontek | futile: thanks! |
| 04:06 | futile | k |
| 05:00 | dward | has anyone ever used lamina or aleph? |
| 05:08 | AtKaaZ | is there a function already which does check if a substring is inside a certain string? |
| 05:08 | AtKaaZ | or how would you do it? contains?("abc","a") == true |
| 05:16 | AtKaaZ | ,(.indexOf "abc" "c") |
| 05:16 | clojurebot | 2 |
| 05:19 | bhuemer | hello, hi! I was wondering if you know any benchmarks/articles on how software-transactional memory performs as contention increases? I'm wondering as it says at least in Java Concurrency in Practice that CAS synchronisation performs worse than lock synchronisation when there's a lot of contention (think roundabout vs traffic lights on junctions)? wouldn't the same thing apply to software-transactional memory? |
| 05:54 | Lajjla | Raynes, do you still love me the most |
| 06:51 | ddellacosta | can someone help me understand how I can use with-redefs in Midje, using the around form? https://github.com/marick/Midje/wiki/Setup-and-teardown#around |
| 06:54 | ddellacosta | huh, not really sure what the point of "around" is, now that I'm reading the doc output |
| 06:54 | ddellacosta | I guess I can just wrap the whole thing in my with-redefs, but I wish I had something like use-fixtures in clojure.test. |
| 07:24 | TEttinger | is there any way to get clojure to AOT compile an application but not AOT-compile a library it require-s? |
| 07:26 | TEttinger | I seem to be encountering an odd bug in a lib I am using (hiphip, https://github.com/Prismatic/hiphip ) related to the use of (load "anothernamespace") in AOT'ed code |
| 08:00 | Glenjamin | Hi guys, I'm trying to add new relic to my clojure app running on heroku as an uberjar - but i can't figure out how to get the jar up there so i can start up with -javaagent |
| 08:01 | Glenjamin | Can anyone point me in the right direction? |
| 08:17 | ker2x_ | friendly greetings \o/ |
| 08:19 | ker2x_ | i'm learning clojure, i discovered condition-map (awesome) and i found that we can overload a fonction on arity, now the question is : can we define a condition map for each overloaded fonction ? |
| 08:21 | llasram | ker2x_: At least according to http://clojure.org/special_forms yes. |
| 08:22 | ker2x_ | this is the definition that say yes ? (fn name? ([params* ] condition-map? exprs*)+) |
| 08:24 | ker2x_ | well, that make sense now. thank you :) |
| 08:26 | hyPiRion | ,(let [f (fn ([a] {:pre [(integer? a)]} (+ a 10)) ([a b] {:pre [(integer? a) (integer? b)]} (+ a b)))] [(f 1 2) (f 1)]) |
| 08:26 | clojurebot | [3 11] |
| 08:26 | hyPiRion | so yes |
| 08:30 | ker2x_ | thank you. i tested something else on try clojure, overloading with same arity but different condition-map, doesn't work. :) |
| 08:31 | ker2x_ | (defn diviser ([a b] "divide a with b" {:pre [(not= b 0)]} (/ a b)) ([a b] {pre [(= b 0)]} (println "nope") )) java.lang.RuntimeException: Can't have 2 overloads with same arity |
| 08:32 | hyPiRion | Yeah, preconditions aren't guards in that sense |
| 08:32 | ker2x_ | that could have been fun :) |
| 08:33 | ker2x_ | but not realistic. :) |
| 08:33 | snake-john | emacs users question: I spot a function in the middle of the screen with my eyes. I want to jump to the source with M-.. But to reach the function i have to type M-f many times. and then finally M-. to reach the source. how can I short this up? |
| 08:34 | Glenjamin | ctrl+r functionname ? |
| 08:36 | snake-john | yes that turbos my navigation thanks! I hope I won't forget |
| 08:45 | snake-john | I sometimes get exceptions like clojure.core.async$eval10960.invoke (NO_SOURCE_FILE:2) . Why isn't the source-file and therefore the line-number known? I for sure loaded the macro which causes the exception from a.clj file…. |
| 08:45 | ker2x_ | i'm at ~60% of "clojure in action" :) |
| 08:47 | hyPiRion | snake-john: because the function was most likely generated at runtime, meaning it has no source |
| 08:47 | hyPiRion | You should print the entire stack trace to get where it crashed |
| 08:50 | snake-john | yes your absolutely right the macro generates a function that's then executed…. unfortunately the nrepl shows only 20 lines of stack trace and no other namespace of my source files show up |
| 08:51 | snake-john | how do I print the entire stack trace? |
| 08:53 | hyPiRion | (pst) in the repl, or a (try (some-expressiin-here) (catch Exception e (.printStackTrace e))) within the code |
| 08:53 | hyPiRion | I'd recommend the first one, if you're running in the repl |
| 09:02 | snake-john | ok thanks I tried try-catch but still getting not enough information in the stack traces… I think because the error happens while the macro is being parsed… anyway I will find the error |
| 09:12 | snake-john | Has anybody looked at the source of https://github.com/clojure/core.async? Theres a function emit-state-machine wich produces a state-machine fn. I would love to see the source of this on the fly geared fn. But cannot find a way to print it out? |
| 09:13 | snake-john | I meant on the fly generated fn |
| 09:19 | foolano | hi |
| 09:21 | foolano | say i have a function foo that returns something, what's the idiomatic way to populate a list of size n by calling foo() n times? |
| 09:21 | llasram | snake-john: macroexpand perhaps? |
| 09:22 | llasram | foolano: `repeatedly`? |
| 09:22 | sandhu | (repeatedly n foo) |
| 09:22 | sandhu | http://clojuredocs.org/clojure_core/clojure.core/repeatedly |
| 09:23 | foolano | awesome. Thank you! |
| 09:26 | xsyn | Can anybody tell me why this doens't work: |
| 09:26 | xsyn | https://gist.github.com/anonymous/6098526 |
| 09:27 | hyPiRion | xsyn: what would you like (name (keys data)) to do? |
| 09:29 | llasram | Although that's the proximate problem (for [id [user-list] ...] ...) itself looks somewhat confused |
| 09:31 | snake-john | @llasram thanks I finally achieved it with (map #(clojure.pprint/pprint %) (seq (emit-statemachine …)) |
| 09:35 | llasram | Cool beans |
| 09:35 | llasram | snake-john: FYI, in IRC, you usually just refer to people's nicks to reference them. No @-prefix required |
| 09:37 | snake-john | ok thank you for telling me! I did not know thanks |
| 09:48 | xsyn | hyPiRion: I'd like it to return a strong of the keys from the dat map |
| 09:48 | xsyn | and compare them against the id's in the user-list |
| 09:53 | xsyn | hyPiRion: At a higher level I'm trying to manipulate the data into a specific form so that I can render it nicely with d3 |
| 09:54 | xsyn | I'm a clojure noob, and it's made me a bit unstuck |
| 09:54 | xsyn | because I'm pretty sure what I'm doing is more hacky than idiomatic |
| 09:54 | hyPiRion | okay, I assume the user-list is a list of ids, where all ids are strings? |
| 09:55 | hyPiRion | like, ["foo" "bar" "baz"] |
| 09:55 | xsyn | user list is an array of maps |
| 09:55 | xsyn | ala |
| 09:55 | xsyn | {:last_name Lubowitz, :crypted_password $2a$10$mzQup4i4rQbrSu4qphSUBuHIzguT6mOFvu8HRlTH56fnd/Y/7/TGq, :updated_at #<DateTime 2013-07-28T11:31:05.491Z>, :username tawannalubowitz, :created_at #<DateTime 2013-07-28T11:31:05.491Z>, :email tawanna@acme.inc, :_id #<ObjectId 51f500f9c2e64bb14589bbd7>, :first_name Tawanna, :activation_code_created_at #<DateTime 2013-07-28T11:31:05.489Z>, :department DevOps, :role user, :activation_code 6d0d2 |
| 09:56 | hyPiRion | ah, okay |
| 09:56 | xsyn | and data looks like this |
| 09:57 | xsyn | {:_id #<ObjectId 51f50026c2e64bb14589bbb1>, :51f50433c2e6566054df2e31 {:inf3 aldo@acme.inc, :adv1 aldo@acme.inc, :adv2 aldo@acme.inc, :adv3 aldo@acme.inc, :trt2 aldo@acme.inc, :trt3 aldo@acme.inc, :email guy@cloudafrica.net, :trt1 aldo@acme.inc, :department Human Resources, :inf2 aldo@acme.inc, :inf1 aldo@acme.inc}, :51f179e1e508cd7cc7fa6330 {:inf3 aldo@acme.inc, :adv1 aldo@acme.inc, :adv2 casey@acme.inc, :adv3 dorie@acme.inc, :trt2 b |
| 09:57 | xsyn | see there is the key :51f50433c2e6566054df2e31 |
| 09:57 | xsyn | I'm trying to get that, turn it into a string |
| 09:57 | xsyn | and then map that id against the id's in user-list |
| 09:58 | hyPiRion | ah, ok |
| 10:00 | xsyn | but the problem is actually casting (name (keys data)) |
| 10:03 | llasram | I think you have other problems, but for that particular issue -- `keys` returns a *sequence* of map keys, while `name` expects a *single* `Named` object |
| 10:03 | llasram | If that were the only problem, `(map name (keys data))` might be what you were looking for |
| 10:07 | xsyn | llasram: Yeah, I'm just getting to see that |
| 10:07 | xsyn | what is the best way to match an id on a keyword? |
| 10:07 | xsyn | or is my entire approach to this wrong? |
| 10:09 | hyPiRion | xsyn: I just quickly wrote this, may be of help https://www.refheap.com/16993 |
| 10:10 | hyPiRion | where convert-to-string converts the ObjectId to a string |
| 10:10 | hyPiRion | (I also tried to make it clojure-friendly, not sure if I succeeded at that) |
| 10:10 | hyPiRion | *new-to-clojure-friendly |
| 10:12 | xsyn | you and me both :) |
| 10:17 | xsyn | hyPiRion: Thank you, that'll go a long way |
| 10:20 | xsyn | I need to start hanging out here more, maybe I'll learn something |
| 10:25 | hyPiRion | xsyn: you certainly will if you stay here long enough :) |
| 11:00 | Somelauw | Lol, I wrote my first chess program. It can backtrack 2 moves (so one move for black, one move for white) before slowdown explodes. |
| 11:00 | Somelauw | I didn't do any optimization yet. |
| 11:01 | hyPiRion | Somelauw: heh, you should have a look at alpha-beta pruning |
| 11:01 | hyPiRion | Slowdown's still going to be horrible though, but at least you can potentially go one move further |
| 11:02 | Somelauw | hyPiRion: I will try that. |
| 11:12 | Somelauw | that can only be implemented using reduce |
| 11:14 | hyPiRion | Somelauw: yeah, I did it for one of my projects for university |
| 11:15 | hyPiRion | Somelauw: https://github.com/hyPiRion/snigilbot/blob/master/src/snigil/players/minimax.clj#L71-L93 |
| 11:16 | Somelauw | no, it can't be implemented using a simple, reduce, because it has to break immediately as sson as it found a bad value |
| 11:16 | Somelauw | hyPiRion: I'll take a look at it |
| 11:16 | Somelauw | maybe this is one of the things that is easier to express imperatively than functionally |
| 11:16 | hyPiRion | Somelauw: You can use reduced |
| 11:17 | hyPiRion | which short-circuits the reduce |
| 11:19 | hyPiRion | Oh, mind you, I'm not keeping track of the optimal path. I just save the first move, not all of them. |
| 11:24 | Somelauw | I can't find examples of reduced and it's doc is short. |
| 11:25 | Somelauw | ,(reduce (fn[a b] (if (= b 3) (reduced 3)) b)(range 6)) |
| 11:25 | clojurebot | 5 |
| 11:25 | bbloom | ,(reduce (fn[a b] (if (= b 3) (reduced 3) b))(range 6)) |
| 11:25 | clojurebot | 3 |
| 11:25 | bbloom | you've got a misplaced paren |
| 11:26 | Somelauw | oh, yeah, I was experimenting in lein repl, so I had to type them manually :P |
| 11:26 | sdegutis | ,(reduce + [1 2 3]) ; /cc Somelauw |
| 11:26 | clojurebot | 6 |
| 11:27 | sdegutis | ,(reduce conj [[1] [2] [3]]) ; /cc Somelauw |
| 11:27 | clojurebot | [1 [2] [3]] |
| 11:27 | sdegutis | hmm maybe that actually makes it *more* confusing |
| 11:27 | Somelauw | try cons |
| 11:27 | Somelauw | ,(reduce cons [[1] [2] [3]] |
| 11:27 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 11:28 | Somelauw | in some language that worked |
| 11:28 | sdegutis | ,(reduce cons [[1] [2] [3]]) |
| 11:28 | clojurebot | (([1] 2) 3) |
| 11:28 | Somelauw | but I've never seen reduced in another language |
| 11:29 | sdegutis | Somelauw: its just reduce |
| 11:29 | Somelauw | it's like some magic break statement |
| 11:29 | sdegutis | nope |
| 11:29 | sdegutis | it calls the fn with the first and second elements, takes the result, and calls it with that plus the next element, etc |
| 11:30 | hyPiRion | sdegutis: reduced, not reduce |
| 11:30 | sdegutis | ,reduced |
| 11:30 | clojurebot | #<core$reduced clojure.core$reduced@575e7e> |
| 11:30 | sdegutis | oh |
| 11:30 | sdegutis | ,(doc reduced) |
| 11:30 | clojurebot | "([x]); Wraps x in a way such that a reduce will terminate with the value x" |
| 11:30 | sdegutis | whoa |
| 11:30 | r0bgleeson | o_O |
| 11:30 | bbloom | Somelauw: reduced is a common trick, however |
| 11:30 | r0bgleeson | never seen that before |
| 11:30 | sdegutis | what.. how... but... |
| 11:30 | Somelauw | sdegutis: that's what I was thinking as well |
| 11:31 | bbloom | sdegutis: the reduce function just checks for (instance? Reduced ...) |
| 11:31 | bbloom | and if it finds it, then it bails |
| 11:31 | hyPiRion | you can e.g. implement every? with it |
| 11:31 | bbloom | it's super useful :-) |
| 11:31 | r0bgleeson | bbloom: i'm clojure newb, but can't you just return early or break from reduce() without that? |
| 11:32 | bbloom | r0bgleeson: no, there is no "break" |
| 11:32 | hyPiRion | (defn every? [pred coll] (reduce (fn [_ b] (or (pred b) (reduced false))) coll)) |
| 11:32 | hyPiRion | well actually, that's a wrong implementation, but you get the idea |
| 11:32 | bbloom | r0bgleeson: are you coming from Ruby? or somewhere else? |
| 11:33 | bbloom | if you're coming from ruby, you're probably familiar with break vs return and procs vs lambdas, right? |
| 11:33 | r0bgleeson | bbloom: yup, Ruby. |
| 11:33 | r0bgleeson | yeah |
| 11:33 | sdegutis | no i dont actually |
| 11:33 | sdegutis | can someone please do a real world example of reduced? |
| 11:33 | Somelauw | sdegutis: alpha beta pruning probably |
| 11:33 | bbloom | sdegutis: just think of it like (reduce-until pred ...) |
| 11:34 | bbloom | only the pred is not an arg |
| 11:34 | bbloom | r0bgleeson: http://journal.stuffwithstuff.com/2013/01/13/iteration-inside-and-out/ |
| 11:34 | r0bgleeson | bbloom: all it does i return an instance of "Reduced", which reduce() detects and breaks from? |
| 11:34 | bbloom | r0bgleeson: precisely |
| 11:34 | r0bgleeson | thanks |
| 11:34 | bbloom | http://journal.stuffwithstuff.com/2013/02/24/iteration-inside-and-out-part-2/ |
| 11:36 | hyPiRion | bbloom: hmm, do you think there could be a performance increase by implementing some, every? and friends with reduce/reduced? |
| 11:36 | jonasen | bbloom: I saw you guys made progress on fipp with rrb-vector -- awesome! |
| 11:36 | r0bgleeson | bbloom: thank you |
| 11:36 | jonasen | bbloom: what's the next step for cljs-fipp? |
| 11:36 | bbloom | hyPiRion: so not really for "some", since it returns the first success, it's naturally linear |
| 11:37 | bbloom | hyPiRion: but every? etc could probably benefit from reduce for *large* input |
| 11:37 | bbloom | "some" is linear, but a hypothetical "some?" could be a monoid parallelizable by reduced |
| 11:38 | bbloom | s/reduced/reduce/ |
| 11:38 | bbloom | jonasen: https://github.com/brandonbloom/fipp/issues/7 |
| 11:39 | bbloom | transduce should be trivial to port |
| 11:39 | bbloom | it's probably < 1 day for me to get good cljs fipp, but i don't personally have a use for it & have a ton of other irons in the fire :-) |
| 11:39 | jonasen | I could try to port transduce |
| 11:40 | jonasen | and then I can look at what's next (I have a use case for cljs pprint :-) |
| 11:41 | hyPiRion | bbloom: Hm, I thought the speedup from different CollReduce extensions would speed it up somewhat for large colls, but perhaps the overhead for smaller collections is too significant. |
| 11:42 | bbloom | hyPiRion: hmm, you may be right. i don't know what the overhead of reduced is |
| 11:42 | bbloom | i guess it would bypass the lazy sequences, which may help |
| 11:42 | bbloom | it's trivial to try, you can write a foldable every? function in 1 minute |
| 11:42 | bbloom | let me know what you get! :-) |
| 11:43 | hyPiRion | oh, hahah. Alright, I'll have a shot at it |
| 11:43 | bbloom | here, i'll write your monoid for you: #(and %1 %2) |
| 11:43 | bbloom | done. |
| 11:43 | bbloom | :-) |
| 11:43 | bbloom | er and the unit value is true |
| 11:43 | hyPiRion | yeah |
| 11:43 | bbloom | and is already a monoid, but since it's a macro, you can't use it as such |
| 11:58 | Somelauw | Well, my code did become faster (but not smarter because I probably made an error somewhere). |
| 12:03 | Somelauw | next step. Parallelizing the reduce and enabling strict type interference? |
| 12:15 | sontek | how easy is it to re-use java libraries within Clojure? So, for instance, could I use the cassandra java library? Or do I have to use a clojure specific lib? |
| 12:15 | bbloom | extremely easy |
| 12:16 | bbloom | http://clojure.org/jvm_hosted |
| 12:16 | bbloom | http://clojure.org/java_interop |
| 12:17 | hyPiRion | oh darn, totally forgot about lein and its jvm speedup tricks |
| 12:33 | hyPiRion | bbloom: https://www.refheap.com/3b18fa584237430760c7cd1d5 -- obviously not conclusive, but it seems valuable to peek into it at least |
| 12:33 | hyPiRion | (using latest criterium for benchmarking) |
| 12:38 | clj_newb_2345 | anyone having problems with core.async |
| 12:38 | clj_newb_2345 | where it claims that a socket is closed |
| 12:38 | clj_newb_2345 | the channel is never explicity closed ? |
| 12:38 | clj_newb_2345 | s/the channel/yet the channel/ |
| 12:41 | hyPiRion | Now I just need to figure out how to benchmark that implementation properly. Any core devels out there which knows what is required (how to benchmark) to get a performance improvement patch into core? |
| 12:47 | dward | has anyone ever used lamina or aleph? |
| 12:48 | clj_newb_2345 | yes |
| 12:48 | clj_newb_2345 | I played with it for a bit while trying to do websockets with clojure |
| 12:48 | clj_newb_2345 | I ended up concluding I was about 20 IQ point short of really understanding it. |
| 12:48 | dward | how was the preformance? |
| 12:48 | dward | haha |
| 12:48 | clj_newb_2345 | oh, I never measured performance. |
| 12:49 | clj_newb_2345 | I just wanted a real time editor |
| 12:49 | clj_newb_2345 | a real time collaborative editor |
| 12:49 | clj_newb_2345 | that was it |
| 12:49 | dward | cool, ya it's got a lot of stuff |
| 12:49 | bbloom | hyPiRion: lemme see... |
| 12:50 | bbloom | hyPiRion: killer! |
| 12:51 | dward | lucene IndexWriters and IndexReaders are threadsafe, I want to strap lamina up to a dataflow, index it with lucene, and run bayesian inference to do deduplication |
| 12:51 | dward | or maybe I will strap it directly to elasticsearch |
| 12:51 | bbloom | hyPiRion: what about small collections? |
| 12:51 | bbloom | < arraymap & vector sized. so like 5 to 25 or so |
| 12:52 | dward | if lamina preforms how it says it does, i think it would be awesome, but i'm worried |
| 12:52 | bbloom | hyPiRion: i believe reducers have a cutoff, so presumably that should just switch to a normal loop |
| 12:56 | hyPiRion | bbloom: running on it now. Still seems faster on average for all cases, but keep in mind I'm only doing vectors now |
| 12:56 | hyPiRion | And now I have to do an errand, so I'll be back later. |
| 12:56 | bbloom | hyPiRion: yeah, seqs would naturally be linear anyway |
| 12:56 | hyPiRion | yeah |
| 13:05 | clj_newb_2345 | dumbass question: in http://clojure.github.io/core.async/ how does alt! and alts! differ? |
| 13:06 | bbloom | clj_newb_2345: alt! is like a switch statement (static branches) and alts! is like a map lookup (dynamic branches) |
| 13:09 | clj_newb_2345 | bbloom: do you have an exmaple of alts! doing something cool? |
| 13:10 | clj_newb_2345 | bbloom: alt! = sleect from posix right? |
| 13:10 | clj_newb_2345 | s/sleect/select |
| 13:10 | bbloom | clj_newb_2345: iirc, posix alts takes an array of handles to wait on, right? |
| 13:10 | bbloom | in that case, it's more similar to alts! |
| 13:10 | clj_newb_2345 | bbloom: and they return one with of them has a msg |
| 13:10 | clj_newb_2345 | bbloom: which sounds like core.async's alt! |
| 13:12 | bbloom | clj_newb_2345: alt! is a macro, alts! is a function |
| 13:13 | bbloom | the select keyword in Go is like alt! and the reflect.Select function is like alts! |
| 13:13 | bbloom | it's statically known set of channel ops vs dynamic set |
| 14:16 | sontek | You guys are beautiful unique snowflakes |
| 14:33 | jonasen | bbloom: https://github.com/jonase/transduce/compare/cljs |
| 14:34 | seangrove | Trying to run the script/test for the clojurescript repo, getting Exception in thread "main" java.lang.RuntimeException: No reader function for tag queue, compiling:(/Users/sgrove/code/tmp/clojurescript/bin/cljsc.clj:1720) on the master branch |
| 14:35 | bbloom | jonasen: cool! whenever you're ready, send over a pull request. I'll likely merge it with no-to-few changes when i get some time to test it out in the next day or two |
| 14:36 | jonasen | bbloom: ok |
| 14:36 | seangrove | Ok, something strange going on with that error, disregard it for now |
| 14:37 | bbloom | jonasen: if you want to keep going with your adventure, michalmarczyk's rbb fork/branch is the basis to use |
| 14:37 | bbloom | jonasen: i'll probably merge his rbb branch once he makes the relevant optimizations to clojure.rrb-vector |
| 14:38 | jonasen | bbloom: I'll take a look at that next. |
| 14:39 | bbloom | jonasen: also, i'd just hard-code the various concrete types for IPretty for now |
| 14:39 | bbloom | jonasen: you'll just need to grep core.cljs for the various concrete type names and put those into the extend-protocol macro. |
| 14:39 | bbloom | otherwise, we'll need to wait for dnolen and cemerick on CLJS-527 :-) |
| 14:41 | justin_smith | sontek: ❄ |
| 14:41 | bbloom | jonasen: thanks for taking this project on :-) |
| 14:42 | jonasen | bbloom: thanks for your guidance! |
| 14:42 | bbloom | jonasen: you're free work for me. guidance is the minimum payment i can provide! |
| 14:42 | bbloom | you're DOING free... |
| 14:42 | bbloom | i accidentally a word |
| 15:12 | clj_newb_2345 | when developing a clojure app which fires off events when a key is being held down, |
| 15:12 | clj_newb_2345 | what should the time sampling be? |
| 15:12 | clj_newb_2345 | 10 ms? 100 ms? |
| 15:14 | justin_smith | clj_newb_2345: maybe the better question to ask is what is a reasonable rate for updates from input - and then work back from that, no need to produce events faster than updates are needed |
| 15:14 | justin_smith | if the results are audio, you get one answer, if it is moving images, another |
| 15:16 | seangrove | I must be doing something strange - http://search.maven.org/remotecontent?filepath=org/clojure/tools.reader/0.7.5/tools.reader-0.7.5.jar doesn't seem to be a valid jar file |
| 15:16 | seangrove | Is that not the right place to download the jar? |
| 15:45 | seangrove | Bronsa: Have a question for you re: tools.reader |
| 15:47 | seangrove | Looks like you say that clojure.land.LispReader will read ":foo/bar/baz" and tools.reader will throw an error |
| 15:47 | seangrove | The cljs core test suite actually tests that the reader is able to read symbols with two /'s: https://github.com/clojure/clojurescript/blob/master/test/cljs/cljs/core_test.cljs#L204 |
| 15:48 | seangrove | Is the test wrong so that I should update it, or am I misunderstanding? |
| 16:13 | konr`` | Is there a way to macroexpand hiding the fully qualified names? The output of macroexpand-1 is quite illegible |
| 16:14 | alandipert | konr``: one thing you can do is (require 'clojure.pprint) and (pprint (macroexpand...)) |
| 16:14 | alandipert | konr``: err, (require '[clojure.pprint :refer [pprint]) that is |
| 16:14 | alandipert | konr``: or really, at the repl, just (use 'clojure.pprint). phew. |
| 16:17 | konr`` | alandipert: a good use for this old friend! |
| 16:20 | clj_newb_2345 | is there any open source alternative to datomic? |
| 16:22 | bbloom | clj_newb_2345: it's too awesome. anybody who understands how awesome it is would feel too bad competing with rich. everybody else is clueless ;-) |
| 16:23 | clj_newb_2345 | bbloom: why are you always one step ahead of my thought process? |
| 16:23 | technomancy | clj_newb_2345: you can implement value-driven workflows in databases with more pleasant licenses, they just don't work that way by default |
| 16:27 | clj_newb_2345 | what odes "paid perpeutual" mean? |
| 16:27 | clj_newb_2345 | for license, does it mean it's not a monthly fee? |
| 16:28 | clj_newb_2345 | alright, what's a good datomic tutorial? |
| 16:28 | konr`` | clj_newb_2345: there is one in datomic's website |
| 16:28 | konr`` | clj_newb_2345: the 'getting started' http://docs.datomic.com/getting-started.html |
| 16:29 | technomancy | there is also a separate #datomic channel |
| 16:29 | clj_newb_2345 | konr``: nice, thanks |
| 16:29 | clj_newb_2345 | technomancy: noted |
| 16:29 | technomancy | clj_newb_2345: are you going to change your nick when you get better at clojure? |
| 16:29 | konr`` | clj_newb_2345: and a more thorough here: http://docs.datomic.com/ |
| 16:29 | clj_newb_2345 | technomancy: yeah, I'll change it to 2346 when I understand datomic |
| 16:30 | technomancy | former-clj-newb isn't taken |
| 16:30 | technomancy | heh |
| 16:37 | callen | these benchmarking results for Selmer are sensational |
| 16:37 | callen | it's keeping pace with Stencil and Mustache.clj |
| 16:37 | callen | a massive upgrade from Clabango. |
| 16:38 | callen | https://gist.github.com/bitemyapp/6100049 |
| 16:51 | dark_element | Is there any way I can destructure fields in deftype? https://www.refheap.com/16997 |
| 16:54 | vraid | i want to include a jar called "mt4j-desktop.jar", placed in a local repository found by lein, but i can't figure out how the :dependencies http://en.wikipedia.org/wiki/Special:Search?go=Go&search=_ has to look, any directions? |
| 16:57 | vraid | dependencies [[ _ ]] .. |
| 16:58 | gfredericks | vraid: it's in your local maven repo under ~/.m2? |
| 17:06 | justin_smith | you should be able to open the jar and look at the project.clj - there is probably an automatic translation from the directory structure too but I am less sure of how that works |
| 17:06 | justin_smith | a jar is basically just a zip file |
| 17:07 | vraid | gfredericks: it's in a folder in the project |
| 17:07 | Raynes | It is exactly just a zip file. It just has metadata. |
| 17:08 | sdegutis | woo im successfully lurking on irc |
| 17:12 | gfredericks | vraid: so what did you mean by "placed in a local repository found by lein"? |
| 17:12 | gfredericks | did you mean you _want_ to place it in one, or that it's already there? |
| 17:12 | vraid | the jar is there |
| 17:13 | gfredericks | are you trying to deploy it to the local repo on that machine? |
| 17:13 | vraid | but i trip on adding it to the project file, i'm not sure what to name it |
| 17:13 | vraid | ah wait, i have to process the jar file first? |
| 17:13 | nDuff | vraid: did you add it manually, or was it imported by a Maven-compatible tool? |
| 17:14 | gfredericks | what makes you think that lein will find it just because it's in a folder in the project? |
| 17:14 | nDuff | vraid: if the latter, its coordinates would already be in that tool. |
| 17:14 | gfredericks | yes typically you will manually deploy it to your local repo (in ~/.m2) |
| 17:14 | gfredericks | which involves picking the group-id, artifact-id, and version |
| 17:15 | gfredericks | depending on where this jar came from there might be an appropriate choice that you can discover by unzipping the jarfile and looking at a pom.xml or project.clj or something |
| 17:15 | gfredericks | but you might also be able to get away with making something up |
| 17:16 | gfredericks | nDuff: can't `lein deploy` handle this now? |
| 17:16 | gfredericks | I thought I saw that mentioned somewhere |
| 17:16 | git_ | well thats all folks |
| 17:16 | git_ | ht tp://ww w.youtube.com/watch?feature=player_detailpage&v=ZQAjJAvLtZA |
| 17:16 | nDuff | gfredericks: probably. Haven't tracked clrosely. |
| 17:16 | git_ | http://www.youtube.com/watch?feature=player_detailpage&v=ZQAjJAvLtZA |
| 17:16 | git_ | :) |
| 17:16 | vraid | everything feels so gimped on windows |
| 17:17 | nDuff | ...who the heck has a spambot emit a typo'd version of its URL before the correct one? |
| 17:17 | nDuff | Huh. |
| 17:17 | nDuff | (exact same typo elsewhere as well) |
| 17:17 | justin_smith | I figured he was just alluding to the fact that it was time for him to go to church |
| 17:17 | vraid | nDuff: automatic join, manual text |
| 17:20 | justin_smith | sdegutis: excellent example of apophasis |
| 17:24 | sdegutis | git_ uhh |
| 17:46 | vraid | nDuff, gfredericks: okay, i've got maven up and working now |
| 17:47 | danlarkin | anyone have thoughts on bishop and/or liberator? |
| 17:47 | gfredericks | $google mvn install-file |
| 17:47 | lazybot | [Maven Install plugin - Usage] http://maven.apache.org/plugins/maven-install-plugin/usage.html |
| 17:47 | gfredericks | vraid: ^ docs on the command you'll want |
| 17:48 | vraid | many thanks |
| 17:49 | kmicu | bishop early on f4 |
| 17:52 | danlarkin | haha |
| 17:52 | danlarkin | not quite what I meant |
| 17:55 | gfredericks | opposite colored bishop endgames are drawish |
| 18:14 | vraid | gfredericks: finally got it, thanks |
| 18:14 | gfredericks | vraid: w00t |
| 18:15 | vraid | apparently maven doesn't work in powershell |
| 18:15 | vraid | took me 20 minutes to figure that out |
| 18:16 | gfredericks | I certainly couldn't've told you that |
| 18:17 | clojurenewb | hey guys… I'm confused… how can I add a 'distinct' as the last step in a thread last macro ? |
| 18:17 | technomancy | gfredericks: yeah, you don't need mvn install:install-file any more |
| 18:17 | vraid | do i add the .m2/repository to the project file? |
| 18:18 | gfredericks | vraid: no it should be looking there automatically |
| 18:18 | gfredericks | you just need to add the artifact to :dependencies using the appropriate group/artifact/version |
| 19:31 | seangrove | dnolen: Could use some help running the cljs test suite when you're around |
| 19:42 | onr | http://clojurekoans.com/ |
| 19:44 | egghead | CLJS |
| 19:44 | egghead | is a lot of fun :) |
| 19:47 | dnolen | seangrove: what's up? |
| 19:51 | seangrove | dnolen: How can I set the print-fn while running the tests? I finally got them half-way running, but they're bailing out with: Error: No *print-fn* fn set for evaluation environment |
| 19:51 | seangrove | How do you kick off the test suite? |
| 19:51 | dnolen | seangrove: ./script/tests |
| 19:51 | dnolen | seangrove: you shouldn't have to set print-fn |
| 19:55 | seangrove | dnolen: Then I guess this patch may have caused more havok than I realized |
| 19:55 | seangrove | Where is *print-fn* set when running test? I run V8_HOME=/opt/boxen/homebrew/bin script/test and get the error |
| 19:58 | dnolen | seangrove: in test/cljs/test_runner.cljs |
| 20:02 | seangrove | dnolen: Alright, then this is a bit baffling. I'll keep going through it. |
| 20:02 | seangrove | Thanks for the heads up |
| 20:05 | clj_newb_2345 | anyone familiar with statistical profiling on clojure? |
| 20:06 | clj_newb_2345 | I have this system, whose cpu usage, according to "top", just umped from 10% to 30% |
| 20:06 | clj_newb_2345 | I'd love to know why |
| 20:08 | callen | I use jvisualvm and yourkit. |
| 20:09 | nDuff | (YJP == YourKit) |
| 20:09 | clj_newb_2345 | better than visual vm? |
| 20:09 | clj_newb_2345 | hmm |
| 20:09 | clj_newb_2345 | time to try both |
| 20:09 | callen | clj_newb_2345: yourkit is more "industrial", visualvm is nicer to use. |
| 20:09 | clj_newb_2345 | which is more powerful? |
| 20:09 | clj_newb_2345 | I want vim, not notepad :-) |
| 20:10 | clj_newb_2345 | I want the most powerful one |
| 20:10 | clj_newb_2345 | learning curves be damned :-) |
| 20:10 | callen | well yourkit is commercial |
| 20:10 | callen | a couple hundred dollars I think |
| 20:10 | callen | visualvm is free |
| 20:11 | clj_newb_2345 | err, I'm a grad student |
| 20:11 | clj_newb_2345 | I can't afford yourkit |
| 20:11 | clj_newb_2345 | that was easy to decide |
| 20:11 | callen | lol. |
| 20:12 | callen | so much for using the more powerful tool. |
| 20:12 | clj_newb_2345 | is yourkit more powerful? |
| 20:12 | dnolen | seangrove: I'm willing to help out, but the there seem to be classpath issues with tools.reader |
| 20:12 | callen | clj_newb_2345: what do you suppose "industrial" meant? |
| 20:12 | clj_newb_2345 | provides support and hand holding |
| 20:12 | clj_newb_2345 | and consultants |
| 20:12 | dnolen | seangrove: which what I'm concerned about, ./script/repl and try to require tools.reader doesn't work |
| 20:12 | clj_newb_2345 | maybe drinks + dinners at bars if you're in charge of sales |
| 20:13 | Raynes | clj_newb_2345: If you need yourkit for an open source project you can get a free license key as long as you mention yourkit in the README or something. |
| 20:13 | clj_newb_2345 | it's research |
| 20:13 | clj_newb_2345 | not open source |
| 20:19 | seangrove | dnolen: Yeah, got that working. The problem was I was downloading a bad jar for tools.reader. I wasn't able to run the tests before though (CLOJURESCRIPT_HOME was pointing somewhere random from last year when I first got into cljs), and now that I have the tests running, there are a few broken ones |
| 20:21 | dnolen | seangrove: ok, sounds like you've got a handle on it then. |
| 20:21 | seangrove | dnolen: Yeah, do have a question around the symbols though |
| 20:21 | dnolen | seangrove: what's up? |
| 20:22 | clj_newb_2345 | damn it |
| 20:22 | clj_newb_2345 | yourkit is not giving me my free evalutain key |
| 20:22 | clj_newb_2345 | it must be like "we can detect over the internet that you are poor, so no 15 day evaluation for you" |
| 20:22 | seangrove | The new reader throws an error on e.g. (name ':foo/bar/baz), which is expected from the readme, but there's a test in core_test.cljs that asserts that it should be alright https://github.com/clojure/clojurescript/blob/master/test/cljs/cljs/core_test.cljs#L204 |
| 20:22 | seangrove | You can see the ntoe about the difference here: https://github.com/clojure/tools.reader#differences-from-lispreaderjava |
| 20:23 | seangrove | Just wondering which is right |
| 20:25 | dnolen | seangrove: probably something to bring up with Bronsa - personally I think tools.reader should probably allow the edge cases that the standard reader allows. |
| 20:26 | seangrove | dnolen: Yeah, messaged him a bit ago, sounds like it's not clearly decided yet |
| 20:27 | clj_newb_2345 | dumb question: what java functions lets me do statistical sampling on my own? |
| 20:28 | squidz | what kind of sampling? |
| 20:28 | clj_newb_2345 | statisticall sampling |
| 20:28 | clj_newb_2345 | I want to know what the stack frames of threads |
| 20:31 | Bronsa | seangrove: dnolen the doc at http://clojure.org/reader explicitely says that symbols (and thus keywords) can only contain one '/' in the middle of the name, I follwed that |
| 20:33 | dnolen | Bronsa: yes, question is whether tools.reader should be eager about errors around such things |
| 20:33 | dnolen | seangrove: in anycase it's a small thing, feel free to change those tests to remove extraneous slashes |
| 20:34 | dnolen | seangrove: in your updated patch (also when you put a new patch please squash and delete the old one) |
| 20:36 | seangrove | dnolen: Will do |
| 20:37 | seangrove | dnolen Bronsa: Another question then around tagged literal support |
| 20:37 | seangrove | Looks like tools.reader doesn't provide an implementation for #queue, but there are a few tests around that https://github.com/clojure/clojurescript/blob/master/test/cljs/cljs/core_test.cljs#L1720 |
| 20:38 | seangrove | Well, two |
| 20:38 | Bronsa | seangrove: clojure doesn't either, AFAIK it's a clojurescript specific thing |
| 20:38 | Bronsa | the ticked on CLJ hasn't been merged yet |
| 20:40 | Bronsa | seangrove: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/compiler.clj#L757 |
| 20:41 | dnolen | seangrove: but I'm assuming you can work around this? |
| 20:41 | Bronsa | sure |
| 20:41 | Bronsa | just change that to r/*data-readers* cljs/*data-readers* |
| 20:41 | Bronsa | (assuming r == clojure.tools.reader) |
| 20:42 | seangrove | Ok, sounds good, I'll give that a try |
| 20:43 | dnolen | seangrove: Bronsa: thx! |
| 20:43 | Bronsa | seangrove: remember that tools.reader doesn't use clojure.core/{*default-data-reader-fn* *read-eval* *data-readers*} you have to use the tools.reader/whatever equivalent |
| 20:43 | Bronsa | that was for backward compatibility I think |
| 20:44 | Bronsa | yeah. for clojure-1.3.0 compatibility |
| 20:44 | seangrove | Bronsa: Maybe you can check over the patch in a bit to see if there are any glaring omissions? |
| 20:45 | Bronsa | sure |
| 20:53 | bbloom | ok data structures experts…. if i use subseq on a sorted-map… does that prevent all / part / none of the unselected branches of the tree from being garbage collected? |
| 20:55 | sdegutis | i wonder, is it possible to start up a JVM from C and pass data and call functions back and forth? |
| 20:55 | sdegutis | but initiating it all from the C side? |
| 20:55 | sdegutis | i wanna add Clojure scripting to this Mac app |
| 20:56 | Bronsa | bbloom: it wouldn't look so |
| 20:56 | bbloom | Bronsa: really? i thought the opposite from a cursory glance at PersistentTreeMap.java |
| 20:57 | bbloom | but maybe i'm reading this wrong... |
| 20:57 | Bronsa | bbloom: I just quickly glanced at seqFrom but it looks to me like it's just creating a Seq out of the remaining nodes |
| 20:58 | bbloom | Bronsa: that was my first thought too, but keep digging, it's more subtle than that |
| 20:58 | bbloom | it's producing a stack that represents some spine of the tree & then traversing the tree along that spine |
| 20:58 | bbloom | check out `static public class Seq` |
| 20:59 | Bronsa | blargh, I assumed Seq was a simple Cons |
| 20:59 | bbloom | nope, it's effectively a closure :-) |
| 21:01 | bbloom | but the implementation has both val & branch nodes for both red & black, so conceivably this is only putting value nodes in for the subset of the tree that would be outside of the subseq |
| 21:01 | bbloom | also, compare: |
| 21:01 | bbloom | (doc subvec) |
| 21:01 | clojurebot | "([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done." |
| 21:01 | bbloom | (doc subseq) |
| 21:01 | clojurebot | "([sc test key] [sc start-test start-key end-test end-key]); sc must be a sorted collection, test(s) one of <, <=, > or >=. Returns a seq of those entries with keys ek for which (test (.. sc comparator (compare ek key)) 0) is true" |
| 21:02 | bbloom | i think that branch/value indirection makes this work! clojure's data structures rock. |
| 21:07 | seangrove | dnolen: Alright, patch is updated with all the changes: http://dev.clojure.org/jira/browse/CLJS-540 |
| 21:07 | dnolen | seangrove: great thanks, tests pass? |
| 21:07 | seangrove | Looking at how I can delete the previous attachments... |
| 21:07 | seangrove | Yeah |
| 21:07 | bbloom | Bronsa: am you studying it? :-) |
| 21:08 | seangrove | Ok, cleaned up |
| 21:12 | Bronsa | bbloom: what, the PersistentTreeMap$Seq implementation? |
| 21:12 | bbloom | Bronsa: yeah |
| 21:12 | Bronsa | no, I'm too sleepy right now |
| 21:12 | bbloom | haha ok, fair enough |
| 21:16 | Bronsa | seangrove: doesn't the repl need to switch to tools.reader too? |
| 21:17 | seangrove | Bronsa: Not sure it has to happen all at once |
| 21:18 | seangrove | Ideally it would, but the main difference right now is just the metadata from tools.reader. Functionally, everything seems to work the same |
| 21:19 | sdegutis | objc -> c -> java -> clojure, and back again |
| 21:24 | dnolen | seangrove: sweet seems to work, will push shortly |
| 21:25 | seangrove | Phew, thanks |
| 21:25 | seangrove | Was quite a bit of work to get into the guts of cljs with a properly-working env |
| 21:26 | dnolen | seangrove: Bronsa: reader doesn't seem to add any significant time to compilation time |
| 21:27 | Bronsa | dnolen: I'm happy to hear that |
| 21:27 | seangrove | Bronsa: tools.reader seems very nicely done, thank you for it |
| 21:31 | Bronsa | dnolen: on a side note - tools.reader can read [+-]Infinity as Double/[+-]Infinity, I think clojurescript should special-case on that in emit-constant Double |
| 21:31 | clj_newb_2345 | what is the idiomatic way to send a fixed-rate message to a go channel? |
| 21:31 | clj_newb_2345 | I'm currently using a java Timer, |
| 21:32 | clj_newb_2345 | with a task which does (go (>! my-channel :tick)) |
| 21:32 | clj_newb_2345 | however, I think this is bad, since when I run it at 10milli seconds, |
| 21:32 | clj_newb_2345 | it fore off 100 go requests per second, which sometimes appears to starve the go-threads trying to read from the channel |
| 21:48 | bbloom | Bronsa: https://gist.github.com/brandonbloom/6101597 |
| 21:49 | bbloom | i mailed the list too, b/c that behavior was kinda odd :-P |
| 21:53 | mischov | So is 'do' a macro or a function or what? |
| 21:53 | bbloom | mischov: special form |
| 21:53 | bbloom | it's a magic SUPER macro |
| 21:54 | mischov | Where would I go to find source for special forms? |
| 21:54 | bbloom | Compiler.java |
| 21:54 | mischov | Thanks |
| 21:54 | Raynes | I could have swore you said "Where can I go to find the special forces." mischov. |
| 21:54 | Bronsa | bbloom: mmmh now I'm super curious |
| 21:55 | bbloom | Bronsa: i am continuously surprised & delighted by clojure's stdlib |
| 21:55 | mischov | Raynes: The magic SUPER special forces. |
| 21:57 | bbloom | Bronsa: what i'm really looking for is the ability to slice a sorted map and have it stay a sorted map |
| 21:58 | justin_smith | clj_newb_2345: the jvm is going to cause problems if you want the timings to be accurate, gc and realtime are a tricky combo |
| 22:00 | mischov | ... 8000 lines of compiler.java later... "oh java....." |
| 22:00 | clj_newb_2345 | no one has embarked on clojure in clojure yet? |
| 22:00 | bbloom | mischov: heh, yes. it's particularly verbose b/c it's coded very functionally, which requires lots of boilerplate in java |
| 22:00 | bbloom | clj_newb_2345: there is some GSOC work going on this summer on that |
| 22:01 | clj_newb_2345 | why are such important projects being left to GSOC ? |
| 22:01 | Bronsa | that would be my work :P |
| 22:02 | seangrove | clj_newb_2345: A lot of work, presumably |
| 22:02 | clj_newb_2345 | not to say GSOC people aren't qualified; but it seems like such core projects would have the interests of those who have developed Clojure for years |
| 22:02 | bbloom | clj_newb_2345: why is it important? |
| 22:03 | bbloom | clj_newb_2345: it's unlikely that any other implementation will supplant the primary java implementation any time soon |
| 22:03 | bbloom | clj_newb_2345: even if one was "ready" there would be significant migration cost |
| 22:03 | bbloom | for what benefit? |
| 22:04 | clj_newb_2345 | bbloom: your pragmatism is making my idealism seem irrational |
| 22:04 | bbloom | that's the goal :-) |
| 22:04 | seangrove | bbloom: Presumably, there's some payoff in being able to develop tooling |
| 22:04 | bbloom | self-hosting is a neat trick & it's quite useful for many reasons… none of which are meaningful objectives of clojure |
| 22:05 | seangrove | Lowering the bar to contributing by removing most of the Java-stuff could help the clojure ecosystem develop quicker |
| 22:05 | bbloom | seangrove: quicker isn't necessarily better |
| 22:05 | bbloom | seangrove: and lots of clojure-ports of various parts pop up as people develop the need for them |
| 22:06 | seangrove | bbloom: Tooling-wise, it might be |
| 22:06 | bbloom | see tools.reader, clojurescript, my backtick, etc etc |
| 22:06 | clj_newb_2345 | I guess part of it not being self hosting |
| 22:06 | clj_newb_2345 | and java being a mess |
| 22:06 | clj_newb_2345 | is that there's only one implementation |
| 22:06 | seangrove | Just thinking about hypothetical benefits of self-hosting |
| 22:06 | clj_newb_2345 | unlike, say scheme |
| 22:07 | Bronsa | ,(meta '^:foo []) ;; just a quick reminder that Compiler.java is full of unhandled edge-cases |
| 22:07 | clojurebot | nil |
| 22:07 | bbloom | https://github.com/languages/Clojure & https://github.com/languages/Scheme |
| 22:07 | bbloom | #24 vs #35 |
| 22:07 | bbloom | not saying popularity matters, but having more than one scheme implementation isn't helping solve the problems clojure is solving |
| 22:08 | bbloom | and obviously, lots of people need those problems solved! |
| 22:08 | bbloom | i'd love to have a self hosting compiler |
| 22:08 | seangrove | It's definitely a nice-to-have, but I don't see any strong, immediate benefits |
| 22:08 | bbloom | but it's just not a priority for the core team & few people who are capable are interested |
| 22:09 | seangrove | Sounds like we're in violent agreement |
| 22:09 | bbloom | seangrove: i'm trying to help clj_newb_2345 understand :-) |
| 22:09 | clj_newb_2345 | I'm convinced. |
| 22:09 | clj_newb_2345 | I'll sacrifice my ability to read Clojure internals |
| 22:09 | clj_newb_2345 | for the benefit of a non-fragmented community. |
| 22:09 | bbloom | learn java, it's not so bad :-) |
| 22:09 | seangrove | Uhg |
| 22:10 | bbloom | haha yeah, yeah i know |
| 22:10 | seangrove | clj_newb_2345: I guess learn java, or be happy that clojure moves - slowly - more and more to clojure |
| 22:10 | clj_newb_2345 | I hope Compiler.java is written with variable names consisting solely of the ltters o, l, 0, and 1 |
| 22:10 | seangrove | hence clojure.tools.reader vs clojure.lang.LispReader |
| 23:07 | seangrove | I think the clojurescript project is one of the biggest projects using the closure compiler |
| 23:07 | seangrove | More often than not clojurescript resources show up when googling for closure compiler errors |
| 23:08 | bbloom | seangrove: could just be google results personalization :-) |
| 23:08 | bbloom | but i wouldn't be surprised if it was by far the biggest use outside of google or other closed organizations |
| 23:10 | seangrove | I've caused an error with the cljs output with duplicate fn param names being emitted, mainly because of the "_" name |
| 23:10 | seangrove | Googled the closure error to understand it better, and cljs tickets popup |
| 23:11 | seangrove | I hope google is able to personalize searches that well for me - it'd make me feel like we're old friends |
| 23:11 | clj_newb_2345 | is there a way, from clojure, to get how much CPU / memory this particular JVM instance is using up? |
| 23:14 | seangrove | Is there a way on github to see the evolution of a line over time? I want to know when a section of code was changed immedaitely after some commit |
| 23:16 | clj_newb_2345 | is this similar to git blame? |
| 23:16 | seangrove | clj_newb_2345: Yeah, like git blame, but asking "who/what changed this line immediately folloeing this commit?" |
| 23:16 | bbloom | yeah, i don't think you can do that on github, but you can use blame --before |
| 23:17 | seangrove | Thanks, will check it out |
| 23:17 | bbloom | or maybe --since |
| 23:17 | bbloom | or something like that |
| 23:17 | bbloom | git blame rev -- file |
| 23:17 | bbloom | like that |
| 23:17 | bbloom | then you can do `git blame rev^ -- file`, i think |
| 23:19 | seangrove | Ah, damn, this function moved from compiler.clj to analzyer.clj at some point. Actually need something like codeq more |
| 23:20 | bbloom | nope! |
| 23:20 | bbloom | use -M |
| 23:21 | seangrove | Well, I can `git log file`, find the oldest commit for it, then see whether the function is in it |
| 23:21 | bbloom | blame takes a -M flag, just like diff and a few others, for move detection |
| 23:21 | seangrove | Ah, wow |
| 23:22 | bbloom | success!? |
| 23:22 | clojurebot | clojure success stories is http://dev.clojure.org/display/community/Clojure+Success+Stories |
| 23:22 | bbloom | lol |
| 23:23 | seangrove | I don't *think* so... it looks like it might have migrated to an intermediate file first. Let me try -M on that file |
| 23:24 | bbloom | use -M 40 or something |
| 23:24 | seangrove | bbloom: I still maintain a datalog query would be somewhat nicer ;) |
| 23:24 | bbloom | seangrove: surely something somewhere in datalog lang takes a -M argument ;-) |
| 23:26 | seangrove | bbloom: Sure, but if I could just query for "give me all the revision history for these two functions, the first compiler/analyze-fn-method and the second analyzer/analyze-fn-method", I can ask it for the things I care about (functions and their history) rather than things git knows about (line blocks) |
| 23:27 | bbloom | hey man, we here in clojure land can only reinvent computing so fast |
| 23:27 | seangrove | Heh, I think codeq does this already, I just need to fix up Jida and get it in working shape |
| 23:27 | solus | How would someone write the following logic in clojure? https://gist.github.com/anonymous/63b5efe27a1ed6059dbd |
| 23:30 | solus | given collections A and B if an element in B intersects an element in A "modify" C |
| 23:40 | bbloom | *sigh* cedric |
| 23:40 | technomancy | clojurebot: tell bbloom how killfiles work |
| 23:40 | clojurebot | bbloom is a dendrologist |
| 23:40 | seangrove | bbloom: I don't understand the email, but it looked like he was being helpful |
| 23:40 | bbloom | lol |
| 23:41 | bbloom | he was being marginally helpful, but i can't help but read his emails in comic book guy voice |
| 23:41 | seangrove | Yeah, fair enough |
| 23:41 | seangrove | bbloom: But have you considered that datomic is not open source, and is therefore invalid? |
| 23:42 | seangrove | And that also means any time it's even remotely referenced everyone should be reminded about it :P |
| 23:42 | technomancy | I have no idea what this thread is, but it sounds like you're implying that I agree with Cedric |
| 23:43 | technomancy | and that scares me... might be time for me to sign off |
| 23:43 | seangrove | technomancy: I agree as well, but it's rarely relevant when he brings it up |
| 23:43 | bbloom | my thread is completely unrelated to datomic |
| 23:43 | seangrove | Oh, I know, he didn't mention it this time ;) |
| 23:43 | bbloom | except that in the sense that both my thread and datomic love awesome data structures |
| 23:43 | bbloom | <3 |
| 23:44 | solus | How would someone write the following logic in clojure? https://gist.github.com/anonymous/63b5efe27a1ed6059dbd |
| 23:44 | solus | given collections A and B if an element in B intersects an element in A "modify" C |
| 23:44 | bbloom | seangrove: the real issue is that he didn't explain if/how his advice changes my experiment. i don't think it does |
| 23:45 | bbloom | sure, i could do what he says… to make my tiny little test code more robust lol |
| 23:45 | bbloom | i wouldn't mind if he ALSO addressed whether or not finalizers vs reference queues would impact my measurements |
| 23:46 | seangrove | bbloom: It's all over my head anyway, the work of greater minds. I'm just focused on some small analyzer code, and glanced at the thread, and it appeared a remarkably coherent email for him. |
| 23:47 | bbloom | seangrove: no, you're right. i wouldn't be complaining if it was anybody else |
| 23:47 | bbloom | i'd have just said "huh, ok. i didn't know that existed & i don't really care" then continued to wait for somebody to address my actual question |
| 23:49 | arrdem | solus, is there some order gurantee to these collections/ |
| 23:49 | arrdem | *? |
| 23:49 | clojurebot | * is just for when you are lazy and sloppy |
| 23:49 | arrdem | darn tootin |
| 23:49 | solus | no |
| 23:50 | seangrove | hah |
| 23:51 | arrdem | solus, so the approach is probably (reduce (fn [[a c] el-of-b] ..) b) |
| 23:51 | bbloom | * is also for when there aren't enough words in the english language :-) |
| 23:51 | arrdem | bbloom: it's really nice when counting infinite sets too! |
| 23:52 | arrdem | solus, so (fn ..) is a function which implements a single update to c as desired, returning the pair [a, new-c] |
| 23:52 | arrdem | or at least that's how I'd wangle it. |
| 23:53 | solus | I only need new-c but yes that is the idea |
| 23:53 | arrdem | solus, yes but reduce is a sequential update operator |
| 23:53 | arrdem | so the idea here is that you step for each item in b retaining a and "updating" c |
| 23:54 | arrdem | ok so (let [a ..] (reduce (fn [c el-of-b] ..) {} b)) would be better |
| 23:54 | solus | that makes sense |
| 23:55 | solus | I staarted typing some nested doseq then I was like nah there has to be a less strange way of doing this |
| 23:55 | arrdem | ,(doc doseq) |
| 23:55 | clojurebot | "([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil." |
| 23:56 | arrdem | yeah doseq was not the right tool. |
| 23:56 | arrdem | ,(doc for) |
| 23:56 | clojurebot | "([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], ... |
| 23:56 | arrdem | and for's right out. reduce is definitely the right tool. |