#clojure logs

2015-10-10

01:14nowprovisionhttps://clojuredocs.org/clojure.core/lazy-seq#example-542692d3c026201cdc326ff1 why does this stackoverflow?
02:59sveriHi, how can I define a prismatic schema for a "def"?
03:16Trioxinis opengl ez to use these days in clojure?
03:16Trioxinbetter yet maybe openCL
03:16Trioxinhttp://clojurecl.uncomplicate.org/
03:17Trioxinfoking CUDA
04:32cenzhehi, all
04:32cenzhewhen I read the source file of core.clj
04:32cenzhetrying to find out how `case` is implemented
04:32cenzheit further directs me to `case*`
04:33cenzhebut I can't find the declaration of `case*` anywhere
04:33cenzheso, where is `case*` declared, and how it is loaded?
05:10amalloyit's a special form
05:21cenzhe@amalloy I see. But where is it defined?
05:21amalloyin the compiler, in java. that's basically what special form means
05:22cenzhehttps://github.com/clojure/clojure/tree/master/src/jvm/clojure
05:22cenzhesomewhere here?
05:23amalloyspecifically https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java
05:24amalloymore specifically still, https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L8441
05:26cenzhecool!
05:26cenzhemany thanks
05:50Seylerius(inc wasamasa)
05:50Seylerius,(inc wasamasa)
05:50clojurebot#error {\n :cause "Unable to resolve symbol: wasamasa in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: wasamasa in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: wasamas...
05:50Seylerius(inc wasamasa)
07:36boxedis there some tool that makes developing macros somewhat non-horrible?
08:01justin_smithboxed: the thing that's helped me the most is never have logic in macros - macros are for syntax, if you need logic, write a function that does it and have the macro call that function
08:01boxedif only I had gotten that far :P
08:02boxedactually, now I managed to figure out how to use macroexpand-1 and that helped enough to get that far I think
08:03justin_smithoh yeah, macroexpand is another crucial thing of course
08:48muhuksay you have a get-in, it's not-found is another get-in. How do you refactor this?
11:01sveriHi, how can I define a prismatic schema for "def"?
11:16NickSeagullHi there, my first time here :)
11:17emdashcommaHi
11:17skeuomorfWhy does (hash) return a signed 32-bit int and not bytes?
11:17skeuomorfvery weird
11:18Empperidue to java
11:18NickSeagullI suppose that too
11:19Empperiit returns hashcode not hash as in eg. md5 or similar
11:20skeuomorfEmpperi: hashcode is a hash like md5 or similar
11:20skeuomorfEmpperi: It's just that the representation here is stupid
11:20Empperioh no, not in java
11:20skeuomorfEmpperi: What do you mean? What's the underlying algorithm?
11:20Empperiin java it returns object hash code
11:20Empperiyou define it per class yourself
11:20Empperiin java
11:21Empperior it returns object memory address
11:21skeuomorfEmpperi: Yes, well aware, how is the hashcode generated?
11:21Empperiif it's the default implementation
11:21skeuomorfEmpperi: ah
11:22NickSeagullBtw guys, what do you think about core.typed? Do you think it is worth to use?
11:22NickSeagullI have read a few about the topic and I think its quite useful/interesting
11:22NickSeagulla few posts*
11:23muhukHow can I tell a (ring) request from response?
11:27Empperiehm, request goes as function parameters, response comes as return value?
11:31Empperino need
11:31Empperiit's just the older java which is funky
11:31ARM9wasn't core.typed incredibly slow?
11:31Empperianyway, hashCode in java does not have anything to do with hashing algorithms but with hash trees
11:32Empperiit's a convoluted way to force it on every object but it allows them to be placed in hash trees and similar data strucutres
11:32EmpperihashCode is one of the worst things in old java
11:33muhukEmpperi: and nobody ever works on middlewares, right?
11:33Empperiand it gets worse with .equals() ...
11:34Empperimuhuk: oh no, I work with them all the time
11:34Empperior well, not ALL the time :)
11:34Empperibut in pretty much every project
11:35Empperibut yeah, in middlewares you get request as a parameter and you're supposed to return the response which you get from the function you call in your middleware chain
11:35Empperithere's nothing special in it and it's really simple since everything is just normal functions
11:36Empperithere is no need to try to find out if you have a request or response in hand since you already know
11:36skeuomorfEmpperi: Old java, new java, no matter what java, it's verbose java
11:36skeuomorfEmpperi: :)
11:36Empperinah, it's not that bad in java 8 :)
11:36Empperisure it's verbose especially when compared to clojure
11:36Empperibut the enterprisey java and the "de facto way" to write java is pretty horrible
11:37Empperithe worst java I see is written by old C guys
11:37Empperithat stuff is terrible
11:37skeuomorfAll Java is worst Java
11:37Empperimethods which might be 1-2kloc and classes which can be 5k+
11:38Empperiwell we can happily disagree and continue with our lives ;)
11:38skeuomorfI only write Java when I absolutely have to e.g. Android, Clojure interop
11:39EmpperiI just decided to write this one app in our system in java instead of clojure
11:39Empperiit was more simple to write in java in that particular case
11:40Empperinow we have 8 different apps/services, 7 in clojure one in java
11:40skeuomorfWell, the current lib I am writing would definitely be much easier in *any* mutable language
11:40Empperi(I think it was 8, currently in a paternity leave and been out from work for over 2 weeks)
11:40skeuomorfSome implementations just don't lend themselves well to immutability
11:41Empperiyeah
11:41skeuomorfEmpperi: Congrats on the baby :)
11:41Empperiin our case it was the existing framework we had to use (or well, not *had* to use but it made sense since it had so much ready for us) and it would have been too cumbersome to do with clojure and it's java interop
11:41Empperiand thanks, she's now 1 year old
11:42Empperistaying home for the rest of the year
11:42Empperimy wife went back to work
11:42skeuomorfBabies are awesome
11:42Empperiusually lol
11:42Empperinot always
11:42skeuomorfUntil they aren't :P
11:43janus_Hey, have anyone else encountered this problem? http://lpaste.net/142701
11:43janus_lein midje works normally
11:44Empperijanus_: looks like nrepl cannot connect
11:44janus_I'm using arch linux and leiningen2-git aur package
11:44Empperimight be a super tight firewall
11:44janus_Empperi: yeah, I've noticed that, but how to fix it?
11:45Empperiit's a network problem that's all I can say
11:45Empperianyway gtg, that baby I mentioned :)
11:46janus_Empperi: o-kay, thanks anyway
12:58NickSeagullSo, is core.typed recommended or not? lol
13:22sveriNickSeagull ARM9 cannot say anything about the speed. I tried it a few times, but did not manage to type everything. Cannot exactly say which forms, but it's kind of hard. On the other hand, I found some errors in my code with it. There was a post about some "bigger" company switching to prismatic.schema. It described the same pain points I had, except of the speed. But they had 90 namespaces covered, so this will surely take a w
14:26krzysztofhey, I have java class comming from external lib and I'd like to be able to have this class to be destrctured. It contains get(int i) method, but is not implementing any standard interface. do you know how can approach this?
14:27justin_smith(.get O 0) (or whatever number)
14:32rhg135I don't think you can directly
14:32justin_smithoh, if you literally mean destructuring yeah, no, you're out of luck
14:42jeremyheilerrhg135: you can try to fake it by writing a function that acts as a lazy seq over the obj
14:43jeremyheilerhttps://gist.github.com/jeremyheiler/86dffef5b0fbe6a7eed3
14:43justin_smithoh, good point, yeah
14:43rhg135I know hence the "directly" :P
14:44jeremyheilergotcha
14:46jeremyheileroops, you weren't asking the question
14:46jeremyheilerlol
14:46rhg135a better approach would be to lazily produce only the results you want
14:46rhg135no worrie.rs
14:47rhg135meh, I'm learning dvorak so typos ahoy
14:48sverirhg135 You might want to have a look at neo. I also learned dvorak, but found neo to be better suited for the parantheses stuff
14:48sveriAnd switched to neo some time ago
14:48jeremyheilerrhg135: my obj-seq does dot hat
14:48jeremyheilerdo that*
14:48rhg135sveri: will do
14:49rhg135but I also write
14:50rhg135jeremyheiler: if you request, say, 1, wouldn't it pull 0 too?
14:52jeremyheilerthere's no 0 in the example input
14:52jeremyheilerwhich is [1 2 3]
14:53rhg135I mean index
14:54jeremyheilerrhg135: ok
14:54jeremyheileri updated my gist with an example
14:57rhg135I see maybe. I need to go eat, I'm seeing hazy.
14:57rhg135bbiab
15:01rhg135Index 0 would be the 1,but I mean you can't assume .get() will be fast and idempotent
15:05rhg135For all you know .get(0) will try to contact a remote server, when all you need is .get(1)
15:11phil_vHey all. Has anyone played around with the latest version of clojurefx? I can't figure out how to actually get anything to display.
15:17rhg135I need to check that out
15:18rhg135FRP will soon rule the programmer world
15:18phil_v:)
15:23jeremyheilerrhg135: sure... but just like you can't assume that, you cannot assume it isn't, either
15:24rhg135Better safe than sorry :-P but in that case you'd be explicit so nbd
15:26jeremyheilerrhg135:
15:26jeremyheileroops
15:26jeremyheileryour point is valid, if you knew the operations were safe and idempotent, then go for it
15:27jeremyheilerbut we don't know :-)
15:27jeremyheilerbecause the person who asked the question didn't specify
15:27rhg135I just never trust 3rd party java code
15:28jeremyheilerit could be legacy 1st party code
15:29jeremyheileror it could be java sdk code that states that it's idempontent
15:29jeremyheilerhttps://github.com/jeremyheiler/xenopath/blob/master/src/xenopath/dom.clj#L24
15:44rhg135I guess I just assumed
15:52muhukwhy is ring.util.request/body-string defined over ISeq & File while the spec says request body is an InputStream?
15:54justin_smithmuhuk: I'd guess for mocking
15:54justin_smithI mean, it's also defined for InputStream, as one would expect
16:20muhukAleph aware Transit middleware: https://github.com/muhuk/ring-transit-middleware
16:40abhir00pHi what would be some good libraries written in Clojure to start contributing?
16:40abhir00pI am looking for something beginner to intermediate
16:40justin_smithabhir00p: leiningen is very open to contributions, and keeps a list of newbie-friendly issues to fix on github
16:42rhg135but no releases
16:48abhir00pThanks justin
16:48abhir00pAny other suggestions
16:49abhir00pI would like to take a look at atleast a couple of libraries
17:32luckveryI have a javascript to clojure question if anyone wouldn't mind a dm
19:57raspasovhey everyone - what's the state of affairs about Clojure tree-shaking, I recall Rich Hickey or someone else tweeting that some progress has been done but can't find the old link
20:19justin_smithraspasov: there's an option for lazy loading of libs, but you pay a runtime penalty because there's the extra step of checking if things are loaded before using them
20:19justin_smiththat's not quite the same as tree-shaking though
20:38Jabberzso I noticed there's a bunch of schedulers (Quartzite, Chime, cronj, etc) -- any comparisons done out there, or recommendation for lightweight / memory optimal?
20:39Jabberzchime appears to be like 3 functions on top of core.async, so I presume is one of the lightest weight out there of them all
20:39justin_smithJabberz: the most lightweight is definitely to use the native java scheduler class
20:39justin_smithJabberz: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ScheduledExecutorService.html
20:50raspasovjustin_smith: thanks! I assume this will help for decreasing RAM usage but not for decreasing the JAR size?
20:50raspasovuberjar, I mean
20:51justin_smithright
20:51justin_smithand it helps startup time
20:57raspasovjustin_smith: what is that feature called, can't easily find info about it?
21:00justin_smithraspasov: hmm... maybe that branch isn't so active... https://github.com/clojure/clojure/compare/fastload
21:00raspasovjustin_smith: ok thanks anyway!
21:01justin_smithraspasov: there are also alternate compilers, like skummet
21:04TEttingerskummet!
21:07raspasovjustin_smith: thanks Skummet looks cool
21:14bashedInstead of a list of strings, I want to use '(list of strings) in quoted form. Is there something that takes that and converts it to a list of strings?
21:14bashedJust so I don't have to use the double quotation for each element in the list.
21:15Seyleriusbashed: Write your whole list as a single string, and split on linebreaks, maybe?
21:15SeyleriusBut that's a lot of lazy.
21:16SeyleriusWhy don't you want to individually quote your strings?
21:17justin_smith,(map name '(you mean like this?))
21:17clojurebot("you" "mean" "like" "this?")
21:17justin_smithbecause that isn't a list of strings, it's a list of symbols
21:19bashedjustin_smith: Thats exactly what I wanted. Sorry for the wrong terminologies. I'm pretty new to lisp and clojure.
21:19bashedThanks
21:30weathered-treejava interop question: I'm trying to use java.nio.file.Paths/get with a string. There is an overload which takes a URI. When attempting to compile it tries to cast the string to a URI throwing a ClassCastException. Am I calling this incorrectly?
21:30justin_smithweathered-tree: the method that takes string takes varargs strings
21:31justin_smithso you need to call (Paths/get "a" (into-array ["b" "c" "d"]))
21:31justin_smithor (Paths/get "a" (into-array String []))
21:33weathered-treethanks!
21:33weathered-tree(inc justin_smith)
21:35rhg135he's not coming back it seems
21:35rhg135lazybot I mean
21:35justin_smithrhg135: there were talks, I may be the no botkeeper? who knows
21:35justin_smiths/no/new
21:36rhg135ah, I see
21:36rhg135get to work! :P
21:37justin_smithif/when there's a transfer of ownership, I'll be sure to get it running, it's on a host shared by Raynes and amalloy right now though
21:38rhg135why did it go down anyway?
21:38justin_smithrhg135: it's got this bug where it gets disconnected but is not aware it is disconnected, so requires a restart
21:40rhg135ah, would it be worth to excise irclj?
21:40justin_smithrhg135: what would the replacement be?
21:41rhg135pircbot is what clojurebot uses no?
21:42justin_smithis it?
21:42rhg135maybe, for sure it is not irclj
21:43justin_smiththeoretically lazybot could use pircbot, I'd need to take a closer look to see how extensive a rewrite it would be
21:43rhg135pretty extensive
21:44rhg135the plugins rely on it
21:44justin_smithright, it wouldn't be a drop in replace, it would be pulling out irclj, then making an irclj compatible wrapper for pircbot
21:44rhg135yup
21:44justin_smitha full rewrite to be pircbot compatible would be a waste of time
21:45rhg135pircbot-shim
21:46rhg135pircbot-irclj-shim*
21:46justin_smithexactly
21:47rhg135when I did my datomic experiment, unfortunately a shim was not an option
22:50naeluhyo!
22:51naeluh_SATuredayhello ? Hows it going
22:51rhg135hello, naeluh_SATureday, quite well.
23:19naeluh_satyo
23:51mkrHey, I am trying to create a web application with async FB login.
23:51mkrFacebook says that i have to include a lot of Javascript components provided in its pages
23:51mkrIs there a equivalent cljs wrapper?
23:52mkranyone has a good wrapper that wraps FB SDK?
23:56justin_smithmkr: you can probably embed those components via interop, right?