#clojure log - Oct 26 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:33 akurilin: Man, macros do not give you a nice exception when something goes wrong in there.

0:34 You just get the line where the macro is invoked and good luck after that.

0:34 Am I missing some trick here to get a more accurate stack trace?

0:42 bitemyapp: akurilin: writing macros that fail gracefully is an ancient artform handed down from the LISPers of yore to the Common Lisp community

0:43 akurilin: it is deep and ancient knowledge largely forgotten by the functional programming community.

0:44 akurilin: bitemyapp, so not something I'd be able to dig up online specifically for the Clojure context?

0:44 bitemyapp: there'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

0:44 macros in Clojure are supposed to be the VERY simple final cherry on top. - that's it.

0:45 function composition is better.

0:45 we don't have funcall here, we don't need macros so much.

0:46 akurilin: I can definitely see why you'd want them to be as thin as possible.

0:46 bitemyapp: there are tomes of macronic knowledge out there. You're better served in the short and long term by becoming comfortable with HOF.

0:48 noonian: bitemyapp: HOF?

0:48 seangrove: hof?

0:48 Damnit clojurebot...

0:48 bitemyapp: higher order functions

0:48 noonian: ah

0:49 seangrove: clojurebot: HOF is Higher order functions

0:49 clojurebot: You don't have to tell me twice.

0:49 seangrove: hof?

0:49 HOF?

0:49 clojurebot: HOF is Higher-Order Function

0:49 * seangrove holsters clojurebot, secure in the knowledge that he'll beat bitemyapp on the draw next time

0:49 ddellacosta: haha

0:51 bitemyapp: seangrove: maybe. I am multitasking answering questions with StarCraft 2

0:51 my APM is insane right now

0:51 coventry: akurilin: What exception are you getting?

0:51 seangrove: bitemyapp: Sure, rub it in.

0:52 ddellacosta: hmm, none of you have set up init scripts for java (a.k.a. clojure web app) on Gentoo, have you?

0:52 bitemyapp: ddellacosta: only upstart, sorry.

0:52 not insane enough to go for full RICE MODE

0:53 I have some nice tooling for provisioning clojure servers in pythno though

0:53 ddellacosta: bitemyapp: yeah, I guess I should have not picked a gentoo build on ye ole' rackspace account

0:53 habit mostly

0:53 coventry: akurilin: 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

0:53 bitemyapp: ddellacosta: the best choices are questionable ones.

0:53 * ddellacosta considers moving to ubuntu like all the cool kids

0:53 akurilin: coventry, 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

0:53 with no obvious way of figuring out which line within the macro it was

0:53 ddellacosta: bitemyapp: haha, touché

0:56 akurilin: *exception handler

0:57 the best way of debugging that I know is to just manually write the macro around the chunk of code causing trouble. Not very elegant...

0:58 bitemyapp, what's full rice mode?

0:59 ddellacosta: actually, I wanted to ask too, but just figured it meant "from scratch" or something.

1:01 Sgeo: Wonder if someone made ir-macro-transformer for Clojure

1:01 seangrove: ricers...

1:02 http://lug.wsu.edu/node/154

1:02 My main experience with Gentoo as a serious thing was setting up a small web-hosting side business using modded used-xboxes

1:03 It was a waste of time.

1:04 nightfly: seangrove: Sounds like an awesome waste of time though

1:04 coventry: akurilin: 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.

1:04 ddellacosta: seangrove: 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.

1:05 seangrove: 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.

1:06 seangrove: nightfly: I can write it off as a silly teenage learning experience, sure :)

1:06 ddellacosta: when I think back on all the configuration I used to do, though, holy crap what was I thinking.

1:06 seangrove: ddellacosta: Yeah, I just go with ubuntu. If I want to do crazy, cool, and minimal, I'll do a BSD flavor

1:07 I'll never forget the wonder of installing an amazing OS off of a floppy boot disk, ports... ah...

1:07 And yet, *still* doing nothing useful with it at all

1:07 ddellacosta: seangrove: I'm getting flashbacks to one of the two times I installed OpenBSD for "fun" as we call it

1:08 xuser: openbsd makes a nice firewall/router

1:09 +for

1:10 akurilin: coventry, the sequence you wrote down prints the macro to the terminal in a fully expanded form?

1:11 coventry: akurilin: No, but riddley.walk/macroexpand-all works in most cases, if that's what you want.

1:11 akurilin: coventry, just trying to understand what exactly (-> form macroexpand pprint) does

1:11 (still not fully grokking the whole quoting business)

1:14 coventry: akurilin: E.g., try something like ##(clojure.pprint/pprint (macroexpand '(deftype eg [])))

1:14 lazybot: java.security.AccessControlException: access denied (java.util.PropertyPermission line.separator read)

1:16 akurilin: interesting

1:18 coventry, yeah apparently you can actually paste the output of that into the repl and it will run just fine

1:20 coventry: Yep, that's all a macro does.

1:21 akurilin: coventry, I'll explore further then, thanks!

1:24 ddellacosta: Setting 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.

1:24 dobry-den: at the very least, uberjar boots faster

1:25 akurilin: is this for production?

1:25 bitemyapp: ddellacosta: uberjar.

1:26 ddellacosta: aot all + uberjar

1:26 ddellacosta: akurilin: it's just for setting up a toy site (a.k.a. blog)

1:26 bitemyapp: ddellacosta: and make your init process separate functions that main merely calls

1:26 ddellacosta: take-down functions can be useful too.

1:26 ddellacosta: bitemyapp: 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

1:27 bitemyapp: ddellacosta: 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.

1:27 ddellacosta: bitemyapp: 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

1:27 bitemyapp: I mentioned this earlier today in the channel.

1:27 ddellacosta: bitemyapp: ah, sorry, misunderstood

1:27 bitemyapp: why install leiningen in production?

1:28 I'd rather my only dependency be java -jar

1:28 akurilin: I've been pretty happy with runit calling chpst on java -jar in prod

1:28 ddellacosta: bitemyapp: okay, yeah--that logic makes sense. Reducing dependencies always good.

1:29 akurilin: the other issue is that automating leiningen deployment is not super straightforward afaik

1:29 bitemyapp: I don't think it's bad at all, lots of people will just do 'lein ring server :headless' in production. I don't - though.

1:29 I prefer to rsync jars.

1:30 I prefer build artifacts over dynamically downloading dependencies in production.

1:30 I hated random download failures and other sources of chaos in my Python work, I don't know why I would risk it in Clojure.

1:30 Having universally deployable build artifacts is a freakin' joy.

1:31 ddellacosta: akurilin, 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

1:31 in any case, thanks bitemyapp, as usual your feedback is really helpful!

1:31 dobry-den: It's convenient having git repo in production even if you use uberjar. I've Tramped into production to analyze state.

1:32 ddellacosta: dobry-den: ideally I have a staging production with the exact same env as production where I can do stuff like that

1:32 bitemyapp: that's what I use embedded NREPLs for.

1:32 guys, you don't need to do that.

1:32 dobry-den: come at me

1:32 bitemyapp: tag your releases, tunnel into the production nrepl

1:32 inspect REAL live server state and test assumptions.

1:32 no excuses.

1:33 akurilin: bitemyapp, or just firewall 7888 to your VPN

1:33 dobry-den: sometime's youve just gotta reverse tunnel your production server to localhost and do it live

1:33 ddellacosta: bitemyapp: 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

1:33 bitemyapp: that's what I do.

1:33 ddellacosta: I know what I do in production could or couldn't break the server, I test accordingly.

1:34 I have a dev environment that I can trash/refresh at will too.

1:34 ddellacosta: bitemyapp: yeah, I mean, I suspect we are in agreement here in the end

1:34 bitemyapp: dev meaning deployed and essentially "staging"

1:34 ddellacosta: yep

1:34 bitemyapp: I really think people should seriously consider putting embedded nrepl servers in their deployed Clojure services

1:34 it's a life-saver when you need it. Really.

1:35 ddellacosta: makes me seriously nervous from a security point of view, but I can see the value

1:35 benkay: bitemyapp i love your style

1:35 bitemyapp: ddellacosta: I bind to localhost and reverse tunnel.

1:35 ddellacosta: nobody has access to the nrepl unless they have the ssh keys.

1:35 benkay: thanks!

1:36 ddellacosta: hmm, okay.

1:36 bitemyapp: nrepl servers bind to localhost by default. The devs that wrote it ain't dumb :)

1:37 benkay: it also is possible to install emacs on remote boxen and use that in production

1:37 bitemyapp: ddellacosta: 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.

1:37 benkay: meh. I like having my native environment with the nrepl because then I can jump around the code quickly.

1:38 it also frees me from having the git repo on each server.

1:38 Something I don't especially want to do.

1:38 benkay: native environment?

1:38 bitemyapp: benkay: I have a pretty thick stack of elisp in my dotfiles.

1:39 benkay: it's about 410k LOC of elisp in a 95% custom setup.

1:39 I don't want to ship around and configure that for each server.

1:39 I'd rather reverse tunnel and point my local Emacs at the connection.

1:39 benkay: oh meaning connect from local Emacs

1:39 bitemyapp: yes.

1:39 benkay: ha!

1:40 I must do this.

1:40 ddellacosta: bitemyapp: 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!

1:41 bitemyapp: ddellacosta: I automate with Fabric + Cuisine, which is basically Chef for people that are too busy to do dev-ops for a living.

1:41 automate provisioning and deployment, that is.

1:41 configuration is 100% based on env files with exports and weavejester's environ.

1:42 ddellacosta: bitemyapp: 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

1:43 I'll check out fabric/cuisine

1:43 bitemyapp: ddellacosta: cuisine is basically a library of simple idempotent operations for "chef-like" provisioning with Fabric.

1:43 akurilin: I like envdir files for storing configurations

1:43 bitemyapp: you could potentially do a better job with Ansible or Saltstack, but Fabric SUUUUUPER simple so I have a hard time abandoning it.

1:44 benkay: for some values of better

1:45 ddellacosta: right, ansible was the other one folks suggested I look at

1:45 last time I spent half a day struggling with pallet, and unfortunately had to give it up. Will try again sometime though.

