#clojure log - Aug 14 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:14 gtrak: hrm, I think closure's advanced mode is killing this attribute-name: #(set! (.-currentKey state) %), how do I get it back?

0:18 I'm not sure if it's something I can put in externs

0:19 not a top-level thing.

0:23 not sure how angular can work in advanced mode if the symbols get munged :-(

0:23 hiredman: I started rewriting the inference stuff clojurebot does in core.logic

0:24 https://gist.github.com/hiredman/6227901 looks like it may be just about ready

0:26 gtrak: since that would screw up all manner of bindings

0:32 I guess I can use goog object

0:38 ah... http://squirrel.pl/blog/2013/03/28/two-ways-to-access-properties-in-clojurescript/ aset..

1:16 holo1: hi

1:18 holo: is it nowadays a good naming practice to use clj- prefix for libraries?

1:19 technomancy: holo: no

1:19 egghead: you could name it clj-jure

1:20 holo: egghead, come on..

1:21 technomancy, should i use inspiring unique names that mention clojure nowhere?

1:21 technomancy: yes

1:22 clojurebot: next?

1:22 clojurebot: excusez-moi

1:22 holo: (inc technomancy)

1:22 lazybot: ⇒ 67

1:22 technomancy: dang; must be getting my bots confused

1:23 maybe I'm thinking of lazybot??

1:23 lazybot: technomancy: Definitely not.

1:23 technomancy: oh, ok

1:23 * technomancy wanders off

1:32 seancorfield: I was looking over the dev.clojure.org design section on concurrency etc tonight. Looks like core.async satisfies a lot of the requirements outlined in several sections there...?

1:33 For background, I started out thinking about the notifying promises stuff for a problem I was contemplating... and when I read over the various pages on the wiki, it all seemed to point to core.async :)

1:33 callen: seancorfield: I find promises and futures suffice for most of what I do, but it's good to know core.async is available if I need it.

1:35 seancorfield: yes, so far i've been perfectly happy with futures and occasional promises but i'm looking at some more complex interactions...

1:36 https://www.refheap.com/17633 has some simple future / promise / core.async code just as an exploration of how the later can replace the former

1:37 I was just playing in LightTable with it

1:49 SegFaultAX: I've recently become really interested in the idea of micro-service based architectures. Each service is responsible for one aspect of your business domain and therefore probably quite compact (couple hundred lines max). In a production system I can imagine having tens of services all independently operating and intercommunicating.

1:50 callen: SegFaultAX: works best with concurrent stacks, futures and promises are the usual way to compose SOA/micro-SOA.

1:50 SegFaultAX: I'm having trouble understanding the communication and dependency graph of such a system, though.

1:50 callen: graph hits it on the nose if it's really spread out.

1:51 depends on how many things are getting triggered/invoked and if you expect cascade'ish behavior as a result.

1:51 SegFaultAX: I mean ideally I'd want to have a bunch of little rest or rest-lite services that all communicate over HTTP.

1:51 callen: common-case result "denormalization" is advisable. You probably want to abstract over the protocol (HTTP) too

1:51 being able to flip a switch to go from, say, HTTP to ZeroMQ can save your ass later if latency becomes an issue.

1:52 consider that the latency * node traversal will be your min response time.

1:52 max node traversal, I should say.

1:52 SegFaultAX: But I'm struggling with actually implementing this idea of service A requires service B and C, and service B requires service D, etc.

1:52 callen: best to start small, write one or two small services. This is really a "systems" (in the proper sense) type problem.

1:53 SegFaultAX: For example, a very large number of my services would require authentication. It seems ideal to have that live in it's own service that essentially everything requires.

1:54 callen: auth? no no. You expose auth at the edges

1:54 SegFaultAX: Twitter has something like this. They have a semi-large routing and authentication service that sits in front of all the other services. Almost like a authentication proxy/middleware.

1:54 clj_newb_2345: besides sec.gov, are there any other resources for finding financials about companies?

1:55 callen: clj_newb_2345: edgar?

1:55 clj_newb_2345: callen: edgar is also gov required right?

1:55 SegFaultAX: Anyway, has anyone actually worked on such an architecture before? I've spent a lot of time reading and watching talks on the subject, but I've failed to find any actual source examples of a microservice.

1:56 callen: We didn't have a micro SOA, but we did have a SOA with exposed edge nodes to partners at Affine.

1:58 christo: is there a clojure package manager that can do something like: cpm search irc

1:58 ?

1:58 also related is there a project template maker thingy

1:58 ?

1:58 callen: christo: Leiningen?

1:58 s4muel: SegFaultAX: Yes, at $previous_job I ran a handful of services like this in Go (eventing, id, tracking), Ruby APIs. In terms of redundancy or interop they all required each other, so every service was reduntant and said behiind haproxy magic

1:58 christo: @callen does it search remote stuff? It seems to want a project to exist first

1:59 SegFaultAX: s4muel: Did the services communicate over HTTP?

1:59 s4muel: SegFaultAX: to visualize this, actually, is how I ended up discovering Clojure (via the amazing riemann.io)

1:59 christo: callen: sorry doing irc wrong

1:59 callen: christo: use Leiningen.

1:59 s4muel: SegFaultAX: Yes although zeromq was on the horizon

2:00 christo: callen: thanks

2:00 callen: ^^ f'n told you.

2:00 SegFaultAX: s4muel: Was each service developed as a server/client pair? In other words, was part of the service's implementation a client to talk to that service that other services could bring in?

2:00 Or were the clients totally ad hoc on a per-service basis?

