2013-12-06
| 00:00 | brainproxy | with position on left vs. right the only indicator what's going on, since all the plumbing is in the macroexpanded code |
| 00:37 | deadghost | is there a clojure noobs channel? |
| 00:37 | arrdem | nope, you're in it. |
| 00:38 | arrdem | library authors and first timers. it's a fun crew :D |
| 00:38 | arrdem | brainproxy: any chance you have some open project(s) in this style? I'm curious... |
| 00:42 | kristof | AH. |
| 00:42 | kristof | It makes sense now. |
| 00:43 | kristof | I watched Tim's videos on core.async's innards. Clever stuff, albeit complicated |
| 00:44 | kristof | The 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:44 | kristof | I liked his naming of the machine itself: a "virtual virtual machine". |
| 00:45 | kristof | But yes, as I watched the second video, I kept shouting in my head "if only the JVM supported continuations!" |
| 00:47 | kristof | To 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:49 | bbloom_ | kristof: there are multithreaded environments w/ continuations |
| 00:49 | bbloom_ | kristof: continuations weren't really well understood theoretically until relatively recently... much after java came about |
| 00:50 | kristof | bbloom_: In your opinion, is it really necessary to have as much complexity as there is in core.async? |
| 00:51 | amalloy | bbloom_: i'd be interested to read about that. what did we learn about continuations recently? |
| 00:51 | bbloom_ | kristof: that's a loaded question :-P |
| 00:51 | kristof | amalloy: I have a nice paper saved on why undelimited continuations are bad, if you're interested. |
| 00:51 | amalloy | nah, i've read that |
| 00:52 | amalloy | i mean, i think i have, anyway |
| 00:52 | kristof | curses |
| 00:52 | bbloom_ | amalloy: well delimited continuations weren't really even discussed until 1987, which i guess is still 8 years before java |
| 00:52 | kristof | amalloy: You probably have if it sounds familiar. I can't think of any other well known papers with a similar subject. |
| 00:52 | kristof | bbloom_: It is certainly a loaded question! |
| 00:53 | bbloom_ | amalloy: the literature is pretty spread out, but http://okmij.org/ftp/continuations/ is probably a good place to start |
| 00:53 | kristof | Oh, yeah, that was what I was going to link. |
| 00:54 | bbloom_ | 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:54 | amalloy | that's quite a treasure trove |
| 00:54 | bbloom_ | amalloy: everything on oleg's site is gold |
| 00:54 | kristof | I concur |
| 00:55 | bbloom_ | 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:55 | bbloom_ | almost impossible to understand oleg w/o reading at least 4 or 5 references first :-P |
| 00:55 | bbloom_ | but then it's easy ;-) |
| 00:55 | bbloom_ | amalloy: the relationship to monads wasn't fully understood until 2005 |
| 00:56 | bbloom_ | http://lambda-the-ultimate.org/node/4334 |
| 00:56 | bbloom_ | that paper is a bit later, but it's actually very approachable |
| 00:57 | deadghost | http://pastebin.com/YgWRqPnn |
| 00:57 | deadghost | what am I borking up |
| 00:57 | bbloom_ | deadghost: you're trying to map over a url |
| 00:57 | bbloom_ | character by character |
| 00:58 | amalloy | yeah, line 17 should probably end with html |
| 00:58 | deadghost | whooops |
| 00:58 | deadghost | good to have extra eyes |
| 00:59 | bbloom_ | 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:59 | kristof | bbloom_: core.async is relatively new so that isn't an excuse |
| 00:59 | kristof | No, that's unfair of me to say |
| 00:59 | bbloom_ | kristof: no, it's not an excuse b/c it's not related at all |
| 00:59 | bbloom_ | continuations are a dynamic construct |
| 00:59 | bbloom_ | they operate on the evaluator over time |
| 01:00 | bbloom_ | core.async's transform is, by nature of the host, a lexical construct |
| 01:00 | bbloom_ | they operate on the evaluator over a region of code |
| 01:01 | bbloom_ | that's the best you can do w/o either VM primitives (JVM doesn't have them) or a manual CPS transform (slow) |
| 01:01 | kristof | bbloom_: The transform, maybe, but at runtime, isn't there continuation-like behavior happening? |
| 01:01 | bbloom_ | it's continuation-like, but it's much simpler than that |
| 01:01 | bbloom_ | it's a finite state machine |
| 01:01 | bbloom_ | continuations are non-finite machines |
| 01:02 | kristof | I've never done anything non-simple with continuations so I don't really understand the extent of their capabilities |
| 01:02 | kristof | I just saw all the execution-context-saving and made the connection, but perhaps it's unwarranted |
| 01:02 | bbloom_ | i feel like i link to this at least twice a week: http://arxiv.org/abs/1203.1539 |
| 01:02 | kristof | bbloom_: bookmarking |
| 01:03 | bbloom_ | 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:03 | bbloom_ | Eff shows what is really possible w/ delimited continuations as a language construct |
| 01:03 | bbloom_ | without a meteoric rise in complexity |
| 01:03 | kristof | bbloom_: And undelimited continuations are a bad idea (according to Oleg), right? |
| 01:04 | bbloom_ | kristof: it's not so much as they are a bad idea as they don't really exist |
| 01:04 | kristof | oh, that's a different thought |
| 01:04 | bbloom_ | kristof: an undelimited continuation is delimited by the top of the stack :-P |
| 01:04 | kristof | Well, true |
| 01:06 | kristof | bbloom_: 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:06 | bbloom_ | 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:07 | bbloom_ | 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:07 | bbloom_ | kristof: although js engines do perform a bit better with CPS transforms |
| 01:07 | bbloom_ | there's a compromise approach, which is what Scala does |
| 01:07 | bbloom_ | it's a "type-directed" CPS transform |
| 01:08 | kristof | any papers I can read about that? |
| 01:08 | bbloom_ | actually, it's "effect" directed, since it constitutes a type system that is parallel to the type system |
| 01:08 | bbloom_ | http://dl.acm.org/citation.cfm?id=1596596 |
| 01:09 | bbloom_ | 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:09 | arrdem | bbloom_: keep dumping papers please, I look forward to tomorrow morning's logs |
| 01:09 | kristof | bbloom_: Grr, I have to purchase this. Oh well : |
| 01:09 | kristof | *:) |
| 01:09 | bbloom_ | kristof: nah, i think that 1 is available somewhere |
| 01:09 | arrdem | kristof: if you ask nicely I'll rehost it for you :P |
| 01:09 | bbloom_ | http://infoscience.epfl.ch/record/149136/files/icfp113-rompf.pdf |
| 01:10 | bbloom_ | always ask scholar.google.com first |
| 01:10 | kristof | Oh, beautiful, thanks :) |
| 01:10 | kristof | Academic journals are the devil |
| 01:10 | kristof | profiting off poor scholars |
| 01:10 | arrdem | yeah it's gonna suck when I graduate and don't have instant access to ACM/IEEE anymore. |
| 01:11 | bitemyapp | had a ton of fun at the clojure meetup todaty. |
| 01:11 | bitemyapp | wish a bunch of you could've been there :) |
| 01:11 | kristof | bbloom_: So in your opinion, in a perfect world, would core.async be implemented the same way that it is now? |
| 01:12 | bitemyapp | in a perfect world, you get a result before computing it. |
| 01:12 | bbloom_ | kristof: why are you always looking for an easy answer? |
| 01:12 | bbloom_ | kristof: and why are your questions so negative? |
| 01:12 | kristof | bbloom_: I'm not trying to be negative, actually |
| 01:13 | kristof | Just wondering if there are facets of the JVM that caused problems |
| 01:13 | bbloom_ | kristof: in my opinion, the design of core.async is stellar given the constraints and the implementation is not in any way objectionable |
| 01:13 | bitemyapp | https://github.com/ajalt/fuckitpy |
| 01:13 | arrdem | bitemyapp: saw that. still evil. move on. |
| 01:13 | kristof | bbloom_: 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:13 | bbloom_ | 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:14 | arrdem | lol |
| 01:14 | arrdem | old habits die hard I guess. that or it's a way to trace macro expressions vs function expressions... |
| 01:14 | bbloom_ | kristof: the host was an obstacle yes, of course. that's why the transform the way it is, is so clever |
| 01:15 | bbloom_ | kristof: granted, that idea is unashamedly stollen from the C# folks |
| 01:15 | kristof | bbloom_: Their async isn't cps based, is it? |
| 01:15 | bitemyapp | I gave a talk about brambling at the meetup today. There aren't as amany people using Datomic as I thought. |
| 01:15 | bbloom_ | kristof: core.async is not cps, it is a state machine |
| 01:15 | bbloom_ | kristof: C# async also is a state machine |
| 01:15 | kristof | but go blocks are cps |
| 01:15 | bbloom_ | kristof: finite state machines, to be specific |
| 01:15 | bbloom_ | kristof: no, they are not |
| 01:15 | kristof | Oh, I guess I am confused |
| 01:16 | bbloom_ | c=continuation, p=passing |
| 01:16 | bbloom_ | there is no passing of the continuation |
| 01:16 | kristof | And I mean cps as in communicating sequential processes |
| 01:16 | bbloom_ | there is an integer that represents the current state |
| 01:16 | arrdem | 'night all |
| 01:16 | kristof | a la Hoare |
| 01:16 | bbloom_ | kristof: you're thinking of csp |
| 01:16 | kristof | OH, ha |
| 01:16 | kristof | Stupid acronyms |
| 01:17 | bbloom_ | no go re-read what i said now that you have the correct acronyms :-P |
| 01:17 | bbloom_ | s/no/now |
| 01:18 | bitemyapp | kristof: http://hueypetersen.com/posts/2013/08/02/the-state-machines-of-core-async/ |
| 01:18 | bbloom_ | k i'll stop dumping papers on ppl now |
| 01:18 | bbloom_ | gnight |
| 01:18 | kristof | bbloom_: Goodnight! Thanks for the references and talk |
| 01:19 | kristof | bbloom_: I'm trying to grok CSP and goroutines right now so that I can possibly port some of that stuff to Common Lisp |
| 01:19 | kristof | so this is all very helpful |
| 01:58 | deadghost | looking for a recommendation for a sql lib |
| 01:58 | deadghost | I'm partial towards postgresql if that makes any difference |
| 02:01 | sm0ke | ClassCastException java.lang.String cannot be cast to clojure.lang.Associative clojure.lang.RT.assoc (RT.java:702 |
| 02:01 | sm0ke | i am getting this error for some reason in a (assoc form) |
| 02:02 | sm0ke | couldnt figure out why, all the keys are keywords |
| 02:04 | sm0ke | ah i see ##(assoc "{}" :a 1) |
| 02:04 | lazybot | java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Associative |
| 02:47 | ered | deadghost: i'm partial to korma http://sqlkorma.com/ |
| 02:47 | ered | it sits on top of jdbc so anything that can do jdbc will work |
| 02:48 | deadghost | ered, I was eyeballing that |
| 02:49 | deadghost | any project with a site up that has nice looking docs and code to see is a good sign |
| 02:49 | ered | btw, http://www.clojure-toolbox.com/ |
| 02:50 | ered | it has answers to a lot of "is there a library for ____" |
| 02:50 | ered | even if sometimes it's a little out of date |
| 02:50 | deadghost | yeah I saw that |
| 02:50 | deadghost | but "is there" is different from "is it good" |
| 02:50 | ered | well i think it's good |
| 02:51 | deadghost | good enough for me |
| 03:26 | echo-area | How do you read monad? /məuneid/ or /məunə/ or /mɒnəd/? |
| 03:27 | echo-area | And what about monadic? /məu'neidik/? |
| 03:31 | clgv | echo-area: from merriam-webster.com \ˈmō-ˌnad\ |
| 03:34 | echo-area | clgv: Thanks |
| 06:54 | Guest93107 | hi 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:55 | goraci | my question ) |
| 06:58 | Apage43 | there's a couchbase sample config |
| 06:59 | goraci | i edit this config and transactor is not connected |
| 06:59 | goraci | edited |
| 06:59 | Apage43 | but 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:00 | goraci | i made a new bucket - desk |
| 07:00 | Apage43 | alright, that'll be what you set couchbase-bucket to in the datomic config then |
| 07:01 | goraci | there is Access control for this bucket - so one option with 11211 and password second dedicated port - what to choose ? |
| 07:03 | Apage43 | just set couchbase-host to localhost, don't actually put a port number on (other than 8091) |
| 07:03 | Apage43 | the service on port 8091 will be used by the client to discover the bucket configuration |
| 07:03 | Apage43 | but you'll want to set couchbase-password to whatever password you set for the bucket |
| 07:03 | Apage43 | in the datomic config |
| 07:06 | goraci | couchbase-host=localhost:8091 couchbase-bucket=desk couchbase-password=1234 |
| 07:06 | goraci | Starting datomic:couchbase://localhost:8091/desk/<DB-NAME>?password=1234 ... |
| 07:06 | goraci | Critical failure, cannot continue: Error starting transactor |
| 07:06 | goraci | java.lang.NullPointerException |
| 07:07 | goraci | at com.couchbase.client.CouchbaseConnectionFactory.getVBucketConfig(CouchbaseConnectionFactory.java:188) |
| 07:08 | goraci | why it's using DB-NAME i don't know |
| 07:09 | Apage43 | try without the :8091 |
| 07:09 | goraci | then Critical failure, cannot continue: Serve failed |
| 07:09 | goraci | HornetQException[errorCode=2 message=Cannot connect to server(s). Tried with all available servers.] |
| 07:10 | goraci | config above - protocol=couchbase |
| 07:10 | goraci | host=localhost |
| 07:10 | goraci | port=8091 |
| 07:10 | Apage43 | oh |
| 07:10 | Apage43 | no |
| 07:11 | Apage43 | the "host" and "port" without couchbase- in front are the host and port that the transactor *listens* on |
| 07:11 | Apage43 | you should change *that* port back to 4334 |
| 07:12 | goraci | ah this time it seems to be working |
| 07:12 | Apage43 | alright! |
| 07:13 | Apage43 | also 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:13 | Apage43 | where <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:15 | goraci | cool need to write somewhere to not forget )) |
| 07:16 | goraci | where it should be replaced btw ? in properties ? |
| 07:16 | goraci | and how |
| 07:16 | Apage43 | when you connect to a datomic db using the (connect) fn from the API |
| 07:17 | Apage43 | it'll be something like (connect "datomic:couchbase://...") |
| 07:17 | Apage43 | where <DB-NAME> was you'll put a name |
| 07:18 | Apage43 | *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:18 | Apage43 | so if you run the peer on another machine you'll need to make sure to deal with that |
| 07:19 | goraci | (connect "datomic:couchbase://localhost/desk/mydbname?password=1234 |
| 07:19 | Apage43 | yep |
| 07:19 | goraci | like that |
| 07:19 | goraci | ok |
| 07:20 | goraci | db as a value ) |
| 07:20 | Apage43 | you may have to (create-database) that same URI before that'll work |
| 07:20 | goraci | yea before connect , create-database should be |
| 07:20 | goraci | (create-database uri) |
| 07:21 | Apage43 | mmhm |
| 07:22 | goraci | but then |
| 07:22 | goraci | (def db (d/db (d/connect uri)) |
| 07:22 | Apage43 | that'll grab the db yeah |
| 07:22 | goraci | don't know why (create-database) needed then |
| 07:23 | Apage43 | (db) grabs the *current* value of the db out of a connection |
| 07:23 | Apage43 | it doesn't create anything |
| 07:23 | Apage43 | it returns a thing that is an immutable value. Think of it as being similar to derefing an atom |
| 07:24 | goraci | so you have to (create-database) before connection ? |
| 07:25 | goraci | or you can skip |
| 07:25 | Apage43 | the *first* time you connect you need to, after that you don't |
| 07:26 | Apage43 | if you *do* though, it won't hurt. It just doesn't do anything if a database already exists |
| 07:27 | goraci | hmm some hidden state ) |
| 07:30 | goraci | well thanks a lot will move to console to experiment with |
| 07:31 | goraci | we making project with clojure and want to use datomic as db ) |
| 07:31 | Apage43 | cool. I'm going to nap now =P |
| 07:32 | Apage43 | I happen to work at Couchbase, so if you have trouble with it specifically I can probably help |
| 07:33 | goraci | ok so far it's simpler then postgres for me ) |
| 07:33 | goraci | and web ui for admin tasks is cool |
| 07:34 | goraci | can you share your email in private message btw ? |
| 08:22 | OscarZ | im 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:22 | OscarZ | im trying to do something like existing "count" function |
| 08:23 | OscarZ | it always returns 0 :) |
| 08:27 | deadghost | OscarZ, I'm new to clojure |
| 08:27 | deadghost | and only used CL for a month |
| 08:27 | jballanc | OscarZ: look at your parens |
| 08:27 | llasram | ,((fn [x] :not :calling :anything 0) (range 10)) |
| 08:27 | clojurebot | 0 |
| 08:27 | deadghost | or listen to them |
| 08:28 | llasram | OscarZ: ^^ |
| 08:28 | deadghost | it looks like you made an anonymous function |
| 08:28 | deadghost | and never called it |
| 08:28 | deadghost | so it just returns the last value |
| 08:28 | deadghost | which is 0 |
| 08:29 | deadghost | does clojure let you call an anonymous function without funcall? |
| 08:31 | deadghost | http://pastebin.com/rn3yebhU |
| 08:31 | deadghost | I'm getting nullpointer exception |
| 08:31 | deadghost | and I don't know why |
| 08:31 | OscarZ | ah crap.. thanks guys |
| 08:33 | wei__ | 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:33 | OscarZ | wei__: you're right :) |
| 08:34 | wei__ | ,((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:34 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 08:35 | Pupeno_w | deadghost: unless I'm not understanding your question, yes: ((fn [x] (+ x x)) 2) |
| 08:35 | wei__ | probably not the best solution, hope someone improves on it |
| 08:35 | OscarZ | wei__: yeah i put (first x) as the if condition.. now it works |
| 08:35 | jballanc | deadghost: are you sure you're not getting an empty list back from html/select? |
| 08:36 | jballanc | ,(first '()) |
| 08:36 | clojurebot | nil |
| 08:36 | jballanc | ,(clojure.string/replace (first '()) #"\n" "") |
| 08:36 | clojurebot | #<NullPointerException java.lang.NullPointerException> |
| 08:36 | jballanc | that would be my guess |
| 08:38 | OscarZ | why is it that (boolean (rest ())) is true but (boolean (next ())) is false ? i remember running into this somewhere.. |
| 08:38 | jballanc | ,(rest '()) |
| 08:38 | clojurebot | () |
| 08:39 | jballanc | (if '() (print "truthy") (print "falsey")) |
| 08:39 | jballanc | whoops... |
| 08:39 | jballanc | ,(if '() (print "truthy") (print "falsey")) |
| 08:39 | clojurebot | truthy |
| 08:39 | jballanc | ,(next '()) |
| 08:39 | clojurebot | nil |
| 08:39 | jballanc | ,(if nil (print "truthy") (print "falsey")) |
| 08:39 | clojurebot | falsey |
| 08:39 | jballanc | unlike other LISPs, in Clojure an empty list is truthy |
| 08:42 | deadghost | jballanc, spot on |
| 08:42 | deadghost | looks like there was a missing addressing |
| 08:43 | deadghost | so it tried running str replace on nil |
| 08:43 | deadghost | *addresses |
| 08:43 | deadghost | *address |
| 08:44 | jballanc | yeah, 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:44 | jballanc | s/p/up/ |
| 08:44 | deadghost | see |
| 08:44 | deadghost | I don't know java |
| 08:44 | deadghost | at all |
| 08:44 | deadghost | that's why I tried CL first |
| 08:49 | deadghost | whoo |
| 08:49 | deadghost | got it working |
| 08:50 | deadghost | actually, is it an inevitability I'll need to learn java eventually if I keep on clojure? |
| 08:56 | brainproxy | arrdem: working on one |
| 08:56 | brainproxy | not public on github yet |
| 08:57 | bodie_ | 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:57 | bodie_ | I installed Leiningen and Clojure via Yum. |
| 08:58 | bodie_ | I have openjdk 1.7 if that helps. I seem to be seeing mostly missing Codehaus packages. |
| 08:58 | bodie_ | (I'm also asking in #leiningen and #fedora fwiw.) |
| 08:58 | bozhidar | bodie_: You don't really need to install Clojure |
| 08:59 | bodie_ | It's a dep via yum, so I'm not sure how to not install it. |
| 08:59 | bozhidar | bodie_: I'd suggest installing lein yourself using it's own installer |
| 09:00 | bodie_ | On that note, on my Arch setup (where Lein doesn't list Clojure as a dep) it works just fine. |
| 09:00 | bodie_ | OK, that was my next stop anyway. =) Thanks for the advice |
| 09:00 | nDuff | deadghost: not necessarily Java-the-language. Java-the-platform, yes. |
| 09:00 | deadghost | good to know |
| 09:00 | deadghost | one of my life's goals |
| 09:00 | deadghost | is to avoid java |
| 09:00 | bodie_ | right? |
| 09:00 | bruceadams | bodie_: i suggest not using yum for Clojure or lein. |
| 09:01 | bodie_ | OK. Thanks bruceadams and bozhidar! |
| 09:01 | bruceadams | lein will grab Clojure and everything else as needed, including different versions of Clojure as needed |
| 09:01 | arrdem | brainproxy: cool!, also 'mornin |
| 09:01 | bodie_ | 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:01 | bozhidar | bodie_: Java apps are rarely packaged properly, so usually installing them *without* a package manager is the best idea. |
| 09:02 | bodie_ | bruceadams, that's what I thought. You guys should contact the Fedora maintainer. |
| 09:02 | bodie_ | I'm also asking in #leiningen. |
| 09:02 | bodie_ | anyway, if there's interest please email bodie@digitalocean.com w/ requests :) |
| 09:03 | bozhidar | I 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:04 | bodie_ | I hope so. It seems like a pretty good distro so far. My first time on an RPM dist. |
| 09:05 | bodie_ | I'm using a few CentOS servers and I discovered RHEL has better support for certain virtualization-friendly tech such as LVM Thin. |
| 09:06 | bozhidar | bodie_: Fedora is a nice distro indeed. On of my favourite distros, together with Arch & Gentoo. |
| 09:09 | bodie_ | 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:09 | bodie_ | HIGH-MAINTENANCE |
| 09:10 | deadghost | gnusense best distro |
| 09:12 | goraci | datomic.api not working with datomic-pro, how to use api with it,anyone ? |
| 09:13 | bodie_ | deadghost: have you hurd the gnews? |
| 09:13 | goraci | FileNotFoundException Could not locate datomic/api__init.class |
| 09:13 | deadghost | I'm only kidding |
| 09:13 | deadghost | best distro is a toss up between moebuntu and biebian |
| 09:13 | goraci | [com.datomic/datomic-pro "0.9.4324"] in project.clj |
| 09:16 | deadghost | "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:16 | deadghost | hmm what |
| 09:16 | bodie_ | moebuntu, moe problems |
| 09:18 | mpenet | bodie_: I am not sure it's really needed (web stack 1click install), leiningen would download all the necessary dependencies for our web app. |
| 09:18 | mpenet | bodie_: our we can just package it as a single jar and just depend on java |
| 09:18 | bodie_ | :) |
| 09:18 | bodie_ | Cool. I'm kinda new to the Clojure/Lein world, so all input is appreciated. Just want to consume all the learnings. |
| 09:19 | bodie_ | 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:19 | bodie_ | But, I notice there's some difficulty surrounding distro-managed packages..... and I guess the deps all go into the project folder anyway |
| 09:20 | mpenet | nope, they go into ~/.m2 |
| 09:20 | bodie_ | OK |
| 09:20 | mpenet | they are shared between apps on the same server |
| 09:20 | bodie_ | Ah |
| 09:20 | bodie_ | That would make sense. |
| 09:20 | mpenet | server/user |
| 09:21 | goraci | so anyone using datomic here )& |
| 09:21 | goraci | ? |
| 09:25 | nDuff | goraci: 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:25 | goraci | ok |
| 09:29 | bodie_ | Looks like the Lein script worked out of the box on Fedora 20 beta. Thanks for the pointers all :) |
| 09:48 | ambrosebs | Bronsa: congrats on your sponsorship! |
| 10:10 | OscarZ | I'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:11 | OscarZ | if you know what i mean .. maybe theres some function already for this? |
| 10:12 | llasram | OscarZ: `iterate` and `reductions` are probably your best bets |
| 10:12 | OscarZ | sorry.. (func #(+ 1 %) 0 4) makes more sense |
| 10:12 | llasram | ,(take 4 (iterate inc 0)) |
| 10:12 | clojurebot | (0 1 2 3) |
| 10:12 | OscarZ | thanks ill check that out |
| 10:13 | llasram | ,(reductions + 0 (range 4)) |
| 10:13 | clojurebot | (0 0 1 3 6) |
| 10:14 | OscarZ | i actually looked at iterate but didnt realize it does what i want :) |
| 10:44 | cYmen | hm... |
| 10:44 | cYmen | how do I get the position of the minimal element in a vector if I want to replace it? |
| 10:45 | cYmen | I could use min-key and range but what is idiomatic? |
| 10:45 | `cbp | idiomatic would be not to worry about the index at all perhaps? :P |
| 10:46 | bbloom_ | cYmen: how big is your vector? |
| 10:47 | cYmen | bbloom_: tiny, I'm playing 4clojure |
| 10:47 | bbloom_ | cYmen: oh, ok then. just do a loop w/ a counter :-) |
| 10:48 | bbloom_ | which puzzle? i'm sure there is a much better solution than that tho |
| 10:48 | cYmen | `cbp: Should I just concat a take nth drop or what did you have in mind? |
| 10:48 | justin_smith | (defmacro as-keymap [& names] `(assoc {} ~@(mapcat (fn [name] [(keyword name) (symbol name)]) names))) <- this is going in my personal utility pile |
| 10:48 | justin_smith | |
| 10:48 | cYmen | bbloom_: I'll tell you when I'm done. ;) |
| 10:48 | `cbp | cYmen: I mean that working with sequences means thinking about values and the shape of things not about locations and how they mutate |
| 10:48 | bbloom_ | cYmen: i won't ruin it for you, i'll give you a hint |
| 10:49 | `cbp | seq functions are not really meant for playing with indexes |
| 10:49 | `cbp | when you wanna do that just use a loop or whatever |
| 10:49 | cYmen | bbloom_: not yet ;) |
| 10:54 | gfredericks2 | any thoughts on runa vs prismatic for schema libs? |
| 10:54 | cYmen | `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:20 | TimMc | Looks like Runa's employment site still has malware on it. |
| 11:31 | justin_smith | I added a :pre condition that an input contains? some value |
| 11:31 | justin_smith | can I make the :pre show me the key that was not contained? |
| 11:33 | justin_smith | for 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:33 | TimMc | (doto (contains? ...) (when-not (println ...)) |
| 11:33 | TimMc | ) |
| 11:34 | pjstadig | if you want to do validation on the arguments to a function, then using a :pre assertion is probably not the right place |
| 11:34 | justin_smith | OK |
| 11:35 | justin_smith | I thought that was what :pre was for |
| 11:36 | pjstadig | :pre can be turned off and compiled away, and should be for protecting against programmer errors |
| 11:36 | pjstadig | the criteria for using :pre versus some kind of validation prelude to your function are (admittedly) not real clear |
| 11:37 | pjstadig | but i think as a rule of thumb you should see :pre as optional (since it can be compiled away) |
| 11:37 | pjstadig | also as you're seeing it's not the most useful way to do more subtle validations |
| 11:37 | justin_smith | right |
| 11:38 | justin_smith | this is a programmer error - both map and key come from the programmer |
| 11:38 | justin_smith | it just does something specific with that combo |
| 11:38 | justin_smith | and they come from different parts of the codebase |
| 11:39 | pjstadig | you might consider something like schema for this kind of thing too |
| 11:39 | pjstadig | or core.typed? can you assert that a key exists in a map with core.typed? |
| 11:43 | rads_ | 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:44 | justin_smith | I 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:44 | justin_smith | I guess I can make map lookup look slightly more like namespace reference, but it feels like reinventing a wheel |
| 11:46 | nDuff | rads: HMap :mandatory |
| 11:46 | rads | cool! |
| 11:47 | justin_smith | nDuff: is that about checking an arbitrary pair at runtime, or verifying the map at compile time? |
| 11:48 | nDuff | justin_smith: the latter |
| 11:49 | justin_smith | yeah, since this is a plugin system that won't help |
| 11:49 | justin_smith | cool though |
| 11:50 | justin_smith | I'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:56 | technomancy | I kinda wish the `comment` macro was called `dont` instead |
| 11:57 | pjstadig | technomancy: would certainly fit in with the starts-with-do-and-returns-nil theme |
| 11:58 | technomancy | zactly |
| 11:58 | llasram | nice |
| 11:58 | technomancy | sounds vaguely INTERCAL-ish |
| 11:59 | justin_smith | you could even name it don't |
| 12:00 | justin_smith | ' is valid, as long as it is not the first char in the symbol name |
| 12:00 | technomancy | yes indeedy |
| 12:00 | technomancy | to the jiramobile! |
| 12:00 | pjstadig | do doseq dorun doall donot |
| 12:01 | gfredericks2 | doughnut |
| 12:01 | pjstadig | gfredericks2: noooo!!! you beat me to it |
| 12:01 | pjstadig | (slow typer) |
| 12:01 | gfredericks2 | (doughnut fan) |
| 12:01 | justin_smith | doughboy - makes the vm emit the little Hm-Hm! sound |
| 12:03 | algernon | yes, yes, lets pull overtone into the language core! |
| 12:08 | TimMc | (defmacro dont [& _]) |
| 12:08 | TimMc | Now you hav eno excuse not to. |
| 12:09 | TimMc | It's better in all ways, actually -- there's no possible confusion of whether it returns something (a common problem for beginners with comment.) |
| 12:12 | justin_smith | at least spell it right (defmacro don't [& _]) :) |
| 12:13 | TimMc | holy shit that works |
| 12:13 | TimMc | That's a change in 1.3 symbol parsing, yeah? |
| 12:13 | justin_smith | likely |
| 12:14 | justin_smith | it lets you be all mathy and refer to x' and such |
| 12:16 | justin_smith | ,(let [x 0 x' (inc x) x'' (inc x')] (+ x'' x')) |
| 12:16 | clojurebot | 3 |
| 12:19 | awalters | \quit |
| 12:19 | awalters | oops |
| 12:21 | sjl | Is there something like select-keys that will fill in nil values for keys that aren't found in the map? |
| 12:22 | sjl | so like (select-keys-or-nil {:a 1} [:a :b]) => {:a 1 :b nil} |
| 12:22 | justin_smith | juxt |
| 12:22 | danneu | ((juxt :a :b) {:a 1 }) |
| 12:22 | danneu | er |
| 12:22 | justin_smith | (inc juxt) |
| 12:22 | lazybot | ⇒ 4 |
| 12:23 | danneu | into {} |
| 12:23 | justin_smith | ahh |
| 12:23 | justin_smith | yeah, needs that too |
| 12:23 | justin_smith | ,(into {} ((juxt :a :b) {:a 1 })) |
| 12:23 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long> |
| 12:23 | justin_smith | err |
| 12:23 | justin_smith | ,(apply hash-map ((juxt :a :b) {:a 1 })) |
| 12:23 | clojurebot | {1 nil} |
| 12:24 | justin_smith | wait... |
| 12:24 | danneu | our keys |
| 12:24 | justin_smith | oh right |
| 12:26 | sjl | (into {} (for [k [:a :b :c]] [k (k m)])) does what I want but is ugly as hell |
| 12:26 | danneu | ,(let [keys [:a :b]] (zipmap keys ((apply juxt keys) {:a 1}))) |
| 12:26 | clojurebot | {:b nil, :a 1} |
| 12:26 | danneu | l0l |
| 12:26 | egosum | What is best/easiest practice for using private dependencies with Leiningen? |
| 12:26 | justin_smith | ,((fn coerced-select [m keys] (into {} (map (juxt identity m) keys))) {:a 0}) |
| 12:26 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval141$coerced-select> |
| 12:26 | justin_smith | ,((fn coerced-select [m keys] (into {} (map (juxt identity m) keys))) {:a 0} [:a :b]) |
| 12:26 | clojurebot | {:a 0, :b nil} |
| 12:26 | egosum | I see all sorts of references to different methods, all fairly old |
| 12:27 | sjl | ah yeah juxt identity map might be a way to go about it |
| 12:27 | rads | personally I think the for version is simplest |
| 12:27 | danneu | psh |
| 12:28 | danneu | juxt or death |
| 12:30 | sjl | another way would be to create a map of all nil values and merge in the results of select-keys I guess |
| 12:31 | lvh | Hello :) |
| 12:32 | egosum | I'm going to guess just using s3 as a maven wagon repo is the way to go |
| 12:33 | lvh | A 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:33 | danneu | i think your `for` solution is simple. defn body is just (into {} (for [k keys] [k (k m)])). aint ugly - just obvious |
| 12:33 | sjl | yeah that's also not too bad |
| 12:33 | rads | lvh https://github.com/jonase/kibit |
| 12:34 | lvh | rads: Awesome! Thanks! |
| 12:35 | technomancy | egosum: just OSS everything; it's by far the easiest way to go |
| 12:35 | egosum | technomancy: ideally ;) and I may OSS this; just want to get things up and running first |
| 12:36 | technomancy | (if you can't do that, go with the S3 wagon unless you already have a server handy for http-basic-protected artifacts) |
| 12:36 | egosum | i wrote an asynchronous networked extended finite state machine library :) it's pretty slick |
| 12:37 | danneu | sjl: 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:37 | sjl | yeah |
| 12:37 | egosum | …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:37 | sjl | and making sure to never implement something everyone needs like contains-value? |
| 12:37 | sjl | that's also critical if you really wanna get in the game |
| 12:38 | dnolen | sjl: Clojure has a contains-value?, it's called some |
| 12:39 | sjl | dnolen: (when-not (some #{nil} [1 nil 2]) (println "NOPE")) |
| 12:39 | justin_smith | then you need contains |
| 12:40 | sjl | justin_smith: (when-not (contains? nil [1 nil 2]) (println "NOPE")) |
| 12:40 | gfredericks2 | sjl: well some can still work with that, just using #(= % x) instead of #{x} |
| 12:40 | justin_smith | sjl: wrong order |
| 12:40 | sjl | gfredericks2: sure I can pepper my code with anonymous functions every time I need to check if a collection contains a value |
| 12:40 | sjl | or clojure could, like, include this super common thing |
| 12:41 | dnolen | sjl: I take it you just want to pretend you can't solve this problem trivially w/ some |
| 12:41 | justin_smith | ,(when (some #(contains? #{nil} %) [1 nil 2]) (println :OK)) |
| 12:41 | clojurebot | :OK\n |
| 12:41 | dnolen | sjl: and if you're littering your code with checking for a value in a sequential collection - you're using the wrong data structure |
| 12:41 | sjl | ok |
| 12:42 | sjl | if clojure folks think "checking if a value is in a vector" isn't something the language should have built in |
| 12:42 | sjl | I don't know what to say to that |
| 12:42 | sjl | we'll just agree to disagree |
| 12:42 | dnolen | sjl: after having written thousands of lines Clojure I think I've done that like 4-5 times. fix your code. |
| 12:43 | sjl | amazing |
| 12:44 | llasram | sjl: OOC, what is your use case for checking if a value is present in a sequential data structure? |
| 12:44 | gfredericks2 | my codebase has 6700 lines; I just grepped for '(some #{' and found one of them |
| 12:44 | danneu | i like contains? + set |
| 12:44 | danneu | then again, set does a full traverse |
| 12:45 | danneu | some it is! |
| 12:45 | gfredericks2 | b |
| 12:46 | sjl | llasram: https://github.com/yogthos/Selmer/issues/12 |
| 12:46 | justin_smith | ther is also (comp first (partial filter pred)) - for when you care about the thing that matched |
| 12:46 | sjl | that's one off the top of my head |
| 12:46 | sjl | I've been mostly writing scala recently |
| 12:48 | llasram | sjl: 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:48 | alandipert | on 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:48 | sjl | llasram: it works, sure |
| 12:49 | sjl | llasram: I still feel like "checking if a value is in a seq" should be something the language does for me |
| 12:49 | sjl | not something I need to hand roll every time |
| 12:50 | llasram | I see. That seems reasonable, although I'll add myself to the count of people who don't need to do it frequently |
| 12:50 | danneu | i have a `util` namespace that i just bring into every project and every namespace |
| 12:50 | coventry | alandipert: I wrote 1e8 lines of clojure just yesterday. Fabulous productivity. :-) |
| 12:50 | danneu | it's like ztellman's potemkin except mine sucks |
| 12:50 | sritchie | technomancy: hey man - should "provided" deps be making it into an uberjar? |
| 12:50 | gfredericks | I've started using prismatic/plumbing |
| 12:51 | hyPiRion | ,(.contains [1 88 3] 88) |
| 12:51 | clojurebot | true |
| 12:51 | sjl | ,(.contains [1 nil 2] nil) |
| 12:51 | clojurebot | true |
| 12:51 | sjl | nice |
| 12:51 | seangrove | gfredericks: What do you think of it? |
| 12:51 | sjl | java interop works I guess |
| 12:51 | alandipert | coventry: also a fair amount! some day we might know something. i just wish i understood nil, afaict it's an interop surface |
| 12:51 | gfredericks | seangrove: no complaints |
| 12:52 | seangrove | I used it heavily for one project, and it definitely has its upside, but maybe less useful than something like schema |
| 12:52 | seangrove | Not that they're competing in any way |
| 12:52 | llasram | I know about .contains on vectors, but I didn't know it even works on seqs. Fun! |
| 12:52 | sjl | ,(.contains (list 1 nil 2) nil) |
| 12:52 | clojurebot | true |
| 12:52 | sjl | oh nice |
| 12:52 | danneu | damn, hyPiRion crowd control |
| 12:53 | gfredericks | sjl: probably gotta be careful with reflection on that one |
| 12:53 | sjl | yeah |
| 12:53 | gfredericks | ,(time (some #(= nil %) '(1 nil 2))) |
| 12:53 | clojurebot | "Elapsed time: 0.147865 msecs"\ntrue |
| 12:53 | hyPiRion | llasram: even work on lazy seqs, it's interesting |
| 12:54 | gfredericks | ,(time ((fn [x] (.contains x nil)) '(1 nil 2))) |
| 12:54 | clojurebot | "Elapsed time: 0.158361 msecs"\ntrue |
| 12:54 | hyPiRion | ,(.contains (range) 10000) |
| 12:54 | clojurebot | true |
| 12:54 | gfredericks | hrm; why did that not slowen up? |
| 12:55 | seangrove | sjl: 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:55 | sjl | seangrove: yeah we have a project like that |
| 12:56 | egosum | seangrove: 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:57 | seangrove | sjl: (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:57 | seangrove | erm... |
| 12:57 | seangrove | ,(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:57 | clojurebot | [nil :a 3] |
| 12:58 | sjl | seangrove: the problem is that nil is falsy, so when you use some as a predicate you get into trouble |
| 12:59 | sjl | ,(when (some #{nil} [1 nil]) "yes") |
| 12:59 | clojurebot | nil |
| 12:59 | danneu | this 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:59 | justin_smith | there is always (partial = needle) |
| 13:00 | seangrove | sjl: Ah, yes, that can be annoying sometimes. |
| 13:00 | seangrove | justin_smith: Only problem with that for me is you get the truth value back, not the original value |
| 13:01 | coventry | The 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:01 | justin_smith | seangrove: then you want filter, not some |
| 13:01 | justin_smith | well (first (filter (partial = needle) coll)) |
| 13:02 | sjl | there I think you can do the set shortcut |
| 13:02 | alandipert | (some {nil true} ...) ? |
| 13:02 | sjl | (first (filter #{needle} coll)) |
| 13:02 | sjl | is basically some |
| 13:02 | justin_smith | (filter #{nil} [nil nil nil]) |
| 13:02 | justin_smith | ,(filter #{nil} [nil nil nil]) |
| 13:02 | clojurebot | () |
| 13:02 | justin_smith | nope |
| 13:02 | justin_smith | no sets for nil |
| 13:02 | sjl | ah no |
| 13:02 | sjl | nil |
| 13:02 | sjl | welp |
| 13:02 | justin_smith | ,(filter (partial = nil) [nil nil nil]) |
| 13:02 | clojurebot | (nil nil nil) |
| 13:02 | seangrove | justin_smith: e.g. |
| 13:02 | seangrove | ,(if-let [result (pos? (dec (rand-int 20)))] (+ result 10) :fail) |
| 13:02 | clojurebot | :fail |
| 13:03 | seangrove | in this case if I switch pos? out for (partial = ...) then the same problem |
| 13:03 | seangrove | justin_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:04 | corvobianco | [ ][ ][ ] OlA CoMpAgNeRoS Di #clojure [ ][ ][ ] |
| 13:04 | corvobianco | !list |
| 13:06 | justin_smith | (let [result (op)] (if (status result) ...)) that's not so bad |
| 13:06 | justin_smith | and you could make a macro for it if you find it that tedious |
| 13:06 | seangrove | justin_smith: Yup, not bad at all. Just a tiny nitpick that keeps me from using if-let |
| 13:08 | justin_smith | seangrove: (defmacro if-pred [form condition yes no] `(let [result# ~form] (if (~condition result#) ~yes ~no))) |
| 13:09 | justin_smith | (if-pred (+ 1 1) even? :ok :nope) |
| 13:09 | justin_smith | I guess it should have an anaphore for the result though |
| 13:09 | seangrove | justin_smith: Sure sure, not saying it's impossible at all. |
| 13:11 | justin_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:11 | justin_smith | *four |
| 13:12 | justin_smith | probably better not to reuse % |
| 13:13 | seangrove | Actual 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:13 | seangrove | I imagine bitemyapp fuming in the audience there so much that smoke comes of his head |
| 13:20 | egosum | anyone 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:30 | justin_smith | egosum: would running lein-install and comparing the local path under .m2 help with that at all? |
| 13:30 | justin_smith | just a shot in the dark |
| 13:44 | Glenjawork | Hi 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:45 | Glenjawork | does anyone have any suggestions? |
| 13:45 | justin_smith | simple parsing of a tree? |
| 13:46 | egosum | justin_smith: same path there :\ |
| 13:46 | justin_smith | like the four basic math objects plus ints in a lispy syntax, and find the answer? |
| 13:46 | egosum | justin_smith: but thanks |
| 13:46 | Maior | Glenjawork: http://6brand.com/solving-8-puzzle-with-artificial-intelligence.html |
| 13:46 | justin_smith | egosum: ? |
| 13:46 | Maior | Glenjawork: don't look too hard at the title |
| 13:46 | Glenjawork | i'm trying to avoid anything where the solution is search-based |
| 13:46 | justin_smith | egosum: oh, now I get it, never mind |
| 13:46 | Maior | Glenjawork: ah |
| 13:46 | justin_smith | Glenjawork: make a simple equation evaluator |
| 13:46 | Glenjawork | because that's mostly just (ok? (generate solutions)) |
| 13:46 | justin_smith | that's recursive |
| 13:47 | Glenjawork | justin_smith: thats a good one |
| 13:47 | justin_smith | bonus points, make it a dsl with ops apropriate to said interest group |
| 13:47 | egosum | justin_smith: but. get this. i tried it again (4 time in a row; definition of insanity) but it works now |
| 13:47 | justin_smith | LOL |
| 13:47 | justin_smith | congrats |
| 13:48 | egosum | justin_smith: thanks. computers are not sane. |
| 13:48 | Glenjawork | justin_smith: oo, i like it |
| 13:48 | Glenjawork | i wonder if i should so something funky like postfix |
| 13:48 | Glenjawork | or infix |
| 13:49 | Glenjawork | although, it's a general functional programming group, I wonder how doable that is in a non-lisp |
| 13:50 | justin_smith | recursive parsing, all functional langs worth the name are good at that |
| 13:51 | justin_smith | similar, make an automated code translater for some subset of Haskell / clojure |
| 13:51 | Glenjawork | i guess the haskell approach you'd express as a recursive ADT |
| 13:51 | justin_smith | it doesn't need to be useful, just a toy |
| 13:51 | Glenjawork | mm, that's a good idea |
| 13:52 | sritchie | is there a way to exclude default java imports in a clojure file, like String? |
| 13:52 | sritchie | something like :refer-java :exclude |
| 13:53 | seancorfield | sritchie: you're getting conflicts with something else you're trying to import? |
| 13:53 | sritchie | WARNING: String already refers to: class java.lang.String in namespace: schema.core, being replaced by: #'schema.core/String |
| 13:53 | seancorfield | seems like there are repeated calls for class aliasing to be added... |
| 13:53 | seancorfield | ah, the dangers of :use vs :require? |
| 13:54 | sritchie | no |
| 13:54 | seancorfield | #'schema.core/String is just a def for java.lang.String anyway I think? |
| 13:54 | llasram | sritchie: If you control the namespace defining a `String` var, you can `ns-unmap` the symbol `String` first |
| 13:54 | sritchie | that's in schema.core itself |
| 13:55 | seancorfield | but you're use'ing schema.core (or refer'ing :all) ? |
| 13:55 | seancorfield | I don't get that warning on a :require :as for schema.core ... pretty sure |
| 13:57 | sritchie | this is in AOT compilation |
| 13:57 | sritchie | I'm requiring as |
| 13:57 | sritchie | I only get it when compiling |
| 13:58 | eric_normand | I just adapted hiccup to output React.DOM nodes (at runtime) |
| 13:59 | eric_normand | we'll see how that works |
| 13:59 | seancorfield | sritchie: hmm, I don't see that warning on lein check which does a compile, but I'm not doing full AOT compilation |
| 13:59 | seancorfield | I guess I'd ask why you're doing AOT compilation? :) |
| 14:00 | dabd | this is so cool http://daly.axiom-developer.org/clojure.pdf |
| 14:09 | dsrx | eric_normand: nice |
| 14:09 | eric_normand | dsrx: it's almost there |
| 14:10 | eric_normand | dsrx: i'd like it to do most of the translation at compile time |
| 14:10 | eric_normand | dsrc: anything static, that is |
| 14:11 | bitemyapp | sritchie: why do you have something named String? |
| 14:11 | sritchie | prismatic does |
| 14:11 | sritchie | in schema.core - for cljs + clj |
| 14:11 | bitemyapp | sritchie: use :as |
| 14:11 | bitemyapp | require schema :as sch |
| 14:11 | bitemyapp | sch/String |
| 14:11 | bitemyapp | sch/* |
| 14:12 | bitemyapp | or just s, if you like. |
| 14:12 | sritchie | okay, nice |
| 14:17 | Pupeno | Is pedestal a framework for client side web apps? |
| 14:18 | OscarZ | is 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:19 | OscarZ | if not.. maybe this would be a good spot to learn about macros ? |
| 14:19 | gfredericks | OscarZ: definitely not a macro |
| 14:19 | gfredericks | it's an easy function |
| 14:19 | OscarZ | ok |
| 14:19 | OscarZ | ill work that out.. i thought maybe there is already one |
| 14:19 | gfredericks | not that I know of |
| 14:19 | bitemyapp | Pupeno: Pedestal handles both. You probably don't need it. |
| 14:20 | OscarZ | ok thanks |
| 14:21 | Bronsa | OscarZ: you can use `compare` to get 1 or -1 |
| 14:22 | Pupeno | bitemyapp: care to elaborate on not needing it? |
| 14:23 | seancorfield | sritchie: how were you pulling in schema.core to your code? |
| 14:23 | llasram | Hypothesis: sritchie is still having his problem, and has just gotten tired of people misunderstanding it :-) |
| 14:24 | sritchie | on a quick phone call :) I'll be back soon! |
| 14:24 | sritchie | sorry dudes, thanks for the comments |
| 14:24 | seancorfield | you 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:26 | OscarZ | Bronsa: thanks for the tip.. nicer than if :) |
| 14:28 | Bronsa | OscarZ: 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:28 | coventry | In fact, schema.core does the ns-unmap llasram suggested. https://github.com/Prismatic/schema/blob/master/src/cljx/schema/core.cljx#L92 |
| 14:29 | OscarZ | Bronsa: heh ok.. thats weird :) |
| 14:30 | OscarZ | Same as Java x.compareTo(y) except it also works for nil, and |
| 14:30 | OscarZ | compares numbers and collections in a type-independent manner. |
| 14:30 | coventry | You could do a refer excluding just the two symbols unmapped there, and refer to just those two with an alias if you cared. |
| 14:31 | gfredericks | why would you use s/String over String? |
| 14:31 | justin_smith | coventry: regarding that link above, do you know if #+clj and #+cljs are specific to schema or they are provided by clojure? |
| 14:31 | coventry | justin_smith: That is cljx syntax. |
| 14:32 | justin_smith | and what provides the cljx reader? |
| 14:32 | coventry | cljx of course. :-) |
| 14:32 | gfredericks | cross platform I guess |
| 14:33 | coventry | I hear it's super-handy if you're doing combined clj/cljs work. https://github.com/lynaghk/cljx |
| 14:33 | coventry | cemerick was mad for it a couple of weeks ago. |
| 14:36 | dabd | can someone tell me the difference between persistence and immutability, regarding clojure data structures? |
| 14:36 | justin_smith | coventry: cool, thanks |
| 14:37 | coventry | immutability: can't change it. persistence: http://en.wikipedia.org/wiki/Persistent_data_structure |
| 14:39 | dabd | right I read that before asking but as they say a persistent data structure is effectively immutable. It looks like the same thing |
| 14:39 | Bronsa | dabd: assoc on a simply immutable data structure might implemented by copying the whole data structure and adding the element to the new copy |
| 14:40 | Bronsa | dabd: persistent implies that the underlying shared data-structure will be re-used |
| 14:40 | justin_smith | dabd: numbers are all immutible, but not persistent |
| 14:40 | justin_smith | they are just data you cannot mutate |
| 14:42 | dabd | right, a data structure can't be persistent if it can't be modified in the first place |
| 14:42 | Bronsa | dabd: http://clojure.org/functional_programming#Functional%20Programming--Immutable%20Data%20Structures |
| 14:43 | dabd | bronsa: ty for the link, it explains it exactly |
| 14:45 | seangrove | eric_normand: That sounds awesome |
| 14:45 | seangrove | Very curious to see where it goes |
| 14:47 | seangrove | Wow, there's a leiningen aptitude package? |
| 14:48 | seangrove | Seems a bit unnecessary |
| 14:48 | justin_smith | counterproductive even |
| 14:48 | `cbp | no one knows how to keep apt packages updated |
| 14:48 | bruceadams | right. it just confuses people |
| 14:48 | gfredericks | reiddraper: I'm writing a jsonish generator for types that should roundtrip through json |
| 14:49 | gfredericks | e.g., only keywords for map keys, but no keywords otherwise |
| 14:58 | sritchie | seancorfield: back |
| 14:58 | sritchie | I'm using it with a require as |
| 14:59 | sritchie | no problem there |
| 14:59 | sritchie | but this shows up when I AOT compile; |
| 14:59 | sritchie | and because the schema namespace gets AOT compiled on its own (I guess), |
| 14:59 | sritchie | the waning shows up there |
| 14:59 | sritchie | just like you get reflection warnings from other people's code if they're not careful |
| 15:00 | sritchie | another qq - |
| 15:00 | sritchie | and this one, I'm just lacking some understanding on |
| 15:00 | sritchie | I have "aot all" in my uberjar; |
| 15:00 | sritchie | profile, on leiningen |
| 15:00 | sritchie | BUT, when I actually go to compile, only my main class gets aot compiled (it has a gen-class) |
| 15:00 | seancorfield | curious why you're AOT compiling? |
| 15:00 | sritchie | for heroku boot times |
| 15:00 | sritchie | my boot times out |
| 15:01 | seancorfield | ah, ok |
| 15:11 | llasram | sritchie: What version of Leiningen? |
| 15:11 | sritchie | 2.3.3 |
| 15:12 | llasram | Hmm. Oh -- when you say "go to compile" do you mean `lein compile` or `lein uberjar`? |
| 15:12 | sritchie | lein uberjar |
| 15:13 | sritchie | I've overridden the default compile with prep-tasks ^:replace [["cljx"] ["javac"] ["compile" ":all"]] |
| 15:14 | llasram | In the :uberjar profile? |
| 15:14 | llasram | Or you mean that's your work-around? |
| 15:17 | sritchie | I have to do that anyway, |
| 15:18 | sritchie | llasram: so that cljx gets compiled before compilation |
| 15:18 | sritchie | sorry, the bigger bug I'm trying to solve is why I get this crazy classnotfoundexception when including austin in my project |
| 15:18 | Pupeno | bitemyapp: can you elaborate on why I don't need Pedestal please? |
| 15:18 | llasram | Ok. Then that's extra weird, because the `compile :all` prep-task should be causing full AOT compilation before any task |
| 15:18 | sritchie | even as a dev plugin |
| 15:18 | sritchie | llasram: I think it does, I think I goofed with that one by running it twice without cleaning |
| 15:18 | llasram | Ah, I see |
| 15:19 | sritchie | https://github.com/cemerick/austin/issues/23 |
| 15:19 | sritchie | that's the bigger issue |
| 15:19 | sritchie | really unclear why it's happening, |
| 15:19 | sritchie | but it's linked to austin |
| 15:19 | rkneufeld | Pupeno: One of Pedestal's authors here. It's a fairly experimental framework, with a rather high barrier of entry (at present). |
| 15:19 | sritchie | so I'm trying to put austin somewhere, maybe as a dev plugin, that completely removes its effect when running "lein uberjar" |
| 15:20 | Pupeno | rkneufeld: it still seems to be the most active web framework on clojure. |
| 15:21 | sritchie | I think it gets the most attention because it's backed by cognitect |
| 15:22 | sritchie | raw compojure probably gets the most love |
| 15:22 | sritchie | llasram: anyway, I'm still seeing namespaces getting evaluated |
| 15:22 | Pupeno | Luminus seemed to be second in the popularity contest. |
| 15:22 | sritchie | after AOT compiling my main namespace |
| 15:22 | sritchie | (and every namespace does show up) |
| 15:23 | sritchie | llasram: of course, only the main namespace has gen-class on it |
| 15:23 | sritchie | llasram: but I would have thought that would transitively compile |
| 15:24 | llasram | sritchie: 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:24 | sritchie | llasram: I have a top level side effect in one of my files |
| 15:24 | sritchie | that tries to require a certain CLJS development namespace, but only if available |
| 15:24 | sritchie | and I see the println statement on AOT compilation, and also on running the jar |
| 15:25 | llasram | Oh, 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:25 | sritchie | gotcha |
| 15:25 | sritchie | interesting |
| 15:26 | llasram | I think the intent is that AOT is supposed to be transparent -- loading AOT'd or not AOT'd should do the same things |
| 15:27 | reiddraper | gfredericks: oh neat |
| 15:29 | technomancy | Pupeno: "most active" is really not that interesting of a metric in an ecosystem primarily composed of small libraries |
| 15:29 | stuartsierra | And "popularity" is even worse. |
| 15:30 | sritchie | llasram: my goal was to AOT for speed, so no new eval work has to be done at launch |
| 15:31 | sritchie | llasram: otherwise, why AOT? |
| 15:31 | Pupeno | technomancy: true. |
| 15:33 | Pupeno | technomancy: do you do web development with clojure? |
| 15:34 | technomancy | Pupeno: I've basically only written one web project: https://github.com/technomancy/syme |
| 15:35 | technomancy | and even that's only ~500LOC, but maybe it has some good techniques you could learn from |
| 15:35 | technomancy | the way it uses oauth is neat, and I recommend copying its approach for db migrations |
| 15:35 | seangrove | Pupeno: There's a lot of churn right now, some great ideas in pedestal, react, cljs, compojure, etc. |
| 15:36 | technomancy | huh, I'd never heard of react before ~3 days ago |
| 15:37 | lazybot | java.lang.RuntimeException: EOF while reading |
| 15:37 | llasram | sritchie: 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:37 | seangrove | technomancy: Well, it is a js library, just has some interesting good ideas that are similar to pedestal |
| 15:37 | sritchie | llasram: ah, okay. but eval still happens. gotcha |
| 15:37 | seangrove | And with what eric_normand is doing around hiccup, it could all be very cool |
| 15:38 | seangrove | sritchie: That's a pretty nasty workaround. Well done though. |
| 15:42 | future | is it possible to rebind the Java classes that built-in clojure functions use? |
| 15:42 | future | I want to make future use ForkJoinTask instead of FutureTask |
| 15:43 | future | is it possible to do that without rewriting future? |
| 15:44 | gfredericks | has anybody written a prismatic/schema -> simplecheck-generator function yet? |
| 15:45 | ohpauleez | gfredericks: 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:47 | gfredericks | ohpauleez: I might have to try this myself then |
| 15:48 | gfredericks | naively it sounds like just some glueing |
| 15:52 | sritchie | technomancy: qq about slug size (again) |
| 15:52 | sritchie | my uberjar is 65MB |
| 15:53 | sritchie | but the slug size is 130MB |
| 15:54 | sritchie | technomancy: you were saying for non-uberjar project, the .m2 dir is included |
| 15:56 | ohpauleez | gfredericks: 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:56 | bbloom_ | swannodette forked tastejs/todomvc to swannodette/todomvc 4 hours ago |
| 15:56 | bbloom_ | dnolen: it begins. |
| 15:56 | bbloom_ | :-P |
| 15:57 | ohpauleez | It'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:57 | ohpauleez | (it opens up an additional level of verification and validation, if people were into that sort of thing) |
| 15:58 | ohpauleez | bbloom_: :) |
| 15:58 | ohpauleez | I've been watching today as wel |
| 15:58 | ohpauleez | well |
| 15:58 | bbloom_ | ohpauleez: brenton seems stoked about react as well, which i consider good news |
| 15:59 | dnolen | bbloom_: heh, working with React DOM is definitely a case where #js literal would be nice |
| 15:59 | ohpauleez | Yes, it seems like some interesting things are coming together |
| 15:59 | dnolen | bbloom_: I showed him latest gist and explained how it worked - I think he's even more psyched now |
| 15:59 | dnolen | bbloom_: "you're blowing my mind" I think were his exact words :) |
| 15:59 | ohpauleez | haha :) |
| 16:00 | ohpauleez | It 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:00 | bbloom_ | http://clojure-log.n01se.net/date/2013-08-23.html#13:38e |
| 16:00 | bbloom_ | :-P |
| 16:00 | ohpauleez | and also, makes things really really fast |
| 16:01 | bbloom_ | ohpauleez: what new insights? are you just talking about how immutability means faster diffs? |
| 16:02 | ohpauleez | yes |
| 16:02 | ohpauleez | haha |
| 16:02 | ohpauleez | yes I am |
| 16:02 | bbloom_ | yeah, it wasn't a new insight to the facebook folks :-) they already use immutable models w/ react internally |
| 16:03 | dnolen | bbloom_: 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:03 | bbloom_ | dnolen: yeah, they lack the vocabulary that we have here in clojure land to express what's so great about their approach |
| 16:04 | ohpauleez | I'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:05 | ohpauleez | but the latest react stuff is very exciting |
| 16:05 | bbloom_ | latest? heh, it's basically the same as when it shipped |
| 16:06 | bbloom_ | 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:07 | bbloom_ | 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:07 | dnolen | bbloom_: yes support things that work via ES6 generator interface, they seemed receptive to that. |
| 16:08 | dnolen | bbloom_: one downside is that React has a lot of complexity because the OO approach |
| 16:08 | dnolen | bbloom_: but there's too much good value for that to matter at this point |
| 16:09 | bbloom_ | 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:09 | bbloom_ | dnolen: but my investigation suggested they are less tangled than it would appear |
| 16:10 | dnolen | bbloom_: I mean there's a lot of functionality we don't care about |
| 16:10 | dnolen | bbloom_: like their batching system or the role of state |
| 16:11 | dnolen | we always render from root, so batching is trivial for us, and we don't need state stuff |
| 16:11 | bbloom_ | dnolen: no, i disagree completely |
| 16:11 | dnolen | bbloom_: I disagree w/ your disagreement |
| 16:11 | bbloom_ | lol |
| 16:11 | dnolen | bbloom_: that stuff isn't useful for us |
| 16:11 | bbloom_ | dnolen: it is |
| 16:11 | dnolen | bbloom_: how? |
| 16:12 | bbloom_ | dnolen: b/c some components really are stateful & have transient state that you really don't want to include in your model |
| 16:12 | bbloom_ | and you want that state to have managed life time |
| 16:12 | bbloom_ | the state stuff can be made much better w/ a clojure perspective, but that doesn't mean it's not useful |
| 16:12 | bbloom_ | at minimum, we need the life cycle management, which is essentially 99% of the state subsystem |
| 16:12 | dnolen | bbloom_: I can't think of a component I would write that needs that - do you have an example? |
| 16:13 | bbloom_ | dnolen: consider animations or reacting to the mouse pointer, or focus, or other transient bits of UI state |
| 16:14 | bbloom_ | dnolen: you don't want to treat that stuff as part of your world |
| 16:14 | dnolen | bbloom_: why not? |
| 16:14 | bbloom_ | 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:14 | bbloom_ | you might want to save that stuff, but you definitely want it isolated |
| 16:14 | bbloom_ | it has different lifetime policy |
| 16:14 | bbloom_ | it's lifetime is tied to inclusion in the dom |
| 16:14 | bbloom_ | anything in your props/etc has unbounded lifetime managed by you |
| 16:15 | bbloom_ | having automatic lifetime of state is critical |
| 16:15 | bbloom_ | we can hide that state in control variables for core.async loops or whatever |
| 16:15 | bbloom_ | but we still need the lifetime management |
| 16:15 | dnolen | bbloom_: still not convinced anything you've said matters |
| 16:15 | dnolen | just put into the graph |
| 16:15 | geoffeg | any congomongo "experts" around? i can |
| 16:15 | dnolen | if you load and stuff is different, recompute update, re-render |
| 16:15 | geoffeg | i can't figure out how to do a case-insensitive regex match |
| 16:16 | bbloom_ | 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:16 | bbloom_ | dnolen: you're going to have state inside the loop arguments for a go-loop |
| 16:16 | bbloom_ | dnolen: for your event handling |
| 16:16 | bbloom_ | dnolen: that's exactly what the state obj is for |
| 16:17 | dnolen | bbloom_: this is not my understanding, nor what petehunt commnicated when we talked about it today |
| 16:17 | dnolen | state is a hack because they can't efficiently traverse the tree |
| 16:17 | dnolen | we can |
| 16:17 | seangrove | bbloom_: I had the same thoughts about independent/default life-cycle management for components |
| 16:17 | bbloom_ | dnolen: i didn't hear him say that |
| 16:17 | bbloom_ | oh you talked to him again today? |
| 16:17 | bbloom_ | *shrug* |
| 16:17 | dnolen | bbloom_: yep |
| 16:18 | bbloom_ | dnolen: just like you put .value in props, i'd expect you'd put .channel in state |
| 16:18 | dnolen | bbloom_: I specifically said we don't need set state because can use equality checks all the way down |
| 16:18 | bbloom_ | or something along those lines |
| 16:18 | dnolen | bbloom_: he basically hell yeah, that's right |
| 16:18 | dnolen | basically said |
| 16:18 | bbloom_ | yeah, you don't need getState/setState |
| 16:18 | bbloom_ | b/c you're going to have that managed implicitly in a core.async state machine :-P |
| 16:18 | dnolen | bbloom_: ok now we return to the same reality |
| 16:19 | dnolen | bbloom_: that's what I was talking about - the api |
| 16:19 | dnolen | no state in general |
| 16:19 | dnolen | s/no/not |
| 16:19 | bbloom_ | yeah, so that state thing is literally a map w/ an obj in it and the lifecycle management |
| 16:19 | bbloom_ | like i said: we need the lifecycle management |
| 16:19 | bbloom_ | which will basically boil down to managing the event channels |
| 16:21 | bbloom_ | anyway, i told pete to idle here :_P |
| 16:22 | dnolen | bbloom_: 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:22 | akhudek | sounds like I missed an interesting conversation |
| 16:23 | akhudek | we've been playing with a pedestal-like design recently |
| 16:24 | geoffeg | seancorfield: ping? |
| 16:24 | stcredzero | I came here to ask about the Slf4jLog.debug missing method problem |
| 16:24 | arohner | clojurebot: ~ask |
| 16:24 | clojurebot | Excuse me? |
| 16:24 | akhudek | but built on a more common set of clojure libraries |
| 16:25 | arohner | clojurebot: ~question |
| 16:25 | clojurebot | Gabh mo leithscéal? |
| 16:25 | arohner | hrm, what was the "don't ask if you can ask a question" prompt? |
| 16:25 | seangrove | arohner: Gonna need to lurk more so you can operate arohner better :P |
| 16:25 | seangrove | ask? |
| 16:25 | clojurebot | The Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question. |
| 16:25 | seangrove | anyone? |
| 16:25 | clojurebot | anyone is anybody |
| 16:25 | stcredzero | Hi sean |
| 16:25 | seangrove | Hey Peter, sorry haven't gotten back to your email yet, was actually looking into it ;) |
| 16:26 | stcredzero | So, after I upgraded my machine to OS X Mavericks, I started getting java.lang.NoSuchMethodError |
| 16:26 | arohner | geoffeg: I haven't tried insensitive matching in congo, but have you tried just passing a normal insensitive regex? |
| 16:26 | arohner | http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html |
| 16:26 | teslanick | "Saying, There was in a rage with him because of the special forms" -- http://kingjamesprogramming.tumblr.com/ |
| 16:27 | stcredzero | java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple; -- is there an easy fix? |
| 16:27 | seangrove | stcredzero: I wonder if it isn't a version mismatch somehow |
| 16:27 | stcredzero | help |
| 16:27 | seangrove | stcredzero: Can you post the `lein deps` output to refheap? |
| 16:32 | dnolen | bbloom_: 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:34 | bbloom_ | 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:34 | bbloom_ | dnolen: the point is that the work react does for their OOP top-layer is like ~10 lines & the rest is about lifecycle |
| 16:35 | geoffeg | arohner: ah, turns out it doesn't matter anyways, mongodb doesn't do well with case-insensitive regexes hitting an index. |
| 16:38 | musicalchair | bbloom_: 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:38 | balpert | dnolen: bbloom_: yeah, there's really not *that* much code related to state or batching in React |
| 16:38 | bbloom_ | musicalchair: yeah, you can of course keep it in app state, but when you do that, it becomes your problem |
| 16:38 | balpert | you could probably make a slimmed-down version of ReactCompositeComponent.js if you really cared |
| 16:38 | musicalchair | bbloom_: tho the lifecylce bit is probably more interesting |
| 16:38 | musicalchair | bbloom_: ah I'm starting to see where you're comign from now |
| 16:39 | bbloom_ | musicalchair: there are two "default" life cycles available to you: 1) save forever in app state and 2) exists while in the DOM |
| 16:39 | bbloom_ | #2 is super useful |
| 16:39 | gfredericks | didn't somebody have a lib for generating matches from a regex? |
| 16:39 | musicalchair | bbloom_: WebSocket |
| 16:40 | musicalchair | bbloom_: sorry, shouldn't be so brief. I was trying to pose an example of useful dom state |
| 16:40 | bbloom_ | 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:40 | bbloom_ | musicalchair: it's your problem |
| 16:40 | bbloom_ | and that's what you want |
| 16:40 | bbloom_ | rather than it being backbone's problem & they do a stupid job of it |
| 16:40 | bbloom_ | 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:41 | musicalchair | bbloom_: I think I'm a little behind because I'm not quite following. I'm sure it will make sense soon, though |
| 16:50 | musicalchair | bbloom_: "then you should use that where possible" - what's 'that'? |
| 16:50 | musicalchair | bbloom_: the policy? |
| 16:50 | bbloom_ | musicalchair: a sensible default lifecycle policy |
| 16:50 | bbloom_ | yeah |
| 16:50 | musicalchair | bbloom_: hmm |
| 16:52 | musicalchair | bbloom_: 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:54 | bbloom_ | musicalchair: yeah, i'm speaking at a design level, not about any particular bit of code |
| 16:56 | musicalchair | bbloom_: ok. have you seen any interesting papers (or code, even) around declaring life cycle policies? |
| 16:57 | bbloom_ | musicalchair: i think you're over thinking this :-P |
| 16:57 | bbloom_ | you ever write any C code? |
| 16:57 | musicalchair | bbloom_: I was afraid of that =P too soon, too son |
| 16:57 | musicalchair | s/son/soon |
| 16:57 | bbloom_ | you got stack allocation or heap allocation |
| 16:58 | typicalbender | Anyone have bandwidth the answer a macro question? https://gist.github.com/ajorgensen/7832799 |
| 16:58 | musicalchair | yup |
| 16:58 | bbloom_ | stack allocation is one strategy for managing the lifetime of allocations |
| 16:58 | bbloom_ | and malloc/free is another |
| 16:58 | bbloom_ | and garbage collection is a 3rd |
| 16:58 | bbloom_ | 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:58 | bbloom_ | it's literally that simple :-P |
| 16:59 | musicalchair | mmm 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:00 | musicalchair | bbloom_: thanks for induldging =) back to work.. |
| 17:00 | typicalbender | is 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:04 | stuartsierra | typicalbender: eval it |
| 17:04 | sveri1 | hi 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:04 | egghead | css |
| 17:04 | nDuff | sveri1: http://keminglabs.com/c2/ |
| 17:04 | egghead | oops ya meant to link that one instead ;) |
| 17:05 | sveri1 | ah, nice, it creates svg |
| 17:05 | dnolen | any opinions about #js CLJS literal |
| 17:05 | sveri1 | thank you |
| 17:05 | dnolen | I think about the following semantics |
| 17:05 | dnolen | #js {} -> js-obj, #js [] -> array |
| 17:05 | dnolen | #js {:onClick func} -> (js-obj "onClick" func) |
| 17:06 | dnolen | and #js is shallow |
| 17:06 | dnolen | #js {:items #js [1 2 3]} |
| 17:06 | bbloom_ | dnolen: that was my initial expectation |
| 17:06 | bbloom_ | dnolen: doing it deep is problematic for many reasons |
| 17:06 | dnolen | bbloom_: agreed |
| 17:08 | bbloom_ | dnolen: i'd make it work for #js 'foo and #js :bar too |
| 17:08 | bbloom_ | even tho they aren't that useful :-P |
| 17:10 | dnolen | bbloom_: hrm ... I can't see the value of it being used for anything other than js objects and arrays |
| 17:10 | bbloom_ | dnolen: there isn't any really, feel free to ignore that request |
| 17:10 | bbloom_ | OH |
| 17:10 | bbloom_ | actually there is one |
| 17:10 | bbloom_ | sets |
| 17:10 | bbloom_ | #js #{1 2 3} |
| 17:10 | bbloom_ | should be: |
| 17:10 | bbloom_ | {"1": true, "2": true, "3": true} |
| 17:11 | bbloom_ | that's the js convention for sets |
| 17:11 | dnolen | hrm |
| 17:11 | bbloom_ | i guess you could also expand that as {"1": "1", "2": "2", "3": "3"} to match clj sets closer |
| 17:11 | dnolen | and it should only allow numbers, strings and keywords? |
| 17:12 | musicalchair | dnolen: probably? #{false} -> {false: false} |
| 17:12 | dnolen | musicalchair: yeah that's an argument for true as the value |
| 17:12 | bbloom_ | alternatively you just use they key for the value |
| 17:13 | bbloom_ | the key here is actually "false", a string |
| 17:13 | dnolen | right so this is the problem w/ supporting sets |
| 17:13 | dnolen | I'm kinda inclined to say no |
| 17:13 | dnolen | #js just means I want a JS literal |
| 17:13 | bbloom_ | dnolen: if we do do sets, my vote is to expand to true as the value |
| 17:13 | bbloom_ | but i wouldn't object to not having it |
| 17:16 | chouser | has anyone tried to use data.fressian to read from a file on disk? |
| 17:16 | seangrove | dnolen: 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:16 | bbloom_ | dnolen: you said strings/numbers/keywords, what about symbols? should they be resolved/evaluated? |
| 17:17 | dnolen | http://dev.clojure.org/jira/browse/CLJS-717 |
| 17:17 | dnolen | I think the scope should be very limited |
| 17:17 | dnolen | objects, and arrays only |
| 17:17 | bbloom_ | fair |
| 17:17 | dnolen | #js {}, map keys must be keyword or string |
| 17:17 | bbloom_ | i'd consider symbol keys to be an error |
| 17:17 | dnolen | yes |
| 17:18 | musicalchair | are clojurescript's numerics straight javascript numbers? |
| 17:18 | bbloom_ | yes |
| 17:19 | abp | you guys make me want to play with react |
| 17:19 | dnolen | no namespaced keywords I think |
| 17:19 | abp | any particular resources besides docs/presentation vid? |
| 17:20 | dnolen | abp: JSConf EU 2013 petehunt video is great intro |
| 17:20 | dnolen | abp: I've found it more informative to lurk on IRC and pester them :) |
| 17:20 | abp | dnolen: ok, thanks |
| 17:20 | petehunt | for js: http://facebook.github.io/react/docs/tutorial.html |
| 17:20 | petehunt | another great video: http://facebook.github.io/react/blog/2013/11/18/community-roundup-11.html |
| 17:21 | abp | petehunt: oh, hi :) more interested in cljs but able to adapt ;) |
| 17:21 | petehunt | also 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:21 | petehunt | abp: yeah sorry, i am from JS world :( working on my clojure-foo though |
| 17:22 | abp | petehunt: thanks for those resources and that's great to hear! |
| 17:22 | bbloom_ | petehunt: we'll make a clojurian out of you yet |
| 17:22 | dnolen | petehunt: it definitely applies, you'll end up doing the same things but with functions |
| 17:22 | dnolen | petehunt: the TodoMVC port should be informative when I get around to it |
| 17:22 | petehunt | bbloom_: i'm already convinced. i just need the time (I have a day job!) |
| 17:23 | bbloom_ | petehunt: perfect. so i'll expect instagram.com to be ported to cljs by the end of the week |
| 17:23 | bbloom_ | :-D |
| 17:23 | petehunt | npm install js2cljs |
| 17:23 | petehunt | am i doing it right guys? |
| 17:24 | abp | petehunt: seems bout right start, js is just scheme without parenthesis anyway *runs* |
| 17:26 | BobSchack | petehunt I've come to clojure form PHP :) |
| 17:27 | petehunt | BobSchack: the fact that you guys have a great culture and tooling support around immutable data structures is reason enough to switch! |
| 17:27 | deadghost | I like js as a language |
| 17:28 | deadghost | but in practice it doesn't feel very lispy |
| 17:28 | deadghost | and I still think node.js is group hysteria |
| 17:29 | petehunt | deadghost: that's a very apt description of node.js :) |
| 17:29 | imkmf | deadghost, petehunt: why's that? i don't write node at all, but i'm always curious about the big discrepancy in node opinion |
| 17:30 | deadghost | the only guy I know that really likes node is really big on js to begin with |
| 17:30 | deadghost | it's his dominant language by far |
| 17:30 | deadghost | I gave node.js a fair try |
| 17:30 | deadghost | and don't know how it seems like a reasonable choice for anyone |
| 17:31 | deadghost | all those callbacks |
| 17:31 | imkmf | right |
| 17:31 | nDuff | deadghost: callbacks? sounds like an excuse for core.async. :) |
| 17:31 | deadghost | I think people who think it's totally ok to code like that is out of their mind |
| 17:32 | BobSchack | Node 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:32 | deadghost | my js friend also is more susceptible to trendy stuff |
| 17:32 | deadghost | nodejs + rethinkdb for pretty much no reason |
| 17:33 | deadghost | we didn't need the performance |
| 17:35 | deadghost | idk what's driving nodejs adoption |
| 17:35 | deadghost | I suspect all the front end web devs that spent years in js jumping to back end |
| 17:36 | deadghost | or it's actually totally amazing and I can't see it at all |
| 17:38 | bbloom_ | 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:39 | deadghost | right I got the vibe the rails hipster crowd moved to node |
| 17:39 | bbloom_ | 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:40 | bbloom_ | 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:40 | dnolen | deadghost: Node.js is fine ... especially if ClojureScript runs on it :) |
| 17:40 | dnolen | bbloom_: hum, I thought I fixed it |
| 17:41 | dnolen | bbloom_: do you have some case where it doesn't work? |
| 17:42 | bbloom_ | dnolen: you fixed the java vs js date thing? |
| 17:42 | deadghost | I actually tried node.js with sibilant |
| 17:42 | deadghost | http://sibilantjs.info/ |
| 17:42 | dnolen | bbloom_: I thought I did |
| 17:43 | bbloom_ | dnolen: oh, i didn't see. i'll look at it in a bit |
| 17:43 | deadghost | idk how well something like clojurescript can make nodejs callbacks palatable |
| 17:43 | wink | aw man, I liked the monospace font only to learn it's a google one |
| 17:43 | dnolen | bbloom_: remind me what the failing case was? it just didn't work at all right? |
| 17:43 | dnolen | deadghost: solved problem - core.async |
| 17:44 | deadghost | huzzah |
| 17:45 | rads | I 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:46 | bja | rads: it supports concurrency better than python? It's almost identical to twisted in normal use |
| 17:46 | deadghost | it's easier to start with something small and build up with nodejs |
| 17:46 | deadghost | I'll give it that |
| 17:47 | deadghost | ruby and python have rails and django representing them |
| 17:47 | deadghost | and those are large by default |
| 17:47 | bja | yeah, but if you're wanting to write event-driven network stuff, you'd use EventMachine or Twisted |
| 17:48 | bja | which 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:48 | bbloom_ | dnolen: Caused by: java.lang.RuntimeException: No such var: readers/source-logging-push-back-reader |
| 17:48 | bbloom_ | trying to run script/repljs |
| 17:48 | dnolen | bja: but it wouldn't be Web Scale |
| 17:49 | bja | dnolen: correct. but it also wouldn't need several million dollars to scale either |
| 17:49 | Bronsa | bbloom_: you need to update your tools.reader dep |
| 17:50 | bbloom_ | Bronsa: i did a script/clean & script/bootstrap |
| 17:50 | bbloom_ | and lein deps |
| 17:50 | bja | my mistake, webscale only costs $200k |
| 17:51 | bja | webscale is cheaper than 2 FTEs |
| 17:51 | petehunt | yeah |
| 17:51 | petehunt | until node got generators it was pretty much unusable |
| 17:52 | dnolen | petehunt: yet that didn't stop them for saying otherwise :) |
| 17:52 | petehunt | i think npm is pretty good though, though i am still unsure about the local vs global dependencies thing |
| 17:52 | dnolen | s/for/from |
| 17:52 | petehunt | dnolen: there are certainly....cultural issues. |
| 17:52 | dnolen | petehunt: npm is alright, some good libs, and they have momentum |
| 17:53 | Bronsa | bbloom_: and you have only tools.reader.0.8.0.jar in lib/ ? |
| 17:53 | dnolen | petehunt: 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:53 | bbloom_ | oh there are others in there... |
| 17:54 | petehunt | dnolen: how does well written cljs on v8 perform vs clojure on jvm |
| 17:54 | dnolen | bbloom_: repljs works fine for me |
| 17:54 | dnolen | bbloom_: you sure you don't have a multple jars in libs? |
| 17:54 | bbloom_ | dnolen: there are multiple in there. i'm going to send you a patch for the bootstrap script :-) |
| 17:54 | bja | heh, we need cljs/node vs clj/http-kit benchmarks |
| 17:54 | dnolen | petehunt: very favorably |
| 17:55 | dnolen | petehunt: things I specifically spent optimizing are often within or under 2.5X of the JVM which is pretty cool |
| 17:55 | rads | bja: 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:55 | bja | rads: we don't talk about third party libraries in the twisted universe. |
| 17:56 | dnolen | petehunt: 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:56 | bja | rads: you can always deferToThread |
| 17:56 | cYmen | I have a seq of seqs and I would like to remove the smallest first element of the seqs. How do I do it? |
| 17:56 | petehunt | dnolen: i bet cljs startup time is better, no? |
| 17:57 | bbloom_ | dnolen: https://gist.github.com/brandonbloom/7833585 apply me |
| 17:57 | gfredericks | it occurred to me today that you could do arbitrarily complex lexical refactorings at a keystroke just with cider & emacs macros |
| 17:57 | bja | rads: 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:57 | dnolen | petehunt: for compiled scripts yeah, non existant |
| 17:58 | bbloom_ | dnolen: you didn't fix the tagged literals issue |
| 17:58 | petehunt | inlineCallbacks in twisted was sweet |
| 17:58 | bbloom_ | '#inst "2013-12-06" |
| 17:58 | bbloom_ | try that |
| 17:58 | bbloom_ | note the leading quote |
| 17:58 | dnolen | bbloom_: ah right couldn't remember what the actual bug was filing now |
| 17:58 | bbloom_ | (quote #inst "2013-12-06") |
| 17:58 | rads | so my point is with node all the third party libs already assume callbacks, and the stdlib prefers callbacks. I think that's useful |
| 17:59 | bbloom_ | dnolen: apply my clean patch :-) |
| 17:59 | dnolen | bbloom: http://dev.clojure.org/jira/browse/CLJS-718 |
| 17:59 | dnolen | bbloom_: where? |
| 18:00 | bbloom_ | dnolen: https://gist.github.com/brandonbloom/7833585 |
| 18:01 | dnolen | bbloom_: done |
| 18:02 | bbloom_ | hurray |
| 18:03 | cYmen | bbloom_: Problem 108. I'll take that hint now. |
| 18:12 | cYmen | I have a solution but it is naaaasty. |
| 18:15 | bbloom_ | cYmen: sorry back. what did you come up with? |
| 18:15 | cYmen | My account name is firefly... |
| 18:16 | cYmen | Basically I just removed the minimum element until they were either all equal or I ran out. |
| 18:16 | cYmen | But beating those seqs into shape was waaaaay more annoying than usual. |
| 18:16 | bbloom_ | yeah, that's basically it |
| 18:17 | cYmen | Well, 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:18 | bbloom_ | cYmen: you need to traverse them in parallel |
| 18:18 | cYmen | hm... |
| 18:35 | cYmen | bbloom_: is there any clever way of doing that? |
| 18:36 | bbloom_ | cYmen: i'm not #clojure's best golfer. i'd probably write a loop :-) |
| 18:38 | cYmen | How'd you do it in a loop? |
| 18:41 | justin_smith | I did mine with a function and recur, 4 lines |
| 18:42 | justin_smith | I did it by doing a lazy seq on each in parallel, and stopping when all first elements were equal |
| 18:42 | justin_smith | the trick is knowing when to advance one of them |
| 18:43 | egghead | sounds fancy |
| 18:44 | justin_smith | cYmen: the lists are sorted |
| 18:44 | justin_smith | so you take the list of lists, and if all first elements are equal, you are done |
| 18:44 | cYmen | justin_smith: Yeah, so you can always advance the list with the smallest element |
| 18:45 | justin_smith | right |
| 18:45 | chouser | justin_smith: that's what I did. mine is 5 lines |
| 18:45 | cYmen | well, apparently I missed some shortcuts :p |
| 18:45 | cYmen | mine is 6 and ugly |
| 18:46 | `cbp | showoffs |
| 18:46 | `cbp | mine was 14 |
| 18:46 | chouser | Don't be sad. 4clojure is for learning. |
| 18:47 | chouser | I abuse it for golf fun. :-) |
| 18:47 | justin_smith | cYmen: I'm following you on 4clojure, we implement pretty much the same logic, just express it differently |
| 18:48 | cYmen | justin_smith: are you noisesmith? |
| 18:49 | justin_smith | yeah |
| 18:49 | cYmen | yeah, looking at it :) |
| 18:49 | cYmen | you are the only guy I'm following so I look at all your solutions ;) |
| 18:49 | justin_smith | your min-key / take/drop thing is the same logic I implemented by sorting the sequences by first |
| 18:49 | justin_smith | heh |
| 18:49 | justin_smith | some of mine are terrible |
| 18:49 | cYmen | well..yes |
| 18:49 | cYmen | :) |
| 18:50 | dnolen | #js tagged literals in master - http://github.com/clojure/clojurescript/commit/91f6a3223122e3ae147cca0e9838f84290292789 |
| 18:50 | bitemyapp | Korma users, I got a ping about some changes that are desired. |
| 18:50 | bitemyapp | akurilin: seangrove ^^ |
| 18:50 | bitemyapp | from a company that seems to be using it. Hopefully they'll be tossing me ideas for improvements. Consider this a general solicitation. |
| 18:50 | bbloom_ | dnolen: let me toy with it a bit :-) |
| 18:51 | cYmen | justin_smith: I should stop trying to optimize prematurely. I thought about sorting but decided against it because it isn't necessary. |
| 18:51 | akurilin | bitemyapp: as in, you're welcoming requests for improvements? |
| 18:51 | dnolen | bbloom_: heh, will look into fixing the quoting issues next :) |
| 18:51 | bbloom_ | dnolen: that's a fair bit trickier. i think we need a protocol for that |
| 18:52 | bbloom_ | dnolen: if you recall we discussed it: it's got to be per code generator |
| 18:52 | bitemyapp | akurilin: uh sorta, but I'm not planning to superhero anything myself. I'll help on things somebody else starts. |
| 18:52 | bbloom_ | dnolen: ie you need a different back end for js or for lua or for jvm or whatever |
| 18:52 | bitemyapp | akurilin: this is to avoid a fork and improve Korma. |
| 18:53 | bbloom_ | dnolen: the assert is pretty annoying in the repl. if you get a bad literal it kills repljs |
| 18:53 | akurilin | bitemyapp: 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:53 | dnolen | bbloom_: yeah it should be switched to a proper warning - was just copying what was already done |
| 18:53 | akurilin | Thinking stuff like passing db pools/connections into each query etc. |
| 18:53 | bitemyapp | akurilin: 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:54 | bitemyapp | akurilin: 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:56 | akurilin | I 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:56 | bitemyapp | akurilin: all of this hinges on this company being willing to implement what they want though. |
| 18:56 | bitemyapp | akurilin: you're supposed to do that. stub out model calls. |
| 18:56 | bbloom_ | dnolen: hurray js literal :-) |
| 18:56 | bbloom_ | dnolen: works great |
| 18:56 | bbloom_ | dnolen: would be nice to document it :-) |
| 18:57 | akurilin | bitemyapp: "model call" can mean a bunch of things. Are we talking specifically about DB calls? |
| 18:59 | justin_smith | cYmen: I was optimizing; optimizing for readability :) |
| 18:59 | justin_smith | easier to be clear and correct, then make it fast |
| 18:59 | justin_smith | unclear and wrong and fast -> correct is a very hard transition |
| 19:00 | justin_smith | not saying I don't often I fail at that, but that's what I am usually aiming for at least |
| 19:00 | bitemyapp | akurilin: I mean model function. It'd be easiest to explain by example. |
| 19:01 | cYmen | justin_smith: I _try_ but my mind works (and sometimes doesn't) in mysterious ways |
| 19:01 | bitemyapp | akurilin: just uhh, you know, abstracting your controllers/views from the specifics of the data layer. |
| 19:01 | cYmen | and so does the resulting code :p |
| 19:01 | akurilin | bitemyapp: 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:08 | danneu | Has anyone ever had Adsense disabled for having ads on a non-content page (404 in my case)? |
| 19:11 | abp | dnolen: re js-literal, wouldn't mapcat be more appropriate than apply concat in read-js? |
| 19:13 | bitemyapp | akurilin: 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:13 | bitemyapp | code-n-talk |
| 19:14 | akurilin | bitemyapp: sounds fair, would appreciate that. |
| 19:14 | bbloom_ | abp: better yet (for [[k v] form, x [(name k) v]] x) /cc dnolen |
| 19:15 | bbloom_ | abp: eh, nah, mapcat is better lol |
| 19:15 | abp | bbloom_: at least you tried :D |
| 19:16 | egghead | lol justin_smith cYmen after your chat I had to solve it... got it to 5 lines |
| 19:16 | bbloom_ | abp: fn is just not short enough :-P |
| 19:16 | justin_smith | egghead: nice |
| 19:17 | egghead | spoilers inside: https://www.refheap.com/21570 |
| 19:18 | DAAAMN | Chousuke, ping? |
| 19:20 | egghead | what is your username on there justin_smith |
| 19:22 | abp | bbloom_: Are you somewhat familiar with the changes around keywords in cljs? |
| 19:23 | bbloom_ | abp: somewhat. dnolen & seangrove would know best |
| 19:23 | abp | bbloom_: This code can't work anymore, right: https://github.com/Prismatic/dommy/blob/master/src/dommy/macros.clj#L97 |
| 19:23 | abp | I think it needs keyword-identical? .. probably |
| 19:24 | bbloom_ | abp: um, no that's probably fine b/c the identical? is occuring in the macro expansion. that's evaled on the jvm |
| 19:27 | amalloy | bbloom_: fwiw, some time ago i wrote a function knit such that your for-expression above could be (mapcat (knit name identity) form) |
| 19:28 | bbloom_ | amalloy: so is that basically juxt with an extra set of [] in the arg list? :-P |
| 19:28 | devn | Given 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:29 | bbloom_ | amalloy: seems like a useful little combinator |
| 19:29 | amalloy | bbloom_: no, you'll see that juxt does something different which doesn't work here |
| 19:29 | bbloom_ | amalloy: er yeah, i gotcha |
| 19:29 | amalloy | ((juxt f g) x y) => [(f x y) (g x y)], ((knit f g) [x y]) => [(f x) (g y)] |
| 19:30 | bbloom_ | amalloy: http://docs.factorcode.org/content/article-dataflow-combinators.html |
| 19:30 | bbloom_ | juxt : cleave :: knit : spread |
| 19:31 | amalloy | well, 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:31 | bbloom_ | cool |
| 19:33 | justin_smith | egghead: noisesmith, same as my github |
| 19:34 | egghead | cool, thx |
| 19:35 | justin_smith | devn: maybe something with set ops and group by? |
| 19:35 | justin_smith | *group-by |
| 19:35 | devn | hrm -- i think my issue is that im screwing up (apply #(update-in ...) ...) and (apply #(assoc-in ...) ...) |
| 19:36 | devn | i keep getting various wrong number of arguments issues |
| 19:39 | devn | nevermind figured it out |
| 19:40 | devn | nevermind, no i didn't :) |
| 19:43 | gfredericks | does anybody remember a (toy?) clojure lib for generating instances of a given regex? |
| 19:43 | amalloy | devn: i think step one is (for [[file fields] m, field fields] {field file}) |
| 19:44 | amalloy | or probably {field [file]} at the end there, to make it easier to merge-with into |
| 19:44 | amalloy | (apply merge-with into (for [[file fields] m, field fields] {field [file]}))? |
| 19:44 | abp | gfredericks: nope, only that: https://github.com/noprompt/frak |
| 19:44 | gfredericks | yeah that's what google keeps pointing me to :) |
| 19:44 | devn | amalloy: this is what i was trying: https://www.refheap.com/21571 |
| 19:45 | amalloy | oh, i missed the count |
| 19:45 | gfredericks | has anybody done regex parsing at least? |
| 19:46 | noprompt | gfredericks: it's one of the things i've been meaning to get around to. |
| 19:46 | amalloy | what is the count for? it looks like just the count of the vector it's referring to. why include that at all? |
| 19:46 | noprompt | gfredericks: i keep running in to these places where are re parser would be useful. |
| 19:46 | devn | amalloy: it's to count the number of occurrences of a field across all files |
| 19:46 | gfredericks | noprompt: I bet feeding the results into simplecheck would be pretty straightforward |
| 19:47 | noprompt | gfredericks: btw if you look at frak, i'm open to *any* improvements as i'm sure the algorithm is not the best. |
| 19:47 | abp | gfredericks: https://github.com/weavejester/re-rand |
| 19:47 | devn | amalloy: but to still maintain which files it was counted from |
| 19:47 | noprompt | gfredericks: i was trying to solve a problem so i wasn't focused on performance necissarily. |
| 19:47 | dnolen | Bronsa: 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:48 | devn | amalloy: what im doing in that refheap is now pretty different from what i think i am asking above |
| 19:48 | gfredericks | noprompt: I linked to the english-words gist on twitter a few months back and it virally exploded |
| 19:48 | gfredericks | by far the most popular thing I ever done tooted |
| 19:48 | swart | I'm seeing the following problem on OS X - any suggestions as to what I'm doing wrong? http://pastebin.com/pq9P2qxL |
| 19:49 | gfredericks | abp: oh that was totally it! thanks |
| 19:49 | gfredericks | oh wow it's three years old |
| 19:49 | noprompt | gfredericks: 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:50 | justin_smith | swart: it is happening while it is reading your profiles |
| 19:50 | noprompt | gfredericks: thanks for sharing it :) |
| 19:50 | gfredericks | noprompt: I would've more vigorously linked it to you if I'd known it'd get that much attention |
| 19:50 | justin_smith | swart: maybe try temporarily moving your profiles.clj if you have one, or checking your project.clj for errors |
| 19:50 | justin_smith | swart: does lein repl in a directory with no clojure project work? |
| 19:51 | gfredericks | noprompt: https://twitter.com/gfredericks_/status/366694207995392000 |
| 19:51 | noprompt | gfredericks: what surprised me the most is that most of the people who starred/watched it aren't clojure programmers. |
| 19:51 | gfredericks | justin_smith: I think so |
| 19:51 | swart | justin_smith: yes. it does |
| 19:51 | swart | hmm. I've got some funky stuff in my profile from when I was playing with emacs |
| 19:52 | gfredericks | noprompt: yeah I kind of observe that from the twitter reaction too |
| 19:52 | justin_smith | swart: yeah, I bet there is a syntax error in your profiles.clj or that project's project.clj |
| 19:52 | noprompt | gfredericks: some people thought that regex was a hoax. it was just the first thing i thought to do once i had it working. |
| 19:52 | swart | justin_smith: that fixed it |
| 19:52 | noprompt | gfredericks: it's kinda funny. |
| 19:52 | gfredericks | noprompt: yeah I was jealous I hadn't thought of that myself :) |
| 19:52 | eric_normand | dnolen: pure + hiccup macro is super fast |
| 19:53 | swart | I had this in there :jvm-opts ^:replace [] |
| 19:53 | dnolen | eric_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:53 | Bronsa | dnolen: as long as it's not an ExceptionInfo it will be automatically get wrapped into one with :line/:column |
| 19:53 | gfredericks | noprompt: it made me think of plugging such a thing into a DFA minimization algorithm; so I tried that but the results were hairy |
| 19:53 | swart | istr it was an optimization recommended by overtone |
| 19:53 | swart | justin_smith: thanks |
| 19:53 | justin_smith | np |
| 19:54 | gfredericks | noprompt: oh here it is -- the minimal DFA for some small subset of words: http://upload.gfredericks.com/graph.svg |
| 19:54 | gfredericks | I used a subset just to make it tractable |
| 19:54 | eric_normand | dnolen: and easy, too |
| 19:54 | noprompt | gfredericks: 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:55 | eric_normand | dnolen: I was skeptical of the pure value |
| 19:55 | eric_normand | dnolen: but it was easy to choose |
| 19:55 | noprompt | gfredericks: oh wow. this is beautiful. |
| 19:55 | dnolen | eric_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:55 | gfredericks | it's something |
| 19:55 | noprompt | gfredericks: this would make a great poster. |
| 19:55 | eric_normand | dnolen: and in every case identical if it didn't vhange |
| 19:55 | dnolen | eric_normand: yep |
| 19:55 | eric_normand | change |
| 19:56 | dnolen | eric_normand: we're emerging from the stone ages for front end development |
| 19:59 | gfredericks | does core.async get used to have channels between browser and server? |
| 19:59 | gfredericks | is that the recommended way of communicating now? |
| 20:00 | gfredericks | noprompt: I wish it were possible for this sort of diagram to be remotely legible; a lot of the edges get too tangled |
| 20:00 | dnolen | Bronsa: excellent thanks! |
| 20:01 | bitemyapp | HTTP content negotation. oh-my-god. |
| 20:03 | noprompt | gfredericks: that or at least interactive. iow you could click and drag nodes around. |
| 20:04 | gfredericks | noprompt: ah right |
| 20:04 | noprompt | gfredericks: come to think of it, isn't there a js library that does graphs like that? |
| 20:05 | noprompt | gfredericks: 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:05 | noprompt | *atlas |
| 20:05 | clojurebot | excusez-moi |
| 20:05 | gfredericks | yeah it wouldn't surprise me |
| 20:06 | dnolen | bbloom_: hrm, so I guess reader literals are specially treated somehow so they always self evaluate? |
| 20:14 | amalloy | dnolen: 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:15 | devn | amalloy: this is closer i guess... https://www.refheap.com/21571 |
| 20:16 | amalloy | and 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:17 | pdk | wait |
| 20:18 | pdk | clojure added user supplied reader macros now? |
| 20:18 | amalloy | devn: what is the deal with (apply #(assoc-in m [%2 :files] [k]) vs), vs (assoc-in m [(second vs) :files] [k])? |
| 20:18 | amalloy | pdk: not really. a fairly limited subset |
| 20:18 | pdk | what's the story |
| 20:18 | pdk | did they just add a few predefined ones and let you supply the implementation as desired |
| 20:19 | dnolen | amalloy: you sure? ''#inst "2012", #inst "2012" always self evaluates, same for the other literals |
| 20:19 | dnolen | amalloy: doesn't matter the level of quoting |
| 20:20 | dnolen | amalloy: or sorry, you're suggesting the behavior, I was just wondering if the defaults are special cased to have this behavior |
| 20:20 | dnolen | I mean you were suggesting the behavior of a custom data literal |
| 20:20 | amalloy | i 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:20 | dnolen | amalloy: a reader literal always evaluates to itself, regardless of the level of quoting |
| 20:21 | dnolen | ,''#inst "2013" |
| 20:21 | clojurebot | #<SecurityException java.lang.SecurityException: denied> |
| 20:21 | dnolen | heh right |
| 20:21 | dnolen | anyways that'll emit (quote #inst "2013") |
| 20:23 | amalloy | dnolen: it doesn't do that for me |
| 20:23 | amalloy | user=> ''#inst "2013" ;; => (quote #inst "2013-01-01T00:00:00.000-00:00") |
| 20:23 | bitemyapp | Raynes: I would watch TV again for that. |
| 20:23 | Raynes | bitemyapp: Agreed. |
| 20:23 | dnolen | amalloy: er that's what I meant |
| 20:24 | justin_smith | ''''#inst "2013" -> (quote (quote (quote #inst "2013-01-01T00:00:00.000-00:00"))) |
| 20:24 | amalloy | then...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:24 | dnolen | ''''#inst "2013-01-01T00:00:00.000-00:00" -> (quote (quote (quote #inst "2013-01-01T00:00:00.000-00:00"))) |
| 20:24 | dnolen | amalloy: ^ |
| 20:24 | devn | dnolen: you're talking about reader literals in cljs or clj? |
| 20:25 | dnolen | devn: I'm trying to understand the clj behavior so I can replicate it |
| 20:25 | devn | ahhh |
| 20:25 | amalloy | dnolen: i see that, but i don't know what property you're getting at |
| 20:25 | amalloy | it's definitely not the property of self-evaluation |
| 20:25 | amalloy | because ''(inc 1) prints as (quote (inc 1)), even though (inc 1) is clearly not self-evaluating: it evaluates to 2, of course |
| 20:26 | dnolen | amalloy: an #inst is just a java.util.Date |
| 20:26 | dnolen | amalloy: my point is this must be preserved some how |
| 20:26 | dnolen | if I make a #foo [1 2 3] -> (foo 1 2 3) |
| 20:26 | dnolen | ''#foo -> (quote (foo 1 2 3)) |
| 20:26 | devn | so 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:26 | devn | user> ''#inst "2013" |
| 20:26 | devn | (quote #inst "2013-01-01T00:00:00.000-00:00") |
| 20:26 | dnolen | not (quote #foo [1 2 3]) |
| 20:27 | dnolen | amalloy: ^ |
| 20:28 | amalloy | dnolen: that's just how the compiler prints Date objects |
| 20:28 | amalloy | it doesn't remember that it was read in as an #inst |
| 20:29 | amalloy | ,(java.util.Date.) |
| 20:29 | clojurebot | #inst "2013-12-07T01:29:05.342-00:00" |
| 20:30 | dnolen | '''(java.util.Date. "2012") |
| 20:30 | amalloy | so #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:30 | dnolen | obviously won't do that |
| 20:30 | dnolen | ok that makes sense |
| 20:30 | amalloy | dnolen: well, of course, because that doesn't build a date |
| 20:30 | amalloy | #inst happens at read time |
| 20:30 | devn | ,(macroexpand-1 '#inst "2013") |
| 20:30 | dnolen | amalloy: right, anyways, I'll have to think about this some more - thanks. |
| 20:30 | clojurebot | #<SecurityException java.lang.SecurityException: denied> |
| 20:31 | devn | => #inst "2013-01-01T00:00:00.000-00:00" |
| 20:43 | devn | amalloy: re: your earlier question -- i think this is closer, but i'm open to suggestions https://www.refheap.com/21571 |
| 20:46 | devn | which is totally superfluous in the if-not |
| 20:58 | bbloom_ | dnolen: amalloy: sorry i only skimmed the chat |
| 20:59 | bbloom_ | dnolen: amalloy: but "self-evaluates" is not a good way to think about it. it's simply *not* evaluated |
| 20:59 | bbloom_ | 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:00 | bbloom_ | a major feature of reader literals is that the domain of macros is expanded to include non-syntax constructs |
| 21:00 | bbloom_ | dnolen: basically, reader-literals should be compiled in to the constants table |
| 22:00 | devn | Do you refer to yourself as a Clojurist or a Clojurian? |
| 22:01 | devn | Inquiring minds want to know. |
| 22:01 | seangrove | Clojurian is the term, I believe, but I'm not a fan of associating myself solely with a language like that |
| 22:02 | joegallo | both terms make me vomit into my mouth a little, but that's just me |
| 22:02 | `cbp | i refer to myself as cesar |
| 22:02 | devn | seangrove: 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:03 | devn | Python folks tend to say Pythonista without hesitation. Or at least, that's been my experience. |
| 22:03 | joegallo | there it is again, a little bit more vomit |
| 22:03 | joegallo | so i guess it works for pythonista too |
| 22:03 | joegallo | amazing |
| 22:03 | devn | I heard pythonista today from a few people and I'll agree with you, it sounds ridiculous. |
| 22:04 | joegallo | my grandfather was a farmer so that my father could be an engineer so that i could be a pythonista |
| 22:04 | joegallo | i have shamed the generations that came before me |
| 22:04 | devn | So there are euphemisms, and there are the lesser known dysphemisms. |
| 22:05 | devn | I wonder what "pythonista" would be classified as. |
| 22:05 | Raynes | devn: I'm a Clojuristian. |
| 22:05 | seangrove | Taxonomy... |
| 22:06 | devn | dysphemisms 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:06 | devn | I think pythonista is pretty close to a dysphemism |
| 22:06 | Raynes | devn: Was that my poll? I feel like I ran a poll like that when I was like 15. |
| 22:06 | devn | Raynes: that makes 1 of us. :) |
| 22:07 | devn | Raynes: you may have as well. it's crazy you were hanging around clojure town on 56k back then. |
| 22:07 | Raynes | devn: 56k? |
| 22:08 | devn | all of this talk about running Clojure on giant Azul clusters and you were rocking some primitive internets. |
| 22:08 | devn | Raynes: I remember you telling me you had dialup |
| 22:08 | Raynes | Oh! |
| 22:08 | Raynes | Yes. |
| 22:08 | bbloom_ | seangrove: there's a difference between "I'm an american, and damn proud of it!" and "I have american citizenship" |
| 22:09 | bbloom_ | i use clojure & participate in the community, that makes me a cloju-wahtever-ist-ian |
| 22:09 | bbloom_ | that's a fact about me, it doesn't define me. you can use the word w/o letting it define you :-) |
| 22:13 | devn | Can 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:13 | justin_smith | http://thisplacejournal.com/ <- since I did not work on the latest caribou site, I can say it is totally awesome |
| 22:13 | devn | the whole (into {} (map #(update-in m [%] conj k) vs)) thing grosses me out |
| 22:15 | devn | justin_smith: im confused. is this the caribou website? |
| 22:15 | justin_smith | it is the latest of the sites constructed using caribou |
| 22:16 | devn | justin_smith: you need your designers to show the caribou docs site some love |
| 22:16 | justin_smith | we do |
| 22:16 | devn | but then again, don't be those guys who spend more time branding than making it usable |
| 22:16 | justin_smith | heh |
| 22:17 | justin_smith | don't worry, our designers don't write caribou code |
| 22:17 | devn | design is time-consuming and is sometimes a complete waste for libs and docs |
| 22:17 | justin_smith | so it isn't either or |
| 22:17 | justin_smith | our designers are dedicated, they don't even html |
| 22:17 | justin_smith | specialists |
| 22:17 | devn | s/our designers don't/our designers won't/g |
| 22:17 | justin_smith | heh, that's not what they are good at |
| 22:17 | justin_smith | we have frontend guys for that |
| 22:18 | justin_smith | hell, if we even got a frontend guy to give our docs site a looking at that would even help |
| 22:19 | devn | We have a gradient |
| 22:19 | justin_smith | yeah, that is common, we are really hyper-specialized around our design |
| 22:19 | devn | There needs to be a good set of bridges between design, front end, and back end |
| 22:20 | justin_smith | hell, we have art-directoris that don't even do design - just guide it |
| 22:20 | devn | otherwise you get things which cannot be built for the web without huge sacrifices |
| 22:20 | devn | blood letting and the whole deal |
| 22:20 | justin_smith | we have conversations to cover that |
| 22:21 | justin_smith | it is very horizontal compared to most workplaces |
| 22:21 | justin_smith | we get in an argument with a designer, and figure out what actually is doable |
| 22:21 | devn | just to temper my contrarian attitude |
| 22:21 | devn | i think thisplacejournal.com looks lovely |
| 22:21 | devn | tell your designers i said so :) |
| 22:21 | justin_smith | oh, thanks |
| 22:22 | devn | Raynes: hot. |
| 22:22 | bbloom_ | Raynes writes web frameworks to harvest the blood of users for his now widely publicized vampire bloodlust |
| 22:23 | devn | justin_smith: tiny bit of feedback: http://thisplacejournal.com/chapter/1 |
| 22:23 | devn | when it fills half my screen i have no idea i can scroll |
| 22:23 | devn | i needed to expand it to figure that out |
| 22:23 | justin_smith | weird, what browser? I get a scroll bar |
| 22:23 | devn | chrome |
| 22:24 | devn | justin_smith: what os? |
| 22:24 | justin_smith | ubuntu ringtail |
| 22:24 | justin_smith | chrome |
| 22:24 | devn | justin_smith: yeah, on osx they hide the scrollbars until you scroll |
| 22:24 | devn | so because it doesn't show the box with the down arrow you don't know to scroll |
| 22:25 | justin_smith | weird, I am literally the only person not using osx at work |
| 22:25 | justin_smith | you would think they would notice this |
| 22:25 | devn | i have some some design |
| 22:25 | devn | done some* |
| 22:26 | devn | if you like the way it looks on a big screen there is a strong tendency toward saying: "fuck you. this is art." |
| 22:26 | Raynes | Oh my. |
| 22:26 | Raynes | That was lovely. |
| 22:26 | devn | it's like if guernica were 8.5" x 11" |
| 22:26 | justin_smith | devn: making a ticket on the tracker, thanks |
| 22:27 | devn | justin_smith: no problem. i hate to be a critic. i think it's really nice. |
| 22:27 | devn | bbloom_: yeah, raynes is a vampire |
| 22:27 | devn | i've had too many 3:30AM conversations to believe otherwise |
| 22:28 | devn | which begs the question: "am *I* a vampire?" |
| 22:30 | devn | justin_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:30 | justin_smith | devn: 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:30 | justin_smith | devn: nice |
| 22:30 | devn | justin_smith: it gets better |
| 22:30 | devn | wait til it's done, then scroll |
| 22:30 | devn | there's a preferences pane to adjust the settings, too |
| 22:31 | devn | click the play button |
| 22:31 | justin_smith | man, now I want to submit those arrows to the 3d printer in the office |
| 22:31 | devn | etc. |
| 22:31 | justin_smith | in other news, there is a 3d printer in the office, woot |
| 22:32 | devn | we 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:32 | justin_smith | that is some nice webgl |
| 22:32 | justin_smith | cool |
| 22:32 | justin_smith | we have concerts by our teepee |
| 22:32 | justin_smith | occasionally |
| 22:32 | devn | justin_smith: his stuff is better than any i've seen |
| 22:33 | justin_smith | it is really good |
| 22:33 | devn | justin_smith: go to the widget thing in the upper right, and change it to EGA |
| 22:33 | justin_smith | I've been poking at that |
| 22:34 | devn | between your company's work on thisplacejournal and acko.net my machine is a full-on space heater |
| 22:34 | justin_smith | lol, need a new gpu? |
| 22:34 | justin_smith | yeah, thisplace is rough of the processor too |
| 22:34 | justin_smith | I noticed that |
| 22:35 | justin_smith | like system loads almost hitting 4 |
| 22:35 | devn | justin_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:35 | devn | felt like running gentoo again, except worse |
| 22:35 | devn | im too old for that shit |
| 22:36 | justin_smith | wait, who said linux? |
| 22:36 | devn | you did earlier i though |
| 22:36 | devn | 03:24 < justin_smith> ubuntu ringtail |
| 22:36 | justin_smith | ahh |
| 22:36 | justin_smith | just seemed like a non-sequitor just now |
| 22:37 | devn | when you said "new gpu?" i felt like that's something you only ask someone who has control over their damned hardware |
| 22:37 | devn | which i most certainly do not at the moment |
| 22:37 | justin_smith | ahh |
| 22:37 | justin_smith | now the pieces fit together |
| 22:39 | devn | ,(-> (interleave "devn" "justin_smith") sort) |
| 22:39 | clojurebot | (\d \e \j \n \s ...) |
| 22:44 | Raynes | devn: Gee, get a room man. ;) |
| 22:46 | hyPiRion | ,(->> (concat "Raynes" "hyPiRion") sort (take 3) (apply str)) |
| 22:46 | clojurebot | "PRR" |
| 22:50 | devn | heh |
| 22:51 | devn | so, 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:52 | devn | derp, that last (into {}) should be (into (sorted-map)) |
| 22:54 | devn | guess 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:11 | devn | So, 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:12 | seangrove | devn: How so? |
| 23:12 | devn | make /all the things/ callable! |
| 23:13 | devn | like (map #"foo" ["foobar" "bar" "baz"]) |
| 23:13 | seangrove | Hrm... yes, but that seems like a reasonable enough idea. What were the 3 years spent struggling over? |
| 23:13 | devn | seangrove: nothing in particular |
| 23:13 | devn | i worked on cljs before it got released and i guess I just didn't notice IFn sitting there |
| 23:14 | devn | alan and i were talking about a problem i was working on and he suggested making the records i was working with invokable |
| 23:14 | seangrove | Ah, I see |
| 23:15 | devn | there's a fair amount of pain in doing this in clojure |
| 23:15 | devn | clojurescript makes it wildly simple though |
| 23:15 | seangrove | Oh, I didn't know that it wasn't a protocol in clojure |
| 23:15 | devn | *nod* |
| 23:15 | devn | seangrove: https://gist.github.com/alandipert/2346460 |
| 23:15 | seangrove | devn: Well, that makes sense then |
| 23:16 | seangrove | I believe that's pretty well discouraged though, isn't it - extending protocols to native js types? |
| 23:19 | abp | seangrove: I'd say (without much experience in cljs) as discouraged as extending protocols to any type. Why not? |
| 23:19 | gdev | is anyone making games with clojure or have we all just decided to make webapp games with clojurescript instead? asking for a friend |
| 23:22 | seangrove | abp: Sorry, just for libraries and the core language itself: https://groups.google.com/d/msg/clojurescript/vtBqlc6OfRI/fGvJCHPvgv0J |
| 23:23 | devn | seangrove: meh. i don't care if it's discouraged. |
| 23:23 | devn | it's fucking awesome. |
| 23:23 | bbloom_ | devn: please don't do that |
| 23:24 | bbloom_ | :-P |
| 23:24 | abp | seangrove: Oh yeah forgot about that rule. Applies to Clojure as well. |
| 23:24 | devn | gah "that rule" |
| 23:24 | devn | this community needs to lighten up a bit and let people program how they want to program |
| 23:24 | bbloom_ | this the the whole type classes are unacceptable modules, but modules are unacceptable type classes problem |
| 23:25 | abp | devn: Incompatible libraries ain't fun. |
| 23:25 | devn | abp: so don't use them |
| 23:26 | devn | abp: i just find it all to be in the spirit of squashing creativity before it starts |
| 23:26 | bbloom_ | https://www.evernote.com/shard/s57/sh/14479b49-11a1-444b-ba23-a42dfd21e0f8/560fb8a4deb7828b7488fb1f7d1b47ba |
| 23:27 | SegFaultAX | devn: 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:27 | abp | devn: Also I've put it as "that rule" is mostly because I'm tired. |
| 23:28 | devn | SegFaultAX: 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:28 | bbloom_ | devn: there's a reason ruby has one and only one successful "active support" type project |
| 23:29 | bbloom_ | devn: b/c you can't have two active-support-like things monkey patching every class everywhere |
| 23:29 | SegFaultAX | devn: 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:29 | bbloom_ | it just doesn't work |
| 23:29 | devn | macros 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:29 | SegFaultAX | goto 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:30 | abp | huh |
| 23:30 | bbloom_ | seangrove: i'm not sure whether i should be offended or ashamed |
| 23:30 | SegFaultAX | bbloom_: A bit of both? |
| 23:30 | SegFaultAX | :) |
| 23:30 | bbloom_ | heh |
| 23:30 | SegFaultAX | seangrove: Sick burn. |
| 23:30 | bbloom_ | this is a problem i've spent a bunch of time thinking about |
| 23:31 | Raynes | bbloom_: Man. bitemyapp ain't that bad. |
| 23:31 | Raynes | He's a little aggressive sometimes, but dude's got a heart of gold. |
| 23:31 | nonuby | just 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:31 | bbloom_ | Raynes: bitemyapp has been exceptionally well behaved recently. forgive my joke |
| 23:31 | seangrove | Raynes bbloom_: Just meant because of the the type classes, modules, and haskell references |
| 23:31 | SegFaultAX | As someone who has hung out with Chris a lot IRL, I can attest to what Raynes is saying. |
| 23:32 | devn | SegFaultAX: 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:32 | devn | ... language. This isn't something we should prescribe. It's something people learn on their own. |
| 23:33 | seangrove | devn: It's cultural momentum, and it's not entirely bad. Habits that have hurt others accumulate and are more heavily communicated. |
| 23:33 | bbloom_ | 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:33 | SegFaultAX | devn: 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:33 | devn | "You can't tell someone their favorite band." |
| 23:33 | seangrove | Doesn'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:33 | SegFaultAX | But if you come here asking for help, shouldn't we be promoting only the best ideas? |
| 23:34 | seangrove | bbloom_: Why are all these arrows here? |
| 23:34 | devn | SegFaultAX: i think good educators don't /tell/ |
| 23:34 | bbloom_ | 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:34 | SegFaultAX | bbloom_: Sure. |
| 23:34 | seangrove | And what does "pi not lambda" mean in this case? |
| 23:34 | devn | If you've ever read Polya's book How to Solve It, there are things a good teacher can do |
| 23:34 | bbloom_ | seangrove: lol sorry. previous slide showed the axis. X = increasing power, Y = increasing difficulty/complexity |
| 23:35 | devn | the absolute last one on the list is to say "here's exactly how to do it" |
| 23:35 | technomancy | <3 socratic dialog |
| 23:36 | bbloom_ | seangrove: i'm not sure about the pi not lambda comment |
| 23:36 | bbloom_ | i assume it's a type theory thing |
| 23:36 | seangrove | bbloom_: Sounds like some cool wisdom, but not sure what pi means, heh. |
| 23:37 | bbloom_ | seangrove: best guess: http://en.wikipedia.org/wiki/%CE%A0-calculus |
| 23:38 | seangrove | bbloom_: Wow, very interesting, thank you for the link. |
| 23:38 | bbloom_ | seangrove: in theory, you could think about type classes, protocol impls, etc as being process-local |
| 23:39 | bbloom_ | 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:39 | bbloom_ | maybe the ruby "refinements" idea is worth studying |
| 23:39 | bbloom_ | http://www.rubyinside.com/ruby-refinements-an-overview-of-a-new-proposed-ruby-feature-3978.html |
| 23:39 | seangrove | I 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:40 | bbloom_ | seangrove: the issue (assert (some owns? [protocol type])) |
| 23:42 | seangrove | bbloom_: As in two protocols I've brought into my namespace extend the same type in contradictory ways? |
| 23:42 | devn | bbloom_: owns? |
| 23:43 | bbloom_ | owns in the sense of the political party which dictates the semantics of |
| 23:44 | bbloom_ | somebody might check satisfies? and branch on that, or somebody else might expect the java.lang.Object or :default behavior to occur |
| 23:44 | nonuby | https://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:44 | seangrove | bbloom_: 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:44 | bbloom_ | seangrove: namespaces don't affect protocols at all |
| 23:45 | seangrove | bbloom_: It seems like they could, though there might be some performance overhead... |
| 23:45 | bbloom_ | seangrove: are you familiar with ML modules/functors? |
| 23:45 | seangrove | And thinking about it, it would probably rely on a stronger sense of types |
| 23:45 | seangrove | bbloom_: Nope |
| 23:46 | bbloom_ | seangrove: it would be enlightening to study them |
| 23:46 | bbloom_ | there's no really good reference that i know of for them tho |
| 23:46 | bbloom_ | also worth studying: racket's units |
| 23:46 | bbloom_ | http://docs.racket-lang.org/reference/mzlib_unit.html |
| 23:46 | seangrove | I'll google and spend a few minutes reading, see if it's graspable |
| 23:46 | bbloom_ | http://docs.racket-lang.org/guide/units.html |
| 23:47 | bbloom_ | 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:48 | bbloom_ | the trickier bit is what to do about PARTIAL definitions, which is what protocols/type-classes are |
| 23:48 | bbloom_ | or predicate dispatch too |
| 23:48 | bbloom_ | it's a tough bag of problems |
| 23:49 | seangrove | Glad that people far, far smarter than me are working on it |
| 23:50 | seangrove | Functors sound pretty interesting though, "lifters" |
| 23:55 | bbloom_ | 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:56 | bbloom_ | 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:56 | seangrove | What is this? |
| 23:57 | decaf | adbot |
| 23:57 | bbloom_ | decaf: i try to keep my shameless self promotion to a minimum while maximizing positive vibes for planet earth |
| 23:58 | decaf | do what you want somewhere else |
| 23:58 | bbloom_ | seangrove: massive learn-to-code campaign w/ a super cool beginner tutorial i've been helping out with |
| 23:59 | bbloom_ | google blockly, angry birds, plants vs zombies, mark zuckerberg, bill gates etc teach programming to kids ages 8 and up |
| 23:59 | bbloom_ | monday is the big launch, but you can try it now :-) |
| 23:59 | seangrove | bbloom_: 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? |