#clojure logs

2014-01-18

00:00xuserddellacosta: great, thanks
00:00xuserdeadghost: probably gonna bug you after reading it ;)
00:00ddellacostaxuser: my short answer is use closure rather than jquery (jayq), but check out dommy too.
00:02xuserddellacosta: ok, does the closure library and dommy overlap?
00:03ddellacostaxuser: no. Domina and Closure do, of course.
00:05xuserddellacosta: ok, so clojure lib and dommy are a nice combo to use
00:07ddellacostaxuser: again, it's really about what you are trying to build. For example, if you think you'll want to re-purpose a lot of the UI widgets that Google Closure provides, then it may be nice to just use Google Closure only, or Domina + Closure. If you won't need to lean on any UI widget libs, then dommy may be a better choice, or enfocus if you prefer that approach.
00:08ddellacostaxuser: and in the end, if you get familiar with one or the other, it won't be hard picking up another lib, so if you are just trying things out I wouldn't think about it too much--just pick one and go.
00:10ddellacostaand this is leaving aside using something like Om or Cloact, which kind of obviate the need for these sorts of dom libs
00:13xuserddellacosta: thanks, I'm just learning JS and DOM but don't want get to deep in JS, just enough to be able to code in cljs with not somethking slowing me down
00:14ddellacostaxuser: try dommy. :-)
00:14kristofxuser: Om is not Javascript, if it's "deep" in anything, it's Clojurescript. :)
00:14ddellacostayeah, I mean, it's important to note that the approach implied by dom libs like the above and react/om is very different, fundamentally.
00:15xuserkristof: yeah, I think I want to focus on om/closure library
00:16xuserwas asking of closure lib vs jquery, because I don't really want to reinvent all those usefule UI widgets
00:16xuser:)
00:17ddellacostaxuser: I'm not sure how you would use a google closure widget with Om/React, honestly. Not sure it's possible (in an idiomatic way).
00:18bbloomxuser: you may find those widgets much easier to build with react than to repurpose from elsewhere, heh.
00:18bbloomespecially if you don't want to use their CSS
00:18xuserddellacosta: what's the limitation?
00:19xuserbbloom: glad you said then ;) thanks
00:19ddellacostaxuser: I'm just honestly not sure if the way that Google Closure UI widgets get render is can fit within the component model that React provides. I mean, it may be possible, I'm honestly not sure.
00:19ddellacosta*rendered
00:20clojurebotExcuse me?
00:20bbloomddellacosta: it shouldn't be any trouble really, other than requiring you to play the IDisposable game with react's lifecycle events
00:20xuserbbloom: I'm going switch my focus to cljs/om/react now :)
00:20bbloomddellacosta: react plays surprisingly nice with other frameworks/widgets/etc as long as they stick to their own respective subtree
00:21ddellacostabbloom: ah, okay. I've yet to dig in seriously to Om/React so I'm still ignorant on that front. This is informative though: https://github.com/facebook/react/blob/master/examples/jquery-bootstrap/js/app.js
00:21ddellacostabbloom: confirms what you're suggesting.
00:22ddellacostaseems pretty clearly to be embedding jquery/bootstrap widgets inside of react components. Interesting.
00:24xuserthe JS ecosystem is horrible/scary place, it looks like pure Cljs fixes 80% of the 3rd party JS libs
00:25domino14how do i escape a quote character?
00:25domino14i want to find the " in a string
00:25domino14#"\"" doesn't seem to work
00:27xuserbbloom: isn't the problem that most frameworks/widgets aren't compatible with the advaced mode of closure compiler?
00:27bbloomxuser: yeah, that's *an* issue
00:27bbloomxuser: the bigger issue is that many frameworks like to assume they own the dom
00:27bbloomxuser: you'd *think* that were true of react, but it's not
00:28bbloomreact only presumes to control a *slice* of the dom. generally a subtree up until (and including) components it has "rendered" but *not* including components it doesn't know about... so you can use the mount/unmount events to connect stuff within that sub-sub-dom & react promises not to muck around with it beyond a data-react-id attribute
00:29domino14arghhh
00:29domino14how do i find a " character in a string
00:30bbloom,(re-find #"\"" "x\"y")
00:30clojurebot"\""
00:30bbloomseems to work fine to me
00:31bbloomdomino14: maybe you're using re-matches incorrectly?
00:31bbloom,(re-matches #".*\".*" "x\"y")
00:31clojurebot"x\"y"
00:31domino14,(clojure.string/replace "\"COOKIES#"\"" ""
00:31clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
00:32domino14,(clojure.string/replace "\"COOKIES#"\"" ""
00:32clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
00:32domino14sorry
00:32domino14,(clojure.string/replace "\"COOKIES\"" #"\"" "")
00:32clojurebot"COOKIES"
00:32domino14,(clojure.string/replace "COOKIES" #"\"" "")
00:32clojurebot"COOKIES"
00:32bbloomdomino14: heh, you're just misinterpreting the output :-)
00:32domino14:( sorry
00:32bbloomtry:
00:32bbloom,(println (clojure.string/replace "\"COOKIES\"" #"\"" ""))
00:32clojurebotCOOKIES\n
00:33domino14oh it's my editor that sucks
00:33bbloomdomino14: strings are quoted when printed as literals :-)
00:33bbloomanyway, gnight all
00:33domino14i have this: (clojure.string/replace str #"\"" "") and my editor is highlighting everything wrong. i thought sublimetext was good for clojure
00:34xuserbbloom: so that stuff you connect within that sub-sub-dom should be code in JS if you are using jquery for example and to pass through the clojure compiler?
00:35xusers/to/not/
00:35xuserof he left ;)
00:37danneu Isn't :jvm-opts ["-Djava.awt.headless=true"] supposed to prevent this: Exception in thread "main" java.awt.HeadlessException?
00:38hiredmandanneu: it most likely means you are trying to do something that absolutely requires a head
00:38hiredmanhttp://docs.oracle.com/javase/7/docs/api/java/awt/HeadlessException.html
00:38clojurebotPardon?
00:38bitemyappkristof: reading the Haxl slides, very cool.
00:38bitemyappkristof: the sort of thing I was telling a coworker works a lot better in Haskell.
00:42xuserbitemyapp: we have lost you to haskell ;)
00:46bitemyappxuser: yeah, actually.
00:59marcopolo`I'm performing an experiment, who uses vim and has a decent amount of clojure on github?
01:42domino14is there a way to enumerate a vector with for? like (for [el my_array] ; i want access to the element, and the index of the element
01:48bjadomino14, (map (fn [i e] ...) (range) my_array)) works with map
01:49domino14oh cool didnt know it would take two args
01:50andrew_fm,(doc map)
01:50clojurebot"([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."
01:50bja,(map (fn [i x] [i x]) (range) [:a :b :c])
01:50clojurebot([0 :a] [1 :b] [2 :c])
01:51bjaguess I could just use vector in the example...
02:01amalloy,(map-indexed vector '(a b c))
02:01clojurebot([0 a] [1 b] [2 c])
02:03andrew_fmperhaps the best feature of this channel and of 4clojure is seeing how people pull functions out of the hat that i haven't used before. sure is better than reading a long list of API docs to learn all the various functions.
03:12hcumberdaleHI :)
03:13bitemyapphcumberdale: hai
03:14arrdemI see chare has gotten sick of being hellbanned and moved on to easier targets...
03:15arrdemah crud.
03:15bitemyapparrdem: ?
03:16arrdembitemyapp: how can I change the default shard for a database?
03:16arrdembitemyapp: I'm getting stuff on Omniknight (which will go down) an I need Warlock to be the primary.
03:16bitemyapparrdem: http://i.imgur.com/ba3K8PF.gif
03:16arrdembitemyapp: yes yes that was all over r/dogecoin
03:17arrdemmy entire doge collection is worth $1.14....
03:20bitemyappoh my god why are people still messing with DCPU-16?
03:21bitemyappjust use a 6502 emulator :|
03:21arrdemgood question... they could be inventing their own saner architectures but no we have DCPU-32s...
03:28bitemyapparrdem: http://www.rethinkdb.com/docs/sharding-and-replication/ ctrl-f "pinning"
03:28arrdembitemyapp: danke
03:29bitemyapparrdem: "default shard" momentarily confused me but I think I've touched on the bit you care about.
03:29bitemyappI like how you immediately clustered your rethinkdb instance for the fuck of it.
03:29bitemyappjust lol.
03:30arrdembitemyapp: I mean...
03:30arrdembitemyapp: I know the IT guys here and they give no fucks what I do on network...
03:30bitemyapphey, it's a good thing that it's a clustered data store that actually "just works"
03:30bitemyappI just found it amusing.
03:30arrdembitemyapp: yeah. and that SJW makes my night.
03:30bitemyapparrdem: SJW?
03:31arrdembitemyapp: shit just works
03:31bitemyappoh right, yes.
03:31bitemyapparrdem: well that and the sharding and replication is actually sensible and tuneable.
03:31bitemyappMongoDB? lol, serious deployments have to do the sharding themselves because the 10gen impl is too fucked.
03:32arrdemfukkit new mololithic project. I'll just salvage what I can from the wreckage of clojurecup...
03:32arrdemand LEIN_IRONIC_JURE can just piss right off
03:33bitemyapparrdem: in Minecraft, is it me or is Equivalent Exchange pretty much grind-to-cheat-mode?
03:34arrdembitemyapp: probably... I'm not familliar with that particular mod
03:40bitemyapparrdem: Now I just need you to use Revise... http://i.imgur.com/btjXhpH.jpg
03:42arrdembitemyapp: dude. chill friggin 10 minutes. I'm digging through a trainwreck of forgotten ideas and clojure code. revise is already in deps, I just need to find the pieces, fix http://i.imgur.com/iw4YuOi.gif and then I can start using your stuff...
03:43bitemyapparrdem: oh I'm chill, just excited :)
03:43bitemyapparrdem: great gif.
03:53arrdemyep well that project was a pile of once-off data munging scripts in Clojure...
03:54locksdanneu: neat :D
04:12arrdemI wonder if doing this whole thing in core.typed is reasonable...
04:12arrdemsingle dispatch problem domain...
04:12arrdemcould be viable.
04:19bitemyapparrdem: you can type-check multimethods too. Sorta.
04:20arrdembitemyapp: yeah but when I've tried that stuff I ran into rough patches even faster...
04:22arrdembitemyapp: r/insert implicitly does a multi if given (U List Vec)?
04:26arrdembitemyapp: also why no -! convention? just because you don't have a mutable global connection?
04:27bitemyapparrdem: pretty much.
04:27bitemyapparrdem: they're not STM operations.
04:27bitemyapparrdem: ! is for STM operations, conventionally.
04:28bitemyappdeeply proud of that.
04:32arrdemmmmk. I've been using -! for anything with side-effects whether STM or otherwise.
04:32arrdemmay take this opportunity to change my style..
04:36bitemyapparrdem: yeah I've seen people do the same, but I talked to tbaldridge about it - no dice, not what it's for.
04:37bitemyapparrdem: it's specifically to warn you against using impure functions inside of the !-annotated function whereas it may not matter in the cases you're using them in.
04:37bitemyappif somebody took it too literally, they could be in for same pain :)
04:38arrdembitemyapp: so what's the usage here... I assume I need to compose r/db with r/table before I can execute operations even though the examples don't show this..
04:39bitemyapparrdem: the tests are a good place to poke around.
04:42bitemyapparrdem: just be aware there's a fair bit of partial application and aliasing/wrapping of common-case stuff flying around.
04:42bitemyapparrdem: cbp was thorough :)
04:42bitemyapparrdem: fair warning, the library is 80% cbp's work, I just did the conn mgmt.
04:43bitemyappin about 15 minutes you're going to know more than I do.
04:43arrdembitemyapp: I'm just reading the partials trying to decide how cute it is...
04:43bitemyappor sooner,.
04:43bitemyapparrdem: be easier in a typed lang...
04:48xexonixxexillionI want to learn clojure, but most of the tutorials seem to be more aimed at people coming from java. Can anyone suggest tutorials for someone coming from common lisp or Haskell (I'm proficient in both)
04:49bitemyappxexonixxexillion: you're proficient in Haskell?
04:50bitemyappxexonixxexillion: you probably just want Joy of Clojure, but either way, shouldn't take much time at all.
04:50abaranoskyxexonixxexillion: your learnign points will all revolve around the JVM then
04:50locksI second JoC
04:50bitemyappxexonixxexillion: abaranosky is right, but Clojure offers some ways to skirt around and avoid having to be confronted with Java-isms all at once.
04:51bitemyappabaranosky: did you really not know about ::?
04:51abaranoskyI know ::foo, sure
04:51abaranoskybut if I evaluate ::my.ns/foo in the repl BOOM
04:51bitemyappthe namespace has to exist yo.
04:51bitemyappthe point of :: is namespace qualification.
04:51abaranosky:my.ns/foo is fine though
04:52bitemyappbecause it's not namespace qualified
04:52abaranoskywhat is it then?
04:52clojurebotTitim gan éirí ort.
04:52bitemyapp:my.ns/foo is basically arbitrary data with the namespace getting destructured out.
04:52bitemyappas a convenience.
04:52bitemyapp::my.ns/foo isn't really arbitrary data, it's a namespace qualified keyword that is sorta intended to be a proxy for a var.
04:52abaranoskythere's a function you can call to get the n of a keyword right?
04:53bitemyappof any keyword, yes
04:53bitemyappbut if the namespace OF the keyword doesn't exist then you can't use a namespace qualified keyword, if it's a "logical"
04:53abaranoskyso I guess I didn't know that
04:53bitemyapprather than "actual" keyword.
04:53bitemyapp:: should mean you're referring to a var in a real and in scope namespace.
04:53abaranoskyI thought that keyword namesapces and regular namespaces were totally orthogonal
04:53bitemyapp: is just data.
04:53bitemyappabaranosky: they are...in :
04:54abaranoskyyeah, right, makes sense
04:54bitemyappabaranosky: I think the idea is to get a less-stringy, compiler-checked way to refer to vars as data.
04:55abaranoskyoh, interesting.
04:55bitemyappI can't say for sure because I'm not Hickey, but that's the only way I've seen them used.
04:56abaranoskyI just use them whenever I add a key to someone else's map where I wn't know the keys in the map 200%
04:58honzabitemyapp: is there any convention of marking up pure/impure functions?
04:59bitemyapphonza: nope. Welcome to Hell.
04:59abaranoskyI write my impure functions in red
04:59bitemyappabaranosky: no, you use the red ink for Hickey's words.
05:00abaranoskyI sprin magic elven gold dust on his words, and am transported to a better time, where magic and mystery was the rule of the land
05:02john2xwhat fn do I want to check if an element is in a coll?
05:02honzawelp
05:02john2xI thought it was contains? but it only works on keys
05:02abaranoskyjohn2x: depends on the colelction
05:02bitemyappjohn2x: (partial some #{element})
05:02abaranoskystick your data in a set, and call contains?
05:02abaranoskyif you have any kind of size of data then some sucks
05:03bitemyappyou don't need to even do that.
05:03bitemyappsets are functions, you just need to pass it as a function to some.
05:03abaranoskybitemyapp: sure
05:03bitemyappI've used some #{} for existential queries against colls ever since Raynes showed me the light
05:04bitemyapp10:01 <chare> unmute now or I tell your girlfriend you cheated on her
05:04bitemyappthis dude has a seriously optimistic view of my social life.
05:04bitemyapparrdem: ^^
05:04arrdembitemyapp: yep yep
05:04john2xthanks
05:05andrew_fmlol bitemyapp
05:06bitemyapparrdem: I should break his heart and tell him he's not more interesting than google closure compiler arguments?
05:06arrdembitemyapp: you assume it has a heart, let alone a soul....
05:06andrew_fmsomeone just knocked on my door. but no one was there, then I get back here and this is waiting for me: 6:03 <chare> turn off mute or next time i'll be standing there with something in my hand
05:06andrew_fmdo you think it would be a bouquet of flowers?
05:06bitemyappLOL
05:07arrdem.............
05:08bitemyapparrdem: what if chare turns out to be an omnipotent malevolent multi-dimensional being who is only allowed to unleash his powers when human beings try to silence him?
05:08bitemyappwhat if by muting him...we've opened pandora's box?
05:08bitemyapp#creepypasta
05:09arrdembitemyapp: okay. that I need to compose db -> table-db -> insert should be in the fucking readme file.
05:09arrdembitemyapp: I should not have spent the last 15 reading test cases and grepping the query code.
05:09bitemyapparrdem: PRs accepted by my lazy ass.
05:10andrew_fmwhat is creepy pasta?
05:10bitemyappwait, the README should have a shake-n-bake example
05:10arrdemIMHO yes.
05:10bitemyapphum.
05:10bitemyapparrdem: that's in the README
05:11bitemyapparrdem: https://github.com/bitemyapp/revise/#insert
05:11arrdembitemyapp: right. you give this insertion example, but r/table implicitly uses the default table, "test".
05:11arrdembitemyapp: sorry. db.
05:12arrdembitemyapp: if you want to change DBs, you have to compose (r/db), (r/table-db) an then as shown.
05:12arrdembitemyapp: why am I lecturing you on your library.
05:12bitemyapparrdem: you're right, the documentation can be made more explicit.
05:12bitemyapparrdem: it was basically "unrolled" out of the test cases.
05:13bitemyapparrdem: it's a 36kb README.md though, that's not shabby at all for a Clojure library.
05:13bitemyapp10:08 -!- chare [322f51ac@gateway/web/freenode/ip.50.47.81.172] has quit [Quit: Page closed]
05:13bitemyapp10:09 <chare> god dam nit
05:13bitemyappway too entertaining
05:13bitemyapparrdem: it even covers date/time manipulation!
05:13arrdembitemyapp: hang on.. you left me a raw IP there...
05:14arrdemah fuck. web client.
05:14arrdemeven I portscan anyway. 1d2
05:14arrdem1d2
05:14clojurebot2
05:14andrew_fmi have successfully rooted chare's machine, i'm digging through his files right now. nothing too interesting yet.
05:14bitemyappandrew_fm: wait what
05:15arrdemandrew_fm: ..... wat
05:15arrdembitemyapp: he's still talking to me...
05:16andrew_fmchare has the worst firewall protection, and by "worst" i mean "none"
05:16arrdemapparently he's in Washington state...
05:16arrdemlemme see what I can get with geoip.
05:16andrew_fmi will tell you exactly where he lives in a pm, but don't want to do that publicly
05:17arrdemhe is running Linux... 2.6. I'm probably seeing a network device given the service list I scanned up.
05:20bitemyapparrdem: "likely embedded"
05:20arrdemyeah best I can do is Redmond area. The geoip lookup breaks down because the tracerout winds up in ISP owned nonpublic IP ranges...
05:21bitemyapparrdem: redmond? Microsoft intern?
05:21bitemyapparrdem: pretty brutal drop in employee quality :)
05:22hcumberdaleHad a meeting with MS for startups yesterday :D
05:22andrew_fmi'll send you google maps satellite image of his house in pm
05:22bitemyapp10:19 <chare> WHY WOULD I EVER WORK FOR FAGGY MICROSOFT
05:22bitemyapphcumberdale: oh their tech lock-in program?
05:23hcumberdaleAzure looked good. They offer also seed-funding, accelerator and biztalk programs
05:23hcumberdaleyeah bitemyapp, it seems to be a bit like it
05:23bitemyapphcumberdale: it's not worth it ;)
05:23hcumberdale"If you get funding you have to create a company placed in the US, for taxes"
05:23hcumberdale... and US law?
05:24hcumberdalebitemyapp: he just showed what is possible, not the terms and conditions
05:24arrdem<chare> ok what do you want in exchange for unmute [04:09]
05:24arrdem<chare> you guys gotta hide behind a proxy [04:11]
05:24arrdem<chare> you guys scared to show yourself [04:12]
05:24arrdem<chare> YOU GUYS STOP SCANNING ME
05:25hcumberdaleJust told that people who use some services have to relocate to berlin and thats why ~300 candidates directly reduced to 80
05:25hcumberdale"We haven't read terms and conditions, can't move to berlin, sorry"
05:26hcumberdaleMost startups in their german program don't use the MS technology. Only Azure because of the ability to run Linux, Java and such things from it and they seem to be flexible with their free plan for startups.
05:27andrew_fmhcumberdale i was thinking of moving to berlin actually, so what do you mean? however i was there in September and the internet service city-wide is quite bad, espcially for a city known for its tech work
05:28honzaEnjoying all the Clojure talk this morning.
05:28hcumberdaleandrew_fm: a lot of startups are dependant on their location. Different problems occur like people are not willing to relocate because of their family. Or they have to do a 2nd job to finance their startup.
05:28arrdembitemyapp: ah I love watching the document count tick up...
05:29arrdembitemyapp: porting from Mongo was a breeze one I figured your crud out.
05:29andrew_fmoh you mean, for devs to take jobs with new startups? i thought you mean starting your own startup
05:29abaranoskyI really like Emacs gist-mode :)
05:30andrew_fmberlin is a really interesting city but it is an odd one why their internet is so primitive. lots of complaints about it from guys who normally work in other places.
05:30andrew_fmbut then again, i actually had a cab driver in berlin who had never seen a credit card before, so go figure.
05:30hcumberdaleno the M$ stuff is for fresh startups that get free software, free usage of cloud Azure stack (up to 50k$ I think), free education and so on. Funding from 50k$ up to 250k$
05:31arrdemhcumberdale: wow MSFT is that desperate to secure users?
05:31andrew_fmand it takes 10 minutes to use an atm machine there because the connection is so slow.
05:31hcumberdalearrdem: I think they want to get the next billion dollar start-ups running on azure
05:32arrdemhcumberdale: this I totally understand... I just find it funny.
05:32hcumberdaleThe ultimate lock-in is gone. Everybody is writing software for android, ios, linux, whatever...
05:32arr0wwhat do you think about typed clojure?
05:32hcumberdalearr0w: haven't understood the benefit of it
05:33hcumberdalesince there are type hints performance shouldn't be the problem
05:33arrdemhcumberdale: the advantage of typed clojure is that you can selectively add typechecker backed gurantees to your Clojure code.
05:33hcumberdaleand where is typesave really helpful? Modern applications just include a lot magic and dependencies to other systems.
05:34hcumberdalearrdem: isn't that what type hints are actually doing?
05:34arrdemhcumberdale: not at all
05:34arrdemhcumberdale: type hints are hints to the compiler about the runtime type so that the emitted classes can use static type dispatch.
05:34arrdemhcumberdale: applicable only to gen-classes and java.lang.*
05:35hcumberdaleso you mean for example it is helpful for refactoring and stuff
05:35andrew_fmhcumberdale i think the device-specific tendencies to write for a particular OS will gradually give way over cloud apps, and MSFT understands that. its easier to write a cloud app that both an android and iOS user can access then to manage two codebases. many other advantages also.
05:36arrdemhcumberdale: absolutely. the value I've gotten out of my core.typed adventures was entirely when the typechecker called me on not satisfying my own map structure "gurantees", and calling me out when I didn't migrate an entire subsystem between representations.
05:36hcumberdaleandrew_fm: for MS it is all going down to money. And if they can't be the manufacture of the boat to sccess they are likely want to sit in there :)
05:37hcumberdalearrdem: isn't that better covered by tests. All the structural representation is done by some convention since you have so many ways to declare data structs
05:38khaledo/
05:38hcumberdaleTo hard-code it might lower agility ^^
05:38arrdemhcumberdale: not at all in my experience. tests show that your stuff breaks, the typechecker can provide formal proof that there exists some case (not nessicarily covered by your tests) in which your program will break.
05:39hcumberdalearrdem: ok, but at the cost of bad readable hard-to-maintain code
05:39hcumberdalelook at scala (okay it is more complex with all the OO* stuff)
05:39arrdemhcumberdale: right. or at least that's the sales pitch.
05:39hcumberdaleBut the type system makes declarations and everything crazy
05:40khaledarrdem: is typed clojure a possible solution, for strong typed?
05:40arr0warrdem when you get errors with typed clojure, at compile time?
05:40arrdemarr0w: whenever you invoke the (check-ns) form, usually compile or test time. core.typed is designed to have zero runtime footprint.
05:41hcumberdaleStatic types, reminds me to: http://goo.gl/1cX821
05:43arr0warrdem so you used typed clojure in a real-world application? I guess your code base needs to be relatively large to start seeing the benefits?
05:44arrdemarr0w: I've only used core.typed in my hobby clojure code
05:44arrdemarr0w: but I've seen the typechecker catch real issues in my designs in programs under 1K lines.
05:45bitemyapparrdem: "I never write code with type errors because I've relabeled type error to mean logic error!"
05:46bitemyappNothing makes my eyes prolapse and cause me to descend into a red-haze like hearing that.
05:46bitemyappeyes to*
05:49arrdemalright... well I could make some effort to parallelize my IRC log scraping, but as everything is ticking over smoothly I think I'll just hit the sack
05:49arrdemnight all
05:49arrdemchare: burn in hell
05:50hcumberdalenight? :)
05:50arrdemhcumberdale: I'm in Texas. it's about 5am here :P
05:50bitemyappsigh, I should sleep.
05:50abaranoskycore.typed is so verbose though
05:51bitemyappabaranosky: yeah :(
05:51bitemyappabaranosky: Fay and Haskell are short though :)
05:51abaranoskyyeah, I 've tried it and gave up. :(
05:51abaranoskywhat is Fay?
05:51bitemyappsetBGColour :: Text -> JQuery -> Fay JQuery
05:51arrdemabaranosky: yeah... it has gotten better thanks to the *> forms, but it still has a significant overhead.
05:51bitemyappabaranosky: Haskell->JS, it's quite nice :)
05:51abaranoskyI see, googled
05:51hcumberdaleahh, good n8 :)
05:52abaranoskylater
05:54arr0wabaranosky it is? doesn't seem too verbose to me. I only looked at simple examples, though
05:55abaranoskyarr0w: maybe I'm just not used to it?
05:59ambrosebsI don't think core.typed will ever be described as succinct ;)
06:00arr0whttp://adambard.com/blog/core-typed-vs-haskell/
06:01arr0wthere's some initial plumbing, and in those examples names of the types are longer in core.typed than in haskell, but the actual syntax for declaring function signatures is more or less the same in haskell and typed clojure
06:01arr0wverbosity wise
06:04hcumberdaleYeah, verbose.
06:04ambrosebscompared to Clojure, Typed Clojure is verbosity city. But of course Clojure doesn't give you any guarantees.
06:04hcumberdaleambrosebs: who needs compile time guarantees?
06:04hcumberdaledon't think its such an advantage
06:05arr0wwell sure, but comparing typed clojure with clojure is not a fair comparison
06:05ambrosebshcumberdale: ok, then don't use the type checker :) a type system is not very interesting for some problems.
06:06ambrosebsarr0w: yes, but that's what people want. Clojure syntax, with the guarantees of Typed Clojure.
06:06ambrosebsarr0w: which would be pretty awesome.
06:08arr0wtype inference would be nice.
06:17arr0whow does clojure name python's `any' and `all' functions? they take a list of predicates and return true if any or all predicates are true
06:17arrdemarr0w: #'clojure.core/some
06:18andrew_fmarr0w also every?
06:18andrew_fm,(doc every?)
06:18clojurebot"([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
06:18arr0wlooks like that is it, thanks
06:18arrdemcore/some just gets my goat because it's a predicate which doesn't conform to the -? convention.
06:19bitemyapparrdem: some and every?
06:19bitemyapper
06:19andrew_fmactually some is not a predicate, but it behaves like one. it doesn't have the ? because it is not actually a true predicate
06:19bitemyappaimed at the wrong person
06:19bitemyappAND slow on the draw
06:19bitemyappfuck me
06:19bitemyappmight be time to sleep.
06:19bitemyapparrdem: I solved my first mysterious Fay bug!
06:19arrdemmight be.
06:19andrew_fmit returns the value of the predicate function for the first value found, thus it may not be a predicate result
06:19bitemyappwasn't Fay's fault (t'was mine), but I've filed an issue for a potential case where a helpful compiler error would be good.
06:19arrdembitemyapp: woot. I just rewrote my crawler to do 8-wide parallel and it's going like a bat out of hell.
06:20bitemyapparrdem: hahaha, nice.
06:20arrdembitemyapp: I just hope that revise isn't silently loosing async transactions..
06:20bitemyapparrdem: but more seriously, I'm hoping the pipelining makes your clients more efficient.
06:21bitemyapparrdem: you have a client for each thread right?
06:21bitemyapparrdem: async or not?
06:21arrdembitemyapp: all the db accesses are run-async
06:22arrdemcomming from futures, with a cap at 8 simultaneous futures.
06:22bitemyapparrdem: yeah it should be spewing those inserts at the database then
06:22arrdemcool.
06:22bitemyapparrdem: run-async behavior is roughly "throw it over the fence and PIPELINE LIKE A MADDAFAKKA" mode.
06:22bitemyappbut the error handling is more manual.
06:23arrdemah. bugger. I seem to have killed my crawler.
06:23bitemyapptechnically the synchronous mode is still sorta-async and pipelined behind the scenes but the direct caller is forced to wait and confront any errors.
06:23bitemyapparrdem: cheers.
06:48ggherdovHello. I am familiar with writing (basic) Rails webapps, I mean the routing mechanism and the Model View Controller paradigm. Is Luminus much different? is it MVC as well, somehow?
07:02quizdrggherdov also take a look at Pedestal. i've not used either one but am curious about the differences between them. i'm just now starting to explore web developmet in clojure.
07:11ggherdovquizdr: thanks for the the tip. My plan is to follow the book that came out this summer, now in beta
07:11quizdrthe prag pub web dev book?
07:11ggherdovhttp://pragprog.com/book/dswdcloj/web-development-with-clojure
07:11ggherdovyep
07:11quizdrthat is no longer in beta
07:12quizdrit has gone to print
07:12ggherdovah !
07:12quizdri just got it myself
07:14ggherdovah yes I have this "beta 6", which is actually the final thing -- I actually pourchased the PDF a week ago)
08:53pepijndevosHow can I implement an Atom il
08:53pepijndevosn clojure
08:54pepijndevosI mean, atom uses AtomicReference which uses unsafe private java magic.
08:56pepijndevosI want an atom that works with a revision instead of a reference, and wonder if there is a better way than naive lockh
08:58pjstadigpepijndevos: not sure what you mean? you can use AtomicReference
09:00pepijndevospjstadig, I want to do (compare-and-set! atom rev newval) => newrev
09:01pjstadigyou could have the atom contain a vector [rev val]
09:02pjstadigpepijndevos: you could also directly use java.util.concurrent.atomic.AtomicStampedReference
09:04pepijndevosthat has compareAndSet(V expectedReference, V newReference, int expectedStamp, int newStamp), I want compareAndSet(V newReference, int expectedStamp, int newStamp)
09:06pepijndevosIn other words, no expectedReference.
09:06pjstadigi guess i still don't understand what you want, but I think you could use clojure's atom and swap! with the atom's value being a vector of values
09:06pjstadigin the swap function you can decide what to update and when
09:10pepijndevosI guess I could do compareAndSet(getReference() , V newReference, int expectedStamp, (inc getStamp()))
09:22sundbpI made PR for the small changes I have in my local repo relating to using messaging+xa with an injected XA manager outside of container.
09:23sundbpI'm not sure it's complete but the changes should stand up on their own logic even if partial.
09:42pepijndevosIf you apply the rules for a heap and a search tree, you get a linked list, right?
10:07corecodeis there an easy way to do cljs+node.js+emacs+repl?
10:07corecodeor should i be inquiring elsewhere?
10:08xeqicorecode: you'd want to look at https://github.com/cemerick/austin#project-repls
10:10corecodexeqi: that seems to be for browser-based cljs, no?
10:11xeqicorecode: it should be able to do either. repl-env for brepl, exec-env for standalone
10:11xeqihttps://github.com/cemerick/austin/blob/master/src/clj/cemerick/austin.clj#L452
10:12corecodeit keeps talking about browser-repl, that's what confuses me
10:49rovarare comments allowed in edn?
10:52kzar; this is a comment rovar
10:52kzarand there's a reader macro to comment a s-exp that I forget
10:52kzarOh it's #_
10:53kzar,(+ 1 2 3 #_4)
10:57hyPiRionkzar: uh, in edn?
10:58hyPiRionI'm certain #_ is not allowed, and I guess ; isn't either
10:58RickInAtlanta,(+ 1 2)
10:58clojurebot3
10:58RickInAtlanta,(+ 1 2 #_(+ 1 2))
10:59TimMchyPiRion: What? That would suck.
10:59xeqi,(clojure.edn/read "#_ 1 1")
11:00TimMchyPiRion: No, both are supported.
11:00hyPiRionTimMc, kzar, rovar: Ignore me, I thought edn was json-like in that regard
11:00TimMcUnlike JSON. What a bad decision.
11:00hyPiRionyeah
11:00RickInAtlantabut it seems like the bot isn't evaluating any forms that have #_ anywhere in them
11:01xeqiRickInAtlanta: I think it died
11:01TimMc&(clojure.edn/read "#_ 1 1")
11:01RickInAtlanta,(+ 1 2)
11:01clojurebot3
11:02hyPiRionTimMc, xeqi: read requires a reader
11:02hyPiRionread-string on the other hand
11:02xeqihyPiRion: right, should be read-string
11:04TimMclazybot is dead :-(
11:04xeqiRaynes: ^
11:08paulswilliamsesqHiya, if there's any Lighttable users in here, what themes do you use for clojure dev? Something that highlights the nested parens and contents thereof?
11:12kzarpaulswilliamsesq: Not sure but I thought the same thing, I found the default theme quite dark but didn't see any others in the directory
11:12kzaroh I tell a lie, I think I found one other one that was quite dark as well
11:12paulswilliamsesqkzar: I'm trying ibdknox which seems okay but like something a little bolder
11:13kzar(Personally I'd like a theme + improved emacs plugin to match emacs as much as possible superficially)
11:14kzarI'm guessing it will come with time, early days
11:19paulswilliamsesqkzar: absolutely. I'm normally a vim user, and love vim-fireplace but Lighttable really does seem awesome.
11:20kzarpaulswilliamsesq: Yea, it has a lot of potential, especially with the plugin api coming out. Can think of loads of good ideas... markdown preview plugin, mergetool plugin, etc etc
11:23paulswilliamsesqkzar: yeah, I'd like to see some ability to share a session to enable remote pairing... would be great to support me learning clojure..
11:46mrhankyhow can i check for keywords as arguments?
11:47mrhanky(foo args :bar true)
11:51bbloommrhanky: in most cases, you should just pass a map instead of unwrapping kwargs, but if you must, you can simply use destructuring in your arg list after &
11:51bbloom,((fn [& {:as x}] x) :foo 1 :bar 2)
11:51clojurebot{:foo 1, :bar 2}
11:51mrhankyi'm on clojurescript and have a script which uses (spit f c :append true)
11:52mrhankyi already have a function called spit, now i only need to handle the case ":append true"
11:52bbloommrhanky: i just showed you ^^
11:52mrhankyoh :D
12:18xnil,'test
12:18clojurebottest
12:27xnilis clojurebot open-source?
12:33xeqixnil: https://github.com/hiredman/clojurebot
12:58danneuIf I wanted to remove a uniqueness constraint in Datomic, would I just retract the db/unique
13:07gtraktpope: I had to include cljs.core in every ns for it work, does that answer your question?
13:07gtraktpope: I'm not sure if I pushed that into cljs-complete yet.
13:08xnilxeqi: thank you very much.
13:46effyhi, is there a up to date reference post somewhere about which plugin to use (and how) in emacs for clojure?
13:48kzareffy: You want to use nrepl and cider probably https://github.com/clojure-emacs/cider
13:49kzarThe readme there is pretty damn good and links to tutorials so maybe give that a read?
13:50scapeanyone using korma?
13:50scapeI want to retrieve queries without it being a vector or seq, limit 1 does not seem to do this. I end up with many (first) statements
13:51scapeas in: (:token(first(:device(first(select player (with device ...
13:52effykzar: thanks, i am :)
14:03effykzar: cider seems effectively pretty damn complete
14:03kzareffy: Yea I hadn't done any clojure for a while, previously it was swank only pretty much. Came back to it again recently and, yea, I was impressed too
14:03kzarmuch nicer having proper tools :)
14:04effyi was expecting to be redirected to slim with some kind of tweaks to make it less cl and more clj
14:06kzareffy: Also if you've not seen it before Light Table is looking really promising although IMHO not a replacement for emacs yet
14:07koreth_Have you used Light Table on nontrivial projects? I'm skeptical about its navigation abilities past the handful-of-source-files level but I haven't actually worked on a large Clojure code base yet.
14:07effykzar: i'm not willing to switch my text editor
14:08kzarkoreth_: No I haven't. I've just been playing with it here and there last week or so. I did actually try opening a project I'm helping with at work and the navigation stuff fell a bit flat now that you mention it
14:09kzarkoreth_: I was looking for a file called api.py or api.js (I forget) but that was matching crap loads of other files. I was likely doing seomthing wrong though
14:09kzarI actually struggled to find the file at all until I typed most of the path in
14:09kzarbut I'm sure stuff like that will be sorted out as it develops
14:10dnolenkoreth_: LT is programmed in LT, so I think it can handle big projects OK
14:10koreth_Yeah, it's still changing fast.
14:10kzarMy guess is that it will supersede emacs at some point
14:10kzarso I want to be ready I guess, + it's cool to play with
14:10koreth_Also, LT is not itself what I'd call a "big" project, thinking about the size of some of the enterprise Java code I've worked on -- think thousands of source files, not tens.
14:11dnolenkoreth_: Clojure(Script) projects don't get big in the same way.
14:12koreth_They will if Clojure takes off, I think. Right now Clojure isn't being used for that class of problem. Or are you saying there's a fundamental reason for that?
14:12locksI’m with dnolen in that there’s a fundamental reason for that
14:12bbloomkoreth_: i think it's wrong to assume the problems are any different
14:12kzardnolen: to be fair though if Light Table needs to support Java etc projects if it is to replace emacs
14:12dnolenkoreth_: people have been using Clojure for 6 years now on big production projects
14:12kzararg I accidentally a word there, you know what I mean hopefully
14:12dnolenkoreth_: most big projects are 50-75K. I've only heard of one around 150K.
14:14koreth_I mean, take one (completely implausible) example: write Facebook in Clojure, and I don't mean "a social networking site with a handful of Facebook-like features," I mean the entire thing. No way is that going to be 150K.
14:14bbloomdnolen: i can't even imagine what i'd do with 150k lines of clojure. it's just bad design afaict. i've worked on multi million line C#/C++/Java code bases & it's almost always just 90% useless shit
14:14dnolenkoreth_: I wouldn't be surprised if it was 1/2 that size.
14:14Jii_10% of 10 million lines is still 1 million lines ;)
14:15lvhI wonder how well datomic would fare :)
14:15dnolenlvh: Datomic is also not very big from what I've heard.
14:17locksI wonder how much is class declaration boiletplate O:)
14:17locks*how much of those projects
14:18bbloomlocks: it's all getters and setters :-P
14:18bbloom& i've never met a setter i like
14:18lvhdnolen: Oh, no, I'm not talking about Datomic's own size; I'm wondering how well it would work to put all of the data Facebook produces into Datomic.
14:18bbloomlvh: lol it wouldn't. at least not a single instance, that's for sure
14:19lvhSure, I doubt a single instance of anything would :)
14:19coventryWasn't there some bank in Ireland who claimed their clojure code base was hundreds of thousands of lines?
14:19bbloomi dunno why people brag about the (large) size of their code bases
14:19bbloomi'd brag about how little there was :-P
14:20ToBeReplacedbbloom: yeah, exactly
14:20bbloomhalf the time too you get these huge systems that have lots and lots of hard coded business logic in a general purpose language
14:20coventryThese guys, I think: https://github.com/AvisoNovate I think someone from there mentioned it here.
14:20locksbbloom: stockholm syndrome
14:20locksbbloom: “see, it’s THIS big of a mess and it’s still working!!1!"
14:20locksor maybe they think they’re bragging how little it is?
14:20koreth_Not sure it's bragging (in all cases), just describing reality. The fact is that there *are* large code bases, so you want to look for tools that can handle them. Whether the large code base is a good or a bad thing doesn't matter.
14:21bbloomi've seen things that are like 10M lines of java & it should be 50k lines of java and all the rest should be in some UI built by some accountant & code reviewed by a dev
14:21bbloommost people just can't be trusted with a general purpose language :-P
14:21bbloomespecially not most programmers!
14:21dnolenkoreth_: I think I can go out on limb and say Clojure was designed specifically to be anti-large codebase from the ground up.
14:22koreth_I actually think that's going to be a big use case for Clojure. Build a little DSL and give it to your designers or finance people.
14:22koreth_I know one company that tried to migrate to Scala and it fell flat because their designers couldn't handle the complexity.
14:23bbloomkoreth_: the scala compiler developers can't handle the complexity, what chance have mere mortals got?
14:23lvhkoreth_: Why is Clojure so much better at making DSLs?
14:23coventryGet out of my head, bbloom
14:23lvhkoreth_: I've made DSLs with Python. With a parser generator :)
14:23bbloomlvh: you don't have to (read: probably shouldn't) write a new grammar to get a new DSL
14:23koreth_Of course, you can build DSLs in anything, but in Clojure they aren't a separate thing, they're just Clojure code that uses your custom macros.
14:24koreth_So your debugger and such can treat them as first-class language constructs.
14:24bbloomin fact, you should do syntax LAST & work backwards from the minimal expression as data, since 99% of the the time you need a UI of some sort for non-programmer domain-experts to work with
14:27kzardnolen: bit offtopic but I'm following the react tutorial without using JSX and I had a question. How do I create a react element with multiple children? Just set the value of children to an array of things instead of a single one?
14:28dnolenkzar: an array yes, but you need to give each child a React key if you do.
14:28dnolenkzar: I believe that will be done for you if you use varargs
14:28dnolenkzar: React.DOM.div(null, x, y, z)
14:28tpopegtrak: yeah it did seem to be an issue related to that
14:29kzardnolen: null being potentially the object with things like className?
14:29dnolenkzar: it's call props, but yes
14:29dnolens/call/called
14:30kzarOK ty
14:32coventrydnolen: Would it make sense for om/build to error out if its cursor arg doesn't satisfy the ICursor protocol? We got a cryptic reactjs error message yesterday because we passed in nil.
14:33dnolencoventry: it does error out
14:35arrdem'mornin
14:40coventrydnolen: Ah, it comes after the reactjs error message. Thanks.
14:41dnolencoventry: yep
14:44mathrickhi, how do I make an empty sequence of the same type as the given one?
14:44mathrickspecifically, I'm looking at http://www.4clojure.com/problem/23
14:45mathrickand cons makes it easy to extend the sequence element-wise, but I don't know how to seed it
14:45bbloom(doc empty)
14:45clojurebot"([coll]); Returns an empty collection of the same category as coll, or nil"
14:45mathrickoh
14:45mathrickthanks
14:45kzar,(conj () [1])
14:45clojurebot([1])
14:46kzarhmm
14:46kzarignore that ^^
14:46edwkzar: Were you thinking `concat`?
14:46bbloommathrick: also worth grepping http://clojure.org/cheatsheet or using find-doc in your repl. try (doc find-doc)
14:46kzaredw: No, I clicked the 4clojure link, saw my solution and was trying to remember how it worked without giving away the answer to mathrick
14:47edwAh.
14:47mathrickbbloom: I was using clojuredocs.org, but I missed empty taking an argument
14:47edwmathrick: There's also a helm-based Clojure cheat sheet in Emacs.
14:47mathrickhelm is unfortunately horrible
14:48bbloommathrick: sadly, clojuredocs.org is kinda old. it's 1.3 but 1.5.1 is out and 1.6 is on the way soon
14:48mathrickone day I will find a better replacement, probably involving ido/icicles
14:48bbloommathrick: should be sufficient for 4clojure-ing though
14:48edwmathrick: but I lose my double-sided 2-up paper copy of my cheat sheet from time to time.
14:49mathrickalso, kinda unrelated, but how do you make an updateable closure, the way (let ((counter 0)) (lambda () (incf counter))) works in Common Lisp? I assume the answer involves Vars somehow?
14:49mathrickedw: I was commenting only on helm, not on the validity of having docs inside emacs :)
14:50locksbbloom: why does clojuredocs seem to have “died out”?
14:50edwmathrick: No prob. Re: your Q: Yes, you'd use `atom` along with `deref` `reset!` etc.
14:50bbloomlocks: no clue
14:51bbloomother folks here may have more info, i dunno anything about it
14:51locksoh ok
14:51locksit’s a shame, because the core docs are very terse
14:51edwmathrick: That is, if you want to transliterate from Scheme or CL.
14:51kzarYea I end up using it a lot
14:51coventrydnolen: Still, the om/build stacktrace is a lot more transparent with a (cursor-check cursor) at the top of om/build. Without it, I don't see the offending om/build call in the stacktrace at all.
14:52mathrickedw: what'd be the clojure way to do it? I was thinking about take-nth, which needs to keep track of "every nth"
14:52edwHold on, I'll type something up...
14:52ianeslickmathrick - any state object would work, such as an Atom, Ref, or Var
14:53kzarmathrick: You can eval (source take-nth) to see how it works fyi
14:54dnolencoventry: open a issue please, it's a simple enhancement
14:55coventrySure.
14:58edwmathrick: Check this counter source out: <https://www.refheap.com/24775&gt;
14:58mathrickedw: thanks
14:59edwmathrick: That said, that's an idiomatic Clojure expression of an un-idomatic Clojure approach to solving the problem.
14:59edwAften you'd just want to use `range`.
14:59mathrickedw: yeah, I get that in the specific case of take-nth, you can just drop everything but nth item
14:59edws/Aften/Often/
15:00mathrickah
15:04bbloomedw: why are you using partial in that swap! call? swap! takes varargs
15:05bbloomand + is (effectively) commutative
15:06bbloomalso, i think that's bugged under concurrent use....
15:06bbloomtwo different readers could deref at the same time
15:06bbloomif you start with (atom (- x step)) then you can use the return value of swap! directly without having to deref
15:11coventryI guess it shows the strength of the design that all my other Exceptions so far happened outside of an om/build.
15:11kristofbitemyapp: Yes, the Haxl stuff is VERY cool. Can you name any scenarios in your work where it would have been useful?
15:12kristofStructuring computation in such a manner
15:14bitemyappkristof: well, yes, in analysis of clickstream data.
15:15kristofbitemyapp: Is that inherently asynchronous?
15:15bitemyappkristof: something simpler than Hadoop but will parallel would've been really nice.
15:15bitemyappkristof: we also had a number of async operations and data dependencies on the API layer that would've been nicer with a better way to express asynchronicity.
15:16kristofbitemyapp: What language?
15:16kristofbitemyapp: I believe you use Clojure at work, don't you?
15:17bitemyappkristof: I use Python and Clojure at work right now, even split.
15:17bitemyappkristof: at the *time* I'm thinking of, we were using Python and C++
15:17kristofbitemyapp: Well that's an easy way to get white hairs
15:17bitemyappand *neither* were particularly nice for managing asynchronicity or parallelism.
15:17kristofpython DOESN'T manager parallelism :P
15:18bitemyappwasn't a happy time in my life.
15:18kristof*manage
15:18bitemyappwell, fork, but yeah.
15:18bitemyappPython is so slow parallelism can't save you anyway./
15:18kristofhahahahaha
15:18kristofbitemyapp: The problem with Python is that they actually just... wanted Lisp.
15:19kristofOr if syntax was a concern, then maybe they could have tried to resurrect Open Dylan
15:20kristofbitemyapp: That Haxl presentation irritated me with its "new slide for every addition of information" philosophy. As if the factor of incremental surprise were so monumentally important :)
15:24lockskristof: good thing that open dylan is being ressurected then :}
15:24kristofmehhhhhhhhhhhhhhhh
15:25bitemyappkristof: Lisp/Dylan isn't what *Guido* wanted, he's too fucking ignorant for that.
15:26bitemyappkristof: the slides were designed for a presentation, I'm afraid. But I hate that too.
15:26edwbbloom: Huh? What should I have used? Something like thi? #(+ step %) I don't think this is a big deal.
15:26bbloom(doc swap!)
15:27bbloom,(let [a (atom 0)] (swap! a + 5))
15:27edwI am familiar with swap!.
15:27bbloom&(let [a (atom 0)] (swap! a + 5))
15:27clojureboteval service is offline
15:27edwAh, duh.
15:27bbloomseriously? wtf?
15:27bbloomboth our bots are on vacation?
15:27bbloomlame.
15:27clojurebot5
15:27bitemyappwtf
15:27bbloom*sigh* clojurebot you slacker
15:27edwAnd + takes &args too...
15:28bbloom&(let [a (atom {:foo 0})] (swap! a update-in [:foo] + 5))
15:28edwSorry about that. Brain fart.
15:28bbloom^^ gotta love that :-)
15:28bbloom,(let [a (atom {:foo 0})] (swap! a update-in [:foo] + 5))
15:28clojurebot{:foo 5}
15:28bbloomthere we go bot
15:28ivan&{Float/NaN 1 Float/NaN 2}
15:29amalloy$mail lazybot plz wake up
15:30RickInAtlantalazybot: orm
15:31kristofbitemyapp: I'm more and more surprised at how chaining together computations by using monads accomplishes a lot of what I'd usually just string together in a macro
15:33bbloomkristof: frankly, i think both haskell & clojure fail miserably for the sort of thing the Haxl project is trying to do
15:33kristofbbloom: Haxl does a lot of things, which are you referring to?
15:34bitemyappthere's a lot of surface area and lot of Haskell seems to be shining through nicely, especially typeclasses.
15:34bbloomkristof: in particular, i'm talking about how they dismissed their current program-as-data approach b/c it relies on an interpreter & they wanted the benefit of ghc's quality implementation
15:34bbloomkristof: i think that writing an interpreter is the "obvious" and sensible solution. the complaint i have is that nothing out there makes it all that pleasant to make that fast
15:35bbloomwe have great general purpose programming languages, but our meta programming tools are, frankly, utter shit still
15:35lockshear hear.
15:35kristofI would not call Lisp's metaprogramming "shit", but I consider homoiconicity and metaprogramming to be a relatively unexplored realm.
15:35bbloomI think it's particularly unnatural to encode the dataflow in to a monad or applicative
15:35kristofoh, uh
15:35kristofwell ok :P
15:36bbloombecause those force pipelining in a way that is against the grain of the nature of the problem
15:36kristofBut yes, I think the proper word to describe metaprogramming is "naive"; Lisp metaprogramming essentially reduces down to complex manipulation of lists. Which is useful, but you can do more to describe code than "lisp"
15:36kristofbbloom: Incorrect. They allow pipelining in a situation where it was wanted but previously unattainable.
15:37kristofI'm sorry, I meant "you can do more to describe code than "lists with other lists in them"
15:37bbloomkristof: i disagree, but give me a moment to disagree intelligently
15:40kristofbbloom: go for it brother
15:41ProfpatschSo I’ve got (defmacro foo [& args] (let [x (filter something args)] …))
15:41bbloomkristof: ok so i'm looking at slide 42 and 43 of 86
15:42bitemyappI don't really mind incremental developments, and as far as incremental developments go, expressing data dependencies and pipelining in terms of monads and applicatives is a pretty big improvement in almost all respects over everything prior/extant (such as async/await in C#)
15:42ProfpatschHow do I make it so that args isn’t called?
15:42ProfpatschHow do I quote args? 'args doesn’t work in that context.
15:42bbloomkristof: essentially what's happening is that that Haxl internally is relying on the compiler/runtime machinery of the IO monad to build & optimize a dataflow graph
15:42bbloomkristof: because applicative <*> is binary, some structure is lost and must be recovered
15:43coventryProfpatsch: Do you want to backquote the entire let, and unquote args? It's not completely clear what you want the macro to do.
15:43bbloomkristof: you want a variadic abstraction for parallelism
15:44Profpatschcoventry: I just want to bind parts of args to some variables in the beginning with let, later in the macroe there is a `(defn …)
15:44bitemyappIn spite of that, there's a lot people need to learn from Haxl about structuring these kinds of problems.
15:44bbloomkristof: on slide 43, you can't clearly see the problem b/c of operator syntax. if you add all the extra parens, you'll note that the shape (<*> is (<*> kinda (<*> like this)))
15:44bitemyappseriously, compare with things like async/await, almost entirely unstructured and unprincipled way of doing asynchronous processing.
15:44coventryProfpatsch: You may not want to quote it at all,
15:44coventryin that case.
15:45bbloomkristof: lifting further masks the problem
15:45kristofbitemyapp: Well, it doesn't *enforce* structure, which is still bad but different than just being default unstructured.
15:45bitemyappkristof: right.
15:45coventryIt won't be evaluated in that (filter)
15:46kristofbbloom: Let me pull up the slides again so I can grok your criticisms in cotext
15:46kristof*context
15:46bbloomkristof: it's absolutely amazing to me how well GHC can optimize these sorts of things, but personally, i rather get the shape of the dependency tree as data. what if i wanted to graph it? in haskell, i'd have to create an alternative instance of the applicative w/o the IO and have it construct a data structure.. but my data structure would be totally the wrong shape & i'd be stuck having to untangle it without the help of GHC's internals
15:46bbloom :-(
15:47Profpatschcoventry: Yes, because atm when I do (foo :y :z {:a 42}) args is inserted as (:y :z {:a 42}) and what I’m left with at runtime is {:a 42} (which is the result of evaluating that keyword call).
15:48bitemyappThe ways in which I could think of code-as-data being useful here are pretty much entirely unexplored and the existing mechanisms for doing so are completely unstructured (macros)
15:48kristofbbloom: That sounds like "I have a thing wrapped in some context and I want to parse the thing but also using the context as an argument" sounds a lot like you want a comonad.
15:48coventryProfpatsch: Still not clear what you want foo to do.
15:48bitemyappkristof: sounds more like a free monad to me.
15:48kristofAnd a monad that is also a comonad is... a Hopf Algebra!~
15:48bitemyappkristof: from the perspective of a late-bound context/computation projected onto the structure after the fact.
15:49bitemyappthere's a particular Haskell programmer who makes quite a go of Free Monads all over the place and the *reason* is code-as-data.
15:49kristofbitemyapp: There is some nontrivial connection between free monads and Hopf algebras, I think
15:49bbloomkristof: my concern is irrespective of context
15:49bitemyappthe reason most other people don't do it? can't be arsed, don't get enough leverage, etc.
15:49bbloomkristof: think about what's happening internally w/ the applicative & monadic machinery
15:49bitemyappbut for people who want to decomplect code-data/structure from "interpretation" free monads are pretty sweet.
15:50bbloomkristof: monads are worse offenders than applicatives, since applicatives can create arbitrary tree shapes and monads can only make lists
15:50bbloomkristof: i can make an instance of monad (or applicative) that doesn't do anything side effecty, just returns a tree (or list or whatever)
15:50bitemyappwell that's not true at all.
15:51bitemyapphttps://dl.dropbox.com/u/828035/Monads/monads.pdf
15:51bbloombitemyapp: yes, you're right, you can make any shape you want, but not if you want the shape to be isomorphic to the code's control flow
15:51bbloombitemyapp: of course i can treat it like arbitrary state and make any shape, duh. that's not the point i'm making
15:51bitemyappthe grafting part is what interests me about trees in this case.
15:52bbloomthey haxl ppl are trying to take normal looking applicative code & make it stay normal looking but do caching, distribution, parallelism, etc
15:52Profpatschcoventry: I don’t think that it matters for the problem, but I want a macro (component comp :x :y :foo :bar {:opt 4 :opt2 10}) which returns a function (comp [x y foo bar & args) with opt and opt2 being optional arguments with default values 4 and 10.
15:52bitemyappI don't doubt for instance that they're stressing the abstraction, but I still think it's very interesting and worth exploring further.
15:52bbloomi can encode an arbitrary interpreter in to a monad, of course
15:52bbloomand can produce arbitrary data as a result
15:52bitemyappAnd I haven't seen anything in any other language that is remotely as interesting.
15:52bbloombut i have to go through a linearization process first & hence lose structure
15:52bitemyappfor this particular subject.
15:52Profpatschcoventry: *returns a function (defn comp [x y foo bar & args] …)
15:53Profpatschcoventry: So my marco starts with (defmacro component [name & props] …)
15:54bitemyapphrm. tensor category products. I'm in the fucking weeds now.
15:54Profpatschcoventry: And I need to filter out the keywords and the list at the end (if it is there) from props.
15:54bbloomkristof: do you understand my point about the shape of monad or applicative? ie i have to encode my code in to cons cells
15:54bbloomkristof: essentially :-P
15:55KnightRiderThemeAimHere, why do you hate me?
15:55bitemyappfuck now I have to listen to the Knight Rider theme
15:56bbloomkristof: anyway, i understand that's not really a big deal b/c of lifting both arguments & type inference doing some voodoo to drag the implicit applicative instance through the whole computation, but it just seems like the hard way to go about it
15:56kristofbbloom: What would you have done instead? You have homoiconicity in Clojure and there's nothing stopping you from writing applicative and monads in it (many people do it!)
15:57bbloomkristof: i think they did the right thing originally
15:57bitemyappI probably like Fluokitten more than anybody else present, but still, yick.
15:57coventryProfpatsch: Yeah, maybe it doesn't. I still don't understand what your question is.
15:57bbloomkristof: they created a data structure... all they had to do was replace `foo bar` with `Foo Bar`
15:57bbloomkristof: the shape stayed the same
15:58Profpatschcoventry: How do I use & args in a macro as a quoted list?
15:58kristofbbloom: I see.
15:58bbloomkristof: the problems are 1) they had to write their own interpreter, which is only a big deal b/c naive interpreters are slow, but there is lots of research to make naive interpreters fast and....
15:58bbloomkristof: 2) the haskell compiler fights you on that, b/c now you're doing type level computation instead of term level
15:58Profpatschcoventry: That is, something that doesn’t get evaluated at compilation time.
15:58kristofPyPy is a good example of how to make naive-interpreters fast :)
15:58edwProfpatsch: Perhaps if you showed as a couple sample data structures, and the transformations you were hoping to effect i.e. the desired end results.
15:58bbloomkristof: indeed
15:58bitemyappwell if you want nicer type-level computation there's always Agda and Idris :)
15:59bbloombitemyapp: i don't want a distinction between type and term languages
15:59bbloomi've made my position quite clear on that :-P
15:59bitemyappor kinds. or sorts.
15:59kristofbbloom: I don't want to side-track but if you haven't already read the paper, you can theoretically make Python as fast as C# by generating a JIT compiler which outputs .NET bytecode, which the .NET compiler analyzes after (they call it "JIT Layering", I think it's exciting)
15:59bbloomkristof: i've studied the pypy stuff a bit. it's good shit
16:00kristof:)
16:00bbloomi'm also betting on abstract interpretation
16:00kristofNot sure what that is
16:00kristoflinks welcome
16:00bitemyappkristof: you need a *wobbles hand* action next to that.
16:00kristof?
16:00coventryProfpatsch: OK, I get it now: (defmacro a [& args] `'~args) (a foo bar baz)
16:00bitemyappkristof: Python-as-fast-as-C#
16:00bbloomkristof: http://en.wikipedia.org/wiki/Abstract_interpretation is a reasonable intro. normal wikipedia caveats apply
16:01bitemyappkristof: you can probably write Python code intentionally "nice" for the JIT but the way I see people use Python is too chunky to be that nice.
16:01bitemyappkristof: dict all the thiiiiings
16:01kristofbitemyapp: they unbox the things that don't necessarily need to be dicts in the first place
16:01bitemyappkristof: Python is much faster if you structure your data in terms of classes/objects and avoid getattr/setattr.
16:02bbloomkristof: anyway, i hope i've made at least one compelling argument for why maybe it's not such a great idea to encode arbitrary computations via lifting :-)
16:02bitemyappkristof: yeah but you can't really unbox the dicts without static analysis, I'm pretty sure.
16:02Profpatschedw: coventry: Simple: (defmacro foo [& args] args) (foo :a {:a 42})) should return (:a {:a 42}) but it returns 42.
16:02bitemyappkristof: you're basically converting dicts into records.
16:02bitemyappI can think of easier ways to use get records.
16:02kristofbbloom: I'm not sure I'm convinced yet. You argument is essentially that monadic/applicative computation is not structure preserving, which is useful when you need structure.
16:02coventryProfpatsch: My example meets that criterion.
16:03kristofbitemyapp: PyPy is written in a statically analyzable subset of Python
16:03Profpatschcoventry: Thanks, works like a charm!
16:04coventrynp
16:04bbloomkristof: that's my argument, but further that properties of abstractions (such as structure) are useful for reasoning (and hence correctness, optimization, etc) and therefore it is unwise to discard those properties up front, especially if you have a perfectly workable solution that *doesn't* disregard those properties except in the sense that it may not yet utilize them
16:04bitemyappkristof: I know, but that's no longer Python.
16:04bitemyappkristof: I'm not trying to be pedantic, just trying to speak to the realities of using JIT interpreters for languages like Python.
16:04kristofThat's true, bitemyapp
16:05bitemyappkristof: my point is that if you use a language with better defaults, better opportunities for static analysis arise.
16:05ProfpatschBut I don’t quite understand it. You are quoting everything with `, then unqote args with ~ and then quote it again with '. Shouldn’t that first ~ evaluate that list before it can be quoted?
16:05bitemyappbut you gotta get off the teat of arbitrary buckets of key-value pairs first.
16:05bitemyappwhen 90%++ of the time you want a record.
16:05bbloomkristof: anyway, thanks for bullshitting with me. i've had this thought for a while and it was nice to try to explain it. i should blog about it sometime & get the thought out more fully :-)
16:06bitemyappbbloom: blog posts are often nice.
16:06kristofbbloom: You should
16:06bitemyappwhich reminds me, I need to fix my site.
16:07kristofbbloom: I'm just trying to sort some thoughts out at the moment.
16:07kristofbbloom: How do you have graph reduction in a language if you try to preserve structure, too?
16:09bbloomkristof: not sure i understand the question
16:10kristofbbloom: I'm just not smart enough to really grasp the future you see, forgive me :P
16:11Profpatschcoventry: Ooooooh, I think I get it. The unquote resolves the symbol to its value. I didn’t know it had that effect.
16:11kristofbbloom: Do you think youl
16:11kristofbbloom: *Do you think you'll explore some more of these ideas in something like asyncx?
16:11bbloomkristof: in asyncx, definitely not no :-P
16:11kristofah, ok
16:12coventryProfpatsch: Yep, exactly.
16:12bbloomasyncx was just a toy to learn core.async & play with CSP in a context that wasn't Go b/c I didn't really feel like learning to use Go & frankly have practically zero use for CSP at all :-P
16:12bbloombut more generally, i'm exploring the boundary between dynamic and static :-)
16:12Profpatschcoventry: So, does ~ do that *and* unquote lists or are both one and the same thing?
16:12kristofbbloom: It's funny how different people approach concurrency so differently. You were probably here but Baldridge has said himself that he has never used STM in a way that it wasn't refactored out later
16:13Profpatschcoventry: I’m not sure I’m grasping the pattern.
16:13bitemyappkristof: I've pretty effectively avoided STM.
16:13bitemyappkristof: refs, anyway.
16:13bitemyappand even atoms were contingent, but not necessary, in what I was doing.
16:13bitemyappagents/Executors were closer to necessary/critical.
16:13kristofbitemyapp: That reminds me of a Microsoft developer's comment at the end of an expose of .NET's STM: "So, what is it? Is the world going to be transactional, or is it not?"
16:13bitemyappcore.async lets you ditch a lot of stuff
16:14bitemyappkristof: I like STM, I just don't use it nearly as much as I thought I would.
16:14bbloomkristof: since discovering clojure, my approach to concurrency has always been full linearization of async writes with completely uncoordinated reads. STM not required :-P
16:14bitemyapp^^ that is basically what I do.
16:14bitemyappthat and I use promises at the API layer.
16:14kristofbbloom: So you basically sprinkle agents everywhere and purposefully decouple computations.
16:14bbloomkristof: turns out that scales much further than i've needed for a greenfield project
16:14kristofbbloom: Sounds very erlang-esque
16:14bitemyappkristof: s'what I do.
16:14bbloomkristof: nope
16:14Profpatschcoventry: Ugh, I’m so stupid. I’ve used this all along, but somehow this slightly more complicated example brought me off-tracks.
16:15bitemyappkristof: core.async for some stuff, agents for others.
16:15bbloomkristof: i use at most one agent
16:15kristofbitemyapp: Had a lengthy discussion in #haskell about how actors are just shared mutable state and don't compose
16:15bbloomkristof: my clojure programs tend to look like either 1 agent or (more commonly) 1 atom, everything else immutable
16:15bitemyappI don't think I've needed more than one agent per coarse-grained side-effecty "noun"
16:15kristofbitemyapp: but Clojure doesn't actually have actors, because agents aren't quite the same thing
16:16bitemyappkristof: Right. I just use it linearize operations against a sink of side effects.
16:16kristofbbloom: Even in very large applications? You never find yourself needing to coordinate some shared state?
16:16kristofbitemyapp: Wait, how do you linearize computations with asynchronous agents?
16:16bitemyappkristof: in large applications, STM keels over.
16:16bbloomkristof: what's a "very large application"?
16:16kristofbbloom: I'm using large to mean "touches a lot of components"
16:16bitemyappkristof: seriously, you can write a script in Clojure to hammer a ref. Try it.
16:16bbloomkristof: in anything really big, i generally rely on external shared state: ie a database
16:17bitemyappkristof: again, ditto.
16:17bitemyappbut Erlang is typically used for things where you want all the pertinent state in memory.
16:17bitemyapplike multiplayer game servers.
16:17kristofI'm going to apologize to both bbloom and bitemyapp, here, my inadequacy is showing and the Dunning-Kruger will start reeking at some point
16:17bbloomkristof: no need to apologize
16:17bitemyappkristof: awareness generally keeps the D-K away.
16:18kristofbbloom: Then you really are using STM, just a better designed one that you don't explicitly program
16:18kristofbbloom: except that software is just going to be SQL/NoSQL or something
16:19bbloomkristof: i guess you can see it that way. *shrug*
16:19danno1Simple Q: Should I be able to call (doc <methodname>) in a .clj file, or does it only run in the REPL?
16:19kristofbbloom: Wait, if I may extrapolate something here, are you saying that whenever your application gets large enough to necessitate the sharing of state, you should just use a database? Meaning there's really no good use for STM?
16:19bitemyappkristof: no no
16:19bitemyappkristof: at truly large scale you AVOID transactions that are responsible for more data than strictly necessary at all costs
16:19bitemyappkristof: you scale through independence, not through a clever transaction algorithm.
16:20bitemyappkristof: part of the reason for tackling and thinking hard about sharding is figuring out where your "independence" shard-points lie
16:20kristofbitemyapp: What's your job title and what do you typically work with? It sounds like you specialize in web applications and distributed computing.
16:20bitemyappI'm a backend monkey yo. I haven't done anything truly distributed since that CV company.
16:20bitemyappkristof: currently I work with Datomic and API servers.
16:21kristofI see.
16:21bitemyappbut using Datomic doesn't really change the story from SQL servers. You scale them the same way, independence.
16:21kristofOk.
16:21bitemyappfigure out where you can draw a line in the sand and accept that "whole comprehensions" of database are not going to happen
16:21bitemyappif you want such a thing, you're talking OLAP, not OLTP, and you're funneling your data into a different sort of store.
16:22bitemyappwhich reminds me, I should think about making a river-middleware for Datomic.
16:22bitemyappbut anyway, the work I do right now is relatively simple with respect to scale.
16:23bitemyappThe ugliness comes from hooman problems and data modelling.
16:23kristofbitemyapp: Ah, I see.
16:24kristofbitemyapp: Not sure what river-middleware is.
16:24bitemyappkristof: piping and repeating transactions from Datomic into other data sinks like ElasticSearch and Hadoop.
16:24bitemyapp"any entity with :attr, convert to JSON and post to ElasticSearch for search indexing"
16:25bitemyappkristof: but yeah, anyway, OLAP generally implies a sacrifice of latency and liveness so that you can "fold" your data with high throughput. OLTP generally means, "touch the least amount of data possible per operation, handle transactions with predictable latency"
16:25bitemyapptwo very different workloads.
16:26kristofbitemyapp: So OLTP is for touching little things at a time (getting and setting) while OLAP is for business logic
16:26bitemyappkristof: OLAP is business intelligence, OLTP is the "store" of the result of some sort of business logic.
16:26kristofOk
16:27bitemyappkristof: the problem is figuring out how to balance OLTP data store simplicity with atomically safe transactions that can do meaningful "things"
16:27koreth_Example: Withdrawing cash from your bank account at an ATM is OLTP. Generating your monthly bank account statement is OLAP.
16:27bitemyappkoreth_: sorta, that's not how banks actually handle that though. Good example.
16:28koreth_Yeah, just going for an analogy there.
16:28kristofOk, I understand
16:28bitemyappkristof: closer to OLAP would actually be, "generating average balance of all customers for a given region"
16:28kristofbitemyapp: Oh, but OLAP is going to impact the way you store data, isn't it? The two just aren't going to live together happily
16:29bitemyappkristof: if your shard-point is a single customer, then it's still possible to calculate monthly balance on a per user basis on the OLTP layer.
16:29bitemyappkristof: generally you have some sort of data source of first resort.
16:29kristofok
16:29bitemyappkristof: the safest thing is logs and reconciliation, which is what banks do.
16:29bitemyappthose logs get rolled into whatever data stores you want.
16:29kristofbitemyapp: Rich Hickey talked a lot about logs being second class to immutable data structures
16:30bitemyappeh.
16:30kristofDisagree?
16:30bitemyappit's highly dependent on context.
16:30kristofAs is everything, I guess.
16:30bitemyappthe fundamental data structure you want to think about at scale when reliability is paramount is a log.
16:30bitemyappyou might have an API server that acts as a gatekeeper for operations like account withdrawal, but the data store that gave the yes/no answer is still going to have its state "overridden" by whatever the logs say happened.
16:31bbloomtraditionally, yes, but i think that persistent data structures and atomic root cells are woefully underexplored
16:31kristofWell, if I listen to anymore I might not retain the stuff from earlier :(
16:31bitemyappthe state is a convenience and an optimization, not the real truth.
16:31bbloombitemyapp: i disagree with that entirely
16:31bitemyappbbloom: agreed
16:31bitemyappthat was poorly timed.
16:31bitemyappyou get my meaning.
16:31bbloomthe log is just that: a log
16:31bitemyappwell in some sense, the log is the state that takes precedence.
16:31bbloomnot really, no. you get to pick
16:32bitemyappthat's a decision to be made
16:32bitemyappI'm talking about a relatively simple model for log reconciliation.
16:32bitemyappif you have new "events" hitting a stateful data store, nothing is stopping you from merging-without-loss with the logs too.
16:32amontalentiThis is a bit of a newbie question. I have some code that is reading through a file full of data and parsing it a bit with JSON / string splitting. I have a function working that is printing each line of this parsed data. But I want to change the function now to return a vector or seq on that data. What's the change I'm meant to make? (Code snippet: https://gist.github.com/amontalenti/8496733)
16:33bbloomdisagree with that too :-P
16:33bitemyappregardless, none of it works without really understanding your data.
16:34coventryamontalenti: You want to make your doseq a for or a map or a mapv, and change the println to list or vec or similar.
16:35arrdembitemyapp: what would you consider a normal insertion rate for your Rethink driver?
16:35amontalenticoventry, thanks -- I'm checking the relevant docs now to understand. Appreciat eit.
16:35arrdem20-30 writes/sec?
16:35amontalenti*appreciate it.
16:35bitemyapparrdem: per client? seems reasonable.
16:36bitemyapparrdem: there's a RethinkDB connection pooling daemon if you want it.
16:37arrdembitemyapp: hum... ok. something happens in the 2011-03-* logs which causes my memory usage to spike by a factor of 10 and I'm wonderinf if I'm just managing to overload the insert queue resulting in the driver holding refs for longer or something.
16:37ProfpatschIs it just me or does (name) not work in a macro context? Here the macroexpand gives me (clojure.core/defn foobar [nil nil]) for (component foobar :x :y): https://bigmac.caelum.uberspace.de/paste/macro.clj.html
16:38bitemyapparrdem: the agents are inspectable.
16:38bitemyapparrdem: start logging promise mapping count to disk.
16:39bitemyapparrdem: it's entirely possible for empty promises to accumulate, or for fulfilled promises to not get graveyarded or something.
16:39bitemyappI hope that's not what's happening, just coming up with possibilities.
16:39arrdembitemyapp: yeah I have no idea.. I'm just sitting here watching the JVM leak memory somehow.
16:40bitemyapparrdem: add logging and make your data loading process idempotent and incremental.
16:40bitemyapparrdem: save ya time.
16:40amontalenticoventry, hmm, interesting -- I think I understood what to do, but changing my (do-seq) to (for) results in an IOException. I think I know why -- since the (with-open) call is before (for), it opens a stream before a lazy sequence is returned. (snippet updated: https://gist.github.com/amontalenti/8496733)
16:41arrdembitemyapp: technically it already is... I just happen to be running it as a monolithic scrape and insert run.
16:41bitemyapparrdem: if it's monolithic, it's not incremental. Do you have natural key for log events? I assume each message is a document in Rethink?
16:42coventryamontalenti: Yes, make it eager, or keep the file open.
16:43coventryProfpatsch: name is being overwritten by the arg name. Use clojure.core/name, or change the arg name.
16:43amontalenticoventry, got it, thanks!
16:43bitemyapphad dim-sum for brunch today. Still feel like a roly-poly fat ass 3 hours later.
16:43Profpatschcoventry: UGH, I hate it when that happens. What a drag.
16:47coventryIt's just the duck-typing tax which pays for your handy keyword lookups. :-)
16:48ProfpatschI guess. But thanks again.
16:49arrdembitemyapp: hum... ok. I'll bug you about my architecture here later. Trying to dig into LLVM while this runs...
16:58arrdembitemyapp: well it's clearly some form of acreeted garbage from the duration of the run... my write rate drops to < 1/s and I'm near 99% system memory usage but if I restart from the last checkpoint I'm sub 50% memory and doing 34w/s again.
17:07bitemyappoh so it is checkpointed, hoog.
17:07bitemyappgood*
17:07bitemyapparrdem: but can you log the agent state to check for a possible source of garbage for me?
17:08arrdembitemyapp: lemme try an experiment with multiple connections first...
17:09bitemyappwell that would be a good place to start, yes.
17:09arrdembitemyapp: well one bottlekneck was that I was sharing one db conn between all the worker threads.. I'm seeing 120+ writes/sec now
17:10bitemyapparrdem: ಠ_ಠ
17:11arrdembitemyapp: your utf-8 killed my emacs..
17:12arrdembitemyapp: and your disapproval is well justified here.
17:12marcopolo`anyone use tools.cli?
17:12arrdemmarcopolo`: I have... it works ok.
17:12marcopolo`I'm trying to figure out how to pass a list of arguments without parsing that list myself
17:12marcopolo`as in --keywords foo bar baz
17:12marcopolo`or anything similar
17:12bitemyapparrdem: hahahahaha
17:13bitemyappnow I have a killswitch for your erc
17:13arrdembitemyapp: 300+ writes/second... burn baby burn...
17:13bitemyappthat is fantatic.
17:13bitemyappfantastic*
17:13arrdembitemyapp: you didn't kill it... my Arch fonts are just screwed again so it didn't render correctly.
17:13bitemyapparrdem: you can batch writes too
17:14bitemyapparrdem: bulk inserts might save you an fsync or two :)
17:18arrdembitemyapp: yeah I'll see about getting some logging out of the conns... looks like I'm still leaking at some leve.
17:19NotteHello, i'm approaching clojure with the clojure community tutorial. I installed leining but i don't understand how to run a plain clojure script, in particular the one called vars.clj. In the tutorial says "To run the code above, save it in a file named "vars.clj" and use the shell script for executing Clojure files described earlier", but i didn't find described any shell script. Would you help me, please?
17:20bitemyappNotte: learn to use Leiningen.
17:20arrdemNotte: link?
17:20Nottearrdem: http://java.ociweb.com/mark/clojure/article.html
17:20NotteVars section
17:21bitemyappthis material isn't quite right.
17:22bitemyappfor one thing, he uses "global" to mean at least three different things
17:22arrdemNotte: did you do all this? http://java.ociweb.com/mark/clojure/article.html#Getting%20Started
17:23arrdemNotte: yeah there totally isn't mention of whatever he uses for "$ clj $FILE"
17:23arrdemNotte: what platform are you on?
17:24Nottearrdem: osx. I installed leining as says in the tutorial, and also downloaded the clojure.jar just to try the simple repl. That's it.
17:24bitemyappNotte: you can just use `lein repl` and load the file.
17:25arrdemNotte: so if you set up a leiningen project, you can do what bitemyapp just said.
17:25bitemyappNotte: you should just learn to use Leiningen and live in the REPL though.
17:25bitemyappdon't even necessarily need a project, you can drop a REPL and use load-file anywhere.
17:25arrdemNotte: `lein new scratch; cp scratch.clj scratch/src/; cd scratch; lein repl;`
17:25bitemyappjust a terrible idea is all.
17:25bitemyappa scratch project is better.
17:26arrdemHAHAHAHA 500 WRITES/SEC.
17:26coventryNotte: This is good, and a bit more modern: http://aphyr.com/posts/301-clojure-from-the-ground-up-welcome
17:26bitemyappyou are...really excited about this.
17:26bitemyapparrdem: what'd you change to achieve that?
17:26NotteOk,thank you all.
17:27arrdembitemyapp: nothing. the 500 is just a huge peak on the same one conn per worker run I kicked off earlier.
17:28arrdem$seen http
17:28lazybotI have never seen http.
17:28arrdemhum... I have a bug then.
17:28bitemyapparrdem: how so?
17:28bitemyapparrdem: what's the state of the agents?
17:29arrdembitemyapp: so... because of the way that the logs I'm parsing are formatted, the message author's name is only mentioned the first time they send. So if I send four messages in a row, only the first displays my name.
17:29arrdembitemyapp: this means that I have some internal state which I use to track the previous message sender in case the next message has no sender, meaning that the sender is unchanged.
17:30arrdembitemyapp: the "last sender" is dumped whenever an agent finishes parsing one day's logfile and I'm seeing the usernames "http" and "https" show up, neither of which is probably correct.
17:31bitemyapparrdem: I'm going to assume in the intervening time that none of this is my default.
17:31bitemyappmy fault*
17:31arrdembitemyapp: probably a safe assumption.
17:32bitemyapparrdem: http://forums.frontier.co.uk/showthread.php?t=7892
17:32arrdembitemyapp: yep this behavior is a bug and totally my fault.
17:40NotteWhat can i read to learn clojure? Suggestions?
17:40SparkySparkyBoomNotte, this really helped when i first started. http://adambard.com/blog/clojure-in-15-minutes/
17:42NotteSparkySparkyBoom: ok, thanks.
17:43marcopolo`Notte: Check out light table
17:43marcopolo`I think it makes learning clojure a lot easier because it takes care of the boring stuff like setting up a repl connection
17:44Nottemarcopolo`: yeah, i know it. It's great, although it lacks of many features for now.
17:45marcopolo`like what?
17:45Nottemultiple cursors
17:45Nottefor instance
17:45marcopolo`yeah that is kind of annoying
17:46Notteonce you get used to it, it's difficult to write without it :)
17:46Notteannoying, i mean
17:47NotteBut i'll definitely use it one day, has great concepts
17:49NotteJust out of curiosity, do we have a repl in this channel?
17:49arrdembitemyapp: yeah in general I have way too much fun whenever I get to actually leverage all the compute power hiding inside my tower :D
17:49pdk% (print "maybe")
17:49pdkdamn it
17:50pdk, (print "maybe")
17:50Nottelol
17:50clojurebotmaybe
17:50marcopolo`lol
17:50bitemyapparrdem: as my desktop sits idle while I code on my dinkpad.
17:50Notte>> 'lol
17:50arrdembitemyapp: is that something like a crackbook?
17:51bitemyapparrdem: meant it in the sense of it being dinky, but really that's being unfair, it's a T430 and pretty decent.
17:51bitemyappjust wish Lenovo would use higher quality displays.
17:52bitemyappthe matte display is so matte it's downright cloudy.
17:54SparkySparkyBoom> (println "maybe")
17:54SparkySparkyBoom:|
17:58arrdembitemyapp: I love that this microjump/chainjump system includes stellar drift of targets and varied orbit speeds on a per-body basis
17:58bitemyapparrdem: it's quite interesting.
18:00shriphanisorry if this is a stupid question. what is the web-framework everyone recommends ? I can see a bunch but most of this pro-con stuff is about 2 years old and I was wondering if there is a single solution everyone's converged to.
18:00bitemyappshriphani: Ring/Compojure, but it's not a framework.
18:01bitemyappshriphani: you just use the bits and pieces you care about.
18:01arrdemshriphani: stay away from anything using Noir and you should be fine. lib-noir is ok.
18:01bitemyappshriphani: http://www.luminusweb.net/
18:01shriphaniany opinions on pedestal ?
18:01danneushriphani: use Compojure and assemble it a la carte
18:01shriphanithere's a 34 sections long tutorial
18:02danneuimpression i get is that pedestal appears to be aiming for interactive js apps
18:02shriphanio.
18:02danneuim running a forum with just compojure
18:02shriphaniok compojure it is
18:02marcopolo`pedestal is amazing, but it's designed for big client side apps
18:03shriphaniyea this is not big. There is currently just 1 user - me.
18:03shriphaniand it will stay that way for a while
18:03marcopolo`compojure should be just what you want
18:05bitemyapparrdem: discovered those links today, the micro-jump/plotted-jump is strikingly similar to what I had in mind.
18:06bitemyapparrdem: the super-cruise mode was something I hadn't come to yet though, I think there's an interesting way to use the gravity well mechanism to regulate the use of conventional, cruise, and hyperspace.
18:06danneui have a slow route in my webapp that does a lot of things. is there any sort of way to see how long time is spent in each function?
18:06bitemyappdanneu: https://github.com/bitemyapp/trajectile/ ?
18:07danneubitemyapp: thanks, i'll check it out
18:07arrdembitemyapp: the gravity well mechanic is absolutely critical IMHO.
18:07arrdembitemyapp: one thing which could be interesting is the interaction of a gravity well and the signature of a jumping ship...
18:08arrdembitemyapp: if deliberately diving a gravity well at supercruise allowed you to hide your de-jump signature...
18:09arrdembitemyapp: this being ballanced because of the induced system stress. otherwise supercruise or warp chases are just exercises in who can fly fastest, which will be warp engine determined.
18:09danneui run a compojure app behind nginx. this is my basic config: https://gist.github.com/danneu/8498070
18:10danneuDoes anyone more experienced know how i can throw up an error page if @MYCLOJUREAPP doesnt respond?
18:10danneuor perhaps a better way of hosting an app behind nginx
18:10bitemyappdanneu: middleware
18:11bitemyappdanneu: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/middleware.clj#L9-L22
18:12arrdemdanneu: you can add a 504.html that will get served on a timeout...
18:12bitemyappohhh
18:12bitemyappyou mean an actual 504
18:12carkbitemyapp: what's this space stuff you're talking about ?
18:12bitemyapprather than "doesn't respond" in the abstract.
18:12danneuarrdem: i get a 502 gateway when @MYCLOJUREAPP is down
18:12arrdemdanneu: there is support for 50X.html
18:12danneuyeah, thanks
18:13arrdemdanneu: http://help.cloud66.com/web-server/custom-500-page.html
18:13danneubitemyapp: i really need that too. i thought i'd just develop my site live. but it got really popular and now my stacktraces are thrown out to everyone
18:14arrdemdanneu: there are worse problems to have...
18:14danneufinally, is there any reason why 'lein ring server' in development mode is a bad idea if the stacktraces are turned into 500 errors?
18:14bitemyappit's a pretty bad idea.
18:14danneuthat's how i'm doing it so i can rapidly deploy
18:14danneubitemyapp: the readme just says that it "watches filesystem to reload changes"
18:15mrhankyhow do i replace a " with \" in a string?
18:15arrdemdanneu: set up a git-post-recieve to redeploy your app... do the dynamic reloading crap on your dev machine and just do redeploys whenever you want.
18:15bitemyappcark: uh, there does not currently exist a space game that fits what I want.
18:16arrdemI should have a template git repo for doing exaclty that...
18:16bitemyappcark: there was going to be one, but it died because the developer is flakier than a biscuit.
18:16carkbitemyapp: ah ok =(
18:16bitemyappcark: so I'm watching the development of a couple of promising space games while thinking about what I believe would be fun.
18:16bitemyappcark: mostly following Elite Dangerous and Star Citizen, the former seems more mature right now.
18:16danneuarrdem: what's the preferred incantation for serving a lein-ring app in production? (without compiling uberjar)
18:16bitemyappE:D should have multiplayer by the end of this month.
18:16bitemyappdanneu: use uberjar.
18:17arrdemdanneu: you really do want to do uberjar
18:17carkbitemyapp: i'm worried they might ruin the elite franchise...
18:17arrdemdanneu: the setup I used to use was that my post-recieve would uberjar and then java -jar $UBERJAR
18:17bitemyappcark: an otherwise dead franchise cannot be ruined.
18:17danneualright. i'll stop `lein ring server` and insteaed rsync up code and compile uberjar remotely
18:17carktru enough
18:17arrdemdanneu: you certainly don't want to be running lein in uberjar
18:17arrdemsorry. in production.
18:17bitemyappcark: I'm happy for anything they come up with and the development seems very promising. Thoughtful.
18:18danneuarrdem: doesnt `trampoline` get around that?
18:18arrdemdanneu: maybe. I've never used it.
18:18bitemyappdanneu: use uberjar.
18:18carkbitemyapp: the PR is thoughtfull, let's wait and see for the rest
18:18bitemyapptrampoline gets around some memory usage issues, it doesn't make using lein in product not a bad idea.
18:19danneubitemyapp: why is lein in production a bad idea in general?
18:19bitemyappchooses bad defaults, not the right way at all to do deploys.
18:19bitemyappDeploys should be of archived and tagged build artifacts.
18:19bitemyappnot freakin' code rsync.
18:20bitemyappusing lein ring server is like FTP'ing PHP code into production.
18:20bitemyappyou deserve what you get, at that point.
18:21danneusounds like i need to hang up my chaps
18:21danneuand my cowboy hat
18:21bitemyappdanneu: you're a francophone aren't you?
18:21arrdemdanneu: seriously. go set up a git server on your remote, add a git remote and just live http://nvie.com/posts/a-successful-git-branching-model/
18:21bitemyappdanneu: if so, you get a free pass for being weird.
18:21ProfpatschOkey, maybe I’m dumb, but: Howto new Map from seq of key-value pairs?
18:21arrdemProfpatsch: (into {} pair-seq) I think.
18:21bitemyapp,(into {} [["blah" "die"] [:untyped :langs] [:suck :fruit/wax]])
18:21clojurebot{"blah" "die", :untyped :langs, :suck :fruit/wax}
18:22danneualright, thanks guys. i'll make some payments on my technical debt.
18:22bitemyapparrdem: http://i.imgur.com/dqwujIX.jpg
18:22arrdemdanneu: you recognize that you have technical debt, and that's step one :D
18:22ProfpatschOh, right, I should have looked at the generic ops section. ;)
18:22ProfpatschThanks!
18:23danneuarrdem: i sure feel silly now at my first development job when i complained about the nasty code, that's for sure
18:24arrdemdanneu: hey man. relax. we all have to learn what good practice looks like at some point. I'm still learning...
18:24bitemyappdanneu: bad programmers are often worse at reading than writing code.
18:24mrhankyhow do i escape " in a string with replace?
18:24bitemyappdanneu: and they usually develop more slowly at reading than writing because they spend more time writing than reading.
18:24mrhankytried (replace string #"\"" "\\\"")
18:24arrdem$google java string escape
18:24bitemyappdanneu: one of my dream projects is writing a book on learning to read code other people ewrote.
18:24lazybot[Characters (The Java™ Tutorials > Learning the Java Language ...] http://docs.oracle.com/javase/tutorial/java/data/characters.html
18:24`cbpis anyone better at reading than writing
18:24arrdemmrhanky: ^
18:25bitemyapp`cbp: professors?
18:25ProfpatschGosh, I LOVE clj so much. It’s like I’m smiling constantly while writing code.
18:25bitemyappnot many anyway.
18:26`cbpsome dont know how to write at all :-D
18:26arrdembitemyapp: yeah there's something weird going on with the garbage system here...
18:26ProfpatschThe live response from the instarepl just heightens that feeling.
18:26arrdembitemyapp: I've been sitting at a 550 write/sec hypercruise for the last half hour and I just dropped to 1/s
18:26danneuProfpatsch: yeah, i can't even work with other code anymore. i don't know what i did before i could just eval code in the editor.
18:27danneui hope my personal projects don't collapse
18:27bitemyapparrdem: LAWGS
18:27bitemyapp~bitemyapp's |response| to everything is "logs plz"
18:27clojurebotYou don't have to tell me twice.
18:27bitemyapp~bitemyapp's
18:27clojurebotNo entiendo
18:27bitemyapp~bitemyapp
18:27clojurebotbitemyapp is it amuses me to mock other peoples' gods
18:27bitemyapp~bitemyapp
18:27clojurebotbitemyapp is unfuck your stack with monads!
18:28bitemyappLOL
18:28bitemyappokay.
18:28bitemyappI give up. I have no idea where the bot stashed that.
18:28`cbp~bytemyapp
18:28clojurebotPardon?
18:28`cbpoops
18:28`cbpoh well
18:29alewbitemyapp: what would you write in this book?
18:29bitemyappalew: they'd be a mixture of practical application and traits/patterns/methods.
18:29bitemyappalew: mostly just walkthroughs of extant non-trivial codebases in a variety of programming languages.
18:30alewI feel like reading the code base of a lib in clojure or c++ or java is so widely different
18:30alewin terms of idioms used and such
18:31bitemyappalew: that's why I planned to use a mixture of typed and untyped languages.
18:31bitemyappalew: one example technique I'd hammer in is source<-->sink identification and traversal.
18:31bitemyappmost people do it subconsciously, but don't practice it.
18:32alewYeah, I don't that is very explicit
18:32alewit's especially relevant for web or ui programming
18:32bitemyappI think you a word there.
18:33alewWow, even reading back over it I automatically reinserted the word
18:33bitemyapphelp me out?
18:33alewYeah I don't think that is very explicit
18:33bitemyappRight.
18:33bitemyappalew: especially in frameworks like Django/Ruby
18:33bitemyappthat stuff gets nuts if you don't know the idioms.
18:34bitemyappborderline magical/pure DSL in nature
18:34alewYeah, and shit like Swing
18:35bitemyapparrdem: `cbp can I interest you gentlemen in doters?
18:35bitemyappI'm tired of fucking around with sourcemaps.
18:35bitemyapp`cbp: you have a new Revise user btw.
18:36`cbpbitemyapp: I do? :P
18:36bitemyapp`cbp: arrdem.
18:36`cbpI have been really lazy with that since I have seen no issues posted
18:37`cbpwell lmk if you need help or new features
18:37arrdembitemyapp: lemme finish this llvm shit and get some food.
18:37arrdembitemyapp: ETA one hour if I stop derping with cloutjure
18:37`cbparrdem: ^
18:37arrdem`cbp: cheers
18:37`cbpi need to afk 30-40 for food
18:38bitemyapparrdem: one hour sounds good.
18:44ivanaha, IDEA replaced -Didea.no.safe.write=true with a 'Use "safe write"' in Settings -> General
18:44ivanno wonder I was getting weird locking issues
18:47rovarso I hit a major milestone last night. Finally made it through the Dota2 training scenarios
18:52arrdembitemyapp: you're gonna have to help me out with getting you some logs... I've got my big gaming box totally pegged on all cores, but the server rethink is running on is totally idling. something on the java client end is definitely locking up..
18:53bitemyapparrdem: it's actually pure Clojure.
18:53bitemyapparrdem: unless you mean you're not using Revise.
18:53bitemyapparrdem: I have to leave though, catching second brunch with a buddy.
18:53arrdembitemyapp: kk
18:53bitemyappthat's right, I'm having a second one.
18:55bitemyapparrdem: send me code if you want me to follow-up when I get back
18:55arrdembitemyapp: kk.
19:02danneuMy compojure app launches quickly, but the initial request takes a long time. Once it finishes, everything is working smoothly. I imagine this because the homepage pretty touches all the data in my Datomic db (at least counts all the records), so the first request is waiting for the peer to pull all of down?
19:08koreth_I'd guess it's compiling everything the first time.
19:11danneukoreth_: it's run from an uberjar
19:13rovardanneu: this is a job for liberally sprinkling log messages around
19:14danneurovar: heh, right. thanks. my introspection kit is nonexistent
19:32logic_progin C, we have macros that return __FILENAME__ and __LINE_NUMBER__
19:32logic_progin clojure, do we have anything like this?
19:32logic_progI want to hav ethe FILENAME / LINE_NUMBER of where hte macro _expands_
19:32logic_prognot where the macro is defined
19:33arrdemlogic_prog: neg. there is some line metadata on some symbols.
19:33danneuIs there a max string size in Datomic's string datatype? google turned up nothing
19:33arrdemlogic_prog: however this is all very ill-developed.
19:33logic_progarrdem: are clojure macros not supposed to output errors about the file/line number
19:33logic_progi.e. things like assert dumping where they failed
19:34arrdemlogic_prog: I don't know offhand how to achieve such an effect. I've looked in passing for that information before but I don't think it's easily accessible.
19:34logic_progarrdem: can a macro look up and get the name of the lexical function it's being expanded in?
19:34cark i thjink there's an env variable
19:34carknot quite sure, but that's something to google for i guess
19:34arrdemso there's *ns*, maybe a *env*, but no *fn* or *line*.
19:35arrdemI don't know of a *file* either.
19:35logic_proghttp://blog.jayfields.com/2011/02/clojure-and.html looks insuficient
19:35logic_progthere's &env and &form
19:35logic_progbut it's not clear to me how to pull the lexical function name from &env
19:37cark &form has metadata
19:37Bronsaarrdem: there's *file* actually
19:38arrdemBronsa: hum. TIL.
19:39Bronsaand as cark said, you can get line/column info from the metadata on &form
19:43gtraktpo
19:53alewis there a way to check if a value is the 'true' value?
19:54alewas in the actual true literal, not a truthy value
19:54Bronsaarrdem: logic_prog http://sprunge.us/GagZ?clj
19:54logic_progBronsa: thanks!
19:55arrdemBronsa: sweet!
19:56alewI think (= true value) works?
19:57coventry,(true? true)
19:57clojurebottrue
19:57coventry,(true? 1)
19:57clojurebotfalse
19:58arrdemhum... anyone know of a better worker thread management system than this? na
19:58arrdemhttps://github.com/seancron/work
19:58arrdemthis and technomancy's die-roboten both seem pretty dead (or just stable).
20:01logic_progBronsa: (defmacro fn-name [] (.thisName (.objx @clojure.lang.Compiler/METHOD))) (defn foo-magic [] (fn-name)) (foo-magic)
20:01logic_progwhy does that return nil ?
20:01Bronsabecause (defn foo []) expands to (def foo (fn [] ..)) not to (def foo (fn foo []))
20:02Bronsalogic_prog: there *might* be a way to get to the var name, let me check
20:02logic_progBronsa: ah, noted, thanks
20:04alewconventry: thanks
20:06Bronsalogic_prog: user=> ((fn foo [] (fn-name)))
20:06Bronsa"user$eval26$foo__27"
20:06Bronsaderp
20:06Bronsalogic_prog: http://sprunge.us/ZYFH
20:07logic_progBronsa: let me test this
20:08logic_progBronsa: awesome, thanks!
20:08logic_progBronsa: if I may, I have one more request --
20:08logic_progBronsa: I'm using cljx. Any chance we can make this work in cljs too? :-D
20:09Bronsalogic_prog: I don't think I need to say that this is abusing the clojure internals and you should really don't do this :P
20:09logic_progBronsa: Reasonable men use existing APIs. Unreasonable men use internals. Therefore, all progress depend on unreasonable men.
20:10logic_progBronsa: I have a dream -- that one day, code will be judged by what they do, and not what APIs they use.
20:10logic_progAsk not what existing clojure APIs can do for you; ask what you can do to develop future clojure APIs
20:10`cbpstahp
20:12arrdemI like this guy. can we keep him?
20:14logic_progcljs development is 1% clojure and 99% ^&(&*-javascript. -- Edison
20:17alewI think that was Lincoln
20:17arrdem$google edison quote invention is
20:17lazybot[Thomas A. Edison Quotes - BrainyQuote] http://www.brainyquote.com/quotes/authors/t/thomas_a_edison.html
20:17quizdrgood morning fellas
20:19logic_progin writing clojure code, I think a 100-line day is a good day
20:19logic_progin wriitng clojure macros, a 10-line day is a good day
20:20coventryAdded or removed?
20:20alewMost of your macro writing should be writing regular functions if they are anything complicated
20:21logic_progcoventry: added
20:21logic_progalew: indeed, but it's still hard for me to debug/visualize
20:23alewI've found the best way to write a macro is to write out how you want the macro to be called first and what it transform into
20:54grzmanyone run into "ReferenceError: Can't find variable: require" when using clojurescript.test with cljs.nodejs ?
21:21bitemyapparrdem: back
21:21arrdembitemyapp: ohai
21:23arrdembitemyapp: so I'm reading Revise trying to chase down what's going on here
21:23arrdembitemyapp: and it looks to me like in run-async when you finally send-off the operation, the send-off never manages to do anything.
21:24arrdembitemyapp: in short, I think I've succeeded in overloading the Clojure threadpool :P
21:24bitemyapparrdem: gg.
21:24bitemyapparrdem: still not my fault, got it.
21:25arrdembitemyapp: lolz.
21:26arrdembitemyapp: yeah so I've managed to control the memory usage by not using run-async and using a manually controlled threadpool
21:27arrdembitemyapp: but I'm just gonna have to run this thing overnight 'cause its friggin slow.
21:28bitemyappinterdasting.
21:30bitemyapparrdem: I'm trying not to be tempted into a benchmarking rabbit-hole by this.
21:30arrdembitemyapp: yeah I kinda want to get a profiler set up and figure out what's going on here...
21:31bitemyapparrdem: that's fine, I just bought the E:D alpha so I can do that instead until I go back to hacking :)
21:31rovarhow can I eval a file I've loaded and have it execute all functions in the file?
21:31rovarit seems to eval the first def and then stops..
21:31bitemyapparrdem: so are you just working with a fixed-size thread pool or what?
21:32bitemyapparrdem: you can use Executors with a specific thread pool impl I think.
21:32arrdembitemyapp: the last version I had did some really janky stuff with futures to manually implement a size 8 threadpool
21:32arrdembitemyapp: I went and got a real Java threadpool imp'l and now it's working...
21:32bitemyapparrdem: throughput?
21:33arrdembitemyapp: I'm down to about 30 documents/sec, but I'm not leaking memory and I'm restartably snapshotting so I'll take it.
21:33arrdemI am curious why I can't replicate that retarded 400/s throughput tho.
21:33bitemyapparrdem: increase thread pool size?
21:34rovarhow big are the documents? 30/sec seems very low for any database..
21:34rovarit's unlikely to be IO bound in any way that could be alleviated by more threads..
21:34rovare.g. disk..
21:35bitemyapprovar: I don't think it's bound by the database right now.
21:35bitemyapprovar: his thread pool is probably starving the client.
21:35arrdembitemyapp: I can confirm that all DBs are essentially idling
21:36bitemyappRight, as I would expect.
21:37rovarby all means then :)
21:38arrdemlemme see if I can tune out my VPN's overhead..
21:40rovaras an alternate to my eval question.. how can I use/require an arbitrary .clj file that isn't in my path?
21:41arrdemokay... using loopback rather than an encrypted channel to Warlock was good for an increase to 90/s
21:42rovarI have a thingy that generates test-data..
21:42logic_progThose who would give up macros for ease of use deserve neither. -- Franklin
21:49arrdemwell I haven't managed to propperly peg rethink... it's only at 10% of system time, but I also can't go any wider on my parallel crawl or I'll start getting 503 ratelimited.
21:54arrdembitemyapp: yeah I'm pretty sure that's what was happening. I'm using blocking transactions at the moment and I'm still seeing transactions going out of order by two and three months.
21:54arrdembitemyapp: so an overwhelmed Clojure threadpool would totally have done the trick.
22:01bitemyapparrdem: hum.
22:04arrdembitemyapp: https://github.com/arrdem/cloutjure/blob/master/src/cloutjure/input/irc.clj
22:05rovaris there any way to evaluate a function as a key in a map?
22:05rovari vaguely recall reading about this issue
22:06rovarthat the function call is treated as a symbol
22:06rovarI juts don't remember what to do about it.
22:06ivan,{(inc 1) "a"}
22:06clojurebot{2 "a"}
22:07rovarno worky
22:08rovarjava.lang.IllegalArgumentException: Duplicate key: (tmp)
22:08ivan,(hash-map (inc 1) "a")
22:08clojurebot{2 "a"}
22:08rovarin this case tmp is a lambda wrapper for tempid
22:09rovarhmm
22:10rovar,{(inc 1) "a" (inc 1) "a"}
22:10clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (inc 1)>
22:11rovar, (hash-map (inc 1) "a" (inc 1) "b")
22:11clojurebot{2 "b"}
22:11rovark
22:12rovari'll switch to an a-list style vector
22:16danneuWhat do I need to know when slurping/spitting to the `resources` folder of an uberjar? it's hard for me to translate my code into something that works in an uberjar.
22:33arrdemdanneu: https://groups.google.com/forum/#!topic/clojure/FIWygm8ub7Y
23:00stirfoocan someone with JOGL knowledge take a look here: http://pastebin.com/HWk4XGu3
23:00stirfootrying to get glDrawElements to work
23:04carki don't know about your example, but you really should not be using the opengl2 api
23:04stirfoocark: yes, I'm stuck in the past, but I've never learned the *new* opengl way.
23:06danneuarrdem: my problem seems to be actually writing to a new file in resources
23:06stirfooI'v programmed opengl with vertex arrays for a long time in c, c++ and python. I'm assuming it will work fine with clojure once I work the kinks out.
23:07stirfoo*and common lisp
23:09carkstirfoo: have you tied not disabling client state ?
23:09carktried*
23:10stirfoocark, I think I did actually
23:10stirfooI say an example that did the same
23:10stirfoo*saw
23:11carkis there no color information for each vertex ? you might be drawing black on black ?
23:12stirfoocark, default color *should* be white. guess I could enable a color array
23:12carkanyways i know nothing of gl2 =P
23:12stirfoojust to see
23:12carki shouldn't try to help
23:12stirfoocark: I'll take any help I can get
23:12stirfooI really should learn shaders one of these days
23:13carkthey're not all that hard, just start simple like you do here
23:13quizdrdoes anyone know how to stop an infinite loop at the REPL without killing the REPL buffer?
23:15danielszmulewiczquizdr: try C-c c-b
23:16quizdractually it looks like it locked up emacs entirely and I couldn't enter any key strokes at all
23:17danneuM-x nrepl-interrupt sometimes works
23:17quizdri've noted these and will try them if it happens again
23:19stirfooC-z, ps ax, kill -9 ####
23:19carkstirfoo: is make-direct-flat-buffer actually returning anything ?
23:19stirfoolast resort, but I've done that more than once
23:19quizdrthanks stirfoo
23:20stirfoocark, yes I can (.get buf N) and it returns the correct value
23:21carkahyes rewind returns the buffer
23:21stirfoocark: but really I have no idea what I'm doing with java.nio.Buffer, just read enough of the docs to try it out
23:21danneuIs there a reason why (spit (str (io/resource "cache/") "hello.html") "test") throws a 500 error with jetty instead of writes to resources/cache/hello.html?
23:21danneuwhen in an uberjar?
23:22carkstirfoo: why not create it directly with wrap ?
23:23carkthe floatbuffer
23:23stirfoocark: a direct buffer is required
23:23stirfoowell, that's what the traceback told me
23:24stirfoothat's for glVertexPointer, it doesn't complain when using wrap with glDrawElements, although I've tried a direct Buffer there as well.
23:24carkstirfoo: so maybe the indices one must be direct too ?
23:24stirfoostill nothing renders
23:24carkkk
23:24stirfoo=)
23:27carkfunny you would be doing opengl stuff, since a discussion here yesterday i've been playing with webgl and clojurescript =)
23:27carkgot a texture showing, and some "programmer art" too !
23:27stirfoothat sounds fun, I havent tried clojurescript out yet
23:29carki was astonnished when discovering that IE11 actually works with opengl
23:29carkwith a minimal change about 10 characters long
23:31stirfooahaha, I haven't used internet exploder in a loooong time
23:31carkahwell still the market leader, need to take it into account don't we
23:31ggherdovhello. About web dev in clojure (luminus, or pedestal). Anybody can point me to the "clojure way" to perform testing of a webapp? In Rails they have this "Capybara" gem, that can to the unthinkable: click on buttons, fill forms... It's based on selenium.
23:31ggherdovMaybe I can pick something from the java ecosystem to do something like that?
23:32stirfooyep, if you want your code to run most everywhere
23:33ggherdovBasically I am askng of a headless js-capable browser I can use to test my clojure webapp
23:34carkggherdov: maybe check this : https://github.com/cemerick/austin this project starts a repl inside phantom.js
23:34quizdris defonce bascially like def except it won't reassign the var if it is already exists? kinda like defvar in common lisp?
23:34ggherdovcark: thanks
23:35ggherdovcark: about IE11, do you know that the javascript isIE() function evaluates "false" on it? I LOL-ed for a day whan saw that
23:36carkggherdov: didn't know that =)
23:36kristofshouldn't that just check the user agent?
23:36ggherdovkristof: user agents are a jungle of nonsense, not reliable anymore basically
23:37kristofCome now, there are only so many, you can easily hardcode those cases in
23:37kristof...If you can't rely on them, what's the point anymore? :P
23:37ggherdovcark: http://www.nczonline.net/blog/2013/07/02/internet-explorer-11-dont-call-me-ie/
23:42ivanif there's any Trident in it it's IE
23:42ggherdovkristof: http://webaim.org/blog/user-agent-string-history/
23:42ggherdov"... and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded."
23:43ggherdov:)
23:43kristofheh, that's what people are doing with Pipelight
23:43kristof"I'm on Windows, I swear!"
23:44ggherdovhehe
23:57`cbphow's the driver treating you arrdem