2:01 (The latter seems insane, btw, but it's worth discussing)

2:01 callen: this was the original purpose of SOAP

2:01 s4muel: SegFaultAX: And it is worth discussing because that's sort of what happened

2:01 callen: programmatic client/server negotiation and behavior.

2:01 s4muel: SegFaultAX: There ended up being a lot of 'contract additions' to the client side js

2:01 callen: I'm not saying SOAP is a good idea, I'm just saying they were reacting to something.

2:01 s4muel: as it were

2:02 futile: welp,

2:02 SegFaultAX: s4muel: In your system, were dependencies fulfilled synchronously or asynchronously? Like if A depended on B and C, would that happen in parallel or in series typically?

2:02 s4muel: SegFaultAX: Some of the business logic around event and identity tracking kind of got in the way as well.

2:03 SegFaultAX: Depended on business logic. Do we know who you are? OK, retrieve that. Now, history for you? Append? create new? -- each of these questions was answered by a service or subset of a service's api

2:04 SegFaultAX: s4muel: How big were services? How many did you have? How did you manage deployment?

2:04 s4muel: SegFaultAX: The questions get complex when we start dealing with recommendations, and same user different devices

2:06 christo: callen: I had an ancient version of Leiningen that found nothing when I searched. upgrade fixed that

2:06 SegFaultAX: To be concrete, we have a number of things on our current application that I feel would naturally fall out of the monolith as services.

2:07 callen: christo: good choice.

2:07 SegFaultAX: For example, we do payment processing.

2:07 That's an /obvious/ case for a service.

2:07 s4muel: SegFaultAX: Not too big -- enough that we didn't need to scale them horizontally (yet) beyond smallish ec2 instances. But for example there is a resize service that if down will break iamges on the site, so there were 'hard' dependencies.

2:07 callen: christo: `lein help search`

2:07 s4muel: SegFaultAX: Deployments were managed as best as possible among different services capabilities and what we could glom onto it from amazon

2:08 SegFaultAX: CDN cache, memcached, etc. Ruby we could deploy without downtime using unicorn, etc.

2:09 SegFaultAX: s4muel: So you had services running in multiple languages?

2:09 (Other than Go)

2:10 s4muel: SegFaultAX: Yes -- Ruby, Go, Node, and they all were instrumented by sending events into Riemann (clojure) and now I'm working on a similar system for parsing log data ala logstash...clojure seemed like a natural choice rather than jruby

2:11 SegFaultAX: There is also a giant data-warehousing / hadoop/hive/EMR/Redshift component at play

2:20 callen: Do I have a safer/more-robust/edn-based option rather than this? http://stackoverflow.com/questions/17263929/clojure-read-string-on-functions

2:24 yeah that doesn't seem kosher at all.

2:25 yeah not gonna work at all.

2:28 fuck it, gettin' quoted.

2:37 SegFaultAX: s4muel: How did your services register themselves/find each other?

2:37 Also, how did you handle routing?

2:43 amalloy: &(== 6032314514195021674.0 6032314514195021672) ;; really?

2:43 lazybot: ⇒ true

2:44 SegFaultAX: Wut.

2:47 amalloy: SegFaultAX: discovered that while reading http://twistedoakstudios.com/blog/Post4428_unfathomable-bugs-6-pretend-precision

2:47 callen: (some (fn [x] (= (alength (.getParameterTypes x)) 1)) (vec (.getDeclaredMethods (class fn-name))))

2:47 OH YES ^^

2:48 also (read-string (let [w (java.io.StringWriter.)] (print-dup f w) (str w)))

2:48 amalloy: the tldr is that longs promote to doubles when comparing, even longs which are too large to fit precisely into a double

2:48 callen: scary but good to know.

2:48 SegFaultAX: amalloy: Yea, I see that now.

2:48 Crazy, though.

2:49 amalloy: SegFaultAX: note that i had to use the "sloppy" == rather than the more-careful = to get the unexpected behavior

2:51 s4muel: SegFaultAX: HAProxy is a great piece of software

2:51 SegFaultAX: in re: routing of services and such (especially over http)

2:52 SegFaultAX: And they found each other via environment variables referred to in the application, this gave the most flexibility and allowed us to (sort of) seamlessly use paas providers like heroku

2:52 for testing and whatnot

2:53 SegFaultAX: Hmm, but haproxy doesn't really do anything for service discoverability.

2:54 I'm assuming then at some point you had a static configuration map of service -> host/proxy

2:54 s4muel: SegFaultAX: At the end of the day, multicast doesn't run in AWS, so discoverability options that don't suck are limited

2:55 SegFaultAX: And, I mean, not everything is fully auto -- there is a level of human control as to which services are talking to which, etc.

2:56 SegFaultAX: s4muel: Well sure, but there are other good options. ZooKeeper is a thing, for instance.

2:57 s4muel: now you have two problems

2:57 SegFaultAX: I've used it for distributed configuration, etc.

2:59 s4muel: The way I crafted Ansible plays allowed me to reset a bunch of variables and perform the right steps in the right order to reconfigure, and that fit well into the other aspects of our configuration management. YMMV, of course.

3:06 SegFaultAX: A lot of good ideas/projects in this space, more importantly Java-based projects, are the netflix OSS tools like Archaius, Curator, and Hystrix

3:43 holo: it seems .?. is not available in core. is there any replacement in clojure.core? http://clojuredocs.org/clojure_contrib/clojure.contrib.core/._q.

3:50 oh cool, found it finally: https://github.com/clojure/core.incubator

3:51 gnight guys/girls

5:33 nonuby: seem new behavour of lein is to stick repl port in target/repl/repl-port but fireplace still uses target/repl-port, a symlinks fixes it but just wondering if more permanent solution exists

5:37 bb_oz: #leave

6:37 supersym: I've got this thing that keeps creeping up, how to 'disolve' a list.. e.g I use (for [[k v] {:a :b :c :d}] [k v]) inside some hiccup vector, but it keeps returning with parens around like ([:a :b][:c :d]) obviously since functions can

6:37 't really return 2 values, but how do I rid of the list?

6:38 Anderkent[away]: supersym: what do you want to do with the return value?

6:39 Anderkent: you can always destructure the list with (let [[first second] (for ...)]) and have the values separatedly, or you can build a map with (into {} ..)

6:40 supersym: ok never mind

6:41 hiccup is fine with the vectors being in a list, seems to ignore it or at least the rendered HTML is correct so thats good

6:42 and i guess can also still work with the zipper this way in the hiccup forms

7:39 H4ns: does clojure have some variables that are bound to the last expressions evaluated in the repl (i.e. like * ** *** in cl)?

7:39 turbopape: H4ns, *1 and *2

7:39 H4ns: turbopape: grazie

7:40 turbopape: you're welcom H4ns

7:54 noncom: hi, i have a set of characters like #{\- \: \/} and a string which optionally contains some/any of these.. how do i find the indices of the occurencies?

7:54 supersym: indices?

7:54 noncom: i thought that a reduce on the string with manually counting the current index would do, but maybe ther is a better way?

7:54 supersym: I dont think sets have them?

7:54 clojure.set/select

7:54 noncom: supersym: no-no, indices in the string

7:55 supersym: oh ok

7:55 noncom: i could do indexOf and then drop...

7:55 but maybe there is a finer way?

7:56 supersym: no if you need the indices, treat it the way you suggest is fine I guess

7:57 Anderkent: if you're finding multiple chars in one string, doing a single scan through the string sounds fine

7:58 supersym: https://groups.google.com/forum/#!topic/clojure/0uSE8smFLb4

7:58 Anderkent: you could also iterate indexOf

7:58 ince it has the fromIndex param

7:58 supersym: yeah or call java.lang.String.indexOf?

7:59 Anderkent: the problem with indexof is that you'd have to scan the string per each character

7:59 giving you O(mn) instead of O(n)

8:00 noncom: ok if i go with reduce, how do i say "if the current char is found in the set ..." ?

8:00 (if #{...} char) does not seem towork..

8:01 oh that's nonsense i wrote

8:01 but anyway... (select) and see if nil?

8:02 Anderkent: sets are functions

8:02 ,(#{1 2 3} 1)

8:02 clojurebot: 1

8:02 Anderkent: ,(#{1 2 3} 8)

8:02 clojurebot: nil

8:03 noncom: oh cool!

8:04 hyPiRion: ,(map #(.indexOf "foo-bar:baz/zap" (int %)) #{\- \: \/})

8:04 clojurebot: (3 11 7)

8:04 hyPiRion: I wouldn't worry too much about the speed, although it's O(n*m)

8:04 Anderkent: hypirion: he wants a list of all occurences of a char I think?

8:04 not just the first one

8:04 hyPiRion: oh.

8:05 Anderkent: I got something like this

8:05 &(take-while pos? (drop 1 (iterate #(.indexOf "foobar1barfoo1" "1" (+ 1 %)) -1)))

8:05 lazybot: ⇒ (6 13)

8:05 Anderkent: the drop 1 is yuck but not sure how to handle it other than replicating the .indexOf on the right

8:06 noncom: yeah, well, i think this is the natural evolution of the indexOf way...

8:06 `cbp: whats going on here :)

8:06 noncom: what is the common practice to keep an eye on index during reduce? store it in the acc?

8:07 or loop-recur?

8:07 hyPiRion: ,(filter second (map-indexed (fn [x y] [x (#{\- \: \/} y)]) "foo-bar:baz/zap/fu:uh"))

8:07 clojurebot: ([3 \-] [7 \:] [11 \/] [15 \/] [18 \:])

8:07 hyPiRion: then do a group-by second if you want them based upon char

8:08 noncom: wow, cool!

8:08 `cbp: noncom: map-indexed

8:08 then remove nil?

8:08 hyPiRion: ,(group-by second '([3 \-] [7 \:] [11 \/] [15 \/] [18 \:]))

8:08 clojurebot: {\- [[3 \-]], \: [[7 \:] [18 \:]], \/ [[11 \/] [15 \/]]}

8:08 hyPiRion: not the prettiest, hrm.

8:09 noncom: gotta ten kill the seconds again

8:09 `cbp: noncom: or (for [idx x] (map vector (range) coll]..)

8:09 supersym: for optional named arguments, the :keys seem redundant with :or, I guess those would still be needed for binding context?

8:10 I don't mind the extra typing (well I do..:P) but I was just wondering if I could have optional arguments default values without :keys

8:11 it's just this particular function has tons of arguments and its getting ugly real quick

8:11 `cbp: if you have extra arguments shouldnt you be destructuring vector instead of maps? :P

8:12 or nvm i just woke up :/

8:14 noncom: supersym: although keys become really redundant here, it is still easy to justify their presense with righteous dogmas. so i think maybe you make a macro for that?

8:14 supersym: nah...I answered my own question, its needed for the form (symbols) and expression

8:14 noncom: what?

8:14 clojurebot: What is 2d6

8:14 supersym: noncom: probably yeah I was thinking that

8:15 noncom: `cbp: welcome, welcome :D

8:21 geoffeg: update-in seems to create the key in m if it doesn't exist? is there a way to avoid that?

8:24 noncom: geoffeg:not with update-in afaik. try first checking if the path exists?

8:27 geoffeg: noncom: i guess i'd check if the key exists in the function part of update-in?

8:30 `cbp: geoffeg: that will create the key and put a nil value on it in most cases

8:30 noncom: geoffeg: the function part is applied to the last node in the path, meaning that previous nodes, if did not exist, are created

8:30 `cbp: you'd need to check the key previously

8:30 noncom: geoffeg: so better used something like get-in or likes

8:31 geoffeg: thanks

8:31 aroemers: cemerick: regarding your comment on http://dev.clojure.org/jira/browse/CLJ-1125, what version of Immutant did you use and with what kind of app did you test this?

8:32 noncom: geoffeg: actually, you could use a slightly modified version of update-in. look at the souce: http://clojuredocs.org/clojure_core/clojure.core/update-in (expand at the bottom) and see what to change...?

8:32 but a separate check might look cleaner

8:33 geoffeg: ah, nice. thanks. i'll probably check seperately, the function i'm using update-in is already getting too big, simplifying would be good

8:34 (but i will look at the src to update-in)

8:35 noncom: hyPiRion: the last step was (reduce (fn [acc [k v]] (assoc acc k (mapv first v))) {} grouped) but you surely know already

8:36 hyPiRion: I guessed it was something along those lines, but I think it's a lot more satisfying when people can solve it themselves

8:36 noncom: sure it is!

8:37 hyPiRion: actually, you could probably use reduce-kv here: (reduce-kv (fn [acc k v] (assoc acc k (mapv first v))) {} grouped)

8:37 Doesn't change the semantics at all, just handy to know that reduce-kv is out there. It's rare to know about it I've realized

8:37 noncom: first time i hear of this kind of reduce :)

8:38 thanks yeah, now i know

8:46 shafire: hi

8:47 I can not decide between compujore, noir and moustache

8:47 are there even more web frameworks out?

8:48 hyPiRion: shafire: there's a set of libraries named pedestal. have a look at pedestal.io

8:49 vmarcinko: hello, newb question - is it possible to break valid Agent reference by passing some invalid function, and then be unable to do anything with it again?

8:49 because it seems to me that I managed to do that

8:49 in very simple way

8:49 for eg. (def myagent (agent 0))

8:50 (send-off myagent #(identity 55)) ; broken call since it doesnt make sense

8:50 after this last call it prints the agent, but after I repeat the same call again it throws :

8:51 ArityException Wrong number of args (1) passed to: user$eval47$fn clojure.lang.AFn.throwArity (AFn.java:437)

8:51 and when I try to send-off some proper function to it again, it throws same exception again

8:51 clgv: vmarcinko: yes, if there occurs an exception, the agent wont do anything for the next actions in the default configuration

8:52 vmarcinko: one options is to restart the agent via `restart-agent`

8:52 tbaldridge: vmarcinko: there's a way to change that.

8:52 hyPiRion: restart-agent and agent-error are yourfriends there

8:53 clgv: vmarcinko: there are also different :error-mode s for agent

8:53 vmarcinko: ok thanx

8:53 tbaldridge: vmarcinko: you can also (set-error-mode! my-agent :continue)

8:53 hyPiRion: Or set an error handler.

8:54 vmarcinko: ok, i should study agents mroe then..I thought they were similar to actors - if function cannot be processed, exception is registered but actors continue to work since the state hasnt been changed

8:54 tbaldridge: vmarcinko: that's what :continue will do

8:54 vmarcinko: ok...

8:54 thanx a bunch

8:55 `cbp: shafire: do not use noir, it's deprecated

8:57 shafire: there's pedestal and luminus which are just sane collection of libraries rather than frameworks.

8:57 vmarcinko: one more thing - after 15 years of java, clojrue is the first language to learn, so maybe i forgot how its to think in another way, but I noticed that clojure function, even in cases when these are not overly generic, tend to use very short names for bindings, whereas, in my java experience, with time I began using longer and longer method names (in java), and understability of my code raises that way, and I rarely

8:57 needed to comment my code due to that, but here in clojure, people seem to like short names which are sometimes hard to understand, no?

8:58 `cbp: vmarcinko: only short names for stuff that is commonly used, otherwise long names are pretty standard

8:58 so s will usually be a string and x will usually be something that can have any time, n will usually be a quantity, most often a size

8:58 etc.

8:59 vmarcinko: ok, maybe Im just seeing math-related generic examples, so thats why binding names are short

9:00 `cbp: s/time/type

9:00 vmarcinko: and hungarian notation for interafces is used in clojure core I see - ISeq etc...

9:01 i also thought its kinda old way of doing stuff (no offense intended, i guess its just preference)

9:01 opqdonut: that's not hungarian notation

9:01 hyPiRion: vmarcinko: that's in clojure.core, you seldom have to think about those interfaces

9:01 in general, clojure.core is special because it's, well, the core of Clojure.

9:02 shafire: `cbp: why is noir deprecated?

9:02 hyPiRion: Although I kind of agree that it's a bit strange to see the I in front of all interfaces, but I suppose that's something coming from C#?

9:02 vmarcinko: one more newb question - is there some deprecation mechanism in clojrue core, and do deprecated stuff get thrown away, unlike java that keeps everything, even deprecated from 1.0?

9:03 tbaldridge: vmarcinko: this is clojure...we do things right the first time

9:03 :-P

9:03 hyPiRion: tbaldridge: (doc agent-errors) :p

9:03 vmarcinko: i mean, has there been a practice of throing deprecated stuff away, or back comaptibility is too improtant?

9:04 tbaldridge: i can see that youre humble guy

9:04 tbaldridge: vmarcinko: actually there's very little in that sort of way, defstruct isn't used much anymore but it's still there. However, I'd say that it only contributes about 100 loc to the codebase, so why remove it

9:04 clgv: vmarcinko: we'll see whether clojure/core will keep true to semantic versioning - then version 2.0 would be a landmark to throw away all deprecated stuff

9:04 mgaare: vmarcinko: clojure.contrib was deprecated, but in terms of core I don't think anything has been officially deprecated yet

9:05 tbaldridge: vmarcinko: I jest. But I think the language is just too young to deprecate a whole lot yet.

9:05 `cbp: shafire: the maintainer moved on to different things. The useful libraries that it had are now called noir-lib or something

9:06 vmarcinko: tbaldridge: ok, i understood the joke

9:06 mgaare: Rich doesn't deprecate things in core, he just declares certain things 'non-idiomatic' and leaves them in ;)

9:06 clgv: there are some deprecated statements in clojure.core though

9:06 shafire: I see, ok `cbp thanks

9:06 hyPiRion: (doc agent-errors)

9:06 clojurebot: "([a]); DEPRECATED: Use 'agent-error' instead. Returns a sequence of the exceptions thrown during asynchronous actions of the agent."

9:06 hyPiRion: ^

9:07 ,(-> #'agent-errors meta :deprecated)

9:07 clojurebot: "1.2"

9:07 ToxicFrog: tbaldridge: for "why remove it" - one needs only look at the java standard library, where for any problem there are six classes that purport to solve it, four of them deprecated.

9:07 mgaare: shafire: also noir originally was not very "clojurey" in that it had some rails-esque magic that the author has disowned

9:14 vmarcinko: btw, im just finishing reading clojrue books (from chas, and joy of clojrue), and Im starting to get grip of individual clojrue features, but what I need now is a way to get feel of overall way of coding apps in clojrue, say, tipical 3 tier app. For example, in java, if we disregard the rpesentation tier, I usually have business layer, mostly using Sprring container, and there, on top I have some UserManager component

9:14 that has some business method, say Usermanager.activateUser(Long userId), and implementation of that method uses aspects to mark it as transactional

9:15 in that servcie implementation, I fetch User domain model by ampping the record from SQL db, apply business logic that evetually updates enbtity state, and it all gets persistend at the end of TX (using Hibernate for eg.)

9:16 what I would like to see some complete small clojrue app that shows some idiomatic way of doing similar use case (say activating user ) in clojrue code, so I can easily comapre the aproaches

9:16 is there some similar tutorial out there?

9:17 mdrogalis: It seems like you're asking how to port an architecture, to be honest.

9:17 & a kind of specific one too. I'm hard pressed to point you somewhere that shows that.

9:17 lazybot: java.lang.RuntimeException: Unable to resolve symbol: a in this context

9:17 mdrogalis: Heh, lazybot.

9:18 vmarcinko: well, I dont care whether clojrue way will end up similary to the archuitecture that I mentioned, I jsut wanted to see how do people implement that same use case (activating existing User entity that exists in SL db), to check whether architecturally stuff looks different now in clojrue

9:19 tbaldridge: vmarcinko: it's going to look much much different in Clojure... but the gist of it is something like this

9:20 mdrogalis: I think you'll find its super, super different

9:20 vmarcinko: is it also that you create in clojrue apps some kind of business layer ,that has some kind of trasnactional aspects to mark that method as trasnactional, and do stuff similary to my java description above?

9:20 tbaldridge: vmarcinko: replace the ORM with clojure.java.jdbc, all objects become hashmaps, validation/business logic are now functions

9:21 vmarcinko: and you need to define transactional for us... as in you want to lock that user while you are using it?

9:22 vmarcinko: well, since Im using SQL as db, I need to mark whole business action as transactional so it would create db TX before the business fucntion begins, and commits this DB TX after it ends suceesfuly, no?

9:23 mdrogalis: ORM is kind of scorned here.

9:23 vmarcinko: i mean, top function wehre the action begins surely has to communicate to DB to open db TX, no?

9:23 mdrogalis: So the transactionality gets pushed into the persistence realm.

9:23 vmarcinko: ok, but this doesn't have anything to do with ORM, even plain SQL need db TX

9:24 mdrogalis: I don't think I'm much help here. Question is too specific/lengthy. :)

9:24 vmarcinko: ORMs (sometimes) can make things easier in OO land, but its not crucial arhcitecturaly looking

9:24 tbaldridge: vmarcinko: I'm not sure you're using transaction in the way that I would use it, but clojure.java.jdbc will get you the sql stuff you're looking for. And you can do inserts/updates that will happen in a transaction.

9:25 although I'm more a member of the "do it all in a stored proc" school...

9:25 mdrogalis: tbaldridge: I did something pretty nifty with core.async. Gonna write a blog post tonight, but the gist is this..

9:26 jkkramer: clojure.java.jdbc lets you wrap multiple queries/statements within a transaction

9:26 tbaldridge: vmarcinko: but I'd say start there. Use only hashmaps, functions and jdbc and see where you get. My guess is that you'll end up with a very small amount of code that does what you want.

9:26 mdrogalis: Sometimes you want to add a watch to a ref and do something when it changes, and after you react to a change, you remove the watch. But I've seen a lot of code where the watch can be invoked twice before the watch gets removed - hence showing incorrect behavior.

9:26 The problem goes away if you put a channel inbetween the watcher and the code reacting to the event :)

9:26 tbaldridge: having spent 2 horrible years of my life writing these sort of applications in C# I can tell you, 90% of the OOP crap you have to deal with just doesn't exist in a ecosystem like Clojure

9:27 vmarcinko: ok, mabye I shoud've asked more concrete stuff, something like, do you have top buness fucntions looking oomething like (defn activate-user [userId] (open-db-tx (...somhow fecth user and execute SQL update) (commit-db-tx))

9:27 tbaldridge: vmarcinko: that and use Datomic (shameless promotion)

9:27 jkkramer: vmarcinko: pretty much, exception the commit is usually implicit at the end of the transaction scope, unless you explicitly rollback or throw an exception

9:28 vmarcinko: ok, thas what i wnated to know

9:28 jkkramer: see https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L487

9:28 and nested transactions are absorbed into the outermost one

9:30 vmarcinko: tbaldridge: i wonder how sufficient is free version of datomic for production

9:30 mdrogalis: It's pretty good ;)

9:31 vmarcinko: and is it possible do add your own custom storage sicne it is not given in free version

9:31 mdrogalis: vmarcinko: Nope.

9:31 shafire: Which ide do you use? With sublime, I have some issues with identation :-(

9:32 jkkramer: shafire: emacs, eclipse, lighttable, vim are popular choices

9:34 * clgv votes for eclipse with counterclockwise

9:37 noncom: shafire: ccw under eclipse

9:38 shafire: thanks

9:38 noncom: i tried lighttable and although i like the concept, it seems a bit alien. gonna try more sometime and when they advance the versions frther

9:39 turbopape: noncom, did it leave alpha already ?

9:39 noncom: turbopapa: hard to say.. they have version 0.4 now. they say they use it to write it and other code too...

9:40 turbopapa: but seems pretty robust in terms of stability

9:40 although ui definitely needs improvements

9:42 blrm: noncom: it is still alpha. i assume it will go closed beta once it gets to that point, since that was a kickstarter perk

9:42 noncom: blrm: will it be free at the end?

9:43 blrm: noncom: the kickstarter perk for a license of LT was $50, not sure what the cost will be once its generally available.

9:44 noncom: well, $50 seems affordable anyway.

9:45 blrm: btw, maybe you are aware of when do they plan to release? 2013? 2014? 2015?

9:46 clgv: noncom: before the next duke nukem? ;) :P

9:46 noncom: ahahah :)

9:46 blrm: hehe

9:47 noncom: no idea on the timeline. updates get posted here: http://www.kickstarter.com/projects/ibdknox/light-table/posts

9:54 clgv: noncom: there were licenses for $15 in the kickstarter campaign as well^^

9:59 H4ns: does anyone have usage examples for clojure.walk? i'm trying to wrap my head around it, trying to use it to collect certain data items from a nested structure, but i don't seem to get it how i can build up a data structure while walking

9:59 noncom: i guess it won't be below 50 or 100 though.. but if i need just clojure+clojurescript+js, it'd be cool to not to pay for other langs support.. if possible..

10:00 tbaldridge: mdrogalis: nice!

10:01 noncom: H4ns: afaik it simply realizes the visitor pattern or something along the lines?

10:01 H4ns: noncom: yes. maybe my real problem is immutability. when i visit a node, i may or may not want to collect that node into a result set, but how?

10:02 clgv: H4ns: if you just want to find certain values in the nested datastructure `tree-seq` might be an option as well

10:03 H4ns: clgv: ah, that sounds more like it, thanks!

10:04 jcromartie: this is driving me nuts… I have an inline volume control on my headphones but it attenuates the left channel at anything but max volume

10:06 arcatan: hmm

10:18 noncom: is there a less cumbersome way to do the same? (here i count 3 intos which add cumbersomeness):

10:18 ,(into {} (mapv (fn [x] (into [] x)) (partition-all 2 (interleave (range 4 8) "akra"))))

10:18 clojurebot: {4 \a, 5 \k, 6 \r, 7 \a}

10:19 hyPiRion: ,(into {} (map vector (range 4 8) "akra"))

10:19 clojurebot: {4 \a, 5 \k, 6 \r, 7 \a}

10:19 noncom: oh

10:20 hyPiRion: ,(conj {} [:key :val]) ; :)

10:20 clojurebot: {:key :val}

10:20 nifff: https://www.refheap.com/17641 help for transients

10:20 noncom: rught :)

10:20 s/rught/right

10:21 nifff: what's up?

10:21 nifff: its a functions that works with assoc but not with assoc!

10:21 its the same code ifyou can check it out

10:22 noncom: do you get errors?

10:22 nifff: no

10:22 but i get different results

10:22 dont know why i am new in clojure and transients

10:23 i have two version the persistent and the transient in the next line

10:23 nDuff: that... doesn't really look like a use case for transients to me.

10:24 nifff: transients are intended to be used only for local data. When you're passing things between functions, it's certainly not local. And you aren't calling persistent! anywhere.

10:24 Oh. I missed that.

10:24 hyPiRion: nDuff: He is, at line 100

10:24 `cbp: what's going on :-D

10:25 nifff: its wrong to call a function with a transient?

10:25 nDuff: Not _wrong_ necessarily, but a code smell.

10:25 nifff: if you can try the two exact version and the one its wrong

10:25 `cbp: you should probably use java data structures if you wanna share mutable data structures accross functions

10:26 nifff: you thing the error comes from sharing transients between functions?

10:26 k

10:27 `cbp: transients are usually used to speed up some operation on a persistent ds. You can check many examples in clojure.core

10:27 nDuff: nifff: that code is a bit more complex than I'd want to walk to find the actual error.

10:28 nifff: basically -- if you use any of the foo! functions on a transient, you *have* to adopt that value -- if you do anything with the old one, your code is behaving unreliably.

10:28 nifff: so, it's very believable for there to be a branch in there somewhere where that rule isn't being followed.

10:29 nifff: if you could generate a simple enough case that it's obvious to the reader that that problem isn't happening, we'd be in a better place to debug, but generally, if it's not a case where it's obvious that there's no risk of that happening, transients are the wrong job anyhow.

10:29 nifff: yes its large but the lines are exactly the same only assoc changes to assoc!

10:29 nDuff: err, wrong tool for the job

10:29 nifff: yes, that's the only change, but when you make that change your code has to follow new constraints to be safe

10:29 and the code is too large to analyze for whether it follows those constraints.

10:30 nifff: thanks anyway i will try again

10:30 noncom|2: is there a reference paper enlisting the constraints?

10:31 nDuff: noncom: it's discussed at http://clojure.org/transients, under "How they Work".

10:31 noncom: though most of it is pretty obvious -- if something is being modified in-place, you can't ever reference old values and expect behavior to be deterministic.

10:32 noncom|2: i know, but maybe that helps nifff somehow

10:32 nDuff: noncom: (the less obvious part is that you won't _always_ see the new values either unless you assign the results of your foo! operations)

10:32 noncom|2: oh

10:32 nifff: i dont use any of the foo! functions until the function its over,the only weird maybe thing that i do is to pass transients between functions

10:33 nDuff: nifff: *shrug*. If you think you have a reproducible problem, build the simplest possible test case that demonstrates it.

10:34 `cbp: what is the problem? :-)

10:34 nDuff: `cbp: inaccurate results when using transients

10:36 nifff: let me give you another example of a place things can go wrong: Let's say somewhere in your code you're using something (like map) that generates a lazy sequence.

10:36 nifff: if you're using transients, more items from that sequence can be realized than are actually used

10:36 nifff: ...which will mutate the underlying objects, resulting in inaccurate results.

10:37 nifff: it's really best to not try to use transients unless you're in a case where the code is simple enough that it's obvious that there's nothing surprising able to go on under the hood.

10:38 hyPiRion: nDuff: and when you really, really need speed.

10:40 `cbp: nifff: could you paste the code again?

10:41 nifff: in reafheap

10:41 https://www.refheap.com/17641

10:41 H4ns: is there a nicer way to say #(:foo %)?

10:41 hyPiRion: H4ns: :foo

10:41 H4ns: hyPiRion: can i pass a keyword as a function?

10:41 hyPiRion: H4ns: yes

10:41 H4ns: woha

10:42 llasram: H4ns: Keywords *are* functions (IFn's)

10:42 hyPiRion: Generally, all the places where you have `#(something %)` can be replaced with `something`

10:42 H4ns: nice. thanks.

10:43 vijaykiran: is there a shortcut for (take 30 (drop 5 something)) ?

10:44 nifff: https://www.refheap.com/17646 removed some stuff

10:44 hyPiRion: vijaykiran: if something is a vector, you can do (subvec something 5 35), which runs in constant time

10:44 llasram: vijaykiran: (->> something (drop 5) (take 25)) uses smaller numbers

10:44 vijaykiran: hyPiRion: sorry I should have qualified it - something is a line-seq from a file

10:44 TimMc: Note that the subvec holds a handle on the original vec.

10:45 hyPiRion: vijaykiran: then I'd do what llasram said. Just be a bit careful when it is realized (but you probably know)

10:46 vijaykiran: hyPiRion: thanks, I'm using ->> already was just wondering if I missed (foo xs 4 20) kinda function

10:46 TimMc: llasram: I think that's wrong, though.

10:47 llasram: TimMc: Oh, yeah, you're right

10:47 nifff: bye room thanks for the time

10:47 llasram: Once again, I really should just never try to multitask

10:48 hyPiRion: TimMc: huh? (->> something (drop 5) (take 30)) is transformed into (take 30 (drop 5 something))

10:49 llasram: Yeah, but I was trying to be clever and suggested he wanted to take 25, even though that is not correct

10:49 hyPiRion: oh

10:57 TimMc: wohoo!

10:57 $google CLJ-1121

10:57 lazybot: [Release Notes - Clojure - Version Release 1.6 - HTML format ...] http://dev.clojure.org/jira/secure/ReleaseNote.jspa?projectId=10010&version=10157

10:57 hyPiRion: blr

10:57 $google jira clojure 1121

10:57 lazybot: [Release Notes - Clojure - Version Release 1.6 - HTML format ...] http://dev.clojure.org/jira/secure/ReleaseNote.jspa?projectId=10010&version=10157

10:57 hyPiRion: Ok, I give up, you get me.

11:02 jcromartie: I really like the way GLSL lets you operate on scalars vectors and matrices so easily. I'd like to be able to do that in Clojure. I'm playing with my own implementation but are there any out there already?

11:02 i.e. I want polymorphic math functions

11:02 I've been trying to do it with protocols however I feel like the only way to make it really work is with multimethods

11:02 tbaldridge: jcromartie: core.matrix comes close I think

11:03 jcromartie: https://github.com/mikera/matrix-api

11:03 stuartsierra: Forever ago I implemented 2-argument dispatch with protocols and macros. Unfortunately I lost the code.

11:04 jcromartie: tbaldridge: thanks, that looks like what I want

11:05 stuartsierra: interesting

11:05 tbaldridge: jcromartie: not sure that works on scalars though.

11:05 jcromartie: tbaldridge: it does

11:05 (* (identity-matrix 2) 3.0)

11:06 TimMc: $jira CLJ-1121

11:06 Oh well.

11:07 hyPiRion: First hit when I actually go to google.com: http://dev.clojure.org/jira/browse/CLJ-1121

11:07 hyPiRion: TimMc: I know, same for me.

11:07 TimMc: Filter bubbling?

11:08 Must be. startpage.com gives the same results as lazybot.

11:09 shafire: does anyone use lib-noir? does one have a hello world example?

11:12 jcromartie: 'Sure, it's super cool to wave your hand above a Leap Motion and go "whoa, that's my hand." But that's the most fun you'll have with a Leap Motion, today.'

11:12 swarthy: jcromartie: Is that from the 'Wonderful, amazing, useless' article -- or some such title

11:13 jcromartie: swarthy

11:13 yes

11:13 swarthy: Saw the title haven't had a chance to read yet.

11:15 jcromartie: I've had one here on my desk for a while, and have been struggling to think of a mode of use that's more efficient or better than a keyboard/mouse/trackpad

11:16 hyPiRion: jcromartie: do you mean with the Leap Motion thingy, or in general?

11:16 jcromartie: the Leap

11:16 hyPiRion: ah

11:17 jcromartie: so far games and musical instruments feel like the best use

11:18 swarthy: jcromartie: at present nothing is better than what you listed. but I think our brains have a long way to go. imagine using that to drag s-exps around, that would be cool.

11:20 jcromartie: swarthy: code is about discrete structures, I don't see why continuous input would help

11:20 tbaldridge: swarthy: jcromartie: I'd be happy with a 4k 30" multi-touch screen. That'd allow me to do do paredit with my hands. touch and hold one paren to "pin" it, and then drag another paren to slurp a sexpr

11:21 jcromartie: I think it's just too darn squirrely

11:21 hyPiRion: I'd be happy if I could get some input to my brain, and dump some output back to the computer

11:21 jcromartie: not the Leap itself, necessarily, but trying to do accurate input with hands floating in the air

11:21 hyPiRion: Now that's happening indirectly through eyes and fingers

11:22 jcromartie: code isn't 3D

11:22 maybe it could be

11:22 if it were, or if we could think of it that way, then maybe something like leap would be useful

11:22 swarthy: could scope not be '3D'-ish

11:23 TimMc: What I'd love is to be able to expand/collapse function subtrees and just show the backbone of a namespace.

11:23 "Show me fns on the path from A to B and everything here that B relies on."

11:25 jcromartie: OK, what if scope were on the Z axis, names on the X, and values on the Y

11:25 er

11:25 no

11:25 not quite what I mean

11:26 move your hand in and out to step in/out of a scope, with all namespaces at the top level

11:26 left and right to navigate positions in the current scope

11:26 and up/down to change the value of the element at the current position

11:26 TimMc: We see in 2D*2, so expanding an interface to 3D in a meaningful and useful way is always going to be hard.

11:26 jcromartie: yeah

11:27 TimMc: "2.5D"

11:27 jcromartie: alright now I'm getting ideas

11:27 this could only work with Lisp :)

11:27 at first

11:28 TimMc: And then more languages as they convert to sexprs? :-D

11:28 swarthy: yeah, or we have to learn new ways to work with other languages. Where we build on their ASTs.

11:28 jcromartie: my arm is getting tired

11:28 :|

11:29 a new generation of beefcake programmers emerges

11:29 TimMc: That's one of the other problems with haptic interfaces. :-P

11:29 swarthy: jcromartie: ahah

11:29 Ideally we would get a nice blend. The introduction of the mouse did not destroy keyboard use.

11:29 TimMc: Light-pen interfaces apparently had limited success partly because they were tiring to use.

11:29 swarthy: This new input device doesn't mean eliminating the old.

11:29 jcromartie: it's useful for navigation but not for input

11:30 and how do you switch from navigation to input without navigating?

11:30 because you have to move your hand

11:30 voice?

11:30 TimMc: Foot-pedals.

11:30 jcromartie: TimMc: that's not a bad idea at all

11:30 blinking

11:30 TimMc: The answer is always foot-pedals

11:30 jcromartie: :P

11:31 `cbp: are there any libraries with some useful file manipulation facilities?

11:31 ystael: TimMc: the answer is always a breath controller

11:32 TimMc: Oh yeah! Sip/puff input.

11:32 mgaare: a flatulantor

11:32 `cbp: im looking to write something that monitors files, changes permissions on them, zips them and so on

11:32 * hyPiRion accidentally sneezes.

11:32 hyPiRion: whoops, there goes my file

11:33 TimMc: hyPiRion: That happens anyway.

11:33 ah-- ah-- CHOO:wq

11:33 ystael: hyPiRion: silly, that's why you bind sneeze to nrepl-load-current-buffer

11:33 jcromartie: :wq!

11:33 much harder

11:33 hyPiRion: :x guys. And I don't even use vim

11:34 TimMc: Those were the only commands I knew. :-(

11:34 dark_element: I have created audio viz project using core.async please take a look. http://kapilreddy.me/examples/korova_drop/

11:35 * TimMc drops an OGG by accident, waits patiently for site to blow up

11:36 `cbp: TimMc: i also know gg"*yG so i can copy everything onto emacs :D!

11:42 TimMc: I wonder if dark_element was just collecting MP3s.

11:43 dpritchett: I wrote a toy arithmetic parser that turns "1 + 2 * 3" into '(+ 1 (* 2 3)) and I'm having trouble unit testing it

11:43 Specifically my operator lookups - (resolve (symbol "*")) is not equal to the * function

11:44 I mean they do the same thing, but I wanted to write a unit test like (= * (resolve (symbol "*")))

11:44 Am I missing something?

11:45 llasram: dpritchett: `resolve` returns the Vars. You need to `deref` the Vars to access the functions they hold

11:45 TimMc: You're probably getting the var instead of its value.

11:45 dpritchett: Hey! deref did the trick

11:45 Thanks!

11:46 llasram: dpritchett: N.B. also that you may want to use `identical?` instead of `=`

11:47 dpritchett: Is identical? more forgiving or less?

11:47 = obviously has character count going for it ;)

11:47 hyPiRion: llasram: well, for functions, use of = and identical? yields the same result

11:47 llasram: dpritchett: `identical?` is true iff the two objects are the same object, which is the only sense of equality which makes sense for Clojure functions anyway

11:48 hyPiRion: Yeah, but being explicit etc

11:48 Ok, in the channel we have someone using the nick `so`, and now also `also`?

11:49 Someone needs to jump on `the`, `and`, etc

11:49 dpritchett: thanks llasram

11:50 ljos: Hi - I just pushed this: https://github.com/ljos/chromite . It is just some (mostly) automatically generated wrappers for the chrome apis, but I plan to look into making the bindings a bit more ideomatic clojure (at least for things I am using, but maybe for the rest if I find the time). I thought that someone else might find it useful.

11:52 saolsen: ljos: cool, that's useful

11:55 ljos: I will also translate some of the example projects from the developer site to make it easier for people to get started.

11:55 therefore: llasram: It's amazing what nicks aren't taken.

11:55 llasram: hah

11:56 turbopape: hello people, I am learning clojure, so I started with 1.5.1,

11:56 will be major changes in 1.6?

11:56 llasram: turbopape: Nope

11:56 turbopape: when will it be relased ?

11:56 llasram, thank you !

11:56 llasram: turbopape: Only rhicky knows

11:57 turbopape: llasram : okay ...

11:57 llasram: er, rhickey even

11:57 But seriously,

11:58 tbaldridge: turbopape: I wouldn't count on it any time soon. But the last "breaking change" was between 1.2 and 1.3 and that was what...3 years ago now?

11:58 `cbp: core is pretty conservative

11:58 noncom|2: what is planned for 2.0?

11:58 llasram: Yeah. And even then, most of the breakage was because of the contrib library re-shuffle

11:58 tbaldridge: llasram: I was thinking of numeric stuff, but yeah

11:58 * TimMc is still a little mad about +' vs. +

11:58 tbaldridge: noncom|2: is 2.0 planned?

11:59 turbopape: okay ... interesting history, indeed :) !

11:59 llasram: Oh yeah, I guess that too. It didn't actually break any of my code, so I'd forgotten :-)

11:59 noncom|2: i guess, up to 2.0 there will be polishing, but what about 2.0 itself?

11:59 tbaldridge: well, if there is 1, there must be at least 2?

11:59 ot will it stop somewhere on 1.8 or even 1.99999999 ?

12:00 tbaldridge: I think the gist is this, core.async in many was proof that much less needs to be in clojure than many would have thought. I wouldn't be surprised to see less and less changes in Clojure proper.

12:00 hyPiRion: it may go on beyond 1.9. 1.10 and so forth is totally doable.

12:00 TimMc: noncom|2: There have been breaking changes in 1.x releases.

12:00 tbaldridge: to me, 2.0 would mean something like a new compiler, and I don't see that happening anytime in the next few years.

12:01 noncom|2: then i guess, i must re-phrase: what is most significant changes are planned and known for now?

12:01 llasram: I'd really like to see all the core things which are implemented in terms of Java interfaces or ad hoc rules become protocols

12:01 noncom|2: tbaldridge: why no time soon?

12:02 what's holding?

12:02 tbaldridge: noncom|2: the existing compiler works just fine, and I don't think a replacement would be nearly robust enough before that time. Even then there's tons of black magic optimizations in the existing compiler that would need to be verified to still exist in the new compiler.

12:02 hyPiRion: time and thought. One can't just mash up something new without thinking it through.

12:02 tbaldridge: noncom|2: I'm talking about CinC here.

12:03 noncom|2: tbaldrigde: yeah, i was supposing CinC too

12:03 so, the project is gathering experience now and tries to define itself better...

12:04 tbaldridge: the official list form rich as to 1.6 stuff was here: http://dev.clojure.org/display/design/Release.Next+Planning

12:04 TimMc: I think the delay is that Rich is waiting on delivery of another thinking hammock.

12:04 tbaldridge: Part of this no longer applies (the async blocks are now known as core.async)

12:07 noncom|2: but how long until it has the same level of primitive hinting, JIT hinting and AOT support that the current compiler has.

12:09 noncom|2: i don't know.. to me, there are several reasons for delay: 1) obscure goals 2) insufficient knowledge/experience 3) real-world problems like money, family, etc.. As Rich and his team are superheroes, I believe that 1 and 2 does not apply to them... and well.. idk about 3...

12:11 tbaldridge: noncom|2: there's also something else to consider. Why break what's not broken? Why go back and throw out a working compiler. I'm sure has much better uses for his time. As most of us do. I love writing compilers as much as the next guy, but that's a huge undertaking for no real reason.

12:11 freezing: hi. what does ->, ->> and :>> do in clojure? what are they called and where can i read about them?

12:11 bbloom: noncom|2: you're assuming that you need a reason to delay, when in reality you need a reason to advance

12:11 freezing: use doc:

12:11 (doc ->)

12:11 clojurebot: "([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."

12:11 hyPiRion: (doc condp)

12:11 clojurebot: "([pred expr & clauses]); Takes a binary predicate, an expression, and a set of clauses. Each clause can take the form of either: test-expr result-expr test-expr :>> result-fn Note :>> is an ordinary keyword. For each clause, (pred test-expr expr) is evaluated. If it returns logical true, the clause is a match. If a binary clause matches, the result-expr is returned, if a ternary clause matches, its result-fn, which m

12:11 bbloom: for :>>, that's just a normal symbol, so … yeah what hyPiRion says, see the (doc …) for the outer form, which is condp

12:12 s/normal symbol/normal keyword/

12:12 noncom|2: yeah, i agree on that all, just wanted to know what is the general anticipation among people in clojureland

12:12 freezing: thanks hyPiRion & bbloom

12:12 TimMc: freezing: -> is "stitch-first" (or "thread-first"), ->> is "stitch-last" (or "thread-last").

12:13 Some people call them threading macros, but I think that's misleading in several ways.

12:13 Anderkent: tbaldridge: it's not 'no real reason'. The compiler is pretty much a black box right now. Having it written in clojure means tooling can hook into the compiler more easily.

12:14 `cbp: freezing: you might also wanna use macroexpand-1 with those since they're macros

12:14 Anderkent: now sure you can write libs that do it without involving the compiler... But then you're duplicating the

12:14 gah

12:14 glosoli: What is the most widely used templating engine for clojure ?

12:14 Anderkent: didn't mean to send that :P

12:14 dnolen: noncom|2: but anticipation for what? :) much of what I'm excited about (and would require changing normal languages) is under development as libs.

12:14 Anderkent: I don't see why you can't do that with tools.reader and tools.analyzer

12:15 freezing: cbp, TimMc thanks. i am very very new to the lisp / clojure land so i am reading as much as i can and try to build stuff.

12:15 Anderkent: dnolen: because having the logic duplicated means it can get out of sync with the compiler

12:15 noncom|2: tbaldridge: bbloom: dnolen: is there a "final" goal for clojure development which was embedded in its conception? that would redeem "breaking what works" and give "a reason to advance" and what can't "fit in a lib"? I know this is ephemerial, but something makes me wonder...

12:16 Anderkent: I find clojure compilation extremely magical anyway. The fact that you have to interleave read and eval seems bizzare, and I couldn't find justification for it (admittedly I didn't spend much time looking)

12:17 dnolen: Anderkent: and changing the compiler nearly always means inviting unintended bugs

12:17 noncom|2: dnolen: yeah, that is so true...although there are some basic-level improvementrs i'm craving for, like ability to define "undoxed" regions, like its happening with (transients)... a compiler trick? a jvm limitation? who knows.. who cares... :))

12:17 hyPiRion: noncom|2: I think the main goal was to get away from C++,C# and Java because they were too complex and didn't focus enough on values. It worked for me.

12:17 dnolen: Anderkent: the REPL?

12:17 bbloom: Anderkent: clojure (and clojurescript)'s compilers are incremental to support the REPL

12:17 tbaldridge: Anderkent: macros are a major reason, see how ClojureScript punts on this and makes you put your macros in a different namespace

12:17 freezing: TimMc: bbloom so this is more of a readability issue, i see?

12:17 dnolen: Anderkent: also most tools will want something richer than what the compiler needs anyway

12:17 Anderkent: read doesn't macroexpand, does it?

12:18 bbloom: imo, the biggest reason to change either compiler would to enable whole-program optimizations, but that would require clever techniques to recover incrementality for interactive development

12:18 Anderkent: i dont see how macros impact that

12:18 noncom|2: hyPiRion: that works for the negative goal, the "repelling force", but sooner or later, it must be complemented with "attracting force" i think..? well, lisping itself can serve a destination, right...

12:18 bbloom: Anderkent: macros require explicit staging (phase separation)

12:18 if i define a macro, then define a function that uses that macro, i need the macro to have been compiled first

12:18 Anderkent: sure

12:18 that's cool

12:19 but that doesnt mean it has to be compiled before you read the function

12:19 just before you eval it

12:19 shafire: a

12:20 noncom|2: well,nevermind, it's just mental roaming

12:20 bbloom: Anderkent: except that would be a *different* dynamic environment

12:20 Anderkent: I guess what I'm going for is another step between read and eval that would resolve symbols etc.

12:20 bbloom: what if that macro used other macros that *changed* in between definition and use?

12:20 Anderkent: so that I could for example read the entire file then eval the forms in sequence

12:21 and get the same result as the compiler

12:22 bbloom: extensibility and modularity of the evaluation strategy is a separate topic all together :-)

12:23 nacon: I'm fairly new to Clojure, and as something to work on I tried accessing data from the Leap Motion controller: https://gist.github.com/daniel-j-h/6206341 I stumbled upon a few issues here: First, what do I actually have to import? Only the classes I use for type-hinting or explicitely in override methods (Listener)? Because it seems like I do not have to import classes for objects that gets returned by methods (e.g. .frame returns a Frame, but it works wi

12:23 Anderkent: nacon: yes, only classes you explicitly refer to

12:23 noncom|2: nacon: lucky you, to me, leap motion is still on schedule :)

12:24 gtrak: nacon: if you're just trying to get leap to work, besides the learning, have you seen: https://github.com/quoll/leap-clj ?

12:24 nacon: Anderkent: okay perfect. Is there a way to require those classes and make the "path" to them an alias? For example, in the code posted above, I want to refer to the classes as leap/Controller.

12:24 TimMc: freezing: Yeah, -> and ->> just let you reorganize code syntactically. Watch out for implicit call-forms, though!

12:25 freezing: (-> 5 inc) and (-> 5 #(inc %)) aren't the same thing at all.

12:26 freezing: thanks TimMc. that was helpful.

12:26 nacon: gtrak: Yes I saw a few Clojure bindings for the Leap, but I wanted to learn more about Clojure. Actually using the Leap data is not that important right now ;)

12:26 noncom|2: nacon: then I would create a wrapper ns, named "leap" and a wrapper for controller there, so it'd be (leap/controller)

12:26 Anderkent: nacon: I don't think so. You can do refer to an imported clas by just class name (i.e. (import 'java.io.File) (File. ...)), but I don't thin you can rename packages

12:27 `cbp: freezing: that's why you use macroexpand-1 :)

12:27 freezing: `cbp: i am checking out macroexpand-1 right now :)

12:27 `cbp: ,(macroexpand-1 '(-> 1 inc))

12:27 clojurebot: (inc 1)

12:27 noncom|2: nacon: and it'd be (:require [my-project.leap :as leap]) and later (leap/controller ..)

12:28 nacon: noncom|2, Anderkent: Sounds reasonable. I thought this kind of aliasing would Just Work with a bit of magic using the :require keyword.

12:28 Anderkent: alas, require is only for clojure stuff

12:29 nacon: Err, :import

12:29 noncom|2: nacon: the restrictive behavior of the java-introp (:import) statement is intended, there was even a discussion on it somewhrer

12:30 nacon: nothing, however, holds you from creating some facility different from the (ns) macro to handle stuff the way you like

12:30 but that can get out of hands if done wrong..

12:31 Anderkent: nothing bare common sense

12:32 egghead: lol dnolen what did you do

12:32 http://www.nytimes.com/

12:32 nacon: On a side note, I had to write xml files for maven, to create local repositories for the .jar and native libraries, so I could refer to them in my project.clj. Is there an easier way of bundling .jars and native shared objects than editing xml files for maven by hand? The next problem I had doing this was the "deployment" with Leiningen. I searched a bit and it seems like the ubarjar isn't intended to be used with native dependencies.

12:32 nDuff: nacon: Maven has a "mvn" command-line tool

12:33 nacon: even worst-case, you should be telling that to do installs, not building files by hand.

12:33 noncom|2: nacon: and there also was something like "lein install"...

12:33 technomancy: nacon: deploying native dependencies with an uberjar is a nightmare

12:34 nacon: nDuff: yes I used mvn install, but still I had to write *Pom.xml files for the jar and native dependencies

12:34 noncom|2: as for uberjar - actually, handling somewhat more sophistiacated dependencies, native, or java-oldstyle is a pure pain with lein (in my exp, disclaimer: i might be noob)

12:34 nDuff: nacon: mvn install should be building adequate-ish POMs for you.

12:34 technomancy: nacon: you don't need mvn to install standalone jar files though

12:34 nDuff: nacon: well, not necessarily _very_ adequate, but POMs, anyhow.

12:35 technomancy: you can do `lein deploy file://path/to/repo randomfile.jar randomfile.pom

12:35 nacon: technomancy: not just standalone jars, but also native shared objects. In my case, the Leap motion provides a LeapJava.jar and additional shared objects e.g. two for linux-x86_64.

12:36 egghead: deploying tarballs :3

12:36 technomancy: nacon: you can use :jvm-opts ["-Djava.library.path=whatever"] for running within lein, but you're on your own if you want to run without it in production

12:36 justin_smith: we should rename war to jarballs

12:37 noncom|2: technomancy: are you aware of somehting called "com.jdotsoft.jarloader" ?

12:37 technomancy: "cry havoc and let slip the dogs of jar"

12:38 noncom|2: haven't heard of it

12:38 nacon: technomancy: So I should set this path appropriately and just dump the jars in a native/ directory inside my repository?

12:39 Anderkent: nacon: java.library.path is for the native libraries, I don't think it unpacks them for jars though

12:39 technomancy: yeah, pulling .so files out of a jar is a lein-specific tric

12:39 noncom|2: technomancy: then please please, read this: http://www.jdotsoft.com/JarClassLoader.php and there is the source: http://www.jdotsoft.com/download/JarClassLoader.java

12:39 technomancy: though some individual libraries roll their own similar behaviour

12:39 overtone, lwgl, etc

12:39 egghead: justin_smith: .jar pretty much is a jarball -- jar xvf somefile.jar

12:40 justin_smith: egghead: yeah, but war by conventions is a big bundle of jars

12:40 noncom|2: technomancy: with that thing being the starting point in my app, all the native libraries and all the native jars, despite any complexety, were loaded correctly and automatically. is it possible to integrate it with lein?

12:40 Anderkent: ha! TIL there's a jar command. I was always just using unzip after renaming to .zip (because it complained about the extension -.-

12:40 noncom|2: s/native jars/jars

12:40 llasram: noncom|2: You could write a plugin to build JARs which work via that ClassLoader

12:41 egghead: war, huh, what is it good for

12:41 technomancy: noncom|2: specifically for native dependencies?

12:41 I wonder if this is what overtone uses

12:41 egghead: absolutely nothing (tomcat/jboss/resin notwithstanding)

12:41 noncom|2: llasram: since this is the pain that wakes me at the night, I might as well consider that. however, i think that technomancy is far more qualified, i am a noob.

12:41 technomancy: noncom|2: I've never used native dependencies myself

12:41 nacon: Okay, so native libraries in the path. And platform specific jars? Because in my case, the Leap Motion provides different jars for Windows, Mac and Linux. The Linux jar is even a few version numbers behind (and therefore does not provide a few members, e.g.), so bundling those together sounds like a nightmare..

12:41 noncom|2: technomancy: that loader solves ALL and ANY native/jar loading issues on any platform and for any bitness

12:42 technomancy: noncom|2: yeah, it sounds like a plugin is in order

12:42 justin_smith: egghead: 🎵 bundling up a bunch of dependencies for a webapp 𝅘𝅥𝅮 UH SAY IT AGAN

12:42 noncom|2: weeeee! (expresses happiness)

12:43 egghead: :)

12:43 technomancy: noncom|2: making it part of `lein jar` itself is probably not a good idea though; we shouldn't force dependencies on people who don't care about native deps

12:43 kasterma: (clojure.data.generators/float) gives me -5.449482730771777E23 Not what I was expecting, nor what the docs (either clojure of java promise me). Any guesses as to what I am doing wrong?

12:43 futile: Does core.async make Clojure as good as Go?

12:43 Anderkent: nacon: the platform specific jar goes into maven repo (as something like leap-motion-linux for example?), then into your project.clj as a dependency. I'd think.

12:43 egghead: futile: wut

12:43 nDuff: futile: ..."as good as"?

12:43 futile: Yes.

12:43 Anderkent: if you want your project to be platform agnostic then I guess you just depend on leap-motion.jar and hope that the right one is installed in the local repository?

12:43 not sure.

12:43 justin_smith: does #"" make clojure as good as perl?

12:44 nDuff: futile: if you want to ask if its async model has caveats that Go doesn't, that's a question we could answer.

12:44 futile: but you're asking a completely different question, and one that doesn't really _have_ a single, correct answer at all.

12:44 technomancy: justin_smith: how is core.async better than hadoop?

12:44 nDuff: futile: ("as good as" for what purpose, exactly?)

12:44 egghead: technomancy: because macros

12:44 noncom|2: technomancy: sure, that functionality is not very basic, however, once lein will have a plugin that works that way, that will be *the* lein for me. like (binding *lein* (lein-with-jar-class-loader) (do-my-job)

12:44 futile: Concurrency.

12:44 nDuff: ...

12:44 again.

12:44 egghead: asynchroncity, you can't hit what you can't see

12:44 futile: And parallelism.

12:45 tbaldridge: futile: I think it's better than Go. STM, immutable by default, reducers, are all things Go doesn't have

12:45 egghead: explanation is futile

12:45 nacon: Anderkent: Yeah I tried making it platform agnostic -- but if it's such a pain I'm going with my local linux repository only, for now. Seems to be good enough for learning about Clojure.

12:45 nDuff: futile: Clojure has features Go doesn't. Go has features Clojure doesn't. We can't answer that question.

12:45 futile: ...and yes, that's true even when talking only about concurrency &c.

12:45 Anderkent: nDuff: but apples are better than oranges!

12:45 futile: nDuff: tbaldridge did.

12:45 technomancy: nacon: you might find you end up learning more about "how to deal with people who don't understand maven libraries" than about Clojure itself =(

12:46 nDuff: futile: tbaldridge gave an opinion, not an answer.

12:46 tbaldridge: futile: Go has the ability to do an async put/take anywhere in any function. That's cool, not really needed in practice, imo.

12:46 futile: tbaldridge: But can it handle thousands of goroutines as performantly as Go?

12:46 technomancy: Anderkent: TAKE IT BACK

12:46 tbaldridge: (inc nDuff)

12:46 lazybot: ⇒ 5

12:46 Anderkent: oh god we're going there.

12:46 tbaldridge: futile: and an highly biased opinion at that.

12:46 technomancy: "performantly" seriously?

12:46 nDuff: futile: core.async can handle thousands of goroutines well.

12:46 futile: Am I doing it right?

12:46 Anderkent: technomancy: apples are clearly superior as the need to peel an orange is unnecessary burden

12:46 tbaldridge: futile: do you need thousands of go routines?

12:47 futile: Hmm.

12:47 stuartsierra: kasterma: I can't reproduce that, e.g. (some #(when (neg? %) %) (repeatedly 1000000 gen/float))

12:47 ambrosebs: callen: the closest thing to Maybe/Option in core.typed is (U nil T). It works just as well.

12:47 technomancy: futile: next you need to ask if it can it "utilize" all the cores for the best paradigms

12:47 tbaldridge: futile: or do you really want thousands of items in a buffered channel with one go per CPU on your system.

12:47 futile: Well that's one thing Go shines at, it says that goroutines are better than threads because they're so small that you can have tons more of them.

12:47 Anderkent: can does not imply should

12:47 nDuff: futile: core.async go blocks aren't 1:1 with threads either.

12:47 shafire: does someone use clojure with openjdk successfully??

12:47 lazybot: shafire: What are you, crazy? Of course not!

12:47 egghead: how big is the async threadpool for core.async

12:47 and is it customizeable at all?

12:47 Anderkent: shafire: yes

12:47 egghead: (in the java impl I guess)

12:48 shafire: Anderkent: 1.7?

12:48 Anderkent: shafire: we deploy on openjdk 7

12:48 yup

12:48 technomancy: shafire: I use nothing but openjdk

12:48 futile: Are core.async blocks "green" like goroutines?

12:48 technomancy: highly recommend it

12:48 Anderkent: only problem with openjdk

12:48 kasterma: stuartsierra: It clearly shouldn't happen, but I have a repo that does give me these results.

12:48 nDuff: futile: cooperative? Yes, they are.

12:48 Anderkent: is the fucking retards at ubuntu

12:48 broke ssl config

12:48 stuartsierra: kasterma: consistently?

12:48 kasterma: s/repo/repl/

12:48 tbaldridge: futile: define green

12:48 Anderkent: https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1006776

12:48 it boggles the mind

12:48 kasterma: stuartsierra: I have a simulate simulation that consistently gave the wrong answers until I changed gen/float to gen/double

12:49 nDuff: tbaldridge: "green threads" ~= "cooperative multithreading". Very, very roughly.

12:49 kasterma: Not it gives the right results.

12:49 To see why, I typed the gen/float in the repl. and got the weird stuff.

12:49 futile: Can core.async utilize all the cores for optimal performance?

12:49 nDuff: futile: how about you read how it works instead of playing 20 questions?

12:49 shafire: Anderkent: heh

12:50 futile: These kind of things are not exactly evident in the documentation.

12:50 shafire: I see, okay, thanks!

12:50 nDuff: futile: ehh, yes, it is.

12:50 shafire: technomancy: thanks

12:50 futile: They require expert minds.

12:50 kasterma: stuartsierra: The repo is still open, anything I can type to diagnose.

12:50 technomancy: futile: you forgot "paradigm"

12:50 futile: technomancy: dangit

12:50 nDuff: futile: the documentation indicates that it uses a thread pool.

12:50 futile: so, obviously, it can use multiple cores.

12:50 stuartsierra: kasterma: Clojure is automatically going to cast Float to Double anyway. It's possible that by casting a very small float or doing some other computation you ended up with a negative number.

12:50 tbaldridge: futile: yes by default core.async uses cores + 2 threads. However, if things get blocked (due to doing IO in a go thread), the threadpool may spin up additional threads to handle the gos.

12:50 egghead: ALL THE CORES

12:50 futile: nDuff: But I've learned from Go not to make that assumption, since goroutines *may* use more than one core but by default don't.

12:51 justin_smith: egghead: (+ (ALL-THE-CORES) 2)

12:51 kasterma: stuartsierra: That is what I thought, but now I have this weirdness.

12:51 stuartsierra: kasterma: If you can show an instance of java.util.Random producing a negative float with a particular seed, that would be a bug in java.util.Random.

12:51 futile: Thanks for all your thorough and patient answers, tbaldridge and nDuff and technomancy and justin_smith.

12:51 noncom|2: justin_smith: that should be in the docs!

12:52 technomancy: http://thisotplife.tumblr.com/post/58142081675/showing-erlang-code-to-non-erlang-developers

12:52 kasterma: user=> (clojure.data.generators/float)

12:52 -63.45589065551758

12:52 stuartsierra: kasterma: What's the seed?

12:52 futile: Are core.async blocks optimized to start with a small stack, like goroutines are?

12:52 kasterma: stuartsierra: I didn't manually set it.

12:52 Can I extract?

12:53 nDuff: futile: the question doesn't actually make sense in the context of the JVM.

12:53 futile: I thought the JVM was a stack-based VM.

12:53 noncom|2: technomancy: so, can the classloader to be considered scheduled for creation for lein? or maybe do I better take this task and try to implement and if I succeed, contribute?

12:53 stuartsierra: kasterma: Not via the public API, maybe with reflection. And I don't know what java.util.Random does, maybe it resets the seed on every call.

12:53 futile: And not a register-based VM like LLVM and Parrot.

12:53 Anderkent: kasterma: you could try to get the seed from java.util.Random by reflection

12:53 nDuff: futile: it is, yes. Still doesn't mean the question makes sense. :)

12:54 dnolen: futile it doesn't make sense in JS either

12:54 technomancy: futile: one cool thing to do would be to write a program, and if it's too slow to profile it and find out why.

12:54 kasterma: Anderkent: I don't know how.

12:54 Anderkent: one sec

12:54 futile: Okay, I get the message loud and clear. I'll stop asking questions.

12:54 Thanks everyone for your time.

12:54 nDuff: futile: ...since there's only as much control as the interface allows.

12:54 dnolen: futile: but on CLJ and CLJS it's relatively cheap, a closure

12:54 bbloom: tbaldridge: dnolen: this works now! https://github.com/brandonbloom/cleff/blob/master/src/cleff/core.clj#L198-L204

12:55 callen: ambrosebs: oh very good to know, thank you!

12:55 bbloom: need to clean up the effect-calling syntax, do automatic insertion of "value" effects. and support effect "instances"

12:55 but i think all that is quite doable

12:55 Anderkent: kasterma: do you have the Random instance?

12:56 dnolen: bbloom: I'm not sure what I'm looking at :)

12:56 Anderkent: ah it's in *rnd*

12:56 bbloom: dnolen: that's a trivial, exhaustive, non-deterministic choice implementation

12:56 see http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/

12:56 ambrosebs: callen: you can "refine" the type with a conditional. If x : (U nil Number), (if x ;x:Number ;x:nil)

12:57 tbaldridge: dnolen: it's pretty much using ioc_macros.clj to kill monads. So that's roughly the sequence monad....

12:57 bbloom: dnolen: in short, the "value" effect is for results of evaluation of expressions, which it wraps in a vector. then the "choice" effect utilizes two continuations to concat those vectors

12:57 yeah what tbaldridge said

12:57 dnolen: tbaldridge: bbloom: oh hm ... cool!

12:57 callen: ambrosebs: o_O

12:57 justin_smith: symbol friendly web search for http://symbolhound.com/?q=clojure+%23+%25+%60

12:57 futile: By the way, anyone here know anyone looking to hire anyone?

12:57 justin_smith: s/for//

12:58 stuartsierra: Anderkent, kasterma: Sorry, got to go. I'd assume it's a one-time fluke unless you can reproduce it.

12:58 tbaldridge: bbloom: this is pretty cool. mind bending, but cool

12:58 bbloom: tbaldridge: :-)

12:58 Anderkent: https://www.refheap.com/17653

12:58 kasterma: Anderkent stuartsierra I have to go too. If I figure it out, I'll post a bug report.

12:58 Anderkent: that will tell you what the current seed value is

12:59 but I'm not sure if you can get the *previous* value from that :(

12:59 noprompt: dnolen: is it possible to build a cljs lib with an optional cli interface? that is, target the browser and node.

12:59 kasterma: Seed value is 25214903916

12:59 Anderkent: hm.

12:59 I must have done something wrong

12:59 because I get exaclty the same value :D

12:59 ah

12:59 noprompt: just a bit confused on how to set up the project file for that.

12:59 Anderkent: my bad

12:59 kasterma: Weird

12:59 bbloom: i also want to add a "call" effect for computations to push things on to their stack. then you'd have "sub" and "defsub" macros (read: subroutines) that would let you do nested computational effects even without the dynamic extent ioc

12:59 Anderkent: let me update that sript

13:00 try now : https://www.refheap.com/17653

13:00 kasterma: Seed value is 213845663926458

13:00 different

13:00 I do really have to leave now though. But with the seed preserved, the bug will live another day!

13:01 Thanks@

13:01 dnolen: noprompt: you can set Node as your compilation target yes

13:01 bbloom: very interesting, I see they talk about probabilistic programming at the end

13:02 noprompt: dnolen: right, but i'd also like to target the browser too.

13:02 dnolen: that is, if it's possible to set it up that way.

13:03 dnolen: so basically i want to package the browser cljs with the clj code, but the leave the cli stuff optional.

13:03 dnolen: noprompt: what I normally do is make two directories, one for build one for another, each with the main entry point file

13:04 noprompt: everything else is shared of course, and not a problem since it's on the classpath

13:04 noprompt: http://github.com/swannodette/swannodette.github.com/blob/master/code/blog/project.clj should give you the basic idea

13:05 noprompt: note that different builds have different :source-paths

13:05 noprompt: utils path there is not necessary (I just haven't cleaned it up)

13:07 bdruth: Good morning - quick question. I have a map {key value key value key value}, where every value is itself a map of one or more key/value pairs -- I'd like merge a "defaults" map into each of the values in the first-mentioned map, such that what I return is a map of key/value pairs where each value is defaults + whatever it was … I think I need to use (map) and (merge), but I'm not entirely sure how to maintain my original map struct

13:07 noprompt: dnolen: gotcha. so if i push my project to clojars i can exclude the cljs cli code while keeping the code that targets the browser?

13:08 dnolen: noprompt: no idea, that's a leiningen question outside my expertise.

13:08 callen: technomancy: https://github.com/facebook/pfff

13:09 noprompt: dnolen: oh, well that what i'm hung up on. :)

13:09 dnolen: bdruth: what do you mean maintain original?

13:09 noprompt: you can probably just put the cli stuff outside the lein source paths but on cljsbuild source paths

13:09 bbloom: dnolen: my prototype doesn't have all the features yet, but their design is basically an answer to the monad transformer library

13:09 dnolen: if you add "forwarding" of messages up the stack of handlers, then you can get arbitrary composition of effects

13:10 dnolen: bbloom: yeah I get that part

13:10 bbloom: the composition of effects bit

13:10 bbloom: dnolen: yeah, the nice bit is that there is no lifting :-)

13:10 dnolen: bbloom: monad transformers are gross

13:10 bbloom: dnolen: very.

13:10 Anderkent: bdruth: you want something like (into {} (map (fn [[key val]] [key (merge defaults val)]) my-map)) I think?

13:11 bbloom: dnolen: but now ambroseb_ is gonna have to write core.effected too ;-)

13:12 noprompt: dnolen: oh, is there something i can do to get cljs targeting node to work in advanced mode? whenever i run a script complied with advanced, it always complains about goog.string.Unicode blah, blah, blah.

13:12 bdruth: Anderkent[away]: ok, gotcha

13:12 Here's a gist of what I'm trying to do: https://gist.github.com/bdruth/dc3f0ab4ae70ba9b1505

13:12 dnolen: noprompt: it only complains about that under simple, not advanced

13:12 noprompt: dnolen: i saw the jira issue, but that's like a year old.

13:13 dnolen: noprompt: er I mean whitespace

13:13 noprompt: dnolen: maybe that's what it was.

13:13 dnolen: noprompt: there are no issues w/ simple and advanced

13:15 bdruth: Anderkent[away]: yep, that's exactly what I was looking for - works in the repl, at least ;-) thanks!

13:20 noncom|2: technomancy: reading through the docs to the jdotsoft loader, there is the statement: "UberJAR Based on Classworlds package. Requires configuration file and strict directory structure. Does not support native libraries. Documentation is minimal.", so uberjar seems inferior to it by design, but as far as i understand, it supports maven and that is a desirable feature?

13:21 technomancy: noncom|2: lein's uberjar is unrelated to classworlds; probably just coincidental naming

13:22 noncom|2: technomancy: will you consider creating jdot plugin or maybe should i try and if i succeed - contribute?

13:23 technomancy: noncom|2: I don't have any use for native jars personally; you'd have better luck talking to someone like ztellman who actually uses that stuff

13:23 callen: bbloom: where does an effect system encroach on the monad's typical realm of concern?

13:23 technomancy: happy to answer lein-specific questions though

13:24 callen: technomancy: did you look at the OCaml thingamajig? :D

13:24 TimMc: hyPiRion: Oh wow, I didn't notice that rhickey had approved the ->/->> patch!

13:24 callen: TimMc: wait what

13:24 technomancy: callen: yeah, that's kinda nuts

13:24 noncom|2: ok, this is very good, thanks for the directions, i am very interested in resolving that, i will try to talk to zach and attempt to create that

13:25 callen: technomancy: the funny thing is, I'm pretty sure they used to have something similar in Haskell.

13:25 technomancy: callen: I guess this is how facebook engineers cope with having to write PHP?

13:25 callen: technomancy: same company, even.

13:25 technomancy: uhm, yes it is. Tons of support tooling.

13:25 clojurebot: technomancy: couch is insanely irritating and slow.

13:25 technomancy: clojurebot: that's not nice.

13:25 clojurebot: Gabh mo leithscéal?

13:25 callen: technomancy: I talked to them about the HipHip JIT implementation when I interviewed.

13:25 noprompt: technomancy: i was asking dnolen if it was possible to cherry pick which cljs code gets packaged with a jar.

13:26 callen: HipHop*

13:26 technomancy: callen: I mean both dealing with the flaws of PHP practically speaking but also as a way to keep sane by not spending all day writing PHP

13:26 noprompt: sorry; I've never used cljs

13:27 callen: technomancy: well, for better or worse, it's more productive to have their "elite" engineers accelerating the efforts of the PHP muggles in a leveraged manner than it would be to move to anything else.

13:27 dnolen: technomancy: he's asking a simple question, how to exclude source from a jar

13:27 technomancy: doesn't really matter if it .clj or .cljs

13:27 callen: so not excluding a dependency, but a single source file?

13:27 technomancy: oh sure; `lein help sample | grep jar-exclusions` iirc

13:27 noprompt: callen: "PHP muggles" :D

13:28 callen: technomancy: which would also explain why I was talking to them about production engineering and their compiler team and not frontline SWE

13:28 noprompt: >:)

13:28 noprompt: technomancy, dnolen thanks :)

13:29 TimMc: callen: http://dev.clojure.org/jira/browse/CLJ-1121, if that's what you're asking about.

13:30 noprompt: i'm not sure if should be surprised no one has forked the clojurescript compiler to make it emit PHP.

13:30 callen: TimMc: thank you

13:30 noprompt: PHP programmers don't know how to write compilers, I'm not surprised at all.

13:30 noprompt: no callen, you know that's not true.

13:30 callen: stuff like Facebook only happens when you offer free food and lots of money to programmers that don't use PHP.

13:30 tbaldridge: noprompt: someone tried, but they were found in the bay with their feet in concrete

13:30 noprompt: :P

13:31 oh my.

13:31 callen: TimMc: this is awesome, thanks for bringing this up :)

13:32 rasmusto: tbaldridge: the bay area

13:33 noprompt: tbaldridge: are you still working on clojure-py?

13:34 tbaldridge: noprompt: no

13:35 noprompt: tbaldridge: i was helping with a ruby clojure but, eh, we stopped too.

13:41 callen: Raynes: got started on Bulwark, thinking about how to efficiently store and query time series data in Redis.

13:43 kasterma: Anderkent[away]: figured out my clojure.core.datagenerators issue; I was using an old version that didn't have the restriction to the unit interval.

13:46 jcromartie: my new Router from Comcast requires that admin interface passwords be 8 characters in length

13:46 of course it ships with a default of "password" which I guess technically does conform to that requirement

13:47 dnolen: bbloom: hmm, cleff could be a pretty interesting way to do small bits of simple non-deterministic computation? that little example is 5-6X slower in core.logic

13:47 bbloom: dnolen: heh, OF COURSE you benchmarked it

13:47 i didn't :-)

13:47 nifff: if i acces a from a recursive function(not recur),a atom,makes the access slow?

13:48 bbloom: if you see the paper, it can do go routines & shift/reset and all sorts of other stuff too

13:48 zphds: guys, what is the clojure-way of tracing nullpointer exception

13:48 nifff: if i acces an atom from a recursive function(not recur),makes the access slow?

13:48 callen: zphds: it's not in the stack trace?

13:48 bbloom: dnolen: somebody yesterday at nyclisp was saying that you needed coroutines in order to make negation possible in core.logic… did i understand that right?

13:48 zphds: callen: am not seeing it in the nrepl

13:49 this is all I have

13:49 NullPointerException clojure.core/name (core.clj:1505)

13:49 nifff: zphds i use (require '[clojure.repl :refer [pst]]) and call (pst)

13:49 callen: nrepl has an error buffer for dumping stack traces.

13:49 well, in emacs it does.

13:49 jcromartie: nifff: the only thing that would slow down operations on an atom would be contention from multiple threads trying to swap! it

13:49 zphds: callen: yeah am guessing, someone is catching that exception and just returning it

13:49 dnolen: bbloom: well for negation as failure that isn't horrible yes (not true negation which is hard). we already have in the form of the constraint store

13:49 jcromartie: nifff: deref/@ should not be slowed down no matter how you do it

13:50 zphds: nifff: thanks I didn't know about pst

13:50 nifff: jcromartie when i have a recursive function it runs on the same thread ?

13:50 jcromartie: nifff: unless you're recursing in a future or something

13:50 dnolen: bbloom: but this state machine stuff has definitely got me thinking ... I wonder if we couldn't compile miniKanren into these things

13:50 bbloom: dnolen: of course you could :-)

13:50 jcromartie: nifff: when you say "access" do you mean deref, or swap!, or both?

13:51 nifff: both

13:51 bbloom: dnolen: but, sadly, i think we desperately need to be able to compile computational effects over dynamic extent

13:51 dnolen: but we can probably get pretty far w/o higher order use of effects

13:51 dnolen: i'd really love to see a defunctionalized clojure compiler

13:51 jcromartie: nifff: could you paste code somewhere?

13:52 nifff: i have a recursive function that if i dont use state and cary the arguments its very faster,when i use atoms for state and dont carry the aruments its slow

13:52 zphds: nifff: awesome, pst is what I was looking for

13:52 nifff: :P

13:52 jcromartie: nifff: yes, because using an atom will be much slower than passing argumetns

13:52 dnolen: bbloom: dynamic extent when compiling mK into core.async state machines?

13:52 nifff: jcromartie how to solve it using state?

13:53 `cbp: I leave small bugs on my tiny clojure apps at work so people send me to fix them. Instead of me having to maintain php which is my default. I'm a horrible person :-(

13:53 jcromartie: nifff: sorry the way you originally phrased your question made it sound like you were wondering if you were somehow slowing down read/write on the atom itself

13:53 callen: `cbp: :(

13:53 `cbp: you're making Clojure look bad :(

13:53 bbloom: dnolen: just in general. the example tbaldridge used was (map <! chans)

13:53 jcromartie: nifff: also why not use recur?

13:54 bbloom: dnolen: it would be annoying to decompose a large program with explicit call stack management & then that would ultimately be much slower to have a stack of state machines than a traditional call stack

13:54 jcromartie: (if you can)

13:54 nifff: i cant do it with recur

13:54 i have to make a stack going back and forth

13:55 how to use state from a recursive function,and be as fast as parsing the argument in

13:55 atoms are slow in this

13:56 jcromartie: are you sure you can't just do this as a genuine recursive function?

13:56 because yes atoms are going to be slower than arguments

13:56 no way around it

13:56 bbloom: dnolen: in theory, i could build core async itself on top of my thing ;-)

13:56 dnolen: bbloom: heh

13:56 bbloom: basically add send/receive effects

13:57 that'd be super cool b/c you could have pluggable handlers

13:57 dnolen: so i could have a "debug" handler that lets me inspect all the channels

13:57 for example

13:57 nifff: https://www.refheap.com/17654 the code that uses state and its slow...... if i pass the arguments its alot faster,can i fix it and keep the state?

13:58 a

13:58 jcromartie: nifff: which function?

13:58 nifff: apply-op

13:58 make

13:58 jcromartie: you're depending on those 4 global atoms?

13:59 nifff: yes,its slow as hel

13:59 i have another version with no atoms but i carry 4 arguments

13:59 its weird

14:00 callen: nifff: so why not use arguments one?

14:00 nifff: its like 10x when i carry the args

14:00 bbloom: dnolen: so why are the state machines faster than core.logic ?

14:00 nifff: i just asking if i can fix it and keep the state

14:01 dnolen: bbloom: well core.logic is monadic, but also a lot of things are reified, logic variables

14:01 gtrak: nifff: it's hard to see what the code is even doing, but it seems like resetting 4 atoms all at once would be a lot like resetting a single atom with a map in it, pointing to the values.

14:01 dnolen: bbloom: also unification

14:02 jcromartie: nifff: it's not weird at all

14:02 noprompt: dnolen: looks like i had my :externs entry in the wrong place and i was getting an error message. :-/

14:02 gtrak: nifff: don't keep the state if you can help it.

14:02 bbloom: dnolen: hm ok

14:02 dnolen: bbloom: but I think logic programming is a spectrum, there are cases where you don't need this stuff, some like cleff could be pretty useful when you don't

14:02 jcromartie: nifff: passing arguments to functions is what Clojure is particularly optimized for

14:02 dnolen: bbloom: also sounds like you might be onto something like HANSEI

14:03 jcromartie: nifff: I'd try to rework your API into pure functions

14:03 nifff: jcromartie ok thanks man

14:03 jcromartie: nifff: what are these things supposed to do?

14:03 dnolen: bbloom: the probabilistic stuff

14:03 nifff: https://www.refheap.com/17656 the version with pure functions and some add-ons

14:04 jcromartie: nifff what does "bdd" mean here

14:04 nifff: its a binary decision diagram it takes a boolean formula and converts it to bdd

14:04 jcromartie: hm

14:05 gtrak: nifff: see if you can change your loop-recurs into reduces

14:05 nifff: acessing the global state makes aceess slower than passing the arguments to functions right?

14:06 gtrak: don't use counters when traversing sequences

14:06 that would help readability

14:06 bbloom: dnolen: yeah, so you can implement purely functional state w/ this too. that includes dynamic variables, lazy thunks, etc. all purely

14:06 dnolen: so you could have optional reification of logic variables

14:07 dnolen: you could create a richer protocol for logic & then provide a handler that has as much or as little of the machinery as you request

14:07 gtrak: I still can't see what it's meant to look like in the end, though :-)

14:08 dnolen: bbloom: makes sense, I think there's a lot of possibilities as a compile target - also the IR probably allows optimizations passes analysis of some kind?

14:08 nifff: parsing arguments is faster than accesing global state right?

14:08 jcromartie: nifff: I am not sure you're thinking about it quite right

14:08 gtrak: nifff: that's what all this stuff is for: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L25

14:08 bbloom: dnolen: so yeah, in the references of this Eff paper, there is the original algabric effects discussion, which is much more theoretical. but there is a true co-algebra for reasoning about effects

14:09 dnolen: so it's highly amenable to analysis and compilation

14:09 dnolen: but using state machines instead of general stacks is a bit hacky :-)

14:09 dnolen: bbloom: I don't mean the paper I mean core.async IOC IR

14:11 nifff: gtrak i dont know what are all those.it make me dizzy :)

14:11 bbloom: dnolen: oh yeah. the SSA format is *huuugely* useful

14:12 callen: gtrak: apropos: https://github.com/bitemyapp/bulwark/blob/master/src/bulwark/core.clj#L18-L23

14:12 jcromartie: nifff: see https://gist.github.com/jcromartie/6233620

14:13 not only does state make simple things more complicated, but it's slower because atoms have to compare-and-set and all that jazz

14:13 dnolen: bbloom: yeah, this might be the next step for core.logic ...

14:14 jcromartie: nifff: now, *sometimes* state might simplify or even speed an algorithm up; for example using transients instead of building lots of intermediate persistent data structures

14:17 nifff: jcromartie thanks man i should have the test first,bye room :)

14:28 bbloom: dnolen: i'm curious how that would work? you'd have your little run* macro or whatever & then compile that down into SSA, optimize it, then compile that to a giant state machine & run it?

14:29 tbaldridge: oh, also you should talk to aysylu. she showed off loom at lispnyc last night & was doing some SSA visualization & optimizations :-) https://github.com/aysylu/loom

14:30 dnolen: bbloom: something like that I think, though not sure about the giant part, don't want to run afoul of JVM method size limits.

14:30 bbloom: dnolen: i think it might make sense to compile each state to a method & then compile a giant switch statement

14:30 dnolen: the switch statement would probably compile down nice & small and be fast, then each method could be individually jit-ed

14:30 can probably make core.async faster w/ that strategy

14:31 dnolen: bbloom: yes that would be ideal

14:31 tbaldridge: bbloom: interesting....I'm going to have to try that.

14:31 hiredman: the annoying thing is clojure doesn't expose a way to get a method that isn't attached to a closure (object) in a non-global context

14:31 bbloom: tbaldridge: i can just keep creating work for you via irc all day long if you don't stop me :-)

14:31 tbaldridge: bbloom: I tried a blocks are methods approach, but used functions instead of STATE-IDX and that was actually 2x slower than what we have.

14:32 bbloom: tbaldridge: hm ok

14:32 tbaldridge: I really want goto in clojure...although that is the last time I will ever say that in IRC

14:33 bbloom: tbaldridge: would recur-to solve the issue?

14:33 callen: tbaldridge: undelimited continuations?

14:33 hiredman: if the compiler did λ lifting of letfn's (turned them into static methods on the enclosing fn if possible) I think the jit would just eat that up

14:33 tbaldridge: bbloom: perhaps, depends on how it's implemented

14:33 bbloom: tbaldridge: as gotos :-P

14:33 gotos respecting a stack disciplin, that is

14:34 creese: I'd like to save the history of a db column by treating it like a "succession of values". Does anyone know the right approach?

14:34 bbloom: tbaldridge: one other thing i noticed: the :Return terminals can return a value & core.async actually uses that for returning the promise channel from a go form. but it checks against :recur, which is un-namespaced & so not really safe to use generally.

14:34 samrat: this example from the core.async walkthrough isn't working for me: https://github.com/clojure/core.async/blob/master/examples/walkthrough.clj#L75-85

14:34 bbloom: tbaldridge: my solution was to just get-object for the VALUE-IDX and return nil from the :Return handler

14:34 callen: creese: event sourcing. Also, look at Datomic for ideas.

14:34 samrat: I just get nil

14:36 bhauman: samrat: i just ran it and it worked for me

14:37 creese: callen: this feels like a problem datomic has solved, that's why I was asking here

14:37 tbaldridge: bbloom: yeah, I should fix that

14:37 callen: creese: well, it is, but Datomic isn't necessarily for everybody.

14:38 It *is* very cool though :)

14:38 creese: callen: yeah, I can't use it for work

14:40 bhauman: dnolen: bbloom: I think I just came up with a reasonable use case for channels on channels

14:40 ozzloy: how do i grab input from the command line without echoing as the user types, for instance when grabbing a password? https://gitorious.org/ozzloy/pwd-getter/blobs/develop/src/pwd_getter/core.clj here's what i'm currently trying

14:41 bbloom: bhauman: there are many reasonable use cases :-)

14:41 samrat: bhauman: strange. restarted the repl and now its working

14:41 bhauman: samrat: probably output flushing problem

14:42 bbloom: I guess I had a subconscious question mark at the end of my previous statement

14:44 I have been wrestling with this binary machine that's needed for drawing messages.

14:45 dnolen: nice you going to post about it?

14:45 bhauman: ^

14:45 bhauman: dnolen: I think so

14:47 dnolen: the act of drawing seems best captured by a channel message that contains a channel of all the drawing messages which then closes on completion

14:48 dnolen: bhauman: oh right, you're thinking about removing that bit of duplication

14:49 bhauman: dnolen: exactly insead of enforcing all the consumers of the channel all the way down the chain to enact their own handling of the binary state

14:51 H4ns: what kind of literal number is "1N"?

14:51 bbloom: ,(class 1N)

14:51 hiredman: ,(type 1N)

14:51 clojurebot: clojure.lang.BigInt

14:51 clojure.lang.BigInt

14:51 bbloom: lol

14:51 H4ns: ah, interesting, thanks!

14:52 dnolen: bhauman: sounds pretty reasonable, along the lines of what I was thinking with the helpers

14:52 bhauman: that I gisted

14:54 ToxicFrog: Is there a convention for what license to release Clojure programs and libraries under? Clojure itself seems to be all EPL; I know in the Lua community MIT is the most popular...

14:54 callen: ToxicFrog: EPL

14:54 technomancy: ToxicFrog: MIT is terrible for US hackers; it contains no patent protections on contributions

14:55 bhauman: dnolen: i spent some time refactoring with the helpers and several others that I crafted and it just wasn't satisfactory. However with a channel of channels those helpers seem work great.

14:55 callen: ToxicFrog: read it: http://www.eclipse.org/legal/epl-v10.html

14:55 technomancy: might be OK for folks in more civilised countries though

14:55 callen: ToxicFrog: just use EPL.

14:55 technomancy: but please have pity on us poor US hackers =)