1:46 bitemyapp: ansible is recently popular and sits somewhere between fabric and saltstack in terms of "SCALE"

1:46 ddellacosta: I've done a decent sized chunk of dev-ops work and I couldn't get pallet do anything useful for me.

1:46 if you need amazon API integration, just use Amazonica IMO

1:46 technomancy: bitemyapp: thanks for saving me the trouble of breaking cemerick's heart re: google go

1:47 ddellacosta: bitemyapp: 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.

1:47 bitemyapp: technomancy: no problem. I'm the all-dancing, all-singing evil sock puppet at your disposal.

1:47 technomancy: it 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

1:48 bitemyapp: ddellacosta: they're nice people, but have a weird way of thinking about machine provisioning, deployment, and configuration.

1:48 technomancy: how do they manage it

1:48 http://p.hagelb.org/mystery.gif

1:48 ddellacosta: heh

1:49 bitemyapp: ddellacosta: the SF Clojure meetup talk I went to was about Pallet

1:49 I successfully diverted post-presentation conversation *away* from Pallet.

1:50 ddellacosta: bitemyapp: haha, I remember that day actually. Sounds like it was kinda painful. :-(

1:50 bitemyapp: a weetle.

1:50 Met some really awesome people though.

2:14 dobry-den: is there a named concept that describes a way of reading bytes from a stream and executing logic when they follow certain footprints?

2:14 Like, "if i encounter 0x01, then ignore all following bytes until 0xff. then print the following byte"

2:16 Or "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"

2:17 bitemyapp: dobry-den: you mean like finite state automata?

2:18 dobry-den: https://github.com/ztellman/automat

2:18 dobry-den: ill 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

2:19 bitemyapp: dobry-den: just wondering, did you go to school?

2:20 dobry-den: what do you mean

2:22 xuser: dobry-den: what's 1 * 1?

2:22 dobry-den: not for computer science

2:23 yeah, i know im the channel idiot but i also rarely encounter any body using clojure near my experience level

2:23 Apage43: aw man, go happened above

2:24 i'm the lone clojure guy at work sitting across from the go corner

2:25 I think I'm winning one guy over though

2:26 who's wanting features/changes in a thing I built, and I just walk him through making the change

2:28 dobry-den: Apage43: yeah it takes some hustlin to turn your wolfpack of 1 into a wolfpack of 2

2:28 bitemyapp: Apage43: http://i.imgur.com/J15AClk.png

2:28 Apage43: haha

2:28 bitemyapp: I have a wolfpack of 2 serious Clojure users with an expanded set of 4-6 people at my company.

2:28 seangrove: o_O

2:29 ddellacosta: bitemyapp: I feel deeply offended, which is to say I love it

2:29 Apage43: it's enough to just watch them across the desk divider trying to come up with a solution to freeze their dependencies

2:29 bitemyapp: Apage43: aren't there like 35 package management/freezers/etc out there for Go now?

2:30 ddellacosta: bitemyapp: btw, got "hello world" up and running with uberjar + custom gentoo init script, thanks for the help. Stoked.

2:30 bitemyapp: Everybody and their sister is writing a half-assed maven, I love it.

2:30 Apage43: bitemyapp: it'll be 36 sooner than later

2:30 bitemyapp: Seeing 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.

2:31 ddellacosta: Awesome. Glad it worked out for you. :)

2:31 ddellacosta: another reason I do it that way is to avoid magic I have to spend time learning when it breaks.

2:32 ddellacosta: bitemyapp: 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.

2:32 bitemyapp: ddellacosta: another reason I do that is so that all the sub-services in my JVM processes are "equals"

2:32 ddellacosta: bitemyapp: hmm, not sure I know what you mean by that. Could you elaborate?

2:32 bitemyapp: ddellacosta: if you use Lein ring init and the starting of another (separate) service fails, it could take down the init of the Ring service.

2:33 my @work project has 3 or 4 services that start in -main, all with separate state, init, and takedown functions.

2:33 ddellacosta: bitemyapp: ah, so you start each sub-service with a different uberjar?

2:33 bitemyapp: no

2:33 no no no

2:33 they're just functions in one big uberjar.

2:34 (defn -main [& args] (start-web) (start-nrepl) (start-consumers :queues [:a :b :c :d]) (start-blah-service) )

2:34 ddellacosta: bitemyapp: ah, haha--sorry, I gotcha--that way you set up stuff in the repl, as you were describing earlier.

2:34 bitemyapp: sorta.

2:34 it just fires up from main if it's enabled in the config.

2:34 each "start-*" thing is wrapped in an env-config check to see if it should start at all

2:34 ddellacosta: er, 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.

2:34 bitemyapp: so I can disable components at will by resetting the config and restarting the server *OR* by using the takedown functions built in.

2:34 ddellacosta: right, very nice

2:35 okay, cool, I like it

2:35 bitemyapp: ddellacosta: a lot of how I use and deploy Clojure is influenced by Erlang.

2:35 I like having a "master control" terminal of mostly transparent server state that lets me flip all the switches.

2:35 ddellacosta: interesting--yeah, I can see how you are separating things into more atomic entities, so to speak

2:35 bitemyapp: yep.

2:35 and I've needed this functionality for dev *and* prod

2:35 for example, we had a problem with the queue consumer stuff

2:36 jump 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

2:36 then bounce around the REPL in prod to do cleanup duty / inspection.

2:36 ddellacosta: right, you don't disrupt other stuff but can manage/maintain/clean up and get back up and running in repl. Very cool.

2:36 bitemyapp: most services as they're developed are monolithic/dumb.

2:36 cf. most Ruby and Python queueing integration. You can't shut off your queue workers without commenting out code.

2:37 That is, to my mind, insane.

2:37 ddellacosta: bitemyapp: yes. :-(

2:37 bitemyapp: my consumers and queue worker state is stored in an atom. I can shut them off from any REPL instance.

2:37 I can also start them back up against specific queues or all of them.

2:37 and it's very simple, not over-engineered at all.

2:37 just a function.

2:37 ddellacosta: oh, moments like these I really love clojure. That is quite nice.

2:38 alright, now I've got a lot of food for thought. Thanks.

2:38 bitemyapp: ddellacosta: the rabbit hole goes deeper when you're in the mood.

2:38 ddellacosta: I'll be stealing these ideas, of course...

2:38 ha, this is good enough to get me started. I'll come back and poke at you at a later date, I'm sure

2:41 bitemyapp: I need a hyper-efficient way to associate integers with values in a manner that I can dissoc/remove at a later point.

2:42 benkay: bitemyapp: what are the resources for diving down this hole? is there a "lisp in production" tome passed from hand to hand by alien technologists?

2:42 bitemyapp: benkay: it's like my approach is informed by Common Lisp, Python, Erlang, and Clojure itself. Stole some ideas Stuart Sierra too.

2:42 Apage43: the idea of hot-modifying in general is active outside of lisp :)

2:43 bitemyapp: benkay: it's pretty common for Common Lispers to "swank" into prod and debug the shit out of their deployed stuff :)

2:43 Apage43: or even just hot-introspecting

2:43 bitemyapp: Sorta. I don't think it became mainstream/standard for very many language communities though.

2:43 Apage43: I work a lot with a partially erlang project

2:44 bitemyapp: Erlangers took "dynamic service" thing seriously, of course.

2:44 Apage43: yeah. Erlang it is really considered to be one of the core things you can do

2:44 but outside of that.. not so much

2:44 bitemyapp: Common Lispers really just don't tolerate being "separated" from what their code is doing.'

2:44 they want to be able to dive their arms into the guts at any point in time, prod or no.

2:44 Apage43: the lisps its more like "well, yeah, why wouldn't you be able to do that?"

2:45 bitemyapp: I think the Lisp community is defined by its ability to take nice things for granted.

2:45 benkay: i've been wondering about this weird disconnect i've developed with my py work

2:45 bitemyapp: I would kill for an "embedded" GHCI server/client for Haskell

2:45 seangrove:

2:45 bitemyapp: Have you introduced cljs to any protégés at work yet?

2:45 bitemyapp: benkay: I do this stuff with Python too (I do and have done a lot of Python)

2:45 seangrove: been indirectly infecting the frontenders.

2:46 benkay: i find myself wanting a repl and simultaneously feeling dirty for wanting to muck around in my production instances

2:46 bitemyapp: one of said frontenders are going to be transferring to my neck of the woods soon, I'll complete the infection then.

2:46 benkay: haha, I leave ipdb hooks in all my Python servers.

2:46 GNU Screen + WSGI hack + ipdb hook == PYTHON REPLLLLL IN PROOOOOOD

2:47 benkay: bahahahaha

2:47 bitemyapp: I kept meaning to hack it up into a proper ipython server/client but never got around to it.

2:47 benkay: it's a crazy kind of cowboy

2:47 bitemyapp: I just kept snagging stdout.

2:47 benkay: i'll say it again - i like your style

2:47 seangrove: bitemyapp: Been contributing more to cljs recently

2:48 bitemyapp: seangrove: are you fishing for things to improve? You seemed busy already./

2:48 My current (as in, right now) project is Revise

2:48 the client already works surprisingly well. cbp did a lot of impressive work here.

2:48 seangrove: bitemyapp: 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.

2:49 bitemyapp: seangrove: you know the client/patronage model in ancient Roman governance/

2:49 seangrove: bitemyapp: Not fishing as much as focused on smoothing the path out

2:49 Apage43: I like ~2004 era PHP, as most of those applications had a remotely accessible REPL in them *somewhere* (unintentionally).

2:49 bitemyapp: s/\//?/g

2:49 Apage43: *snerk*

2:49 seangrove: bitemyapp: In the arts?

2:49 Apage43: if not an actual PHP REPL, at least an SQL one.

2:49 bitemyapp: seangrove: no, it was a political model for mutual obligation between otherwise free actors. Anyway, it's a metaphor for how my workplace works.

2:50 seangrove: 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.

2:50 then I'll get all the info you could possibly want.

2:50 seangrove: Might be very interesting

