#clojure log - Jan 18 2014

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

0:00 xuser: ddellacosta: great, thanks

0:00 deadghost: probably gonna bug you after reading it ;)

0:00 ddellacosta: xuser: my short answer is use closure rather than jquery (jayq), but check out dommy too.

0:02 xuser: ddellacosta: ok, does the closure library and dommy overlap?

0:03 ddellacosta: xuser: no. Domina and Closure do, of course.

0:05 xuser: ddellacosta: ok, so clojure lib and dommy are a nice combo to use

0:07 ddellacosta: xuser: 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.

0:08 xuser: 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.

0:10 and this is leaving aside using something like Om or Cloact, which kind of obviate the need for these sorts of dom libs

0:13 xuser: ddellacosta: 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

0:14 ddellacosta: xuser: try dommy. :-)

0:14 kristof: xuser: Om is not Javascript, if it's "deep" in anything, it's Clojurescript. :)

0:14 ddellacosta: yeah, I mean, it's important to note that the approach implied by dom libs like the above and react/om is very different, fundamentally.

0:15 xuser: kristof: yeah, I think I want to focus on om/closure library

0:16 was asking of closure lib vs jquery, because I don't really want to reinvent all those usefule UI widgets

0:16 :)

0:17 ddellacosta: xuser: 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).

0:18 bbloom: xuser: you may find those widgets much easier to build with react than to repurpose from elsewhere, heh.

0:18 especially if you don't want to use their CSS

0:18 xuser: ddellacosta: what's the limitation?

0:19 bbloom: glad you said then ;) thanks

0:19 ddellacosta: xuser: 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.

0:19 *rendered

0:20 clojurebot: Excuse me?

0:20 bbloom: ddellacosta: it shouldn't be any trouble really, other than requiring you to play the IDisposable game with react's lifecycle events

0:20 xuser: bbloom: I'm going switch my focus to cljs/om/react now :)

0:20 bbloom: ddellacosta: react plays surprisingly nice with other frameworks/widgets/etc as long as they stick to their own respective subtree

0:21 ddellacosta: bbloom: 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

0:21 bbloom: confirms what you're suggesting.

0:22 seems pretty clearly to be embedding jquery/bootstrap widgets inside of react components. Interesting.

0:24 xuser: the JS ecosystem is horrible/scary place, it looks like pure Cljs fixes 80% of the 3rd party JS libs

0:25 domino14: how do i escape a quote character?

0:25 i want to find the " in a string

0:25 #"\"" doesn't seem to work

0:27 xuser: bbloom: isn't the problem that most frameworks/widgets aren't compatible with the advaced mode of closure compiler?

0:27 bbloom: xuser: yeah, that's *an* issue

0:27 xuser: the bigger issue is that many frameworks like to assume they own the dom

0:27 xuser: you'd *think* that were true of react, but it's not

0:28 react 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

0:29 domino14: arghhh

0:29 how do i find a " character in a string