14:55 dnolen: bhauman: yes, I mean the helpers by themselves definitely not enough :)

14:56 bhauman: looking forward to seeing what you come up with, sounds like something that could be a common pattern

14:57 bhauman: dnolen: i with definitely let you know

14:57 gtrak: callen: is that bulwark function really ok? every function will pass, no?

14:58 or... does .getDeclaredMethods not include abstract impls?

14:58 callen: gtrak: I'm not saying it's kosher, I'm still finding ways to break it by passing it random things.

14:58 gtrak: that's like v3 of it.

14:59 ToxicFrog: callen: alright.

14:59 callen: The goal is to verify that arity-1 for fn and a var to an fn (defn) are going to work when invoked.

15:00 I could "simplify" by just wrapping (fn nil) in an try/catch and returning true/nil based on success.

15:00 I was hoping to avoid doing that, but I don't mind obligating users to send me pure fns.

15:00 gtrak: meh, just let exceptions happen?

15:00 callen: gtrak: do you understand what bulwark is for?

15:00 bhauman: bbloom: dnolen: question about using put! instead of >! inside a go block. I have been doing that because I am intending not to block. Does that sound reasonable?

15:01 callen: "letting exceptions happen", pushes exceptions from app init to app runtime.

15:01 I'd rather not do that if I can help it.

