#clojure logs

2013-12-06

00:00brainproxywith position on left vs. right the only indicator what's going on, since all the plumbing is in the macroexpanded code
00:37deadghostis there a clojure noobs channel?
00:37arrdemnope, you're in it.
00:38arrdemlibrary authors and first timers. it's a fun crew :D
00:38arrdembrainproxy: any chance you have some open project(s) in this style? I'm curious...
00:42kristofAH.
00:42kristofIt makes sense now.
00:43kristofI watched Tim's videos on core.async's innards. Clever stuff, albeit complicated
00:44kristofThe idea itself is not complicated; walk the code at compile time and splice the body of a go block into a state machine. The implementation of the state machine itself is certainly daunting
00:44kristofI liked his naming of the machine itself: a "virtual virtual machine".
00:45kristofBut yes, as I watched the second video, I kept shouting in my head "if only the JVM supported continuations!"
00:47kristofTo save execution contexts -- across threads, even! This calls for a good continuation (although I don't know if a continuation's behavior was ever really defined for mulithreaded environments; would anyone here know?)
00:49bbloom_kristof: there are multithreaded environments w/ continuations
00:49bbloom_kristof: continuations weren't really well understood theoretically until relatively recently... much after java came about
00:50kristofbbloom_: In your opinion, is it really necessary to have as much complexity as there is in core.async?
00:51amalloybbloom_: i'd be interested to read about that. what did we learn about continuations recently?
00:51bbloom_kristof: that's a loaded question :-P
00:51kristofamalloy: I have a nice paper saved on why undelimited continuations are bad, if you're interested.
00:51amalloynah, i've read that
00:52amalloyi mean, i think i have, anyway
00:52kristofcurses
00:52bbloom_amalloy: well delimited continuations weren't really even discussed until 1987, which i guess is still 8 years before java
00:52kristofamalloy: You probably have if it sounds familiar. I can't think of any other well known papers with a similar subject.
00:52kristofbbloom_: It is certainly a loaded question!
00:53bbloom_amalloy: the literature is pretty spread out, but http://okmij.org/ftp/continuations/ is probably a good place to start
00:53kristofOh, yeah, that was what I was going to link.
00:54bbloom_the "static" and "dynamic" variants of delimited continuations were all in the lituature, but not really studied with respect to each other cuntil the 2000s
00:54amalloythat's quite a treasure trove
00:54bbloom_amalloy: everything on oleg's site is gold
00:54kristofI concur
00:55bbloom_amalloy: but his papers are usually denser. it's always a good idea to look at the bibliography & check for the most cited items in there
00:55bbloom_almost impossible to understand oleg w/o reading at least 4 or 5 references first :-P
00:55bbloom_but then it's easy ;-)
00:55bbloom_amalloy: the relationship to monads wasn't fully understood until 2005
00:56bbloom_http://lambda-the-ultimate.org/node/4334
00:56bbloom_that paper is a bit later, but it's actually very approachable
00:57deadghosthttp://pastebin.com/YgWRqPnn
00:57deadghostwhat am I borking up
00:57bbloom_deadghost: you're trying to map over a url
00:57bbloom_character by character
00:58amalloyyeah, line 17 should probably end with html
00:58deadghostwhooops
00:58deadghostgood to have extra eyes
00:59bbloom_anyway, amalloy & kristof. i'd say that continuations weren't really understood well enough to justify their inclusion in a practical language until as late as 2005 to 2011
00:59kristofbbloom_: core.async is relatively new so that isn't an excuse
00:59kristofNo, that's unfair of me to say
00:59bbloom_kristof: no, it's not an excuse b/c it's not related at all
00:59bbloom_continuations are a dynamic construct
00:59bbloom_they operate on the evaluator over time
01:00bbloom_core.async's transform is, by nature of the host, a lexical construct
01:00bbloom_they operate on the evaluator over a region of code
01:01bbloom_that's the best you can do w/o either VM primitives (JVM doesn't have them) or a manual CPS transform (slow)
01:01kristofbbloom_: The transform, maybe, but at runtime, isn't there continuation-like behavior happening?
01:01bbloom_it's continuation-like, but it's much simpler than that
01:01bbloom_it's a finite state machine
01:01bbloom_continuations are non-finite machines
01:02kristofI've never done anything non-simple with continuations so I don't really understand the extent of their capabilities
01:02kristofI just saw all the execution-context-saving and made the connection, but perhaps it's unwarranted
01:02bbloom_i feel like i link to this at least twice a week: http://arxiv.org/abs/1203.1539
01:02kristofbbloom_: bookmarking
01:03bbloom_tim, who implemented core.async's backend, and i had lots of good chats about Eff & that paper in particular, which is very approachable
01:03bbloom_Eff shows what is really possible w/ delimited continuations as a language construct
01:03bbloom_without a meteoric rise in complexity
01:03kristofbbloom_: And undelimited continuations are a bad idea (according to Oleg), right?
01:04bbloom_kristof: it's not so much as they are a bad idea as they don't really exist
01:04kristofoh, that's a different thought
01:04bbloom_kristof: an undelimited continuation is delimited by the top of the stack :-P
01:04kristofWell, true
01:06kristofbbloom_: If the host supported the primitives necessary to implement efficient continuations, would core.async be written with those instead of having a whole virtual virtual machine?
01:06bbloom_kristof: but more direct to your question, yes oleg speaks out against undelimited control. call/cc in particular: http://okmij.org/ftp/continuations/against-callcc.html
01:07bbloom_kristof: it's possible, but most interesting hosts don't support them & half the point of core.async was to make js callback hell suck less
01:07bbloom_kristof: although js engines do perform a bit better with CPS transforms
01:07bbloom_there's a compromise approach, which is what Scala does
01:07bbloom_it's a "type-directed" CPS transform
01:08kristofany papers I can read about that?
01:08bbloom_actually, it's "effect" directed, since it constitutes a type system that is parallel to the type system
01:08bbloom_http://dl.acm.org/citation.cfm?id=1596596
01:09bbloom_i've spent a lot of time over the last 2 years studying language design & continuations took me particularly long to grok fully, but it ultimately made a lot of other things really click all at once, so these references are fresh in my mind :-)
01:09arrdembbloom_: keep dumping papers please, I look forward to tomorrow morning's logs
01:09kristofbbloom_: Grr, I have to purchase this. Oh well :
01:09kristof*:)
01:09bbloom_kristof: nah, i think that 1 is available somewhere
01:09arrdemkristof: if you ask nicely I'll rehost it for you :P
01:09bbloom_http://infoscience.epfl.ch/record/149136/files/icfp113-rompf.pdf
01:10bbloom_always ask scholar.google.com first
01:10kristofOh, beautiful, thanks :)
01:10kristofAcademic journals are the devil
01:10kristofprofiting off poor scholars
01:10arrdemyeah it's gonna suck when I graduate and don't have instant access to ACM/IEEE anymore.
01:11bitemyapphad a ton of fun at the clojure meetup todaty.
01:11bitemyappwish a bunch of you could've been there :)
01:11kristofbbloom_: So in your opinion, in a perfect world, would core.async be implemented the same way that it is now?
01:12bitemyappin a perfect world, you get a result before computing it.
01:12bbloom_kristof: why are you always looking for an easy answer?
01:12bbloom_kristof: and why are your questions so negative?
01:12kristofbbloom_: I'm not trying to be negative, actually
01:13kristofJust wondering if there are facets of the JVM that caused problems
01:13bbloom_kristof: in my opinion, the design of core.async is stellar given the constraints and the implementation is not in any way objectionable
01:13bitemyapphttps://github.com/ajalt/fuckitpy
01:13arrdembitemyapp: saw that. still evil. move on.
01:13kristofbbloom_: Oh no no no, I'm not saying that core.async is poorly implemented, I was just wondering if the host was an obstacle in any way to its implementation, that's all
01:13bbloom_kristof: i take that back. there is one objection i have. tbaldridge made some constant ALL-CAPS and there's no damn good reason to do that in clojure. i object to that shit :-P
01:14arrdemlol
01:14arrdemold habits die hard I guess. that or it's a way to trace macro expressions vs function expressions...
01:14bbloom_kristof: the host was an obstacle yes, of course. that's why the transform the way it is, is so clever
01:15bbloom_kristof: granted, that idea is unashamedly stollen from the C# folks
01:15kristofbbloom_: Their async isn't cps based, is it?
01:15bitemyappI gave a talk about brambling at the meetup today. There aren't as amany people using Datomic as I thought.
01:15bbloom_kristof: core.async is not cps, it is a state machine
01:15bbloom_kristof: C# async also is a state machine
01:15kristofbut go blocks are cps
01:15bbloom_kristof: finite state machines, to be specific
01:15bbloom_kristof: no, they are not
01:15kristofOh, I guess I am confused
01:16bbloom_c=continuation, p=passing
01:16bbloom_there is no passing of the continuation
01:16kristofAnd I mean cps as in communicating sequential processes
01:16bbloom_there is an integer that represents the current state
01:16arrdem'night all
01:16kristofa la Hoare
01:16bbloom_kristof: you're thinking of csp
01:16kristofOH, ha
01:16kristofStupid acronyms
01:17bbloom_no go re-read what i said now that you have the correct acronyms :-P
01:17bbloom_s/no/now
01:18bitemyappkristof: http://hueypetersen.com/posts/2013/08/02/the-state-machines-of-core-async/
01:18bbloom_k i'll stop dumping papers on ppl now
01:18bbloom_gnight
01:18kristofbbloom_: Goodnight! Thanks for the references and talk
01:19kristofbbloom_: I'm trying to grok CSP and goroutines right now so that I can possibly port some of that stuff to Common Lisp
01:19kristofso this is all very helpful
01:58deadghostlooking for a recommendation for a sql lib
01:58deadghostI'm partial towards postgresql if that makes any difference
02:01sm0keClassCastException java.lang.String cannot be cast to clojure.lang.Associative clojure.lang.RT.assoc (RT.java:702
02:01sm0kei am getting this error for some reason in a (assoc form)
02:02sm0kecouldnt figure out why, all the keys are keywords
02:04sm0keah i see ##(assoc "{}" :a 1)
02:04lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Associative
02:47ereddeadghost: i'm partial to korma http://sqlkorma.com/
02:47eredit sits on top of jdbc so anything that can do jdbc will work
02:48deadghostered, I was eyeballing that
02:49deadghostany project with a site up that has nice looking docs and code to see is a good sign
02:49eredbtw, http://www.clojure-toolbox.com/
02:50eredit has answers to a lot of "is there a library for ____"
02:50eredeven if sometimes it's a little out of date
02:50deadghostyeah I saw that
02:50deadghostbut "is there" is different from "is it good"
02:50eredwell i think it's good
02:51deadghostgood enough for me
03:26echo-areaHow do you read monad? /məuneid/ or /məunə/ or /mɒnəd/?
03:27echo-areaAnd what about monadic? /məu'neidik/?
03:31clgvecho-area: from merriam-webster.com \ˈmō-ˌnad\
03:34echo-areaclgv: Thanks
06:54Guest93107hi can anyone help with datomic and couchbase, cann't run transactor, what i should write in properties ? i have running couch on localhost:8091
06:55goracimy question )
06:58Apage43there's a couchbase sample config
06:59goracii edit this config and transactor is not connected
06:59goraciedited
06:59Apage43but the values you specifically probably care about are couchbase-host (localhost:8091), couchbase-bucket (the bucket name. If all you did is hit next a bunch of times there'll be one bucket named "default"), and couhbase-password (probably blank, this is the *bucket* password, *not* the password you use to log into the Couchbase UI. There's not one set by default.)
07:00goracii made a new bucket - desk
07:00Apage43alright, that'll be what you set couchbase-bucket to in the datomic config then
07:01goracithere is Access control for this bucket - so one option with 11211 and password second dedicated port - what to choose ?
07:03Apage43just set couchbase-host to localhost, don't actually put a port number on (other than 8091)
07:03Apage43the service on port 8091 will be used by the client to discover the bucket configuration
07:03Apage43but you'll want to set couchbase-password to whatever password you set for the bucket
07:03Apage43in the datomic config
07:06goracicouchbase-host=localhost:8091 couchbase-bucket=desk couchbase-password=1234
07:06goraciStarting datomic:couchbase://localhost:8091/desk/<DB-NAME>?password=1234 ...
07:06goraciCritical failure, cannot continue: Error starting transactor
07:06goracijava.lang.NullPointerException
07:07goraciat com.couchbase.client.CouchbaseConnectionFactory.getVBucketConfig(CouchbaseConnectionFactory.java:188)
07:08goraciwhy it's using DB-NAME i don't know
07:09Apage43try without the :8091
07:09goracithen Critical failure, cannot continue: Serve failed
07:09goraciHornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.]
07:10goraciconfig above - protocol=couchbase
07:10goracihost=localhost
07:10goraciport=8091
07:10Apage43oh
07:10Apage43no
07:11Apage43the "host" and "port" without couchbase- in front are the host and port that the transactor *listens* on
07:11Apage43you should change *that* port back to 4334
07:12goraciah this time it seems to be working
07:12Apage43alright!
07:13Apage43also the datomic:couchbase://... string that the transactor prints on startup is the connection URL you'll need to use in order to connect peers
07:13Apage43where <DB-NAME> should be replaced with whatever you want to name your datomic db (you can have more than one datomic db in a single couchbase bucket)
07:15goracicool need to write somewhere to not forget ))
07:16goraciwhere it should be replaced btw ? in properties ?
07:16goraciand how
07:16Apage43when you connect to a datomic db using the (connect) fn from the API
07:17Apage43it'll be something like (connect "datomic:couchbase://...")
07:17Apage43where <DB-NAME> was you'll put a name
07:18Apage43*also* the host= in the transactor properties needs to be the hostname that peers can use to connect to the transactor, as the connection string you give to the peer library tells the peer library how to find the *storage* (Couchbase), and will look up *in* the storage how to contact the transactor
07:18Apage43so if you run the peer on another machine you'll need to make sure to deal with that
07:19goraci(connect "datomic:couchbase://localhost/desk/mydbname?password=1234
07:19Apage43yep
07:19goracilike that
07:19goraciok
07:20goracidb as a value )
07:20Apage43you may have to (create-database) that same URI before that'll work
07:20goraciyea before connect , create-database should be
07:20goraci(create-database uri)
07:21Apage43mmhm
07:22goracibut then
07:22goraci(def db (d/db (d/connect uri))
07:22Apage43that'll grab the db yeah
07:22goracidon't know why (create-database) needed then
07:23Apage43(db) grabs the *current* value of the db out of a connection
07:23Apage43it doesn't create anything
07:23Apage43it returns a thing that is an immutable value. Think of it as being similar to derefing an atom
07:24goraciso you have to (create-database) before connection ?
07:25goracior you can skip
07:25Apage43the *first* time you connect you need to, after that you don't
07:26Apage43if you *do* though, it won't hurt. It just doesn't do anything if a database already exists
07:27goracihmm some hidden state )
07:30goraciwell thanks a lot will move to console to experiment with
07:31goraciwe making project with clojure and want to use datomic as db )
07:31Apage43cool. I'm going to nap now =P
07:32Apage43I happen to work at Couchbase, so if you have trouble with it specifically I can probably help
07:33goraciok so far it's simpler then postgres for me )
07:33goraciand web ui for admin tasks is cool
07:34goracican you share your email in private message btw ?
08:22OscarZim doing some 4clojure exercises.. why is my count function not working: (defn my-count [x] (fn self [y c] (if (next y) (self (next y) (inc c)) c)) x 0)
08:22OscarZim trying to do something like existing "count" function
08:23OscarZit always returns 0 :)
08:27deadghostOscarZ, I'm new to clojure
08:27deadghostand only used CL for a month
08:27jballancOscarZ: look at your parens
08:27llasram,((fn [x] :not :calling :anything 0) (range 10))
08:27clojurebot0
08:27deadghostor listen to them
08:28llasramOscarZ: ^^
08:28deadghostit looks like you made an anonymous function
08:28deadghostand never called it
08:28deadghostso it just returns the last value
08:28deadghostwhich is 0
08:29deadghostdoes clojure let you call an anonymous function without funcall?
08:31deadghosthttp://pastebin.com/rn3yebhU
08:31deadghostI'm getting nullpointer exception
08:31deadghostand I don't know why
08:31OscarZah crap.. thanks guys
08:33wei__OscarZ: also, I think you're not taking into account the first element of the collection, so there's an off-by-one error
08:33OscarZwei__: you're right :)
08:34wei__,((defn my-count [x] ((fn self [y c] (if (next y) (self (next y) (inc c)) (if (first y) (inc c) c))) x 0)) (range 3))
08:34clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
08:35Pupeno_wdeadghost: unless I'm not understanding your question, yes: ((fn [x] (+ x x)) 2)
08:35wei__probably not the best solution, hope someone improves on it
08:35OscarZwei__: yeah i put (first x) as the if condition.. now it works
08:35jballancdeadghost: are you sure you're not getting an empty list back from html/select?
08:36jballanc,(first '())
08:36clojurebotnil
08:36jballanc,(clojure.string/replace (first '()) #"\n" "")
08:36clojurebot#<NullPointerException java.lang.NullPointerException>
08:36jballancthat would be my guess
08:38OscarZwhy is it that (boolean (rest ())) is true but (boolean (next ())) is false ? i remember running into this somewhere..
08:38jballanc,(rest '())
08:38clojurebot()
08:39jballanc(if '() (print "truthy") (print "falsey"))
08:39jballancwhoops...
08:39jballanc,(if '() (print "truthy") (print "falsey"))
08:39clojurebottruthy
08:39jballanc,(next '())
08:39clojurebotnil
08:39jballanc,(if nil (print "truthy") (print "falsey"))
08:39clojurebotfalsey
08:39jballancunlike other LISPs, in Clojure an empty list is truthy
08:42deadghostjballanc, spot on
08:42deadghostlooks like there was a missing addressing
08:43deadghostso it tried running str replace on nil
08:43deadghost*addresses
08:43deadghost*address
08:44jballancyeah, my experience is that while Clojure gets you away from some or most of the nil-checking that you have to do in Java, there are still cases where it'll catch you p
08:44jballancs/p/up/
08:44deadghostsee
08:44deadghostI don't know java
08:44deadghostat all
08:44deadghostthat's why I tried CL first
08:49deadghostwhoo
08:49deadghostgot it working
08:50deadghostactually, is it an inevitability I'll need to learn java eventually if I keep on clojure?
08:56brainproxyarrdem: working on one
08:56brainproxynot public on github yet
08:57bodie_Hi all. Can anyone help me figure out where I'm going wrong with Lein and Clojure on Fedora 20? Every Leiningen command results in 60+ ClassNotFoundException's.
08:57bodie_I installed Leiningen and Clojure via Yum.
08:58bodie_I have openjdk 1.7 if that helps. I seem to be seeing mostly missing Codehaus packages.
08:58bodie_(I'm also asking in #leiningen and #fedora fwiw.)
08:58bozhidarbodie_: You don't really need to install Clojure
08:59bodie_It's a dep via yum, so I'm not sure how to not install it.
08:59bozhidarbodie_: I'd suggest installing lein yourself using it's own installer
09:00bodie_On that note, on my Arch setup (where Lein doesn't list Clojure as a dep) it works just fine.
09:00bodie_OK, that was my next stop anyway. =) Thanks for the advice
09:00nDuffdeadghost: not necessarily Java-the-language. Java-the-platform, yes.
09:00deadghostgood to know
09:00deadghostone of my life's goals
09:00deadghostis to avoid java
09:00bodie_right?
09:00bruceadamsbodie_: i suggest not using yum for Clojure or lein.
09:01bodie_OK. Thanks bruceadams and bozhidar!
09:01bruceadamslein will grab Clojure and everything else as needed, including different versions of Clojure as needed
09:01arrdembrainproxy: cool!, also 'mornin
09:01bodie_By the way, can I get a gauge of whether people would be interested in a Clojure web stack one-click installer for DigitalOcean? I'm working on the images there and I could put something together according to a spec if anyone has a shopping list.
09:01bozhidarbodie_: Java apps are rarely packaged properly, so usually installing them *without* a package manager is the best idea.
09:02bodie_bruceadams, that's what I thought. You guys should contact the Fedora maintainer.
09:02bodie_I'm also asking in #leiningen.
09:02bodie_anyway, if there's interest please email bodie@digitalocean.com w/ requests :)
09:03bozhidarI recall that on fedora even packages like tomcat and jboss were unusable. Don't think they care that much about Java apps. Haven't used Fedora in a while, though. Maybe the situation has improved. After all Red Hat has a significant interest in Java...
09:04bodie_I hope so. It seems like a pretty good distro so far. My first time on an RPM dist.
09:05bodie_I'm using a few CentOS servers and I discovered RHEL has better support for certain virtualization-friendly tech such as LVM Thin.
09:06bozhidarbodie_: Fedora is a nice distro indeed. On of my favourite distros, together with Arch & Gentoo.
09:09bodie_Gentoo is way too cool for me. I require a distro that doesn't need me to take it out on dates and buy it shoes.
09:09bodie_HIGH-MAINTENANCE
09:10deadghostgnusense best distro
09:12goracidatomic.api not working with datomic-pro, how to use api with it,anyone ?
09:13bodie_deadghost: have you hurd the gnews?
09:13goraciFileNotFoundException Could not locate datomic/api__init.class
09:13deadghostI'm only kidding
09:13deadghostbest distro is a toss up between moebuntu and biebian
09:13goraci[com.datomic/datomic-pro "0.9.4324"] in project.clj
09:16deadghost"The original tutorial uses association lists. Clojure does not support association lists out-of-the box, instead, it comes with hash-maps which we use as a mapping data structure here. "
09:16deadghosthmm what
09:16bodie_moebuntu, moe problems
09:18mpenetbodie_: I am not sure it's really needed (web stack 1click install), leiningen would download all the necessary dependencies for our web app.
09:18mpenetbodie_: our we can just package it as a single jar and just depend on java
09:18bodie_:)
09:18bodie_Cool. I'm kinda new to the Clojure/Lein world, so all input is appreciated. Just want to consume all the learnings.
09:19bodie_I supposee you're right, but I'm thinking of something more like a simple set of packages for people to learn more about using Clojure as a webstack.
09:19bodie_But, I notice there's some difficulty surrounding distro-managed packages..... and I guess the deps all go into the project folder anyway
09:20mpenetnope, they go into ~/.m2
09:20bodie_OK
09:20mpenetthey are shared between apps on the same server
09:20bodie_Ah
09:20bodie_That would make sense.
09:20mpenetserver/user
09:21goraciso anyone using datomic here )&
09:21goraci?
09:25nDuffgoraci: there's a separate #datomic channel, so if (for some odd reason) you want to know how many datomic users are on IRC right now, it might be a better place to start than polling in #clojure.
09:25goraciok
09:29bodie_Looks like the Lein script worked out of the box on Fedora 20 beta. Thanks for the pointers all :)
09:48ambrosebsBronsa: congrats on your sponsorship!
10:10OscarZI'd like to apply some function n times but i want to yield the intermediate results instead of having just a single aggregate result.. something like (func + 0 4) would return (0 1 2 3)
10:11OscarZif you know what i mean .. maybe theres some function already for this?
10:12llasramOscarZ: `iterate` and `reductions` are probably your best bets
10:12OscarZsorry.. (func #(+ 1 %) 0 4) makes more sense
10:12llasram,(take 4 (iterate inc 0))
10:12clojurebot(0 1 2 3)
10:12OscarZthanks ill check that out
10:13llasram,(reductions + 0 (range 4))
10:13clojurebot(0 0 1 3 6)
10:14OscarZi actually looked at iterate but didnt realize it does what i want :)
10:44cYmenhm...
10:44cYmenhow do I get the position of the minimal element in a vector if I want to replace it?
10:45cYmenI could use min-key and range but what is idiomatic?
10:45`cbpidiomatic would be not to worry about the index at all perhaps? :P
10:46bbloom_cYmen: how big is your vector?
10:47cYmenbbloom_: tiny, I'm playing 4clojure
10:47bbloom_cYmen: oh, ok then. just do a loop w/ a counter :-)
10:48bbloom_which puzzle? i'm sure there is a much better solution than that tho
10:48cYmen`cbp: Should I just concat a take nth drop or what did you have in mind?
10:48justin_smith(defmacro as-keymap [& names] `(assoc {} ~@(mapcat (fn [name] [(keyword name) (symbol name)]) names))) <- this is going in my personal utility pile
10:48justin_smith
10:48cYmenbbloom_: I'll tell you when I'm done. ;)
10:48`cbpcYmen: I mean that working with sequences means thinking about values and the shape of things not about locations and how they mutate
10:48bbloom_cYmen: i won't ruin it for you, i'll give you a hint
10:49`cbpseq functions are not really meant for playing with indexes
10:49`cbpwhen you wanna do that just use a loop or whatever
10:49cYmenbbloom_: not yet ;)
10:54gfredericks2any thoughts on runa vs prismatic for schema libs?
10:54cYmen`cbp: You are probably right. Actually, I don't care about the position at all the damn vector might as well be a set. Thanks for pointing it out, betriebsblind.
11:20TimMcLooks like Runa's employment site still has malware on it.
11:31justin_smithI added a :pre condition that an input contains? some value
11:31justin_smithcan I make the :pre show me the key that was not contained?
11:33justin_smithfor now I am changing it to (or (contains? m keyname) (println "not here" keyname)) since println returns falsey, but that feels like a hack
11:33TimMc(doto (contains? ...) (when-not (println ...))
11:33TimMc)
11:34pjstadigif you want to do validation on the arguments to a function, then using a :pre assertion is probably not the right place
11:34justin_smithOK
11:35justin_smithI thought that was what :pre was for
11:36pjstadig:pre can be turned off and compiled away, and should be for protecting against programmer errors
11:36pjstadigthe criteria for using :pre versus some kind of validation prelude to your function are (admittedly) not real clear
11:37pjstadigbut i think as a rule of thumb you should see :pre as optional (since it can be compiled away)
11:37pjstadigalso as you're seeing it's not the most useful way to do more subtle validations
11:37justin_smithright
11:38justin_smiththis is a programmer error - both map and key come from the programmer
11:38justin_smithit just does something specific with that combo
11:38justin_smithand they come from different parts of the codebase
11:39pjstadigyou might consider something like schema for this kind of thing too
11:39pjstadigor core.typed? can you assert that a key exists in a map with core.typed?
11:43rads_NDuff: as far as I know, you can only check the types of the keys and the values, not that a specific key exists
11:44justin_smithI am making a map to represent a set of injected resources (rather than constructing namespaces on the fly), and now I miss the error checking / reporting namespace lookup provides
11:44justin_smithI guess I can make map lookup look slightly more like namespace reference, but it feels like reinventing a wheel
11:46nDuffrads: HMap :mandatory
11:46radscool!
11:47justin_smithnDuff: is that about checking an arbitrary pair at runtime, or verifying the map at compile time?
11:48nDuffjustin_smith: the latter
11:49justin_smithyeah, since this is a plugin system that won't help
11:49justin_smithcool though
11:50justin_smithI'm just trying to get the sensible error report when one part of the code asks for a functionality no other part of the code provided
11:56technomancyI kinda wish the `comment` macro was called `dont` instead
11:57pjstadigtechnomancy: would certainly fit in with the starts-with-do-and-returns-nil theme
11:58technomancyzactly
11:58llasramnice
11:58technomancysounds vaguely INTERCAL-ish
11:59justin_smithyou could even name it don't
12:00justin_smith' is valid, as long as it is not the first char in the symbol name
12:00technomancyyes indeedy
12:00technomancyto the jiramobile!
12:00pjstadigdo doseq dorun doall donot
12:01gfredericks2doughnut
12:01pjstadiggfredericks2: noooo!!! you beat me to it
12:01pjstadig(slow typer)
12:01gfredericks2(doughnut fan)
12:01justin_smithdoughboy - makes the vm emit the little Hm-Hm! sound
12:03algernonyes, yes, lets pull overtone into the language core!
12:08TimMc(defmacro dont [& _])
12:08TimMcNow you hav eno excuse not to.
12:09TimMcIt's better in all ways, actually -- there's no possible confusion of whether it returns something (a common problem for beginners with comment.)
12:12justin_smithat least spell it right (defmacro don't [& _]) :)
12:13TimMcholy shit that works
12:13TimMcThat's a change in 1.3 symbol parsing, yeah?
12:13justin_smithlikely
12:14justin_smithit lets you be all mathy and refer to x' and such
12:16justin_smith,(let [x 0 x' (inc x) x'' (inc x')] (+ x'' x'))
12:16clojurebot3
12:19awalters\quit
12:19awaltersoops
12:21sjlIs there something like select-keys that will fill in nil values for keys that aren't found in the map?
12:22sjlso like (select-keys-or-nil {:a 1} [:a :b]) => {:a 1 :b nil}
12:22justin_smithjuxt
12:22danneu((juxt :a :b) {:a 1 })
12:22danneuer
12:22justin_smith(inc juxt)
12:22lazybot⇒ 4
12:23danneuinto {}
12:23justin_smithahh
12:23justin_smithyeah, needs that too
12:23justin_smith,(into {} ((juxt :a :b) {:a 1 }))
12:23clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
12:23justin_smitherr
12:23justin_smith,(apply hash-map ((juxt :a :b) {:a 1 }))
12:23clojurebot{1 nil}
12:24justin_smithwait...
12:24danneuour keys
12:24justin_smithoh right
12:26sjl(into {} (for [k [:a :b :c]] [k (k m)])) does what I want but is ugly as hell
12:26danneu,(let [keys [:a :b]] (zipmap keys ((apply juxt keys) {:a 1})))
12:26clojurebot{:b nil, :a 1}
12:26danneul0l
12:26egosumWhat is best/easiest practice for using private dependencies with Leiningen?
12:26justin_smith,((fn coerced-select [m keys] (into {} (map (juxt identity m) keys))) {:a 0})
12:26clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval141$coerced-select>
12:26justin_smith,((fn coerced-select [m keys] (into {} (map (juxt identity m) keys))) {:a 0} [:a :b])
12:26clojurebot{:a 0, :b nil}
12:26egosumI see all sorts of references to different methods, all fairly old
12:27sjlah yeah juxt identity map might be a way to go about it
12:27radspersonally I think the for version is simplest
12:27danneupsh
12:28danneujuxt or death
12:30sjlanother way would be to create a map of all nil values and merge in the results of select-keys I guess
12:31lvhHello :)
12:32egosumI'm going to guess just using s3 as a maven wagon repo is the way to go
12:33lvhA while ago, I saw this interesting program that appeared to detect certain common clojure code patterns, and replace them with their more idiomatic versions. Anyone know what I'm talking about?
12:33danneui think your `for` solution is simple. defn body is just (into {} (for [k keys] [k (k m)])). aint ugly - just obvious
12:33sjlyeah that's also not too bad
12:33radslvh https://github.com/jonase/kibit
12:34lvhrads: Awesome! Thanks!
12:35technomancyegosum: just OSS everything; it's by far the easiest way to go
12:35egosumtechnomancy: ideally ;) and I may OSS this; just want to get things up and running first
12:36technomancy(if you can't do that, go with the S3 wagon unless you already have a server handy for http-basic-protected artifacts)
12:36egosumi wrote an asynchronous networked extended finite state machine library :) it's pretty slick
12:37danneusjl: although part of being a clojure developer is going far out of your way to "improve" a function, especially when you incorporate core funcs you never actually use. like `fnil`
12:37sjlyeah
12:37egosum…and a JS (will convert to clojurescript later, maybe) frontend for displaying them and creating them. Just rewriting the node.js server for serving and executing them, and will be good to go :) Will be scriptable via a DSL, JavaScript (through Rhino) or Clojure :)
12:37sjland making sure to never implement something everyone needs like contains-value?
12:37sjlthat's also critical if you really wanna get in the game
12:38dnolensjl: Clojure has a contains-value?, it's called some
12:39sjldnolen: (when-not (some #{nil} [1 nil 2]) (println "NOPE"))
12:39justin_smiththen you need contains
12:40sjljustin_smith: (when-not (contains? nil [1 nil 2]) (println "NOPE"))
12:40gfredericks2sjl: well some can still work with that, just using #(= % x) instead of #{x}
12:40justin_smithsjl: wrong order
12:40sjlgfredericks2: sure I can pepper my code with anonymous functions every time I need to check if a collection contains a value
12:40sjlor clojure could, like, include this super common thing
12:41dnolensjl: I take it you just want to pretend you can't solve this problem trivially w/ some
12:41justin_smith,(when (some #(contains? #{nil} %) [1 nil 2]) (println :OK))
12:41clojurebot:OK\n
12:41dnolensjl: and if you're littering your code with checking for a value in a sequential collection - you're using the wrong data structure
12:41sjlok
12:42sjlif clojure folks think "checking if a value is in a vector" isn't something the language should have built in
12:42sjlI don't know what to say to that
12:42sjlwe'll just agree to disagree
12:42dnolensjl: after having written thousands of lines Clojure I think I've done that like 4-5 times. fix your code.
12:43sjlamazing
12:44llasramsjl: OOC, what is your use case for checking if a value is present in a sequential data structure?
12:44gfredericks2my codebase has 6700 lines; I just grepped for '(some #{' and found one of them
12:44danneui like contains? + set
12:44danneuthen again, set does a full traverse
12:45danneusome it is!
12:45gfredericks2b
12:46sjlllasram: https://github.com/yogthos/Selmer/issues/12
12:46justin_smithther is also (comp first (partial filter pred)) - for when you care about the thing that matched
12:46sjlthat's one off the top of my head
12:46sjlI've been mostly writing scala recently
12:48llasramsjl: Ok... I guess I'm just not really seeing what's wrong with `(some (partial = x) coll)`, although I frequently wish for a shorter way of writing (partial = x) and (partial identical? x)
12:48alandiperton the topic of weird stuff, after tens of billions of lines of clojure i don't know what it means for a map to have a nil value
12:48sjlllasram: it works, sure
12:49sjlllasram: I still feel like "checking if a value is in a seq" should be something the language does for me
12:49sjlnot something I need to hand roll every time
12:50llasramI see. That seems reasonable, although I'll add myself to the count of people who don't need to do it frequently
12:50danneui have a `util` namespace that i just bring into every project and every namespace
12:50coventryalandipert: I wrote 1e8 lines of clojure just yesterday. Fabulous productivity. :-)
12:50danneuit's like ztellman's potemkin except mine sucks
12:50sritchietechnomancy: hey man - should "provided" deps be making it into an uberjar?
12:50gfredericksI've started using prismatic/plumbing
12:51hyPiRion,(.contains [1 88 3] 88)
12:51clojurebottrue
12:51sjl,(.contains [1 nil 2] nil)
12:51clojurebottrue
12:51sjlnice
12:51seangrovegfredericks: What do you think of it?
12:51sjljava interop works I guess
12:51alandipertcoventry: also a fair amount! some day we might know something. i just wish i understood nil, afaict it's an interop surface
12:51gfredericksseangrove: no complaints
12:52seangroveI used it heavily for one project, and it definitely has its upside, but maybe less useful than something like schema
12:52seangroveNot that they're competing in any way
12:52llasramI know about .contains on vectors, but I didn't know it even works on seqs. Fun!
12:52sjl,(.contains (list 1 nil 2) nil)
12:52clojurebottrue
12:52sjloh nice
12:52danneudamn, hyPiRion crowd control
12:53gfrederickssjl: probably gotta be careful with reflection on that one
12:53sjlyeah
12:53gfredericks,(time (some #(= nil %) '(1 nil 2)))
12:53clojurebot"Elapsed time: 0.147865 msecs"\ntrue
12:53hyPiRionllasram: even work on lazy seqs, it's interesting
12:54gfredericks,(time ((fn [x] (.contains x nil)) '(1 nil 2)))
12:54clojurebot"Elapsed time: 0.158361 msecs"\ntrue
12:54hyPiRion,(.contains (range) 10000)
12:54clojurebottrue
12:54gfrederickshrm; why did that not slowen up?
12:55seangrovesjl: As bbloom_ says, don't be afraid to write your own commonly used helper functions that you carry with you from project to project
12:55sjlseangrove: yeah we have a project like that
12:56egosumseangrove: really been enjoying prismatic/plumbing. haven't been using it extensively yet, but it's nice when I do. fnk/defnk are pretty slick + graph is awesome
12:57seangrovesjl: (let [has? (fn [haystack needle] (some #{needle} haystack))] [(has? [1 nil 3 5 :a] :b) (has? [1 nil 3 5 :a] :a) (has? [1 nil 3 5 :a] 3)])
12:57seangroveerm...
12:57seangrove,(let [has? (fn [haystack needle] (some #{needle} haystack))] [(has? [1 nil 3 5 :a] :b) (has? [1 nil 3 5 :a] :a) (has? [1 nil 3 5 :a] 3)])
12:57clojurebot[nil :a 3]
12:58sjlseangrove: the problem is that nil is falsy, so when you use some as a predicate you get into trouble
12:59sjl,(when (some #{nil} [1 nil]) "yes")
12:59clojurebotnil
12:59danneuthis is a shot in the dark, but if you were writing a browser-based roguelike (buttons send POST requests, update Datomic db), how would you represent state over time? like a succession of facts about HP, inventory, debuffs, location?
12:59justin_smiththere is always (partial = needle)
13:00seangrovesjl: Ah, yes, that can be annoying sometimes.
13:00seangrovejustin_smith: Only problem with that for me is you get the truth value back, not the original value
13:01coventryThe trick is to arrange your functions so that if they stick nil into a collection it has the same semantics as that entry not existing.
13:01justin_smithseangrove: then you want filter, not some
13:01justin_smithwell (first (filter (partial = needle) coll))
13:02sjlthere I think you can do the set shortcut
13:02alandipert(some {nil true} ...) ?
13:02sjl(first (filter #{needle} coll))
13:02sjlis basically some
13:02justin_smith(filter #{nil} [nil nil nil])
13:02justin_smith,(filter #{nil} [nil nil nil])
13:02clojurebot()
13:02justin_smithnope
13:02justin_smithno sets for nil
13:02sjlah no
13:02sjlnil
13:02sjlwelp
13:02justin_smith,(filter (partial = nil) [nil nil nil])
13:02clojurebot(nil nil nil)
13:02seangrovejustin_smith: e.g.
13:02seangrove,(if-let [result (pos? (dec (rand-int 20)))] (+ result 10) :fail)
13:02clojurebot:fail
13:03seangrovein this case if I switch pos? out for (partial = ...) then the same problem
13:03seangrovejustin_smith: I'm not sure why I brought this up right now, but with if/when-let it has been a bit annoying somethings ;)
13:04corvobianco[ ][ ][ ] OlA CoMpAgNeRoS Di #clojure [ ][ ][ ]
13:04corvobianco!list
13:06justin_smith(let [result (op)] (if (status result) ...)) that's not so bad
13:06justin_smithand you could make a macro for it if you find it that tedious
13:06seangrovejustin_smith: Yup, not bad at all. Just a tiny nitpick that keeps me from using if-let
13:08justin_smithseangrove: (defmacro if-pred [form condition yes no] `(let [result# ~form] (if (~condition result#) ~yes ~no)))
13:09justin_smith(if-pred (+ 1 1) even? :ok :nope)
13:09justin_smithI guess it should have an anaphore for the result though
13:09seangrovejustin_smith: Sure sure, not saying it's impossible at all.
13:11justin_smith(defmacro if-pred [form cond yes no] `(let [~'% ~form] (if (~cond ~'%) ~yes ~no))) ; (if-pred nil number? (* % %) nil) -> nil (returns for for arg of 2)
13:11justin_smith*four
13:12justin_smithprobably better not to reuse %
13:13seangroveActual quote from crockford: "And once it's done, there's folklore that says, having gone through that wringer, you're guaranteed your program is going to be error free. And it turns out, it's not. That there are subtle errors that happen in Haskell as happens in all other languages, *and the type system actually gives you no leverage in dealing with that stuff."
13:13seangroveI imagine bitemyapp fuming in the audience there so much that smoke comes of his head
13:20egosumanyone have experience using an s3 wagon for a private repo (along with the lein plugin)? credential are correct (tested with aws cli), maybe the file structure isn't? /bucket/releases/io/org-name/project-name has maven-metadata.xml + the checksums, then under that 0.0.1-SNAPSHOT has the jar etc
13:30justin_smithegosum: would running lein-install and comparing the local path under .m2 help with that at all?
13:30justin_smithjust a shot in the dark
13:44GlenjaworkHi guys, I'm putting together a FP/recursion themed problem set for a user group - one of the members asked if I could include a "real-world" problem - but i'm struggling to think of a good candidate that can be solved in time
13:45Glenjaworkdoes anyone have any suggestions?
13:45justin_smithsimple parsing of a tree?
13:46egosumjustin_smith: same path there :\
13:46justin_smithlike the four basic math objects plus ints in a lispy syntax, and find the answer?
13:46egosumjustin_smith: but thanks
13:46MaiorGlenjawork: http://6brand.com/solving-8-puzzle-with-artificial-intelligence.html
13:46justin_smithegosum: ?
13:46MaiorGlenjawork: don't look too hard at the title
13:46Glenjaworki'm trying to avoid anything where the solution is search-based
13:46justin_smithegosum: oh, now I get it, never mind
13:46MaiorGlenjawork: ah
13:46justin_smithGlenjawork: make a simple equation evaluator
13:46Glenjaworkbecause that's mostly just (ok? (generate solutions))
13:46justin_smiththat's recursive
13:47Glenjaworkjustin_smith: thats a good one
13:47justin_smithbonus points, make it a dsl with ops apropriate to said interest group
13:47egosumjustin_smith: but. get this. i tried it again (4 time in a row; definition of insanity) but it works now
13:47justin_smithLOL
13:47justin_smithcongrats
13:48egosumjustin_smith: thanks. computers are not sane.
13:48Glenjaworkjustin_smith: oo, i like it
13:48Glenjaworki wonder if i should so something funky like postfix
13:48Glenjaworkor infix
13:49Glenjaworkalthough, it's a general functional programming group, I wonder how doable that is in a non-lisp
13:50justin_smithrecursive parsing, all functional langs worth the name are good at that
13:51justin_smithsimilar, make an automated code translater for some subset of Haskell / clojure
13:51Glenjaworki guess the haskell approach you'd express as a recursive ADT
13:51justin_smithit doesn't need to be useful, just a toy
13:51Glenjaworkmm, that's a good idea
13:52sritchieis there a way to exclude default java imports in a clojure file, like String?
13:52sritchiesomething like :refer-java :exclude
13:53seancorfieldsritchie: you're getting conflicts with something else you're trying to import?
13:53sritchieWARNING: String already refers to: class java.lang.String in namespace: schema.core, being replaced by: #'schema.core/String
13:53seancorfieldseems like there are repeated calls for class aliasing to be added...
13:53seancorfieldah, the dangers of :use vs :require?
13:54sritchieno
13:54seancorfield#'schema.core/String is just a def for java.lang.String anyway I think?
13:54llasramsritchie: If you control the namespace defining a `String` var, you can `ns-unmap` the symbol `String` first
13:54sritchiethat's in schema.core itself
13:55seancorfieldbut you're use'ing schema.core (or refer'ing :all) ?
13:55seancorfieldI don't get that warning on a :require :as for schema.core ... pretty sure
13:57sritchiethis is in AOT compilation
13:57sritchieI'm requiring as
13:57sritchieI only get it when compiling
13:58eric_normandI just adapted hiccup to output React.DOM nodes (at runtime)
13:59eric_normandwe'll see how that works
13:59seancorfieldsritchie: hmm, I don't see that warning on lein check which does a compile, but I'm not doing full AOT compilation
13:59seancorfieldI guess I'd ask why you're doing AOT compilation? :)
14:00dabdthis is so cool http://daly.axiom-developer.org/clojure.pdf
14:09dsrxeric_normand: nice
14:09eric_normanddsrx: it's almost there
14:10eric_normanddsrx: i'd like it to do most of the translation at compile time
14:10eric_normanddsrc: anything static, that is
14:11bitemyappsritchie: why do you have something named String?
14:11sritchieprismatic does
14:11sritchiein schema.core - for cljs + clj
14:11bitemyappsritchie: use :as
14:11bitemyapprequire schema :as sch
14:11bitemyappsch/String
14:11bitemyappsch/*
14:12bitemyappor just s, if you like.
14:12sritchieokay, nice
14:17PupenoIs pedestal a framework for client side web apps?
14:18OscarZis there something like range that would increment or decrement automatically based on start and end values without having to give step... something like (range 0 3) -> 0 1 2 and (range 3 0) -> 3 2 1
14:19OscarZif not.. maybe this would be a good spot to learn about macros ?
14:19gfredericksOscarZ: definitely not a macro
14:19gfredericksit's an easy function
14:19OscarZok
14:19OscarZill work that out.. i thought maybe there is already one
14:19gfredericksnot that I know of
14:19bitemyappPupeno: Pedestal handles both. You probably don't need it.
14:20OscarZok thanks
14:21BronsaOscarZ: you can use `compare` to get 1 or -1
14:22Pupenobitemyapp: care to elaborate on not needing it?
14:23seancorfieldsritchie: how were you pulling in schema.core to your code?
14:23llasramHypothesis: sritchie is still having his problem, and has just gotten tired of people misunderstanding it :-)
14:24sritchieon a quick phone call :) I'll be back soon!
14:24sritchiesorry dudes, thanks for the comments
14:24seancorfieldyou said you weren't doing use or refer all but bitemyapp's suggestion is what i was also suggesting... we use (:require [scheme.core :as s])
14:26OscarZBronsa: thanks for the tip.. nicer than if :)
14:28BronsaOscarZ: err, looks like there's no guarantee that it'll return 1 or -1, only a negative or positive number, so it's probably better not to rely on that, sorry
14:28coventryIn fact, schema.core does the ns-unmap llasram suggested. https://github.com/Prismatic/schema/blob/master/src/cljx/schema/core.cljx#L92
14:29OscarZBronsa: heh ok.. thats weird :)
14:30OscarZSame as Java x.compareTo(y) except it also works for nil, and
14:30OscarZcompares numbers and collections in a type-independent manner.
14:30coventryYou could do a refer excluding just the two symbols unmapped there, and refer to just those two with an alias if you cared.
14:31gfrederickswhy would you use s/String over String?
14:31justin_smithcoventry: regarding that link above, do you know if #+clj and #+cljs are specific to schema or they are provided by clojure?
14:31coventryjustin_smith: That is cljx syntax.
14:32justin_smithand what provides the cljx reader?
14:32coventrycljx of course. :-)
14:32gfrederickscross platform I guess
14:33coventryI hear it's super-handy if you're doing combined clj/cljs work. https://github.com/lynaghk/cljx
14:33coventrycemerick was mad for it a couple of weeks ago.
14:36dabdcan someone tell me the difference between persistence and immutability, regarding clojure data structures?
14:36justin_smithcoventry: cool, thanks
14:37coventryimmutability: can't change it. persistence: http://en.wikipedia.org/wiki/Persistent_data_structure
14:39dabdright I read that before asking but as they say a persistent data structure is effectively immutable. It looks like the same thing
14:39Bronsadabd: assoc on a simply immutable data structure might implemented by copying the whole data structure and adding the element to the new copy
14:40Bronsadabd: persistent implies that the underlying shared data-structure will be re-used
14:40justin_smithdabd: numbers are all immutible, but not persistent
14:40justin_smiththey are just data you cannot mutate
14:42dabdright, a data structure can't be persistent if it can't be modified in the first place
14:42Bronsadabd: http://clojure.org/functional_programming#Functional%20Programming--Immutable%20Data%20Structures
14:43dabdbronsa: ty for the link, it explains it exactly
14:45seangroveeric_normand: That sounds awesome
14:45seangroveVery curious to see where it goes
14:47seangroveWow, there's a leiningen aptitude package?
14:48seangroveSeems a bit unnecessary
14:48justin_smithcounterproductive even
14:48`cbpno one knows how to keep apt packages updated
14:48bruceadamsright. it just confuses people
14:48gfredericksreiddraper: I'm writing a jsonish generator for types that should roundtrip through json
14:49gfrederickse.g., only keywords for map keys, but no keywords otherwise
14:58sritchieseancorfield: back
14:58sritchieI'm using it with a require as
14:59sritchieno problem there
14:59sritchiebut this shows up when I AOT compile;
14:59sritchieand because the schema namespace gets AOT compiled on its own (I guess),
14:59sritchiethe waning shows up there
14:59sritchiejust like you get reflection warnings from other people's code if they're not careful
15:00sritchieanother qq -
15:00sritchieand this one, I'm just lacking some understanding on
15:00sritchieI have "aot all" in my uberjar;
15:00sritchieprofile, on leiningen
15:00sritchieBUT, when I actually go to compile, only my main class gets aot compiled (it has a gen-class)
15:00seancorfieldcurious why you're AOT compiling?
15:00sritchiefor heroku boot times
15:00sritchiemy boot times out
15:01seancorfieldah, ok
15:11llasramsritchie: What version of Leiningen?
15:11sritchie2.3.3
15:12llasramHmm. Oh -- when you say "go to compile" do you mean `lein compile` or `lein uberjar`?
15:12sritchielein uberjar
15:13sritchieI've overridden the default compile with prep-tasks ^:replace [["cljx"] ["javac"] ["compile" ":all"]]
15:14llasramIn the :uberjar profile?
15:14llasramOr you mean that's your work-around?
15:17sritchieI have to do that anyway,
15:18sritchiellasram: so that cljx gets compiled before compilation
15:18sritchiesorry, the bigger bug I'm trying to solve is why I get this crazy classnotfoundexception when including austin in my project
15:18Pupenobitemyapp: can you elaborate on why I don't need Pedestal please?
15:18llasramOk. Then that's extra weird, because the `compile :all` prep-task should be causing full AOT compilation before any task
15:18sritchieeven as a dev plugin
15:18sritchiellasram: I think it does, I think I goofed with that one by running it twice without cleaning
15:18llasramAh, I see
15:19sritchiehttps://github.com/cemerick/austin/issues/23
15:19sritchiethat's the bigger issue
15:19sritchiereally unclear why it's happening,
15:19sritchiebut it's linked to austin
15:19rkneufeldPupeno: One of Pedestal's authors here. It's a fairly experimental framework, with a rather high barrier of entry (at present).
15:19sritchieso I'm trying to put austin somewhere, maybe as a dev plugin, that completely removes its effect when running "lein uberjar"
15:20Pupenorkneufeld: it still seems to be the most active web framework on clojure.
15:21sritchieI think it gets the most attention because it's backed by cognitect
15:22sritchieraw compojure probably gets the most love
15:22sritchiellasram: anyway, I'm still seeing namespaces getting evaluated
15:22PupenoLuminus seemed to be second in the popularity contest.
15:22sritchieafter AOT compiling my main namespace
15:22sritchie(and every namespace does show up)
15:23sritchiellasram: of course, only the main namespace has gen-class on it
15:23sritchiellasram: but I would have thought that would transitively compile
15:24llasramsritchie: I'm not sure what you mean by "getting evaluated" -- are you sure you're not just seeing the effects of the initializers Clojure generates w/ AOT?
15:24sritchiellasram: I have a top level side effect in one of my files
15:24sritchiethat tries to require a certain CLJS development namespace, but only if available
15:24sritchieand I see the println statement on AOT compilation, and also on running the jar
15:25llasramOh, I see. Yeah, unless I'm mistaken, the way AOT works, you'll still get that code eval'd when you load the AOT'd artifacts
15:25sritchiegotcha
15:25sritchieinteresting
15:26llasramI think the intent is that AOT is supposed to be transparent -- loading AOT'd or not AOT'd should do the same things
15:27reiddrapergfredericks: oh neat
15:29technomancyPupeno: "most active" is really not that interesting of a metric in an ecosystem primarily composed of small libraries
15:29stuartsierraAnd "popularity" is even worse.
15:30sritchiellasram: my goal was to AOT for speed, so no new eval work has to be done at launch
15:31sritchiellasram: otherwise, why AOT?
15:31Pupenotechnomancy: true.
15:33Pupenotechnomancy: do you do web development with clojure?
15:34technomancyPupeno: I've basically only written one web project: https://github.com/technomancy/syme
15:35technomancyand even that's only ~500LOC, but maybe it has some good techniques you could learn from
15:35technomancythe way it uses oauth is neat, and I recommend copying its approach for db migrations
15:35seangrovePupeno: There's a lot of churn right now, some great ideas in pedestal, react, cljs, compojure, etc.
15:36technomancyhuh, I'd never heard of react before ~3 days ago
15:37lazybotjava.lang.RuntimeException: EOF while reading
15:37llasramsritchie: It avoids needing to compile any code. For every class which would normally need to be generated, it can just load the pre-generated AOT version.
15:37seangrovetechnomancy: Well, it is a js library, just has some interesting good ideas that are similar to pedestal
15:37sritchiellasram: ah, okay. but eval still happens. gotcha
15:37seangroveAnd with what eric_normand is doing around hiccup, it could all be very cool
15:38seangrovesritchie: That's a pretty nasty workaround. Well done though.
15:42futureis it possible to rebind the Java classes that built-in clojure functions use?
15:42futureI want to make future use ForkJoinTask instead of FutureTask
15:43futureis it possible to do that without rewriting future?
15:44gfrederickshas anybody written a prismatic/schema -> simplecheck-generator function yet?
15:45ohpauleezgfredericks: There was a tweet about this the other day - there have been a few "specs should be consumed as tests" efforts. I'm not sure about schema to simplecheck, specifically
15:47gfredericksohpauleez: I might have to try this myself then
15:48gfredericksnaively it sounds like just some glueing
15:52sritchietechnomancy: qq about slug size (again)
15:52sritchiemy uberjar is 65MB
15:53sritchiebut the slug size is 130MB
15:54sritchietechnomancy: you were saying for non-uberjar project, the .m2 dir is included
15:56ohpauleezgfredericks: Totally worth the effort - I look forward to some day when a single specification can be consumed as a generative test, contract/schema/validation, or generate extra documentation
15:56bbloom_swannodette forked tastejs/todomvc to swannodette/todomvc 4 hours ago
15:56bbloom_dnolen: it begins.
15:56bbloom_:-P
15:57ohpauleezIt'd be nice if specification could be extensible to other systems or consumers - it'd be nice to use specs/schemas with something like Alloy or core.logic to assert properties about your system, or query the system you're building/specifying
15:57ohpauleez(it opens up an additional level of verification and validation, if people were into that sort of thing)
15:58ohpauleezbbloom_: :)
15:58ohpauleezI've been watching today as wel
15:58ohpauleezwell
15:58bbloom_ohpauleez: brenton seems stoked about react as well, which i consider good news
15:59dnolenbbloom_: heh, working with React DOM is definitely a case where #js literal would be nice
15:59ohpauleezYes, it seems like some interesting things are coming together
15:59dnolenbbloom_: I showed him latest gist and explained how it worked - I think he's even more psyched now
15:59dnolenbbloom_: "you're blowing my mind" I think were his exact words :)
15:59ohpauleezhaha :)
16:00ohpauleezIt answers an open question that the latest Pedestal stuff still had, and thanks to new insights from dnolen around mapping data structures to components, simplifies things even more
16:00bbloom_http://clojure-log.n01se.net/date/2013-08-23.html#13:38e
16:00bbloom_:-P
16:00ohpauleezand also, makes things really really fast
16:01bbloom_ohpauleez: what new insights? are you just talking about how immutability means faster diffs?
16:02ohpauleezyes
16:02ohpauleezhaha
16:02ohpauleezyes I am
16:02bbloom_yeah, it wasn't a new insight to the facebook folks :-) they already use immutable models w/ react internally
16:03dnolenbbloom_: haha, my comments were based on reading their website - had to goto the code and ask lots of questions to understand - also still wasn't clear how modular it was until the past couple of days
16:03bbloom_dnolen: yeah, they lack the vocabulary that we have here in clojure land to express what's so great about their approach
16:04ohpauleezI'm personally interested to see how the latest Pedestal app workflow stuff gets wired up - and if the general design from react and be lifted and generalized
16:05ohpauleezbut the latest react stuff is very exciting
16:05bbloom_latest? heh, it's basically the same as when it shipped
16:06bbloom_anyway, the react API can be entirely wrapped to work in a hiccup style with extreme ease, but there will be a translation perf cost for that. core can change to add some generality to let us hook in our own objects
16:07bbloom_right now they assume raw json arrays or objs in a few cases, but it can probably be made generic with very little change to core
16:07dnolenbbloom_: yes support things that work via ES6 generator interface, they seemed receptive to that.
16:08dnolenbbloom_: one downside is that React has a lot of complexity because the OO approach
16:08dnolenbbloom_: but there's too much good value for that to matter at this point
16:09bbloom_dnolen: it's not entirely clear which bits of the code go to serve the component model & which parts go to serve the DOM diff
16:09bbloom_dnolen: but my investigation suggested they are less tangled than it would appear
16:10dnolenbbloom_: I mean there's a lot of functionality we don't care about
16:10dnolenbbloom_: like their batching system or the role of state
16:11dnolenwe always render from root, so batching is trivial for us, and we don't need state stuff
16:11bbloom_dnolen: no, i disagree completely
16:11dnolenbbloom_: I disagree w/ your disagreement
16:11bbloom_lol
16:11dnolenbbloom_: that stuff isn't useful for us
16:11bbloom_dnolen: it is
16:11dnolenbbloom_: how?
16:12bbloom_dnolen: b/c some components really are stateful & have transient state that you really don't want to include in your model
16:12bbloom_and you want that state to have managed life time
16:12bbloom_the state stuff can be made much better w/ a clojure perspective, but that doesn't mean it's not useful
16:12bbloom_at minimum, we need the life cycle management, which is essentially 99% of the state subsystem
16:12dnolenbbloom_: I can't think of a component I would write that needs that - do you have an example?
16:13bbloom_dnolen: consider animations or reacting to the mouse pointer, or focus, or other transient bits of UI state
16:14bbloom_dnolen: you don't want to treat that stuff as part of your world
16:14dnolenbbloom_: why not?
16:14bbloom_think about like a x/y coordinate if you were to save UI state & then load it back up in a different sized window
16:14bbloom_you might want to save that stuff, but you definitely want it isolated
16:14bbloom_it has different lifetime policy
16:14bbloom_it's lifetime is tied to inclusion in the dom
16:14bbloom_anything in your props/etc has unbounded lifetime managed by you
16:15bbloom_having automatic lifetime of state is critical
16:15bbloom_we can hide that state in control variables for core.async loops or whatever
16:15bbloom_but we still need the lifetime management
16:15dnolenbbloom_: still not convinced anything you've said matters
16:15dnolenjust put into the graph
16:15geoffegany congomongo "experts" around? i can
16:15dnolenif you load and stuff is different, recompute update, re-render
16:15geoffegi can't figure out how to do a case-insensitive regex match
16:16bbloom_dnolen: *shrug* ok go ahead and start building stuff w/ that approach and call me when you realize that not everything belongs in there :-P
16:16bbloom_dnolen: you're going to have state inside the loop arguments for a go-loop
16:16bbloom_dnolen: for your event handling
16:16bbloom_dnolen: that's exactly what the state obj is for
16:17dnolenbbloom_: this is not my understanding, nor what petehunt commnicated when we talked about it today
16:17dnolenstate is a hack because they can't efficiently traverse the tree
16:17dnolenwe can
16:17seangrovebbloom_: I had the same thoughts about independent/default life-cycle management for components
16:17bbloom_dnolen: i didn't hear him say that
16:17bbloom_oh you talked to him again today?
16:17bbloom_*shrug*
16:17dnolenbbloom_: yep
16:18bbloom_dnolen: just like you put .value in props, i'd expect you'd put .channel in state
16:18dnolenbbloom_: I specifically said we don't need set state because can use equality checks all the way down
16:18bbloom_or something along those lines
16:18dnolenbbloom_: he basically hell yeah, that's right
16:18dnolenbasically said
16:18bbloom_yeah, you don't need getState/setState
16:18bbloom_b/c you're going to have that managed implicitly in a core.async state machine :-P
16:18dnolenbbloom_: ok now we return to the same reality
16:19dnolenbbloom_: that's what I was talking about - the api
16:19dnolenno state in general
16:19dnolens/no/not
16:19bbloom_yeah, so that state thing is literally a map w/ an obj in it and the lifecycle management
16:19bbloom_like i said: we need the lifecycle management
16:19bbloom_which will basically boil down to managing the event channels
16:21bbloom_anyway, i told pete to idle here :_P
16:22dnolenbbloom_: I haven't gotten so far as to think through how component code and core.async should interact - i'll keep your points in mind
16:22akhudeksounds like I missed an interesting conversation
16:23akhudekwe've been playing with a pedestal-like design recently
16:24geoffegseancorfield: ping?
16:24stcredzeroI came here to ask about the Slf4jLog.debug missing method problem
16:24arohnerclojurebot: ~ask
16:24clojurebotExcuse me?
16:24akhudekbut built on a more common set of clojure libraries
16:25arohnerclojurebot: ~question
16:25clojurebotGabh mo leithscéal?
16:25arohnerhrm, what was the "don't ask if you can ask a question" prompt?
16:25seangrovearohner: Gonna need to lurk more so you can operate arohner better :P
16:25seangroveask?
16:25clojurebotThe Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
16:25seangroveanyone?
16:25clojurebotanyone is anybody
16:25stcredzeroHi sean
16:25seangroveHey Peter, sorry haven't gotten back to your email yet, was actually looking into it ;)
16:26stcredzeroSo, after I upgraded my machine to OS X Mavericks, I started getting java.lang.NoSuchMethodError
16:26arohnergeoffeg: I haven't tried insensitive matching in congo, but have you tried just passing a normal insensitive regex?
16:26arohnerhttp://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html
16:26teslanick"Saying, There was in a rage with him because of the special forms" -- http://kingjamesprogramming.tumblr.com/
16:27stcredzerojava.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple; -- is there an easy fix?
16:27seangrovestcredzero: I wonder if it isn't a version mismatch somehow
16:27stcredzerohelp
16:27seangrovestcredzero: Can you post the `lein deps` output to refheap?
16:32dnolenbbloom_: ok I think I see what you mean, but it seems easy enough to merge some maps for the render? one of those maps will be the actually app-state and the other maps are transient stuff?
16:34bbloom_dnolen: so how that stuff will work in a clojure-y API isntead of an OOP one is yet to be seen. i dunno the answer
16:34bbloom_dnolen: the point is that the work react does for their OOP top-layer is like ~10 lines & the rest is about lifecycle
16:35geoffegarohner: ah, turns out it doesn't matter anyways, mongodb doesn't do well with case-insensitive regexes hitting an index.
16:38musicalchairbbloom_: to me, it seems the x,y coords problem you mentioned earlier can be kept in the app state. translateContext appState oldContext newContext :: State WindowSize WindowSize. not totally up to speed, tho
16:38balpertdnolen: bbloom_: yeah, there's really not *that* much code related to state or batching in React
16:38bbloom_musicalchair: yeah, you can of course keep it in app state, but when you do that, it becomes your problem
16:38balpertyou could probably make a slimmed-down version of ReactCompositeComponent.js if you really cared
16:38musicalchairbbloom_: tho the lifecylce bit is probably more interesting
16:38musicalchairbbloom_: ah I'm starting to see where you're comign from now
16:39bbloom_musicalchair: there are two "default" life cycles available to you: 1) save forever in app state and 2) exists while in the DOM
16:39bbloom_#2 is super useful
16:39gfredericksdidn't somebody have a lib for generating matches from a regex?
16:39musicalchairbbloom_: WebSocket
16:40musicalchairbbloom_: sorry, shouldn't be so brief. I was trying to pose an example of useful dom state
16:40bbloom_musicalchair: yeah, that's the #1 case. you put stuff in some global atom & then you need to take that out of the global atom
16:40bbloom_musicalchair: it's your problem
16:40bbloom_and that's what you want
16:40bbloom_rather than it being backbone's problem & they do a stupid job of it
16:40bbloom_but if you can use a default policy that makes sense for a particular kind of data... saaay "is on the screen or not" then you should use that where possible :-)
16:41musicalchairbbloom_: I think I'm a little behind because I'm not quite following. I'm sure it will make sense soon, though
16:50musicalchairbbloom_: "then you should use that where possible" - what's 'that'?
16:50musicalchairbbloom_: the policy?
16:50bbloom_musicalchair: a sensible default lifecycle policy
16:50bbloom_yeah
16:50musicalchairbbloom_: hmm
16:52musicalchairbbloom_: so these policies. I haven't dug too much into ReactJS and what you're doing, yet. I assume you're using policy as a general term and not referring to a specific implementation
16:54bbloom_musicalchair: yeah, i'm speaking at a design level, not about any particular bit of code
16:56musicalchairbbloom_: ok. have you seen any interesting papers (or code, even) around declaring life cycle policies?
16:57bbloom_musicalchair: i think you're over thinking this :-P
16:57bbloom_you ever write any C code?
16:57musicalchairbbloom_: I was afraid of that =P too soon, too son
16:57musicalchairs/son/soon
16:57bbloom_you got stack allocation or heap allocation
16:58typicalbenderAnyone have bandwidth the answer a macro question? https://gist.github.com/ajorgensen/7832799
16:58musicalchairyup
16:58bbloom_stack allocation is one strategy for managing the lifetime of allocations
16:58bbloom_and malloc/free is another
16:58bbloom_and garbage collection is a 3rd
16:58bbloom_well, creating a list of things that enter or exit the DOM in a browser and mapping that to a look up table of state is an Nth strategy for managing life time of data
16:58bbloom_it's literally that simple :-P
16:59musicalchairmmm ok. I think there's something there, though. you mentioned a default policy for particular kinds of data, and at this point we're talking about data that can be in the browser, might need to be persisted/loaded/rewound/fast-forwarded. ok, yeah, I'm definitely overthinking
17:00musicalchairbbloom_: thanks for induldging =) back to work..
17:00typicalbenderis there something special i need to do to store an expression in a def and then send that into a macro to be evaluated?
17:04stuartsierratypicalbender: eval it
17:04sveri1hi there, if i would want to paint charts in html, what would i use for that? and is there something that is integrated into clojure already?
17:04eggheadcss
17:04nDuffsveri1: http://keminglabs.com/c2/
17:04eggheadoops ya meant to link that one instead ;)
17:05sveri1ah, nice, it creates svg
17:05dnolenany opinions about #js CLJS literal
17:05sveri1thank you
17:05dnolenI think about the following semantics
17:05dnolen#js {} -> js-obj, #js [] -> array
17:05dnolen#js {:onClick func} -> (js-obj "onClick" func)
17:06dnolenand #js is shallow
17:06dnolen#js {:items #js [1 2 3]}
17:06bbloom_dnolen: that was my initial expectation
17:06bbloom_dnolen: doing it deep is problematic for many reasons
17:06dnolenbbloom_: agreed
17:08bbloom_dnolen: i'd make it work for #js 'foo and #js :bar too
17:08bbloom_even tho they aren't that useful :-P
17:10dnolenbbloom_: hrm ... I can't see the value of it being used for anything other than js objects and arrays
17:10bbloom_dnolen: there isn't any really, feel free to ignore that request
17:10bbloom_OH
17:10bbloom_actually there is one
17:10bbloom_sets
17:10bbloom_#js #{1 2 3}
17:10bbloom_should be:
17:10bbloom_{"1": true, "2": true, "3": true}
17:11bbloom_that's the js convention for sets
17:11dnolenhrm
17:11bbloom_i guess you could also expand that as {"1": "1", "2": "2", "3": "3"} to match clj sets closer
17:11dnolenand it should only allow numbers, strings and keywords?
17:12musicalchairdnolen: probably? #{false} -> {false: false}
17:12dnolenmusicalchair: yeah that's an argument for true as the value
17:12bbloom_alternatively you just use they key for the value
17:13bbloom_the key here is actually "false", a string
17:13dnolenright so this is the problem w/ supporting sets
17:13dnolenI'm kinda inclined to say no
17:13dnolen#js just means I want a JS literal
17:13bbloom_dnolen: if we do do sets, my vote is to expand to true as the value
17:13bbloom_but i wouldn't object to not having it
17:16chouserhas anyone tried to use data.fressian to read from a file on disk?
17:16seangrovednolen: It'd essentially be a destructive transformation, right? set -> js-obj out. You wouldn't expect to be able to treat it as a clj-set afterwards anyway
17:16bbloom_dnolen: you said strings/numbers/keywords, what about symbols? should they be resolved/evaluated?
17:17dnolenhttp://dev.clojure.org/jira/browse/CLJS-717
17:17dnolenI think the scope should be very limited
17:17dnolenobjects, and arrays only
17:17bbloom_fair
17:17dnolen#js {}, map keys must be keyword or string
17:17bbloom_i'd consider symbol keys to be an error
17:17dnolenyes
17:18musicalchairare clojurescript's numerics straight javascript numbers?
17:18bbloom_yes
17:19abpyou guys make me want to play with react
17:19dnolenno namespaced keywords I think
17:19abpany particular resources besides docs/presentation vid?
17:20dnolenabp: JSConf EU 2013 petehunt video is great intro
17:20dnolenabp: I've found it more informative to lurk on IRC and pester them :)
17:20abpdnolen: ok, thanks
17:20petehuntfor js: http://facebook.github.io/react/docs/tutorial.html
17:20petehuntanother great video: http://facebook.github.io/react/blog/2013/11/18/community-roundup-11.html
17:21abppetehunt: oh, hi :) more interested in cljs but able to adapt ;)
17:21petehuntalso here is my "how to think about building stuff" blog post (may not apply to cljs stuff): http://facebook.github.io/react/blog/2013/11/05/thinking-in-react.html
17:21petehuntabp: yeah sorry, i am from JS world :( working on my clojure-foo though
17:22abppetehunt: thanks for those resources and that's great to hear!
17:22bbloom_petehunt: we'll make a clojurian out of you yet
17:22dnolenpetehunt: it definitely applies, you'll end up doing the same things but with functions
17:22dnolenpetehunt: the TodoMVC port should be informative when I get around to it
17:22petehuntbbloom_: i'm already convinced. i just need the time (I have a day job!)
17:23bbloom_petehunt: perfect. so i'll expect instagram.com to be ported to cljs by the end of the week
17:23bbloom_:-D
17:23petehuntnpm install js2cljs
17:23petehuntam i doing it right guys?
17:24abppetehunt: seems bout right start, js is just scheme without parenthesis anyway *runs*
17:26BobSchackpetehunt I've come to clojure form PHP :)
17:27petehuntBobSchack: the fact that you guys have a great culture and tooling support around immutable data structures is reason enough to switch!
17:27deadghostI like js as a language
17:28deadghostbut in practice it doesn't feel very lispy
17:28deadghostand I still think node.js is group hysteria
17:29petehuntdeadghost: that's a very apt description of node.js :)
17:29imkmfdeadghost, petehunt: why's that? i don't write node at all, but i'm always curious about the big discrepancy in node opinion
17:30deadghostthe only guy I know that really likes node is really big on js to begin with
17:30deadghostit's his dominant language by far
17:30deadghostI gave node.js a fair try
17:30deadghostand don't know how it seems like a reasonable choice for anyone
17:31deadghostall those callbacks
17:31imkmfright
17:31nDuffdeadghost: callbacks? sounds like an excuse for core.async. :)
17:31deadghostI think people who think it's totally ok to code like that is out of their mind
17:32BobSchackNode seems to attract a lot of NIH libraries and wheel reinventing. One thing I like about clojure devs is references to papers when talking about how to develop a lib
17:32deadghostmy js friend also is more susceptible to trendy stuff
17:32deadghostnodejs + rethinkdb for pretty much no reason
17:33deadghostwe didn't need the performance
17:35deadghostidk what's driving nodejs adoption
17:35deadghostI suspect all the front end web devs that spent years in js jumping to back end
17:36deadghostor it's actually totally amazing and I can't see it at all
17:38bbloom_deadghost: the biggest thing is that rails is slow & the community needed an excuse to move to anything else & the "run the same code on the client & server!" idea sold some ppl even tho that's rarely ever useful
17:39deadghostright I got the vibe the rails hipster crowd moved to node
17:39bbloom_and even when it is useful, it's for a tiny slice of your stack & you shouldn't force yourself to write CPS code for the rest of it
17:40bbloom_dnolen: were you gonna take a crack at the #js thing? b/c i think the tagged-literalls-are-totally-broken issue still applies
17:40dnolendeadghost: Node.js is fine ... especially if ClojureScript runs on it :)
17:40dnolenbbloom_: hum, I thought I fixed it
17:41dnolenbbloom_: do you have some case where it doesn't work?
17:42bbloom_dnolen: you fixed the java vs js date thing?
17:42deadghostI actually tried node.js with sibilant
17:42deadghosthttp://sibilantjs.info/
17:42dnolenbbloom_: I thought I did
17:43bbloom_dnolen: oh, i didn't see. i'll look at it in a bit
17:43deadghostidk how well something like clojurescript can make nodejs callbacks palatable
17:43winkaw man, I liked the monospace font only to learn it's a google one
17:43dnolenbbloom_: remind me what the failing case was? it just didn't work at all right?
17:43dnolendeadghost: solved problem - core.async
17:44deadghosthuzzah
17:45radsI think node.js fits a niche in that it supports concurrency better than ruby and python, and javascript is more similar to those languages than a lisp or the statically typed alternatives
17:46bjarads: it supports concurrency better than python? It's almost identical to twisted in normal use
17:46deadghostit's easier to start with something small and build up with nodejs
17:46deadghostI'll give it that
17:47deadghostruby and python have rails and django representing them
17:47deadghostand those are large by default
17:47bjayeah, but if you're wanting to write event-driven network stuff, you'd use EventMachine or Twisted
17:48bjawhich are both large libraries, but don't have a lot of baggage with them if you're not actually using all the features (as opposed to say, Django or Rails)
17:48bbloom_dnolen: Caused by: java.lang.RuntimeException: No such var: readers/source-logging-push-back-reader
17:48bbloom_trying to run script/repljs
17:48dnolenbja: but it wouldn't be Web Scale
17:49bjadnolen: correct. but it also wouldn't need several million dollars to scale either
17:49Bronsabbloom_: you need to update your tools.reader dep
17:50bbloom_Bronsa: i did a script/clean & script/bootstrap
17:50bbloom_and lein deps
17:50bjamy mistake, webscale only costs $200k
17:51bjawebscale is cheaper than 2 FTEs
17:51petehuntyeah
17:51petehuntuntil node got generators it was pretty much unusable
17:52dnolenpetehunt: yet that didn't stop them for saying otherwise :)
17:52petehunti think npm is pretty good though, though i am still unsure about the local vs global dependencies thing
17:52dnolens/for/from
17:52petehuntdnolen: there are certainly....cultural issues.
17:52dnolenpetehunt: npm is alright, some good libs, and they have momentum
17:53Bronsabbloom_: and you have only tools.reader.0.8.0.jar in lib/ ?
17:53dnolenpetehunt: I'm actually pretty excited for CLJS to run directly on Node.js and for us to be able to hook directly into the library ecosystem
17:53bbloom_oh there are others in there...
17:54petehuntdnolen: how does well written cljs on v8 perform vs clojure on jvm
17:54dnolenbbloom_: repljs works fine for me
17:54dnolenbbloom_: you sure you don't have a multple jars in libs?
17:54bbloom_dnolen: there are multiple in there. i'm going to send you a patch for the bootstrap script :-)
17:54bjaheh, we need cljs/node vs clj/http-kit benchmarks
17:54dnolenpetehunt: very favorably
17:55dnolenpetehunt: things I specifically spent optimizing are often within or under 2.5X of the JVM which is pretty cool
17:55radsbja: that's a good point about twisted. what about third party libraries though? for example, I was using a node binding to taglib today for reading MP3 metadata, which has a callback api by default. it looks like the python bindings only have a sync version
17:55bjarads: we don't talk about third party libraries in the twisted universe.
17:56dnolenpetehunt: things that aren't close to JVM are often because V8 doesn't do quite enough inlining, and the GC isn't quite as good
17:56bjarads: you can always deferToThread
17:56cYmenI have a seq of seqs and I would like to remove the smallest first element of the seqs. How do I do it?
17:56petehuntdnolen: i bet cljs startup time is better, no?
17:57bbloom_dnolen: https://gist.github.com/brandonbloom/7833585 apply me
17:57gfredericksit occurred to me today that you could do arbitrarily complex lexical refactorings at a keystroke just with cider & emacs macros
17:57bjarads: basically. third party support is hit/miss (mostly miss) and you end up doing blocking stuff in separate threads/processes and using something like txZMQ a lot
17:57dnolenpetehunt: for compiled scripts yeah, non existant
17:58bbloom_dnolen: you didn't fix the tagged literals issue
17:58petehuntinlineCallbacks in twisted was sweet
17:58bbloom_'#inst "2013-12-06"
17:58bbloom_try that
17:58bbloom_note the leading quote
17:58dnolenbbloom_: ah right couldn't remember what the actual bug was filing now
17:58bbloom_(quote #inst "2013-12-06")
17:58radsso my point is with node all the third party libs already assume callbacks, and the stdlib prefers callbacks. I think that's useful
17:59bbloom_dnolen: apply my clean patch :-)
17:59dnolenbbloom: http://dev.clojure.org/jira/browse/CLJS-718
17:59dnolenbbloom_: where?
18:00bbloom_dnolen: https://gist.github.com/brandonbloom/7833585
18:01dnolenbbloom_: done
18:02bbloom_hurray
18:03cYmenbbloom_: Problem 108. I'll take that hint now.
18:12cYmenI have a solution but it is naaaasty.
18:15bbloom_cYmen: sorry back. what did you come up with?
18:15cYmenMy account name is firefly...
18:16cYmenBasically I just removed the minimum element until they were either all equal or I ran out.
18:16cYmenBut beating those seqs into shape was waaaaay more annoying than usual.
18:16bbloom_yeah, that's basically it
18:17cYmenWell, is there any way of doing that without getting the index of the seq with the smallest element and then messing around with it?
18:18bbloom_cYmen: you need to traverse them in parallel
18:18cYmenhm...
18:35cYmenbbloom_: is there any clever way of doing that?
18:36bbloom_cYmen: i'm not #clojure's best golfer. i'd probably write a loop :-)
18:38cYmenHow'd you do it in a loop?
18:41justin_smithI did mine with a function and recur, 4 lines
18:42justin_smithI did it by doing a lazy seq on each in parallel, and stopping when all first elements were equal
18:42justin_smiththe trick is knowing when to advance one of them
18:43eggheadsounds fancy
18:44justin_smithcYmen: the lists are sorted
18:44justin_smithso you take the list of lists, and if all first elements are equal, you are done
18:44cYmenjustin_smith: Yeah, so you can always advance the list with the smallest element
18:45justin_smithright
18:45chouserjustin_smith: that's what I did. mine is 5 lines
18:45cYmenwell, apparently I missed some shortcuts :p
18:45cYmenmine is 6 and ugly
18:46`cbpshowoffs
18:46`cbpmine was 14
18:46chouserDon't be sad. 4clojure is for learning.
18:47chouserI abuse it for golf fun. :-)
18:47justin_smithcYmen: I'm following you on 4clojure, we implement pretty much the same logic, just express it differently
18:48cYmenjustin_smith: are you noisesmith?
18:49justin_smithyeah
18:49cYmenyeah, looking at it :)
18:49cYmenyou are the only guy I'm following so I look at all your solutions ;)
18:49justin_smithyour min-key / take/drop thing is the same logic I implemented by sorting the sequences by first
18:49justin_smithheh
18:49justin_smithsome of mine are terrible
18:49cYmenwell..yes
18:49cYmen:)
18:50dnolen#js tagged literals in master - http://github.com/clojure/clojurescript/commit/91f6a3223122e3ae147cca0e9838f84290292789
18:50bitemyappKorma users, I got a ping about some changes that are desired.
18:50bitemyappakurilin: seangrove ^^
18:50bitemyappfrom a company that seems to be using it. Hopefully they'll be tossing me ideas for improvements. Consider this a general solicitation.
18:50bbloom_dnolen: let me toy with it a bit :-)
18:51cYmenjustin_smith: I should stop trying to optimize prematurely. I thought about sorting but decided against it because it isn't necessary.
18:51akurilinbitemyapp: as in, you're welcoming requests for improvements?
18:51dnolenbbloom_: heh, will look into fixing the quoting issues next :)
18:51bbloom_dnolen: that's a fair bit trickier. i think we need a protocol for that
18:52bbloom_dnolen: if you recall we discussed it: it's got to be per code generator
18:52bitemyappakurilin: uh sorta, but I'm not planning to superhero anything myself. I'll help on things somebody else starts.
18:52bbloom_dnolen: ie you need a different back end for js or for lua or for jvm or whatever
18:52bitemyappakurilin: this is to avoid a fork and improve Korma.
18:53bbloom_dnolen: the assert is pretty annoying in the repl. if you get a bad literal it kills repljs
18:53akurilinbitemyapp: what's the plan as far as backwards compat goes here? There were some ideas we were talking about regarding a "mini-korma" that might be worthwhile for big korma, but they also might break people.
18:53dnolenbbloom_: yeah it should be switched to a proper warning - was just copying what was already done
18:53akurilinThinking stuff like passing db pools/connections into each query etc.
18:53bitemyappakurilin: I'm the one that wants a mini-Korma, I'd rather focus on industrial needs though. I'll leave mini-korma alone if nobody asks for it.
18:54bitemyappakurilin: this is likely to lead to some API breakage, so it'd be a 0.3.x / 0.4.x thing if these guys are serious about these changes.
18:56akurilinI wonder if I'm the only person to mock stuff around here. I always have to wrap korma calls with something I can then stub out individually in tests.
18:56bitemyappakurilin: all of this hinges on this company being willing to implement what they want though.
18:56bitemyappakurilin: you're supposed to do that. stub out model calls.
18:56bbloom_dnolen: hurray js literal :-)
18:56bbloom_dnolen: works great
18:56bbloom_dnolen: would be nice to document it :-)
18:57akurilinbitemyapp: "model call" can mean a bunch of things. Are we talking specifically about DB calls?
18:59justin_smithcYmen: I was optimizing; optimizing for readability :)
18:59justin_smitheasier to be clear and correct, then make it fast
18:59justin_smithunclear and wrong and fast -> correct is a very hard transition
19:00justin_smithnot saying I don't often I fail at that, but that's what I am usually aiming for at least
19:00bitemyappakurilin: I mean model function. It'd be easiest to explain by example.
19:01cYmenjustin_smith: I _try_ but my mind works (and sometimes doesn't) in mysterious ways
19:01bitemyappakurilin: just uhh, you know, abstracting your controllers/views from the specifics of the data layer.
19:01cYmenand so does the resulting code :p
19:01akurilinbitemyapp: I get it. I'm not sure sure I'm personally decoupling this as well as I should, so I'd be curious to see how the pros do it at some point.
19:08danneuHas anyone ever had Adsense disabled for having ads on a non-content page (404 in my case)?
19:11abpdnolen: re js-literal, wouldn't mapcat be more appropriate than apply concat in read-js?
19:13bitemyappakurilin: easiest way to find out is to come to one of the meetups I'm at and let me do a tutorial after the talk.
19:13bitemyappcode-n-talk
19:14akurilinbitemyapp: sounds fair, would appreciate that.
19:14bbloom_abp: better yet (for [[k v] form, x [(name k) v]] x) /cc dnolen
19:15bbloom_abp: eh, nah, mapcat is better lol
19:15abpbbloom_: at least you tried :D
19:16eggheadlol justin_smith cYmen after your chat I had to solve it... got it to 5 lines
19:16bbloom_abp: fn is just not short enough :-P
19:16justin_smithegghead: nice
19:17eggheadspoilers inside: https://www.refheap.com/21570
19:18DAAAMNChousuke, ping?
19:20eggheadwhat is your username on there justin_smith
19:22abpbbloom_: Are you somewhat familiar with the changes around keywords in cljs?
19:23bbloom_abp: somewhat. dnolen & seangrove would know best
19:23abpbbloom_: This code can't work anymore, right: https://github.com/Prismatic/dommy/blob/master/src/dommy/macros.clj#L97
19:23abpI think it needs keyword-identical? .. probably
19:24bbloom_abp: um, no that's probably fine b/c the identical? is occuring in the macro expansion. that's evaled on the jvm
19:27amalloybbloom_: fwiw, some time ago i wrote a function knit such that your for-expression above could be (mapcat (knit name identity) form)
19:28bbloom_amalloy: so is that basically juxt with an extra set of [] in the arg list? :-P
19:28devnGiven a map: {"some-filename" ["field1" "field2" "field3"] "another-file" ["field2" "field3"]} -- I want: {"field2" {:files ["some-file", "another-file"] :count 2} "field1" {:files ["some-file"] :count 1} "field3" {:files ["some-file" "another-file"] :count 2}}
19:29bbloom_amalloy: seems like a useful little combinator
19:29amalloybbloom_: no, you'll see that juxt does something different which doesn't work here
19:29bbloom_amalloy: er yeah, i gotcha
19:29amalloy((juxt f g) x y) => [(f x y) (g x y)], ((knit f g) [x y]) => [(f x) (g y)]
19:30bbloom_amalloy: http://docs.factorcode.org/content/article-dataflow-combinators.html
19:30bbloom_juxt : cleave :: knit : spread
19:31amalloywell, i knew when i wrote it that it was just stolen from haskell: https://github.com/flatland/useful/blob/develop/src/flatland/useful/fn.clj#L94
19:31bbloom_cool
19:33justin_smithegghead: noisesmith, same as my github
19:34eggheadcool, thx
19:35justin_smithdevn: maybe something with set ops and group by?
19:35justin_smith*group-by
19:35devnhrm -- i think my issue is that im screwing up (apply #(update-in ...) ...) and (apply #(assoc-in ...) ...)
19:36devni keep getting various wrong number of arguments issues
19:39devnnevermind figured it out
19:40devnnevermind, no i didn't :)
19:43gfredericksdoes anybody remember a (toy?) clojure lib for generating instances of a given regex?
19:43amalloydevn: i think step one is (for [[file fields] m, field fields] {field file})
19:44amalloyor probably {field [file]} at the end there, to make it easier to merge-with into
19:44amalloy(apply merge-with into (for [[file fields] m, field fields] {field [file]}))?
19:44abpgfredericks: nope, only that: https://github.com/noprompt/frak
19:44gfredericksyeah that's what google keeps pointing me to :)
19:44devnamalloy: this is what i was trying: https://www.refheap.com/21571
19:45amalloyoh, i missed the count
19:45gfrederickshas anybody done regex parsing at least?
19:46nopromptgfredericks: it's one of the things i've been meaning to get around to.
19:46amalloywhat is the count for? it looks like just the count of the vector it's referring to. why include that at all?
19:46nopromptgfredericks: i keep running in to these places where are re parser would be useful.
19:46devnamalloy: it's to count the number of occurrences of a field across all files
19:46gfredericksnoprompt: I bet feeding the results into simplecheck would be pretty straightforward
19:47nopromptgfredericks: btw if you look at frak, i'm open to *any* improvements as i'm sure the algorithm is not the best.
19:47abpgfredericks: https://github.com/weavejester/re-rand
19:47devnamalloy: but to still maintain which files it was counted from
19:47nopromptgfredericks: i was trying to solve a problem so i wasn't focused on performance necissarily.
19:47dnolenBronsa: if there's a tagged literal error what error should I throw so that the reader catches it and rethrows w/ file/line info?
19:48devnamalloy: what im doing in that refheap is now pretty different from what i think i am asking above
19:48gfredericksnoprompt: I linked to the english-words gist on twitter a few months back and it virally exploded
19:48gfredericksby far the most popular thing I ever done tooted
19:48swartI'm seeing the following problem on OS X - any suggestions as to what I'm doing wrong? http://pastebin.com/pq9P2qxL
19:49gfredericksabp: oh that was totally it! thanks
19:49gfredericksoh wow it's three years old
19:49nopromptgfredericks: ah, that's what it was. haha, i thought i was being trolled when it went from 17 to 200 stars over night. :P
19:50justin_smithswart: it is happening while it is reading your profiles
19:50nopromptgfredericks: thanks for sharing it :)
19:50gfredericksnoprompt: I would've more vigorously linked it to you if I'd known it'd get that much attention
19:50justin_smithswart: maybe try temporarily moving your profiles.clj if you have one, or checking your project.clj for errors
19:50justin_smithswart: does lein repl in a directory with no clojure project work?
19:51gfredericksnoprompt: https://twitter.com/gfredericks_/status/366694207995392000
19:51nopromptgfredericks: what surprised me the most is that most of the people who starred/watched it aren't clojure programmers.
19:51gfredericksjustin_smith: I think so
19:51swartjustin_smith: yes. it does
19:51swarthmm. I've got some funky stuff in my profile from when I was playing with emacs
19:52gfredericksnoprompt: yeah I kind of observe that from the twitter reaction too
19:52justin_smithswart: yeah, I bet there is a syntax error in your profiles.clj or that project's project.clj
19:52nopromptgfredericks: some people thought that regex was a hoax. it was just the first thing i thought to do once i had it working.
19:52swartjustin_smith: that fixed it
19:52nopromptgfredericks: it's kinda funny.
19:52gfredericksnoprompt: yeah I was jealous I hadn't thought of that myself :)
19:52eric_normanddnolen: pure + hiccup macro is super fast
19:53swartI had this in there :jvm-opts ^:replace []
19:53dnoleneric_normand: I believe it :) and I have some more optimization ideas in mind but we'll see how fast the naive version is first
19:53Bronsadnolen: as long as it's not an ExceptionInfo it will be automatically get wrapped into one with :line/:column
19:53gfredericksnoprompt: it made me think of plugging such a thing into a DFA minimization algorithm; so I tried that but the results were hairy
19:53swartistr it was an optimization recommended by overtone
19:53swartjustin_smith: thanks
19:53justin_smithnp
19:54gfredericksnoprompt: oh here it is -- the minimal DFA for some small subset of words: http://upload.gfredericks.com/graph.svg
19:54gfredericksI used a subset just to make it tractable
19:54eric_normanddnolen: and easy, too
19:54nopromptgfredericks: i've been slowly trying to learn about nlp and ml so i can build an program that makes subtle transformations to large bodies of literature. lol. ie. turn frankenstien in to a madlib and then automatically fill it out. haha.
19:55eric_normanddnolen: I was skeptical of the pure value
19:55eric_normanddnolen: but it was easy to choose
19:55nopromptgfredericks: oh wow. this is beautiful.
19:55dnoleneric_normand: yeah I think once you're used to this you'll never want to go back to anything else for client side UI rep
19:55gfredericksit's something
19:55nopromptgfredericks: this would make a great poster.
19:55eric_normanddnolen: and in every case identical if it didn't vhange
19:55dnoleneric_normand: yep
19:55eric_normandchange
19:56dnoleneric_normand: we're emerging from the stone ages for front end development
19:59gfredericksdoes core.async get used to have channels between browser and server?
19:59gfredericksis that the recommended way of communicating now?
20:00gfredericksnoprompt: I wish it were possible for this sort of diagram to be remotely legible; a lot of the edges get too tangled
20:00dnolenBronsa: excellent thanks!
20:01bitemyappHTTP content negotation. oh-my-god.
20:03nopromptgfredericks: that or at least interactive. iow you could click and drag nodes around.
20:04gfredericksnoprompt: ah right
20:04nopromptgfredericks: come to think of it, isn't there a js library that does graphs like that?
20:05nopromptgfredericks: i'm fairly sure clojure atlast uses something that displays interactive graphs. i know neo4j's web console does too. it might be fun to try using something like that.
20:05noprompt*atlas
20:05clojurebotexcusez-moi
20:05gfredericksyeah it wouldn't surprise me
20:06dnolenbbloom_: hrm, so I guess reader literals are specially treated somehow so they always self evaluate?
20:14amalloydnolen: i doubt that's the case. if i installed a reader literal such that #foo/bar x read as (foo x), i'd expect the compiler to emit a call to foo
20:15devnamalloy: this is closer i guess... https://www.refheap.com/21571
20:16amalloyand in fact i'm sure that's how it works; i know someone wrote a reader literal #spy x that expands to (spy x), where spy is some macro of theirs (i don't claim this is a good idea, only that it works)
20:17pdkwait
20:18pdkclojure added user supplied reader macros now?
20:18amalloydevn: what is the deal with (apply #(assoc-in m [%2 :files] [k]) vs), vs (assoc-in m [(second vs) :files] [k])?
20:18amalloypdk: not really. a fairly limited subset
20:18pdkwhat's the story
20:18pdkdid they just add a few predefined ones and let you supply the implementation as desired
20:19dnolenamalloy: you sure? ''#inst "2012", #inst "2012" always self evaluates, same for the other literals
20:19dnolenamalloy: doesn't matter the level of quoting
20:20dnolenamalloy: or sorry, you're suggesting the behavior, I was just wondering if the defaults are special cased to have this behavior
20:20dnolenI mean you were suggesting the behavior of a custom data literal
20:20amalloyi apparently don't understand what you mean by "self-evaluates". do you mean that (= (eval x) x), for all x that were produced by a reader literal?
20:20dnolenamalloy: a reader literal always evaluates to itself, regardless of the level of quoting
20:21dnolen,''#inst "2013"
20:21clojurebot#<SecurityException java.lang.SecurityException: denied>
20:21dnolenheh right
20:21dnolenanyways that'll emit (quote #inst "2013")
20:23amalloydnolen: it doesn't do that for me
20:23amalloyuser=> ''#inst "2013" ;; => (quote #inst "2013-01-01T00:00:00.000-00:00")
20:23bitemyappRaynes: I would watch TV again for that.
20:23Raynesbitemyapp: Agreed.
20:23dnolenamalloy: er that's what I meant
20:24justin_smith''''#inst "2013" -> (quote (quote (quote #inst "2013-01-01T00:00:00.000-00:00")))
20:24amalloythen...i don't see how self-evaluating enters the picture at all. ''x always prints as (quote x), for all x. (modulo how that x is printed; in this case, it prints with more precision than you wrote)
20:24dnolen''''#inst "2013-01-01T00:00:00.000-00:00" -> (quote (quote (quote #inst "2013-01-01T00:00:00.000-00:00")))
20:24dnolenamalloy: ^
20:24devndnolen: you're talking about reader literals in cljs or clj?
20:25dnolendevn: I'm trying to understand the clj behavior so I can replicate it
20:25devnahhh
20:25amalloydnolen: i see that, but i don't know what property you're getting at
20:25amalloyit's definitely not the property of self-evaluation
20:25amalloybecause ''(inc 1) prints as (quote (inc 1)), even though (inc 1) is clearly not self-evaluating: it evaluates to 2, of course
20:26dnolenamalloy: an #inst is just a java.util.Date
20:26dnolenamalloy: my point is this must be preserved some how
20:26dnolenif I make a #foo [1 2 3] -> (foo 1 2 3)
20:26dnolen''#foo -> (quote (foo 1 2 3))
20:26devnso i've seen several variations on the initial example dnolen provided, in one case he uses ''#inst "2013" and in another he used the entire output as input
20:26devnuser> ''#inst "2013"
20:26devn(quote #inst "2013-01-01T00:00:00.000-00:00")
20:26dnolennot (quote #foo [1 2 3])
20:27dnolenamalloy: ^
20:28amalloydnolen: that's just how the compiler prints Date objects
20:28amalloyit doesn't remember that it was read in as an #inst
20:29amalloy,(java.util.Date.)
20:29clojurebot#inst "2013-12-07T01:29:05.342-00:00"
20:30dnolen'''(java.util.Date. "2012")
20:30amalloyso #inst reads as a Date, and then the repl says "hey i need to print this object", and then the Date is printed with #inst
20:30dnolenobviously won't do that
20:30dnolenok that makes sense
20:30amalloydnolen: well, of course, because that doesn't build a date
20:30amalloy#inst happens at read time
20:30devn,(macroexpand-1 '#inst "2013")
20:30dnolenamalloy: right, anyways, I'll have to think about this some more - thanks.
20:30clojurebot#<SecurityException java.lang.SecurityException: denied>
20:31devn=> #inst "2013-01-01T00:00:00.000-00:00"
20:43devnamalloy: re: your earlier question -- i think this is closer, but i'm open to suggestions https://www.refheap.com/21571
20:46devnwhich is totally superfluous in the if-not
20:58bbloom_dnolen: amalloy: sorry i only skimmed the chat
20:59bbloom_dnolen: amalloy: but "self-evaluates" is not a good way to think about it. it's simply *not* evaluated
20:59bbloom_dnolen: amalloy: if a reader literal returns a symbol, it won't be resolved or anything. it will just be passed along to the macro or whatever
21:00bbloom_a major feature of reader literals is that the domain of macros is expanded to include non-syntax constructs
21:00bbloom_dnolen: basically, reader-literals should be compiled in to the constants table
22:00devnDo you refer to yourself as a Clojurist or a Clojurian?
22:01devnInquiring minds want to know.
22:01seangroveClojurian is the term, I believe, but I'm not a fan of associating myself solely with a language like that
22:02joegalloboth terms make me vomit into my mouth a little, but that's just me
22:02`cbpi refer to myself as cesar
22:02devnseangrove: I was mostly interested to know if anyone had actually used "clojurian" regularly. I remember the poll where clojurian beat out conjurer, clojurist, etc.
22:03devnPython folks tend to say Pythonista without hesitation. Or at least, that's been my experience.
22:03joegallothere it is again, a little bit more vomit
22:03joegalloso i guess it works for pythonista too
22:03joegalloamazing
22:03devnI heard pythonista today from a few people and I'll agree with you, it sounds ridiculous.
22:04joegallomy grandfather was a farmer so that my father could be an engineer so that i could be a pythonista
22:04joegalloi have shamed the generations that came before me
22:04devnSo there are euphemisms, and there are the lesser known dysphemisms.
22:05devnI wonder what "pythonista" would be classified as.
22:05Raynesdevn: I'm a Clojuristian.
22:05seangroveTaxonomy...
22:06devndysphemisms according to Steve Pinker are, for example, when you're talking with your doctor, and instead of saying: "Do you plan to take a stool sample?" you say: "Do you plan to take a doo doo sample?"
22:06devnI think pythonista is pretty close to a dysphemism
22:06Raynesdevn: Was that my poll? I feel like I ran a poll like that when I was like 15.
22:06devnRaynes: that makes 1 of us. :)
22:07devnRaynes: you may have as well. it's crazy you were hanging around clojure town on 56k back then.
22:07Raynesdevn: 56k?
22:08devnall of this talk about running Clojure on giant Azul clusters and you were rocking some primitive internets.
22:08devnRaynes: I remember you telling me you had dialup
22:08RaynesOh!
22:08RaynesYes.
22:08bbloom_seangrove: there's a difference between "I'm an american, and damn proud of it!" and "I have american citizenship"
22:09bbloom_i use clojure & participate in the community, that makes me a cloju-wahtever-ist-ian
22:09bbloom_that's a fact about me, it doesn't define me. you can use the word w/o letting it define you :-)
22:13devnCan someone tell me what to do to fix this? I can't brane good today and think I have a case of the dums. https://www.refheap.com/21571
22:13justin_smithhttp://thisplacejournal.com/ <- since I did not work on the latest caribou site, I can say it is totally awesome
22:13devnthe whole (into {} (map #(update-in m [%] conj k) vs)) thing grosses me out
22:15devnjustin_smith: im confused. is this the caribou website?
22:15justin_smithit is the latest of the sites constructed using caribou
22:16devnjustin_smith: you need your designers to show the caribou docs site some love
22:16justin_smithwe do
22:16devnbut then again, don't be those guys who spend more time branding than making it usable
22:16justin_smithheh
22:17justin_smithdon't worry, our designers don't write caribou code
22:17devndesign is time-consuming and is sometimes a complete waste for libs and docs
22:17justin_smithso it isn't either or
22:17justin_smithour designers are dedicated, they don't even html
22:17justin_smithspecialists
22:17devns/our designers don't/our designers won't/g
22:17justin_smithheh, that's not what they are good at
22:17justin_smithwe have frontend guys for that
22:18justin_smithhell, if we even got a frontend guy to give our docs site a looking at that would even help
22:19devnWe have a gradient
22:19justin_smithyeah, that is common, we are really hyper-specialized around our design
22:19devnThere needs to be a good set of bridges between design, front end, and back end
22:20justin_smithhell, we have art-directoris that don't even do design - just guide it
22:20devnotherwise you get things which cannot be built for the web without huge sacrifices
22:20devnblood letting and the whole deal
22:20justin_smithwe have conversations to cover that
22:21justin_smithit is very horizontal compared to most workplaces
22:21justin_smithwe get in an argument with a designer, and figure out what actually is doable
22:21devnjust to temper my contrarian attitude
22:21devni think thisplacejournal.com looks lovely
22:21devntell your designers i said so :)
22:21justin_smithoh, thanks
22:22devnRaynes: hot.
22:22bbloom_Raynes writes web frameworks to harvest the blood of users for his now widely publicized vampire bloodlust
22:23devnjustin_smith: tiny bit of feedback: http://thisplacejournal.com/chapter/1
22:23devnwhen it fills half my screen i have no idea i can scroll
22:23devni needed to expand it to figure that out
22:23justin_smithweird, what browser? I get a scroll bar
22:23devnchrome
22:24devnjustin_smith: what os?
22:24justin_smithubuntu ringtail
22:24justin_smithchrome
22:24devnjustin_smith: yeah, on osx they hide the scrollbars until you scroll
22:24devnso because it doesn't show the box with the down arrow you don't know to scroll
22:25justin_smithweird, I am literally the only person not using osx at work
22:25justin_smithyou would think they would notice this
22:25devni have some some design
22:25devndone some*
22:26devnif you like the way it looks on a big screen there is a strong tendency toward saying: "fuck you. this is art."
22:26RaynesOh my.
22:26RaynesThat was lovely.
22:26devnit's like if guernica were 8.5" x 11"
22:26justin_smithdevn: making a ticket on the tracker, thanks
22:27devnjustin_smith: no problem. i hate to be a critic. i think it's really nice.
22:27devnbbloom_: yeah, raynes is a vampire
22:27devni've had too many 3:30AM conversations to believe otherwise
22:28devnwhich begs the question: "am *I* a vampire?"
22:30devnjustin_smith: i assume you've seen this, but you and anyone else in here who hasn't, oh my good lord: http://acko.net/
22:30justin_smithdevn: no, the feedback is appreciated, and since I won't be the one needing to address the bug ticket, it's no skin off my back
22:30justin_smithdevn: nice
22:30devnjustin_smith: it gets better
22:30devnwait til it's done, then scroll
22:30devnthere's a preferences pane to adjust the settings, too
22:31devnclick the play button
22:31justin_smithman, now I want to submit those arrows to the 3d printer in the office
22:31devnetc.
22:31justin_smithin other news, there is a 3d printer in the office, woot
22:32devnwe just bought a really nice mixer and a bunch of recording gear. we're building a stage in the office. We've been doing concerts, but they're going to get more legitimate. We work next door to a decent venue.
22:32justin_smiththat is some nice webgl
22:32justin_smithcool
22:32justin_smithwe have concerts by our teepee
22:32justin_smithoccasionally
22:32devnjustin_smith: his stuff is better than any i've seen
22:33justin_smithit is really good
22:33devnjustin_smith: go to the widget thing in the upper right, and change it to EGA
22:33justin_smithI've been poking at that
22:34devnbetween your company's work on thisplacejournal and acko.net my machine is a full-on space heater
22:34justin_smithlol, need a new gpu?
22:34justin_smithyeah, thisplace is rough of the processor too
22:34justin_smithI noticed that
22:35justin_smithlike system loads almost hitting 4
22:35devnjustin_smith: nah, i'm on a mac. i tried to run linux on this thing, but the macbookpro early 2011 is an absolute piece of garbage when it comes to running just about any distro
22:35devnfelt like running gentoo again, except worse
22:35devnim too old for that shit
22:36justin_smithwait, who said linux?
22:36devnyou did earlier i though
22:36devn03:24 < justin_smith> ubuntu ringtail
22:36justin_smithahh
22:36justin_smithjust seemed like a non-sequitor just now
22:37devnwhen you said "new gpu?" i felt like that's something you only ask someone who has control over their damned hardware
22:37devnwhich i most certainly do not at the moment
22:37justin_smithahh
22:37justin_smithnow the pieces fit together
22:39devn,(-> (interleave "devn" "justin_smith") sort)
22:39clojurebot(\d \e \j \n \s ...)
22:44Raynesdevn: Gee, get a room man. ;)
22:46hyPiRion,(->> (concat "Raynes" "hyPiRion") sort (take 3) (apply str))
22:46clojurebot"PRR"
22:50devnheh
22:51devnso, last shot at this, but I would love to hear if anyone has a better solution to do the same thing: https://www.refheap.com/21571
22:52devnderp, that last (into {}) should be (into (sorted-map))
22:54devnguess it doesn't much matter -- ultimately the result gets grouped-by the count of the number of items in the seq on the RHS
23:11devnSo, it took me a good 3 years or so, but alandipert finally made me realize how significant it is that IFn is a protocol in clojurescript.
23:12seangrovedevn: How so?
23:12devnmake /all the things/ callable!
23:13devnlike (map #"foo" ["foobar" "bar" "baz"])
23:13seangroveHrm... yes, but that seems like a reasonable enough idea. What were the 3 years spent struggling over?
23:13devnseangrove: nothing in particular
23:13devni worked on cljs before it got released and i guess I just didn't notice IFn sitting there
23:14devnalan and i were talking about a problem i was working on and he suggested making the records i was working with invokable
23:14seangroveAh, I see
23:15devnthere's a fair amount of pain in doing this in clojure
23:15devnclojurescript makes it wildly simple though
23:15seangroveOh, I didn't know that it wasn't a protocol in clojure
23:15devn*nod*
23:15devnseangrove: https://gist.github.com/alandipert/2346460
23:15seangrovedevn: Well, that makes sense then
23:16seangroveI believe that's pretty well discouraged though, isn't it - extending protocols to native js types?
23:19abpseangrove: I'd say (without much experience in cljs) as discouraged as extending protocols to any type. Why not?
23:19gdevis anyone making games with clojure or have we all just decided to make webapp games with clojurescript instead? asking for a friend
23:22seangroveabp: Sorry, just for libraries and the core language itself: https://groups.google.com/d/msg/clojurescript/vtBqlc6OfRI/fGvJCHPvgv0J
23:23devnseangrove: meh. i don't care if it's discouraged.
23:23devnit's fucking awesome.
23:23bbloom_devn: please don't do that
23:24bbloom_:-P
23:24abpseangrove: Oh yeah forgot about that rule. Applies to Clojure as well.
23:24devngah "that rule"
23:24devnthis community needs to lighten up a bit and let people program how they want to program
23:24bbloom_this the the whole type classes are unacceptable modules, but modules are unacceptable type classes problem
23:25abpdevn: Incompatible libraries ain't fun.
23:25devnabp: so don't use them
23:26devnabp: i just find it all to be in the spirit of squashing creativity before it starts
23:26bbloom_https://www.evernote.com/shard/s57/sh/14479b49-11a1-444b-ba23-a42dfd21e0f8/560fb8a4deb7828b7488fb1f7d1b47ba
23:27SegFaultAXdevn: Not that this is one of those cases, but there are some types of mistakes that we as a community don't need to continue to make. And we certainly shouldn't encourage or condone others to do so.
23:27abpdevn: Also I've put it as "that rule" is mostly because I'm tired.
23:28devnSegFaultAX: yeah, i just find it annoying that everyone always needs to make the case against doing something. they rarely mention when it might be correct, beneficial, novel, etc.
23:28bbloom_devn: there's a reason ruby has one and only one successful "active support" type project
23:29bbloom_devn: b/c you can't have two active-support-like things monkey patching every class everywhere
23:29SegFaultAXdevn: The common rebuttal to that argument is of course, if you're good enough to know you need to use a tool in a given way, you're good enough not to need to ask.
23:29bbloom_it just doesn't work
23:29devnmacros are the same deal. i get sick everytime i hear someone remind some poor newb how macros are scary are not to be trifled with. playing with macros is a rite of passage. who are you to deny a clojure newb of their right to explore lisp?
23:29SegFaultAXgoto is oft cited as an example of something that most people should never use and will never need, but there are definitely appropriate times where it should be applied.
23:30abphuh
23:30bbloom_seangrove: i'm not sure whether i should be offended or ashamed
23:30SegFaultAXbbloom_: A bit of both?
23:30SegFaultAX:)
23:30bbloom_heh
23:30SegFaultAXseangrove: Sick burn.
23:30bbloom_this is a problem i've spent a bunch of time thinking about
23:31Raynesbbloom_: Man. bitemyapp ain't that bad.
23:31RaynesHe's a little aggressive sometimes, but dude's got a heart of gold.
23:31nonubyjust spiking something and noticing something odd with possibly vim-fireplace http://imgur.com/6Fwz3Rb, println should flush the buffer yet "x" isnt printed, only the first "xa"
23:31bbloom_Raynes: bitemyapp has been exceptionally well behaved recently. forgive my joke
23:31seangroveRaynes bbloom_: Just meant because of the the type classes, modules, and haskell references
23:31SegFaultAXAs someone who has hung out with Chris a lot IRL, I can attest to what Raynes is saying.
23:32devnSegFaultAX: exactly. that's what i'm saying. in 2009 stuart halloway gave a talk about clojure. he called it a "consenting adults language". I would like to see people in this community treat others like adults and quit discouraging exploration. I think it's counter-productive. Despite all of this negativity, people still write libraries which don't play well with others. Part of learning a language is learning how far to take a particular aspect of that ...
23:32devn... language. This isn't something we should prescribe. It's something people learn on their own.
23:33seangrovedevn: It's cultural momentum, and it's not entirely bad. Habits that have hurt others accumulate and are more heavily communicated.
23:33bbloom_devn: i'm not saying that you shouldn't extend protocols to see what happens. i'm saying you shouldn't publish a library that does that & expect ppl to use it w/o bitching that it BREAKS THEIR CODE
23:33SegFaultAXdevn: I dunno, what you are saying sounds pretty ridiculous to me. Of course there is nothing we can do to stop someone from going off and doing something crazy. People do it all the time (in Clojure and elsewhere)
23:33devn"You can't tell someone their favorite band."
23:33seangroveDoesn't mean it's impossible for new people or others to change it, but it's going to take a lot of time and effort.
23:33SegFaultAXBut if you come here asking for help, shouldn't we be promoting only the best ideas?
23:34seangrovebbloom_: Why are all these arrows here?
23:34devnSegFaultAX: i think good educators don't /tell/
23:34bbloom_SegFaultAX: eh, we could provide wild & crazy ideas too, as long as we label them as such and then don't make that a permanent label if the wild and crazy turns out to work nice
23:34SegFaultAXbbloom_: Sure.
23:34seangroveAnd what does "pi not lambda" mean in this case?
23:34devnIf you've ever read Polya's book How to Solve It, there are things a good teacher can do
23:34bbloom_seangrove: lol sorry. previous slide showed the axis. X = increasing power, Y = increasing difficulty/complexity
23:35devnthe absolute last one on the list is to say "here's exactly how to do it"
23:35technomancy<3 socratic dialog
23:36bbloom_seangrove: i'm not sure about the pi not lambda comment
23:36bbloom_i assume it's a type theory thing
23:36seangrovebbloom_: Sounds like some cool wisdom, but not sure what pi means, heh.
23:37bbloom_seangrove: best guess: http://en.wikipedia.org/wiki/%CE%A0-calculus
23:38seangrovebbloom_: Wow, very interesting, thank you for the link.
23:38bbloom_seangrove: in theory, you could think about type classes, protocol impls, etc as being process-local
23:39bbloom_random thought: the parent in the process tree, such as the -main function, gets to pick which implementations of hte protocol/type-class get applied
23:39bbloom_maybe the ruby "refinements" idea is worth studying
23:39bbloom_http://www.rubyinside.com/ruby-refinements-an-overview-of-a-new-proposed-ruby-feature-3978.html
23:39seangroveI thought the idea of protocols was that each namespace could opt to bring in its own type extensions without requiring the rest of the world to opt-in
23:40bbloom_seangrove: the issue (assert (some owns? [protocol type]))
23:42seangrovebbloom_: As in two protocols I've brought into my namespace extend the same type in contradictory ways?
23:42devnbbloom_: owns?
23:43bbloom_owns in the sense of the political party which dictates the semantics of
23:44bbloom_somebody might check satisfies? and branch on that, or somebody else might expect the java.lang.Object or :default behavior to occur
23:44nonubyhttps://github.com/tpope/vim-fireplace/issues/115 - if there is something fundamental (or stupid) ive missed that Im not seeing the second println please let me know so I can remove the potentially embarrassing bug report
23:44seangrovebbloom_: But surely this is only a problem for a specific namespace when two protocols I opt into (again for that specific namespace only) extend the type?
23:44bbloom_seangrove: namespaces don't affect protocols at all
23:45seangrovebbloom_: It seems like they could, though there might be some performance overhead...
23:45bbloom_seangrove: are you familiar with ML modules/functors?
23:45seangroveAnd thinking about it, it would probably rely on a stronger sense of types
23:45seangrovebbloom_: Nope
23:46bbloom_seangrove: it would be enlightening to study them
23:46bbloom_there's no really good reference that i know of for them tho
23:46bbloom_also worth studying: racket's units
23:46bbloom_http://docs.racket-lang.org/reference/mzlib_unit.html
23:46seangroveI'll google and spend a few minutes reading, see if it's graspable
23:46bbloom_http://docs.racket-lang.org/guide/units.html
23:47bbloom_A unit resembles a procedure in that both are first-class values that are used for abstraction. While procedures abstract over values in expressions, units abstract over names in collections of definitions.
23:48bbloom_the trickier bit is what to do about PARTIAL definitions, which is what protocols/type-classes are
23:48bbloom_or predicate dispatch too
23:48bbloom_it's a tough bag of problems
23:49seangroveGlad that people far, far smarter than me are working on it
23:50seangroveFunctors sound pretty interesting though, "lifters"
23:55bbloom_while i'm BS-ing in here instead of working and/or sleeping... everybody has their kids (and parents?) all signed up for an hour of code, right!??! http://csedweek.org/
23:56bbloom_the team over here at code.org has been busting our asses to bring the youth of planet earth a bad ass educational coding extravaganza this week. get in on it!
23:56seangroveWhat is this?
23:57decafadbot
23:57bbloom_decaf: i try to keep my shameless self promotion to a minimum while maximizing positive vibes for planet earth
23:58decafdo what you want somewhere else
23:58bbloom_seangrove: massive learn-to-code campaign w/ a super cool beginner tutorial i've been helping out with
23:59bbloom_google blockly, angry birds, plants vs zombies, mark zuckerberg, bill gates etc teach programming to kids ages 8 and up
23:59bbloom_monday is the big launch, but you can try it now :-)
23:59seangrovebbloom_: We were in the same batch as codecademy, and two of my sisters that don't already code clojure are going through it. You recommend this as an intro instead of LPTHW + codecademy?