#clojure logs

2013-10-26

00:33akurilinMan, macros do not give you a nice exception when something goes wrong in there.
00:34akurilinYou just get the line where the macro is invoked and good luck after that.
00:34akurilinAm I missing some trick here to get a more accurate stack trace?
00:42bitemyappakurilin: writing macros that fail gracefully is an ancient artform handed down from the LISPers of yore to the Common Lisp community
00:43bitemyappakurilin: it is deep and ancient knowledge largely forgotten by the functional programming community.
00:44akurilinbitemyapp, so not something I'd be able to dig up online specifically for the Clojure context?
00:44bitemyappthere's definitely a ton of resources on macros in Clojure, but it's not really something people take seriously for trying to make them compose or fail gracefully
00:44bitemyappmacros in Clojure are supposed to be the VERY simple final cherry on top. - that's it.
00:45bitemyappfunction composition is better.
00:45bitemyappwe don't have funcall here, we don't need macros so much.
00:46akurilinI can definitely see why you'd want them to be as thin as possible.
00:46bitemyappthere are tomes of macronic knowledge out there. You're better served in the short and long term by becoming comfortable with HOF.
00:48noonianbitemyapp: HOF?
00:48seangrovehof?
00:48seangroveDamnit clojurebot...
00:48bitemyapphigher order functions
00:48noonianah
00:49seangroveclojurebot: HOF is Higher order functions
00:49clojurebotYou don't have to tell me twice.
00:49seangrovehof?
00:49seangroveHOF?
00:49clojurebotHOF is Higher-Order Function
00:49ddellacostahaha
00:51bitemyappseangrove: maybe. I am multitasking answering questions with StarCraft 2
00:51bitemyappmy APM is insane right now
00:51coventryakurilin: What exception are you getting?
00:51seangrovebitemyapp: Sure, rub it in.
00:52ddellacostahmm, none of you have set up init scripts for java (a.k.a. clojure web app) on Gentoo, have you?
00:52bitemyappddellacosta: only upstart, sorry.
00:52bitemyappnot insane enough to go for full RICE MODE
00:53bitemyappI have some nice tooling for provisioning clojure servers in pythno though
00:53ddellacostabitemyapp: yeah, I guess I should have not picked a gentoo build on ye ole' rackspace account
00:53ddellacostahabit mostly
00:53coventryakurilin: It's not that magical. Compiler.java has a few places where an exception raised in a macro is thrown away for some reason. E.g. http://dev.clojure.org/jira/browse/CLJ-1279
00:53bitemyappddellacosta: the best choices are questionable ones.
00:53akurilincoventry, I wrote a macro to wrap a random sql call into a handler + make sure the return value would be in an error-monad style vec. I had missed catching one of the two expected types of exceptions, so I was getting a generic null ref exception somewhere in that blob
00:53akurilinwith no obvious way of figuring out which line within the macro it was
00:53ddellacostabitemyapp: haha, touché
00:56akurilin*exception handler
00:57akurilinthe best way of debugging that I know is to just manually write the macro around the chunk of code causing trouble. Not very elegant...
00:58akurilinbitemyapp, what's full rice mode?
00:59ddellacostaactually, I wanted to ask too, but just figured it meant "from scratch" or something.
01:01SgeoWonder if someone made ir-macro-transformer for Clojure
01:01seangrovericers...
01:02seangrovehttp://lug.wsu.edu/node/154
01:02seangroveMy main experience with Gentoo as a serious thing was setting up a small web-hosting side business using modded used-xboxes
01:03seangroveIt was a waste of time.
01:04nightflyseangrove: Sounds like an awesome waste of time though
01:04coventryakurilin: Oh, you mean the error was in the macro-generated code? You can get more specific location information by (-> form macroexpand pprint)ing it and running it in the repl.
01:04ddellacostaseangrove: back when I was learning all the ins-and-outs of Linux (we're talking 12+ years ago) I went so far as to install Linux-from-scratch. That was just a bit too insane for me, so I compromised with Gentoo at some point.
01:05ddellacostaseangrove: now I'm mostly just stuck in my ways, but I do find it nice when I want something super minimal. Use ubuntu for work stuff day-in-day-out though.
01:06seangrovenightfly: I can write it off as a silly teenage learning experience, sure :)
01:06ddellacostawhen I think back on all the configuration I used to do, though, holy crap what was I thinking.
01:06seangroveddellacosta: Yeah, I just go with ubuntu. If I want to do crazy, cool, and minimal, I'll do a BSD flavor
01:07seangroveI'll never forget the wonder of installing an amazing OS off of a floppy boot disk, ports... ah...
01:07seangroveAnd yet, *still* doing nothing useful with it at all
01:07ddellacostaseangrove: I'm getting flashbacks to one of the two times I installed OpenBSD for "fun" as we call it
01:08xuseropenbsd makes a nice firewall/router
01:09xuser+for
01:10akurilincoventry, the sequence you wrote down prints the macro to the terminal in a fully expanded form?
01:11coventryakurilin: No, but riddley.walk/macroexpand-all works in most cases, if that's what you want.
01:11akurilincoventry, just trying to understand what exactly (-> form macroexpand pprint) does
01:11akurilin(still not fully grokking the whole quoting business)
01:14coventryakurilin: E.g., try something like ##(clojure.pprint/pprint (macroexpand '(deftype eg [])))
01:14lazybotjava.security.AccessControlException: access denied (java.util.PropertyPermission line.separator read)
01:16akurilininteresting
01:18akurilincoventry, yeah apparently you can actually paste the output of that into the repl and it will run just fine
01:20coventryYep, that's all a macro does.
01:21akurilincoventry, I'll explore further then, thanks!
01:24ddellacostaSetting up an init script to run a clojure web app, is it better to run it via uberjar, or lein trampoline? Not sure what the difference is.
01:24dobry-denat the very least, uberjar boots faster
01:25akurilinis this for production?
01:25bitemyappddellacosta: uberjar.
01:26bitemyappddellacosta: aot all + uberjar
01:26ddellacostaakurilin: it's just for setting up a toy site (a.k.a. blog)
01:26bitemyappddellacosta: and make your init process separate functions that main merely calls
01:26bitemyappddellacosta: take-down functions can be useful too.
01:26ddellacostabitemyapp: using the init-script format here, so that shouldn't be hard: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4#doc_chap4
01:27bitemyappddellacosta: I'm thinking less of init start/stop and more of how I embed nrepl into all my clojure services so I can tunnel in and perform maintenance.
01:27ddellacostabitemyapp: thanks! I'll go with that. But, incidentally, why would I want to do one or the other? The leiningen FAQ doesn't really distinguish: https://github.com/technomancy/leiningen/blob/stable/doc/FAQ.md
01:27bitemyappI mentioned this earlier today in the channel.
01:27ddellacostabitemyapp: ah, sorry, misunderstood
01:27bitemyappwhy install leiningen in production?
01:28bitemyappI'd rather my only dependency be java -jar
01:28akurilinI've been pretty happy with runit calling chpst on java -jar in prod
01:28ddellacostabitemyapp: okay, yeah--that logic makes sense. Reducing dependencies always good.
01:29akurilinthe other issue is that automating leiningen deployment is not super straightforward afaik
01:29bitemyappI don't think it's bad at all, lots of people will just do 'lein ring server :headless' in production. I don't - though.
01:29bitemyappI prefer to rsync jars.
01:30bitemyappI prefer build artifacts over dynamically downloading dependencies in production.
01:30bitemyappI hated random download failures and other sources of chaos in my Python work, I don't know why I would risk it in Clojure.
01:30bitemyappHaving universally deployable build artifacts is a freakin' joy.
01:31ddellacostaakurilin, bitemyapp: yeah, for example I was looking at this thread, which goes into some of these questions: https://groups.google.com/forum/#!msg/clojure/CKw8y0JA7q4/C9_T7TLqy7sJ
01:31ddellacostain any case, thanks bitemyapp, as usual your feedback is really helpful!
01:31dobry-denIt's convenient having git repo in production even if you use uberjar. I've Tramped into production to analyze state.
01:32ddellacostadobry-den: ideally I have a staging production with the exact same env as production where I can do stuff like that
01:32bitemyappthat's what I use embedded NREPLs for.
01:32bitemyappguys, you don't need to do that.
01:32dobry-dencome at me
01:32bitemyapptag your releases, tunnel into the production nrepl
01:32bitemyappinspect REAL live server state and test assumptions.
01:32bitemyappno excuses.
01:33akurilinbitemyapp, or just firewall 7888 to your VPN
01:33dobry-densometime's youve just gotta reverse tunnel your production server to localhost and do it live
01:33ddellacostabitemyapp: it's true--it just depends on what you are trying to do. Of course there is no substitute for inspecting the real data coming in/going out. But for everything other than that I'd rather avoid touching production
01:33bitemyappthat's what I do.
01:33bitemyappddellacosta: I know what I do in production could or couldn't break the server, I test accordingly.
01:34bitemyappI have a dev environment that I can trash/refresh at will too.
01:34ddellacostabitemyapp: yeah, I mean, I suspect we are in agreement here in the end
01:34bitemyappdev meaning deployed and essentially "staging"
01:34ddellacostayep
01:34bitemyappI really think people should seriously consider putting embedded nrepl servers in their deployed Clojure services
01:34bitemyappit's a life-saver when you need it. Really.
01:35ddellacostamakes me seriously nervous from a security point of view, but I can see the value
01:35benkaybitemyapp i love your style
01:35bitemyappddellacosta: I bind to localhost and reverse tunnel.
01:35bitemyappddellacosta: nobody has access to the nrepl unless they have the ssh keys.
01:35bitemyappbenkay: thanks!
01:36ddellacostahmm, okay.
01:36bitemyappnrepl servers bind to localhost by default. The devs that wrote it ain't dumb :)
01:37benkayit also is possible to install emacs on remote boxen and use that in production
01:37bitemyappddellacosta: I don't just use the embedded nrepls for debugging either - I use them for plain old database queries against prod, for managing fine-grained service takedown/startup, all kinds of things.
01:37bitemyappbenkay: meh. I like having my native environment with the nrepl because then I can jump around the code quickly.
01:38bitemyappit also frees me from having the git repo on each server.
01:38bitemyappSomething I don't especially want to do.
01:38benkaynative environment?
01:38bitemyappbenkay: I have a pretty thick stack of elisp in my dotfiles.
01:39bitemyappbenkay: it's about 410k LOC of elisp in a 95% custom setup.
01:39bitemyappI don't want to ship around and configure that for each server.
01:39bitemyappI'd rather reverse tunnel and point my local Emacs at the connection.
01:39benkayoh meaning connect from local Emacs
01:39bitemyappyes.
01:39benkayha!
01:40benkayI must do this.
01:40ddellacostabitemyapp: interesting. I don't actually do our production deployments, as it is--just deploy to our dev stack--so I don't have much of an opinion on Clojure in production yet. I'm used to using scripts, and back in my RoR days, capistrano deploys. This side project is a chance to practice, and I'll try some of the stuff your suggesting. Many thanks!
01:41bitemyappddellacosta: I automate with Fabric + Cuisine, which is basically Chef for people that are too busy to do dev-ops for a living.
01:41bitemyappautomate provisioning and deployment, that is.
01:41bitemyappconfiguration is 100% based on env files with exports and weavejester's environ.
01:42ddellacostabitemyapp: yeah, in my "main" side project, I'm using environ pretty heavily, but that uses heroku (which I'm thinking of getting off of), so it's pretty simple--I let them do all the work. This is the first time I've set this up myself, on a bare linux image
01:43ddellacostaI'll check out fabric/cuisine
01:43bitemyappddellacosta: cuisine is basically a library of simple idempotent operations for "chef-like" provisioning with Fabric.
01:43akurilinI like envdir files for storing configurations
01:43bitemyappyou could potentially do a better job with Ansible or Saltstack, but Fabric SUUUUUPER simple so I have a hard time abandoning it.
01:44benkayfor some values of better
01:45ddellacostaright, ansible was the other one folks suggested I look at
01:45ddellacostalast time I spent half a day struggling with pallet, and unfortunately had to give it up. Will try again sometime though.
01:46bitemyappansible is recently popular and sits somewhere between fabric and saltstack in terms of "SCALE"
01:46bitemyappddellacosta: I've done a decent sized chunk of dev-ops work and I couldn't get pallet do anything useful for me.
01:46bitemyappif you need amazon API integration, just use Amazonica IMO
01:46technomancybitemyapp: thanks for saving me the trouble of breaking cemerick's heart re: google go
01:47ddellacostabitemyapp: yeah, bummed me out. I think you were around that day actually. Someone on #pallet was really trying hard to help me though, I gotta give them credit.
01:47bitemyapptechnomancy: no problem. I'm the all-dancing, all-singing evil sock puppet at your disposal.
01:47technomancyit is really astonishing how there are at least three distinct directions you could pursue to move things forward with error handling, or you can at least stick with the status quo as the safe option, and somehow go manages to take a huge leap backwards
01:48bitemyappddellacosta: they're nice people, but have a weird way of thinking about machine provisioning, deployment, and configuration.
01:48technomancyhow do they manage it
01:48technomancyhttp://p.hagelb.org/mystery.gif
01:48ddellacostaheh
01:49bitemyappddellacosta: the SF Clojure meetup talk I went to was about Pallet
01:49bitemyappI successfully diverted post-presentation conversation *away* from Pallet.
01:50ddellacostabitemyapp: haha, I remember that day actually. Sounds like it was kinda painful. :-(
01:50bitemyappa weetle.
01:50bitemyappMet some really awesome people though.
02:14dobry-denis there a named concept that describes a way of reading bytes from a stream and executing logic when they follow certain footprints?
02:14dobry-denLike, "if i encounter 0x01, then ignore all following bytes until 0xff. then print the following byte"
02:16dobry-denOr "when i encounter a 0x0a, if the next bytes is 0x0b, and then if the next byte is 0x0c, then do this. else, start over looking for a 0x0a byte"
02:17bitemyappdobry-den: you mean like finite state automata?
02:18bitemyappdobry-den: https://github.com/ztellman/automat
02:18dobry-denill look that up. im basically just trying to find a better way of parsing a socket stream that can be more robust against garbled data than my naive approach
02:19bitemyappdobry-den: just wondering, did you go to school?
02:20dobry-denwhat do you mean
02:22xuserdobry-den: what's 1 * 1?
02:22dobry-dennot for computer science
02:23dobry-denyeah, i know im the channel idiot but i also rarely encounter any body using clojure near my experience level
02:23Apage43aw man, go happened above
02:24Apage43i'm the lone clojure guy at work sitting across from the go corner
02:25Apage43I think I'm winning one guy over though
02:26Apage43who's wanting features/changes in a thing I built, and I just walk him through making the change
02:28dobry-denApage43: yeah it takes some hustlin to turn your wolfpack of 1 into a wolfpack of 2
02:28bitemyappApage43: http://i.imgur.com/J15AClk.png
02:28Apage43haha
02:28bitemyappI have a wolfpack of 2 serious Clojure users with an expanded set of 4-6 people at my company.
02:28seangroveo_O
02:29ddellacostabitemyapp: I feel deeply offended, which is to say I love it
02:29Apage43it's enough to just watch them across the desk divider trying to come up with a solution to freeze their dependencies
02:29bitemyappApage43: aren't there like 35 package management/freezers/etc out there for Go now?
02:30ddellacostabitemyapp: btw, got "hello world" up and running with uberjar + custom gentoo init script, thanks for the help. Stoked.
02:30bitemyappEverybody and their sister is writing a half-assed maven, I love it.
02:30Apage43bitemyapp: it'll be 36 sooner than later
02:30bitemyappSeeing Golang re-create 35 worse-than-Maven clones is the most entertaining thing I've witnessed since Node.js was taken seriously the first time.
02:31bitemyappddellacosta: Awesome. Glad it worked out for you. :)
02:31bitemyappddellacosta: another reason I do it that way is to avoid magic I have to spend time learning when it breaks.
02:32ddellacostabitemyapp: yeah, the simplicity of this is really nice. I'm realizing that it'll be cake to set up deployment with this kind of setup, as you pointed out.
02:32bitemyappddellacosta: another reason I do that is so that all the sub-services in my JVM processes are "equals"
02:32ddellacostabitemyapp: hmm, not sure I know what you mean by that. Could you elaborate?
02:32bitemyappddellacosta: if you use Lein ring init and the starting of another (separate) service fails, it could take down the init of the Ring service.
02:33bitemyappmy @work project has 3 or 4 services that start in -main, all with separate state, init, and takedown functions.
02:33ddellacostabitemyapp: ah, so you start each sub-service with a different uberjar?
02:33bitemyappno
02:33bitemyappno no no
02:33bitemyappthey're just functions in one big uberjar.
02:34bitemyapp(defn -main [& args] (start-web) (start-nrepl) (start-consumers :queues [:a :b :c :d]) (start-blah-service) )
02:34ddellacostabitemyapp: ah, haha--sorry, I gotcha--that way you set up stuff in the repl, as you were describing earlier.
02:34bitemyappsorta.
02:34bitemyappit just fires up from main if it's enabled in the config.
02:34bitemyappeach "start-*" thing is wrapped in an env-config check to see if it should start at all
02:34ddellacostaer, I suppose you have that set up by default, but then you can take down/restart services huh? It's starting to click. I see the elegance in that.
02:34bitemyappso I can disable components at will by resetting the config and restarting the server *OR* by using the takedown functions built in.
02:34ddellacostaright, very nice
02:35ddellacostaokay, cool, I like it
02:35bitemyappddellacosta: a lot of how I use and deploy Clojure is influenced by Erlang.
02:35bitemyappI like having a "master control" terminal of mostly transparent server state that lets me flip all the switches.
02:35ddellacostainteresting--yeah, I can see how you are separating things into more atomic entities, so to speak
02:35bitemyappyep.
02:35bitemyappand I've needed this functionality for dev *and* prod
02:35bitemyappfor example, we had a problem with the queue consumer stuff
02:36bitemyappjump into the tunnel, shut it off manually from the REPL so it stops immediately, then redeploy the config with the consumers shut off by default
02:36bitemyappthen bounce around the REPL in prod to do cleanup duty / inspection.
02:36ddellacostaright, you don't disrupt other stuff but can manage/maintain/clean up and get back up and running in repl. Very cool.
02:36bitemyappmost services as they're developed are monolithic/dumb.
02:36bitemyappcf. most Ruby and Python queueing integration. You can't shut off your queue workers without commenting out code.
02:37bitemyappThat is, to my mind, insane.
02:37ddellacostabitemyapp: yes. :-(
02:37bitemyappmy consumers and queue worker state is stored in an atom. I can shut them off from any REPL instance.
02:37bitemyappI can also start them back up against specific queues or all of them.
02:37bitemyappand it's very simple, not over-engineered at all.
02:37bitemyappjust a function.
02:37ddellacostaoh, moments like these I really love clojure. That is quite nice.
02:38ddellacostaalright, now I've got a lot of food for thought. Thanks.
02:38bitemyappddellacosta: the rabbit hole goes deeper when you're in the mood.
02:38ddellacostaI'll be stealing these ideas, of course...
02:38ddellacostaha, this is good enough to get me started. I'll come back and poke at you at a later date, I'm sure
02:41bitemyappI need a hyper-efficient way to associate integers with values in a manner that I can dissoc/remove at a later point.
02:42benkaybitemyapp: what are the resources for diving down this hole? is there a "lisp in production" tome passed from hand to hand by alien technologists?
02:42bitemyappbenkay: it's like my approach is informed by Common Lisp, Python, Erlang, and Clojure itself. Stole some ideas Stuart Sierra too.
02:42Apage43the idea of hot-modifying in general is active outside of lisp :)
02:43bitemyappbenkay: it's pretty common for Common Lispers to "swank" into prod and debug the shit out of their deployed stuff :)
02:43Apage43or even just hot-introspecting
02:43bitemyappSorta. I don't think it became mainstream/standard for very many language communities though.
02:43Apage43I work a lot with a partially erlang project
02:44bitemyappErlangers took "dynamic service" thing seriously, of course.
02:44Apage43yeah. Erlang it is really considered to be one of the core things you can do
02:44Apage43but outside of that.. not so much
02:44bitemyappCommon Lispers really just don't tolerate being "separated" from what their code is doing.'
02:44bitemyappthey want to be able to dive their arms into the guts at any point in time, prod or no.
02:44Apage43the lisps its more like "well, yeah, why wouldn't you be able to do that?"
02:45bitemyappI think the Lisp community is defined by its ability to take nice things for granted.
02:45benkayi've been wondering about this weird disconnect i've developed with my py work
02:45bitemyappI would kill for an "embedded" GHCI server/client for Haskell
02:45seangrove
02:45seangrovebitemyapp: Have you introduced cljs to any protégés at work yet?
02:45bitemyappbenkay: I do this stuff with Python too (I do and have done a lot of Python)
02:45bitemyappseangrove: been indirectly infecting the frontenders.
02:46benkayi find myself wanting a repl and simultaneously feeling dirty for wanting to muck around in my production instances
02:46bitemyappone of said frontenders are going to be transferring to my neck of the woods soon, I'll complete the infection then.
02:46bitemyappbenkay: haha, I leave ipdb hooks in all my Python servers.
02:46bitemyappGNU Screen + WSGI hack + ipdb hook == PYTHON REPLLLLL IN PROOOOOOD
02:47benkaybahahahaha
02:47bitemyappI kept meaning to hack it up into a proper ipython server/client but never got around to it.
02:47benkayit's a crazy kind of cowboy
02:47bitemyappI just kept snagging stdout.
02:47benkayi'll say it again - i like your style
02:47seangrovebitemyapp: Been contributing more to cljs recently
02:48bitemyappseangrove: are you fishing for things to improve? You seemed busy already./
02:48bitemyappMy current (as in, right now) project is Revise
02:48bitemyappthe client already works surprisingly well. cbp did a lot of impressive work here.
02:48seangrovebitemyapp: If you get the chance, it might be nice if you wielded some creepy authority over they to make them write down their experience, what hurt in the tooling, etc.
02:49bitemyappseangrove: you know the client/patronage model in ancient Roman governance/
02:49seangrovebitemyapp: Not fishing as much as focused on smoothing the path out
02:49Apage43I like ~2004 era PHP, as most of those applications had a remotely accessible REPL in them *somewhere* (unintentionally).
02:49bitemyapps/\//?/g
02:49bitemyappApage43: *snerk*
02:49seangrovebitemyapp: In the arts?
02:49Apage43if not an actual PHP REPL, at least an SQL one.
02:49bitemyappseangrove: no, it was a political model for mutual obligation between otherwise free actors. Anyway, it's a metaphor for how my workplace works.
02:50bitemyappseangrove: I don't have a boss, I am free to do what I want as long as I wrap up pre-established obligations. I can pair-program CLJS if I flip over to web.
02:50bitemyappthen I'll get all the info you could possibly want.
02:50seangroveMight be very interesting
02:50bitemyappseangrove: you know what would help people I see visiting this channel regularly?
02:50seangroveMarissa has been ramping up in cljs and has been unbelievably frustrated
02:50bitemyappa blog post on, "this is how you get started with ClojureScript"
02:50benkayyes plz
02:50bitemyappat least a basic rundown of the tools people use, like Piggieback
02:51benkayi've been wailing and gnashing my teeth quietly over here about getting running with Austin
02:51bitemyappand explaining how the tools relate to each other and what problem they solve.
02:51bitemyappfor example, I know Piggieback - but I still don't know what Austin does.
02:51seangrovebitemyapp: good suggestion. I'd like to gather these up somewhere
02:51seangroveJust got into austin this morning, it's nicer
02:51bitemyappa gist on github alone would be a lifesaver, then I can point the question-askers I see in here to it.
02:51seangroveAuto-reconnects, etc.
02:52bitemyappdemo/example projects go a long way too.
02:52bitemyappseangrove: that does sound nice.
02:52seangroveAlright, I'll think on it a bit.
02:52bitemyappseangrove: much appreciated. I'll continue spreading the good word at work. :)
02:52bitemyappannnnd back to protobuf bizarro world.
02:53Apage43man I *tried* to get into protobuf bizarro world.
02:53bitemyappI want a b-tree, don't I?
02:53bitemyappdense packed efficient integer -> value that can be dissoc'd. That's just a b-tree.
02:53bitemyappDerp.
02:53Apage43folks preferred to do poorly specified bespoke protocols
02:53bitemyappApage43: RethinkDB couldn't leave protobuf alone, they have a weird custom handshake.
02:54bitemyappthat DOESN'T use standard protobuf varints.
02:54Apage43.. yeah rethinkDB went a bit overboard
02:54Apage43I've seen their .proto files
02:54bitemyappI was vomiting blood for a week after I got the initial connection negot working.
02:54bitemyappthat's why cbp had to write the actual library.
02:54Apage43and that handshake thing
02:56bitemyappand it's specifically a little endian unsigned 32 bit integer.
02:56bitemyappjust...why...
02:58bitemyappbahahahaha, there's a lenses library for Clojure. Time to litter monads all over my code to protect it from pull requests.
02:59Apage43so far -> has been enough to scare folks off for me :/
02:59bitemyappApage43: really? did you try ,,, ?
03:00bitemyappI find the Zoidberg mouth-tentacles fogus invented work fine for explaining the data-cannon.
03:00gwsthe invisible pacman ghost operator
03:00sritchiehey guys - any advice for "java.io.IOException: Broken pipe" on a clojurescript page refresh?
03:00Apage43bitemyapp: well, it's hard when the first Clojure I show someone is ->'d
03:00Shiro-IchidaTo be fair -> is terribly confusing if you're not familiar with what's going on without it.
03:00sritchieI can't seem to recover my browser repl session after a page reload
03:00bitemyappApage43: if that scares them, boy am I prepared for Halloween with just Synthread.
03:00Apage43because then I have to explain that it can do that because it's a *macro*
03:01Apage43I have a synthread-ification of a project I did that I haven't committed because I really would like said project to be "beginner" accessible
03:01bitemyappApage43: macro, monad, magic. Whatever. Same thing to muggle-ears.
03:01bitemyappApage43: post post post plz
03:02bitemyappor email me the tarball.
03:02Apage43oh
03:02bitemyappsritchie: who's throwing the exception?
03:02Apage43it's actually up
03:02bitemyappApage43: topic monads are relevant to my interests, I'm figuring out some conn mgmt stuff
03:02Apage43it's a small, terrible amount of code I wrote under pressure, that runs a checkers game :)
03:02sritchie at cemerick.austin$send_for_eval.invoke(austin.clj:133)
03:02bitemyappho damn.
03:02bitemyappsritchie: seangrove actually just meant Austin was supposed to auto-reconnect.
03:02bitemyappmentioned*
03:03Apage43https://github.com/apage43/checkers-overlord/commit/cc92351bbaedbd05bac7bcc3d93c22b81b55ba60
03:03sritchiehere's the full
03:03sritchiehttps://gist.github.com/sritchie/7165907
03:03sritchieoh, let me read up
03:04bitemyappApage43: seems like a sensible use of synthread to me.
03:04bitemyappyou've got a "topic", you're pipelining changes and accesses.
03:04Apage43it is
03:04bitemyappApage43: Synthread overlaps with lenses a fair bit too.
03:04Apage43to some extent I think the synthread version is, on the surface, easier to explain
03:04sritchieseangrove: austin vs piggieback...
03:05sritchiebitemyapp: seangrove it LOOKED like austin would simplify the situation
03:05bitemyappsritchie: piggieback is less experimental, last I heard.
03:05Apage43as long as explainee is content to let some stuff remain "magic" while I lay the groundwork
03:05bitemyappApage43: oh, did you see my gilded rose solution?
03:05bitemyappI need to wrap that up and upload it.
03:05bitemyappApage43: we did the gilded rose at Clojure Dojo.
03:05Apage43ooh no
03:05bitemyappyou familiar with the exercise?
03:06Apage43nope =P
03:06bitemyappit's a refactoring exercise. One moment, I think it's on my work computer./
03:06bitemyappor, more frankly, a refuctoring exercise.
03:08sritchiebitemyapp: woah, my google voice plugin may be affecting austin
03:08sritchiehttps://github.com/cemerick/austin/issues/17
03:09bitemyappsritchie: that is impressively annoying/obscure and a good thing to know.
03:09bitemyappHrm, just realized retina display lets me notice how blurry Postgres.app's icon is. Shutting it down just so I don't have to look at it.
03:10seangrovesritchie: If you're just getting into cljs and the ecosystem, would love for you to keep in mind any complaints and thoughts
03:10sritchieseangrove: will do
03:10seangroveI think we need to do a "state of cljs newcomer experience" yearly survey like cemerick's
03:10seangroveAnyway, I need to sleep
03:11sritchiethis repl experience is the big pain so far, but it looks like that's being worked on
03:11sritchiefor sure, will keep track
03:13sritchieseangrove: that fixed my broken pipe!
03:14sritchieseangrove: disabling the google voice extension, that is
03:16bitemyappsritchie: nice!
03:17sritchiebitemyapp: now, the remaining Q for tonight is,
03:17sritchiehow to structure the app such that I can get the repl running in dev mode, but not in production
03:17bitemyappno repl in prod? too bad. ;)
03:22anonymous-functiAm I able to use a function as a value in a map? Such that it evaluates every time that key is accessed, for example? Something like an atom watcher?
03:22anonymous-functiFor example, something like this {:some-value (fn [] (nth (@data :another-value) 0))}
03:23Apage43,(({:a inc :b dec} :a) 1)
03:23clojurebot2
03:23Apage43oh
03:23Apage43you want something different
03:23anonymous-functiYeah
03:23anonymous-functiCurrently that evalutes once
03:23Apage43Hm
03:23anonymous-functibut when @data changes, it doesn't re-evalute
03:24Apage43I've seen a library that does what you're talking about
03:24anonymous-functiand when I quote it, then I just get the anon function, but it does't eval
03:24Apage43(basically it just makes it simpler ti implement IAssoc)
03:25Apage43or whatever the map protocol was
03:25Apage43there are a boatload of interfaces maps satisfy
03:26anonymous-functiHmm...
03:26anonymous-functiI don't think I want assoc, basically I want to implement my own watcher I guess. So maybe I should go look up the src for atoms
03:26anonymous-functithe gist of it is I have a vector of some positions data
03:27bitemyappI was looking for an excuse to not use the Clojure HAMTs but 24 nanoseconds for a transactional hash-smash is pretty compelling.
03:27anonymous-functiand I have some physics calcs acting on that which is why I split them off from the main "object" vector
03:27bitemyappsigh, it even degrades gracefully...
03:27anonymous-functiso an "object" is just a map in my case, so I want :position to point to the position in the other vector
03:28drorbemetHi, I am looking for a way to parse and query a wikipedia dump (up to 10GB of xml)
03:28drorbemetpicking subsets of fields to be used as base for the queries. Which aproach and which libraries would you suggest?
03:28anonymous-functiIs there perhaps a better way of doing this instead?
03:30drorbemetOr, is it preferable to parse the wikipedia / mediawiki api online? Which libraries would you suggest using for that?
03:30bitemyappdrorbemet: zip.xml or enlive or laser or tree-seq or lenses or walk or recur or xml-seq or clojure.data.xml
03:31Apage43OH
03:31bitemyappApage43: what? seriously?
03:31Apage43no i was OHing at another thing
03:31Apage43i remember
03:32Apage43the thing i was thinking about earlier was .. Potemkin
03:32Apage43has a helper for defining your own things that pretend to be maps
03:32Apage43https://github.com/ztellman/potemkin/blob/master/src/potemkin/collections.clj#L160
03:32bitemyappwow, mega variance. derferk.
03:32drorbemetbitemyapp: I just took a look on clojure.data.xml, I'll have a look on the others too, thanks.
03:33Apage43clojure.data.xml was nice last time I used it to streamingly-parse enormous stuff
03:33bitemyappApage43: when I thought to myself, "I'm trying to write something fast!" I realized I should check ztellman's github before writing any code.
03:34Apage43but for smaller stuff just plain clojure.xml is less hassle usually
03:34Apage43bitemyapp: i have so many project.cljs that half the deps are ztellman libs
03:34bitemyappsadly I can't say that, but on the occasion I use one of his libraries it's a joyous day.
03:35Apage43I do a lot of one off tiny protocol fiddling apps
03:35bitemyappyeah that'll do it.
03:36bitemyappalright I'm satisfied he doesn't have anything that solves my problem
03:36bitemyapptime to create some fake transaction contention.
04:18bitemyapptime to create some fake transaction contention.
04:18bitemyappargh, wrong terminal.
04:29bitemyappfirst person to guess why I wrote this gets a chocolate macaron: (clojure.string/join " " (clojure.core/map first (clojure.core/map #(clojure.string/split % #" ") (clojure.core/map second (clojure.core/map #(clojure.string/split % #"WARNING: ") (clojure.string/split blah #"\n"))))))
04:40ToBeReplacedanyone have a recommendation for a lisp that can be compiled into arduino c++?
04:40Apage43bitemyapp: parsing "WARNING thing already refers to: other thing in namespace: bleh" messages?
04:40bitemyappApage43: ding ding. A winrar of macaron is you.
04:40bitemyappAlso, this library I'm working on is the first to actually cause a stack overflow when you try to eval the code in a repl.
04:41bitemyappto clarify, it works fine if you *run* the code or run the tests.
04:41bitemyappbut it completely conks out nrepl somehow.
04:41ToBeReplacedwhy would you need to parse that warning message?
04:41bitemyappToBeReplaced: there was a very long list of them.
04:41bitemyappI am in the alterate-universe namespace from Hell.
04:43bitemyappALSO WHY IS EVERYTHING A DOUBLE
04:43bitemyappWHAT IS GOING ON
04:44Apage43did you accidentally some javascript
04:45bitemyapp{:deleted 2.0, :errors 0.0, :inserted 0.0, :replaced 0.0, :skipped 0.0, :unchanged 0.0}
04:45bitemyappwhat the fuck is half an error.
04:45bitemyappHow do I get half an error?
04:45bitemyapp0.33333 repeating errors.
04:46bitemyappoh dear sweet jesus
04:46Apage43oh is this still rethinkdb
04:46bitemyappit actually IS because of JavaScript.
04:46Apage43i was going to say
04:46bitemyappTHEY'RE JSON NUMBERS
04:46bitemyappAAAAAAAAAAAAAAAAAGH
04:46Apage43there is javascript all up in there
04:46bitemyapp(╯°□°)╯︵ ┻━┻
04:47bitemyappI'm going to build a tree-house in the woods and write Haskell and kill my food to survive.
04:48bitemyappthe test-cases are such that whether they pass or not isn't even important or interesting, I just want to know what the hateful bastard barfs out.
04:48bitemyappaha, multimethods to the rescue. I can fix this!@
04:50ddellacostawhat is going on with lein repl on heroku, in terms of what filesystem I'm interacting with when I start up a repl? It seems like it has nothing to do with the one I see when I do heroku run bash.
04:51bitemyappthat's a technomancy question but you're in the WAYYYYY wrong timezone.
04:51bitemyappI'm only awake because I'm angry. I'm angry because JSON.
04:52Apage43someone at work offered me a JSON shirt
04:52Apage43I responded "I don't believe in JSON"
04:52ddellacostabitemyapp: just now the thing you have on your web site floated through my mind: "Technologies I've used in anger"
04:53bitemyappddellacosta: literally and figuratively.
04:53ddellacostasometimes I think of moving back to the states just so I can talk to people in realtime on IRC
04:53bitemyappI assume by default that if you haven't considered defenestrating a technology, you haven't really used it.
04:53ddellacostahahaha
04:54bitemyappI have similar notions regarding cohabitation with women.
04:54ddellacostathat is a cogent observations, methinks
04:54ddellacostaon both accounts
04:54sritchiedo you guys have advice on how to get config options into lein-ring?
04:54sritchieI see init --
04:54sritchiebut getting CL args like prod vs dev,
04:54sritchieor a DB name
04:54ddellacosta(apologies to any women in the channel, same probably goes both ways I suspect)
04:54bitemyappApage43: Looky, evil overcomes evil: {:deleted 2, :errors 0, :inserted 0, :replaced 0, :skipped 0, :unchanged 0}
04:54bitemyappddellacosta: indeed. Could you *IMAGINE* living with me?
04:54ddellacostasritchie: maybe environ could help?
04:54ddellacostabitemyapp: haha, good point....
04:55bitemyappsritchie: seconding weavejester's environ.
04:55ddellacostasritchie: https://github.com/weavejester/environ
04:55bitemyappenviron is luvverly. I pair with a config.clj that has functions it.
04:55bitemyapppair it*
04:55Apage43hooray
04:55ddellacostasritchie: I find it quite handy when I want to pick up env variables and pass them through to my app. Super useful for differentiating different deployment environments. Ditto what bitemyapp says re: using + config.clj
04:55sritchieokay, that works
04:56sritchieI'm converting an old web app away from noir :)
04:56bitemyappsritchie: a fine choice.
04:56ddellacostasritchie: ah, yes, do that. :-)
04:56sritchieand just trying to get my head around the pieces I need
04:56sritchiering-jetty-adapter, for example
04:56bitemyappoh, right, I can't eval this namespace...because the code is so insane nrepl throws a stack overflow.
04:56sritchieit looks like lein-ring fires up a jetty server already,
04:56bitemyappsritchie: you don't need that.
04:56bitemyappsritchie: you don't need that either.
04:56ddellacostayep, no need
04:57sritchieokay, what's the stack
04:57bitemyapphttp-kit and (start-server)
04:57sritchiecompojure + ring replace noir (plus lib-noir)
04:57bitemyapphttp-kit is Ring compatible by design and out of the box. no magic needed.
04:57bitemyappjust call (start-server ...) from sie -main fn.
04:57ddellacostabitemyapp: oh, thought you mean you don't need to explicitly include the lib. Yeah, http-kit is fine.
04:57bitemyappsritchie: http-kit has the additional benefit of being async and supporting websockets and long-polling out of the box.
04:58sritchienice
04:58sritchieawesome, just what I was looking for
04:58ddellacostabitemyapp: to be the devil's advocate, why would you use http-kit if you didn't need those things?
04:58bitemyappsritchie: it's also thread-pooled automatically...
04:58bitemyappit also comes with an async http client if you ever need one. (I do occasionally)
04:58sritchieyeah, I'm trying to go down the web socket road
04:58bitemyappddellacosta: simpler. Less magic.
04:58sritchieI've got core.async up in the browser,
04:58bitemyappddellacosta: the jetty tooling is fine and works fine, but people were way too eager to slap magic on there.
04:58ddellacostasritchie: ah, well, in that case definitely
04:58bitemyappsritchie: http-kit it is.
04:58sritchienow I want to try to get a client talking to a server
04:58sritchievia websockets
04:59sritchiekevin lynagh had posted this
04:59sritchiehttps://github.com/lynaghk/jetty7-websockets-async
04:59ddellacostabitemyapp: I mean, my only counterargument is that you can get it up and running (very slightly) faster, just 'cause it's default in the default compojure template.
04:59bitemyappsritchie: in case you were curious about http-kit's performance credentials: http://shenfeng.me/600k-concurrent-connection-http-kit.html http://www.techempower.com/benchmarks/
04:59bitemyappddellacosta: *shrugs* sure.
04:59ddellacostayeah, I think http-kit is the clear performance winner
04:59bitemyappddellacosta: but, Luminus has an http-kit recipe anyway.
04:59bitemyapphttp-kit is the clear performance winner 90% of the time
04:59bitemyappI actually know how to break it though, lol.
04:59ddellacostabitemyapp: ah, gotcha--I don't use Luminus so that's probably why I wouldn't have thought of it
05:00ddellacostasritchie: I would imagine lynaghk's jetty7 web sockets thing is useful if you've already got an app you need to integrate it with
05:00sritchiedo you guys have a favorite lib for cljs / cli client server crosstalk?
05:00ddellacostaotherwise I would definitely start with http-kit
05:00bitemyappApage43: https://gist.github.com/bitemyapp/7166725
05:00sritchieyeah, that sounds like the right way to go
05:00ddellacostasritchie: you mean, using websockets?
05:00sritchienice, thanks guys
05:00sritchieddellacosta: yeah
05:01bitemyappsritchie: highest abstraction one is shoreleave but that's more of an RPC thingy.
05:01bitemyappsritchie: generally a simple websocket lib for cljs and the direct interface http-kit provides should work fine and be simple.
05:01bitemyappthis isn't like Java where you need to read up on a class hierarchy to send a few bytes.
05:01ddellacostasritchie: well, by the way you may want to take a look at this for a really barebones example of web sockets + httpkit + core.async: https://github.com/ddellacosta/cljs-core-async-chat
05:01bitemyappI don't think shoreleave is WS:// anyway.
05:02bitemyappddellacosta: solid!
05:02sritchieddellacosta: this is perfect!
05:02sritchieniiice
05:02sritchieguys, so awesome
05:02sritchiethanks a bunch
05:02ddellacostasritchie: I just used raw JS web sockets and wrapped them in core.asyc, I think that's the way to go personally.
05:02ddellacostasritchie: sure thing!
05:02Apage43bitemyapp: oh.
05:02bitemyappApage43: you object to my evil?
05:03bitemyappsritchie: the typical pattern with core.async is to use a super-dumb / simple callback that serves only to feed data into the channel, from there you can start tee'ing/broadcasting/whatever.
05:03Apage43nah. It's just.. unfortunate.
05:03bitemyappApage43: well. I can't fix JSON.
05:03ddellacostasritchie: sorry, I realize I'm assuming you're using CLJS, dunno if you are though
05:03sritchieyeah, I am
05:03bitemyappddellacosta: pretty sure he is. core.async too.
05:03Apage43JSON doesn't actually say anywhere that JSON numbers are doubles
05:03bitemyappddellacosta: so your project was super-apropos.
05:03sritchieyeah, it was dead on
05:03Apage43lots of parsers/encoders assume that because javascript
05:03ddellacostaexcellent. :-)
05:03bitemyappApage43: but it's a unified data-type, yes?
05:04Apage43and lots don't =P
05:04bitemyappwhere it's a quantum super-position of doubles and integrals?
05:04bitemyappwell.
05:04bitemyappI could complain to RethinkDB.
05:04bitemyappI will!
05:04ddellacostasritchie: I don't guarantee it's the best way to structure web sockets + core.async, but hopefully will get you started.
05:04Apage43I don't think that'd help
05:04Apage43as they actually do just spin up v8 inside the db to do stuff
05:04ddellacostahaha
05:05bitemyappApage43: dude. Have you seen how many issues they have on github?
05:05bitemyapp437. Four. Hundred. Thirty-Seven.
05:05bitemyappPeople whose job I don't want. yeesh.
05:05ddellacostaalright, back to figuring out heroku magic. *sigh*
05:05bitemyappthey spin up V8? well...ow.
05:05bitemyappApage43: you can preserve integrals in V8 though
05:05bitemyappApage43: it'd uh...just require some hax to the code...
05:06Apage43oh? Huh.
05:06Apage43oh
05:06bitemyappApage43: asm.js
05:06Apage43You sly dog.
05:06bitemyappjust want muh un-tampered un-fuzzy bits.
05:06Apage43i like how asm.js doesn't have 64-bit non-floaty things
05:07bitemyappApage43: anything ending in .js is required by natural law to have at least one critical flaw.
05:07bitemyappif not several.
05:08bitemyappAnything ending in .php is required to have at least one security hole.
05:08bitemyappnyuk nyuk nyuk. I should sleep soon.
05:08Apage43Them's the rules: If an adversary has phyiscal access to your machine, it's not your machine anymore. If it has PHP installed on it, it's not your machine anymore.
05:09Apage43*pretend i can spell
05:09ddellacostaI thought we agreed not to say the P-word on this channel
05:09Apage43Perl?
05:09bitemyappddellacosta: does the scar tissue twitch?
05:10bitemyappApage43: I've noticed that people who do Perl or JS for a living end up having an auto-immune disorder called Haskell in reaction to the weak type systems.
05:10ddellacostahahaha
05:10bitemyappflesh-eating monads.
05:10bitemyappHalloween Haskell. Boo!
05:11ddellacostaokay, Dr. Functor-instein
05:11ddellacostaI'm here all night, try the veal
05:11bitemyappddellacosta: that one elicited a gasp-laugh-cough. gg.
05:12ddellacostabitemyapp: yeah, that sounds about right.
05:12bitemyapp<3 this channel so much.
05:12ddellacostaheh
05:12bitemyappwithout you guys I would just be a crazy FP hobo screaming at passerbys about how the world is falling apart because of mutable data structures.
05:13sritchieddellacosta: one last dumb question - is there any need for ring in the project,
05:13bitemyappTHE SEGFAULT IS NIGH
05:13sritchiew/ an http-kit and compojure stack?
05:13sritchieother than for middleware, like [ring.middleware.reload :as rl]
05:13bitemyappsritchie: it's still Ring, but usually you don't use it directly except for middleware.
05:13gws"What?! you mean ('42' + 0) doesn't do what i want anymore? haha what kind of hamstrung language is that"
05:14sritchiegot it
05:14sritchiemakes sense
05:14ddellacostasritchie: I mean, if I include ring it's probably just for using helpers here and there--compojure does all the heavy-lifting (by wrapping ring up nicely)
05:14bitemyappsritchie: lib-noir has parted out the components of Noir that could be salvaged into useful middleware.
05:14sritchielooks like once I kill all these defpage instances I should be good to go
05:15bitemyappsritchie: one caveat to http-kit, there's no thread affinity. Don't use dynamic vars.
05:15bitemyappasync-safe code is the order of the day.
05:15sritchieI've got one around for my database instance
05:15bitemyappwell. make it thread global.
05:15sritchiecool, I should only need to swap it in once
05:16sritchiethat's a good tip
05:16ddellacostaI stuff all the really hairy state in some well-managed atoms and it works fine--I think I do that to handle the different websocket channels in my example actually.
05:16bitemyappatoms are fine...just not thread-scoped dynamic atoms.
05:16ddellacostathat is, what bitemyapp said
05:16bitemyappbecause the thread-scoping *will* break.
05:16ddellacostayeah, thread global
05:17Apage43I just like being able to explain the effects of -doing a thing to a system- without having to add ", hopefully."
05:17bitemyappI'm pretty sure global atoms can be avoided by the magic of closures and middleware but I'm leaving that particular crusade for a day when I don't have an infinite lazy sequence of libraries on my TODO.
05:17bitemyappApage43: functional programming is the death of hope?!
05:18bitemyapplet me go tell the Perl users so they can be warned.
05:18Apage43I prefer to think of it as allowing people to spend their hope on other things :)
05:18bitemyappgws: FP destroys software jobs.
05:19bitemyappApage43: like my hope that RethinkDB never fucks me over and changes the protocol spec.
05:19Apage43but but but isn't that what protobuf is supposed to save you from
05:19gwsFad Programming
05:20bitemyappApage43: I don't really need protobufs to keep a protocol stable, I just need to be in walking distance of the author.
05:20Apage43that helps too
05:24Apage43well, that and its being an abominable syntax tree means it can change pretty heavily above the protobuf layer too
05:25bitemyappApage43: which-wha?
05:25bitemyappthe lambda syntax or something else?
05:26Apage43yeah. You can arbitrarily nest things and it'll build up a fun tree-like thing that you protobuf
05:26bitemyappApage43: https://github.com/bitemyapp/revise/blob/master/src/bitemyapp/revise/query.clj
05:27bitemyappthe only way to express my feelings about this namespace is:
05:27Apage43the way they pull of the lambda syntax trick rustled my jimmies
05:27Apage43*pull off
05:27bitemyappApage43: http://i.imgur.com/XeAjJNE.jpg
05:28Apage43wow
05:29bitemyappsee, the impressed-yet-horrified reaction is how you know it's good Lisp code.
05:33Apage43clojure is surprisingly practical for throwing a rug over some horrifying thing and providing it through an interface that hides said thing's worst qualities
05:35Apage43THROW A BLANKET OVER IT: http://i.imgur.com/wIeHi8g.gif
05:36bitemyapplol :)
05:38gwsor put a pillow over it... new FullName.FullNameBuilder(new Name("Flintstone"), new Name("Fred")).createFullName()
05:42ddellacostawait, bitemyapp, are you using stefon?
05:43ddellacostajust saw this is why I ask https://github.com/circleci/stefon/issues/4
05:43ddellacosta...and 'cause I'm wrestling with it now
05:47bitemyappddellacosta: not right now, it solves a problem I had a few months ago
05:47bitemyappwhenever I pick that back up, I'll start using it in...anger...
05:47ddellacostabitemyapp: okay, haha
05:47ddellacostabitemyapp: frustrated 'cause it's not working on Heroku, which is most definitely 'cause of how Heroku's filesystem works. Seeing if I can get it to write/read assets from S3 bucket now.
05:48bitemyappddellacosta: I usually precompile my asset pipelines for deployment.
05:48bitemyappddellacosta: but I can see why you'd want it to "just work" on Heroku
05:48bitemyappddellacosta: if you're trying to write to the filesystem on Heroku, I can tell you right now that will never...ever...ever work.
05:49bitemyappthey don't allow it.
05:49ddellacostabitemyapp: yeah, the problem is that I'd have to commit precompiled assets, I think--I can't do the jar deploy thing, and I'd rather not do that
05:49ddellacostabitemyapp: yeah, definitely not expecting that magic from heroku, just read up on it now and realized what my problem was.
05:50bitemyappddellacosta: i precomp to s3
05:50ddellacostabitemyapp: and so, how does stefon find your assets? are you using stefon/link-to-assets?
06:33andrewmcveighHi, I'm in the process of transitioning from vim to emacs for clojure dev. Is there a way in emacs to have 2 (or more) buffers open, one/some clj, one/some cljs and have clj evaluate in one nRepl session, and cljs eval in another (but in the same repl instance)? I had a hack of vim-fireplace to do this, but I can't find anything solid on how to do this in emacs. Or at least have the same sort of functionality.
06:35andrewmcveighI'm using cider in emacs, currently. With the latest nrepl, piggieback, austin.
07:07fakedrakehello
07:08fakedrakei want to get a vector wit the nil elements removed, i do (filter #(-> % nil? not) [nil 1 2]), but it is a bit ugly. Is there a better way?
07:19Morgawrfakedrake: sorry if late but (filter (complement nil?) [nil 1 2 3 4 nil 5])
07:19Morgawr&(filter (complement nil?) [nil 1 2 3 4 nil 5])
07:19lazybot⇒ (1 2 3 4 5)
07:20morrifeldmanI started a repl on machine A using 'lein repl'. How can I connect to it from another machine?
07:50hyPiRionmorrifeldman: `lein repl` will default the host to localhost, which blocks remote connections. You can do `lein repl :headless :host myhost :port myport` on it though. Then it should be possible to connect through `lein repl :connect myhost:myport`
08:11morrifeldmanhyPiRion: Thanks. It's working although connecting required a bit extra. `LEIN_REPL_PORT=4567 lein repl :connect 10.0.1.3:4567/repl`
08:12hyPiRionah
08:42fakedrakeis there a way to have u64 in clojure like we have in c. That is to ignore overflows nd stuff?
08:43AimHereWell with clojure, you can promote long int overflows to multiple precision bigints
08:44AimHereIf I'm not mistaken, you're at the mercy of the JVM though, so ask Oracle!
08:44AimHere,(* 4000000000 2)
08:44clojurebot8000000000
08:45AimHeredamn
08:46hyPiRion,(+ Long/MAX_VALUE 10)
08:46clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
08:46AimHere,(* 8000000000 8000000000)
08:46clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
08:46AimHere,(*' 8000000000 8000000000)
08:46clojurebot64000000000000000000N
08:47hyPiRion,(unchecked-add Long/MAX_VALUE 10)
08:47clojurebot-9223372036854775799
08:47hyPiRionDepends on what you need. *' and +' autopromotes. unchecked-xxx ignore flags
08:48AimHereAnd if all else fails, there's try ... catch
08:48mpenet?google primitive-math clojure
08:49mpenethmm cant remember the syntax, anyway, https://github.com/ztellman/primitive-math
08:49hyPiRion$
08:49mpenetright!
08:49fakedrakesry about that
08:50fakedrakemy internet is a bit unstable
08:50fakedrakedid I miss an answer?
08:50Ember-most likely
08:50Ember-,(*' Integer/MAX_VALUE 2)
08:50clojurebot4294967294
08:51Ember-,(*' Integer/MAX_VALUE 20)
08:51clojurebot42949672940
08:51AimHere,(* Integer/MAX_VALUE 20)
08:51clojurebot42949672940
08:51Ember-,(* Integer/MAX_VALUE 20)
08:51clojurebot42949672940
08:51AimHere,(* Long/MAX_VALUE 20)
08:51clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
08:51AimHere,(*' Long/MAX_VALUE 20)
08:51clojurebot184467440737095516140N
08:51Ember-,(unchecked-add INTEGER/MAX_VALUE 1)
08:51clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: INTEGER, compiling:(NO_SOURCE_PATH:0:0)>
08:51Ember-crap
08:51Ember-,(unchecked-add Integer/MAX_VALUE 1)
08:51clojurebot2147483648
08:52Ember-,(unchecked-add Integer/MAX_VALUE 100)
08:52clojurebot2147483747
08:52fakedrakehmm
08:52Ember-,(unchecked-add Long/MAX_VALUE 100)
08:52clojurebot-9223372036854775709
08:52Ember-so *' and +' and so forth auto promotes
08:52Ember-unchecked versions allow overflow
08:53Ember-and normal * + etc will throw exceptions when you go over the number space
08:54Ember-,(*' Long/MAX_VALUE Long/MAX_VALUE)
08:54clojurebot85070591730234615847396907784232501249N
08:54fakedrake,(bit-shift-left 2 50)
08:54clojurebot2251799813685248
08:54fakedrake,(bit-shift-left 2 100)
08:54clojurebot137438953472
08:55fakedrakewhy is the 2nd one much smaller?
08:56AimHereI'd guess it overflowed
08:56AimHere,(bit-shift-left 2 36)
08:56clojurebot137438953472
08:57AimHereYeah, 100=64+36, and the overflow happened at 2^64
08:57fakedrakeif it did, shouldnt it be 0?
08:57AimHereIt'll be a rotate, not a shift!
08:57fakedrakeah it sycles around
08:57fakedrakehmm
09:03hyPiRionbitshifting over the amount of bits have undefined behaviour, and doesn't necessarily cycle
09:04hyPiRion,(bit-shift-left -1 100) ; Should be -1 regardless if that's the theory
09:04clojurebot-68719476736
09:07hyPiRionHowever, it may be that the processor masks its input. I.e. x << n == x << (n & 63)
09:25CreapI saw someone binding *out* to a writer and using println instead of using .write, are there any benefits or drawbacks of that approach?
09:28Creapexcept that it prints a newline automatically..
10:13gfredericksCreap: and spaces in between the args?
10:14gfredericksalso you can use that to change the behavior of other things that print, though it sounds like that isn't what's happening here
10:21LauJensenWhich libraries do we have to handle cookies, when accesing a site which requires a login?
11:58poppingtonicin #startups
13:33maaclI know it is not being actively developed, but is anyone able to get penumbra up and running on OSX? I get errors about liblwjgl.dylib missing.
13:48fakedrakehey, how do I round in clojure without pulling external libs?
13:49fakedrakeround to the closest integer that is
13:50`cbpMath/round
13:50`cbpyou just wont be able to round ratios
13:53fakedrakethanx
13:58fakedrakeWhile I can run Math/round on it's own in the repl
13:58fakedrakefrom within another fun i get `java.lang.IllegalArgumentException: No matching method found: round'
13:59LauJensenWhich libraries do we have to handle cookies, when accesing a site which requires a login?
14:00`cbpfakedrake: you might wanna do (Math/round (double ..))
14:11dobry-denWhat's a pattern for taking from a core.async channel forever in a go-block until it's closed? The most naive example (go (while true (println (<! c)))) will consume nil forever
14:12seangrovednolen: Feel free to throw the patch I submitted out if it's the wrong idea. I thought a bit about how to keep the current warning behavior, but make it completely configurable (eventually by passing in custom handlers instead of a dynamic var), and this seemed like an interesting approach
14:12dobry-denIt's like I want a (while-let [val (<! c)] ...)
14:15dobry-denwait... i can just treat the channel like it's a seq
14:15dobry-deni realize my question is like "how can i consume [1 2 3] until i run out?"
14:19dobry-denactually that's not true. [1 2 3 nil nil nil ...[
14:41seangroveI wish nrepl.el associates would associate a "project" with an nrepl, and all of the buffers opened associated with a file in the project would automatically send their evaluations to their own nrepl. This would let me work on different projects at the same time without running nrepl-make-repl-connection-default or whatever when switching project eval targets.
14:42seangroveWorking on a wish list I have for clojure/script tooling for me and some new users around me. Posting that here in case it already does that.
15:30poppingtonicI'm wondering why specifying, in defproject, that ":main app_name.core", pointing to app_name/core.clj causes lein run to barf "could not find anything for app_name.core"
15:30bbloompoppingtonic: do you have a file called app_name/core.clj ?
15:30bbloomdoes it have namespace app-name.core in it?
15:30bbloomtry using a hyphen instead of underscore
15:32poppingtonicbbloom, yes. the underscore was used by lein
15:32poppingtonicuncer src/app_name/core.clj
15:32poppingtonic*under
15:35seangrovepoppingtonic: What's the first line in that file?
15:35poppingtonicbbloom: under defproject, should I use app_name.core for :main if the namespace is app_name.core?
15:35poppingtonicseangrove: (ns app-name.core
15:35seangrovepoppingtonic: Notice that it's app-name for the namespace, and app_name for the file
15:35bbloomi already said: "try using a hyphen"
15:39dobry-denI think core.async is my favorite abstraction in programming ever
15:41poppingtonicI've changed the folder name using dired from src/app_name/ to src/app-name and lein still looks for src/app_name/core.clj
15:41poppingtonicgiving: "Could not locate simple_blog/core__init.class or simple_blog/core.clj"
15:42bbloompoppingtonic: leave the folder name alone. it should be _
15:42bbloomfolders use _
15:42bbloomnamespaces use -
15:44poppingtonicbbloom: k, changed.
15:44poppingtonicmy :main is now simple-blog.core, and the core.clj's namespace is simple-blog.core. still getting "could not find anything for simple-blog.core"
15:45seangrovepoppingtonic: What's the file name?
15:46poppingtoniccore.clj
15:46seangroveI wish lein could give warning/guidance on this "It looks like you wanted simple-blog.core, but there's no path simple_blog/core.clj"
15:46seangroveWhat's the folder it's in?
15:46LauJensenWhich libraries do we have to handle cookies, when accesing a site which requires a login?
15:47seangroveWow, I've managed to accidentally block the javascript ui in a non-blocking fashion with core.async
15:47poppingtonicseangrove: the path from the folder I created in lein is simple-blog/src/simple-blog/core.clj
15:47seangrovepoppingtonic: the folder and file names *must* use underscores
15:47seangroveIf you see any hyphens in your file or folder names, it will not work
15:47poppingtonicrather, simple-blog/src/simple_blog/core.clj
15:48seangroveok, that should work then
15:48seangroveThe error is, "could not find anything"?
15:48poppingtoniclein created the simple_blog so it should be ok. yes, the error is still the same. so confusing.
15:49dobry-denwhat command are you trying to run
15:49poppingtonic"could not find anything to run for simple-blog.core"
15:50poppingtonicdobry-den: I'm trying to run a simple webapp using compojure/hiccup/httpkit/jdbc
15:50dobry-denpoppingtonic: do you have (defn -main [& args] ...) in simple-blog.core
15:50poppingtonicdobry-den: nope
15:50dobry-den:main simple-blog.core is telling leinwhere your -main is
15:51bbloompoppingtonic: most clojure web apps don't have main functions
15:51bbloomthey use jetty or something like that
15:51seangrovepoppingtonic: Maybe there's a pre-existing template that can get you started?
15:53poppingtonicseangrove: do you have anything in mind? though I'd like to figure this out anyway.
15:53dobry-denpoppingtonic: Here's the -main boilerplate I use in webapps https://gist.github.com/danneu/7173399
15:54seangrovepoppingtonic: If you're just getting started, probably shouldn't worry too much about figuring this out. Following a pre-existing structure and tweaking will be a better (and much more fun) way to learn it all.
15:55bbloomthe hash code discussions on the mailing lists are pretty interesting
15:55poppingtonicbbloom: I'm using http-kit which is supposed to be an alternative to jetty. Does that use -main?
15:56bbloompoppingtonic: *shrug* maybe you should read the http-kit docs?
15:56poppingtonicdobry-den: ty, checking it out.
15:56dobry-denpoppingtonic: yeah. -main is the entrypoint for when you compile it into an uberjar and run it `java -jar simple-blog.jar`
15:56bbloompoppingtonic: are you completely new to clojure?
15:56bbloommost clojure programs don't even start out with main
15:56bbloomthey start with some form being evaluated in a repl
15:57bbloomhttp://http-kit.org/ top right corner
15:57bbloomyou can just run that line of code
15:57bbloom& figure out main later
15:57lazybotjava.lang.RuntimeException: Unable to resolve symbol: figure in this context
15:57dobry-denpoppingtonic: In your -main: (run-server my-handler {:port 8080})
15:57dobry-denaccording to http-kit homepage
16:00dobry-denpoppingtonic: if youre making a website and trying to arrive at the ol webdev workflow: change code, reload browser. then i recommend Jetty
16:00poppingtonicbbloom: I'm reading cemerick's book as I work on a bunch of web tutorials.
16:01bblooma lot of folks try to start w/ web apps, b/c that's what they know / where they come from in php/ruby/python/perl/whatever, but i'm pretty sure it's a bad place to start for clojure, since the clojure web libraries are intentionally so minimal
16:01dobry-denpoppingtonic: if you want to see full boilerplate, type `lein new compojure simple-blog2`, cd into it, and then run `lein ring server`
16:01staaflconsidering that CLJ doesn't have right fold, what's the most elegant way to write this:
16:01staaflhttp://www.4clojure.com/problem/30
16:01dobry-denbbloom: i think webdev with compojure is one of the easiest entrypoints
16:02dobry-denbbloom: easier than sinatra and flask
16:02dnolenseangrove: it looks like a fine approach to me.
16:02poppingtonicbbloom: thing is, web-dev is where I'd like to end up.
16:02dnolenseangrove: should just wait on some feedback from chas
16:03bbloompoppingtonic: sometimes it is quicker and easier to start at the beginning, rather than try to jump to the end :-P
16:03bbloomstaafl: why would you need right fold?
16:03bbloom(for that problem)
16:04poppingtonicbbloom: well, i like nonlinearity :P
16:04staaflbbloom, because with that I can trivially check whether (== current-element (first aggregate-sequence))
16:04dobry-denjumping in is the way to go.
16:05poppingtonic^
16:05hyPiRionstaafl: with left fold you can do the same thing: (= current-element (peek aggregate-vector))
16:05bbloom*shrug* you're in hear struggling with getting a program to run. running code is something that generally has a very different workflow in clojure than in most languages you're used to. if you just try to go back to what you know, you won't get a chance to experience all the fun and interesting things about clojure. but whatever you wanna do
16:06staaflhyPiRion, this problem seems to expect the result as a seq, not a vector
16:06staaflincidentally, what is the double-equal operator for?
16:07bbloomstaafl: try the "doc" macro in your repl
16:07hyPiRionstaafl: double equality is for numerics. The problem expect not a seq, but a collection equivalent to the collection on the right
16:07hyPiRionE.g. ##(= [1 2 3] '(1 2 3))
16:07lazybot⇒ true
16:07staaflhyPiRion, hmm, interesting
16:07dobry-denbbloom: all poppingtonic (or any noob) needs is someone to point out the magical incantations that get the barebones running.
16:07staaflthen how would I do a strict value equality check?
16:08poppingtonichmmm..."used to". I'm used to Lisp. I've gone all the way through paip, OL, Land of Lisp, I'm learning clojure for pragmatic reasons.
16:08seangrovednolen: Sounds good
16:09staaflpoppingtonic, what's OL?
16:09bbloomdobry-den: the magic incantation is printed on the HOME PAGE for http-kit
16:09iwilcoxstaafl: Paul Graham's "On Lisp"?
16:09staafliwillig, I see, thanks
16:10bbloomdobry-den: unless you insist on running as main or in a servlet container. in which case you can read the docs for lein or the servelet container respectively
16:10iwilcoxstaafl: The question mark there was "probably", not me being incredulous that you didn't know :)
16:10poppingtonicbbloom, struggling is just what every conscientious noob goes through. Once I'm over the humps it'll be smooth sailing. I am asking for it, so that later, I don't have to.
16:10bbloomhttps://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md
16:11staafliwilcox, :-)
16:11bbloompoppingtonic: i'm telling you, if you want to get over the hump, just run that one line of code in your repl
16:11staaflso, how does one do a type-sensitive value comparison?
16:11staaflif '=' treats collections the same
16:11bbloomstaafl: = only treats sequentials the same
16:11dobry-denpoppingtonic: why are you using http-kit?
16:12staafl"compares
16:12staaflnumbers and collections in a type-independent manner"
16:12hyPiRionbbloom: and maps and sets?
16:12bbloomhyPiRion: yeah, was just typing something up about that
16:12bbloomthere are various implementations of maps, sets, etc. tree maps, hash maps, array maps. but they all test equal
16:13poppingtonicbbloom: done.
16:13poppingtonicdobry-den: it's what's used in the tutorial I'm reading.
16:13bbloomequality is *hard* and clojure takes a "best effort" shot at it. and frankly does a better job than any other dynamic language i know of :-P
16:13hyPiRionthe only iffy thing is that, even though (= x y), that doesn't mean (= (f x) (f y)).
16:15bbloomhow could you possibly have anything else that was still useful with respect to some abstractions?
16:16hyPiRione.g ##(map #(= (% '(1 2 3)) (% [1 2 3])) [identity pop peek #(conj % 0) #(cons 0 %)])
16:16lazybot⇒ (true false false false true)
16:16gfrederickshyPiRion: or trivially the class function
16:17hyPiRionyeah
16:18gfredericks(map #(System/identityHashCode %) [42 (* 2 3 7)])
16:18gfredericks,(map #(System/identityHashCode %) [42 (* 2 3 7)])
16:18clojurebot(17901622 17901622)
16:18hyPiRionhuh
16:18gfredericks,(map #(System/identityHashCode %) [42000 (* 2 3 7 1000)])
16:18clojurebot(11491449 31030949)
16:18gfredericksthar we go
16:19dobry-denpoppingtonic: well if you need help, hit me up
16:19hyPiRiongfredericks: well, that's just because small ints are interned
16:19gfrederickshyPiRion: sure; but my point is that those two things are distinguishable via some f
16:19gfredericksso is it iffy for them to be =?
16:20bbloomspeaking of hashes :-P
16:20bbloomdoes anybody know of any literature on hashing of composites?
16:21bbloomnot too many languages use composites for keys like clojure does outside of basic tuples
16:21hyPiRiongfredericks: I meant more commonly used functions, like pop and peek. If you combine in an nth, you may suddenly get surprises if you're not aware of the difference.
16:21gfredericksspeaking of funny keys
16:21bbloomcurious if there is some reading to help with that thread
16:21hyPiRionSure thing, I'm not aware of any better way of fixing it, I'm just saying that it may be a pitfall
16:21gfredericks,(assoc {#"foo" 12} #"foo" 42 #"foo" "some other value")
16:21clojurebot{#"foo" "some other value", #"foo" 42, #"foo" 12}
16:22hyPiRionwat
16:22bbloombwha?
16:22hyPiRion,(= #"foo" #"foo")
16:22clojurebotfalse
16:22poppingtonicdobry-den: the boilerplate's good. I'm studying it now. ty for all the help.
16:22hyPiRionwell, there we go I guess.
16:22gfredericksyep
16:22gfredericksI had a coworker using regexes as keys in a map is why I discovered that
16:22hyPiRion,(ckla
16:22clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
16:22bbloom,(let [f (fn [] #"foo")] (= (f) (f)))
16:22clojurebottrue
16:22hyPiRiontypo of the day
16:23hyPiRion,(class #"foo")
16:23clojurebotjava.util.regex.Pattern
16:23gfrederickspresumably it doesn't override equals
16:23hyPiRionSo the issue is that the Patten class doesn't implement equality properly then
16:23gfrederickswhich seems fair to me
16:23bbloom= doesn't always rely on equals
16:23gfredericks,(.equals #"foo" #"foo")
16:23clojurebotfalse
16:23gfredericksI think regex equality is about as shady as function equality
16:24gfredericksso the current behavior seems right
16:24bbloomgfredericks: not "about", it absolutely is
16:24gfredericksbbloom: well restricted regexes you could conceivably compare
16:24gfredericksbut I don't think anybody wants the jvm running a DFA minimization algorithm every time you compare regexes
16:24bbloomheh
16:24coventrygfredericks: I get your point with functions, since they close over things. But a regexp's behaviour is entirely determined by its string encoding, isn't it?
16:25gfrederickscoventry: but some different regexes do the same thing
16:25gfredericks#"aaa" versus #"a{3}"
16:25gfredericksshould those be equal?
16:25hyPiRioncoventry: It's a question of equality
16:25dnolenthinking about how to make incremental CLJS compilation less lame, especially for stuff like source maps and constants - does it make sense to cache analysis results to disk and reuse them? crazy?
16:25TimMcgfredericks: I'm working on URL equality at work. That's good times...
16:26gfredericksTimMc: WAT
16:26hyPiRionheh
16:26bbloomdnolen: i've cached analysis results for various purposes when debugging & experimenting. the printed representation is LARGE b/c it is highly redundant
16:26gfrederickshyPiRion: when should two unidentical URLs be considered equal?
16:26gfrederickswai
16:26gfredericksTimMc not hyPiRion
16:26bbloomdnolen: and re-reading it in is absurdly wasteful in memory
16:26gfredericksyou guys are the same to me
16:26dnolenbbloom: not all analysis, in this case probably just constants and source map info
16:27TimMcgfredericks: Case differences in protocol, hostname, or percent-encoding; "/" vs "" path
16:27TimMcumm... you can argue about :80 vs no port on http
16:27gfrederickswhat about query params reordering?
16:28TimMcIIRC, the URI spec identifies 4 levels of equality.
16:28TimMcSure.
16:28bbloomhell, comparing a URL to itself isn't even useful, since the server might change on you ;-)
16:28gfredericksI assume somebody wants to do it
16:28bbloomdnolen: for particular use cases w/ carefully designed serialized values, it's probably a sensible idea if profiling proves it helps
16:28coventryIf only everyone used urbit, we might have a referentially transparent web.
16:28gfrederickshard to track where your users are going on the internet if every visit is to a unique location
16:28staaflhelp request: https://www.refheap.com/20183
16:29bbloomdnolen: would be nice to save the full analyzer state though, but it's only really infeasible b/c there is no way to serialize with sharing & recover it upon deserialization
16:29staaflsolving http://www.4clojure.com/problem/31 and getting weird error :-/
16:29bbloomstaafl: really should tell us what the error is, if you want us to help
16:30staaflbbloom, ClassCastException clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack clojure.lang.RT.peek (RT.java:634)
16:30staaflit's in the paste
16:30staaflhmm, actually I think I see it now
16:31staafl'butlast' returns a seq and the next 'peek' chokes on that
16:31staaflis there a butlast alternative for vectors?
16:31coventrystaafl: (use 'clojure.repl) (pst) to find the stack frame which refers to your source code.
16:31gfredericksstaafl: pop?
16:31hyPiRionstaafl: subvec
16:32hyPiRionyeah, gfredericks' answer is better
16:32bbloomdefinitely not subvec :-P
16:32staaflcoventry, gfredericks, hyPiRion, thanks!
16:32hyPiRionbbloom: psh, I like to leak memory
16:33gfrederickswhat is this urbit.org
16:33coventrygfredericks: It's this crazy utopian thing about fixing the brokenness of the internet.
16:34coventrygfredericks: http://www.slideshare.net/JohnBurnham1/pcloud
16:34seangrovetechnomancy: Any ideas on this uberjar problem? https://www.refheap.com/a915c8d2e8b40d24056836a3b
16:34gfrederickscoventry: this looks crazy and utopian and something I would try if I had lots of time
16:35coventrygfredericks: Oh, yeah, it's also glorious.
16:36gfredericksif I didn't think security was impossible I might read this further :)
16:36hyPiRionseangrove: `with-profile +uberjar` perhaps? I'd guess you discard the base profile and that throws away the :main class
16:37hyPiRioneither way, the uberjar task loads the uberjar profile by default
16:43coventrygfredericks: I agree, his confidence in his security measures sound a little hollow to me.
16:43gfrederickssubvec at least composes fine
16:44poppingt`"extreme commoditization of computing semantics"?
16:44gfrederickscoventry: I do like the idea of an extremely pure computation environment; just not for the purpose of personal security
16:44bbloomyeah, i just read through some gobblty gook on that page & closed it
16:46poppingt`I won't call it a troll, but it definitely is minimally hilarious.
16:46gfredericksHoon's goal is to be the C of functional programming
16:47bbloomyeah, um i don't know of that analogy provides any insight
16:47bblooms/of/if
16:48gfredericksoh man figure this one out:
16:48gfredericksHaskell has higher-order type inference; Hoon has “higher-order” “type” “inference.”
16:48poppingt`http://xkcd.com/356/
16:51seangrovehyPiRion: No luck. Same error. I have another project with working AOT, I'll take a look at it first
16:52hyPiRionseangrove: perhaps running a `lein clean` does it. Sometimes that just seem to help
16:55coventrypoppingtonic, gfredericks: The real crazy starts when you realize what his world-domination plan looks like. https://groups.google.com/forum/#!topic/urbit-dev/krwrSf0Mwoc
17:02sritchiecoventry: woah, looking at orbit now
17:02sritchieurbit
17:07tbaldridgeokay, I just joined the channel, is urbit a language?
17:10tbaldridgeI remember this now. I read the intro page and had then died of technospeak overkill.
17:14dobry-denso who's implementing clojure on top of urbit's nock vm?
17:14dobry-deni think that's the elephant in the room
17:15sritchiepoll - what are your favorite emacs packages for Clojure dev?
17:15sritchieprojectile + helm has been amazing for dev, for me
17:15sritchie(not really clojure specific)
17:15dobry-denevil
17:17typeclassydobry-den: i'm eagerly awaiting the emacs clone, in clojure, on nock
17:20dobry-denthat sounds like a cool project if i ever find out im immortal
17:21poppingtonicbbloom, seangrov1, dobry-den: the boiler works fine with the code I'd written. I'm now making good progress in my learning. Thank you again.
17:21poppingtonic*boilerplate
17:21dobry-denyeah homie
17:21poppingtonic\\//
17:22dobry-denonce you get the make-code-change -> reload-browser workflow going, things are pretty simple
17:23poppingtonicyep, that's where I am now. as it should be.
17:27poppingtoniccan the programming language in use be a bottleneck in deep learning work?
17:29xuserWhat do you mean by that?
17:32poppingtonicyou can arrange programming languages in a hierarchy based on how fast they carry out certain kinds of operations. so, doesn't that factor into the kind of process-intensive computations that happen in deep learning?
17:32nightflyThat factors into solving any problem
17:33nightflynot sure what you mean by 'deep learning'
17:33poppingtonichttp://deeplearning.net
17:34poppingtonichttp://deeplearning.net/software_links/
17:36typeclassyit's possible for particular language implementations to be poorly suited for particular problems
17:36nmqHey guys, any idea why I get the following with submting a file using compojure: java.lang.IllegalArgumentException: Cannot open <{:size 60143, :tempfile #<File /var/folders/_m/xph2n7j95clg7t9ymvxpy0dh0000gn/T/ring-multipart-3539559773558335532.tmp>, :content-type "text/csv", :filename "file.csv"}> as an InputStream.
17:37nmqwhen submitting*
17:37typeclassyyou should profile first before getting nervous about it
17:39nmqio/reader doesn't like the file I plock off the request
17:39nmqpluck*
17:40dobry-dennmq: it doesn't like the File in that :tempfile key?
17:41nmqI was passing the whole map
17:42dobry-dentry (io/reader (:tempfile <map>))
17:44nmqBeautiful, thank you dobry-den!
17:48dobry-dennmq: it's because that map is nothing special, just some metadata that ring provides for you. it might as well be {:foo "lol"}
17:49dobry-denbut io/reader knows how to handle the File type
17:49nmqI see, that makes sense
18:26n008I am a total newbie to clouure
18:26n008s/clouure/clojure
18:27n008can you run clojure outside a jvm ?
18:27typeclassyyou can use clojurescript
18:27coventryn008: What are you trying to do?
18:28piskettin008: also https://github.com/clojure/clojure-clr
18:29dnolenCLJS source maps now work even w/ no Closure optimizaitons - http://github.com/clojure/clojurescript/commit/b924f8e0fab8cc00ef5e47719f8b4984685abda4
18:29n008coventry: nothing just looking around
18:29n008thanks pisketti
18:32ta479n008: https://github.com/takeoutweight/clojure-scheme
18:35ta479n008: if you want something faster you're going to have to roll your own
18:40n008ta479: what is clojure-scheme
18:42ta479clojure -> scheme -> C -> machine code compiler
18:57bbloomdnolen: good stuff
18:57dnolenbbloom: yes. much nicer experience.
19:00bbloomif i ever dig my way out of this js/rb hell, maybe i'll get to try it out
19:00xusernice!, they should have used chicken scheme ;)
19:02TimMcgfredericks: I don't know what this urbit thing is, and I'm not sure I want to take the time to figure it out. :-P
19:06dobry-dendnolen: hell yeah
19:07dnolendobry-den: yep, it's pretty nice
19:11grncdrdnolen: you are east coast right?
19:12grncdrI need to remember to buy you a beverage of choice if I'm ever in the area
19:12akurilinbitemyapp, aah, you guys allowing people to manually set postgres :subname if we want to instead of forcing users to compose it from the other keys is a good idea
19:12akurilinbitemyapp, that whole "override configs" pattern is great
19:12dnolengrncdr: yes :) appreciated
19:13dnolengrncdr: I did some light testing, it appears to me that incremental compilation and source maps should always work, lemme know if you encounter a case where it doesn't.
19:14grncdrwill do, I still don't know how to use a git version of clojurescript in my project yet
19:14grncdr(and probably shouldn't, what with my new-shiny addiction)
19:14dnolengrncdr: yeah no worries, a new version will be out a few days, I want to get the warning enhancement in and that's it
19:18grncdrtoo late, I found this: https://github.com/emezeske/lein-cljsbuild/wiki/Using-a-Git-Checkout-of-the-ClojureScript-Compiler going to see if it breaks my project ;)
19:18grncdrbtw, with core.async, is it possible to use (<! ...) in a function called by a go-block?
19:18grncdrlike (go (my-func ...)) where my-func contains the <!
19:20dnolengrncdr: only shallow yield, very much like C# and ES 6 generators
19:20bbloomgrncdr: no, you need to use an extra channel/go/<1
19:20grncdrah ok
19:20bbloomgrncdr: it's a lexical transform in a macro, it can't go inside opaque calls
19:20coventrygrncdr: go is a macro. If it can't see the <! symbol in the form it's passed, it won't do anything about it.
19:20grncdrright, that makes sense
19:20grncdrit was just odd that I was getting the exception at run-time then
19:21grncdrbut I can see why, if go is a macro and <! isn't
19:21cgaganyone used postal for sending email? It's taking like a full minute to "send" an email, returning success, but never actually sending the email for me
19:22cgagkind of at a loss for how to debug such a thing
19:23Brand0postal?
19:24Brand0it could be a lot of things, where are you trying to send, for one?
19:25cgagmailtrap at the moment
19:26Brand0any encryption?
19:26cgagnope
19:26Brand0do wireshark or tcpdump or something like that to see what's going on with the connection
19:38bitemyappakurilin: yep.
19:53akurilinbitemyapp, Have you guys never found any use for "prepare" outside of update/insert? Would be neat to be able to e.g. transform keys of where clause before running the query.
19:53bitemyappakurilin: not personally, no.
19:54bitemyappakurilin: seangrov1 uses Korma too though, could ask him.
19:57grncdrdnolen: I get OutOfMemoryError when compiling with source maps on the latest master, probably because it's compiling the compiler and I should set a JVM flag somewhere?
19:58akurilinbitemyapp, seangrov1 my thought process is that korma already allows you to map table names and query result keys with table and transform, so it might be interesting to do the same for prepared statement maps.
20:00bitemyappakurilin: are you into electronic music?
20:01akurilinbitemyapp, don't go out of my way for it, but I do have a few artists here in the genre that I enjoy
20:01bitemyappakurilin: I'm roughly in the same position but I'm trying to force myself to go out more. Anyway, Huxley at Monarch tonight.
20:03akurilinbitemyapp, will have to check them out on spotify or something
20:03bitemyappakurilin: https://soundcloud.com/huxley_uk/let-it-go-original-mix
20:12akurilinbitemyapp, brain gets really confused when switching from post-metal to electronica
20:15bitemyappakurilin: I didn't know you listened to post-metal. I listen to a ton of post-metal/blackgaze/black metal, and post-rock.
20:15bitemyappakurilin: http://bandcamp.fallenempirerecords.com/album/endlichkeit-i-ii
20:18akurilinbitemyapp, I like black, although I somehow rarely end up actively listening to it unless it's fairly prog/folk-infused a la Enslaved or Agalloch etc.
20:19akurilinBest part is Norwegians in full leather and nails outfits running around frozen woods.
20:26akurilinbitemyapp, pretty raw, like it. I imagine you're familiar with Alcest?
20:26bitemyappakurilin: one of my favorite bands :)
20:27akurilinbitemyapp, I approve.
20:27bitemyapphe has a new album coming out soon.
20:27bitemyapphttp://en.wikipedia.org/wiki/Les_Voyages_de_l'%C3%82me I have this one in my car.
20:29bitemyappakurilin: some doom inspired stuff: http://chelseawolfe.bandcamp.com/
20:31akurilinbitemyapp, nice. I'm literally all about discovering new bands/subgenres.
20:31akurilinbitemyapp, are you on Spotify?
20:31bitemyappsf examiner's website is noticeably slow.
20:32bitemyappakurilin: yeah, my account on spotify is the same as my name.
20:32dobry-denbitemyapp: dude, state machines are exactly what i wanted.
20:32bitemyappdobry-den: told you.
20:32bitemyappdobry-den: use ztellman's automat. 'tis cool. :)
20:32dobry-deni built one myself with core.async/go-loop
20:32bitemyappnifty.
20:32bitemyappdobry-den: do you send valid results down a channel?
20:34dobry-denit started that way. but then i watched dnolen's core.async video and now it's a chain of a few channels
20:35bitemyappI usually start with one channel and start chaining or broadcasting afterward.
20:36dobry-denit starts with a channel that reads bytes from the socket, and then one that parses the stream into events [:end-of-stream, :valid, :invalid, :timeout] with a payload.
20:37akurilinbitemyapp, yeah I don't think I can add you there without FB, and your FB SEO is rough :)
20:38bitemyappakurilin: blargh. let me log into spotify and see what I can rustle up.
20:39bitemyappakurilin: I have one of the pre-FB grandfathered accounts so Spotify is hella weird about following people sometimes.
20:40akurilinbitemyapp, yeah I figured, they're probably trying to weed you guys out :)
20:40akurilinI hate that about my apps, stupid backwards compat.
20:40bitemyappakurilin: added you on FB
20:42bitemyappakurilin: alright, gotcha followed now.
20:43akurilinbitemyapp, yeah I'm running ubuntu spotify, not sure I'll ever see you on there lol.
20:43bitemyappakurilin: I used to use the Linux client, it was surprisingly decent but still the red-headed stepchild.
20:43sritchietechnomancy: have you seen this before?
20:43sritchiegpg: cancelled by user
20:43sritchiegpg: cancelled by user
20:43sritchiegpg: decryption failed: secret key not available
20:43sritchiebut that's not the case
20:44bitemyappsritchie: are you trying to deploy?
20:44sritchieyeah, a snapshot
20:44sritchiegpg -d ~/.lein/credentials.clj.gpg works fine
20:44bitemyappsritchie: https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md https://github.com/technomancy/leiningen/blob/master/doc/GPG.md
20:44sritchieyeah, I've been through all of that
20:44Apage43i've had stuff like this happen when my gpg-agent gets wedged
20:44bitemyappsritchie: https://github.com/technomancy/leiningen/issues/1349
20:44sritchiehaha, I filed that
20:44bitemyappoh, right.
20:44bitemyappnuts.
20:45akurilinbitemyapp, you seriously have brontide as one of your playlists?
20:45bitemyappakurilin: no, just discovered it through you.
20:45bitemyappso *now* I do.
20:45bitemyappokay okay, 5rlz. I need to get ready for sushi.
20:45bitemyappakurilin: I have Post, Black Metal, and Blackgaze playlist folders, should find some stuff in there.
20:45bitemyappakurilin: I highly recommend the Great Old Ones!
20:46akurilinbitemyapp, deal.
20:46bitemyappthey're right on the knife's edge between epic black metal and blackgaze, it's wonderful.
20:46bitemyappCatch y'all latah.
20:50sritchiebitemyapp: yeah, gpg-agent cancels my business
20:53sritchieugh
20:53sritchiewell, whatever
20:57grncdr?
20:57grncdrer, hm, I had question before that...
20:58grncdris this wiki page a sensible way of using a custom build of the clojurescript compiler? https://github.com/emezeske/lein-cljsbuild/wiki/Using-a-Git-Checkout-of-the-ClojureScript-Compiler
20:59grncdrit seems like it's building quite a bit of stuff, whereas (I think) I'd really like to just build the cljs compiler and use it, without it being part of each build
21:01akurilinAm I correct to suppose that it's generally better to let SQL DB clients sort result sets to avoid adding more work on it?
21:01akurilinAs in, you can have plenty of clients, but the one DB often tends to be the bottleneck, so it might not be worth it to give it extra work if you can handle it just fine down stream
21:02grncdrakurilin: if you're sure the clients can handle it, then yes
21:02grncdrreally depends on the particular result set unfortunately
21:04grncdrlike, if your db server is a bottleneck for results sets that the client can easily sort itself, you probably need to address the performance issue at the DB sooner rather than later ;)
21:05akurilingrncdr, yeah I get what you mean, thanks.
21:05akurilingrncdr, just wanted to confirm that my line of thinking was potentially sane for some scenarios
21:08grncdrfor every line of thinking there exists some scenario which has the potential to make it seem sane
21:09grncdrthe real trick is recognizing when the scenario is (becoming) insane and cut it off before you start doing really ridiculous things ;)
22:19holohi
22:59holois there some way to to return regex match strings with some string/keyword label associated? like with re-seq it would return [{:a "foo"} {:b "bar"}] for input "foo" "bar" . labels to be returned would be specified in each pattern group
23:00holo*input is "foobar", for that example
23:09dobry-denholo: i dont remember what (group) matches look like in the return, but cant you just destructure it?
23:11holodobry-den, i want something like provided by clojure-opennlp with post-tag: (pprint (pos-tag (tokenize "Mr. Smith gave a car to his son on Friday."))) - https://github.com/dakrone/clojure-opennlp
23:11holo(["Mr." "NNP"] ["Smith" "NNP"] ["car" "NN"] …)
23:12holodobry-den, i guess this is out of regex domain or that of clojure core fns. i should probably look further into clojure-opennlp
23:13dobry-denyeah im pretty useless, to boot
23:14holoi'm thankful anyway
23:16dobry-denCore.async question: Here's an attempt to wrap a Socket's stream with a channel that returns 0-255, :end-of-stream, or :timed-out. https://www.refheap.com/20187
23:16dobry-denI'm not proud of it but it seems to work. Any tips for a less bad approach?
23:19dobry-denA timeout socket is created on every loop iteration because i only want to timeout since the last byte received.
23:19dobry-dentimeout channel*
23:30akurilinOh man, I don't even know where to start with respect to dirty repls and the headaches you can give yourself.
23:31dobry-denakurilin: what's a dirty repl
23:31holoprobably he means state
23:31dobry-dener, i mean an example
23:32akurilinwell.. dirty state. You move a function to a different namespace and start editing it there, your old namespace is still referring to the old one
23:32dobry-denhaha yes
23:32dobry-denevery day
23:32akurilinso you change it, unit test it to death, with absolutely no results
23:32holoakurilin, i didn't even start, so i just restart :D
23:32akurilinthis is the part where I need to kick myself in the ass and setup Sierra's workflow
23:33akurilin*set up
23:33holoakurilin, i must setup Sierra's worflow someday, but it's hardcore indeed
23:34dobry-den"surely i'll sit down and implement it someday"
23:35holo..someday..
23:35dobry-den"surely ill catch up on the mass of links in my favorites folder that's become a repository of things that look cool but im too lazy to actually read"
23:36holodobry-den, i leave one-time reads in a kind of stack (getpocket), not favorites
23:36holoi mean, one-time potential reads
23:36akurilinas long as you're getting there at some point
23:36dobry-denbut that's the thing. out of guilt and shame i begin to avoid the stack
23:36akurilinPocket scares me, it grows at a much faster pace than I can read it :)
23:36akurilindobry-den, that
23:39holoto balance my shame now, after reading some good article or video, i stack it on "read articles" of stackoverflow careers
23:39akurilinhah
23:39akurilintechnical videos are the worst
23:39akurilinthey just sit there in Firefox for months and months
23:39akurilinlooking at you
23:39akurilinmocking you.
23:40holoakurilin, those are the best.. i tend to watch them while eating. this way i can look at the food while listening
23:40akurilin"Guess who's been eating up 500mb of your memory since February, son"
23:40holohahaha
23:41arrdemthis is what emacs deft is for.. get the a "to watch" list!
23:41arrdems/the/thee/
23:42dobry-denit's hard to bounce back feelin like a self-control champ when you buy a year-long subscription to Peepcode and can't even manage to watch one
23:42holoanyone tries to read clojure mailing list months old on inbox, out of guilt?
23:44dobry-deni just dont use that account anymore
23:44dobry-denclojure mailing list was least of my problems