15:01 gtrak: ah

15:01 bbloom: bhauman: you shouldn't use put! or take! unless you A) really know what you're doing or B) are near the edges when you need to interop w/ something event-based

15:01 callen: gtrak: your notions are probably best for the nicest possible code though.

15:01 gtrak: thanks for your thoughts :)

15:01 gtrak: callen: I guess that makes sense in some weird twisted way :-)

15:02 dnolen: bhauman: it's reasonable if you've thought it through as bbloom alludes. I don't think I saw anything problematic in your post.

15:03 bhauman: bbloom: dnolen: thanks, that helps

15:13 gtrak: callen: not sure of its usefulness, but a protocol/reify might be a better fit

15:13 it at least means the client had to be extra-conscious of what he's passing in

15:14 callen: gtrak: I'd prefer to keep it lightweight. They just have to write an fn that accepts a Ring request map as a single arg.

15:14 gtrak: that's a good idea if the "contract" being enforced gets any hairier

15:15 gtrak: yea, those things are in tension

15:16 callen: I'll just write better documentation and keep the code lightweight for now.

15:16 gtrak: thanks again!

15:19 `cbp`: callen: does the compiler not yell at you for (defn arity [fn]..) ?

15:20 dark_element: I had posted this earlier but repeating again for new people joining in. Created an audio viz using core.async and cljs. kapilreddy.github.io/cljs/core.async/2013/08/12/core_async_webgl_korova_drop.html

