#clojure logs

2013-08-29

00:00xeqiddellacosta: ah, I let emacs + austin/piggieback handle that for me
00:00ddellacostathe solution presented on clojurescript.test's github page is quite vague in terms of how it suggests tests get loaded into the repl.
00:01ddellacostaxeqi: see, that's what I was looking for. How does that work?
00:01ddellacostaxeqi: that is, you write a test in emacs, and it gets written to a file, compiled, and sent to the browser repl…?
00:01xeqipiggieback is a nrepl middleware that you can make take over the clj repl and turn into a cljs repl.
00:02xeqithen C-c C-k will send the buffer to the repl
00:02ddellacostaxeqi: yes, I've already got piggieback loaded, and running
00:03ddellacostaxeqi: hmm…interesting, so there is no file compilation step, it gets loaded directly from emacs, huh? interesting.
00:03xeqiso you can write a test in a file, C-c C-k, and then (t/test-ns 'some-namespace)
00:03xeqipiggieback handles the compilation
00:04xeqisame way it translates things entered in the repl
00:04ddellacostaxeqi: okay. That is the bit I'm missing--so, what do you need in emacs to get this all hooked up? I've been avoiding using emacs w/nrepl for a while, for no good reason
00:04callenddellacosta: "I've been avoiding using emacs" - I don't think we can be friends.
00:04xeqiI think any nrepl frontend would work.. do you already use one of emacs,vim,or ccw?
00:05ddellacostacallen: you read into it incorrectly: I've been avoiding using nrepl with emacs, emphasis on nrepl. I'll stop using emacs when you rip it from my cold, dead hands
00:05ddellacostaxeqi: yah, see above, heh
00:06xeqiM-x package-install nrepl-mode
00:06xeqiC-x C-f some/path/to/file/in/lein/project
00:06xeqiC-c C-j
00:07xeqito start an nrepl server for that project. piggieback setup is a bit more work, but basically is copy paste from its readme
00:07ddellacostaxeqi: okay, this is awesome, should be more than enough to get me going. Thank you so much, this is *exactly* what I wanted to know!
00:09xeqiddellacosta: ack, C-c M-j to start nrepl
00:10ddellacostaah, that's why that didn't work...
00:10xeqiddellacosta: at which point https://github.com/clojure-emacs/nrepl.el#clojure-buffer-commands might be useful
00:10ddellacostaxeqi: the one thing I wish I could do is send it to a repl I have already open, *not* (standard cmdline lein repl) in emacs…is that crazy/unpossible?
00:11gdevemacs live for the win
00:11xeqinote that somethings don't work in a cljs-repl, like tab completion, M-.
00:11xeqiddellacosta: M-x nrepl will let you specify an already running nrepl instance, though I've only done that with `lein repl :headless`
00:11ddellacostaxeqi: yah, I've used a cljs-repl a fair amount, I'm familiar with that part of it
00:11gdevduring boring meetings M-x zone...dance for me emacs
00:12ddellacostaxeqi: gotcha, thanks--excellent
00:16xeqiddellacosta: feel free to ask if you run into any problems
00:16ddellacostaxeqi: thanks, much appreciated!
00:31futileIf anyone needs a good smile right now, look no further: http://www.reddit.com/r/PHP/comments/1l7baq/creating_a_user_from_the_web_problem/
00:36tbaldridgefutile: obligatory response : http://xkcd.com/327/
00:37futile:)
00:38muhooi vaguely remember there being a function to swap keys and vals in a map, but i can't for the life of me remember what it was
00:38muhooprobably something in clojure.set i'd guess
00:39xeqi,(doc clojure.set/map-invert)
00:39clojurebotI don't understand.
00:39muhooah, thanks
00:39futileWhy is that in clojure.set?
00:59dissipatecan someone explain what exactly replaces object oriented design in clojure? is it really just immutable data being passed through pure functions and that's it?
01:00brehautreplaces what aspect of OO
01:00callenso. who's interested in discussing my problem with making an idempotent alter-var-root? :P
01:01gdevcallen, I am for a little bit
01:01brehautdissipate: data modelling? just use maps etc. polymorphism? first class and higher order functions, multimethods, protocols all do kinds of polymorphism, identity? reference types. etc etc
01:02dissipatebrehaut, replaces objects
01:02callengdev: I have to wrap the inner behavior (AOP style) of functions in c.j.j and potentially also Korma. It's for a SQL logging library.
01:02callengdev: I'm ripping into the args passed to said functions and logging the queries, then timing the function I wrapped.
01:02brehautdissipate: objects are _everything_ in an object orient system. the have many responsibilites. particular facilities of objects responsiblities are handled via different mechanisms in clojure
01:03callengdev: I could ask users to obey a contract of, "don't run the same wrapper fn more than once!", but I'd rather it "just work" and be idempotent (otherwise it'll just keep adding duplicate log lines)
01:03brehautdissipate: if you mean things to hold pieces of data, then use data structures
01:03noididissipate, in Clojure the API design mostly focuses on the data, not the operations
01:03dissipatebrehaut, so why does common lisp have an object system? CLOS
01:03jlongsterso how does core.async handle errors? are you supposed to manually check for error objects? (@dnolen if you're around)
01:04noididissipate, you might find this helpful http://www.infoq.com/presentations/Thinking-in-Data
01:04brehautdissipate: because common lisp decided to have an object system. however im pretty sure this is #clojure
01:04callengdev: my initial thought was metadata but this is problematic for several reasons specific to how alter-var-root works.
01:04callengdev: help me obi-wan-kenobi, you're my only hope.
01:04brehautdissipate: and fwiw, CLOS doesnt resemble anything much like you'd find in most 'OO' languages
01:04dissipatenoidi, thanks
01:05gdevcallen, this is not the clojurian you are looking for 0_o
01:05dissipatebrehaut, that's probably just because it hasn't been ported yet
01:05callengdev: why not? :(
01:05dilzio@noidi gr8 link...thx
01:05brehautdissipate: or, because it doesn't fit with clojures philosphy
01:05xeqicallen: I believe robert.hooke has a way to be idempotent for named hooks, might be worth checking out
01:06brehautis cheshire still the preferred clojure json lib?
01:06dissipatebrehaut, BTW, i'm no fan of OOP, just curious how clojure gets things done without objects.
01:06noididissipate, is there a particular problem you think object orientation solves for which you can't find a solution in clojure?
01:06callenxeqi: whoa. I need to see this. Thanks.
01:06callenxeqi: I actually know of the library, but forgot it existed.
01:06gdevcallen, see? told you
01:06brehautdissipate: you still havent specified which features of objects you want to know about.
01:06callenI need a bot that reminds me of various technomancy, ztellman etc libraries at intervals.
01:07callenbrehaut: yes.
01:07brehautcallen: thanks
01:07dissipatenoidi, no. i've just been 'forced' to do OOP in industry, and that's what i'm used to thinking about things in
01:07noidiaccording to some definitions of OO, Clojure does support it: http://wcook.blogspot.fi/2012/07/proposal-for-simplified-modern.html
01:08noidiit doesn't have classes, but it does have type-based polymorphism in the form of protocols
01:08dissipatebrehaut, bundling state and data with methods
01:08callenyeah...this is good...
01:08brehautdissipate ok then. the answer is dont do that
01:08brehautjust pass data through functions
01:09dissipatebrehaut, that's what i asked initially, if it's all just immutable data and pure functions
01:09dissipateseems too good to be true
01:09brehautthats the basics yes
01:10brehautbut in the same way objects arent _just_ data and methods living together
01:10brehautin particular theres late bound polymorphism typically oing in there
01:10brehautas well as the namespacing
01:10brehautand you deal with a crap ton of identitys rather than values
01:11Apage43Man I needed this talk link a week ago
01:11callenApage43: which?
01:11dissipateApage43, which one?
01:11Apage43the thinking in data one above
01:12xeqiI feel like I saw a Stuart Halloway recording from a user group where he walks through all the properties in some OOP systems and how they are done in clojure
01:12dissipateBTW, does anyone know when/where the next clojure west conference is?
01:12Apage43Working with a coworker on a checkers game. I did an implementation of the rules as functions of boards and moves.
01:12dissipatexeqi, please linky link to that
01:12xeqidissipate: trying to find it
01:12callenxeqi: WHOA. link.
01:13callenxeqi: the ravenous hordes are upon you. With the linky-ness, quickly!
01:13Apage43Then the in the data model I have to actually work with, each game piece is an object, with its own identity that has to be preserved as stuff moved around.
01:13dissipatedoes anyone have any info about the next clojure west conference?
01:14dissipateApage43, objects in clojure? the blasphemy!
01:14Apage43well my bit is in clojure
01:14Apage43the other bit is obj-c
01:14Apage43hence the disconnect
01:14brehautdissipate: well actually, clojure does support objects as a first class thing: its part of the interop model with java. however, objects as objects are only used as an implementation concern and arent something you need to know about as a beginner
01:15dissipatei think OOD sucks bad. the real world doesn't fit into nice taxonomies of inheritance. it just doesn't.
01:15Apage43(and the app itself exists largely as a showcase for a third thing written in go)
01:16brehautdissipate: to be fair, best practise in OO for 15+ years has been not to use inheritance if you can help it
01:17dissipatebrehaut, a lot of the 'objects' i run into in industry are not really objects. they are just controllers for other stuff, loosely organized data and methods to interact with something else, like the database.
01:18brehautdissipate: there is bad code everywhere in every paradigm. FP and clojure is no silver bullet
01:18noidiI don't think Clojure's notion of objects is just for interop
01:19noidiProtocols, Types and Records are much more than just interop features
01:19brehautnoidi: no its not. its also an implementation detail
01:19brehautnoidi: right. all of those are objects due to the host system making objects the natural way to implement them performantly. they are however, not intrinsically objects
01:19dissipatebrehaut, you got that right. bad code everywhere. an entire industry built on crap.
01:20dissipatesome of the crap makes money some of the time
01:22noidiobjects as "an instance of a class" are an interop feature / implementation detail. but I think objects as "a thing that implements an certain interfaces/protocols" are core to Clojure.
01:23noidi-an
01:23gdevdissipate, you've seen this? http://www.infoq.com/presentations/Clojure-Java-Interop
01:23dissipatenoidi, so a good portion of Java made it's way into Clojure?
01:24dissipateoutside of interop
01:24gdevdissipate, also this flowchart is pretty nice http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/
01:25gdevdissipate, Clojure took the good parts from a lot of languages
01:25xeqidissipate, callen: https://www.youtube.com/watch?feature=player_detailpage&v=cidchWg74Y4#t=1141 is the closest I can find atm, but I thought I had seen a longer talk of that section
01:26noididissipate, not directly, no. protocols fill the same need as Java interfaces, but they're designed to avoid their shortcomings. http://clojure.org/protocols
01:26callent=1141 isn't working for me I think. hrm.
01:26callentechnomancy: thank you for robert.hooke
01:27xeqicallen: jump to ~19m in
01:28callenxeqi: thanks.
01:29dissipategdev, not much good from java in terms of language features.
01:30gdevdissipate, yes, but it runs on the jvm, so that's enough
01:30dissipateas far as i know, java was a big step backwards. only thing going for it is the JVM.
01:31dissipategdev, how does someone write a book about java and actually praise the language? that i can't understand
01:31callenxeqi: oh man, robert.hooke really cleaned up my code. Thanks for reminding me it exists. Also this Halloway video is relevant because I will be explaining Clojure in further detail to my coworkers soon.
01:33dissipatecallen, what are your coworkers using now?
01:33gdevthere are also two videos on ClojureTV's YouTube channel about clojure data structures by Rich himself
01:33gdevalso two Clojure for Java developers videos
01:34clj_newb_2345someone needs to write a simple editor in pedestal
01:34clj_newb_2345have it process scripts server side in clojure
01:34clj_newb_2345and call it cljmacs
01:34glosolilol
01:35clj_newb_2345i was going to say climacs, but I think there's already a common lisp gui library named that
01:35xeqidissipate: it did add a memory model which still seems rare. Not sure if that should be considered a java feature or a jvm feature
01:36dissipatewhy not make clojure into something like haxe that just compiles to almost anything?
01:36clj_newb_2345why can't everyoe just support the jvm
01:37xeqidissipate: there are several forks, https://github.com/halgari/clojure-py, https://github.com/takeoutweight/clojure-scheme (which can then go to c), clojurescript
01:38dissipatexeqi, right, but those are separate projects. i just want 1 command line executable that will turn my clojure code into almost any language.
01:38glosoliclj_newb_2345: that would be boring ;/
01:39gdevdon't forget clj-tran clojure to fortran compiler
01:40clj_newb_2345i'm not happy
01:40clj_newb_2345until there is a clojure to scala compiler
01:41gdevi just throwed up in my mouth
01:41clj_newb_2345what would you rather do, be forced to switch from emacs to vim, or from clojure to scala?
01:41callen95% of the complaining about Clojure not supporting a particular platform or compiler target is done by people that haven't pushed anything to clojars.
01:41callenI'll let the implication stand on its own.
01:42dissipatecallen, clojars?
01:42callen(cemerick is the other 5%. Singlehandedly)
01:43dissipatecallen, what does clojars have to do with compiler targets? seems to be a general repository
01:44clj_newb_2345the point is
01:44clj_newb_2345those people don't contribute
01:44cemerickcallen: I don't recall ever complaining about compilation targets?
01:44gdevI am the 95% ;0
01:44clj_newb_2345anything to clojrue besides arguments on irc
01:44callencemerick: it was an oblique tease about CLR.
01:44dissipatecallen, are you in a java shop?
01:45cemerickcallen: very, I don't grok
01:45gdevcemerick, ignore the peanut gallery =)
01:45callencemerick: I wouldn't take it personally, it was intended playfully. I was referencing you mourning the quasi-death of Clojure CLR.
01:45callendissipate: writing code, bug me later.
01:46cemerickcallen: I barely took it at all :-)
01:46cemerickgdev: indeed, back to bed for me
01:46clj_newb_2345I have a simple question.
01:46dissipatehehe, sounds like someone is in a java shop.
01:46clj_newb_2345Would you say clojure makes you 10x more produce than java ?
01:46dissipateclj_newb_2345, many languages will make you 10x more productive than java
01:47gdevnot only 10 times more but also fresher produce
01:47dissipatejava is a terribly verbose language
01:47clj_newb_2345http://jemacs.sourceforge.net/ <-- why is there a java emacs, but noclojure emacs?
01:47gdevclj_newb_2345, deuce
01:47dissipatejava is all about classes. it's verbose class hell. don't even get me started on generics.
01:47gdevhttps://github.com/hraberg/deuce
01:48seangrov`10x is pretty big though
01:48callenclj_newb_2345: pop culture is people talking about other people but never creating anything themselves.
01:48callenclj_newb_2345: resist the urge and just go make something.
01:48xeqijlongster: core.async is agnostic about errors. It will properly handle try/catch blocks, but then you have to decide what to do (such as sending the error to a error reporting go block and then recuring in a go/loop)
01:50gdevcallen, I've been trying to create something all night, IRC is where I end up with more questions than answers
01:50dissipateseangrov`, 10x sounds plausible to me
01:50callengdev: I'm having a good night, hammered out like 2 or 3 iterations of my library, trying to finish the home-stretch for Korma support.
01:50callenif I finish korma support, I'm fucking #shipping and celebrating with a trip to the pub.
01:50jlongsterxeqi: yeah, that's what I've noticed. Go seems to encourage having a separate error channel, but still playing around with that
01:51callenjlongster: to be fair, that's because Golang is derpy and only has one hammer.
01:51callenjlongster: no exceptions, no nuttin' save for err binding from function return and channels.
01:51callenI remember reading a statistic that 30-40% of Golang code was part of err handling.
01:52jlongstercallen: I've heard that. But suddenly there's an outpouring of admiration for it :)
01:52callenjlongster: that's because people were dying for a static, compiled language that was reasonably practical for writing a web app in.
01:52clj_newb_2345http://pedestal.io/documentation/service-context-reference/ <-- is this using core.async ?
01:52callenjlongster: the alternatives up to that point were...what? C++? Haskell?
01:53jlongsterTypeScript!
01:53callenI said static, compiled.
01:53clj_newb_2345Coq
01:53clj_newb_2345Coq
01:53gdevcallen did you fix your issue with impotent alter-var-root?
01:53xeqiclj_newb_2345: pedestal predates core.async, but there is a branch using it. Supposedly is simplified the server side significantly
01:53callengdev: was that intentional? because I'm beet red from laughing now.
01:54gdevcallen, yes ;0
01:54xeqiclj_newb_2345: https://github.com/pedestal/pedestal/tree/with-core-async
01:57callengdev: but yes, xeqi's suggestion to use robert-hooke solved my problem precisely.
01:57callenrobert-hooke is like micro-AOP. It's awesome.
01:57callenI...am kinda sad technomancy didn't mention it when I was bitching about this earlier or yesterday.
01:58gdevis it possible to write so many libraries you forget you've written one for a problem someone is having?
01:59xeqigdev: with how quick technomancy will remember random webcomic / references / video links?
01:59callenxeqi: yeah I'm not buying it either.
01:59gdevthe brain is funny like that
01:59callenand I'm pretty sure robert.hooke he was proud of.
02:00gdevI can remember obscure 80s references, but my wife's birthday or my kids ages? not so much
02:00callengdev: priorities. you have them.
02:00callenNothing wrong with that.
02:01gdevstill, don't assign malice where there is only forgetfulness
02:01gdevor something like that
02:01dissipatedata oriented programming? hmm
02:03gdevyes, POJOs were a good idea, take it even further with PODS
02:04gdevcallen, is your stuff on the hub of git?
02:04callengdev: yurs.
02:06callengdev: bitemyapp
02:08gdevgreat, now I have that Doobie Brothers song stuck in my head 0_o
02:09callengdev: bwahahaha. it's actually named after a thing to do with lumberjacks. "logging"
02:11gdevblackwater ben?
02:11callengdev: yeah
02:15callenokay so the query is clearly working. what the fuck gives.
02:15gdevcallen,
02:16gdevi'll try it out on my Granny's Addressbook app tomorrow
02:17callengdev: ...errr....blackwater?
02:17callengdev: what database library are you using?
02:17gdevcallen, yes, korma
02:17callenI haven't gotten Korma working yet, only c.j.j works atm.
02:17gdevfix ur sh*t plx
02:17callenmy uni-func-integration tests should confirm as much.
02:18callengdev: I'm not any happier about it than you are, I'm a fucking Korma user.
02:18callenI told you I'd #ship if I got Korma working.
02:18gdevi just #shipped my pants
02:18callenthere's no documentation yet either. which I'll probably write drunk.
02:19gdevuse marginalia
02:20callenthere are no doc strings either.
02:20callenyou...don't seem to be familiar with what sort of establishment this is sir.
02:21callenThis here is a bawdy house run by a nihilist. We serve single-malt scotch and syphilis, not documentation.
02:23gdevnihilist? eff me. i mean, say what you like about the tenets of National Socialism, Dude, at least it's an ethos
02:25fkeyHey there, I am getting a "to much recursion" error message for clojurescript. here is a test case (def myMap { :foo (fn []) :bar (fn [] ((myMap :foo))) }) ((myMap :bar))
02:25callenyisssssssss
02:25callenVICTOLY
02:26callengdev: basic Korma select queries are working now. expanding test-cases now.
02:27fkey(myMap :bar) returns "return myMap.call(null,"\uFDD0'foo").call(null);" ..this seems a bit odd
02:27fkeyi am usign clojurescript.net, not sure if this page is using the most recent clojurescript build
02:28seangrov`fkey: Does look weird
02:29seangrov`Sadly, I'm off to bed, can't look at it now
02:29fkeyseangrov: tanks, i'm going to pick and it for a few more minutes, about to do the same
02:30fkey*thanks
02:31gdevcallen, cool, I forked it in case I'm feeling froggy tomorrow
02:32gdevI can at least add doc strings?
02:32callengdev: you can do anything you want, but wait for me to do this latest push.
02:33callengdev: I'd be grateful just to get a user, let alone a PR.
02:34callenoh man, I am just knocking out the test cases now :)
02:37gdevsweet, I'm going to bed before I turn into a pumpkin. I can't keep up with you guys on that pacific time zone
02:37callengdev: cheers. Ping me tomorrow. :)
02:38gdevcallen will do
02:47callenBoom. Time to hit the pub. https://clojars.org/blackwater
02:53seangrov`nice callen, enjoy your drinks
02:53callenseangrov`: actually just shipped another version with custom colors and better docs. *now* I'm getting drinks.
02:56ddellacostacallen : jealous! Enjoy.
03:05notsonerdysunnyis core.async going to just launch a new thread for every new go-block? I tried to find this on the web but couldn't find enough information. Is it also going to switch to running a different go-block when one of them blocks on some socket-io ?
03:12noncomnotsonerdysunny: idk, but why not look in the sources?
03:21callenddellacosta: hullo from the pub. why jealous?
03:22so-rudeسمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ
03:22ddellacostacallen: 'cause I'd rather be having a drink. ;-)
03:22noncomso-rude: there appears to be a problem with encoding, i cant read your text
03:22ddellacostacallen: although, I'm close to completing something so that is satisfying.
03:23callenddellacosta: oh you probably indulge more an' i do :) - what are you completing?
03:23noncomddellacosta: callen: you drink alcohol?
03:23ddellacostacallen: I suspect I do…heh. noncom: I definitely do.
03:23callenso-rude: text worked for me
03:24callenddellacosta: what are you completing?
03:25callennoncom: pretty sure it is not unusual to drink.
03:25ddellacostacallen: oh, sorry, didn't answer your question. I've been working on a rbac/dac system along with some basic front-end features, and I'm putting some finishing touches (on the first draft, which I'm sure will need some tweaks).
03:25noncomyeah, sure, just interesting..
03:27ddellacostacallen: …it's a web app, I didn't say that.
03:27ddellacostacallen: so, building out authorization features, basically.
03:27callenddellacosta: interesting. built on top of friend or custom? did you see bulwark?
03:29ddellacostacallen: yeah, I've checked out bulwark, but unfortunately it is orthogonal to our needs now. What we have is basically a wrapper around the authorization functionality of Apache Shiro (http://shiro.apache.org). We have a custom solution in our system for authentication, and we pass authorization off to a Shiro wrapper (with what I've built).
03:30calleni know it is orthogonal - just figured i would ask. that sounds interesting. will it be OSS?
03:30ddellacostacallen: although, bulwark could come in handy at some point. Our authorization policies are still pretty rough.
03:30noididdellacosta, is the wrapper open source?
03:30ddellacostanoidi: not at this stage, not sure if/when we'll break it out, but I'll definitely post something if so.
03:31ddellacostacallen: yeah, what I said to noidi re: OSS
03:31callenddellacosta: fair warning - the main problem bulwark is intended to solve is throttling, blacklist and whitelist were just easy wins.
03:31ddellacostaI dunno, I'd like to, but it's just one sub-section of Shiro, which truly encompasses a lot of functionality.
03:32ddellacostacallen: gotcha, I'll keep it in mind. This is an area that clojure needs some more comprehensive solutions. And I think Shiro solves a lot of problems that aren't covered in anything I've seen yet, certainly not Friend
03:32callenddellacosta: so ping me if you start eyeballing bulwark. more intended for securing public apis.
03:33ddellacostacallen: most definitely, I will!
03:45paomianclojure.lang.Var$Unbound cannot be cast to clojure.lang.Atom
03:46paomianwhy i get it when i ues sessiom/put! in lib-noir
03:48paomianhello?
03:48clojurebotBUENOS DING DONG DIDDLY DIOS, fRaUline paomian
03:49callenlol
03:49ordnungswidrig*g*
03:50paomianwhat?
03:50clojurebotwhat is http://gist.github.com/306174
03:51paomianwho can tell me how to fix it
03:53paomian0.0
03:53noidipaomian, your missing a (binding [*some-var* some-value] ...) around your code
03:54noidi*you're
03:55paomiannoidi: I think it is right,but the lib-noir have a api is put!,when I use it .it will be wrong
03:56noidi`Var$Unbound` means that you have a var (probably created with `(def ^:dynamic *some-var*)`) without an associated value
03:57callenthat session stuff needs to be made async safe.
03:58noidipaomian, you need to provide a http://sscce.org/ if you want a better answer.
03:58paomiannoidi: yes .i read source at github,it https://github.com/noir-clojure/lib-noir/blob/master/src/noir/session.clj#L12
03:59paomiannoidi: but i did not what should i do can fix it
04:00noidiI don't know Noir, but it seems that you need to wrap your Ring handler with wrap-noir-session
04:00noidibecause that's what establishes the binding for *noir-session*
04:02paomiannoidi: the source of 4clojure it used at this line https://github.com/4clojure/4clojure/blob/develop/src/foreclojure/core.clj#L58
04:03paomiannoidi: thank you! i will try it:-S
04:08fredyrbtw what is that gist that clojurebot posted?
04:18callennoidi: it's not Noir, Noir is deprecated. It's lib-noir.
04:18callennoidi: the nomenclature is important, we abandoned the framework intentionally.
04:18callenI even went to the trouble of stalking ibdknox until he finally put the deprecation notice on Noir's website.
04:20callenthat having been said, while lib-noir is definitely better designed and works as a proper library, it's not async/http-kit safe yet.
04:20callenthe sessions stuff relies on thread-local global mutable state and it's quite gnarly.
04:20callenI figured out a solution in neubite but it requires obeying a contract.
04:22noidicallen, OK. Well, I don't know lib-noir either :)
04:23callenSure, I'm just trying to make certain people understand Noir is dead, long live lib-noir.
04:23callenbecause too many trip over the old website.
04:23paomiancallen:but how to fix it ?
04:24callenpaomian: dude already told you.
04:24callenucb: hai hai. I just shipped a new library!
04:24ucbohai! awesome! which one?
04:24callenhttps://github.com/bitemyapp/blackwater/ I'm about to add a pretty-pretty screenshot.
04:25paomiancallen: what is dude?
04:25ucbcallen: you'll be delighted to hear that after the hiatus and much deliberation, I've decided to go the postgis route for clojunauts
04:25callenucb: very cool. I've done GIS stuff with MongoDB and ElasticSearch in the past.
04:25ucbcallen: this is right up my alley. I've been meaning to ask you about a recommendation for SQL libs, but I see your thing already mentions korma
04:26ucbcallen: I want minimal hassle really
04:26callenpaomian: dude is a colloquialism. Uhm, it's just a casual way of referring to somebody.
04:26callenucb: I'm pretty happy with Korma. c.j.j is in a really weird state.
04:26callenc.j.j has this quasi higher level DSL, but it's incomplete, can't even do 'limit', but is still "lower level" than Korma, and is worse designed than Korma
04:26ucbcallen: how about clojureql? oh, and while we're on the subject, do you do migrations at all? I've looked at ragtime and others (including lobos) but I'm not sure.
04:26callenbut has a lower level substrate layer than allows arbitrary queries.
04:27callenI prefer Korma + the occasional raw query.
04:27callenucb: I recommend migratus for migrations, generally.
04:28paomiancallen: I can not understand clearly
04:29ucbcallen: yeah, looked at it. What initially drove me away (same for ragtime) was SQL files, but I've come to terms with that and I think I'll have to go down that route anyway.
04:29ucbpaomian: 'dude' as well as 'man' is just a generic word to refer to a person. It can sometimes even be used instead of 'hey', e.g. 'dude, pass the salt' vs. 'hey, pass the salt'
04:31callencooool. we has screenshots now.
04:31callenucb: https://github.com/bitemyapp/blackwater/
04:31callennifty eh? :)
04:31callenthis was also a good exploration of AOP-esque style in Clojure. I came away from the experience reasonably satisfied.
04:32ucbnice!
04:32callenbut yeah, I was already a primarily Korma user, but after being elbow-deep in Korma and c.j.j both for the last couple days, my opinions are closer to dearly held beliefs now :P
04:32ucboh, remember my pickle thing?
04:32callenucb: yeah, what of it?
04:33ucbwell, there's pyrolite which has a near complete implementation of the protocol
04:33clgvany datomic experienced developers around? Is it possible to store double arrays efficiently in datomic? i.e. does :db.type/doubles exist?
04:33ucb(pyrolite is a java thing, but w/e)
04:33ucbso I'll probably rewrite my one to be a wrapper around it
04:34ucbso here's the question: I've spoken to the guy who develops pyrolite about getting his jars into sonatype or somewhere and he was all "nah, too much effort". Would it be rude for me to build a jar and put it in clojars?
04:34callenclgv: efficiently?
04:34callenucb: no, just do it.
04:34callenucb: happens *all* the time in the Clojure community.
04:34ucbyeah, thought so.
04:34callena version bump sometimes comes with the fork + deploy.
04:35callenwith a note that you forked to get it live.
04:35clgvcallen: I mean building a table/entities from array id and array position to value would not be efficient
04:35ucbgood idea
04:35callen"nah too much effort" - lol flake.
04:35callenlein deploy is hard :((((( ;_;
04:35clgvucb: you can use a private group for it
04:35callenclgv: vectorize it?
04:35ucbcallen: https://github.com/irmen/Pyrolite/issues/3
04:35Ember-btw, we found this yesterday with Christophe Grand https://www.refheap.com/18137
04:35ucblein deply is hard?
04:35ucbdeploy
04:36callenucb: I...don't need more enemies on github.
04:36ucbI've had some issues in the past, but they're mostly gone
04:36ucbheh
04:36callenbut you're followed now. so. there's that.
04:36callenI'M WATCHING YOU
04:36ucblein search otoh is botched for me :/
04:36ucbwat. /D:\
04:36callenucb: (it's 0113 here and I just got back from the pub)
04:36ucbI trust you had a healthy dose of real ales
04:36Ember-cgrand made a fix for that already, hope it'll end up in the next version of Clojure
04:37callenucb: guinness and glenfiddich.
04:37ucb-1 on former, +1 on latter
04:37clgvcallen: I am just starting out with datomic. just completed the tutorial yesterday. if I vectorize the array it would be a "many" relation which has probably a lot of overhead, right?
04:37ucb-1 only because stouts are not my thing
04:37callenucb: it's an irish republican pub. you win some, you lose some.
04:37ucbheh
04:37callenucb: guinness is an uncommon good stout though.
04:37ucbcallen: it's drinkable
04:37callenclgv: don't make it a relation?
04:38ucboh, bbc news shows the scan of a brain with a penis delineated on it
04:38ucbhave they found the penis area already?
04:38fuzi'm going to the home of guiness sunday
04:38callenucb: this pub is known for having fresh and creamy guinness for some reason. the rumors weren't lying.
04:38callenucb: I'm otherwise ambivalent to guinness in a retail context.
04:38callenfuz: proper.
04:38ucbcallen: did you get the shamrock done on the neck?
04:38callennaw.
04:38ucbgood.
04:39callenclgv: store them opaquely as native value types, scalars pointing to the coll vector of doubles.
04:39callenclgv: there isn't a particular well documented shake-n-bake recipe for this, but it's doable.
04:40clgvcallen: oh right clojure values should work
04:40callenclgv: also I'm semi-tipsy, so you're not going to get much that is helpful further out of me. #datomic is likely asleep since the bastids are all in my timezone.
04:40callenso...you're stuck with me.
04:40clgvcallen: maybe arrays do as well. I thought I had to specify the type for it
04:41callenclgv: I'm a strong proponent of experimentation.
04:41callenknow what should happen, have expectations, but just try stuff too.
04:41callenor not. you know. whatever.
04:41clgvcallen: well I like to read first and then experiment to avoid unneccessary spent time ;)
04:43callenclgv: by all means. sadly with datomic the option of reading the source isn't available, so experimentation becomes a more valid-than-usual tactic.
04:43clgvcallen: yeah. it would be easy to spot if the documentation was just out of sync if I could look up the type keywords in source
04:43ucbso how do you like this? customer says "lol cluster is too slow. We compared the performance of your commodity cluster with our 7M USD Oracle cluster and it came up worse. Plsfix kthxbai"
04:44callenucb: "plz 2 send cluster benchmark test harness code"
04:44callenucb: "plz 2 fuck yourself, kthxbai"
04:44ucbit's not even that
04:44ucbit's the fact that they're comparing 2 different beasts
04:45callenucb: is the benchmark even remotely likely to be credible even ignoring the "two different beasts" part?
04:45ucbthese guys are so incompetent it's not even funny any more
04:45ucbcallen: meh. It's generic tsung load. So it could well be.
04:46ucbit's the whole "I ran a test on my newest laptop and it outperformed your run on your PC XT. WHAT!" thing that rubs me the wrong way
04:46ucband it's not even testing the same software, it's testing different software as well (couchdb vs. oracle)
04:46callenucb: what manner of cluster is this? full-stack hive-mind shit, application layer, persistence layer, or something else?
04:46ucbjust DB layer
04:46ucbno app, no nothing
04:47ucbit's about the sustained load in terms of concurrent connections, throughput of operations, etc.
04:47callenoh right, just remembered your employer.
04:47callenherp de derp
04:47ucbbut again, it's testing 2 different pieces of software on 2 different (very) hardware specs
04:47callenwell you can't directly compare "transactions per second" between Oracle and your product anyway, yes
04:48calleneven given roughly comparable hardware and workloads.
04:48ucbthanks for confirming my sanity
04:48callenif their true, representative workload is simple enough to be 100% transferable between such disparate systems, then they aren't solving real problems I'm sorry to say.
04:48callenin which case, anything will do.
04:49ucbheh
04:49callenincluding flushing loglines to an NFS share in cambodia.
04:49callengg, go home happy guys.
04:49ucbthe relationship's been tainted already for so long that anything they say, even if it's reasonable, will come across as a big wth
04:49ucbenjoy
04:50callenI'm on a 19 day github streak and I moved between two different cities in that intervening time.
04:51callen#FeelsGoodMan
04:51clgvbtw. is there any higher level layer (library) for datomic, yet?
04:51callenclgv: tons.
04:51callenclgv: writing your own higher-level datomic client is a rite of passage at this point.
04:52clgvcallen: so nothing established so far?
04:52callenclgv: there hasn't been a winner that ate all the other puppies in the nursery yet, no.
04:53callenclgv: buuuut datomico is close.
04:53paomiannoidi: yes it work!!!Thank you
04:53clgvcallen: thx for that hint
04:53callenclgv: I'm in an ornery mood, you're lucky you got anything remotely useful out of me.
04:54clgvcallen: sending you a glass of glenn fiddich over the wire wont work I guess ;)
04:55callenclgv: I have a 10 am meeting tomorrow (today) :(
04:56clgvcallen: what time is it now in your zone?
04:56callen0133
04:56clgvso 7hours of sleep in case you start soon ^^
04:57ucb10am meeting? slacker. That's already late.
04:58callenucb: I work for a startup that doesn't really care about the minutiae of my day-to-day hours.
04:58ucbme too :)
04:58callenthat a coworker very inconsiderately requested to speak with me at 10 am is...not a regular thing, but a not entirely happy event when it happens.
04:58ucbI just get up REALLY early because of the tiny human inhabiting my household
04:58callenucb: baby?!
04:58ucbyup
04:59callenucb: I have a coworker that constantly talks about her toddler, thus reminding me how very much I don't want kids right now.
04:59ucb"right now" is key
04:59ucbi.e. I am of the position that EVERYONE wants kids (sooner or later).
05:00ucbextrapolation ftw
05:02fredyroh those were the days
05:02fredyr:)
05:03fredyrnow im reminded of being an oldie
05:04fredyr:o
05:04ucbjoin the club
05:04noncomucb: +1 for kids, i got one recently
05:04ucbnoncom: congrats!
05:04fredyr+1 on the congrats
05:05noncomthanks, you too, guys! :)
05:11ucb:)
05:14clgvhuh clojars search result page displays wrong versions as the recent version
05:15clgve.g. for datomico it shows 0.1.0 but when you click the details it shows the correct 0.2.0
05:21noncomclgv: can it be because the creators did not push the last version to clojars?
05:22clgvnoncom: no it is a bug as described above. clojars reports two different versions as most recent on the search result page and the project detail page
05:23noncomoh
05:23clgvissue filed ^^
05:42ucbclgv: did you search on clojar's website or via lein?
05:43clgvucb: I am talking about the clojars.org website only
05:43ucbclgv: ok
05:43clgvusb: try the above search for "datomico"
05:50ro_stis it possible to add metadata to defmethods?
05:51Anderkent]awayro_st: not that easily, and it wouldn't be easy to access.
05:51ucbclgv: 0.1.0 comes up
05:51ro_stok. thanks
05:59ro_sthow do i deal with a multi-method not having a valid dispatch function? is there a way to ignore these?
05:59ro_sti guess :default with a no-op defmethod
06:02ro_stthat seems to do the trick
06:26learner_Hello All, a newbie question here. I am going through set of IRC logs looking for a word, I have written the script. But I don't think it's idiomatic. Could you please take a look and suggest me how I can improve it. The actual code is here @ https://www.refheap.com/2b7cca31b3912c85c7e650641 Thanks for your time
06:30Anderkentlearner_: two space indent is the usual - your code will look much better with it already. Tabs are evil :)
06:30hyPiRion-> or ->> may help with readability here
06:31Anderkentyes, but in general I'd recommend pulling out some functionality into fns
06:31sverihi there, i am currently trying clojure just out of curiosity, i grabbed lumines with the korma plugin and added a table with a text column, now when i retrieve the entries from that table and display them with entry.content is the output: clob1: 'some content', how can i access the text in that content
06:33learner_Anderkent: True, I will consider this. thanks
06:34learner_hyPiRion: Yes, with lot of maps and stuff, it's looking bit confusing. May be I should use ->> . But the overall approach of using (remove nil? & applying map is alright? or is it naivy?
06:34Anderkentlearner_: you want `doall`
06:34hyPiRionlearner_: well, remove nil? will remove every element there, because println returns nil
06:36learner_Anderkent: hmm, doall in place of?
06:36Anderkentthe `remove nil?`
06:36Anderkentyou just want the entire collection to be evaluated, right?
06:38hyPiRionI would've probably done something like this: https://www.refheap.com/4bafc148ff94f6b896a1bf51c
06:38Anderkentlearner_: https://www.refheap.com/18141 is how I'd do it.
06:38Anderkentget-log-urls can still be improved
06:38hyPiRionnot sure if it works, but that's the idea at least
06:39hyPiRionthe rest is there to avoid printing the first url
06:39Anderkentoh yeah, as-> is nice, I'm still not up to date with new clojure
06:40Anderkentah, because it's ../
06:40Anderkentright
06:49learner_Anderkent: hyPiRion: Yes, (rest is there to avoid first link ("../").. Thanks for taking time and modifying the code to show the better approach. Really appreciate it.
06:54clgvdoes anyone know how a datomic schema atrribute definition for a vector of doubles has to look like?
07:42sverihi there, i am currently trying clojure just out of curiosity, i grabbed lumines with the korma plugin and added a table with a text column, now when i retrieve the entries from that table and display them with entry.content is the output: clob1: 'some content', how can i access the text in that content
07:52ordnungswidrigsveri: https://groups.google.com/d/msg/sqlkorma/SoMAteoUpug/4I7HrqmsmSAJ
07:52ordnungswidrigsveri: does this help?
07:53jowagambrosebs: I suppose core.typed works only when .clj sources are present on a classpath, not with just AOTed classes?
07:53ambrosebsjowag: yes it works with ASTs of clojure code.
07:54jowagambrosebs: and does it look and analyze dependencies automatically, e.g. parse ns declaration?
07:55ambrosebsyes it tries its best. It seems to work, but see clojure.core.typed/typed-deps for manual deps.
07:55ambrosebs0.2.0 is quite chatty about which namespaces it is checking so it will be clear if something isn't checked.
07:56ambrosebsIt uses tools.namespace to infer deps.
07:56jowagthanks, and one last thing, how much is evaled during the analysis? I see that you are doing macro expansion to at least macros are evaled when checking for types, am I right? Any other things are evaled, top level forms maybe?
07:57ambrosebsunfortunately *every form* is evaluated at the moment.
07:57ambrosebsbit of a wart!
07:57jowagah
07:58ambrosebsjowag: every top form is fully macroexpanded, evaluated, then checked.
07:59jowagbut you check the macro expanded form, not the evaled result
07:59ambrosebsjowag: yes.
08:00ambrosebsit's evaluated for side effects, like require/use.
08:00kmicuIs any core.typed-mode for emacs yet? ;]
08:00ambrosebskmicu: How do I plug it in?
08:00ambrosebsI'm a vimmer
08:01ambrosebsalthough I haven't written a plugin for vim either.
08:01kmicu"C-u C-c C-t inserts a type annotation, for symbol at point, on the line above"
08:01kmicuI only asking. It will be neat thing.
08:01Anderkent> 3 keystrikes with a modifier
08:01Anderkent>neat
08:01Anderkent:D
08:01Anderkentsorry, my vim is showing :P
08:01kmicuI can bind it to ,t
08:02ambrosebsah. I'm more interested in highlighting type errors.
08:02ambrosebsthat would be cool.
08:02kmicuAnd highlighting type errors with flycheck.
08:02kmicuYes.
08:02ambrosebsI have the line numbers! I'll have a look.
08:03kmicuAny support for core.typed in tools will be awesome.
08:04kmicuAnderkent: It was an example from haskell-mode, you can set a keybinding whatever you want.
08:05jowagambrosebs: if you must eval everything, it is not a static type checking anymore, is it? :) creeping side effect may hinder the usage of type checking on the fly e.g. in IDEs
08:06noncomcan i somehow receive the result of (concat) in the form of a [], without (into []) ?
08:07jowagnoncom: concat returns lazy seq, so no, either use into, or reduce
08:07ambrosebsjowag: yes it's a valid concern. But it's a product of Clojure's compiler/nature. In CLJS we don't have this problem.
08:08ambrosebsjowag: There's probably a solution, I just used a hammer to fix this particular problem ;)
08:11AnderkentI'd say having top level forms that cannot be safely evaluated is a bad codesmell anyway
08:11Anderkentesp. since that means your code can't be AOT compiled
08:12ambrosebsAnderkent: yes. we could probably get away with just evaluating the first form in every ns.
08:14jowagAnderkent: it has it's valid uses though, e.g. creating defs programatically
08:15jowagambrosebs: you need also to eval each defmacro so you can use it to macroexpand later forms
08:15Anderkentambrosebs: not really. You can't even read a file in without evaluating each form if you want to be sure you're looking at the same thing the compiler looks at
08:16ambrosebsto be clear, I run the full file through the Compiler's analyzer, *then* I call the .eval method on each AST object.
08:17Anderkenthm. from my understanding of the compiler, that shouldn't work. Unless the analyzer evals already?
08:18ambrosebsSee jvm.tools.analyzer for exactly what happens.
08:19hhenkelHi all, I'm currently trying to "understand" clojure. As I did python and java stuff my mind is polluted with object oriented programming.
08:19ambrosebshhenkel: I think you're in good company :)
08:20Anderkentno time right now to look at it really, but the one thing I'm sure doesn't work is something like: (doseq [form (read-all file)] (eval form)), where read-all is not lazy.
08:20hhenkelI currently try to understand how someone would do something like a shared queue - shared as in in shared between threads.
08:20AnderkentI'm not sure about what the java interface is, but you certainly can't call (read file-stream true nil) before evaling previous form
08:20ambrosebsit's more like (doseq [ast (analyze-file file)] (.eval ast))
08:20Anderkentyeah, that doesn't tell me anything :(
08:20hhenkelambrosebs: ;)
08:20coredhello
08:21Anderkenthhenkel: if you need synchronous access, you want a `ref` to a vector, and all threads accessing it in `dosync` blocks
08:21Anderkent(or if it's just a queue you want, you might use java.util.concurrent queues :P)
08:21clgvAnderkent: vectors are stacks not queues ;)
08:21jowagambrosebs: Anderkent: but there is a difference between analyzing a file and analyzing one form. In order to analyze next form, you have to eval the previous. what if previous form switches a current namespace for example...
08:22Anderkentyes, soryr. list.
08:22jowagsee https://github.com/clojure/jvm.tools.analyzer/blob/master/src/main/clojure/clojure/tools/analyzer.clj#L840
08:22clgvAnderkent: clojure.lang.PersistentQueue ^^ list can also only be modified at one end (the head)
08:23hhenkelAnderkent: hmm, okay. It would be a priority queue in my case and there is a java class for that. I looked a bit around and found: http://stackoverflow.com/questions/671706/how-do-i-make-a-java-class-immutable-in-clojure
08:23ambrosebsok, I got it wrong. I analyze, then eval each form sequentially.
08:23ambrosebshttps://github.com/clojure/jvm.tools.analyzer/blob/master/src/main/clojure/clojure/tools/analyzer.clj#L929
08:23clgvhhenkel: but for communication between threads the Queue implementations in java.util.concurrent might be useful as well
08:23ambrosebsprecisely for side effects like ns changing.
08:24hhenkelWhat I currently not getting is the use of "pqueue-add", as the queue I created gets not altered.
08:25clgvhhenkel: how do you want to use the queue? producer-consumer-scenario?
08:25hhenkelclgv: okay. So the recommondation would be to stick to the java stuff?
08:25Anderkenthhenkel: the java stuff is ok if all you need is a queue
08:25Anderkentbut if you need something more complex (say a shared datastructure that includes a queue)
08:25hhenkelclgv: Yes, I was thinking about writing a little client that consumes data from jolokia and sends it to riemann.
08:25Anderkentthen you want refs
08:25clgvhhenkel: if you want the producer-consumer-scenario with priorities you can use java.util.concurrent.PriorityBlockingQueue
08:26jowagyou can use core.async too :)
08:26Anderkentcore.async is nice but maybe not as in the first clojure project? :D
08:26Anderkentunless one just takes it for what it says and doesnt try to parse its internals, I guess.
08:27jowagonly for former golang programmers :)
08:27hhenkelclgv: okay and for threads I would use agents or plain java threads?
08:27Anderkenthhenkel: that depends if they're worker threads or task-management threads
08:28Anderkentyou shouldnt put 'work' (anyhting that blocks, for example) into an agent
08:28Anderkentagents are more like dispatchers. Any real work should either happen in a plain java thread or in the non-agent threadpool (using `send-off`)
08:28clgvhhenkel: not agents -> futures
08:29jowaghhenkel: you also have a "future" function, it really depends on what do you want to achieve with another thread
08:29Anderkentmy usual agent usage is: you submit a task, agent looks at it and decides if it should be done, if so it uses send-off to execute it, and the task submits a 'done' task back onto the agent
08:29clgvhhenkel: e.g. (let [q (create-the-queue)] (future (producer)) (future (consumer)))
08:29hhenkelAnderkent: okay, so a http request/ messages are a don't for agents.
08:30Anderkentin general, between futures, promises, agents and send-off you rarely have to think of the jvm threads.
08:30Anderkenthhenkel: the network reading is not ok in the agent, but deciding what kind of response should go there is fine
08:30clgvhhenkel: depends - use agents when you want to handle those requests sequentially in a different thread
08:31clgvhhenkel: you got a clojure book where you can read about the concurrency principles built into clojure?
08:32hhenkelclgv: I got Programming Clojure - second Edition
08:33hhenkelOkay, I think I have to get back to reading...a lot of information to process.
08:34hhenkelAnderkent: clgv: jowag: Thanks for all the input!
08:39Anderkentjowag: ambrosebs: a jvm.tools.analyzer question - does it make it easier to do full recursive macroexpansion / transformation than just working on sexps? It looks like it might, with the additional information like where a symbol is bound, but it's not clear to me.
08:39ambrosebsAnderkent: yes a sexp has no contextual information. AST's are rich with it.
08:39Anderkentor does clojure.tools.analyzer/macroexpand already do recursive macroexpansion?
08:40ambrosebsAnderkent: it delegates it to clojure.lang.Compiler/analyze, and then pretty prints the AST to simulate macroexpansion :)
08:41Anderkentright, but that results in the top form being macroexpanded, or a full recursive macroexpansion?
08:41Anderkenteh, guess i'll just `lein try` it and see for myself
08:41ambrosebsIt's quite rigid, I can *only* get back a fully expanded AST for clojure.lang.Compiler/analyze.
08:41ambrosebs*from
08:43Anderkentoh nice
08:43Anderkentit does it already
08:43AnderkentI guess I need to start using it for cloverage
08:44AnderkentGah. Or I can't. damn.
08:44ambrosebs?
08:45Anderkentwell, this might be going into too much detail
08:45ambrosebs:)
08:45Anderkentbut basically what I do is: take a sexp, look at the first element, if it's a known form that I know how to instrument, do it manually and recurse on some children, otherwise macroexpand.
08:45ambrosebsjvm.tools.analyzer is too blunt an instrument to do that.
08:46AnderkentI don't always want to macroexpand because some macroes expand into really stupid forms :P
08:46ambrosebsI'm eagerly awaiting CinC to be completed.
08:46Anderkentyeah, my problem is
08:46Anderkentwhen i get something like
08:46Anderkent(letfn [(loop [x] x)] (loop 1))
08:46Bronsaambrosebs: working on it :P
08:46ambrosebsBronsa: <3 <3
08:46Anderkentcloverage happily instruments the letfn, then recurses on the loop
08:47Anderkentbut it loses track of lexical scope, so it thinks it's clojure.core/loop
08:47Anderkentwhich it knows of and special cases, but this is not a legal loop form, so it fails.
08:47AnderkentI guess I have to track the lexical scope myself, but that's a pain
08:48ambrosebsAnderkent: yes, a pain.
08:48ambrosebsAnderkent: and error prone.
08:49Anderkentyeah.
08:49ambrosebsat least I would screw it up :)
08:49ambrosebsthere's quite a few forms where bindings are introduced.
08:49Anderkentambrosebs: most of them expand to let* though.
08:49Anderkenton the other hand
08:50Anderkent,(do (defn loop [x] x) (loop 1))
08:50Anderkent;(((
08:50clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
08:50Anderkentyea shut up clojurebot
08:50ambrosebsI think deftype*, try/catch, letfn* are the exceptions.
08:50ambrosebsprobably more.
08:51Anderkentyeah. it's not a small job
08:52Anderkentso for now I just decided that anyone who redefines loop is a fool and doesnt deserve test coverage!
08:53jowagambrosebs: is CinC still being worked on? I though the focus is now shifted on CLJS compiler/analyzer, and use that as CinC eventually
08:53ambrosebsAnderkent: oh fn*, and NewInstanceMethod :)
08:54ambrosebsso 6 ways of introducing locals :O
08:54Anderkentnewinstancemethod?
08:54ambrosebsIIRC it's what methods in a deftype compile to.
08:54ambrosebsjowag: Bronsa is hard at work on it.
08:55ambrosebsjowag: CLJS was a successful experiment showing how to write a compiler in CLJ and has spawned several similar compilers.
08:56Anderkentah, yes, the methods under deftypes have their own silly syntax too. I guess they're not fns for efficiency?
08:57Anderkentman, this is hard... Still easier than writing a clojure-aware byte code instrumenter, I guess, but it's sad it's this hard
08:57Anderkentit's a lisp, it's supposed to be easy! :P
08:58ambrosebsI assume it compiles directly to methods on the class compiled by deftype.
09:05ambrosebsjowag: https://github.com/Bronsa/CinC
09:05ambrosebsAnderkent: ^ apparently the analyzer is written. You could probably customise it.
09:06ambrosebshttps://github.com/Bronsa/CinC/blob/compiler-WIP/src/cinc/analyzer.clj
09:06Anderkentthe WIP is scary :P
09:07ambrosebsI think the emission is WIP, the analyzer is done.
09:07ambrosebs(apparently)
09:07ambrosebsyou only want the analyzer.
09:07Anderkenthm, well, I need to be able to go from analyzed code (ast, I guess?) to s-exp so that I can ask clojure to compile it
09:08Bronsaambrosebs: Anderkent the analyzer is done, you probably want to use https://github.com/Bronsa/CinC/blob/compiler-WIP/src/cinc/analyzer/jvm.clj by the way
09:08BronsaAnderkent: just need to write a emit-form pass and you're ok to go :P
09:09ambrosebsAnderkent: see clojure.tools.analyzer.emit-form for an idea of what's involved.
09:09BronsaAnderkent: the jvm analyzer has a pass that does alpha-conversion so you should have no problem regarding locals shadowing
09:09Anderkentskimming through the two files doesn't really give me a very good idea of what's actually going on, I'm afraid
09:10Anderkenti'd have to read through to see what all the passes do to see where I'd want to hook in, I guess.
09:12Anderkentbut working on asts actually solves another problem I have
09:12BronsaAnderkent: there are the tests and some documentation, even though it's somewhat outdated
09:12Anderkentwhich is that strings/numbers/etc. don't have metadata
09:12BronsaI'm sorry, I'll write extensive documentation once everything is stable
09:13Anderkenthaha don't worry
09:13AnderkentI won't get to trying it any time soon anyway
09:13ambrosebsAnderkent: you probably want to hook in at macroexpand-1 or -analyze :seq.
09:15ambrosebsBronsa: you're doing awesome work! feels like a sneak preview of CLojure 2.0
09:17Anderkentambrosebs: it's probably not that simple - f.e. when I see a defn, I want to do some modification to its body (probably before analysis), then let the analysis continue without doing anything until I actually enter the body. It's not obvious how to achieve that - perhaps putting some metadata on each body expr that says 'ok start instrumenting again'
09:18Anderkentso I need to hook in every time something is about to be macroexpanded, and every time something is being -analyzed
09:18Bronsaambrosebs: thanks! unfortunately right now it's really slow :(
09:18Anderkentand keep track of the relation between macroexpanded and original forms
09:18ambrosebsBronsa: sounds like my work.
09:18Bronsaambrosebs: heh, I'll first get it to work, then focus on performance enhancements
09:19ambrosebsamen.
09:19Anderkentpff, who cares if it's correct when it's fast? :P
09:20ambrosebsAnderkent: interesting.
09:31clgvAnderkent: you can intercept `defn` easily via robert.hooke or plain `alter-var-root` then modify the body since the analysis is said to expand the macros that should work
09:34Anderkentclgv: as in change defn itself instead of recognizing when it's called? You know, that might work and generalize to everything except non-namespaced specials...
09:34Anderkentdidn't think of that!
09:34Anderkent(of course I'd want a thread local binding not alter-var-root)
09:35AnderkentHm. no, I still want to recurse into arguments to functions (not macroes), so I have to look at the sexp and not just let it evaluate.
09:41silasdavisIf i have a zipper zp and I apply down enough times I get a NullPointerException:
09:41silasdavis (-> zp down down down node)
09:41silasdavisusing this example: http://clojuredocs.org/clojure_core/clojure.zip/zipper
09:41silasdavisbut according to the docs I think I should get nil
09:42Anderkentsilasdavis: (node nil) gives NPE
09:42Anderkentthe examples do not call node on the result
09:42silasdavisthat'll be why then
09:43silasdavisthanks
09:43Anderkentnp
10:23futileRight now I spawn up a short-lived thread for each message I want to send, and throw it over a concurrent-queue to a central thread that communicates over a unix socket. Would it be more efficient to use core.async instead?
10:23mdrogalisHow many threads are you making?
10:24futileLet's say that in one small burst it's about 10 to 20, and the bursts happen only every few minutes, but they usually come in 3-5 bursts at a time.
10:24futileSo, maybe about 30-60 all at once every few minutes.
10:24mdrogalisfutile: You could try with go-blocks. JVM gives you about 1,000 threads. So profile & found out :)
10:37Anderkentfutile: are oyu making an actual thread or using a threadpool?
10:39tbaldridgefutile: I just created 1mil go blocks in about 2sec it's quite possible to do what want in core.async
10:46clgvtbaldridge: according from what I read and tested it seems not to be possible to store double arrays compactly in datomic. did I miss something?
10:47jowaganyb knows what's the purpose of :once metadata in fn* ?
10:48tbaldridgeclgv: you can store it in a column of :db.type/bytes, in that case, the storage structure for a datom would basically be [int int byte-array]. So that'd be quite compact.
10:49clgvtbaldridge: yes I considered that. It is unfortunate that they do not support double arrays...
10:49Anderkentjowag: look at Compiler$ObjExpr.compile, the oneTimeUse arg comes from the :once meta
10:50Anderkent(and it seems it's not used haha)
10:50jowagI've looked, this arg is not used at all in compile() method
10:50noncomjowag: does it relate to (defonce) somehow?
10:50Anderkentyeah, I guess it's just legacy crap
10:51jowagit is used
10:51jowagin emitlocal
10:51jowaglook for onceOnly field
10:52jowagin Compiler.clj, but my knowledge of compiler stops there :)
10:52jowagCompiler.java of course :)
10:53noncomi think it simply makes the function defined only once
10:53noncomin case if you have some closures inside it i guess
10:53Anderkentjowag: compiler.clj haha wishful thinking
10:53noncomthat you no want to redefine
10:53jowagnoncom: or maybe a function that gets GCed after called just once?
10:54noncomjowag: although that might be, but i think that such a behavior is not very good... esp with the clojures accent on immutability
10:54jowagAnderkent: got carried away by CinC
10:55Anderkentjowag: I believe it's for clojure clearing
10:55noncomjowag: such use-once-then-destroy fns would probably be better created in a datastruct that is destroyed later
10:55Anderkent*closure
10:55jowagnoncom: seems to have valid use in future, delay and lazy-seq
10:56Anderkentif you know a function will only be called once
10:56Anderkentthen you can kill its closure after it runs
10:56Anderkentotherwise you must wait for the fn to be gced
10:57tbaldridgebbloom: ping
10:57bbloomtbaldridge: pong
10:58jowagAnderkent: seems reasonable explanation, thanks
10:59tbaldridgebbloom: so I was reading that eff papaer again last night, and I'm still confused by something. What is the point of resources? They don't get a continuation, they simply do IO. If all the runtime does is act like they are normal function calls, why not use the IO function instead?
10:59tbaldridgebbloom: I mean I see the point of "everything is functional" but what does that buy you?
10:59bbloomtbaldridge: the point of resources is that they are attached to effects, so that they have dynamic extent
10:59bbloomtbaldridge: you don't ever raise a resource
11:00bbloomtbaldridge: let's say you have an Output effect that has one function: "println"
11:00bbloomtbaldridge: you'd need a Consult too, which implements the println operation
11:01bbloomer i mean Console
11:01bbloomnot consult
11:01tbaldridgebbloom: right
11:01bbloomtbaldridge: anyway, you could create a Output effect built on StringBuilder which doesn't have a resource that just soaks up printing, like with-out-str
11:01bbloomtbaldridge: same idea
11:04bbloomtbaldridge: Eff is a stylized (and typed) use of the effects/resources thing
11:05tbaldridgebbloom: okay, I'll read the papers again and see if that helps
11:06bbloomtbaldridge: under the hood, effects with resources DO get a continuation, they just always return precisely once, since otherwise you could give a continuation to a resource, which would be problematic
11:07bbloomtbaldridge: Eff is using it's type system to prevent you from calling the continuation multiple times, etc. it realizes when you hvae a resourceful effect & then changes the signature of operations to not get the continuation, wrapping your operation in the obvious/trivial destructuring of the return pair (result, new-resource-state) and calling the continuation with result
11:08tbaldridgebbloom: ah, that makes more sense, so it doesn't allow you to store the continuation off somewhere. That explains why resources != effects
11:08bbloomtbaldridge: yeah! took me a bit to wrap my head around it too until i started implementing it
11:10jowagAnderkent: I've found it "The new lazy branch contains a compiler enhancement for this and similar scenarios. lazy-seq and delay both perform closed-over local clearing on the tail call of their body, ensuring no references remain in the closure itself when the tail-call executes."
11:10jowaghttp://clojure.org/lazy
11:11bbloomtbaldridge: the other confusing bit is that there are really two categories of resources: magic top-level ones, and arbitrary values
11:12bbloomtbaldridge: the former make sense: they're the outside world you can communicate with. the later was a little less clear to me
11:12bbloomtbaldridge: they use the later in the second part of the state example. the resource they provide is just the state value. it can have any type
11:13tbaldridgebbloom: so like the clojure atom
11:13bbloomtbaldridge: yeah, but it's more like a Var b/c it's gonna have thread local scope
11:13Anderkentjowag: so kind of what I guessed, I think?
11:13bbloomtbaldridge: but it's a var that you can give a custom interface to
11:14jowagAnderkent: yeah but seems specific to TCO
11:14noncomhow do i iterate over two or more collections simultaneously? i would use a (map) but i really need only side-effects, so maybe there is a way which is preferred for side-effects?
11:14Anderkentwell, that's probably more of a 'when do we set :once' rather than 'whta does :once do'
11:15noncomlike doseq, but able to iterate over multiple collections llike map
11:15bbloomtbaldridge: yeah, that's a good way to think about it: as a dynamic "object" which is built out of several ^:dynamic vars: one state atom + several functions that swap! that atom :-)
11:16Anderkentnoncom: any particular order? (doall (interleave coll1 coll2)) is my instinct
11:16Anderkent(make that dorun if you don't care about results)
11:17noncomthe order matters yes. i think (dorun) then is what i want
11:17arkhwhat's a way to iterate over 2 or more sequences like 'for', but do so in a simultaneous fashion (not rightmost fastest)? So the first iteration would consume the first item on all sequences, etc.
11:17bbloomtbaldridge: another cool thing about this is that your default top-level handler might support like a "dbg" function for printing during development, but wouldn't support normal printing or other IO effects or the like. so if you created a lazy thunk or lazy-seq like they do in the paper, and you accidentally had IO in there, then the IO occurs outside of the lazy dynamic extent, you'll get a runtime error about the operation not being
11:17bbloom available when you try to force the lazy thunk
11:17noncomarkh: haha, same quaestion.. but do you need side-efefcts or the results?
11:18Anderkentarkh: (for [[x .... ] (map list c1 c2 c3)])
11:18noncomheh
11:18arkhnoncom: oh - weird : )
11:18tbaldridgebbloom: interesting.
11:19Anderkentarkh: basically (map list ...) will join the respective elements together, until one of them runs out
11:19noncomAnderkent: but in your example (doall (interleave coll1 coll2)) where is the function?
11:19arkhAnderkent: neat! Thank you
11:20bbloomtbaldridge: yeah, it's cool b/c you can basically say "well, laziness is available here… and IO is available here" and split them up so that you can't fuck it up :-)
11:20Anderkentnoncom: ah, I thought you just needed to evaluate the collections, not run something over them?
11:20noncomAnderkent: i think that what you adviced to arkh - is closer. yeah, i deen a func to exec side-effects on paralleled colls
11:20noncoms/deen/need (to much coca-cola)
11:21Anderkentah, I thought it was the collection evaluation that side effects
11:22Anderkentthen yes you want something like (map my-side-effect-fn c1 c2 c3 c4) if it takes one element from each each, or (map my-side-effect (interleave c1 c2 c3 c4)) if it takes one at a time
11:22bbloomtbaldridge: for example, you'll notice people are discussing doall & side effects and whatnot around us :-)
11:23Anderkentbbloom: what? who?
11:23noncomthe first one is the best.. so i like force them with (dorun)? will it be idiomatic?
11:23tbaldridgebbloom: when you said "run time error" above did you mean compile time error?
11:23bbloomAnderkent: you guys :-)
11:23Anderkentno way.
11:23tbaldridgebbloom: because we have runtime errors with lazy-seqs right now.
11:23Anderkentnoncom: yes, that shuold be fine
11:23noncomthanks! :)
11:24bbloomtbaldridge: i'm saying you'd get a run time error if you try to realize a lazy seq outside of an IO handler
11:24bbloomtbaldridge: er i mean outside of a laziness handler
11:24noncomi need side-effects coz i iterate with java graphics lib, that makes a usecase :)
11:25tbaldridgenoncom: if you need better performance, consider using loop/recur. But yes, doall will work fine for most cases
11:25bbloomtbaldridge: also, Eff explicitly disallows you from having effects inside your effect handlers, which i'm still wrapping my head around why, but it seems like a reasonable restriction. so you'd get a runtime error if you tried to execute an effect during lazy realization
11:26bbloomtbaldridge: there's this line in there too: "It would be even better if deferred effectful computations were prevented by a typing discipline, but for that we would need an effect system." <-- they have runtime errors now & they want to move to compile time errors in future work
11:27Anderkenttbaldridge: dorun not doall if he just needs the sideeffects!
11:27Anderkentbut still :p
11:27tbaldridgebbloom: agreed, that seems like the better approach
11:28bbloomtbaldridge: what seems like a better approach? doing it at compile time?
11:29bbloomtbaldridge: to do it at compile time, you'd need to do effect inference. just like how there are static type systems, there are static effect systems. the same ideas apply: inference, effect checking, etc.
11:30bbloomtbaldridge: types describe *what* something computes and effects describe *how* it computes. static type systems *prove* what and static effect systems *prove* how in such a way as to prevent common errors :-)
11:30tbaldridgebbloom: yeah, compile time. It seems that it would have interesting uses during optimization as well.
11:30nDuff..."package level" meaning protected?
11:30nDuff...oh, wow, I was scrolled up.
11:30bbloomtbaldridge: yes, absolutely. there's probably some kind of clojure-type-hints level minimal inference that could provide perf benefits. things like ^:once or whatever on a continuation
11:31akyteWhat are we doing at compile time?
11:31tbaldridgebbloom: well in this case I'm actually thinking of how this would look in a statically typed language.
11:32bbloomtbaldridge: ah! well spare your imagination some trouble & check out this thing from MSR:
11:32tbaldridgebbloom: I have the odd position that I don't really care about types for "correctness" I think that's a bit pointless. Using types to drive better optimizations, now that's something that interests me.
11:32bbloomtbaldridge: http://www.rise4fun.com/koka/tutorial
11:33bbloomtbaldridge: that's not that odd of a position! i'm with you completely. i'm a huge believer in partial evaluation and the like
11:33bbloomtbaldridge: Koka is a language with a type & effect system
11:33bbloomtbaldridge: the tutorial is interactive & has awesome hover tooltips
11:33tbaldridgebbloom: cool, I'll check it out. (after work, lol)
11:33bbloomtbaldridge: i'm experimenting with an interpreter for a clojure-like language that is designed to be more amenable to static analysis & partial evaluation
11:34bbloomtbaldridge: while still remaining dynamic by default
11:37tbaldridgebbloom: nice!
11:57futileAnderkent: Actually I'm only creating very few new threads, most of the time I'm just communicating with an existing thread over an ArrayBlockingQueue
11:57seangrov`core.typed really looks cool
11:58seangrov`core.typed, source maps, clojurescript, and core.async - should be a pretty robust system to work with
12:00ka__Why does this code "(def f Character/isUpperCase)" make an error "... Unable to find static field: isUpperCase in..."? Why dosen't clojure search static methods?
12:00seangrov`,(def f #(Character/isUpperCase %))
12:00clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
12:00seangrov`Damn sanbox
12:00ToxicFrogseangrov`: that doesn't seem like it should be necessary
12:03bbloomToxicFrog: it's necessary because java methods are not clojure functions
12:03futileDoes anyone foresee the ClojureScript tooling improving over the next few years? It feels a bit raw to use at this stage.
12:04bbloomToxicFrog: you could coerce them with a wrapper like mem-fn, but note the signature of mem-fn:
12:04bbloom(doc mem-fn)
12:04clojurebotIt's greek to me.
12:04bbloom(doc memfn) ; rather
12:04clojurebot"([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn. name may be type-hinted with the method receiver's type in order to avoid reflective calls."
12:05seangrov`futile: Only you can improve cljs tooling
12:05bbloomToxicFrog: java methods aren't first-class, clojure fns are. but you give type hints to memfn to eliminate reflection, since java methods can be overloaded by type
12:05ToxicFrogbbloom: aah.
12:05futileseangrov`: improving cljs tooling, fighting forest fires.. man the world is laying tons of responsibility on just me
12:05bbloomToxicFrog: #() will at lease resolve the arity, which is usually enough to narrow down the choice & eliminate reflection
12:06bbloomToxicFrog: but we have syntax for type hints, that's our syntax for arity hints
12:07seangrov`futile: But of course it should get better. Source maps, cemerick's work on pushing lein-cljsbuild forward, austin, cljs.test (which is *awesome*), etc.
12:07futileyay
12:07tbaldridgefutile: I use "lein cljsbuild auto", now I actually love working in CLJS more than CLJ at times.
12:07seangrov`tbaldridge: I've never had incremental builds work for me
12:08tbaldridgeseangrov`: macros seem to mess with things a bit, but besides that I don't have many problems.
12:08seangrov`Most of the time I prefer repl-based dev
12:09seangrov`But there are times (especially with cljs' fn-reference semantics) that it's impossible to debug or tweak a feature without recompiling... incremental builds would be great there
12:12ddellacostaabout to go to bed, but just popping in to say, CLJS tooling is improving constantly. thanks to people like seangrov` among many…
12:12ddellacostaif we want it to improve we have to take matters into our own hands, at the moment. But it's totally usable now.
12:12sandbagsi asked this a while back in #clojurescript but i'm not sure anyone there is talking. I've just setup a new CLJS project and it's not including the core CLJS stuff in the compiled JS file, just my code & the Google Clojure stuff. I've had this work in the past so I guess I've done something daft. Anyone see something wrong in my project.clj (https://gist.github.com/mmower/513299b84c1e57d86d82)? I am using le
12:12sandbagsin cljsbuild auto.
12:12ddellacostawhat timing
12:13ddellacostasandbags: the obvious thing to check first is that your code is in src/cljs, as it says there
12:14sandbagsddellacosta: yes, the code i put in my CLJS files is getting included in compiled.js
12:14ddellacostasandbags: oh, wait, it *does* include your code, but not some other libs?
12:14ddellacostasorry, misunderstood
12:14ddellacostasandbags: what is it not including?
12:14sandbagsit's the CLJS code itself
12:14sandbagsi.e. Clojure in JS
12:14ddellacostasandbags: …what do you mean?
12:15seangrov`ddellacosta: cljs.core isn't being output into his file
12:15sandbagsseangrov`: yes, that's what i was trying & failing to say
12:15seangrov`sandbags: try :optimizations :simple
12:15sandbagsi think i tried that already but i will try again now
12:15seangrov`do a lein clean first
12:15seangrov`err, lein cljsbuild clean
12:15seangrov`And then change the optimization to :simple
12:16ddellacostasandbags: huh, weird, never had that kind of issue. Yeah, ditto what seangrov` is saying
12:17clgvanother datomic question: can I create attributes with ordered many relations?
12:17ddellacostaand on that note, I'ma let ya'll handle this one and gonna go get some sleep. 'night folks.
12:17tbaldridgeclgv: no, but you can have each attribute point to an entity with a :index attribute
12:17seangrov`'night ddellacosta
12:18sandbagsokay i did a cljsbuild clean & cljsbuild auto after changing optimization to :simple
12:18sandbagshttps://gist.github.com/mmower/50fd08d3850482723bff
12:18ddellacostaseangrov`: g'night. And don't get too depressed about domina…I know where you're coming from though…heh
12:18clgvtbaldridge: I really miss the ability to use clojure collections as values...
12:19seangrov`sandbags: I've had this problem sometimes as well, and it always turns out to be something very simple I've forgotten
12:19sandbagsi feel like i'm missing something obvious, i've been following along the instructions from CLJS Up & Running
12:19seangrov`Does a cljsbuild once work?
12:20tbaldridgeclgv: yeah, that'll be a common problem with DBs, you loose that but gain performance, query abilities, etc. And Datomic entities are basically hashmaps, so you can use many of the clojure functions with them
12:20sandbagsseangrov`: same error trying 'once'
12:21clgvtbaldridge: hmm right from sql dbs I know that...
12:21seangrov`sandbags: what does ls out/ look like? Is there a cljs folder? Is there a core.cljs inside of that?
12:24sandbagsseangrov`: okay i've solved it, it was a pathing issue with my source file
12:24seangrov`sandbags: What was the issue?
12:24seangrov`Would be good to make a note somewhere
12:25sandbagsseangrov`: so i created src/cljs/core.cljs rather than src/cljs/jsa/core.cljs (for ns jsa.core)
12:25sandbagsseangrov`: once i moved my source file into a cljs/jsa folder
12:25seangrov`Hrm, frustrating
12:25sandbagsthe cljs.core stuff got compiled in.... it's possibly related to using the name "core.cljs"
12:26sandbagsand being in, essentially, the root folder
12:26seangrov`Yeah, makes sense, but the error doesn't make it clear at all
12:26seangrov`Not sure what we could do in that case
12:26sandbagsso maybe some path collecting thing thinks "I already have the core.cljs file"
12:26sandbagsseangrov`: yes it's not obvious
12:27sandbagsoh, an ancilliary Q
12:27sandbagshow do you find out what value to specify for the build number in the project.clj :dependencies for org.clojure/clojurescript?
12:27sandbagsthe one in the book is pretty old
12:27sandbagsthe only clojurescript i could find in clojars was one of Chris Grangers versions
12:27clgvtbaldridge: does :unique work on :db.type/bytes attributes?
12:28sandbagsand looking at the Clojurescript repo in github didn't obviously tell me how to figure it out
12:28seangrov`sandbags: Follow the mailing list, for now
12:28sandbagsah :)
12:28sandbagsi've found this to be a problem clojure-wide
12:28seangrov`Maybe dnolen can add a lein project section to the clojure/clojurescript readme with the latest version
12:28sandbagsi'm constantly wondering
12:29sandbagsi think that would be really helpful
12:29xeqisandbags: cljs is hosted in maven, so http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.clojure%22%20a%3A%22clojurescript%22
12:29seangrov`dnolen: Any reason that wouldn't be possible?
12:29dnolenseangrov`: anybody can do that when the patch lands, it's part of the wiki.
12:29xeqisorry, hosted in central
12:29clgvsandbags: http://search.maven.org/
12:30sandbagsxeqi, clgv thanks ... i'm not sure how I (or any other relative newbie) would have known to search there
12:30sandbagsi find stuff using the clojars.org search (although sometimes i seem to find the wrong thing)
12:30clgvsandbags: well, now you can remember that all the official clojure projects are over there
12:33sandbagsthe info is actually on the libraries page of the clojure.org site
12:33sandbagsbut the maven link is not, i think, very well described
12:34sandbagssince, for example, when looking for CLJS I wouldn't be thinking "JVM libraries"
12:34sandbagsi don't know who has editing rights for those pages
12:47clgvis there any authentication/authorization to access the transactor of datomic? otherwise it cant be run on our remote server which is publically accessible...
12:56tbaldridgeclgv: I'd argue that you probably shouldn't have any DB facing the internet anyways
12:56tbaldridgeclgv: use SSH tunnels or VPNs
13:16TimMcI just made a little lein plugin to create a graph of your project's namespaces: https://github.com/timmc/nephila
13:16TimMcNeeds a bunch of work, but it may be useful as is.
13:17hyPiRionTimMc: Can you show an example in the docs?
13:17TimMcProbably a good idea!
13:18TimMcIt should also do things like, I dunno, actually use the :sources info in your project.clj.
13:18TimMcHere's an example: clojurewerkz/cassaforte http://i.imgur.com/yBvlxiL.png
13:19hyPiRionhmm, lush
13:20TimMcThe abbreviation code was hard!
13:20hyPiRionTimMc: oh, I thought you specified that manually or so
13:20hyPiRionneat.
13:21langmartinI'm sure this is a FAQ, but I'm having some trouble executing a large number of blocking procedures at once. I don't need the results
13:21TimMcThis would all be better as an interactive web page.
13:22coventry,(do (defn tst [] (let [f (transient {})] (assoc! f :2 1) (persistent! f))) (tst))
13:22clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
13:22langmartinI'm currently using send-off to an agent, is it sufficient to call (release-pending-sends) to get the send-offs to actually execute in parallel?
13:22coventryWell, what does http://clojure.org/transients mean when it says "...transients are not designed to be bashed in-place. You must capture and use the return value in the next call." In that code I just tried, for instance?
13:22TimMcRight, that code uses transients incorrectly.
13:23hyPiRionTimMc: I had an idea like that for Codeq, but it's a bit far away for me to be able to create something like that yet
13:23coventryTimMc: But it works outside the sandbox. Is it only incorrect by convention?
13:23TimMclangmartin: Clojure fns are Runnables, so you could .start Threads on each one and .join them all.
13:23clgvcoventry: try to assoc a lot of k-v-pairs to that transient map and you'll see why it is incorrect
13:23TimMccoventry: I think it works by chance.
13:25hyPiRioncoventry: it would only return new versions if there's no space in the current transient, otherwise it'll place it in the current transient
13:25riley526has anyone read an early version of "Web Development with Clojure" and can vouch for its usefulness? http://pragprog.com/book/dswdcloj/web-development-with-clojure
13:25langmartinTimMc: and If I wanted to use a thread pool like like the send-off pool...
13:26coventryTimMc, hyPiRion: Thanks, I see. Sticking the assoc in a (dotimes [i 1000]) gives a result with only eight keys.
13:26technomancyriley526: I think it was just announced yesterday, so probably no one =)
13:26riley526technomancy: fair :)
13:28schmirriley526: I've got one.
13:28coventryriley526: Have you read the excerpts? I found them pretty informative.
13:29riley526coventry: not yet, I will shortly
13:29riley526schmir: what are your thoughts on it?
13:29schmirit gives at least an good overview if you have no clue about web development...just skimmed through it..
13:30srrubyIs there a way to control the order that keys are displayed when printing maps ?
13:30bbloomsrruby: no
13:31bbloomhiredman: you might know the answer to this...
13:31bbloomis there someway to exclude java imports like you can do with refer-clojure :exclude ?
13:31bbloomminimal repro, try to (deftype Void [])
13:32coventrysrruby: You might want an array-map. http://clojuredocs.org/clojure_core/clojure.core/array-map
13:32bbloomget IllegalStateException Void already refers to: class java.lang.Void ...
13:32riley526schmir: as someone who has a clue about web development, I'm looking for a solid source on how organize a clojure webapp.
13:32TimMchyPiRion: It quickly becomes useless for projects the size of Midje: http://i.imgur.com/C182izv.jpg
13:32technomancyscared_kitty.gif
13:32hiredmanbbloom: no, you may be able to unmap Void from the namespace, the map of imports is in the namespace object
13:33bbloomhiredman: heh, i tried that… but: (ns-unmap 'Void) yields the same IllegalStateException
13:33Ph_DHey, all. I'm finally compiling my personal CLJS project as production ready code, and I'm noticing the filesize is around 175kb with {:optimizations :advanced :pretty-print false}. Is this normal?
13:33Bronsabbloom: (ns-unmap *ns* 'Void)
13:33bbloomhiredman: oh never mind. i'm an idiot
13:34bbloomhaha yeah
13:34hyPiRionTimMc: oh whaa
13:34bbloomBronsa: fireplace was eval-ing my file that had the deftype still in it
13:34riley526schmir: clojure gives me almost too much freedom. I spend too much time trying to figure out where to put something, and still end up with an unorganized mess of functions. My fault entirely, of course :)
13:34hiredmanI'm not sure if ns-unmap will unmap the right bits
13:34tbaldridgePh_D: are you thinking that sounds big, or small?
13:34coventryriley526: I don't know if the excerpts will answer that question for you.
13:34justin_smithwhy is the type of m in (def m {:a 1}) different from the type of m in (let [m {:a 1}] m)
13:34bbloomhiredman: Bronsa: ok ns-unmap seems to have worked. thanks guys!
13:35tbaldridgePh_D: remember that includes the entire clojure runtime, any libs you included, etc.
13:35Bronsahiredman: class imports are just put in .mappings
13:36Bronsahiredman: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Namespace.java#L34
13:37bbloomBronsa: since you're a reader pro… what's the best approach if i have a zero-payload custom type that i want to be readable? for example, consider such a Void type :-)
13:37bbloomin scheme land, you'd have something like #void
13:38bbloomi guess the best i can do is: #void []
13:38bbloomwhich feels ugly
13:38Ph_Dtbaldridge: It's a bit large for my liking, but that does make sense as it includes the libs I've added to the project. It was ~200kb until I removed some unnecessary namespace requires.
13:38Bronsabbloom: #void nil? :P
13:38tbaldridgePh_D: gzip it, and see what happens.
13:38bbloomBronsa: can i do that? :-) heh
13:38Bronsabbloom: I can't think of anything simpler than #void [] btw
13:39Bronsabbloom: sure you can
13:39bbloomBronsa: seems like a small oversight in EDN
13:39Ph_Dtbaldrige: Yeah, that was my next step. I've read some articles on how to gzip in Compojure, but it seems fuzzy. Should I be using Jetty's gzip feature or Ring middleware?
13:39bbloomBronsa: i feel similarly about `true` and `false` vs the more traditional #t and #f
13:39bbloomor #true and #false
13:39bbloomBronsa: annoying as hell if you actually want to have a 'true symbol
13:40Bronsayeah, but then again, you can make the same argument for rebinding special forms
13:40Bronsalike it or not, you need some special symbols that don't behave like everything else
13:40bbloomi disagree :-P the primitive symbols really should be namespaced
13:41Bronsabut they don't bind to vars
13:42bbloomBronsa: (defprotocol IVar …) (deftype PrimitiveVar …) (deftype Var …) :-)
13:43tbaldridgePh_D: I'd use the ring middleware, but you can gzip it from the commandline to get an idea of what ball park you'll be in
13:48Ph_Dtbaldrige: Oh, right. Gzipped it's ~50kb. I can manage that. :P
13:50dnolenPh_D: ;) CLJS produces a pretty optimal amount of code.
13:57asteve,(try (read-string (str "4932") (catch Exception e 0)))
13:57clojurebotasteve: I don't understand.
13:58Ph_Ddnolen: Definitely. Did some heavy reading on core.async last night, and I'm beginning to implement it in my UI design. Words can't describe the power...
13:58bbloomPh_D: cue maniacal laughter
14:02silasdavis!(str (map hash-map [:bar] (repeatedly hash-map)))
14:02silasdavis_(str (map hash-map [:bar] (repeatedly hash-map)))
14:02silasdavisclojurebot,
14:02clojurebotExcuse me?
14:02silasdavisclojurebot, help
14:02clojurebotNobody can help with "X doesn't work". Please provide context: what you did, what you hoped would happen, and what happened instead. A stack trace is especially helpful, if applicable.
14:02silasdavisclojurebot, execute
14:02clojurebotCool story bro.
14:02silasdavisbah
14:03silasdaviscan someone tell me how to get the above to print what it does in the repl, not somethign like "clojure.lang.LazySeq@3ccf1b46"
14:03Ph_Dbbloom & dnolen: I also read this article from Keming Labs: http://keminglabs.com/blog/core-async-ui-first-questions/ — I'm specifically interested in his question on using go blocks for simple (Angular-like) data-binding. Thoughts?
14:04coventrysilasdavis: ,(pr-str (map hash-map [:bar] (repeatedly hash-map))) ?
14:04dnolenPh_D: I don't yet, working on some stuff.
14:04coventry,(pr-str (map hash-map [:bar] (repeatedly hash-map)))
14:05clojurebot"({:bar {}})"
14:05bbloomPh_D: the only thoughts i can offer you are either A) already covered in what we linked you to or B) would probably just confuse you more
14:05bbloomPh_D: like i said, it's a bit of an open research problem right now
14:07silasdaviscoventry, thanks
14:08Ph_Ddnolen: Gotcha, I'll be sure to keep an eye out on your blog.
14:08Ph_Dbbloom: Hah, that's fair. Once I really sink my teeth in it, I look forward to contributing some of my own experiments.
14:13pandeiroanyone installed lighttable 5.x on archlinux successfully?
14:23futileWhat are some signs of poor health in a Clojure project?
14:27bjafutile: poor health in what context? code quality? support? active development? validated test cases?
14:27futileCode quality.
14:29bjadifficult to test and explain code has been a quick indicator for me in the past. It's not that difficult to test is necessarily bad code, but code that is hard to test and/or hard to explain tends to be sketchy in the commercial projects I've worked on
14:30tbaldridgefutile: I try to look for, global dynamic vars, and global mutable state. For instance, I consider DB clients that keep the connection in a single var to be very bad form.
14:30tbaldridgefutile: DSLs, esp those not backed by a data interface.
14:31futileHmm.
14:31futileVery interesting, thank you gentle men.
14:32bjafwiw, the difficult to test and explain thing has held true regardless of the language and platform I've worked on. It was just as true doing C and Python as it has been doing Clojure
14:33futilebja: that makes sense. If it's difficult to test and explain, it's probably doing too many things at once, which coudl easily lead to fragility, rigidity, and homoiconicity.
14:35futileWhat do you think about heavy use of macros?
14:35tbaldridgefutile: that kindof falls into the DSL side of things
14:37justin_smithcoventry: in the pr-str example, is pr-str acting like (comp str doall) ?
14:38coredhello
14:38coredis this a good starting point for learning Clojure http://cemerick.com/2012/05/02/starting-clojure/
14:38cored?
14:39pbostromtbaldridge: do you have any good examples of a "proper" DSL/data interface?
14:39amalloycored: i don't konw anything about the particular link, but anything by cemerick is unlikely to do actual harm, and likely to do good
14:39justin_smithcored: cemerick knows his shit, but counterclockwise as an editor may be a slightly controversial choice (more folks use emacs I think, and it is something you will never see unanimity about)
14:40justin_smitheditor choice is something you will never see unanimity about, that is
14:40tbaldridgepbostrom: the key is to have it backed by data, so write your program to take data as its input, then write a DSL that outputs data. That way if I don't like your DSL I can write my own, or I can generate data for your library from some other source (like a DB).
14:40vijaykirancored: Clojure Programming book will help too
14:41futileSome people I know say they nevr use macros. They say it's just gnnda lead to un-managable code and gove others on your team a hard time evolving the code over time, and that that's even true for the future-yiou. They suggest coming upp with a DSL that builds on composable functions instead, but sometimes that can get a bit cumbersome too.
14:41coredjustin_smith: I'm a vim user myself, will have to learn emacs then
14:41coredvijaykiran: bought Clojure Made Simple right now
14:41justin_smithvijaykiran: which, handily enough, is written by the same guy who did that blog post
14:41tbaldridgepbostrom: that and try not to break the Clojure semantics. e.g., don't write a macro that evaluates (foo a b) in reverse order, a, b then call foo. This is totally backwards, and would just confuse people.
14:41justin_smithcored: clojure in vim is doable, there are people here that do it
14:41coredjustin_smith: sounds good to me, I will check emacs either way. I've heard good things about Light Table for Clojure
14:41justin_smithcored: seconding recommendation about the book btw
14:42vijaykirancored: didn;t read that one though
14:42tbaldridgefutile: there's a point to each side. Build the data interface for the code to interact with, and the DSL for people to interact with.
14:42futilewait for it...
14:42vijaykirancored: and don't worry too much about the editors
14:43coredvijaykiran: :-)
14:43technomancycored: don't learn a new editor at the same time as learning a new language
14:43cored67 pages clojure made simple :-/
14:44futile*never
14:44technomancy(unless the language is racket)
14:44futile*gonna
14:44vijaykirancored: also practicing on 4clojure.com and looking at how others solved the problems helps too
14:44coredtechnomancy: I want to check racket also :-) the people in the channel told me to use DrRacket
14:44coredvijaykiran: got it
14:44coredwow, never thought this channel would be this friendly
14:44bjacored: I open up a lein repl inside vim using Conque
14:45coventryjustin_smith: No, it's (applying) its arguments to (pr)
14:45coventry,(source pr-str)
14:45clojurebotSource not found\n
14:45vijaykirancored: if you are interested in DrRacket -- book mark this ;) https://www.coursera.org/course/programdesign
14:45bbloomcored: clojure is kinda like the anti-lisp community :-)
14:45coventry(well, source is in clojure.repl)
14:45technomancycored: I think that's the only place where learning a new editor is justified
14:45futile*give
14:45bjaand just use normal vim stuff for moving code back and forth. It's not as fancy as slimv or fireplace's integration, but I also don't have to think about it much
14:45bbloomwe accomplish things and are nice to each other & have a shared vision for computing, rather than sit in our recluse lisp dens
14:45futileman i made a lot of typos in that reply
14:45futile*you
14:46coredI've been hearing some nasty stuff about Clojure community, I felt that all people using Clojure were a bunch of grumpy bearded math wiz's "no offense"
14:46Bronsafutile: i was expecting *up
14:46futile*up
14:46bbloomcored: curious. where did you hear what nasty stuff?
14:46futileBronsa: yep looks like I mistyped that one too
14:46coredbbloom: a couple of friends which were trying to learn it, they told me they asked in some mailing list
14:46futileBronsa: see my message in here about 6 minutes ago
14:46vijaykirancored: Wow .. that's new :) that's exactly opposite to the experience I've
14:47justin_smithcoventry: I know what it does, but I was just suggesting that in that case it is mostly useful for the side effect of forcing the lazy seq (which str will not force)
14:47coredbbloom: I heard Relevance podcast from time to time, one of the people that got interviewed said something similar, not nasty stuff but that Clojure's community wasn't open to beginners
14:47coventryjustin_smith: Oh, of course. Sorry for the misunderstanding.
14:48coredvijaykiran: I saw that course yesterday, but it's says that they will use Python/Javascript
14:48pbostromtbaldridge: thanks, I think I understand, so something like hiccup, where you use data like [:div [:span "foo"]] to describe html, would be a good example of a data interface
14:48coredvijaykiran: I can see the racket logo in the video though, I got myself into the functional programming course with Scala, which is the only thing that I found talking about functional programming in there
14:49justin_smithcoventry: np, I didn't take offense
14:51amalloyjustin_smith: fwiw, (comp str doall) never prints anything different from just str
14:52justin_smithamalloy: oh, I had no idea
14:52justin_smiththanks
14:52amalloy&(str (doall (range 10)))
14:52lazybot⇒ "clojure.lang.LazySeq@9ebadac6"
15:08functionformcored
15:08functionformi can gaurantee i'm not a math wiz :)
15:08futilecored: yeah, I'm just a Ruby programmer, they brought me here to do Clojure against my will, help!
15:09futile:)
15:10riggerfutile: sounds like someone has your best interest at heart
15:10futile:P
15:10riggerhehe
15:10alexebertshi everyone - noobie question: what's the current best practice for personal helper libraries that I want to make available to every clojure project? Are people setting up a local repository and then importing it as a local dependency?
15:10futileI'm getting close to ready to just do a start-up.
15:11futilealexeberts: If they're done right, they're probably good enough to go on clojars
15:11technomancyalexeberts: pull request to useful =)
15:11alexebertsfutile: mine are certainly not ready to put on clojars at this point! :-)
15:12alexebertstechnomancy: where's "useful" hosted? github?
15:12Apage43I just put mine on clojars anyway
15:12technomancyyeah
15:13mabeswhen you need to do blocking io in go-blocks is it better to delegate to `future` w/clojure's unbounded thread pool or async's `thread` which is a fixed cached pool?
15:13alexebertsok, thanks for the suggestions - I'll checkout useful.
15:13Apage430.0.x == I'm messing around here, you *can* use this but don't expect it to be good
15:13coredfutile: hehe, I'm also a Ruby programmer, but curious about programming languages in general
15:13coredfunctionform: at least do you have a beard?
15:13futilecored: then you've come to the right place.
15:14futilecored: because Clojure is "Ruby done right", or "what Ruby was trying to be", or "a better Ruby"
15:14futilecored: basically, 99% of the problems that Ruby was created to solve, Clojure solves and does a better job.
15:14nDuff...?
15:14coredfutile: to be honest I have mixed feelings about Clojure/Scala
15:14coredfutile: before Ruby I did a lot of Java
15:14futilecored: the one problem Ruby solves better is being command-line-friendly
15:15futileAnd Leiningen does some to help this, and possibly helps it fully.
15:15riggereh, jvm startup time for utility scripts is crazy
15:15futileRight on.
15:15coredfutile: well, I normally work as a web developer, I did some command line stuff with Ruby but not big things
15:15futilecored: then Clojure is better than Ruby for what you do :)
15:16futilenDuff: a main goal of both is to increase developer productivity in a predictable way.
15:16technomancyI realized the other day that the thing about the JVM ecosystem is that it's easy to pull in "random java lib for X" as long as X isn't a web-based thing typically
15:16nDufffutile: one could argue that that's the goal of *every* high-level programming language.
15:16technomancyprobably because web-based libs need to make a lot of assumptions about your stack?
15:17futilenDuff: it's explicitly stated though by Matz and Rich, no?
15:17vijaykirantechnomancy: isn't it similar to CPAN :) ?
15:17technomancyanyway, ruby still trounces clojure on "availability of $RANDOM_WEB_TASK" libs
15:17futiletechnomancy: not that they have to but that they thought they had to.
15:17nDufffutile: Can you find a major programming language whose designers *didn't* explicitly state that productivity was a goal?
15:17technomancyfutile: quite
15:17coredfutile: also, it's seems like Scala is getting more attention at least from companies; saw a lot of companies using Scala in the typesafe site
15:17futiletechnomancy: like servlets, that's not strictly necessary right? But many things are built around them.
15:17technomancyvijaykiran: can't say I've had the pleasure
15:18technomancywhere "pleasure" needs quotation marks
15:18nDuffs/programming language/high-level programming language/
15:18yazirianCPAN is a four letter word
15:18bjasmall companies seem to not really care what I write their code with
15:18bjaprovided that the rest of the team can understand it
15:18arcatannDuff: haskell's goals do not include programmer productivity :P (ref: http://www.haskell.org/onlinereport/preface-jfp.html)
15:19nDuffarcatan: I thought I said "major". :)
15:19vijaykirantechnomancy: :) well I'd - but then hanging out on perlmonks trying put of fires on the head
15:19arcatannDuff: :P
15:19nDuffcored: Scala is indeed easier to sell in traditional corporate settings. Not nearly as much as a pleasure to work with, though.
15:20corednDuff: I'm trying to swim in both waters for that same reason, job oportunities and having fun
15:21futilecored: Many companies have moved from C++ to Python, or from Java to Ruby, or from Ruby to Scala. And I think they all do it for the same reason: they were only really competent at language A, found language B, found that it fixes a lot of problems in language A, and jump to it without examining languages C-Z.
15:21nDuffcored: Do you know any LISPs presently? Do you know any functional languages?
15:22futileIt's really hard to see why Dropbox chose Python for instance, over some alternatives, aside from "it's all I know well." Python is probably not the best tool for that job.
15:22corednDuff: I started the programming languages class from coursera, but just learned a bit of SML I had to stop before starting racket, so nope starting at the moment with Clojure
15:22futileAnd honestly, maybe I fall in that category too. Maybe Clojure is far worse than, say, Erlang or Haskell or Elixir for web development, and I just haven't given them a fair look. Who knows?
15:23coredfutile: well I remember what happend to yammer, they went to Scala and I think now they went back to Java
15:23coredfutile: yeap, I heard some comments like that before, like Clojure is not too into web development
15:24futileAnd I bet you heard that from Ruby people?
15:24nDuff*shrug*. Depends; Pedestal, for instance, gives you some capabilities that aren't really available elsewhere at all. It's not the right tool for every project, and grokking it isn't an easy task, but I haven't seen anything of comparable power elsewhere.
15:25futileIt's easy to judge another language without having sufficient knowledge about the given domain to know what trade-offs that domain needs.
15:25nDuffcored: Personally, I'd suggest using Clojure for at least a project or two even if you then go on to Scala. The work you need to do to retrain yourself to think in a functional way will benefit you even if you aren't using Clojure itself later on.
15:25bbloomcored: Clojure's user base is simply broader b/c it helps you tackle problems harder than serving some HTML
15:25futilenDuff: I've had people say that to me about Haskell too.
15:25bbloomcored: quite honestly, nobody has anything as nice as Rails for get-some-CRUD-shit-done-quick
15:26futileAnd I just can't feel comfortable with Haskell because of how strict it is about types. You can't have variadic functions like what's in clojure.core, on account of each one needing to specify the number of arguments.
15:26nDufffutile: Sure. Haskell and Clojure are at different points along the practicality/purity spectrum.
15:26bbloomcored: but quite a few clojure folks would actually recommend Rails for quick little sites & the like, but if you've got a bigger badder tougher problem to solve, you wind up throwing your framework out over time anyway, so the community hasn't really bothered to solve that problem: rails already fills the nitch
15:26futileAnd is that really a good reason to reject Haskell and prefer Clojure? Maybe not. Maybe I'm doing the same thing Rubyists do to avoid looking into Clojure.
15:29futileI can't help but feel like feature-expressions are the downfall of Clojure. They remind me of #if kind of things in C. Makes code extremely ugly just to become portable.
15:29arcatanwhat's feature expression?
15:30nDufffutile: ...well, they don't exist yet anyhow. :)
15:30tbaldridgefutile: and that's exactly why they don't exist yet
15:30futileyeah but they're looming and I haven't heard complaints yet
15:30nDuffarcatan: a proposed compiler macro for allowing code specific to different implementations (or, rather, their features) to exist in the same file.
15:31nDufffutile: there are lots of complaints. Otherwise they'd exist.
15:31nDuff...which is a damned shame, I want them sooner rather than later.
15:31amalloyfutile: incidentally, have you looked at how haskell implements printf? it is pretty ingenious
15:31arcatannDuff: ah, okay
15:31tbaldridgefutile: tons of arguments here: http://dev.clojure.org/display/design/Feature+Expressions
15:31nDuffs/compiler macro/reader macro/
15:32futilePersonally I don't see why Clojure wants to keep embrace-the-platform as a goal. It might have been good for bootstrapping, but if it takes the Ruby approach of add-on extensions, it gets a whole lot simpler, and it hasn't been a problem for Ruby in practice.
15:32coredbbloom: regarding the Rails comment, I said yesterday in here that probably Clojure needs that but somebody said that they don't want a Rails in Clojure
15:32tbaldridgefutile: try writing a language that wraps everything then get back to me
15:32futiletbaldridge: I'm just one person!
15:32tbaldridgefutile: Ruby took about 10 years before anyone used it seriously. Clojure was invented 5 years ago.
15:32futileRich Hickey is like 8 people.
15:33tbaldridgefutile: nah, he just knows how to leverage existing code. If you embrace the platform you can port clojure to a different platform in a matter of months.
15:33futiletbaldridge: that's what I mean by bootstrapping. But if something like this is added in as an opt-in feature right now, we can slowly build it up and migrate to it over time.
15:33bbloomcored: i kinda don't want a Rails in the community either. the ONE TRUE WAY mentality is poisonous
15:33rbxbx(inc bbloom)
15:33lazybot⇒ 14
15:34bbloomi'm totally fine with "THE ONE BEST WAY WE KNOW OF"
15:34futilebbloom: I don't think "the one true way" mentality is bad, as long as it's correct.
15:34bbloomand i'm also fine with "YOUR WAY SEEMS INTERESTING, BUT YOU MUST PROVE IT IS BETTER"
15:34bbloom:-)
15:34futilebbloom: the problem with rails isn't that it's opinionated, it's all the design flaws it has
15:34bbloomfutile: that's like, your opinion, man
15:34rhg135hey, (take-while #(not= -1 %) (repeatedly #(.read in))) is this the ebst way to read an inputstream?
15:34futilebbloom: whereas I'm fine with Ring and Compojure etc. being the One True Way™
15:35nDufffutile: Complecting a lot of unrelated concerns *is* a design flaw
15:35tbaldridgefutile: I'm not, because I can't so async code with ring
15:35bbloomfutile: Skeptical Of Ways That Challenge The Best We Know Now != One True Way
15:35futilenDuff: yes, that's what makes Rails suck
15:35futiletbaldridge: oh
15:35nDufffutile: but it's also the whole point of being opinionated (in a web framework) -- trying to integrate everything tightly.
15:35tbaldridgefutile: hence the reason Pedestal doesn't use ring, but uses a "ring like" interface
15:36bbloomskepticism > scripture
15:36futilenDuff: oh. I've always looked at "opinionated" as meaning "we're going to make a few decisions that simplify things for us and for you, although it reduces a little bit of your flexibility"
15:36futileand where that flexibility doesn't matter, it can be an improvement over existing options that still hold on to it
15:37futilebbloom: sure, except in religion ;)
15:37callenfutile: that's a pretty fair description, but I don't think it's unreasonable to believe that most of the people implementing what they call "opinionated" libraries/frameworks are going too far down that local maxima.
15:37callenand in response, reject that philosophy and try to find a better way to manage complexity, reuse code, etc.
15:37coredoh
15:37coredfind an article
15:37coredlooks like a flame
15:37coredhttp://matt.aimonetti.net/posts/2013/08/27/what-technology-should-my-startup-use/
15:37callentrying to use a Ruby library in pretty much any manner other than was originally intended is a sisphyean effort far too often.
15:37coredthere's a clojure part in there
15:38supersymI don't mind people making my decissions, as long as I agree with them ;)
15:38nDuffcored: if you'd like to see an article from someone whose startup went through Rails and Scala and ended up on a Clojure stack (before a successful exit), there's a recent one of those too. :)
15:38futilecallen: I look at Rails as being "opinionated" in the way I described, but as having the wrong understanding of what does or doesn't matter
15:39callenfutile: the fiddling with coffeescript tells me all I need to know about Rails core.
15:39nDuffcored: ...ahh: http://www.colinsteele.org/post/23103789647/against-the-grain-aws-clojure-startup
15:39futilecallen: Rails core fiddles with CS?
15:39corednDuff: great, thanks
15:39callenfutile: the flipping around of the asset pipeline and frontend defaults.
15:39tbaldridgecored: yes, please read that article. The RoomKey people have done some awesome stuff with Clojure
15:39coredcallen: hello
15:39futileoh
15:39callencored: bye
15:40callenfutile: waste of time.
15:40cored:-(
15:40callencored: what? :(
15:40arcatanrhg135: i guess reading more than one byte at a time would be more efficient, but that's kinda neat
15:40rhg135thx
15:40coredcallen: I'm just saying "hi" and you are already leaving, what a shame
15:40futilecallen: oh, a good example, Rails holds the opinion that it's important to have convention over configuration, but in practice I've found that's unrealistic on larger projects
15:40rhg135the normal way is way too long
15:41bjaplaying with go-loops in cljs browser seems way less dangerous than doing so in a normal clj repl
15:41futilecored: ignore callen he's super rude, and not representative of the rest of Clojure community
15:41nDuff*snerk*
15:41futilecored: it's likely your friends (who did not like the Clojure community) just interacted with callen once or twice.
15:41bjawhenever I mess up my logic, reloading the browser is way faster than killing and reloading my jvm
15:41coredfutile: hehehe, he was quite informative yesterday
15:41dnolenbja: heh
15:41futilecored: not mutually exclusive traits
15:42tbaldridgebja: +1 to that, I actually enjoy writing core.async code in the browser more. Plus "threads" in the browser is just way too much fun.
15:43bjatbaldridge: yeah. it's wild having every UI component in its own little event loop
15:43rhg135now as soon as we have sockets we can forget the jvm
15:43rhg135(mostly)
15:43bjatbaldridge: and keeping the code readable
15:44mabesnevermind my previous question about future and core.async/thread.. I thought the thread pool was fixed like the go block tp
15:45bjaI think the biggest plus for cljs+core.async for me so far is that it lets me largely forget I'm writing a browser app. Outside of the small bit of actual dom manipulation, it's just normal code
15:45mabestbaldridge: what was the motivation behind making the thread pool larger for the go-blocks? https://github.com/clojure/core.async/commit/7b64bd8a22c2b6df69c23dce34eb66d705f5bf1a
15:45bjawhich is handy, as my experience in javascript land has thus far been limited to hacking stuff together just well enough to ship it
15:46tbaldridgemabes: we're trying to strike a balance there, we don't want people to do IO inside a go block, but if they have to we'd don't want it to totally stall out.
15:48mabestbaldridge: async's new thread tp uses an unbounded tp just like clojure's future... why not just use future?
15:49tbaldridgemabes: no technical reason I'm aware of, but the answer might be "why not"?
15:50mabestbaldridge: yeah, it seems like a good idea in case you want to treat it differently. I was just curious if there was another less-apparent reason
15:54mdrogalistbaldridge: take! confuses me a bit. Can you give me an example of draining a channel and getting the elements in a seq?
15:56tbaldridgemdrogalis: https://gist.github.com/halgari/6382422
15:59futileThe past few months, I've been wishing Clojure was written in something like C.
15:59futileI started asking myself why I wish that.
16:00futileAnd mainly because I'd love to use it for embedding into other applications as a scripting language.
16:00futileThe closest I can get to that right now is to compile some CljS, and embed a V8 interpreter that loads it up.
16:01futileMaybe I have too much of a niche need for it to ever make a difference. But I think Clojure as an embedded scripting language (instead of on the JVM) would be great.
16:03TimMcfutile: Well, there are other backends in development by various folks.
16:03nDuff...and very much other LISPs built to be used as embedded extension languages from the ground up.
16:04futilenDuff: any of them with the same built-in immutability and sequence-favoring core lib as Clojure?
16:04futile(and destructuring and rich type-literals syntax)
16:07nathanicfutile: http://www.infoq.com/presentations/clojure-scheme
16:09futileBut is it production-reday? It does not appear so.
16:11nDufffutile: ...well, if you want to work on *making* it production-ready, patches will doubtless be welcome. :)
16:11bjafutile: production-ready is largely a decision to be made by your own team
16:12futilenDuff: as if I'm capable or qualified for that
16:12nDuffWhat better way to get qualified than to try to work on it?
16:12muhooproduction-ready depends on what you mean by production
16:12bjae.g. I'm going to be putting core.async into a production capacity soonish
16:12muhooand what things specifically you need for production.
16:12futilenDuff: many
16:12bjaas I built a dashboarding system using it
16:13bjait's one of those things that, without a large team around it, you just have to decide if you're willing to support it yourself.
16:14futilenDuff: in the same words as that feminist lady on twitter who talked shit about me for no good reason: "I don't owe you an answer to that question! Why you think you have the privilege to demand I give you such answers when you could figure it out yourself is beyond me."
16:14llasram*blink*
16:23tbaldridgewell that killed the room....
16:25amacdougallSpeaking of feminism and open-source contributions*, I found out yesterday how handy Enlive is.
16:25amacdougall*not actually
16:26amacdougallI was trying to get cemerick's Austin CLJS REPL to work, and when the concepts finally clicked, I was able to use Enlive to inject the REPL connect script into my Liberator system.
16:26llasramOOC, anyone know of "computation graph" libraries other than prismatic/plumbing, stuartsierra/flow, and ReadyForZero/babbage ?
16:26amacdougallComing from the larger webdev world, I kept thinking of templating as being this all-consuming thing that dominates your app structure… nope. Clojure philosophy.
16:27amacdougallIt's still crazy being able to drop just a pinch of a library into a working app.
16:28schmirwhy must the function passed to clojure.core/keep be free of side effects? I tried to look at keep's implementation and now my head hurts...
16:30Bronsaschmir: probably because it returns a lazy-seq
16:31llasramschmir: I believe just because it is chunked-seq-aware, and thus may be called for some implementation-defined number of additional values beyond what has been intentionally realized
16:32schmirllasram: being chunked-seq-aware is an optimization?
16:34TimMcAllegedly.
16:35nathanicllasram: re: computation graph libs, perhaps https://github.com/ztellman/lamina ?
16:35schmirok, thanks everyone for the explanation
16:35pjstadigmaybe its ok to have side effects as long as your prepared to have 32 of those side effects happen when you only pull one item off the seq
16:39dnolendoes the expresso maintainer hang out here?
16:40llasramnathanic: Not quite... Well, hmm. Maybe? I hadn't thought about it that way, but maybe lamina and core.async would be so-construed
16:40llasrams,would be,could be,
16:40nathanicllasram: yeah, hence my question mark :-)
16:41ztellmanllasram nathanic: I'd say https://github.com/ztellman/narrator is more like the other libraries
16:43llasramztellman: Cool -- I'd been meaning to take a closer look at narrator
16:43ztellmanstill hasn't been formally released
16:44ztellmanI need to add a few bells and whistles, write some more tests
16:44ztellmanbut you could also look at, say, javelin
16:47llasramHuh, interesting
16:47llasramI've been falling behind in my knowledge of the Clojuresphere!
16:48ztellmandataflow is the proper streaming generalization of prismatic's graph
16:48ztellmanmost of the other stuff is just some special case
16:48ztellmanincluding narrator, lamina, et al
16:51matthavenerwhat does the :shared metadata on a clojure namespace mean?
16:52mdrogalistbaldridge: Thank you!
16:52matthavenerfor example, this namespace: https://github.com/pedestal/app-tutorial/blob/master/tutorial-client/app/src/tutorial_client/behavior.clj
16:52llasramInteresting... I'd been thinking of things in terms of kind of a Makefile-like DAG of computations. I want <x>, so compute the dependencies of <x>. But maybe the other direction is more obvious in cases where you actually need to compute everything
17:02matthavenernevermind, its a special feature of pedestal.app-tools
17:03callencored: oh I was just teasing, but I was in fact leaving for lunch. :)
17:17kyledIs this the right channel to ask clojure script questions?
17:18bbloomyup
17:19kyledat clojurescript.net i am getting "wrong number of args (1) passed to foo at line 1" when running (def foo {:a (fn [] ) :b (fn [] (foo :a))}) 
17:20kyledfurther more, ((foo :b)) returns "#<InternalError: too much recursion> at line 1"
17:20kyledwhy is this?
17:20bbloomkyled: hmmm looks like you found a bug. dnolen?
17:20bbloomkyled: the reason is that you're trying to use foo in the definition of foo
17:21bbloomkyled: that works for functions b/c there is a level of indirection, but in cljs, there are no Var objects, so that indirection doesn't exist
17:21bbloomon clojure (def foo xxx) will create a var called foo, then eval xxx and set the value of foo
17:21bbloomin cljs, (def foo xxx) will evaluate xxx then create a field called foo
17:21bbloomand set foo to xxx
17:22ToxicFrogbbloom: but the only reference to foo is inside the fn, right? So surely it shouldn't be resolved until the function is actually called, by which time foo is already defined.
17:22bbloomToxicFrog: right, but clojurescript has some baked in optimizations for arity dispatch
17:23kyledbbloom: i assume its like trying to "var foo = {a: function() {} , b: foo.a};"..in javascript land it dosen't work obvisouly...not sure if the above is supped to work in clojurescript..i guess it should of because of late evulation?
17:23kyledwell , not "should", but was expecting it to work
17:23Bronsabbloom: ToxicFrog looks like (def foo (fn [] (foo :a))) actually does (def foo (fn foo [] (foo :a)))
17:24dnolenbbloom: only if you turn those optimizations on
17:24dnolenbbloom: or advanced compile
17:24bbloomkyled: yeah that `var foo =` analogy is a good one, but it's a side effect of the cljs implementation. that works on jvm clj
17:24kyledbbloom: ah, i assumed it work work on the jvm =)
17:24kyledhm, well thanks for looking at it
17:25bbloomshould be easy to work around
17:25robinkHow do you select an HTML element that contains another element matching some spec in Laser?
17:25robinki.e. I want child-of that returns the node matched by the first selector, not the last, but returns anything iif all three selectors match (implicit and)
17:25robinksorry, all n selectors
17:25robink(and I only need to use two)
17:26robinkSo I want to match, for example, a <td> element iif it contains a <b> element as a direct descendant.
17:27robinkand I *only* want the <td> (in some cases I don't even need the :content key, but it would be nice to always have it)
17:30dnolenbbloom: kyled: http://dev.clojure.org/jira/browse/CLJS-580, it's a bug around def + fn
17:31bbloomdnolen: yup :-) thx for logging it
17:32ToBeReplacedamalloy: what would you think about breaking up flatland/useful? -- i don't like that "map-keys" involves clojure.tools.macro as a dependency
17:32kyleddnoley: thanks for reporting. First bug in a programming language rather then an application that i found =p haha
17:34ToBeReplacedamalloy: plus it would let those parts evolve independently... for example, i'd be more inclined to make recommendations for "contains-keys?" if there was a dedicated map-utils library people cared about
17:34technomancy[useful-core "1.1.0"]
17:36clojurenewb_hey guys, I've got a list of vectors where the first item in the vector is an #inst, I'd like to filter keeping anything in the last day, how do I do it ?
17:36ToBeReplacedtechnomancy: is that a real thing? or what you'd rather see?
17:37technomancynot a real thing and probably not a great idea
17:37callenToBeReplaced: usually he makes fun of things with 'core' in the name.
17:38callenToBeReplaced: having a "misc" bucket is usually a bad idea.
17:38ToBeReplacedhence breaking it up
17:38callen`cbp: I think you're done: http://hugoduncan.org/post/alembic_reloads_your_project_clj_dependencies/
17:39ToBeReplacedactually, is there a good reason why "contains?" only accepts two arguments? I'd think that (contains? key1 key2 ...) would make sense.
17:40ToBeReplacedi really hate writing (every? #(contains m %) ks)
17:41justin_smithclojurenewb_: ,(filter #(< (- (.getTime (java.util.Date.)) (.getTime (first %))) (* 1000 60 60 24)) [[(java.util.Date.) :data]])
17:41justin_smith,(filter #(< (- (.getTime (java.util.Date.)) (.getTime (first %))) (* 1000 60 60 24)) [[(java.util.Date.) :data]])
17:41clojurebot([#inst "2013-08-29T21:18:33.324-00:00" :data])
17:42hyPiRionToBeReplaced: You want contains? to be vararg?
17:43callenI had a similar reaction ^^
17:43callenToBeReplaced: you know how slow apply is...right?
17:43ToBeReplacedhyPiRion: yes (not necessarily "wants", more like wondering)
17:43hyPiRionToBeReplaced: what would (contains? m) be?
17:43clojurenewb_justin_smith: thanks, I'll give it a go
17:43callenhyPiRion: if this was haskell, a partial function >:)
17:43ToBeReplacedbad number of args exception
17:43hyPiRioncallen: heh
17:44ToBeReplacedyou wouldn't have to use apply to implement it
17:44futileTo shuffle your playlists, iTunes just shuffles the whole thing when it starts, and when it reaches the end and has to start over, it just shuffles it again. And it shuffles when you overflow in the reverse direction too. Which means if you just started the cycle over and hit previous-song, it'll be a brand new song.
17:44justin_smithclojurenewb_: (defn days->ms [days] (* 1000 60 60 24 days)) would make the code more readable
17:44justin_smiththen you could insert (days->ms 1) instead of the inline multiply
17:45futileI think a combination of mapcat, shuffle, and cycle would work better.
17:45holo1hi
17:46futileThen again it's a little foggy on what exactly should happen when you remove a song from a playlist that's already been played.
17:46callenucb: hai
17:46futileClojure has corrupted my thinking.
17:46callenhyPiRion: I am envious at times of the automatic partial application.
17:47ucbcallen: haibak
17:47hyPiRioncallen: Yeah, one of the "issues" with clojure is that identity and partial are too verbose
17:48ToBeReplaced(defn contains2? "contains? with varargs" ([coll key] (. clojure.lang.RT (contains coll key))) ([coll key & more] (every? #(contains? coll %) (cons key more))))
17:48hyPiRionI wouldn't mind explicit partial application if it was shorter
17:49ToBeReplacedno apply, only works with 2+ args, returns true if (get coll k) works for all k in ks
17:49futilehyPiRion: like #() ?
17:49hyPiRionfutile: no, that's not partial application sadly
17:49futilehyPiRion: is (partial ...)?
17:50callenhyPiRion: verbose and in the latter case, slow.
17:50hyPiRionfutile: yes. See the difference when doing (let [f (partial max-key identity)] (f 1 2 3) (f 4 2) (f 5))
17:50callenhyPiRion: I need a macro that rewrites fn and defn in terms of partial closures.
17:50holohow to convert from "[a-z]" into #"[a-z]" ?
17:50futilehyPiRion: that just need %& right?
17:51metellusholo: re-pattern
17:51hyPiRionfutile: no
17:51futileoh
17:51futilewell ok then
17:51hyPiRionThen you'd have to add in apply too
17:51hyPiRionand then suddently partial is shorter again
17:51futileahh
17:51Bronsajust (def p partial) and you're good to go :P
17:52holo(inc metellus)
17:52lazybot⇒ 4
17:53metellusholo: also if you're doing any escaping, you need to double-escape
17:53metellusex. (re-pattern "\\d") becomes #"\d"
17:53futile(inc Bronsa)
17:53lazybot⇒ 9
17:53futile$karma futile
17:53lazybotfutile has karma 2.
17:54futileyay ive helped 2 people
17:54holometellus, thanks
17:54hyPiRionBronsa: Hm, I'm tempted to make a library containing two functions: `p` and `id`. Guess what they do
17:55BronsahyPiRion: you'd already have a user.
17:56hyPiRionI'll call the library "p-and-id", then you can (:use p-and-id)
17:56futilehyPiRion: what would id do?
17:56futileoh
17:56BronsahyPiRion: I currently cheat a bit and let emacs display "partial" as "Ƥ" and "comp" as "·"
17:57futilei tried that and it got so annoying i had to remove it
17:57hyPiRionBronsa: Oh, that's smart. I just convert fn to lambda.
17:57Bronsalet me figure out a good greek letter for identity
17:57BronsahyPiRion: that too
17:58Bronsaalso "contains?" to "∈", "nil" to "∅" and a few others
17:58Bronsasaves some space and looks better
17:59brehautBronsa: how do you set those up? I want to do stuff like that for core.typed
18:00bbloom*cringe*
18:00hyPiRionBronsa: I wouldn't be surprised if you display "not=" as "≠", "<=" as "≤", "Math/sqrt" as "√", "every?" as "∀" and "some" as "∃"
18:00Bronsabrehaut: disclaimer: it's ugly and I don't know any elisp but: https://github.com/Bronsa/.emacs.d/blob/master/config/hooks.el#L32
18:00BronsahyPiRion: some of those.
18:01brehautBronsa: i can handle ugly. i dont know elisp either
18:01callenBronsa: standard font lock stuff.
18:01hyPiRionBronsa: Obviously you'd have 1500 lines of code to convert core.typed to formal math definitions.
18:02bbloomi understand that mathematical notation is nice and terse … but let's all remember that it was designed by people who had to write it by hand on paper....
18:02bbloom:-)
18:02callenbbloom: haskellers are far worse about it.
18:03brehautbbloom: thats the wonder of views, we can both have it our own ways
18:04Bronsabbloom: i still write "not=", i just find it faster/easier/prettier to read it as "≠" for instance
18:04ToBeReplacedBronsa: how does that affect things like indent-region?
18:05BronsaToBeReplaced: it messes it up unfortunately.
18:06hiredmanBronsa: you should pull that out in to a minor mode
18:06Bronsahiredman: so i can disable&reindent?
18:07hiredmanyeah
18:07Bronsayeah, I'll probably do that, thanks
18:08hiredmanI'll steal your gist as payment
18:09ToBeReplacedBronsa: that would make me use it -- i'd setup a hook to run an indentation function on toggle -- i use prelude, so for me prelude-indent-region-or-buffer
18:10Bronsahiredman: ToBeReplaced I'll have it done by tomorrow, I'm going to bed now
18:10brehautBronsa: awesome
18:11hyPiRionEmacs, turning your favourite language into APL since 1976
18:13brehauthyPiRion: and for extra fun, turning APL into your favorite programming language
18:13hyPiRionBetter start making that APL->Clojure translator then
18:17kmicuhttps://github.com/drothlis/pretty-symbols
18:17kmicuhttps://github.com/hackscience/purty-mode
18:18kmicuAnd of course http://www.emacswiki.org/emacs/PrettySymbol
18:20hyPiRionI need one of those for latex mode
18:21hyPiRionpurty-mode is close on that.
18:24kmicuIt looks cool, but it can be a pain for haskell indentations modes ;]
18:25futilehas Clojure been ported to Erlang's VM yet?
18:32Raynesfutile: Joxa is reasonable.
18:32RaynesNot Clojure though.
18:32futileneat
18:34futilehttp://docs.joxa.org/en/latest/quick-start.html :)
18:35srrubyHow do I get pprint to print new lines rather than \n\n ?
18:37amalloythe printer wouldn't be very pretty if random newlines in your strings misaligned everything
18:41callenRaynes: at least with Joxa you get TCO, lol.
18:42RaynesOooh, sick burn callen. Sick burn.
18:43cgagwhat do we miss out on having to use recur vs having real TCO?
18:44`cbpwriting code like schemers
18:45cgagis it just the elegance of actually reusing hte function name or are there bigger issues?
18:46technomancyall non-recursive tail-calls are marginally more efficient
18:47ozzloyi'm trying to convert lines 11 through 17 to more idiomatic clojure and failing. is there a way i can put the imports into the ns form with :import ?
18:47ozzloyhttp://goo.gl/ZIST9y here
18:48ozzloyshort of having a (:import ...) for every. single. class... i really like the shorthand notation afforded by the (import ..) form
18:49AimHereSomething like (ns <wibble> (:import [foo.bar baz.Wibble fred.Barney stadtler.Waldorf] [pugh.pugh barney.Mcgrew])) works for me
18:50AimHereBasically a bunch of vectors of the form [prefix suffix1 suffix2 etc] for each class denoted by prefix.suffix
18:51ozzloycool. i'll give that a shot. can i nest those?
18:51AimHereI don't know, offhand. Never tried!
18:52AimHereIt still cuts down on your typing even without nesting
18:52technomancynesting works but messes with your ability to grep; not recommended
18:52ozzloylike a.b.c a.b.d a.e.f imported by (import [a [b c d] e.f])
18:52ozzloyo ok
18:52AimHereClojure is too powerful for our own good
18:53`cbpozzloy maybe you're forgetting to remove the quotes?
18:57callenAimHere: maybe for you.
18:57callenAimHere: I could do with some more power.
18:58callentechnomancy: oh, btw, I used robert.hooke to great effect recently. Why didn't you mention it when I was having trouble?
18:58ozzloy`cbp, nah, just didn't know it needed to be a vector
19:00ozzloyi'm in the process of making that more idiomatic to clojure, let me know if you have suggestions. i'm new to clojure, so i wouldn't be surprised if there were lots
19:00AimHereI think other collections work, but vector is my default collection when I don't know any better!
19:03`cbpozzloy: it doesnt need a vector though
19:03cgagthose chains of java calls could probably be one with ->, or maybe it has to be doto since it's interop stuff
19:19ozzloytechnomancy, i know you said not to, but i wanted to try it and see. i get a compile error though https://www.refheap.com/18163 what's the right syntax? my googling shows nothing
19:20ozzloyAimHere, cgag, thanks for looking!
19:22`cbpdamn it! no websockets on ios safari ;_;
19:25callen`cbp: welcome to the jungle. You might consider Google's BrowserChannel - which works in CLJS too.
19:27ozzloyhttp://clojuredocs.org/clojure_core/clojure.core/doto in the first example, the comment says "doto still returns the date object". what date object?
19:27ozzloymaybe that's a holdover from a prior example?
19:27hyPiRionozzloy: they mean the hashmap
19:28ozzloycool, thought so
19:40ozzloyfixed it. that's ok, right?
19:41ozzloyalso, is it the case that there is no doc source code repo somewhere with pull requests and stuff?
19:42ozzloyor maybe this webterface is backed by something like that?
19:49pandeirohow can i tell which port an nrepl server is listening in (i started it with nrepl-jack-in from emacs)?
19:50technomancypandeiro: cat target/repl-port
19:50llasramozzloy: IIRC, the current clojuredocs.org is backed by a Rails application nobody wants to deal with, but an in-Clojure replacement is in the works. I believe by some of the ClojureWerkz people?
19:50callenllasram: the CLJWRKZ thing has been long coming and doesn't seem to be materializing.
19:50callenllasram: I am probably going to proceed with the wiki so that an alternative is out there.
19:51callenI'm really...really tired of using clojuredocs.
19:52technomancydoes the in-repl clojuredocs client work?
19:52pandeirotechnomancy: no such file in the project directory
19:52technomancypandeiro: either you need to update lein or you don't have a repl running
19:53technomancy(or you started another repl and exited it, which overwrote the first repl's state)
19:53pandeiro2.3.1?
19:53technomancyyeah, you want 2.3.2
19:53technomancythat version has zarro boogs
19:53pandeiroman i gotta get with the times
19:53pandeiro:)
19:54callentechnomancy: ...the what?
19:54callenhow do I never know of these things ;_;
19:55technomancyoh... it might have been dropped from the default lein repl due to a preponderance of apache httpcilent conflicts
19:55technomancyhttps://github.com/dakrone/clojuredocs-client <- put this in your user profile or something
19:56technomancy(never used it myself)
19:56pandeirotechnomancy: the *nrepl-server* buffer had the info btw, dunno why i didn't look there first
19:56callentechnomancy: I'd rather allocate the time to the wiki.
19:56callentechnomancy: but thanks for mentioning it, I'll keep it in mind in case anybody asks.
19:57technomancycallen: just curious if it works actually
19:57technomancyI personally don't understand why people like to look that kind of stuff up in a browser
19:58callenWhat I have in mind for a wiki is a bit more expansive than an alternative to (doc ...)
19:58callenand would entail reading content longer than a function signature.
19:58technomancyI thought the point of clojuredocs was user-submitted examples
19:58technomancy(says the guy who has never used it)
19:59callentechnomancy: the point of a wiki is to make contribution straightforward and pain-free.
19:59callentechnomancy: so user submitted examples are part of it.
20:00technomancydo people actually use clojuredocs just for docstring lookup?
20:00callentechnomancy: some do.
20:00callenbut stuff closer to EmacsWiki and c2 is also what I have in mind for the wiki.
20:00technomancythe young people these days
20:00technomancyI do not understand them
20:00technomancywhat with their rock music, their long hair, and their dope
20:01callenmy repl suffices for docstrings, but I'll use clojuredocs for idioms/examples sometimes.
20:01callenbut I'd really like longer form discussion.
20:01callenwhen it makes sense.
20:01callenin particular for things like atoms.
20:01callenor binding.
20:02pandeirohm, can i make a have an nrepl server not bind to just one specific address?
20:04llasrampandeiro: You mean like bind to 0.0.0.0 ?
20:04callenllasram: he might mean ports.
20:05pandeirollasram: yeah so i could do something like lein repl :host 0.0.0.0 :port 8765 ?
20:05pandeirough no :host, thought i had read that
20:06llasrampandeiro: You can specify it in your project-map :repl-options
20:06pandeiroah ok that's good to know
20:06pandeirobut what i needed was :start i think
20:07llasramAh, cool
20:08pandeiro0.0.0.0 means any host, eg both 127.0.0.1 and 192.168.x.x ?
20:08llasrampandeiro: Yes. It means all available host addresses
20:09llasram(for binding purposes, specifically, that is)
20:09pandeirohuh, still refusing connections
20:10ozzloywhat's the rationale behind not having multi-line comments? (comment ...) doesn't count
20:11llasramozzloy: What would be the rationale behind having them? I'd say the trend is against
20:11ddellacostaozzloy: ,(comment you can it with this)
20:11ddellacosta,(comment test test test)
20:11clojurebotnil
20:11ddellacostawell, should have expected that I suppose
20:12ozzloyllasram,
20:12ozzloyer...
20:12ddellacostaoh, sorry, I saw you said that doesn't count, my bad
20:12llasrampandeiro: Works for me. Hmm. What OS are you running?
20:12ozzloyhttp://goo.gl/ZIST9y so at the beginning of this document i wanted multiline comments
20:12callenozzloy: that doesn't make any sense. Why doesn't (comment ...) count?
20:13llasrampandeiro: (not that this would matter for working, but affects my ability to troubleshoot :-) )
20:13callenozzloy: (comment ...), single line comments, and docstrings all solve different problems.
20:13ozzloyddellacosta, i know about (comment ...) but that requires well formed expressions, so the & messed it up
20:13ozzloyand :
20:13callenozzloy: the general philosophy in Clojure is to make something solve one problem.
20:13pandeirollasram: nvm, just got it
20:13callenor as Halloway calls it in cult-speak, "simples"
20:14llasrampandeiro: Awesome
20:14hyPiRionThe comment macro won't stop the reader from crashing
20:14Steve973wow, there are a lot of people in here!
20:14ozzloycallen, ok, the problem i'm having is that i have multiple lines of text and i'd like to put them in the code as a comment without worrying about if they're well formed s-expressions
20:14hyPiRion,(comment 5-/12 <- won't work)
20:14clojurebot#<NumberFormatException java.lang.NumberFormatException: Invalid number: 5-/12>
20:14ozzloyis there one thing that solves that problem
20:15ozzloyseems like "no"
20:15callenozzloy: make a big string.
20:15llasramozzloy: Ok, then just make each line a comment, like you've done, right? I'm not sure what an explicit multiline comment gets you outside of the ability to forget to terminate it
20:15callen," (broke ass code lel "
20:15clojurebot" (broke ass code lel "
20:15callenozzloy: also use a real text editor that lets you comment blocks of code at a time.
20:16ozzloyyeah, that's what i ended up doing
20:16callenthen single line vs. multi-line is a meaningless distinction.
20:16ddellacostayeah, I solve it my tying a key command to comments, easy-peasy
20:16callen`C-c c m` for me.
20:16hyPiRionUsually, if I need to write prose inside the codeblock, it seems more sensible to put it outside of the codebase and into documentation
20:16ozzloycallen, M-; already does it
20:16ddellacosta!
20:16ozzloyer... assuming emacs
20:17callenozzloy: old weird habits, don't ask.
20:17ddellacostaozzloy: it does. Didn't know that, hot damn. And I went through all that work…well, 30 seconds of work
20:17callenand yes, it's Emacs.
20:18llasram"I can't believe it's Emacs!"
20:18callenddellacosta: "Emacs: we've already got it"
20:18callen"It's too late, we've seen everything."
20:18hyPiRionC-x r t ;; RET also works, and is a bit more, hm, flexible in cases
20:18ddellacostacallen: seriously. I need to read the docs more, rather than open up .emacs I suppose
20:18callenddellacosta: probably yes.
20:18callenddellacosta: let me know if you end up using blackwater btw.
20:19llasram"I'm taking the Emacs challenge, and have replaced my wife's regular text editor with Emacs. Let's see if she notices!"
20:19ddellacostacallen: oh, yeah, will do, but probably won't be any time in the next week or so. Lotsa front-endy kinda fiddling ta do.
20:19ozzloycallen, man, that was the first time i'd seen patrick stewart do something funny. i laughed for quite a while
20:19ddellacostallasram: *snort*
20:20callenddellacosta: sure sure. I just like seeing the queries stream past in my terminal. :)
20:20callen(and the times, so I know when to add an index)
20:20ddellacostahaha, gotcha.
20:21callenozzloy: Patrick Stewart is great. You should follow his twitter.
20:21callenalso if I didn't have Nose integrated into my Emacs, I would go mad.
20:21callenthis Python code is like following a mangled ball of yarn a kitten attacked.
20:22brehautcallen: explicit is better than implicit, but we dont like functional ideas
20:23callenbrehaut: apparently implicit is okay if you slap a Class on it or it's mutation inside a method.
20:23callenbrehaut: too bad Guido is an ignoramus.
20:23brehautcallen: but reduce just makes ugly code or is used to write sum, and we already have sum!!
20:23callenbrehaut: derpiest shit I'd ever heard from a language designer.
20:23pandeirook so if lein repl :headless is called, the host defaults to "127.0.0.1", but in lein's sample.project.clj under [:repl-options :host], it shows "0.0.0.0" - is that not the default value?
20:23callenEven the Golang people are savvier than that.
20:23brehautsome wise guy sent him SICP in the mail :P
20:24callenbrehaut: if he's too lazy to have tried to learn anything from other languages by now, he won't change from having a book sent.
20:24hyPiRionPython: We don't have TCO because recursion is bad.
20:24brehautcallen: theres quite a lot of savvy in the go people. they arent solving problems i care about, or producing a language im interested in, but i think they are doing interesting things
20:24brehautcallen: indeed. he just tweeted grumpily about it
20:25callenGolang is awfully weak and imperative though.
20:25technomancypandeiro: sample.project.clj isn't about defaults
20:25callenYuck.
20:25callenbrehaut: I'm fighting a Django app with class-based views. It's like somebody was intentionally trying to write Ravioli code.
20:25hyPiRioncallen: weak as in?
20:25callenbrehaut: http://c2.com/cgi/wiki?RavioliCode
20:25brehautcallen: i want to take an axe to django class based views every time i use them. also the way they do views in general
20:25callenhyPiRion: weak in terms of semantic power and type system.
20:26pandeirotechnomancy: yeah i read that into it i guess; so the default with lein repl :headless is 127.0.0.1 i assume?
20:26hyPiRioncallen: hah, agreed
20:26callenhyPiRion: the bullshit interface type casting to work around the useless type system makes it less safe than most dynamic/strong type systems.
20:26callenridiculous.
20:26technomancypandeiro: yeah, defaulting to 0.0.0.0 would be disastrous
20:26pandeirosure, ok
20:26callenbrehaut: I can at least work with FBVs, but CBVs make me want to commit murder.
20:26pandeirotechnomancy: it would probably increase repl usage however
20:26callenbrehaut: I would seriously be bereft if I didn't have smart IDE functionality in my Emacs.
20:27brehautcallen: haha :(
20:27callen"Welcome to Ravioli code, where you need 10 buffers open to know what one endpoint is doing"
20:28brehautcallen: https://gist.github.com/brehaut/6384870
20:28brehauti use the hell out of that
20:28brehautcallen: its adapted from steve losh's django annoying
20:29callenbrehaut: out of spite I use FBVs even in apps that use CBVs. Just to poke them in the fucking eye.
20:29brehautcallen: haha likewise. i never use CBVs by choice
20:29ddellacostawhy is there Python popping popping up on #clojure, ya'll trying to make me cry
20:29hyPiRioncallen: the worst is probably the fact that if a struct Foo implements interface Bar, then I can return Foo whenever I expect a Bar. But a func() Foo is obviously not a func() Bar, which makes me wrap the code like this: func() Bar { return originalFunc() }
20:29ddellacostaI typed popping twice, probably Freudian slip somehow
20:30hyPiRionWell, except for the generics part.
20:30callenhyPiRion: I'm not convinced they knew what covariance and contravariance was when they built the language.
20:30ozzloyhttps://www.refheap.com/18164 is this acceptable, or would you break lines 2-4 into one line for each form?
20:31callenddellacosta: sorry, just bitching about the 9-5 ick.
20:31callenddellacosta: interacting with Django class-based views makes me really irritable.
20:31ddellacostacallen: oh, I don't really mind. Just wanted to make a snarky comment about Python. Also, https://twitter.com/gvanrossum/status/352085842140991489
20:31hyPiRioncallen: I'm not convinced they know much about types in general, really.
20:32hiredmanthe lack of dynamic code loading is annoying
20:32callenddellacosta: oh fuck him. he made a language halfway to Lisp from Java.
20:32callenddellacosta: and Java was halfway to Lisp from C.
20:32technomancyhiredman: "please don't do anything interesting with our runtime; kthxbai"
20:32callenthey're all just Zeno's paradoxing their way to Lisp.
20:32hiredman:)
20:33ddellacostacallen: I have SO much I could say but I will leave it off. ;-)
20:33ddellacostaalso, note what that tweet was a response to.
20:33callenddellacosta: well now I'm curious. privchat it if you must.
20:34callenddellacosta: I noticed. He's forever and always lazy.
20:35ddellacostacallen: I will say only this, a programming language should not come with a sheet of commandments that acolytes can point to whenever you do something their little minds don't approve of with their precious holy language. NOT THAT I'VE HAD BAD EXPERIENCES WORKING WITH PYTHON DEVS OR ANYTHING
20:35technomancyum
20:35technomancy,(doc contains?)
20:35clojurebot"([coll key]); Returns true if key is present in the given collection, otherwise returns false. Note that for numerically indexed collections like vectors and Java arrays, this tests if the numeric key is within the range of indexes. 'contains?' operates constant or logarithmic time; it will not perform a linear search for a value. See also 'some'."
20:35ddellacostasorry, that was over the top. Apologies, #clojure
20:36ddellacostaanyways, back to CLJS
20:36callenddellacosta: lol. it's okay. I know how you feel.
20:36gdevI'm glad Rich took the opposite approach of Guido and said, here's macros add whatever you want
20:36ddellacostaI mean, there are community themes in Clojure so to speak, don't get me wrong.
20:37callengdev: ish? we're more conservative than Common Lispers are.
20:37ddellacostabut, number one seems to be, "think about it"
20:37ddellacostacallen: I'm sure you're right, I don't know much about CL community. Although I think the Steve Yegge post from a year or so ago about that was really off-base.
20:37hyPiRionWe're super conservative, just ask Steve Yegge.
20:38hyPiRionoh, ddellacosta beat me to it.
20:38callenddellacosta: I'm speaking from experience, not Yegge.
20:38ddellacostacallen: yah, I can't speak to that, like I said don't know CL community.
20:38gdevcallen, how liberal are CLispers?
20:38ddellacostamaybe a little conservatism is good when you are building shit for people to use. Dunno (seriously)
20:39callenddellacosta: prolly.
20:39callengdev: depends on the individual, but generally - very.
20:39callengdev: that's why I'm ruthless about doing whatever I want in Clojure. I tip-toe'd more in CL.
20:39hyPiRioncallen: the problem is that you're attaching the labels "conservative" and "liberal" as if those are the only datapoints you can measure languages and communities with. It's very, very dangerous to say "oh, we can place languages on a line and get 100% information out of it"
20:40callenhyPiRion: no I'm not.
20:40callenIt's just one of many descriptors.
20:40hyPiRion*is that if
20:40callenCL is more liberal as a community. I'm not describing anything but that particular axis.
20:40ddellacostaI kind of agree with hyPiRion and now see that hyPiRion and callen don't really seem to be disagreeing.
20:40callenI would describe Haskell as being more liberal culturally than Clojure as well.
20:41ozzloyvigorous agreement all around
20:41callenbecause they spend as much time exploring *how* to program in new and otherwise unheard of ways than actually programming.
20:41ddellacostaheh
20:41hyPiRionI have problems understanding what a liberal and a conservative language is
20:41gdevme too
20:41ozzloyi was vigorously agreeing with someone in here yesterday
20:41hyPiRionIt's much more than just "oh, we won't implement this feature" and "oh, we'll implement ALL the features!"
20:42ddellacostacallen: again, aren't we talking about meaning of liberal/conservative? That was the biggest irritation I had about that Yegge article. It was so damn prescriptive. Conservative thinking, if you will
20:42ddellacostayeah, what hyPiRion sez
20:42callenhyPiRion: I'm speaking to a variety of factors
20:42callensuch as the average risk tolerance of a user in the community
20:43callenthe willingness/proclivity to explore, hack, fuck with the implementation itself
20:43callenbend/break the implementation to match desired semantics
20:43callenpracticality of how the language is used
20:43technomancyI'd place CL as more of an anarchist/survivalist community
20:43callendegree to which the language represents the bleeding edge.
20:43gdevI was just describing how Guido is a BDFL and Java has that whole JSR process...we have macros and extendtype
20:43technomancylimiting the power of the programmer is the one unforgivable sin
20:43ddellacostaI don't think that is an unreasonable definition
20:43callentechnomancy: sounds about right.
20:43ddellacostatechnomancy: interesting framing.
20:43technomancymeanwhile you have all these isolated individuals trying really hard to build their own utopia
20:43callenso when I say CL is more liberal than Clojure, I'm accounting for everything I just said.
20:44callentechnomancy: hahahaha. so true.
20:44technomancy*cough*axisofeval*cough
20:44ddellacostacallen: alright, that + technomancy's description make it easier to grasp.
20:44callentechnomancy: "IN MY DOMAIN, WE SHALL HAVE LAZY SEMANTICS!"
20:44ddellacostahaha
20:44hyPiRion"Look at this beatiful type system I build on top of CLOS"
20:44gdevyou're complecting my mellow man
20:47callenChoice quote from Axis of Eval, "I enjoyed meeting Pascal Costanza and Charlotte Herzeel. Pascal shares my disdain for the aberration that is Lisp-1 and doesn't tire of telling Schemers so."
20:47callenlol, k
20:49gdevin other news at our joy of clojure book club we try some 4clojure problems. "Gary what did I do wrong?" (fn [x] str("Hello, " x "!")) "...put that function *inside* the parens" "omg it works!" *tear* it's so beautiful
20:50technomancy"Sorry, I can't hear you over the sound of how awesome having to keep functions in a separate namespace from all other values is."
20:51hyPiRionThose enlightening moments are very dangerous. It's like "Oh, this is so amazing! I can use this for everything!", and you're in this euphoria where you actually do use it for everything.
20:51ddellacostaWoah, Axis of Eval is a thing
20:52ddellacostaso, the thing is, criticizing other ways of doing things in that fashion is rather conservative, IMHO
20:53callendnolen: bad news, Common Lispers beat you guys to the whole async thing: http://axisofeval.blogspot.com/2013/05/green-threads-in-browser-in-20-lines-of.html
20:53ddellacostaalthough, they mention Perl in the next post, so maybe it's just bad first impressions
20:53callenddellacosta: it's not conservative or liberal to hate other things, just narrow.
20:54dnolencallen: heh, an abomination
20:54callenI see both types criticizing other languages.
20:54callendnolen: that's everything that comes out of CL though.
20:54ddellacostacallen: fair enough!
20:54ddellacostais that Wat thing like Lisp but with arrays + strings? wacky
20:54callenliberal CLers will complain about not having eval, conservative Java ERP coders will complain about...I'm not really sure what they complain about. I'm not sure they even know what they're missing out on.
20:55riggerhahaa
20:55dnolenddellacosta: Manuel Simoni is a funny a guy, I differ with most of his opinions.
20:56dnolenthis is a pretty awesome tumblr though, http://this-plt-life.tumblr.com
20:56callentime to commit some mutable evil with a setInterval.
20:56ddellacostadnolen: I figured you would be aware of his work…seems like he's got a crazy approach though. But don't know enough about his work yet
20:56ddellacostadnolen: oh, I love that tumblr!
20:56dnolenddellacosta: I don't like his work at all
20:56dnolenddellacosta: I appreciate his sense of humor is about it
20:57hyPiRionhttp://thisotplife.tumblr.com/ is also good
20:57ddellacostadnolen: Love this one: http://this-plt-life.tumblr.com/post/55420560033/when-somebody-offers-me-promises-as-a-replacement-for
20:57dnolenddellacosta: haha yeah that's a good one
21:00callenhyPiRion: the "string or list of integers?" speaks to me.
21:01callenhyPiRion: speaks to pain...and lost sanity...and cursing myself for not learning to speak Dialyzer.
21:02ddellacostacemerick: I would like to help with lein-cljsbuild, btw, let me know if you want to throw anything at me. One big thing I really want is being able to easily specific build profiles when testing...
21:02callenddellacosta: I think cemerick merged a really old PR or something I had for cljsbuild. He might be in the mood for contributions.
21:02callenlike...last night.
21:03hyPiRioncallen: yeah, Dialyzer is one of the things you should understand after you've grokked OTP
21:03ddellacostacallen: yah, I should put my money where my mouth is and just start tweaking shit and sending PRs
21:03hyPiRionalso http://thisotplife.tumblr.com/post/52897638378/when-you-went-full-speed-ahead-with-iso-latin-1-encoded
21:03cemerickddellacosta: Noted, thanks. Though, it's going to be more of careful pruning and triage for a while, at least until a 1.0.0 is out.
21:04cemerickddellacosta: but, can't you use lein profiles for particular cljsbuild configs/profiles?
21:04callenhyPiRion: that OTP life tumblr is AMAZING
21:04ddellacostacemerick: okay, that makes sense. re build profiles--not while testing, not last time I checked. I end up commenting out build profiles in project.clj (uber-yuck)
21:04callenddellacosta: I just break shit. works great for me.
21:04ddellacostacemerick: at least, with testing using lein cljsbuild test
21:05callenddellacosta: when you've broken something, you feel obligated to fix it. then you do. now you've contributed.
21:05cemerickddellacosta: If that's still the case, then something's badly broken. File an issue, if you can put together a reproducable project.clj that exhibits the behaviour.
21:05ddellacostacallen: haha, yeah
21:05ddellacostacemerick: okay, let me make sure I'm not crazy…could be running something outdated.
21:06ddellacostacemerick: will need to put together an example project that shows the behavior too
21:07ddellacostaer, like you said. really need more coffee
21:10brainproxyOH: "pretty much the only thing you can't do in Emacs is go to the bathroom..."
21:11gdevbrainproxy, M-x port-o-potty
21:12gdevit searches the file system and opens the first java file it finds for you to pewp on
21:12dnolenlove that core.async, http://gist.github.com/swannodette/6385166
21:22ddellacostadnolen: nice. About to integrate core.async with a production app shortly
21:23dnolenddellacosta: cool! I think this pattern could be much improved ... thinking ...
21:26ddellacostadnolen: would be nice to be able to pass a channel to the task, methinks
21:27dnolenddellacosta: yes ... but also I think you want a more flexible relationship between supervisor and the task ... current task is an opaque fn
21:27dnolens/current/currently
21:31bbloomdnolen: https://news.ycombinator.com/item?id=6297680 <-- i got your back :-)
21:32dnolenbbloom: hehe nice
21:44xeqiddellacosta: have you had any luck w/ an improved cljs workflow?
21:45dnolengetting warmer - http://gist.github.com/swannodette/6385166
21:45ddellacostaxeqi: unfortunately, I haven't had time to refine it yet…but probably will dig into it further today. Thank you for asking! I have to get into the flow with emacs + cljs.
21:53robinkIs there way to get the immediate parent of a node in Laser?
22:14callengdev: M-x port [No match]
22:14callengdev: you're a liar :(
22:15callenwell, at least M-x butterfly works.
22:17`cbpsuccessfully flipped one bit!
22:20brehaut`cbp: black triangle achieved!
22:27callenThe deep deep evil I commit in the name of capricious decisions...
22:40gdevcallen, are you using Emacs Live from the Muddy Banks of the Wishkah configuration?
22:50callengdev: I use a custom setup.
22:52gdevthen just add port-o-potty.el to it
22:52callengdev: I'd been using artisanal Emacs for years. I didn't even start using package management until recently because clojure-mode and nrepl were getting updated too frequently.
22:52callengdev: I don't like junking up github.com/bitemyapp/dotfiles :|
22:54gdevcallen, you calling my port-o-potty junk?
23:44futilewat
23:46futileI think rewriting things from scratch isn't given enough credit as a viable solution.
23:47futileSometimes a specific need can only be met perfectly when it's engineered from top to bottom.
23:48futileBut everyone seems to say "No don't do that, that's crazy! Just take the existing solution and tweak it to fit your need."
23:48futileBut it seems like I'm the only one who sees it this way.
23:49futile... which gives me a huge advantage.