#clojure logs

2013-09-11

00:00clj_newb_2345how do I get clojure.edn ?
00:00clj_newb_2345what line do I need to add to my lein project.clj ?
00:00bbloomnothing
00:00clj_newb_2345clojure.edn/read-string is NOT available at my repl
00:01bbloomso (require 'clojure.edn)
00:03clj_newb_2345(worked now
00:03clj_newb_2345thanks :-)
00:10clj_newb_2345one more dumbass question: what is the clojurescript counterpart to edn?
00:13amalloyc'mon, clj_newb_2345, that is not hard to google
00:13clj_newb_2345actually, "clojurescript edn" brings up surprisiiiiogly little documentation
00:13dnolenclj_newb_2345: what counterpart is needed. EDN is like JSON
00:14bbloomlet's play bbloom's favorite game!
00:14dissipate_amalloy, i thought #clojure was google?
00:14bbloomit's called: "Have you tried grep?"
00:14clj_newb_2345bbloom: what would I grep for?
00:14clj_newb_2345what code base would I grep over?
00:14bbloomgit clone github.com/clojure/clojurescript
00:15bbloomconsidering clojure.edn is baked in to your repl, the primary repository is a good guess
00:16clj_newb_2345your suggestion is not completely unreasonable
00:16sdegutisThanks
00:16bbloomclj_newb_2345: i'll give you one more hint: try "defn" is a likely hit
00:17bbloomdnolen: although now that i mention it, we probably should have a clojure.edn namespace in cljs
00:17bbloomdnolen: trying to bring clj & cljs closer together
00:17coventry`clj_newb_2345: google(clojurescript intext:edn) is the trick.
00:17dnolenbbloom: perhaps, but that's more churn, cljs.reader predates clojure.edn
00:18bbloomdnolen: grumble grumble. who does that rich hickey guy think he is using a different namespace than the cljs team :-)
00:19xeqiif only there was a nice plugin to a build tool to paper over the differences with feature expressions
00:20bbloom:-/
00:20dissipate_bbloom, you realize these issues would go away if there was a pure clojurescript framework that allowed you to put client and server code in the same file? look at the opa framework.
00:21dissipate_"Write simultaneously the frontend and backend code, in the same language, within the same module. Even better: the Opa Slicer automates the calls between client and server. No more manually written AJAX calls or value serialization!"
00:21dissipate_but we can't have nice things because running javascript server side is blasphemy!
00:22bbloomyou've totally misunderstud the goals and tradeoffs selected for clojurescript
00:26xeqidissipate_: while I haven't seen anything that chooses where to run the code for you, there are libs to make the http calls hidden, like shoreleave
00:26xeqior pedestal
00:27dissipate_xeqi, that's certainly an improvement
00:27coventry`The study required to understand pedestal would leave no time for trolling.
00:30dissipate_coventry`, hmm, and what's the payoff for all that study?
00:32xeqibbloom: I was refering to https://github.com/lynaghk/cljx incase there was any confusion
00:32coventry`Anyone got ready-made code for walking a tree and changing one symbol to another where ever it appears?
00:32bbloomxeqi: i'm familiar with it
00:33dnolendissipate_: I think the value proposition of things like are Opa (similarly Meteor) are grossly overstated
00:35dissipate_dnolen, seems good for rapid prototyping in any event, no?
00:36dnolendissipate_: doesn't look any worse or better than ClojureScript in that regard IMO
00:39dnolendissipate_: actually reading over the docs, it looks worse - but of course it's always hard to say w/o actually using. Doesn't seem to have a good async story outside of the small part of many apps that is client/server comm
00:43coventry`Why is there zip/vector-zip as well as zip/seq-zip? Is it faster?
00:45dissipate_dnolen, i wouldn't use opa. the database stuff is way too heavily integrated and seems to promote accessing the database wherever you please.
00:46coventry`Is loop the best way to walk a tree with zip, as in the examples at http://clojure.org/other_libraries#Other%20included%20Libraries-Zippers%20-%20Functional%20Tree%20Editing%20(clojure.zip) ?
00:47dissipate_good god, someone needs to fix those URLs.
00:47Pupnik_its just irc
00:49dissipate_coventry`, http://bit.ly/14E0MYX you are welcome
00:50bbloomcoventry`: recur is definitely the way to go with zippers b/c that's kinda half the point of them
00:50bbloomcoventry`: zippers reify the context of your traversal as a data structure.
00:50bbloomcoventry`: generally, that context is stored in your program's evaluation stack!
00:52coventry`bbloom: Got it, thanks. It just looks ugly, but not as ugly as traversing the tree myself, and easier than writing inner and outer functions for walk.
01:16amalloybbloom: i dunno, lazy-seq functions seem to work pretty well with zippers
01:17bbloomamalloy: sure, capturing the context for delayed (or repeated) execution is the other half the point :-)
01:33clj_newb_2345does clojure have a built in binary tree? i.e. I want a sorted list of items where I can do insertion / deletion in logn time
01:33clj_newb_2345I don't think vectors provide this, as they tend to be O(n) time insert/delete
01:34bbloom(doc sorted-set)
01:34clojurebot"([& keys]); Returns a new sorted set with supplied keys. Any equal keys are handled as if by repeated uses of conj."
01:35bbloomit's built on a persistent red black tree
01:35clj_newb_2345this doesn't seem to support (insert after n/2-th element)
01:35clj_newb_2345so I'm trying to mirrot the DOM tree
01:36clj_newb_2345actually, now that I think about it
01:36clj_newb_2345what I really want is a doubly linked list
01:37clj_newb_2345since why do I want O(log n_) time insert/delete when I can have constant time insert/delete ?
01:37bbloomclj_newb_2345: b/c you get to keep persistence and the tree's generally shallow enough to be amortized constant
01:39clj_newb_2345hm
01:39clj_newb_2345so what is the "correct" way to mirror a dom tree
01:39clj_newb_2345dom trees have the notion of NodeList
01:39bbloomit's impossible to have a doubly linked list that is also fully persistent w/ structural sharing. not that that means there is never a use for a double linked list, but it's highly unlikely you need that compared to a persistent structure
01:39bbloomhow could there possibly be a "correct" way? different representations make different trade offs
01:39clj_newb_2345I think I can get away with a zipper, since I only walk up/down the list one item at a time
01:40clj_newb_2345so I have a representation, which is: left: list of nodes, right : list of nodes, cur : current node
01:40clj_newb_2345where "left" is stored in reverse order
01:40dissipate_bbloom, what about a sorted map?
01:42bbloomgotta run
01:42dissipate_clj_newb_2345, http://clojuredocs.org/clojure_core/clojure.core/sorted-map
01:50Raynesamalloy: Answer to why lazybot was down: because f*** you, that's why.
02:25fredyrls
02:25lazybotboot home lib lost+found media mnt opt proc root sbin selinux srv swap sys
02:25fredyr:o
02:25fredyrsry seems like i'm tired, mixing up the windows
02:42andyfingerhutDo you know if/how Clojure+Ring+Compojure web servers with multiple instances share session state between them? Or do they rely on load balancers that usually cause same client to go to same server?
02:48fredyri don't know how it is done w/ ring/compojure, but there are a couple of common choices
02:48fredyrfirst as you said, you can have sticky sessions
02:49fredyror otherwise a shared session cache of some kind
02:49fredyrusually database backed or a distributed cache like memcached
02:50andyfingerhutfredyr: Thanks. Do you know which events typically cause that session cache to be updated? i.e. would it pretty much need to be updated on every user request?
02:55fredyrdon't really think that's needed
02:56SegFaultAXI had bangers and mash for dinner... and it was amazing. Just saying.
03:00fredyrandyfingerhut: to answer your question, no i don't really know specifically for ring
03:02andyfingerhutfredyr: Thanks. Haven't done any web dev before, and just learning a little bit about it. Bought Dmitri Smotnikov's new Web Development with Clojure book and going through that.
03:04fredyrnice
03:04fredyri'm sure you'll get better answers once the americans wake up also
03:04fredyr:)
03:12s4muelandyfingerhut: the basic idea is that yes, you wrap your application handler in ring's wrap-session, essentially just a handler fn that reads the :session for a request. you update it by sending (an updated copy of) the :session back in the response
03:13s4muelcheck out the ring wiki, there's a whole page on it. in terms of session storage, there's stuff built into ring, and whatever your app server might provide too (for larger stuff).
03:19andyfingerhuts4muel: Thanks. So ring by default will use an in-memory session store. That is sufficient if you have a single web server, I can see. fredyr mentioned memcached or a database as a potential storage for session state if you have many web servers. Do you know how often such a session store is updated typically?
03:28SegFaultAXandyfingerhut: It really depends on the application. Session can be used for all kinds of stuff.
03:28SegFaultAXServer-side memory store and cookie stores are quite common.
03:29SegFaultAXTypically the main thing in there is the identifier for a user (perhaps the primary key on the users table)
03:29SegFaultAXBut other information you might want to cache could be in there. Stuff you access often that changes slowly.
03:30clj_newb_2345does clojurescript support "format" ?
03:30clj_newb_2345i.e. the clojure format command
03:31andyfingerhutIf the web app implemented a "shopping cart", and the user could add another item to it with every request, would that typically be implemented by putting the shopping cart items in the session, or in some database that was accessed via the user id?
03:32fredyrclj_newb_2345: it does
03:34clj_newb_2345fredyr: what namespace is it in, what is it called?
03:35SegFaultAXandyfingerhut: In the database.
03:35fredyrclj_newb_2345: i believe it's straight in core
03:35fredyr,(format "%.3f" 2.0)
03:35clojurebot"2.000"
03:36clj_newb_2345in clojurescript ...
03:36fredyryeah, but i believe it is the same in clojurescript
03:36fredyrit uses goog.string instead of the java.lang.String though
03:37SegFaultAXandyfingerhut: Generally don't trust highly valuable data to something that isn't persisted.
03:37SegFaultAXandyfingerhut: If the server crashed, for example, you'd lose your shopping cart.
03:38SegFaultAXandyfingerhut: Furthermore when using cookies as your session store, don't store anything private or really anything at all of value.
03:38andyfingerhutMakes sense. Wasn't sure how "highly valuable" shopping cart data is, but it certainly would annoy customers if they were lost a noticeable fraction of the time.
03:39SegFaultAXandyfingerhut: A good rule of thumb is to never put anything in the session that can't be resurrected from the primary data store.
03:39SegFaultAXandyfingerhut: In memory session stores also have some other rather important problems to consider.
03:52ddellacostahow do I access a protected member within a gen-class method (fn) definition? I've tried (.member this) and it says that it doesn't exist…is it even possible?
03:56tomjackcan I do `lein new $NAME` if $NAME is two letters long?
03:57fredyrtomjack: $ lein new ts
03:57fredyrGenerating a project called ts based on the 'default' template.
03:58tomjackI should have explained the question better, but wasn't sure how to
03:58tomjackI know it works, I mean I would feel like an asshole pushing that to clojars
03:59SegFaultAXJust give it an artifact group.
03:59SegFaultAXcom.tomjack/fu
03:59tomjackok
03:59fredyryou should probably include `core` somewhere also
03:59tomjackbut (ns fu.ba) ?
03:59fredyr:)
04:00SegFaultAXAlso, I laughed at this so hard: https://github.com/mperham/sidekiq/blob/master/lib/sidekiq.rb#L25
04:00SegFaultAXI don't know why.
04:00tomjackso we stick to RDN for GAV, but in ns's?
04:01tomjacker, "reverse-dns"?
04:08ddellacostaSegFaultAX: that ruby method is hi-larious
04:09SegFaultAXddellacosta: Yup
04:18ucbSegFaultAX: heh that made me chuckle
04:18ucbjust finished listening to This is Water by DFW, so I'm in a gloomy/pensive mode. Otherwise I would've really laughed at that method :)
04:19muhoothat's an amazing lecture
04:21ucbmuhoo: yeah. I only recently came across the audio.
04:22muhooi've never seen a video of it, just the audio.
04:22muhooi discovered when he died. so sad that he was so ill. brilliant guy.
04:23ucbindeed
04:23ucbI don't think I've ever witnessed so much clarity packed in such a small amount of time
04:23SegFaultAXucb: Link?
04:24ucbSegFaultAX: https://dl.dropboxusercontent.com/u/1640144/This%20Is%20Water%20by%20David%20Foster%20Wallace%20Full%20Speech-PhhC_N6Bm_s.mp4
04:24SegFaultAXThanks!
04:24ucbno worries
04:24muhooalso here, looks like http://www.youtube.com/watch?v=8CrOL-ydFMI
04:26ucbmuhoo: I made a copy just in case :)
04:28SegFaultAXmuhoo: The number of views on that video is pissing me off.
04:28SegFaultAX65,534
04:28fredyrhah
04:29ucbODD kicks in it seems
04:29muhooodd?
04:30ucb(see what I did there?)
04:33ddellacostaI cannot get :exposes-methods working at all in gen-class. What is the meaning/order of the arguments in that hash-map?
04:33ddellacostait's not clear to me which is the name of the parent method I want to expose, and it's not clear what the other arg is meant to be, or where it occurs
04:33muhooknow what pisses me off?
04:34muhoo,(let [foo (atom {})] (-> 1 @foo :ugh))
04:34clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core$deref>
04:34muhoouh, i'm only passing 1 arg to deref
04:35clgvmuhoo: no you are not.
04:35muhoo(-> 1 blah) passes only one arg, which is 1, to blah
04:36clgvmuhoo: @foo expandes to (deref foo)
04:36muhoo,(doc ->)
04:36clojurebot"([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."
04:36ucbmuhoo: shouldn't it be (-> 1 (blah)) ?
04:36clgv,(read-string "@foo")
04:36clojurebot(clojure.core/deref foo)
04:36clgvmuhoo: hence you get ##(read-string "(-> 1 @foo :ugh)")
04:36ucbe.g. (-> 1 (@the-ref) :ugh)
04:36muhooclgv: ah, macro expansion
04:36lazybot⇒ (-> 1 (clojure.core/deref foo) :ugh)
04:37ucb,(let [a (atom {})] (-> 1 (@a) :ugh))
04:37clojurebotnil
04:37ucbright
04:37muhoosurprising
04:37ucb,(let [a (atom {1 {:ugh :yay}})] (-> 1 (@a) :ugh))
04:37clojurebot:yay
04:37ucbthere
04:37clgvmuhoo: no. not normal macro expansion. it is a reader macro so to say
04:39muhoothanks, makes a bit more sense now.
04:48SegFaultAXucb: Wow
04:48SegFaultAXThat was awesome.
04:48ucbSegFaultAX: INORITE
04:49SegFaultAXI'm going to listen to it again tomorrow.
04:49SegFaultAXThat was awesome.
04:49ucbI just did today :)
04:49SegFaultAXThanks for sharing.
04:49ucbit's one of those things I like to do periodically, just to remind myself of the awesomeness
04:49ucbno worries, glad you liked it
04:49SegFaultAXOn that note, I must sleep.
04:49SegFaultAXNight all.
04:49ucbnight
04:50supersymgood morning :)
04:50clgvucb: what is he talking about? ;)
04:51ucbclgv: DFW's "This is Water" speech
04:51ucbDFW = David Foster Wallace
04:51muhooa man of infinite jest
04:54clj_newb_2345the following is almost certainly a bad idea, but I want to try it anyway
04:55clj_newb_2345is there a way I can setup to have "(refresh)" called once every second
04:55clj_newb_2345(refersh is referring to clojure.tools.namespace/refresh)
04:55clj_newb_2345actually, I want it to be sent over emacs
04:55clj_newb_2345whenever I do a write
04:56clgvclj_newb_2345: fire up a future with an infinite loop that Thread/sleep for a second and then calls refresh
04:56clj_newb_2345yes, this is what I wnat: to add in a hook to my emacs, so that on every write, it sends nrepl a "(refresh)"
04:56clj_newb_2345no, I no longer want one per second
04:56clj_newb_2345I'd like it to work via emacs write hook
04:56clj_newb_2345or something like cljsbuild
04:56clj_newb_2345to monitor that when a *.clj file has been modified
04:56supersymuse a watcher
04:56clgvcant help you there. I have no knowledge about elisp and emacs internals ;)
04:57supersymme neither, I'd use a watcher for that in pedestal
04:57clj_newb_2345https://github.com/derekchiang/Clojure-Watch ?
04:57clj_newb_2345actually, this was moditivated by pedestal
04:57clj_newb_2345how does pedestal do it?
04:57supersymlet me have a look
04:58schmirclj_newb_2345: take a look at https://github.com/schmir/.emacs.d/blob/master/setup-clojure.el, it may help you with executing code from emacs
04:58clj_newb_2345if you don't mnind, could you (1) refactor the code, (2) post it to git up, and (3) add it to clojars so I can just add it to my project.clj :-)
04:58supersymhttps://github.com/konrad-garus/pedestal-routing/blob/master/dev/dev.clj#L82
04:59ddellacostaI cannot get this to work: http://stackoverflow.com/questions/9060127/how-to-invoke-superclass-method-in-a-clojure-gen-class-method, any ideas? I just keep getting exceptions like "No matching field found: bar for class foo."
04:59clj_newb_2345most likely a type issue
04:59clj_newb_2345i.e. clojure won't auto convert a char to a int for you
05:00clj_newb_2345so if it expects an int, and you pass it a char, it "can't find the function"
05:01ddellacostaclj_newb_2345: are you responding to me?
05:01supersymddellacosta: did you lein compile?
05:01ddellacostasupersym: yes.
05:01ddellacostasupersym: I've been going to the extreme of deleting the class files to make sure that's not it, but anyways, my exceptions change so I'm pretty sure it's unrelated anyways.
05:02supersymah
05:02ddellacostathis further adds to the confusion: http://dev.clojure.org/jira/browse/CLJ-1027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs
05:02supersymI had that last part all too often as well
05:02clj_newb_2345https://github.com/ibdknox/watchtower + (refresh) should suffice
05:02ddellacostajust really not sure how this is supposed to work, but at this point I've tried all sorts of variations, so I'm deeply perplexed.
05:03supersymhttp://stackoverflow.com/questions/3318671/clojures-gen-class-and-double-arrays
05:03ucbddellacosta, supersym, clj_newb_2345: you have to keep in mind that tools.namespace/refresh doesn't play nice with aot
05:03ucbugh
05:03ucbwrong context probable
05:03ucbprobablY
05:03clj_newb_2345ucb:ucb: why do I want gen-class / aot ?
05:03supersymits not exactly what your problem is, but that should help you check a few things
05:03supersymucb: yep :)
05:03ucbclj_newb_2345: I'm not saying you do; I just barged in a conversation and made an arse of myself.
05:04clj_newb_2345hmm
05:04supersymthat I know as well
05:04clj_newb_2345does "file system watchers" basically just poll ?
05:04clj_newb_2345or do they something clever and get push notifications from the OS?
05:06ddellacostasupersym: hmm, thanks but not sure this is going to help--I'm having trouble just deciphering how to get access to a parent's protected method. It seems like I'm not successfully exposing it, even using expose-methods. I can successfully create and override methods otherwise, however--there's no issues there.
05:09clj_newb_2345hmm, can (refresh) only be called from the lein repl>
05:09clj_newb_2345Exception in thread "Timer-0" java.lang.IllegalStateException: Can't change/establish root binding of: *ns* with set at clojure.lang.Var.set(Var.java:233) at clojure.lang.RT$1.invoke(RT.java:239)
05:10ddellacostaoh, fer #$!@s sake, I forgot to pass the right args into the parent method
05:12supersym:)
05:14dissipate_can someone explain why you need the 'apply' function in this: https://www.refheap.com/18531
05:14dissipate_why not just '+' without the 'apply'?
05:15TEttingerdissipate_, numbers is a collection
05:15fredyr,(+ [1 2 3 4])
05:15clojurebot#<ClassCastException java.lang.ClassCastException: Cannot cast clojure.lang.PersistentVector to java.lang.Number>
05:15fredyr,(apply + [1 2 3 4])
05:15clojurebot10
05:17ddellacostaomg…could it really be…working…? Is it true??
05:17lazybotddellacosta: Definitely not.
05:17ddellacostalazybot: you are one tough customer.
05:17ddellacostaway to be a downer, you damn bot
05:18dissipate_TEttinger, I see, thanks
05:19TEttingerfredyr thanks for the example
05:19TEttingernp dissipate_
05:19fredyrnp
05:48sdegutisSo, I got pretty far in my Lisp interpreter tonight. Now I'm stuck at the hard part.
05:48sdegutisScoping.
05:49sdegutisFor anonymous functions, it's confusing since there's 2 scopes, the calling scope and the definition scope, and I don't understand how lookups are split between these two. How does Clojure do this?
05:50sdegutisMaybe it's just as simple as putting the definition scope at the tail of the calling scope's parent-chain.
05:53jjttjj``+
05:54sdegutisjjttjj``: ?
05:54fredyrsdegutis: you just merge them together into one env
05:55sdegutisfredyr: Okay. And the caller-env should have precedence, right?
05:55fredyrright, shadowing bindings that are in both
05:55sdegutisSo in Clojure it would be (merge definition-env caller-env)
05:55sdegutisCool.
05:55jjttjj``sdegutis: ignore that
05:56sdegutisjjttjj``: I'm trying!
05:57fredyrsdegutis: have you looked at paip? the environment stuff is explained pretty good there
05:58sdegutishttp://norvig.com/paip.html ?
05:58fredyryes
05:58sdegutisfredyr: nope, will check it out, thanks
05:58fredyrsure
05:59fredyri implemented a (very!) basic scheme interpreter in clojure over the summer based on that
06:00sdegutisfredyr: on github?
06:00fredyrnah
06:00fredyrbut its like 40 loc
06:00fredyrso i can put it in a gist
06:00fredyrif you want
06:00sdegutisthat'd be really nice of you :)
06:03fredyrhttps://gist.github.com/fredyr/6521407
06:03fredyrhere u go
06:03sdegutisWoo, thanks :)
06:04fredyroh, i see now that i used a ref instead of an atom for the global env :S
06:04fredyrso disregard that if you please
06:04sdegutisfredyr: heh will do
06:06fredyrlooks nice
06:06sdegutisfredyr: heh, you name things like i do.. "maybe-add"
06:07fredyroh i think that one might be courtesy of Norvig though
06:07sdegutisah
06:07fredyrbut i do like it anyways
06:08fredyrbegin is like do in scheme
06:08fredyrand just as in clojure you have an implicit begin inside of lambdas
06:08sdegutisright
06:10sdegutisfredyr: your lambdas never get a called-at-env, they only house the defined-at-env
06:11fredyrisn't (ext-env parms args env) exactly that?
06:11fredyrenv is the called-at
06:12fredyrand parms+args is defined-at
06:12fredyror maybe i'm misunderstanding
06:13sdegutisfredyr: the 'env' (last arg of ext-env) that you just mentioned is only bound as the second arg to interp
06:14sdegutisand in this case, the call to interp is where the lambda is defined.
06:14fredyrbut called-at-env is the global-env at the top level
06:15fredyrand if you have lambdas inside lambdas you get extended local versions
06:16sdegutisfredyr: well i could be mistaken, but i think you're mistaken
06:16sdegutiseither way, it's not that important :)
06:16fredyri don't think i understand what you mean exactly
06:17fredyrbut it's entirely possible i'm wrong
06:17sdegutisim not 100% sure i do either.
06:18fredyrwhat i was trying to say earlier, but wasn't very clear, is that the lambda code is interpreted with env bound to the extended env
06:18sdegutisall i can say is, i think your code will probably fail with this code: (((lambda (x) (lambda (y) (+ x y)) 1) 2)
06:18sdegutisright
06:18sdegutissanity check: ##(+ 1 2)
06:18lazybot⇒ 3
06:19sdegutissanity check: ##(((fn [x] (fn [y] (+ x y))) 1) 2)
06:19lazybot⇒ 3
06:19sdegutisok just making sure
06:19sdegutis,(((fn [x] (fn [y] (- x y))) 1) 2)
06:19fredyrright, i see your point
06:19clojurebot-1
06:19sdegutisfredyr: dont mind me :)
06:19fredyrbut i think the key here is that the lambda gets interpreted with (interp code (ext-env parms args env))
06:20sdegutisfredyr: i think your solution might work on account of it being mutable.
06:20sdegutisi havent ran it though..
06:20fredyri'm about to
06:20fredyr:)
06:20fredyri wanna test your let w/ lambda construct
06:23sdegutisyou mean ##(((fn [x] (fn [y] (+ x y))) 1) 2) ?
06:23lazybot⇒ 3
06:23sdegutismy goal is to get that working right now, God help me.
06:25fredyrthankfully, it works like a charm!!
06:26fredyri updated the gist
06:27sdegutisfredyr: woot
06:27sdegutisfredyr: i cant say i fully understand how
06:27sdegutisfredyr: but on the other hand, i also cant say im capable of understanding how at this hour
06:28fredyr:)
06:30sdegutisyay i got it working
06:31sdegutisnot sure my solution is super good but whatever
06:31fredyrcool
06:31sdegutishttps://github.com/sdegutis/Beowulf/blob/master/Beowulf/BWFunction.m#L17-L20
06:31sdegutisand https://github.com/sdegutis/Beowulf/blob/master/Beowulf/BWEnv.m#L40-L45
06:32sdegutisim not 100% sure right now that envs need parents, but i vaguely think they probably should seeing as im setting them in some places.
06:32clj_newb_2345when a blah.clj file is reloaded, does its old go-blocks get killed?
06:32clj_newb_2345or do they continue to run?
06:34sdegutisclj_newb_2345: refheap.com it
06:42sandbagsif i'm just html scraping is there an advantage to using enlive over clj-tagsoup?
06:42wei_I'm having trouble reading json POST params server-side. the params appear as an InputStream under :body in the request map, but when I read with slurp it's empty. any ideas?
06:42sandbagsthey're the two options (even if i think enlive is actually built on tagsoup) that seem to come up most often searching for clojure html scraping
06:45cgrandsandbags: enlive defaults to tag soup but you can opt for jsoup
06:45sandbagscgrand: ah, the author himself :)
06:46sandbagsi get the feeling enlive is a complete solution
06:46sandbagsfor parsing & templating
06:46sandbagsright now i'm definitely still a newbie so, in general, trying to reduce complexity of what i'm doing
06:47sandbagswould you recommend clj-tagsoup (or jsoup) as a simpler alternative for the single use-case?
06:48cgrand(-> "http://...&quot; e/html-resource (e/select [:#some-id])) to scrape a specific id
06:48sandbagshrmm... that does look enticingly simple :)
06:48sandbagssold
06:48cgrandsandbags: you d'ont have to learn the template stuff (which is 90% of enlive) to scrap
06:49sandbagsyeah my concern was mostly about separating the two concerns but your example is pretty compelling :)
06:49sandbagsthanks
06:49clgvclj_newb_2345: very likely they continue running, except there is some special implementation for that exact case in the lib
07:01sandbagsfor a tool i am writing that i'll be putting on github i need a way of configuring a username/password and some other details (but the creds are the reason).. i'm thinking the easiest approach is to use an EDN file containing a configuration map. is there anything better?
07:02sdegutisfredyr: what do you think of macro scopes? they should probably have the same kind of scoping rules as lambdas, right?
07:04clgvsandbags: define "better"! maps are used in leiningen for config as well
07:05sandbagsclgv: i suppose by better i mean, more standard, more appropriate, "the clojure way" if that helps
07:05clgvsandbags: having config in maps is a clojure way
07:05sandbagsbut, thinking about it, i guess project.clj is just a map
07:05sandbagsoh wait
07:05sandbagsno a function call
07:05clgvyes it is
07:05sandbags:)
07:05clgvsome macro magic for convenience
07:06sandbagsbut in my case a map would work fine... i guess i was just looking to see if there were shreaks of "No! No! You must do XYZ instead!" :)
07:06sandbagsthanks clgv
07:06wakeuphi
07:06wakeup:)
07:06clgvif there are no special requirements just go for config map. since you do not have to implement anything additional for that you can easily change when requirements for the config are introduced
07:07clgvsandbags: ^^
07:07sandbagsclgv: thanks
07:08sandbagshere's something i'm having trouble googling up... if i want to package some of my own code as a private library and include it via project.clj
07:09wakeupIs there something like GNU readline (but with an LGPL/MIT license) available to clojure?
07:09sandbagsis that possible, without publishing to clojars or maven?
07:09clgvsandbags: you can set up a privaten maven repository
07:10sandbagsclgv: will i find myself clawing my eyes out long before i have a working solution? (I hear nothing much good about maven)
07:10clgvsandbags: I had success with "Apache Archiva". I also heard that "Artifactory" works
07:10sandbagsi guess i was hoping there was a project.clj short-hand for "find library in ~/blah"
07:11clgvsandbags: no eyes clawing here, but I invested 2-3 hours to set it up
07:11clgvsandbags: do you have only one development machine?
07:11sandbagstwo
07:11clgvsandbags: well. then you will need a private repository
07:11sandbagswell i can easily put the code in Dropbox
07:12sandbagsi mean, i might just do that and symlink it into these projects
07:12sandbagssince i suspect 2-3hr for you might be a monumental yak shaving party for me
07:12clgvnot necessarily, since I did not use anything like that before.
07:13sandbagsor i guess, i suppose, i could just put it on clojars and endure the shame of anyone ever reading it :)
07:14clgvsandbags: just have a look at the "apache archiva" page to see if it might be easy enough to setup
07:15sandbags(reading that now, thanks)
07:15clgvand maybe also the artifactory one
07:35wakeupMaybe a little OT: Imaine a propritary application, which includes a shell script that contains a pipeline like like 'somegplprg | somepropritaryprog'. Is that violating the GPL?
07:39jamiiI would have expected this to work: (case (class 1) java.lang.Long :ok)
07:40jamiiSince (identical? java.lang.Long (class 1)) => true
07:41vijaykiranwakeup: In your proprietary app do you bundle the GPL program ?
07:41jamiiAh - https://groups.google.com/forum/#!topic/clojure-dev/AB6A9u7ohSc
07:43sm0kehello, i am just fresh to clojure and lisp in general. I am having hard time figuring out what to write in place of what i used to write in oop langs? For E.g. ..
07:43sm0keAn api which creates a object with some vals and then invoke functions on it?
07:44ucbsm0ke: can you be more concrete?
07:45sm0keumm i am not sure... its hard to figure out where to start when all i have is functions!!
07:46sm0keis defining records equivalent to oop in clojure?
07:46ucbsm0ke: you'll probably want to forget about oop for a while while you learn clojure
07:47ucbjust think in terms of functions that operate on data structures
07:47ucband you'll be fine :)
07:49sm0kethanks... thats a start
07:50TEttingersm0ke, have you seen 4clojure? good way to start
07:50TEttinger4clojure and clojuredocs
07:52TEttingersm0ke, if you don't have it already, https://github.com/technomancy/leiningen is vital to clojure dev :) handles projects and can be used for all sorts of related things as well
07:52sm0keTEttinger: i think i have some basic knowledge of clojure.. But my question is more about software design patterns!
07:52TEttingerohhh
07:53sm0kesounds boring but..i bet there must be some standard way to write clojure system
07:54TEttingersm0ke, yeah think of it kinda like C, you have a main function (the top-level, and also -main in some cases) and everything gets called in order.
07:54sm0kei was thinking exactly the same thing...but feared you guys will kick my ass if i say do i think like programming in C :P
07:54TEttingersm0ke, if you're collaborating with people, you have namespaces that correspond to java namespaces
07:55TEttingerwell C and Clojure are both not OOP
07:55mathiaspI'm puzzled: I wrote a small script to convert a simple csv to an html file, using enlive, running in immutant. The test.csv and the template are UTF-8, I have set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8, and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> in the template, and still I get iso-8859-1 in the output. Maybe even something else, recode complains when trying to convert the result to utf-8. Any ideas how I
07:55mathiaspcan find out where this happens? It happens in the template and in the csv content. I'm stumped.
07:55TEttingerin some ways that's a big advantage
07:57TEttingermathiasp, that is odd. some programs occasionally depend on terminal encoding too
07:57TEttingerif you use pipes then terminal encoding matters I think
07:57TEttingerwindows has it as an ugly isssue
07:57mathiaspTEttinger: nope, I'm using konsole on FreeBSD, with utf-8 as encoding...
07:58TEttingermathiasp, it's a small script right? can you pastebin?
07:58cgrandmathiasp: you have to set the charset/content-typ on the ring response map for the ring handler to pick the correct encodng
07:58TEttingeror listen to cgrand since he knows what he's talking about...
07:58TEttinger...and I don't...
07:59sm0kei am finding this answer helpful http://stackoverflow.com/questions/5232654/java-to-clojure-rewrite
08:00mathiaspTEttinger: good, I'll do that :) @cgrand. thanks, I didn't try that since the response heeader showed utf-8, but now i will try it
08:01sm0kehttps://speakerdeck.com/stilkov/clojure-for-oop-folks-how-to-design-clojure-programs .. i think i am not alone
08:01TEttingersm0ke, good finds
08:02TEttingerclojure's built-in data structures are wonderful. advice #1 in that stack overflow post is on target for sure
08:03tcrawleymathiasp: if that doesn't work, and it smells like an Immutant bug, come see us in #immutant and we'll see what we can figure out
08:06TEttingersm0ke, part that was hard for me learning clojure was the concurrency primitive stuff. coming from java, my instinct was to make every possibly mutable thing a ref, but it is generally better to just use clojure's immutable persistence and return/use new values (good performance on this too).
08:06TEttingerI've found atoms are pretty simple to use, but they all have uses of course
08:08sm0kedont know what ref is but atom seems to be a paranoid's variable :)
08:09TEttingersomething like that.
08:10sm0kesorry i am just a newbie ..
08:10TEttingera ref is a reference, it can only be modified in a dosync block IIRC
08:10TEttingerbut
08:10TEttingerit can be read outside of it at any time
08:11TEttingerso you can have a ref being updated by multiple threads, each one waits for dosync to finish before starting its own modifications
08:11sm0kesounds horrible
08:12sm0kesomething like a sync {} block in java i guess
08:12TEttingeryeah ref is kinda verbose for simple modifications. but it's easier than manual locks.
08:16TEttingersm0ke, in my clojure game, I really barely use anything other than atoms (I don't need multithreading because so much has to happen on the swing thread), and I barely use atoms either. for total performance intensive stuff I use raw arrays, but I didn't need the speed of arrays for most other stuff.
08:17TEttingeralso, when you create a java object from clojure, it acts like it does in java, mutable
08:18sm0kegame in clojure?
08:18sm0keare there enough libraries?
08:18TEttingerclojure has all of java's libs
08:19TEttingerI'm only using 3 or so total deps.
08:19sandbagssm0ke: have you seen https://leanpub.com/fp-oo ?
08:19sm0kebut i gues using java libs without syntactic sugar isnt as nice!?
08:20sm0kesandbags: thanks ill have a look
08:27Kototamahi, how can I use ~/.lein/init.clj to define a function for my REPLs sessions? This won't work: http://cljbin.com/paste/52305b42e4b0cc31d37fe96e
08:30supersymsm0ke: this is something recent people have been working on the web side of things http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html
08:30supersymfor the rest, I don't think Java is famous for its game engines either
08:30supersymjmonkey or something I know of
08:40czpqwhey guys, has anyone tried playing with libgdx + clojure?
08:40sm0kenice!! supersym
08:50dcunit3dwhats up?
08:50dcunit3di'm looking at the 4clojure problemsets
08:51dcunit3dspecifically, the black-box testing problem, where you're trying to determine the type of a sequence (map/set/vector/list) without using reflection
08:52dcunit3dbut the last test for this question requires that you distinguish each empty sequence type (http://www.4clojure.com/problem/65#prob-title)
08:52dcunit3d(= [:map :set :vector :list] (map __ [{} #{} [] ()]))
08:53dcunit3dis there any way to do that without try/catch
08:54dcunit3di mean maps/sets always return nil when you ({} 1) or (#{} 1), but doing this with ([] 1) or ('() 1) will blow up
08:57hyPiRiondcunit3d: how do you get an empty version of the current collection?
08:57clgv,(doc empty)
08:57clojurebot"([coll]); Returns an empty collection of the same category as coll, or nil"
08:58clgvdcunit3d: you got a hint per private message to avoid a spoiler for others ;)
09:00dcunit3dclgv: thanks
09:00dcunit3dhyPiRion: it's passed into the function
09:00clgvnp
09:00clgv,(type (empty (range 10))
09:00clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
09:01clgv,(type (empty (range 10)))
09:01clojurebotclojure.lang.PersistentList$EmptyList
09:02hyPiRiondcunit3d: it was a hint :)
09:02hyPiRion,(= () (empty (range 10)))
09:02clojurebottrue
09:03hyPiRionwhoops
09:03mdrogalisHahah
09:04hyPiRionoh right, yesh. Something about empty and conj and things
09:05clgvI also like manutter51's solution ^^
09:42squidzi'm reading into the new schema library and see that you can compose type shapes with using def like (def verb s/String). I also noticed that you can define using defrecords, but I can't figure out what the difference/advantage would be using one over the other? Can somebody enlighten me?
09:49glosoliis there something basic in Compojure to just cause reload of current route ?
10:15supersymyou mean after you changed the route / file content the server reloads that?
10:16supersymhttps://github.com/pedestal/samples/tree/master/auto-reload-server
10:16supersymsee how they did it ;)
10:18sandbagscgrand: enlive++ thanks again
10:27xeqihiredman: did you write a clojurescript nrepl client?
10:32deechHi all, how do I load use a generated class `(:gen-class ...)` from the repl? The file is in my source tree and I've restarted the REPL but I get a SOURCE_PATH error.
10:33TEttingerdeech, is the class listed in project.clj as one of your aot'ed namespaces?
10:33TEttingerI think aot is needed for all gen-class using ns s
10:34deechTEttinger: I don't know how to do that.
10:34TEttingerdeech, are you using leiningen?
10:34deechyes
10:34clojurebotyes isn't is
10:35llasramclojurebot's been hitting the sauce a little early again
10:35TEttinger:aot [deech.core] ;; this would be in your project.clj
10:35llasramdeech: Backing up a level though, why do you want a generated class?
10:35TEttingerfor whatever ns you need gen-class to be seen with I think
10:35deechTEttinger: Ok, got it.
10:35TEttingeralso, what llambda
10:36deechI've got it to compile my core.clj file.
10:36TEttingerllasram said
10:36TEttingeryou don't usually need gen-class for pure-clojure code
10:36TEttingerthere are totally cases for it though
10:36deechTEttinger: because I need to extend a Java class that has multiple constructors. And I need to pass that extended class as a constructor argument to a class that I'm proxying.
10:37TEttingerah.
10:37TEttingerdevilish
10:37llasramdeech: For that I would suggest writing a small Java stub which exposes the exact Java surface you need and then calls into your Clojure code
10:38deechTEttinger: So it compiled my deech.core, but I have another in the deech namespace with the gen-class that isn't getting picked up.
10:38deechllasram: Why is that a better approach? Not contradicting, just curious.
10:38TEttingeroh, it was a vector, you're supposed to just have all the namespaces to aot listed in the vector, sorry
10:39TEttingeralso, the easy way is
10:39deechTEttinger: I have :aot :all in my project.clj. That's not enough?
10:39TEttinger:aot :all yeah
10:39TEttingerthat works
10:39TEttingerok, maybe it can't find the java source you're extending?
10:39TEttingerlein javac ?
10:40TEttingerjava interop where another language has to imitate java... is a tricky business
10:40llasramdeech: It gives you exact control over the Java surface you're exposing to the Java APIs which expect something which doesn't map well to Clojure semantics
10:41deechTEttinger: That's possible, but all dependency which contains the jar which contains the class that I'm extending is available if I start up the repl.
10:41deechllasram: Ah, thanks.
10:41TEttingerI've googled similar issues in the past. llasram is right I think, and it probably won't be a large java class to write
10:41llasramdeech: From a practical argument, gen-class is semi-abandoned, and rhickey has moved to advocate the approach I've described
10:42deechllasram: Good to know. Thanks!
10:42deechIs there some document which shows how to include Java files in a Clojure project?
10:43llasramdeech: lein has some docs...
10:43llasramHere you go: https://github.com/technomancy/leiningen/blob/master/doc/MIXED_PROJECTS.md
10:43deechllasram: Will do. Thanks again!
10:43gfrederickswait wait why does not-empty exist if seq is supposed to be the idiom for emptiness testing?
10:44supersymdeech: http://blog.jayfields.com/2011/12/clojure-java-interop.html thats pretty elaborate as well on Java/clj interop
10:45deechsupersym: Nice!
10:45llasramdeech: And here's an example project using the specific approach I've personally found works the best: https://github.com/damballa/abracad/blob/master/src/java/abracad/avro/ClojureDatumReader.java
10:46danielszmulewiczIs Clojure prone to dependency hell (via maven/leinigen)?
10:46deechllasram: Whow.
10:46kaw:gen-class is semi-abandoned? What's the standard approach to creating a jar with a -main that can be used on the command line now?
10:47deechllasram: That'll take a bit to digest. :)
10:48llasramkaw: When I say `semi-abandoned` I mean that the kind of elaborate constructions it lets you generate seem to be considered a dead-end. If you just want a class with a static main you can invoke from the command line, it's still a reasonable approach
10:48kawAh, okay
10:48kawYeah, that's pretty much what I use it for
10:48llasramkaw: Alternatively, you can just use the `clojure.main` class. If you do `java ... clojure.main -m my.name.space ARGS...` you get essentially the same results
10:50kawI think I prefer the other way for consistency with other command-line jars
10:51llasramkaw: There's also https://github.com/timmc/lein-otf
10:51llasramThe benefit of that (and of core.main) is that you don't need AOT
10:52llasramI've come around personally to the opinion that anything which *requires* AOT is a Clojure design smell
10:52squidzif I use :foreign-libs in my cljsbuild which refers to a simple js file that contains console.log("test"), should that be printed out after compiling with lein cljsbuild once?
10:57andrewmcveigh|wollasram: that link to abracad came just at the right time for me. Been messing around with AOT/compile order for the last 30 mins and getting nowhere. Thanks!
10:58danielszmulewiczI have an issue I don't know what to make of it. I have a project that stops working if I add a particular dependency. I just note that the dependency references data.json, which is also being used elsewhere in the project. The error message I get is: No such var: json/write-str. But json/write-str is present in data.json! I don't understand.
10:58danielszmulewiczThe error jumps very early, when I do `lein repl`for example
10:59danielszmulewiczHow should I go debugging this?
10:59TEttingerdanielszmulewicz, could they be using different versions?
10:59llasramandrewmcveigh|wo: Hope it actually helps! :-)
10:59TEttingeralso, make sure you're referring to data.json as json
11:00danielszmulewiczTEttinger: yes, but I played with the versions, making them match, still same error
11:00andrewmcveigh|woYeah, I think it will. :)
11:00TEttingerit would help to see some code though, if possible
11:00danielszmulewiczTEttinger: Yes, they are referring data.json as json
11:00llasramdanielszmulewicz: Re: dep hell; it makes dependencies easy, which leads to lots of tiny libraries, which can cause problems if they don't e.g. sanely use semantic versioning. But in my experience it isn't worse than anything else (Python, Ruby, etc)
11:01danielszmulewiczTEttinger: gladly, but what code?
11:01andrewmcveigh|wollasram: just deleting an old :gen-class block made me smile.
11:01danielszmulewiczllasram: no version locking like in ruby, isn't that a detriment?
11:01TEttingerdanielszmulewicz, I guess the code that's throwing the error, and maybe project.clj in a gist
11:01supersymalso tried `lein deps :tree`?
11:01llasramdanielszmulewicz: Have you used `lein deps :tree` ?
11:01llasramheh
11:01danielszmulewiczllasram: yes
11:01supersymto see if there are dependency conflicts
11:01llasramsupersym: jinx!
11:01supersymwhat
11:01supersymffs lol
11:02danielszmulewiczsupersym: the thing is that all recent versions of data.json have the fn write-str defined
11:02llasramdanielszmulewicz: I've come the opinion that the leinigen/maven way is the worst possible dependency version-resolution system, except for all the others :-)
11:03danielszmulewiczTEttinger: the code that's throwing the error is in a dependency, not in my project
11:03danielszmulewiczTEttinger: in liberator.clj
11:03TEttingermaybe you have a weird version in ~/.m2 ?
11:03TEttingerok, what's the project, liberator.clj ?
11:03danielszmulewiczTEttinger: yes, that's possible
11:03llasramdanielszmulewicz: For a particular set of dependencies and versions, you will consistently and always get the same resolved set of dependencies+versions, exactly like Gemfile.lock
11:04danielszmulewiczTEttinger: I did `lein install`for the other dependency. IS that how I can reference a library locally?
11:04TEttingeruhhh don't google liberator
11:04danielszmulewiczTEttinger: :-)
11:05TEttingerI didn't honestly know that there was a class of pillow called "adult pillows", nor that one is the liberator.
11:05danielszmulewiczllasram: I noticed that the order in which you reference the dependencies play a role
11:06supersymbtw danielszmulewicz you know about cheshire?
11:06supersymI always tend to use that
11:06TEttingerwhich library is throwing the error?
11:06xeqidanielszmulewicz: what do you mean by "reference a library locally"?
11:06danielszmulewiczllasram: if you have two dependencies that use a third party library of different versions, the first one in the list "wins"
11:07llasramdanielszmulewicz: Yep. But *consistently* wins
11:07llasramdanielszmulewicz: If there are problems, you resolve them via adding dependencies / exclusions
11:07TEttingercan you file an issue on the lib you're using?
11:07danielszmulewiczxeqi: I mean that I have a project I want to use as a library. It is not in clojars or maven, so I did `lein intall`, and then used the local copy in my .m2 repo
11:08danielszmulewiczIs this correct?
11:08llasram~guards
11:08clojurebotSEIZE HIM!
11:08xeqiyep, that should allow lein to resolve the project coordinates
11:08llasramdanielszmulewicz: If you absolutely need to, but it's counter-recommended, because now your build is tied to your local system
11:09danielszmulewiczllasram: what are you suggesting for private libraries?
11:09llasramdanielszmulewicz: Have a private artifact repository
11:09supersymyou can take a clojars account
11:09supersymsorry :P
11:10llasramdanielszmulewicz: For personal use, you can ^^ use clojars, or setup a repository in S3. W/in a company etc you can run archiva or nexus
11:11danielszmulewiczllasram: good, will do. thanks
11:12danielszmulewiczA ticket was opened on liberator: https://github.com/clojure-liberator/liberator/issues/14
11:12danielszmulewiczI have the same message
11:12danielszmulewiczHowever, without that local library, everything works fine
11:12danielszmulewiczThe error only appears when I add the dependency
11:13danielszmulewiczIt doesn't make sense, does it?
11:13llasramdanielszmulewicz: Just double checking -- you compare `lein deps :tree` w/ and w/o your dep and have the same data.json version dependencies in both cases?
11:14danielszmulewiczllasram: yes
11:14llasramYep -- that makes no sense :-)
11:14danielszmulewiczllasram: And write-str is present in all versions by the wa
11:14danielszmulewiczy
11:14TEttingercheck .m2 see if something's wrong
11:15danielszmulewiczYes, I suspect it's what lein install does. First question, should I aot :all or not?
11:15llasramdanielszmulewicz: Idea: is the extra dep an uberjar which may contain the same namespace?
11:16danielszmulewiczthe extra dep is https://github.com/ianbarber/clj-gapi by the way
11:16danielszmulewiczAnd it's not on clojars
11:16danielszmulewiczjust github
11:17danielszmulewiczso if i want to bring this in my project, I need to do lein install and put it on a private repo, right? Are there extra steps?
11:18llasramdanielszmulewicz: Convince the original project author to deploy a release to clojars :-)
11:18danielszmulewiczin other words, clj-gapi and liberator both use data.json, not the same version by default, but all versions have write-str so I don't understand the error
11:18danielszmulewiczllasram: yes, it's Ian Barber from Google, I'll ask him
11:21danielszmulewiczyou were discussing aot compilation before, I'm trying to understand when it's required. I understand it's required for an uberjar, but outside of that scenario, are there other use cases?
11:21llasramdanielszmulewicz: If you can fire up a REPL w/in the project w/ the dep, you should be able to use clojure.java.io/resource to find the file which will loaded for the data.json namespace
11:22danielszmulewiczllasram: good idea
11:23llasramdanielszmulewicz: Using AOT compilation also means any `gen-class` (and semi for `deftype`) classes have real class files on disk, and thus may be loaded via e.g. Class/forName or other reflection methods
11:24llasramAOT does also improve load time, and (IMHO) makes sense as a deployment optimization
11:25danielszmulewiczllasram: OK, so the usual thing is to generate the core class with the main method, and the rest can be left as clojure source code?
11:26llasramdanielszmulewicz: It definitely seems to be a common approach. Lately I've mostly been just adding wrapper scripts which launch via `clojure.main`, but it's pretty 6 vs half-dozen
11:27danielszmulewiczllasram: cool
11:40danielszmulewiczOK, I'll be redoing it from scratch. My purpose is to add clj-gapi in an existing, working project. I clone clj-gapi from github (https://github.com/ianbarber/clj-gapi). I type `lein install`.
11:40danielszmulewiczThe message I get is : Implicit AOT of :main will be removed in Leiningen 3.0.0.
11:41danielszmulewiczBut it does create the jar.
11:41llasramOh... Oh!
11:41llasramHmm
11:42llasramWhat's in the JAR? Did the AOT'd class files for everything end up in the dep?
11:42danielszmulewiczNo, at this point only :main is aot'd.
11:43llasramYeah, but so one of the big problems w/ AOT is that it has to transitively AOT compile everything mentioned by the AOT'd namespace
11:43llasramWhich means AOTing anything usually means AOTing everything, including all of Clojure itself and all of your deps
11:44llasramIf those end up in the resulting JAR, the AOT'd versions will be on the classpath, and preferred over the source versions provided by other JARs
11:45llasramdanielszmulewicz: The JAR should be under target/ after you do the `lein install`. Just `unzip -l` it (or whatever is appropriate for your platform) to list the contents
11:45danielszmulewiczllasram: OK, so first question, can I add clj-gapi as a pure clojure source code dependency
11:46llasramdanielszmulewicz: Yeah. Just modify the project.clj to either remove the :main key+val or add ^:skip-aot metadata to the namespace symbol
11:46danielszmulewiczllasram: now that I like.
11:46llasramIt looks like the original author only marked it as :main out of inexperience
11:47akmeena,(into-array String ["foo"])
11:47clojurebot#<String[] [Ljava.lang.String;@4790c>
11:48akmeenaHow to denote a java array's class in clojure?
11:48danielszmulewiczllasram: you helped solve my problem. I bow to you, sir.
11:48llasramakmeena: For what purpose? Metadata type-hinting?
11:48danielszmulewiczllasram: it works now.
11:49mpenet,(doc make-array)
11:49clojurebot"([type len] [type dim & more-dims]); Creates and returns an array of instances of the specified class of the specified dimension(s). Note that a class object is required. Class objects can be obtained by using their imported or fully-qualified name. Class objects for the primitive types can be obtained using, e.g., Integer/TYPE."
11:49llasramdanielszmulewicz: Awesome! Glad to hear it
11:50TEttingerakmeena, uh... it's a bit odd. you can type hint an array in 1 dimension with ^booleans I think, but 2d needs ^"[[Z"
11:50danielszmulewiczllasram: half aot'd projects are a sure way to shoot yourself in the foot, isn't it? But it must happen a lot among users who are not experts in java. Talking about incidental complexity. Clojure was meant to free us from it!!!
11:50TEttingerwhich is the JVM code for boolean 2d array
11:50TEttingerand can be gotten with a call, let me find it
11:50akmeenallasram: specefically I need to pass the class in gen-class's constructor spec
11:50akmeenaso I can't use a function to return class since that's a macro.
11:51llasramdanielszmulewicz: Well, there are good reasons technomancy wants to deprecate :main being implicitly AOTed :-)
11:51TEttingerakmeena, array of...what?
11:51akmeenaURL's
11:51TEttingerjust strings? ok
11:52devnhttp://emareaf.deviantart.com/art/Rich-Hickey-321501046 -- lol, not a flattering image
11:52llasramakmeena: You can hint as e.g. ^"[Ljava.net.URL", but
11:52danielszmulewiczllasram: Right. God bless him, by the way. He's doing an awesome job.
11:53llasramif you scroll back / look at the recent log, this just came up, and I highly recommend just writing a Java stub to call your Clojure for anything more complicated than a static `main()` method
11:54akmeenaSo no way to denote it using a symbol?
11:55TEttinger^"[Ljava.lang.String" or ^"[Ljava.net.URL"
11:55TEttingererr
11:55TEttingerwait is this a type hint?
11:58akmeenaTEttinger: :constructors {[[Ljava.net.URL ...
11:58TEttingeruh
11:59TEttingeractually I don't know if [[ is right. also it may need to be in a string
11:59TEttinger,(class (make-array java.lang.String 5 3))
11:59clojurebot[[Ljava.lang.String;
11:59TEttingerso that's a 2D array of strings
11:59TEttinger,(class (make-array java.lang.String 5))
11:59clojurebot[Ljava.lang.String;
11:59TEttinger1D is only one [
12:00TEttingerbut that should be in double quotes I think, otherwise it becomes a weird vector
12:01akmeenaI'll try a string there.
12:06jmlI'm working on an edn implementation, where's the best place to raise questions?
12:07mimieuxHi all!
12:08mdrogalisjml: Probably here.
12:09mimieuxHow would be a function with the same arity but different type args? (fn ([^Boolean arg] arg) ([^String arg] arg))
12:10opqdonutthat's not really possible
12:10opqdonutusing just a function
12:10jmlok. first up: edn strings can span multiple lines, and also can contain escape characters '\n'. *But* the equality section says that strings are equal to strings with the same edn representation
12:11jmlwhich means that "foo\nbar" is not equal to "foo
12:11jmlbar"
12:11opqdonutyou should either do (fn [arg] (cond (instance? Boolean arg) arg (instance? String arg) arg))
12:11opqdonutor use a protocol or multimethod
12:11opqdonutmimieux: ^
12:11jmlbecause the representation is different (escape char vs literal)
12:12mimieuxopqdonut: Ok, I see.
12:12mimieuxthanks
12:13jmlsecond, it's not clear whether a reader should attempt to decode strings into unicode
12:14mdrogalisThere are a lot of things that aren't clear about EDN. :/
12:28llasramjml: Can you elaborate on "decode strings into unicode"?
12:29jmlllasram: how do you know if a string you get should be interpreted as a sequence of literal bytes or as human-readable text?
12:31llasramjml: Interesting that the EDN spec doesn't mention Unicode... I'd argue that Clojure's handling of strings is that they are pretty clearly sequences of Unicode codepoints, not arbitrary bytes
12:31llasrammodulo the JVM 16-bit char wackiness
12:32jmlllasram: if that's the case (and it's a reasonable guess), then it doesn't have an obvious way of sending literal bytes.
12:32jml#base64 "r0flcopter"
12:33llasramjml: Yep. And that's a known limitation of Clojure reader data
12:33jmlllasram: ah, interesting.
12:34jml'#bytes (72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100)' perhaps
12:35llasramYeah. It's not clear what the best approach would be. Maybe different ones for different situation :-)
12:36jmlwell, the prob with those is that they aren't very compact.
12:37jmlthe newline thing is perhaps more obviously a bug in the spec
12:38ambrosebswow, nanopass compilers session at clojure conj! https://twitter.com/alandipert/status/377825887397216257
12:41alandipertambrosebs: have you studied/used nanopass?
12:42ambrosebsalandipert: no, I'm looking at your links
12:42ambrosebsI just know Andy Keep is a boss.
12:43ambrosebsbbloom: are you familiar with nanopass compilers? ^^
12:43supersymhaha
12:45jmlanyway, I've filed https://github.com/edn-format/edn/issues/59 and https://github.com/edn-format/edn/issues/58 if anyone is interested in pursuing further.
13:00alandipertambrosebs: chris frisz pointed me at a paper and i was enthralled, i did a little spike into a static clj and came to the realization that the real trick with compilers is organizing their insides. the nanopasses aren't unlike ring middlewares
13:14jewhy is the both a clojure.xml and clojure.data.xml they seem to have some overlap?
13:14bbloomambrosebs: yeah, read the dissertation the other day
13:15bbloomwill definitely go to that talk :-)
13:15ambrosebsbbloom: was it you messing around with multipass CLJS compilers?
13:16bbloomambrosebs: i've been discussing with dnolen how to move away from our monolithic two-pass compiler to something easier to maintain and extend
13:16ambrosebsah nice
13:19bbloomalandipert: yeah ring middleware is a reasonable analogy
13:25alandipertkovas: hi!
13:25kovasalandipert: word
13:25kovaspsa: still drinking my first coffee
13:26dcunit3dhas anyone used gloss?
13:28llasramdcunit3d: A tiny bit
13:34dobry-denIs there a simple way to lazily read objects from an edn file?
13:36saml(read-from (edn-file) lazily)
13:36callenbbloom: wouldn't the trade-off be compile time though?
13:37llasramdobry-den: Something like: (take-while #(not (identical? ::eof %)) (repeatedly #(edn/read {:eof ::eof} pbr)))
13:37llasramdobry-den: (where `pbr` is a PushbackReader instance)
13:38bbloomcallen: yes, however, if you read the dissertation they talk about "micropass" compilers which are basically the naive approach & how their nanopass approach recovers much of that lost performance
13:38bbloomcallen: also, in our case, it's worth pointing out that google closure compiler is already highly modular into passes & is, in fact, quite slow
13:38alandipertcallen: i don't think, necessarily, esp. in light of persistent data. also with discrete pieces there may be ways to parallelize in ways previously very hard
13:39bbloomcallen: CLJ is far easier to analyze than JS, so we could dramatically speed up the optimization process by doing CLJ-level tree shaking before doing JS level optimizations
13:40bbloomin short, they generate record data structures from grammars & then generate traversal code from pass configuration
13:41callenbbloom: seems reasonable. Thanks.
13:41callenbbloom: I actually need to simplify the parser in Selmer but haven't had time to attack it lately.
13:41alandipertalso, easier CinC! (maybe?)
13:41callenIt's a raw recursive descent parser and could be a lot nicer given a GLL
13:42bbloomalandipert: *shrug* i don't think that it would help there much, since Compiler.java is already monolithic & step one would be to just port it over more or less unchanged
13:44alandipertbbloom: it just seems to me that w/ nanopasses it would be much easier to target new things, possibly building on existing passes
13:45alandipertesp. a target in JS's ballpark, like java
13:46bbloomalandipert: i mean the compiler backend is like 800 lines of code. Targeting a new platform isn't the hard part, it's all the work around the standard library, macro system, interop code, build infrastructure, performance optimizations, etc
13:47bbloomalandipert: sure, a nanopass compiler would mean that the compiler could be 500 lines instead of 800 lines
13:47bbloombut *shrug* no big deal really
13:47bbloomthe big win is in being able to *share* optimizations across backends
13:47alandiperti'm taking those into account, the things you list seem to map to passes
13:47dcunit3dllasram: i'm trying to find some examples. i'm looking on clojuresphere and found a few good projects there. i'm trying to parse data from the MNIST handwritten digits database, which is in a fairly simple format.
13:48samlhttp://cufp.org/conference/sessions/2013/t7-luke-vander-hart-clojure-tutorial is this worth taking it?
13:48bbloomalandipert: a lot of optimizations in Compiler.java are *very* java specific
13:48bbloomalandipert: there are a *few* things that are more general than JS in compiler.cljs
13:48bbloomalandipert: like tag inference
13:50llasramdcunit3d: There's also some examples in the gloss wiki. I don't really have a corpus of examples to point you to which would be better than ones you've probably already got
13:50alandiperti envision passes that do more platform-specific opt. are just just closer in the chain to final emission than the general optimizations
13:50llasramdcunit3d: If you run into trouble, ztellman is frequently on this channel
13:50llasramOh, and is here now apparently
13:50ztellmanyes, I got dinged
13:50llasramhah
13:51dcunit3dcool
13:51ztellmanbut yeah, let me know if you have any questions re: gloss
13:51bbloomalandipert: yeah, absolutely. all i'm saying is that spinning up a new backend is actually pretty easy & i actually probably *easier* to do with a monolithic backend, since we already have a model to follow.
13:52bbloomalandipert: don't get me wrong. i'd rather see lots of small passes, just don't think that easier new backend is a motivation for that. i'm much more interested in shared analysis & optimization + easier reasoning about those things.
13:52ztellmanalandipert: did you score tickets to StrangeLoop?
13:53alandipertztellman: yeah man and i'm amped!
13:53ztellmancool, see you there
13:53alandipertbbloom: dream big :-)
13:53bbloomalandipert: if you wanna dream big, then you should talk to tbaldridge about doing an SSA intermediate target & compiling *that* to JVM or JS :-)
13:54mdrogalisztellman: Did anyone ever reply to your tweet about Java getting booted from Script Bowl?
13:54alandipertbbloom: gclosure does my SSA ;-)
13:54ztellmanmdrogalis: nope, but I wasn't really serious
13:55bbloomalandipert: for alternative backends? :-P
13:55mdrogalisztellman: I got a good laugh out of it, anyway.
13:58alandipertbbloom: SSA could be a pass, no? multiple passes even
13:59alandipertztellman: are you gonna be there for ELC or workshops?
14:00ztellmanalandipert: ELC
14:00bbloomalandipert: conversion to SSA would be a pass & then there are *many* SSA optimization you (or LLVM or whatever) could perform. then you'd have an SSA->target code generation pass
14:01bbloomalandipert: let me be clear: smaller simpler passes are a very good thing that will make the compiler better in many many ways
14:02bbloomalandipert: however in terms of time-to-CinC, i don't think it will make anything faster or dramatically easier, since the problems are practically unrelated to the complexity of the *code generator* which is the (currently) final and most platform specific pass
14:02bbloomalandipert: there are lots of little optimizations that we can do that will make our lives easier for code generation
14:03bbloomalandipert: for example, we talked about ANF transform which will mean we don't need to do those (function() { })() scope thinggies in JS. similar simplifications would be available for the JVM
14:05bbloomso yeah, nanopass would benefit code generation to some extent, but not nearly to the same degree as analysis & optimization
14:05alandipertbbloom: i guess i feel differently re: CinC, as i see conforming to target platform idioms/constraints as a kind of optimization, made easier when the compiler framework isn't allowed to make many assumptions about target
14:05bbloombb in a bit
14:05alandipertbbloom: oh hey are you strangelooping btw? would be awesome to hang again
14:05bbloomi'll be at the conj, but probably not strange loop
14:05bbloombrb
14:23mmitchellCould anyone here recommend a Clojure validation lib? Kinda looks like bouncer and validateur are the main choices? Anyone here have experience with either of them?
14:31LeonidasIs there a better solution for something linke (if (contains? @cache (first args)) (@cache (first args)) …)?
14:32LeonidasI'm kinda annoyed by having to do the cache lookup basically twice.
14:32metellusif-let
14:32Leonidasthanks
14:32tbaldridgeLeonidas: look up clojure core.cache https://github.com/clojure/core.cache
14:32BronsaLeonidas: if-let + find
14:32bbloomLeonidas: you shouldn't deref (the @) twice in a row if somebody else can invalidate the cache out from under you
14:32Leonidastbaldridge: that's overkill, my cache is just a Map :)
14:32tbaldridgeLeonidas: has memorizing wrappers, if you need that.
14:32tbaldridgekk
14:33Leonidastbaldridge: jup, I was playing with a recursive memorizing macro :)
14:33Leonidasbbloom: yup, I was thinking about this too. Not likely to happen, since the cache is local, but something I'd better avoid in any case :)
14:45ToBeReplacedwhere can i learn the difference between ILookup and Associative?
14:46ToBeReplacednvm, just looking at the java works
14:47ToBeReplacedI'm wondering if maybe we should document that more... I don't like when libraries say "accepts a map" when they mean "ILookup"
14:48ToBeReplacedor worse when "accepts a map" doesn't accept records
14:57tbaldridgeToBeReplaced: who does that? (maps not records)
15:01ToBeReplacedtbaldridge: clj-http
15:01tylereIs there any way to get something sort of paredit-like in intellij for closure? E.g. something that constantly reformats code alignment and keeping everything pared up.
15:02ToBeReplacedtbaldridge: try (client/get "http://www.google.com&quot; {:connection-manager (make-reusable-conn-manager)})
15:02ToBeReplacedthen do it again with the map as a record
15:03tbaldridgeToBeReplaced: ick, I'd love to know why that bug exists
15:05ToBeReplacedtbaldridge: maps are functions, records aren't
15:06nDufftylere: ...it exists, but it's not as good as the canonical emacs implementation.
15:06supersym /join #linguistics
15:06tbaldridge, (do (defrecord Foo [x]) (:x (->Foo 42)))
15:06clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
15:06tbaldridgeToBeReplaced: it works in a real repl
15:07mdrogalisCan anyone expand on what Rich is trying to say at 8:20? http://www.infoq.com/presentations/Design-Composition-Performance
15:07ToBeReplaceddo it the other way aroud ((->Foo 42) :x)
15:08mdrogalisIs he advocating using constructs like deftype more for problem logic and maps/sets for solution logic?
15:08tbaldridgeToBeReplaced: ah I see
15:08mdrogalisLike, I get the idea. I just don't get how to put it into practice.
15:08BronsaToBeReplaced: that has nothing to do with Associative or ILookup, it's because record don't implement IFn (I wonder why)
15:09ToBeReplacedright; the issue is that clj-http requires your "m" to implement IFn ... where a reasonable guess woudl have been you just need Associative
15:11ToBeReplacedBronsa: my point was more that we use "map" everywhere, and that's a pain, because sometimes I just want to pass an ILookup or a Record, and i tend not to know if it will work
15:11tbaldridgemdrogalis: the gist is that we should not conflate data with code.
15:12tbaldridgemdrogalis: so yes, use maps,sets,vectors for data. Only resort to deftype/defrecord when you need better performance.
15:13mdrogalistbaldridge: I find that conclusion kind of conflicting. It's not that I disagree with your first statement, but I was always under the impression that deftype was there to carve out abstractions in the problem space.
15:14hiredmandeftype is not abstract at all
15:14dnolenbbloom: http://vimeo.com/74314050, great stuff from Jonathan Edwards
15:14bbloomdnolen: love that guy! will definitely watch it soon
15:15tbaldridgemdrogalis: not really. You can do good abstraction via pure data and multimethods. It's just that these things were way to slow to build an entire language off of (like cljs)
15:15dnolenmdrogalis: protocols carve out the abstractions, deftype fills in the blanks
15:15tbaldridgednolen: lol, just got an email for that video
15:15mdrogalisdnolen: What does fill in the blanks mean?
15:16dnolenmdrogalis: ISeq is the big idea, the 20 deftypes that implement it make it work
15:16mdrogalisI kind of find that maps are so flexible in Clojure that the 'how to navigate' the map bit seeps through my entire program.
15:16mdrogalisSo I think that's where I get tripped up about it.
15:17mdrogalisdnolen: Yeah, I suppose I shouldn't read too hard into the English idiom.
15:17dnolenmdrogalis: it can be problem in larger programs, core.typed and Prismatic's Schema look promising solutions
15:18mdrogalisdnolen: Was considering core.typed. It becomes a jungle after a while for sure.
15:18tbaldridgemdrogalis: yeah, I'm not saying "don't use protocols", there are times however, when I'm coding and I step back and say "Oh My....I'm using protocols like I would in OOP". And that's just wrong. So perhaps if you spend the first part of a project writing 20 protocols each with 5 members, you're doing it wrong.
15:19dnolenmdrogalis: it just depends on how much discipline you apply and what your timeline is. generally you don't have time to uniformly apply discipline, so you need something else
15:19mdrogalistbaldridge: I recall someone, maybe Stu Halloway, driving home the point about that. I believe he was noting that protocols should have 1-3 functions ish.
15:20mdrogalisThe topic would probably make a really good blog post on the front of more abstract design topics.
15:20callenI've done a really good job of avoiding protocols.
15:21callenbut I'm not allergic to multimethods either.
15:22astevewhat is going on here: (let [[a & other-a :as ab] @a-b])?
15:22mdrogalisWell, example in core.async: https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/buffers.clj#L16
15:22mdrogalisWas that in the name of performance?
15:23tbaldridgemdrogalis: yes
15:23mdrogalistbaldridge: The alternative being a multimethod?
15:24callencore.async is out on the hairy edge though. I'd argue most clojure users would be better served with multimethods.
15:25callencore.async only needs to be implemented once, you shouldn't use the unusual constraints and priorities of one library to inform design principles for your Twitter clone.
15:25tbaldridgemdrogalis: yeah, I wouldn't use core.async as a good example of idiomatic clojure code. The core.async CLJS code doubly so. We take tons of shortcuts in the name of performacne.
15:25tbaldridge*performance
15:26mdrogalisGot'cha. Yeah, definitely noted that the rest of the code is off-par. That one bit caught my eye though.
15:28callentechnomancy: used paredit on my coworker's machine who is learning Clojure, immediately turned around and installed paredit on mine as well.
15:37technomancysweet
15:39technomancywon't say I told you so
15:39technomancybut everyone else told you so
15:40callentechnomancy: I used paredit twice, once before Clojure and once briefly after. It was finickier back then.
15:40callenI figured I'd end up using it eventually, just didn't know when.
15:41dissipate__anyone use counterclockwise with eclipse?
15:41technomancy~anyone
15:41clojurebotanyone is anybody
15:41callendissipate__: nope never.
15:41technomancydammit clojurebot
15:42dissipate__:(
15:42callendissipate__: one of the philosophies of Clojure is that you should concern yourself with queries and results - values. Not "places".
15:43callendissipate__: if you have a question, ask it. Don't concern yourself with how many "nouns" you can possibly derive arbitrary information from.
15:43coredhi
15:43`cbpHello, what do people do when they wanna prevent getting/updating non-existing keywords on maps/records?
15:43callencored: hi.
15:43callen`cbp: prevent?
15:43coredwhy isn't this equal (= '(:a :b) (conj '(:a) :b))
15:43`cbpcallen: Like I'd rather they throw an exception than return nil
15:43tbaldridge`cbp: they don't. Sometimes I want extra keywords on a record
15:44coredcallen: hello
15:44callen`cbp: that's pretty bad style. You might be trekking into core.typed territory perhaps?
15:44callenif you need to statically define a "this and only this" shape of a map.
15:44tbaldridge`cbp: in general clojure programmers prefer to let people do what they want.
15:44`cbpcallen: Is it? I just seem to waste so much time sometimes hunting down misstyped keywords :(
15:44callentbaldridge: except ask bad IRC questions. that's verboten.
15:45tbaldridgecallen: touche
15:45callen`cbp: core.typed helps a lot with misstyped keywords. If you must throw an exception on a non-existent keyword, make it dev-only.
15:46`cbpcallen: Ok I'll check it out. Sry for the bad questions :P
15:46callen`cbp: my vote is a debug/dev-only macro that throws as the alternate to a "get" or core.typed
15:46callen`cbp: I wasn't talking about your question.
15:47`cbpcallen: oh ok
15:47callen`cbp: yours was fine and is pretty common/standard to learning the "we're all consenting adults" attitude of Clojure.
15:47callenI really really do not like Python-esque "throw on non-existence" behavior.
15:47callenreally. Really. It's an obnoxious default.
15:47tbaldridge(inc callen)
15:47lazybot⇒ 9
15:48dnolenanybody want to lend a helping hand tracking this bug http://dev.clojure.org/jira/browse/CLJS-586
15:48dnolenI've constructed a minimal repo after what's described in the ticket (see last comment), I cannot reproduce the issue at all
15:50`cbpcallen: Oh btw I'm _still_ working on it :P. Just had to put some extra hours at work these last 2 weeks. Good news though, no more windows whining
15:50callenmy attitude is that if you must catch situations where you want to enforce map shape, you might as well do it at compile-time with ambrose's baby. The awkward middle-territory of runtime exceptions just makes me stabby.
15:50callen`cbp: still working on what?
15:50`cbpcallen: the sync stuff
15:50callen`cbp: http://hugoduncan.org/post/alembic_reloads_your_project_clj_dependencies/
15:51callen`cbp: are you doing it differently from hugod's alembic?
15:51coredread the documentation on the repl
15:51`cbpcallen: I had no idea it existed I'll read it
15:51callen`cbp: I thought I emailed it you as a heads up.
15:51coredbut it's still kinda weird, the parameter for the new item in the conj function is in the end; at first glance it's implies to me that th eitem will be added to the end of the list
15:52coredbut it's get joined at the first element
15:52callencored: conj is a generic "add to coll" function. If you need to worry about the "placeness" then think about the data type you're passing it.
15:52callenvector -> tail, list -> head
15:53`cbpcallen: Got no email :(
15:53jonasendnolen: I can reproduce
15:53callen`cbp: oh balls. I have no idea who that email went to then. Sorry!
15:53dnolenjonasen: can you gist your steps? It doesn't matter which file I modify I don't see the issue.
15:54coredcallen: oh, great way to remember this, thanks
15:54callen`cbp: you should sync up ( http://i.imgur.com/wjANVCD.jpg ) with me on IRC more often :)
15:54dnolenjonasen: being able to copy and paste your steps will remove any variables here
15:54coredcallen: which means I can use a vector or a list with the same function?
15:54jonasenhttps://www.refheap.com/18555
15:54jonasendnolen: ^
15:55callencored: http://i.imgur.com/RInU1Nr.jpg
15:55muhooany clues as to anything i can do to mitigate lots of "Unexpected end of ZLIB input stream." in clj-http?
15:57jonasendnolen: copy/paste messed up some of the commands but I hope you can follow it
15:57coventry`asteve: That is assigning the value from dereferencing a-b to ab, the first value of that to 'a' and the rest to other-a. http://clojure.org/special_forms#Special%20Forms--Binding%20Forms%20(Destructuring)
15:57callenmuhoo: are you holding onto the head?
15:58astevecoventry`: ah, thank you
15:58`cbpcallen: Its pretty much what I had. I just had a bit more care when needing auth for a repo + you could specify a profile on mine. The issue with conflicting dependencies remains though, and I have so far not much of an idea on how to solve it
15:59dnolenjonasen: so you had to touch two files to trigger?
15:59callenmuhoo: is Accept-Encoding being set?
16:00`cbpI had a dream where you could switch profiles on the repl, like suddenly (sync! :1.2) :P
16:01jonasendnolen: i don't know. no warnings when I touched the first file so I tried the other...
16:01callen`cbp: I'm getting close to needing that, but not quite yet.
16:02dnolenjonasen: yep can't reproduce
16:02jonasendnolen: weird
16:03jonasendnolen: I only need to touch core.cljs to get the warnings
16:05dnolenjonasen: yep can't repro
16:07dnolenjonasen: ok, typo in my require ns, can repro now. Thanks!
16:14asteveis clojuredocs.org deprecated?
16:16nopromptasteve: it's a bit outdated, but the majority of the reference is still relevant.
16:16asteveyou can choose between 1.2.0 and 1.3.0 is that referring to clojure versions or clojuredoc versions?
16:16mdrogalisasteve: Clojure versions.
16:16astevebecause it claims 1.3.0 is the latest stable on some modal where the clojure.org claims 1.5.1 is the latest stable
16:17mdrogalisasteve: The latter is correct.
16:18nopromptasteve: i would look at this http://clojure.github.io/clojure/clojure.core-api.html
16:18astevenoprompt: thank you
16:19astevemdrogalis: thank you as well
16:19mdrogalis:)
16:21callenasteve: clojuredocs is hella out of date.
16:21callenIt will be replaced soon.
16:22asteveit was outdated in the late 90s? :)
16:23callenasteve: hella is Yay!speak, not 90s.
16:23asteveI remember using it in the 90s and then I stopped
16:23asteveI'm glad I stopped
16:23asteve:)
16:26danielszmulewiczI always thought that interactive and incremental development at the REPL was as prevalent with Clojurians than with other Lispers, but after reading about Stuart Sierra reloaded patern, where you reload the whole system after modifying code, I'm starting to wonder if things are different in Clojureland. I thought I'd ask here first to see what other people are doing.
16:27danielszmulewiczWhat's your workflow like?
16:27callendanielszmulewicz: like Sierra's.
16:27callenMostly.
16:28danielszmulewiczInteresting.
16:28callenI used to have persistent sessions in Common Lisp but I got tired of worrying about it.
16:28rhgload a repl, code, reload and repeat
16:28callenit got almost Erlang-esque. yuck.
16:28danielszmulewiczYou don't do incremental development at all
16:28danielszmulewicz?
16:28callenthat's...not true at all.
16:28callensierra's model of development is incremental
16:28callenit's just not especially stateful.
16:28danielszmulewiczok
16:29callenwhich helps to keep local dev in sync with prod.
16:29danielszmulewiczrhg: you reload and when it's broken, what do you do?
16:29coventry`I do a lot of experimentation in a long-running repl without reloading, but I am not currently tracking a lot of complex state.
16:29rhgbroken how?
16:30danielszmulewiczrhg: when the system is messed up
16:30seangroveJust wanted to double check, sohuld we change the Clojure license?
16:30rhgi also sometimes just evaluate short snippets
16:30danielszmulewiczcoventry`: so you keep track of state mentally?
16:30callenseangrove: er, what?
16:30callenseangrove: you mean in the default project.clj or something else?
16:31seangrovecallen: Just the mailing list again :P
16:31seangroveAlso, we should consider a white-space clojure syntax
16:31rhgstate is unneeded 90% of the time
16:31mdrogalisThat number is scientifically well-founded.
16:32danielszmulewiczcallen: so you never C-c C-k a buffer at the repl? I should ask if you're an emacs user first I guess?
16:32rhgor maybe more
16:32coventry`danielszmulewicz: No, actually I am just throwing the state away on each run, so I guess what I'm doing is a little like Sierra's workflow, but accidentally.
16:32callendanielszmulewicz: I do C-c C-k all the time.
16:32callendanielszmulewicz: I've been using Emacs for over a decade. How else would I do CL?
16:34danielszmulewiczcallen: so how often do you C-c C-k and when do you reload the whole?
16:34danielszmulewiczsystem?
16:34callen(inc seancorfield)
16:34lazybot⇒ 5
16:35callenI refresh when I've changed a bunch of code and I'm too lazy to manually eval individual forms.
16:35callenI don't "reload" strictly speaking.
16:35callenI C-c C-k whenever I enter a new namespace.
16:36danielszmulewiczcallen: cool. So when you do refresh, how do you do it?
16:36callenthe same way Sierra does...
16:36danielszmulewiczcallen: right, so you design your application in such a way that you can reload the whole system at the repl
16:36callenit doesn't take much "design"
16:37callengood habits in general will end up meshing naturally with how Sierra develops.
16:37callenunless you've got really strange constraints that are probably contrived.
16:37danielszmulewiczcallen: how prevalent is this strategy you reckon in the community?
16:37callenI don't really care how many people use it/
16:37callenI care that people continually improve how they work.
16:38danielszmulewiczcoventry`: when you throw away the state, how do you do it? Sierra style or you just restart the REPL?
16:39callenrestarting the REPL is really annoying.
16:39callenanybody that had killing/restarting the REPL as part of their workflow needs the am-blamps.
16:40danielszmulewiczcallen: :-)
16:40rasmustocallen: Is there a way to tell nrepl to stop running w/e infinite loop I sent the repl into? (from nrepl.el or otherwise)
16:41coventry`danielszmulewicz: I'm re-evaluating clojure.core and test-clojure into gensym'd namespaces. I effectively just throw those namespaces away. That is the extent of my state at the moment.
16:41coventry`rasmusto: C-c C-b.
16:41callencoventry`: IIRC you're working on something kinda weird anyway.
16:42rasmustocoventry`: thank you
16:42dnolenok pretty sure I have a fix for CLJS-568, cut another release 1878
16:42seangrovecallen: Ah, beat me too it
16:42seangroveC-c C-b is also awesome for a hung cljs repl
16:42danielszmulewiczcoventry`: Interesting. But makes me more curious.
16:43dnolenif anybody wants to help me please try reproducing the error with 1878 http://dev.clojure.org/jira/browse/CLJS-586
16:43callenseangrove: in the silly thread?
16:43dnolenthanks!
16:43seangrovecallen: woops, meant coventry`
16:43coventry`danielszmulewicz: I'm working on a debugging tool. I want to make sure that all of clojure can run under it without breaking/breaking the tool.
16:43nopromptdnolen: have the new compiler optimizations made it in?
16:43nopromptdnolen: it's like laser beams fast now. i love it.
16:43coventry`seangrove: no worries.
16:43callenseangrove: you saw the silly license thread right?
16:43seangrovecallen: Yeah, just a small sigh when it comes up
16:43dnolennoprompt: nope, it'll probably be while before I get around to it, but it my list of todos
16:43danielszmulewiczcoventry`: oh, I see. That must come with its own challenges.
16:44seangroveIf it changes that's cool, but I don't care much one way or another
16:44callen"IRC, where we discuss the mailing list", "mailing list, where we discuss the JIRA"
16:44dnolennoprompt: it won't be a dramatic difference, but at least we know we won't have that overhead to consider when benchmarking
16:44coventry`danielszmulewicz: Yes, it's quite challenging and fun.
16:44seangrovecallen danielszmulewicz: But I agree with the repl bits - there's rarely much state to "throw away"
16:45dnolennoprompt: glad to hear, these kind of details make a lot of difference I think.
16:45danielszmulewiczseangrove: there's components like databases, servers, that's state too
16:45seangrovednolen: Will check the bug out
16:46dnolenseangrove: thanks!
16:46danielszmulewiczcoventry`: wouldn't be related with ritz, would it?
16:46callendanielszmulewicz: and there are smarter ways to manage those components than def'ing a dynamic db var.
16:46nopromptdnolen: it's exciting stuff. not having to wait a few seconds before refreshing the browser makes a huge difference.
16:46dnolennoprompt: agreed
16:46seangrovedanielszmulewicz: Sure, but they can either be recreated or don't have to be touched. Every now and then something like the jetty server can be annoying, but you come up with functions that handle it fine
16:46coventry`danielszmulewicz: Yes, but if you're routinely testing at the repl with those resources, you're probably not working in the most efficient way.
16:47coventry`danielszmulewicz: No, not related to ritz. This is pure-clojure.
16:47danielszmulewiczcallen: Yes, I suppose you mean sierra style. I agree it's a good strategy.
16:47nopromptdnolen: the seconds lost waiting for builds can really have an impact on the workflow.
16:48callendanielszmulewicz: sometimes. the point is to pause to reflect on what you actually want.
16:48callenSierra's workflow is a reflection of that process, not reified perfection-in-itself as a workflow.
16:48nopromptgarden is going to support clojurescript soon. :-) i'm super excited about htat.
16:48danielszmulewiczcallen: fair point
16:48nopromptor rather, be available to use from clojurescript.
16:49dnolennoprompt: yep - it really wasn't CLJS was slow, just the way incremental builds worked. The fact that analyzer can get through about 15000 lines of Clojure ~1second on my machine ain't bad IMO.
16:49dnolener ClojureScript
16:50nopromptdnolen: that's amazing.
16:53callenseancorfield: thanks for that MEAP coupon :)
16:53callensnagged me a JoC 2ed
16:53danielszmulewiczcoventry`: not sure what you mean with routinely. I'm spending much time at the REPL testing stuff out, then I write what works in buffers, reload the system eventually, it's an iterative process. I'd love to know more about your approach.
16:56coventry`danielszmulewicz: The code for talking to those resources should be very simple. Most of the stuff you test at the repl should be with pure functions and data you would get from those resources.
16:56seangrovednolen: This is the warning output from the current build https://www.refheap.com/60e1e83393484e38f22626947
16:56danielszmulewiczcoventry`: oh, yes, we're in agreement.
16:57seangroveWill try with the 1878 release
16:57dnolenseangrove: that looks like completely different bug that 568
16:57dnolenseangrove: those are GClosure warnings, not CLJS compiler ones
16:58dnolenseangrove: will need a different ticket for that and a minimal case
16:58seangrovednolen: Ok then, nevermind about it
17:00dnolenseangrove: might be a dependency ordering on recompile issue ... perhaps lynaghk's spelunking in Closure Compiler might deliver something more sensible than what's in closure.clj
17:01seangrovednolen: I think that's what it was before, I was thinking about looking at it sometime soon
17:02dnolenseangrove: things definitely get out of order under incremental compilation, though I haven't encountered issues with that myself.
17:03coventry`What's the right way to get the unqualified symbol from the qualified? Like (symbol (last (str/split (name 'clojure.core/partial) #"/")))?
17:04Bronsacoventry`: ##(symbol (name 'foo/bar))
17:04lazybot⇒ bar
17:05seangrovednolen: Yeah, I just haven't used incremental compile because of it. It broke early in my cljs days, and I just do everything via repl almost. I wouldn't mind using it though, so I'll check into it later
17:06coventry`Bronsa: Heh, I had "clojure.core/partial" as a string when I was testing out name. Thanks.
17:06seangroveWhere is lynaghk's research on the compiler?
17:06dnolenseangrove: you'll have to ask him in person, not written up anywhere as far as I know
17:08callenIt's a pity the pro license for Datomic doesn't let me disclose benchmarking results...
17:08callenVery nice stuff. :)
17:08patchworkcallen: How does it prevent you disclosing benchmarks?
17:09patchworkThat seems counterproductive
17:09callenIt's pretty normal/standard for a product like Datomic, or .NET, to disallow disclosure of benchmarks.
17:09callenWell, considering how bad most people are at *designing* benchmarks, it makes sense to me.
17:09patchworkSo it seems like they would provide their own in that casxe
17:09patchwork*case
17:10callenThey could. I suspect they're busy/popular enough that they don't need to engage in 10gen-esque self-promotion though.
17:10callenhard to tell as an outsider though.
17:10callenEither way, super-pleased.
17:11patchworkTheme of the week: Everyone talking about evidence they can't show people…
17:11kawIs there a way to suppress warnings for cljsbuild that aren't coming from my own code? I'm getting this every time I compile: http://lpaste.net/1592370575374811136
17:12kawAlternatively, a way to eliminate those warnings, if they're something I can/should eliminate without digging into the domina code
17:12bbloomdnolen: lol! "pretty much incomprehensible to, you know, regular people"
17:12callenpatchwork: well. I can't. I'm going to show my coworkers in ~2.5 hours but they're the only ones who'll know how awesome Datomic is I guess :)
17:13callenI'm tempted to adapt that Yahoo test for Datomic and see what it spits out.
17:14astevethis might be slightly OT but I'm needing help understanding defbolts and storm, I figured some people in here may use storm. here's the question: what is the purpose for ["word"] for a defbolt like (defbolt sentences ["word"] [tuple collector]...)
17:15callenasteve: an aside, if you aren't already, you should be following sritchie.
17:15sritchieasteve: that's the name of the stream that the bolt outputs
17:15sritchieasteve: so, other bolts can subscribe using that name
17:16asteveis that written in the docs somewhere that I've missed?
17:17sritchieasteve: I guess nathan talks about it here...
17:17sritchiehttps://github.com/nathanmarz/storm/wiki/Clojure-DSL
17:17sritchiebut that whole page is confusing even for me
17:17bbloomdnolen: as soon as he showed that red/blue arrow, i knew exactly where he was going. i agree big time.
17:18dnolenbbloom: good stuf
17:18dnolenf
17:18asteveheh, well I'm glad I'm not the only one; thanks sritchie
17:18sritchieasteve: :) for sure
17:19callensritchie: is there a clojure equiv to summingbird?
17:19sritchiecallen: not yet, but I did a bunch of work on Cascalog 2 that pushes it in that direction
17:20asteveso, on another related note, I'm battling with upgrading storm for 0.5.2 to 0.8.2 and I'm getting a type casting errors for a number that I believe should be a long
17:20sritchieCascalog 2 generalizes the execution platform idea...
17:20callenI was about to ask if Cascalog 2 was intended to accomplish that.
17:20sritchiecallen: yup
17:20rasmustoany preference for auto-complete+ac-nrepl vs the nrepl.el default completion?
17:20callensritchie: very cool. Thanks for your work :)
17:20sritchieso the datalog planning engine generates an immutable DAG,
17:20asteveI'm getting long cannot be cast to double and double cannot be cast to long when I attempt to use .getLong and .getDouble on the tuple
17:20sritchieand then a platform compiles that down to a physical plan, like a Cascading plan
17:23bbloomdnolen: so i subscribe to these same ideas as edwards, but i'm a little more radical in my stance. instead of dynamic/static split, i want arbitrary stages with a sliding scale of dynamic/static
17:23bbloomdnolen: in general, yes, stages go from more dynamic to more static. but that might not always be the case
17:23coventry`rasmusto: I just use hippie-expand or dabbrev, or whatever comes with emacs. But emacs-live seems to have some good autocomplete functionality. Never played with it myself. http://vimeo.com/22798433
17:24rasmustocoventry`: thanks, will take a look
17:24bbloomdnolen: also, i advocate for "capabilities" as a mechanism for controlling access to various features. so for example if you have first class environments, that's pretty dynamic & hard to optimize, but if you don't ever give the first-class-environment module to the next stage, then you can treat that entire stage as being sans first class environments. just as one example
17:24tbaldridgebbloom: I still question if it really makes things any simpler with the half-dynamic stuff. And he basically side-stepped the whole template error message thing by putting error message construction on the user.
17:24sritchiecallen: I'm speaking about it at clojure/conj, btw
17:25sritchieso I'll have to have the storm planner done by then :)
17:25bbloomtbaldridge: still watching. will comment on that in a sec
17:25callenanother reason to go to the conj. hrrrm
17:30bbloomtbaldridge: ambrose just wrote a whole thing about witnesses for types in core.typed :-) http://frenchy64.github.io/2013/09/08/simple-reasoning-assertions-core-typed.html
17:32bbloomtbaldridge: i think that it's a pretty reasonable approach. we've got the same issues in clojure where you fuck up and give a number instead of a map or something and you get a stack trace from *deep* in the app
17:32bbloomtbaldridge: if you just add an (assert (number? x)) somewhere, you're fine. you don't need to (assert (number? x) "Some friendly message") necessarily
17:33dnolenbbloom: tbaldridge: I agree with the idea that witnesses sound reasonable - sounds close to contracts and blame stuff
17:33bbloomtbaldridge: he alluded to it, but an even better solution is the "blame calculus" which is what folks are researching both for dynamic types AND things like concepts
17:33dnolenhello world in ClojureScript now generates 49 lines of pretty printed advanced compiled code
17:33dnolenI don't think we can actually get much smaller than that :)
17:33bbloomtbaldridge: it's funny, but creating inhabited generics is roughly the same as evaluating dynamically typed code :-P hence the same tech works on both
17:39tbaldridgebbloom: and is also the same tech used in the PyPy tracing JITs. bytecode tracing -> partial evaluation of the bytecode -> static type the byte code -> remove mallocs -> generate machine code.
17:40scriptordnolen: wait, the days of 4000 lines of generated js are over?
17:40bbloomtbaldridge: haha yeah, that too! I'm telling you, partial evaluation & specialization via abstract interpretation is a big fucking idea :-)
17:40dnolenscriptor: absolutely not
17:40dnolenscriptor: but the dependencies in core.cljs are very clean now, you get what you use.
17:42rasmustocoventry`: ac-nrepl is pretty easy to setup, I'll go with this for now :)
17:43coventry`rasmusto: Oh, is it ac-nrepl? People were complaining about that here the other day. http://clojure-log.n01se.net/date/2013-09-09.html#14:15
17:44rasmustocoventry`: haha, no blood/sweat/tears here, but I'll take that under advisement
17:46callenac-nrepl is really slow sometimes.
17:46callenpeople should still try it out, but z0mg it drives me nuts sometimes.
17:46rasmustocallen: it's all backgrounded though, right?
17:46callenit slows down my namespace switching hardcore.
17:46callenrasmusto: if it is, I haven't noticed.
17:48rasmustocallen: ah, I see what you're saying, typing "def" and waiting will make it chug a bit
17:49callenno, I mean nrepl-set-ns blocks for awhile when I'm using ac-nrepl.
17:49callenwhich sucks because my work-style is to jump from ns to ns when I'm testing assumptions.
17:49callenI don't do everything in (ns user) like some people.
17:49rasmustocallen: me either, I usually just do a c-c c-k and go from there
17:50rasmusto(which might be bad)
17:50callenI do the same.
17:50callenC-c M-n + C-c C-k
17:50rasmustooh, does c-c c-k not change your namespace automatically?
17:51callenhrm. lets find out.
17:51coventry`rasmusto: no.
17:51callennope.
17:52callenit just reloads the vars in that buffer.
17:52callenin their respective namespaces.
17:52rasmustooh, you're talking about the repl namespace
17:53rasmustoif I want to run code "on the repl" I just drop it into a namespace that requires/uses the namespace with the code that I want
17:53rasmustowhich is probably where my workflow is a bit strange
17:53coventry`rasmusto: It's awfully handy to be able to just type forms in and hit enter, sometimes.
17:54rasmustocoventry`: is it more handy than having those forms in a persistant buffer and just have to take one more step to delete it afterwards?
17:55coventry`Yes. I don't usually want a record of every dumb thing I tried. When I get the result I want, that goes in a unit test.
17:56coventry`If I learn something substantial along the way about the right/wrong way to do things, that goes in my org-mode notes. :-)
17:56rasmustocoventry`: okay, gotcha
17:56rasmustocoventry`: are you talking about undo history?
17:58coventry`No, I mean using the repl window. E.g. https://www.refheap.com/18560
18:00rasmustocoventry`: alright. I appreciate the advice. I bootstrapped my own goofy workflow, so its good to hear how other people do things :)
18:16callen,(get (Object.) :a)
18:16clojurebotnil
18:16callenyeah aphyr wasn't kidding.
18:18technomancy,(get nil :a)
18:18clojurebotnil
18:19technomancywow
18:19callenclearly a function after my own heart.
18:19hiredman,(assoc nil :a 1)
18:19clojurebot{:a 1}
18:19callen,(assoc (Object.) :a 1)
18:19clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Object cannot be cast to clojure.lang.Associative>
18:20callenbut nil can? d00d.
18:20technomancyyeah_whatever.jpg
18:35dnolenCLJS folks I've backed out format/printf - http://github.com/clojure/clojurescript/commit/48c8d0fafc18375876e10caf960a7c7da27ac308
18:36dnolenif I hear a lot of complaints I'll bring it back in but I can't imagine that people used it for much given it extremely limited capabilities
18:36dnolenit cannot be optimized away by GClosure because of it's horrendous design
18:36dnolenso it'll take some convincing for me to move it back in
18:38dnolenthis also delivers an extremely clean core.cljs as far as dependencies go - a CLJS program that doesn't use core.cljs now only consists of 10 lines of code.
18:39sdegutisI remember saying "I like the idea of Clojure but the JVM startup time just isn't worth it"... back when I was using Bundler. (lol)
18:39technomancygrenchman!
18:39sdegutisyou keep saying that word
18:39sdegutisi do not think it means what you think it means
18:39technomancyit's a fun word
18:40sdegutistechnomancy: it reminds me of grinch and henchmen every time i read it
18:40sdegutisbrehaut: heh
18:40technomancythat's no good; it should remind you of a high-school skinhead band
18:40sdegutisit succeeds in failing at that
19:03callentechnomancy: I like typing grench :P
19:03technomancygrench grench grench
19:04devngwrench
19:07nopromptGRENCH-MU-MU-MU-MAAAAAAAYAAAAANA!
19:09nopromptM-x james-hetfield-mode
19:10nopromptgrench-a. may-na.
19:13callennoprompt: I don't think most Clojure users are confronted with the Java that often unless they're tackling weird/arcane problems.
19:13nopromptcallen: in reference to the tweet?
19:14nopromptcallen: when i wrote it i was thinking more of ClojureScript/JavaScript because interop is more in your face there.
19:14nopromptgrizninch
19:15noprompttechnomancy: the next lib i come up with needs a ridiculous name.
19:15noprompti always wanted a lib called "blood"
19:16technomancyplease do
19:16noprompti stole "shodan" from system shock.
19:17technomancyhttps://clojars.org/shodan <- this one?
19:18technomancy(yes, duh)
19:18technomancyapparently your lib has connected to freenode
19:19technomancySHODAN: please don't kill us
19:19sdegutistechnomancy: but is grenchman production-ready?
19:20noprompttechnomancy: there's a clip on youtube with all the S.H.O.D.A.N. quotes.
19:20technomancysdegutis: we are rolling out a full factory run of grenchman units next week
19:21noprompttechnomancy: be sure to have a counter somewhere on the README that says "X days without an accident."
19:21sdegutisshodan... is that the lib that somehow made me end up on the GlaDOS wikipedia page?
19:21nopromptsdegutis: haha! yeah! that happened to me too!
19:21sdegutis:D
19:22sdegutisi havent played portal or portal 2, but ive heard all her quotes. pretty funny stuff.
19:22nopromptsdegutis: did you ever play the system shock games?
19:23sdegutisonly post-SNES games i ever played were Morrowind and Halo 1.
19:23rasmusto@_@
19:24technomancythe first system shock may have been contemporary to the SNES
19:24callennoprompt: yeah that's true.
19:24nopromptapparently @polask_1 just started following me. wow. imagine it beautiful girls following me on twitter.
19:24nopromptoh. wait. aww. it's a spammer. this day is ruined.
19:24technomancyyeah, 1994. predates Marathon even, wow.
19:25sdegutisand the only non-post-SNES games i really played were Super Metroid and 7th Saga
19:26sdegutisoh wait, how could i forget Final Fantasy 7.. i played that one a ton too
19:26nopromptsuper metroid was, as they say in basketball, a "slam dunk."
19:26sdegutisnoprompt: that comes from basketball? no wonder they looked at me awkwardly at the last superbowl thing
19:27technomancynoprompt: I haven't actually played SS1; how does it compare to the second?
19:27nopromptwas there ever a "First Fantasy"?
19:27rasmustonoprompt: this is the only "slam dunk" game IMO: http://www.talesofgames.com/related_game/barkley-shut-up-jam-gaiden/
19:27noprompttechnomancy: i don't remember much about it. it didn't leave as much as an impression on me as the second one.
19:28noprompttechnomancy: going through the wikipedia article brought up old memories and now i'm thinking of replaying them.
19:28technomancynoprompt: the second is pretty haunting
19:28technomancylots of sheer panic moments
19:29nopromptsci-fi horror is such a great genre.
19:30noprompt"Irrevocable Fantasy"
19:30sdegutisheh
19:30nopromptrasmusto: hey remember NBA Jam? where you could, like, dunk from half court.
19:31rasmustonoprompt: you mean, "from downtown"?
19:31nopromptYES!
19:31rasmustopippin/grant was overpowered
19:31s4muelhe's on fiiiire!
19:31s4muelnba jam was the shit.
19:32s4muelBOOMSHAKALAKA!
19:32sdegutisalright, that was some pretty high quality bonding, thanks yall. time to hack on a datomic project
19:32nopromptthere it is. there's the lib name. "shakalaka"
19:32rasmustoI knew it would come out eventually
19:33rasmusto"sjakalaka"
19:34sdegutisi wanted to name all my projects after FFVII stuff. my IDE is named Leviathan and my music app is named Bahamut.
19:34sdegutisbut i think there's probably legal reasons i cant do that.
19:34sdegutisfortunately both those names already come from mythology so i can keep them. but I probably cant, say, name a new lib "Materia"
19:35Bronsawhy not. "materia" means "matter" in italian
19:35nopromptsdegutis: so if i name my kid Bahamut, Squaresoft is gonna sue me?
19:35nopromptor worse, sue my kid?
19:35s4muelnoprompt: no but your kid is going to be pissed that you named him after such a lowball materia
19:35brehautyou could probably name your kid squaresoft and they couldnt do anything
19:36sdegutisnoprompt: no but if you call it Sephiroth they might
19:36s4muelnoprompt: name your kid Quadra Magic.
19:36sdegutisoh man.. such an awesome materia
19:37kovasBronsa: hows CinC coming? seeing a steady stream of commits
19:38sdegutisso i named my lisp interpreter Beowulf. i think its gonna catch on.
19:38Bronsakovas: it's near, it's left to emit fn/deftype/reify and then it should be usable
19:38kovasthats awesome
19:38Bronsathere's an issue with loop/recur tag inference and primitive support is not exactly tested yet
19:39kovasdefinitely looking forward to studying it once its ready
19:39nopromptif technomancy didn't take grenchman i'd name my lisp interpreter that.
19:39kovasyeah hard to nail every little thing on the first try...
19:39kovasany idea what the compilation speed is gonna be like in comparison with the java version?
19:40Bronsato be honest, I think it's going to be pretty slow.
19:40sdegutisnoprompt: you have one too?
19:40BronsaI havent done any performance work
19:40kovasi guess im wondering if its like 10x slower, or a 100x
19:40Bronsakovas: there's plently of room for performance enhancements though
19:40kovasif its within the 10x ballpark, some perf improvements should close the gap
19:40nopromptsdegutis: oh. i've only written toy lisp interpreters. i helped out with the rouge project for a while.
19:41nopromptBronsa: is that the Clojure to C compiler?
19:41kovasClojure-In-Clojure
19:41Bronsanoprompt: no, it's a clojure to jvm compiler written in clojure
19:41tufflaxwhere is cinc hosted?
19:41`cbpo_O
19:41tufflaxor, where is the repo?
19:41nopromptBronsa: that sounds cool?
19:41Bronsahttps://github.com/Bronsa/CinC
19:42noprompts/\?/./
19:42kovasBronsa: once u get it working, putting some comments in would be very helpful :)
19:42Bronsakovas: yeah, I know :)
19:42Bronsadocumentation is going to be my main priority once I get everything to work
19:43kovasprobably more value in that than on polishing the perf etc
19:43kovasawesome man
19:43sdegutisnoprompt: ah right, mines probably at toy-level too, but i hope to use it for scripting mac apps: https://github.com/sdegutis/Beowulf/tree/master/Beowulf (doesn't need to be super efficient just for scripting)
19:43Bronsaprobably more value than in the project itself kovas :)
19:43sdegutisi got it to do these things so far: https://github.com/sdegutis/Beowulf/blob/master/BeowulfTests/BeowulfTests.m
19:43technomancySephiroth is a hasidic concept referring to the names of God
19:43kovasyeah i think of the clojure code as a comprehensible explanation of the compilation process
19:43kovasno way i was gonna read the java
19:44Bronsakovas: CinC is obviously never going to replace the java implementation but it's probably going to be real usefull for experiments/understanding how the compiler works
19:44Bronsayeah, Compiler.java is a mess.
19:44kovasBronsa: I'm not so sure about that statement
19:44sdegutistechnomancy: only if you spell it differently though :)
19:44kovasBronsa: I think the killer app would be better error messages
19:45kovasBronsa: but who knows what technology is more possible with CinC
19:45tufflaxAnd having IPersistentMap etc be protocols? That would be nice
19:47Bronsatufflax: CinC is only a port of the compiler, not a full self-hosting implementation of clojure
19:47Bronsathat's going to be a lot more work :P
19:47brehautsdegutis: i should mention, that javascript is painfully optimized for one shot runtime performance on webpage load; theres soem pretty horrible crap going on to achieve it
19:48Bronsakovas: I have an open issue for that, it's going to take me a while but that's definitely something I want to try and do
19:48kovasBronsa: yeah thats down the line, but still this is an important project for the long term
19:48sdegutisThere are 2 things that make ObjC kind of crappy for something like Clojure.. one is that you can't tell when you should use nil or [NSNull null], and another is the lack of runtime reflection on functions, or being able to generate them properly with the right args.
19:48kovas(CinC)
19:49Bronsakovas: right now my schedule is: make it work by the end of the GSoC (the end of the week :P), write extensive documentation, performance enhancements/error messages
19:49sdegutisAlthough I have a fix for that which *should* work in 99% of cases, and just have strange bugs if you try to do something super-fancy.
19:50Bronsaand hopefully get to standardize the AST between CinC/clojurescript/jvm.tools.analyzer, I'll have to talk with dnolen/ambrosebs for that
19:50kovascool. Id love to see a talk on it at some conference someday
19:50kovasi think most people don't realize this project is happening
19:51kovasyet
19:51Bronsayeah, to be honest I havent really publicized it, I want to wait until it's complete/cleaned up before releasing it and announcing it properly
19:52kovasyup makes sense
19:53sdegutisBronsa: it'll still need the JVM though to run, right? (or node)
19:53Bronsayes
19:55noprompti'm not very good at "selling" clojure.
19:55sdegutisnoprompt: thats cuz its free
19:55noprompt:)
19:56sdegutisnoprompt: I've found that nobody starts giving Clojure a serious look until they're finally fully fed up with other languages.
19:57rhgis just a raw (let ...) ok for side effect code or should i do (do (let ...))?
19:57sdegutisnoprompt: And no matter what language it is, people are usually content with whatever inconsistencies or poor abstractions of convolutions it has, whether it's C++ or Ruby or Python or Perl or Common Lisp
19:58rasmustorhg: let has an implicit do
19:58rhgik
19:58rhgi mean for style
19:58rasmustorhg: ok, can't speak to style :)
19:58nopromptsdegutis: a friend of mine pinged me saying "i need a new platform for web development".
19:58rhgya
19:59rasmustorhg: maybe put it in a function with a ! in the name
19:59s4muelrhg: (defn side-effecty-fn! [] (let ...
19:59s4muelhive mind
19:59rasmustohive mind!
20:00rhgits a multimethod, not my choice
20:03rhgbasically it calls alter-meta! to insert a key and returns the value of the key
20:06squidzdoes anybody know why i'm getting this schema errror https://www.refheap.com/18562
20:07sdegutisMy wife and I can't figure out what the Grenchman comic is referencing.
20:07sdegutisShe pointed out that it's Simon Cowell, that part I didn't get.
20:07sdegutisBut still..
20:07technomancyhint: it is a hyperlink
20:08sdegutisOh. heh.
20:09squidzsomething is wrong with the stacked-power-form map. When I type in a simpler map it works, but I can't figure out why that map throws that error
20:09rhghttps://www.refheap.com/18563
20:09rhgits the fn
20:10squidzrhg: what fn?
20:11technomancysdegutis: you might have to go back a bit to get context
20:11rhgthe multimethod im extending
20:11technomancyachewood is very high-context humor
20:11sdegutisoh
20:15rhgactually my real intent is a cache of sorts, maybe a global memoized html-resource fn, but thatd remove the ability to easily remove something from cache
20:15clojurebotAlles klar
20:16technomancyclojurebot: say something unexpected
20:16clojurebotNo entiendo
20:16rhgah
20:18rhgi had it not cache and even on my inet a few requests took too long
20:21rhghas anybody used core.cache?
20:21ddellacostarhg: yes
20:21rhghmm
20:25hiredmanrhg: I would be surprised if anyone uses core.cache directly, I imagine most people who use it actually use core.memoize
20:25rhgah
20:25sdegutisHow should macros work in an interpreted (minimal) version of Clojure?
20:25rhgthx
20:27sdegutisI figured they should just be functions that have different evaluation rules: they're called with their args un-eval'd, and the return result gets eval'd. Should be that simple, right?
20:27sdegutisnoprompt: rouge looked really neat btw, I wonder why it didn't gain much traction
20:27sdegutisAnd why rouge.io is dead
20:28R_Macyhaha, so the discussion is somewhat relevant with the problem I'm about to has for help with
20:28R_MacyI'm getting the following stack trace: No such var: clojure.core.cache/through, compiling
20:28R_MacyWhen trying to: lein with-profile production trampoline run -m app.web
20:29R_Macy%/has/ask
20:29R_MacyPoking around on the web, and not seeing anything obvious
20:29rhghmm, core.memoize may really help here
20:29nopromptsdegutis: we just stopped working on it.
20:30nopromptsdegutis: simple as that.
20:30clojurebotIt's greek to me.
20:30sdegutisnoprompt: heh
20:30technomancyhrm; I thought I had a dumb defmacro working in bus scheme
20:30technomancybut I can't find it
20:30hiredmanR_Macy: you are refering the name clojure.core.cache/through with out loading the clojure.core.cache namespace
20:30nopromptsdegutis: also, i couldn't understand some of the code so i wasn't sure how to do things i wanted to do.
20:30sdegutisnoprompt: happens to the best of projects
20:31sdegutis(or something)
20:31R_Macyhiredman leiningen must be doing, because I definitely am not
20:31R_Macythis is almost a base leiningen heroku template with minor modifications
20:32nopromptinstalling software and setting up a server is boring.
20:32s4muelR_Macy: And you've got org.clojure/core.cache in your project.clj dependencies?
20:32technomancyR_Macy: if it works in a repl then it must be pulled in by your dev deps or something
20:32R_MacyI'll try adding it to my deps
20:32technomancyyou need to declare it explicitly if you use it directly
20:35R_MacyVery odd, I must be using a project that depends on it implicitly
20:35R_Macyincluding it in project.clj worked, thanks for the help
20:35technomancyit's not that odd
20:36R_MacyI think it's odd that it wasn't included in the template that has projects that depend on it
20:37akanoprompt: you've obviously never done a bunch of cocain with a drunk stripper and provision a server before.
20:38nopromptaka: wut? where is that going down?
20:38nopromptaka: that sounds neat.
20:38technomancyR_Macy: it's not a dependency of the heroku template
20:38akanoprompt: it's the only way to provision
20:38nopromptaka: i knew i was doing something wrong.
20:40nopromptwhat am i doing with my life?
20:40akaWell now you know. I like to think I might have changed your life for the positive.
20:40nopromptaka: i think so.
20:41akaI like to think I did something good for the stripper and did a decent deploy too. We both know I didn't.
20:43akaAnyone have a suggestion for a library for creating and altering torrent files?
20:43nopromptaka: the sad thing is i stopped drinking months ago. now, no one calls or texts.
20:43nopromptaka: perhaps cocaine and strippers will get me out of this sober funk.
20:44akanoprompt: I'm just getting out of my stop drinking heavy for a few years phase. I was pulling a real noprompt for a few years but I'm snapped out of it now.
20:44s4muel...six weeks later: that didn't go as planned.
20:45akaHow many times has a night ended in a total blackout after starting with a proclamation of absolute sobriety?
20:45noprompttechnomancy: cartilage head.
20:45akaMore times than not I'm afraid.
20:52nopromptwow. yeah i just stopped drinking cause it was expensive and distracting.
20:52geoffegI feel like this is much, much more complicated than it needs to be. Any suggestions? https://gist.github.com/geoffeg/6531708
20:55nopromptgeoffeg: use a multimethod
20:55akaI'm finally getting into some serious development with clojure after about a year of full intentions to play with it. I'm curious if there is any value in using a lib like 0mq and proto buffers, or if I should try to enjoy some of the more "pure" facilities that clojure provides to handle that. Anyone have a suggestion in regards to that? I'm building a system that will be processing data in parallel locally
20:55akabut communicating to other nodes as well as distributing "large" files to all the nodes.
20:55nopromptgeoffeg: also use keywords. {:cat "meow"}
20:56nopromptgeoffeg: also break up your code in to smaller functions that have a purpose.
20:56technomancyaka: if you can use a centralized message broker your architecture will be dramatically simpler
20:56akaagreed
20:57geoffeghmm, i tried it as a multimethod yesterday and decided it wouldn't work for some reason i can no longer remember :)
20:58geoffegi'll try again
20:59technomancyyou can try 0mq, but unless you have really unique requirements I would recommend against it for your first clojure project
20:59geoffegsomething to do with needing to pass different params to the methods than was passed into the mutlimethod
21:03callendon't use 0mq for your first clojure project, yeesh.
21:03akaTo be clear I am very comfortable with 0mq is the only reason I'm dragging it into this. Ideally this system wouldn't require a central message broker but I'm thinking I'll go that route. wow my life just got about 10x easier just from that little talk.
21:04callenaka: well, if that's kosher, you might as well go the whole way and use the core.async 0mq library for Clojure.
21:04aka Anything I should know about protocols before I dig in?
21:05technomancydon't use protocols on your first clojure project either
21:05technomancyor rather, on your first non-oo project
21:06akaGreat, I don't get to do anything cool. I guess this app will just have to work instead.
21:07technomancysorry; if you wanted fresh and exciting try #elixir-lang =)
21:07akalol
21:07nopromptaka, technomancy is actually giving good advice. he gave me the same advice when i first came here and i'm glad he did.
21:08akaYeah I am def not arguing it.
21:08nopromptno. fuck that. we're arguing now.
21:08technomancyI still haven't worked on any projects that justified use of protocols
21:08akaIt is a little frustrating when people don't let you shoot yourself in the foot.
21:08akayeah you're right I'm pissed
21:08akaright?
21:09technomancyalso for goodness sake don't write any macros
21:09akaI probably just have a limited *mis*understanding of what protocols are and what they provide
21:09noprompttechnomancy: how would you do something like hiccup or garden w/o asking map?, vector?, or checking keys/meta?
21:09nopromptjust out of curiosity.
21:09nopromptoh and btw, this an an argument. we're totally arguing right nwo.
21:10noprompt*now
21:10bbloomnoprompt: what's wrong with asking map? vector? etc?
21:10technomancynoprompt: hiccup doesn't have any runtime polymorphism afaik
21:10nopromptbbloom: hiccup uses protocols.
21:10technomancyisn't it all precompiled into functions that take strings?
21:10akaoh sweet I have to use hiccup then
21:10nopromptwhoops, that was @ technomancy
21:11nopromptbbloom: i don't think there is anything wrong with map? vector? etc?
21:11akanoprompt: could you do me a favor and spell "now" correct the first time when we are arguing
21:11akait would me a lot
21:11nopromptaka: oh wut? oh no you didn't. that's it dawg the glove are off nwo.
21:11noprompt*now
21:12callennoprompt: are you trying to dethrone me as resident belligerent Clojure user?
21:12noprompttechnomancy: so the record/protocol stuff is for perf?
21:12technomancynoprompt: yes
21:12nopromptor as i like to call it, "PERF madness"
21:12bbloomnoprompt: and interop with java's interfaces
21:13nopromptbbloom, technomancy so should i go an pull out all the protocols/records in Garden?
21:13technomancynoprompt: what's Garden?
21:13bbloomit's also useful if you need to do some horrible dependency injection-style nightmare thing where you have alternate Whateverers that implement Whateverable
21:13akaman I love fighting on irc... I'm just tuff as shit on here
21:14bbloomwhich i've only never needed when interoping with broken ass libraries :-P
21:14noprompttechnomancy: it's a Clojure -> CSS lib like hiccup
21:15technomancynoprompt: don't fix what isn't broken, but it doesn't sound like a good fit
21:16callennoprompt: yes
21:16noprompttechnomancy: well, hypothetically here.
21:16callennoprompt: rip them all out. Do it for Lord Satan.
21:17noprompttechnomancy: seriously. some insight would be nice. i feel like people never give me honest opinions. :-/
21:18callenI'm always honest.
21:18technomancynoprompt: I don't know anything about CSS
21:18noprompti'm not gonna get "butt hurt" as they say.
21:18callennoprompt: protocols and records are probably unnecessary in Garden and you should remove them if you're willing to actually do so.
21:18noprompts/\(they\)/"\1"
21:18technomancyif you were just starting, I would first ask if you really need polymorphism, and if you were really sure you did I'd tell you to use multimethods, which are a lot more flexible
21:19technomancybecause I can't imagine dispatch ever being a bottleneck
21:19nopromptcallen: i would be willing to.
21:19callenjust use maps and functions. If you need polymorphism - maps and multimethods.
21:19callenand be *sure* of whether or not you actually need polymorphism.
21:20nopromptCSS has a lot more to it than HTML.
21:20callenI understand CSS just fine.
21:20sdegutisnoprompt: alternatively you can use protocols and defrecords
21:20technomancy(css [:h1 :h2 [:a {:text-decoration "none"]]) ;-> "h1 a, h2 a{text-decoration:none}"
21:20sdegutisnoprompt: or Ruby
21:20noprompti could represent things as maps sure. but then during the compilation i'd be constantly frisking every map checking for keys.
21:21nopromptsdegutis: that's what we're talking about.
21:21akaYou guys make it sound like adding unneeded complexity is a bad thing :)
21:21callen^^ do ho ho ho
21:21sdegutisnoprompt: sounds like protocols and defrecord is what you want
21:21callenprobably not.
21:21technomancy^ I would have structured this as {[:h1 :h2] {:a {:text-decoration "none"}}} because you're mapping several things to one value
21:21nopromptsdegutis: that's what i have. that's what were talking about not having.
21:21noprompttechnomancy: unfotunately order matters in CSS
21:22sdegutisnoprompt: oh, ok. why go away from protocols and defrecord?
21:22technomancynoprompt: ah, gotcha. yeah, I don't know the semantics enough to comment on polymorphism
21:23sdegutisnoprompt: heh yeah, I got bit when translating my CSS to garden, because I often get lazy and do "margin: 30px; margin-left: 20px;"
21:24nopromptsdegutis: that's why i tell people to use multiple maps if order matters.
21:24sdegutisnoprompt: oh I didn't realize you could do that, cool
21:24nopromptsdegutis: i think you can also use an ordered map too but that doesn't "look cool"
21:24sdegutis:D
21:24sdegutisit will once you define a reader macro for it
21:25nopromptsdegutis: oh yes, there's that. :)
21:25nopromptsdegutis: i have reader macros defined for the unit functions like #px
21:26seangrovenoprompt: https://github.com/flatland/ordered
21:26noprompttechnomancy: but is that the idea? to check for specific keys, etc?
21:26seangroveYou could write a custom reader if you wanted it to look cool
21:27sdegutisnoprompt: I tried to use those but wasn't finding that they helped any
21:27sdegutisMaybe with a better syntax highlighter they would have helped.
21:27nopromptsdegutis: everyone has things that work/don't work for them.
21:27sdegutisUnfortunately I can't allocate any spare time to work on my own IDE that might be able to fix that, because I've got to spend all my energy converting our site from MongoDB to Datomic.
21:31nopromptsdegutis: really the idea was to have a format as the base to build on top of. ideally garden stylesheets should look like clojure code.
21:36sdegutisnoprompt: ah that makes sense
21:37nopromptsdegutis: in fact, i plan to update the README to encourage people to use the at-media function instead of the meta directly.
21:37sdegutishmm interesting idea
21:37nopromptsdegutis: i've been making a lot of changes to the lib over the past couple weeks and there are lots of breaking changes in v1.0.0
22:05coventry`Why is import* interned as clojure.core/import* rather than just import*, like all the other special symbols?
22:15clj_newb_2345are there any clojure libraries for sending android push notifications ? (without having to install an ap on the android device)