15:20 dnolen, you might want to check this ^

15:21 callen: `cbp: seemingly not.

15:21 `cbp: I can run it again to check, but I'd rather not just right now.

15:21 gtrak: `cbp: nope, clojure is dynamic.. it'll at least yell at you for using symbols not in scope.

15:22 `cbp: callen: gtrak: would it not try to use the fn passed instead of the special form fn when you do (fn [x]) which will prolly tell you that x is not defined?

15:22 gtrak: `cbp: here is the default implementation of every IFn interface method: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFn.java#L67

15:22 TimMc: &(let [fn 5] fn)

15:22 lazybot: ⇒ 5

15:22 TimMc: &(let [do 5] do)

15:22 lazybot: ⇒ nil

15:23 gtrak: it links to the right java-arity at compile-time, but it will throw an exception if the the function doesn't override that implementation.

15:23 `cbp: &(let [fn 5] (fn [x] x))

15:23 lazybot: ⇒ #<sandbox80477$eval84166$fn__84167 sandbox80477$eval84166$fn__84167@15da4b>

15:23 TimMc: ¯\_(ツ)_/¯

15:23 dark_element: and the same project in action http://kapilreddy.me/examples/korova_drop/

15:23 TimMc: dark_element: It didn't work when I tried it.

15:24 `cbp: I just bind my functions to f to avoid headaches :P

15:24 gtrak: `cbp: that does CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:1) in my repl