2:50 bitemyapp: seangrove: you know what would help people I see visiting this channel regularly?

2:50 seangrove: Marissa has been ramping up in cljs and has been unbelievably frustrated

2:50 bitemyapp: a blog post on, "this is how you get started with ClojureScript"

2:50 benkay: yes plz

2:50 bitemyapp: at least a basic rundown of the tools people use, like Piggieback

2:51 benkay: i've been wailing and gnashing my teeth quietly over here about getting running with Austin

2:51 bitemyapp: and explaining how the tools relate to each other and what problem they solve.

2:51 for example, I know Piggieback - but I still don't know what Austin does.

2:51 seangrove: bitemyapp: good suggestion. I'd like to gather these up somewhere

2:51 Just got into austin this morning, it's nicer

2:51 bitemyapp: a gist on github alone would be a lifesaver, then I can point the question-askers I see in here to it.

2:51 seangrove: Auto-reconnects, etc.

2:52 bitemyapp: demo/example projects go a long way too.

2:52 seangrove: that does sound nice.

2:52 seangrove: Alright, I'll think on it a bit.

2:52 bitemyapp: seangrove: much appreciated. I'll continue spreading the good word at work. :)

2:52 annnnd back to protobuf bizarro world.

2:53 Apage43: man I *tried* to get into protobuf bizarro world.

2:53 bitemyapp: I want a b-tree, don't I?

2:53 dense packed efficient integer -> value that can be dissoc'd. That's just a b-tree.

2:53 Derp.

2:53 Apage43: folks preferred to do poorly specified bespoke protocols

2:53 bitemyapp: Apage43: RethinkDB couldn't leave protobuf alone, they have a weird custom handshake.

2:54 that DOESN'T use standard protobuf varints.

2:54 Apage43: .. yeah rethinkDB went a bit overboard

2:54 I've seen their .proto files

2:54 bitemyapp: I was vomiting blood for a week after I got the initial connection negot working.

2:54 that's why cbp had to write the actual library.

2:54 Apage43: and that handshake thing

2:56 bitemyapp: and it's specifically a little endian unsigned 32 bit integer.

2:56 just...why...

2:58 bahahahaha, there's a lenses library for Clojure. Time to litter monads all over my code to protect it from pull requests.

2:59 Apage43: so far -> has been enough to scare folks off for me :/

2:59 bitemyapp: Apage43: really? did you try ,,, ?

3:00 I find the Zoidberg mouth-tentacles fogus invented work fine for explaining the data-cannon.

3:00 gws: the invisible pacman ghost operator

3:00 sritchie: hey guys - any advice for "java.io.IOException: Broken pipe" on a clojurescript page refresh?

3:00 Apage43: bitemyapp: well, it's hard when the first Clojure I show someone is ->'d

3:00 Shiro-Ichida: To be fair -> is terribly confusing if you're not familiar with what's going on without it.

3:00 sritchie: I can't seem to recover my browser repl session after a page reload

3:00 bitemyapp: Apage43: if that scares them, boy am I prepared for Halloween with just Synthread.

3:00 Apage43: because then I have to explain that it can do that because it's a *macro*

3:01 I 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

3:01 bitemyapp: Apage43: macro, monad, magic. Whatever. Same thing to muggle-ears.

3:01 Apage43: post post post plz

3:02 or email me the tarball.

3:02 Apage43: oh

3:02 bitemyapp: sritchie: who's throwing the exception?

3:02 Apage43: it's actually up

3:02 bitemyapp: Apage43: topic monads are relevant to my interests, I'm figuring out some conn mgmt stuff

3:02 Apage43: it's a small, terrible amount of code I wrote under pressure, that runs a checkers game :)

3:02 sritchie: at cemerick.austin$send_for_eval.invoke(austin.clj:133)

3:02 bitemyapp: ho damn.

3:02 sritchie: seangrove actually just meant Austin was supposed to auto-reconnect.

3:02 mentioned*

3:03 Apage43: https://github.com/apage43/checkers-overlord/commit/cc92351bbaedbd05bac7bcc3d93c22b81b55ba60

3:03 sritchie: here's the full

3:03 https://gist.github.com/sritchie/7165907

3:03 oh, let me read up

3:04 bitemyapp: Apage43: seems like a sensible use of synthread to me.

3:04 you've got a "topic", you're pipelining changes and accesses.

3:04 Apage43: it is

3:04 bitemyapp: Apage43: Synthread overlaps with lenses a fair bit too.

3:04 Apage43: to some extent I think the synthread version is, on the surface, easier to explain

3:04 sritchie: seangrove: austin vs piggieback...

3:05 bitemyapp: seangrove it LOOKED like austin would simplify the situation

3:05 bitemyapp: sritchie: piggieback is less experimental, last I heard.

3:05 Apage43: as long as explainee is content to let some stuff remain "magic" while I lay the groundwork

3:05 bitemyapp: Apage43: oh, did you see my gilded rose solution?

3:05 I need to wrap that up and upload it.

3:05 Apage43: we did the gilded rose at Clojure Dojo.

3:05 Apage43: ooh no

3:05 bitemyapp: you familiar with the exercise?

3:06 Apage43: nope =P

3:06 bitemyapp: it's a refactoring exercise. One moment, I think it's on my work computer./

3:06 or, more frankly, a refuctoring exercise.

3:08 sritchie: bitemyapp: woah, my google voice plugin may be affecting austin

3:08 https://github.com/cemerick/austin/issues/17

3:09 bitemyapp: sritchie: that is impressively annoying/obscure and a good thing to know.

3:09 Hrm, 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.

3:10 seangrove: sritchie: If you're just getting into cljs and the ecosystem, would love for you to keep in mind any complaints and thoughts

3:10 sritchie: seangrove: will do

3:10 seangrove: I think we need to do a "state of cljs newcomer experience" yearly survey like cemerick's

3:10 Anyway, I need to sleep

3:11 sritchie: this repl experience is the big pain so far, but it looks like that's being worked on

3:11 for sure, will keep track

3:13 seangrove: that fixed my broken pipe!

3:14 seangrove: disabling the google voice extension, that is

3:16 bitemyapp: sritchie: nice!

3:17 sritchie: bitemyapp: now, the remaining Q for tonight is,

3:17 how to structure the app such that I can get the repl running in dev mode, but not in production

3:17 bitemyapp: no repl in prod? too bad. ;)

3:22 anonymous-functi: Am 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?

3:22 For example, something like this {:some-value (fn [] (nth (@data :another-value) 0))}

3:23 Apage43: ,(({:a inc :b dec} :a) 1)

3:23 clojurebot: 2

3:23 Apage43: oh

3:23 you want something different

3:23 anonymous-functi: Yeah

3:23 Currently that evalutes once

3:23 Apage43: Hm

3:23 anonymous-functi: but when @data changes, it doesn't re-evalute

3:24 Apage43: I've seen a library that does what you're talking about

3:24 anonymous-functi: and when I quote it, then I just get the anon function, but it does't eval

3:24 Apage43: (basically it just makes it simpler ti implement IAssoc)

3:25 or whatever the map protocol was

3:25 there are a boatload of interfaces maps satisfy

3:26 anonymous-functi: Hmm...

3:26 I 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

3:26 the gist of it is I have a vector of some positions data

3:27 bitemyapp: I was looking for an excuse to not use the Clojure HAMTs but 24 nanoseconds for a transactional hash-smash is pretty compelling.

3:27 anonymous-functi: and I have some physics calcs acting on that which is why I split them off from the main "object" vector

3:27 bitemyapp: sigh, it even degrades gracefully...

3:27 anonymous-functi: so an "object" is just a map in my case, so I want :position to point to the position in the other vector

3:28 drorbemet: Hi, I am looking for a way to parse and query a wikipedia dump (up to 10GB of xml)

3:28 picking subsets of fields to be used as base for the queries. Which aproach and which libraries would you suggest?

3:28 anonymous-functi: Is there perhaps a better way of doing this instead?

3:30 drorbemet: Or, is it preferable to parse the wikipedia / mediawiki api online? Which libraries would you suggest using for that?

3:30 bitemyapp: drorbemet: zip.xml or enlive or laser or tree-seq or lenses or walk or recur or xml-seq or clojure.data.xml

3:31 Apage43: OH

3:31 bitemyapp: Apage43: what? seriously?

3:31 Apage43: no i was OHing at another thing

3:31 i remember

3:32 the thing i was thinking about earlier was .. Potemkin

3:32 has a helper for defining your own things that pretend to be maps

3:32 https://github.com/ztellman/potemkin/blob/master/src/potemkin/collections.clj#L160

3:32 bitemyapp: wow, mega variance. derferk.

3:32 drorbemet: bitemyapp: I just took a look on clojure.data.xml, I'll have a look on the others too, thanks.

3:33 Apage43: clojure.data.xml was nice last time I used it to streamingly-parse enormous stuff

3:33 bitemyapp: Apage43: when I thought to myself, "I'm trying to write something fast!" I realized I should check ztellman's github before writing any code.

3:34 Apage43: but for smaller stuff just plain clojure.xml is less hassle usually

3:34 bitemyapp: i have so many project.cljs that half the deps are ztellman libs

3:34 bitemyapp: sadly I can't say that, but on the occasion I use one of his libraries it's a joyous day.

3:35 Apage43: I do a lot of one off tiny protocol fiddling apps

3:35 bitemyapp: yeah that'll do it.

3:36 alright I'm satisfied he doesn't have anything that solves my problem

3:36 time to create some fake transaction contention.

4:18 time to create some fake transaction contention.

4:18 argh, wrong terminal.

4:29 first 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"))))))

4:40 ToBeReplaced: anyone have a recommendation for a lisp that can be compiled into arduino c++?

4:40 Apage43: bitemyapp: parsing "WARNING thing already refers to: other thing in namespace: bleh" messages?

4:40 bitemyapp: Apage43: ding ding. A winrar of macaron is you.

4:40 Also, 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.

4:41 to clarify, it works fine if you *run* the code or run the tests.

4:41 but it completely conks out nrepl somehow.

4:41 ToBeReplaced: why would you need to parse that warning message?

