2014-10-17
| 00:02 | TEttinger | ,`('~list 1 2 3) |
| 00:02 | clojurebot | ((quote #<clojure.lang.PersistentList$1@3d6600>) 1 2 3) |
| 00:02 | tbaldridge | ,(eval `(~'list 1 2 3)) |
| 00:02 | clojurebot | (1 2 3) |
| 00:02 | TEttinger | we have eval in clojurebot too! |
| 00:02 | TEttinger | wow |
| 00:03 | TEttinger | (inc tbaldridge) |
| 00:03 | lazybot | ⇒ 11 |
| 00:03 | tbaldridge | hrm.... |
| 00:03 | TEttinger | the ~ and ' are reversed |
| 00:03 | tbaldridge | ,(clojure.java.shell/sh "rm -rf /") |
| 00:03 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.java.shell> |
| 00:03 | tbaldridge | ,(eval '(clojure.java.shell/sh "rm -rf /")) |
| 00:03 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.java.shell> |
| 00:03 | tbaldridge | well that's good at least... |
| 00:03 | TEttinger | tbaldridge: there's a sandbox anyway |
| 00:03 | TEttinger | ,(File. "/") |
| 00:03 | clojurebot | #<CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: File, compiling:(NO_SOURCE_PATH:0:0)> |
| 00:04 | amalloy | right, TEttinger. ~'list evaluates to the symbol list, whereas '~ evaluates to a quoting of the function list |
| 00:04 | TEttinger | ,(java.util.File. "/") |
| 00:04 | clojurebot | #<CompilerException java.lang.ClassNotFoundException: java.util.File, compiling:(NO_SOURCE_PATH:0:0)> |
| 00:04 | TEttinger | ,(java.io.File. "/") |
| 00:04 | clojurebot | #<File /> |
| 00:04 | TEttinger | huh |
| 00:04 | rntz^2 | amalloy: right, and quoting the function list is what I was trying to do |
| 00:04 | amalloy | TEttinger: there's nothing wrong with *making* a File object; clojurebot just doesn't let you do anything with it |
| 00:04 | amalloy | no it's not, rntz^2 |
| 00:04 | rntz^2 | ,(eval `('~list 1 2 3)) |
| 00:04 | clojurebot | #<ExceptionInInitializerError java.lang.ExceptionInInitializerError> |
| 00:05 | rntz^2 | amalloy: no, trust me, it absolutely is. |
| 00:05 | amalloy | i mean, i guess there's no law against trying to do things which are bad |
| 00:05 | rntz^2 | the code in question is actually passed in a function, it's not using list specifically. |
| 00:05 | rntz^2 | I'm writing a... rather strange implementation of quasiquote |
| 00:06 | rntz^2 | and it uses this, and it works in scheme, but because of this it doesn't quite work in clojure |
| 00:06 | amalloy | you cannot embed arbitrary objects (including functions) into the middle of code and have them evaluate to something meaningful |
| 00:06 | rntz^2 | well. maybe. but it does work for functions other than list. in fact, the problem seems to have something to do with the fact that list is not exactly a function. |
| 00:07 | TEttinger | is list a macro? |
| 00:07 | amalloy | it works, more or less by coincidence, for functions which are not closures |
| 00:07 | amalloy | list is a weird special case, i agree |
| 00:07 | rntz^2 | oh, interesting. |
| 00:08 | amalloy | TEttinger: list has no clojure source code; it's defined in PersistentList.java or somewhere like that |
| 00:08 | rntz^2 | huh, it fails for closures. weird |
| 00:08 | rntz^2 | ,(let [x 0] (eval `'~(fn [] x))) |
| 00:08 | clojurebot | #<ExceptionInInitializerError java.lang.ExceptionInInitializerError> |
| 00:08 | amalloy | rntz^2: anything you couldn't type in, you should not embed in code |
| 00:09 | rntz^2 | look, I'm not here to get lectured at. you can just tell me it doesn't work and be on your way :P. |
| 00:09 | amalloy | i have been, and yet here you are |
| 00:15 | tbaldridge | ~gentlemen |
| 00:15 | clojurebot | You can't fight in here. This is the war room. |
| 00:17 | TEttinger | clojurebot: gentleman |is| not as good as Gangnam Style. |
| 00:17 | clojurebot | Ik begrijp |
| 00:18 | kenrestivo | gentlemen is http://www.youtube.com/watch?v=_oD3pbOBP50 |
| 00:25 | ddellacosta | woah, that is kickass |
| 00:38 | razum2um | does anyone know why "clojure"? is it changed "closure" (but why?) or anything else? |
| 00:42 | ivan | razum2um: http://groups.google.com/group/clojure/msg/766b75baa7987850 |
| 02:08 | andyf | ,*clojure-version* |
| 02:08 | clojurebot | {:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"} |
| 02:08 | andyf | ,(apropos “replace") |
| 02:08 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading string> |
| 02:09 | andyf | ,(apropos “str”) |
| 02:09 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: “str” in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 02:11 | dysfun_ | have there been any experimental reader replacements for clojure, out of interest? |
| 02:12 | TEttinger | smart quotes, andyf |
| 02:12 | TEttinger | ,(apropos "replace") |
| 02:12 | clojurebot | (clojure.core/replace clojure.string/re-quote-replacement clojure.string/replace clojure.string/replace-first) |
| 02:12 | andyf | Huh, didn’t know I was producing smart quotes. Thx. |
| 02:13 | TEttinger | np |
| 02:14 | andyf | Anyone know how to disable Colloquy client on Mac OS X from generating smart quotes? |
| 02:15 | TEttinger | it may be a mac thing... |
| 02:16 | andyf | Found it via Google, which is what I should have checked first for such a non-Clojurey question |
| 02:16 | andyf | ,(apropos "walk") |
| 02:16 | clojurebot | () |
| 02:34 | andyf | dysfun_: I don't know if it woud be categorized as experimental, but the tools.reader contrib library is not identical to the built-in reader |
| 02:35 | andyf | What kind of differences from the built-in reader would you consider experimental? |
| 02:50 | dysfun_ | andyf: well in particular i was wondering whether someone had just replaced the reader with a parser that compiled down to clojure, but y'know, a real parser, not an AST reader |
| 02:51 | andyf | dysfun_: So that Clojure got a different syntax available for developers? |
| 02:51 | dysfun_ | yes |
| 02:52 | dysfun_ | syntax is just sugar. i'm wondering how it would play out in practice |
| 02:52 | dysfun_ | i mean obviously you lose a lot of the utility of macros if you go non-homoiconic |
| 02:54 | dysfun_ | i'm experimenting with a pythonic syntax sugar. the code isn't too horrible |
| 02:54 | dysfun_ | well, the pythonic syntax isn't too horrible, i mean |
| 02:55 | andyf | Almost every lisp dialect has had a "fewer parentheses" alternate syntax proposed for it (often more than once), e.g. a discussion thread from 2009 here: https://mail.google.com/mail/u/0/#search/clojure+alternate+syntax/11fa43cf06119121 |
| 02:56 | andyf | I haven't seen one of those go past the stage of a curiosity, though. |
| 02:56 | dysfun_ | yes, it's a common thing in lisp communities :) |
| 02:56 | dysfun_ | and the historical solutions are interesting |
| 02:57 | dysfun_ | fexprs, for example. i think they only really fell out of favour because they played badly with dynamic scoping, which most lisps were using at the time |
| 02:59 | andyf | I don't recall hearing of someone working on Python-y syntax that compiles to Clojure before. There was a project to create an implementation of Clojure that compiled to Python, but that isn't the same thing at all. |
| 03:00 | dysfun_ | yes, i saw that |
| 03:00 | dysfun_ | i liked his quote: "those who don't understand the work of rich hickey are doomed to repeat it poorly" |
| 03:04 | dysfun_ | hrm, i see that <> are not documented as permitted values in symbols. i wonder if there was an idea at some point to use them for new literal syntax? obviously too many libraries do use them already and the auto-generated record functions do |
| 03:06 | dysfun_ | i'm not sure what you might use more kinds of brackets to denote |
| 03:08 | amalloy | dysfun_: i mean, there's clojure.core/>. it's pretty clear that's intended to be a valid symbol |
| 03:08 | andyf | dysfun_: http://dev.clojure.org/jira/browse/CLJ-1527 may bring the implementation and documentation into closer agreement some day |
| 03:09 | dysfun_ | :) |
| 03:18 | dysfun_ | i can't think of a reasonable use for <> anyway. And we could still have #<> |
| 03:20 | andyf | dysfun_: Not sure I understand: do you mean that you think < and > should be renamed in core? |
| 03:21 | andyf | dysfun_: Oh, you mean what a new set of 'brackets' could be used to mean in Clojure, the way that {} [] () and #{} are defined now for collections |
| 03:21 | dysfun_ | yes |
| 03:22 | hyPiRion | Perhaps sensible to use #[] before we get to <>. And we already got #<> so |
| 03:27 | dysfun_ | what's #<> ? |
| 03:27 | dysfun_ | ,(class #<>) |
| 03:27 | clojurebot | #<RuntimeException java.lang.RuntimeException: Unreadable form> |
| 03:27 | rpaulo | when's 1.7.0 coming out? |
| 03:28 | hyPiRion | dysfun_: unreadable forms, like ##(Object.) |
| 03:28 | lazybot | ⇒ #<Object java.lang.Object@1c25dc5f> |
| 03:29 | dysfun_ | hrm |
| 04:24 | hellofunk | does anyone know how on Ring to use this fix that normally involves an .htaccess file? http://wpvkp.com/font-awesome-doesnt-display-in-firefox-maxcdn/ |
| 04:25 | dysfun_ | you can do that with a middleware |
| 04:26 | dysfun_ | there may even be a general purpose middleware that can do it already |
| 04:26 | clojurebot | Gabh mo leithscéal? |
| 04:39 | clgv | hellofunk: yeah you can definitely implement setting of that header data as ring middleware and maybe there is already one for similar tasks |
| 04:42 | inad922 | Hi |
| 04:42 | inad922 | How do you parse and format dates in clojure? |
| 04:43 | ssideris | inad922: https://github.com/clj-time/clj-time |
| 04:43 | inad922 | ssideris: Thanks |
| 04:43 | ssideris | this is a pretty popular wrapper of Joda time |
| 04:43 | xsyn | what's the syntax for using an anonymous function with multiple arguements in a thread ? |
| 04:44 | clgv | xsyn: what? |
| 04:44 | xsyn | er... |
| 04:44 | inad922 | Joda time? |
| 04:44 | inad922 | What is that? |
| 04:45 | xsyn | clgv: I'm trying to filter a dataset |
| 04:45 | clgv | inad922: just have a look at clj-time ;) |
| 04:45 | clgv | xsyn: can you give an example to the above question? I really do not understand what you want exactly |
| 04:45 | inad922 | k :) |
| 04:46 | inad922 | Is there like a package repository for clojure? I come from python and I look for something like Pypi. |
| 04:46 | inad922 | leiningen is like pip I guess |
| 04:47 | xsyn | (defn getuser [user] (-> data (filter (= (nth (split data ", ") 11) user))) |
| 04:47 | xsyn | is kinda what I want to do |
| 04:47 | algernon | inad922: clojars |
| 04:47 | inad922 | algernon: Thanks |
| 04:50 | inad922 | Can you suggest a good book/tutorial on clojure? I prefer something where I have to create a working application. |
| 04:51 | dysfun_ | Clojure in action has a lot of examples you can type out. Although it's quite outdated now. |
| 04:52 | dysfun_ | I think TJOC is probably the best book, but it's not really that style of book |
| 04:53 | dysfun_ | is there a way to get at the typing information of some code without executing and instrumenting it? |
| 04:54 | dysfun_ | what types clojure thinks it might contain, i mean |
| 04:54 | dysfun_ | that's a really bad explanation. i would like to be able to ask clojure what it thinks the type of an expression is |
| 04:56 | dysfun_ | i appreciate in a lot of cases it's going to come back java.lang.Object |
| 04:57 | hyPiRion | dysfun_: If you use core.typed, you can use holes. |
| 04:58 | dysfun_ | hrm, that's an idea |
| 04:58 | hyPiRion | That's for definitions only though. If you want to go into expressions like (+ 1 2), then I guess tools.analyzer could probably do some inference? |
| 04:59 | SagiCZ1 | dysfun_: i really hated TJOC, Clojure Programming is way better IMO |
| 05:00 | SagiCZ1 | maybe i just read it with athe wrong level of prior understanding |
| 05:01 | dysfun_ | perhaps. i read it after many years of using other lisps |
| 05:02 | dysfun_ | but i think language design is really interesting, and they helped to build up a better picture of the reasons why clojure is designed in given ways |
| 05:03 | hellofunk | does anyone know why the second Om/build only displays if I remove the first om/build in this snippet: https://www.refheap.com/91883 |
| 05:10 | clgv | xsyn: and you want to have the `filter` expression parallelized? |
| 05:10 | clgv | xsyn: or run a get-user invocation in a different thread? |
| 05:13 | xsyn | the way I understand the thread macro is that it will work on the first thing that you are threading (in this case data), my question is if I have another variable that I want to look at (say in this case I want to look up a user) how to I pass that arguement into the thread macro. |
| 05:13 | xsyn | that's the question really |
| 05:14 | clgv | xsyn: ah you are talking about the threading macros. |
| 05:15 | clgv | xsyn: if `data` is a collection and I interpret your code right, you just need to use `->>` instead of `->` |
| 05:15 | clgv | xsyn: though there is no real advantag to use threading for a single form |
| 05:16 | clgv | xsyn: ah no, sorry there is another error. so what is `data` and `user`? |
| 05:16 | xsyn | data is a coll |
| 05:17 | xsyn | and user is a string |
| 05:17 | xsyn | collection* |
| 05:17 | xsyn | what's the difference between -> and --> |
| 05:18 | xsyn | err ->> |
| 05:18 | dysfun_ | -> threads to second place, ->> to last place |
| 05:22 | clgv | xsyn: so you actually want (defn getuser [user] (filter #(= (nth (split % ", ") 11) user) data)) ? |
| 05:23 | clgv | xsyn: in this case you should have tried to get a working `filter` expression first and then introduce threading macros in case you need to apply seq functions on the result |
| 05:31 | dysfun_ | i can't seem to find the source for in-ns |
| 05:32 | xsyn | just found the macro-expand function which has helped a lot |
| 05:32 | xsyn | thanks guys |
| 05:35 | xsyn | cool, working like I want it to. |
| 05:36 | xsyn | thank you |
| 05:43 | dysfun_ | macroexpand-1 is useful too where you want to not expand everything |
| 06:21 | clgv | ,(macroexpand '(let [a 1] (-> 1 inc (* 2))) |
| 06:21 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 06:21 | clgv | ,(macroexpand '(let [a 1] (-> 1 inc (* 2)))) |
| 06:21 | clojurebot | (let* [a 1] (-> 1 inc (* 2))) |
| 06:21 | clgv | dysfun_: ^^ ;) |
| 06:56 | szymanowski | Hi, is there a way of reimplement "invoke" on vectors and/or lists? |
| 06:56 | clgv | szymanowski: with which gal? |
| 06:57 | clgv | *goal |
| 06:57 | szymanowski | treat them as functions that do what i want |
| 06:57 | clgv | szymanowski: which is? |
| 06:58 | clgv | szymanowski: why not just write a function that does what you want with a vector? |
| 06:58 | szymanowski | for exemple apply all the fns they contain on the argument |
| 06:59 | clgv | szymanowski: that's to specific to be part of some vector implementation. just write a function that does that |
| 07:00 | szymanowski | yes i could do like this but it seems more handy to just treat them as functions when i want |
| 07:00 | szymanowski | in a particular namespace it should be handy |
| 07:00 | clgv | ,((apply juxt [inc dec #(+ % 10)]) 0) |
| 07:00 | clojurebot | [1 -1 10] |
| 07:01 | szymanowski | yes i know i can do that |
| 07:01 | szymanowski | but... it seems great to me to be able to reimplement invoke |
| 07:01 | szymanowski | thank you |
| 07:02 | clgv | szymanowski: but you are conflicting with a general clojure principle here. you dont want to treat vectors as simple data anymore but you want to build some kind of special object that does application specific stuff. I guess this is the approach you'd choose in OOP |
| 07:02 | szymanowski | yes you're probably right, i'm new to FP |
| 07:03 | clgv | szymanowski: honestly, I really do not see the advantage over a once defined function |
| 07:04 | szymanowski | in the program i'm writing every type is also an invokable, so much of the mecanics lay on that fact |
| 07:05 | szymanowski | and i have to create custom type that behave exactely like vecs or lists with just the invoke impl changed |
| 07:05 | szymanowski | it's quite inelegant |
| 07:05 | szymanowski | in my opinion |
| 07:08 | dysfun_ | then you probably don't want this |
| 07:16 | szymanowski | ok thank you |
| 07:54 | dysfun_ | are there any useful symbols that are reserved that could be abused as reader syntax? |
| 07:54 | dysfun_ | preferably ones that aren't likely to be used |
| 07:57 | clgv | szymanowski: you know that you can use `partial` to combine a function and a vector to pass them into the context where you need the "invokables" |
| 08:02 | szymanowski | yes i know partial, it seems like a way, i will try |
| 08:48 | cYmen_ | , [a b] |
| 08:48 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 08:51 | TEttinger | ,[1 2] |
| 08:51 | clojurebot | [1 2] |
| 08:52 | clgv | ,'[a b] |
| 08:52 | clojurebot | [a b] |
| 08:53 | clgv | ,(mapv type '[a b]) |
| 08:53 | clojurebot | [clojure.lang.Symbol clojure.lang.Symbol] |
| 08:53 | clgv | teaching by example ;) |
| 08:55 | clgv | the combination ":(" should be mandatory for exceptions and every editor/ide should render it as smiley. Then Clojure would communicate that it is sad about Exceptions ... :D |
| 08:56 | TEttinger | ;( for NPEs |
| 08:58 | TimMc | Gruh, `lein release` with :deploy-via :clojars tries to use Clojars' disabled SCP endpoint. |
| 08:59 | TimMc | Do I need to say {:deploy-via :shell, :shell ["lein" "deploy" "clojars"]} or something? |
| 09:00 | clgv | TEttinger: hehe yes |
| 09:01 | TEttinger | TimMc: what version of lein? |
| 09:01 | TimMc | 2.4.2 |
| 09:02 | clgv | TimMc: oh. do you have a working setup for "lein release" with version increment and such? (except from deploy) |
| 09:02 | TimMc | yeah |
| 09:02 | clgv | available on github? |
| 09:02 | TimMc | Looks like :shell works, it's just silly. |
| 09:03 | TimMc | clgv: Well, no -- my .lein/credentials.clj.gpg is not public. :-) |
| 09:03 | clgv | I didn't upgrade my projects to "lein release" yet. I only use "lein deploy" after everything is built |
| 09:03 | clgv | TimMc: doesn't matter I am only interested in project.clj ;) |
| 09:03 | TimMc | clgv: Don't you have to roll back to the tagged commit before deploy, then? |
| 09:04 | TimMc | I just accidentally lein deploy'd a SNAPSHOT because I failed to do that. |
| 09:04 | clgv | TimMc: I didnt use leiningen for anything git related so far |
| 09:04 | TimMc | Oh, misread. |
| 09:04 | CookedGryphon | the lein release stuff needs more sanity checking |
| 09:05 | clgv | TimMc: I usually do "lein do clean, install" followed by "lein deploy clojars" on success ;) |
| 09:05 | TimMc | `lein release` is a little annoying. It's opinionated about various things that it oughtn't. |
| 09:05 | CookedGryphon | for example if you do a lein release, then half way through it realises you haven't yet set your GPG key, you have half a release and commits floating around and have to revert things manually |
| 09:05 | clgv | oh |
| 09:05 | TimMc | yeah |
| 09:06 | clgv | does it offer hooks to customize like for the rest of leiningen? |
| 09:06 | TimMc | Not really. |
| 09:06 | CookedGryphon | are you sure? I thought you could customise every step |
| 09:07 | CookedGryphon | just set the release process to include some code in a plugin? |
| 09:08 | CookedGryphon | My main annoyance is that I can't decide to release say 0.1.8-SNAPSHOT as 0.2.0 if I decide the snapshot warrants a major version change. Obviously for libraries these changes should happen along with the changes that cause them to add features/break compatibility or whatever |
| 09:08 | CookedGryphon | but I'm developing an application, and want to release versions when I decide it's got enough new features |
| 09:09 | TimMc | clgv: https://github.com/timmc/handy/blob/master/project.clj |
| 09:10 | TimMc | CookedGryphon: I bump the version as soon as I make a minor or major change -- right on the branch, or even in the same commit. |
| 09:10 | TimMc | I think it's a good habit to get into. |
| 09:12 | CookedGryphon | TimMc: Yeah, as I said, that's a perfectly good workflow for libraries |
| 09:12 | CookedGryphon | but I'm releasing an application so can't really say ahead of time what constitutes a version change |
| 09:12 | CookedGryphon | as it's not as simple as "does this break back compatibility" because there's no such thing |
| 09:12 | TimMc | Jesus, what's wrong with my reading comprehension recently. :-/ |
| 09:13 | TimMc | I blame lack of sleep. |
| 09:13 | CookedGryphon | :P |
| 09:16 | stain | CookedGryphon: if you use something like Artifactory as your Maven repository, then you can deploy to a staging repository and then do a click in the web interface to make it live once finished. Simiarly you can do the git work on a different staging repository that you push yourself from afterwards. |
| 09:16 | stain | a bit more heavyweight Java enterprise style than the Clojure leiningen clojars approach though.. |
| 09:17 | TimMc | Anyway, I just pushed an addition to org.timmc/handy -- tabular-delta, a more reliable way of writing midje tabular tests when you're only perturbing things from a working baseline. https://github.com/timmc/handy/blob/master/src/org/timmc/handy.clj#L158 |
| 09:18 | CookedGryphon | stain: I use github releases for deployment of an intermediate, then the exact same package gets promoted to beta testing, and if it's all good the same package gets pushed out as a release |
| 09:18 | CookedGryphon | as a result I have a version scheme of <marketing-hoo-ha>.<user-visible-version>.<candidate-build> |
| 09:19 | CookedGryphon | where a candidate build is not a snapshot, but something I've prodded to say, there's a good number of features, this is a candidate for putting out to people to try |
| 09:21 | CookedGryphon | and actually, if I skip past version 0 and don't show the candidate-build number to the user, this works quite well |
| 09:21 | stain | CookedGryphon: yeah, that sounds good enough.. not quite semantic versioning, but close enough |
| 09:39 | clgv | TimMc: thx |
| 09:40 | clgv | TimMc: "lein release" switches to non snapshot, builds and deploys the project and then increments the last position in the version number? |
| 09:48 | CookedGryphon | that's right, lein release :minor does the same but increments the minor version number and resets the :patch nmumber |
| 09:48 | CookedGryphon | and :major does the obvious |
| 10:09 | m1dnight | is there an updated document about the low-level workings of refs in clojure? Atm I have this one, which is kind of old (5 years): http://java.ociweb.com/mark/stm/article.html |
| 10:12 | Bronsa | m1dnight: the STM hasn't changed in a long time |
| 10:15 | m1dnight | oh okay :) thanks |
| 10:15 | m1dnight | they mentioned in the article that big changes were underway, so I though I could ask |
| 10:21 | Bronsa | m1dnight: there have been only 2 non-cleanup commits since August 2009 |
| 10:24 | Duke-_ | is there any reason for the 'gres' local in condp source? it doesn't seem to be used https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L6071 |
| 10:27 | AshtonKem | Mornin. |
| 10:28 | Bronsa | Duke-_: looks like a leftover |
| 10:29 | arrdem | agreed leftover. |
| 10:32 | AshtonKem | Ah, this web client won't do. |
| 10:32 | AshtonKem | Shame. |
| 10:32 | ToxicFrog | Why not? |
| 10:33 | AshtonKem | on an iPhone. |
| 10:33 | AshtonKem | So it loses its connection the moment I go to another app. |
| 10:33 | AshtonKem | I was hoping to get irc on here without signing up for another account on a random irc service for iOS |
| 10:38 | edw | Anyone happen to recall the Mac Homebrew IRC channel? Last time I went to #homebrew I learned a lot about beer nerds. |
| 10:42 | edw | It's #machomebrew, btw. |
| 10:43 | wink | lol |
| 10:49 | m1dnight | not to be rude, but why is there so little java doc in the java code for clojure? |
| 10:49 | m1dnight | like, summaries for a method or something |
| 10:50 | arrdem | officially most of the Clojure Java code is "implementation details" which will never be documented. |
| 10:50 | arrdem | I think IFn and ISeq are the only things that are officially not imp'l details. |
| 10:50 | Bronsa | there's also a public API since 1.5 or 1.6 |
| 10:50 | clgv | CookedGryphon: ah good there is an option :D |
| 10:51 | Bronsa | clojure.java.api.Clojure |
| 10:53 | clgv | m1dnight: follow up question: why are there almost no comments in Clojure's implementation? |
| 10:54 | stuartsierra | http://clojure.github.io/clojure/javadoc/ |
| 10:54 | arrdem | clgv: I'll bite :D |
| 10:54 | clgv | arrdem: please, don't bite me! |
| 10:55 | arrdem | I've got some self-documenting verilog over here if anyone believes that's a thing... |
| 10:56 | clgv | what is verilog? |
| 10:57 | arrdem | $google verilog |
| 10:57 | lazybot | [Verilog - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Verilog |
| 10:58 | clgv | muhaha |
| 10:59 | the-kenny | Anyone using core.match in core.async's go-blocks with ClojureScript? It seems broken here. |
| 10:59 | clgv | arrdem: my favorite example https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4439 |
| 10:59 | the-kenny | (match [:foo] [[:asdf _]] 42 :else 23) returns 42 if used outside of a go block. |
| 10:59 | the-kenny | If I wrap it in (go ...) it fails with "Uncaught Error: :foo is not ISeqable" |
| 10:59 | the-kenny | ehh returns 23 outside of a go-block. |
| 11:00 | Bronsa | the-kenny: I believe it's a known issue that go and match can't work together |
| 11:00 | Bronsa | clgv: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L1011-L1014 this is my favourite |
| 11:00 | Bronsa | clgv: followed closely by https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7918 |
| 11:01 | arrdem | (inc Bronsa) |
| 11:01 | lazybot | ⇒ 62 |
| 11:01 | clgv | Bronsa: woah! dummyThis gets actually used later on... X( |
| 11:01 | arrdem | Rich 2009. lol. |
| 11:01 | Bronsa | clgv: no it's in a dead code path actually |
| 11:02 | clgv | Bronsa: ok, github is not doing this analysis ;) |
| 11:02 | Bronsa | https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L7980-L7981 clgv |
| 11:02 | the-kenny | Bronsa: aw :( This is bad |
| 11:02 | Bronsa | >if (foo != null) foo == null ? dummy : else |
| 11:02 | Bronsa | dummy can never be reached there |
| 11:02 | the-kenny | Bronsa: do you know what's the reason? I never heard of that. |
| 11:02 | clgv | right |
| 11:03 | clgv | Bronsa: this is intentionally left there so that the clojure compiler doesnt get too fast on modern computers, eh? :P |
| 11:04 | Bronsa | clgv: I doubt that has any performance impact |
| 11:04 | Bronsa | the-kenny: no idea, you might want to ask that question to dnolen_ though |
| 11:05 | hhutch | the-kenny: http://dev.clojure.org/jira/browse/MATCH-87 |
| 11:06 | the-kenny | oh, such an old issue |
| 11:06 | clgv | Bronsa: you took that comment too serious ;) |
| 11:06 | hhutch | the-kenny: right, but this is why http://dev.clojure.org/jira/browse/MATCH-87?focusedCommentId=31926&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-31926 |
| 11:08 | the-kenny | heh, yeah :) Knowing this I'll just work around this |
| 11:09 | Bronsa | the-kenny: core.async might get ported to tools.analyzer.js relatively soon and get in par with the clojure impl, that might solve those issues |
| 11:11 | the-kenny | yay! |
| 11:12 | arrdem | idle curiosity, how many people here are using core.match? |
| 11:14 | hhutch | i have in the past |
| 11:14 | the-kenny | I really like it - it makes some kind of code much easier to understand |
| 11:15 | Bronsa | arrdem: http://crossclj.info/ns/org.clojure/core.match/0.2.2/project.clj.html mentions 41 direct usages |
| 11:15 | Bronsa | oh version usage got added, awesome |
| 11:17 | Bronsa | so 1.5.1 seems to be the most used clojure version ATM |
| 11:23 | puredanger | according to the clojure survey, it's overwhelmingly 1.6 |
| 11:24 | arrdem | I would guess that there's a lot of bias there in GH projects that aren't actively maintained |
| 11:24 | puredanger | many libs depend on a version but when used downstream the app's version is higher |
| 11:25 | puredanger | 91% of people claim to be using 1.6 for dev or prod in survey |
| 11:25 | Bronsa | cool |
| 11:25 | Bronsa | puredanger: will the raw data be available eventually? |
| 11:25 | puredanger | yes |
| 11:26 | puredanger | eventually being early next week |
| 11:26 | Bronsa | great |
| 11:26 | puredanger | I have a report with some of the things that are easy to report and will flesh that out a bit more and it includes a link to the raw data |
| 11:27 | puredanger | I'm going to leave it open at least for today |
| 11:27 | puredanger | going through the text responses will take a long time - I haven't even looked at them yet |
| 11:28 | puredanger | if anyone wants to help, would be happy for it |
| 11:29 | rurumate | since I got not answer from #cascalog, I'll ask this again here ; The cascading javadoc on CoGroup says that pipe order is important for join performance. Cascalog joins are implemented as CoGroups, so, is there a way to control the pipe order in the generated cascading flow? |
| 11:33 | clgv | O_o |
| 11:33 | puredanger | rurumate: I don't know the answer, but I do know from having done a lot with cascalog a few years ago that questions like this are what drove us to ultimately toss cascalog and write our own layer directly to cascading. unfortunately that code is lost in a dead proprietary code base now. |
| 11:36 | rurumate | puredanger: thanks, I've thought about that too. Cascading seems a bit harder to read than cascalog though |
| 11:37 | rurumate | oh well you wrote a layer on top of it, too bad it's lost |
| 11:38 | puredanger | definitely. cascalog is effectively in charge of "planning" how to build your flow, which is great to make it easier to use. but you give up a lot of control if you actually know what you want that to be |
| 11:39 | rurumate | also it sucks that cascalog uses so many defrecords internally, they should use hash maps instead |
| 11:39 | rurumate | I still like it, but the project seems slow moving now |
| 11:39 | llasram | rurumate: Have you checked out https://github.com/damballa/parkour/ ? </plug> |
| 11:39 | rurumate | not really no |
| 11:40 | rurumate | llasram: that's not on top of cascading |
| 11:40 | llasram | Nope |
| 11:40 | puredanger | or PigPen https://github.com/Netflix/PigPen |
| 11:41 | puredanger | also not on top of cascading |
| 11:41 | puredanger | but both of those have more current traction I think |
| 11:41 | llasram | Meh. I can see PigPen being of value for shops which already have significant investment in Pig, but compiling a subset of Clojure to Pig still just seems pretty nuts to me |
| 11:42 | puredanger | indeed but I think it's a pretty nice entry point |
| 11:42 | puredanger | Pig is imo really terrible seen through FP eyes |
| 11:42 | llasram | puredanger: "entry point" in what sense? |
| 11:42 | puredanger | from Clojure |
| 11:42 | CookedGryphon | Does anybody have any suggestions for how to write tests for core.async code which depends on timeouts? |
| 11:43 | puredanger | rurumate: might take a look at pig/cogroup for example |
| 11:43 | clgv | CookedGryphon: that again? ;) |
| 11:44 | alejandro3 | CookedGryphon: parameterize the timeout value? |
| 11:44 | alejandro3 | what exactly do you want to test? |
| 11:46 | llasram | puredanger: I... guess? I'm obviously biased, but I think being able to write Hadoop MapReduce jobs, just in Clojure a la Parkour is better |
| 11:48 | puredanger | I have used neither in anger and they both seem to be good projects to me. I could see Pig output being useful in some shops as you said. |
| 11:49 | justin_smith | CookedGryphon: I put together a test for a core.async worker pool thingy that established that verious invarients about the worker pool were consistent with the design. This isn't testing timeouts, but something of this structure may be helpful? https://www.refheap.com/91899 |
| 11:50 | mdrogalis | Dang, rurumate is gone. I had the answe to his question. :( |
| 11:50 | mdrogalis | answer* |
| 11:51 | justin_smith | $mail mdrogalis about this cool feature |
| 11:51 | lazybot | Message saved. |
| 11:51 | CookedGryphon | a number of things are supposed to happen according to a timing sequence plus state machine and I want to test that the state machine transitions at the appropriate times and teh appropriate control events come out the other end |
| 11:51 | mdrogalis | justin_smith: What sorcery is this! |
| 11:52 | justin_smith | CookedGryphon: in my test, which I pasted above, I used atoms over sets, numbers, and vectors to instrument what was happening |
| 11:52 | CookedGryphon | so I sort of want to say "Stop the clock, put this event onto the channel, pretend 50ms have elapsed, put this event on, pretend 300ms have elapsed. What's in the output channel now?" |
| 11:52 | mdrogalis | Anyhow, it's a little involved. But the main point is that joins in Cascading can become *really* slow, and there's not much you can do about it. |
| 11:52 | mdrogalis | puredanger: I saw another shop write a layer ontop of Cascading, too. Common route, unfortunately. |
| 11:53 | justin_smith | CookedGryphon: in that case, maybe you want something you can modularize - either something that fakes timeouts but doesn't take that long, or short enough delays so the test running isn't painfully slow? |
| 11:56 | literary | Well, |
| 11:56 | literary | you see, |
| 11:58 | literary | Never mind, I figured it out. |
| 11:58 | justin_smith | LIES I never got to see |
| 12:02 | rwblue | I'm curious how Clojure-like notions of immutability could be implemented on a web-scale. If anyone has seen ideas along these lines, I'd like to hear them. |
| 12:03 | arrdem | Clojure: no really it's webscale. unlike mongodb. |
| 12:03 | rwblue | arrdem: I'm talking about identity and values as applied to URIs |
| 12:04 | SagiCZ1 | how do i import other namespace? (ns this-namespace (:require [other-namespace :refer :all])) should work right? |
| 12:04 | stuartsierra | rwblue: I've heard it brought up in ReST discussions |
| 12:04 | nkoza | rwblue: check datomic |
| 12:04 | rwblue | stuartsierra nkoza thanks |
| 12:05 | arrdem | rwblue: interesting. I've seen a bunch of different ideas (git/gittorent/DHTs) but very few actual products (gnunet & bittorent being the exceptions, maybe urbit) |
| 12:06 | stuartsierra | rwblue: I think this also came up in Joe Armstrong's talk at Strange Loop 2014 https://www.youtube.com/watch?v=lKXe3HUG2l4 |
| 12:06 | SagiCZ1 | any help? |
| 12:06 | arrdem | SagiCZ1: yeah that'll work |
| 12:06 | rwblue | some discussion here too: https://news.ycombinator.com/item?id=5622209 |
| 12:07 | SagiCZ1 | arrdem: and will it load namespaces that are required in other-namespace as well< |
| 12:07 | SagiCZ1 | ? |
| 12:07 | arrdem | SagiCZ1: yes. (ns) is not declarative, it's an imperative statement that forces loading just like (load). |
| 12:07 | SagiCZ1 | arrdem: thanks |
| 12:08 | technomancy | but but ... it looks declarative =D |
| 12:08 | arrdem | technomancy: quiet you. |
| 12:08 | arrdem | technomancy: that ns is not declarative is one of my great bugbears following the Oxcart project |
| 12:08 | stuartsierra | It is in ClojureScript :P |
| 12:09 | arrdem | stuartsierra: right but ClojureScript isn't Clojure :P |
| 12:09 | SagiCZ1 | thats wierd.. i can use functions from other-namespace but no functions from namespaces required by that other-namespace |
| 12:09 | SagiCZ1 | unabel to resolve symbol |
| 12:09 | justin_smith | SagiCZ1: you need to qualify them with their namespace |
| 12:09 | arrdem | SagiCZ1: no that's the expected behavior. dependencies are transitive, but aliases are not. |
| 12:09 | justin_smith | SagiCZ1: there is no such thing as recursive use, and even use is terrible |
| 12:10 | SagiCZ1 | wait so.. they are "loaded" but not qualified? |
| 12:10 | stuartsierra | SagiCZ1: They are "loaded" but not *referred* into your current namespace. |
| 12:10 | SagiCZ1 | i see.. that actually makes perfect sense |
| 12:10 | stuartsierra | `:refer :all` only refers symbols defined *in* the namespace you `require`d |
| 12:11 | SagiCZ1 | and what happens when you "set a repl to a namespace" ? |
| 12:12 | stuartsierra | SagiCZ1: As with `in-ns`, that just makes a particular namespace the "current namespace" for that REPL session. |
| 12:12 | stuartsierra | You can use any symbols defined or referred into the current namespace without qualification. |
| 12:12 | SagiCZ1 | and by qualification you mean? |
| 12:13 | stuartsierra | SagiCZ1: namespace-qualification, like `clojure.string/replace` |
| 12:13 | SagiCZ1 | i see |
| 12:13 | SagiCZ1 | and i can use anything by using its fully qualified name? |
| 12:13 | arrdem | anything loaded, yes |
| 12:13 | stuartsierra | SagiCZ1: Yes, IF it has already been loaded. |
| 12:14 | justin_smith | it isn't good to use transitive dependencies directly - if you use functions from a namespace you should require it explicitly |
| 12:14 | SagiCZ1 | stuartsierra: okay |
| 12:14 | SagiCZ1 | justin_smith: yes i understand.. it makes sense |
| 12:16 | justin_smith | SagiCZ1: where this stuff becomes important is if you ever edit your code - what if you move a function to a new namespace? What if someone changes how the other namespace is implemented and they don't require the transitive dependency that they used to? too many weird ways for things to break |
| 12:18 | SagiCZ1 | yeah taht would be a mess |
| 12:21 | SagiCZ1 | have you ever been dissapointed by some part of clojure? |
| 12:21 | stuartsierra | Well that's a loaded question. |
| 12:21 | justin_smith | SagiCZ1: and using (require '[clojure.string :as string]) vs. (require '[clojure.string :refer :all]) means that if you refactor and split up a namespace or move a function, things are much easier |
| 12:22 | SagiCZ1 | stuartsierra: i was just wondering.. from my newbie point of view.. it all just seems too good to be true |
| 12:23 | SagiCZ1 | justin_smith: i usually avoid using :refer :all for this reason |
| 12:23 | mdrogalis | SagiCZ1: Total illusion. It's just stuartsierra in here. Everyone else is a Clojure IRC bot. :) |
| 12:23 | justin_smith | SagiCZ1: start up time, RAM usage - but for my needs those concerns are minor |
| 12:23 | justin_smith | (long running process on its own server - works great) |
| 12:23 | AeroNotix | I would write more Clojure if the start-up time didn't suck. |
| 12:23 | SagiCZ1 | even java itself has a long start up time |
| 12:24 | stompyj | SagiCZ1: the only thing that frustrates me about clojure is it’s growth/acceptance curve |
| 12:24 | AeroNotix | I pretty much relinquished Clojure to server-side stuff. |
| 12:24 | SagiCZ1 | stompyj: elaborate? |
| 12:24 | Bronsa | I don't find this claim true. my repl starts up in .5 seconds |
| 12:24 | AeroNotix | (which I absolutely love) |
| 12:24 | AeroNotix | Bronsa: you mean a crappy repl? |
| 12:24 | AeroNotix | who cares |
| 12:24 | AeroNotix | Bronsa: try doing one which loads an application's worth of code |
| 12:24 | Bronsa | AeroNotix: that's not "clojure's startup time" then |
| 12:25 | AeroNotix | Bronsa: same difference to people using Clojure for anything other than "a bare repl" |
| 12:25 | AeroNotix | don't be so obtuse. |
| 12:25 | SagiCZ1 | AeroNotix: isnt that something that is bound to improve somewhat in the future? |
| 12:25 | AeroNotix | SagiCZ1: of course |
| 12:25 | arrdem | I get 6.7s for a "bare" Clojure instance of `lein repl`. |
| 12:25 | AeroNotix | and it has been getting better. |
| 12:25 | AeroNotix | arrdem: lein repl isn't a bare repl, to be fair. |
| 12:25 | stompyj | SagiCZ1: The only worry I have is that Scala and Go will outpace it, and it will have a hard time getting wide enough adoption, as that affects ability to hire, cost of devs, ability to sell into companies, etc |
| 12:25 | Bronsa | arrdem: lein repl does *a lot* |
| 12:25 | arrdem | Bronsa: sure, but it's also the common case. |
| 12:25 | MrJones98 | so i’m completely stumped t this point… using clojure+clojurescript in a web app and came across this issue in cljsbuild https://github.com/emezeske/lein-cljsbuild/issues/303 |
| 12:25 | Bronsa | arrdem: sure but lein isn't clojure |
| 12:25 | arrdem | Bronsa: I literally never use java -jar clojure.jar clojure.main, so it's disingenuous to say it's the metric here. |
| 12:25 | MrJones98 | basically cljs compiler results in stack overflows |
| 12:26 | Bronsa | AeroNotix: look, startup time and compilation time are two completely differnt issues |
| 12:26 | SagiCZ1 | stompyj: i understand.. but the fact that clojure and java understand each other well you can basically use javas popularity |
| 12:26 | SagiCZ1 | stompyj: and i thought that Go is as obscure as clojure is |
| 12:26 | AeroNotix | Bronsa: they're inextricably linked |
| 12:26 | MrJones98 | i increased my stack to 1g just to make it obscenely large… and now i get a FileNotFoundException during compilation with a too many files open |
| 12:27 | dnolen_ | MrJones98: that's not a cljsbuild issue - are you using core.async w/ core.match? |
| 12:27 | technomancy | Bronsa: load time is still poor with AOT |
| 12:27 | MrJones98 | i’m usring core.async a lot |
| 12:27 | MrJones98 | i’m not using core.match mysself |
| 12:27 | MrJones98 | but don’t know if some other library might be |
| 12:27 | MrJones98 | let me check my deps |
| 12:27 | technomancy | Bronsa: so conflating it with compilation time is also disingenuous |
| 12:27 | AeroNotix | SagiCZ1: Go at least as much easier to learn. |
| 12:27 | dnolen_ | MrJones98: no it only matters if you use a core.match macro in a go block |
| 12:27 | AeroNotix | and has very familiar syntax to what typical devs know |
| 12:28 | dnolen_ | MrJones98: however if you're are mixing very complex macros in a go block you can also run afoul of this problem |
| 12:28 | stompyj | SagiCZ1: Go adoption seems to be outpacing Clojure here in NYC, I think they’re both growing well, but I think Go’s story is simpler and the value prop is clearer, if for no other reason that its more like hte other language you were probably using |
| 12:28 | literary | rwblue: the spirit of Clojure was embodied in Datomic, which hates garbage collectors, and the enmity has proven mutual |
| 12:28 | MrJones98 | dnolen_: so i’m not using core.match in a go block |
| 12:28 | SagiCZ1 | AeroNotix: i agree that learning clojure has been a little more daunting than i expected.. |
| 12:28 | MrJones98 | cljx is the only reason core.match is in my deps |
| 12:28 | AeroNotix | stompyj: yes, this. |
| 12:28 | literary | rwblue: so, immutability is, well, slow as a turtle driving a race car with no engine |
| 12:29 | MrJones98 | dnolen_: most things were working fine until i tried to add some external libs to my preamble |
| 12:29 | MrJones98 | just some external js stuff |
| 12:29 | dnolen_ | MrJones98: gist your stacktrace somewhere |
| 12:29 | dnolen_ | MrJones98: include CLJS compiler info please |
| 12:29 | dmatysiak | I have a macro that looks like this: (defmacro eval-expr [vars vals expr] `(let [~vals ~vars] ~expr)). The problem is that I won't be passing literal expressions in, only bound symbols, i.e., while I can do (eval-expr [a b] [1 2] (+a b)), I can't do (eval-expr x y z) where x, y and x are bound to the respective expressions. Any suggestions on how to make something like this work? |
| 12:30 | dnolen_ | MrJones98: i.e. version etc |
| 12:30 | Bronsa | technomancy: I'd be surprised if compilation time was dominated by load time |
| 12:30 | stompyj | SagiCZ1: The best thing about clojure imo, is the community, and the projects the community seems to tackle. Without attacking other communities, Clojurists seem to have a great ability to focus on solving problems that make complex problems simpler |
| 12:30 | literary | I am just waiting for `lein run` to start. It takes almost a minute these days. |
| 12:30 | literary | That's why I'm in here wasting time. |
| 12:31 | stompyj | literary: if lein run takes a minute, that feels like a computer issue, more then a lein run issue |
| 12:31 | MrJones98 | dnolen_: capturing the stack trace now and was using cljs 0.0-2227 and upped it to 0.0-2371 and still having the issue |
| 12:31 | SagiCZ1 | stompyj: Well I was never learning clojure for the sake of getting a job.. I think that only company using Clojure in my country would by a company I founded myself. However I understand that language popularity is important for the healthiness of its community |
| 12:31 | rwblue | literary: I'm not really following. I was asking about if/how Clojure's notion of identity and state has been applied to URIs. I've found a few leads so far |
| 12:31 | literary | stompyj: 32gb of RAM, 3.2 GHz Quad Core Intel Xeon, SSD... so I really doubt that |
| 12:32 | Bronsa | technomancy: not to say load time doesn't play a role in compilation time, but as CLJ-1529 showed, there are significant % improvements in compile time that are completely unrelated to code loading |
| 12:32 | literary | stompyj: More likely, it's that I'm loading up both Clojure and JRuby in the same Clojure web app. |
| 12:32 | stompyj | literary: wow. agreed. that’s crazy tho, lein run usually works in sub 5 seconds, even on my mba |
| 12:32 | stompyj | literary: it might be jruby, the startup time on that when I was using it was *brutal* |
| 12:33 | stompyj | that was about 2 years ago tho, so I assume it’s much better now |
| 12:33 | MrJones98 | dnolen_: https://gist.github.com/andrew-nguyen/b718036ab06b469a2b6a |
| 12:33 | literary | stompyj: Even without JRuby, it takes a good 15 seconds to start the web server. |
| 12:33 | literary | rwblue: I only saw your first question, so... |
| 12:33 | MrJones98 | dnolen_: i can copy more of it if you want |
| 12:33 | stompyj | literary: wow |
| 12:33 | arrdem | literary: cold start? that's not entirely crazy.. |
| 12:33 | literary | `lein run` |
| 12:34 | literary | It's surprising given how fricken fast this computer is in every way. |
| 12:34 | literary | And disappointing. |
| 12:34 | arrdem | I get 3.78s to go from a cold JVM to a running webserver |
| 12:34 | stompyj | SagiCZ1: yeah, I mean, I’m not even overly worried about this, but since you asked, it is the one thing I think about, when I think about trying to build a end-to-end clojure/clojurescript project |
| 12:34 | dnolen_ | MrJones98: no, that's the open files problem - not sure why you have "target" in your list of sources |
| 12:34 | literary | I mean, it makes me disappointed in the human race's inability to make fast software given all the time we've had. |
| 12:34 | stompyj | everything else has been pretty nice |
| 12:34 | MrJones98 | dnolen_: i have target only cause that’s where i stick my cljx generated files |
| 12:35 | literary | Oh look, it started. Brb, seeing if my middleware isn't broken yet. |
| 12:35 | SagiCZ1 | stompyj: yeah i see.. thanks for answering the question :) |
| 12:35 | MrJones98 | dnolen_: should i be sticking that somewhere else? |
| 12:35 | literary | (I'd just reload it from within the app, but that's broken too, because I'm using Clojure libs.) |
| 12:36 | justin_smith | literary: the more powerful computers get, the lazier developers can be about performance. developers are more expensive than hardware, so they get away with it. See also: no matter how powerful batteries get for mobile, the latest phone will need daily charging - the limit is the user's tolerance for charging, and with more power, you get lazier / more ambitious power hungry apps. |
| 12:37 | literary | So we're lazy and spoiled and ignorant. |
| 12:37 | literary | Makes sense. |
| 12:37 | dnolen_ | MrJones98: hmm I don't know I don't use cljx |
| 12:37 | technomancy | only ignorant if you aren't aware of the tradeoffs |
| 12:37 | literary | I should probably go. Clojure is pissing me off too much. |
| 12:37 | arrdem | justin_smith: have you seen Alan Kay talk about buying your way into the future for dev productivity? |
| 12:37 | justin_smith | (I use a dumb phone that holds a charge for a few days, a full week if I am feeling antisocial) |
| 12:37 | MrJones98 | dnolen_: i can’t think of a reason why what i have wouldn’t work though |
| 12:37 | justin_smith | arrdem: rings a bell, not sure |
| 12:37 | MrJones98 | that dir just contains cljs files |
| 12:37 | MrJones98 | liike any other src dir |
| 12:38 | literary | technomancy: I meant ignorant in that we can't see how much our own laziness is hurting us as developers, by writing crappy software on top of crappy software on top of cr. |
| 12:38 | dnolen_ | MrJones98: there's not really enough info here for me to go on - sorry - we've haven too many open file issues in the past - but we've received patches for that. |
| 12:38 | MrJones98 | dnolen_: hmm… might’ve had a bad require in one of my source files |
| 12:38 | MrJones98 | but normally, that results in a compiler warning |
| 12:38 | arrdem | justin_smith: idea is that you overpay for hardware by a factor of ~100x or more to get hardware equivalent to what will be "consumer" in 10 years so that you can be as lazy now as you will be in 10 years and still deliver osum |
| 12:39 | dnolen_ | MrJones98: always possible to miss a case |
| 12:39 | justin_smith | arrdem: "the future doesn't have to be incremental" maybe? |
| 12:39 | arrdem | justin_smith: I think he mentions it there too. |
| 12:40 | arrdem | justin_smith: he's come back to that idea a couple times that I've seen |
| 12:40 | justin_smith | arrdem: google for buying your way into productivity gives me no direct hits |
| 12:41 | MrJones98 | dnolen_: any idea why a require of [secretary.core :as secretary :include-macros true :refer [defroute]] was working in 2227 and now causes a warning in 2371 of “secretary.core/defroute does not exist….” ? |
| 12:41 | MrJones98 | also, removed the other bad require and it compiled |
| 12:42 | dnolen_ | MrJones98: because the compiler improved |
| 12:42 | dnolen_ | MrJones98: defroute is a macro so you need to use :refer-macros |
| 12:42 | arrdem | justin_smith: https://www.youtube.com/watch?feature=player_detailpage&v=gTAghAJcO1o#t=2176 |
| 12:43 | literary | Just typed this whole sentence and joined #clojure and my server still hasn't started yet. |
| 12:43 | justin_smith | arrdem: that's the exact title I asked you about |
| 12:43 | literary | Er, also started my entire IRC client. |
| 12:43 | arrdem | justin_smith: I know, that's the timestamp where he starts talking about it |
| 12:43 | literary | Oh there it goes. |
| 12:43 | MrJones98 | dnolen_: i knew it’d be something simple - thanks! |
| 12:43 | justin_smith | arrdem: ahh, OK |
| 12:43 | MrJones98 | btw, we’re making extensive use of om |
| 12:45 | arrdem | justin_smith: 39:30 |
| 12:45 | arrdem | "because this machine was so fast we didn't have to optimize, we could go out, drink a couple pitchers of beer and play all afternoon" |
| 12:46 | MrJones98 | dnolen_: it’s now compiling but takes ~150-180 seconds… does that pass the sniff test? |
| 12:46 | dnolen_ | MrJones98: ok good |
| 12:46 | dnolen_ | MrJones98: are you using advanced compilation? |
| 12:47 | MrJones98 | dnolen_: whitespace only for now in my dev profile |
| 12:47 | dnolen_ | MrJones98: also all bets are off if you are using cljx I have no idea what that things does or what kind of perf hit you are taking by using it |
| 12:47 | dnolen_ | also sourcemaps on any setting other :none will kill you due to RAM requirements |
| 12:47 | MrJones98 | cljx runs before cljsbuild |
| 12:47 | the-kenny | dnolen_: cljx + :optimization :none is fine. |
| 12:47 | dnolen_ | MrJones98: in general using anything other :none and :advanced is a waste of time IMO |
| 12:47 | MrJones98 | so it’s just a basic cljs file with some defs in it |
| 12:47 | the-kenny | It takes about twice as long, but that's still <2s |
| 12:47 | MrJones98 | some constants i share between the front/backend |
| 12:48 | MrJones98 | dnolen_: oh - i thought whitespace/simple/advanced were the only options |
| 12:48 | MrJones98 | let me drop to none |
| 12:48 | clojurebot | Huh? |
| 12:49 | dnolen_ | MrJones98: anyways sounds like something else may be wrong w/ your setup, I've seen CLJS projects with 40K LOC under advanced compilation take ~50secs on my machine |
| 12:49 | MrJones98 | dnolen_: figured…. just needed some ballpark to indicate if something is wrong |
| 12:49 | MrJones98 | thanks |
| 12:49 | dnolen_ | that's processing around near 200KLOC of generated JS in ~50secs on an iMac |
| 12:50 | dnolen_ | if you can't do that then something is wrong w/ your config |
| 12:50 | justin_smith | arrdem: I am watching from the beginning, the thing about the funding disappearing in the '80s is something I have heard about multiple places - just imagine the world we could live in if DARPA hadn't changed |
| 12:51 | justin_smith | (well DARPA and the corparate stuff from xerox / bell etc.) |
| 12:52 | arrdem | justin_smith: eh. we're where we are today because of old DARPA investments that are finally paying off. I think it's disingenuous to lament the changes in funding because most of those projects overpromised and didn't/couldn't deliver. the AI stuff being the classic example of this. |
| 12:52 | MrJones98 | dnolen_: dropping it to none from whitespace now takes 13 seconds the first time and 0.3 seconds after that |
| 12:52 | MrJones98 | haven’t tried with advanced optimization yet |
| 12:52 | dnolen_ | MrJones98: sounds about right |
| 12:53 | justin_smith | arrdem: the funding rules changed and they stopped funding pure research outright. A lot of good stuff comes from pure research. |
| 12:53 | arrdem | justin_smith: #clojure-offtopic, dnolen_ is working :P |
| 13:13 | ag0rex | hello, i was looking through ibdknox/gambit and i saw this: |
| 13:13 | ag0rex | (defmacro ? [obj k] |
| 13:13 | ag0rex | `(aget ~obj ~k)) |
| 13:13 | technomancy | that doesn't look like scheme |
| 13:13 | ag0rex | why would you create a macro in this case instead of creating a function called ? that does the same thing? |
| 13:15 | ag0rex | right.. i am talking about this: https://github.com/ibdknox/gambit :) |
| 13:15 | arrdem | ag0rex: there is no good reason for ? to be a macro here. It's just sugar that does no transformation and could trivially be a function. |
| 13:15 | technomancy | ag0rex: weird. there is already a lisp implementation called gambit. |
| 13:15 | Bronsa | arrdem: not sure about that, actually |
| 13:15 | Bronsa | ag0rex: arrdem that might have to do with inlining and avoiding run time reflection |
| 13:16 | dnolen_ | ag0rex: looks like an inlining macro |
| 13:17 | dnolen_ | ag0rex: stuff like that is less relevant in modern JS engines - but there are less than efficient JS engines to contend with still |
| 13:17 | Bronsa | ah, clojurescript |
| 13:17 | Bronsa | well, just drop the run time reflection bit then |
| 13:19 | ag0rex | dnolen_: so one would do this to avoid a another call to a different function? |
| 13:19 | dnolen_ | ag0rex: yes inlining |
| 13:19 | dnolen_ | ag0rex: but there's really no need to do this kind of thing unless your writing inner loops |
| 13:22 | literary | Hi! Is it a stupid idea to have a background loop that calls (System/gc) every few hours in my web app? |
| 13:23 | arrdem | probably.. the JVM will likely GC more frequently than that anyway.. |
| 13:23 | literary | Oh! |
| 13:23 | puredanger | literary: don't do that |
| 13:23 | literary | Thanks! |
| 13:23 | Gurkenmaster | strange |
| 13:23 | Gurkenmaster | wrong channel |
| 13:23 | hiredman | puredanger means "yes, that is stupid" |
| 13:24 | literary | Well now! |
| 13:24 | puredanger | I thought my way was nicer :) |
| 13:24 | hiredman | sure, but literary asked if it was stupid |
| 13:24 | literary | Indeed! |
| 13:25 | puredanger | I don't think it's a stupid question if you lack JVM context |
| 13:25 | literary | I didn't ask if it was a stupid question! |
| 13:26 | verma | is there a lein plugin which serves my project directory over http? |
| 13:26 | puredanger | I don't think it's a stupid idea, just unnecessary :) |
| 13:26 | verma | like just static |
| 13:26 | literary | My gratitude! I am indebted to your service! |
| 13:26 | verma | so that I can serve the output of my cljsbuild stuff |
| 13:26 | seancorfield | literary: I've known systems on top of the JVM that used to call GC periodically to stay stable - on earlier versions of Java - but I don't know many systems that feel the need to do it now |
| 13:27 | seancorfield | esp. with the G1 collector (if that works for your app) |
| 13:27 | verma | lein pdo repl, cljsbuild auto, server |
| 13:27 | literary | My boss is adamant that we use Datomic, so the GC dies every so often! |
| 13:27 | literary | It spins out of control! |
| 13:27 | seancorfield | which collector are you using? which JVM version? |
| 13:28 | hiredman | literary: the gc dies? |
| 13:28 | literary | I will say this much: I no longer believe experimenting with Datomic to be a worthwhile endeavor! |
| 13:28 | literary | I'm using the latest of both! |
| 13:28 | noonian | you had to manually call the gc all the time with the initial versions of android heh, especially when doing anything with the camera or big files |
| 13:28 | hiredman | literary: what do you mean the gc dies? |
| 13:28 | seancorfield | no, which garbage collector strategy are you using? |
| 13:28 | literary | Garbage collection is the past, Rust's way is the future, whatever it is! |
| 13:29 | hiredman | literary: what do you mean the gc dies? |
| 13:29 | literary | I don't know! |
| 13:29 | technomancy | verma: python -m SimpleHTTPServer 3001 |
| 13:29 | literary | The app just suddenly stops responding to everything! |
| 13:29 | hiredman | literary: and why do you think that is a gc issue? |
| 13:29 | seancorfield | you specify which GC strategy as part of the JVM options at startup |
| 13:29 | literary | Because I've checked everything else! |
| 13:29 | literary | I don't specify it! |
| 13:29 | hiredman | literary: are you monitoring the gc at all? |
| 13:30 | seancorfield | that's your problem then :) |
| 13:30 | literary | What does that mean? |
| 13:30 | literary | I don't know how to monitor it! |
| 13:30 | hiredman | literary: use jstat |
| 13:30 | hiredman | or some kind of profiler |
| 13:30 | verma | technomancy, I don't want to run separate terminal sessions :( .. I already have node.js' http-server |
| 13:30 | seancorfield | maybe you should hire a consultant who understands the JVM? |
| 13:30 | literary | The way my boss set up our website is very bare-bones and configuration-less! |
| 13:30 | verma | technomancy, may be this? https://github.com/tailrecursion/lein-simpleton |
| 13:30 | hiredman | look at how many full gc pauses there |
| 13:30 | technomancy | verma: yeah, there's undoubtedly something |
| 13:30 | hiredman | check the usage of each of the spaces |
| 13:30 | technomancy | this is like the one thing I actually use python for |
| 13:31 | clojurebot | Alles klar |
| 13:31 | literary | My gratitude! I am indebted to your service! |
| 13:31 | technomancy | clojurebot: forget this |is| like the one thing I actually use python for |
| 13:31 | clojurebot | I forgot that this is like the one thing I actually use python for |
| 13:31 | technomancy | ._. |
| 13:31 | verma | technomancy, lol |
| 13:31 | verma | technomancy, then you should just use http-server from npm, and let python go :) |
| 13:32 | hiredman | literary: it doesn't sound like you've done a very thorough job of figuring out what the issue is, so I would not be so quick to assume a gc issue |
| 13:32 | technomancy | verma: lol no |
| 13:32 | literary | I don't even know how to figure out what it is! |
| 14:25 | SagiCZ1 | No matching ctor found??? cant we just spelled out "constructor" so people dont waste time googling what that obscure word means? :) |
| 14:26 | technomancy | c9r |
| 14:26 | llasram | Oh man, best convention ever |
| 14:26 | SagiCZ1 | i hate i18n too |
| 14:28 | nullptr | t9y: nice |
| 14:32 | SagiCZ1 | ,(float (/ 5 7)) |
| 14:32 | clojurebot | 0.71428573 |
| 14:32 | SagiCZ1 | shorter way to do this? |
| 14:33 | nullptr | interesting core.async question -> http://stackoverflow.com/questions/26431207/why-is-the-threadpool-for-core-async-in-clojure-created-with-fixed-thread-pool-o |
| 14:35 | llasram | SagiCZ1: ##(/ (double 5) (double 7)) |
| 14:35 | lazybot | ⇒ 0.7142857142857143 |
| 14:35 | llasram | That doesn't initially create a Ratio object |
| 14:35 | justin_smith | ,(/ 5 (double 7)) |
| 14:35 | clojurebot | 0.7142857142857143 |
| 14:35 | justin_smith | does that? |
| 14:36 | llasram | I believe that also works |
| 14:36 | justin_smith | (/ 5 7 1.0) |
| 14:36 | justin_smith | ,(/ 5 7 1.0) |
| 14:36 | clojurebot | 0.7142857142857143 |
| 14:36 | justin_smith | definitely creates a ratio, but it's "shorter" |
| 14:36 | justin_smith | lol |
| 14:36 | SagiCZ1 | cool, thanks |
| 14:37 | justin_smith | (defn to-days [ms] (/ ms 1000 60 60 24)) |
| 14:39 | justin_smith | (defn to-ms [days] (* days 1000 60 60 24)) |
| 14:42 | johnwalker | nullptr: it's a duplicate, unfortunately |
| 14:51 | TimMc | llasram: I t3k i2s a f2e c8n. |
| 15:08 | llasram | TimMc: Early and recent-extra-minimal Forth systems frequently use/d only 4 bytes for "word" names -- first 3 bytes + a 1-byte length |
| 15:09 | llasram | (or well, 1-byte length + first 3 bytes) |
| 15:09 | clojurebot | Gabh mo leithscéal? |
| 15:10 | llasram | I 5thi 3it' 1a 6pre 10rea 10con |
| 15:10 | justin_smith | lol |
| 15:10 | justin_smith | l3l |
| 15:10 | sveri | Hi, I have a piece of code I don't understand. I am using enlive as a templating engine and in my library I always returned this: (ring.util.response/response (apply str template)) where template is the enlive code, now I played around and tried to embed my library into a current luminus created webapp, all of a sudden the templates are downloaded now, because they have the wrong content type, but when I change my render function to t |
| 15:12 | justin_smith | sveri: (apply str template) should be redundant with ring |
| 15:13 | justin_smith | sveri: also, that message was too long, it got cut off at "I changed my render function to t" |
| 15:13 | sveri | justin_smith: ok |
| 15:15 | bbloom | i really wish i could instantiate java classes w/ namespace aliases |
| 15:15 | bbloom | got a class called "Client" in a long ass namespace |
| 15:16 | bbloom | would be so nice if it could (foo/Client. blah blah) instead of (com.omg.this.is.a.long.name.Client. blah blah) or just the ambiguous (Client. blah blah) |
| 15:18 | dnolen_ | http://arcadia-unity.tumblr.com/post/100257212548/arcadia-0-1a-launched |
| 15:20 | bbloom | dnolen_: cool, get timsg and ra-whatever-his-irc-handle in here :-) |
| 15:21 | cfleming | dnolen_: That looks really great |
| 15:21 | danneu | bbloom: it wouldn't be clojure anymore if you weren't constantly reminded that Java is right there behind the scenes |
| 15:22 | bbloom | danneu: meanwhile, that unity stuff is on the clr ^^ :-) |
| 15:22 | bbloom | or mono, really |
| 15:22 | cfleming | dnolen_: Maybe that'll help clojure-clr get some love, it seems to be the great project that no-one uses. |
| 15:22 | dnolen_ | being able to target XBox, iOS, etc with ClojureCLR is pretty cool |
| 15:22 | dnolen_ | cfleming: yep people care about platforms - this open up some new platforms |
| 15:22 | cfleming | Yeah, I guess ClojureCLR works with the Xamarin stuff? |
| 15:22 | dnolen_ | cfleming: yes |
| 15:48 | justin_smith | the thing that makes me sad about arcadia is unity won't run on Linux :( |
| 15:48 | justin_smith | which is ironic, given that it is based on mono |
| 15:54 | AimHere | Well Unity exports to Linux; is the editor mono-based too? |
| 15:55 | justin_smith | AimHere: they provide no dev env for linux, and no web player |
| 15:55 | AimHere | Right, dev env or editor is what I'm talking about |
| 15:55 | justin_smith | yeah, not available for linux at all |
| 15:56 | justin_smith | http://feedback.unity3d.com/suggestions/platforms-unity-editor-for-linu |
| 15:56 | AimHere | Yeah, but is it built on Mono or something else? Given that it's a full-on game engine, I suspect there's big chunks of native code that needs porting |
| 15:56 | justin_smith | tustex is spamming |
| 15:56 | AimHere | Also tutus |
| 15:57 | justin_smith | AimHere: yeah, most likely, but yeah, they built it on mono |
| 15:57 | justin_smith | well, a forked mono |
| 15:57 | justin_smith | so they could have more control than they get with the ms. impl of clr |
| 15:58 | AimHere | The devs did say that it was purely a business decision; that they didn't think there'd be enough Linux devs willing to shell out the £1500 to use the Pro version |
| 15:59 | AimHere | Though I'd have thought that would be a good use of something like Kickstarter. Get the money pledged in advance. |
| 16:16 | ayarna | hi |
| 16:17 | stompyj | hello |
| 16:22 | bbloom | let's say i've got a lein plugin, what's the easiest way to exclude the version of a dependency it includes? i want to include my own version of it, but `lein deps :tree` shows my dependency seems to be overridden by the plugin |
| 16:23 | technomancy | bbloom: the plugin should attach ^:displace metadata to the dependency vector |
| 16:24 | bbloom | technomancy: shouldn't project dependencies always override plugin dependencies? |
| 16:24 | technomancy | bbloom: there's no such thing as plugin dependencies |
| 16:25 | technomancy | I mean, it's not a first-class concept, just a thing that you can do well or badly |
| 16:25 | bbloom | technomancy: https://github.com/greglook/whidbey/blob/master/src/whidbey/plugin.clj |
| 16:25 | bbloom | what's done badly about that? i can fix it |
| 16:25 | bbloom | i want to supply my own version of puget |
| 16:25 | mdrogalis | What a champ. |
| 16:25 | technomancy | bbloom: try attaching ^:replace metadata to your own maybe |
| 16:26 | technomancy | bbloom: why is this a plugin though? |
| 16:26 | bbloom | technomancy: i have no idea, i still don't understand lein, no matter how much i try to |
| 16:26 | technomancy | oh, because nrepl middleware can't be configured from within project space? |
| 16:26 | bbloom | i guess so, this thing actually monkey patches nrepl |
| 16:27 | technomancy | that's a shame; there really ought to be a way to make it manifest-driven |
| 16:27 | technomancy | project.clj seems like the wrong place for it |
| 16:27 | bbloom | not sure what you mean by that |
| 16:27 | technomancy | well, embedding an nrepl in your project is a thing |
| 16:27 | bbloom | adding ^:replace to my dep seems to fix it |
| 16:27 | technomancy | so having the middleware depend on constructs that aren't present in production seems like a problem |
| 16:29 | technomancy | bbloom: cool |
| 16:30 | technomancy | bbloom: IMO plugins adding dependencies is so easy to do wrong that it's rarely worth the trouble |
| 16:30 | bbloom | technomancy: that's been my impression of most of my interactions with lein |
| 16:30 | technomancy | bbloom: but if you're in a bug-reporting mood, maybe recommend adding ^:displace in the plugin so others don't have this same problem |
| 16:31 | technomancy | bbloom: people get carried away with magic =( |
| 16:31 | technomancy | "just add this one line and it does everything[1] for you" |
| 16:31 | technomancy | [1] everything *I* think you should need |
| 16:32 | technomancy | the way cljsbuild uses project middleware has made me regret adding that feature to lein |
| 16:32 | bbloom | in general, i distrust plugins of any kind |
| 16:33 | technomancy | that's a healthy default |
| 16:33 | technomancy | at least, plugins that execute project code |
| 16:33 | bbloom | once you have a plugin that executes code, you're not in the operating system business |
| 16:33 | bbloom | now* |
| 16:33 | bbloom | "not" totally fails to make my point :-P |
| 16:34 | technomancy | most eval-in-project plugins should really just be -main namespaces that run entirely in project-land |
| 16:34 | mrb_bk | Reminder for conj attendees http://www.meetup.com/Papers-We-Love-DC/events/212419432/ |
| 16:35 | AeroNotix | REMINDER for people, we need moar EU stuff |
| 16:35 | bbloom | technomancy: it's totally a human problem. you made a plugin system... then you documented it! that's where you went wrong :-) |
| 16:35 | technomancy | bbloom: even the ones that ship with lein itself that run code like repl and test are really just there to work around problems in the contribution process for upstream |
| 16:35 | technomancy | haha |
| 16:36 | hiredman | tbd? who does he think he is, rich? |
| 16:36 | technomancy | there's very little reason repl should be anything other than an alias for `lein run -m org.clojure.tools.nrepl` |
| 16:36 | bbloom | technomancy: agreed, and then if you wanted a "plugin" you'd just make a custom main and parameterize it |
| 16:36 | technomancy | same with lein test |
| 16:37 | technomancy | bbloom: IIRC the first thing in the plugin docs right no is a paragraph that tries to convince you not to write a plugin |
| 16:37 | technomancy | but it's too late |
| 16:37 | bbloom | technomancy: can you move the current plugin system in to a custom main and then deprecate the plugin system? |
| 16:38 | bbloom | seems like a good idea to me :-) |
| 16:38 | technomancy | bbloom: hah; that would work if all plugins called eval-in-project |
| 16:39 | justin_smith | bbloom: technomancy: I wonder if there isn't a larger underlying issue, design wise, that gives rise to both lein plugin/middleware issues and instability in various emacs / clojure integration... pitfalls of AOP or something? |
| 16:40 | technomancy | justin_smith: I think it's a matter of failing to decompose first before packaging up good defaults |
| 16:40 | technomancy | "the framework problem" |
| 16:40 | bbloom | justin_smith: there's at least two orthogonal problems: #1 is the AOP side of it, but #2 is that whenever you have dynamic code loading, you've got a shadow world of dependency management, process/job control, evaluation ordering, etc |
| 16:41 | justin_smith | interesting |
| 16:41 | bbloom | yeah, i guess "the framework problems" comes in these two forms: the static decomposition of parts and their dynamic behavior |
| 16:41 | technomancy | so on the bright side, you can now read profiles out of plugins |
| 16:42 | technomancy | which should allow anything that's currently done as middleware to be redone in a declarative way that's easy to override |
| 16:42 | technomancy | I'm sure whidbey could be rearranged to do that |
| 16:43 | technomancy | rather than having a profile that's embedded in the code as a def, it's looked up in the project map, so you can override it easily |
| 16:43 | technomancy | I don't know enough about cljsbuild to speak authoritatively, but my gut tells me the "magic" should be able to be replaced there too |
| 16:46 | bbloom | i don't think lein succeeds in being "declarative" at least not in a positive way |
| 16:46 | bbloom | instead, it's config file magic |
| 16:47 | bbloom | as for cljs build, i've had dramatically more success w/ manual jetty/closure/etc code |
| 16:48 | bbloom | basically write build and clean functions, parameterize them as i need, then a util function or two like rebuild, and then wrap that up in a namespace with an explicit jetty server for my static assets, and wire in a weseal socket to that server |
| 16:48 | bbloom | whole thing is like 20 lines of code |
| 16:48 | bbloom | and 100X more flexible and easier to work w/ than lein |
| 16:48 | bbloom | much faster too |
| 16:48 | bbloom | you get per file re-eval in repl, rather than auto-build nonsense |
| 16:49 | nullptr | bbloom: do you have that packaged somewhere? |
| 16:49 | bbloom | i'll post a gist |
| 16:50 | justin_smith | bbloom: "100X more flexible and easier to work w/ than lein" are you using something else for dep management? |
| 16:50 | bbloom | lein-cljsbuild, i mean |
| 16:50 | dnolen_ | bbloom: pfaw - who evals cljs files anymore? let figwheel sort it out |
| 16:51 | bbloom | dnolen_: does figwheel do auto eval on save? i hate that. |
| 16:51 | dnolen_ | bbloom: it does, it's great! |
| 16:52 | bbloom | dnolen_: i hate that. |
| 16:52 | bbloom | dnolen_: i don't want to eval on save. i want to eval in a very particular order sometimes |
| 16:52 | bbloom | nullptr: https://gist.github.com/brandonbloom/60a3dc87969965573271 |
| 16:52 | bbloom | that's hacked up from anothe rproject |
| 16:52 | dnolen_ | bbloom: well there you go - people problems not technology ones |
| 16:52 | bbloom | i deleted a bunch of shit that was project specific |
| 16:53 | nullptr | bbloom: thanks, i get the idea -- simpler than expected |
| 16:54 | bbloom | nullptr: dramatically simpler than a lein plugin! |
| 16:54 | nullptr | "thanks, cljs.closure!" |
| 16:54 | dnolen_ | bbloom: yeah that file is gross |
| 16:54 | mlb- | is there a way I can create functions without using defmacro, or (eval `(defn ...)) ? |
| 16:54 | dnolen_ | bbloom: I'd take lein over that stuff anyday |
| 16:54 | mlb- | rather, can I create functions without using a macro, but instead a function *without* using eval? |
| 16:55 | dnolen_ | bbloom: and I've suffered bad lein days too |
| 16:55 | technomancy | bbloom: I luckily have avoided cljsbuild, but from what I've heard the situation there is pretty dire |
| 16:55 | amalloy | mlb-: that's kinda a weird question. (fn [x] (inc x)) is a function, and you don't need defn to make it. do you have a more overarching goal? |
| 16:55 | technomancy | which ... I mean it's been abandoned for how many years now? |
| 16:55 | bbloom | dnolen_: i get that you like auto-compile, but are there any other advantages that lein-cljs provide you? |
| 16:55 | technomancy | twice? |
| 16:56 | mlb- | amalloy: I'm trying to see if I'm needlessly using macros. I've a set of macros to provide covers to JavaScript implementations in a JVM ScriptEngine |
| 16:56 | bbloom | dnolen_: b/c the cost is that every time i try to set it up, i spend a ton of time and the result is that i get a workflow i don't like |
| 16:57 | dnolen_ | bbloom: not putting that crap in a source file - `lein with-profile (dev|prod) cljsbuild (auto|once)` works for me |
| 16:57 | bbloom | dnolen_: what's wrong with having it in a source file? |
| 16:57 | dnolen_ | bbloom: because I can't configure it without changing the source file |
| 16:58 | bbloom | dnolen_: isn't changing source file what you do all day long when working anyway? |
| 16:58 | dnolen_ | bbloom: anyways look at chestnut - it's a sensible config and a sane use of profiles and lein-environ |
| 16:58 | bbloom | my actual version of that file has a bunch of crap in a (comment ...) block |
| 16:58 | technomancy | inc on preferring changing source to changing project.clj-level stuff |
| 16:58 | bbloom | dnolen_: if it's built around auto-recompile, i'm not interested |
| 16:58 | amalloy | mlb-: have a look at ##(doc intern). but that doesn't sound like a terrible use of macros |
| 16:58 | lazybot | java.lang.SecurityException: You tripped the alarm! intern is bad! |
| 16:58 | mlb- | amalloy: the meat of it is something like: `(defn ~fn-name [&~'args] (apply js/js-new ~engine ~classname ~'args)) |
| 16:58 | technomancy | lol |
| 16:58 | technomancy | shame on you amalloy, trying to hack lazybot |
| 16:58 | dnolen_ | bbloom: which fine, but this is not what most people want |
| 16:59 | mlb- | amalloy: ah, okay. Just getting a sanity check to see that I'm not that far off the deep end |
| 16:59 | bbloom | dnolen_: seems weird to me, since i've never heard of anyone doing "auto compile" for normal jvm clojure projects |
| 16:59 | bbloom | dnolen_: i think autocompile is a goofy idea from rails etc universe that web devs have adopted b/c of the refresh cycle in browsers |
| 17:00 | technomancy | bbloom: or people who don't know how after-save-hooks work =) |
| 17:00 | bbloom | i want to press the refresh button in my browser as infrequently as i restart lein in my dev env |
| 17:00 | technomancy | (I'm sure there's a vim equivalent) |
| 17:00 | dnolen_ | bbloom: ^ |
| 17:00 | dnolen_ | bbloom: people already do this via various means in Clojure |
| 17:00 | bbloom | technomancy: do you use after-save-hooks to eval clojure files? |
| 17:00 | dnolen_ | bbloom: reload namespaces is a thing - there's even middle ware for it |
| 17:00 | dnolen_ | for ring |
| 17:01 | technomancy | bbloom: no, but if I wanted instant feedback, I sure as heck wouldn't be doing it in a lein plugin |
| 17:01 | bbloom | i save files so frequently and instinctually, i usualy save when the files would FAIL to compile |
| 17:01 | technomancy | but I don't actually want it, so yeah |
| 17:01 | bbloom | if it were up to me, files would always auto save w/o no save action |
| 17:02 | bbloom | on every damn keystroke |
| 17:02 | bbloom | but undo and commit are two different features |
| 17:02 | mlb- | technomancy: a hack I use is to start a nrepl with my ring server, then I can connect my vim to it and re-eval stuff in that JVM |
| 17:02 | bbloom | and save complects them |
| 17:02 | bbloom | i want durable undo to be automatic |
| 17:02 | bbloom | and commit (to my running env) to be explicit |
| 17:03 | bbloom | and i want to be able to commit individual expressions, not whole files |
| 17:03 | bbloom | i'm also a fan of git add -p :-) |
| 17:03 | AeroNotix | bbloom: I know someone who has their editor set up to commit to a branch on every save and then rebase squashes them before sending PRs |
| 17:03 | bbloom | AeroNotix: that sounds awesome |
| 17:04 | technomancy | inb4 smalltalk images |
| 17:04 | bbloom | technomancy: smalltalk images complect save and commit too, but standardize on commit instead of save :-P |
| 17:04 | amalloy | man, i save my files way too often for that to make sense. add a space, delete a space, save just in case |
| 17:04 | technomancy | never actually used it, other than via scratch |
| 17:04 | bbloom | although i guess "worlds" in the VPRI stuff is their solution |
| 17:04 | mdrogalis | technomancy: Haha :) |
| 17:05 | technomancy | my default assumption is that they got everything right decades ago and no one noticed |
| 17:05 | AeroNotix | amalloy: I know a monster who writes whole functions before saving |
| 17:05 | bbloom | amalloy: git can auto squash hundreds of commits, no problem |
| 17:05 | bbloom | thousands even |
| 17:05 | amalloy | bbloom: i'm aware of how to use git |
| 17:05 | AeroNotix | shots fired |
| 17:05 | bbloom | lol |
| 17:05 | bbloom | to me, it seems like vim's undo tree should just be git :-P |
| 17:05 | technomancy | bbloom: I once wrote a collaborative editing engine that used git rebase+auto-commit+mdns |
| 17:06 | technomancy | it sort of worked |
| 17:06 | AeroNotix | technomancy: wasn't that the thing on aws that used tmux sessions too? |
| 17:06 | technomancy | AeroNotix: same problem, different solution |
| 17:06 | AeroNotix | ah, that looked interesting |
| 17:06 | amalloy | but auto-squashing a zillion commits is so low-class. i prefer to squash manually so that i can come up with a legible commit log, not a single "do a million things" commit |
| 17:06 | devn | technomancy: what was that called again? |
| 17:06 | AeroNotix | technomancy: I always forget how to share tmux sessions ;) |
| 17:06 | AeroNotix | amalloy: nothing is stopping you from doing that |
| 17:07 | bbloom | amalloy: i prefer iterative refinement |
| 17:07 | amalloy | AeroNotix: if my editor made a new commit every time i saved, there would be a lot of commits that it would be hard to put together sensibly |
| 17:07 | bbloom | i usually have like 37973573 commits w/ the message "wip" |
| 17:07 | technomancy | devn: the git one? http://technomancy.us/113 |
| 17:07 | bbloom | and i squash every so often after a logical unit of work |
| 17:07 | bbloom | then i re-arrange multiple sensible commits before making a PR |
| 17:07 | technomancy | AeroNotix: http://tmate.io is actually a lot simpler for many cases |
| 17:08 | devn | technomancy: ah yeah, ebby |
| 17:09 | amalloy | bbloom: your approach is reasonable too, of course. git is flexible enough to support a lot of completely different workflows |
| 17:09 | bbloom | amalloy: i'm just saying i wouldn't mind if i had 237957935793 commits that were labeled with messages the same way MS Word labels the "Undo" menu entry |
| 17:09 | bbloom | "Undo typing 'the'" |
| 17:10 | AeroNotix | technomancy: I don't use a MacOSX operating device |
| 17:10 | AeroNotix | oh it's x-platform |
| 17:10 | AeroNotix | scratch that |
| 17:10 | bbloom | also, i love typing numbers with 3537953 digits |
| 17:10 | bbloom | it's 309753753 kinds of fun |
| 17:10 | amalloy | bbloom: i'd be interested in trying it, too. it sounds neat. i don't think i'd like it long-term, but who knows |
| 17:10 | technomancy | AeroNotix: it's pronounced macosecks |
| 17:10 | AeroNotix | I'm surprised how accurately you get the same set of numbers |
| 17:10 | AeroNotix | technomancy: make sex? |
| 17:11 | technomancy | better than war |
| 17:15 | AeroNotix | is there a function somewhere to take a compojure request/response map and turn it into what would get sent on the wire? |
| 17:16 | justin_smith | AeroNotix: ring? (lol) |
| 17:16 | rmarianski | AeroNotix: https://github.com/ring-clojure/ring/blob/dd98af112bd5d94d006570b84f507ac0df9b8068/ring-servlet/src/ring/util/servlet.clj#L105-L115 |
| 17:17 | rmarianski | it's the job of the adapters |
| 17:17 | AeroNotix | justin_smith: why lol? |
| 17:17 | numberten | this should be a oom error right? (let [[t d] (split-with #(< % 12) (range 1e8))] [(count d) (count t)]) |
| 17:17 | justin_smith | AeroNotix: you could call ring a program that turns requests into request maps, and response-maps into responses, that's pretty much what it is for - so it trivially does what you describe |
| 17:18 | numberten | whenever I run it lein repl hangs :/ |
| 17:18 | AeroNotix | justin_smith: but i want a function that takes the request map and returns the string |
| 17:18 | AeroNotix | just for debugging |
| 17:18 | justin_smith | ring doesn't send a string, it sends a response, it has things like headers etc. |
| 17:18 | justin_smith | well I guess there is a string form... |
| 17:18 | AeroNotix | nevermind |
| 17:19 | justin_smith | AeroNotix: it sounds like a great idea for a ring adaptor: one that gets a request as a string, and returns the response as a string, for testing and debugging |
| 17:19 | technomancy | AeroNotix: shell out to curl? =) |
| 17:19 | justin_smith | you could call it ring-string |
| 17:19 | justin_smith | or maybe string-ring |
| 17:19 | justin_smith | I should make that project |
| 17:20 | bja | (inc justin_smith) |
| 17:20 | lazybot | ⇒ 94 |
| 17:20 | AeroNotix | justin_smith: ring-sting? |
| 17:20 | rmarianski | st-ring |
| 17:20 | stuartsierra | HTTP is surprisingly complicated when you get down into the details. |
| 17:21 | AeroNotix | justin_smith: I need to look up how to make a ring-adapter then |
| 17:22 | justin_smith | stuartsierra: yeah, I would have no intention of making a fully http-complient thing, just enough to be able to feed it a request and get a testable response for a fairly vanilla handler function |
| 17:22 | amalloy | numberten: you'll run out of memory eventually |
| 17:22 | AeroNotix | Method, headers, body |
| 17:22 | AeroNotix | all it really needs |
| 17:23 | marcoslamuria | hello |
| 17:23 | numberten | amalloy: over an hour of waiting :/ |
| 17:24 | numberten | amalloy: and the version that releases the head only takes a few seconds, wouldn't you expect to see a oom exception in roughly the same time it takes to realize the whole seq? |
| 17:24 | amalloy | no. you're making a lot more work for the GC |
| 17:25 | amalloy | you allocate ten numbers, say, and then to allocate another you need to GC. so it scans the heap, finds ten million numbers it needs to keep, and a little ephemeral garbage it can clean up |
| 17:25 | justin_smith | numberten: the head does not escape scope, so it is not held onto |
| 17:26 | amalloy | justin_smith: yes it is. he has two references to the original seq |
| 17:26 | justin_smith | numberten: I have verified similar code in a profiler (amalloy probably remembers this, I had a weird bug) |
| 17:27 | justin_smith | amalloy: oh, count is enough to hold the head? I would have hoped it was smart enough to just have accumulated count + rest |
| 17:27 | amalloy | the value d isn't held onto, but while he's counting d he needs to hold onto t in order to count it |
| 17:27 | amalloy | and t needs to hold onto the range |
| 17:27 | amalloy | count doesn't hold any heads itself, of coruse |
| 17:32 | numberten | amalloy: yeah i'd just expect it to run out of space really quickly |
| 17:32 | numberten | since it can't gc any values |
| 17:32 | amalloy | numberten: it can gc some other stuff, though. cons cells in the split-with lazy seq |
| 17:32 | justin_smith | numberten: if you want to see a graph of gc / space usage, open up jvisualvm (comes with the jdk) and connect to your repl |
| 17:33 | justin_smith | numberten: it's a gui profiler, pretty self explanitory, gives nice graphs of metrics over time among other things |
| 17:33 | numberten | alright thanks |
| 17:33 | amalloy | you've made the job O(n^2) instead of O(n), where most of the time taken is inside the garbage collector |
| 17:34 | numberten | but wouldn't the non-head-retaining one also have to gc as much stuff? |
| 17:34 | numberten | can you explain where the ^2 comes from in that? |
| 17:34 | amalloy | yes, but the extra work is not "things it can gc", but "things it has to scan over while gcing" |
| 17:35 | numberten | ahhhh |
| 17:35 | numberten | i see |
| 17:35 | numberten | thanks :) |
| 17:35 | amalloy | because a huge portion of the process's memory is uncollectable |
| 17:35 | numberten | yeah |
| 17:35 | numberten | i get it |
| 17:35 | numberten | that's interesting |
| 17:35 | numberten | very cool |
| 17:37 | numberten | so gc time grows proportionally with the number of allocated things? |
| 17:37 | numberten | and when many of the those can't be gc'ed, it won't shrink |
| 17:37 | numberten | and possibly continue to grow? |
| 17:37 | numberten | amalloy: just to make sure I followed you :) |
| 17:38 | amalloy | well, the time taken to do a full gc |
| 17:38 | amalloy | but for minor collections, where most stuff is collectable, you don't really pay that cost |
| 17:39 | numberten | i see |
| 17:39 | amalloy | because the gc algorithm the jvm uses for minor collections is just "copy anything that's still alive into a new place, and mark the entire old place as reusable" |
| 17:40 | amalloy | so there's no cost that scales with things that are collected, until they've been alive long enough to be promoted into oldgen |
| 17:42 | amalloy | tldr gc is really complicated and anytime you think you know what's going on you're wrong |
| 17:43 | bbloom | amalloy: case in point, if you've got finalizers or weak refs, the copying collector needs to visit dead objects too! |
| 17:45 | amalloy | uhhhhh, weak refs, or phantom refs? i don't really know how weak refs fit into the gc plan, but kinda thought it would be in a way that doesn't create substantial extra work |
| 17:45 | bbloom | weak and phantom refs have the same mechanism, but just have a slightly different policies |
| 17:46 | bbloom | they basically go in a big table of special refs |
| 17:46 | bbloom | same time as finalizers, i believe |
| 17:46 | bbloom | or another table problem too |
| 17:46 | bbloom | probably* |
| 17:46 | bbloom | lots of tables |
| 17:46 | bbloom | heh |
| 17:48 | amalloy | bbloom: interesting. do you know where i can read about the mechanism? |
| 17:49 | bbloom | amalloy: http://www.amazon.com/The-Garbage-Collection-Handbook-Management/dp/1420082795 |
| 17:49 | bbloom | amalloy: i'm sure there's somewhere else, heh |
| 17:50 | bbloom | but i just finished reading that, and it's covered reasonably well in there |
| 17:50 | amalloy | hm. i've read his "Garbage Collection: Algorithms for Automatic Dynamic Memory Management" |
| 17:50 | amalloy | or maybe i only got halfway through |
| 17:50 | bbloom | the jvm gets a fair bit of plan, since lots of GC researchers use ibm's research jvm as a test env |
| 17:50 | bbloom | s/plan/play |
| 17:50 | bbloom | man, i can't type even more than usual today |
| 17:51 | DomKM | Are there any good examples out there of a transient set implementation with deftype? I'm having trouble finding the right interfaces. |
| 17:51 | bbloom | ,(transient #{}) |
| 17:51 | clojurebot | #<TransientHashSet clojure.lang.PersistentHashSet$TransientHashSet@1351137> |
| 17:52 | bbloom | ,(-> #{} transient class supers) |
| 17:52 | clojurebot | #{java.lang.Runnable clojure.lang.ATransientSet clojure.lang.Counted clojure.lang.AFn clojure.lang.ITransientSet ...} |
| 17:52 | amalloy | DomKM: i kinda have one |
| 17:52 | bbloom | DomKM: run that locally, start there |
| 17:52 | amalloy | https://github.com/flatland/ordered/blob/develop/src/flatland/ordered/set.clj#L97 |
| 17:52 | DomKM | bbloom: my background isn't in Java; I was hoping to avoid stumbling around for a few hours |
| 17:53 | bbloom | (doc supers) ; DomKM |
| 17:53 | clojurebot | "([class]); Returns the immediate and indirect superclasses and interfaces of c, if any" |
| 17:53 | DomKM | thanks amalloy! |
| 18:22 | mdeboard | How do you guys do code-folding in Emacs+CIDER |
| 18:26 | justin_smith | mdeboard: hs-mode |
| 18:26 | justin_smith | hs-minor-mode that is |
| 18:26 | mdeboard | ok |
| 18:26 | justin_smith | it's nice, but you need to fix the default keybindings (those suck) |
| 18:26 | mdeboard | The keybinds for that are pretty onerous,I'm rebinding to C-c M-s and C-c M-h |
| 18:27 | mdeboard | haha |
| 18:27 | mdeboard | yeah |
| 18:27 | justin_smith | jynx |
| 18:27 | mdeboard | C-c @ C-h ? |
| 18:27 | mdeboard | I mean, good god |
| 18:27 | mdeboard | What do you use? |
| 18:27 | justin_smith | mdeboard: rember that C-c [a-zA-Z] are all reserved for your use and will never be used by a behaving emacs mode |
| 18:27 | mdeboard | Oh, right |
| 18:27 | mdeboard | good call |
| 18:30 | amalloy | i love that rule. i have like six or eight things on C-c [letter] |
| 18:32 | justin_smith | mdeboard: I use the following file full of keybindings that I call "outline-stuff.el" https://www.refheap.com/91922 |
| 18:32 | justin_smith | I have a super-decomposed .emacs |
| 18:33 | justin_smith | it's using outline mode not hide-show, I had forgotten |
| 18:33 | mdeboard | hm |
| 18:33 | mdeboard | Never heard of that minor mode, sweet, thanks |
| 18:40 | justin_smith | mdeboard: hmm - that code is not working for the global "hide sublevels" command, but it does work for collapsing individual blocks |
| 18:40 | mdeboard | ya I'm chalking it up to look up later |
| 18:40 | mdeboard | For now hs-mode and C-c h/s works quite well |
| 18:40 | mdeboard | thanks for that reminder |
| 18:41 | justin_smith | yeah, I may go back to hs-mode myself now that I take a closer look... |
| 18:53 | arrdem | is there a good writeup of core.match somewhere? I'm not even seeing a writeup of the pattern notation. |
| 19:00 | Bronsa | arrdem: https://github.com/clojure/core.match/wiki/Basic-usage |
| 19:04 | arrdem | yeah. found that link reading a copy of the clojure cookbook I found googling. |
| 19:26 | dopamean_ | why does (clojure.string/split "dopamean" #"") return a vector starting with an empty string? |
| 19:32 | justin_smith | ,(clojure.string/split "dopamean" #"") |
| 19:32 | clojurebot | ["" "d" "o" "p" "a" ...] |
| 19:32 | justin_smith | weird, it does that here, but not in my local repl |
| 19:33 | justin_smith | &(clojure.string/split "dopamean" #"") |
| 19:33 | lazybot | ⇒ ["" "d" "o" "p" "a" "m" "e" "a" "n"] |
| 19:33 | dopamean_ | every time i needed a list of chars from a sring like that i was doing (rest .... |
| 19:33 | dopamean_ | then i recently discovered (char-array |
| 19:33 | hiredman | ,(seq "foo") |
| 19:33 | clojurebot | (\f \o \o) |
| 19:33 | justin_smith | ,(seq "dopamean") |
| 19:33 | clojurebot | (\d \o \p \a \m ...) |
| 19:33 | dopamean_ | interesting |
| 19:33 | dopamean_ | that actually may have been more useful |
| 19:33 | hiredman | ,(map int "foo") |
| 19:33 | clojurebot | (102 111 111) |
| 19:34 | justin_smith | but string/split does not return a list of chars, it returns a vector of strings |
| 19:34 | dopamean_ | ,(char-array "dopamean") |
| 19:34 | clojurebot | #<char[] [C@59b2e> |
| 19:34 | hiredman | ,(map int (char-array "foo")) |
| 19:34 | clojurebot | (102 111 111) |
| 19:35 | dopamean_ | ,(apply list (char-array "dopamean")) |
| 19:35 | clojurebot | (\d \o \p \a \m ...) |
| 19:35 | bostonaholic | this is the behavior of http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#split(java.lang.CharSequence) |
| 19:35 | bostonaholic | as well as http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#split(java.lang.String) |
| 19:35 | dopamean_ | right. i guess for my basic use today it didnt really matter if i got back a vector of string or a list of chars |
| 19:35 | justin_smith | ,(apply str (map (comp char dec int) "IBM")) |
| 19:35 | clojurebot | "HAL" |
| 19:36 | amalloy | the problem with using #"" as a split is that it matches anywhere, without consuming even one character |
| 19:36 | justin_smith | amalloy: any idea why my local clojure 1.7-alpha java 8 repl would not match the first empty string? |
| 19:37 | amalloy | justin_smith: clojure version certainly doesn't matter. maybe java 8 changed how split works |
| 19:38 | dbasch | amalloy: why would they change something like split? |
| 19:38 | justin_smith | yeah, that has to be the difference, it's a weird one though |
| 19:38 | dbasch | http://stackoverflow.com/questions/22718744/why-does-split-in-java-8-sometimes-remove-empty-strings-at-start-of-result-array |
| 19:38 | justin_smith | but I am sitting here with a java 8 repl, and not getting the empty string at the beginning |
| 19:39 | justin_smith | ahh! |
| 19:39 | justin_smith | (inc dbasch) |
| 19:39 | lazybot | ⇒ 14 |
| 19:39 | dopamean_ | man |
| 19:39 | dopamean_ | i was beginning to feel a little crazy here |
| 19:39 | nullptr | hey, at least we can "blame java" |
| 19:40 | dopamean_ | as long as its not me |
| 19:41 | dopamean_ | ,(type (char-array "dopamean")) |
| 19:41 | clojurebot | [C |
| 19:41 | dopamean_ | wtf is that |
| 19:42 | dopamean_ | was expecting something more along the line of clojure.lang.Charsomethingortheother |
| 19:42 | amalloy | dopamean_: http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3 |
| 19:43 | dbasch | dopamean_: the string representation of the class arrays of native types is something like [X |
| 19:43 | dbasch | e.g. [B for byte array |
| 19:43 | dopamean_ | ahhhh. ok. thanks a lot |
| 19:43 | dbasch | &(class (float-array [1.0])) |
| 19:43 | lazybot | ⇒ [F |
| 19:53 | squeedee | I'm having a blast learning some clojure |
| 20:03 | squeedee | Is there a way to map two colls such that the longest collection is used, and nil stands in for the shorter one? |
| 20:04 | technomancy | concat the shorter with (repeat nil) maybe |
| 20:05 | amalloy | technomancy: works iff you know which is shorter |
| 20:05 | technomancy | indeed |
| 20:05 | technomancy | eh just do it on both; what's the worst that could happen |
| 20:06 | justin_smith | ,(def worst-that-could-happen (repeatedly #(nil))) |
| 20:06 | clojurebot | #<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0:0)> |
| 20:06 | amalloy | that special-casing of (nil) has always seemed silly to me |
| 20:07 | justin_smith | ,(def almost-as-bad (repeatedly #(/ 0 0))) |
| 20:07 | clojurebot | #'sandbox/almost-as-bad |
| 20:08 | squeedee | hmm |
| 20:09 | amalloy | like, why doesn't clojure let me compile (fn [] (nil)) if i don't plan to ever call it? i can imagine a macro generating code like that |
| 20:10 | EvanR | has any one had success setting up vim and fireplace.vim |
| 20:10 | technomancy | huh that's the first time I've ever heard anyone complain about clojure being *too* strict around nil |
| 20:10 | technomancy | actually now I can't tell if it's serious |
| 20:10 | justin_smith | EvanR: rumor has it there is at least one user |
| 20:11 | EvanR | i can use the repl functionality, but it cant find any of my jars when i try to run my code |
| 20:11 | technomancy | I heard the pope uses fireplace |
| 20:11 | EvanR | i really wonder if he does |
| 20:12 | justin_smith | EvanR: do you connect to a project repl? if you run (.getCanonicalPath (java.io.File. ".")) do you see the expected project directory? |
| 20:12 | EvanR | yes |
| 20:12 | justin_smith | and when you say "cant find your jars" do you mean you try to require namespaces and it can't find them? what does your code to require the ns look like? |
| 20:13 | EvanR | i was wondering the same thing but didnt know how to test, whether the repl was running on the project correctly |
| 20:13 | EvanR | i was trying :Require |
| 20:13 | EvanR | which did... |
| 20:13 | justin_smith | (require '[your.ns :as alias]) |
| 20:13 | EvanR | (require 'gangway.google-cloud-storage :reload) |
| 20:13 | justin_smith | ,(:require 'anything :reload) ; is a noop |
| 20:13 | clojurebot | :reload |
| 20:14 | justin_smith | you need to leave off the : |
| 20:14 | EvanR | seems like a bug in the command right |
| 20:14 | justin_smith | nope |
| 20:14 | justin_smith | ,(:any-keyword 'whatever :something-else) |
| 20:14 | clojurebot | :something-else |
| 20:14 | justin_smith | that's how keywords work |
| 20:14 | justin_smith | you want 'require' the function, not ':require' the keyword |
| 20:15 | justin_smith | oh wait... |
| 20:15 | EvanR | yeah, thats just the command that fireplace is emitting when i use the :Require command in vim |
| 20:15 | justin_smith | I totally misread |
| 20:15 | EvanR | im trying the no colon version to make sure it works |
| 20:15 | justin_smith | oh, :Require the vim command |
| 20:15 | justin_smith | yeah, just try it in the repl first, sorry - I don't know the vim commands so I was confused |
| 20:16 | EvanR | try what exactly |
| 20:16 | EvanR | right now my requires work in intellij with :require because its inside of a ns macro |
| 20:16 | EvanR | it seems |
| 20:16 | dustingetz | i am a clojurescript newbie, i have a cljs project with one .cljs file that i want to include via a git submodule in a second cljs project |
| 20:16 | justin_smith | EvanR: right, that's now the ns macro works |
| 20:17 | dustingetz | how do i configure the parent project's project.clj to know about the submodule |
| 20:17 | justin_smith | so, after (require 'gangway.google-cloud-storage :reload) runs, can you call foo as (gangway.google-cloud-storage/foo ...) |
| 20:17 | justin_smith | substitute an actual function of course |
| 20:17 | justin_smith | if so, use the :as version I described above to get a usable alias |
| 20:17 | EvanR | justin_smith, yeah, that results in the same thing. which is: ClassNotFoundException com.google.api.client.http.GenericUrl java.net.URLClassLoader$1.run (URLClassLoader.java:372) |
| 20:17 | nullptr | dustingetz: so there are two project.clj files? |
| 20:18 | EvanR | justin_smith, the require |
| 20:18 | justin_smith | ahh |
| 20:18 | dustingetz | that is correct, both are trivial other than standard cljs stuff |
| 20:18 | justin_smith | so, how are you specifying the class dependency for google.blah.GenericUrl? |
| 20:19 | EvanR | the dependencies are listed in my project.clj |
| 20:19 | nullptr | dustingetz: i haven't seen that done -- normally they would be side-by-side and communicate via lein deps |
| 20:19 | dustingetz | How can I do that, while keeping the git repos separate |
| 20:19 | dustingetz | just a pointer in the right direction is enough |
| 20:19 | justin_smith | EvanR: and if you run lein deps :tree in the project directory do you see the artifact you expect in the output? |
| 20:20 | EvanR | justin_smith, sorry, still getting used to this damned laptop keyboard |
| 20:20 | EvanR | can you repeat that |
| 20:20 | justin_smith | lein deps :tree |
| 20:20 | nullptr | dustingetz: i suppose you could have each being a submodule with a parent that just organizes them, not sure if that makes sense in your case |
| 20:20 | justin_smith | if you run that in the project dir, do you see the artifact in there that would include that class? |
| 20:21 | dustingetz | thanks i think that's enough of a hint, thank you |
| 20:23 | nullptr | dustingetz: no problem -- did your work on react-cursor inspire a closer look at cljs? |
| 20:23 | EvanR | justin_smith, no particularly, now that i look at project.clj, i dont even know what that would be |
| 20:23 | EvanR | not* |
| 20:24 | EvanR | i assumed it was working in intellij due to some anonymous dependency |
| 20:24 | dustingetz | ha! no, i'm just finally disentangled from all my javascript commitments |
| 20:24 | EvanR | this error is about the first import in my file, but maybe its a coinsidence and i need to list the actual library |
| 20:25 | justin_smith | EvanR: how do you manage your deps with this project? |
| 20:26 | justin_smith | sorry, back scrolling, you are using lein and project.clj, I just mis-parsed a statement |
| 20:26 | EvanR | justin_smith, theres a project.clj and intellij occasionally says "synchronizing leiningin" |
| 20:27 | justin_smith | EvanR: clearly the solution is to explicitly include the artifact that includes that google lib in your project.clj |
| 20:27 | EvanR | im still in the process of understanding what any of this even means |
| 20:27 | justin_smith | OK |
| 20:27 | EvanR | i dont see anything google relateed in my project so wtf |
| 20:27 | EvanR | i will try that |
| 20:28 | justin_smith | project.clj describes your deps - all external code other than stuff that comes with the jvm should be specified there |
| 20:28 | EvanR | does the system support downloading and installing deps and using them without them being in that project.clj? |
| 20:29 | justin_smith | EvanR: it's possible, but it's not worth it, it's a pain in the ass |
| 20:29 | technomancy | is this cljs? |
| 20:29 | EvanR | i am realizing |
| 20:30 | justin_smith | technomancy: com.google.api.client.http.GenericUrl java.net.URLClassLoader$1.run (URLClassLoader.java:372) makes me think no |
| 20:30 | technomancy | oh gotcha. |
| 20:30 | EvanR | you know what the ssue might be, there is a plausible dep listed in a project clj which is in a sibling dir to my project dir, but both are shown in the intellij file tree. maybe it is just downloading all deps in sight and treating this as one huge big project |
| 20:30 | EvanR | cljs? |
| 20:30 | justin_smith | technomancy: to me it looks like he was using intellij which was doing some magic with the deps, and is now transitioning to vim |
| 20:30 | clojurebot | cljs is not the place to be if you want your code to stay the same month to month. |
| 20:30 | technomancy | EvanR: one of your dependencies needs a dependency on a google lib or something maybe |
| 20:31 | justin_smith | EvanR: I bet that is it - but if your project uses an artifact, it should be declared in the deps of that project |
| 20:31 | EvanR | yes |
| 20:31 | EvanR | doing it |
| 20:32 | EvanR | would be really stupid if i dump a working vim environment because of something unrelated |
| 20:33 | EvanR | ok vim took a little while to load, seems plausible |
| 20:34 | justin_smith | EvanR: were you using cursive previously? |
| 20:34 | EvanR | what was the command i was supposed to run, :Require did not succeed |
| 20:34 | EvanR | yes |
| 20:35 | alexbaranosky_ | requie |
| 20:35 | justin_smith | you may want to report what happened as a but in the project sync - cfleming is the cursive dev |
| 20:35 | alexbaranosky_ | oops mistype... :) |
| 20:35 | alexbaranosky_ | irc on the phone. uts a beautiful world |
| 20:36 | justin_smith | (require 'gangway.google-cloud-storage :reload) - and maybe just try this in a lein repl instance |
| 20:36 | justin_smith | that takes out at least one point of failure |
| 20:36 | EvanR | ok |
| 20:37 | EvanR | ah |
| 20:37 | EvanR | new error, cant load something else, also not in my deps i think |
| 20:38 | EvanR | light at the end of the tunnel |
| 20:38 | justin_smith | shortcut: "lein check" |
| 20:38 | justin_smith | that will compile all your namespaces, and report any errors |
| 20:38 | justin_smith | without any repl interaction needed |
| 20:38 | EvanR | reflection warnings |
| 20:38 | justin_smith | then just chase down the missing classes |
| 20:38 | justin_smith | yeah, that too :) |
| 20:38 | justin_smith | I guess lein compile would be more straightforward in this case maybe |
| 20:39 | justin_smith | but anyway, a missing class should throw an error |
| 20:39 | EvanR | this particular program is doing a bunch of network and db connections at the top level, so its having trouble compiling because those remote hosts arent running, im glad you made me run that so i realize how much that needs to not happen |
| 20:40 | justin_smith | right, this would be a problem eventually no matter waht :) top level side effects are bad |
| 20:41 | EvanR | gotta love several shitstorms at once lol |
| 20:42 | justin_smith | heh |
| 20:42 | justin_smith | now who lined up the feces and did the rain dance, you might ask? |
| 20:44 | EvanR | what the hell library is this supposed to be in |
| 20:44 | justin_smith | google is often very helpful finding a mvn dep to go with a random class name, in my experience |
| 20:45 | arrdem | Bronsa: is there a way to exclude class aliases? |
| 20:45 | EvanR | right |
| 20:46 | Bronsa | arrdem: what do you mean? exclude from the auto import? |
| 20:46 | arrdem | Bronsa: yeah |
| 20:46 | Bronsa | arrdem: no, you have to manually ns-unmap them |
| 20:46 | arrdem | Bronsa: use case being (defrecord Package) |
| 20:46 | arrdem | damnit. okay thanks. |
| 20:46 | arrdem | (inc Bronsa) |
| 20:46 | lazybot | ⇒ 63 |
| 20:47 | EvanR | ok all these deps were already in the project, i think something happened with git and they got reverted |
| 20:47 | EvanR | probably my fault |
| 20:47 | justin_smith | ahh, some weird git / intellij interaction then |
| 20:48 | EvanR | yeah, closing intellij right now |
| 20:49 | arrdem | Bronsa: yeah that worked. thanks. |
| 20:51 | arrdem | Bronsa: hey hey check this out |
| 20:52 | arrdem | Bronsa: (do (ns-ummap *ns* 'Class) (defrecord Class [])) |
| 20:54 | mdeboard | pwned |
| 20:54 | EvanR | i cant believe it, it all works now |
| 20:54 | EvanR | justin_smith, thanks |
| 20:54 | EvanR | im probably going to be lurking here a lot for a while |
| 20:55 | Bronsa | arrdem: ummap? |
| 20:55 | clojurebot | I don't understand. |
| 20:55 | arrdem | Bronsa: that's me failing at typing. unmap. |
| 20:56 | arrdem | this may be a reloading related issue not a strict compiler bug, but that's killing my 1.6 instance |
| 20:56 | Bronsa | arrdem: uhm, it works fine on my repl |
| 20:56 | amalloy | you and 700 other people, EvanR |
| 20:57 | dbasch | most of us are bots |
| 20:57 | Bronsa | arrdem: I'm not sure I would recommend ns-unmapping java.lang.* Classes TBH. really weird things might happen w/ type hinting |
| 20:57 | arrdem | dbasch: speak for yourself. some of us have feelings. |
| 20:58 | dbasch | arrdem: tell me more about some of us have feelings |
| 20:58 | EvanR | automatic love |
| 20:58 | arrdem | (inc dbasch) |
| 20:58 | lazybot | ⇒ 15 |
| 20:58 | EvanR | (/ 99 0) |
| 20:58 | dbasch | &(/ 99 0) |
| 20:58 | lazybot | java.lang.ArithmeticException: Divide by zero |
| 20:58 | arrdem | Bronsa: https://github.com/clojure-grimoire/grimoire/blob/3c285da0e77b8d5e45d5be1b93e6bbf7b26be319/src/grimoire/web/api.clj |
| 20:59 | EvanR | (/ 99.0 0.0) |
| 20:59 | justin_smith | EvanR: inc is a bot command that only looks kind of like clojure code, it actually just mutates a database of karma |
| 20:59 | EvanR | oh |
| 20:59 | justin_smith | you need , or & to activate the bots |
| 20:59 | arrdem | some of us only get & |
| 20:59 | justin_smith | ,(= (/ 99.0 0.0) (/ 99.0 0.0)) |
| 20:59 | clojurebot | true |
| 21:00 | EvanR | &(unsafe-launch-missiles :fort-knox) |
| 21:00 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: unsafe-launch-missiles in this context |
| 21:00 | justin_smith | ,(launch-missiles! intern) |
| 21:00 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: launch-missiles! in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 21:00 | EvanR | time to figure out these god awful Meta-keycombos to do slurp and barf |
| 21:01 | EvanR | which do not work as advertised |
| 21:01 | justin_smith | ,(= (/ 0.0 0.0) (/ 0.0 0.0)) |
| 21:01 | clojurebot | false |
| 21:01 | EvanR | no NaN constants, as usual |
| 21:02 | EvanR | &(+ 4 NaN) |
| 21:02 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: NaN in this context |
| 21:02 | EvanR | &(+ 4 4.0) |
| 21:02 | lazybot | ⇒ 8.0 |
| 21:03 | justin_smith | ,(= Double/NaN Double/NaN) ; EvanR |
| 21:03 | clojurebot | false |
| 21:03 | EvanR | ah |
| 21:04 | EvanR | seeing double now |
| 21:04 | EvanR | double NaN gum |
| 21:07 | dustingetz | anyone know if lein cljsbuild compatible with lein "checkouts" directory? |
| 21:08 | dustingetz | as soon as I started using a checkouts directory to refer a sibling project, I stopped seeing js files for my cljs dependencies |
| 21:08 | dustingetz | *compiled js files |
| 21:08 | EvanR | justin_smith, and if i try to use [d to jump to definition for symbol, i get ClassNotFoundException clojure.repl java.net.URLClassLoader$1.run (URLClassLoader.java:372) |
| 21:10 | justin_smith | that's very weird - try (require 'clojure.repl) |
| 21:10 | justin_smith | and if that makes it work, maybe report an issue with fireplace |
| 21:11 | justin_smith | afk going out to a show |
| 21:12 | sevvie | Arcadia is very impressive. |
| 21:13 | EvanR | it works thanks |
| 23:42 | ddellacosta | ,(println "hello") |
| 23:42 | clojurebot | eval service is offline |
| 23:51 | quizme | i'm trying to use subseq on a sorted-set of hash-maps, sorted by a particular key, but it doesn't seem to be working. can somebody give me an example of how to do this? |