15:24 I think something's weird with the sandbox

15:24 dark_element: TimMc it will only work on Chrome right now.

15:25 `cbp: gtrak: yeah, some also returns false or true and then he's comparing it to 1

15:25 TimMc: Oh! Well then.

15:26 It renders better in Firefox. :-P

15:26 dark_element: TimMc, it uses wegGL and audio API.

15:26 TimMc, ohh it works in firefox?

15:26 TimMc: No.

15:26 But the loading indicator is smoother.

15:27 I get "repl is not defined" in both Chrome 28 and Firefox 23.

15:28 Xapak: Hello.

15:28 Anyone using/tried Light Table)

15:28 ?*

15:28 `cbp: a while ago

15:29 tbaldridge: Xapak: I try each new version. But with no paredit I close it within about 10 minutes

15:29 Xapak: I just wanted to try it out, but it keeps complaining about not being able to. clojure is in PATH, so... :'(

15:29 `cbp: then I put a fn that wrote to a file on the instarepl and the file grew too large and I was like no i dont want that!

15:29 gtrak: `cbp: we used it for a demo to appeal to ruby folks.. to not scare them with emacs :-)..

15:30 dark_element: TimMc, firefox does not have an audio api support or I am not aware of the alternative.

15:30 TimMc "repl is not defined" should not break anything. What do you see after loading indicator?

15:30 TimMc does mp3 start playing? or nothing happens?

15:30 gtrak: it's the closest thing to DrClojure right now

15:30 `cbp: Xapak: you need java on your path

15:30 Xapak: and possibly lein too, not clojure

15:31 TimMc: dark_element: The loading indicator doesn't go away.

15:31 Xapak: lein is, but I have no JAVA-related environment variables. That might be it. clojure standalone and other projects work just fine.

15:32 `cbp: gtrak: I was teaching some friends clojure but they didnt like lighttable, one used notepad++ and the other eclipse :)

15:32 dark_element: TimMc, does it generate any errors in js console?

15:33 `cbp: Xapak: if you can run java -version from a terminal then it should be fine

15:33 callen: gtrak: Ruby programmers are easily frightened and when they feel threatened they retreat to Twitter and #RUBY_DRAMA

15:33 one should never corner a Ruby programmer

15:33 gtrak: heh, yes

15:33 Xapak: `cbp, I can do that just fine. :'(

15:33 callen: they're diseased and their teeth can transmit infections.

15:33 gtrak: some are receptive though, the ones that know how to get sick of bad things

15:34 TimMc: dark_element: No further errors or activity.

15:34 Xapak: `cbp, oh, well, maybe it’s because I’m using OpenJDK. (troll)

15:34 `cbp: Xapak: well I have no idea but maybe lighttable has a mailing list?

15:35 ozzloy: how do i grab a pw? here's my current attempt https://gitorious.org/ozzloy/pwd-getter/blobs/develop/src/pwd_getter/core.clj it fails with the output in the comment starting on line 10

15:35 `cbp: emacs frightens me too sometimes. There was a time when autocomplete would segfault when getting the docstring

15:35 Then I switched to emacs live /shame

15:36 callen: `cbp: whatever works man :)

15:36 bhauman: dark_element: in chrome it jumps me to the embedded player

15:37 dark_element: I'm on OSX

15:38 TimMc: Ubuntu Linux here.

15:39 ozzloy: is this not the channel for that sort of question?

15:40 dark_element: bhauman, are there any errors in js console?

15:41 llasram: ozzloy: This isn't necessarily the proximate problems, but nested `def` etc forms are pretty much never what you want

15:41 bhauman: dark_element: no chance to see them. Chrome is wanting to interpret it as a local file an thus loads it into the current tab replacing your app

15:41 llasram: ozzloy: `def` always creates/updates a Var in the compilation-time namespace, not in the lexical scope