4:41 bitemyapp: ToBeReplaced: there was a very long list of them.

4:41 I am in the alterate-universe namespace from Hell.

4:43 ALSO WHY IS EVERYTHING A DOUBLE

4:43 WHAT IS GOING ON

4:44 Apage43: did you accidentally some javascript

4:45 bitemyapp: {:deleted 2.0, :errors 0.0, :inserted 0.0, :replaced 0.0, :skipped 0.0, :unchanged 0.0}

4:45 what the fuck is half an error.

4:45 How do I get half an error?

4:45 0.33333 repeating errors.

4:46 oh dear sweet jesus

4:46 Apage43: oh is this still rethinkdb

4:46 bitemyapp: it actually IS because of JavaScript.

4:46 Apage43: i was going to say

4:46 bitemyapp: THEY'RE JSON NUMBERS

4:46 AAAAAAAAAAAAAAAAAGH

4:46 Apage43: there is javascript all up in there

4:46 bitemyapp: (╯°□°)╯︵ ┻━┻

4:47 I'm going to build a tree-house in the woods and write Haskell and kill my food to survive.

4:48 the 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.

4:48 aha, multimethods to the rescue. I can fix this!@

4:50 ddellacosta: what 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.

4:51 bitemyapp: that's a technomancy question but you're in the WAYYYYY wrong timezone.

4:51 I'm only awake because I'm angry. I'm angry because JSON.

4:52 Apage43: someone at work offered me a JSON shirt

4:52 I responded "I don't believe in JSON"

4:52 ddellacosta: bitemyapp: just now the thing you have on your web site floated through my mind: "Technologies I've used in anger"

4:53 bitemyapp: ddellacosta: literally and figuratively.

4:53 ddellacosta: sometimes I think of moving back to the states just so I can talk to people in realtime on IRC

4:53 bitemyapp: I assume by default that if you haven't considered defenestrating a technology, you haven't really used it.

4:53 ddellacosta: hahaha

4:54 bitemyapp: I have similar notions regarding cohabitation with women.

4:54 ddellacosta: that is a cogent observations, methinks

4:54 on both accounts

4:54 sritchie: do you guys have advice on how to get config options into lein-ring?

4:54 I see init --

4:54 but getting CL args like prod vs dev,

4:54 or a DB name

4:54 ddellacosta: (apologies to any women in the channel, same probably goes both ways I suspect)

4:54 bitemyapp: Apage43: Looky, evil overcomes evil: {:deleted 2, :errors 0, :inserted 0, :replaced 0, :skipped 0, :unchanged 0}

4:54 ddellacosta: indeed. Could you *IMAGINE* living with me?

4:54 ddellacosta: sritchie: maybe environ could help?

4:54 bitemyapp: haha, good point....

4:55 bitemyapp: sritchie: seconding weavejester's environ.

4:55 ddellacosta: sritchie: https://github.com/weavejester/environ

4:55 bitemyapp: environ is luvverly. I pair with a config.clj that has functions it.

4:55 pair it*

4:55 Apage43: hooray

4:55 ddellacosta: sritchie: 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

4:55 sritchie: okay, that works

4:56 I'm converting an old web app away from noir :)

4:56 bitemyapp: sritchie: a fine choice.

4:56 ddellacosta: sritchie: ah, yes, do that. :-)

4:56 sritchie: and just trying to get my head around the pieces I need

4:56 ring-jetty-adapter, for example

4:56 bitemyapp: oh, right, I can't eval this namespace...because the code is so insane nrepl throws a stack overflow.

4:56 sritchie: it looks like lein-ring fires up a jetty server already,

4:56 bitemyapp: sritchie: you don't need that.

4:56 sritchie: you don't need that either.

4:56 ddellacosta: yep, no need

4:57 sritchie: okay, what's the stack

4:57 bitemyapp: http-kit and (start-server)

4:57 sritchie: compojure + ring replace noir (plus lib-noir)

4:57 bitemyapp: http-kit is Ring compatible by design and out of the box. no magic needed.

4:57 just call (start-server ...) from sie -main fn.

4:57 ddellacosta: bitemyapp: oh, thought you mean you don't need to explicitly include the lib. Yeah, http-kit is fine.

4:57 bitemyapp: sritchie: http-kit has the additional benefit of being async and supporting websockets and long-polling out of the box.

4:58 sritchie: nice

4:58 awesome, just what I was looking for

4:58 ddellacosta: bitemyapp: to be the devil's advocate, why would you use http-kit if you didn't need those things?

4:58 bitemyapp: sritchie: it's also thread-pooled automatically...

4:58 it also comes with an async http client if you ever need one. (I do occasionally)

4:58 sritchie: yeah, I'm trying to go down the web socket road

4:58 bitemyapp: ddellacosta: simpler. Less magic.

4:58 sritchie: I've got core.async up in the browser,

4:58 bitemyapp: ddellacosta: the jetty tooling is fine and works fine, but people were way too eager to slap magic on there.

4:58 ddellacosta: sritchie: ah, well, in that case definitely

4:58 bitemyapp: sritchie: http-kit it is.

4:58 sritchie: now I want to try to get a client talking to a server

4:58 via websockets

4:59 kevin lynagh had posted this

4:59 https://github.com/lynaghk/jetty7-websockets-async

4:59 ddellacosta: bitemyapp: 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.

4:59 bitemyapp: sritchie: 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/

4:59 ddellacosta: *shrugs* sure.

4:59 ddellacosta: yeah, I think http-kit is the clear performance winner

4:59 bitemyapp: ddellacosta: but, Luminus has an http-kit recipe anyway.

4:59 http-kit is the clear performance winner 90% of the time

4:59 I actually know how to break it though, lol.

4:59 ddellacosta: bitemyapp: ah, gotcha--I don't use Luminus so that's probably why I wouldn't have thought of it

5:00 sritchie: I would imagine lynaghk's jetty7 web sockets thing is useful if you've already got an app you need to integrate it with

5:00 sritchie: do you guys have a favorite lib for cljs / cli client server crosstalk?

5:00 ddellacosta: otherwise I would definitely start with http-kit

5:00 bitemyapp: Apage43: https://gist.github.com/bitemyapp/7166725

5:00 sritchie: yeah, that sounds like the right way to go

5:00 ddellacosta: sritchie: you mean, using websockets?

5:00 sritchie: nice, thanks guys

5:00 ddellacosta: yeah

5:01 * Apage43 uses aleph.. because it was there before any of this and it works fine for me :)

5:01 bitemyapp: sritchie: highest abstraction one is shoreleave but that's more of an RPC thingy.

5:01 sritchie: generally a simple websocket lib for cljs and the direct interface http-kit provides should work fine and be simple.

5:01 this isn't like Java where you need to read up on a class hierarchy to send a few bytes.

5:01 ddellacosta: sritchie: 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

5:01 bitemyapp: I don't think shoreleave is WS:// anyway.

5:02 ddellacosta: solid!

5:02 sritchie: ddellacosta: this is perfect!

5:02 niiice

5:02 guys, so awesome

5:02 thanks a bunch

5:02 ddellacosta: sritchie: I just used raw JS web sockets and wrapped them in core.asyc, I think that's the way to go personally.

5:02 sritchie: sure thing!

5:02 Apage43: bitemyapp: oh.

5:02 bitemyapp: Apage43: you object to my evil?

5:03 sritchie: 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.

5:03 Apage43: nah. It's just.. unfortunate.

5:03 bitemyapp: Apage43: well. I can't fix JSON.

5:03 ddellacosta: sritchie: sorry, I realize I'm assuming you're using CLJS, dunno if you are though

5:03 sritchie: yeah, I am

5:03 bitemyapp: ddellacosta: pretty sure he is. core.async too.

5:03 Apage43: JSON doesn't actually say anywhere that JSON numbers are doubles

5:03 bitemyapp: ddellacosta: so your project was super-apropos.

5:03 sritchie: yeah, it was dead on

5:03 Apage43: lots of parsers/encoders assume that because javascript

5:03 ddellacosta: excellent. :-)

5:03 bitemyapp: Apage43: but it's a unified data-type, yes?

5:04 Apage43: and lots don't =P

5:04 bitemyapp: where it's a quantum super-position of doubles and integrals?

5:04 well.

5:04 I could complain to RethinkDB.

5:04 I will!

5:04 ddellacosta: sritchie: I don't guarantee it's the best way to structure web sockets + core.async, but hopefully will get you started.

5:04 * bitemyapp flies off to github to continue his journey as the "ruiner of days"

5:04 Apage43: I don't think that'd help

5:04 as they actually do just spin up v8 inside the db to do stuff

5:04 ddellacosta: haha

5:05 bitemyapp: Apage43: dude. Have you seen how many issues they have on github?

5:05 437. Four. Hundred. Thirty-Seven.

5:05 People whose job I don't want. yeesh.

5:05 ddellacosta: alright, back to figuring out heroku magic. *sigh*

5:05 bitemyapp: they spin up V8? well...ow.

5:05 Apage43: you can preserve integrals in V8 though

5:05 Apage43: it'd uh...just require some hax to the code...

5:06 Apage43: oh? Huh.

5:06 oh

5:06 bitemyapp: Apage43: asm.js

5:06 Apage43: You sly dog.

5:06 bitemyapp: just want muh un-tampered un-fuzzy bits.

5:06 Apage43: i like how asm.js doesn't have 64-bit non-floaty things

5:07 bitemyapp: Apage43: anything ending in .js is required by natural law to have at least one critical flaw.

5:07 if not several.

5:08 Anything ending in .php is required to have at least one security hole.

5:08 nyuk nyuk nyuk. I should sleep soon.

5:08 Apage43: Them'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.

5:09 *pretend i can spell

5:09 ddellacosta: I thought we agreed not to say the P-word on this channel

5:09 Apage43: Perl?

5:09 bitemyapp: ddellacosta: does the scar tissue twitch?

5:09 * ddellacosta starts hyperventilating

5:10 bitemyapp: Apage43: 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.

5:10 ddellacosta: hahaha

5:10 bitemyapp: flesh-eating monads.

5:10 Halloween Haskell. Boo!

