2014-01-08
| 00:00 | CaptainLex | The other way around, if I read you correctly |
| 00:00 | CaptainLex | Lisp is powerful because the macro system exists even at the REPL |
| 00:00 | andrew__ | oh, i gotcha now |
| 00:00 | danneu | it would be more Clojuresque to represent find-user-by-uid/find-topic-by-uid/find-forum-by-uid as (find-by :user/uid 42), right? |
| 00:00 | danneu | i'm just looking at my db namespace and questioning my life |
| 00:00 | CaptainLex | danneu: Sounds right, but goodness I know nothing about dispatch |
| 00:00 | andrew__ | CaptainLex got it, it wasn't detailed in that way in the book, hence the apparent and obvious inconsistentcy |
| 00:01 | danneu | CaptainLex: if it's good enough for you, it's good enough for me capn |
| 00:01 | CaptainLex | andrew_ Glad I could help! |
| 00:01 | andrew__ | I am also glad that you could help! |
| 00:05 | CaptainLex | Well, good night chaps. That it's for me tonight :P |
| 00:34 | abaranosky | bbloom: Transduce is a neat little library I saw when looking that the Fipp source code. It is nice becuase the implementation is so simple. Still trying to think of places I could use this kind of approach. |
| 00:41 | sm0ke | should a protocol be extended with defrecord of deftype? |
| 00:43 | sm0ke | or* |
| 00:47 | andrew__ | marco |
| 00:48 | abaranosky | sm0ke, depends :) |
| 00:48 | abaranosky | if you want map-like behavior then defrecord, else deftype |
| 00:48 | abaranosky | I mostly use deftype |
| 00:50 | mysamdog | polo? |
| 01:03 | bbloom | abaranosky: i don't use transduce itself that often, but i use those sorts of techniques ALL THE TIME |
| 01:04 | andrew__ | from the REPL how can I see my version of Java? |
| 01:04 | bbloom | andrew__: look up the System class' getProperty method |
| 01:04 | bbloom | andrew__: use (System/getProperty ...) |
| 01:08 | andrew__ | Hm it reports an incomprehensible number that I cannot find any meaning for user> (System/getProperty "java.vm.version") "20.65-b04-462" |
| 01:08 | bbloom | andrew__: you can also figure it out with java -version |
| 01:08 | bbloom | but if you need the marketing version number at runtime... there should be a way to get that |
| 01:09 | amalloy | java.version, right? |
| 01:09 | bbloom | andrew__: oh, you asked for java.vm.version |
| 01:09 | bbloom | it's just java.version |
| 01:09 | andrew__ | ok i got this: java version "1.6.0_65" surely I am not running Java 1.xxx !! |
| 01:10 | amalloy | there is no java 2.xxx |
| 01:10 | bbloom | andrew__: that's java 6 |
| 01:10 | bbloom | it's technically 1.6 |
| 01:10 | andrew__ | ah, ok |
| 01:10 | bbloom | 2.0 would be backwards incompatible, but that never happened / probably never will :-P |
| 01:10 | andrew__ | never say never |
| 01:11 | andrew__ | just look at Python 3 |
| 01:11 | bbloom | andrew__: and look how well that's turned out |
| 01:11 | bbloom | lol |
| 01:11 | andrew__ | exactly, but an ugly monster is still a real monster |
| 01:11 | bbloom | i've said this before, and i'll say it again: they should have just made three times as many breaking changes and called it Boa or something else snake related & it would have done great :-) |
| 01:12 | andrew__ | ah that would have been cool for sure |
| 01:13 | andrew__ | I've heard that Clojure 2.0 will be called Denial |
| 01:13 | sm0ke | python is going towards clojure |
| 01:13 | sm0ke | i gues somewhere down the lane python 6.0 will be actually lisp |
| 01:13 | egghead | wut |
| 01:14 | sm0ke | :D |
| 01:14 | sm0ke | true story! |
| 01:15 | mormon | Hey, any ideas how could one wrap compure resources route, so that I could do some precech kon the args it gets like "path" and etc. The idea is to append something to some paths it gets |
| 01:15 | Jarda | does someone know a library that wraps ZipOutputStream |
| 01:16 | Raynes | Jarda: There is a bit of stuff in https://github.com/Raynes/fs. May not do exactly what you want, but it might serve as a useful example. |
| 01:16 | bitemyapp | Jarda: reading *and* writing code is the Royal path to getting good. |
| 01:18 | andrew__ | if you use Lein to install Clojure itself, will lein keep Clojure up to date? |
| 01:18 | egghead | ya andrew__ |
| 01:18 | andrew__ | so everytime you start a repl with lein, it will make sure you have the most recent version of Clojure? |
| 01:19 | bbloom | andrew__: no |
| 01:19 | sm0ke | not true |
| 01:19 | bbloom | andrew__: clojure itself is just a jar. it's specified as a dependency in your project.clj file |
| 01:19 | Jarda | Raynes: seems like it does just what need |
| 01:20 | sm0ke | bbloom: well you could have lein launch without a project too? |
| 01:20 | andrew__ | ok, so when Clojure is updated to fix bugs or whatever, it gets a new version number, and I change the version number in the project.clj and then Lein makes sure I have the latest? |
| 01:20 | bbloom | sm0ke: that'll use whatever version of clojure lein was installed against based on the lein version |
| 01:20 | amalloy | andrew__: that's about the shape of it, yeah |
| 01:20 | andrew__ | i like shapes, amalloy |
| 01:24 | andrew__ | so there is probably not much reason then to clone the clojure core repository as is suggested in a book i'm reading |
| 01:24 | andrew__ | if lein can just update it for you |
| 01:25 | sm0ke | hey guys did you know scala just had a sicp about macros |
| 01:25 | sm0ke | sicp is scala improivement process or some shit like that |
| 01:25 | sm0ke | i wonder how thats even possible |
| 01:26 | amalloy | andrew__: cloning the source is useful for looking things up, but i wouldn't recommend actually building the source |
| 01:27 | seangrove | sicp? |
| 01:27 | clojurebot | sicp is http://web.mit.edu/alexmv/6.001/sicp.pdf |
| 01:27 | andrew__ | good to know mr. amalloy |
| 01:27 | seangrove | They had a book about macros for Scala? |
| 01:28 | sm0ke | http://docs.scala-lang.org/overviews/macros/overview.html |
| 01:28 | sm0ke | ugly stuff! user discresion is advised |
| 01:29 | andyf_ | seangrove: I think sm0ke meant to say SIP (Scala Improvement Process), not SICP |
| 01:29 | abaranosky | bbloom: I've got to expand my repertoir to see good opportunities to use state monad-like solutions |
| 01:29 | seangrove | andyf_: Ahhh, ok. I was scanning through looking for a reference to sicp |
| 01:29 | andyf_ | http://docs.scala-lang.org/sips/ |
| 01:29 | sm0ke | oh sorry, yeah sip* |
| 01:29 | sm0ke | do we have cip too? |
| 01:30 | sm0ke | lol |
| 01:30 | seangrove | JIRA? |
| 01:30 | sm0ke | hah |
| 01:30 | sm0ke | funny |
| 01:30 | seangrove | Drinks with Rich & co? |
| 01:30 | andyf_ | sm0ke: We have JIRA tickets, some of which are enhancement requests, and there are design pages with ideas for possible enhancements. |
| 01:30 | bbloom | abaranosky: tinkering with factor really helped me understand where that sort of thing makes the most sense |
| 01:30 | sm0ke | yea i get it, you know how scala has a bit of added complexity to everything |
| 01:32 | bbloom | abaranosky: i now think in terms of alternating operational and denotational solutions. i write functions that transform trees in to other trees, then i flatten those trees in to sequences of op code-like things and reduce over them. i do shit like that all the time now |
| 01:32 | bbloom | abaranosky: like this patch i made for cljs: https://github.com/clojure/clojurescript/commit/9feed772a6db1d2697de387f14c05e7e99c9d891 |
| 01:33 | bbloom | abaranosky: realized that it was a regular grammar i was parsing, so i made a state machine :-) |
| 01:33 | amalloy | oh hey, i was reading that code recently, bbloom |
| 01:33 | amalloy | i don't remember why, though |
| 01:33 | abaranosky | bbloom: so cases where you want to make decisions using some past state you've built up |
| 01:34 | bbloom | amalloy: the try parser, or the fipp / transduce code? |
| 01:34 | amalloy | try |
| 01:35 | ddellacosta | does HMap not exist currently in core.typed? |
| 01:36 | bbloom | abaranosky: "past" is constraining thinking. more like "context" of any kind, which may include past |
| 01:41 | ddellacosta | never mind...figured it out |
| 01:43 | seangrove | list-style-type: hangul, or list-styl-stype: cjk-heavenly-stem? |
| 01:43 | seangrove | I can't believe how much stuff the browser vendors have had to build in, it's amazing |
| 01:51 | bitemyapp | ddellacosta: why boggle? |
| 01:51 | ddellacosta | bitemyapp: oh, just think it's freaking cool |
| 01:57 | numberten | is there a go-to introduction to clojure book? or at least a highly recommended one? |
| 01:57 | ddellacosta | numberten: many folks feel like Clojure Programming is good for beginners: http://www.clojurebook.com |
| 01:57 | numberten | specifically for someone with fp experience but that doesn't know any lisp dialects |
| 01:57 | numberten | ddellacosta: thanks |
| 01:58 | bitemyapp | numberten: that'd be clojurebook.com, yes. |
| 01:59 | numberten | alright i'll take a look, thanks |
| 02:01 | akhudek | numberten: Joy of Clojure might be better if you already have fp experience |
| 02:03 | sm0ke | are clojure datatypes by default serializable? |
| 02:03 | koreth__ | I'm reading Clojure Programming right now and I don't find it's spending too much time rehashing basic FP concepts, though there's a bit of that. I like it in general but it has an annoying tendency to use functions in examples and not tell you what they do, so keep a web browser handy to browse the documentation. |
| 02:04 | koreth__ | But that problem only happens occasionally and it's generally one of the better intro language books I've read. |
| 02:04 | akhudek | sm0ke: yes |
| 02:05 | bitemyapp | akhudek: not knowing any Lisp? dodgy. |
| 02:05 | bitemyapp | numberten: what FP language did you use that wasn't a Lisp? |
| 02:05 | numberten | haskell |
| 02:05 | sm0ke | akhudek: also are records and types? |
| 02:06 | sm0ke | whoa! |
| 02:06 | akhudek | sm0ke: records yes, types no, I think |
| 02:06 | bitemyapp | numberten: how much Haskell? Were you spitting monad stacks like bullets or are you still calling >>= "fishtail"? |
| 02:06 | sm0ke | akhudek: taking your words on that |
| 02:06 | sm0ke | thanks |
| 02:07 | numberten | bitemyapp: not sure where i would fall on your scale |
| 02:07 | numberten | I don't call bind fishtail, and i'm comfortable with monads |
| 02:07 | bitemyapp | numberten: then it's fifty-fifty on clojurebook.com vs. Joy of Clojure, clojure programming will cover more of the stdlib if that's something you care about. |
| 02:07 | sm0ke | bitemyapp: dude do you always have you head so deep up your ass? |
| 02:07 | numberten | though I'm no crazy haskell type-hacker |
| 02:07 | bitemyapp | numberten: but Joy of Clojure is more compact. |
| 02:07 | bitemyapp | numberten: so I think it may come down to how verbose you like your books. |
| 02:07 | bitemyapp | JoC might hit nirvana for you faster. |
| 02:08 | bitemyapp | clojurebook can bore certain kinds of people if they already know Lisp, FP, or both. |
| 02:08 | numberten | i'll take a look at both |
| 02:08 | bitemyapp | sm0ke: acquire an ambien suppository. There's no malice here except from you. |
| 02:08 | bitemyapp | akhudek: solid guess on your part. |
| 02:12 | amalloy | if you have to tell someone to "acquire an ambien suppository" as part of an allegation that you're not being unpleasant, it's unlikely to be correct |
| 02:13 | sm0ke | ,(instance? java.io.Serializable [1 2 3 4]) |
| 02:13 | clojurebot | true |
| 02:14 | sm0ke | ,(instance? java.io.Serializable (seq [1 2 3])) |
| 02:14 | clojurebot | true |
| 02:14 | akhudek | sm0ke: if you want to serialize clojure, it's probably best to do pr-str |
| 02:14 | sm0ke | i guess seq results in a record |
| 02:14 | akhudek | sm0ke: not sure if everything implements java.io.Serializable, but who knows |
| 02:15 | akhudek | sm0ke: usually I use nippy to serialize stuff |
| 02:15 | abaranosky | akhudek: Kryo's faaaaaaast. It all depends on what you need |
| 02:16 | sm0ke | akhudek: well i have slightly different circustance |
| 02:17 | sm0ke | akhudek: i am writing a library which can be used in objects which in turn demand to be serializable |
| 02:17 | akhudek | ah, I see |
| 02:17 | sm0ke | although thing can be marked transient , but would break the usage |
| 03:11 | rurumate | ,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t") |
| 03:11 | clojurebot | ["a" "b"] |
| 03:12 | rurumate | ,(+ 5 22) |
| 03:12 | clojurebot | 27 |
| 03:12 | rurumate | huh |
| 03:12 | rurumate | how to evaluate stuff again |
| 03:13 | ddellacosta | in humor, timing is everything |
| 03:14 | rurumate | and, how to make clojure.string/split return the correct number of tokens? the example above should return ["a" "b" "" ""] but returns ] |
| 03:14 | rurumate | *returns ["a" "b"] |
| 03:16 | andyf_ | rurumate: Try adding a negative 'limit' arg to split. See example mentioning word 'negative' here: http://clojuredocs.org/clojure_core/clojure.string/split |
| 03:16 | andyf_ | ,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t" -1) |
| 03:16 | clojurebot | ["a" "b" "" ""] |
| 03:16 | ddellacosta | rurumate: there is nothing to split after "b" |
| 03:17 | andyf_ | rurumate: You barely missed my example. I'll send it once more. |
| 03:17 | andyf_ | ,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t" -1) |
| 03:17 | clojurebot | ["a" "b" "" ""] |
| 03:20 | rurumate | andyf_: woah black magic |
| 03:20 | rurumate | ,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t" -1) |
| 03:20 | clojurebot | ["a" "b" "" ""] |
| 03:20 | andyf_ | Not really, just a careful reading of the Java docs for the underlying Java split function |
| 03:20 | rurumate | it should be documented in http://clojuredocs.org/clojure_core/1.2.0/clojure.string/split too |
| 03:21 | andyf_ | I don't think the 1.2.0-specific versions on ClojureDocs should be high on anyone's list of worries. |
| 03:22 | andyf_ | rurumate: But wait, it is documented at that link, too. |
| 03:22 | rurumate | andyf_: I meant in string.clj |
| 03:23 | rurumate | is it? |
| 03:23 | andyf_ | In the doc string for clojure.string/split? |
| 03:23 | rurumate | oh yes negative limit |
| 03:24 | rurumate | I think yes, the doc string should mention the -1 case |
| 03:24 | andyf_ | One can wish for it to be in the official doc strings all you want, but that is unlikely to happen. Fortunately you can change the doc strings yourself, if you want. |
| 03:25 | rurumate | andyf_: in my own fork, yes |
| 03:25 | rurumate | is clojure accepting pull requests? |
| 03:25 | andyf_ | Or even without changing the Clojure source code at all, by changing the metadata of #'clojure.string/split |
| 03:25 | rurumate | heh |
| 03:26 | andyf_ | rurumate: Clojure does not accept pull requests, it uses JIRA tickets. And it is highly unlikely that a change in the doc string as you suggest would be accepted. I'm not saying I wouldn't like it, but I've been watching what goes into Clojure for a couple of years, and detailed voluminous doc strings are not wanted. |
| 03:27 | andyf_ | Here is one way to edit your own doc strings: https://github.com/jafingerhut/thalia |
| 03:52 | mindbender1 | dnolen: Hi! What's the status of http://swannodette.github.io/2013/03/25/stlc-redux---part-ii/ . Is there a place where there is ongoing discussions? |
| 04:31 | derek_c | How do you update lein? |
| 04:32 | frankgerhardt__ | Hi, I have a question. I cloned a project from github. Now I want to use it in Counterclockwise. How can I generate the required Eclipse files, especially the .project with lein? |
| 04:41 | frankgerhardt__ | so, I found "lein eclipse". Lein says eclipse is not a task. I added a :dev-dependency. What am I doing wrong? |
| 04:44 | katox | derek_c: lein upgrade |
| 04:52 | supersym | frankgerhardt__: did you install the plugin, add: :plugins [[lein2-eclipse "2.0.0"]] |
| 04:52 | supersym | to the project or profiles.clj file and you should be able to run the task |
| 04:57 | si14_ | argh. I think I've hit the wall with records. Is it such a bad idea to use records to represent "objects" in my system? |
| 04:58 | si14_ | oops. sorry for that. |
| 04:59 | ohcibi | hi i'm just folowing this tutorial: https://coderwall.com/p/4yjy1a I dont understand why he (defonce force-toolkit-init....) I understand that it somehow leaked the (.show) function into the namespace but I dont understand how... can someone explain that to me? |
| 05:05 | si14_ | I've represented "objects" with records. There were some strange "class not found" exceptions, but then I've added AOT of that namespace and everything worked fine… until I've investigated why "c.t.n.repl/refresh" is broken. It turns out that it will not work with AOT, and this is a problem. |
| 05:06 | si14_ | so now I'm facing a choice: either I should rewrite quite a lot of code to use plain maps, or somehow avoid AOT of that namespace with records (and I've forgot to mention that it's shared between CLJ and CLJS, therefore CLJX). |
| 05:09 | si14_ | I'm also using protocols to dispatch particular handlers on WS message, so they should be rewritten, too (using multimethods and :type field, I assume). |
| 05:14 | sm0ke | Hello people |
| 05:15 | sm0ke | i am writing a library, so i dont have a bootstrapping method like -main, but i want to still bootstrap some code , like spawnning a thread etc |
| 05:15 | sm0ke | and dont want it to leave up to user of library |
| 05:15 | sm0ke | how do i go about it |
| 05:16 | sm0ke | i am asking this like 5th time |
| 05:16 | sm0ke | heh would keep asking, unless someone answers :P |
| 05:17 | si14_ | sm0ke: you can use some local atom for this. check it on execution of your function. |
| 05:17 | si14_ | *functions |
| 05:18 | sm0ke | si14_: exactly what i thought |
| 05:18 | sm0ke | but then id have to put a check on every method |
| 05:18 | sm0ke | although i can put the executable form in my namespace directly..but i am not sure if thats a good idea |
| 05:20 | steerio | sm0ke: you can also use a delay |
| 05:21 | sm0ke | whats that |
| 05:21 | si14_ | sm0ke: it's fine if you do it once on loading of your code, AFAIK |
| 05:21 | sm0ke | si14_: isnt it an anti pattern? |
| 05:21 | steerio | sm0ke: try (delay (+ 1 2)) in the repl, you'll see that it's "pending" until you deref it |
| 05:21 | si14_ | sm0ke: I don't know :) |
| 05:22 | sm0ke | si14_: i mean i gets invoked during compilation right |
| 05:22 | steerio | sm0ke: it's calculated exactly once, but not until it's needed |
| 05:22 | sm0ke | si14_: thats not what youd like |
| 05:22 | si14_ | sm0ke: during loading of namespace. it's different. |
| 05:22 | si14_ | sm0ke: it's runtime. |
| 05:22 | steerio | sm0ke: what is it that has to be initialized even before someone requires your library? |
| 05:22 | steerio | sm0ke: normally a defonce would totally suffice |
| 05:22 | sm0ke | steerio: no not before that |
| 05:22 | steerio | well, then defonce |
| 05:23 | sm0ke | steerio: how is defonce different from def |
| 05:23 | steerio | will refuse to set any value if the var is already bound |
| 05:24 | steerio | you can avoid accidental reinitialization with it |
| 05:26 | steerio | not saying it's good for your use case, because we don't know that :) |
| 05:27 | sm0ke | well i dont see how defonce is useful in runtime, unless i dont hotswap forms in my production system |
| 05:27 | sm0ke | though a embedded repl or something fancy |
| 05:28 | sm0ke | and moreover in that case i *REALLY* would not like defonce |
| 05:29 | sm0ke | when i do a (def a (somefun)) |
| 05:30 | sm0ke | does somefunc gets called as soon as namespace is loaded |
| 05:30 | pyrtsa | Yes. |
| 05:30 | sm0ke | no right? |
| 05:30 | sm0ke | np it does not |
| 05:30 | sm0ke | no* |
| 05:30 | pyrtsa | Really? |
| 05:30 | sm0ke | :( |
| 05:30 | sm0ke | not sure |
| 05:30 | sm0ke | it would just define a function right? |
| 05:31 | pyrtsa | Try (def a (println "Really?")) |
| 05:31 | pyrtsa | def defines a var, and if you pass a value the value is evaluated right there. |
| 05:32 | pyrtsa | ...so as soon as `a` exists for you, its value has been evaluated as well. |
| 05:33 | sm0ke | ok |
| 05:33 | sm0ke | so to bootstrap code i can do (def dummy (boot)) |
| 05:34 | pyrtsa | I think a much better option than a hidden defonce or anything like that is to wrap the whole thing into, say, a defprotocol (an object, essentially) and make the user do the initialization. |
| 05:34 | sm0ke | or i can just put (boot), and let lein bitch about it while compiling |
| 05:34 | sm0ke | pyrtsa: does defrecord has a constructor? |
| 05:35 | pyrtsa | sm0ke: Not really but you can define a function that does the initialization and returns a record. |
| 05:35 | sm0ke | pyrtsa: well a factory methods you sugest? |
| 05:35 | sm0ke | i feel like working with java again |
| 05:35 | pyrtsa | i.e. (defrecord Something [args ...] ...) paired with (defn something [some-args ...] ... (Something. ...)) |
| 05:36 | sm0ke | ugh |
| 05:36 | steerio | in fact you can stay away from records as long as necessary and just keep using maps. their interface is pretty much the same. |
| 05:36 | steerio | that's the real fun part about them. |
| 05:36 | pyrtsa | steerio: Good point. |
| 05:37 | Jarda | when do you need a record? |
| 05:37 | pyrtsa | sm0ke: The thing is, you're already adding state to the game -- and in this case, you we're even creating global state (which is the thread). *That* is the complication. |
| 05:38 | steerio | pyrtsa: when you have to implement a protocol, i guess |
| 05:38 | steerio | ok sorry that's for Jarda |
| 05:38 | pyrtsa | State means that you're not dealing with values (unless you use something like e.g. monads to make the state behave like a value). |
| 05:38 | Jarda | steerio: yeah true |
| 05:38 | steerio | also, there might be super-performance-critical applications when the benefit of property lookup vs. map lookup counts |
| 05:39 | pyrtsa | That said, I think it's okay to (defonce worker-thread ...) if your use case is simple enough. |
| 05:39 | sm0ke | dafuq i need defonce then, i can just def |
| 05:40 | sm0ke | who is going to reload the jar in a running system |
| 05:41 | pyrtsa | Right. :) |
| 05:41 | sm0ke | pyrtsa: what? |
| 05:41 | pyrtsa | Just remember that running threads may prevent your JVM from shutting down. |
| 05:41 | steerio | sm0ke: in that jar defonce makes no difference, but during development you might send the whole stuff to the VM from the editor again, etc |
| 05:42 | sm0ke | steerio: yea for dev it makes sense |
| 05:42 | sm0ke | surealy |
| 05:42 | sm0ke | surely* |
| 05:42 | pyrtsa | sm0ke: What steerio said, i.e. defonce doesn't matter in that case. :) |
| 05:42 | sm0ke | again why didnt anyone suggest just putting (boot) in my namespace somewhere? |
| 05:43 | sm0ke | people seem to be aweful quite about it |
| 05:43 | steerio | now aweful and awful are complete opposites |
| 05:44 | pyrtsa | Now that I think of it, I think both (def x (run-some-code)) and (run-some-code) at the namespace level are pretty ugly if (run-some-code) may take a random time to complete. |
| 05:45 | sm0ke | pyrtsa: why is that? one can just put it at the bottom |
| 05:45 | sm0ke | :D |
| 05:45 | sm0ke | i hope things are evaluated in sequence |
| 05:46 | noidi | I think that, as a user of your library, I would be very surprised if just requiring the library would have side effects (such as starting new threads) |
| 05:46 | pyrtsa | Heh. I mean I think it's better to try to make namespaces load quickly and to move the performance penalty of setting things up somewhere else. |
| 05:46 | pyrtsa | noidi: Exactly. |
| 05:47 | sm0ke | umm well |
| 05:47 | sm0ke | yeaa |
| 05:47 | noidi | cemerick's austin uses a clever thing where it starts its server in a delay |
| 05:47 | noidi | https://github.com/cemerick/austin/blob/master/src/clj/cemerick/austin.clj#L42 |
| 05:47 | steerio | i mentioned delays previously |
| 05:48 | frankgerhardt__ | supersym, thank it worked |
| 05:48 | noidi | the server is started the first time the library needs it |
| 05:48 | steerio | in fact i had a similar problem with a ns that uses nlp heavily, and has to load the language models |
| 05:48 | sm0ke | so delay is like lazy var |
| 05:48 | steerio | sm0ke: lazy value. you don't need to put the delay in a var. |
| 05:48 | noidi | steerio, oh, I only skimmed the discussion :) |
| 05:49 | sm0ke | i want exact opposite |
| 05:49 | sm0ke | which is just a simple def |
| 05:49 | steerio | :) |
| 05:50 | steerio | wanna hear a really ugly idea? |
| 05:50 | sm0ke | fucking novice i am |
| 05:50 | sm0ke | yeah sure |
| 05:50 | sm0ke | things are already bad |
| 05:51 | steerio | put the resource-heavy initialization in another namespace (that's only loaded by you, not the user), and use (use 'that-ns) wherever you need the initialized stuff |
| 05:51 | steerio | ^ but more like, don't do this. |
| 05:51 | steerio | :) |
| 05:51 | steerio | what kind of initialization is this btw? setting up of connections? |
| 05:52 | sm0ke | yeah |
| 05:52 | sm0ke | well i can be made explicit |
| 05:52 | steerio | i'd definitely make that user-triggered |
| 05:52 | sm0ke | yeah but users are lazy and stupid |
| 05:52 | sm0ke | like myself |
| 05:52 | steerio | tell me one library where you don't have to trigger connection |
| 05:53 | steerio | how are credentials passed, if any? |
| 05:53 | sm0ke | well core.async has 0 boilerplate |
| 05:53 | steerio | does it connect somewhere? |
| 05:53 | steerio | if you deal with connections, you might look for examples at donno, cassaforte |
| 05:53 | sm0ke | but it does init threadpools right? |
| 05:53 | pyrtsa | steerio: It actually does create a thread pool. |
| 05:54 | pyrtsa | ...Not sure when that happens, though. |
| 05:54 | sm0ke | yea |
| 05:54 | sm0ke | core.async is awesome sauce |
| 05:54 | steerio | pyrtsa: my understanding is that sm0ke deals with connections which come with configuration, credentials, and the remote party might not even be ready at load time for some reason |
| 05:54 | steerio | pyrtsa: that's why i specifically asked this |
| 05:55 | sm0ke | steerio: ok this one time for connections |
| 05:55 | sm0ke | but i find this ocurring for non network based stuff too |
| 05:55 | steerio | get it, you also wanted to hear about how it should be done in the broader sense |
| 05:55 | pyrtsa | steerio: Yeah, definitely should be explicit initialization there. |
| 05:56 | sm0ke | nah thats how apis should be |
| 05:56 | sm0ke | defaults to implicit initialization, explicit for advance usages |
| 05:57 | sm0ke | i dont knwo wether their is initialization at all in core.async |
| 05:57 | pyrtsa | sm0ke: IMO if initialization is needed, then initialization returns a value that you use to call the API with. |
| 05:57 | steerio | https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L370 :) |
| 05:57 | sm0ke | hah |
| 05:57 | sm0ke | defonce |
| 05:58 | sm0ke | so core.async has side effect as soon as you require it!! |
| 05:58 | pyrtsa | sm0ke: Are you making a parametric connection to some server or just creating a thread pool? |
| 05:58 | steerio | it creates an objects and puts it in a var. |
| 05:59 | steerio | defining a function is the same thing, basically. |
| 05:59 | steerio | s/objects/object/ |
| 05:59 | sm0ke | pyrtsa: well there could be serivce discovery in long run |
| 06:00 | steerio | pyrtsa has the point: opening a connection is a side effect, creating instances is not. |
| 06:00 | sm0ke | so its best kept to library |
| 06:00 | sm0ke | not user |
| 06:00 | sm0ke | well i am going to put executable form right in my namespace |
| 06:00 | sm0ke | right now! |
| 06:01 | pyrtsa | steerio: It's all relative. In the end, creating *anything* has the side effect of allocating memory. Yet, creating threads does consume system resources (max number of threads), which might matter in some cases, but more often won't. |
| 06:02 | steerio | pyrtsa: side effect is a term that's used very loosely here, i think. |
| 06:03 | pyrtsa | Indeed. |
| 06:03 | steerio | pyrtsa: you can reasonably expect that loading a namespace will allocate memory, but if it starts making outside connections right away is a "side effect" |
| 06:03 | pyrtsa | Its definition depends on your use case. |
| 06:03 | pyrtsa | steerio: I definitely agree on that. |
| 06:04 | sm0ke | https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L28 |
| 06:04 | steerio | i noticed that one too |
| 06:04 | steerio | looks a bit rude to me :) |
| 06:05 | sm0ke | it basically a bootstrap code right |
| 06:06 | steerio | in fact the same commit adds this set! to a couple of other files too |
| 06:09 | noidi | I don't like that either. just because it's in a clojure/core project doesn't mean it's a polite thing to do :) |
| 06:12 | sm0ke | https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj#L16 |
| 06:12 | sm0ke | how about this for polite |
| 06:12 | steerio | noidi: I'd put it in src/user.clj (and maybe .gitignore it), so it only loads when I'm in the REPL (which was probably the intention anyway) |
| 06:13 | steerio | it has no :main in its project.clj, so it'd work |
| 06:14 | steerio | sm0ke: I love the + 42 part |
| 06:14 | steerio | that looks like some random "let's see it under stress" code left in |
| 06:15 | sm0ke | yep, definitiely can be configurable |
| 06:15 | sm0ke | with sensible default |
| 06:17 | sm0ke | so core async works with 2*no-of-processors+42 threadpool size |
| 06:18 | sm0ke | ,(-> Runtime/getRuntime .availableProcessors) |
| 06:18 | clojurebot | #<CompilerException java.lang.SecurityException: Reference To Runtime is not allowed, compiling:(NO_SOURCE_PATH:0:0)> |
| 06:19 | sm0ke | so for hyperthreaded quadcore we have ## (-> 8 (* 2) (+ 42)) ; threads |
| 06:19 | lazybot | ⇒ 58 |
| 06:19 | sm0ke | whoa! |
| 06:20 | sm0ke | and thats a fixedthreadpool |
| 06:22 | pyrtsa | sm0ke: Does it matter? |
| 06:23 | sm0ke | yeah i you have a personal grade laptop |
| 06:23 | sm0ke | for servermachines not so much |
| 06:23 | pyrtsa | 58 is much? |
| 06:24 | sm0ke | well if a thread takes 4mb you have ##(* 4 58); mbs just by requiring |
| 06:24 | lazybot | ⇒ 232 |
| 06:24 | sm0ke | thats a side effect id say |
| 06:26 | pyrtsa | I agree. |
| 06:27 | pyrtsa | On the other hand, it seems to me from the documentation that Executors/newThreadFactory creates the threads lazily: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int, java.util.concurrent.ThreadFactory) |
| 06:27 | pyrtsa | (Sorry, broken link, unless properly copied.) |
| 06:29 | clgv | pyrtsa: you can force it to create the threads http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html#prestartAllCoreThreads%28%29 |
| 06:31 | pyrtsa | clgv: The point was that this side effect shouldn't happen immediately with core.async and its 2 * N + 48 threads: "<sm0ke> well if a thread takes 4mb you have ##(* 4 58); mbs just by requiring" |
| 06:31 | lazybot | ⇒ 232 |
| 06:31 | pyrtsa | s/48/42/ |
| 06:31 | clgv | I joined after that ;) |
| 06:31 | pyrtsa | Yep. That's why I quoted. :) |
| 06:36 | clgv | pyrtsa: oh is there any rational for the magic numbers 2 and 42 in the formula for the number of threads? |
| 06:37 | pyrtsa | No there isn't. |
| 06:37 | clgv | great. |
| 06:37 | pyrtsa | 42 was mentioned in the Clojure Conj 2013 talk as a nice number. |
| 06:38 | clgv | wow, great. if douglas adams is the reason at least the magnitude should have a reason |
| 06:38 | pyrtsa | IMO there could be much fewer threads, and all blocking should be done outside core.async. (Ideally, there could be a mechanism to warn when you do block. Not sure how that could be done, though.) |
| 06:39 | pyrtsa | On the other hand, 42 threads won't be many in a few years. ;) |
| 06:39 | sm0ke | I dont really create threadpools but wheni do i multiply cores by 2 and and add 42. |
| 06:39 | clgv | well, maybe the alpha is removed from the versions string as soon as a reason for the formula pops up ;) |
| 06:39 | pyrtsa | Yeah. |
| 06:39 | pyrtsa | sm0ke: :D |
| 06:41 | clgv | I dont like magic numbers in software: either they are parameters or come frome the definition of the specific problem that is tackled. |
| 06:43 | corecode | hi |
| 06:45 | ucb | anybody here played/used Samza with clojure? |
| 06:47 | sm0ke | what is it like storm? |
| 06:50 | ucb | similar, yes |
| 06:51 | sm0ke | is it better in someways? |
| 06:52 | ucb | it guarantees ordering of messages, persistence, and a few other things |
| 06:52 | ucb | I wouldn't say better, just different |
| 06:52 | sm0ke | i see major prjects from backtype are not much maintained now |
| 06:52 | sm0ke | be it storm or cascalog |
| 06:53 | ucb | maybe they consider them mature enough. Didn't storm originate from twitter anyway? |
| 06:53 | sm0ke | hopefully there are new projects which seems to be replacing them |
| 06:53 | sm0ke | never knew about samza |
| 06:53 | sm0ke | yeah different places same guys |
| 06:54 | sm0ke | i like parkour |
| 06:54 | steerio | moving to open source... with limitations... hm |
| 06:54 | sm0ke | and pigpen seems promising too |
| 06:54 | steerio | i'll wait and see how this plays out |
| 06:54 | sm0ke | steerio: what are you talking about? |
| 06:54 | steerio | samza |
| 06:55 | sm0ke | its not limitation as in crippled versio for open source community and diamond version for enterprise users |
| 06:55 | sm0ke | its lmitation as in shit not implemented |
| 06:58 | steerio | sm0ke: it depends on non-production-ready code, that's quite some limitation. also, it doesn't state when the "some months" would end, no date to say when "now" is. |
| 06:58 | sm0ke | well yeah its a incubator project |
| 06:58 | sm0ke | but its under apache for some reasons |
| 06:59 | sm0ke | have some faith |
| 07:00 | steerio | comes from linkedin. they probably used it to spam and harass people, telling them to "claim" their automatically created profiles. |
| 07:00 | steerio | took me nearly 2 years to get them to remove mine. 1/10, never again. |
| 07:00 | sm0ke | well kafka is from linkedin too |
| 07:01 | sm0ke | seems pretty popular |
| 07:01 | steerio | not saying that makes it bad, just wanted to rant for a couple of lines :) |
| 07:01 | sm0ke | steerio: funny reason not to use a framework |
| 07:01 | steerio | i didn't cite it as a reason for that |
| 07:02 | sm0ke | they probably used it to harass people, its a sin if i write my code using that |
| 07:02 | sm0ke | hah |
| 07:02 | sm0ke | well is it? |
| 07:02 | steerio | chill out, at no point was that said |
| 07:02 | sm0ke | you surely got me thinking |
| 07:03 | sm0ke | well its true to some extend |
| 07:03 | sm0ke | oracle has completely ruined jersey for instance |
| 07:03 | sm0ke | like java |
| 07:03 | steerio | i guess it's not the devs making the business choices |
| 07:03 | sm0ke | yea its the management making the dev choice too |
| 07:03 | sm0ke | lol |
| 07:03 | steerio | :DD |
| 07:04 | sm0ke | i hope openjdk catched up sometime soon |
| 07:05 | jcromartie | it seems fine to me |
| 07:05 | sm0ke | is there any work being done i openjdk for tail recursion? |
| 07:05 | sm0ke | jcromartie: yeah well there is a lot of dev effort in openjdk |
| 07:05 | sm0ke | so its like bleeding edge |
| 07:05 | steerio | sm0ke: you mean tco? |
| 07:05 | sm0ke | steerio: yes |
| 07:06 | steerio | it's not in java specs, so they don't need to implement it at all |
| 07:06 | sm0ke | definitrly, tail recursion is already there |
| 07:06 | steerio | is it? |
| 07:06 | sm0ke | i sad it is there, not that its optimized |
| 07:06 | sm0ke | said* |
| 07:06 | sm0ke | wait |
| 07:07 | sm0ke | does tail recursion means, stack space for previous call is removed |
| 07:07 | sm0ke | it just mean recursion from a tail position |
| 07:07 | steerio | the proper term is tail call optimization |
| 07:07 | sm0ke | yes yes! |
| 07:07 | sm0ke | i agree |
| 07:08 | steerio | you don't have to be calling the same function, it can be a tail call to anything |
| 07:09 | steerio | so recursion is not necessarily implied |
| 07:09 | sm0ke | true :) |
| 07:09 | steerio | (i say function as this is not related to the jvm but in general) |
| 07:12 | logic_prog | in clojure/lein, instead of doing "lein run main", is it possibl to have one codebase that supports both (1) server and (2) client, which then allows me to do "lein run server" and "lein run client" ? |
| 07:13 | augustl | logic_prog: the problem I think is that at the end of the day you compile one jar file, that you run with java -jar |
| 07:14 | augustl | logic_prog: you could always create a "main" that reads the first item in argv and dispatches accordingly |
| 07:14 | alew | lein can run any main file in any namespace |
| 07:14 | alew | so you could have |
| 07:14 | alew | lein run -m app.client |
| 07:15 | alew | lein run -m app.server |
| 07:15 | logic_prog | alew: this is what I wanted. nice, thanks! |
| 07:15 | alew | main function* |
| 07:18 | steerio | logic_prog: wrap those in bash scripts (with the exec command so lein will actually replace your bash process), commit them too, and it becomes really user friendly |
| 07:22 | sm0ke | is it a common practice to redefine a symbol in a running program? |
| 07:22 | sm0ke | like (if fail |
| 07:22 | sm0ke | sorru |
| 07:23 | sm0ke | sorry* (if fail? (def a 1)) |
| 07:23 | sm0ke | eh |
| 07:23 | ucb | I don't think so. |
| 07:23 | sm0ke | where a is already put like (def a 0) as a top form in namespace |
| 07:24 | sm0ke | i know i can use atom, but there i no requirement of multiple threads accessing it |
| 07:24 | ucb | yeah, no. |
| 07:24 | sm0ke | ucb: yes or no? |
| 07:24 | ucb | I'd vote for no. |
| 07:24 | sm0ke | no for atom or def? |
| 07:25 | ucb | don't know about atom, definitely not for def |
| 07:25 | ucb | I don't know what you're trying to do. |
| 07:26 | clgv | sm0ke: no please dont |
| 07:26 | sm0ke | :D |
| 07:26 | clgv | atom is fine if it is really needed that way |
| 07:26 | clgv | but you might get similar problems as with singletons in OOP |
| 07:26 | sm0ke | clgv: but whats the point of atom is there is not concurrent access |
| 07:26 | sm0ke | if* |
| 07:27 | clgv | oh I answered sequential. first to redefining then to the atom approach ;) |
| 07:28 | clgv | sm0ke: I think there are not that many reasonable scenarios where a value of your application needs or should eb tied to a variable in the namespace |
| 07:28 | clgv | "changing values" |
| 07:29 | sm0ke | clgv: well i am talking about a connection pool or smething like that |
| 07:30 | sm0ke | which has to be only single value in the jvm |
| 07:31 | clgv | sm0ke: that's valid then. all sorts of globale registries as well provided they are justified |
| 07:33 | clgv | sm0ke: but you should probably implement pure functions which get the value of the atom as parameter and convenience functions that use the atom and pass its value to the former functions |
| 07:36 | sm0ke | yeah makes sense |
| 07:37 | sm0ke | using atoms is probably saner |
| 07:44 | andrew__ | i'm reading about atoms and swap! and I just don't see how this is different than a mutable programming style. it seems fundamentally that you are still changing state |
| 07:44 | CookedGryphon | andrew__: yeah, but you *know* when you're changing state |
| 07:44 | CookedGryphon | and it isn't the default, you have to go out of your way to say "this is state, things can change it" |
| 07:45 | andrew__ | in another language i also *know* I am changing state when I do myInstanceVariable=7 |
| 07:45 | sm0ke | andrew__: you want python? (def a 1) (def a 2), there you go! |
| 07:46 | amalloy | andrew__: if i hand you an object, say in java, and it has some fields in it; if you hang onto that object, will its fields change without you assigning to them? |
| 07:47 | andrew__ | amalloy of course they can, but how that different than having a def of an atom out there that you can access any time, and knowing that its contents could change as well, due to other functions you have |
| 07:47 | sm0ke | hah |
| 07:47 | amalloy | andrew__: the difference is that in clojure you have to opt into that "things can change anytime" scheme |
| 07:47 | amalloy | in java, you don't get much choice |
| 07:48 | andrew__ | by "opt in" I assume you mean by specifically defining it as an atom, as opposed to just a set or something |
| 07:48 | amalloy | mutable things in clojure have to be handled differently from the normal immutable values, and you always know when you're working with one |
| 07:50 | andrew__ | in C++ (I don't know Java but it is probably similar), fields are private by default, other objects cannot change the state of this object's field. to "opt in" i can make that field public. not sure I see a big difference there. |
| 07:51 | amalloy | uh, private is immensely different from immutable |
| 07:51 | sm0ke | andrew__: so when you change a data structure in c++ you actually cahnge the data structure, while in clojure you get a completely new data |
| 07:51 | amalloy | member functions mutate private member variables all the time |
| 07:52 | sm0ke | if i am not wrong, thats what the fundamental idea of immutability is |
| 07:52 | amalloy | if i give you a std::set<int> or whatever, it has a private member somewhere that it uses to store its data, somehow |
| 07:53 | amalloy | and indeed, i cannot mutate that member because it's private |
| 07:53 | andrew__ | ok, sure, perhaps a different analogy is marking things const in c++ though there you'd have to deliberately "opt out" of mutability, so I can see where the "encouragement towards a paradigm" comes in |
| 07:53 | sm0ke | andrew__: similar ot builder pattern if you prefer |
| 07:53 | sm0ke | to* |
| 07:53 | amalloy | but i can call set->add(5), and now the set i gave you has different members than it did |
| 07:54 | andrew__ | i guess what I'm noticing is that if your habits are strictly based on mutability, working in clojure could very easily allow you to continue those habits, with little effort, since refs and atoms are so easy |
| 07:54 | sm0ke | yeah sure |
| 07:55 | sm0ke | do whatever you want man, its a free world |
| 07:55 | andrew__ | it is often said that clojure is more functional than common lisp, but it seems to me that really both allow for whatever programming style you want, functional or not, equally easily |
| 07:56 | CookedGryphon | andrew__: a fine example of this is the java Date class |
| 07:56 | sm0ke | Clojure doesnt do mutable but when it does it makes sure you work hard. |
| 07:56 | CookedGryphon | which is actually mutable internally |
| 07:56 | sm0ke | did it sound like the meme? |
| 07:57 | andrew__ | sm0ke i see what you mean, but i'm not sure it seems like working hard to mutate a few atoms whenever you want. |
| 07:57 | CookedGryphon | so if you pass a date to two places , each of those places can modify it for the other |
| 07:57 | sm0ke | andrew__: and did you know that atoms are actually stm? |
| 07:58 | CookedGryphon | andrew__: point is, there are very few places where you actually do want to mutate state. Usually what you actually want is a value |
| 07:58 | CookedGryphon | incrementing 1 gives you a *different* value 2, it doesn't change 1 into 2 |
| 07:58 | andrew__ | so via the stm the atoms are managing concurrent access when it happens? |
| 07:59 | sm0ke | yes thats the idea |
| 07:59 | sm0ke | so its not like obj.x=3 |
| 08:00 | andrew__ | it's all very interesting, i'm deliberately playing devil's advocate just so I can understand it better |
| 08:00 | CookedGryphon | here is a far more eloquent summary than I could ever give http://www.infoq.com/presentations/Value-Values |
| 08:01 | Bronsa | sm0ke: atoms have nothing to do with stm |
| 08:02 | sm0ke | Synchronous Transport Module? |
| 08:02 | Bronsa | oh, I thought you were talking about Clojure's STM (software transactional memory) |
| 08:03 | sm0ke | hah |
| 08:03 | sm0ke | Bronsa: whyd you say that |
| 08:03 | CookedGryphon | refs are STM, atoms use compare and set |
| 08:04 | sm0ke | whats the definition of stm? |
| 08:04 | CookedGryphon | http://en.wikipedia.org/wiki/Software_transactional_memory |
| 08:04 | sm0ke | can you set alter ref deref an atom? |
| 08:04 | sm0ke | http://clojure.org/concurrent_programming |
| 08:04 | sm0ke | according to this they are |
| 08:05 | CookedGryphon | sm0ke: no they aren't, it lists the three different approaches, refs, agents and atoms |
| 08:05 | sm0ke | ok whateverman, ill bounce for now |
| 08:06 | sm0ke | you the experts |
| 08:08 | andrew__ | so atom is thread safe, but not because of STM specifically, right? |
| 08:09 | CookedGryphon | right |
| 08:09 | CookedGryphon | so an atom sets off some work on the old value |
| 08:09 | CookedGryphon | and then when it has the new value it wants to set, it does a single-instruction compare-and-set |
| 08:10 | CookedGryphon | if the value is the same as when it started, the new value is set, if it's changed, it assumes its new value isn't valid, and sets off the work again based on the value that's there now |
| 08:10 | CookedGryphon | and repeats until it succeeds |
| 08:10 | CookedGryphon | which is why you don't put anything with side effects into a swap! function, because it might happen multiple times |
| 08:15 | andrew__ | interestingly, in an Apress book, it says that the println function is a side effect in a function, yet in Stu Hollaway's book, he calls a function pure based strictly it being value-oriented, even if it has println calls in it |
| 08:15 | jcromartie | anybody here have experience building a real event sourcing type of system in Clojure? |
| 08:16 | jcromartie | I think it depends on your application |
| 08:16 | jcromartie | if stdout is important, then println is definitely a side effect |
| 08:16 | jcromartie | but if stdout is basically logging, then it doesn't matter much, does it? |
| 08:17 | corecode | a bit confusing that clojuredocs.org lists clojure.core max at 1.3.0 |
| 08:18 | jcromartie | outdated documentation is the bane of the clojure ecosystem |
| 08:20 | alew | I'm surprised no one has gotten around to updating clojuredocs |
| 08:20 | jcromartie | situation: there are 14 outdated and confusing sources for Clojure docs; "hey, I know, let's make a new unofficial Clojure doc site that encompasses everything!"; soon: there are 15 outdated and confusing sources for Clojure docs. |
| 08:23 | clgv | corecode: http://clojure-doc.org has a different approach but most of it was written post 1.4/1.5 |
| 09:13 | corecode | alew: there seems to be commit activity on the clojuredocs github repo |
| 09:15 | alew | corecode: that's encouraging. not that much as changed from 1.3 to 1.5 (almost 1.6) so it shouldn't be too much to update |
| 09:15 | corecode | that in any case |
| 09:32 | oracle1123 | for the following code, why it doens't return 30? |
| 09:32 | oracle1123 | (let [x (transient {})] |
| 09:32 | oracle1123 | (dotimes [n 30] (assoc! x n n)) |
| 09:32 | oracle1123 | (count x)) |
| 09:34 | dnolen | oracle1123: transients don't work that way you must work with them in a functional manner (side note use a paste service) |
| 09:38 | andyf_ | oracle123: http://clojuredocs.org/clojure_core/clojure.core/assoc! may be helpful in understanding |
| 09:38 | shep-werk | andyf_: good reference |
| 09:46 | oracle1123 | thx everyone, understood. the following ulr is helpful http://clojure.org/transients |
| 11:22 | sl33k1 | hi guys |
| 11:25 | sl33k1 | new to clojure, experienced java developer...currently largely on windows box |
| 11:25 | sl33k1 | looking at clojure to learn fx programming and improve thought process |
| 11:25 | gtrak | fx? |
| 11:26 | mdrogalis | FP, maybe. |
| 11:26 | gtrak | javafx? |
| 11:26 | mdrogalis | Sup, sl33k1? |
| 11:27 | gtrak | sound fx? |
| 11:27 | Sorella | f(x) |
| 11:27 | mdrogalis | Foxes, perhaps. |
| 11:27 | gtrak | overtone can be used for sound effects :-) |
| 11:27 | Sorella | What do they say? |
| 11:27 | Kallikrates | what color is that shed |
| 11:28 | mdrogalis | ~fox |
| 11:28 | clojurebot | I don't understand. |
| 11:28 | tbaldridge | clojurebot: fox is "Ring-ding-ding-ding-dingeringeding!" |
| 11:28 | clojurebot | Ik begrijp |
| 11:29 | pjstadig | no |
| 11:29 | sl33k1 | fp programming. sorry |
| 11:29 | tbaldridge | ~fox |
| 11:29 | clojurebot | fox is "Ring-ding-ding-ding-dingeringeding!" |
| 11:29 | pjstadig | remove that fact now |
| 11:29 | tbaldridge | lol |
| 11:29 | sl33k1 | in maths i think fx = functional |
| 11:29 | mdrogalis | tbaldridge: I'll enjoy eval'ing that 6 months from now. |
| 11:30 | mdrogalis | tbaldridge: Why exactly is thread preferred over future? |
| 11:30 | tbaldridge | mdrogalis: future returns a promise, thread returns a channel. |
| 11:31 | mdrogalis | Ahh, right. |
| 11:31 | mdrogalis | Yeah, I need to be able to do something akin to future-cancel. |
| 11:31 | tbaldridge | mdrogalis: that's a bit tricky |
| 11:31 | mdrogalis | I never use the result of (thread ...) so I guess it doesn't matter much. |
| 11:31 | mdrogalis | tbaldridge: Oh? |
| 11:31 | tbaldridge | you could use future, and then cancel it |
| 11:32 | sl33k1 | well anyone able to setup an okay environment? |
| 11:32 | tbaldridge | but I'm not sure what would happen if you cancel a future while it's waiting on a channel |
| 11:32 | sl33k1 | on windows |
| 11:32 | gtrak | sl33k1: I used to use it on windows, getting the emacs stuff working is a little tedious, maybe it's easier to use something like light table? |
| 11:32 | mdrogalis | tbaldridge: InterruptedException |
| 11:32 | gtrak | now I'm full-time linux. |
| 11:32 | mdrogalis | Which is a fine result. |
| 11:32 | tbaldridge | sl33k1: I learned with netbeans and intelij on windows, I'd be tempted to try out Cursive |
| 11:33 | tbaldridge | sl33k1: http://cursiveclojure.com/ |
| 11:33 | sl33k1 | tbaldridge: i have paid IntelliJ copy |
| 11:33 | gtrak | we have devs at work that run it in a linux VM |
| 11:33 | mdrogalis | I'm looking at a constructor with 37 parameters. Ahhhhh >_> |
| 11:33 | tbaldridge | sl33k1: I'm not a fan of LightTable, but you may like it more than I did. |
| 11:33 | sl33k1 | tbaldridge: once i grasp language, i do lot of web apps, and seeing it with clojure would make lot of sense |
| 11:34 | tbaldridge | sl33k1: Cursive is a Intelij plugin for Clojure, I've heard good things about it and like it. However, I use emacs, so I have a hard time switching to a different IDE. If I had to switch however, it'd be to Cursive. |
| 11:36 | sl33k1 | any of you guys built or can show stuff end user can relate to, front end stuff with clojure eventually? |
| 11:36 | sl33k1 | e.g web apps or desktop apps. mobile is cool too |
| 11:36 | gtrak | sl33k1: clojurescript is fast making headway. |
| 11:36 | gtrak | that's clojure->js |
| 11:36 | Kallikrates | you can do anything you can do with javascript with clojurescript |
| 11:37 | gfredericks | sl33k1: http://gfredericks.com/sandbox/qc |
| 11:37 | gtrak | gfredericks: I remember this from portland :-). |
| 11:37 | sl33k1 | like web frameworks |
| 11:37 | sl33k1 | found webnoir |
| 11:38 | sl33k1 | http://www.webnoir.org/ |
| 11:38 | Kallikrates | http://pedestal.io/ might be worth a look |
| 11:38 | gtrak | sl33k1: noir's been superceded imo, try luminous, pedestal |
| 11:38 | mdrogalis | Noir's kinda dead |
| 11:38 | gtrak | luminus* |
| 11:39 | gtrak | seems like some people like 'caribou', I haven't used it. |
| 11:39 | gtrak | http://let-caribou.in/ |
| 11:39 | gfredericks | gtrak: gonna come to SF? |
| 11:40 | gtrak | I don't know if I can make it out there, but I'll try for conj and one other this year, maybe strange-loop. |
| 11:40 | gtrak | I'm sad I missed that |
| 11:40 | teslanick | gtrak: That's a call to action if I've ever seen it. But I don't want a caribou anywhere that might be labelled "in" |
| 11:40 | gtrak | teslanick: damn antlers |
| 11:41 | sl33k1 | so i just need to install Cursive in my IntelliJ and get going then. early last year, i tried clojure and installed the repl environment. not sure if i would need that now |
| 11:41 | gtrak | sl33k1: you'll probably need to install leiningen |
| 11:41 | sl33k1 | i'm just telling myself this year first quarter, the ellipsis cannot stop me! |
| 11:41 | gtrak | http://leiningen.org/ |
| 11:41 | sl33k1 | In java, i install jdk and then i have java |
| 11:41 | sl33k1 | is leinxxxx like the jdk? |
| 11:42 | gtrak | you don't install clojure, leiningen is like maven. |
| 11:42 | gtrak | and it's the standard project/package-manager/build-tool |
| 11:42 | gtrak | so it downloads clojure to run itself, but then it'll depend on your project. |
| 11:42 | sl33k1 | you never install clojure? it uses the jvm then i suppose? and leiningen is like the comple tool |
| 11:43 | clojurebot | Alles klar |
| 11:43 | sl33k1 | compile* |
| 11:43 | teslanick | lein pulls in the clojure compiler, which makes clojure into something that runs on the JVM. |
| 11:43 | TimMc | sl33k1: Clojure is actually a library. |
| 11:43 | teslanick | Or something like that |
| 11:43 | gtrak | yes, that's right. clojure's a jar file. |
| 11:44 | sl33k1 | and a language. |
| 11:44 | sl33k1 | what happens to repl? |
| 11:44 | gtrak | there is a repl implemented as a main class inside the clojure jar, there are other repls, lein ships with one of those. |
| 11:45 | gtrak | 'lein repl' will give it to you, inside a project, it'll give it to you with the project's environment. |
| 11:45 | sl33k1 | gtrak: i am downloading this: https://bitbucket.org/djpowell/leiningen-win-installer/downloads/leiningen-installer-beta1.exe |
| 11:46 | gtrak | not sure if the installer does anything special, in the end, lein is a batch file that downloads/updates/runs the lein jars. |
| 11:48 | sl33k1 | gtrak: lol. smooth trick |
| 11:49 | gtrak | if cursive somehow avoids requiring you to have leiningen, it'll be because it embeds leiningen. I'm not sure if that's the case, anyway can't hurt to have it :-). |
| 11:50 | gtrak | looks like it has its own deps/project model that it keeps in sync with leiningens. |
| 11:50 | gtrak | reminds me of the m2eclipse plugin.. badly. |
| 11:52 | sl33k | m2eclipse is main reason i switched from eclipse |
| 11:52 | sl33k | netbeans makes it so easy...paid for intelliJ but havent actually gotten it yet |
| 11:52 | gtrak | I remember it being a can of worms. |
| 11:52 | gtrak | I had workarounds that I didn't know why they worked. |
| 11:53 | sl33k | gtrak: http://cursiveclojure.com/ isnt free |
| 11:54 | egghead | isn't free how? |
| 11:54 | sl33k | " It will be a commercial product, at a similar price point to PyCharm or RubyMine." |
| 11:54 | egghead | certainly is free to install and use |
| 11:54 | gtrak | sl33k: free for now, I guess :-). tasty lockin. |
| 11:55 | egghead | lol |
| 11:55 | gtrak | but emacs will certainly frustrate you for at least a few days. |
| 11:55 | egghead | cursive clojure was good but I don't think I'd pay for it... |
| 11:56 | gtrak | on a related note, light table just went open-source today |
| 11:56 | sl33k | egghead: you use cursive? i am here: http://cursiveclojure.com/ and i dont know what to do next. no download plug-in link. |
| 11:56 | teslanick | http://cursiveclojure.com/userguide/ |
| 11:57 | egghead | sl33k: basically just add the plugin source and install through the intellij ui |
| 12:01 | sl33k | egghead: seen. :) |
| 12:03 | gfredericks | ,:/ |
| 12:03 | clojurebot | :/ |
| 12:03 | gfredericks | &:/ |
| 12:03 | lazybot | java.lang.RuntimeException: Invalid token: :/ |
| 12:03 | gfredericks | ,*clojure-version* |
| 12:03 | clojurebot | {:interim true, :major 1, :minor 6, :incremental 0, :qualifier "master"} |
| 12:03 | gfredericks | I must need 1.6 |
| 12:05 | Bronsa | ,:| |
| 12:05 | clojurebot | :| |
| 12:13 | dnolen | ibdknox: congrats on the Light Tables release! |
| 12:13 | steerio | so what does clojurebut do if i type ,(range)? |
| 12:13 | steerio | s/but/bot/ |
| 12:13 | justin_smith | ,(range) |
| 12:14 | clojurebot | (0 1 2 3 4 ...) |
| 12:14 | dnolen | ibdknox: exciting times will be cool to see where people take it. |
| 12:14 | justin_smith | steerio: it has a print limit, so it does not eagerly consume the range |
| 12:14 | justin_smith | &(range) |
| 12:14 | lazybot | java.lang.OutOfMemoryError: Java heap space |
| 12:14 | justin_smith | as opposed to lazybot |
| 12:14 | justin_smith | somewhat ironically given the names |
| 12:15 | llasram | heh |
| 12:15 | steerio | justin_smith: :) |
| 12:15 | lsdafjklsd | dnolen: you will be surprised to hear that I still can't get that simple example working >.< |
| 12:15 | lsdafjklsd | dnolen: after a few hours of trying haha |
| 12:15 | dnolen | lsdafjklsd: what example? |
| 12:16 | lsdafjklsd | dnolen: remember the example I sent to you, with the "i'm the active project" |
| 12:16 | lsdafjklsd | dnolen: in the list of projects |
| 12:16 | dnolen | lsdafjklsd: oh the active thing |
| 12:16 | lsdafjklsd | dnolen: dude I'm losing my mind, can you help me |
| 12:16 | dnolen | lsdafjklsd: did you try the simplest approach first? i.e. callbacks? |
| 12:17 | dnolen | lsdafjklsd: don't have time to at the moment, pass a callback from parent to child via :opts |
| 12:17 | lsdafjklsd | dnolen: ok |
| 12:17 | dnolen | lsdafjklsd: the callback when triggered will should set the active state in the parent, and invoke the child callback if needed |
| 12:17 | dnolen | lsdafjklsd: I don't like this pattern but it's easy to understand |
| 12:18 | dnolen | lsdafjklsd: core.async is it's own learning hump |
| 12:18 | lsdafjklsd | dnolen: right on, currently i'm implementing like the todos example |
| 12:18 | lsdafjklsd | dnolen: i'll give the callback method a go |
| 12:18 | dnolen | lsdafjklsd: I would do something simpler than that for this |
| 12:18 | tangrammer | justin_smith: HI Justin, sorry if i disturb you but @jcidaho asked me about about.clj and i remembered you and your intention to implemented in your project |
| 12:19 | dnolen | lsdafjklsd: just a ul of li where if you click only one item is selected |
| 12:19 | tangrammer | jusntin_smith: about.clj > avout.clj :) |
| 12:20 | tangrammer | justin_smith: about.clj > avout.clj :) |
| 12:22 | seangrove | ibdknox: Indeed, congrats on the release of LT. I'm excited to see you getting back to cutting-edge stuff now that you have a proper base to work with. |
| 12:25 | frozenlock | What what what "Light Table is open source" |
| 12:26 | zerowidth | whoaaaa nice |
| 12:27 | illsorted | is Light Table written in clojure? |
| 12:28 | tbaldridge | CLJS I think |
| 12:28 | dnolen | illsorted: all ClojureScript, Clojure is only required for compiling CLJS, hopefully we can eliminate the dead weight soon |
| 12:29 | illsorted | dnolen: awesome, thanks |
| 12:29 | frozenlock | With the ability to do some plugins! Oh... this is bad for my productivity! |
| 12:30 | seangrove | Heh, https://twitter.com/pmarca/status/420968246544576512 |
| 12:34 | justin_smith | tangrammer: hey, yeah, I have a project to put config in avout |
| 12:34 | justin_smith | it has not been put to serious use, and I have been warned not to use watches with avout |
| 12:34 | justin_smith | if that helps at all |
| 12:34 | justin_smith | if you have more specific questions feel free to ask |
| 12:35 | tangrammer | justin_smith: thanks for answering , the problem with this user jcidaho seem to be this issue https://github.com/liebke/avout/issues/2 |
| 12:35 | justin_smith | As the developer of an automated resizer tool using the image libs that ship with the jvm, let me just say that CMYK and YCCK can FOAD TIA. |
| 12:36 | tangrammer | justin_smith: i am not sure if this behavior is good or not,,,, maybe if the connection is broken the data must be unavailable to persist … what do you think about? |
| 12:37 | justin_smith | tangrammer: ahh, I don't know - I use sql for long term but mutible config, and the codebase for persistent immutible config |
| 12:37 | justin_smith | avout I only use to keep instances in sync |
| 12:38 | tangrammer | justin_smith: ok, a lot of thanks justin you are very kind with your answers, have a good day! |
| 12:58 | dnolen | ibdknox: you're probably way busy but I still can't get 0.6.0 to connect to anything |
| 12:59 | TimMc | &(#(apply + % #_ %2 %&) 1 100 1 1 1) |
| 12:59 | lazybot | ⇒ 4 |
| 13:00 | rasmusto | wait, where does 100 go? |
| 13:01 | andyf_ | wow, did a variant of that bite you in production code? |
| 13:01 | TimMc | No, I was just seeing if I could come up with a plausible scenario where it would. |
| 13:01 | TimMc | rasmusto: Into the interaction between #_ and #( |
| 13:02 | rasmusto | #_ without anything should just be whitespace, yeah? |
| 13:02 | bbloom | TimMc: very interesting! |
| 13:02 | rasmusto | but I guess the reader is choking |
| 13:02 | Bronsa | TimMc: that looks reasonable to me, what'd you expect? |
| 13:02 | bbloom | it's not choking, it's doing precisely what it should do |
| 13:02 | Bronsa | yeah |
| 13:02 | rasmusto | ignoring %2? |
| 13:02 | pyrtsa | ,(map #(% 10 ()) [drop take drop-last take-last]) ;; Argh! |
| 13:02 | clojurebot | (() () () nil) |
| 13:02 | bbloom | rasmusto: that's the point of #_ |
| 13:03 | TimMc | #_ says "drop the next form", but the #( reader is keepign track of the largest %n it has seen |
| 13:03 | Bronsa | TimMc: oh, I see. |
| 13:03 | rasmusto | ok, I thought you had to do #_%2 |
| 13:03 | TimMc | Nah, the whitespace in between doesn't matter. |
| 13:03 | rasmusto | but ok, I see the issue is really with %2 and %& |
| 13:03 | Bronsa | you'd expect that to expand to (fn [a & b] ..) instead of (fn [a b & c] ..) |
| 13:03 | TimMc | &[1 2 #_#_#_ 3 4 5 6] |
| 13:03 | lazybot | ⇒ [1 2 6] |
| 13:04 | TimMc | andyf_: It was also a public service announcement, I suppose. |
| 13:04 | andyf_ | TimMc: Thanks for keeping me steadfast in my use of ; for commenting out code :-) |
| 13:05 | justin_smith | andyf_: also, proper emacs syntax rule creation to handle #_ highlighting is *hard* |
| 13:05 | justin_smith | at least at my levels of elisp skill it is |
| 13:05 | TimMc | bbloom: "Should" is an interesting word to use there. :-P |
| 13:06 | bbloom | TimMc: no, you're right, it could go either way |
| 13:06 | TimMc | It definitely performs according to spec, where spec == the code as written. |
| 13:06 | dnolen | so has anybody tried Light Table + Austin? |
| 13:07 | dnolen | or something similar? |
| 13:08 | Bronsa | TimMc: on the same note, #_ #=(println "foo") makes the println run |
| 13:08 | TimMc | Now *that* doesn't surprise or bother me. |
| 13:09 | Cr8 | #= is strange |
| 13:09 | gfredericks | yeah considering how #_ works it's not too weird |
| 13:09 | andyf_ | Bronsa: I don't see that in a 1.5.1 REPL, but maybe I'm doing it wrong |
| 13:10 | Cr8 | also consider that with #=(...), that code executes *during reading* |
| 13:10 | Bronsa | andyf_: http://sprunge.us/GcFU |
| 13:10 | TimMc | Bronsa: What version of Clojure? |
| 13:10 | Bronsa | 1.6.0-SNAPSHOT |
| 13:11 | TimMc | Ah, OK. It doesn't do it in 1.5.1. |
| 13:11 | Bronsa | but I don't think anything has changed on that side, should be the same in 1.5.1 |
| 13:11 | Bronsa | TimMc: maybe the output gets swallowes by nrepl? I'm running java -jar .. |
| 13:12 | andyf_ | Bronsa: Yeah, different behavior between straight java repl and lein repl |
| 13:12 | TimMc | https://www.refheap.com/22623 |
| 13:12 | TimMc | lein repl |
| 13:13 | Bronsa | TimMc: #_ #=(spit "foo" "foo") 1 |
| 13:13 | Bronsa | you can see it gets run |
| 13:14 | andyf_ | Bronsa: I don't think it is in lein repl |
| 13:15 | TimMc | Bronsa: negatory |
| 13:16 | TimMc | I'm not worried about someone tripping over this, but I am a little uneasy that it is unexplained. |
| 13:16 | Bronsa | uh, you're right. |
| 13:23 | andyf_ | Does anyone know off-hand whether Clojure Java interop has a special case for a Java method that takes an int, but you call it in Clojure with code like (for [i (range 10)] (.methodName obj ^Integer i)) ? |
| 13:24 | andyf_ | With ^Integer i, ^int i, or (int i), no reflection warning. With just 'i', reflection warning. I haven't checked the generated code in these cases yet. |
| 13:24 | stuartsierra | andyf_: i is a Long there, not an Integer |
| 13:26 | andyf_ | So why no reflection warning with an ^Integer type hint? |
| 13:27 | Bronsa | andyf_: it gets unboxed automatically |
| 13:27 | justin_smith | andyf_: there is a lib that forces reflection warnings for primitive types, but it is a different paradigm from normal reflection |
| 13:28 | justin_smith | or I should say "reflection warnings" it is really warning about unexpected types / unexpected boxing |
| 13:28 | andyf_ | The source of my question is that I ran across this while running tests on next version of Eastwood Clojure lint tool, and there was a method call like this that Eastwood is currently complaining about, but it looks like it should not. |
| 13:28 | justin_smith | https://github.com/ztellman/primitive-math |
| 13:29 | justin_smith | that does more than just warn about unexpected boxing / unboxing, but could be a start |
| 13:29 | Bronsa | andyf_: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java#L454-L459 this is how it gets done |
| 13:29 | hiredman | andyf_: well, analyzer.jvm may not exactly match up with the actually compiler at the edges |
| 13:30 | gfredericks | tools.logging (afaict), at least with log4j, calls .getLogger on every logging call; that is less than ideal, correct? |
| 13:32 | hiredman | andyf_: best thing is compile, inspect the byte code for reflection, open issues where things don't match the reality of the bytecode |
| 13:34 | andyf_ | sorry, had a phone call there. Thanks for the info, folks. Most likely what I need to do is consider adding some cases to Eastwood to permit things that the Clojure compiler does. |
| 13:35 | andyf_ | I've only run across this case once in about 50 different projects, so it is not a common thing in actual usage, AFAICT |
| 13:37 | hiredman | andyf_: I am sure Bronsa is interested in hearing about mismatches |
| 13:39 | andyf_ | hiredman: This appears to be a case where it isn't tools.analyzer(.jvm) that is causing any problems, but Eastwood linting code itself is complaining. |
| 13:41 | hiredman | huh |
| 13:41 | andyf_ | hiredman: Don't worry, I've been bugging Bronsa a lot for the last month :-) |
| 13:42 | hiredman | :) |
| 13:44 | dnolen | ibdknox: ok doing Om development with Light Table ROCKS |
| 13:44 | dnolen | ibdknox: I wonder if LT couldn't provide some way to actively watch an atom though |
| 13:44 | dnolen | ibdknox: or an arbitrary expression really |
| 13:44 | dnolen | ibdknox: currently I have to re-eval to see the expression change if I'm interacting via the browser REPL |
| 13:51 | canweriotnow | Is anyone successfully using speclj with Luminus? |
| 13:51 | canweriotnow | I'm getting very confusing errors when I run `leon spec` |
| 13:51 | canweriotnow | *lein |
| 13:52 | canweriotnow | It seems related to the core.cache/through issue... |
| 13:52 | canweriotnow | even though I've got the workaround w/ memoize in my project.clj |
| 13:53 | dav | is there a strict version of get that throws an exception if the key is not present in the hashtable? |
| 13:53 | tbaldridge | dav: no, thankfully |
| 13:54 | dav | tbaldridge: why thankfully. would you rather the program continues to run and crash later with an obscure error when the nil hits something that can't digest it? |
| 13:56 | technomancy | dav: part of learning clojure is learning to embrace the NPE |
| 13:56 | tbaldridge | dav: clojure is designed to handle nil gracefully, nil has a meaning in most of Clojure code. With no throw on missing key I can do stuff like this: |
| 13:56 | tbaldridge | , (filter #{3 4} [1 2 3 4 5]) |
| 13:56 | clojurebot | (3 4) |
| 13:56 | technomancy | dav: it's kind of weird because there is such a thing for sequential collections, just not for associative |
| 13:57 | technomancy | go figure |
| 14:00 | Morgawr | ibdknox: been hyped as hell because of new lighttable plugin and source code available, thanks a lot for the great job! It also feels really faster now |
| 14:03 | tbaldridge | dav: but as a whole, I've found that when working with transformations over data (map, filter, merge, assoc, etc.) I very rarely hit NPE, and when I do it's pretty clear when were it's coming from. Or I just add a few :pre asserts to make sure required inputs are available. Couple that with small functions, and I don't see a need to have collections throw exceptions. |
| 14:06 | dnolen | Om brain explosion - specify + protocols are going to be amazing http://github.com/swannodette/om/issues/51 |
| 14:07 | dnolen | you can patch ILookup for a speicfy map to get data representation independence |
| 14:07 | dnolen | s/speicfy/specific |
| 14:09 | bitemyapp | holy shit LightTable is open source now. |
| 14:10 | Morgawr | bitemyapp: yep |
| 14:10 | Morgawr | the plugin system looks great too |
| 14:10 | bitemyapp | Morgawr: now to begin a Haskell plugin >:) |
| 14:11 | dav | tbaldridge: 'part of learning clojure is learning to embrace the NPE' => doesn't seem like a good reason why there should not exist a strict version of get.. |
| 14:11 | bitemyapp | "learning to embrace the NPE" is the most perverse thing I have ever heard. |
| 14:11 | bitemyapp | null errors are utterly unnecessary. |
| 14:12 | tbaldridge | dav: you'll find different points of view on the whole NPE thing. technomancy is on the pro strict side, I tend to be on a different side of the argument. |
| 14:12 | tbaldridge | dav: and you can feel free to write your own strict get: |
| 14:12 | dav | tbaldridge: yep thanks |
| 14:12 | bitemyapp | I'm on the, "this has wasted billions of dollars and possibly also killed lives and as an industry we should be ashamed we perpetuate this mistake" side. |
| 14:12 | dav | tbaldridge: was just curious why it wasn't already out there. |
| 14:13 | dav | kind of miss haskell's Maybe |
| 14:13 | dav | wondering if there would be a way to elegantly integrate that feature without having to go for the whole strict typesystem. |
| 14:13 | Morgawr | I wonder how big of a feat it would be to add annotation to the whole LT source tree with typed clojure |
| 14:13 | bitemyapp | dav: I'm a Haskell user and I've looked at core.typed, it can help but really if you like having a helpful type system you're not going to get very far. |
| 14:14 | Morgawr | project seems pretty massive |
| 14:14 | bitemyapp | Morgawr: considering it's CLJS, pretty hard? |
| 14:14 | tbaldridge | dav: something like this will do the trick https://gist.github.com/halgari/8322555 |
| 14:14 | Morgawr | typed clojure doesn't work on CLJS? |
| 14:14 | bitemyapp | Morgawr: ambrose is working on it. |
| 14:14 | Morgawr | ah |
| 14:14 | Morgawr | my bad then, I thought it was already working |
| 14:14 | Morgawr | cool though |
| 14:14 | bitemyapp | Morgawr: JS has a very different underlying type system than Java. |
| 14:14 | jcromartie | bitemyapp: absolutely agree |
| 14:14 | Morgawr | yeah |
| 14:15 | dnolen | Morgawr: that basics do work in CLJS |
| 14:15 | bitemyapp | dav: I like Clojure, but my fucking god is so much human labor and productivity being wasted on errors arising from using untyped languages. |
| 14:15 | dnolen | Morgawr: CLJS isn't really different enough for the core |
| 14:15 | dnolen | Morgawr: interop is another story |
| 14:15 | Morgawr | yeah of course |
| 14:15 | bitemyapp | that's sorta the point. |
| 14:15 | dav | tbaldridge: not sure why you need to deftype? find ought to do it.. |
| 14:16 | dav | bitemyapp: agreed. |
| 14:16 | tbaldridge | dav: find returns a map entry, this way doesn't require a allocation on every get. |
| 14:16 | dav | tbaldridge: isn't the mapentry fully shared? |
| 14:17 | tbaldridge | dav: I like ML, but so much human labor and productivity is being wasted on errors arising from compiler type checking. |
| 14:17 | tbaldridge | dav: no |
| 14:17 | stuartsierra | You don't need to define a new type. (Object.) would work too. |
| 14:17 | tbaldridge | stuartsierra: good point I wasn't sure there was a way to do that in Java. |
| 14:17 | dav | stuartsierra: what if there's an Object. in your map ? |
| 14:17 | bitemyapp | tbaldridge: what's to lose in that direction? |
| 14:17 | tbaldridge | dav: I updated the gist to use (identica?) instead of (instance?) |
| 14:17 | stuartsierra | `identical?` checks object identity |
| 14:17 | tbaldridge | dav: reload the gist |
| 14:18 | dav | stuartsierra: I see. |
| 14:18 | bitemyapp | tbaldridge: I have yet to get a cogent example from an untyped enthusiast as to what they'd be missing in something like Haskell. |
| 14:18 | tbaldridge | bitemyapp: well, go write me a compiler or a OS in Haskell, if it compiles it's bug free! |
| 14:18 | tbaldridge | :-P |
| 14:18 | dnolen | bitemyapp: or a user interface that isn't total shite |
| 14:18 | Morgawr | tbaldridge: either have an OS that runs with bugs or an OS that doesn't compile :P |
| 14:19 | Morgawr | I'll take the first one |
| 14:19 | bitemyapp | tbaldridge: you're missing the point. You can be more productive and spend less time overall tracking down errors in something like Haskell than an untyped Brand X. |
| 14:19 | dnolen | bitemyapp: or generic software that doesn't require reading piles of papers |
| 14:19 | bitemyapp | dnolen: have you written Haskell? you don't have to read papers, just a tutorial accompanied by silly cartoons. |
| 14:19 | tbaldridge | bitemyapp: but the end result is that you program in two languages, a type language, and a runtime language. I'd rather do all my coding in a single language, not a language and a DSL. |
| 14:20 | bitemyapp | you don't program in the type system |
| 14:20 | dnolen | bitemyapp: I have written enough to know which patterns I like in dynamic languages become painfully difficult in Haskell |
| 14:20 | bitemyapp | you don't even have to write the annotations out of the gate to frame out an idea. |
| 14:20 | dnolen | bitemyapp: and seen enough generic programming papers in Haskell to be afraid |
| 14:20 | bitemyapp | you can query the REPL as to what it thinks the type is. |
| 14:20 | bitemyapp | dnolen: what can you do in Clojure that you think you can't do in Haskell? |
| 14:20 | dnolen | bitemyapp: and read enough threads on the utter fuckup that is Haskell records |
| 14:20 | dnolen | etc etc |
| 14:20 | bitemyapp | dnolen: that's what I've been begging for. |
| 14:20 | bitemyapp | dnolen: I want a concrete, cogent example of Clojure code that you think can't be done in Haskell. |
| 14:21 | dnolen | bitemyapp: there isn't any thing you can't do |
| 14:21 | dnolen | it's just a matter of what I want to spend my time on |
| 14:21 | tbaldridge | bitemyapp: core.logic? |
| 14:21 | bitemyapp | don't make vague references to papers about Haskell (which are likely addressing much higher concerns than you likely think they are) |
| 14:21 | bitemyapp | tbaldridge: really? there are multiple libraries like that in Haskell. |
| 14:21 | bitemyapp | tbaldridge: http://lambda-the-ultimate.org/node/112 |
| 14:21 | insamniac | <gets popcorn> |
| 14:21 | bitemyapp | tbaldridge: you need to try harder than that. |
| 14:21 | Morgawr | funny enough I'm currently reading this paper http://ecs.victoria.ac.nz/foswiki/pub/Events/PLATEAU/2009Program/plateau09-hanenberg.pdf which seems to be related to this conversation and might interest somebody |
| 14:22 | bitemyapp | tbaldridge: Haskell people are huge fans of declarative programming, embedding prolog/logic programming in Haskell is like the first thing they'd want to do. |
| 14:22 | dav | dnolen: I think the Maybe pattern is useful. In fact we get some of the ADT benefits in core.match (which I believe you wrote?).. |
| 14:22 | dnolen | bitemyapp: I've yet to see anything that gets to close miniKanren in Haskell, it's hard problem, surprise |
| 14:22 | bitemyapp | Morgawr: empirical studies on the practice of programming based on the efforts of undergrads/grad students are not good papers. |
| 14:22 | dav | I don't know if there's a way to make it a more intimate part of the language |
| 14:22 | dav | anyway I'm late for dinner. got to go.. |
| 14:23 | teslanick | It's my experience that loosely-typed languages are great for JFDI. But that's not always a good thing. |
| 14:23 | zerowidth | what is it you want, bitemyapp? validation that haskell is the one true way? |
| 14:23 | Morgawr | bitemyapp: don't shoot the ambassador ;) skim through it, it might be interesting (I just started so idk) |
| 14:23 | bitemyapp | Morgawr: I'm going to read it, not shooting at you, just saying that I've read a lot of papers like this and they usually aren't very good. |
| 14:23 | Morgawr | (also I hate having to do this myself because I agree but I *have* to read this shit because to write a paper you need to read papers, duh) |
| 14:23 | bitemyapp | empiricism in Comp Sci involving humans isn't great. |
| 14:23 | gtrak | I wonder how many programmers perpetually have 'learn haskell' on their todo lists? Not sure if that's data for or against haskell. |
| 14:24 | bitemyapp | Morgawr: yep, I've even read this particular paper. I remember it now. |
| 14:24 | Morgawr | funny thing, I started with haskell a few years back but I was struggling a bit undertaking a serious project with it (because it was complx) so I moved to Clojure because it looked interesting.. decided to stick with it lol |
| 14:24 | bitemyapp | Morgawr: part of the problem is that to even compare the two, you'd have to include the cost of long tail bugs the untyped lang won't catch that the typed language would. |
| 14:25 | Morgawr | bitemyapp: true |
| 14:25 | bitemyapp | Morgawr: you can't do that unless you scope it to an actual library/project lifecycle. |
| 14:25 | tbaldridge | well, I have work to do, but I'll just say this...this talk perfectly captured my views on the typed/untyped thing: http://www.infoq.com/presentations/functional-pros-cons |
| 14:25 | dnolen | dav: I'm not anti Haskell, or ML derived - but typed FP evangelism is goofy |
| 14:25 | bitemyapp | Morgawr: another thing confounding a comparison is that if you compare a randomized sampling of Java programmers to Clojure programmers, the Clojurians are probably going to win simply because of sampling bias. |
| 14:26 | gtrak | that guy's really funny-harsh. |
| 14:26 | bitemyapp | Morgawr: but if you compared Haskell programmers to Java programmers, the Haskell programmers would win for the same reason. The sampling bias would massively outweigh any differences related to the languages themselves. |
| 14:26 | bitemyapp | and would have mostly to do with what languages attract smarter people. |
| 14:26 | dnolen | dav: as with most of these discussions, there are nuances and tradeoffs often ignored |
| 14:27 | Morgawr | I'm torn in two between dynamic and static typing to be honest, I think the typed clojure approach is a good way to go.. might be harder to implement but knowing I can have a type system at my disposal if I need to (but nobody enforcing me to use it) sounds great (in theory) |
| 14:27 | bitemyapp | dnolen: I mostly am seeking a relatively constrained, not-a-whole-project-or-line-of-research example of code in an untyped language that somebody believes couldn't be done in Haskell. |
| 14:27 | bitemyapp | Morgawr: I'm not encouraged by core.typed after talking to Amborse. |
| 14:27 | bitemyapp | Ambrose* |
| 14:27 | dnolen | bitemyapp: just take your Haskell evangelism somewhere else man, it's sooooo tiresome |
| 14:27 | tbaldridge | bitemyapp: not even a good talking point. I can write a web browser in x86 assembler...doesn't mean I should |
| 14:28 | Morgawr | a thing I like about typed over untyped is that even after months of writing shitty code, I can always go back to it and at least understand what some data is without having to undestand the program |
| 14:28 | dnolen | bitemyapp: none of us are sitting #haskell bugging people |
| 14:28 | bitemyapp | dnolen: that's because you wouldn't have a leg to stand on anyway. |
| 14:28 | bitemyapp | tbaldridge: the turing completeness nihilism can be applied anywhere in any conversation. |
| 14:28 | dnolen | bitemyapp: lol |
| 14:28 | bitemyapp | tbaldridge: the point is productivity. |
| 14:28 | mrhanky | ist it possible to use google closure compiler with externs.js and js files as additional lib? |
| 14:28 | bbloom | bitemyapp: you've become more polite, but more troll like. seriously, go away |
| 14:28 | gtrak | I'd like some of the benefits of types, like wicked compiler optimizations, but V8 has proven it can be done to javascript. |
| 14:28 | bitemyapp | bbloom: well that's not going to work. |
| 14:29 | bitemyapp | bbloom: but if you contrive a small example of Clojure that you think can't work in Haskell, that'll keep me busy for awhile. |
| 14:29 | bbloom | bitemyapp: you're a major negative influence on this channel, you make it an unpleasant place for many smart folks |
| 14:29 | dnolen | bitemyapp: sadly I'm putting you on ignore now, you've had your chance |
| 14:29 | zerowidth | bitemyapp: still curious what you're trying to accomplish here |
| 14:30 | bitemyapp | zerowidth: raising awareness. |
| 14:30 | Cr8 | and I'm just sitting here hammering out C |
| 14:30 | mrhanky | they see him trollin |
| 14:30 | zerowidth | consider my awareness, uh, raised |
| 14:30 | bitemyapp | mrhanky: they hatin' |
| 14:30 | bbloom | bitemyapp: everybody in here is bloody fucking aware that haskell exists and is interesting. you're not doing anything productive by issuing stupid challenges |
| 14:30 | bitemyapp | bbloom: being aware something exists and grokking it are two different stories. |
| 14:31 | bitemyapp | bbloom: I'm not trying to "issue a challenge", I legitimately want to compare/contrast. |
| 14:31 | zerowidth | pretty sure no one's really interested in doing that |
| 14:31 | bitemyapp | bbloom: I want to know what's missing as a pedagogical exercise. |
| 14:31 | bitemyapp | bbloom: but nobody can come up with anything that isn't a huge project. |
| 14:31 | bbloom | bitemyapp: i'm sorry we can't all be as smart as you and have seen the light. alternatively, i'm sorry you don't grok the fact that some/many of us DO grok it and genuinely prefer an alternative way of viewing the world |
| 14:31 | hiredman | bbloom: /ignore |
| 14:31 | Morgawr | I remember reading an article some time ago about some guy trying to write some complex algorithms using "proper" monadic haskell code and even after asking 4 other PhD guys it took them several months to have proper code to implement the algorithm meanwhile everybody else had a fully working algorithm from the get go |
| 14:31 | bitemyapp | bbloom: I'm trying to exercise a dialectic, not push a particular point. |
| 14:31 | mrhanky | how do i prevent this js from getting munged by cljs compiler? $("#repl").jqconsole(); |
| 14:31 | Morgawr | however this is probably just some satyrical article I read and I don't remember where so idk |
| 14:32 | Morgawr | thought it was funny though |
| 14:32 | bitemyapp | Morgawr: you can shanghai yourself with yak-shaving in any language. |
| 14:32 | bitemyapp | Morgawr: people do the same thing with macros all the time. |
| 14:32 | bitemyapp | Cr8: embedded? |
| 14:32 | bitemyapp | Cr8: or kernel hacker? |
| 14:32 | Cr8 | nope |
| 14:33 | Cr8 | and nope |
| 14:33 | bitemyapp | Cr8: okay, what then? |
| 14:33 | mrhanky | anybody? :/ |
| 14:33 | teslanick | Some people just like writing C. :) |
| 14:33 | bitemyapp | I'm curious. |
| 14:33 | Morgawr | Cr8: bored? :P |
| 14:33 | Cr8 | bitemyapp: my usual thing, work |
| 14:33 | bitemyapp | teslanick: mmmmm function pointer typedefs |
| 14:33 | mrhanky | i'm confused by the $("#repl") |
| 14:33 | bitemyapp | Cr8: ah god dermert. |
| 14:33 | shep-werk | Cr8: how similar do you feel clojure is to C? |
| 14:33 | bitemyapp | lol. |
| 14:34 | OlegYch | depressing to see a guy with decent contributions in lang being labeled as troll at #lang |
| 14:34 | shep-werk | (I also do it for my da job, sometimes) |
| 14:34 | Cr8 | it's in C because folks (that aren't me) like C =P |
| 14:34 | shep-werk | Obviously, there's a lot of difference |
| 14:34 | Morgawr | C used to be my main language until I switched to Clojure, way to completely change my development process (still love C) |
| 14:34 | bitemyapp | OlegYch: do you use one of my libraries or do you mean somebody else? |
| 14:34 | bbloom | OlegYch: it's not enough to be smart, you need to be likable, otherwise nobody will listen to you. he's not even trying |
| 14:34 | bitemyapp | Morgawr: that's a pretty big leap. |
| 14:35 | shep-werk | but there's something so similar about clojure functions that take the "object" as the first param |
| 14:35 | Cr8 | adding some small features to the disky b-tree file format lib |
| 14:36 | nDuff | OlegYch: ...a guy with decent contributions, and a long history of being at least moderately abrasive. |
| 14:36 | Cr8 | shep-werk: very unlike =P |
| 14:37 | Cr8 | everyone around me seems to gravitate toward languages with no capacity for abstraction |
| 14:37 | OlegYch | bitemyapp: i haven't been using clojure in a while |
| 14:37 | danneu | I have a compojure app running in production connected to a datomic db. what's the preferred way to make live changes to the code? |
| 14:38 | danneu | Well, "seamless" deploy rather |
| 14:38 | bitemyapp | OlegYch: yeah my use of it has tapered but I still maintain some libraries and fix bugs. |
| 14:38 | bitemyapp | OlegYch: most of my active use of it currently centers around Datomic. |
| 14:38 | OlegYch | your libs look useful as well as your conversations in here |
| 14:44 | bitemyapp | OlegYch: Some of it is that bloom and nolen have disliked me for a long time and if I do pretty much anything at all that brings my existence to their notice it draws their ire. The other is that a lot of people have a hard time exercising critical distance in the course of teasing out ideas, especially in a dialectic. |
| 14:45 | bitemyapp | Some react to things as if noun X of dialectic X and Y is somehow internalized into their ego and identity. |
| 14:45 | insamniac | Someone was being reactionary anyway.. |
| 14:45 | bitemyapp | Which is unhealthy for reasons that have nothing to do with what they think copacetic (read: absent substance) conversation constitutes. |
| 14:47 | tbaldridge | OlegYch: don't let him fool you, almost every day of the week he's on here talking about how Haskell or ML is better or whatever. It's just in poor taste to go to the forum of language X and talk about how one of its core features makes it worse than language Y. |
| 14:48 | bitemyapp | Haskell happens to be a great Brand X for type systems. |
| 14:48 | bitemyapp | That's why so many PLT papers use it. |
| 14:48 | tbaldridge | For instance, I would expect people to react this same way if I went to #erlang and wouldn't stop talking about how we needed STM. It's not constructive, it doesn't help, it's a long ago decided design decision....enough said. |
| 14:48 | bitemyapp | tbaldridge: I'm sorry types pissed in your wheaties :( |
| 14:49 | Morgawr | I smell a #haskellian conspiracy taking place, we should retaliate and send some covert agents lauding the feats and qualities of clojure in their channel! |
| 14:49 | bitemyapp | Morgawr: We could go to #haskell and talk about how superior CLJS is to Fay! |
| 14:49 | zerowidth | tbaldridge: but you're just having a dialectic about, you know, STM |
| 14:49 | bitemyapp | zerowidth: the problem is that you think you're being farcical but I think the merits and demerits of STM are worth discussing. |
| 14:50 | bitemyapp | zerowidth: they're good to have but can fall apart fast. |
| 14:50 | bitemyapp | abara |
| 14:50 | bbloom | bitemyapp: i've given you a half dozen changes to not act like a troll. i've been very patent with you and for a while, thought you had turned around your attitude and behavior. we even had some private chats where you thanked me for helping you not piss of smart folks, yet here you are assuming telling folks that i have an ego problem b/c i don't like you. get over yourself |
| 14:50 | bitemyapp | damn, he's not here. Anyway, he knows what I'm talking about. |
| 14:51 | tbaldridge | agreed, but it wouldn't help anyone to go to #erlang where the idea is "share nothing...ever" and start talking about sharing stuff. |
| 14:51 | bitemyapp | bbloom: you troll me as much as anything else and I haven't asked to you to supplicate yourself in public. |
| 14:51 | tbaldridge | And with that I shall quit. |
| 14:52 | bbloom | bitemyapp: you've managed to piss off tbaldridge, dnolen, myself, stuartsierra, and how many other respected members of this channel and community? cut it out. |
| 14:52 | zerowidth | mrhanky: did you figure your thing out? that's a jquery call |
| 14:52 | bitemyapp | bbloom: IRC is nothing special, I gave a lightning talk on some Haskell at the last SF Clojure meetup. |
| 14:52 | TimMc | whoop-de-doo |
| 14:52 | mrhanky | i'm still working on it, but it seems i got it now |
| 14:52 | bitemyapp | bbloom: the oligarchy is upset. why do I care? |
| 14:52 | bbloom | bitemyapp: and hiredman, and TimMc it seems too |
| 14:52 | zerowidth | mrhanky: cool, i haven't tried doing that but i think you just need an externs file for jquery |
| 14:53 | mrhanky | yeah, i found some on googles site. just needed a definition "jQuery.fn" |
| 14:53 | bitemyapp | I actually originally dipped into here today to discuss LT getting open sourced. |
| 14:53 | bitemyapp | bbloom: it's offensive that you even put that much weight on such things. |
| 14:54 | bitemyapp | in other, more positive news, the almighty powers that be decided to finally clean up the edn spec a bit. |
| 14:55 | bitemyapp | https://github.com/edn-format/edn/commits/master |
| 14:55 | bitemyapp | not quite the EBNF I'd like, but it at least resolves some irregularities that meant any edn parser implemented to spec wouldn't actually work for talking to Datomic. |
| 14:56 | bitemyapp | I'm hoping this at least means writing an edn parser that's useful can be done against the spec instead of the Clojure reader. |
| 14:56 | arrdem | Haskell EDN parser? what? |
| 14:57 | bitemyapp | arrdem: hum? |
| 14:57 | bitemyapp | arrdem: need Python support at work. There isn't a working Python one, we're limping along with one of the ghetto ones. |
| 14:57 | bitemyapp | arrdem: I'd *like* a Haskell one but I haven't had the time to verify/check the existing one(s) |
| 14:58 | arrdem | bitemyapp: ah. I looked for a python reader a while back and didn't find anything good. |
| 14:58 | arrdem | *either |
| 14:58 | bitemyapp | arrdem: trust me, there isn't anything good. |
| 14:58 | bitemyapp | arrdem: the closest thing to a decent one would be dreid/edn, and I'm still working on some issues there. |
| 14:58 | bitemyapp | mostly involving Python's terrible collections. |
| 15:00 | ToBeReplaced | i've limped with pyclj... at least has the primitives working, but no tag registry iirc |
| 15:01 | ToBeReplaced | dreid/edn looks cool |
| 15:01 | gfredericks | technomancy: is there any public discussion or quick pithy opinions on bundler's approach to version ranges? (i.e., the lockfile) |
| 15:02 | bitemyapp | gfredericks: it's bad. |
| 15:02 | bitemyapp | gfredericks: there are better examples of how to handle version ranges based on a consistent versioning scheme but I'm afraid if I utter the word I'll raise the hackles of the oligarchy. |
| 15:02 | gfredericks | bitemyapp: what are the downsides? |
| 15:02 | bitemyapp | gfredericks: it helps a lot if you have a versioning scheme where the relative importance of each digit is consistent across projects. |
| 15:03 | gfredericks | I'm not sure how that's relevant? |
| 15:03 | ToxicFrog | bitemyapp: wha? |
| 15:04 | jgmize | I'm curious as to how hard it would be to port the clojure EDN reader over to Hy to use from python modules. |
| 15:04 | bitemyapp | gfredericks: it's not designed to actually handle sensible version ranges and more often than not, it's more like Golang where you simply lock in a build that works and pray. |
| 15:04 | bitemyapp | jgmize: don't think you'd win much. |
| 15:04 | gfredericks | bitemyapp: what's not designed to actually handle sensible version ranges? |
| 15:05 | gfredericks | I'm contrasting this with leiningen's approach, not some uninstantiated ideal |
| 15:05 | zerowidth | gfredericks: opinions about bundler's approach in what way? |
| 15:05 | bbloom | gfredericks: forgive my self promotion, but i've written about my thoughts on semver & version numbers: http://www.brandonbloom.name/blog/2013/06/19/semver/ |
| 15:05 | zerowidth | the idea in theory is that gems use semver |
| 15:05 | zerowidth | and the ~> can be handy |
| 15:06 | zerowidth | bbloom: ahh, nice |
| 15:06 | gfredericks | I'm wondering about the idea of having a version range in one file and a locked version in another, generated file |
| 15:06 | zerowidth | ahh, if you check in the generated file, you can at least ensure a consistent environment between dev/prod |
| 15:06 | bbloom | gfredericks: the idea of resolving a dynamic identity (ie a version specifier) to a static name (a sha1) is a good idea |
| 15:07 | bbloom | gfredericks: bundler gets that part right, imo |
| 15:07 | zerowidth | seems flexible enough to me, but i don't have any experience with lein's style |
| 15:07 | bitemyapp | it'd be less tedious if Ruby were based around build artifacts. |
| 15:08 | bitemyapp | that's partly how Golang gets away with being terrible at this. |
| 15:08 | TimMc | gfredericks: Yeah, I generally approve of the idea that updates can be fetched and suggested automatically, and that the programmer can accept or reject updates. |
| 15:09 | gfredericks | so is there a reason leiningen doesn't have this option, and can it be done with a plugin? |
| 15:09 | arrdem | bbloom: nice post. |
| 15:09 | bbloom | arrdem: thx |
| 15:10 | hiredman | TimMc: working in a team larger than one or two, I don't think I would like that |
| 15:13 | mrhanky | is google closure able to minify the output when using advanced optimization? |
| 15:13 | tos9 | /7/ |
| 15:14 | mrhanky | minify = remove whitespaces, linebreaks etc |
| 15:15 | hiredman | advanced optimization is minified by definition, I believe |
| 15:15 | teslanick | Yeah, it also renames values, inlines certain functions, etc. |
| 15:16 | mrhanky | i know, but it still uses line breaks an indentation |
| 15:16 | hiredman | mrhanky: you must have the pretty-printing output turned on in project.clj |
| 15:17 | dnolen | mrhanky: it does not, lein-cljsbuild pretty prints output by default |
| 15:17 | stuartsierra | lein-cljsbuild has :pretty-print true by default for some strange reason. |
| 15:17 | hiredman | :( |
| 15:17 | dnolen | mrhanky: which doesn't make sense for advanced |
| 15:17 | finishingmove | can someone tell me how to install LightTable on Debian? I'm a linux noob... |
| 15:17 | jergason | dnolen: how does clojurescript handle immutable data structures? |
| 15:18 | jergason | isn't that kinda wasteful in javascript? |
| 15:18 | dnolen | jergason: JS GCs have come a very, very long way |
| 15:18 | Morgawr | finishingmove: http://www.lighttable.com/ go here, download the linux64 or linux32 archive (depends if you're on 64 or 32 bit) |
| 15:18 | Morgawr | then extract it wherever you want |
| 15:18 | radix | finishingmove: I just downloaded the Linux x64 version and ran the LightTable script inside. |
| 15:18 | Morgawr | and run the binary called "LightTable" |
| 15:18 | finishingmove | How would I run it without having to type in the full path everytime though? |
| 15:19 | jergason | so the answer is "it is fast/efficient enough to copy the entire data structure"? |
| 15:19 | nDuff | finishingmove: putting it somewhere in your PATH. |
| 15:19 | hiredman | wow, no one copies the whole thing |
| 15:19 | clojurebot | Excuse me? |
| 15:19 | Morgawr | I have this line in my .bashrc: export PATH=/opt/LightTable:$PATH |
| 15:20 | Morgawr | where /opt/LightTable is where I have extracted the archive |
| 15:20 | nDuff | finishingmove: personally, for instance, I have a $HOME/local/opt/LightTable-VERSION/, with symlinks from $HOME/local/opt/LightTable to the current -VERSION, and a $HOME/local/bin that symlinks to ../opt/LightTable/LightTable (or something like that). |
| 15:20 | clojurebot | Cool story bro. |
| 15:20 | Morgawr | nDuff: does it make sense to have a -VERSION? because LT automatically updates itself |
| 15:20 | nDuff | Morgawr: only to a point. |
| 15:21 | dnolen | jergason: ClojureScript implements some of the most efficient persistent data structures known - they work by sharing structure |
| 15:21 | jergason | hiredman: was that to me? |
| 15:21 | nDuff | Morgawr: it upgrades across point releases, but not minor releases. |
| 15:21 | Morgawr | well yeah, with major releases that break backwards compatibility (like this one to 0.6) it doesn't work well |
| 15:21 | hiredman | yeah |
| 15:21 | gfredericks | do maven servers typically serve info on all versions available for an artifact? |
| 15:21 | nDuff | Morgawr: thus, I have a separate -VERSION per minor release. |
| 15:21 | Morgawr | makes sense I guess, I just override everything |
| 15:21 | Morgawr | as in, extract over the old one |
| 15:21 | dnolen | jergason: when ClojureScript was released it was copy on write - but those were soon replaced with ports of the Clojure data structures |
| 15:21 | hiredman | immutable datastructures are almost always implemented as trees using path copying |
| 15:21 | jergason | oh for some reason I assumed that stuff would have a different implementation in cljs |
| 15:21 | jergason | neato |
| 15:22 | xeqi | gfredericks: the maven-metadata.xml contains that info |
| 15:22 | gfredericks | xeqi: cool, thanks |
| 15:22 | nDuff | gfredericks: Yes. |
| 15:22 | teslanick | dnolen: Where do those ports live? I'd like to look at them |
| 15:22 | nDuff | gfredericks: it's typical to cull old snapshots, but not old releases. |
| 15:22 | dnolen | jergason: we also have transients, last time I checked on Google V8 you can thaw an immutable vector and add 10,000,000 elements as fast you can push onto a mutable array. |
| 15:23 | dnolen | teslanick: look at the ClojureScript standard library |
| 15:23 | dnolen | cljs/core.cljs |
| 15:24 | jballanc | wow...I get up to go have dinner and LightTable gets released open source |
| 15:24 | teslanick | dnolen: Awesome, thanks |
| 15:24 | Morgawr | jballanc: should have more dinners throughout the day man |
| 15:24 | jballanc | right? |
| 15:25 | Morgawr | they must be magical |
| 15:25 | jballanc | at least now the couple hours I spent customizing my key bindings in LT over the weekend seem like less of a waste |
| 15:25 | gfredericks | nDuff: I'm noodling the idea of a lein plugin for lockfiles |
| 15:25 | hiredman | :( |
| 15:25 | gfredericks | I'm not too familiar with maven's support for version ranges though |
| 15:26 | hiredman | gfredericks: it is really bad |
| 15:26 | hiredman | don't use version ranges |
| 15:26 | gfredericks | hiredman: because version ranges are bad or maven is bad? |
| 15:26 | hiredman | http://nelsonmorris.net/2012/07/31/do-not-use-version-ranges-in-project-clj.html |
| 15:27 | xeqi | gfredericks: the combination of the maven default of what "1.0.0" and how version ranges interact is bad |
| 15:28 | gfredericks | hiredman: the repeatability issue is solved by the lockfile, presumably |
| 15:28 | hiredman | gfredericks: pick versions, and if consumers of libraries want something different lein provides ways to do that |
| 15:28 | gfredericks | and my guess is a plugin could apply its own range logic if necessary... |
| 15:28 | llasram | gfredericks: Oh, lockfile -> like Gemfile.lock ? |
| 15:28 | gfredericks | exactly |
| 15:29 | xeqi | gfredericks: what advantages are yo uhoping to get out a lock file not provided currently? |
| 15:29 | nDuff | gfredericks: heh. I'm trying to sell the rest of the Ivy team on support repository-wide read locks right now. |
| 15:29 | gfredericks | xeqi: not having to overspecify what you want |
| 15:30 | hiredman | gfredericks: what is the use case? |
| 15:31 | gfredericks | hiredman: semantic specifications; I put "0.6.3" in my project.clj not because I'm attached to that version in particular but because lein requires an exact version |
| 15:32 | gfredericks | but it's not clear that I'd be happy with 0.6.4 as well if it existed |
| 15:32 | gfredericks | i.e., my intent isn't obvious |
| 15:32 | gfredericks | and lein therefore can't do anything based on my intent |
| 15:32 | llasram | gfredericks: But if 0.6.4 doesn't exist yet, you don't know if your project will work with it or not |
| 15:32 | gfredericks | I'm not suggesting it upgrade without telling me |
| 15:33 | gfredericks | and it's true that I don't know if my project would work; that's why I would test with it after upgrading |
| 15:33 | llasram | gfredericks: Sure, but unless you actually have a cross-version matrix of tests, you don't actually know any given collection of versions from a set of ranges are actually compatible |
| 15:33 | xeqi | gfredericks: are you familiar with maven's dependency resolution and what soft dependencies are? |
| 15:33 | gfredericks | xeqi: no |
| 15:33 | llasram | gfredericks: Ok -- but how is that different from today? |
| 15:34 | hiredman | gfredericks: it is better to explicitly say "I used this version and it works here" and let consumers override it, than to leave it open ended, and force consumers to figure out the end of an open range |
| 15:34 | gfredericks | hiredman: so that's a libs vs apps issue; this would be intended for apps, not libs |
| 15:35 | hiredman | then what is the point? |
| 15:35 | gfredericks | ...people use lein with apps too? |
| 15:35 | hiredman | leave it closed, write a plugin that just says "oh, there is a newer version of this dep in maven, maybe check it out?" |
| 15:35 | gfredericks | and people who write apps also have dependencies? |
| 15:36 | hiredman | no reason to fiddle with depency logic, or have some kind of lockfile |
| 15:36 | gfredericks | okay |
| 15:36 | gfredericks | thanks |
| 15:36 | hiredman | if you are writing an app that uses some library, and you want to override one the libraries dependencies, you can do that via :exclusions |
| 15:37 | xeqi | I hear lein-ancient handles the finding latest version part |
| 15:37 | hiredman | ^- |
| 15:38 | xeqi | having never used it |
| 15:38 | hiredman | me neither, we have a guy on the team who will obsessively upgrade things |
| 15:41 | bbloom | hiredman: ugh. reminds me why i hate the "everybody just commits to master" model that so much of the world relies on |
| 15:42 | bbloom | i saw that thing about facebook's giant single mercurial instance and almost threw up in my mouth |
| 15:42 | hiredman | speaking of, the clojure with hand tools talk is up |
| 15:42 | bbloom | nice |
| 15:42 | mrhanky | gnaaa |
| 15:43 | rkneufeld | hiredman: I actually started hand tool woodworking over the break. It's intense! |
| 15:43 | hiredman | bbloom: I dunno I can definitely see some advantages to a single repo |
| 15:43 | bbloom | hiredman: there are definite advantages, but i'd argue that most of them are too to poor tooling, not inherent |
| 15:43 | paulswilliamsesq | safa |
| 15:43 | bbloom | hiredman: we didn't have a good model for small repos until distributed version control, now we don't have a great model for coordinating many small repos |
| 15:44 | hiredman | bbloom: sure |
| 15:44 | bbloom | s/too/due |
| 15:44 | hyPiRion | who are "we"? |
| 15:44 | bbloom | hyPiRion: the software engineering community :-P |
| 15:44 | hiredman | and it doesn't help that so many people are running right out of git instead of building released artifacts |
| 15:44 | hyPiRion | hm |
| 15:45 | hiredman | managing change :( |
| 15:46 | hiredman | which, well upgrading depedencies is just another change to manage |
| 15:46 | lsdafjklsd | dnolen: so the problem was that I was not passing the entire root app cursor to the ul build component, but a subset e.g. (:projects app), is that weird? |
| 15:47 | dnolen | lsdafjklsd: it's not weird, (:projects app) will just make a new cursor |
| 15:48 | lsdafjklsd | dnolen: I pass the id to the ul component via opts, and with (:projects app) it won't update, even though it's changing |
| 15:48 | dnolen | lsdafjklsd: but what is id? |
| 15:49 | dnolen | lsdafjklsd: once you hit primitives you need to be careful |
| 15:49 | lsdafjklsd | dnolen: sorry, the new selected item's id that changed. it's a property on the root cursor :selected-id and I pass that to the component through it's opts option |
| 15:49 | dnolen | lsdafjklsd: you only get a free ride on associative data structures |
| 15:50 | dnolen | lsdafjklsd: is id a string? a keyword? |
| 15:50 | lsdafjklsd | dnolen: a number |
| 15:50 | dnolen | lsdafjklsd: if so you need to make sure that it can be converted into a cursor |
| 15:50 | lsdafjklsd | dnolen: well the key is a keyword, the value is a number |
| 15:52 | dnolen | lsdafjklsd: can you make a gist? |
| 15:52 | lsdafjklsd | dnolen: yea, super minimal |
| 15:54 | lsdafjklsd | dnolen: https://gist.github.com/lsdafjklsd/8324062 |
| 15:56 | lsdafjklsd | dnolen: this is the version that won't work, https://gist.github.com/lsdafjklsd/8324478 |
| 15:57 | lsdafjklsd | dnolen: it gets the projects passed to it, instead of having to get them itself |
| 16:07 | dnolen | lsdafjklsd: so the problem here is something that you just have to get used to in Om |
| 16:08 | dnolen | lsdafjklsd: you're passing the project-list to the next component and it's never changing |
| 16:08 | dnolen | lsdafjklsd: so Om isn't going to re-render it |
| 16:08 | dnolen | lsdafjklsd: that is the argument to project-list never changes |
| 16:08 | lsdafjklsd | dnolen: right ok |
| 16:09 | lsdafjklsd | dnolen: it's not going to re-render when a specific option changes |
| 16:09 | lsdafjklsd | dnolen: the main thing has to change |
| 16:09 | dnolen | lsdafjklsd: no |
| 16:09 | dnolen | lsdafjklsd: the arguments have to change or the state has to change |
| 16:09 | dnolen | lsdafjklsd: neither are changing for project-list |
| 16:10 | dnolen | lsdafjklsd: to illustrate what I mean, put :aid into a span in the root above project-list |
| 16:10 | dnolen | lsdafjklsd: you'll see it changes, but the list won't change |
| 16:10 | dnolen | because the list is never getting any new data |
| 16:11 | lsdafjklsd | dnolen: ya, and this is why in my original example the correct project would display in the detail view, but the active class would not show up in the list |
| 16:13 | lsdafjklsd | dnolen: thanks for taking the time to help me with this |
| 16:14 | dnolen | lsdafjklsd: the correct thing to do here would have been to set the state in project-list, not the app |
| 16:14 | dnolen | lsdafjklsd: let me fix it so you can see. |
| 16:15 | dnolen | lsdafjklsd: actually it just depends on whether you want to put that information in the app state or not |
| 16:15 | dnolen | lsdafjklsd: vs. component local state |
| 16:15 | lsdafjklsd | dnolen: i'd rather have it in the local state of the ul |
| 16:15 | mrhanky | where does lein cljsbuild place the goog/base.js? |
| 16:16 | dnolen | lsdafjklsd: ok changing it so you can see how to do this |
| 16:16 | mrhanky | i've setup a build-config to output the whole thing in several files, but it's missing goog.base now |
| 16:16 | lsdafjklsd | mrhanky: did you set an :output-dir? |
| 16:16 | mrhanky | yes |
| 16:17 | lsdafjklsd | mrhanky: try a lein cljsbuild clean |
| 16:17 | lsdafjklsd | mrhanky: and then build again |
| 16:18 | mrhanky | still no goog for me :( |
| 16:18 | lsdafjklsd | mrhanky: what's your optimization? |
| 16:18 | mrhanky | whitespace |
| 16:19 | lsdafjklsd | mrhanky: but there is a goog folder right? |
| 16:19 | sshack | So does anyone have any advice for when dealing with two different libraries which fail in different ways when using different versions of clojure.java.jdbc? korma fails with 0.3 migrates fails with 0.3-beta1 |
| 16:19 | lsdafjklsd | mrhanky: in your output-dir |
| 16:19 | seangrove | dnolen: set/get-state is for component-local state? |
| 16:20 | dnolen | seangrove: yes |
| 16:20 | seangrove | Perfect, handles a case I was struggling with |
| 16:20 | mrhanky | no lsdafjklsd, no goog dir |
| 16:21 | steerio | sshack: try downgrading/upgrading one of the libs |
| 16:22 | sshack | point. I've filed a bug with migratus already. |
| 16:22 | mrhanky | ah |
| 16:22 | lsdafjklsd | mrhanky: change omptimizations |
| 16:22 | mrhanky | yes |
| 16:22 | mrhanky | none did the trick :S |
| 16:22 | lsdafjklsd | mrhanky: to :none |
| 16:22 | lsdafjklsd | mrhanky: instead of :whitespace |
| 16:23 | lsdafjklsd | mrhanky: then do a lein cljsbuild clean |
| 16:27 | dnolen | lsdafjklsd: fixed, https://gist.github.com/swannodette/8324933 |
| 16:27 | dnolen | lsdafjklsd: you cond-> expression also had a bug, the second clause always succeeded |
| 16:27 | lsdafjklsd | dnolen: ok, and that was horrible anyway and needed refactoring :p |
| 16:28 | lsdafjklsd | dnolen: just didn't immediately know the best way, thanks |
| 16:33 | lsdafjklsd | dnolen: man, awesome |
| 16:34 | lsdafjklsd | dnolen: not sure why I couldn't think of this after like, 3 days |
| 16:35 | dnolen | lsdafjklsd: I've struggled longer than that :) |
| 16:35 | dnolen | lsdafjklsd: it's a simple model but pretty much completely different from what I'm or I guess anyone else is used to |
| 16:35 | lsdafjklsd | dnolen: that's encouraging, I watched you fly through the the sortable example |
| 16:35 | dnolen | lsdafjklsd: that one was particularly hard actually |
| 16:36 | dnolen | lsdafjklsd: missing features in Om and stuff, hopefully the example will save someone else some trouble |
| 16:36 | lsdafjklsd | dnolen: yea that thing is dense, trying to focus on building more instead of reading |
| 16:36 | lsdafjklsd | dnolen: this is the most fun i've had in a long time, reallly re-energized me |
| 16:36 | dnolen | lsdafjklsd: it's one of the hardest things you could build and I think not the type of thing most people need to do |
| 16:37 | dnolen | lsdafjklsd: and honestly it's a bit hacky, but the high level concepts there are more or less solid |
| 16:38 | dnolen | lsdafjklsd: passing view constructors around and channel communication, and handling lots of changing state |
| 16:38 | bbloom | dnolen: do you find that working with om, is more similar to working with the cljs compiler than with traditional UI approaches? :-) |
| 16:38 | dnolen | bbloom: writing the UIs? not really, working on Om itself kinda |
| 16:39 | dnolen | bbloom: the UIs feel remarkable like everything I like about OO except you can always see state transitions |
| 16:39 | dnolen | bbloom: no banging on fields |
| 16:39 | bbloom | yup |
| 16:40 | Clome | Can someone explain why tail recursion is a problem on the JVM. Can`t the reader analize the definition of a function and if it detects that it has all the propreties of tail recursive fn, it transformas it into an iteration? |
| 16:41 | bbloom | Clome: that would only work lexically |
| 16:41 | technomancy | Clome: tail recursion is not impossible, but full TCO is |
| 16:41 | justin_smith | java interop question: I want to get the headers for an imageio inputstream that may contain a format that java cannot read |
| 16:41 | Clome | whats the difference, and why do we need to use recur? |
| 16:41 | bbloom | Clome: clojure *could in theory* do that within a function for tail recursion, but not tail *calls* to other functions. |
| 16:42 | bbloom | Clome: clojure needs to know where tail positions are anyway, in order to give you an error if you don't write recur in the right place |
| 16:42 | justin_smith | currently my predicate "can-read?" catches format exceptions and returns false, but I would prefer to just check for the known formats and only read the header |
| 16:42 | justin_smith | because otherwise I am loading an image and throwing away the object (in cases where the format is fine) |
| 16:42 | bbloom | Clome: in theory, clojure could make all those things in to tail recursive calls, but doesn't b/c it takes the stance that explicit is better than implicit for whether or not your calls consume stack space |
| 16:43 | jcromartie | I keep running into this and then feeling afraid to ask: how can I check if a given value implements a protocol? |
| 16:43 | bbloom | (doc satisfies?) |
| 16:43 | clojurebot | "([protocol x]); Returns true if x satisfies the protocol" |
| 16:44 | tbaldridge | Clome: bbloom: but if it did, it would be super easy to shoot yourself in the foot. Consider a function with 2 arities, bouncing from one arity to the other would consume stack. |
| 16:44 | jcromartie | a ha |
| 16:44 | bbloom | tbaldridge: in theory, since multiple arities are statically defined together, you could do inlining too & that would work |
| 16:45 | bbloom | tbaldridge: but it's just not worth it :-) |
| 16:45 | tbaldridge | yeah |
| 16:45 | bbloom | i view tail calls as an effect anyway ;-) |
| 16:46 | tbaldridge | Although it's interesting to note that Erjang does all that and more. I wouldn't want to maintain that compiler, but sthat sort of stuff is possible. |
| 16:46 | bbloom | tbaldridge: well erlang's compilation unit is a module |
| 16:46 | alew | Ah ok, should write up a short bit about hooks in the docs |
| 16:47 | bbloom | tbaldridge: it doesn't need things like vars for live programming b/c it isolates state from code entirely & uses message sends to achieve the added level of indirection for live redefinitions |
| 16:47 | tbaldridge | yeah, it is a different problem. But from the point of view of the way core.async does things it was interesting to see how Erjang differs. |
| 16:48 | bbloom | tbaldridge: yeah, one major downside to channels is that they don't have names.... |
| 16:48 | seangrove | dnolen: Is there a way to clone a cursor in a render function to get its actual value, so I can refer to it in an onChange callback? |
| 16:48 | tpope | technomancy: let me know when you have some time to talk about nrepl-discover (lord knows I took my sweet time getting around to it) |
| 16:48 | tbaldridge | bbloom: sure they do, they're called pointers :-P |
| 16:49 | seangrove | dnolen: Or should I restrict myself to om/read |
| 16:49 | bbloom | tbaldridge: true story :-) |
| 16:49 | dnolen | seangrove: there's the om/bind conveneince |
| 16:49 | bbloom | tbaldridge: let me rephrase: their unique names are not "source stable" |
| 16:49 | dnolen | seangrove: but you need to make sure to double check your assumptions in the handler |
| 16:49 | tbaldridge | bbloom: true. although someone could build that via weakrefs (or not) and a hashmap. |
| 16:50 | dnolen | seangrove: i.e. that data could very well be gone when the handler fires |
| 16:50 | seangrove | dnolen: I suppose I should just do a om/read in the handler then |
| 16:51 | dnolen | seangrove: same difference really, that's what om/bind does |
| 16:51 | mrhanky | guys, is it possible that cljs.reader/read-string is not working as it should? |
| 16:51 | dnolen | mrhanky: definitely possible |
| 16:51 | mrhanky | oh great |
| 16:51 | dnolen | mrhanky: if you have a minimal case that should work that does not report in JIRA |
| 16:52 | mrhanky | i dont understand? |
| 16:54 | mrhanky | need it for escape characters |
| 16:54 | Clome | bloom: why would you prefer explictily write recur, and why inlining it is noth worth it |
| 16:55 | mrhanky | are there any working libraries which can display thinks like \newline or \u0040 correctly? |
| 16:56 | bbloom | Clome: inlining would add considerable complexity to the compiler & basically would only serve the purpose of local tail call recursion for multi-arity functions or letfn forms, not even generalized tail calls. it's just not worth the cost benefit |
| 16:56 | technomancy | Clome: if your algorithm depends on not consuming stack, you want the compiler to enforce it. if you didn't use recur, it would be easy to accidentally move the recursion to a non-tail position without realizing it |
| 16:56 | bbloom | Clome: i prefer to explicitly write recur b/c it's sometimes hard to eyeball if something is in tail position & i like to explicitly demand it |
| 16:57 | technomancy | tpope: sure, what's up? |
| 16:57 | tpope | technomancy: I've gotten vim talking to it as a proof of concept. a lot of feedback and not sure where to start |
| 16:58 | tpope | technomancy: I was thinking I might just go to town on samples.clj and let you have a look |
| 16:58 | technomancy | tpope: you mean writing your own ops? |
| 16:59 | tpope | technomancy: well for starters, tweaking yours |
| 16:59 | Clome | oh, now I see the benefit of writing explicitly recur |
| 16:59 | Clome | thanks |
| 16:59 | tpope | technomancy: there are some things I don't understand. like some of your ops take a filename but don't use it |
| 17:00 | dnolen | mrhanky: if you have some string that you think you should be able to read that you can't open a ticket with the failing string |
| 17:00 | tpope | technomancy: I can't get your jump-to to work. it seems to try to read a classpath relative filename and fails |
| 17:01 | technomancy | tpope: so the file arg is used in order to send a "clear overlays" command to the editor before running th etests |
| 17:01 | technomancy | man; I haven't worked on this since the conj; bit fuzzy on the details |
| 17:02 | tpope | technomancy: oh uh it's the "jpeg" op (and a couple of others I think) that ignore the file op |
| 17:02 | tpope | technomancy: probably just an oversight, which is fine. I can fix |
| 17:03 | tpope | technomancy: re: the overlay stuff, seems like you'd just want to use :file from the metadata, no? |
| 17:03 | tpope | technomancy: sorry, I'm all over the map here. like I said I'm not sure where to start |
| 17:04 | technomancy | tpope: sorry, got a meeting; bbiab |
| 17:04 | tpope | technomancy: sure I'll be around |
| 17:07 | logic_prog | http://lpaste.net/98203 <-- what am I doing wrong in this macro ? |
| 17:07 | Clome | I still can`t understand why you can`t transform every recursive code without consuming stack. I mean, in mathematics you can do it, recursion is just another type of iteration. Are there no efficient algorithms that can transform recursive code into iterative or is the issue bigger then I am making it to be, and I should shut up:D |
| 17:08 | bitemyapp | logic_prog: why does that need to be a macro? |
| 17:08 | logic_prog | bitemyapp: becuse capturing variable names |
| 17:08 | bitemyapp | Clome: it's a logistical problem related to the JVM |
| 17:08 | logic_prog | [:rect x y] <-- this binds x, y |
| 17:08 | bitemyapp | Clome: you can do TCO on the JVM, but it makes certain use-cases slower because of the JVM's limitations and makes it harder to make interop play nice. |
| 17:09 | bbloom | Clome: http://stackoverflow.com/questions/3616483/why-does-the-jvm-still-not-support-tail-call-optimization |
| 17:09 | meltingw1x | can anyone help me with this exception (trying to set up dbs in luminus) http://pastebin.com/mF42jins |
| 17:09 | bitemyapp | Clome: it would be more likely to happen if it was a native JVM faculty that played nice with Java. |
| 17:10 | bitemyapp | Clome: otherwise, you have to be okay with having code in your language be potentially difficult to call into without invoking runtime overhead. |
| 17:10 | bitemyapp | but if you're okay with slapping a $BRAND_X.lang.RT wrapper around everything, then yeah, you can totes do TCO. |
| 17:11 | bitemyapp | Clome: http://stackoverflow.com/questions/10008673/does-frege-perform-tail-call-optimization |
| 17:12 | bitemyapp | Clome: Frege is implemented on the JVM. |
| 17:14 | Clome | thanks for the links |
| 17:16 | wink | I am torn if I should be amused or bewildered by the fact that I know about Frege and also about TCO on the JVM |
| 17:17 | wink | bitemyapp: your randomness of interesting facts will not prevail! |
| 17:19 | bitemyapp | wink: yes but now I must be crucified for using a typed language to teach something. |
| 17:19 | bitemyapp | wink: get out the dogwood cross, nails, and hammer. |
| 17:19 | technomancy | Clome: there are schemes that do TCO, but it means a function call is more than just a method call |
| 17:20 | justin_smith | meltingw1x: your ns form is messed up |
| 17:20 | bitemyapp | nDuff: martyrdom either way. |
| 17:20 | justin_smith | switch use for :use and take the ' forms out |
| 17:20 | bitemyapp | wink: Frege is an uncommonly good way to learn about how to implement functional languages on the JVM. |
| 17:20 | justin_smith | also you want only one :use clause |
| 17:20 | bitemyapp | wink: the various Schemes that technomancy alluded to are good for that as well. |
| 17:20 | nDuff | ...publicly assume the worst and you make it tempting to fulfill that expectation. :) |
| 17:21 | wink | bitemyapp: that ups it a little on my "sorted languages by interest" list :P |
| 17:21 | bitemyapp | nDuff: <3 |
| 17:21 | justin_smith | meltingw1x: you should put both namespaces you are using in a vector and specify :use as a keyword, like you did with :require |
| 17:22 | technomancy | tpope: so yeah... I'm less interested in the actual implementations of the sample ops and more interested in how easy they are to interface with othe editors |
| 17:22 | justin_smith | meltingw1x: and finally, :use is bad and you should :require :as or at most :require :refer (but this is a preference / design thing, not an error) |
| 17:23 | justin_smith | meltingw1x: the bad ns form causes the totally useless error message you got |
| 17:23 | justin_smith | worse than useless, actually an incorrect error string |
| 17:24 | tpope | technomancy: oh for sure |
| 17:25 | tpope | technomancy: the "file" parameter in particular raises the question for me of if I'm supposed to prompt for it or just grab it from the current buffer or what |
| 17:26 | technomancy | tpope: yeah... I'm starting to wonder if those shouldn't be two distinct argument types |
| 17:26 | technomancy | current-file vs prompt-file or something |
| 17:26 | tpope | technomancy: and thinking it through, I'm wondering if it's really necessary at all. I mean what happens if I send mismatched file/ns parameters |
| 17:27 | tpope | feels like file/ns should be either/or |
| 17:27 | technomancy | yeah, ns is more high-fidelity in a way |
| 17:28 | technomancy | but if you had an op that took csv data or something, you'd still need to prompt for a file |
| 17:28 | technomancy | but maybe that means there's no need for a current-file arg |
| 17:29 | tpope | yeah that sounds right |
| 17:30 | tpope | if I get back a class path relative file (i.e., from the :file metadata), I can match it up to an actual buffer |
| 17:31 | technomancy | annoyingly enough namespaces don't have file metadata |
| 17:31 | technomancy | so you have to just grab their first var |
| 17:32 | tpope | in the case of the test runner, couldn't you just grab it on a per test basis? |
| 17:32 | tpope | I guess that leaves the question of what to clear open |
| 17:32 | technomancy | yeah you should be able to grab the filename from the test var; not sure why I didn't do that |
| 17:33 | tpope | I'm also thinking of namespaces split across multiple files. although hopefully nobody does that for test namespaces |
| 17:33 | steerio | is that a thing? |
| 17:33 | technomancy | I am 100% ok not supporting that |
| 17:33 | tpope | steerio: clojure.core itself does, among others |
| 17:34 | tpope | seems especially silly for a test |
| 17:35 | hiredman | also the opposite, a file with multiple namespaces |
| 17:36 | hiredman | or vars not defined via def in a file |
| 17:36 | tpope | are you just trying to troll technomancy |
| 17:36 | hiredman | no |
| 17:37 | tpope | hey I hear SOME PEOPLE use top level forms that aren't a def! |
| 17:37 | hiredman | I would link to an example but github has decided to 404 |
| 17:38 | tbaldridge | tpope: doesn't every single defn do that? |
| 17:38 | tpope | I mean def in general not the special form in particular |
| 17:38 | tbaldridge | , (macroexpand '(defn foo "hey" [] 42) |
| 17:38 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 17:38 | meltingw1x | justin_smith: whats wrong with my ns now? still getting the same error: http://pastebin.com/QF4KyK6j |
| 17:38 | tbaldridge | , (macroexpand '(defn foo "hey" [] 42)) |
| 17:38 | clojurebot | (def foo (clojure.core/fn ([] 42))) |
| 17:38 | hiredman | I was just the other day looking at hiphip (array library) to replace the gross way they parameterize the code in namespaces on primitive types |
| 17:38 | tbaldridge | nah, it's something else, something does def in a do. |
| 17:39 | Bronsa | tbaldridge: defrecord, deftype, defmacro |
| 17:39 | justin_smith | meltingw1x: odd, that looks fine |
| 17:39 | tbaldridge | hiredman: there has to be a better way than the way they do that. |
| 17:39 | hiredman | and my solution ended up with a macro that would generate each parameterized namespace from a single file |
| 17:39 | hiredman | tbaldridge: yes |
| 17:39 | hiredman | it is so gross |
| 17:40 | meltingw1x | justin_smith: even when the file is just the (ns ...), i still get the same error |
| 17:40 | justin_smith | and the directory tree there is in the runtime classpath? |
| 17:40 | tpope | technomancy: you saw my belated reply on the mailing list right? with the overlay and position commentary? |
| 17:41 | justin_smith | meltingw1x: lein classpath helps verify that if you are using lein |
| 17:41 | hiredman | justin_smith: he has an extra directory |
| 17:41 | justin_smith | ahh yeah he does |
| 17:42 | technomancy | tpope: which list? |
| 17:42 | justin_smith | meltingw1x: either move the contents of zonu up one level, or add src/zonu to the resource-paths in project.clj |
| 17:42 | justin_smith | *source-paths, sorry |
| 17:43 | tpope | technomancy: clojure-tools. the content negotiation thread |
| 17:43 | hiredman | and why is he aot compiling anything anyway |
| 17:43 | hiredman | etc etc |
| 17:43 | technomancy | tpope: doesn't look like it went through |
| 17:43 | tpope | technomancy: oh, shit, no wonder you didn't reply |
| 17:44 | tpope | technomancy: sec, I'll resend |
| 17:46 | hiredman | hey, it is working |
| 17:47 | hiredman | https://github.com/hiredman/hiphip/blob/foo/src/hiphip/impl.clj is an example of a single file generating multiple namespaces |
| 17:51 | tpope | technomancy: okay, I *think* I posted it. (google groups, man.) my first point was that line/column is much easier for me to deal with than character offset |
| 17:53 | meltingw1x | justin_smith: the namespace needed to be zonu.models.db, not just models.db |
| 17:56 | justin_smith | yeah, that's another way to do it |
| 17:59 | mrhanky | is it right, that closure compiler can use, lets say "lib/foo.js" als library - and will it get compiled into the files? |
| 18:09 | technomancy | tpope: it's not getting delivered or showing up in the web ui, but the "N replies" count on the web UI is going up |
| 18:09 | technomancy | so I assume it's from google groups just sucking horribly |
| 18:11 | tpope | technomancy: I did another email attempt (with a different return address that I think was also wrong) and one via the web |
| 18:12 | tpope | technomancy: the latter mentioned something about approval |
| 18:12 | technomancy | I wish librelist were actually getting active attention so I could bug people to flee google for good |
| 18:13 | tpope | technomancy: ANYWHO other than the line/col thing, my other point was that a fail/error/pass semantic might be better than red/orange/green |
| 18:13 | bitemyapp | technomancy: what about Mailan? |
| 18:13 | bitemyapp | er, Mailman* |
| 18:15 | tpope | technomancy: and that in vim, you can do the line highlight thing, but a more conventional mechanism would be to load all the results up into the "quickfix" list: filename/line/col/type/etc data that vim provides mechanics for navigating |
| 18:15 | technomancy | tpope: hm... the thing about the fail/error/pass semantic value is that it requires a lot more coordination. who defines the full list of valid values? what if someone comes up with something new? |
| 18:16 | tpope | technomancy: point taken, though that's true to a lesser extent about colors too (console vim doesn't know what orange is) |
| 18:17 | technomancy | hex colors should be pretty unambiguous though |
| 18:17 | tpope | unambiguous but even harder to deal with in console vim |
| 18:17 | tpope | could we send both? semantic and suggested color |
| 18:18 | technomancy | for tests, sure. but that's not a general-purpose mechanism anymore; it's become something specific to tests. |
| 18:18 | tpope | so maybe a separate test discussion is in order |
| 18:19 | tpope | but putting that aside, what other use cases did you have in mind? |
| 18:19 | tpope | maybe lein-kibit or something? |
| 18:20 | technomancy | well, on the totally-out-there axis I could see this becoming a sort of UI toolkit where people could write general-purpose software in an nrepl server and have clients provide UIs |
| 18:21 | technomancy | so you could have a mail client written in clojure that could easily have a vim, emacs, and eclipse UI |
| 18:21 | technomancy | but more practically, yeah dev tools like linters and core.typed could make use of it |
| 18:22 | technomancy | actually I would like to replace most of cider's commands with server-side eqivalents instead of having stuff hard-coded in elispu |
| 18:22 | tpope | linters seem similar to test runners in that there's also a semantic, and even an error message/other annotation worth capturing |
| 18:23 | tpope | yeah I like that idea for sure |
| 18:23 | technomancy | yeah, if you restrict it to dev tooling you could probably come up with a limited set of semantic tags |
| 18:23 | technomancy | I have a feeling it could be bigger than that, but I'm aware it's at least mildly quixotic |
| 18:25 | tpope | yeah, I'm favoring separating the concerns then |
| 18:25 | tpope | I'd rather test/linter/tooling stuff go in the quickfix, but I could still see providing overlay support for other operations |
| 18:26 | tpope | in particular, regardless of vim specifics, providing some sort of way to convey a collection of locations/annotations decoupled from ui representation seems useful |
| 18:27 | tpope | for that matter, the same mechanic could pontentially be used for stack traces |
| 18:29 | technomancy | oh, neat idea |
| 18:29 | technomancy | you could send a stack trace as a list of lines where each line could have its own tag |
| 18:30 | technomancy | so the editor gets the full-fidelity trace but only shows a subset till the rest are requested |
| 18:30 | tpope | hot |
| 18:31 | TimMc | Where do I send my Bitcoins? :-P |
| 18:31 | technomancy | so yeah, given that the fail/error semantics are more broadly applicable than just tests I'm fine canonizing those in the spec |
| 18:33 | tpope | there's also warning, maybe |
| 18:34 | technomancy | yeah, sure |
| 18:36 | Clome | can I give ^:dynamic proprety to a function at run time? |
| 18:37 | bitemyapp | Clome: try it! |
| 18:38 | Clome | how? |
| 18:38 | clojurebot | with style and grace |
| 18:39 | jarofghosts | does anyone have recommendations for good beginner resources? |
| 18:40 | mysamdog | jarofghosts, Clojure Programming by Chas Emerick, Brian Carper, and Christophe Grand is a great book. |
| 18:41 | jarofghosts | !m mysamdog |
| 18:41 | jarofghosts | err |
| 18:41 | jarofghosts | i mean thanks |
| 18:41 | jarofghosts | ! |
| 18:41 | jarofghosts | will check it out |
| 18:43 | mysamdog | And while not exactly a beginner resource, this channel is very helpful. |
| 18:44 | Cr8 | Clome: you can def over it, but any fns that were compiled when it wasn't dyamic won't pick up the dynamicness |
| 18:44 | Cr8 | https://www.refheap.com/22635 |
| 18:44 | jarofghosts | nice, i want to build a good foundation and try things out before i bother anyone in here though |
| 18:44 | justin_smith | Cr8: wouldn't alter-meta! work for that? |
| 18:45 | jarofghosts | but i did take the shortcut of procuring a good resource! |
| 18:45 | Clome | I am tringto use build in map with dotrace, but it needs to be dynamic. |
| 18:45 | Cr8 | justin_smith: you can alter-meta! as well but it wouldn't change the behavior |
| 18:45 | justin_smith | oh, for some reason I thought the behavior was set by the metadata, but the metadata is just there as a convenience? |
| 18:46 | Cr8 | justin_smith: the behavior *is* set by the metadata |
| 18:46 | Cr8 | but |
| 18:46 | Cr8 | if the :dynamic flag isn't true when a fn that refs the var is compiled |
| 18:46 | Cr8 | that fn will only see the root binding |
| 18:47 | justin_smith | ahh, ok |
| 18:48 | Cr8 | that is, you can alter-var-root the foo var |
| 18:48 | Cr8 | and the old getfoo will pick up the new root |
| 18:48 | Cr8 | but it won't pick up any binding |
| 18:48 | Cr8 | because it wasn't compiled to be binding-aware |
| 18:51 | Cr8 | or: the :dynamic more affects compilation, and (binding) just yells at you when trying to bind over a var that isn't dynamic because it knows it won't do anything =P |
| 18:51 | tpope | technomancy: is there a reason you're sending back structured data as lists (file line color) rather than some sort of map? {:file file :line line :color color} |
| 18:52 | tpope | technomancy: i.e. a technical constraint of some sort |
| 18:58 | technomancy | tpope: for a few things I was sending just a 2-tuple of file/position and a list seemed fine for that |
| 18:58 | technomancy | but once there's more than two elements a map is probably better |
| 18:58 | tpope | yeah that's my thought too |
| 18:58 | tpope | I'm gonna find some time to play and see what I can come up with |
| 19:00 | technomancy | great |
| 19:00 | VFe | Using a regex with re-find, http://regexr.com?37u3a Shows it as valid, but when I use re-find the output ends at fourth line, right after Mscorcfg. Anyone have any ideas why that's the case? |
| 19:35 | LusciousPear | Hmmm... hello? Anyone I know in here? :p |
| 19:38 | technomancy | LusciousPear: what are the haps |
| 19:38 | LusciousPear | @technomancy Whatup! Haven't heard from you in forever. |
| 19:38 | bitemyapp | LusciousPear: are you a PNW'er? |
| 19:39 | LusciousPear | @bitemyapp I was a Seattleite for 6 years, but moved to SF for 'startup stuff' last year |
| 19:41 | bitemyapp | LusciousPear: I'm thinking of going in the opposite direction. I've been in SF for 3 years. |
| 19:41 | bitemyapp | NYC for 2.5 years prior. |
| 19:41 | LusciousPear | @bitemyapp flee while you can. I miss the PNW |
| 19:41 | bitemyapp | LusciousPear: yeah, that's what people who've migrated in both directions told me. |
| 19:42 | bitemyapp | LusciousPear: I work at a startup but I've got the green light to go remote. |
| 19:42 | sritchie | bitemyapp: move to Boulder! |
| 19:42 | LusciousPear | @bitemyapp my first startup was a distributed DB company, and I wanted everyone to be under one roof in SF. but now I'm doing a mobile app, so I don't really care where anyone lives :p |
| 19:42 | bitemyapp | sritchie: I like trees, water, and moisture. And the politics there are a bit incompatible to me. |
| 19:43 | teslanick | Is the west everything I've heard it could be? I live in the frozen northeast, and I'm a bitter yankee. |
| 19:43 | bitemyapp | sritchie: part of the reason I am leaving the Yay is to "vote with my feet". |
| 19:43 | sritchie | gotcha |
| 19:43 | bitemyapp | teslanick: I'm originally from Ohio and then NYC, I like the west coast. But it all depends on you and your personality. |
| 19:43 | technomancy | moisture is kind of important |
| 19:43 | bitemyapp | it really is. I have trouble breathing as it is. |
| 19:44 | teslanick | Well, in the winter I do too, from the cold you see. |
| 19:44 | LusciousPear | @teslanick I've lived both coasts. the west has great food, perfect weather, and is laid back and nerdy. the east coast is more 'get shit done omg'. your mileage my vary. |
| 19:45 | bitemyapp | that was my experience as well, but the midwest offers something else entirely. |
| 19:45 | bitemyapp | the midwest is very chill and more sincere than the west coast. |
| 19:45 | LusciousPear | @bitemyapp I can believe that. |
| 19:45 | bitemyapp | LusciousPear: it's insanely easy to make really good friends in Ohio, even in the cities. |
| 19:45 | bitemyapp | Michigan too. |
| 19:46 | bitemyapp | people in cities like Detroit are 1,000x nicer than NYC. |
| 19:46 | arrdem | bitemyapp: 12.974 |
| 19:46 | LusciousPear | @bitemyapp What is a 'friend'. Is that someone who introduces you to a VC? I don't understand ;p #sf |
| 19:46 | bitemyapp | arrdem: do you have that on a macro? |
| 19:46 | arrdem | bitemyapp: my hatred for humanity is at an all time high. |
| 19:46 | bitemyapp | arrdem: one more game. |
| 19:46 | bitemyapp | arrdem: ONE MORE |
| 19:46 | teslanick | I was going to ask a JS-y question. I'm reimplementing Bagwell's array-mapped hash trie, and I'm trying to decide if it's worth optimizing it for fast access in the ASCII range of characters for keys, or if that's terribly eurocentric of me. |
| 19:46 | bitemyapp | LusciousPear: lack of friends is a big part of why I'm leaving the Yay. I had more friends in NYC by a huge margin. |
| 19:46 | teslanick | Insert "in javascript" at some point in that previous statement. |
| 19:47 | bitemyapp | teslanick: I'd call it inadvisable rather than merely eurocentric. |
| 19:47 | bitemyapp | I don't like speculative optimization. |
| 19:47 | LusciousPear | @bitemyapp I seem to have a lot more friends in NYC than SF, but I'm not sure if that's just because I'm always heads down here. |
| 19:47 | bitemyapp | teslanick: https://github.com/jml/perfidy seen this? |
| 19:47 | bitemyapp | LusciousPear: I worked equally as much in both places and I had more friends in NYC, if that counts for anything. |
| 19:47 | arrdem | LusciousPear: I think it's that everyone is heads down in the Bay but that's just my perception. |
| 19:48 | bitemyapp | I don't it's that at all. |
| 19:48 | bitemyapp | Even the people that have a leisurely work week are pretty isolated. |
| 19:48 | bitemyapp | relationships in the Bay Area scoped to some kind of static context and acquaintances rarely break out of that sandbox. |
| 19:48 | teslanick | The reason I'm thinking about it is that I can count on zero hands the number of times I've seen non-ASCII-range keys for objects. |
| 19:49 | bitemyapp | teslanick: I think it's weord that you even assume stringly keys. |
| 19:49 | bitemyapp | teslanick: I key based on hashable objects rather than strings all the time. |
| 19:49 | bitemyapp | that's partly why Python makes me so fucking mad. |
| 19:49 | teslanick | It's javascript. Hashable objects are a nonstarter. |
| 19:50 | bitemyapp | well, a lot of things are a nonstarter when you live in a ghetto environment like that. |
| 19:50 | LusciousPear | So Clojure-wise,I'm new to the lang. I'm building typical api-driven mobile app. Is there a list of 'preferred libraries' everyone uses? So far I'm using Compojure and Clauth. I'm at that learning stage where if I can see all the pieces everyone uses, I can start to get a picture of the ecosystem in my head. |
| 19:50 | bitemyapp | LusciousPear: the easiest way to become comfortable, is to simply grok Ring and the way functional middleware works. |
| 19:50 | LusciousPear | I've only done distributed db stuff for the past five years, so I literally have no idea what the 'state of the art' is. |
| 19:50 | bitemyapp | LusciousPear: once that's in your head, then you can derive how everything else. |
| 19:50 | LusciousPear | @bitemyapp Yeah, I really like ring so far. |
| 19:50 | bitemyapp | else works. |
| 19:51 | bitemyapp | LusciousPear: well, the main alternative to the Ring way of doing things is Pedestal, but I don't think that's necessarily a good fit for an API serving a mobile app. |
| 19:52 | LusciousPear | Considering the eldritch horror that was APIapp dev in my Java and .NET days, this is like a revelation from the heavens |
| 19:52 | bitemyapp | LusciousPear: it bears a strong resemblance to Flask in Python and WAI in Haskell. |
| 19:52 | bitemyapp | / WSGI |
| 19:52 | noonian_ | LusciousPear: there are a lot of libraries that build on top of ring, for api's there is liberator, but you might try making a simple api on your own first just using functions and some middlewares for converting between edn and json |
| 19:52 | teslanick | bitemyapp: It's not a great environment, but it's ubiquitous. It's also the lingua franca of web UI developers everywhere. |
| 19:53 | bitemyapp | teslanick: in my CLJS and Fay-using eyes, it's an output for my compiler. |
| 19:53 | bitemyapp | teslanick: beneath the dignity of human programmers :) |
| 19:53 | bitemyapp | teslanick: but I understand the constraints and why you're sometimes forced to grapple with it :) |
| 19:54 | LusciousPear | @noonian_ yeah, I started looking at liberator but I can't quite figure out where it is in my mental model, since it basically seems like decoration on what I'd do with compojure. but I haven't thought deeplyon it. |
| 19:55 | bitemyapp | LusciousPear: I tried to make Liberator work, but customizing behavior on things like content negotiation and output was WAY harder than simply writing the "obvious" middleware. |
| 19:55 | bitemyapp | LusciousPear: luckily, some of the work I do at my company, I open source! Have a look-see: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/middleware.clj |
| 19:55 | teslanick | bitemyapp: I don't totally disagree with the sentiment, but good luck finding someone who can scrape together a decent UI design that also can write CLJS, and will work for a company that writes enterprise software. I'm pretty sure that population is pretty close to zero. |
| 19:55 | noonian_ | yeah, i'm just starting with liberator and have only used it for very simple things so far |
| 19:56 | bitemyapp | teslanick: why are UI people writing code? |
| 19:56 | teslanick | Because UIs are written in code? |
| 19:56 | bitemyapp | teslanick: so they're coders but don't take coding seriously? |
| 19:56 | bitemyapp | noonian_: that fell apart for me pretty fast. |
| 19:56 | bitemyapp | a relatively simple use-case turned into an absolute nightmare. |
| 19:56 | bitemyapp | noonian_: contrast with that simple middleware.clj file. |
| 19:58 | noonian_ | bitemyapp: i was going to look at it for helping to enforce authorization rules for different endpoints, my attempts to do that using friend have been pretty messy so far |
| 19:58 | akhudek | teslanick: we had no trouble finding someone exactly like that. |
| 19:58 | bitemyapp | noonian_: I avoid Friend too... |
| 19:59 | LusciousPear | I tried to get into Friend, and it looks comprehensive, but also really complex |
| 19:59 | bitemyapp | teslanick: supposition vs. data? :) |
| 19:59 | teslanick | akhudek: How about dozens of them? |
| 19:59 | bitemyapp | teslanick: considering how many UI people you can replace with a single CLJS coder... |
| 19:59 | akhudek | teslanick: well, we had dozens of applications, many looked good. |
| 19:59 | bitemyapp | teslanick: but seriously, you're getting silly now. Surely there are plenty of competent frontend people that want to learn better languages. |
| 19:59 | bitemyapp | teslanick: I think I know the person he refers to, and he is an excellent and eager learner. |
| 19:59 | teslanick | Agreed, but there's a lot of moving parts to get that to hapepn. |
| 20:00 | bitemyapp | teslanick: I've gotten that same person started on some Haskell recently, which only scarcely has any relevance to his day job. :) |
| 20:00 | bitemyapp | teslanick: it's always easier to come up with reasons you shouldn't take the high road. |
| 20:00 | bitemyapp | teslanick: I'd rather be one of the people trying things to see what can be made to work. |
| 20:00 | teslanick | Hey, I'm a UI developer who's sitting somewhere in the kiddie pool side of Clojure. So I'm not saying they don't exist |
| 20:00 | bitemyapp | including hiring people to learn new things. |
| 20:01 | bitemyapp | teslanick: well, one of my pet projects right now is teaching people things like Haskell and Clojure, especially people you wouldn't conventionally expect to want to learn such things. |
| 20:01 | bitemyapp | teslanick: my experiences so far make me skeptical of the pessimism you're exhibiting. |
| 20:02 | noonian_ | it can't be THAT easy to get a job using Clojure that Clojure programmers would pass up a job just because it's with a company that ships enterprise software |
| 20:03 | bitemyapp | hum. A job that got posted recently for a company in Singapore that needed to fill 6 Haskell positions got something like ~60 applicants based mostly on a Reddit post. |
| 20:03 | bitemyapp | and that's for something in SEA. |
| 20:03 | bitemyapp | and it was for relatively boring work. |
| 20:03 | teslanick | But it's a chicken-egg thing. You gotta get a big organization willing to sign off on a cljs/clj stack for new development, which means a rolling rewrite of existing software or greenfield project, and get all the people who work on it into a new language. It's definitely not easy. |
| 20:03 | bitemyapp | Porting a PHP app to Haskell. |
| 20:03 | bitemyapp | there's no chicken or egg here. |
| 20:04 | bitemyapp | They decided to port their PHP web app to Haskell, they posted an ad, and got a ton of applications. |
| 20:04 | bitemyapp | it seems to me to be pretty easy to test the waters for interest in the project you have in mind by simply posting the project and tech involved. |
| 20:04 | bitemyapp | Startups do it all the time for validating their entire business model/product. |
| 20:05 | bitemyapp | teslanick: it's pretty hard to beat the averages if you're making the same decisions as the average company/ |
| 20:05 | bitemyapp | teslanick: I'd rather take risks and try to surround myself with more driven people that want to learn. |
| 20:06 | bitemyapp | teslanick: Haskell and Clojure both have a pretty good track record of having been used happily at companies of a pretty good range of sizes. |
| 20:06 | bitemyapp | so it's not even like you'd be using something unproven, you're just making excuses for Blub decision-making. |
| 20:08 | akhudek | bitemyapp: on a different topic, did you see our little database experiment? https://github.com/diligenceengine/edl |
| 20:09 | bitemyapp | akhudek: not yet, but I'm looking now. |
| 20:09 | bitemyapp | akhudek: this sounds really neat! |
| 20:10 | akhudek | bitemyapp: there is a lot I like about it, but I'm not yet sure where to go with it |
| 20:10 | bitemyapp | akhudek: on the topic of optimization, one of the best ways to go there is to analyze cardinality and sequencing of indexes used. |
| 20:11 | bitemyapp | akhudek: well if you can layer a sufficiently expressive (equal to SQL?) way of building queries on top of it, it could hypothetically be an alternative to Korma, no? |
| 20:11 | akhudek | bitemyapp: that's one possibility |
| 20:12 | akhudek | bitemyapp: the part I'm not sure about is, is the korma style really the best way to solve the problem? |
| 20:12 | bitemyapp | akhudek: I think there are a multitude of ways to improve on Korma. |
| 20:13 | bitemyapp | akhudek: but, you have to be careful about diverging from the semantics of the underlying query language. I've seen that fail too (Haskell Persistent, people ended up using Esqueleto which is like Korma and Squeryl) |
| 20:13 | akhudek | bitemyapp: yeah, that's the big problem. Proposing to replace sql would require *really* good reasons |
| 20:14 | bitemyapp | akhudek: the best reason I've seen so far was Datalog, which is capable of being more expressive than SQL but that still introduces massive pain when you want to do something like an outer join. |
| 20:15 | bitemyapp | akhudek: SQL semantics generally make practical projects the least painful, my interest is in type-safe, efficient, and *composable* SQL that lines up with the schema. |
| 20:16 | akhudek | bitemyapp: so there are two parts here, on the one hand, we could create a compile-time type safe honeysql or the like (probably just an add-on for honeysql), and on the other are macros like get-record which provide a more concise dsl for some queries |
| 20:18 | akhudek | bitemyapp: I think a type safe honeysql is all around good, but I'm unsure about the extra dsl aspects. |
| 20:20 | bitemyapp | akhudek: there are aspects of SQL that are tedious. |
| 20:21 | bitemyapp | akhudek: the part where libraries like this really bites you is when you need to specifically express some weird SQL syntax notation or suffix because you're talking to a really stupid SQL database like Oracle. |
| 20:21 | bitemyapp | akhudek: that's why arbitrary-SQL DSLs are popular. |
| 20:21 | bitemyapp | they prevent you from becoming stuck because of something like that. |
| 20:22 | akhudek | bitemyapp: yep, I know we've used postgres specific extensions frequently |
| 20:22 | bitemyapp | akhudek: it's 50/50 whether it's a PostgreSQL extension or an Oracle oddity that somebody complains about with Korma. |
| 20:24 | bitemyapp | akhudek: maybe a meta-DSL that lets you integrate the generation of custom query-strings into the greater family of defaults? |
| 20:25 | akhudek | bitemyapp: honeysql does that, but it's not very concise considering it's exactly sql |
| 20:25 | akhudek | bitemyapp: I thought briefly about a dsl that used honeysql fragments or something, but didn't get very far |
| 20:26 | bitemyapp | akhudek: I would encourage looking at what the Haskell community has tried here as a source of what might/might not work. Primarily Persistent, Esqueleto, and HaskellDB. |
| 20:26 | bitemyapp | akhudek: http://blog.felipe.lessa.nom.br/?p=68 |
| 20:27 | bitemyapp | The esqueleto would probably look ugly to a Clojurian's eyes, but you get the idea. |
| 20:27 | bitemyapp | akhudek: you can see how it's programmable/composable SQL. |
| 20:27 | bitemyapp | one difference is that it's a bit higher level than HoneySQL |
| 20:27 | bitemyapp | but not necessarily schema-aware. |
| 20:27 | meltingw1x | can anyone explain to me why this for loop over a PersistentVector isn't working? http://pastebin.com/YFr5gDqD |
| 20:27 | bitemyapp | you could hypothetically unify those properties. |
| 20:28 | bitemyapp | meltingw1x: for is lazy yo. |
| 20:28 | bitemyapp | meltingw1x: if you want to do something for side effects, look for a function/macro with the word "do" in the name. |
| 20:28 | akhudek | bitemyapp: thanks, I'll take a look at these. |
| 20:28 | bitemyapp | meltingw1x: the code in the body of "for" never executes if I'm understanding correctly. |
| 20:28 | meltingw1x | bitemyapp: thank you very much |
| 20:28 | meltingw1x | yes |
| 20:29 | bitemyapp | meltingw1x: map and filter are lazy too. |
| 20:42 | darthdeus | how can i do this the right way? (let [xs '(1 2 3)] (+ xs)) |
| 20:42 | darthdeus | i'm getting "Cannot cast clojure.lang.PersistentList to java.lang.Number" |
| 20:44 | bbloom | ibdknox: please prefix your github project names! |
| 20:44 | bbloom | ibdknox: before it's waaaayy too late to do so, add a "LightTable-" or "lt-" prefix or something like that |
| 20:45 | bitemyapp | this is why I choose weird names. Nobody's going to mistake berossus for anything but what it is. |
| 20:45 | bitemyapp | brownie points to whoever knew off the top of their heads who that was. |
| 20:45 | bbloom | ibdknox: If I were to fork LightTable/Vim, I'd have BrandonBloom/Vim, which would be quite misleading |
| 20:46 | amalloy | darthdeus: (apply + xs) |
| 20:46 | bitemyapp | ,(reduce + '(1 2 3)) |
| 20:46 | clojurebot | 6 |
| 20:46 | darthdeus | jjthat gives me Attempting to call unbound fn: #'user/apply |
| 20:46 | bbloom | ibdknox: you've got ~20 forks on stuff besides the main project now. the sooner you rename, the less painful it will be :-) |
| 20:46 | bitemyapp | ,(+ '(1 2 3)) ;; :( |
| 20:46 | clojurebot | #<ClassCastException java.lang.ClassCastException: Cannot cast clojure.lang.PersistentList to java.lang.Number> |
| 20:47 | darthdeus | amalloy: hm weird, it seems to work in the lein repl, but not inside lighttable live mode |
| 20:48 | bbloom | ibdknox: in fact, if i fork your Clojure project, github calls it BrandonBloom/Clojure-1 |
| 20:48 | bbloom | *sigh* |
| 20:49 | bitemyapp | Clearly should've named the plugins after DC Comics superheroes. |
| 20:49 | amalloy | darthdeus: that surprises me a little, but there are a lot of things that break in lighttable's live thingy, apparently |
| 20:50 | bitemyapp | oh, LT user. Right. Giving up now. |
| 20:50 | muhoo | bbloom: transduce is interesting. i'd been doing stuff like it using reduce instead. https://www.refheap.com/22642 thanks for a new way of looking at it. |
| 20:51 | bbloom | muhoo: yeah, i generally use reduce when i don't want to suck in a dep or copy paste these little functions. the distinction is about the fact that reduce is eager & transducers can be chained together to execute interleaved |
| 20:51 | darthdeus | bitemyapp: huh? |
| 20:51 | bitemyapp | For any curious: http://hackage.haskell.org/package/fst https://github.com/brandonbloom/transduce http://www.cse.chalmers.se/alumni/markus/fstStudio/ |
| 20:52 | bitemyapp | Particularly for a high level overview of the "grammar": http://hackage.haskell.org/package/fst-0.10.0.0/docs/FST-FSTStudio.html |
| 20:59 | arrdem | bitemyapp: I suppose that's one scheme for never running out of names... |
| 21:08 | Squee-D | ibdknox you rock man. Not just because I really like Light Table, but because your source is going to help me get started with clojure and node webkit |
| 21:09 | bitemyapp | arrdem: what can I say, I solved one of the two hard problems in CS> |
| 21:09 | bitemyapp | arrdem: now I just need to make a library for cache invalidation via dependency graphs. |
| 21:10 | logic_prog | for the semantics of alt!, is (alt! [chan1 chan2]) always nil when chan2 is a closed channel? |
| 21:10 | logic_prog | i.e. does a closed channel = infinite stream of nil ? |
| 21:17 | stcredzero | Howdy folks. (Particularly utexas folks) Does anyone here understand Ring sessions? |
| 21:18 | arrdem_ | /nick arrdem |
| 21:18 | bitemyapp | stcredzero: I've hacked on many Ring sessions implementations, but that also means I'll need you to get more specific. |
| 21:18 | bitemyapp | stcredzero: are you asking for a generic Ring approach to sessions? (In which case, you'll need to specify whether you mean kicking state across the request lifecycle or attaching user state to requests themselves) |
| 21:19 | bitemyapp | stcredzero: or are you referring to something specific, like the libnoir stuff? |
| 21:20 | stcredzero | bitemyapp: Just how do I attach state to a session that I can get back at the next request? I've read almost a dozen blog posts and I'm still as confused as I was when I started. |
| 21:20 | bitemyapp | stcredzero: that would the the latter of what I said. So you probably want signed/encrypted sessions. Simplest way to learn is to write your own Ring middleware. Super easy. |
| 21:21 | bitemyapp | let me try to dig up an example. |
| 21:21 | stcredzero | bitemyapp: I keep seeing stuff where people give an example where they define a handler. But I don't define a handler, I have the route produce one automagically. Instead of writing my own handler, could I just use sandbar? |
| 21:21 | stcredzero | I mean middleware |
| 21:22 | bitemyapp | stcredzero: https://github.com/bitemyapp/neubite/blob/master/src/neubite/handler.clj#L50 |
| 21:22 | bitemyapp | stcredzero: does that look applicable? If not, please do explain why. |
| 21:22 | arrdem | dibs! |
| 21:22 | bitemyapp | stcredzero: [ring.middleware.session.cookie :refer [cookie-store]] is the origin package. |
| 21:22 | bitemyapp | arrdem: seriously? |
| 21:22 | arrdem | bitemyapp: yes |
| 21:22 | bitemyapp | arrdem: 13 |
| 21:22 | bitemyapp | arrdem: ? |
| 21:23 | arrdem | bitemyapp: probably. I haven't kept track :P |
| 21:23 | bitemyapp | arrdem: I want to leave the office, but I don't want to until you're 13. |
| 21:23 | bitemyapp | arrdem: plzchk |
| 21:23 | arrdem | bitemyapp: oh. level. nah man I'm taking a break and working on some old posts. |
| 21:24 | bitemyapp | frick. |
| 21:25 | bitemyapp | stcredzero: if you have some kind of opaque magic from you slapping middleware onto your top-level app handler then you need to unfuck your stack promptly and use vanilla Ring. |
| 21:25 | stcredzero | mitemyapp: this is as confusing as the rest. site is a reference to something magic. I recognize the {:session... stuff afterwards. Is this some noir thing? |
| 21:25 | bitemyapp | preventing you from* |
| 21:25 | bitemyapp | stcredzero: it's just Ring middleware man. functions returning functions. [lib-noir "0.3.5"] |
| 21:26 | bitemyapp | actually wait |
| 21:26 | bitemyapp | let me verify |
| 21:26 | stcredzero | bitemyapp: your last long comment basically sums up every blog post about ring sessions, ever. Doesn't help. |
| 21:27 | bitemyapp | stcredzero: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session/cookie.clj |
| 21:27 | bitemyapp | stcredzero: a Ring application is the composition of functions comprising both middleware and handlers. |
| 21:27 | stcredzero | Yes, I got that. |
| 21:28 | bitemyapp | well fine, but I'm reinforcing it because there's some subtler aspect of it you may not be grokking |
| 21:28 | bitemyapp | it takes most people awhile to connect the dots on this. |
| 21:28 | bitemyapp | Routing is just a handler function that dispatches based on a mapping of string to fn (modulo some regex) |
| 21:29 | bitemyapp | Middleware is a function that takes the app fn and decorates the behavior, whether that be before or after the invocation of the app fn against the request. |
| 21:29 | bitemyapp | stcredzero: It might help if you articulated what part you don't understand or shared your code. |
| 21:29 | bitemyapp | stcredzero: neubite is a mostly (except for MongoDB I think) freestanding micro-CMS example of how to put a Ring app together. |
| 21:29 | bitemyapp | stcredzero: I'm pretty sure Luminus has other examples as well. |
| 21:30 | stcredzero | bitemyapp: your last comment starting "it takes most..." should be regarded by the community as a symptom. Okay, I get that part about decorations. What in the world do I write for the typical compojure thing? What I'm gathering is that I should use some library or basically write my own session store mechanism. |
| 21:30 | bitemyapp | arrdem: can I bribe you into hitting 13? |
| 21:30 | bitemyapp | stcredzero: it's a symptom of a poor education system that teaches according to corporate priorities rather than what actually makes people excellent programmers, but that's besides the point. |
| 21:31 | bitemyapp | stcredzero: for the typical compojure thing? I personally use the default Ring middleware for cookie stores. I'm sure many others do. |
| 21:32 | bitemyapp | stcredzero: the default Ring middleware for cookie stores is exactly what you're seeing in that neubite code. |
| 21:32 | seangrove | I have to run out to a meetup, but stcredzero I'd be happy to help bitemyapp help you out when I get back |
| 21:33 | seangrove | stcredzero: I would just suggest posting as much code as possible to make everything crystal clear |
| 21:33 | bitemyapp | seangrove: wait, which meetup is tonight? |
| 21:33 | seangrove | Appium :P |
| 21:33 | hiredman | stcredzero: have you seen https://github.com/mmcgrana/ring/wiki/Sessions ? |
| 21:33 | stcredzero | bitemyapp: re: symptom. I won't disagree. Okay, so where the heck does "site" come from? And what in all this do I need or don't need? |
| 21:33 | seangrove | Nothing special |
| 21:33 | seangrove | Meeting a customer there, and some of my old work mates from Sauce |
| 21:34 | stcredzero | Hey, sean. |
| 21:34 | bitemyapp | stcredzero: site is middleware, I often find it helps to "just read the code" when it comes to Clojure and Haskell: https://github.com/weavejester/compojure/blob/master/src/compojure/handler.clj |
| 21:34 | bitemyapp | stcredzero: the intent behind it is to bundle up some common default middleware. |
| 21:35 | dsrx | in haskell you can often get away with reading the type signature |
| 21:35 | hiredman | stcredzero: since you using compojure to define routes, the end points are still handlers, you still get a ring request map |
| 21:35 | bitemyapp | stcredzero: if you don't want the rest of it, you can probably get away with using wrap-session plus cookie-store. |
| 21:35 | logic_prog | what problem does https://github.com/halgari/fafnir solve ? |
| 21:35 | bitemyapp | dsrx: damn straight. It's awesome. |
| 21:35 | logic_prog | why is inserting a big object into datomic nono-trivial? |
| 21:35 | bitemyapp | logic_prog: the nested part is the important part. |
| 21:36 | bitemyapp | logic_prog: as someone that has had to (de/re)forest ugly hierarchies into Datomic, if your data model fits Fafnir, you probably want to use it. |
| 21:36 | stcredzero | I keep seeing this "(defn handler..." example, but I don't have such a thing. I would like to just use wrap-session and cookie-store. Just doesn't make sense. |
| 21:36 | hiredman | stcredzero: your compojure route is a handler |
| 21:36 | logic_prog | bitemyapp: noted, thanks |
| 21:37 | bitemyapp | stcredzero: what you're saying is symptomatic of some part of Ring or Compojure not "clicking" for you. |
| 21:37 | hiredman | (defroutes handler (GET whatever [req])) |
| 21:37 | hiredman | is a handler and req is same request map that gets passed in to the (defn handler ...) |
| 21:37 | bitemyapp | stcredzero: everything is a function. Compojure routes are the monoidic aggregation of matching rules and handlers into higher level functions that take ring requests and return ring responses. |
| 21:37 | hiredman | and it returns the same thing, so you drop the body of the handler defn in |
| 21:38 | bitemyapp | bbloom: dnolen http://www.infoq.com/presentations/molog miniKanren in Haskell, @acfoltzer's work. |
| 21:38 | stcredzero | hiredman: I get that. Let me see if I can make sense of "drop the body of the handler in..." |
| 21:38 | hiredman | the really annothing thing there is compojure's destructuring is slightly different from clojure's |
| 21:38 | bitemyapp | hiredman: yeah that's a killer sometimes. |
| 21:38 | hiredman | so the desructuring from the example may not just work |
| 21:39 | stcredzero | hiredman: Seems like there's 2 or 3 bits of additional magic I have to figure out for every additional thing I learn. |
| 21:40 | hiredman | stcredzero: if you don't know clojure you are going to have to learn things to write clojure |
| 21:40 | hiredman | stcredzero: if you don't know ring, etc etc etc |
| 21:40 | stcredzero | This is my second clojure personal project. |
| 21:40 | hiredman | I mean, that is just the reality of doing new things |
| 21:40 | stcredzero | Thanks for the talking down to. |
| 21:41 | bitemyapp | stcredzero: everybody has stuff they don't know. Don't worry about where you are on the ladder, just keep climbing!~ |
| 21:41 | bitemyapp | stcredzero: putting your ego aside will allow you to focus on the climb. |
| 21:41 | bitemyapp | stcredzero: a month ago, I didn |
| 21:41 | ddellacosta | stcredzero: don't take it personally. It's hard to read tone in IRC. These guys are definitely trying to help. |
| 21:42 | bitemyapp | stcredzero: didn't really grok Scotty's routing monoids (kinda like Compojure), now I do! |
| 21:42 | sritchie | bitemyapp: routing monoids? |
| 21:42 | stcredzero | Thanks, I guess. Why are you alleging ego? And why does all of this have to be so cryptic? |
| 21:43 | bitemyapp | sritchie: sure. You can model fizzbuzz as a monoid too. |
| 21:44 | bitemyapp | sritchie: a rule can be a tuple (String, RingHandler) where Ring handler is a function (Request -> Response) |
| 21:44 | bitemyapp | sritchie: routing is the Monoidic `mappending` of those tuples into a single "router" |
| 21:45 | bitemyapp | sritchie: sorting/precedence rule aggregation in fizzbizz forms a Monoid too! |
| 21:45 | sritchie | okay, sure |
| 21:45 | rafaelsf | exit |
| 21:45 | ddellacosta | stcredzero: what are you stuck on? Do you have a gist/refheap of your code, or is it some conceptual thing? I'm sorry, I missed the beginning of the conversation. |
| 21:45 | bitemyapp | sritchie: I've been writing a little too much Haskell lately :( |
| 21:45 | sritchie | monoids everywhere, baby! |
| 21:45 | bitemyapp | sritchie: the things I've seen... |
| 21:46 | stcredzero | dellacosta: What would be great is just what to write so that I can shove some data in a session and get it back. Was on the phone, so was too awkward to post any code. Just a sec... |
| 21:46 | ddellacosta | stcredzero: okay |
| 21:47 | bitemyapp | ddellacosta: wheeeee. I look forward to it! |
| 21:47 | ddellacosta | bitemyapp: I haven't forgotten! ;-) |
| 21:48 | ddellacosta | also, sritchie I owe you a response on friend-oauth2, apologies for completely flaking that one |
| 21:48 | sritchie | no worries |
| 21:48 | arrdem | the day I get op in here, first thing I'm doing is kicking also and so. |
| 21:49 | stcredzero | ddellacosta: http://pastebin.com/bbhJWrtW -- that's my handler.clj The function that I'm trying to get sessions to work with is session-test (of course) |
| 21:49 | akhudek | arrdem: no decent person would choose those names! |
| 21:49 | arrdem | akhudek: I KNOW. THANK YOU. |
| 21:50 | ddellacosta | haha |
| 21:50 | gfredericks | oh no help now I have five libs named #"lib-\d{4}" |
| 21:50 | bitemyapp | arrdem: I survive this hypothetical purge? |
| 21:51 | arrdem | bitemyapp: maybe. take a tough check. |
| 21:52 | arrdem | 1d6 |
| 21:52 | clojurebot | 2 |
| 21:52 | arrdem | bitemyapp: failed the tough check. you get canned too. |
| 21:52 | arrdem | bitemyapp: <3 |
| 21:52 | bitemyapp | ouch. |
| 21:52 | ddellacosta | stcredzero: and, what do you want to return there? |
| 21:52 | bitemyapp | my D&D karma is not good. |
| 21:52 | ddellacosta | 1d6 |
| 21:52 | clojurebot | 1 |
| 21:53 | ddellacosta | that's hilarious, didn't know that existed |
| 21:53 | bitemyapp | 1d12 |
| 21:53 | clojurebot | 4 |
| 21:53 | bitemyapp | man, this bot's RNG is not doling out the awesome tonight. |
| 21:53 | vdmit11 | Hi folks. Does doseq forces evaluation of a given lazy sequence before evaluation of body or it evaluates one element from the sequence per iteration? |
| 21:54 | ddellacosta | stcredzero: take a look at https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session.clj#L49 if you haven't |
| 21:54 | stcredzero | ddellacosta: It's a mess because I've just been trying stuff. I'd pretty much like to do what https://github.com/mmcgrana/ring/wiki/Sessions is doing in the 2nd gray box. I'm just about to do that in a new lein project |
| 21:54 | arrdem | 2d6 |
| 21:54 | clojurebot | 8 |
| 21:54 | arrdem | 2d6 |
| 21:54 | clojurebot | 8 |
| 21:54 | arrdem | 2d6 |
| 21:54 | clojurebot | 9 |
| 21:54 | arrdem | little high here... |
| 21:55 | arrdem | it's not blatantly returning 4 all the time :P |
| 21:55 | Cr8 | 2701d1 |
| 21:55 | clojurebot | 2701 |
| 21:56 | arrdem | bitemyapp: we need lazybot and clojurebot pages on the wiki... |
| 21:56 | arrdem | a package naming convention would be nice too... |
| 21:57 | ddellacosta | stcredzero: ah, okay...so the thing to remember is that there is a session in the response args, with the key (in that example) of :session. So you have to update that in your response. Your example is not doing that--it's returning an "arbitrary" hash-map. Does that make sense? That's why I pointed you to the session-response function in my link above. |
| 21:57 | bitemyapp | arrdem: we do need pages on the bots, I forget the commands too fucking much. |
| 21:57 | ddellacosta | ...as that shows what is going on, if you read that code it may make more sense. |
| 21:57 | bitemyapp | arrdem: you are welcome to add whatever content you like :) |
| 21:57 | stcredzero | dellacosta: thanks for trying. I hadn't seen that particular one, but it's just as bad as everything else. I'm going to try to play with the example at https://github.com/mmcgrana/ring/wiki/Sessions |
| 21:58 | ddellacosta | stcredzero: ...what's bad about it? That's the library you are using to write this. |
| 21:58 | hiredman | /ignore stcredzero |
| 21:59 | hiredman | pardon me |
| 21:59 | ddellacosta | haha |
| 21:59 | ddellacosta | stcredzero: well, if you change your mind, I'm happy to try and help you understand the workings of ring a bit more. But I do recommend reading through the ring code to understand how it works, at some point. Otherwise, good luck. |
| 22:01 | stcredzero | dellacosta: It's confusing. If this is truly an earnest attempt at help, I dunno. Reminds me of the same stuff from Smalltalk years ago. |
| 22:02 | ddellacosta | stcredzero: if you take the time to explain what is confusing, those of us here with experience with Clojure can better help you. But I assure you that the default attitude here from 99% of folks is helpful, sincerely. |
| 22:03 | ddellacosta | dammit, burnt my toast |
| 22:03 | stcredzero | ddellacosta: appreciate it. I think I'm going to have to go on and play with stuff first. Then I'm going to come back and say something like, "well, why didn't you just tell me...!?" |
| 22:03 | bitemyapp | ddellacosta: "dammit, burnt my toast" - and then he was enlightened |
| 22:03 | bitemyapp | too funny. |
| 22:04 | ddellacosta | haha |
| 22:04 | ddellacosta | stcredzero: understood. Good luck! :-) |
| 22:05 | ddellacosta | bitemyapp: now I have to figure out what to eat. I have not yet reached enlightenment. |
| 22:05 | bitemyapp | ddellacosta: whatever's available and appealing? |
| 22:05 | ddellacosta | maybe I'll go to the conbini and get some melon pan |
| 22:06 | bitemyapp | also I'm depressed. Prim (delivered laundry service startup) shut down. Now I have to do my own laundry. |
| 22:06 | ddellacosta | bitemyapp: dude |
| 22:06 | ddellacosta | bitemyapp: that is so San Francisco |
| 22:06 | bitemyapp | ddellacosta: living in SF is a lesson in the impermanence of existence. |
| 22:06 | ddellacosta | haha |
| 22:06 | ddellacosta | very Zen today. ;-) |
| 22:07 | bitemyapp | ddellacosta: I've been neck-deep in broken edn parsers for a couple of weeks. When sanity leaves, Zen remains |
| 22:07 | ddellacosta | heh |
| 22:07 | bitemyapp | why? because Zen can't go anywhere |
| 22:08 | bitemyapp | ddellacosta: my latest amusement is some weirdo buddhist or soto person trolling ewk on reddit.com/r/zen |
| 22:08 | bellkev | Does anybody know if there's anything loosely equivalent to :jar-exclusions for cljs? That is, is there a way to conditionally include/exclude files/namespaces from going into the compiled js based on a leiningen profile other than having multiple source directories? |
| 22:08 | bitemyapp | ddellacosta: I think somebody has an axe to grind with non-religious zennists. |
| 22:08 | bitemyapp | or rinzai. |
| 22:08 | ddellacosta | bitemyapp: well, I am going somewhere, to the conbini to get a bite. Be back. ;-) |
| 22:09 | ddellacosta | bitemyapp: rinzai strikes me as more likely to troll. brb |
| 22:09 | bitemyapp | ddellacosta: you're actually right, ewk is usually the troll. So am I. (I'm rinzai, god only knows what he is). But somebody decided to put him on the defensive and it's hilarious. Cheers. |
| 22:10 | bvecchi | Hey. Is there a way to know, given a function, if there's a var that is bound to it? |
| 22:11 | bitemyapp | ,(= (fn [] (println "Hello!")) (fn [] (println "Hello!"))) |
| 22:11 | clojurebot | false |
| 22:12 | bitemyapp | sadface.jpg |
| 22:14 | gf3 | bitemyapp: ahahahaha that last shit_hn_says was brilliant |
| 22:14 | gf3 | https://twitter.com/shit_hn_says/status/421116237792284672 |
| 22:14 | b-ot | gf3: @shit_hn_says: Why don't they just host GitHub wherever the status site is hosted? |
| 22:18 | danneu | How would you do a case-insensitive string search with datalog? |
| 22:19 | hiredman | danneu: you'll need to specify a kind of datalog |
| 22:19 | danneu | Nevermind, got it |
| 22:19 | danneu | hiredman: yeah, thanks. i've been able to use d/datoms so often that i forgot how to write datalog |
| 22:20 | danneu | [(clojure.str/lower-case ?name) ?lower-name] [(= "peter" ?lower-name)] |
| 22:20 | hiredman | danneu: datalog is a family of query languages like lisp is a family of programming languages |
| 22:21 | hiredman | I guess being #clojure assuming datomic's datalog might be an ok bet |
| 22:22 | bellkev | I think I answered my own question about cljs exclusions here: https://github.com/emezeske/lein-cljsbuild/issues/157 |
| 22:23 | bellkev | It looks like @magomimmo settled on a source-paths based solution. His use case of a browser-connected repl is identical to what I wanted the option for... |
| 22:23 | bellkev | So I'll just assume that that solution is idiomatic for now... |
| 22:30 | ddellacosta | it's a long shot, but, anyone here used the relatively new update/set/values helpers in HoneySQL? |
| 22:43 | abishek | ;;message |
| 22:43 | abishek | ;;message Hi |
| 22:43 | bitemyapp | gf3: <3 |
| 22:43 | gf3 | :) |
| 22:47 | bitemyapp | arrdem: doters? |
| 22:48 | arrdem | bitemyapp: sure. let me finish ranting about pipeline hazards, grab a beer and I'll change machines. |
| 22:54 | bitemyapp | gf3: FIGHT FIGHT FIGHT |
| 22:54 | gf3 | hahaha |
| 22:54 | gf3 | bitemyapp: lojikil is a good friend of mine |
| 22:56 | bitemyapp | gf3: I don't care, I expect a blood sacrifice. Not using oxford commas is unforgivable. |
| 22:56 | bitemyapp | they have a very useful semantic purpose. |
| 22:56 | gf3 | agree |
| 22:56 | gf3 | fogus must pay |
| 22:57 | gf3 | #sin |
| 22:57 | bitemyapp | gf3: maybe 3 years of writing VB 6 is sufficient punishment? |
| 22:57 | bitemyapp | gf3: ...writing Excel format parsers |
| 22:57 | gf3 | bitemyapp: I heard VP.NET is worse |
| 22:57 | gf3 | er |
| 22:57 | gf3 | VB.NET |
| 22:57 | bitemyapp | gf3: ...the old bytecode Excel format. |
| 22:57 | bitemyapp | gf3: nah, VB 6 is worse. |
| 22:57 | bitemyapp | gf3: I did .NET back in the day. |
| 22:58 | bitemyapp | gf3: VB.NET is like the C++ of VB, but actually good. |
| 22:58 | bitemyapp | well, not good, better. |
| 22:58 | gf3 | bitemyapp: I heard VB.NET is VB pretending it's a big boy, and VB6 is just unabashed VB |
| 22:58 | bitemyapp | gf3: I guess it depends on your priorities. |
| 22:58 | gf3 | bitemyapp: pizza |
| 22:58 | bitemyapp | gf3: but that's like saying the robber baron capitalism of the 19th century was better than feudalism. It's true, but the orders of magnitude involved are mind boggling. |
| 22:59 | bitemyapp | gf3: I was already following him, but after this conversation, I like him even more. |
| 22:59 | gf3 | bitemyapp: smart as hell, too |
| 23:02 | bitemyapp | gf3: probably why I originally followed them. |
| 23:02 | stcredzero | Okay, I can write a handler to do stuff with the session. How in the world do I incorporate that into the functions I call from defroutes? |
| 23:03 | arrdem | bitemyapp: okay. lets do this. |
| 23:04 | bitemyapp | stcredzero: I can't help you right now, I'm agitating for marxist revolt against product managers. |
| 23:04 | bitemyapp | arrdem: mumbulurs. |
| 23:05 | stcredzero | bitemyapp: your comment re: robber barons reminds me of my observation about almost all leaders prior to 1700 |
| 23:05 | bitemyapp | stcredzero: that being? |
| 23:05 | bitemyapp | arrdem: gooby pls mmbl. |
| 23:06 | stcredzero | bitemyapp: which is that almost all leaders prior to 1700 have the same morality that supervillains do in todays fiction. |
| 23:06 | bitemyapp | stcredzero: uh, yeah, but I don't think that stopped at 1700. |
| 23:07 | bitemyapp | stcredzero: I'm listening to the history of rome podcast, about 80% done. One of the starkest impressions I'm getting is, "virtually everyone in power was a sociopath of some variety or another" |
| 23:07 | stcredzero | Love History of Rome |
| 23:07 | stcredzero | Also, I didn't say that it stopped at 1700. It's just that you can categorically say that about the leaders before 1700 |
| 23:08 | bitemyapp | stcredzero: ah gotcha. Yeah I'd agree with that. |
| 23:09 | stcredzero | How come everyone always concocts an incorrect or illogical implication of something I say/write. then assumes I'm proulgating that silly idea? |
| 23:10 | stcredzero | I made a comment on HN about how inheritance is overrated, factory is overused, and both happen to generics. This was interpreted as my claiming inheritance and factory are somehow associated with generics |
| 23:12 | gf3 | stcredzero: that's what you get for commenting on HN |
| 23:12 | mischov | stcredzero: I think things would be overly generic if you inherited factory jobs from your parents.. :) |
| 23:12 | bitemyapp | gf3: I think I can improve your friend. |
| 23:13 | gf3 | bitemyapp: oh ya? |
| 23:13 | bitemyapp | gf3: ya, get 'em started on 'Askell. |
| 23:13 | bitemyapp | if I say the H word, the monsters come out of the woodwork :) |
| 23:15 | stcredzero | gf3: so now HN is a den of careless readers and breezy pseudo knowitalls? |
| 23:15 | gf3 | bitemyapp: I'm sure he already has |
| 23:15 | gf3 | stcredzero: WELL YOU POST THERE, SO... |
| 23:16 | gf3 | bitemyapp: The guy blows my mind whenever he talks to me about what he's working on |
| 23:16 | xuser | stcredzero: if its everyone like you said, have you stop and think that maybe the way you write is the problem? |
| 23:16 | xuser | ;) |
| 23:16 | stcredzero | gf3: I've been there awhile noting the decline in things like CS knowledge and reading comprehension. |
| 23:18 | stcredzero | xuser: reading involves coming up with a number of possible interpretations, like hypotheses. It's a filtering observation: see if someone only ever produces one hypothesis then goes with it. |
| 23:18 | gf3 | stcredzero: i'm just pushing your buttons, i don't care where you post on the internet |
| 23:18 | stcredzero | gf3: You *think* you are pushing your buttons, and I'm not defending HN. |
| 23:19 | gf3 | you got me |
| 23:32 | cerealklr | Hey folks. Sorry to bother you with such a simple question, but it's impossible to google the @ character. What does a variable name preceded by the @ sign imply? |
| 23:34 | egghead | @ is dereferencing |
| 23:35 | egghead | like a future or an atom |
| 23:37 | cerealklr | Ah, I see. So does it block for a value synchronously? |
| 23:38 | cerealklr | Actually, I can probably just google clojure concurrency constructs and figure it out. Thanks! |
| 23:38 | justinjaffray | cerealklr: I believe (but someone correct me if I'm wrong) @foo is equivalent to (deref foo) |
| 23:38 | egghead | ^ |
| 23:38 | clojurebot | Gabh mo leithscéal? |
| 23:39 | egghead | ,(let [a (atom :atom)] [a (deref a) @a]) |
| 23:39 | clojurebot | [#<Atom@1c81588: :atom> :atom :atom] |
| 23:40 | cerealklr | Looks like you were right. :) |
| 23:58 | dsrx | reminds me that i used to use the nick Atom on IRC way back in the day.... good thing i stopped |