15:41 ozzloy: well, i can change it to a let, but i'm guessing i'll get the same

15:42 ystael: ozzloy: "System.console returns null if there is no console": http://stackoverflow.com/questions/4203646/system-console-returns-null

15:42 ozzloy: ystael, llasram thanks!

15:42 bhauman: dark_element: no console messages occur before the drop

15:43 gtrak: ,(do (let [a (def b)]) b)

15:43 dark_element: bhauman, ok

15:43 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

15:43 gtrak: &(do (let [a (def b)]) b)

15:43 lazybot: java.lang.SecurityException: You tripped the alarm! def is bad!

15:43 gtrak: ugh.. here :-).. user> (do (let [a (def b)]) b) .... #<Unbound Unbound: #'user/b>

15:44 dark_element: bhauman, let me make a few changes that will make debugging little easier.

15:44 bhauman: dark_element: sure

15:45 ozzloy: is there a better way to grab user input without echoing in clojure, other than through java's Console?

15:45 gtrak: ozzloy: more poignantly: user> (do (let [a #(def c)]) c) .. #<Unbound Unbound: #'user/c>

15:45 `cbp: ozzloy: there's all the java ways

15:46 amalloy: gtrak: (do #(def c) c)

15:46 ozzloy: i know, but console isn't there, which maybe i can solve, but if there's already a way of doing this, i didn't want to reinvent

15:46 gtrak: amalloy: fine :-)

15:48 `cbp: ozzloy: user input is way too broad. If you just wanna run your program in a console then maybe you can use a scanner the java way?

15:48 ozzloy: i mean via command line

15:48 so, running at bash

15:48 dnolen: dark_element: looks neat though I think the code could use some cosmetic refactoring (I really hate clojure-mode formatting)

15:48 ozzloy: or what-have-you

15:50 i'm also not too familiar with java

15:50 so i'll look into that too

15:50 `cbp, thanks!

15:50 `cbp: ozzloy: maybe like (def scanner (java.util.Scanner. *in*))

15:50 dark_element: dnolen what do you suggest?

15:50 H4ns: anyone familiar with http-kit's timer? if i schedule a task using timer/schedule-task, do i need to keep a reference to the task to prevent it from being garbage collected?

15:50 `cbp: ozzloy: then you can do like (.nextLine scanner)

15:51 ddellacosta: Is it possible to use a zipper for a data structure which has multiple pointer entries per node? a.k.a., children branch off from multiple entries in a single node?

15:51 gtrak: H4ns: do you have a reason to think that would be an issue?

15:51 H4ns: gtrak: yes. i can't see my scheduled task execute, which is why i ask

15:52 gtrak: H4ns: I would try to trace the execution before I think of something like that.

15:52 dnolen: dark_element: don't use aset unless you need it, use set!, implement a dochan macro instead of go-loop, (dochan [e chan] ...), break apart main, use two space indent everywhere except when align binding forms

15:52 dark_element: don't repeat by-id, just access the element once

15:53 dark_element: dnolen, all right.

15:54 H4ns: gtrak: yeah, that is what i'm trying, but that does not yield much. maybe i should avoid http-kit's timers

15:55 dnolen: dark_element: again it's mostly cosmetic, obviously can't use dochan where you have some loop state, the demo itself is very cool

15:55 dark_element: pretty nice considering you haven't used CLJS before, had you used CLJ?

15:55 dark_element: dnolen, thanks!

15:56 gtrak: H4ns: at first glance, it seems very minimal. You could probably just use the built in java timer and Timertask instead.

15:56 dark_element: dnolen, yup I use CLJ at work.

15:56 dnolen: dark_element: good stuff, it's great to see so much CLJS popping up :D

15:56 H4ns: gtrak: yeah, there is not much to it. it would just have been nice if it worked :)

15:57 gtrak: 'works' is in the eye of the beholder :-)

15:58 H4ns: gtrak: hence my original question ("familiar"). maybe something not apparent from the documentation is needed.

15:58 gtrak: but thanks anyway

15:59 dark_element: dnolen, cljs + core.async is too good to ignore.

16:01 H4ns: gtrak: and the solution is... i was looking for output in the wrong buffer :/

16:02 gtrak: H4ns: doh

16:09 dnolen: tbaldridge: did you see this, http://www.slideshare.net/aysylu/aysylu-loom?

16:09 tbaldridge: the last few slides are doing graph analysis of core.async SSA

16:09 tbaldridge: I was just going look at it

16:11 dnolen: oh, that's really awesome. the pypy guys have a super fast visualizer for stuff like this, they can view entire programs in an SSA graph form

16:15 TimMc: I was just looking at jkkramer/loom today! It still says "alpha" and hasn't been touched in a couple years. I'm not sure what its testing status is.

16:21 dnolen: TimMc: Aysylu forked it pretty cool how she applied it in so many different ways

16:21 zenoli: I've been using jkkramer/loom pretty extensively lately. I'll definitely have to take a look and see what's going on in her fork.

16:21 Been using a wrapper to use JUNG for visualization.

16:24 dark_element: dnolen, did all the audio viz work for you? Since I am using couple of different things in each some might break.

16:25 dnolen: dark_element: it seemed too

16:25 dark_element: dnolen, great!

16:38 boblarrick: Getting "Could not find artifact org.gnu:gnu-crypto:jar:2.0.1" when trying to run `lein deps` on a new machine, works fine on my usual machine

16:41 justin_s`: boblarrick: maybe it is from a nonstandard mvn repo?

16:42 that is, one you have configured to use on one machine and not the other

16:43 boblarrick: Hrm, hope not, cause I sure don't know anything about doing that

16:44 justin_s`: are your ~/.lein/profile.clj files the same on both?

16:44 *profiles.clj that is

16:45 boblarrick: don't have one on either machine

16:47 justin_s`: try one of these versions maybe? http://mavenhub.com/c/gnu/crypto/registry

16:47 it could be that version is obsolete so no longer deployed, but cached by your machine locally

16:48 (that is the kind of package that would be invalidated for security reasons for example)

16:48 see if changing the version to 2.0.5 fixes it

16:48 boblarrick: I'm not depending on it myself, i reckon something I require is, how can I find out what is requiring that?

16:49 llasram: boblarrick: Try `lein deps :tree`

16:50 justin_s`: also if you explicitly require a different version, that can override the other package's nested dep

16:51 it is a good idea to add it to the other package's :exclusions list in that case

16:52 hugod: If anyone interested in clojurescript has a few cycles to spare, I have a repo with tests that fail on two machines, but work on someone else' machine. Could you try: `git clone https://github.com/hugoduncan/papadom.git; cd papadom; lein do clean, cljsbuild once, cljsbuild test;` and let me know if it fails with something like https://www.refheap.com/17658

16:53 boblarrick: I can get the jar here, http://www.gnu.org/software/gnu-crypto/, is there a way to download the jar and point to it?

16:54 justin_s`: boblarrick: the jar will be under your other machine's .m2/repositories/

16:54 you can put it in the exact same path on the new machine

16:54 but I recommend against using deprecated crypto unless you really know what you are doing

16:54 they probably stopped providing it for a good reason

16:54 llasram: And of course it will then continue to fail to build on any future machine as well

16:55 boblarrick: I don't , but a java library I'm using from clojure depends on that

16:55 justin_s`: llasram: yeah, that too

16:55 boblarrick: so unless they update their dependency, which i have no control over, not sure what else to do

16:55 llasram: You have total control over it, as justin_s` described above

16:55 justin_s`: in your project.clj require the newer version

16:56 in the req that subdepends, add an :exclusions entry

16:56 so that it cannot try to get the old version

16:56 the github page for leiningen has examples of using :exclusions

16:57 futile: instead of "extremely" or "incredibly" or "immensely", use the word "intensely" from now on

17:02 boblarrick: Ok, the exclusion got lein deps running, i have to run now but will figure out how to require that lib in my project.clj tonight

17:02 thanks for help

17:05 justin_smith: man, he already left - the dep is the easy part

17:05 hah

17:08 hugod: looks like my clojurescript problem is caused by something affecting the order of js libs in the compiled js file

17:22 shafire: can a defn name be just numbers?

17:23 justin_smith: shafire: no, because otherwise numbers would be ambiguous

17:23 defn has the same rules as def

17:23 shafire: ok, thanks

17:24 kristof: shafire: ...why would you do that? I'm curiuos about the use case.

17:24 bbloom: (def 1 2)

17:24 that'll teach em to try to read me code!

17:24 shafire: kristof: (route/not-found (404))

17:24 :D

17:25 kristof: bbloom: Can't remember where I saw it but there's always the case where you define 0 as 0, then (0 as 1, (0) as 2, ((0) as 3 . . . fast even-odd lookup!

17:25 justin_smith: as a number theory thing you could (defn 2 (partial * 2))

17:25 llasram: It is probably unambiguous in the call position....

17:25 kristof: bbloom: But not great for anything else numbers are used for.

17:25 justin_smith: llasram: in a lisp-2 that would make sense

17:25 lisp-1 opts out of that sort of thing

17:25 bbloom: kristof: are you thinking of church numerals?

17:26 llasram: justin_smith: Haha, you said "lisp-2" and "make sense" in the same sentence!

17:26 justin_smith: LOL

17:26 `cbp: kristof: maybe sicp :)

17:26 oh

17:27 justin_smith: shafire: how about have a response function, that gets called like (response 404)

17:28 kristof: bbloom: Oh, shit, yeah

17:28 `cbp: Heh, yeah, I found that in SICP.

17:28 shafire: justin_smith: nice idea, thanks

17:28 kristof: Am I the only person who found Chapter 4 and 5 to be utterly useless, save for some key things?

17:28 `cbp: I've seen a four_oh_four function before

17:28 maybe it was python

17:29 kristof: The parts of Chapter 4 and 5 that I really, really liked were those on lazy evaluation, constraints programming (that blew my mind all over the floor), and garbage collection.

17:29 glosoli: kristof: sorry to interrupt which book it is ?

17:29 callen: `cbp: yeah.

17:29 `cbp: glosoli: structure and interpretation of computer programs

17:30 Profpatsch: Hi guys.

17:30 kristof: glosoli: The Structure and Interpretation of Computer Programs. The book they do NOT use anymore for introduction compsci at UC Davis, UC Berkeley, and UCLA now that the diehard professors have retired :P

17:30 Everyone's using Python now.

17:30 justin_smith: SICP great lisp-centric intro to cs, available for free at this point

17:30 callen: kristof: :(

17:30 that's such a waste.

17:30 glosoli: ah ok thanks , just got me wondering lol

17:30 kristof: justin_smith: That's the thing, though. What makes SICP is that until Chapters 4 and 5, it is NOT Lisp-centric, and it's VERY language independent.

17:31 *what makes SICP great

17:31 callen: Why? I don't think it is. Python is a good language and it gets people going. =)

17:32 callen: the Scheme version was deeper.

17:32 justin_smith: It is no "let over lambda", but there is a definite lisp approach in the book

17:32 brehaut: languages with statement / expression separation make for an lessons that take a while to untangle

17:33 justin_smith: yeah, scheme is great for introductions because it so vicisously eliminates special cases

17:33 callen: viciously

17:33 justin_smith: *viciously

17:33 heh

17:34 callen: Scheme really is superior as a teaching language, even if Python is more popular.

17:34 brehaut: viscously

17:34 Profpatsch: I hope you guys are more clever than I am.

17:35 I don’t have a clue whether to use for, reduce or iterate for a function.

17:35 nDuff: kristof: if the goal is to teach computer science, as opposed to "get people going" building practical things, sure. When did universities become trade schools?

17:35 Profpatsch: Or something else entirely.

17:35 callen: Profpatsch: why not describe what you want to do and provide some code?

17:36 Profpatsch: At it. ;)

17:36 kristof: nDuff: When 93 percent of college graduates do not come from the top universities (UC system, Ivy Leagues, famous state schools, and other important private technical schools).

17:36 gtrak: I thought engineering's supposed to be rigorous? python's a fine language, but scheme is foundational.

17:36 amalloy: the good news, Profpatsch, is that i think there's no scenario where all three of those would be reasonable choices. so we can at least narrow it down

17:36 Profpatsch: (defn combine-lines

17:36 gtrak: when I was a freshman, I thought scheme was totally irrelevant, but here I am..

17:36 Profpatsch: "Combines strings in a collection into lines not longer than the breakpoint."

17:36 [coll breakpoint]

17:36 …???…

17:36 )

17:36 technomancy: nDuff: "When did universities become trade schools?" <- you want an exact date, or what? =)

17:37 kristof: I really like what justin_smith said, though. I was about to disagree with callen and then I remembered that I found a LOT of value in SICP's approach to building all of our familiar tools from scratch

17:37 justin_smith: iterate is when you want to refine a result over successive applications of a function (ie. newton's method), for / map are when you need a result for each element of the input, reduce is when the input is a sequence that should be traversed, but the output is not a 1-1 mapping with input

17:37 `cbp: Profpatsch: use refheap.com when you wanna paste code

17:37 bbloom: more depressing is that the trade-school-ification of universities has made for *worse* tradesmen

17:37 kristof: I went into SICP thinking I would learn good functional programming and I left it knowing about message passing, object oriented programming, encapsulation, inheritance, good mutable practice (or the difficulty thereof) . . .

17:37 kmicu: "Python -- there is only one, degenerate, buggy, poorly-composed, verbose way to do it."

17:37 Profpatsch: I want to combine an array of strings into an array of line-strings not longer than breakpoint.

17:38 kristof: But what's most important about SICP is that it gets you into the mindset that you can build anything you want, and that you have (or at least should have) the tools to do so.

17:38 Profpatsch: Without doing it iteratively. I just can’t imagine how to do it in a functional way.

17:39 gtrak: bbloom: If I ever have kids, I will encourage them to study something fun and unique, and teach them programming myself. It's unfortunate, but better programmers won't ever come from a watered down commodification of the core principles.

17:40 justin_smith: Profpatsch: sounds like a job for reduce, especially if you can use clojure 1.5 (reduction)

17:40 Profpatsch: Thanks, I will look into it.

17:41 callen: kristof: it's not like building "practical" things is all that inaccessible.

17:41 kristof: university is supposed to make depths of knowledge available to you that are difficult to acquire independently (typically).

17:41 gtrak: it's like 'new math', of course it will never work.

17:42 callen: gtrak: new math was actually supposed to be more foundational and less practical in some respects.

17:42 justin_smith: Profpatsch: (reduce (fn [el [line lines]] (if (> (count (str el line) ...) ...))...) ["" []] lineseq) something or another along those lines maybe?

17:42 gtrak: callen: yea, I might be thinking of something else, now that you mention it... new new math :-)

17:43 justin_smith: I saw an argument today, in print, not sarcastic, that we cannot switch to metric in America because our children are too stupid to learn metric

17:43 shafire: is there something like Nunjucks for clojure?

17:44 technomancy: shafire: I have no idea what that is, but I hope so.

17:44 gtrak: actually, my (really good) calculus teacher had the best argument against metric. "Have you ever tried to build something in metric?"

17:44 nDuff: shafire: it'd be an easier question to answer if it didn't assume knowledge of what "Nunjucks" is.

17:44 kristof: callen: I'm not sure what you're referring to because I was agreeing with you. :P But I think building things in Python is still alright, if the courses emphasize that YES, "for" is a constant space operating iterative process... that is also a recursive procedure :P

17:44 shafire: which clojure template system supports template inheritance?

17:44 `cbp: shafire: Selmer

17:45 callen: shafire: Selmer

17:45 `cbp: gerd dermmert lol

17:45 shafire: `cbp: callen: looks like nunbla :) thanks

17:46 `cbp: like what :(

17:47 technomancy: https://twitter.com/panzertime/status/367747114014482432 <- sounds legit

17:47 shafire: `cbp: nunjucks

17:47 justin_smith: google for nunbla -> "did you mean nambla?"

17:47 brehaut: technomancy: what the

17:47 callen: shafire: nunjucks is based on Jinja2, Jinja2 is based on Django template language. Selmer is based on DTL and Jinja (best of both we hope)

17:48 `cbp: do the js guys have pet names for their libraries? :P

17:48 callen: technomancy: LOLWUT

17:48 technomancy: brehaut: I was gonna put a star of david into the lein repl startup message, but that tweet convinced me not to.

17:48 callen: `cbp: they choose weird names and nobody else knows what the hell they're talking abut.

17:48 justin_smith: with a name like panzertime what do you expect?

17:48 brehaut: technomancy: lols

17:49 shafire: callen: thanks!

17:49 kmicu: WunderbarPanzerkampfwagen 2.0

17:50 callen: shafire: thank yogthos

17:50 shafire: yogthos: thank you!

17:50 callen: his project?

17:50 callen: shafire: `cbp and I kicked in, but it's mostly his labor.

17:51 shafire: I was sitting in the shade cracking the whip on design decisions because I'm the Django/Jinja veteran of the three of us.

17:51 but without yogthos, no library :)

17:51 shafire: ah, okay. :)

17:56 gtrak: technomancy: will you accept a pull-request for a ascii art rabbi in leiningen?

17:56 johnmn3: g'day

17:56 Anyone out there using luminus?

17:57 callen: johnmn3: some of us. Don't need to ask to ask, just ask. :)

17:57 shafire: selmer works nice, thank you!

17:58 johnmn3: I'm a bit of a novice with web apps and I used the default site template. But I need to upload a file and the docs on how to upload files does not conform to the template: http://www.luminusweb.net/docs/static_resources.md

17:58 they use (defn upload-page [] (layout/common [:h2 ....

17:58 callen: shafire: glad it was useful. :)

17:58 johnmn3: but that uses a hiccup template, I assume.. and the latest uses selmer

17:59 so I'm not sure how to reconcile the file-upload docs with the new selmer template

17:59 callen: johnmn3: they just need updated. I'll let yogthos know.

18:00 johnmn3: I set up home.html with what I believe are the appropriate form details

18:00 callen: johnmn3: notified. we'll follow up on it.

18:01 johnmn3: thanks for bringing it up.

18:01 johnmn3: and I'm getting Exception: java.lang.NullPointerException: null

18:02 FileInputStream.java:158 java.io.FileInputStream.<init>

18:02 callen: good deal. Thanks callen. Any idea how to fix it?

18:05 `cbp: johnmn3: that may be that its not finding your home.html

18:12 johnmn3: `cbp: I updated the home.html directly. gave it <form action="/upload" method="POST" enctype="multipart/form-data">

18:12 and in defroutes I have (POST "/upload" [file] (handle-upload file))

18:14 and I have a function called handle-upload with (noir.io/upload-file "/" file), per the docs... maybe I'll try "/upload" there...

18:15 nope

18:18 callen: johnmn3: just so you know, Luminus is by and large vanilla Ring/Compojure

18:18 johnmn3: so any advice concerning how to handle file uploads in Ring/Compojure would probably be applicable here.

18:21 justin_smith: [ring.middleware.multipart-params :only (wrap-multipart-params)], then do what you like with the bytestream that comes in under (:multipart-params request), for example

18:31 johnmn3: callen: that's what I'm hoping.

18:31 justin_smith: thanks justin

18:32 justin_smith: that is what I use in my ring apps

18:33 there may be other libs to simplify it even more, but if you can do what you want with an inputstream, that should set you up

18:41 gtrak: is there anything in clojure 1.5.1 vs 1.4 that would break equality for records?

18:42 ptime: is there a list anywhere of simple project ideas for new clojure users?

18:43 gtrak: ptime: build a small webapp, deploy it on heroku, lots you can do. I keep one with handy utilities, like json->clj conversion.

18:44 ptime: ok will keep that in mind

18:46 gtrak: ptime: what are you interested in, though?

18:46 ptime: idk really

18:46 i always liked lisp, never did anything super "useful" with it

18:46 just tried to do super recursion and stuff

18:47 brehaut: ptime, i built my website, and a stupid irc bot, along with various data munging programs and some solved some math puzzles

18:47 gtrak: do you want something especially amenable to lisp/clojure or something you could do in aother languages?

18:47 ptime: i was thinking along the lines of math puzzles ys

18:47 something aimed towards clojure but w/e works

18:47 brehaut: ptime: have you looked at 4clojure ?

18:47 ptime: uh, yeah i've poked around a bit

18:48 brehaut: ptime: theres always project euler

18:48 both those will stretch your small scale problem solving in clojure

18:48 ptime: aha

18:48 project eulre

18:48 I had forgotten about that, was trying to remember

18:48 brehaut: building boring but understood software like blogs and todolists etc will stretch your understanding of how larger projects hang together in clojure

18:48 ptime: thanks, needed that memory jog more than anything else

18:56 * bhauman is loving this freaking language

18:56 bbloom: yeah, that tends to happen

18:57 bhauman: it sinks in slowly and then before you know it wham

19:03 `cbp: I have a lot of small clojure monitoring apps. Is there a tool somewhere that could let me monitor and maybe synchronize these apps?

19:06 bhauman: this is the code I'm so psyched about https://www.refheap.com/17665

19:07 dnolen: ^^ did you already write this?

19:07 `cbp: no system monitoring library around? :)

19:09 ToBeReplaced: `cbp: i don't know what you're asking about... are you looking for ganglia?

19:11 gtrak: can you put clojure itself in a lein checkout? I need to git bisect something.

19:11 technomancy: gtrak: you would need to add a fake project.clj to your clojure checkout

19:11 gtrak: that's what I figured.

19:11 thx for confirming

19:12 upgrading to 1.5.1 is messing up the order of random stuff that ends up in records constructors..

19:13 and I can't tell if the tests really need them to be in a certain order, but if I know the change that affects it, that's a start

19:13 brehaut: can anyone remember the talk rhickey (i think) gave about services as an abstraction boundary?

19:14 `cbp: ToBeReplaced: I have a bunch of jars atm that sometimes have to share data between them and sometimes i'd like to stop/start them at my whim. And i kinda feel like a caveman using cron and stuff and maybe i'd like to have a webapp or something to manage that

19:16 ToBeReplaced: bhauman: The Language of the System?

19:16 johnmn3: so I made some good progress. I got it to upload and then redirect to the same file you just uploaded, which causes it to be downloaded, since it is just a CSV file. Which is fine, because really thats the point of this... manipulate some CSV files... But then I tried sending the file to the manipulation function and now nothing.

19:16 getting error: 013-08-14 18:52:58.996:WARN:oejs.AbstractHttpConnection:/upload java.lang.AssertionError: Assert failed: (not (depends? graph dep x))

19:16 I think it is attempting to redirect to the file before the processing is done and it is erroring because the file does not exist yet.

19:17 I tried adding a sleep, but that doesn't seem to have an effect.

19:17 bhauman: ToBeReplaced: liked that a lot, but I was referring to clojure

19:18 ToBeReplaced: oh, message was meant for brehaut, oops... both start with b :)

19:19 brehaut: ToBeReplaced: aha thanks

19:19 (inc ToBeReplaced)

19:19 lazybot: ⇒ 1

19:24 bhauman: thought it was a late reply

19:26 brehaut: bhauman: i really enjoyed your dots post

19:26 bhauman: it works just fine in firefox too btw

19:27 bhauman: brehaut: thanks man, working on a post which refactors the code in that post right now

19:29 brehaut: you did try it in chrome though right? It plays much better.

19:29 brehaut: bhauman: i tried it on ios

19:31 bhauman: the animation is smoother in chrome, but the game play was just as good in ffx

19:32 bhauman: brehaut: great! thanks for letting me know

19:33 brehaut: bhauman: i recently wrote a site with a lot of fussy animation and page state; the core.async stuff looks like it would have at least halved the amount of code needed

19:34 im looking forward to see how the refactored dots cleans up

19:36 bhauman: brehaut: I was really surprised how easy it was to attack the problem one step at a time, core.async can apparently unravel really complex animation and time tasks

19:36 s/time/timing/

19:36 brehaut: yeah it looks fantastic

19:36 i'd love to see how core.typed plays with it too

19:37 module ambrose having to type the dom :P

19:37 s/module/modulo/

19:37 bhauman: interesting. I haven't looked at it yet

19:37 brehaut: ive only dabbled with it in clojure

19:38 bbloom: brehaut: luckily, several people have already typed the dom in various type systems, so it would likely be an easy, but boring process to translate that

19:38 brehaut: ive been impressed, although theres still a lot to go

19:38 bbloom: yeah, the dom spec itself is defined with IDL types; its not hard, just crap work

19:38 and a lot of crap work

19:38 gtrak: technomancy: it's choking on clojure's version.properties, any known workaround? I might monkeypatch the source. https://github.com/clojure/clojure/blob/1a56021c330ab95c9e78c4a12dd14e2cfe996f46/src/clj/clojure/core.clj#L6338

19:38 brehaut: bbloom: from memory typescript spends something like 5000 lines defining all the relevant types

19:38 gtrak: I tried copying it over to the host project, and making sure the dirs were specified in the project.clj

19:39 technomancy: gtrak: missing :resource-paths in the dummy project.clj I'd guess

19:39 brehaut: bhauman: my gut feeling is that static types on web projects will pay off more on the client than on the server

19:40 gtrak: technomancy: ah, I think I figured it out :-), the contents are version=${version}

19:40 brehaut: (due to how the server is mostly just marshalling data between various unitypes)

19:40 bhauman: brehaut: yeah the wild west of the client needs some wrangling

19:40 brehaut: 'some' ;)

19:40 bbloom: brehaut: basically proof that OOP is a mess :-P

19:40 brehaut: bbloom: no arguement from me

19:40 bhauman: bbloom: OOP is a mess?

19:41 bbloom: just kidding

19:44 brehaut: bbloom: typescript has a pretty decent (local) inferencer, but whenever you deal with dom code you have to spray annotations and assertions all over the place to ensure that you get the types you actually need. yay subtypes!

19:44 * bhauman is worrying that the more channels that he pipes together for touchmove events, the more mobile battery life he is going to kill

19:44 bbloom: brehaut: concrete subtypes == dumbest idea ever :-P

19:44 brehaut: bbloom: ever? not sure, stringly typed code is probably worse

19:46 bhauman: i think if you are delivering an in browser interactive experience to mobile, you dont have much hope of not consuming all the battery

19:48 bhauman: brehaut: yeah, I'm just curious about the actual price of touch -> chan -> chan -> chan -> chan -> chan

19:48 brehaut: bhauman: im curious how many chans you can connect before the plumbing starts causing judder

19:49 bhauman: brehaut: as I draw, it feels like there is a price in the browser, but I haven't quantified it yet

19:49 brehaut: I'm sure I'll find out soon

19:50 brehaut: bhauman: i wonder if you could move a lot of the heavy channel processing to an onanimationframe handler, and just populate the first chan from the move handler

19:50 bhauman: brehaut: very interesting

19:50 brehaut: although that risks non deterministic channel processing i guess

19:51 bhauman: brehaut: I didn't think about using onanimationframe that way

19:52 brehaut: gotta jet to a coders group, but I'd like to talk about this idea some more sometime

19:52 brehaut: oh requestanimationFrame; what am i talkign about

19:52 sure thing

19:52 bhauman: brehaut: yep

19:52 later

19:58 solussd: could someone tell me how to write a "this or that" tag selector with enlive? e.g., I want to select all nodes with an h1 or h2 tag

20:05 dnolen: I can't imagine the JS for handling touches would be computational intentions

20:05 I bet nearly all the drainage would be from animations and DOM reflows and stuff like that

20:05 s/intensions/intensive

20:30 amalloy: gfredericks: i noticed https://github.com/clojure/clojure/commit/86bfa996967a5aad43ac9fede6c9f37f6864beab got applied today. were there actually cases where the old implementation of -> had problems? i know ->> was broken, but i was surprised to see you changed ->

20:31 gtrak: has this commit ever caused problems for anyone? CLJ-867 - Records of different types with the same data have the same hashcodes, even though they are not considered to be equal - https://github.com/clojure/clojure/commit/f75d47efaf22dac41065e01c20c5a484831d1fb5

20:32 it looks like a sensible thing, but something is going horribly wrong in our code because of it. And I think it's not even records, but deftypes at play.

20:32 bbloom: gtrak: in theory it can slow down equality checks and some pathological hash map cases

20:33 gtrak: I'm trying to upgrade our codebase to 1.5.1, I git bisected, and reverting that commit makes stuff work again, but it's just odd.

20:34 ah, maybe that's not the only thing :-).. hmm

20:35 ah, and this one: IllegalArgumentException contains? not supported on type: clojure.lang.LazySeq clojure.lang.RT.contains (RT.java:724)

20:36 that's more obvious

21:06 technomancy: checkouts can't pick up java files... oops :-) caused me a headache for the last 30 minutes.

21:07 I guess I have to add it to the host java-source-paths

21:33 jcromartie: so that zifff guy got me reading up on Binary Decision Diagrams, and then graph isomorphism

21:33 and so I was like "oh that would be fun to write a little algorithm that simplifies isomorphic subgraphs"

21:33 oh wait graph isomorphism is NP-HARD

21:33 TIL

21:37 kristof: :'(

22:38 dnolen: jcromartie: sounds like something for constraint programming http://becool.info.ucl.ac.be/pub/theses/thesis-zampelli.pdf

22:38 jcromartie: ultimately, there are a few rules for simplifying BDDs in a "good enough" way

22:39 there's nothing inherently wrong with an un-reduced BDD

22:39 it's just ineffecient

22:40 dnolen: CP(Graph) would be a cool extension to core.logic http://becool.info.ucl.ac.be/pub/theses/thesis-dooms.pdf

22:40 bbloom: dnolen: dammit man. don't give me more stuff to read

22:40 dnolen: jcromartie: i think it problematic when you wire many BDDs together in order to solve large problems

22:41 bbloom: haha

22:45 sounds like JaCoP has this as experimental functionality CP(Graph) but not open source yet ...

22:45 mlb-: I'm trying to use https://github.com/narkisr/swag, but "lein ring server" fails as soon as I try to add the library. Any ideas? https://gist.github.com/mlb-/6237685

22:50 wolfes: mlb-: what's the failure message?

22:53 oops nvm

22:58 mlb-: possibly related http://clojure-log.n01se.net/date/2009-12-04.html - classpath issue?

23:01 mlb-: wolfes: I'm new to clojure, so I don't know how I'd determine this, or how I would even check :(

23:01 abp: mlb-: did you try lein clean? also recent versions of lein 2 show dependency collisions when you do lein deps :tree - you could try to resolve collisions with :exclusions on dependencies in project.clj - https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L41

23:02 mlb-: just tried "lein clean && lein ring server" with no luck

23:02 shoky: mlb-: you can try adding [org.clojure/core.incubator "0.1.3"] to your dependencies

23:04 mlb-: well I'll be damned. I just cargo culted this over and "ring server" works now: :exclusions [org.clojure/clojure]

23:04 anyone care to tell me what repercussions that has?

23:07 I'm not sure I understand what it means to exclude something, or something that appears as basic as "org.clojure/clojure". Why would other libraries include this?

23:08 wolfes: This is the best guide I've fond to project.clj config: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L252-L254

23:08 I noticed swag did the same thing, but I don't fully understand how :exclusions works: https://github.com/narkisr/swag/blob/master/project.clj

23:09 mlb-: yes, that's where I cargo culted from

23:10 Let me try to rephrase: What does it mean to have an exclusion

23:10 ?

23:10 abp: mlb-: it excludes all clojure versions any libraries depend on.

23:11 do a lein deps :tree

23:11 mlb-: Would an exclusion potentially allow me to cherry-pick functionality from a library I import?

23:11 abp: just to see what libraries your project currently depends on, directly and indirectly

23:12 nope, just dependencies of libraries

23:13 mlb-: Ah. I see. That's rather nice actually. So it's to help compensate for indirect library version conflicts?

23:14 abp: mlb-: lein-ring probably bashs ring into your classpath when you do lein ring server, then ring goes to get an older clojure version, and bam you've got two on your classpath

23:14 mlb-: I'll read up on this. Thanks for all your help/patience! =]

23:15 wolfes: (inc abp) ; thanks for describing exclusions :)