5:11 ddellacosta: okay, Dr. Functor-instein

5:11 I'm here all night, try the veal

5:11 bitemyapp: ddellacosta: that one elicited a gasp-laugh-cough. gg.

5:12 ddellacosta: bitemyapp: yeah, that sounds about right.

5:12 bitemyapp: <3 this channel so much.

5:12 ddellacosta: heh

5:12 bitemyapp: without 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.

5:13 sritchie: ddellacosta: one last dumb question - is there any need for ring in the project,

5:13 bitemyapp: THE SEGFAULT IS NIGH

5:13 sritchie: w/ an http-kit and compojure stack?

5:13 other than for middleware, like [ring.middleware.reload :as rl]

5:13 bitemyapp: sritchie: it's still Ring, but usually you don't use it directly except for middleware.

5:13 gws: "What?! you mean ('42' + 0) doesn't do what i want anymore? haha what kind of hamstrung language is that"

5:14 sritchie: got it

5:14 makes sense

5:14 ddellacosta: sritchie: 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)

5:14 bitemyapp: sritchie: lib-noir has parted out the components of Noir that could be salvaged into useful middleware.

5:14 sritchie: looks like once I kill all these defpage instances I should be good to go

5:15 bitemyapp: sritchie: one caveat to http-kit, there's no thread affinity. Don't use dynamic vars.

5:15 async-safe code is the order of the day.

5:15 * ddellacosta chuckles about bitemyapp's FB hobo comment

5:15 sritchie: I've got one around for my database instance

5:15 bitemyapp: well. make it thread global.

5:15 sritchie: cool, I should only need to swap it in once

5:16 that's a good tip

5:16 ddellacosta: I 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.

5:16 bitemyapp: atoms are fine...just not thread-scoped dynamic atoms.

5:16 ddellacosta: that is, what bitemyapp said

5:16 bitemyapp: because the thread-scoping *will* break.

5:16 ddellacosta: yeah, thread global

5:17 Apage43: I just like being able to explain the effects of -doing a thing to a system- without having to add ", hopefully."

5:17 bitemyapp: I'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.

5:17 Apage43: functional programming is the death of hope?!

5:18 let me go tell the Perl users so they can be warned.

5:18 * gws writes a Javaworld article about hope-killing FP

5:18 Apage43: I prefer to think of it as allowing people to spend their hope on other things :)

5:18 bitemyapp: gws: FP destroys software jobs.

5:19 Apage43: like my hope that RethinkDB never fucks me over and changes the protocol spec.

5:19 Apage43: but but but isn't that what protobuf is supposed to save you from

5:19 gws: Fad Programming

5:20 bitemyapp: Apage43: I don't really need protobufs to keep a protocol stable, I just need to be in walking distance of the author.

5:20 Apage43: that helps too

5:24 well, that and its being an abominable syntax tree means it can change pretty heavily above the protobuf layer too

5:25 bitemyapp: Apage43: which-wha?

5:25 the lambda syntax or something else?

5:26 Apage43: yeah. You can arbitrarily nest things and it'll build up a fun tree-like thing that you protobuf

5:26 bitemyapp: Apage43: https://github.com/bitemyapp/revise/blob/master/src/bitemyapp/revise/query.clj

5:27 the only way to express my feelings about this namespace is:

5:27 Apage43: the way they pull of the lambda syntax trick rustled my jimmies

5:27 *pull off

5:27 bitemyapp: Apage43: http://i.imgur.com/XeAjJNE.jpg

5:28 Apage43: wow

5:29 bitemyapp: see, the impressed-yet-horrified reaction is how you know it's good Lisp code.

5:33 Apage43: clojure is surprisingly practical for throwing a rug over some horrifying thing and providing it through an interface that hides said thing's worst qualities

5:35 THROW A BLANKET OVER IT: http://i.imgur.com/wIeHi8g.gif

5:36 bitemyapp: lol :)

5:38 gws: or put a pillow over it... new FullName.FullNameBuilder(new Name("Flintstone"), new Name("Fred")).createFullName()

5:42 ddellacosta: wait, bitemyapp, are you using stefon?

5:43 just saw this is why I ask https://github.com/circleci/stefon/issues/4

5:43 ...and 'cause I'm wrestling with it now

5:47 bitemyapp: ddellacosta: not right now, it solves a problem I had a few months ago

5:47 whenever I pick that back up, I'll start using it in...anger...

5:47 ddellacosta: bitemyapp: okay, haha

5:47 bitemyapp: 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.

5:48 bitemyapp: ddellacosta: I usually precompile my asset pipelines for deployment.

5:48 ddellacosta: but I can see why you'd want it to "just work" on Heroku

5:48 ddellacosta: if you're trying to write to the filesystem on Heroku, I can tell you right now that will never...ever...ever work.

5:49 they don't allow it.

5:49 ddellacosta: bitemyapp: 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

5:49 bitemyapp: yeah, definitely not expecting that magic from heroku, just read up on it now and realized what my problem was.

5:50 bitemyapp: ddellacosta: i precomp to s3

5:50 ddellacosta: bitemyapp: and so, how does stefon find your assets? are you using stefon/link-to-assets?

6:33 andrewmcveigh: Hi, 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.

6:35 I'm using cider in emacs, currently. With the latest nrepl, piggieback, austin.

7:07 fakedrake: hello

7:08 i 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?

7:19 Morgawr: fakedrake: sorry if late but (filter (complement nil?) [nil 1 2 3 4 nil 5])

7:19 &(filter (complement nil?) [nil 1 2 3 4 nil 5])

7:19 lazybot: ⇒ (1 2 3 4 5)

7:20 morrifeldman: I started a repl on machine A using 'lein repl'. How can I connect to it from another machine?

7:50 hyPiRion: morrifeldman: `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`

8:11 morrifeldman: hyPiRion: Thanks. It's working although connecting required a bit extra. `LEIN_REPL_PORT=4567 lein repl :connect 10.0.1.3:4567/repl`

8:12 hyPiRion: ah

8:42 fakedrake: is there a way to have u64 in clojure like we have in c. That is to ignore overflows nd stuff?

8:43 AimHere: Well with clojure, you can promote long int overflows to multiple precision bigints

8:44 If I'm not mistaken, you're at the mercy of the JVM though, so ask Oracle!

8:44 ,(* 4000000000 2)

8:44 clojurebot: 8000000000

8:45 AimHere: damn

8:46 hyPiRion: ,(+ Long/MAX_VALUE 10)

8:46 clojurebot: #<ArithmeticException java.lang.ArithmeticException: integer overflow>

8:46 AimHere: ,(* 8000000000 8000000000)

8:46 clojurebot: #<ArithmeticException java.lang.ArithmeticException: integer overflow>

