#clojure logs

2014-12-20

02:04abaranoskyanyone out there who's used Reagent?
02:05abaranoskyI'm trying to get the simple-component from the reagent docs to work and I'm getting the JS equivalent of a null pointer exception
02:05abaranoskyI wonder if somehow I've got the wrong version of React under the hood
02:05abaranoskyjs/React shows a react version of "0.9.0"
02:06abaranoskyI'm using reagent "0.5.0-alpha"
02:13abaranoskydang noone's aroudn?
03:05TEttinger2ugh, I'm in a debugging nightmare with lazybot
03:06TEttinger2I can get $google to work, some of the time
03:06TEttinger2but only if the first result of the search uses https
03:06TEttinger2and I have no idea how with-open and clojure.java.io/reader interoperate
04:22expezabaranosky: reagent appears to target react 0.12.2
05:11borkdudeis lib-noir still the go to library for handling sessions in web applications in clojure
05:11borkdudehaven't looked at this for a while
05:15borkdudewhat was that website again where you can check how many projects depend on some library
05:58hyPiRionborkdude: crossclj?
06:17m1dnight_Might be a stupid question, but is clojure an interpreted language?
06:17m1dnight_(I know java is jit'ed, but in a sense it's still a compile dlanguage, no?)
06:18expezm1dnight_: all clojure code is compiled
06:18Bronsam1dnight_: yes, clojure is compiled to jvm bytecode
06:18m1dnight_oh okay :)
06:18m1dnight_thanks
07:00jonathanjis there a form of -> that returns early if a subform returns nil?
07:01jonathanj(-> [] first inc) => nil / (-> [1] first inc) => 2
07:02expezjonathanj: some->
07:03jonathanjexpez: fantastic! thank you!
07:38borkdudehyPiRion yes, how can you see in that website how much and by what a lib is used?
07:40hyPiRiongood question
07:40hyPiRionI thought it did, but it doesn't seem like it
07:40hyPiRionclojars have download stats though, but it doesn't list reverse deps
09:02crispinhey guys
09:03crispinhow do I use non-clojars/maven source for dependencies and lein plugins in leiningen?
09:03crispinsay I need a lein plugin. latest version is 0.1. But the github master branch has bugfixes I want to use
09:03crispinhow do I specify this dependency so it doesnt download it, but uses some local path
09:04crispinsame question with dependencies and plugins
09:04expezcrispin: https://github.com/kumarshantanu/lein-localrepo
09:05crispinah cheers expez! will try
09:19noncom|3what is the best and latest and coolest doc/reading on transducers and explanation on how to use them ?
09:41zandAnyone else getting a "nth not supported" error when using 'lein new template' command?
09:42zandI tried a couple of different reagent templates and I'm getting the same result
09:42zandusing lein 2.5.0
09:42noncom|3zand: nope, never
09:42noncom|3that must be an error in the template?
09:43zandyes, possible - weird though that I'm getting the same error on different templates
09:43zandany hints on debugging lein templates? :-)
09:44noncom|3what exactly is this template?
09:44zandhttps://github.com/reagent-project/reagent-template
09:44noncom|3if it is installed with a 3rd party lib, i guess you must check that out
09:45zandit's the default reagent template for lein
09:45noncom|3well, it is obvious that nth is being used on something that is not an ordered sequence
09:46noncom|3other than that,.. it is hard to say..
09:46noncom|3what is the exact stack trace?
09:47zandhttp://pastebin.com/8ug0nbDH
09:48zandit would be great if clojure stack traces referred to a line in clojure code :-/
09:49noncom|3well, it actually does hre
09:49noncom|3*here
09:49noncom|3leiningen.core.project$dependency_map.invoke (project.clj:77)
09:49noncom|3it cant process the deps
09:50zandisn't that what source maps solves?
09:50noncom|3not sure what you're talking about..
09:51noncom|3btw: java.lang.UnsupportedOperationException: nth not supported on this type: Symbol
09:51zandwhen you say "it can't process the deps" I was assuming that you meant clojure can't figure out the line of the error from the clojure sources
09:52noncom|3no, i meant it cannot process the dependencies vector of the app/template
09:52noncom|3cannot resolve the project dependencies
09:52noncom|3for them are a symbol, not a []
09:52noncom|3for some reason..
09:53zandok, well it's a hint to start looking. I love clojure but it's a serious step backwards in the debugging dept vs other languages where you get the link in your sources.
09:54zand*line in your source files
09:54noncom|3zand: well usually it does
09:55noncom|3here it does too
09:55noncom|3the thing is that the error occures in leiningen, not in the template itself
09:55noncom|3template is data here
09:55noncom|3*but*
09:55noncom|3too bad that it does not print out the data that caused the error
09:57zandso when it mentions the line where the error happens (project.clj:77) is that the project.clj of the template?
09:58noncom|3zand: https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/project.clj#L77
09:58noncom|3no. the error is *in leiningen*
09:58noncom|3so the stack trace is that of leiningen
09:58zandah, ok - thanks for the clarification
09:59noncom|3zand: you can recompile leiningen with added debug output for that function :D
09:59noncom|3and seeee what data exactly causes hte issue
09:59zandthanks - I'll check that out...
10:01noncom|3zand: i'd say that the "dep" thing that comes inside the function is not a [] as it is expected to be, but symbol
10:01noncom|3zand: don't you merge the tamplate with any of your own configs?
10:02zandnot usually - in practice you usually do something like : "lein new <template-name> <your-project-name>" and it sets up the project for you based on the template
10:04noncom|3zand: so, then the error is in the template - probably it does not meet the spec
10:04noncom|3try removing the {{{}}} elements from it..
10:05noncom|3can't help more though :)
10:05zandthat's what i'm guessing - grepping the template for 'dependency-map' brings up nothing...
10:06zandoh well, I'll open a ticket on the template and keep hacking away on it in the meantime.
10:06zandthanks for your help!
10:16zandlooks like it might be a lien bug after all...
10:17zanddoing 'lein repl' from the cli gives the same error with a fresh install of lein
10:41noncom|3zand rather strange
10:42noncom|3i dont think lein is *that* bugged
10:42noncom|3maybe you have some user profiles..
11:05luxbockhow does one type hint a double-array?
11:05luxbockwas it just ^"[D"?
11:06luxbockI only remember there was something weird about it
11:06luxbockerrr there's ^doubles
11:10gfredericksyeah that other syntax probably is only needed for nested arrays or something
11:14TEttingergfredericks, correct
11:14TEttinger$google metadata and the medusa
11:14lazybot[Building a Sustainable Metadata Workflow for Audio ... - IFLA Library] http://library.ifla.org/94/1/124-edge-en.pdf
11:14TEttingerwho fixed lazybot?
11:15TEttingerhttp://www.learningclojure.com/2010/09/macros-and-type-hints-metadata-and.html
11:17TEttingeralso, http://asymmetrical-view.com/2009/07/02/clojure-primitive-arrays.html
11:19TEttingerdouble[][] in java becomes [[D in bytecode, which clojure can type hint as ^"[[D"
11:20m1dnight_guys, could somebody help me out with a macro? I want to write one that takes 0 or more arguments but it fails on me
11:20m1dnight_atm I have e.g., (defmacro f [& args] `(println ~args))
11:20m1dnight_(f) works, but (f 1) does not
11:21TEttinger,(defmacro f [& args] `(println ~@args))
11:21clojurebot#'sandbox/f
11:21TEttinger,(f 1)
11:21clojurebot1\n
11:21TEttinger,(f)
11:21clojurebot\n
11:21m1dnight_oh
11:21TEttinger,(f 1 2 3)
11:21clojurebot1 2 3\n
11:21TEttingeryay, my first macro
11:21TEttinger(that works)
11:22m1dnight_oh great that works
11:22m1dnight_thanks! :)
11:22TEttingerno prob
11:22m1dnight_(inc TEttinger)
11:22lazybot⇒ 33
11:31emaczenwhat server does 'lein ring server' actually run?
11:31weavejesteremaczen: Jetty, the Ring default
11:51luxbockcan I transmit deftype'd classes over transit-clj/cljs?
12:03dnolen_luxbock: sure you just need to install handlers for those types
12:04luxbockdnolen_: are handlers defined in *data-readers*?
12:05dnolen_luxbock: Transit documentation covers this - nothing to do w/ data literals
12:06luxbockdnolen_: alright thanks
12:06dnolen_luxbock: https://github.com/cognitect/transit-js/wiki/Getting-Started
12:07luxbockhow I wish someone had ported potemkin over to CLJS :)
12:32m1dnight_Is it possible to write my own exception FooException in Clojure, that has a field? Atm I'm using ExceptoinInfo but it's a bit cluttered
12:32m1dnight_Or am I best to do this in java?
12:33m1dnight_I can't find any decent documentation on how to do it
12:40bbloomm1dnight_: if you genuinely need a field for jvm interop, just use java
12:41bbloomsimply add a .java file to your src directory and you're good
12:59dnolen_luxbock: realized transit-cljs docs were in a bad state compared to transit-js, fixed https://github.com/cognitect/transit-cljs/wiki/Getting-Started
13:16andyfBronsa: I don?t see any :resolved-op metadata for ns forms. Is that because ns is a special case, perhaps?
13:16Bronsais it? I can't rememberr
13:16Bronsaandyf: I'll check in a second and let you nkow
13:16andyfIt might not be, and this is a bug or missing case in t.a(.j).
13:17Bronsaandyf: http://sprunge.us/SQQI?clj
13:18andyfLooks good there. I'll keep checking and let you know if I figure it out.
13:18Bronsaandyf: just tried without #'trim and it's still there
13:19andyfMaybe try a bigger ns form that causes fix for Gilardi scenario to kick in?
13:19andyfOr that one might already...
13:19Bronsaah, right
13:19Bronsausing analyze+eval I don't see resolve-op indeed
13:20andyfI do see resolved-op for many forms, but I haven't characterized which ones yes and which ones no.
13:20Bronsayeah I see what's going wrong now
13:21Bronsagive me a minute and I'll commit a fix
13:21andyfAny chance Clojure/West in Portland, Oregon at a date to be announced would fit into your schedule?
13:21andyfprobably depends on the date, but curious.
13:24Bronsaandyf: check now
13:24andyfok
13:24Bronsaandyf: yeah depends on the date, but.. I hardly see having time this year :(
13:25andyfunderstood. School makes time precious, I'm sure.
13:26Bronsai mean, I can probably take a week off. I'll see when the date gets announced
13:27andyfI'd guess the program committee would be interested in most talk submissions you would think of, which can help a lot on the cost.
13:32andyfThat worked for the ns forms, at least, from quick spot checking. Thanks,
13:35andyf... and when I say "can help a lot with the cost", I would guess they might even be willing to spring for the entire cost including travel, for you.
13:40andyfI think I understand at least some of the reasons why, but it is amazing the number of places like this :resolved-op you have added that mutability during compilation is significant.
13:41andyfgiven the emphasis on immutability elsewhere.
13:41Bronsaandyf: gotcha, I'll think about it :) tbh I'd love to come to one of the clj confs
13:41Bronsaandyf: huh? I don't understand
13:42andyfI mean, one of the reasons you added :resolved-op is because trying to resolve vars at the end of analyzing a file could change the result, because Vars are mutable, yes?
13:42Bronsayeah
13:42Bronsawell
13:42Bronsathe namespace system
13:42andyfYeah, I suppose most of the things I am thinking of come down to mutability there.
13:43Bronsathat's the only piece of global mutable state that t.a.jvm uses (is forced to use)
13:43Bronsaand yeah, that complicates things a bit
13:44BronsaI've actually added support for an immutable namespace system but it's still undocumented and I'm not sure how much useful it will actually be given clojure's semantics
13:45andyfI know others, I think Mike Anderson, and perhaps arrdem, may be interested.
13:46Bronsayou *can* snapshot the ns env at a point in time & have multiple deterministic-ish analysis of the same form but for this to work, you have to assume that no interning happens during analysis other than via def
13:46Bronsawhich is not something we can assume in the general case
13:47puredangerClojure/west will be Apr 20-22 in Portland
13:48dnolen_puredanger: woot!
13:48puredangerWe will make a wider announcement in the new year
13:49puredangerBack at the Gerding theater where we were 2 yrs ago
13:50andyfcool beans
13:59andyfBronsa: new resolved-op key should be on all forms in :raw-forms, not just the first, yes?
14:00Bronsaandyf: correct
14:02Bronsaandyf: well, *now* it will, pull the last commit :P I forgot about inlines
14:19dnolen_Om 0.8.0-beta4 out, back in sync with React 0.12.2
14:25bbloomdnolen_: thanks for the nolocal fix!
15:05dnolen_bbloom: np
15:06dnolen_also landed an interesting change where you can override rAF in Om, perhaps people doing testing might find it useful
15:39tickingwhat if the default printing for stacktraces would only print the clojure parts and core.stacktracke could be used to print everything?
16:01amalloyticking: the default should not be to omit information. it leads to people showing up in #clojure and saying "here is my stacktrace, what is wrong", with the answer being "your stacktrace is wrong"
16:02tickingamalloy: one of the biggest complaints I heat though, is that the stacktraces are very hard to understand
16:02tickingmost of the time you're not interested in the java layers in between, and most of the time you don't do interop
16:04Bronsaticking: I honestly think that most of the people that complain that clj stacktraces are hard to understand, don't even try to read them. They just look at this long verbose stacktrace and assume it impossible to figure out what's going wrong reading it
16:04tickingclojure could focus a bit more on usability, especially because it seems that most people that come to clojure are non-lisp people, that are used to nicer error messages
16:04amalloy(inc Bronsa)
16:04lazybot⇒ 80
16:04amalloyticking: if you try to make the easy case easier, by printing neutered stacktraces, you make the hard case impossible
16:05tickingBronsa: yeah, but that doesn't mean that they have a very bad noise to signal ratio
16:05amalloyclojure embraces the JVM; you can't just pretend you're not on it
16:05amalloywhat are you supposed to do if there's an exception in some java code? just have the stacktrace stop at the deepest part that's clojure? that's awful
16:06tickingamalloy: yeah because that is where the error most likely occured
16:06tickingamalloy: most of the exceptions in clojure programs might get thrown in java parts, but they originate from logic flaws in the clojure layers
16:07amalloyticking: if my programming language starts deciding to hide debugging information based on what "likely happened", it's time for me to switch programming languages
16:07Bronsaticking: I'd blame the issue of hard-to-understand error messages on the garbage-in garbage-out attitute & lack of validatio on clojure core code rather than on "bad stacktraces"
16:07tickingamalloy: that why I said, that the information should be available from clojure.stacktrack/print-stacktrace
16:08amalloyticking: but the beginners you're trying to protect by changing the default don't even know clojure.stacktrace exists
16:08amalloyyou can't make up for bad beginner defaults with a library that gets back the stuff you took away
16:09tickingits not a library, it's buildin
16:09tickingand even advanced clojure people get thrown off by the exceptions from time to time
16:10amalloyi'm not going to argue this anymore. i get tired of people proposing to "simplify" stacktraces
16:10tickingif people come up with this repeatedly, maybe they've got a point
16:11tickingsignal to noise is important, it is better to give a comprehensible incomplete overview first, that gives you a good idea where to go deeper than hand you a giant incomprehensible mess
16:11amalloyticking: people also repeatedly come up with the brilliant idea to use indentation instead of parentheses
16:11Bronsaticking: people come up regularly with proposals of removing parents from lisp. doesn't mean that's a good idea
16:12Bronsaparens*
16:12amalloyBronsa: if we removed parents, lisp programmers would all be as cool as batman
16:13tickingamalloy Bronsa: so far I've seen no cases of indentation that are better than parens, but I've seen plenty of languages that have better stacktraces
16:13tickingeven ones on the jvm
16:17andyfticking: There are at least a few libraries that attempt to make them shorter and Clojure-specific, but I don't recall all of them.
16:17tickingandyf: prone is quite nice when doing ring https://github.com/magnars/prone
16:19andyfIn Clojure itself, I believe the issue has been raised at least a few times, but I think the statement has been made that removing things too early in the implementation discards potentially useful information, so modifying them is left as a job for IDEs or libraries.
16:20dnolen_ticking: Clojure already has shorter pretty printed stack traces by default - no one uses it
16:20dnolen_ticking: (clojure.repl/pst e) does this
16:25tickingdnolen_: interesting, but even with /pst it consists of 90% repl implementation functions unrelated to the problem
16:29tickingamalloy Bronsa: lol, maybe you have to change languages already ;p because by default it seems that Exceptions have only their last frame printed :D
16:29Bronsaticking: I use slime, I always get the full stacktrace
16:30tickingBronsa: yeah, but I wans't really meaning tooling, tools should do whatever they want, all the html based editors could have trace folding which would be nice, but I meant in the repl, because that is where people first come into contact
16:31Bronsaticking: the repl is tooling
16:31tickingBronsa: but amalloy s argument doesn't hold there
16:31tickingprinting a nice trace for exceptions would be an improvement over one liners
16:31tickinghttps://gist.github.com/ticking/c69e77ec33cf7a7855d0
16:32tickingBronsa dnolen_ amalloy: currently you get nothing or everything in the repl. Either just the root cause which is pretty useless, or a trace that contains 90% implementation detail of the repl
16:34Bronsaticking: I was never making a case for how good the default behaviour of the clojure repl is. I never use the default clojure repl. I only talked about clojure stacktraces
16:34dnolen_ticking: nothing in a Clojure stacktrace is useless - the opinion of people that have to use Clojure in anger is not on your side.
16:35dnolen_ticking: that it's not friendly for beginners is of course totally true - but friendlier Clojure environment can fix this
16:36tickingdnolen_: yeah but so far the only argument I've seen is: "we shouldn't omit information", which doesn't apply for exceptions because they only print like "NullPointerException clojure.lang.Numbers.ops (Numbers.java:961)" anyways
16:37tickingso having only the "relevant" clojure parts printed instead would't remove anything
16:37tickingone could even print the root cause and afterwards print the clojure fns but I think this would make a lot of people happy and shut up a lot of critics that start the repl, get a useless error and go rant on their blog
16:40tickingdnolen_: but I'll just go back to fixing gorilla repl's exception printing and lobbying for making it the default repl :P
16:40dnolen_ticking: or repl-y could do this since most people run `lein repl` - sounds like you have some patches in your future :)
16:41tickingdnolen_: yeah reply would be a good point for this :), that's why I was asking what people would think of this. No use in an unwelecome patch
16:42kenrestivoi'm trying to bend schema to my will. i need a map that has one but not more than one of a required key. i.e. {:foo x :baz y} or {:bar x :baz y} but not {:foo x :bar x :baz y} no matter where i stick the s/either, i get protocol :explain exceptions
16:43dnolen_ticking: I don't think anybody is against making things easier for newcomers
16:43kenrestivoor :walker exceptions
16:44tickingdnolen_: yeah, I'll whip something up for gorilla and backport it to reply :)
17:08craigglennieIs there a single function to extend a list? Equivalent to ##(flatten (conj [1 2] [3 4]))
17:08lazybot⇒ (1 2 3 4)
17:08craigglennieOr is that the way to do it?
17:08Bronsa,(concat [1 2] [3 4])
17:08clojurebot(1 2 3 4)
17:09craigglennieawesome, thanks Bronsa
17:09danielglauser,(assoc concat [[0 1] [2 3]])
17:09clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: core/assoc--4105>
17:10danielglauser,(apply concat [[0 1] [2 3]])
17:10clojurebot(0 1 2 3)
17:10Bronsadanielglauser: you mean apply?
17:10danielglauser:)
17:10Bronsaheh, looks like so
17:10danielglausercraigglennie: A slightly different but similar case
17:13alexbara`I'm reading the Om source code. I see a funciton or macro called "specify!" but I cannot find where this is defined, either in Om or in Clojurescript. Anyone know where "specify!" comes from? Or at least what it does?
17:14craigglenniedanielglauser: there doesn’t seem to be any reason to use apply? concat already works without it. You could do this, though: ##(apply conj [1 2] [3 4])
17:14lazybot⇒ [1 2 3 4]
17:14dnolen_alexbara`: not a function, it's a macro
17:15alexbara`dnolen_: where is it defined? I couldn't find it by rgrepping
17:15dnolen_alexbara`: unique to ClojureScript as it's probably too difficult to implement efficiently on the JVM at the moment
17:15dnolen_alexbara`: cljs/core.clj
17:15danielglausercraigglennie: I suspect that a list of lists is a more common situation.
17:16abaranoskydnolen_: aha, my rgrep was looking in *cljs ... I'm still not 100% used to how cljs puts the macros into *.clj files :D Thanks for pointing me in the right direction
17:24tom39291Can anyone suggest a book to introduce clojure? I'm a professional Scala developer, also experienced in Java and Haskell
17:25tom39291Clojure for the brave and true looks good, especially since it introduces Emacs too.
17:26danielszmulewicztom39291: I worked my way with the Joy of Clojure.
17:28mearnshJoC +1
17:29dnolen_tom39291: Joy of Clojure probably the best intro if you're experienced with Scala/Haskell. Other books don't assume much functional background.
17:29tom39291Great. Sounds like what I'm after. Thanks for the recommendations.
17:31danielszmulewiczI'm playing with boot-clj. I like what I see.
17:31danielszmulewiczA lot.
17:32michaniskindanielszmulewicz: if you have issues or suggestions etc we're hanging out in #hoplon
17:34danielszmulewiczmichaniskin: OK, will do. Looks quite stable. I missed the cider repl and middleware the first time I launched a boot repl, but quickly found the wiki with relevant information. Nice.
17:34michaniskinawesome
17:36andyfBronsa: For jvm interop forms, there is no plan to have :resolved-op ? (and maybe no need?)
17:37Bronsaandyf: no need
17:38andyfI guess those are either fully namespace qualified for static methods/fields, or they are instance methods and should have no class names?
17:40Bronsaandyf: right
17:40danielszmulewiczmichaniskin: The philosophy behind it is just awesome. You trade the declarative nature of traditional build tools with the power of Lambda. To die for. I wonder how fast you'll convert Leiningen users to grok and use it.
17:41michaniskinLAMBDA: The Ultimate Declarative :)
17:41danielszmulewiczmichaniskin: Do people grok it?
17:41michaniskinaka: Lisp Can Do It!
17:41michaniskini think it's easier to get by example maybe?
17:41michaniskini just did a video the other day: https://www.youtube.com/watch?v=d0XQD89enjE
17:42kenrestivoeastwood is very helpful. i.e. merge with only one map... oops forgot to put in the second one...
17:42michaniskini live code like 90% of what boot can do
17:42michaniskinhit all the main concepts anyway
17:42danielszmulewiczYes, that's how I got sucked in. But what is your impression of people's reaction after being exposed to it?
17:43michaniskinif i can show someone in person they will love it
17:43michaniskinbut i am not a good technical writer so i think a lot is lost there
17:44danielszmulewiczmichaniskin: The blog post with example is good.
17:44andyfkenrestivo: Glad you are finding it useful. Working on enhancements to it right now.
17:44Bronsa(inc andyf)
17:44lazybot⇒ 15
17:44Bronsa(inc eastwood)
17:44lazybot⇒ 5
17:45michaniskindanielszmulewicz: all the concepts in boot are interrelated, like lisp, so it's tricky to explain sometimes
17:45danielszmulewiczmichaniskin: Yes, it's been forever there. I mean, I remember when boot v1 was announced.
17:46danielszmulewiczmichaniskin: Being so neat, it deserves better exposure & acceptance.
17:46michaniskinboot1 was hobbled because we didn't know how to make pods work back then
17:47michaniskinnow that we've figured that out it's smooth sailing :)
17:47danielszmulewiczmichaniskin: Building its own homepage was a smart move.
17:47danielszmulewiczmichaniskin: I can see it coming together.
17:47michaniskinalandipert and i work at adzerk, and they're really cool about supporting open source
17:48michaniskinadzerk actually paid for the website and whatnot
17:48sveriHi, anyone using cursive here? I have this form [:h3 "foo" [:h4 "bar"]]. What is the structural editing command to separate these both into this: [:h3 "foo"] [:h4 "bar"]?
17:49tickingsveri: should be barf forward
17:50sveriticking: indeed, thanx, thats it :-)
17:50cflemingsveri: Yup, barf forward, under Edit->Structural Editing
17:50tickingAlt + A, ,
17:50danielszmulewiczmichaniskin: It's really a competing alternative to Leiningen, and since Leiningen is almost standard these days, it is going to be an uphill battle. I'm curious how this will turn out.
17:51tickingseems like the lisp curse has finally struck
17:52andyfticking: Because both Leiningen and boot exist?
17:52tickingyeah kinda
17:52andyfticking: There used to be Leiningen and Cake, and those merged.
17:52tickingandyf: yeah, that was a happy day :D
17:52sveriHehe, a friend of mine who started using clojure together with me always went for building its own thing until I pointed him to existing libraries which did things better
17:53andyfLeiningen did not eliminate Maven, or makefiles, or the use of other build tools. It *nearly* eliminated them, but not completely.
17:53michaniskindanielszmulewicz: we can use leiningen tasks in most cases, we run them in pods, like https://github.com/adzerk/boot-beanstalk
17:53tickingandyf: I really like build, but I love that I can point newbies to one canonical build tool
17:53ticking'boot
17:53Bronsaticking: having alternatives is good when you need them
17:53andyfSee compile/package/deploy section of the survey results here if you are curious: https://cognitect.wufoo.com/reports/state-of-clojure-2014-results/
17:54tickingyeah I agree, I just don't ever want to tell people getting started "well you could use this... or this.. they are both good but different"
17:54sveriticking: what do you tell ppl in java land? there are at least three majore players: ant, maven and gradle
17:55tickingsveri: yeah and how many people do you tell to use java?
17:55sveriticking: :D
17:55sveriticking: at work everyone is using it
17:56tickingsveri: yeah but the build tool situation is still a mess
17:56kenrestivoafter investing almost 3 years now in rendering all of leiningen's quirks into muscle memory, any alternative would have to be beyond amazing to get me to spend the mental overhead to learn it and unlearn lein
17:56sveriticking: gradle is pretty cool, not as cool as leiningen (didn't try boot), but hey, at least you can get things done in a relatively short time
17:57kenrestivowell not all of its quirks, but all the ones i've run into (mostly in the realm of cljs)
17:57danielszmulewiczkenrestivo: that's the situation for most of us. The thing is, boot-clj might be very well be that amazing thing.
17:57michaniskinsveri: boot is to leiningen as gradle is to maven
17:58sverimichaniskin: I try it in my next project, did plan to do that anyway
17:58michaniskinawesome, let us know how it works for you :)
17:59kenrestivoas it is, it took me much longer than i thought it would to wrap my brain around stuart sierra's components lib. but i think i've got a fair amount of its quirks rendered into muscle memory by now too.
18:00kenrestivotook 3 projects to really get comfortable with it.
18:00danielszmulewiczkenrestivo: A propos Stuart Sierra's components lib, have a look at https://github.com/danielsz/system
18:00michaniskinkenrestivo: boot is actually also a good replacement for components
18:00michaniskinso you can in theory nuke two things with one bomb
18:00kenrestivogreat, another thign to unlearn :-/
18:01tickingtbh I don't get boot it does too many things
18:01danielszmulewiczmichaniskin: Ok, that's your next blog post.
18:01michaniskinhaha, yes, after docker
18:01tickingwhy does it manage resources in scripts, when there is alembic?
18:01kenrestivogetting to be an old guy, i can't do 180-degree turns on a dime anymore.
18:02michaniskinticking: alembic doesn't support the extreme classloader isolation we needed
18:02michaniskinit uses classlojure for that, which isn't enough
18:02tickingmichaniskin: yeah but why not fix it then?
18:03michaniskinit can't be fixed because it's running in clojure. boot fixes it by shipping a java executable, and doing the isolation in java before any clojure runtimes are loaded into any classloaders
18:03tickingmichaniskin: ah I see, too bad :(
18:04michaniskinbasically the classloader isolation and dependency resolution needs to happen outside of any clojure classloader hierarchy
18:04tickingmichaniskin: so the set-env! part is parsed statically and then removed?
18:04michaniskinno, set-env! is just a function
18:04michaniskinthere is no static munging in boot
18:04DeraenI did some quick testing today and converted one of my work projects to boot (it took like 15minutes, as I simple boot project already) and I found that lein pdo less watch, cljx watch, figwheel + lein repl uses 6 jvms and 6000MB memory (some jvm opts might help) while one boot task doing the same things uses 800MB and 1 JVM
18:04tickingmichaniskin: ah so the classloader setup is done before, I see
18:04kenrestivodanielszmulewicz: i looked at your system lib, stuart's components, trapperkeeper, frodo, jig, modular, leaven, pisto... and ended up going with components becuase it seemed the simplest and easiest to understand.
18:05michaniskinticking: the machinery for doing the classloader stuff is implemented in a java class that is in the topmost classloader, above any clojure classloader
18:06michaniskinthis means that you can actually call methods on that class from clojure
18:06tickinginteresting, thanks for the explanation :)
18:06michaniskinit's a class with just static methods
18:06danielszmulewiczkenrestivo: Nice. Just to be clear, system is just a set of readymade components. It builds on SS's lib and brings no other abstractions. Just a repo of ready-to-go components.
18:12sverimichaniskin: while you are here, I just looked through the homeüage and wiki. Is there an example somewhere which includes cljx / cljs / and clj with relaoding features for development and adapted config for production?
18:13Deraensveri: https://github.com/Deraen/saapas/blob/master/build.boot
18:14michaniskinsveri: sure, there is a cljx task that's not in the blog post, but it can be composed with what's in the post easily: http://adzerk.com/blog/2014/11/clojurescript-builds-rebooted/
18:14michaniskinoops, what Deraen said :)
18:14sveriDeraen: michaniskin thank you both, I bookmark this and go through it :-)
18:14michaniskinsaapas is the current state of the art there
18:16sverihow about test-refresh for clojure.test?
18:17michaniskinsveri: alandipert made a test task the other day actually, one sec
18:17michaniskinhttps://github.com/adzerk/boot-test
18:18michaniskinyou can do like `boot watch test` for example
18:18sverimichaniskin: awesome, thank you
18:18michaniskinit actually runs your tests in a pod
18:18michaniskina new pod each time
18:18michaniskinso you don't need to worry about reloading namespaces etc
18:18michaniskineach time is a fresh clojure runtime
18:19sveritasty tasty, maybe I will reconfigure my current project
18:19sveriI am to curious right now
18:19michaniskinalan was doing some stuff the other day
18:19michaniskinlike building the project incrementally, running tests, when tests pass building snapshot jar and deploying to maven local
18:20michaniskinplaying different sounds when tests pass/fail
18:20sverihehe
18:20michaniskinhe built that whole pipeline in a single command line
18:20michaniskinjust composing boot tasks in different ways
18:22sveri:-) bed is calling for now, thanks again
18:25michaniskinnp :)
18:25ticking_sveri: silly germans, always tired
20:15cflemingmichaniskin: Congrats on boot, it looks really cool
20:15cflemingmichaniskin: I need to add support to Cursive for it, it's on my list
20:16cflemingmichaniskin: boot actually looks like a good candidate to migrate the Cursive build (currently Ant) to
20:16michaniskincfleming: awesome, we can help wherever possible
20:16kenrestivomethinks you're going to find yourself setting up a #boot channel
20:16cflemingmichaniskin: Cool, I won't get to it for a while but there are already users asking for it
20:17michaniskincfleming: i think we can do cool things vis ide integration using pods
20:17michaniskinbecause it's cheap to spin up a new pod as an alternative to reloading namepsaces
20:17cflemingmichaniskin: Yeah, I need to look into your classloader magic, I might need something similar for Cursive extensions
20:17michaniskinwe have an optimized pod-pool thing for that
20:18cflemingmichaniskin: Interesting, it does seem like there'd be some interesting use cases for that.
20:18michaniskintcrawley's shimdandy project is what you want there, for sure
20:18michaniskinA+ would use again :)
20:18michaniskinespecially since cursive is launched from a java process, which is what you really need to get classloader isolation working properly
20:19michaniskinyou can't really do it from inside clojure's classloader
20:19michaniskinor i should say, i spent like 3 months trying and couldn't do it :)
20:19cflemingmichaniskin: Interesting. What I actually really want for plugins is to be able to control which classloader Clojure code gets loaded into, but that doesn't seem to be possible.
20:20michaniskincfleming: they can if you use pods
20:20cflemingmichaniskin: i.e. what i don't want is to replicate the clojure runtime for each plugin
20:20michaniskinwhy not?
20:20michaniskinit's not expensive really
20:20cflemingmichaniskin: Because that's a lot of classes in a long-running process
20:21michaniskinmaybe 10-20M of memory is the size of it
20:21michaniskinboot uses way less memory than lein because of pods
20:21cflemingThere's also startup time, which is a problem in IDEs
20:21michaniskinwe have a pod pool thing for that
20:21michaniskinthat keeps a pool of pods warmed up with clojure.core loaded
20:21michaniskinready for action
20:22cflemingRight, but I'm talking about initial IDE startup when the plugins are loaded
20:22michaniskinboot starts a pod for each task usually
20:22michaniskini mean tasks generally start pods of their own
20:22michaniskinbut they do so in a future
20:22michaniskinso they all start concurrently
20:23michaniskinboot starts a minimum of i think 3 or 4 pods
20:23cflemingmichaniskin: Ok, I don't have that much control over IntelliJ's plugin loading unfortunately
20:23michaniskinjust to get to hello world
20:23michaniskinbut i can run boot in < 1.2 on my machine
20:23michaniskini mean 1.2s
20:23cflemingAnyway, pods seem like a really interesting idea for things like spinning up tests and new REPLs
20:24michaniskini'm interested in making a new kind of repl
20:24michaniskinmore like a resident editor than a repl
20:24michaniskinwhere you have a file that is reevaluated every time it changes
20:24michaniskinand you see the output
20:25cflemingSounds like lighttable
20:25michaniskinso each time you change it it is evaluated in a new pod
20:25cflemingI see, interesting
20:25michaniskinyeah but no namespace reloading or mutable namespace business
20:25michaniskinbut for that to work you need a good model for like "session state"
20:26michaniskinbasically a database of local state that is persisted across compiled
20:26cflemingHow good is the JVM at reclaiming classes loaded into discarded pods?
20:26michaniskin*compiles
20:26michaniskinit's fine, but for java 7 there is the permgen issue which is serious for clojure
20:26michaniskinso you need to use the jvm options that permit permgen class unloading
20:26michaniskinbut with those options it runs great on 1.7
20:27michaniskin1.8 has no problems at all, because they removed that
20:27michaniskini mean if you make a lot of pods you either need to use a pod-pool or call the destroy-pod function yourself
20:27michaniskinbecause the pod classloader needs to be closed and clojure agents need to be stopped
20:28michaniskinor it'll hang around for a while eating memory
20:28michaniskinbut we regularly run tests in anonymous one-time-use pods with no memory issues
20:29michaniskinin a watcher loop
20:30michaniskincfleming: https://github.com/boot-clj/boot/wiki/JVM-Options#permgen-errors
20:37cflemingmichaniskin: Ok, thanks. I'll think about some use cases for pods - I suspect they might be quite useful.
20:37michaniskinhaha they're entertaining for sure
20:38cflemingshimdandy looks very nice, actually
20:38michaniskincfleming: for an idea: https://github.com/adzerk/boot-logservice
20:38michaniskinthat solves the datomic peer sfl4j conflict problem
20:38michaniskinby isolating your logger implementation in a pod
20:39michaniskinso your project has no looger implementation dependency to conflict with the one datomic pulls in
20:39michaniskin*logger
20:39cflemingNice
20:58brucehaumanmichaniskin: you still here?
20:59michaniskinhello brucehauman :)
20:59brucehaumanhey man, I am diggin where you are going with boot :)
20:59michaniskinthanks! i dig your domes, man!
20:59brucehaumanmichaniskin: thanks!
21:00michaniskini just moved to durham, and i want to build one
21:00brucehaumanmichaniskin: Well let me know if you have questions.
21:00brucehaumanmichaniskin: I was planning on getting out that way sometime
21:01michaniskini'm still looking for a site
21:01mildfatehey all, what's the difference between the last two examples here? https://github.com/ring-clojure/ring/wiki/Creating-responses
21:01michaniskinhoping to find a shack in the woods :)
21:01brucehaumanits not as hard as you would imagine
21:02brucehaumana shack in the woods is the way to go
21:02mildfatein what cases would I want to return a file vs an input-stream or vice versa? I guess another, more fundamental question is, what does it mean to return an input stream?
21:02michaniskinif you are in this area i invite you to drink beers
21:02brucehaumani’d love that
21:03michaniskinmildfate: input-streams are stateful, is one difference
21:03weaveje__mildfate: An inputstream can come from any I/O source, not just a file.
21:03brucehaumanmichaniskin: hey I wanted to let you know about a clojurescript build library I made that you might find helpful
21:03michaniskinbrucehauman: sweet, what is it?
21:03weavejestermildfate: A file has more information than an input stream. e.g. you know it's size and last modified date.
21:04brucehaumanmichaniskin: https://github.com/bhauman/clojurescript-build
21:04mildfateweaveje__: I think of an input stream as something that requires you to ask content of it. Does the client's browser continue to "ask" the input stream for content?
21:04michaniskinbrucehauman: cool, i like it!
21:04brucehaumanit’s a lib that alolows incremental ClojureScript rebuild when clj files are changed
21:05michaniskinthis will be useful to use in the boot-cljs task i think
21:05brucehaumanyeah thats why I brought it up :)
21:05michaniskineventually i think we'll go a little farther than that, using pods
21:05michaniskinlike with pods we won't need to reload namespaces
21:05michaniskinwe can just do it whenever any clj file changes at all
21:06michaniskinbecause like a clj file with just functions in it might change the behavior of a macro in another clj file
21:06michaniskinif the macro calls those functions
21:06weavejestermildfate: An input stream is a stream of data that can be read. It's piped directly to the client.
21:06brucehaumanyeah I account for that
21:06michaniskinbrucehauman: whoa, really?
21:07brucehaumanmichaniskin: yep :)
21:07weavejestermildfate: From the browser's perspective, there's no difference between a File body or an InputStream body.
21:07michaniskini must read codes :)
21:07mildfateweavejester: Ok. In what cases would I use an InputStream instead of converting it into, say, a string and sending that?
21:08weavejestermildfate: If the stream is large or of an indeterminate length.
21:08mildfateweavejester: Ok, I gotcha
21:08mildfateIf I'm creating the inputstream on the fly or something
21:09michaniskinbrucehauman: do you know if cljs analyzer state can be written to disk and used in a new compiler yet?
21:09michaniskinit was like half implemented last time i checked
21:09brucehaumanmichaniskin: there are atoms in there I think
21:10michaniskinbummer
21:10brucehaumanmichaniskin: maybe I’m wrong about that
21:10mildfateweavejester: So I'm reading the Ring wiki atm, do you recommend any specific framework that builds upon Ring?
21:11brucehaumanmichaniskin: it might be posssible, that would be awseom
21:11weavejestermildfate: The luminus template is a good place to get started.
21:11michaniskinbrucehauman: yeah it's a key thing for what we want to do with pods
21:11mildfateweavejester: I thought Luminus was just a collection of libraries?
21:11michaniskinwe want to avoid reloading namespaces, instead just using a fresh pod
21:11weavejestermildfate: http://www.luminusweb.net/
21:12michaniskinbecause reloading multimethods and protocols is sketchy
21:12weavejestermildfate: It's a project template
21:12mildfateok
21:12weavejestermildfate: That's probably the closest thing there is to a "framework" in Clojure.
21:13weavejesterA framework is pretty much just a template + libraries.
21:13brucehaumanmichaniskin: ofr each compile? and thats fast?
21:14michaniskinbrucehauman: well only when clj files change, but yeah it's super fast
21:14michaniskinthe only thing that takes time is loading clojure.core really, so we keep pods warmed up in reserve ready to go
21:16brucehaumanI’m compiling every few seconds in figwheel sometimes. That seems intense.
21:16michaniskineach time a clj file changes we could use your tool to mark the js files that need to be recompiled and stuff, and then do the cljs compile in a fresh pod with the saved analyzer state from the pervious pod
21:17michaniskinit's not a noticeable delay at all, we use it all the time for running tests tdd style
21:17brucehaumanbut maybe thats my perception laging whats actually possible
21:17michaniskintests run each time in a fresh pod and the pod is discarded after
21:18michaniskinalso the garden task does it
21:18michaniskinincremental compiles with garden don't take longer than without pods
21:18michaniskinit's like .30s to do the garden compile for a normal site
21:18michaniskinincluding spin-up of the new pod and whatnot
21:21bhaumangot bumped offline for a sec
21:23bhaumanmichaniskin: yeah I wanted to let you know that I decoupled figwheel from lein and cljsbuild so if you want to use it, its possible
21:23michaniskinbhauman: that's awesome, we'll be using it, i'm sure
21:24bhaumanmichaniskin: it has its own watcher though
21:24bhaumanbut you can get around it
21:24bhaumanhttps://github.com/bhauman/lein-figwheel/blob/master/sidecar/src/figwheel_sidecar/auto_builder.clj#L38
21:46DeraenPerhaps we can also use figwheel client for boot-reload (or boot-figwheel), the new HUD is nice :)
21:49mildfateis there a getting started page somewhere for lib-noir?
22:03xnil_mildfate: lib-nope
22:04uris77I have a rather basic question about sessions in ring. When I authenticate with an OAuth provider, I normally need to manually make another request to get the user's profile. I'd like to keep some of that information in the session without needing to make a network request for the profile everytime a secure handler is accessed.
22:04uris77Currently, I have a middleware that adds the profile to the session in the request, but it feels wrong having to do a network request everytime.
22:08mildfatewhat are the advantages of dealing with routing in the frontend with javascript versus in the backend?
22:08mildfateI'm trying to understand why I might use routing libraries in clojurescript vs compojure
22:09uris77routing in the front-end is for rich frontend applications
22:09uris77the frontend routes don't always correspond to the backend-routes
22:10uris77and for some views (or routes) you don't make a request to the server, you just hide or show parts of the view. The front-end routes provide ways to access those views through a url.
22:10uris77it is a common practice when building SPAs
23:04crack_userwhat is the advantage of transducer over classic function composition?
23:11kenrestivogeneralization across channels, sequences, etc?
23:13crack_userI cannot do that before transducers?
23:14crack_userI am new in clojure and I am trying hard to understand some parts
23:20kenrestivoif i were new i'm not sure i'd be starting with trandsducers :-)
23:20kenrestivothere's a couple good talks by rich hickey on trandsducers that explain them though.
23:21kenrestivook, core.async question: why would this https://www.refheap.com/95230 be a No implementation of method: :admix* of protocol ?
23:22kenrestivomy goal here is to have a sub that takes a *set* of topics off of a bus, not just one. i was told to use mixes... and that seems to be failing.
23:29bhaumanthe first argument to admix needs to be a mix right?
23:30bhaumanmix creates and returns a “mix” so that would be the first arg to admix
23:39kenrestivoaha, thanks. i'd gotten confused with sub, which is side-effecting, and admix, which is side-effecting. mix returns the mix, it doesn't turn the channel presented as an arg into a mix
23:40kenrestivoi really wish the side-effecting functions in async were! appropriately! screaming!
23:42kenrestivoi.e. it'd be nice if admix was admix! and sub was sub!, but from now on i'll remember that mix is not mix!