23:15 lazybot: ⇒ 1

23:15 abp: mlb-: be explicit about your projects dependencies. you want to depend on ring in your project

23:19 coventry: What part of the pedestal stack does <script id="script-driver"></script> likely belong to? I guess something is going to come along and fill this with javascript, but I'm having trouble finding any references to it, other than in the templates.

23:28 seangrove: Seems pretty upset http://blog.softwarecurmudgeon.com/blog/2013/08/13/why-are-we-settling-for-this-in-clojure/

23:31 abp: seangrove: yeah probably tell him about http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded

23:34 coventry: https://github.com/pedestal/app-tutorial/wiki/Integrating-the-new-Design

23:38 bbloom: tbaldridge: any ideas on how i could go about creating "first-class handlers"? i need to be able to compose several independently defined handler functions

23:39 tbaldridge: i suspect it might not be that easy :-/ my only thought is to save up snippets of code, stitch them together, and compile them upon first use & memoize or something

23:39 or maybe they can only be first class at compile time

23:39 coventry: abp: Thanks, that was actually the page I was looking at. Do you know of any explanations for the script-driver scripts? That page just says to put the other js scripts before it, but does not say why.

23:40 abp: coventry: later on they describe how to simulate your apps actions with the driver, so the app code is needed

23:44 coventry: abp: That is the only page in the wiki which mentions script-driver. Can you point me to the page which uses it?

23:51 abp: coventry: at the end of the tutorial: http://localhost:3000/design.html so you'll have to run that sample

23:53 coventry: abp: Did you paste the wrong URL?

Logging service provided by n01se.net