0:30 bbloom: ,(re-find #"\"" "x\"y")

0:30 clojurebot: "\""

0:30 bbloom: seems to work fine to me

0:31 domino14: maybe you're using re-matches incorrectly?

0:31 ,(re-matches #".*\".*" "x\"y")

0:31 clojurebot: "x\"y"

0:31 domino14: ,(clojure.string/replace "\"COOKIES#"\"" ""

0:31 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading string>

0:32 domino14: ,(clojure.string/replace "\"COOKIES#"\"" ""

0:32 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading string>

0:32 domino14: sorry

0:32 ,(clojure.string/replace "\"COOKIES\"" #"\"" "")

0:32 clojurebot: "COOKIES"

0:32 domino14: ,(clojure.string/replace "COOKIES" #"\"" "")

0:32 clojurebot: "COOKIES"

0:32 bbloom: domino14: heh, you're just misinterpreting the output :-)

0:32 domino14: :( sorry

0:32 bbloom: try:

0:32 ,(println (clojure.string/replace "\"COOKIES\"" #"\"" ""))

0:32 clojurebot: COOKIES\n

0:33 domino14: oh it's my editor that sucks

0:33 bbloom: domino14: strings are quoted when printed as literals :-)

0:33 anyway, gnight all

0:33 domino14: i have this: (clojure.string/replace str #"\"" "") and my editor is highlighting everything wrong. i thought sublimetext was good for clojure

0:34 xuser: bbloom: 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?

0:35 s/to/not/

0:35 of he left ;)

0:37 danneu: Isn't :jvm-opts ["-Djava.awt.headless=true"] supposed to prevent this: Exception in thread "main" java.awt.HeadlessException?

0:38 hiredman: danneu: it most likely means you are trying to do something that absolutely requires a head

0:38 http://docs.oracle.com/javase/7/docs/api/java/awt/HeadlessException.html

0:38 clojurebot: Pardon?

0:38 bitemyapp: kristof: reading the Haxl slides, very cool.

0:38 kristof: the sort of thing I was telling a coworker works a lot better in Haskell.

0:42 xuser: bitemyapp: we have lost you to haskell ;)

0:46 bitemyapp: xuser: yeah, actually.

0:59 marcopolo`: I'm performing an experiment, who uses vim and has a decent amount of clojure on github?

1:42 domino14: is 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

1:48 bja: domino14, (map (fn [i e] ...) (range) my_array)) works with map

1:49 domino14: oh cool didnt know it would take two args

1:50 andrew_fm: ,(doc map)

1:50 clojurebot: "([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."

1:50 bja: ,(map (fn [i x] [i x]) (range) [:a :b :c])

1:50 clojurebot: ([0 :a] [1 :b] [2 :c])

1:51 bja: guess I could just use vector in the example...

2:01 amalloy: ,(map-indexed vector '(a b c))

2:01 clojurebot: ([0 a] [1 b] [2 c])

2:03 andrew_fm: perhaps 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.

3:12 hcumberdale: HI :)

3:13 bitemyapp: hcumberdale: hai

3:14 arrdem: I see chare has gotten sick of being hellbanned and moved on to easier targets...

3:15 ah crud.

3:15 bitemyapp: arrdem: ?

3:16 arrdem: bitemyapp: how can I change the default shard for a database?

3:16 bitemyapp: I'm getting stuff on Omniknight (which will go down) an I need Warlock to be the primary.

3:16 bitemyapp: arrdem: http://i.imgur.com/ba3K8PF.gif

3:16 arrdem: bitemyapp: yes yes that was all over r/dogecoin

3:17 my entire doge collection is worth $1.14....

3:20 bitemyapp: oh my god why are people still messing with DCPU-16?

3:21 just use a 6502 emulator :|

3:21 arrdem: good question... they could be inventing their own saner architectures but no we have DCPU-32s...

3:28 bitemyapp: arrdem: http://www.rethinkdb.com/docs/sharding-and-replication/ ctrl-f "pinning"

3:28 arrdem: bitemyapp: danke

3:29 bitemyapp: arrdem: "default shard" momentarily confused me but I think I've touched on the bit you care about.

3:29 I like how you immediately clustered your rethinkdb instance for the fuck of it.

3:29 just lol.

3:30 arrdem: bitemyapp: I mean...

3:30 bitemyapp: I know the IT guys here and they give no fucks what I do on network...

3:30 bitemyapp: hey, it's a good thing that it's a clustered data store that actually "just works"

3:30 I just found it amusing.

3:30 arrdem: bitemyapp: yeah. and that SJW makes my night.

3:30 * arrdem curses Mongo's sharding configuration

3:30 bitemyapp: arrdem: SJW?

3:31 arrdem: bitemyapp: shit just works

3:31 bitemyapp: oh right, yes.

3:31 arrdem: well that and the sharding and replication is actually sensible and tuneable.

3:31 MongoDB? lol, serious deployments have to do the sharding themselves because the 10gen impl is too fucked.

3:32 arrdem: fukkit new mololithic project. I'll just salvage what I can from the wreckage of clojurecup...

3:32 and LEIN_IRONIC_JURE can just piss right off

3:33 bitemyapp: arrdem: in Minecraft, is it me or is Equivalent Exchange pretty much grind-to-cheat-mode?

3:34 arrdem: bitemyapp: probably... I'm not familliar with that particular mod

3:40 bitemyapp: arrdem: Now I just need you to use Revise... http://i.imgur.com/btjXhpH.jpg

3:42 arrdem: bitemyapp: 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...

3:43 bitemyapp: arrdem: oh I'm chill, just excited :)

3:43 arrdem: great gif.

3:53 arrdem: yep well that project was a pile of once-off data munging scripts in Clojure...

3:54 locks: danneu: neat :D

4:12 arrdem: I wonder if doing this whole thing in core.typed is reasonable...

4:12 single dispatch problem domain...

4:12 could be viable.

4:19 bitemyapp: arrdem: you can type-check multimethods too. Sorta.

4:20 arrdem: bitemyapp: yeah but when I've tried that stuff I ran into rough patches even faster...

4:20 * bitemyapp does a jewish shrug

4:22 arrdem: bitemyapp: r/insert implicitly does a multi if given (U List Vec)?

4:24 * bitemyapp squints

4:26 arrdem: bitemyapp: also why no -! convention? just because you don't have a mutable global connection?

4:27 bitemyapp: arrdem: pretty much.

4:27 arrdem: they're not STM operations.

4:27 arrdem: ! is for STM operations, conventionally.

4:28 deeply proud of that.

4:32 arrdem: mmmk. I've been using -! for anything with side-effects whether STM or otherwise.

4:32 may take this opportunity to change my style..

4:36 bitemyapp: arrdem: yeah I've seen people do the same, but I talked to tbaldridge about it - no dice, not what it's for.

4:37 arrdem: 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.

4:37 if somebody took it too literally, they could be in for same pain :)

4:38 arrdem: bitemyapp: 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..

4:39 bitemyapp: arrdem: the tests are a good place to poke around.

4:42 arrdem: just be aware there's a fair bit of partial application and aliasing/wrapping of common-case stuff flying around.

4:42 arrdem: cbp was thorough :)

4:42 arrdem: fair warning, the library is 80% cbp's work, I just did the conn mgmt.

4:43 in about 15 minutes you're going to know more than I do.

4:43 arrdem: bitemyapp: I'm just reading the partials trying to decide how cute it is...

4:43 bitemyapp: or sooner,.

4:43 arrdem: be easier in a typed lang...

4:43 * bitemyapp grumble grumble

4:43 * arrdem rolls eyes

4:48 xexonixxexillion: I 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)

4:49 bitemyapp: xexonixxexillion: you're proficient in Haskell?

4:50 xexonixxexillion: you probably just want Joy of Clojure, but either way, shouldn't take much time at all.

4:50 abaranosky: xexonixxexillion: your learnign points will all revolve around the JVM then

4:50 locks: I second JoC

4:50 bitemyapp: xexonixxexillion: abaranosky is right, but Clojure offers some ways to skirt around and avoid having to be confronted with Java-isms all at once.

4:51 abaranosky: did you really not know about ::?

4:51 abaranosky: I know ::foo, sure

4:51 but if I evaluate ::my.ns/foo in the repl BOOM

4:51 bitemyapp: the namespace has to exist yo.

4:51 the point of :: is namespace qualification.

4:51 abaranosky: :my.ns/foo is fine though

4:52 bitemyapp: because it's not namespace qualified

4:52 abaranosky: what is it then?

4:52 clojurebot: Titim gan éirí ort.

4:52 bitemyapp: :my.ns/foo is basically arbitrary data with the namespace getting destructured out.

4:52 as a convenience.

4:52 ::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.

4:52 abaranosky: there's a function you can call to get the n of a keyword right?

4:53 bitemyapp: of any keyword, yes

4:53 but if the namespace OF the keyword doesn't exist then you can't use a namespace qualified keyword, if it's a "logical"

4:53 abaranosky: so I guess I didn't know that

4:53 bitemyapp: rather than "actual" keyword.

4:53 :: should mean you're referring to a var in a real and in scope namespace.

4:53 abaranosky: I thought that keyword namesapces and regular namespaces were totally orthogonal

4:53 bitemyapp: : is just data.

4:53 abaranosky: they are...in :

4:54 abaranosky: yeah, right, makes sense

4:54 * bitemyapp shrugs

4:54 bitemyapp: abaranosky: I think the idea is to get a less-stringy, compiler-checked way to refer to vars as data.

4:55 abaranosky: oh, interesting.

4:55 bitemyapp: I can't say for sure because I'm not Hickey, but that's the only way I've seen them used.

4:56 abaranosky: I just use them whenever I add a key to someone else's map where I wn't know the keys in the map 200%

4:58 honza: bitemyapp: is there any convention of marking up pure/impure functions?

4:59 bitemyapp: honza: nope. Welcome to Hell.

4:59 abaranosky: I write my impure functions in red

4:59 bitemyapp: abaranosky: no, you use the red ink for Hickey's words.

5:00 abaranosky: I 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

5:02 john2x: what fn do I want to check if an element is in a coll?

5:02 honza: welp

5:02 john2x: I thought it was contains? but it only works on keys

5:02 abaranosky: john2x: depends on the colelction

5:02 bitemyapp: john2x: (partial some #{element})

5:02 abaranosky: stick your data in a set, and call contains?

5:02 if you have any kind of size of data then some sucks

5:03 bitemyapp: you don't need to even do that.

5:03 sets are functions, you just need to pass it as a function to some.

5:03 abaranosky: bitemyapp: sure

5:03 bitemyapp: I've used some #{} for existential queries against colls ever since Raynes showed me the light

5:04 10:01 <chare> unmute now or I tell your girlfriend you cheated on her

5:04 this dude has a seriously optimistic view of my social life.

5:04 arrdem: ^^

5:04 arrdem: bitemyapp: yep yep

5:04 * arrdem raises shields and checks his fools list

5:04 john2x: thanks

5:05 andrew_fm: lol bitemyapp

5:06 bitemyapp: arrdem: I should break his heart and tell him he's not more interesting than google closure compiler arguments?

5:06 arrdem: bitemyapp: you assume it has a heart, let alone a soul....

5:06 andrew_fm: someone 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

5:06 do you think it would be a bouquet of flowers?

5:06 bitemyapp: LOL

5:07 arrdem: .............

5:08 bitemyapp: arrdem: 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?

5:08 what if by muting him...we've opened pandora's box?

5:08 #creepypasta

5:09 arrdem: bitemyapp: okay. that I need to compose db -> table-db -> insert should be in the fucking readme file.

5:09 bitemyapp: I should not have spent the last 15 reading test cases and grepping the query code.

5:09 bitemyapp: arrdem: PRs accepted by my lazy ass.

5:10 * arrdem facepalms

5:10 andrew_fm: what is creepy pasta?

5:10 bitemyapp: wait, the README should have a shake-n-bake example

5:10 arrdem: IMHO yes.

5:10 bitemyapp: hum.

5:10 arrdem: that's in the README

5:10 * arrdem C-s's some more

5:11 bitemyapp: arrdem: https://github.com/bitemyapp/revise/#insert

5:11 arrdem: bitemyapp: right. you give this insertion example, but r/table implicitly uses the default table, "test".

5:11 bitemyapp: sorry. db.

5:12 bitemyapp: if you want to change DBs, you have to compose (r/db), (r/table-db) an then as shown.

5:12 bitemyapp: why am I lecturing you on your library.

5:12 * bitemyapp laughs hard

5:12 bitemyapp: arrdem: you're right, the documentation can be made more explicit.

5:12 arrdem: it was basically "unrolled" out of the test cases.

5:13 arrdem: it's a 36kb README.md though, that's not shabby at all for a Clojure library.

5:13 10:08 -!- chare [322f51ac@gateway/web/freenode/ip.50.47.81.172] has quit [Quit: Page closed]

5:13 10:09 <chare> god dam nit

5:13 way too entertaining

5:13 arrdem: it even covers date/time manipulation!

5:13 arrdem: bitemyapp: hang on.. you left me a raw IP there...

5:14 ah fuck. web client.

5:14 even I portscan anyway. 1d2

5:14 1d2

5:14 clojurebot: 2

5:14 * arrdem busts out his toolkit.

5:14 andrew_fm: i have successfully rooted chare's machine, i'm digging through his files right now. nothing too interesting yet.

5:14 bitemyapp: andrew_fm: wait what

5:15 arrdem: andrew_fm: ..... wat

5:15 bitemyapp: he's still talking to me...

5:16 andrew_fm: chare has the worst firewall protection, and by "worst" i mean "none"

5:16 arrdem: apparently he's in Washington state...

5:16 lemme see what I can get with geoip.

5:16 andrew_fm: i will tell you exactly where he lives in a pm, but don't want to do that publicly

5:17 arrdem: he is running Linux... 2.6. I'm probably seeing a network device given the service list I scanned up.

5:20 bitemyapp: arrdem: "likely embedded"

5:20 arrdem: yeah best I can do is Redmond area. The geoip lookup breaks down because the tracerout winds up in ISP owned nonpublic IP ranges...

5:21 bitemyapp: arrdem: redmond? Microsoft intern?

5:21 * arrdem snickers

5:21 bitemyapp: arrdem: pretty brutal drop in employee quality :)

5:22 hcumberdale: Had a meeting with MS for startups yesterday :D

5:22 andrew_fm: i'll send you google maps satellite image of his house in pm

5:22 bitemyapp: 10:19 <chare> WHY WOULD I EVER WORK FOR FAGGY MICROSOFT

5:22 hcumberdale: oh their tech lock-in program?

5:23 hcumberdale: Azure looked good. They offer also seed-funding, accelerator and biztalk programs

5:23 yeah bitemyapp, it seems to be a bit like it

5:23 bitemyapp: hcumberdale: it's not worth it ;)

5:23 * arrdem adds andrew_fm to the troll list

5:23 hcumberdale: "If you get funding you have to create a company placed in the US, for taxes"

5:23 ... and US law?

5:24 bitemyapp: he just showed what is possible, not the terms and conditions

5:24 arrdem: <chare> ok what do you want in exchange for unmute [04:09]

5:24 <chare> you guys gotta hide behind a proxy [04:11]

5:24 <chare> you guys scared to show yourself [04:12]

5:24 <chare> YOU GUYS STOP SCANNING ME

5:24 * arrdem dies

5:25 hcumberdale: Just told that people who use some services have to relocate to berlin and thats why ~300 candidates directly reduced to 80

5:25 "We haven't read terms and conditions, can't move to berlin, sorry"

5:26 Most 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.

5:27 andrew_fm: hcumberdale 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

5:28 honza: Enjoying all the Clojure talk this morning.

5:28 hcumberdale: andrew_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.

5:28 arrdem: bitemyapp: ah I love watching the document count tick up...

5:29 bitemyapp: porting from Mongo was a breeze one I figured your crud out.

5:29 andrew_fm: oh you mean, for devs to take jobs with new startups? i thought you mean starting your own startup

5:29 abaranosky: I really like Emacs gist-mode :)

5:30 andrew_fm: berlin 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.

5:30 but then again, i actually had a cab driver in berlin who had never seen a credit card before, so go figure.

5:30 hcumberdale: no 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$

5:31 arrdem: hcumberdale: wow MSFT is that desperate to secure users?

5:31 andrew_fm: and it takes 10 minutes to use an atm machine there because the connection is so slow.

5:31 hcumberdale: arrdem: I think they want to get the next billion dollar start-ups running on azure

5:32 arrdem: hcumberdale: this I totally understand... I just find it funny.

5:32 hcumberdale: The ultimate lock-in is gone. Everybody is writing software for android, ios, linux, whatever...

5:32 arr0w: what do you think about typed clojure?

5:32 hcumberdale: arr0w: haven't understood the benefit of it

5:33 since there are type hints performance shouldn't be the problem

5:33 arrdem: hcumberdale: the advantage of typed clojure is that you can selectively add typechecker backed gurantees to your Clojure code.

5:33 hcumberdale: and where is typesave really helpful? Modern applications just include a lot magic and dependencies to other systems.

5:34 arrdem: isn't that what type hints are actually doing?

5:34 arrdem: hcumberdale: not at all

5:34 hcumberdale: type hints are hints to the compiler about the runtime type so that the emitted classes can use static type dispatch.

5:34 hcumberdale: applicable only to gen-classes and java.lang.*

5:35 hcumberdale: so you mean for example it is helpful for refactoring and stuff

5:35 andrew_fm: hcumberdale 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.

5:36 arrdem: hcumberdale: 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.

5:36 hcumberdale: andrew_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 :)

5:37 arrdem: 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

5:38 khaled: o/

5:38 hcumberdale: To hard-code it might lower agility ^^

5:38 arrdem: hcumberdale: 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.

5:39 hcumberdale: arrdem: ok, but at the cost of bad readable hard-to-maintain code

5:39 look at scala (okay it is more complex with all the OO* stuff)

5:39 arrdem: hcumberdale: right. or at least that's the sales pitch.

5:39 hcumberdale: But the type system makes declarations and everything crazy

5:40 khaled: arrdem: is typed clojure a possible solution, for strong typed?

5:40 arr0w: arrdem when you get errors with typed clojure, at compile time?

5:40 arrdem: arr0w: whenever you invoke the (check-ns) form, usually compile or test time. core.typed is designed to have zero runtime footprint.

5:41 hcumberdale: Static types, reminds me to: http://goo.gl/1cX821

5:43 arr0w: arrdem 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?

5:44 arrdem: arr0w: I've only used core.typed in my hobby clojure code

5:44 arr0w: but I've seen the typechecker catch real issues in my designs in programs under 1K lines.

5:45 bitemyapp: arrdem: "I never write code with type errors because I've relabeled type error to mean logic error!"

5:46 Nothing makes my eyes prolapse and cause me to descend into a red-haze like hearing that.

5:46 eyes to*

5:49 arrdem: alright... 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

5:49 night all

5:49 chare: burn in hell

5:50 hcumberdale: night? :)

5:50 arrdem: hcumberdale: I'm in Texas. it's about 5am here :P

5:50 bitemyapp: sigh, I should sleep.

5:50 abaranosky: core.typed is so verbose though

5:51 bitemyapp: abaranosky: yeah :(

5:51 abaranosky: Fay and Haskell are short though :)

5:51 abaranosky: yeah, I 've tried it and gave up. :(

5:51 what is Fay?

5:51 bitemyapp: setBGColour :: Text -> JQuery -> Fay JQuery

5:51 arrdem: abaranosky: yeah... it has gotten better thanks to the *> forms, but it still has a significant overhead.

5:51 bitemyapp: abaranosky: Haskell->JS, it's quite nice :)

5:51 abaranosky: I see, googled

5:51 hcumberdale: ahh, good n8 :)

5:52 abaranosky: later

5:54 arr0w: abaranosky it is? doesn't seem too verbose to me. I only looked at simple examples, though

5:55 abaranosky: arr0w: maybe I'm just not used to it?

5:56 * bitemyapp cringes

5:59 ambrosebs: I don't think core.typed will ever be described as succinct ;)

6:00 arr0w: http://adambard.com/blog/core-typed-vs-haskell/

6:01 there'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

6:01 verbosity wise

6:04 hcumberdale: Yeah, verbose.

6:04 ambrosebs: compared to Clojure, Typed Clojure is verbosity city. But of course Clojure doesn't give you any guarantees.

6:04 hcumberdale: ambrosebs: who needs compile time guarantees?

6:04 don't think its such an advantage

6:05 arr0w: well sure, but comparing typed clojure with clojure is not a fair comparison

6:05 ambrosebs: hcumberdale: ok, then don't use the type checker :) a type system is not very interesting for some problems.

6:06 arr0w: yes, but that's what people want. Clojure syntax, with the guarantees of Typed Clojure.

6:06 arr0w: which would be pretty awesome.

6:08 arr0w: type inference would be nice.

6:17 how 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

6:17 arrdem: arr0w: #'clojure.core/some

6:18 andrew_fm: arr0w also every?

6:18 ,(doc every?)

6:18 clojurebot: "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."

6:18 arr0w: looks like that is it, thanks

6:18 arrdem: core/some just gets my goat because it's a predicate which doesn't conform to the -? convention.

6:19 bitemyapp: arrdem: some and every?

6:19 er

6:19 andrew_fm: actually some is not a predicate, but it behaves like one. it doesn't have the ? because it is not actually a true predicate

6:19 bitemyapp: aimed at the wrong person

6:19 AND slow on the draw

6:19 fuck me

6:19 might be time to sleep.

6:19 arrdem: I solved my first mysterious Fay bug!

6:19 arrdem: might be.

6:19 andrew_fm: it returns the value of the predicate function for the first value found, thus it may not be a predicate result

6:19 bitemyapp: wasn'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.

6:19 arrdem: bitemyapp: woot. I just rewrote my crawler to do 8-wide parallel and it's going like a bat out of hell.

6:20 bitemyapp: arrdem: hahaha, nice.

6:20 arrdem: bitemyapp: I just hope that revise isn't silently loosing async transactions..

6:20 * bitemyapp looks around shiftily

6:20 * bitemyapp slowly closes laptop and creeps away

6:20 * arrdem follows suit

6:20 bitemyapp: arrdem: but more seriously, I'm hoping the pipelining makes your clients more efficient.

6:21 arrdem: you have a client for each thread right?

6:21 arrdem: async or not?

6:21 arrdem: bitemyapp: all the db accesses are run-async

6:22 comming from futures, with a cap at 8 simultaneous futures.

6:22 bitemyapp: arrdem: yeah it should be spewing those inserts at the database then

6:22 arrdem: cool.

6:22 bitemyapp: arrdem: run-async behavior is roughly "throw it over the fence and PIPELINE LIKE A MADDAFAKKA" mode.

6:22 but the error handling is more manual.

6:23 arrdem: ah. bugger. I seem to have killed my crawler.

6:23 * arrdem puts his JVM out of its misery and goes to bed

6:23 bitemyapp: technically the synchronous mode is still sorta-async and pipelined behind the scenes but the direct caller is forced to wait and confront any errors.

6:23 arrdem: cheers.

6:48 ggherdov: Hello. 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?

7:02 quizdr: ggherdov 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.

7:11 ggherdov: quizdr: thanks for the the tip. My plan is to follow the book that came out this summer, now in beta

7:11 quizdr: the prag pub web dev book?

7:11 ggherdov: http://pragprog.com/book/dswdcloj/web-development-with-clojure

7:11 yep

7:11 quizdr: that is no longer in beta

7:12 it has gone to print

7:12 ggherdov: ah !

7:12 quizdr: i just got it myself

7:12 * ggherdov checks his ebook version...

7:14 ggherdov: ah yes I have this "beta 6", which is actually the final thing -- I actually pourchased the PDF a week ago)

8:53 pepijndevos: How can I implement an Atom il

8:53 n clojure

8:54 I mean, atom uses AtomicReference which uses unsafe private java magic.

8:56 I want an atom that works with a revision instead of a reference, and wonder if there is a better way than naive lockh

8:58 pjstadig: pepijndevos: not sure what you mean? you can use AtomicReference

9:00 pepijndevos: pjstadig, I want to do (compare-and-set! atom rev newval) => newrev

9:01 pjstadig: you could have the atom contain a vector [rev val]

9:02 pepijndevos: you could also directly use java.util.concurrent.atomic.AtomicStampedReference

9:04 pepijndevos: that has compareAndSet(V expectedReference, V newReference, int expectedStamp, int newStamp), I want compareAndSet(V newReference, int expectedStamp, int newStamp)

9:06 In other words, no expectedReference.

9:06 pjstadig: i 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

9:06 in the swap function you can decide what to update and when

9:10 pepijndevos: I guess I could do compareAndSet(getReference() , V newReference, int expectedStamp, (inc getStamp()))

9:22 sundbp: I 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.

9:23 I'm not sure it's complete but the changes should stand up on their own logic even if partial.

9:42 pepijndevos: If you apply the rules for a heap and a search tree, you get a linked list, right?

10:07 corecode: is there an easy way to do cljs+node.js+emacs+repl?

10:07 or should i be inquiring elsewhere?

10:08 xeqi: corecode: you'd want to look at https://github.com/cemerick/austin#project-repls

10:10 corecode: xeqi: that seems to be for browser-based cljs, no?

10:11 xeqi: corecode: it should be able to do either. repl-env for brepl, exec-env for standalone

10:11 https://github.com/cemerick/austin/blob/master/src/clj/cemerick/austin.clj#L452

10:12 corecode: it keeps talking about browser-repl, that's what confuses me

10:49 rovar: are comments allowed in edn?

10:52 kzar: ; this is a comment rovar

10:52 and there's a reader macro to comment a s-exp that I forget

10:52 Oh it's #_

10:53 ,(+ 1 2 3 #_4)

10:57 hyPiRion: kzar: uh, in edn?

10:58 I'm certain #_ is not allowed, and I guess ; isn't either

10:58 RickInAtlanta: ,(+ 1 2)

10:58 clojurebot: 3

10:58 RickInAtlanta: ,(+ 1 2 #_(+ 1 2))

10:59 TimMc: hyPiRion: What? That would suck.

10:59 xeqi: ,(clojure.edn/read "#_ 1 1")

11:00 TimMc: hyPiRion: No, both are supported.

11:00 hyPiRion: TimMc, kzar, rovar: Ignore me, I thought edn was json-like in that regard

11:00 TimMc: Unlike JSON. What a bad decision.

11:00 hyPiRion: yeah

11:00 RickInAtlanta: but it seems like the bot isn't evaluating any forms that have #_ anywhere in them

11:01 xeqi: RickInAtlanta: I think it died

11:01 TimMc: &(clojure.edn/read "#_ 1 1")

11:01 RickInAtlanta: ,(+ 1 2)

11:01 clojurebot: 3

11:02 hyPiRion: TimMc, xeqi: read requires a reader

11:02 read-string on the other hand

11:02 xeqi: hyPiRion: right, should be read-string

11:04 TimMc: lazybot is dead :-(

11:04 xeqi: Raynes: ^

11:08 paulswilliamsesq: Hiya, 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:12 kzar: paulswilliamsesq: 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:12 oh I tell a lie, I think I found one other one that was quite dark as well

11:12 paulswilliamsesq: kzar: I'm trying ibdknox which seems okay but like something a little bolder

11:13 kzar: (Personally I'd like a theme + improved emacs plugin to match emacs as much as possible superficially)

11:14 I'm guessing it will come with time, early days

11:19 paulswilliamsesq: kzar: absolutely. I'm normally a vim user, and love vim-fireplace but Lighttable really does seem awesome.

11:20 kzar: paulswilliamsesq: 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:23 paulswilliamsesq: kzar: 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:46 mrhanky: how can i check for keywords as arguments?

11:47 (foo args :bar true)

11:51 bbloom: mrhanky: 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:51 ,((fn [& {:as x}] x) :foo 1 :bar 2)

11:51 clojurebot: {:foo 1, :bar 2}

11:51 mrhanky: i'm on clojurescript and have a script which uses (spit f c :append true)

11:52 i already have a function called spit, now i only need to handle the case ":append true"

11:52 bbloom: mrhanky: i just showed you ^^

11:52 mrhanky: oh :D

12:18 xnil: ,'test

12:18 clojurebot: test

12:27 xnil: is clojurebot open-source?

12:33 xeqi: xnil: https://github.com/hiredman/clojurebot

12:58 danneu: If I wanted to remove a uniqueness constraint in Datomic, would I just retract the db/unique

13:07 gtrak: tpope: I had to include cljs.core in every ns for it work, does that answer your question?

13:07 tpope: I'm not sure if I pushed that into cljs-complete yet.

13:08 xnil: xeqi: thank you very much.

13:46 effy: hi, is there a up to date reference post somewhere about which plugin to use (and how) in emacs for clojure?

13:48 kzar: effy: You want to use nrepl and cider probably https://github.com/clojure-emacs/cider

13:49 The readme there is pretty damn good and links to tutorials so maybe give that a read?

13:50 scape: anyone using korma?

13:50 I 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:51 as in: (:token(first(:device(first(select player (with device ...

13:52 effy: kzar: thanks, i am :)

14:03 kzar: cider seems effectively pretty damn complete

14:03 kzar: effy: 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:03 much nicer having proper tools :)

14:04 effy: i was expecting to be redirected to slim with some kind of tweaks to make it less cl and more clj

14:06 kzar: effy: Also if you've not seen it before Light Table is looking really promising although IMHO not a replacement for emacs yet

14:07 koreth_: 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:07 effy: kzar: i'm not willing to switch my text editor

14:08 kzar: koreth_: 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:09 koreth_: 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:09 I actually struggled to find the file at all until I typed most of the path in

14:09 but I'm sure stuff like that will be sorted out as it develops

14:10 dnolen: koreth_: LT is programmed in LT, so I think it can handle big projects OK

14:10 koreth_: Yeah, it's still changing fast.

14:10 kzar: My guess is that it will supersede emacs at some point

14:10 so I want to be ready I guess, + it's cool to play with

14:10 koreth_: 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:11 dnolen: koreth_: Clojure(Script) projects don't get big in the same way.

14:12 koreth_: 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:12 locks: I’m with dnolen in that there’s a fundamental reason for that

14:12 bbloom: koreth_: i think it's wrong to assume the problems are any different

14:12 kzar: dnolen: to be fair though if Light Table needs to support Java etc projects if it is to replace emacs

14:12 dnolen: koreth_: people have been using Clojure for 6 years now on big production projects

14:12 kzar: arg I accidentally a word there, you know what I mean hopefully

14:12 dnolen: koreth_: most big projects are 50-75K. I've only heard of one around 150K.

14:14 koreth_: 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:14 bbloom: dnolen: 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:14 dnolen: koreth_: I wouldn't be surprised if it was 1/2 that size.

14:14 Jii_: 10% of 10 million lines is still 1 million lines ;)

14:15 lvh: I wonder how well datomic would fare :)

14:15 dnolen: lvh: Datomic is also not very big from what I've heard.

14:17 locks: I wonder how much is class declaration boiletplate O:)

14:17 *how much of those projects

14:18 bbloom: locks: it's all getters and setters :-P

14:18 & i've never met a setter i like

14:18 lvh: dnolen: 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:18 bbloom: lvh: lol it wouldn't. at least not a single instance, that's for sure

14:19 lvh: Sure, I doubt a single instance of anything would :)

14:19 coventry: Wasn't there some bank in Ireland who claimed their clojure code base was hundreds of thousands of lines?

14:19 bbloom: i dunno why people brag about the (large) size of their code bases

14:19 i'd brag about how little there was :-P

14:20 ToBeReplaced: bbloom: yeah, exactly

14:20 bbloom: half the time too you get these huge systems that have lots and lots of hard coded business logic in a general purpose language

14:20 coventry: These guys, I think: https://github.com/AvisoNovate I think someone from there mentioned it here.

14:20 locks: bbloom: stockholm syndrome

14:20 bbloom: “see, it’s THIS big of a mess and it’s still working!!1!"

14:20 or maybe they think they’re bragging how little it is?

14:20 koreth_: 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:21 bbloom: i'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:21 most people just can't be trusted with a general purpose language :-P

14:21 especially not most programmers!

14:21 dnolen: koreth_: I think I can go out on limb and say Clojure was designed specifically to be anti-large codebase from the ground up.

14:22 koreth_: 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:22 I know one company that tried to migrate to Scala and it fell flat because their designers couldn't handle the complexity.

14:23 bbloom: koreth_: the scala compiler developers can't handle the complexity, what chance have mere mortals got?

14:23 lvh: koreth_: Why is Clojure so much better at making DSLs?

14:23 coventry: Get out of my head, bbloom

14:23 lvh: koreth_: I've made DSLs with Python. With a parser generator :)

14:23 bbloom: lvh: you don't have to (read: probably shouldn't) write a new grammar to get a new DSL

14:23 koreth_: 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:24 So your debugger and such can treat them as first-class language constructs.

14:24 bbloom: in 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:27 kzar: dnolen: 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:28 dnolen: kzar: an array yes, but you need to give each child a React key if you do.

14:28 kzar: I believe that will be done for you if you use varargs

14:28 kzar: React.DOM.div(null, x, y, z)

14:28 tpope: gtrak: yeah it did seem to be an issue related to that

14:29 kzar: dnolen: null being potentially the object with things like className?

14:29 dnolen: kzar: it's call props, but yes

14:29 s/call/called

14:30 kzar: OK ty

14:31 * kzar hates it in Javascript when the first argument to a function is an object and there are further non-object arguments because it's seemingly impossible to indent idiomatically

14:32 coventry: dnolen: 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:33 dnolen: coventry: it does error out

14:35 arrdem: 'mornin

14:40 coventry: dnolen: Ah, it comes after the reactjs error message. Thanks.

14:41 dnolen: coventry: yep

14:44 mathrick: hi, how do I make an empty sequence of the same type as the given one?

14:44 specifically, I'm looking at http://www.4clojure.com/problem/23

14:45 and cons makes it easy to extend the sequence element-wise, but I don't know how to seed it

14:45 bbloom: (doc empty)

14:45 clojurebot: "([coll]); Returns an empty collection of the same category as coll, or nil"

14:45 mathrick: oh

14:45 thanks

14:45 kzar: ,(conj () [1])

14:45 clojurebot: ([1])

14:46 kzar: hmm

14:46 ignore that ^^

14:46 edw: kzar: Were you thinking `concat`?

14:46 bbloom: mathrick: also worth grepping http://clojure.org/cheatsheet or using find-doc in your repl. try (doc find-doc)

14:46 kzar: edw: 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:47 edw: Ah.

14:47 mathrick: bbloom: I was using clojuredocs.org, but I missed empty taking an argument

14:47 edw: mathrick: There's also a helm-based Clojure cheat sheet in Emacs.

14:47 mathrick: helm is unfortunately horrible

14:48 bbloom: mathrick: 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:48 mathrick: one day I will find a better replacement, probably involving ido/icicles

14:48 bbloom: mathrick: should be sufficient for 4clojure-ing though

14:48 edw: mathrick: but I lose my double-sided 2-up paper copy of my cheat sheet from time to time.

14:49 mathrick: also, 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:49 edw: I was commenting only on helm, not on the validity of having docs inside emacs :)

14:50 locks: bbloom: why does clojuredocs seem to have “died out”?

14:50 edw: mathrick: No prob. Re: your Q: Yes, you'd use `atom` along with `deref` `reset!` etc.

14:50 bbloom: locks: no clue

14:51 other folks here may have more info, i dunno anything about it

14:51 locks: oh ok

14:51 it’s a shame, because the core docs are very terse

14:51 edw: mathrick: That is, if you want to transliterate from Scheme or CL.

14:51 kzar: Yea I end up using it a lot

14:51 coventry: dnolen: 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:52 mathrick: edw: what'd be the clojure way to do it? I was thinking about take-nth, which needs to keep track of "every nth"

14:52 edw: Hold on, I'll type something up...

14:52 ianeslick: mathrick - any state object would work, such as an Atom, Ref, or Var

14:53 kzar: mathrick: You can eval (source take-nth) to see how it works fyi

14:54 dnolen: coventry: open a issue please, it's a simple enhancement

14:55 coventry: Sure.

14:58 edw: mathrick: Check this counter source out: <https://www.refheap.com/24775>

14:58 mathrick: edw: thanks

14:59 edw: mathrick: That said, that's an idiomatic Clojure expression of an un-idomatic Clojure approach to solving the problem.

14:59 Aften you'd just want to use `range`.

14:59 mathrick: edw: yeah, I get that in the specific case of take-nth, you can just drop everything but nth item

14:59 edw: s/Aften/Often/

15:00 mathrick: ah

15:04 bbloom: edw: why are you using partial in that swap! call? swap! takes varargs

15:05 and + is (effectively) commutative

15:06 also, i think that's bugged under concurrent use....

15:06 two different readers could deref at the same time

15:06 if you start with (atom (- x step)) then you can use the return value of swap! directly without having to deref

15:11 coventry: I guess it shows the strength of the design that all my other Exceptions so far happened outside of an om/build.

15:11 kristof: bitemyapp: Yes, the Haxl stuff is VERY cool. Can you name any scenarios in your work where it would have been useful?

15:12 Structuring computation in such a manner

15:14 bitemyapp: kristof: well, yes, in analysis of clickstream data.

15:15 kristof: bitemyapp: Is that inherently asynchronous?

15:15 bitemyapp: kristof: something simpler than Hadoop but will parallel would've been really nice.

15:15 kristof: 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:16 kristof: bitemyapp: What language?

15:16 bitemyapp: I believe you use Clojure at work, don't you?

15:17 bitemyapp: kristof: I use Python and Clojure at work right now, even split.

15:17 kristof: at the *time* I'm thinking of, we were using Python and C++

15:17 kristof: bitemyapp: Well that's an easy way to get white hairs

15:17 bitemyapp: and *neither* were particularly nice for managing asynchronicity or parallelism.

15:17 kristof: python DOESN'T manager parallelism :P

15:18 bitemyapp: wasn't a happy time in my life.

15:18 kristof: *manage

15:18 bitemyapp: well, fork, but yeah.

15:18 Python is so slow parallelism can't save you anyway./

15:18 kristof: hahahahaha

15:18 * arrdem reaches for his Unix beard and rants about copy-on-write forking

15:18 kristof: bitemyapp: The problem with Python is that they actually just... wanted Lisp.

15:19 Or if syntax was a concern, then maybe they could have tried to resurrect Open Dylan

15:20 bitemyapp: 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:24 locks: kristof: good thing that open dylan is being ressurected then :}

15:24 kristof: mehhhhhhhhhhhhhhhh

15:25 bitemyapp: kristof: Lisp/Dylan isn't what *Guido* wanted, he's too fucking ignorant for that.

15:26 kristof: the slides were designed for a presentation, I'm afraid. But I hate that too.

15:26 edw: bbloom: Huh? What should I have used? Something like thi? #(+ step %) I don't think this is a big deal.

15:26 bbloom: (doc swap!)

15:27 ,(let [a (atom 0)] (swap! a + 5))

15:27 edw: I am familiar with swap!.

15:27 bbloom: &(let [a (atom 0)] (swap! a + 5))

15:27 clojurebot: eval service is offline

15:27 edw: Ah, duh.

15:27 bbloom: seriously? wtf?

15:27 both our bots are on vacation?

15:27 lame.

15:27 clojurebot: 5

15:27 bitemyapp: wtf

15:27 bbloom: *sigh* clojurebot you slacker

15:27 edw: And + takes &args too...

15:28 bbloom: &(let [a (atom {:foo 0})] (swap! a update-in [:foo] + 5))

15:28 edw: Sorry about that. Brain fart.

15:28 bbloom: ^^ gotta love that :-)

15:28 ,(let [a (atom {:foo 0})] (swap! a update-in [:foo] + 5))

15:28 clojurebot: {:foo 5}

15:28 bbloom: there we go bot

15:28 ivan: &{Float/NaN 1 Float/NaN 2}

15:29 amalloy: $mail lazybot plz wake up

15:30 RickInAtlanta: lazybot: orm

15:31 kristof: bitemyapp: 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:33 bbloom: kristof: frankly, i think both haskell & clojure fail miserably for the sort of thing the Haxl project is trying to do

15:33 kristof: bbloom: Haxl does a lot of things, which are you referring to?

15:34 bitemyapp: there's a lot of surface area and lot of Haskell seems to be shining through nicely, especially typeclasses.

15:34 bbloom: kristof: 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:34 kristof: 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:35 we have great general purpose programming languages, but our meta programming tools are, frankly, utter shit still

15:35 locks: hear hear.

15:35 kristof: I would not call Lisp's metaprogramming "shit", but I consider homoiconicity and metaprogramming to be a relatively unexplored realm.

15:35 bbloom: I think it's particularly unnatural to encode the dataflow in to a monad or applicative

15:35 kristof: oh, uh

15:35 well ok :P

15:36 bbloom: because those force pipelining in a way that is against the grain of the nature of the problem

15:36 kristof: But 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:36 bbloom: Incorrect. They allow pipelining in a situation where it was wanted but previously unattainable.

15:37 I'm sorry, I meant "you can do more to describe code than "lists with other lists in them"

15:37 bbloom: kristof: i disagree, but give me a moment to disagree intelligently

15:40 kristof: bbloom: go for it brother

15:41 Profpatsch: So I’ve got (defmacro foo [& args] (let [x (filter something args)] …))

15:41 bbloom: kristof: ok so i'm looking at slide 42 and 43 of 86

15:42 bitemyapp: I 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:42 Profpatsch: How do I make it so that args isn’t called?

15:42 How do I quote args? 'args doesn’t work in that context.

15:42 bbloom: kristof: 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:42 kristof: because applicative <*> is binary, some structure is lost and must be recovered

15:43 coventry: Profpatsch: Do you want to backquote the entire let, and unquote args? It's not completely clear what you want the macro to do.

15:43 bbloom: kristof: you want a variadic abstraction for parallelism

15:44 Profpatsch: coventry: 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:44 bitemyapp: In spite of that, there's a lot people need to learn from Haxl about structuring these kinds of problems.

15:44 bbloom: kristof: 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:44 bitemyapp: seriously, compare with things like async/await, almost entirely unstructured and unprincipled way of doing asynchronous processing.

15:44 coventry: Profpatsch: You may not want to quote it at all,

15:44 in that case.

15:45 bbloom: kristof: lifting further masks the problem

15:45 kristof: bitemyapp: Well, it doesn't *enforce* structure, which is still bad but different than just being default unstructured.

15:45 bitemyapp: kristof: right.

15:45 coventry: It won't be evaluated in that (filter)

15:46 kristof: bbloom: Let me pull up the slides again so I can grok your criticisms in cotext

15:46 *context

15:46 bbloom: kristof: 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:46 :-(

15:47 Profpatsch: coventry: 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:48 bitemyapp: The 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:48 kristof: bbloom: 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:48 coventry: Profpatsch: Still not clear what you want foo to do.

15:48 bitemyapp: kristof: sounds more like a free monad to me.

15:48 kristof: And a monad that is also a comonad is... a Hopf Algebra!~

15:48 bitemyapp: kristof: from the perspective of a late-bound context/computation projected onto the structure after the fact.

15:49 there'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:49 kristof: bitemyapp: There is some nontrivial connection between free monads and Hopf algebras, I think

15:49 bbloom: kristof: my concern is irrespective of context

15:49 bitemyapp: the reason most other people don't do it? can't be arsed, don't get enough leverage, etc.

15:49 bbloom: kristof: think about what's happening internally w/ the applicative & monadic machinery

15:49 bitemyapp: but for people who want to decomplect code-data/structure from "interpretation" free monads are pretty sweet.

15:50 bbloom: kristof: monads are worse offenders than applicatives, since applicatives can create arbitrary tree shapes and monads can only make lists

15:50 kristof: 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:50 bitemyapp: well that's not true at all.

15:51 https://dl.dropbox.com/u/828035/Monads/monads.pdf

15:51 bbloom: bitemyapp: 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:51 bitemyapp: of course i can treat it like arbitrary state and make any shape, duh. that's not the point i'm making

15:51 bitemyapp: the grafting part is what interests me about trees in this case.

15:52 bbloom: they haxl ppl are trying to take normal looking applicative code & make it stay normal looking but do caching, distribution, parallelism, etc

15:52 Profpatsch: coventry: 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:52 bitemyapp: I don't doubt for instance that they're stressing the abstraction, but I still think it's very interesting and worth exploring further.

15:52 bbloom: i can encode an arbitrary interpreter in to a monad, of course

15:52 and can produce arbitrary data as a result

15:52 bitemyapp: And I haven't seen anything in any other language that is remotely as interesting.

15:52 bbloom: but i have to go through a linearization process first & hence lose structure

15:52 bitemyapp: for this particular subject.

15:52 Profpatsch: coventry: *returns a function (defn comp [x y foo bar & args] …)

15:53 coventry: So my marco starts with (defmacro component [name & props] …)

15:54 bitemyapp: hrm. tensor category products. I'm in the fucking weeds now.

15:54 Profpatsch: coventry: And I need to filter out the keywords and the list at the end (if it is there) from props.

15:54 bbloom: kristof: do you understand my point about the shape of monad or applicative? ie i have to encode my code in to cons cells

15:54 kristof: essentially :-P

15:55 KnightRiderTheme: AimHere, why do you hate me?

15:55 bitemyapp: fuck now I have to listen to the Knight Rider theme

15:56 bbloom: kristof: 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:56 kristof: bbloom: 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:57 * bitemyapp cringes at applicatives and monads in Clojure

15:57 bbloom: kristof: i think they did the right thing originally

15:57 bitemyapp: I probably like Fluokitten more than anybody else present, but still, yick.

15:57 coventry: Profpatsch: Yeah, maybe it doesn't. I still don't understand what your question is.

15:57 bbloom: kristof: they created a data structure... all they had to do was replace `foo bar` with `Foo Bar`

15:57 kristof: the shape stayed the same

15:58 Profpatsch: coventry: How do I use & args in a macro as a quoted list?

15:58 kristof: bbloom: I see.

15:58 bbloom: kristof: 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:58 kristof: 2) the haskell compiler fights you on that, b/c now you're doing type level computation instead of term level

15:58 Profpatsch: coventry: That is, something that doesn’t get evaluated at compilation time.

15:58 kristof: PyPy is a good example of how to make naive-interpreters fast :)

15:58 edw: Profpatsch: 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:58 bbloom: kristof: indeed

15:58 bitemyapp: well if you want nicer type-level computation there's always Agda and Idris :)

15:59 bbloom: bitemyapp: i don't want a distinction between type and term languages

15:59 i've made my position quite clear on that :-P

15:59 bitemyapp: or kinds. or sorts.

15:59 kristof: bbloom: 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:59 bbloom: kristof: i've studied the pypy stuff a bit. it's good shit

16:00 kristof: :)

16:00 bbloom: i'm also betting on abstract interpretation

16:00 kristof: Not sure what that is

16:00 links welcome

16:00 bitemyapp: kristof: you need a *wobbles hand* action next to that.

16:00 kristof: ?

16:00 coventry: Profpatsch: OK, I get it now: (defmacro a [& args] `'~args) (a foo bar baz)

16:00 bitemyapp: kristof: Python-as-fast-as-C#

16:00 bbloom: kristof: http://en.wikipedia.org/wiki/Abstract_interpretation is a reasonable intro. normal wikipedia caveats apply

16:01 bitemyapp: kristof: 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:01 kristof: dict all the thiiiiings

16:01 kristof: bitemyapp: they unbox the things that don't necessarily need to be dicts in the first place

16:01 bitemyapp: kristof: Python is much faster if you structure your data in terms of classes/objects and avoid getattr/setattr.

16:02 bbloom: kristof: 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:02 bitemyapp: kristof: yeah but you can't really unbox the dicts without static analysis, I'm pretty sure.

16:02 Profpatsch: edw: coventry: Simple: (defmacro foo [& args] args) (foo :a {:a 42})) should return (:a {:a 42}) but it returns 42.

16:02 bitemyapp: kristof: you're basically converting dicts into records.

16:02 I can think of easier ways to use get records.

16:02 kristof: bbloom: 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:02 coventry: Profpatsch: My example meets that criterion.

16:03 kristof: bitemyapp: PyPy is written in a statically analyzable subset of Python

16:03 Profpatsch: coventry: Thanks, works like a charm!

16:04 coventry: np

16:04 bbloom: kristof: 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:04 bitemyapp: kristof: I know, but that's no longer Python.

16:04 kristof: I'm not trying to be pedantic, just trying to speak to the realities of using JIT interpreters for languages like Python.

16:04 kristof: That's true, bitemyapp

16:05 bitemyapp: kristof: my point is that if you use a language with better defaults, better opportunities for static analysis arise.

16:05 Profpatsch: But 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:05 bitemyapp: but you gotta get off the teat of arbitrary buckets of key-value pairs first.

16:05 when 90%++ of the time you want a record.

16:05 bbloom: kristof: 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:06 bitemyapp: bbloom: blog posts are often nice.

16:06 kristof: bbloom: You should

16:06 bitemyapp: which reminds me, I need to fix my site.

16:07 kristof: bbloom: I'm just trying to sort some thoughts out at the moment.

16:07 bbloom: How do you have graph reduction in a language if you try to preserve structure, too?

16:09 bbloom: kristof: not sure i understand the question

16:10 kristof: bbloom: I'm just not smart enough to really grasp the future you see, forgive me :P

16:11 Profpatsch: coventry: Ooooooh, I think I get it. The unquote resolves the symbol to its value. I didn’t know it had that effect.

16:11 kristof: bbloom: Do you think youl

16:11 bbloom: *Do you think you'll explore some more of these ideas in something like asyncx?

16:11 bbloom: kristof: in asyncx, definitely not no :-P

16:11 kristof: ah, ok

16:12 coventry: Profpatsch: Yep, exactly.

16:12 bbloom: asyncx 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:12 but more generally, i'm exploring the boundary between dynamic and static :-)

16:12 Profpatsch: coventry: So, does ~ do that *and* unquote lists or are both one and the same thing?

16:12 kristof: bbloom: 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:13 Profpatsch: coventry: I’m not sure I’m grasping the pattern.

16:13 bitemyapp: kristof: I've pretty effectively avoided STM.

16:13 kristof: refs, anyway.

16:13 and even atoms were contingent, but not necessary, in what I was doing.

16:13 agents/Executors were closer to necessary/critical.

16:13 kristof: bitemyapp: 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:13 bitemyapp: core.async lets you ditch a lot of stuff

16:14 kristof: I like STM, I just don't use it nearly as much as I thought I would.

16:14 bbloom: kristof: since discovering clojure, my approach to concurrency has always been full linearization of async writes with completely uncoordinated reads. STM not required :-P

16:14 bitemyapp: ^^ that is basically what I do.

16:14 that and I use promises at the API layer.

16:14 kristof: bbloom: So you basically sprinkle agents everywhere and purposefully decouple computations.

16:14 bbloom: kristof: turns out that scales much further than i've needed for a greenfield project

16:14 kristof: bbloom: Sounds very erlang-esque

16:14 bitemyapp: kristof: s'what I do.

16:14 bbloom: kristof: nope

16:14 Profpatsch: coventry: Ugh, I’m so stupid. I’ve used this all along, but somehow this slightly more complicated example brought me off-tracks.

16:15 bitemyapp: kristof: core.async for some stuff, agents for others.

16:15 bbloom: kristof: i use at most one agent

16:15 kristof: bitemyapp: Had a lengthy discussion in #haskell about how actors are just shared mutable state and don't compose

16:15 bbloom: kristof: my clojure programs tend to look like either 1 agent or (more commonly) 1 atom, everything else immutable

16:15 bitemyapp: I don't think I've needed more than one agent per coarse-grained side-effecty "noun"

16:15 kristof: bitemyapp: but Clojure doesn't actually have actors, because agents aren't quite the same thing

16:16 bitemyapp: kristof: Right. I just use it linearize operations against a sink of side effects.

16:16 kristof: bbloom: Even in very large applications? You never find yourself needing to coordinate some shared state?

16:16 bitemyapp: Wait, how do you linearize computations with asynchronous agents?

16:16 bitemyapp: kristof: in large applications, STM keels over.

16:16 bbloom: kristof: what's a "very large application"?

16:16 kristof: bbloom: I'm using large to mean "touches a lot of components"

16:16 bitemyapp: kristof: seriously, you can write a script in Clojure to hammer a ref. Try it.

16:16 bbloom: kristof: in anything really big, i generally rely on external shared state: ie a database

16:17 bitemyapp: kristof: again, ditto.

16:17 but Erlang is typically used for things where you want all the pertinent state in memory.

16:17 like multiplayer game servers.

16:17 kristof: I'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:17 bbloom: kristof: no need to apologize

16:17 bitemyapp: kristof: awareness generally keeps the D-K away.

16:18 kristof: bbloom: Then you really are using STM, just a better designed one that you don't explicitly program

16:18 bbloom: except that software is just going to be SQL/NoSQL or something

16:19 bbloom: kristof: i guess you can see it that way. *shrug*

16:19 danno1: Simple Q: Should I be able to call (doc <methodname>) in a .clj file, or does it only run in the REPL?

16:19 kristof: bbloom: 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:19 bitemyapp: kristof: no no

16:19 kristof: at truly large scale you AVOID transactions that are responsible for more data than strictly necessary at all costs

16:19 kristof: you scale through independence, not through a clever transaction algorithm.

16:20 kristof: part of the reason for tackling and thinking hard about sharding is figuring out where your "independence" shard-points lie

16:20 kristof: bitemyapp: What's your job title and what do you typically work with? It sounds like you specialize in web applications and distributed computing.

16:20 bitemyapp: I'm a backend monkey yo. I haven't done anything truly distributed since that CV company.

16:20 kristof: currently I work with Datomic and API servers.

16:21 kristof: I see.

16:21 bitemyapp: but using Datomic doesn't really change the story from SQL servers. You scale them the same way, independence.

16:21 kristof: Ok.

16:21 bitemyapp: figure out where you can draw a line in the sand and accept that "whole comprehensions" of database are not going to happen

16:21 if you want such a thing, you're talking OLAP, not OLTP, and you're funneling your data into a different sort of store.

16:22 which reminds me, I should think about making a river-middleware for Datomic.

16:22 but anyway, the work I do right now is relatively simple with respect to scale.

16:23 The ugliness comes from hooman problems and data modelling.

16:23 kristof: bitemyapp: Ah, I see.

16:24 bitemyapp: Not sure what river-middleware is.

16:24 bitemyapp: kristof: piping and repeating transactions from Datomic into other data sinks like ElasticSearch and Hadoop.

16:24 "any entity with :attr, convert to JSON and post to ElasticSearch for search indexing"

16:25 kristof: 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:25 two very different workloads.

16:26 kristof: bitemyapp: So OLTP is for touching little things at a time (getting and setting) while OLAP is for business logic

16:26 bitemyapp: kristof: OLAP is business intelligence, OLTP is the "store" of the result of some sort of business logic.

16:26 kristof: Ok

16:27 bitemyapp: kristof: the problem is figuring out how to balance OLTP data store simplicity with atomically safe transactions that can do meaningful "things"

16:27 koreth_: Example: Withdrawing cash from your bank account at an ATM is OLTP. Generating your monthly bank account statement is OLAP.

16:27 bitemyapp: koreth_: sorta, that's not how banks actually handle that though. Good example.

16:28 koreth_: Yeah, just going for an analogy there.

16:28 kristof: Ok, I understand

16:28 bitemyapp: kristof: closer to OLAP would actually be, "generating average balance of all customers for a given region"

16:28 kristof: bitemyapp: 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:29 bitemyapp: kristof: 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:29 kristof: generally you have some sort of data source of first resort.

16:29 kristof: ok

16:29 bitemyapp: kristof: the safest thing is logs and reconciliation, which is what banks do.

16:29 those logs get rolled into whatever data stores you want.

16:29 kristof: bitemyapp: Rich Hickey talked a lot about logs being second class to immutable data structures

16:30 bitemyapp: eh.

16:30 kristof: Disagree?

16:30 bitemyapp: it's highly dependent on context.

16:30 kristof: As is everything, I guess.

16:30 bitemyapp: the fundamental data structure you want to think about at scale when reliability is paramount is a log.

16:30 you 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:31 bbloom: traditionally, yes, but i think that persistent data structures and atomic root cells are woefully underexplored

16:31 kristof: Well, if I listen to anymore I might not retain the stuff from earlier :(

16:31 bitemyapp: the state is a convenience and an optimization, not the real truth.

16:31 bbloom: bitemyapp: i disagree with that entirely

16:31 bitemyapp: bbloom: agreed

16:31 that was poorly timed.

16:31 you get my meaning.

16:31 bbloom: the log is just that: a log

16:31 bitemyapp: well in some sense, the log is the state that takes precedence.

16:31 bbloom: not really, no. you get to pick

16:32 bitemyapp: that's a decision to be made

16:32 I'm talking about a relatively simple model for log reconciliation.

16:32 if you have new "events" hitting a stateful data store, nothing is stopping you from merging-without-loss with the logs too.

16:32 amontalenti: This 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:33 bbloom: disagree with that too :-P

16:33 bitemyapp: regardless, none of it works without really understanding your data.

16:34 coventry: amontalenti: 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:35 arrdem: bitemyapp: what would you consider a normal insertion rate for your Rethink driver?

16:35 amontalenti: coventry, thanks -- I'm checking the relevant docs now to understand. Appreciat eit.

16:35 arrdem: 20-30 writes/sec?

16:35 amontalenti: *appreciate it.

16:35 bitemyapp: arrdem: per client? seems reasonable.

16:36 arrdem: there's a RethinkDB connection pooling daemon if you want it.

16:37 arrdem: bitemyapp: 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:37 Profpatsch: Is 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:38 bitemyapp: arrdem: the agents are inspectable.

16:38 arrdem: start logging promise mapping count to disk.

16:39 arrdem: it's entirely possible for empty promises to accumulate, or for fulfilled promises to not get graveyarded or something.

16:39 I hope that's not what's happening, just coming up with possibilities.

16:39 arrdem: bitemyapp: yeah I have no idea.. I'm just sitting here watching the JVM leak memory somehow.

16:40 bitemyapp: arrdem: add logging and make your data loading process idempotent and incremental.

16:40 arrdem: save ya time.

16:40 amontalenti: coventry, 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:41 arrdem: bitemyapp: technically it already is... I just happen to be running it as a monolithic scrape and insert run.

16:41 bitemyapp: arrdem: 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:42 coventry: amontalenti: Yes, make it eager, or keep the file open.

16:43 Profpatsch: name is being overwritten by the arg name. Use clojure.core/name, or change the arg name.

16:43 amontalenti: coventry, got it, thanks!

16:43 bitemyapp: had dim-sum for brunch today. Still feel like a roly-poly fat ass 3 hours later.

16:43 Profpatsch: coventry: UGH, I hate it when that happens. What a drag.

16:47 coventry: It's just the duck-typing tax which pays for your handy keyword lookups. :-)

16:48 Profpatsch: I guess. But thanks again.

16:49 arrdem: bitemyapp: hum... ok. I'll bug you about my architecture here later. Trying to dig into LLVM while this runs...

16:58 bitemyapp: 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:07 bitemyapp: oh so it is checkpointed, hoog.

17:07 good*

17:07 arrdem: but can you log the agent state to check for a possible source of garbage for me?

17:08 arrdem: bitemyapp: lemme try an experiment with multiple connections first...

17:09 bitemyapp: well that would be a good place to start, yes.

17:09 arrdem: bitemyapp: well one bottlekneck was that I was sharing one db conn between all the worker threads.. I'm seeing 120+ writes/sec now

17:10 bitemyapp: arrdem: ಠ_ಠ

17:11 arrdem: bitemyapp: your utf-8 killed my emacs..

17:12 bitemyapp: and your disapproval is well justified here.

17:12 marcopolo`: anyone use tools.cli?

17:12 arrdem: marcopolo`: I have... it works ok.

17:12 marcopolo`: I'm trying to figure out how to pass a list of arguments without parsing that list myself

17:12 as in --keywords foo bar baz

17:12 or anything similar

17:12 bitemyapp: arrdem: hahahahaha

17:13 now I have a killswitch for your erc

17:13 arrdem: bitemyapp: 300+ writes/second... burn baby burn...

17:13 bitemyapp: that is fantatic.

17:13 fantastic*

17:13 arrdem: bitemyapp: you didn't kill it... my Arch fonts are just screwed again so it didn't render correctly.

17:13 bitemyapp: arrdem: you can batch writes too

17:14 arrdem: bulk inserts might save you an fsync or two :)

17:18 arrdem: bitemyapp: yeah I'll see about getting some logging out of the conns... looks like I'm still leaking at some leve.

17:19 Notte: Hello, 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:20 bitemyapp: Notte: learn to use Leiningen.

17:20 arrdem: Notte: link?

17:20 Notte: arrdem: http://java.ociweb.com/mark/clojure/article.html

17:20 Vars section

17:21 bitemyapp: this material isn't quite right.

17:22 for one thing, he uses "global" to mean at least three different things

17:22 arrdem: Notte: did you do all this? http://java.ociweb.com/mark/clojure/article.html#Getting%20Started

17:23 Notte: yeah there totally isn't mention of whatever he uses for "$ clj $FILE"

17:23 Notte: what platform are you on?

17:24 Notte: arrdem: 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:24 bitemyapp: Notte: you can just use `lein repl` and load the file.

17:25 arrdem: Notte: so if you set up a leiningen project, you can do what bitemyapp just said.

17:25 bitemyapp: Notte: you should just learn to use Leiningen and live in the REPL though.

17:25 don't even necessarily need a project, you can drop a REPL and use load-file anywhere.

17:25 arrdem: Notte: `lein new scratch; cp scratch.clj scratch/src/; cd scratch; lein repl;`

17:25 bitemyapp: just a terrible idea is all.

17:25 a scratch project is better.

17:26 arrdem: HAHAHAHA 500 WRITES/SEC.

17:26 coventry: Notte: This is good, and a bit more modern: http://aphyr.com/posts/301-clojure-from-the-ground-up-welcome

17:26 bitemyapp: you are...really excited about this.

17:26 arrdem: what'd you change to achieve that?

17:26 Notte: Ok,thank you all.

17:27 arrdem: bitemyapp: nothing. the 500 is just a huge peak on the same one conn per worker run I kicked off earlier.

17:28 $seen http

17:28 lazybot: I have never seen http.

17:28 arrdem: hum... I have a bug then.

17:28 bitemyapp: arrdem: how so?

17:28 arrdem: what's the state of the agents?

17:29 arrdem: bitemyapp: 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:29 bitemyapp: 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:30 bitemyapp: 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:31 bitemyapp: arrdem: I'm going to assume in the intervening time that none of this is my default.

17:31 my fault*

17:31 arrdem: bitemyapp: probably a safe assumption.

17:32 bitemyapp: arrdem: http://forums.frontier.co.uk/showthread.php?t=7892

17:32 arrdem: bitemyapp: yep this behavior is a bug and totally my fault.

17:40 Notte: What can i read to learn clojure? Suggestions?

17:40 SparkySparkyBoom: Notte, this really helped when i first started. http://adambard.com/blog/clojure-in-15-minutes/

17:42 Notte: SparkySparkyBoom: ok, thanks.

17:43 marcopolo`: Notte: Check out light table

17:43 I think it makes learning clojure a lot easier because it takes care of the boring stuff like setting up a repl connection

17:44 Notte: marcopolo`: yeah, i know it. It's great, although it lacks of many features for now.

17:45 marcopolo`: like what?

17:45 Notte: multiple cursors

17:45 for instance

17:45 marcopolo`: yeah that is kind of annoying

17:46 Notte: once you get used to it, it's difficult to write without it :)

17:46 annoying, i mean

17:47 But i'll definitely use it one day, has great concepts

17:49 Just out of curiosity, do we have a repl in this channel?

17:49 arrdem: bitemyapp: 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:49 pdk: % (print "maybe")

17:49 damn it

17:50 , (print "maybe")

17:50 Notte: lol

17:50 clojurebot: maybe

17:50 marcopolo`: lol

17:50 bitemyapp: arrdem: as my desktop sits idle while I code on my dinkpad.

17:50 Notte: >> 'lol

17:50 arrdem: bitemyapp: is that something like a crackbook?

17:51 bitemyapp: arrdem: meant it in the sense of it being dinky, but really that's being unfair, it's a T430 and pretty decent.

17:51 just wish Lenovo would use higher quality displays.

17:52 the matte display is so matte it's downright cloudy.

17:54 SparkySparkyBoom: > (println "maybe")

17:54 :|

17:58 arrdem: bitemyapp: I love that this microjump/chainjump system includes stellar drift of targets and varied orbit speeds on a per-body basis

17:58 bitemyapp: arrdem: it's quite interesting.

18:00 shriphani: sorry 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:00 bitemyapp: shriphani: Ring/Compojure, but it's not a framework.

18:01 shriphani: you just use the bits and pieces you care about.

18:01 arrdem: shriphani: stay away from anything using Noir and you should be fine. lib-noir is ok.

18:01 bitemyapp: shriphani: http://www.luminusweb.net/

18:01 shriphani: any opinions on pedestal ?

18:01 danneu: shriphani: use Compojure and assemble it a la carte

18:01 shriphani: there's a 34 sections long tutorial

18:02 danneu: impression i get is that pedestal appears to be aiming for interactive js apps

18:02 shriphani: o.

18:02 danneu: im running a forum with just compojure

18:02 shriphani: ok compojure it is

18:02 marcopolo`: pedestal is amazing, but it's designed for big client side apps

18:03 shriphani: yea this is not big. There is currently just 1 user - me.

18:03 and it will stay that way for a while

18:03 marcopolo`: compojure should be just what you want

18:05 bitemyapp: arrdem: discovered those links today, the micro-jump/plotted-jump is strikingly similar to what I had in mind.

18:06 arrdem: 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:06 danneu: i 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:06 bitemyapp: danneu: https://github.com/bitemyapp/trajectile/ ?

18:07 danneu: bitemyapp: thanks, i'll check it out

18:07 arrdem: bitemyapp: the gravity well mechanic is absolutely critical IMHO.

18:07 bitemyapp: one thing which could be interesting is the interaction of a gravity well and the signature of a jumping ship...

18:08 bitemyapp: if deliberately diving a gravity well at supercruise allowed you to hide your de-jump signature...

18:09 bitemyapp: 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:09 danneu: i run a compojure app behind nginx. this is my basic config: https://gist.github.com/danneu/8498070

18:10 Does anyone more experienced know how i can throw up an error page if @MYCLOJUREAPP doesnt respond?

18:10 or perhaps a better way of hosting an app behind nginx

18:10 bitemyapp: danneu: middleware

18:11 danneu: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/middleware.clj#L9-L22

18:12 arrdem: danneu: you can add a 504.html that will get served on a timeout...

18:12 bitemyapp: ohhh

18:12 you mean an actual 504

18:12 cark: bitemyapp: what's this space stuff you're talking about ?

18:12 bitemyapp: rather than "doesn't respond" in the abstract.

18:12 danneu: arrdem: i get a 502 gateway when @MYCLOJUREAPP is down

18:12 arrdem: danneu: there is support for 50X.html

18:12 danneu: yeah, thanks

18:13 arrdem: danneu: http://help.cloud66.com/web-server/custom-500-page.html

18:13 danneu: bitemyapp: 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:14 arrdem: danneu: there are worse problems to have...

18:14 danneu: finally, is there any reason why 'lein ring server' in development mode is a bad idea if the stacktraces are turned into 500 errors?

18:14 bitemyapp: it's a pretty bad idea.

18:14 danneu: that's how i'm doing it so i can rapidly deploy

18:14 bitemyapp: the readme just says that it "watches filesystem to reload changes"

18:15 * bitemyapp gags

18:15 mrhanky: how do i replace a " with \" in a string?

18:15 arrdem: danneu: 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:15 bitemyapp: cark: uh, there does not currently exist a space game that fits what I want.

18:16 arrdem: I should have a template git repo for doing exaclty that...

18:16 bitemyapp: cark: there was going to be one, but it died because the developer is flakier than a biscuit.

18:16 cark: bitemyapp: ah ok =(

18:16 bitemyapp: cark: so I'm watching the development of a couple of promising space games while thinking about what I believe would be fun.

18:16 cark: mostly following Elite Dangerous and Star Citizen, the former seems more mature right now.

18:16 danneu: arrdem: what's the preferred incantation for serving a lein-ring app in production? (without compiling uberjar)

18:16 bitemyapp: E:D should have multiplayer by the end of this month.

18:16 danneu: use uberjar.

18:17 arrdem: danneu: you really do want to do uberjar

18:17 cark: bitemyapp: i'm worried they might ruin the elite franchise...

18:17 arrdem: danneu: the setup I used to use was that my post-recieve would uberjar and then java -jar $UBERJAR

18:17 bitemyapp: cark: an otherwise dead franchise cannot be ruined.

18:17 danneu: alright. i'll stop `lein ring server` and insteaed rsync up code and compile uberjar remotely

18:17 cark: tru enough

18:17 arrdem: danneu: you certainly don't want to be running lein in uberjar

18:17 sorry. in production.

18:17 bitemyapp: cark: I'm happy for anything they come up with and the development seems very promising. Thoughtful.

18:18 danneu: arrdem: doesnt `trampoline` get around that?

18:18 arrdem: danneu: maybe. I've never used it.

18:18 bitemyapp: danneu: use uberjar.

18:18 cark: bitemyapp: the PR is thoughtfull, let's wait and see for the rest

18:18 bitemyapp: trampoline gets around some memory usage issues, it doesn't make using lein in product not a bad idea.

18:19 danneu: bitemyapp: why is lein in production a bad idea in general?

18:19 bitemyapp: chooses bad defaults, not the right way at all to do deploys.

18:19 Deploys should be of archived and tagged build artifacts.

18:19 not freakin' code rsync.

18:20 using lein ring server is like FTP'ing PHP code into production.

18:20 you deserve what you get, at that point.

18:20 * arrdem has to agree

18:21 danneu: sounds like i need to hang up my chaps

18:21 and my cowboy hat

18:21 bitemyapp: danneu: you're a francophone aren't you?

18:21 arrdem: danneu: 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:21 bitemyapp: danneu: if so, you get a free pass for being weird.

18:21 Profpatsch: Okey, maybe I’m dumb, but: Howto new Map from seq of key-value pairs?

18:21 arrdem: Profpatsch: (into {} pair-seq) I think.

18:21 bitemyapp: ,(into {} [["blah" "die"] [:untyped :langs] [:suck :fruit/wax]])

18:21 clojurebot: {"blah" "die", :untyped :langs, :suck :fruit/wax}

18:22 danneu: alright, thanks guys. i'll make some payments on my technical debt.

18:22 * arrdem laughs

18:22 bitemyapp: arrdem: http://i.imgur.com/dqwujIX.jpg

18:22 arrdem: danneu: you recognize that you have technical debt, and that's step one :D

18:22 Profpatsch: Oh, right, I should have looked at the generic ops section. ;)

18:22 Thanks!

18:23 danneu: arrdem: i sure feel silly now at my first development job when i complained about the nasty code, that's for sure

18:24 arrdem: danneu: hey man. relax. we all have to learn what good practice looks like at some point. I'm still learning...

18:24 bitemyapp: danneu: bad programmers are often worse at reading than writing code.

18:24 mrhanky: how do i escape " in a string with replace?

18:24 bitemyapp: danneu: and they usually develop more slowly at reading than writing because they spend more time writing than reading.

18:24 mrhanky: tried (replace string #"\"" "\\\"")

18:24 arrdem: $google java string escape

18:24 bitemyapp: danneu: one of my dream projects is writing a book on learning to read code other people ewrote.

18:24 lazybot: [Characters (The Java™ Tutorials > Learning the Java Language ...] http://docs.oracle.com/javase/tutorial/java/data/characters.html

18:24 `cbp: is anyone better at reading than writing

18:24 arrdem: mrhanky: ^

18:25 bitemyapp: `cbp: professors?

18:25 Profpatsch: Gosh, I LOVE clj so much. It’s like I’m smiling constantly while writing code.

18:25 bitemyapp: not many anyway.

18:26 `cbp: some dont know how to write at all :-D

18:26 arrdem: bitemyapp: yeah there's something weird going on with the garbage system here...

18:26 Profpatsch: The live response from the instarepl just heightens that feeling.

18:26 arrdem: bitemyapp: I've been sitting at a 550 write/sec hypercruise for the last half hour and I just dropped to 1/s

18:26 danneu: Profpatsch: 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:27 i hope my personal projects don't collapse

18:27 bitemyapp: arrdem: LAWGS

18:27 ~bitemyapp's |response| to everything is "logs plz"

18:27 clojurebot: You don't have to tell me twice.

18:27 bitemyapp: ~bitemyapp's

18:27 clojurebot: No entiendo

18:27 bitemyapp: ~bitemyapp

18:27 clojurebot: bitemyapp is it amuses me to mock other peoples' gods

18:27 bitemyapp: ~bitemyapp

18:27 clojurebot: bitemyapp is unfuck your stack with monads!

18:28 bitemyapp: LOL

18:28 okay.

18:28 I give up. I have no idea where the bot stashed that.

18:28 `cbp: ~bytemyapp

18:28 clojurebot: Pardon?

18:28 `cbp: oops

18:28 oh well

18:29 alew: bitemyapp: what would you write in this book?

18:29 bitemyapp: alew: they'd be a mixture of practical application and traits/patterns/methods.

18:29 alew: mostly just walkthroughs of extant non-trivial codebases in a variety of programming languages.

18:30 alew: I feel like reading the code base of a lib in clojure or c++ or java is so widely different

18:30 in terms of idioms used and such

18:31 bitemyapp: alew: that's why I planned to use a mixture of typed and untyped languages.

18:31 alew: one example technique I'd hammer in is source<-->sink identification and traversal.

18:31 most people do it subconsciously, but don't practice it.

18:32 alew: Yeah, I don't that is very explicit

18:32 it's especially relevant for web or ui programming

18:32 bitemyapp: I think you a word there.

18:33 alew: Wow, even reading back over it I automatically reinserted the word

18:33 bitemyapp: help me out?

18:33 alew: Yeah I don't think that is very explicit

18:33 bitemyapp: Right.

18:33 alew: especially in frameworks like Django/Ruby

18:33 that stuff gets nuts if you don't know the idioms.

18:34 borderline magical/pure DSL in nature

18:34 alew: Yeah, and shit like Swing

18:35 bitemyapp: arrdem: `cbp can I interest you gentlemen in doters?

18:35 I'm tired of fucking around with sourcemaps.

18:35 `cbp: you have a new Revise user btw.

18:36 `cbp: bitemyapp: I do? :P

18:36 bitemyapp: `cbp: arrdem.

18:36 `cbp: I have been really lazy with that since I have seen no issues posted

18:37 well lmk if you need help or new features

18:37 arrdem: bitemyapp: lemme finish this llvm shit and get some food.

18:37 bitemyapp: ETA one hour if I stop derping with cloutjure

18:37 `cbp: arrdem: ^

18:37 arrdem: `cbp: cheers

18:37 `cbp: i need to afk 30-40 for food

18:38 bitemyapp: arrdem: one hour sounds good.

18:44 ivan: aha, IDEA replaced -Didea.no.safe.write=true with a 'Use "safe write"' in Settings -> General

18:44 no wonder I was getting weird locking issues

18:47 rovar: so I hit a major milestone last night. Finally made it through the Dota2 training scenarios

18:52 arrdem: bitemyapp: 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:53 bitemyapp: arrdem: it's actually pure Clojure.

18:53 arrdem: unless you mean you're not using Revise.

18:53 arrdem: I have to leave though, catching second brunch with a buddy.

18:53 arrdem: bitemyapp: kk

18:53 bitemyapp: that's right, I'm having a second one.

18:55 arrdem: send me code if you want me to follow-up when I get back

18:55 arrdem: bitemyapp: kk.

19:02 danneu: My 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:08 koreth_: I'd guess it's compiling everything the first time.

19:11 danneu: koreth_: it's run from an uberjar

19:13 rovar: danneu: this is a job for liberally sprinkling log messages around

19:14 danneu: rovar: heh, right. thanks. my introspection kit is nonexistent

19:32 logic_prog: in C, we have macros that return __FILENAME__ and __LINE_NUMBER__

19:32 in clojure, do we have anything like this?

19:32 I want to hav ethe FILENAME / LINE_NUMBER of where hte macro _expands_

19:32 not where the macro is defined

19:33 arrdem: logic_prog: neg. there is some line metadata on some symbols.

19:33 danneu: Is there a max string size in Datomic's string datatype? google turned up nothing

19:33 arrdem: logic_prog: however this is all very ill-developed.

19:33 logic_prog: arrdem: are clojure macros not supposed to output errors about the file/line number

19:33 i.e. things like assert dumping where they failed

19:34 arrdem: logic_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:34 logic_prog: arrdem: can a macro look up and get the name of the lexical function it's being expanded in?

19:34 cark: i thjink there's an env variable

19:34 not quite sure, but that's something to google for i guess

19:34 arrdem: so there's *ns*, maybe a *env*, but no *fn* or *line*.

19:35 I don't know of a *file* either.

19:35 logic_prog: http://blog.jayfields.com/2011/02/clojure-and.html looks insuficient

19:35 there's &env and &form

19:35 but it's not clear to me how to pull the lexical function name from &env

19:37 cark: &form has metadata

19:37 Bronsa: arrdem: there's *file* actually

19:38 arrdem: Bronsa: hum. TIL.

19:39 Bronsa: and as cark said, you can get line/column info from the metadata on &form

19:43 gtrak: tpo

19:53 alew: is there a way to check if a value is the 'true' value?

19:54 as in the actual true literal, not a truthy value

19:54 Bronsa: arrdem: logic_prog http://sprunge.us/GagZ?clj

19:54 logic_prog: Bronsa: thanks!

19:55 arrdem: Bronsa: sweet!

19:56 alew: I think (= true value) works?

19:57 coventry: ,(true? true)

19:57 clojurebot: true

19:57 coventry: ,(true? 1)

19:57 clojurebot: false

19:58 arrdem: hum... anyone know of a better worker thread management system than this? na

19:58 https://github.com/seancron/work

19:58 this and technomancy's die-roboten both seem pretty dead (or just stable).

20:01 logic_prog: Bronsa: (defmacro fn-name [] (.thisName (.objx @clojure.lang.Compiler/METHOD))) (defn foo-magic [] (fn-name)) (foo-magic)

20:01 why does that return nil ?

20:01 Bronsa: because (defn foo []) expands to (def foo (fn [] ..)) not to (def foo (fn foo []))

20:02 logic_prog: there *might* be a way to get to the var name, let me check

20:02 logic_prog: Bronsa: ah, noted, thanks

20:04 alew: conventry: thanks

20:06 Bronsa: logic_prog: user=> ((fn foo [] (fn-name)))

20:06 "user$eval26$foo__27"

20:06 derp

20:06 logic_prog: http://sprunge.us/ZYFH

20:07 logic_prog: Bronsa: let me test this

20:08 Bronsa: awesome, thanks!

20:08 Bronsa: if I may, I have one more request --

20:08 Bronsa: I'm using cljx. Any chance we can make this work in cljs too? :-D

20:09 Bronsa: logic_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:09 logic_prog: Bronsa: Reasonable men use existing APIs. Unreasonable men use internals. Therefore, all progress depend on unreasonable men.

20:10 Bronsa: I have a dream -- that one day, code will be judged by what they do, and not what APIs they use.

20:10 Ask not what existing clojure APIs can do for you; ask what you can do to develop future clojure APIs

20:10 `cbp: stahp

20:12 arrdem: I like this guy. can we keep him?

20:14 logic_prog: cljs development is 1% clojure and 99% ^&(&*-javascript. -- Edison

20:17 alew: I think that was Lincoln

20:17 arrdem: $google edison quote invention is

20:17 lazybot: [Thomas A. Edison Quotes - BrainyQuote] http://www.brainyquote.com/quotes/authors/t/thomas_a_edison.html

20:17 quizdr: good morning fellas

20:19 logic_prog: in writing clojure code, I think a 100-line day is a good day

20:19 in wriitng clojure macros, a 10-line day is a good day

20:20 coventry: Added or removed?

20:20 alew: Most of your macro writing should be writing regular functions if they are anything complicated

20:21 logic_prog: coventry: added

20:21 alew: indeed, but it's still hard for me to debug/visualize

20:23 alew: I'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:54 grzm: anyone run into "ReferenceError: Can't find variable: require" when using clojurescript.test with cljs.nodejs ?

21:21 bitemyapp: arrdem: back

21:21 arrdem: bitemyapp: ohai

21:23 bitemyapp: so I'm reading Revise trying to chase down what's going on here

21:23 bitemyapp: 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:24 bitemyapp: in short, I think I've succeeded in overloading the Clojure threadpool :P

21:24 bitemyapp: arrdem: gg.

21:24 arrdem: still not my fault, got it.

21:25 arrdem: bitemyapp: lolz.

21:26 bitemyapp: yeah so I've managed to control the memory usage by not using run-async and using a manually controlled threadpool

21:27 bitemyapp: but I'm just gonna have to run this thing overnight 'cause its friggin slow.

21:28 bitemyapp: interdasting.

21:30 arrdem: I'm trying not to be tempted into a benchmarking rabbit-hole by this.

21:30 * arrdem snickers

21:30 arrdem: bitemyapp: yeah I kinda want to get a profiler set up and figure out what's going on here...

21:31 bitemyapp: arrdem: that's fine, I just bought the E:D alpha so I can do that instead until I go back to hacking :)

21:31 rovar: how can I eval a file I've loaded and have it execute all functions in the file?

21:31 it seems to eval the first def and then stops..

21:31 bitemyapp: arrdem: so are you just working with a fixed-size thread pool or what?

21:32 arrdem: you can use Executors with a specific thread pool impl I think.

21:32 arrdem: bitemyapp: the last version I had did some really janky stuff with futures to manually implement a size 8 threadpool

21:32 bitemyapp: I went and got a real Java threadpool imp'l and now it's working...

21:32 bitemyapp: arrdem: throughput?

21:33 arrdem: bitemyapp: 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:33 I am curious why I can't replicate that retarded 400/s throughput tho.

21:33 bitemyapp: arrdem: increase thread pool size?

21:34 rovar: how big are the documents? 30/sec seems very low for any database..

21:34 it's unlikely to be IO bound in any way that could be alleviated by more threads..

21:34 e.g. disk..

21:35 bitemyapp: rovar: I don't think it's bound by the database right now.

21:35 rovar: his thread pool is probably starving the client.

21:35 arrdem: bitemyapp: I can confirm that all DBs are essentially idling

21:36 bitemyapp: Right, as I would expect.

21:37 rovar: by all means then :)

21:38 arrdem: lemme see if I can tune out my VPN's overhead..

21:40 rovar: as an alternate to my eval question.. how can I use/require an arbitrary .clj file that isn't in my path?

21:41 arrdem: okay... using loopback rather than an encrypted channel to Warlock was good for an increase to 90/s

21:42 rovar: I have a thingy that generates test-data..

21:42 logic_prog: Those who would give up macros for ease of use deserve neither. -- Franklin

21:49 arrdem: well 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:54 bitemyapp: 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:54 bitemyapp: so an overwhelmed Clojure threadpool would totally have done the trick.

22:01 bitemyapp: arrdem: hum.

22:04 arrdem: bitemyapp: https://github.com/arrdem/cloutjure/blob/master/src/cloutjure/input/irc.clj

22:05 * arrdem wanders off in search of foodz

22:05 rovar: is there any way to evaluate a function as a key in a map?

22:05 i vaguely recall reading about this issue

22:06 that the function call is treated as a symbol

22:06 I juts don't remember what to do about it.

22:06 ivan: ,{(inc 1) "a"}

22:06 clojurebot: {2 "a"}

22:07 rovar: no worky

22:08 java.lang.IllegalArgumentException: Duplicate key: (tmp)

22:08 ivan: ,(hash-map (inc 1) "a")

22:08 clojurebot: {2 "a"}

22:08 rovar: in this case tmp is a lambda wrapper for tempid

22:08 * arrdem mutters darkly about people using non-word handles

22:09 rovar: hmm

22:10 ,{(inc 1) "a" (inc 1) "a"}

22:10 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (inc 1)>

22:11 rovar: , (hash-map (inc 1) "a" (inc 1) "b")

22:11 clojurebot: {2 "b"}

22:11 rovar: k

22:12 i'll switch to an a-list style vector

22:16 danneu: What 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:33 arrdem: danneu: https://groups.google.com/forum/#!topic/clojure/FIWygm8ub7Y

23:00 stirfoo: can someone with JOGL knowledge take a look here: http://pastebin.com/HWk4XGu3

23:00 trying to get glDrawElements to work

23:04 cark: i don't know about your example, but you really should not be using the opengl2 api

23:04 stirfoo: cark: yes, I'm stuck in the past, but I've never learned the *new* opengl way.

23:06 danneu: arrdem: my problem seems to be actually writing to a new file in resources

23:06 stirfoo: I'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:07 *and common lisp

23:09 cark: stirfoo: have you tied not disabling client state ?

23:09 tried*

23:10 stirfoo: cark, I think I did actually

23:10 I say an example that did the same

23:10 *saw

23:11 cark: is there no color information for each vertex ? you might be drawing black on black ?

23:12 stirfoo: cark, default color *should* be white. guess I could enable a color array

23:12 cark: anyways i know nothing of gl2 =P

23:12 stirfoo: just to see

23:12 cark: i shouldn't try to help

23:12 stirfoo: cark: I'll take any help I can get

23:12 I really should learn shaders one of these days

23:13 cark: they're not all that hard, just start simple like you do here

23:13 quizdr: does anyone know how to stop an infinite loop at the REPL without killing the REPL buffer?

23:15 danielszmulewicz: quizdr: try C-c c-b

23:16 quizdr: actually it looks like it locked up emacs entirely and I couldn't enter any key strokes at all

23:17 danneu: M-x nrepl-interrupt sometimes works

23:17 quizdr: i've noted these and will try them if it happens again

23:19 stirfoo: C-z, ps ax, kill -9 ####

23:19 cark: stirfoo: is make-direct-flat-buffer actually returning anything ?

23:19 stirfoo: last resort, but I've done that more than once

23:19 quizdr: thanks stirfoo

23:20 stirfoo: cark, yes I can (.get buf N) and it returns the correct value

23:21 cark: ahyes rewind returns the buffer

23:21 stirfoo: cark: 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:21 danneu: Is 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:21 when in an uberjar?

23:22 cark: stirfoo: why not create it directly with wrap ?

23:23 the floatbuffer

23:23 stirfoo: cark: a direct buffer is required

23:23 well, that's what the traceback told me

23:24 that's for glVertexPointer, it doesn't complain when using wrap with glDrawElements, although I've tried a direct Buffer there as well.

23:24 cark: stirfoo: so maybe the indices one must be direct too ?

23:24 stirfoo: still nothing renders

23:24 cark: kk

23:24 stirfoo: =)

23:27 cark: funny you would be doing opengl stuff, since a discussion here yesterday i've been playing with webgl and clojurescript =)

23:27 got a texture showing, and some "programmer art" too !

23:27 stirfoo: that sounds fun, I havent tried clojurescript out yet

23:29 cark: i was astonnished when discovering that IE11 actually works with opengl

23:29 with a minimal change about 10 characters long

23:31 stirfoo: ahaha, I haven't used internet exploder in a loooong time

23:31 cark: ahwell still the market leader, need to take it into account don't we

23:31 ggherdov: hello. 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:31 Maybe I can pick something from the java ecosystem to do something like that?

23:32 stirfoo: yep, if you want your code to run most everywhere

23:33 ggherdov: Basically I am askng of a headless js-capable browser I can use to test my clojure webapp

23:34 cark: ggherdov: maybe check this : https://github.com/cemerick/austin this project starts a repl inside phantom.js

23:34 quizdr: is defonce bascially like def except it won't reassign the var if it is already exists? kinda like defvar in common lisp?

23:34 ggherdov: cark: thanks

23:35 cark: about IE11, do you know that the javascript isIE() function evaluates "false" on it? I LOL-ed for a day whan saw that

23:36 cark: ggherdov: didn't know that =)

23:36 kristof: shouldn't that just check the user agent?

23:36 ggherdov: kristof: user agents are a jungle of nonsense, not reliable anymore basically

23:37 kristof: Come now, there are only so many, you can easily hardcode those cases in

23:37 ...If you can't rely on them, what's the point anymore? :P

23:37 ggherdov: cark: http://www.nczonline.net/blog/2013/07/02/internet-explorer-11-dont-call-me-ie/

23:42 ivan: if there's any Trident in it it's IE

23:42 ggherdov: kristof: http://webaim.org/blog/user-agent-string-history/

23:42 "... and the user agent string was a complete mess, and near useless, and everyone pretended to be everyone else, and confusion abounded."

23:43 :)

23:43 kristof: heh, that's what people are doing with Pipelight

23:43 "I'm on Windows, I swear!"

23:44 ggherdov: hehe

23:57 `cbp: how's the driver treating you arrdem

Logging service provided by n01se.net