#clojure logs

2013-08-14

00:14gtrakhrm, I think closure's advanced mode is killing this attribute-name: #(set! (.-currentKey state) %), how do I get it back?
00:18gtrakI'm not sure if it's something I can put in externs
00:19gtraknot a top-level thing.
00:23gtraknot sure how angular can work in advanced mode if the symbols get munged :-(
00:23hiredmanI started rewriting the inference stuff clojurebot does in core.logic
00:24hiredmanhttps://gist.github.com/hiredman/6227901 looks like it may be just about ready
00:26gtraksince that would screw up all manner of bindings
00:32gtrakI guess I can use goog object
00:38gtrakah... http://squirrel.pl/blog/2013/03/28/two-ways-to-access-properties-in-clojurescript/ aset..
01:16holo1hi
01:18holois it nowadays a good naming practice to use clj- prefix for libraries?
01:19technomancyholo: no
01:19eggheadyou could name it clj-jure
01:20holoegghead, come on..
01:21holotechnomancy, should i use inspiring unique names that mention clojure nowhere?
01:21technomancyyes
01:22technomancyclojurebot: next?
01:22clojurebotexcusez-moi
01:22holo(inc technomancy)
01:22lazybot⇒ 67
01:22technomancydang; must be getting my bots confused
01:23technomancymaybe I'm thinking of lazybot??
01:23lazybottechnomancy: Definitely not.
01:23technomancyoh, ok
01:32seancorfieldI 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...?
01:33seancorfieldFor 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 :)
01:33callenseancorfield: 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.
01:35seancorfieldyes, so far i've been perfectly happy with futures and occasional promises but i'm looking at some more complex interactions...
01:36seancorfieldhttps://www.refheap.com/17633 has some simple future / promise / core.async code just as an exploration of how the later can replace the former
01:37seancorfieldI was just playing in LightTable with it
01:49SegFaultAXI'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.
01:50callenSegFaultAX: works best with concurrent stacks, futures and promises are the usual way to compose SOA/micro-SOA.
01:50SegFaultAXI'm having trouble understanding the communication and dependency graph of such a system, though.
01:50callengraph hits it on the nose if it's really spread out.
01:51callendepends on how many things are getting triggered/invoked and if you expect cascade'ish behavior as a result.
01:51SegFaultAXI mean ideally I'd want to have a bunch of little rest or rest-lite services that all communicate over HTTP.
01:51callencommon-case result "denormalization" is advisable. You probably want to abstract over the protocol (HTTP) too
01:51callenbeing able to flip a switch to go from, say, HTTP to ZeroMQ can save your ass later if latency becomes an issue.
01:52callenconsider that the latency * node traversal will be your min response time.
01:52callenmax node traversal, I should say.
01:52SegFaultAXBut I'm struggling with actually implementing this idea of service A requires service B and C, and service B requires service D, etc.
01:52callenbest to start small, write one or two small services. This is really a "systems" (in the proper sense) type problem.
01:53SegFaultAXFor 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.
01:54callenauth? no no. You expose auth at the edges
01:54SegFaultAXTwitter 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.
01:54clj_newb_2345besides sec.gov, are there any other resources for finding financials about companies?
01:55callenclj_newb_2345: edgar?
01:55clj_newb_2345callen: edgar is also gov required right?
01:55SegFaultAXAnyway, 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.
01:56callenWe didn't have a micro SOA, but we did have a SOA with exposed edge nodes to partners at Affine.
01:58christois there a clojure package manager that can do something like: cpm search irc
01:58christo?
01:58christoalso related is there a project template maker thingy
01:58christo?
01:58callenchristo: Leiningen?
01:58s4muelSegFaultAX: 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
01:58christo@callen does it search remote stuff? It seems to want a project to exist first
01:59SegFaultAXs4muel: Did the services communicate over HTTP?
01:59s4muelSegFaultAX: to visualize this, actually, is how I ended up discovering Clojure (via the amazing riemann.io)
01:59christocallen: sorry doing irc wrong
01:59callenchristo: use Leiningen.
01:59s4muelSegFaultAX: Yes although zeromq was on the horizon
02:00christocallen: thanks
02:00callen^^ f'n told you.
02:00SegFaultAXs4muel: 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?
02:00SegFaultAXOr were the clients totally ad hoc on a per-service basis?
02:01SegFaultAX(The latter seems insane, btw, but it's worth discussing)
02:01callenthis was the original purpose of SOAP
02:01s4muelSegFaultAX: And it is worth discussing because that's sort of what happened
02:01callenprogrammatic client/server negotiation and behavior.
02:01s4muelSegFaultAX: There ended up being a lot of 'contract additions' to the client side js
02:01callenI'm not saying SOAP is a good idea, I'm just saying they were reacting to something.
02:01s4muelas it were
02:02futilewelp,
02:02SegFaultAXs4muel: 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?
02:02s4muelSegFaultAX: Some of the business logic around event and identity tracking kind of got in the way as well.
02:03s4muelSegFaultAX: 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
02:04SegFaultAXs4muel: How big were services? How many did you have? How did you manage deployment?
02:04s4muelSegFaultAX: The questions get complex when we start dealing with recommendations, and same user different devices
02:06christocallen: I had an ancient version of Leiningen that found nothing when I searched. upgrade fixed that
02:06SegFaultAXTo be concrete, we have a number of things on our current application that I feel would naturally fall out of the monolith as services.
02:07callenchristo: good choice.
02:07SegFaultAXFor example, we do payment processing.
02:07SegFaultAXThat's an /obvious/ case for a service.
02:07s4muelSegFaultAX: 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.
02:07callenchristo: `lein help search`
02:07s4muelSegFaultAX: Deployments were managed as best as possible among different services capabilities and what we could glom onto it from amazon
02:08s4muelSegFaultAX: CDN cache, memcached, etc. Ruby we could deploy without downtime using unicorn, etc.
02:09SegFaultAXs4muel: So you had services running in multiple languages?
02:09SegFaultAX(Other than Go)
02:10s4muelSegFaultAX: 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
02:11s4muelSegFaultAX: There is also a giant data-warehousing / hadoop/hive/EMR/Redshift component at play
02:20callenDo I have a safer/more-robust/edn-based option rather than this? http://stackoverflow.com/questions/17263929/clojure-read-string-on-functions
02:24callenyeah that doesn't seem kosher at all.
02:25callenyeah not gonna work at all.
02:28callenfuck it, gettin' quoted.
02:37SegFaultAXs4muel: How did your services register themselves/find each other?
02:37SegFaultAXAlso, how did you handle routing?
02:43amalloy&(== 6032314514195021674.0 6032314514195021672) ;; really?
02:43lazybot⇒ true
02:44SegFaultAXWut.
02:47amalloySegFaultAX: discovered that while reading http://twistedoakstudios.com/blog/Post4428_unfathomable-bugs-6-pretend-precision
02:47callen(some (fn [x] (= (alength (.getParameterTypes x)) 1)) (vec (.getDeclaredMethods (class fn-name))))
02:47callenOH YES ^^
02:48callenalso (read-string (let [w (java.io.StringWriter.)] (print-dup f w) (str w)))
02:48amalloythe tldr is that longs promote to doubles when comparing, even longs which are too large to fit precisely into a double
02:48callenscary but good to know.
02:48SegFaultAXamalloy: Yea, I see that now.
02:48SegFaultAXCrazy, though.
02:49amalloySegFaultAX: note that i had to use the "sloppy" == rather than the more-careful = to get the unexpected behavior
02:51s4muelSegFaultAX: HAProxy is a great piece of software
02:51s4muelSegFaultAX: in re: routing of services and such (especially over http)
02:52s4muelSegFaultAX: 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
02:52s4muelfor testing and whatnot
02:53SegFaultAXHmm, but haproxy doesn't really do anything for service discoverability.
02:54SegFaultAXI'm assuming then at some point you had a static configuration map of service -> host/proxy
02:54s4muelSegFaultAX: At the end of the day, multicast doesn't run in AWS, so discoverability options that don't suck are limited
02:55s4muelSegFaultAX: And, I mean, not everything is fully auto -- there is a level of human control as to which services are talking to which, etc.
02:56SegFaultAXs4muel: Well sure, but there are other good options. ZooKeeper is a thing, for instance.
02:57s4muelnow you have two problems
02:57SegFaultAXI've used it for distributed configuration, etc.
02:59s4muelThe 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.
03:06s4muelSegFaultAX: A lot of good ideas/projects in this space, more importantly Java-based projects, are the netflix OSS tools like Archaius, Curator, and Hystrix
03:43holoit seems .?. is not available in core. is there any replacement in clojure.core? http://clojuredocs.org/clojure_contrib/clojure.contrib.core/._q.
03:50holooh cool, found it finally: https://github.com/clojure/core.incubator
03:51holognight guys/girls
05:33nonubyseem 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
05:37bb_oz#leave
06:37supersymI'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
06:37supersym't really return 2 values, but how do I rid of the list?
06:38Anderkent[away]supersym: what do you want to do with the return value?
06:39Anderkentyou can always destructure the list with (let [[first second] (for ...)]) and have the values separatedly, or you can build a map with (into {} ..)
06:40supersymok never mind
06:41supersymhiccup is fine with the vectors being in a list, seems to ignore it or at least the rendered HTML is correct so thats good
06:42supersymand i guess can also still work with the zipper this way in the hiccup forms
07:39H4nsdoes clojure have some variables that are bound to the last expressions evaluated in the repl (i.e. like * ** *** in cl)?
07:39turbopapeH4ns, *1 and *2
07:39H4nsturbopape: grazie
07:40turbopapeyou're welcom H4ns
07:54noncomhi, 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?
07:54supersymindices?
07:54noncomi thought that a reduce on the string with manually counting the current index would do, but maybe ther is a better way?
07:54supersymI dont think sets have them?
07:54supersymclojure.set/select
07:54noncomsupersym: no-no, indices in the string
07:55supersymoh ok
07:55noncomi could do indexOf and then drop...
07:55noncombut maybe there is a finer way?
07:56supersymno if you need the indices, treat it the way you suggest is fine I guess
07:57Anderkentif you're finding multiple chars in one string, doing a single scan through the string sounds fine
07:58supersymhttps://groups.google.com/forum/#!topic/clojure/0uSE8smFLb4
07:58Anderkentyou could also iterate indexOf
07:58Anderkentince it has the fromIndex param
07:58supersymyeah or call java.lang.String.indexOf?
07:59Anderkentthe problem with indexof is that you'd have to scan the string per each character
07:59Anderkentgiving you O(mn) instead of O(n)
08:00noncomok if i go with reduce, how do i say "if the current char is found in the set ..." ?
08:00noncom(if #{...} char) does not seem towork..
08:01noncomoh that's nonsense i wrote
08:01noncombut anyway... (select) and see if nil?
08:02Anderkentsets are functions
08:02Anderkent,(#{1 2 3} 1)
08:02clojurebot1
08:02Anderkent,(#{1 2 3} 8)
08:02clojurebotnil
08:03noncomoh cool!
08:04hyPiRion,(map #(.indexOf "foo-bar:baz/zap" (int %)) #{\- \: \/})
08:04clojurebot(3 11 7)
08:04hyPiRionI wouldn't worry too much about the speed, although it's O(n*m)
08:04Anderkenthypirion: he wants a list of all occurences of a char I think?
08:04Anderkentnot just the first one
08:04hyPiRionoh.
08:05AnderkentI got something like this
08:05Anderkent&(take-while pos? (drop 1 (iterate #(.indexOf "foobar1barfoo1" "1" (+ 1 %)) -1)))
08:05lazybot⇒ (6 13)
08:05Anderkentthe drop 1 is yuck but not sure how to handle it other than replicating the .indexOf on the right
08:06noncomyeah, well, i think this is the natural evolution of the indexOf way...
08:06`cbpwhats going on here :)
08:06noncomwhat is the common practice to keep an eye on index during reduce? store it in the acc?
08:07noncomor loop-recur?
08:07hyPiRion,(filter second (map-indexed (fn [x y] [x (#{\- \: \/} y)]) "foo-bar:baz/zap/fu:uh"))
08:07clojurebot([3 \-] [7 \:] [11 \/] [15 \/] [18 \:])
08:07hyPiRionthen do a group-by second if you want them based upon char
08:08noncomwow, cool!
08:08`cbpnoncom: map-indexed
08:08`cbpthen remove nil?
08:08hyPiRion,(group-by second '([3 \-] [7 \:] [11 \/] [15 \/] [18 \:]))
08:08clojurebot{\- [[3 \-]], \: [[7 \:] [18 \:]], \/ [[11 \/] [15 \/]]}
08:08hyPiRionnot the prettiest, hrm.
08:09noncomgotta ten kill the seconds again
08:09`cbpnoncom: or (for [idx x] (map vector (range) coll]..)
08:09supersymfor optional named arguments, the :keys seem redundant with :or, I guess those would still be needed for binding context?
08:10supersymI 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
08:11supersymit's just this particular function has tons of arguments and its getting ugly real quick
08:11`cbpif you have extra arguments shouldnt you be destructuring vector instead of maps? :P
08:12`cbpor nvm i just woke up :/
08:14noncomsupersym: 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?
08:14supersymnah...I answered my own question, its needed for the form (symbols) and expression
08:14noncomwhat?
08:14clojurebotWhat is 2d6
08:14supersymnoncom: probably yeah I was thinking that
08:15noncom`cbp: welcome, welcome :D
08:21geoffegupdate-in seems to create the key in m if it doesn't exist? is there a way to avoid that?
08:24noncomgeoffeg:not with update-in afaik. try first checking if the path exists?
08:27geoffegnoncom: i guess i'd check if the key exists in the function part of update-in?
08:30`cbpgeoffeg: that will create the key and put a nil value on it in most cases
08:30noncomgeoffeg: the function part is applied to the last node in the path, meaning that previous nodes, if did not exist, are created
08:30`cbpyou'd need to check the key previously
08:30noncomgeoffeg: so better used something like get-in or likes
08:31geoffegthanks
08:31aroemerscemerick: 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?
08:32noncomgeoffeg: 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...?
08:32noncombut a separate check might look cleaner
08:33geoffegah, nice. thanks. i'll probably check seperately, the function i'm using update-in is already getting too big, simplifying would be good
08:34geoffeg(but i will look at the src to update-in)
08:35noncomhyPiRion: the last step was (reduce (fn [acc [k v]] (assoc acc k (mapv first v))) {} grouped) but you surely know already
08:36hyPiRionI guessed it was something along those lines, but I think it's a lot more satisfying when people can solve it themselves
08:36noncomsure it is!
08:37hyPiRionactually, you could probably use reduce-kv here: (reduce-kv (fn [acc k v] (assoc acc k (mapv first v))) {} grouped)
08:37hyPiRionDoesn'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
08:37noncomfirst time i hear of this kind of reduce :)
08:38noncomthanks yeah, now i know
08:46shafirehi
08:47shafireI can not decide between compujore, noir and moustache
08:47shafireare there even more web frameworks out?
08:48hyPiRionshafire: there's a set of libraries named pedestal. have a look at pedestal.io
08:49vmarcinkohello, 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?
08:49vmarcinkobecause it seems to me that I managed to do that
08:49vmarcinkoin very simple way
08:49vmarcinkofor eg. (def myagent (agent 0))
08:50vmarcinko(send-off myagent #(identity 55)) ; broken call since it doesnt make sense
08:50vmarcinkoafter this last call it prints the agent, but after I repeat the same call again it throws :
08:51vmarcinkoArityException Wrong number of args (1) passed to: user$eval47$fn clojure.lang.AFn.throwArity (AFn.java:437)
08:51vmarcinkoand when I try to send-off some proper function to it again, it throws same exception again
08:51clgvvmarcinko: yes, if there occurs an exception, the agent wont do anything for the next actions in the default configuration
08:52clgvvmarcinko: one options is to restart the agent via `restart-agent`
08:52tbaldridgevmarcinko: there's a way to change that.
08:52hyPiRionrestart-agent and agent-error are yourfriends there
08:53clgvvmarcinko: there are also different :error-mode s for agent
08:53vmarcinkook thanx
08:53tbaldridgevmarcinko: you can also (set-error-mode! my-agent :continue)
08:53hyPiRionOr set an error handler.
08:54vmarcinkook, 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
08:54tbaldridgevmarcinko: that's what :continue will do
08:54vmarcinkook...
08:54vmarcinkothanx a bunch
08:55`cbpshafire: do not use noir, it's deprecated
08:57`cbpshafire: there's pedestal and luminus which are just sane collection of libraries rather than frameworks.
08:57vmarcinkoone 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
08:57vmarcinko 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?
08:58`cbpvmarcinko: only short names for stuff that is commonly used, otherwise long names are pretty standard
08:58`cbpso 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
08:58`cbpetc.
08:59vmarcinkook, maybe Im just seeing math-related generic examples, so thats why binding names are short
09:00`cbps/time/type
09:00vmarcinkoand hungarian notation for interafces is used in clojure core I see - ISeq etc...
09:01vmarcinkoi also thought its kinda old way of doing stuff (no offense intended, i guess its just preference)
09:01opqdonutthat's not hungarian notation
09:01hyPiRionvmarcinko: that's in clojure.core, you seldom have to think about those interfaces
09:01hyPiRionin general, clojure.core is special because it's, well, the core of Clojure.
09:02shafire`cbp: why is noir deprecated?
09:02hyPiRionAlthough 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#?
09:02vmarcinkoone 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?
09:03tbaldridgevmarcinko: this is clojure...we do things right the first time
09:03tbaldridge:-P
09:03hyPiRiontbaldridge: (doc agent-errors) :p
09:03vmarcinkoi mean, has there been a practice of throing deprecated stuff away, or back comaptibility is too improtant?
09:04vmarcinkotbaldridge: i can see that youre humble guy
09:04tbaldridgevmarcinko: 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
09:04clgvvmarcinko: 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
09:04mgaarevmarcinko: clojure.contrib was deprecated, but in terms of core I don't think anything has been officially deprecated yet
09:05tbaldridgevmarcinko: I jest. But I think the language is just too young to deprecate a whole lot yet.
09:05`cbpshafire: the maintainer moved on to different things. The useful libraries that it had are now called noir-lib or something
09:06vmarcinkotbaldridge: ok, i understood the joke
09:06mgaareRich doesn't deprecate things in core, he just declares certain things 'non-idiomatic' and leaves them in ;)
09:06clgvthere are some deprecated statements in clojure.core though
09:06shafireI see, ok `cbp thanks
09:06hyPiRion(doc agent-errors)
09:06clojurebot"([a]); DEPRECATED: Use 'agent-error' instead. Returns a sequence of the exceptions thrown during asynchronous actions of the agent."
09:06hyPiRion^
09:07hyPiRion,(-> #'agent-errors meta :deprecated)
09:07clojurebot"1.2"
09:07ToxicFrogtbaldridge: 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.
09:07mgaareshafire: also noir originally was not very "clojurey" in that it had some rails-esque magic that the author has disowned
09:14vmarcinkobtw, 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
09:14vmarcinko that has some business method, say Usermanager.activateUser(Long userId), and implementation of that method uses aspects to mark it as transactional
09:15vmarcinkoin 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.)
09:16vmarcinkowhat 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
09:16vmarcinkois there some similar tutorial out there?
09:17mdrogalisIt seems like you're asking how to port an architecture, to be honest.
09:17mdrogalis& a kind of specific one too. I'm hard pressed to point you somewhere that shows that.
09:17lazybotjava.lang.RuntimeException: Unable to resolve symbol: a in this context
09:17mdrogalisHeh, lazybot.
09:18vmarcinkowell, 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
09:19tbaldridgevmarcinko: it's going to look much much different in Clojure... but the gist of it is something like this
09:20mdrogalisI think you'll find its super, super different
09:20vmarcinkois 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?
09:20tbaldridgevmarcinko: replace the ORM with clojure.java.jdbc, all objects become hashmaps, validation/business logic are now functions
09:21tbaldridgevmarcinko: and you need to define transactional for us... as in you want to lock that user while you are using it?
09:22vmarcinkowell, 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?
09:23mdrogalisORM is kind of scorned here.
09:23vmarcinkoi mean, top function wehre the action begins surely has to communicate to DB to open db TX, no?
09:23mdrogalisSo the transactionality gets pushed into the persistence realm.
09:23vmarcinkook, but this doesn't have anything to do with ORM, even plain SQL need db TX
09:24mdrogalisI don't think I'm much help here. Question is too specific/lengthy. :)
09:24vmarcinkoORMs (sometimes) can make things easier in OO land, but its not crucial arhcitecturaly looking
09:24tbaldridgevmarcinko: 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.
09:25tbaldridgealthough I'm more a member of the "do it all in a stored proc" school...
09:25mdrogalistbaldridge: I did something pretty nifty with core.async. Gonna write a blog post tonight, but the gist is this..
09:26jkkramerclojure.java.jdbc lets you wrap multiple queries/statements within a transaction
09:26tbaldridgevmarcinko: 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.
09:26mdrogalisSometimes 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.
09:26mdrogalisThe problem goes away if you put a channel inbetween the watcher and the code reacting to the event :)
09:26tbaldridgehaving 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
09:27vmarcinkook, 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))
09:27tbaldridgevmarcinko: that and use Datomic (shameless promotion)
09:27jkkramervmarcinko: pretty much, exception the commit is usually implicit at the end of the transaction scope, unless you explicitly rollback or throw an exception
09:28vmarcinkook, thas what i wnated to know
09:28jkkramersee https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L487
09:28jkkramerand nested transactions are absorbed into the outermost one
09:30vmarcinkotbaldridge: i wonder how sufficient is free version of datomic for production
09:30mdrogalisIt's pretty good ;)
09:31vmarcinkoand is it possible do add your own custom storage sicne it is not given in free version
09:31mdrogalisvmarcinko: Nope.
09:31shafireWhich ide do you use? With sublime, I have some issues with identation :-(
09:32jkkramershafire: emacs, eclipse, lighttable, vim are popular choices
09:37noncomshafire: ccw under eclipse
09:38shafirethanks
09:38noncomi tried lighttable and although i like the concept, it seems a bit alien. gonna try more sometime and when they advance the versions frther
09:39turbopapenoncom, did it leave alpha already ?
09:39noncomturbopapa: hard to say.. they have version 0.4 now. they say they use it to write it and other code too...
09:40noncomturbopapa: but seems pretty robust in terms of stability
09:40noncomalthough ui definitely needs improvements
09:42blrmnoncom: it is still alpha. i assume it will go closed beta once it gets to that point, since that was a kickstarter perk
09:42noncomblrm: will it be free at the end?
09:43blrmnoncom: the kickstarter perk for a license of LT was $50, not sure what the cost will be once its generally available.
09:44noncomwell, $50 seems affordable anyway.
09:45noncomblrm: btw, maybe you are aware of when do they plan to release? 2013? 2014? 2015?
09:46clgvnoncom: before the next duke nukem? ;) :P
09:46noncomahahah :)
09:46blrmhehe
09:47blrmnoncom: no idea on the timeline. updates get posted here: http://www.kickstarter.com/projects/ibdknox/light-table/posts
09:54clgvnoncom: there were licenses for $15 in the kickstarter campaign as well^^
09:59H4nsdoes 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
09:59noncomi 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:00tbaldridgemdrogalis: nice!
10:01noncomH4ns: afaik it simply realizes the visitor pattern or something along the lines?
10:01H4nsnoncom: 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:02clgvH4ns: if you just want to find certain values in the nested datastructure `tree-seq` might be an option as well
10:03H4nsclgv: ah, that sounds more like it, thanks!
10:04jcromartiethis 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:06arcatanhmm
10:18noncomis there a less cumbersome way to do the same? (here i count 3 intos which add cumbersomeness):
10:18noncom,(into {} (mapv (fn [x] (into [] x)) (partition-all 2 (interleave (range 4 8) "akra"))))
10:18clojurebot{4 \a, 5 \k, 6 \r, 7 \a}
10:19hyPiRion,(into {} (map vector (range 4 8) "akra"))
10:19clojurebot{4 \a, 5 \k, 6 \r, 7 \a}
10:19noncomoh
10:20hyPiRion,(conj {} [:key :val]) ; :)
10:20clojurebot{:key :val}
10:20nifffhttps://www.refheap.com/17641 help for transients
10:20noncomrught :)
10:20noncoms/rught/right
10:21noncomnifff: what's up?
10:21nifffits a functions that works with assoc but not with assoc!
10:21nifffits the same code ifyou can check it out
10:22noncomdo you get errors?
10:22nifffno
10:22nifffbut i get different results
10:22nifffdont know why i am new in clojure and transients
10:23nifffi have two version the persistent and the transient in the next line
10:23nDuffthat... doesn't really look like a use case for transients to me.
10:24nDuffnifff: 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:24nDuffOh. I missed that.
10:24hyPiRionnDuff: He is, at line 100
10:24`cbpwhat's going on :-D
10:25nifffits wrong to call a function with a transient?
10:25nDuffNot _wrong_ necessarily, but a code smell.
10:25nifffif you can try the two exact version and the one its wrong
10:25`cbpyou should probably use java data structures if you wanna share mutable data structures accross functions
10:26nifffyou thing the error comes from sharing transients between functions?
10:26nifffk
10:27`cbptransients are usually used to speed up some operation on a persistent ds. You can check many examples in clojure.core
10:27nDuffnifff: that code is a bit more complex than I'd want to walk to find the actual error.
10:28nDuffnifff: 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:28nDuffnifff: so, it's very believable for there to be a branch in there somewhere where that rule isn't being followed.
10:29nDuffnifff: 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:29nifffyes its large but the lines are exactly the same only assoc changes to assoc!
10:29nDufferr, wrong tool for the job
10:29nDuffnifff: yes, that's the only change, but when you make that change your code has to follow new constraints to be safe
10:29nDuffand the code is too large to analyze for whether it follows those constraints.
10:30nifffthanks anyway i will try again
10:30noncom|2is there a reference paper enlisting the constraints?
10:31nDuffnoncom: it's discussed at http://clojure.org/transients, under "How they Work".
10:31nDuffnoncom: 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:32noncom|2i know, but maybe that helps nifff somehow
10:32nDuffnoncom: (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:32noncom|2oh
10:32nifffi 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:33nDuffnifff: *shrug*. If you think you have a reproducible problem, build the simplest possible test case that demonstrates it.
10:34`cbpwhat is the problem? :-)
10:34nDuff`cbp: inaccurate results when using transients
10:36nDuffnifff: 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:36nDuffnifff: if you're using transients, more items from that sequence can be realized than are actually used
10:36nDuffnifff: ...which will mutate the underlying objects, resulting in inaccurate results.
10:37nDuffnifff: 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:38hyPiRionnDuff: and when you really, really need speed.
10:40`cbpnifff: could you paste the code again?
10:41nifffin reafheap
10:41nifffhttps://www.refheap.com/17641
10:41H4nsis there a nicer way to say #(:foo %)?
10:41hyPiRionH4ns: :foo
10:41H4nshyPiRion: can i pass a keyword as a function?
10:41hyPiRionH4ns: yes
10:41H4nswoha
10:42llasramH4ns: Keywords *are* functions (IFn's)
10:42hyPiRionGenerally, all the places where you have `#(something %)` can be replaced with `something`
10:42H4nsnice. thanks.
10:43vijaykiranis there a shortcut for (take 30 (drop 5 something)) ?
10:44nifffhttps://www.refheap.com/17646 removed some stuff
10:44hyPiRionvijaykiran: if something is a vector, you can do (subvec something 5 35), which runs in constant time
10:44llasramvijaykiran: (->> something (drop 5) (take 25)) uses smaller numbers
10:44vijaykiranhyPiRion: sorry I should have qualified it - something is a line-seq from a file
10:44TimMcNote that the subvec holds a handle on the original vec.
10:45hyPiRionvijaykiran: then I'd do what llasram said. Just be a bit careful when it is realized (but you probably know)
10:46vijaykiranhyPiRion: thanks, I'm using ->> already was just wondering if I missed (foo xs 4 20) kinda function
10:46TimMcllasram: I think that's wrong, though.
10:47llasramTimMc: Oh, yeah, you're right
10:47nifffbye room thanks for the time
10:47llasramOnce again, I really should just never try to multitask
10:48hyPiRionTimMc: huh? (->> something (drop 5) (take 30)) is transformed into (take 30 (drop 5 something))
10:49llasramYeah, but I was trying to be clever and suggested he wanted to take 25, even though that is not correct
10:49hyPiRionoh
10:57hyPiRionTimMc: wohoo!
10:57hyPiRion$google CLJ-1121
10:57lazybot[Release Notes - Clojure - Version Release 1.6 - HTML format ...] http://dev.clojure.org/jira/secure/ReleaseNote.jspa?projectId=10010&version=10157
10:57hyPiRionblr
10:57hyPiRion$google jira clojure 1121
10:57lazybot[Release Notes - Clojure - Version Release 1.6 - HTML format ...] http://dev.clojure.org/jira/secure/ReleaseNote.jspa?projectId=10010&version=10157
10:57hyPiRionOk, I give up, you get me.
11:02jcromartieI 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:02jcromartiei.e. I want polymorphic math functions
11:02jcromartieI've been trying to do it with protocols however I feel like the only way to make it really work is with multimethods
11:02tbaldridgejcromartie: core.matrix comes close I think
11:03tbaldridgejcromartie: https://github.com/mikera/matrix-api
11:03stuartsierraForever ago I implemented 2-argument dispatch with protocols and macros. Unfortunately I lost the code.
11:04jcromartietbaldridge: thanks, that looks like what I want
11:05jcromartiestuartsierra: interesting
11:05tbaldridgejcromartie: not sure that works on scalars though.
11:05jcromartietbaldridge: it does
11:05jcromartie(* (identity-matrix 2) 3.0)
11:06TimMc$jira CLJ-1121
11:06TimMcOh well.
11:07TimMchyPiRion: First hit when I actually go to google.com: http://dev.clojure.org/jira/browse/CLJ-1121
11:07hyPiRionTimMc: I know, same for me.
11:07TimMcFilter bubbling?
11:08TimMcMust be. startpage.com gives the same results as lazybot.
11:09shafiredoes anyone use lib-noir? does one have a hello world example?
11:12jcromartie'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:12swarthyjcromartie: Is that from the 'Wonderful, amazing, useless' article -- or some such title
11:13jcromartieswarthy
11:13jcromartieyes
11:13swarthySaw the title haven't had a chance to read yet.
11:15jcromartieI'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:16hyPiRionjcromartie: do you mean with the Leap Motion thingy, or in general?
11:16jcromartiethe Leap
11:16hyPiRionah
11:17jcromartieso far games and musical instruments feel like the best use
11:18swarthyjcromartie: 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:20jcromartieswarthy: code is about discrete structures, I don't see why continuous input would help
11:20tbaldridgeswarthy: 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:21jcromartieI think it's just too darn squirrely
11:21hyPiRionI'd be happy if I could get some input to my brain, and dump some output back to the computer
11:21jcromartienot the Leap itself, necessarily, but trying to do accurate input with hands floating in the air
11:21hyPiRionNow that's happening indirectly through eyes and fingers
11:22jcromartiecode isn't 3D
11:22jcromartiemaybe it could be
11:22jcromartieif it were, or if we could think of it that way, then maybe something like leap would be useful
11:22swarthycould scope not be '3D'-ish
11:23TimMcWhat I'd love is to be able to expand/collapse function subtrees and just show the backbone of a namespace.
11:23TimMc"Show me fns on the path from A to B and everything here that B relies on."
11:25jcromartieOK, what if scope were on the Z axis, names on the X, and values on the Y
11:25jcromartieer
11:25jcromartieno
11:25jcromartienot quite what I mean
11:26jcromartiemove your hand in and out to step in/out of a scope, with all namespaces at the top level
11:26jcromartieleft and right to navigate positions in the current scope
11:26jcromartieand up/down to change the value of the element at the current position
11:26TimMcWe see in 2D*2, so expanding an interface to 3D in a meaningful and useful way is always going to be hard.
11:26jcromartieyeah
11:27TimMc"2.5D"
11:27jcromartiealright now I'm getting ideas
11:27jcromartiethis could only work with Lisp :)
11:27jcromartieat first
11:28TimMcAnd then more languages as they convert to sexprs? :-D
11:28swarthyyeah, or we have to learn new ways to work with other languages. Where we build on their ASTs.
11:28jcromartiemy arm is getting tired
11:28jcromartie:|
11:29jcromartiea new generation of beefcake programmers emerges
11:29TimMcThat's one of the other problems with haptic interfaces. :-P
11:29swarthyjcromartie: ahah
11:29swarthyIdeally we would get a nice blend. The introduction of the mouse did not destroy keyboard use.
11:29TimMcLight-pen interfaces apparently had limited success partly because they were tiring to use.
11:29swarthyThis new input device doesn't mean eliminating the old.
11:29jcromartieit's useful for navigation but not for input
11:30jcromartieand how do you switch from navigation to input without navigating?
11:30jcromartiebecause you have to move your hand
11:30jcromartievoice?
11:30TimMcFoot-pedals.
11:30jcromartieTimMc: that's not a bad idea at all
11:30jcromartieblinking
11:30TimMcThe answer is always foot-pedals
11:30jcromartie:P
11:31`cbpare there any libraries with some useful file manipulation facilities?
11:31ystaelTimMc: the answer is always a breath controller
11:32TimMcOh yeah! Sip/puff input.
11:32mgaarea flatulantor
11:32`cbpim looking to write something that monitors files, changes permissions on them, zips them and so on
11:32hyPiRionwhoops, there goes my file
11:33TimMchyPiRion: That happens anyway.
11:33TimMcah-- ah-- CHOO:wq
11:33ystaelhyPiRion: silly, that's why you bind sneeze to nrepl-load-current-buffer
11:33jcromartie:wq!
11:33jcromartiemuch harder
11:33hyPiRion:x guys. And I don't even use vim
11:34TimMcThose were the only commands I knew. :-(
11:34dark_elementI have created audio viz project using core.async please take a look. http://kapilreddy.me/examples/korova_drop/
11:36`cbpTimMc: i also know gg"*yG so i can copy everything onto emacs :D!
11:42TimMcI wonder if dark_element was just collecting MP3s.
11:43dpritchettI wrote a toy arithmetic parser that turns "1 + 2 * 3" into '(+ 1 (* 2 3)) and I'm having trouble unit testing it
11:43dpritchettSpecifically my operator lookups - (resolve (symbol "*")) is not equal to the * function
11:44dpritchettI mean they do the same thing, but I wanted to write a unit test like (= * (resolve (symbol "*")))
11:44dpritchettAm I missing something?
11:45llasramdpritchett: `resolve` returns the Vars. You need to `deref` the Vars to access the functions they hold
11:45TimMcYou're probably getting the var instead of its value.
11:45dpritchettHey! deref did the trick
11:45dpritchettThanks!
11:46llasramdpritchett: N.B. also that you may want to use `identical?` instead of `=`
11:47dpritchettIs identical? more forgiving or less?
11:47dpritchett= obviously has character count going for it ;)
11:47hyPiRionllasram: well, for functions, use of = and identical? yields the same result
11:47llasramdpritchett: `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:48llasramhyPiRion: Yeah, but being explicit etc
11:48llasramOk, in the channel we have someone using the nick `so`, and now also `also`?
11:49llasramSomeone needs to jump on `the`, `and`, etc
11:49dpritchettthanks llasram
11:50ljosHi - 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:52saolsenljos: cool, that's useful
11:55ljosI will also translate some of the example projects from the developer site to make it easier for people to get started.
11:55thereforellasram: It's amazing what nicks aren't taken.
11:55llasramhah
11:56turbopapehello people, I am learning clojure, so I started with 1.5.1,
11:56turbopapewill be major changes in 1.6?
11:56llasramturbopape: Nope
11:56turbopapewhen will it be relased ?
11:56turbopapellasram, thank you !
11:56llasramturbopape: Only rhicky knows
11:57turbopapellasram : okay ...
11:57llasramer, rhickey even
11:57llasramBut seriously,
11:58tbaldridgeturbopape: 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`cbpcore is pretty conservative
11:58noncom|2what is planned for 2.0?
11:58llasramYeah. And even then, most of the breakage was because of the contrib library re-shuffle
11:58tbaldridgellasram: I was thinking of numeric stuff, but yeah
11:58tbaldridgenoncom|2: is 2.0 planned?
11:59turbopapeokay ... interesting history, indeed :) !
11:59llasramOh yeah, I guess that too. It didn't actually break any of my code, so I'd forgotten :-)
11:59noncom|2i guess, up to 2.0 there will be polishing, but what about 2.0 itself?
11:59noncom|2tbaldridge: well, if there is 1, there must be at least 2?
11:59noncom|2ot will it stop somewhere on 1.8 or even 1.99999999 ?
12:00tbaldridgeI 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:00hyPiRionit may go on beyond 1.9. 1.10 and so forth is totally doable.
12:00TimMcnoncom|2: There have been breaking changes in 1.x releases.
12:00tbaldridgeto me, 2.0 would mean something like a new compiler, and I don't see that happening anytime in the next few years.
12:01noncom|2then i guess, i must re-phrase: what is most significant changes are planned and known for now?
12:01llasramI'd really like to see all the core things which are implemented in terms of Java interfaces or ad hoc rules become protocols
12:01noncom|2tbaldridge: why no time soon?
12:02noncom|2what's holding?
12:02tbaldridgenoncom|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:02hyPiRiontime and thought. One can't just mash up something new without thinking it through.
12:02tbaldridgenoncom|2: I'm talking about CinC here.
12:03noncom|2tbaldrigde: yeah, i was supposing CinC too
12:03noncom|2so, the project is gathering experience now and tries to define itself better...
12:04tbaldridgethe official list form rich as to 1.6 stuff was here: http://dev.clojure.org/display/design/Release.Next+Planning
12:04TimMcI think the delay is that Rich is waiting on delivery of another thinking hammock.
12:04tbaldridgePart of this no longer applies (the async blocks are now known as core.async)
12:07tbaldridgenoncom|2: but how long until it has the same level of primitive hinting, JIT hinting and AOT support that the current compiler has.
12:09noncom|2i 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:11tbaldridgenoncom|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:11freezinghi. what does ->, ->> and :>> do in clojure? what are they called and where can i read about them?
12:11bbloomnoncom|2: you're assuming that you need a reason to delay, when in reality you need a reason to advance
12:11bbloomfreezing: use doc:
12:11bbloom(doc ->)
12:11clojurebot"([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:11hyPiRion(doc condp)
12:11clojurebot"([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:11bbloomfor :>>, that's just a normal symbol, so … yeah what hyPiRion says, see the (doc …) for the outer form, which is condp
12:12bblooms/normal symbol/normal keyword/
12:12noncom|2yeah, i agree on that all, just wanted to know what is the general anticipation among people in clojureland
12:12freezingthanks hyPiRion & bbloom
12:12TimMcfreezing: -> is "stitch-first" (or "thread-first"), ->> is "stitch-last" (or "thread-last").
12:13TimMcSome people call them threading macros, but I think that's misleading in several ways.
12:13Anderkenttbaldridge: 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`cbpfreezing: you might also wanna use macroexpand-1 with those since they're macros
12:14Anderkentnow sure you can write libs that do it without involving the compiler... But then you're duplicating the
12:14Anderkentgah
12:14glosoliWhat is the most widely used templating engine for clojure ?
12:14Anderkentdidn't mean to send that :P
12:14dnolennoncom|2: but anticipation for what? :) much of what I'm excited about (and would require changing normal languages) is under development as libs.
12:14dnolenAnderkent: I don't see why you can't do that with tools.reader and tools.analyzer
12:15freezingcbp, 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:15Anderkentdnolen: because having the logic duplicated means it can get out of sync with the compiler
12:15noncom|2tbaldridge: 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:16AnderkentI 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:17dnolenAnderkent: and changing the compiler nearly always means inviting unintended bugs
12:17noncom|2dnolen: 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:17hyPiRionnoncom|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:17dnolenAnderkent: the REPL?
12:17bbloomAnderkent: clojure (and clojurescript)'s compilers are incremental to support the REPL
12:17tbaldridgeAnderkent: macros are a major reason, see how ClojureScript punts on this and makes you put your macros in a different namespace
12:17freezingTimMc: bbloom so this is more of a readability issue, i see?
12:17dnolenAnderkent: also most tools will want something richer than what the compiler needs anyway
12:17Anderkentread doesn't macroexpand, does it?
12:18bbloomimo, 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:18Anderkenti dont see how macros impact that
12:18noncom|2hyPiRion: 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:18bbloomAnderkent: macros require explicit staging (phase separation)
12:18bbloomif i define a macro, then define a function that uses that macro, i need the macro to have been compiled first
12:18Anderkentsure
12:18Anderkentthat's cool
12:19Anderkentbut that doesnt mean it has to be compiled before you read the function
12:19Anderkentjust before you eval it
12:19shafirea
12:20noncom|2well,nevermind, it's just mental roaming
12:20bbloomAnderkent: except that would be a *different* dynamic environment
12:20AnderkentI guess what I'm going for is another step between read and eval that would resolve symbols etc.
12:20bbloomwhat if that macro used other macros that *changed* in between definition and use?
12:20Anderkentso that I could for example read the entire file then eval the forms in sequence
12:21Anderkentand get the same result as the compiler
12:22bbloomextensibility and modularity of the evaluation strategy is a separate topic all together :-)
12:23naconI'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:23Anderkentnacon: yes, only classes you explicitly refer to
12:23noncom|2nacon: lucky you, to me, leap motion is still on schedule :)
12:24gtraknacon: if you're just trying to get leap to work, besides the learning, have you seen: https://github.com/quoll/leap-clj ?
12:24naconAnderkent: 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:24TimMcfreezing: Yeah, -> and ->> just let you reorganize code syntactically. Watch out for implicit call-forms, though!
12:25TimMcfreezing: (-> 5 inc) and (-> 5 #(inc %)) aren't the same thing at all.
12:26freezingthanks TimMc. that was helpful.
12:26nacongtrak: 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:26noncom|2nacon: then I would create a wrapper ns, named "leap" and a wrapper for controller there, so it'd be (leap/controller)
12:26Anderkentnacon: 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`cbpfreezing: that's why you use macroexpand-1 :)
12:27freezing`cbp: i am checking out macroexpand-1 right now :)
12:27`cbp,(macroexpand-1 '(-> 1 inc))
12:27clojurebot(inc 1)
12:27noncom|2nacon: and it'd be (:require [my-project.leap :as leap]) and later (leap/controller ..)
12:28naconnoncom|2, Anderkent: Sounds reasonable. I thought this kind of aliasing would Just Work with a bit of magic using the :require keyword.
12:28Anderkentalas, require is only for clojure stuff
12:29naconErr, :import
12:29noncom|2nacon: the restrictive behavior of the java-introp (:import) statement is intended, there was even a discussion on it somewhrer
12:30noncom|2nacon: nothing, however, holds you from creating some facility different from the (ns) macro to handle stuff the way you like
12:30noncom|2but that can get out of hands if done wrong..
12:31Anderkentnothing bare common sense
12:32eggheadlol dnolen what did you do
12:32eggheadhttp://www.nytimes.com/
12:32naconOn 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:32nDuffnacon: Maven has a "mvn" command-line tool
12:33nDuffnacon: even worst-case, you should be telling that to do installs, not building files by hand.
12:33noncom|2nacon: and there also was something like "lein install"...
12:33technomancynacon: deploying native dependencies with an uberjar is a nightmare
12:34naconnDuff: yes I used mvn install, but still I had to write *Pom.xml files for the jar and native dependencies
12:34noncom|2as 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:34nDuffnacon: mvn install should be building adequate-ish POMs for you.
12:34technomancynacon: you don't need mvn to install standalone jar files though
12:34nDuffnacon: well, not necessarily _very_ adequate, but POMs, anyhow.
12:35technomancyyou can do `lein deploy file://path/to/repo randomfile.jar randomfile.pom
12:35nacontechnomancy: 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:36eggheaddeploying tarballs :3
12:36technomancynacon: 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:36justin_smithwe should rename war to jarballs
12:37noncom|2technomancy: are you aware of somehting called "com.jdotsoft.jarloader" ?
12:37technomancy"cry havoc and let slip the dogs of jar"
12:38technomancynoncom|2: haven't heard of it
12:38nacontechnomancy: So I should set this path appropriately and just dump the jars in a native/ directory inside my repository?
12:39Anderkentnacon: java.library.path is for the native libraries, I don't think it unpacks them for jars though
12:39technomancyyeah, pulling .so files out of a jar is a lein-specific tric
12:39noncom|2technomancy: then please please, read this: http://www.jdotsoft.com/JarClassLoader.php and there is the source: http://www.jdotsoft.com/download/JarClassLoader.java
12:39technomancythough some individual libraries roll their own similar behaviour
12:39technomancyovertone, lwgl, etc
12:39eggheadjustin_smith: .jar pretty much is a jarball -- jar xvf somefile.jar
12:40justin_smithegghead: yeah, but war by conventions is a big bundle of jars
12:40noncom|2technomancy: 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:40Anderkentha! TIL there's a jar command. I was always just using unzip after renaming to .zip (because it complained about the extension -.-
12:40noncom|2s/native jars/jars
12:40llasramnoncom|2: You could write a plugin to build JARs which work via that ClassLoader
12:41eggheadwar, huh, what is it good for
12:41technomancynoncom|2: specifically for native dependencies?
12:41technomancyI wonder if this is what overtone uses
12:41eggheadabsolutely nothing (tomcat/jboss/resin notwithstanding)
12:41noncom|2llasram: 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:41technomancynoncom|2: I've never used native dependencies myself
12:41naconOkay, 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:41noncom|2technomancy: that loader solves ALL and ANY native/jar loading issues on any platform and for any bitness
12:42technomancynoncom|2: yeah, it sounds like a plugin is in order
12:42justin_smithegghead: 🎵 bundling up a bunch of dependencies for a webapp 𝅘𝅥𝅮 UH SAY IT AGAN
12:42noncom|2weeeee! (expresses happiness)
12:43egghead:)
12:43technomancynoncom|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:43kasterma(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:43futileDoes core.async make Clojure as good as Go?
12:43Anderkentnacon: 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:43eggheadfutile: wut
12:43nDufffutile: ..."as good as"?
12:43futileYes.
12:43Anderkentif 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:43Anderkentnot sure.
12:43justin_smithdoes #"" make clojure as good as perl?
12:44nDufffutile: if you want to ask if its async model has caveats that Go doesn't, that's a question we could answer.
12:44nDufffutile: but you're asking a completely different question, and one that doesn't really _have_ a single, correct answer at all.
12:44technomancyjustin_smith: how is core.async better than hadoop?
12:44nDufffutile: ("as good as" for what purpose, exactly?)
12:44eggheadtechnomancy: because macros
12:44noncom|2technomancy: 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:44futileConcurrency.
12:44nDuff...
12:44nDuffagain.
12:44eggheadasynchroncity, you can't hit what you can't see
12:44futileAnd parallelism.
12:45tbaldridgefutile: I think it's better than Go. STM, immutable by default, reducers, are all things Go doesn't have
12:45eggheadexplanation is futile
12:45naconAnderkent: 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:45nDufffutile: Clojure has features Go doesn't. Go has features Clojure doesn't. We can't answer that question.
12:45nDufffutile: ...and yes, that's true even when talking only about concurrency &c.
12:45AnderkentnDuff: but apples are better than oranges!
12:45futilenDuff: tbaldridge did.
12:45technomancynacon: 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:46nDufffutile: tbaldridge gave an opinion, not an answer.
12:46tbaldridgefutile: Go has the ability to do an async put/take anywhere in any function. That's cool, not really needed in practice, imo.
12:46futiletbaldridge: But can it handle thousands of goroutines as performantly as Go?
12:46technomancyAnderkent: TAKE IT BACK
12:46tbaldridge(inc nDuff)
12:46lazybot⇒ 5
12:46Anderkentoh god we're going there.
12:46tbaldridgefutile: and an highly biased opinion at that.
12:46technomancy"performantly" seriously?
12:46nDufffutile: core.async can handle thousands of goroutines well.
12:46futileAm I doing it right?
12:46Anderkenttechnomancy: apples are clearly superior as the need to peel an orange is unnecessary burden
12:46tbaldridgefutile: do you need thousands of go routines?
12:47futileHmm.
12:47stuartsierrakasterma: I can't reproduce that, e.g. (some #(when (neg? %) %) (repeatedly 1000000 gen/float))
12:47ambrosebscallen: the closest thing to Maybe/Option in core.typed is (U nil T). It works just as well.
12:47technomancyfutile: next you need to ask if it can it "utilize" all the cores for the best paradigms
12:47tbaldridgefutile: or do you really want thousands of items in a buffered channel with one go per CPU on your system.
12:47futileWell 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:47Anderkentcan does not imply should
12:47nDufffutile: core.async go blocks aren't 1:1 with threads either.
12:47shafiredoes someone use clojure with openjdk successfully??
12:47lazybotshafire: What are you, crazy? Of course not!
12:47eggheadhow big is the async threadpool for core.async
12:47eggheadand is it customizeable at all?
12:47Anderkentshafire: yes
12:47egghead(in the java impl I guess)
12:48shafireAnderkent: 1.7?
12:48Anderkentshafire: we deploy on openjdk 7
12:48Anderkentyup
12:48technomancyshafire: I use nothing but openjdk
12:48futileAre core.async blocks "green" like goroutines?
12:48technomancyhighly recommend it
12:48Anderkentonly problem with openjdk
12:48kastermastuartsierra: It clearly shouldn't happen, but I have a repo that does give me these results.
12:48nDufffutile: cooperative? Yes, they are.
12:48Anderkentis the fucking retards at ubuntu
12:48Anderkentbroke ssl config
12:48stuartsierrakasterma: consistently?
12:48kastermas/repo/repl/
12:48tbaldridgefutile: define green
12:48Anderkenthttps://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/1006776
12:48Anderkentit boggles the mind
12:48kastermastuartsierra: I have a simulate simulation that consistently gave the wrong answers until I changed gen/float to gen/double
12:49nDufftbaldridge: "green threads" ~= "cooperative multithreading". Very, very roughly.
12:49kastermaNot it gives the right results.
12:49kastermaTo see why, I typed the gen/float in the repl. and got the weird stuff.
12:49futileCan core.async utilize all the cores for optimal performance?
12:49nDufffutile: how about you read how it works instead of playing 20 questions?
12:49shafireAnderkent: heh
12:50futileThese kind of things are not exactly evident in the documentation.
12:50shafireI see, okay, thanks!
12:50nDufffutile: ehh, yes, it is.
12:50shafiretechnomancy: thanks
12:50futileThey require expert minds.
12:50kastermastuartsierra: The repo is still open, anything I can type to diagnose.
12:50technomancyfutile: you forgot "paradigm"
12:50futiletechnomancy: dangit
12:50nDufffutile: the documentation indicates that it uses a thread pool.
12:50nDufffutile: so, obviously, it can use multiple cores.
12:50stuartsierrakasterma: 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:50tbaldridgefutile: 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:50eggheadALL THE CORES
12:50futilenDuff: 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:51justin_smithegghead: (+ (ALL-THE-CORES) 2)
12:51kastermastuartsierra: That is what I thought, but now I have this weirdness.
12:51stuartsierrakasterma: 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:51futileThanks for all your thorough and patient answers, tbaldridge and nDuff and technomancy and justin_smith.
12:51noncom|2justin_smith: that should be in the docs!
12:52technomancyhttp://thisotplife.tumblr.com/post/58142081675/showing-erlang-code-to-non-erlang-developers
12:52kastermauser=> (clojure.data.generators/float)
12:52kasterma-63.45589065551758
12:52stuartsierrakasterma: What's the seed?
12:52futileAre core.async blocks optimized to start with a small stack, like goroutines are?
12:52kastermastuartsierra: I didn't manually set it.
12:52kastermaCan I extract?
12:53nDufffutile: the question doesn't actually make sense in the context of the JVM.
12:53futileI thought the JVM was a stack-based VM.
12:53noncom|2technomancy: 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:53stuartsierrakasterma: 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:53futileAnd not a register-based VM like LLVM and Parrot.
12:53Anderkentkasterma: you could try to get the seed from java.util.Random by reflection
12:53nDufffutile: it is, yes. Still doesn't mean the question makes sense. :)
12:54dnolen futile it doesn't make sense in JS either
12:54technomancyfutile: 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:54kastermaAnderkent: I don't know how.
12:54Anderkentone sec
12:54futileOkay, I get the message loud and clear. I'll stop asking questions.
12:54futileThanks everyone for your time.
12:54nDufffutile: ...since there's only as much control as the interface allows.
12:54dnolenfutile: but on CLJ and CLJS it's relatively cheap, a closure
12:54bbloomtbaldridge: dnolen: this works now! https://github.com/brandonbloom/cleff/blob/master/src/cleff/core.clj#L198-L204
12:55callenambrosebs: oh very good to know, thank you!
12:55bbloomneed to clean up the effect-calling syntax, do automatic insertion of "value" effects. and support effect "instances"
12:55bbloombut i think all that is quite doable
12:55Anderkentkasterma: do you have the Random instance?
12:56dnolenbbloom: I'm not sure what I'm looking at :)
12:56Anderkentah it's in *rnd*
12:56bbloomdnolen: that's a trivial, exhaustive, non-deterministic choice implementation
12:56bbloomsee http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/
12:56ambrosebscallen: you can "refine" the type with a conditional. If x : (U nil Number), (if x ;x:Number ;x:nil)
12:57tbaldridgednolen: it's pretty much using ioc_macros.clj to kill monads. So that's roughly the sequence monad....
12:57bbloomdnolen: 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:57bbloomyeah what tbaldridge said
12:57dnolentbaldridge: bbloom: oh hm ... cool!
12:57callenambrosebs: o_O
12:57justin_smithsymbol friendly web search for http://symbolhound.com/?q=clojure+%23+%25+%60
12:57futileBy the way, anyone here know anyone looking to hire anyone?
12:57justin_smiths/for//
12:58stuartsierraAnderkent, kasterma: Sorry, got to go. I'd assume it's a one-time fluke unless you can reproduce it.
12:58tbaldridgebbloom: this is pretty cool. mind bending, but cool
12:58bbloomtbaldridge: :-)
12:58Anderkenthttps://www.refheap.com/17653
12:58kastermaAnderkent stuartsierra I have to go too. If I figure it out, I'll post a bug report.
12:58Anderkentthat will tell you what the current seed value is
12:59Anderkentbut I'm not sure if you can get the *previous* value from that :(
12:59nopromptdnolen: is it possible to build a cljs lib with an optional cli interface? that is, target the browser and node.
12:59kastermaSeed value is 25214903916
12:59Anderkenthm.
12:59AnderkentI must have done something wrong
12:59Anderkentbecause I get exaclty the same value :D
12:59Anderkentah
12:59nopromptjust a bit confused on how to set up the project file for that.
12:59Anderkentmy bad
12:59kastermaWeird
12:59bbloomi 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:59Anderkentlet me update that sript
13:00Anderkenttry now : https://www.refheap.com/17653
13:00kastermaSeed value is 213845663926458
13:00kastermadifferent
13:00kastermaI do really have to leave now though. But with the seed preserved, the bug will live another day!
13:01kastermaThanks@
13:01dnolennoprompt: you can set Node as your compilation target yes
13:01dnolenbbloom: very interesting, I see they talk about probabilistic programming at the end
13:02nopromptdnolen: right, but i'd also like to target the browser too.
13:02nopromptdnolen: that is, if it's possible to set it up that way.
13:03nopromptdnolen: so basically i want to package the browser cljs with the clj code, but the leave the cli stuff optional.
13:03dnolennoprompt: what I normally do is make two directories, one for build one for another, each with the main entry point file
13:04dnolennoprompt: everything else is shared of course, and not a problem since it's on the classpath
13:04dnolennoprompt: http://github.com/swannodette/swannodette.github.com/blob/master/code/blog/project.clj should give you the basic idea
13:05dnolennoprompt: note that different builds have different :source-paths
13:05dnolennoprompt: utils path there is not necessary (I just haven't cleaned it up)
13:07bdruthGood 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:07nopromptdnolen: 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:08dnolennoprompt: no idea, that's a leiningen question outside my expertise.
13:08callentechnomancy: https://github.com/facebook/pfff
13:09nopromptdnolen: oh, well that what i'm hung up on. :)
13:09dnolenbdruth: what do you mean maintain original?
13:09dnolennoprompt: you can probably just put the cli stuff outside the lein source paths but on cljsbuild source paths
13:09bbloomdnolen: my prototype doesn't have all the features yet, but their design is basically an answer to the monad transformer library
13:09bbloomdnolen: if you add "forwarding" of messages up the stack of handlers, then you can get arbitrary composition of effects
13:10dnolenbbloom: yeah I get that part
13:10dnolenbbloom: the composition of effects bit
13:10bbloomdnolen: yeah, the nice bit is that there is no lifting :-)
13:10dnolenbbloom: monad transformers are gross
13:10bbloomdnolen: very.
13:10Anderkentbdruth: you want something like (into {} (map (fn [[key val]] [key (merge defaults val)]) my-map)) I think?
13:11bbloomdnolen: but now ambroseb_ is gonna have to write core.effected too ;-)
13:12nopromptdnolen: 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:12bdruthAnderkent[away]: ok, gotcha
13:12bdruthHere's a gist of what I'm trying to do: https://gist.github.com/bdruth/dc3f0ab4ae70ba9b1505
13:12dnolennoprompt: it only complains about that under simple, not advanced
13:12nopromptdnolen: i saw the jira issue, but that's like a year old.
13:13dnolennoprompt: er I mean whitespace
13:13nopromptdnolen: maybe that's what it was.
13:13dnolennoprompt: there are no issues w/ simple and advanced
13:15bdruthAnderkent[away]: yep, that's exactly what I was looking for - works in the repl, at least ;-) thanks!
13:20noncom|2technomancy: 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:21technomancynoncom|2: lein's uberjar is unrelated to classworlds; probably just coincidental naming
13:22noncom|2technomancy: will you consider creating jdot plugin or maybe should i try and if i succeed - contribute?
13:23technomancynoncom|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:23callenbbloom: where does an effect system encroach on the monad's typical realm of concern?
13:23technomancyhappy to answer lein-specific questions though
13:24callentechnomancy: did you look at the OCaml thingamajig? :D
13:24TimMchyPiRion: Oh wow, I didn't notice that rhickey had approved the ->/->> patch!
13:24callenTimMc: wait what
13:24technomancycallen: yeah, that's kinda nuts
13:24noncom|2ok, 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:25callentechnomancy: the funny thing is, I'm pretty sure they used to have something similar in Haskell.
13:25technomancycallen: I guess this is how facebook engineers cope with having to write PHP?
13:25callentechnomancy: same company, even.
13:25callentechnomancy: uhm, yes it is. Tons of support tooling.
13:25clojurebottechnomancy: couch is insanely irritating and slow.
13:25technomancyclojurebot: that's not nice.
13:25clojurebotGabh mo leithscéal?
13:25callentechnomancy: I talked to them about the HipHip JIT implementation when I interviewed.
13:25noprompttechnomancy: i was asking dnolen if it was possible to cherry pick which cljs code gets packaged with a jar.
13:26callenHipHop*
13:26technomancycallen: 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:26technomancynoprompt: sorry; I've never used cljs
13:27callentechnomancy: 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:27dnolentechnomancy: he's asking a simple question, how to exclude source from a jar
13:27dnolentechnomancy: doesn't really matter if it .clj or .cljs
13:27callenso not excluding a dependency, but a single source file?
13:27technomancyoh sure; `lein help sample | grep jar-exclusions` iirc
13:27nopromptcallen: "PHP muggles" :D
13:28callentechnomancy: which would also explain why I was talking to them about production engineering and their compiler team and not frontline SWE
13:28callennoprompt: >:)
13:28noprompttechnomancy, dnolen thanks :)
13:29TimMccallen: http://dev.clojure.org/jira/browse/CLJ-1121, if that's what you're asking about.
13:30noprompti'm not sure if should be surprised no one has forked the clojurescript compiler to make it emit PHP.
13:30callenTimMc: thank you
13:30callennoprompt: PHP programmers don't know how to write compilers, I'm not surprised at all.
13:30nopromptno callen, you know that's not true.
13:30callenstuff like Facebook only happens when you offer free food and lots of money to programmers that don't use PHP.
13:30tbaldridgenoprompt: someone tried, but they were found in the bay with their feet in concrete
13:30noprompt:P
13:31nopromptoh my.
13:31callenTimMc: this is awesome, thanks for bringing this up :)
13:32rasmustotbaldridge: the bay area
13:33noprompttbaldridge: are you still working on clojure-py?
13:34tbaldridgenoprompt: no
13:35noprompttbaldridge: i was helping with a ruby clojure but, eh, we stopped too.
13:41callenRaynes: got started on Bulwark, thinking about how to efficiently store and query time series data in Redis.
13:43kastermaAnderkent[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:46jcromartiemy new Router from Comcast requires that admin interface passwords be 8 characters in length
13:46jcromartieof course it ships with a default of "password" which I guess technically does conform to that requirement
13:47dnolenbbloom: 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:47bbloomdnolen: heh, OF COURSE you benchmarked it
13:47bbloomi didn't :-)
13:47nifffif i acces a from a recursive function(not recur),a atom,makes the access slow?
13:48bbloomif you see the paper, it can do go routines & shift/reset and all sorts of other stuff too
13:48zphdsguys, what is the clojure-way of tracing nullpointer exception
13:48nifffif i acces an atom from a recursive function(not recur),makes the access slow?
13:48callenzphds: it's not in the stack trace?
13:48bbloomdnolen: 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:48zphdscallen: am not seeing it in the nrepl
13:49zphdsthis is all I have
13:49zphdsNullPointerException clojure.core/name (core.clj:1505)
13:49nifffzphds i use (require '[clojure.repl :refer [pst]]) and call (pst)
13:49callennrepl has an error buffer for dumping stack traces.
13:49callenwell, in emacs it does.
13:49jcromartienifff: the only thing that would slow down operations on an atom would be contention from multiple threads trying to swap! it
13:49zphdscallen: yeah am guessing, someone is catching that exception and just returning it
13:49dnolenbbloom: 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:49jcromartienifff: deref/@ should not be slowed down no matter how you do it
13:50zphdsnifff: thanks I didn't know about pst
13:50nifffjcromartie when i have a recursive function it runs on the same thread ?
13:50jcromartienifff: unless you're recursing in a future or something
13:50dnolenbbloom: but this state machine stuff has definitely got me thinking ... I wonder if we couldn't compile miniKanren into these things
13:50bbloomdnolen: of course you could :-)
13:50jcromartienifff: when you say "access" do you mean deref, or swap!, or both?
13:51nifffboth
13:51bbloomdnolen: but, sadly, i think we desperately need to be able to compile computational effects over dynamic extent
13:51bbloomdnolen: but we can probably get pretty far w/o higher order use of effects
13:51bbloomdnolen: i'd really love to see a defunctionalized clojure compiler
13:51jcromartienifff: could you paste code somewhere?
13:52nifffi 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:52zphdsnifff: awesome, pst is what I was looking for
13:52nifff:P
13:52jcromartienifff: yes, because using an atom will be much slower than passing argumetns
13:52dnolenbbloom: dynamic extent when compiling mK into core.async state machines?
13:52nifffjcromartie how to solve it using state?
13:53`cbpI 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:53jcromartienifff: 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:53callen`cbp: :(
13:53callen`cbp: you're making Clojure look bad :(
13:53bbloomdnolen: just in general. the example tbaldridge used was (map <! chans)
13:53jcromartienifff: also why not use recur?
13:54bbloomdnolen: 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:54jcromartie(if you can)
13:54nifffi cant do it with recur
13:54nifffi have to make a stack going back and forth
13:55nifffhow to use state from a recursive function,and be as fast as parsing the argument in
13:55nifffatoms are slow in this
13:56jcromartieare you sure you can't just do this as a genuine recursive function?
13:56jcromartiebecause yes atoms are going to be slower than arguments
13:56jcromartieno way around it
13:56bbloomdnolen: in theory, i could build core async itself on top of my thing ;-)
13:56dnolenbbloom: heh
13:56bbloombasically add send/receive effects
13:57bbloomthat'd be super cool b/c you could have pluggable handlers
13:57bbloomdnolen: so i could have a "debug" handler that lets me inspect all the channels
13:57bbloomfor example
13:57nifffhttps://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:58nifffa
13:58jcromartienifff: which function?
13:58nifffapply-op
13:58nifffmake
13:58jcromartieyou're depending on those 4 global atoms?
13:59nifffyes,its slow as hel
13:59nifffi have another version with no atoms but i carry 4 arguments
13:59nifffits weird
14:00callennifff: so why not use arguments one?
14:00nifffits like 10x when i carry the args
14:00bbloomdnolen: so why are the state machines faster than core.logic ?
14:00nifffi just asking if i can fix it and keep the state
14:01dnolenbbloom: well core.logic is monadic, but also a lot of things are reified, logic variables
14:01gtraknifff: 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:01dnolenbbloom: also unification
14:02jcromartienifff: it's not weird at all
14:02nopromptdnolen: looks like i had my :externs entry in the wrong place and i was getting an error message. :-/
14:02gtraknifff: don't keep the state if you can help it.
14:02bbloomdnolen: hm ok
14:02dnolenbbloom: 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:02jcromartienifff: passing arguments to functions is what Clojure is particularly optimized for
14:02dnolenbbloom: also sounds like you might be onto something like HANSEI
14:03jcromartienifff: I'd try to rework your API into pure functions
14:03nifffjcromartie ok thanks man
14:03jcromartienifff: what are these things supposed to do?
14:03dnolenbbloom: the probabilistic stuff
14:03nifffhttps://www.refheap.com/17656 the version with pure functions and some add-ons
14:04jcromartienifff what does "bdd" mean here
14:04nifffits a binary decision diagram it takes a boolean formula and converts it to bdd
14:04jcromartiehm
14:05gtraknifff: see if you can change your loop-recurs into reduces
14:05nifffacessing the global state makes aceess slower than passing the arguments to functions right?
14:06gtrakdon't use counters when traversing sequences
14:06gtrakthat would help readability
14:06bbloomdnolen: yeah, so you can implement purely functional state w/ this too. that includes dynamic variables, lazy thunks, etc. all purely
14:06bbloomdnolen: so you could have optional reification of logic variables
14:07bbloomdnolen: 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:07gtrakI still can't see what it's meant to look like in the end, though :-)
14:08dnolenbbloom: 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:08nifffparsing arguments is faster than accesing global state right?
14:08jcromartienifff: I am not sure you're thinking about it quite right
14:08gtraknifff: that's what all this stuff is for: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/IFn.java#L25
14:08bbloomdnolen: 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:09bbloomdnolen: so it's highly amenable to analysis and compilation
14:09bbloomdnolen: but using state machines instead of general stacks is a bit hacky :-)
14:09dnolenbbloom: I don't mean the paper I mean core.async IOC IR
14:11nifffgtrak i dont know what are all those.it make me dizzy :)
14:11bbloomdnolen: oh yeah. the SSA format is *huuugely* useful
14:12callengtrak: apropos: https://github.com/bitemyapp/bulwark/blob/master/src/bulwark/core.clj#L18-L23
14:12jcromartienifff: see https://gist.github.com/jcromartie/6233620
14:13jcromartienot only does state make simple things more complicated, but it's slower because atoms have to compare-and-set and all that jazz
14:13dnolenbbloom: yeah, this might be the next step for core.logic ...
14:14jcromartienifff: 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:17nifffjcromartie thanks man i should have the test first,bye room :)
14:28bbloomdnolen: 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:29bbloomtbaldridge: 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:30dnolenbbloom: something like that I think, though not sure about the giant part, don't want to run afoul of JVM method size limits.
14:30bbloomdnolen: i think it might make sense to compile each state to a method & then compile a giant switch statement
14:30bbloomdnolen: the switch statement would probably compile down nice & small and be fast, then each method could be individually jit-ed
14:30bbloomcan probably make core.async faster w/ that strategy
14:31dnolenbbloom: yes that would be ideal
14:31tbaldridgebbloom: interesting....I'm going to have to try that.
14:31hiredmanthe 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:31bbloomtbaldridge: i can just keep creating work for you via irc all day long if you don't stop me :-)
14:31tbaldridgebbloom: 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:32bbloomtbaldridge: hm ok
14:32tbaldridgeI really want goto in clojure...although that is the last time I will ever say that in IRC
14:33bbloomtbaldridge: would recur-to solve the issue?
14:33callentbaldridge: undelimited continuations?
14:33hiredmanif 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:33tbaldridgebbloom: perhaps, depends on how it's implemented
14:33bbloomtbaldridge: as gotos :-P
14:33bbloomgotos respecting a stack disciplin, that is
14:34creeseI'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:34bbloomtbaldridge: 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:34samratthis 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:34bbloomtbaldridge: my solution was to just get-object for the VALUE-IDX and return nil from the :Return handler
14:34callencreese: event sourcing. Also, look at Datomic for ideas.
14:34samratI just get nil
14:36bhaumansamrat: i just ran it and it worked for me
14:37creesecallen: this feels like a problem datomic has solved, that's why I was asking here
14:37tbaldridgebbloom: yeah, I should fix that
14:37callencreese: well, it is, but Datomic isn't necessarily for everybody.
14:38callenIt *is* very cool though :)
14:38creesecallen: yeah, I can't use it for work
14:40bhaumandnolen: bbloom: I think I just came up with a reasonable use case for channels on channels
14:40ozzloyhow 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:41bbloombhauman: there are many reasonable use cases :-)
14:41samratbhauman: strange. restarted the repl and now its working
14:41bhaumansamrat: probably output flushing problem
14:42bhaumanbbloom: I guess I had a subconscious question mark at the end of my previous statement
14:44bhaumanI have been wrestling with this binary machine that's needed for drawing messages.
14:45dnolennice you going to post about it?
14:45dnolenbhauman: ^
14:45bhaumandnolen: I think so
14:47bhaumandnolen: 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:48dnolenbhauman: oh right, you're thinking about removing that bit of duplication
14:49bhaumandnolen: 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:51H4nswhat kind of literal number is "1N"?
14:51bbloom,(class 1N)
14:51hiredman,(type 1N)
14:51clojurebotclojure.lang.BigInt
14:51clojurebotclojure.lang.BigInt
14:51bbloomlol
14:51H4nsah, interesting, thanks!
14:52dnolenbhauman: sounds pretty reasonable, along the lines of what I was thinking with the helpers
14:52dnolenbhauman: that I gisted
14:54ToxicFrogIs 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:54callenToxicFrog: EPL
14:54technomancyToxicFrog: MIT is terrible for US hackers; it contains no patent protections on contributions
14:55bhaumandnolen: 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:55callenToxicFrog: read it: http://www.eclipse.org/legal/epl-v10.html
14:55technomancymight be OK for folks in more civilised countries though
14:55callenToxicFrog: just use EPL.
14:55technomancybut please have pity on us poor US hackers =)
14:55dnolenbhauman: yes, I mean the helpers by themselves definitely not enough :)
14:56dnolenbhauman: looking forward to seeing what you come up with, sounds like something that could be a common pattern
14:57bhaumandnolen: i with definitely let you know
14:57gtrakcallen: is that bulwark function really ok? every function will pass, no?
14:58gtrakor... does .getDeclaredMethods not include abstract impls?
14:58callengtrak: I'm not saying it's kosher, I'm still finding ways to break it by passing it random things.
14:58callengtrak: that's like v3 of it.
14:59ToxicFrogcallen: alright.
14:59callenThe goal is to verify that arity-1 for fn and a var to an fn (defn) are going to work when invoked.
15:00callenI could "simplify" by just wrapping (fn nil) in an try/catch and returning true/nil based on success.
15:00callenI was hoping to avoid doing that, but I don't mind obligating users to send me pure fns.
15:00gtrakmeh, just let exceptions happen?
15:00callengtrak: do you understand what bulwark is for?
15:00bhaumanbbloom: 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:01callen"letting exceptions happen", pushes exceptions from app init to app runtime.
15:01callenI'd rather not do that if I can help it.
15:01gtrakah
15:01bbloombhauman: 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:01callengtrak: your notions are probably best for the nicest possible code though.
15:01callengtrak: thanks for your thoughts :)
15:01gtrakcallen: I guess that makes sense in some weird twisted way :-)
15:02dnolenbhauman: it's reasonable if you've thought it through as bbloom alludes. I don't think I saw anything problematic in your post.
15:03bhaumanbbloom: dnolen: thanks, that helps
15:13gtrakcallen: not sure of its usefulness, but a protocol/reify might be a better fit
15:13gtrakit at least means the client had to be extra-conscious of what he's passing in
15:14callengtrak: 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:14callengtrak: that's a good idea if the "contract" being enforced gets any hairier
15:15gtrakyea, those things are in tension
15:16callenI'll just write better documentation and keep the code lightweight for now.
15:16callengtrak: thanks again!
15:19`cbp`callen: does the compiler not yell at you for (defn arity [fn]..) ?
15:20dark_elementI 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:20dark_elementdnolen, you might want to check this ^
15:21callen`cbp: seemingly not.
15:21callen`cbp: I can run it again to check, but I'd rather not just right now.
15:21gtrak`cbp: nope, clojure is dynamic.. it'll at least yell at you for using symbols not in scope.
15:22`cbpcallen: 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:22gtrak`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:22TimMc&(let [fn 5] fn)
15:22lazybot⇒ 5
15:22TimMc&(let [do 5] do)
15:22lazybot⇒ nil
15:23gtrakit 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:23lazybot⇒ #<sandbox80477$eval84166$fn__84167 sandbox80477$eval84166$fn__84167@15da4b>
15:23TimMc¯\_(ツ)_/¯
15:23dark_elementand the same project in action http://kapilreddy.me/examples/korova_drop/
15:23TimMcdark_element: It didn't work when I tried it.
15:24`cbpI just bind my functions to f to avoid headaches :P
15:24gtrak`cbp: that does CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:1) in my repl
15:24gtrakI think something's weird with the sandbox
15:24dark_elementTimMc it will only work on Chrome right now.
15:25`cbpgtrak: yeah, some also returns false or true and then he's comparing it to 1
15:25TimMcOh! Well then.
15:26TimMcIt renders better in Firefox. :-P
15:26dark_elementTimMc, it uses wegGL and audio API.
15:26dark_elementTimMc, ohh it works in firefox?
15:26TimMcNo.
15:26TimMcBut the loading indicator is smoother.
15:27TimMcI get "repl is not defined" in both Chrome 28 and Firefox 23.
15:28XapakHello.
15:28XapakAnyone using/tried Light Table)
15:28Xapak?*
15:28`cbpa while ago
15:29tbaldridgeXapak: I try each new version. But with no paredit I close it within about 10 minutes
15:29XapakI just wanted to try it out, but it keeps complaining about not being able to. clojure is in PATH, so... :'(
15:29`cbpthen 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:29gtrak`cbp: we used it for a demo to appeal to ruby folks.. to not scare them with emacs :-)..
15:30dark_elementTimMc, firefox does not have an audio api support or I am not aware of the alternative.
15:30dark_elementTimMc "repl is not defined" should not break anything. What do you see after loading indicator?
15:30dark_elementTimMc does mp3 start playing? or nothing happens?
15:30gtrakit's the closest thing to DrClojure right now
15:30`cbpXapak: you need java on your path
15:30`cbpXapak: and possibly lein too, not clojure
15:31TimMcdark_element: The loading indicator doesn't go away.
15:31Xapaklein is, but I have no JAVA-related environment variables. That might be it. clojure standalone and other projects work just fine.
15:32`cbpgtrak: I was teaching some friends clojure but they didnt like lighttable, one used notepad++ and the other eclipse :)
15:32dark_elementTimMc, does it generate any errors in js console?
15:33`cbpXapak: if you can run java -version from a terminal then it should be fine
15:33callengtrak: Ruby programmers are easily frightened and when they feel threatened they retreat to Twitter and #RUBY_DRAMA
15:33callenone should never corner a Ruby programmer
15:33gtrakheh, yes
15:33Xapak`cbp, I can do that just fine. :'(
15:33callenthey're diseased and their teeth can transmit infections.
15:33gtraksome are receptive though, the ones that know how to get sick of bad things
15:34TimMcdark_element: No further errors or activity.
15:34Xapak`cbp, oh, well, maybe it’s because I’m using OpenJDK. (troll)
15:34`cbpXapak: well I have no idea but maybe lighttable has a mailing list?
15:35ozzloyhow 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`cbpemacs frightens me too sometimes. There was a time when autocomplete would segfault when getting the docstring
15:35`cbpThen I switched to emacs live /shame
15:36callen`cbp: whatever works man :)
15:36bhaumandark_element: in chrome it jumps me to the embedded player
15:37bhaumandark_element: I'm on OSX
15:38TimMcUbuntu Linux here.
15:39ozzloyis this not the channel for that sort of question?
15:40dark_elementbhauman, are there any errors in js console?
15:41llasramozzloy: This isn't necessarily the proximate problems, but nested `def` etc forms are pretty much never what you want
15:41bhaumandark_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:41llasramozzloy: `def` always creates/updates a Var in the compilation-time namespace, not in the lexical scope
15:41ozzloywell, i can change it to a let, but i'm guessing i'll get the same
15:42ystaelozzloy: "System.console returns null if there is no console": http://stackoverflow.com/questions/4203646/system-console-returns-null
15:42ozzloyystael, llasram thanks!
15:42bhaumandark_element: no console messages occur before the drop
15:43gtrak,(do (let [a (def b)]) b)
15:43dark_elementbhauman, ok
15:43clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
15:43gtrak&(do (let [a (def b)]) b)
15:43lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
15:43gtrakugh.. here :-).. user> (do (let [a (def b)]) b) .... #<Unbound Unbound: #'user/b>
15:44dark_elementbhauman, let me make a few changes that will make debugging little easier.
15:44bhaumandark_element: sure
15:45ozzloyis there a better way to grab user input without echoing in clojure, other than through java's Console?
15:45gtrakozzloy: more poignantly: user> (do (let [a #(def c)]) c) .. #<Unbound Unbound: #'user/c>
15:45`cbpozzloy: there's all the java ways
15:46amalloygtrak: (do #(def c) c)
15:46ozzloyi 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:46gtrakamalloy: fine :-)
15:48`cbpozzloy: 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:48ozzloyi mean via command line
15:48ozzloyso, running at bash
15:48dnolendark_element: looks neat though I think the code could use some cosmetic refactoring (I really hate clojure-mode formatting)
15:48ozzloyor what-have-you
15:50ozzloyi'm also not too familiar with java
15:50ozzloyso i'll look into that too
15:50ozzloy`cbp, thanks!
15:50`cbpozzloy: maybe like (def scanner (java.util.Scanner. *in*))
15:50dark_elementdnolen what do you suggest?
15:50H4nsanyone 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`cbpozzloy: then you can do like (.nextLine scanner)
15:51ddellacostaIs 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:51gtrakH4ns: do you have a reason to think that would be an issue?
15:51H4nsgtrak: yes. i can't see my scheduled task execute, which is why i ask
15:52gtrakH4ns: I would try to trace the execution before I think of something like that.
15:52dnolendark_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:52dnolendark_element: don't repeat by-id, just access the element once
15:53dark_elementdnolen, all right.
15:54H4nsgtrak: yeah, that is what i'm trying, but that does not yield much. maybe i should avoid http-kit's timers
15:55dnolendark_element: again it's mostly cosmetic, obviously can't use dochan where you have some loop state, the demo itself is very cool
15:55dnolendark_element: pretty nice considering you haven't used CLJS before, had you used CLJ?
15:55dark_elementdnolen, thanks!
15:56gtrakH4ns: at first glance, it seems very minimal. You could probably just use the built in java timer and Timertask instead.
15:56dark_elementdnolen, yup I use CLJ at work.
15:56dnolendark_element: good stuff, it's great to see so much CLJS popping up :D
15:56H4nsgtrak: yeah, there is not much to it. it would just have been nice if it worked :)
15:57gtrak'works' is in the eye of the beholder :-)
15:58H4nsgtrak: hence my original question ("familiar"). maybe something not apparent from the documentation is needed.
15:58H4nsgtrak: but thanks anyway
15:59dark_elementdnolen, cljs + core.async is too good to ignore.
16:01H4nsgtrak: and the solution is... i was looking for output in the wrong buffer :/
16:02gtrakH4ns: doh
16:09dnolentbaldridge: did you see this, http://www.slideshare.net/aysylu/aysylu-loom?
16:09dnolentbaldridge: the last few slides are doing graph analysis of core.async SSA
16:09tbaldridgeI was just going look at it
16:11tbaldridgednolen: 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:15TimMcI 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:21dnolenTimMc: Aysylu forked it pretty cool how she applied it in so many different ways
16:21zenoliI'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:21zenoliBeen using a wrapper to use JUNG for visualization.
16:24dark_elementdnolen, did all the audio viz work for you? Since I am using couple of different things in each some might break.
16:25dnolendark_element: it seemed too
16:25dark_elementdnolen, great!
16:38boblarrickGetting "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:41justin_s`boblarrick: maybe it is from a nonstandard mvn repo?
16:42justin_s`that is, one you have configured to use on one machine and not the other
16:43boblarrickHrm, hope not, cause I sure don't know anything about doing that
16:44justin_s`are your ~/.lein/profile.clj files the same on both?
16:44justin_s`*profiles.clj that is
16:45boblarrickdon't have one on either machine
16:47justin_s`try one of these versions maybe? http://mavenhub.com/c/gnu/crypto/registry
16:47justin_s`it could be that version is obsolete so no longer deployed, but cached by your machine locally
16:48justin_s`(that is the kind of package that would be invalidated for security reasons for example)
16:48justin_s`see if changing the version to 2.0.5 fixes it
16:48boblarrickI'm not depending on it myself, i reckon something I require is, how can I find out what is requiring that?
16:49llasramboblarrick: Try `lein deps :tree`
16:50justin_s`also if you explicitly require a different version, that can override the other package's nested dep
16:51justin_s`it is a good idea to add it to the other package's :exclusions list in that case
16:52hugodIf 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:53boblarrickI 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:54justin_s`boblarrick: the jar will be under your other machine's .m2/repositories/
16:54justin_s`you can put it in the exact same path on the new machine
16:54justin_s`but I recommend against using deprecated crypto unless you really know what you are doing
16:54justin_s`they probably stopped providing it for a good reason
16:54llasramAnd of course it will then continue to fail to build on any future machine as well
16:55boblarrickI don't , but a java library I'm using from clojure depends on that
16:55justin_s`llasram: yeah, that too
16:55boblarrickso unless they update their dependency, which i have no control over, not sure what else to do
16:55llasramYou have total control over it, as justin_s` described above
16:55justin_s`in your project.clj require the newer version
16:56justin_s`in the req that subdepends, add an :exclusions entry
16:56justin_s`so that it cannot try to get the old version
16:56justin_s`the github page for leiningen has examples of using :exclusions
16:57futileinstead of "extremely" or "incredibly" or "immensely", use the word "intensely" from now on
17:02boblarrickOk, 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:02boblarrickthanks for help
17:05justin_smithman, he already left - the dep is the easy part
17:05justin_smithhah
17:08hugodlooks like my clojurescript problem is caused by something affecting the order of js libs in the compiled js file
17:22shafirecan a defn name be just numbers?
17:23justin_smithshafire: no, because otherwise numbers would be ambiguous
17:23justin_smithdefn has the same rules as def
17:23shafireok, thanks
17:24kristofshafire: ...why would you do that? I'm curiuos about the use case.
17:24bbloom(def 1 2)
17:24bbloomthat'll teach em to try to read me code!
17:24shafirekristof: (route/not-found (404))
17:24shafire:D
17:25kristofbbloom: 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:25justin_smithas a number theory thing you could (defn 2 (partial * 2))
17:25llasramIt is probably unambiguous in the call position....
17:25kristofbbloom: But not great for anything else numbers are used for.
17:25justin_smithllasram: in a lisp-2 that would make sense
17:25justin_smithlisp-1 opts out of that sort of thing
17:25bbloomkristof: are you thinking of church numerals?
17:26llasramjustin_smith: Haha, you said "lisp-2" and "make sense" in the same sentence!
17:26justin_smithLOL
17:26`cbpkristof: maybe sicp :)
17:26`cbpoh
17:27justin_smithshafire: how about have a response function, that gets called like (response 404)
17:28kristofbbloom: Oh, shit, yeah
17:28kristof`cbp: Heh, yeah, I found that in SICP.
17:28shafirejustin_smith: nice idea, thanks
17:28kristofAm I the only person who found Chapter 4 and 5 to be utterly useless, save for some key things?
17:28`cbpI've seen a four_oh_four function before
17:28`cbpmaybe it was python
17:29kristofThe 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:29glosolikristof: sorry to interrupt which book it is ?
17:29callen`cbp: yeah.
17:29`cbpglosoli: structure and interpretation of computer programs
17:30ProfpatschHi guys.
17:30kristofglosoli: 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:30kristofEveryone's using Python now.
17:30justin_smithSICP great lisp-centric intro to cs, available for free at this point
17:30callenkristof: :(
17:30callenthat's such a waste.
17:30glosoliah ok thanks , just got me wondering lol
17:30kristofjustin_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:31kristof*what makes SICP great
17:31kristofcallen: Why? I don't think it is. Python is a good language and it gets people going. =)
17:32callenthe Scheme version was deeper.
17:32justin_smithIt is no "let over lambda", but there is a definite lisp approach in the book
17:32brehautlanguages with statement / expression separation make for an lessons that take a while to untangle
17:33justin_smithyeah, scheme is great for introductions because it so vicisously eliminates special cases
17:33callenviciously
17:33justin_smith*viciously
17:33justin_smithheh
17:34callenScheme really is superior as a teaching language, even if Python is more popular.
17:34brehautviscously
17:34ProfpatschI hope you guys are more clever than I am.
17:35ProfpatschI don’t have a clue whether to use for, reduce or iterate for a function.
17:35nDuffkristof: 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:35ProfpatschOr something else entirely.
17:35callenProfpatsch: why not describe what you want to do and provide some code?
17:36ProfpatschAt it. ;)
17:36kristofnDuff: 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:36gtrakI thought engineering's supposed to be rigorous? python's a fine language, but scheme is foundational.
17:36amalloythe 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:36Profpatsch(defn combine-lines
17:36gtrakwhen I was a freshman, I thought scheme was totally irrelevant, but here I am..
17:36Profpatsch "Combines strings in a collection into lines not longer than the breakpoint."
17:36Profpatsch [coll breakpoint]
17:36Profpatsch …???…
17:36Profpatsch )
17:36technomancynDuff: "When did universities become trade schools?" <- you want an exact date, or what? =)
17:37kristofI 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:37justin_smithiterate 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`cbpProfpatsch: use refheap.com when you wanna paste code
17:37bbloommore depressing is that the trade-school-ification of universities has made for *worse* tradesmen
17:37kristofI 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:37kmicu"Python -- there is only one, degenerate, buggy, poorly-composed, verbose way to do it."
17:37ProfpatschI want to combine an array of strings into an array of line-strings not longer than breakpoint.
17:38kristofBut 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:38ProfpatschWithout doing it iteratively. I just can’t imagine how to do it in a functional way.
17:39gtrakbbloom: 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:40justin_smithProfpatsch: sounds like a job for reduce, especially if you can use clojure 1.5 (reduction)
17:40ProfpatschThanks, I will look into it.
17:41callenkristof: it's not like building "practical" things is all that inaccessible.
17:41callenkristof: university is supposed to make depths of knowledge available to you that are difficult to acquire independently (typically).
17:41gtrakit's like 'new math', of course it will never work.
17:42callengtrak: new math was actually supposed to be more foundational and less practical in some respects.
17:42justin_smithProfpatsch: (reduce (fn [el [line lines]] (if (> (count (str el line) ...) ...))...) ["" []] lineseq) something or another along those lines maybe?
17:42gtrakcallen: yea, I might be thinking of something else, now that you mention it... new new math :-)
17:43justin_smithI 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:43shafireis there something like Nunjucks for clojure?
17:44technomancyshafire: I have no idea what that is, but I hope so.
17:44gtrakactually, my (really good) calculus teacher had the best argument against metric. "Have you ever tried to build something in metric?"
17:44nDuffshafire: it'd be an easier question to answer if it didn't assume knowledge of what "Nunjucks" is.
17:44kristofcallen: 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:44shafirewhich clojure template system supports template inheritance?
17:44`cbpshafire: Selmer
17:45callenshafire: Selmer
17:45callen`cbp: gerd dermmert lol
17:45shafire`cbp: callen: looks like nunbla :) thanks
17:46`cbplike what :(
17:47technomancyhttps://twitter.com/panzertime/status/367747114014482432 <- sounds legit
17:47shafire`cbp: nunjucks
17:47justin_smithgoogle for nunbla -> "did you mean nambla?"
17:47brehauttechnomancy: what the
17:47callenshafire: 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`cbpdo the js guys have pet names for their libraries? :P
17:48callentechnomancy: LOLWUT
17:48technomancybrehaut: I was gonna put a star of david into the lein repl startup message, but that tweet convinced me not to.
17:48callen`cbp: they choose weird names and nobody else knows what the hell they're talking abut.
17:48justin_smithwith a name like panzertime what do you expect?
17:48brehauttechnomancy: lols
17:49shafirecallen: thanks!
17:49kmicuWunderbarPanzerkampfwagen 2.0
17:50callenshafire: thank yogthos
17:50shafireyogthos: thank you!
17:50shafirecallen: his project?
17:50callenshafire: `cbp and I kicked in, but it's mostly his labor.
17:51callenshafire: 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:51callenbut without yogthos, no library :)
17:51shafireah, okay. :)
17:56gtraktechnomancy: will you accept a pull-request for a ascii art rabbi in leiningen?
17:56johnmn3g'day
17:56johnmn3Anyone out there using luminus?
17:57callenjohnmn3: some of us. Don't need to ask to ask, just ask. :)
17:57shafireselmer works nice, thank you!
17:58johnmn3I'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:58johnmn3they use (defn upload-page [] (layout/common [:h2 ....
17:58callenshafire: glad it was useful. :)
17:58johnmn3but that uses a hiccup template, I assume.. and the latest uses selmer
17:59johnmn3so I'm not sure how to reconcile the file-upload docs with the new selmer template
17:59callenjohnmn3: they just need updated. I'll let yogthos know.
18:00johnmn3I set up home.html with what I believe are the appropriate form details
18:00callenjohnmn3: notified. we'll follow up on it.
18:01callenjohnmn3: thanks for bringing it up.
18:01johnmn3and I'm getting Exception: java.lang.NullPointerException: null
18:02johnmn3FileInputStream.java:158 java.io.FileInputStream.<init>
18:02johnmn3callen: good deal. Thanks callen. Any idea how to fix it?
18:05`cbpjohnmn3: that may be that its not finding your home.html
18:12johnmn3`cbp: I updated the home.html directly. gave it <form action="/upload" method="POST" enctype="multipart/form-data">
18:12johnmn3and in defroutes I have (POST "/upload" [file] (handle-upload file))
18:14johnmn3and I have a function called handle-upload with (noir.io/upload-file "/" file), per the docs... maybe I'll try "/upload" there...
18:15johnmn3nope
18:18callenjohnmn3: just so you know, Luminus is by and large vanilla Ring/Compojure
18:18callenjohnmn3: so any advice concerning how to handle file uploads in Ring/Compojure would probably be applicable here.
18:21justin_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:31johnmn3callen: that's what I'm hoping.
18:31johnmn3justin_smith: thanks justin
18:32justin_smiththat is what I use in my ring apps
18:33justin_smiththere 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:41gtrakis there anything in clojure 1.5.1 vs 1.4 that would break equality for records?
18:42ptimeis there a list anywhere of simple project ideas for new clojure users?
18:43gtrakptime: build a small webapp, deploy it on heroku, lots you can do. I keep one with handy utilities, like json->clj conversion.
18:44ptimeok will keep that in mind
18:46gtrakptime: what are you interested in, though?
18:46ptimeidk really
18:46ptimei always liked lisp, never did anything super "useful" with it
18:46ptimejust tried to do super recursion and stuff
18:47brehautptime, i built my website, and a stupid irc bot, along with various data munging programs and some solved some math puzzles
18:47gtrakdo you want something especially amenable to lisp/clojure or something you could do in aother languages?
18:47ptimei was thinking along the lines of math puzzles ys
18:47ptimesomething aimed towards clojure but w/e works
18:47brehautptime: have you looked at 4clojure ?
18:47ptimeuh, yeah i've poked around a bit
18:48brehautptime: theres always project euler
18:48brehautboth those will stretch your small scale problem solving in clojure
18:48ptimeaha
18:48ptimeproject eulre
18:48ptimeI had forgotten about that, was trying to remember
18:48brehautbuilding boring but understood software like blogs and todolists etc will stretch your understanding of how larger projects hang together in clojure
18:48ptimethanks, needed that memory jog more than anything else
18:56bbloomyeah, that tends to happen
18:57bhaumanit sinks in slowly and then before you know it wham
19:03`cbpI have a lot of small clojure monitoring apps. Is there a tool somewhere that could let me monitor and maybe synchronize these apps?
19:06bhaumanthis is the code I'm so psyched about https://www.refheap.com/17665
19:07bhaumandnolen: ^^ did you already write this?
19:07`cbpno system monitoring library around? :)
19:09ToBeReplaced`cbp: i don't know what you're asking about... are you looking for ganglia?
19:11gtrakcan you put clojure itself in a lein checkout? I need to git bisect something.
19:11technomancygtrak: you would need to add a fake project.clj to your clojure checkout
19:11gtrakthat's what I figured.
19:11gtrakthx for confirming
19:12gtrakupgrading to 1.5.1 is messing up the order of random stuff that ends up in records constructors..
19:13gtrakand 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:13brehautcan anyone remember the talk rhickey (i think) gave about services as an abstraction boundary?
19:14`cbpToBeReplaced: 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:16ToBeReplacedbhauman: The Language of the System?
19:16johnmn3so 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:16johnmn3getting error: 013-08-14 18:52:58.996:WARN:oejs.AbstractHttpConnection:/upload java.lang.AssertionError: Assert failed: (not (depends? graph dep x))
19:16johnmn3I 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:17johnmn3I tried adding a sleep, but that doesn't seem to have an effect.
19:17bhaumanToBeReplaced: liked that a lot, but I was referring to clojure
19:18ToBeReplacedoh, message was meant for brehaut, oops... both start with b :)
19:19brehautToBeReplaced: aha thanks
19:19brehaut(inc ToBeReplaced)
19:19lazybot⇒ 1
19:24bhaumanthought it was a late reply
19:26brehautbhauman: i really enjoyed your dots post
19:26brehautbhauman: it works just fine in firefox too btw
19:27bhaumanbrehaut: thanks man, working on a post which refactors the code in that post right now
19:29bhaumanbrehaut: you did try it in chrome though right? It plays much better.
19:29brehautbhauman: i tried it on ios
19:31brehautbhauman: the animation is smoother in chrome, but the game play was just as good in ffx
19:32bhaumanbrehaut: great! thanks for letting me know
19:33brehautbhauman: 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:34brehautim looking forward to see how the refactored dots cleans up
19:36bhaumanbrehaut: 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:36bhaumans/time/timing/
19:36brehautyeah it looks fantastic
19:36brehauti'd love to see how core.typed plays with it too
19:37brehautmodule ambrose having to type the dom :P
19:37brehauts/module/modulo/
19:37bhaumaninteresting. I haven't looked at it yet
19:37brehautive only dabbled with it in clojure
19:38bbloombrehaut: 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:38brehautive been impressed, although theres still a lot to go
19:38brehautbbloom: yeah, the dom spec itself is defined with IDL types; its not hard, just crap work
19:38brehautand a lot of crap work
19:38gtraktechnomancy: 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:38brehautbbloom: from memory typescript spends something like 5000 lines defining all the relevant types
19:38gtrakI tried copying it over to the host project, and making sure the dirs were specified in the project.clj
19:39technomancygtrak: missing :resource-paths in the dummy project.clj I'd guess
19:39brehautbhauman: my gut feeling is that static types on web projects will pay off more on the client than on the server
19:40gtraktechnomancy: ah, I think I figured it out :-), the contents are version=${version}
19:40brehaut(due to how the server is mostly just marshalling data between various unitypes)
19:40bhaumanbrehaut: yeah the wild west of the client needs some wrangling
19:40brehaut'some' ;)
19:40bbloombrehaut: basically proof that OOP is a mess :-P
19:40brehautbbloom: no arguement from me
19:40bhaumanbbloom: OOP is a mess?
19:41bhaumanbbloom: just kidding
19:44brehautbbloom: 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:44bbloombrehaut: concrete subtypes == dumbest idea ever :-P
19:44brehautbbloom: ever? not sure, stringly typed code is probably worse
19:46brehautbhauman: 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:48bhaumanbrehaut: yeah, I'm just curious about the actual price of touch -> chan -> chan -> chan -> chan -> chan
19:48brehautbhauman: im curious how many chans you can connect before the plumbing starts causing judder
19:49bhaumanbrehaut: as I draw, it feels like there is a price in the browser, but I haven't quantified it yet
19:49bhaumanbrehaut: I'm sure I'll find out soon
19:50brehautbhauman: 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:50bhaumanbrehaut: very interesting
19:50brehautalthough that risks non deterministic channel processing i guess
19:51bhaumanbrehaut: I didn't think about using onanimationframe that way
19:52bhaumanbrehaut: gotta jet to a coders group, but I'd like to talk about this idea some more sometime
19:52brehautoh requestanimationFrame; what am i talkign about
19:52brehautsure thing
19:52bhaumanbrehaut: yep
19:52bhaumanlater
19:58solussdcould 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:05dnolenI can't imagine the JS for handling touches would be computational intentions
20:05dnolenI bet nearly all the drainage would be from animations and DOM reflows and stuff like that
20:05dnolens/intensions/intensive
20:30amalloygfredericks: 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:31gtrakhas 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:32gtrakit 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:32bbloomgtrak: in theory it can slow down equality checks and some pathological hash map cases
20:33gtrakI'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:34gtrakah, maybe that's not the only thing :-).. hmm
20:35gtrakah, and this one: IllegalArgumentException contains? not supported on type: clojure.lang.LazySeq clojure.lang.RT.contains (RT.java:724)
20:36gtrakthat's more obvious
21:06gtraktechnomancy: checkouts can't pick up java files... oops :-) caused me a headache for the last 30 minutes.
21:07gtrakI guess I have to add it to the host java-source-paths
21:33jcromartieso that zifff guy got me reading up on Binary Decision Diagrams, and then graph isomorphism
21:33jcromartieand so I was like "oh that would be fun to write a little algorithm that simplifies isomorphic subgraphs"
21:33jcromartieoh wait graph isomorphism is NP-HARD
21:33jcromartieTIL
21:37kristof:'(
22:38dnolenjcromartie: sounds like something for constraint programming http://becool.info.ucl.ac.be/pub/theses/thesis-zampelli.pdf
22:38jcromartieultimately, there are a few rules for simplifying BDDs in a "good enough" way
22:39jcromartiethere's nothing inherently wrong with an un-reduced BDD
22:39jcromartieit's just ineffecient
22:40dnolenCP(Graph) would be a cool extension to core.logic http://becool.info.ucl.ac.be/pub/theses/thesis-dooms.pdf
22:40bbloomdnolen: dammit man. don't give me more stuff to read
22:40dnolenjcromartie: i think it problematic when you wire many BDDs together in order to solve large problems
22:41dnolenbbloom: haha
22:45dnolensounds like JaCoP has this as experimental functionality CP(Graph) but not open source yet ...
22:45mlb-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:50wolfesmlb-: what's the failure message?
22:53wolfesoops nvm
22:58wolfesmlb-: possibly related http://clojure-log.n01se.net/date/2009-12-04.html - classpath issue?
23:01mlb-wolfes: I'm new to clojure, so I don't know how I'd determine this, or how I would even check :(
23:01abpmlb-: 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:02mlb-just tried "lein clean && lein ring server" with no luck
23:02shokymlb-: you can try adding [org.clojure/core.incubator "0.1.3"] to your dependencies
23:04mlb-well I'll be damned. I just cargo culted this over and "ring server" works now: :exclusions [org.clojure/clojure]
23:04mlb-anyone care to tell me what repercussions that has?
23:07mlb-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:08wolfesThis is the best guide I've fond to project.clj config: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L252-L254
23:08wolfesI 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:09mlb-yes, that's where I cargo culted from
23:10mlb-Let me try to rephrase: What does it mean to have an exclusion
23:10mlb-?
23:10abpmlb-: it excludes all clojure versions any libraries depend on.
23:11abpdo a lein deps :tree
23:11mlb-Would an exclusion potentially allow me to cherry-pick functionality from a library I import?
23:11abpjust to see what libraries your project currently depends on, directly and indirectly
23:12abpnope, just dependencies of libraries
23:13mlb-Ah. I see. That's rather nice actually. So it's to help compensate for indirect library version conflicts?
23:14abpmlb-: 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:14mlb-I'll read up on this. Thanks for all your help/patience! =]
23:15wolfes(inc abp) ; thanks for describing exclusions :)
23:15lazybot⇒ 1
23:15abpmlb-: be explicit about your projects dependencies. you want to depend on ring in your project
23:19coventryWhat 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:28seangroveSeems pretty upset http://blog.softwarecurmudgeon.com/blog/2013/08/13/why-are-we-settling-for-this-in-clojure/
23:31abpseangrove: yeah probably tell him about http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
23:34abpcoventry: https://github.com/pedestal/app-tutorial/wiki/Integrating-the-new-Design
23:38bbloomtbaldridge: 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:39bbloomtbaldridge: 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:39bbloomor maybe they can only be first class at compile time
23:39coventryabp: 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:40abpcoventry: later on they describe how to simulate your apps actions with the driver, so the app code is needed
23:44coventryabp: That is the only page in the wiki which mentions script-driver. Can you point me to the page which uses it?
23:51abpcoventry: at the end of the tutorial: http://localhost:3000/design.html so you'll have to run that sample
23:53coventryabp: Did you paste the wrong URL?