8:46 AimHere: ,(*' 8000000000 8000000000)

8:46 clojurebot: 64000000000000000000N

8:47 hyPiRion: ,(unchecked-add Long/MAX_VALUE 10)

8:47 clojurebot: -9223372036854775799

8:47 hyPiRion: Depends on what you need. *' and +' autopromotes. unchecked-xxx ignore flags

8:48 AimHere: And if all else fails, there's try ... catch

8:48 mpenet: ?google primitive-math clojure

8:49 hmm cant remember the syntax, anyway, https://github.com/ztellman/primitive-math

8:49 hyPiRion: $

8:49 mpenet: right!

8:49 fakedrake: sry about that

8:50 my internet is a bit unstable

8:50 did I miss an answer?

8:50 Ember-: most likely

8:50 ,(*' Integer/MAX_VALUE 2)

8:50 clojurebot: 4294967294

8:51 Ember-: ,(*' Integer/MAX_VALUE 20)

8:51 clojurebot: 42949672940

8:51 AimHere: ,(* Integer/MAX_VALUE 20)

8:51 clojurebot: 42949672940

8:51 Ember-: ,(* Integer/MAX_VALUE 20)

8:51 clojurebot: 42949672940

8:51 AimHere: ,(* Long/MAX_VALUE 20)

8:51 clojurebot: #<ArithmeticException java.lang.ArithmeticException: integer overflow>

8:51 AimHere: ,(*' Long/MAX_VALUE 20)

8:51 clojurebot: 184467440737095516140N

8:51 Ember-: ,(unchecked-add INTEGER/MAX_VALUE 1)

8:51 clojurebot: #<CompilerException java.lang.RuntimeException: No such namespace: INTEGER, compiling:(NO_SOURCE_PATH:0:0)>

8:51 Ember-: crap

8:51 ,(unchecked-add Integer/MAX_VALUE 1)

8:51 clojurebot: 2147483648

8:52 Ember-: ,(unchecked-add Integer/MAX_VALUE 100)

8:52 clojurebot: 2147483747

8:52 fakedrake: hmm

8:52 Ember-: ,(unchecked-add Long/MAX_VALUE 100)

8:52 clojurebot: -9223372036854775709

8:52 Ember-: so *' and +' and so forth auto promotes

8:52 unchecked versions allow overflow

8:53 and normal * + etc will throw exceptions when you go over the number space

8:54 ,(*' Long/MAX_VALUE Long/MAX_VALUE)

8:54 clojurebot: 85070591730234615847396907784232501249N

8:54 fakedrake: ,(bit-shift-left 2 50)

8:54 clojurebot: 2251799813685248

8:54 fakedrake: ,(bit-shift-left 2 100)

8:54 clojurebot: 137438953472

8:55 fakedrake: why is the 2nd one much smaller?

8:56 AimHere: I'd guess it overflowed

8:56 ,(bit-shift-left 2 36)

8:56 clojurebot: 137438953472

8:57 AimHere: Yeah, 100=64+36, and the overflow happened at 2^64

8:57 fakedrake: if it did, shouldnt it be 0?

8:57 AimHere: It'll be a rotate, not a shift!

8:57 fakedrake: ah it sycles around

8:57 hmm

9:03 hyPiRion: bitshifting over the amount of bits have undefined behaviour, and doesn't necessarily cycle

9:04 ,(bit-shift-left -1 100) ; Should be -1 regardless if that's the theory

9:04 clojurebot: -68719476736

9:07 hyPiRion: However, it may be that the processor masks its input. I.e. x << n == x << (n & 63)

9:25 Creap: I saw someone binding *out* to a writer and using println instead of using .write, are there any benefits or drawbacks of that approach?

9:28 except that it prints a newline automatically..

10:13 gfredericks: Creap: and spaces in between the args?

10:14 also 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:21 LauJensen: Which libraries do we have to handle cookies, when accesing a site which requires a login?

11:58 poppingtonic: in #startups

13:33 maacl: I 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:48 fakedrake: hey, how do I round in clojure without pulling external libs?

13:49 round to the closest integer that is

13:50 `cbp: Math/round

13:50 you just wont be able to round ratios

13:53 fakedrake: thanx

13:58 While I can run Math/round on it's own in the repl

13:58 from within another fun i get `java.lang.IllegalArgumentException: No matching method found: round'

13:59 LauJensen: Which libraries do we have to handle cookies, when accesing a site which requires a login?

14:00 `cbp: fakedrake: you might wanna do (Math/round (double ..))

14:11 dobry-den: What'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:12 seangrove: dnolen: 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:12 dobry-den: It's like I want a (while-let [val (<! c)] ...)

14:15 wait... i can just treat the channel like it's a seq

14:15 i realize my question is like "how can i consume [1 2 3] until i run out?"

14:19 actually that's not true. [1 2 3 nil nil nil ...[

14:41 seangrove: I 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:42 Working 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:25 * seangrove rejoices at having discovered M-x customize-face and what-cursor-position

15:30 poppingtonic: I'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:30 bbloom: poppingtonic: do you have a file called app_name/core.clj ?

15:30 does it have namespace app-name.core in it?

15:30 try using a hyphen instead of underscore

15:32 poppingtonic: bbloom, yes. the underscore was used by lein

15:32 uncer src/app_name/core.clj

15:32 *under

15:35 seangrove: poppingtonic: What's the first line in that file?

15:35 poppingtonic: bbloom: under defproject, should I use app_name.core for :main if the namespace is app_name.core?

15:35 seangrove: (ns app-name.core

15:35 seangrove: poppingtonic: Notice that it's app-name for the namespace, and app_name for the file

15:35 bbloom: i already said: "try using a hyphen"

15:39 dobry-den: I think core.async is my favorite abstraction in programming ever

15:41 poppingtonic: I'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:41 giving: "Could not locate simple_blog/core__init.class or simple_blog/core.clj"

15:42 bbloom: poppingtonic: leave the folder name alone. it should be _

15:42 folders use _

15:42 namespaces use -

15:44 poppingtonic: bbloom: k, changed.

15:44 my :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:45 seangrove: poppingtonic: What's the file name?

15:46 poppingtonic: core.clj

15:46 seangrove: I 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:46 What's the folder it's in?

15:46 LauJensen: Which libraries do we have to handle cookies, when accesing a site which requires a login?

15:47 seangrove: Wow, I've managed to accidentally block the javascript ui in a non-blocking fashion with core.async

15:47 poppingtonic: seangrove: the path from the folder I created in lein is simple-blog/src/simple-blog/core.clj

15:47 seangrove: poppingtonic: the folder and file names *must* use underscores

15:47 If you see any hyphens in your file or folder names, it will not work

15:47 poppingtonic: rather, simple-blog/src/simple_blog/core.clj

15:48 seangrove: ok, that should work then

15:48 The error is, "could not find anything"?

15:48 poppingtonic: lein created the simple_blog so it should be ok. yes, the error is still the same. so confusing.

15:49 dobry-den: what command are you trying to run

15:49 poppingtonic: "could not find anything to run for simple-blog.core"

15:50 dobry-den: I'm trying to run a simple webapp using compojure/hiccup/httpkit/jdbc

15:50 dobry-den: poppingtonic: do you have (defn -main [& args] ...) in simple-blog.core

15:50 poppingtonic: dobry-den: nope

15:50 dobry-den: :main simple-blog.core is telling leinwhere your -main is

15:51 bbloom: poppingtonic: most clojure web apps don't have main functions

15:51 they use jetty or something like that

15:51 seangrove: poppingtonic: Maybe there's a pre-existing template that can get you started?

15:53 poppingtonic: seangrove: do you have anything in mind? though I'd like to figure this out anyway.

15:53 dobry-den: poppingtonic: Here's the -main boilerplate I use in webapps https://gist.github.com/danneu/7173399

15:54 seangrove: poppingtonic: 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:55 bbloom: the hash code discussions on the mailing lists are pretty interesting

15:55 poppingtonic: bbloom: I'm using http-kit which is supposed to be an alternative to jetty. Does that use -main?

15:56 bbloom: poppingtonic: *shrug* maybe you should read the http-kit docs?

15:56 poppingtonic: dobry-den: ty, checking it out.

15:56 dobry-den: poppingtonic: yeah. -main is the entrypoint for when you compile it into an uberjar and run it `java -jar simple-blog.jar`

15:56 bbloom: poppingtonic: are you completely new to clojure?

15:56 most clojure programs don't even start out with main

15:56 they start with some form being evaluated in a repl

15:57 http://http-kit.org/ top right corner

15:57 you can just run that line of code

15:57 & figure out main later

15:57 lazybot: java.lang.RuntimeException: Unable to resolve symbol: figure in this context

15:57 dobry-den: poppingtonic: In your -main: (run-server my-handler {:port 8080})

15:57 according to http-kit homepage

16:00 poppingtonic: if youre making a website and trying to arrive at the ol webdev workflow: change code, reload browser. then i recommend Jetty

16:00 poppingtonic: bbloom: I'm reading cemerick's book as I work on a bunch of web tutorials.

16:01 bbloom: a 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:01 dobry-den: poppingtonic: if you want to see full boilerplate, type `lein new compojure simple-blog2`, cd into it, and then run `lein ring server`

16:01 staafl: considering that CLJ doesn't have right fold, what's the most elegant way to write this:

16:01 http://www.4clojure.com/problem/30

16:01 dobry-den: bbloom: i think webdev with compojure is one of the easiest entrypoints

16:02 bbloom: easier than sinatra and flask

16:02 dnolen: seangrove: it looks like a fine approach to me.

16:02 poppingtonic: bbloom: thing is, web-dev is where I'd like to end up.

16:02 dnolen: seangrove: should just wait on some feedback from chas

16:03 bbloom: poppingtonic: sometimes it is quicker and easier to start at the beginning, rather than try to jump to the end :-P

16:03 staafl: why would you need right fold?

16:03 (for that problem)

16:04 poppingtonic: bbloom: well, i like nonlinearity :P

16:04 staafl: bbloom, because with that I can trivially check whether (== current-element (first aggregate-sequence))

16:04 dobry-den: jumping in is the way to go.

16:05 poppingtonic: ^

16:05 hyPiRion: staafl: with left fold you can do the same thing: (= current-element (peek aggregate-vector))

16:05 bbloom: *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:06 staafl: hyPiRion, this problem seems to expect the result as a seq, not a vector

16:06 incidentally, what is the double-equal operator for?

16:07 bbloom: staafl: try the "doc" macro in your repl

16:07 hyPiRion: staafl: double equality is for numerics. The problem expect not a seq, but a collection equivalent to the collection on the right

16:07 E.g. ##(= [1 2 3] '(1 2 3))

16:07 lazybot: ⇒ true

16:07 staafl: hyPiRion, hmm, interesting

16:07 dobry-den: bbloom: all poppingtonic (or any noob) needs is someone to point out the magical incantations that get the barebones running.

16:07 staafl: then how would I do a strict value equality check?

16:08 poppingtonic: hmmm..."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:08 seangrove: dnolen: Sounds good

16:09 staafl: poppingtonic, what's OL?

16:09 bbloom: dobry-den: the magic incantation is printed on the HOME PAGE for http-kit

16:09 iwilcox: staafl: Paul Graham's "On Lisp"?

16:09 staafl: iwillig, I see, thanks

16:10 bbloom: dobry-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:10 iwilcox: staafl: The question mark there was "probably", not me being incredulous that you didn't know :)

16:10 poppingtonic: bbloom, 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:10 bbloom: https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md

16:11 staafl: iwilcox, :-)

16:11 bbloom: poppingtonic: i'm telling you, if you want to get over the hump, just run that one line of code in your repl

16:11 staafl: so, how does one do a type-sensitive value comparison?

16:11 if '=' treats collections the same

16:11 bbloom: staafl: = only treats sequentials the same

16:11 dobry-den: poppingtonic: why are you using http-kit?

16:12 staafl: "compares

16:12 numbers and collections in a type-independent manner"

16:12 hyPiRion: bbloom: and maps and sets?

16:12 bbloom: hyPiRion: yeah, was just typing something up about that

16:12 there are various implementations of maps, sets, etc. tree maps, hash maps, array maps. but they all test equal

16:13 poppingtonic: bbloom: done.

16:13 dobry-den: it's what's used in the tutorial I'm reading.

16:13 bbloom: equality 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:13 hyPiRion: the only iffy thing is that, even though (= x y), that doesn't mean (= (f x) (f y)).

16:15 bbloom: how could you possibly have anything else that was still useful with respect to some abstractions?

16:16 hyPiRion: e.g ##(map #(= (% '(1 2 3)) (% [1 2 3])) [identity pop peek #(conj % 0) #(cons 0 %)])

16:16 lazybot: ⇒ (true false false false true)

16:16 gfredericks: hyPiRion: or trivially the class function

16:17 hyPiRion: yeah

16:18 gfredericks: (map #(System/identityHashCode %) [42 (* 2 3 7)])

16:18 ,(map #(System/identityHashCode %) [42 (* 2 3 7)])

16:18 clojurebot: (17901622 17901622)

16:18 hyPiRion: huh

16:18 gfredericks: ,(map #(System/identityHashCode %) [42000 (* 2 3 7 1000)])

16:18 clojurebot: (11491449 31030949)

16:18 gfredericks: thar we go

16:19 dobry-den: poppingtonic: well if you need help, hit me up

16:19 hyPiRion: gfredericks: well, that's just because small ints are interned

16:19 gfredericks: hyPiRion: sure; but my point is that those two things are distinguishable via some f

16:19 so is it iffy for them to be =?

16:20 bbloom: speaking of hashes :-P

16:20 does anybody know of any literature on hashing of composites?

16:21 not too many languages use composites for keys like clojure does outside of basic tuples

16:21 hyPiRion: gfredericks: 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:21 gfredericks: speaking of funny keys

16:21 bbloom: curious if there is some reading to help with that thread

16:21 hyPiRion: Sure thing, I'm not aware of any better way of fixing it, I'm just saying that it may be a pitfall

16:21 gfredericks: ,(assoc {#"foo" 12} #"foo" 42 #"foo" "some other value")

16:21 clojurebot: {#"foo" "some other value", #"foo" 42, #"foo" 12}

16:22 hyPiRion: wat

16:22 bbloom: bwha?

16:22 hyPiRion: ,(= #"foo" #"foo")

16:22 clojurebot: false

16:22 poppingtonic: dobry-den: the boilerplate's good. I'm studying it now. ty for all the help.

16:22 hyPiRion: well, there we go I guess.

16:22 gfredericks: yep

16:22 I had a coworker using regexes as keys in a map is why I discovered that

16:22 hyPiRion: ,(ckla

16:22 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

16:22 bbloom: ,(let [f (fn [] #"foo")] (= (f) (f)))

16:22 clojurebot: true

16:22 hyPiRion: typo of the day

16:23 ,(class #"foo")

16:23 clojurebot: java.util.regex.Pattern

16:23 gfredericks: presumably it doesn't override equals

16:23 hyPiRion: So the issue is that the Patten class doesn't implement equality properly then

16:23 gfredericks: which seems fair to me

16:23 bbloom: = doesn't always rely on equals

16:23 gfredericks: ,(.equals #"foo" #"foo")

16:23 clojurebot: false

16:23 gfredericks: I think regex equality is about as shady as function equality

16:24 so the current behavior seems right

16:24 bbloom: gfredericks: not "about", it absolutely is

16:24 gfredericks: bbloom: well restricted regexes you could conceivably compare

16:24 but I don't think anybody wants the jvm running a DFA minimization algorithm every time you compare regexes

16:24 bbloom: heh

16:24 coventry: gfredericks: 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:25 gfredericks: coventry: but some different regexes do the same thing

16:25 #"aaa" versus #"a{3}"

16:25 should those be equal?

16:25 hyPiRion: coventry: It's a question of equality

16:25 dnolen: thinking 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:25 TimMc: gfredericks: I'm working on URL equality at work. That's good times...

16:26 gfredericks: TimMc: WAT

16:26 hyPiRion: heh

16:26 bbloom: dnolen: i've cached analysis results for various purposes when debugging & experimenting. the printed representation is LARGE b/c it is highly redundant

16:26 gfredericks: hyPiRion: when should two unidentical URLs be considered equal?

16:26 wai

16:26 TimMc not hyPiRion

16:26 bbloom: dnolen: and re-reading it in is absurdly wasteful in memory

16:26 gfredericks: you guys are the same to me

16:26 dnolen: bbloom: not all analysis, in this case probably just constants and source map info

16:27 TimMc: gfredericks: Case differences in protocol, hostname, or percent-encoding; "/" vs "" path

16:27 umm... you can argue about :80 vs no port on http

16:27 gfredericks: what about query params reordering?

16:28 TimMc: IIRC, the URI spec identifies 4 levels of equality.

16:28 Sure.

16:28 bbloom: hell, comparing a URL to itself isn't even useful, since the server might change on you ;-)

16:28 gfredericks: I assume somebody wants to do it

16:28 bbloom: dnolen: for particular use cases w/ carefully designed serialized values, it's probably a sensible idea if profiling proves it helps

16:28 coventry: If only everyone used urbit, we might have a referentially transparent web.

16:28 gfredericks: hard to track where your users are going on the internet if every visit is to a unique location

16:28 staafl: help request: https://www.refheap.com/20183

16:29 bbloom: dnolen: 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:29 staafl: solving http://www.4clojure.com/problem/31 and getting weird error :-/

16:29 bbloom: staafl: really should tell us what the error is, if you want us to help

16:30 staafl: bbloom, ClassCastException clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack clojure.lang.RT.peek (RT.java:634)

16:30 it's in the paste

16:30 hmm, actually I think I see it now

16:31 'butlast' returns a seq and the next 'peek' chokes on that

16:31 is there a butlast alternative for vectors?

16:31 coventry: staafl: (use 'clojure.repl) (pst) to find the stack frame which refers to your source code.

16:31 gfredericks: staafl: pop?

16:31 hyPiRion: staafl: subvec

16:32 yeah, gfredericks' answer is better

16:32 bbloom: definitely not subvec :-P

16:32 staafl: coventry, gfredericks, hyPiRion, thanks!

16:32 hyPiRion: bbloom: psh, I like to leak memory

16:33 gfredericks: what is this urbit.org

16:33 coventry: gfredericks: It's this crazy utopian thing about fixing the brokenness of the internet.

16:34 gfredericks: http://www.slideshare.net/JohnBurnham1/pcloud

16:34 seangrove: technomancy: Any ideas on this uberjar problem? https://www.refheap.com/a915c8d2e8b40d24056836a3b

16:34 gfredericks: coventry: this looks crazy and utopian and something I would try if I had lots of time

16:35 coventry: gfredericks: Oh, yeah, it's also glorious.

16:36 gfredericks: if I didn't think security was impossible I might read this further :)

16:36 hyPiRion: seangrove: `with-profile +uberjar` perhaps? I'd guess you discard the base profile and that throws away the :main class

16:37 either way, the uberjar task loads the uberjar profile by default

16:43 coventry: gfredericks: I agree, his confidence in his security measures sound a little hollow to me.

16:43 gfredericks: subvec at least composes fine

16:44 poppingt`: "extreme commoditization of computing semantics"?

16:44 gfredericks: coventry: I do like the idea of an extremely pure computation environment; just not for the purpose of personal security

16:44 bbloom: yeah, i just read through some gobblty gook on that page & closed it

16:46 poppingt`: I won't call it a troll, but it definitely is minimally hilarious.

16:46 gfredericks: Hoon's goal is to be the C of functional programming

16:47 bbloom: yeah, um i don't know of that analogy provides any insight

16:47 s/of/if

16:48 gfredericks: oh man figure this one out:

16:48 Haskell has higher-order type inference; Hoon has “higher-order” “type” “inference.”

16:48 poppingt`: http://xkcd.com/356/

16:51 seangrove: hyPiRion: No luck. Same error. I have another project with working AOT, I'll take a look at it first

16:52 hyPiRion: seangrove: perhaps running a `lein clean` does it. Sometimes that just seem to help

16:55 coventry: poppingtonic, 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:02 sritchie: coventry: woah, looking at orbit now

17:02 urbit

17:07 tbaldridge: okay, I just joined the channel, is urbit a language?

17:10 I remember this now. I read the intro page and had then died of technospeak overkill.

17:14 dobry-den: so who's implementing clojure on top of urbit's nock vm?

17:14 i think that's the elephant in the room

17:15 sritchie: poll - what are your favorite emacs packages for Clojure dev?

17:15 projectile + helm has been amazing for dev, for me

17:15 (not really clojure specific)

17:15 dobry-den: evil

17:17 typeclassy: dobry-den: i'm eagerly awaiting the emacs clone, in clojure, on nock

17:20 dobry-den: that sounds like a cool project if i ever find out im immortal

17:21 poppingtonic: bbloom, 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:21 *boilerplate

17:21 dobry-den: yeah homie

17:21 poppingtonic: \\//

17:22 dobry-den: once you get the make-code-change -> reload-browser workflow going, things are pretty simple

17:23 poppingtonic: yep, that's where I am now. as it should be.

17:27 can the programming language in use be a bottleneck in deep learning work?

17:29 xuser: What do you mean by that?

17:32 poppingtonic: you 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:32 nightfly: That factors into solving any problem

17:33 not sure what you mean by 'deep learning'

17:33 poppingtonic: http://deeplearning.net

17:34 http://deeplearning.net/software_links/

17:36 typeclassy: it's possible for particular language implementations to be poorly suited for particular problems

17:36 nmq: Hey 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:37 when submitting*

17:37 typeclassy: you should profile first before getting nervous about it

17:39 nmq: io/reader doesn't like the file I plock off the request

17:39 pluck*

17:40 dobry-den: nmq: it doesn't like the File in that :tempfile key?

17:41 nmq: I was passing the whole map

17:42 dobry-den: try (io/reader (:tempfile <map>))

17:44 nmq: Beautiful, thank you dobry-den!

17:48 dobry-den: nmq: it's because that map is nothing special, just some metadata that ring provides for you. it might as well be {:foo "lol"}

17:49 but io/reader knows how to handle the File type

17:49 nmq: I see, that makes sense

18:26 n008: I am a total newbie to clouure

18:26 s/clouure/clojure

18:27 can you run clojure outside a jvm ?

18:27 typeclassy: you can use clojurescript

18:27 coventry: n008: What are you trying to do?

18:28 pisketti: n008: also https://github.com/clojure/clojure-clr

18:29 dnolen: CLJS source maps now work even w/ no Closure optimizaitons - http://github.com/clojure/clojurescript/commit/b924f8e0fab8cc00ef5e47719f8b4984685abda4

18:29 n008: coventry: nothing just looking around

18:29 thanks pisketti

18:32 ta479: n008: https://github.com/takeoutweight/clojure-scheme

18:35 n008: if you want something faster you're going to have to roll your own

18:40 n008: ta479: what is clojure-scheme

18:42 ta479: clojure -> scheme -> C -> machine code compiler

18:57 bbloom: dnolen: good stuff

18:57 dnolen: bbloom: yes. much nicer experience.

19:00 bbloom: if i ever dig my way out of this js/rb hell, maybe i'll get to try it out

19:00 xuser: nice!, they should have used chicken scheme ;)

19:02 TimMc: gfredericks: 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:06 dobry-den: dnolen: hell yeah

19:07 dnolen: dobry-den: yep, it's pretty nice

19:11 grncdr: dnolen: you are east coast right?

19:12 I need to remember to buy you a beverage of choice if I'm ever in the area

19:12 akurilin: bitemyapp, 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:12 bitemyapp, that whole "override configs" pattern is great

19:12 dnolen: grncdr: yes :) appreciated

19:13 grncdr: 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:14 grncdr: will do, I still don't know how to use a git version of clojurescript in my project yet

19:14 (and probably shouldn't, what with my new-shiny addiction)

19:14 dnolen: grncdr: 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:18 grncdr: too 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:18 btw, with core.async, is it possible to use (<! ...) in a function called by a go-block?

19:18 like (go (my-func ...)) where my-func contains the <!

19:20 dnolen: grncdr: only shallow yield, very much like C# and ES 6 generators

19:20 bbloom: grncdr: no, you need to use an extra channel/go/<1

19:20 grncdr: ah ok

19:20 bbloom: grncdr: it's a lexical transform in a macro, it can't go inside opaque calls

19:20 coventry: grncdr: 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:20 grncdr: right, that makes sense

19:20 it was just odd that I was getting the exception at run-time then

19:21 but I can see why, if go is a macro and <! isn't

19:21 cgag: anyone 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:22 kind of at a loss for how to debug such a thing

19:23 Brand0: postal?

19:24 it could be a lot of things, where are you trying to send, for one?

19:25 cgag: mailtrap at the moment

19:26 Brand0: any encryption?

19:26 cgag: nope

19:26 Brand0: do wireshark or tcpdump or something like that to see what's going on with the connection

19:38 bitemyapp: akurilin: yep.

19:53 akurilin: bitemyapp, 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:53 bitemyapp: akurilin: not personally, no.

19:54 akurilin: seangrov1 uses Korma too though, could ask him.

19:57 grncdr: dnolen: 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:58 akurilin: bitemyapp, 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:00 bitemyapp: akurilin: are you into electronic music?

20:01 akurilin: bitemyapp, don't go out of my way for it, but I do have a few artists here in the genre that I enjoy

20:01 bitemyapp: akurilin: I'm roughly in the same position but I'm trying to force myself to go out more. Anyway, Huxley at Monarch tonight.

20:03 akurilin: bitemyapp, will have to check them out on spotify or something

20:03 bitemyapp: akurilin: https://soundcloud.com/huxley_uk/let-it-go-original-mix

20:12 akurilin: bitemyapp, brain gets really confused when switching from post-metal to electronica

20:15 bitemyapp: akurilin: I didn't know you listened to post-metal. I listen to a ton of post-metal/blackgaze/black metal, and post-rock.

20:15 akurilin: http://bandcamp.fallenempirerecords.com/album/endlichkeit-i-ii

20:18 akurilin: bitemyapp, 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:19 Best part is Norwegians in full leather and nails outfits running around frozen woods.

20:26 bitemyapp, pretty raw, like it. I imagine you're familiar with Alcest?

20:26 bitemyapp: akurilin: one of my favorite bands :)

20:27 akurilin: bitemyapp, I approve.

20:27 bitemyapp: he has a new album coming out soon.

20:27 http://en.wikipedia.org/wiki/Les_Voyages_de_l'%C3%82me I have this one in my car.

20:29 akurilin: some doom inspired stuff: http://chelseawolfe.bandcamp.com/

20:31 akurilin: bitemyapp, nice. I'm literally all about discovering new bands/subgenres.

20:31 bitemyapp, are you on Spotify?

20:31 bitemyapp: sf examiner's website is noticeably slow.

20:32 akurilin: yeah, my account on spotify is the same as my name.

20:32 dobry-den: bitemyapp: dude, state machines are exactly what i wanted.

20:32 bitemyapp: dobry-den: told you.

20:32 dobry-den: use ztellman's automat. 'tis cool. :)

20:32 dobry-den: i built one myself with core.async/go-loop

20:32 bitemyapp: nifty.

20:32 dobry-den: do you send valid results down a channel?

20:34 dobry-den: it started that way. but then i watched dnolen's core.async video and now it's a chain of a few channels

20:35 bitemyapp: I usually start with one channel and start chaining or broadcasting afterward.

20:36 dobry-den: it 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:37 akurilin: bitemyapp, yeah I don't think I can add you there without FB, and your FB SEO is rough :)

20:38 bitemyapp: akurilin: blargh. let me log into spotify and see what I can rustle up.

20:39 akurilin: I have one of the pre-FB grandfathered accounts so Spotify is hella weird about following people sometimes.

20:40 akurilin: bitemyapp, yeah I figured, they're probably trying to weed you guys out :)

20:40 I hate that about my apps, stupid backwards compat.

20:40 bitemyapp: akurilin: added you on FB

20:42 akurilin: alright, gotcha followed now.

20:43 akurilin: bitemyapp, yeah I'm running ubuntu spotify, not sure I'll ever see you on there lol.

20:43 bitemyapp: akurilin: I used to use the Linux client, it was surprisingly decent but still the red-headed stepchild.

20:43 sritchie: technomancy: have you seen this before?

20:43 gpg: cancelled by user

20:43 gpg: cancelled by user

20:43 gpg: decryption failed: secret key not available

20:43 but that's not the case

20:44 bitemyapp: sritchie: are you trying to deploy?

20:44 sritchie: yeah, a snapshot

20:44 gpg -d ~/.lein/credentials.clj.gpg works fine

20:44 bitemyapp: sritchie: https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md https://github.com/technomancy/leiningen/blob/master/doc/GPG.md

20:44 sritchie: yeah, I've been through all of that

20:44 Apage43: i've had stuff like this happen when my gpg-agent gets wedged

20:44 bitemyapp: sritchie: https://github.com/technomancy/leiningen/issues/1349

20:44 sritchie: haha, I filed that

20:44 bitemyapp: oh, right.

20:44 nuts.

20:45 akurilin: bitemyapp, you seriously have brontide as one of your playlists?

20:45 bitemyapp: akurilin: no, just discovered it through you.

20:45 so *now* I do.

20:45 okay okay, 5rlz. I need to get ready for sushi.

20:45 akurilin: I have Post, Black Metal, and Blackgaze playlist folders, should find some stuff in there.

20:45 akurilin: I highly recommend the Great Old Ones!

20:46 akurilin: bitemyapp, deal.

20:46 bitemyapp: they're right on the knife's edge between epic black metal and blackgaze, it's wonderful.

20:46 Catch y'all latah.

20:46 * akurilin waves

20:50 sritchie: bitemyapp: yeah, gpg-agent cancels my business

20:53 ugh

20:53 well, whatever

20:57 grncdr: ?

20:57 er, hm, I had question before that...

20:58 is 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:59 it 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:01 akurilin: Am 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:01 As 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:02 grncdr: akurilin: if you're sure the clients can handle it, then yes

21:02 really depends on the particular result set unfortunately

21:04 like, 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:05 akurilin: grncdr, yeah I get what you mean, thanks.

21:05 grncdr, just wanted to confirm that my line of thinking was potentially sane for some scenarios

21:08 grncdr: for every line of thinking there exists some scenario which has the potential to make it seem sane

21:09 the real trick is recognizing when the scenario is (becoming) insane and cut it off before you start doing really ridiculous things ;)

21:10 * grncdr would really like to have that superpower

22:19 holo: hi

22:59 is 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:00 *input is "foobar", for that example

23:09 dobry-den: holo: i dont remember what (group) matches look like in the return, but cant you just destructure it?

23:11 holo: dobry-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:11 (["Mr." "NNP"] ["Smith" "NNP"] ["car" "NN"] …)

23:12 dobry-den, i guess this is out of regex domain or that of clojure core fns. i should probably look further into clojure-opennlp

23:13 dobry-den: yeah im pretty useless, to boot

23:14 holo: i'm thankful anyway

23:16 dobry-den: Core.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:16 I'm not proud of it but it seems to work. Any tips for a less bad approach?

23:19 A timeout socket is created on every loop iteration because i only want to timeout since the last byte received.

23:19 timeout channel*

23:30 akurilin: Oh man, I don't even know where to start with respect to dirty repls and the headaches you can give yourself.

23:31 dobry-den: akurilin: what's a dirty repl

23:31 holo: probably he means state

23:31 dobry-den: er, i mean an example

23:32 akurilin: well.. 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:32 dobry-den: haha yes

23:32 every day

23:32 akurilin: so you change it, unit test it to death, with absolutely no results

23:32 holo: akurilin, i didn't even start, so i just restart :D

23:32 akurilin: this is the part where I need to kick myself in the ass and setup Sierra's workflow

23:33 *set up

23:33 holo: akurilin, i must setup Sierra's worflow someday, but it's hardcore indeed

23:34 dobry-den: "surely i'll sit down and implement it someday"

23:35 holo: ..someday..

23:35 dobry-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:36 holo: dobry-den, i leave one-time reads in a kind of stack (getpocket), not favorites

23:36 i mean, one-time potential reads

23:36 akurilin: as long as you're getting there at some point

23:36 dobry-den: but that's the thing. out of guilt and shame i begin to avoid the stack

23:36 akurilin: Pocket scares me, it grows at a much faster pace than I can read it :)

23:36 dobry-den, that

23:39 holo: to balance my shame now, after reading some good article or video, i stack it on "read articles" of stackoverflow careers

23:39 akurilin: hah

23:39 technical videos are the worst

23:39 they just sit there in Firefox for months and months

23:39 looking at you

23:39 mocking you.

23:40 holo: akurilin, those are the best.. i tend to watch them while eating. this way i can look at the food while listening

23:40 akurilin: "Guess who's been eating up 500mb of your memory since February, son"

23:40 holo: hahaha

23:41 arrdem: this is what emacs deft is for.. get the a "to watch" list!

23:41 s/the/thee/

23:42 dobry-den: it'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:42 holo: anyone tries to read clojure mailing list months old on inbox, out of guilt?

23:44 dobry-den: i just dont use that account anymore

23:44 clojure mailing list was least of my problems

Logging service provided by n01se.net