#clojure logs

2013-12-17

00:04kandinskiis the max stack depth on 4clojure very small, or is a StackOverflowError a sign that there's certainly a bug?
00:07kandinskior, why should this overflow the stack with the toy inputs from 4clojure? http://paste.ubuntu.com/6587241/
00:07kandinskiit's an answer to problem 28, or it tries to be
00:10amalloykandinski: 4clojure has the same stack depth as you'd expect. the problem is your recursive function has no base case
00:10kandinskiamalloy: when the first of foo is non-sequential
00:11kandinskithat's the base case
00:11amalloyhow can you call it the base case, when you call flat twice?
00:11kandinskithree times in total
00:12kandinskiI call it on either first and rest of foo
00:12kandinskior only on rest of foo
00:12kandinskiamalloy: by the way, I'm not arguing that I'm right and you're wrong
00:12kandinskiI'm arguing what I understand, which is obviously not correct, since I overflow the stack
00:12amalloythere is no value i can call flat with that won't cause you to call flat again recursively. do you see how that's a problem?
00:13kandinskiamalloy: yes. I would think that (flat '(1 2 3)) should produce [1 2 3], but nope
00:13kandinskihmm
00:14amalloyhow could it ever produce that? you make it call flat again, twice
00:14amalloyand each of those calls will call flat again...
00:14kandinskiwell, (first '(1 2 3)) is not sequential
00:14kandinskiso I call (into [1] (flat '(2 3)) (or so I thought I was)
00:15echo-areaamalloy: What do you think about defining a function such as (fn [tag & _] tag) as the dispatch function of many multimethods?
00:15amalloyyou call (into (flat [1] (flat [2 3])))
00:15kandinskithen, same with '(2 3)
00:15amalloyer, (into (flat [1]) (flat [2 3]))
00:15kandinskiamalloy: that's when (first foo) is sequential, not the case when (first foo) is 1
00:16amalloyoh, so it is. i sorta expected the first half to be the base case
00:16amalloywell, in the second half, the base case, you call flat exactly once
00:16amalloyregardless of the contents of foo
00:16amalloythat's one too many times, for a base case
00:17kandinskiit's (into (base case) (recur on rest of sequence))
00:17kandinskibut since it's not working...
00:18amalloykandinski: if there is any more recursion, that is not a base case. because you never stop
00:18amalloyyou probably want a check on (empty? coll) or something
00:18kandinskiamally
00:18kandinskithe problem is that (sequential '()) is true
00:19kandinskiso (flat (rest foo)) won't stop
00:19kandinskiyes, empty
00:19amalloy(flat (rest foo)) will not stop in any case, because both halves of your if condition contain recursion
00:19kandinskigrumbleor something
00:19amalloyreplacing sequential? with empty? will not change that
00:20amalloyyou will need a branch that does not call flat at all
00:24TEttingeramalloy, as I understand it, J has ways of finding the inverse of some functions (or has them declared for stb lib ones).
00:26TEttingerI'm not sure how you would programatically find square root as the inverse of square, or something like #(Math/pow % 3.5)
00:27kandinskiamalloy: I got to have my cake and eat it
00:27kandinskiadded a base case and kept the one I had
00:29kandinskiamalloy: http://paste.ubuntu.com/6587296/ if you are interested, and thanks for the prodding
00:30amalloyincidentally, (into [x] y) is a kinda gross way to write (cons x y), unless for some reason you really need a vector rather than a seq
00:30kandinskijust to make sure I get the right order
00:32kandinskiamalloy: also, in my basecaseless version, I did not have an empty list to start consing onto
00:32echo-areaamalloy: http://pastebin.com/5KXJFcFK <-- Here's what I meant. What do you think about it?
00:32kandinskiamalloy: amcnamara's solution is interestingly similar to mine
00:32xperahow can I specify in my project.clj that java 7 is a requirement?
00:33amalloyecho-area: why are you asking me specifically? i don't think i've expressed any particular interest in this topic, so asking the channel in general would be the normal thing to do
00:33echo-areaI asked yesterday, nobody answered :(
00:33kandinskixcept the fact that he uses an accumulator
00:33kandinskiand a matcher
00:33kandinskiweird
00:34amalloyxpera: ;; plz use java 7
00:35xperaamalloy: haha, ok, if you twist my arm
00:35amalloyAFAIK there's nothing more formal
00:35xperabut you don't have to wink twice to convince me
00:36xperai'm trying some nio.2 stuff to see what happens. to me, for what I want to do, netty just seems like a bloated mess
00:37echo-areaamalloy: And sorry, I asked you specifically because I thought your answer would be inspiring. Again, I didn't mean to offend you.
00:38echo-areaWould somebody else like to take a look at it?
00:38echo-areahttp://pastebin.com/5KXJFcFK <-- Is this a abuse or not?
00:38echo-area*an
00:40levinmthere must be a function that returns a collection of every item in a collection for which a predicate is true
00:40levinm(gather even? [2 4 5 6]) would return (2 4 6)
00:40levinmWhat function goes where I wrote "gather"?
00:40levinm
00:40echo-arealevinm: filter
00:40echo-arealevinm: See also remove
00:40levinmthanks, hard to google for
00:40rovarwhat's the paredit command to wrap a word in parens?
00:41echo-arealevinm: core.clj is a good place to look at
00:41levinmI get lost there ... so many things to click
00:41rovarM-(
00:41rovarrovar: thanks.
00:41rovarrovar: np
01:13andyflevinm: I think someone made a web site where you could look up functions by example arguments and return values. Anyone remember if that exists, and its name?
01:14bitemyappandyf: well the bot can do that, for one.
01:15andyfbitemyapp: Do you know how? Or even better, is there a description somewhere of most or all that the bot can do?
01:15TEttingermsg lazybot with findfn is it?
01:16TEttingerI don't remember, I will take a look
01:16nopromptbitemyapp: ugh. i dunno. i like this language but i don't feel like i'm *this* anal of a person.
01:16bitemyappnoprompt: you don't have to be anal.
01:17bitemyappnoprompt: you can write the language as strictly or liberally as you want, really.
01:17bitemyappnoprompt: there's a uni-type you can slap on stuff if you're feeling truly lazy.
01:17TEttingerandyf, try: /msg lazybot findfn 1 2
01:17nopromptbitemyapp: sure i get that.
01:17TEttingerit takes a while
01:17bitemyappnoprompt: it's also worth considering that you're experiencing beginner friction that you've not had to experience in Clojure for ages, with a bit more time hacking you'll be on cruise control.
01:18TEttingerwhat language?
01:18bitemyappnoprompt: just give it a bit more time, you're probably used to learning things more quickly than Haskell tends to allow. I don't think it'll take you long though.
01:18bitemyappTEttinger: Haskell.
01:18nopromptbitemyapp: like i don't even know where to begin with this. clojure makes data problems obvious.
01:19xperaamalloy: regarding telling leiningen that Java 7 features are used, I just found :javac-options in https://github.com/technomancy/leiningen/blob/stable/doc/MIXED_PROJECTS.md
01:19bitemyappnoprompt: hum. you're working with roughly the same set of data structures plus some extras in Haskell, with some slightly different defaults.
01:19TEttingernice xpera
01:19bitemyappnoprompt: talk to me about what you want to do/represent and I can help.
01:19nopromptbitemyapp: like none of the monad stuff i've read anywhere makes any sense.
01:19bitemyappnoprompt: leave the monads alone.
01:19bitemyappthose'll come when you need them.
01:20bitemyappseriously, they're not even important right now.
01:20bitemyappThey're good to know, but it doesn't really matter.
01:20bitemyappyou can probably just slap everything in IO for now, no distinctions made, and leave the rest of your code pure.
01:20bitemyappnoprompt: talk to me about your data.
01:21TEttingertell me about your mother I mean data
01:23nopromptbitemyapp: we'll chat about it when we pair this week. right now, i just need to fumble around and be cranky.
01:23andyfbitemyapp: As long as you entice Haskell folks to the Clojure channel every now and then, too :-)
01:24bitemyappnoprompt: you'll be okay.
01:25bitemyappandyf: ¯\_(ツ)_/¯
01:25nopromptbitemyapp: omfg. dude. these people do not understand programming https://github.com/hylang/hy/issues/373#issuecomment-30728838
01:25nopromptbitemyapp: read the whole thread.
01:25bitemyappnoprompt: funny you mention that, I dropped into their channel to talk about translating between edn and Python data today
01:26nopromptbitemyapp: please tell me they are competent.
01:26nopromptbitemyapp: from the responses...
01:26bitemyappnoprompt: uhhh, they didn't have anything shake and bake for my problem.
01:26bitemyappnoprompt: unless I wanted to make a translation layer between their parser and AST to Python native data.
01:27bitemyappI didn't talk to many of them, nothing impressive came of it.
01:27bitemyappI came by way of Fox, really.
01:27bitemyappI was kind of surprised the Hylang people hadn't made an edn/python library.
01:27bitemyappbecause uh. you know.
01:27bitemyapp :|
01:28nopromptbitemyapp: i just don't see how anyone could make such a simple problem so difficult.
01:28bitemyapp...are these motherfuckers for real?
01:28bitemyappI might just rage out of my browser tab.
01:29nopromptbitemyapp: seriously. it's like they're *not* thinking.
01:29nopromptbitemyapp: the problem is SO EASY.
01:29bitemyappnoprompt: I understand not retaining Clojure's semantics 1:1 in some cases, but the truthiness stuff is pretty fundamental and nice.
01:29bitemyappnoprompt: does this mean I shouldn't bother asking them if they've implemented immutable collections?
01:29bitemyapp / persistent
01:30nopromptbitemyapp: no don't. you'll kill them.
01:31bitemyappprobably.
01:31nopromptbitemyapp: i mean they act as if they have no control over the code they wrote.
01:31bitemyappdevn: this is why I'm grumpy all the time.
01:31bitemyappnoprompt: LOL. I love it when I see people like that.
01:32xperanoprompt the point that it will work to make `if` behave properly without break other python code...
01:32xpera...that was funny. and sad.
01:32xperaerr. without breaking
01:33nopromptbitemyapp: and the last comment in the thread is seriously icing on the cake.
01:34xpera"when Hy code is mixed with python code and calls are made to both directions" WHAT?
01:34xperai'm envisioning some kind of HYDOC dropped in the middle of a python program now
01:35xperapython -- now lisp -- now python. whee!
01:35bitemyappWhich is it? NOBODY KNOWS
01:35ivaraasenxpera: I was imagining some sort of two-headed troll ravaging Norwegian peasants.
01:35bitemyappwhy not pick one set of semantics and stick wit hit?
01:35bitemyappeither it's a shitty syntax transpiler with macros or it's a Clojure-derivative.
01:36xperaI can see the sequel: Python snakes on a plane, very much confused
01:37xperabitemyappALL THE POWER OF LISP, but improved with Python if semantics!
01:39bitemyappnoprompt: added my usual gasoline to the fire.
01:43bitemyappSpeaking of terrible languages and the decisions associated with them: http://news.php.net/php.internals/70691
01:44guns"the
01:44gunsfunction hashing mechanism was strlen()."
01:44gunsif anyone missed that
01:46ddellacostabitemyapp: please, why must you try to make me cry
01:46andyfI'm having problems with JVM .printStackTrace, or the (flush) call I am doing near it, generating null chars in my output file. Anyone know if there is a way to avoid that?
01:47ddellacostaI'm looking for something that will give me successive slices of a collection, like if I have [1 2 3 4], I want to get [1 2] and then [2 3] and then [3 4], and if there are less than 2 it just stops. Ideas?
01:47nopromptbitemyapp: i'm having a hard time not coming off as a dick in this comment i'm about to post.
01:47amalloy&(doc partition)
01:47lazybot⇒ "([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complet... https://www.refheap.com/21981
01:47ddellacostaSeems like some mix of take 2, partition, etc.. but I'm having trouble nailing it down
01:48bitemyappddellacosta: I don't mean you make you cry :(
01:48ddellacostaamalloy: argh, I thought I'd reviewed doc partition already, thanks
01:48amalloy&(partition 2 1 (range 1 5))
01:48lazybot⇒ ((1 2) (2 3) (3 4))
01:48bitemyappgerd dermert
01:48bitemyappI was about to paste that.
01:48amalloy&((fn [coll] (map list coll (rest coll))) (range 1 5))
01:48lazybot⇒ ((1 2) (2 3) (3 4))
01:48bitemyappI need to start guessing instead of double-checking my answer.
01:49ddellacostaamalloy, bitemyapp: yeah, I just didn't read the partition doc carefully enough.
01:50bitemyappddellacosta: at least the Clojure core library is that nice.
01:51ddellacostabitemyapp: yeah, seriously. I knew I was missing something that was definitely in there, which is why I asked
01:55bitemyappnoprompt: I struggle with that sometimes too. Github thread comment: "Die you ignorant prick" *^H^H^H^H^H^H* "How can you suck air and walk at the same time while being stupid enough to believe that?" *^H^H^H^H^H^H...* "I don't think you understand the problem very well" *^H^H^H^H^H^H...* "The problem is that ...." *submit*
01:55bitemyappyou can measure how angry I am by how many times I *C-a del* before getting something remotely acceptable.
01:56andyfbitemyapp: Does the success of that project matter to you?
01:56TEttingervery rage. such take offense. wow.
01:57bitemyapp(inc TEttinger)
01:57lazybot⇒ 8
01:57TEttingermy brother got a 3d-printed doge for hanukkah.
01:57bitemyappandyf: *sigh* Not really, no. I'd like Lispers to seem less derpy though.
01:57nopromptlol
01:57bitemyappTEttinger: that's a pretty awesome gift.
01:58TEttingerhttps://www.shapeways.com/model/1496035/doge.html?li=search-results&amp;materialId=26 it printed pretty well.
01:58andyfOne of the properties of Lisp is that its core is small enough that lots of programmers have implemented at least part of one.
01:59logic_progis there a way to configure core.async so that _multiple_ go blocks can read from a single channel? i.e. when I write to a channel, _all_ listeners get the msg
01:59andyfThey aren't all going to have equal quality.
01:59logic_progor is this fundamentally incompatible with core.async design?
01:59bitemyappWhenever I find myself surrounded by pop culture or people I don't respect, I climb for higher ground.
01:59bitemyapplogic_prog: fan-out yo.
01:59ddellacostalogic_prog: are you looking for a pub-sub kind of thing?
01:59logic_progI don't know
01:59logic_proglet me read up on both
02:00bitemyappfan-out is a generic signals/channels thing.
02:00ddellacostalogic_prog: easy to do with http://clojure.github.io/core.async/#clojure.core.async/pub
02:00andyfIf you want to avoid pop culture or people you don't respect, you can't go much further than reading Victor Huge, esp Les Miserables.
02:00xeqiddellacosta, logic_prog: or http://clojure.github.io/core.async/#clojure.core.async/mult + tap
02:01logic_progfan-out is not waht I want
02:01logic_progreading about pubsub now
02:01andyfs/Huge/Hugo/
02:01logic_progxeqi: will try that if pubsub does not work
02:02bitemyappandyf: I was thinking about programming communities.
02:03logic_progddellacosta, zeqi: pubsub looks like hwat I want
02:03logic_progxeqi: I think under the hood, it's the mult + tap you suggested?
02:04ddellacostalogic_prog: yep
02:06nopromptbitemyapp: ok. https://github.com/hylang/hy/issues/373#issuecomment-30730315
02:06nopromptlol
02:07bitemyappnoprompt: I like and agree with your response.
02:08nopromptbitemyapp: i feel so... experienced?
02:08nopromptbitemyapp: rational? what's the fucking word i'm looking for here?
02:09nopromptbitemyapp: i feel like i unloaded.
02:09nopromptbitemyapp: i feel better.
02:09noprompthaha
02:10bitemyappGood.
02:10nopromptsorry everyone!
02:10noprompt:)
02:10bitemyappI'm watching the Walking Dead. It's keeping me hooked so far but it's not that appealing.
02:12andyfI started watching it, and then after a season I realized it reminded me of Lost, and then was entirely unsurprised to find common people behind the creation of both.
02:13bitemyappandyf: the thing with the presaged dream crap was too predictable and stupid.
02:13bitemyappnow that I know the people from Lost are involved, I'm pondering quitting now.
02:14andyfRecommended things to watch if you haven't seen them already: Firefly, The IT Crowd, Father Ted
02:15bitemyappI loved Firefly but it's hole in my chest now.
02:15nopromptbitemyapp: Boardwalk Empire, now that's a show.
02:16bitemyappnoprompt: I watched the first season and a half, got exhausted with it.
02:16nopromptbitemyapp: season two of Walking Dead is nothing but people saying "You don't know what I've been through" or "I need to talk to you."
02:17bitemyappnoprompt: ick.
02:17nopromptbitemyapp: i like it so far. Breaking Bad, BattleStar Gallactica, and Caprica have been the only shows which have made me a pretty happy customer.
02:17bitemyappnoprompt: I liked BB, BSG, and Caprica too.
02:18bitemyappBSG made me happy.
02:18nopromptbitemyapp: Boardwalk Empire is good enough entertainment when i don't feel like thinking hard. generous helpings of nudity and violence.
02:19bitemyappnoprompt: have something happy: http://i.imgur.com/oCmvTas.jpg
02:20bitemyappnoprompt: I found the scheming the most interesting part of BE.
02:21noprompthahahhaa
02:23jonasenandyf: is crucible broken on master? I get lot's of exceptions
02:24andyfjonasen: Crucible wasn't intended to have no exceptions. It was intended to bring them to the forefront :-)
02:24bitemyappandyf: crucible?
02:25andyfTest suite for Eastwood Clojure lint tool we are working on
02:25andyfRuns the linter on all Clojure contrib libraries, and about a dozen 3rd party open source libs
02:26bitemyappyoish. That's thorough.
02:27andyfI didn't want to release it without some level of thoroughness like that. Plus, it is pretty easy to do given all the code available out there. May as well try out a variety and see what happens.
02:27jonasenandyf: I'll have to wait for a few minutes.. don't think it has downloaded the internet yet :) But I get a lot of NullPointerExceptions when retrieving deps
02:28andyfjonasen: Most of the libs are pretty small, but yeah, it can take a bit.
02:28andyfI haven't seen NPEs while cloning github repos, but haven't done it much recently.
02:29andyfjonasen: You are using a recent Leiningen version? Not that I know whether that would matter for sure, but worth asking.
02:30jonasenandyf: 2.3.3
02:31andyfthat's recent. Hmm. I haven't noticed any NPEs when it gets dependencies for me on those libs, but I may have vesions several days older than what you are getting now.
02:31jonasenandyf: the linting has now started.. still only NPE
02:33andyfjonasen: I get exceptions while linting, but they are all during analysis, emit-form, or eval, with no NPEs.
02:33andyfLet me try pulling a fresh copy and see what happens.
02:34jonasenandyf: oh, sorry.. they're no longer NPEs.. it's java.lang.IllegalAccessError
02:35seriously_randomproblems with cons, need a hint: http://pastebin.com/zgXHt5Vs
02:36andyfWhat JVM version?
02:37jonasen1.7.0_25
02:40andyfI've been doing most of my testing with a similar version. You have latest tools.analyzer(.jvm) installed?
02:41andyfBronsa keeps improving them.
02:41jonasenandyf: yes, via checkouts
02:41andyfI usually just 'lein install' them. Don't know if that should make any difference.
02:42jonasenit works fine when I run 'lein eastwood' in the eastwood root folder
02:42jonasenthat's why I think it has something to do with the scripts
02:43andyfI usually 'lein install' in tools.analyzer(.jvm), and then 'LEIN_SNAPSHOTS_IN_RELEASE=1 lein install' in eastwood root dir to install it in my ~/.m2.
02:43andyfThen I run the lint.sh script in crucible.
02:43andyfwith eastwood in my ~/.lein/profiles.clj
02:44jonasenandyf: ok, I'll try that
02:44jonasen(later, gotta run now)
02:44andyfbye
02:56andyfserioiusly_random: Try returning nil in the base case
02:57andyfwhen how many times is 0 rather than 1
02:57andyf,(cons :a :a)
02:57clojurebot#<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: clojure.lang.Keyword {:instance :a}>
02:57andyf,(cons :a nil)
02:57clojurebot(:a)
03:24andreiI have a strange macro bug that I can't understand
03:24andreiThe same code expands in two different ways depending on the context
03:24andrei(use 'monads.core) (defmacro w [a] `(mdo a# <- ~a (return a#)))
03:24andrei
03:24andrei(pprint (macroexpand-all '(w 1)))
03:24andrei(pprint (macroexpand-all '(mdo a <- 1 (return a))))
03:25andreiThe two print statements should have exactly the same output
03:25andreiBut they do not
03:25andreiAm I missing something?
03:25andrei(the same up to variable renaming of course)
03:28andyfAre you referring to the differene of namespace prefixes, e.g. user/mdo instead of mdo?
03:29andreiandyf: No. It generates incorrect code
03:29andreiThe correct code is: (monads.core/>>= 1 (clojure.core/fn [a] (return a)))
03:29andreiBut the output of (pprint (macroexpand-all '(w 1)))
03:30andrei(monads.core/>>= a (clojure.core/fn [x] (monads.core/>>= user/<- (clojure.core/fn [y] (monads.core/>>= 1 (clojure.core/fn [z] (monads.core/return a)))))))
03:30andrei(I renamed variables for readability)
03:31andreiNote how mdo didn't work, it did not parse <- correctly
03:33andyfI'm afraid I am probably getting too sleepy to be useful in answering your question, but you might want to create a paste that makes it clear what mdo refers to, in case someone else can.
03:34andreimdo is https://github.com/bwo/monads/blob/master/src/monads/mdo.clj
03:48amalloyandrei: clojure.walk/macroexpand-all is not close to a canonical/correct macroexpander
03:49amalloythe most obvious/common issue is that it doesn't do anything with &env like the compiler does when it's expanding macros
03:49andreiamalloy: You get the same reuslts with macroexpand
03:49andreiamalloy: And I discovered this because the code also executes incorrectly :)
03:52amalloyoh. your definition of w results in an expansion that is not exactly the same as your by-hand mdo
03:52amalloyit's putting `<- in there instead of '<-
03:53amalloyand you can see that mdo is looking for the no-namespace version of <-: https://github.com/bwo/monads/blob/master/src/monads/mdo.clj#L10
03:54amalloy(defmacro w [a] `(mdo a# ~'<- ~a (return a#))) should make them equivalent, andrei
03:55andreiamalloy: Yup. That works. Thanks! So does defmacro always fully-qualify the names?
03:55amalloyimo that's an issue with mdo, but it's not surprising that clojure's macro libraries have bugs :P
03:55amalloyno, defmacro never does that. it is ` which always does that
03:55andreiamalloy: Ah, should I use something else instead?
03:56amalloyhaskell? we have many well-meaning people here in clojure-land trying to write macro libraries, but nobody has put anywhere near as much time into it here as the haskellers have
03:56andreiamalloy: What should mdo be looking for?
03:56amalloyer, monad libraries
03:56andreiamalloy: I mean, in my macros to preven this :) (but yes, I do write a lot of haskell code)
03:56andreiprevent
03:56amalloyit should be looking for any symbol whose name-part is <-, rather than only the symbol with no namespace and whose name is ->
03:57amalloyno, you should continue to use defmacro and `, but just be aware of what it does, and know how to adjust the output when ` doesn't do quite what you want
03:57andreiAh, is there some easy function/syntax to do that or to break the name up?
03:58amalloy&(name 'user/<-)
03:58lazybot⇒ "<-"
03:58andreiNeat, thanks
03:59andreiIs this somewhere I should have read about this behaviour of defmacro but missed it?
03:59amalloyagain, it is not a part of defmacro at all, but of `
03:59amalloy&`<-
03:59lazybot⇒ clojure.core/<-
03:59andreiOh, I see what you mean
04:00philandstuff&`~'<-
04:00lazybot⇒ <-
04:00andreiThat's pretty odd behaviour
04:00andreiIs there a rationale behind this?
04:00amalloy$google symbol capture clojure
04:00lazybot[Unhygienic ("anaphoric") Clojure macros for fun and profit - amalloy] http://amalloy.hubpages.com/hub/Unhygenic-anaphoric-Clojure-macros-for-fun-and-profit
04:00amalloyhey, that's by me!
04:01amalloyit's really not a good answer to your question though
04:01andreiamalloy: Yeah, that seems to discuss macros; not specifically `
04:02amalloyandrei: the reason is that if you do like common lisp does, and have ` just copy symbols without a namespace or anything, you introduce a couple of places to let very subtle bugs in
04:02amalloyclojure's ` behavior fixes this very neatly, but causes some mild irritation when you actually wanted unqualified symbols
04:03andreiHmm. I have some difficulty seeing this. Can you give me some examples (non-defmacro-based)?
04:03amalloywell, they mostly don't matter except for in macros
04:03amalloy$google on lisp symbol capture
04:03lazybot[On Lisp: Variable Capture - Dunsmor.com] http://dunsmor.com/lisp/onlisp/onlisp_13.html
04:04amalloyyeah, that's exactly what you should read
04:04andreiI'm familiar with variable capture and the different macro systems out there
04:04andrei(including the scheme ones)
04:05andreiBut changing the semantics of ` seems like an odd choice for building a more hygenic macro system
04:05amalloywell, clojure namespace-qualifies symbols in `, so that they can't ever conflict with locals (which can't have namespaces), and also so that it's unambiguous which function should be called when the macro expands in a namespace with different aliases than the one it was defined in
04:06amalloyandrei: i mean, that's not a crazy opinion to have, but it's not like rich was "changing" the definition of `: he built a new language, with what he felt was a better way for it to work
04:06andreiBut surely far more people use ` outside the use case of macros?
04:06amalloyno?
04:06clojurebotno is tufflax: there was a question somewhere in there, the answer
04:06amalloy` is overwhelmingly used inside macros
04:07andreiamalloy: Really? That's highly surprising
04:07andreiamalloy: quasiquote/unquote are regularly used in scheme outside of macros
04:08andreiamalloy: Is there an actual quasiquote/unquote for clojure that doesn't namespace qualify?
04:08amalloyno
04:12andreiamalloy: Oh well. Thanks for the help. I guess I'll have to learn to live without ` in non-macro code and hope for reader macros to fix this up.
04:12amalloyandrei: ` in non-macro code is perfectly fine too, it's just not great for inserting literal symbols
04:12andreiamalloy: Speaking of. Do you know if there's a way to get reader macros? Like to swap out the reader for a compatible one?
04:13amalloywhich is mostly fine because clojure doesn't use symbols in as many places, since it has keywords
04:13mbarbieriHi, I'm trying to port a Scala/Akka little project to Clojure, I know that the "default" way of dealing with async is with core.async but my akka actors are remote: which is the most idiomatic way to deal with remote servers?
04:14amalloyeg, `(~x ~@ys ~z) is a perfectly reasonable thing to write, and totally unaffected by namespacing
04:15justin_smithmbarbieri: I am not sure that core.async is the most idiomatic; refs and atoms and futures and agents are all core language concepts that are all about async
04:16justin_smithmbarbieri: avout uses apache zookeeper to make distributed (multi server) versions of refs and atoms
04:16philandstuffandrei: do tagged literals do enough for you?
04:16andreiphilandstuff: Nope
04:16justin_smithmbarbieri: avout has implementing distributed agents on their roadmap, which is exactly what I think you would want
04:16andreiphilandstuff: I have to have non-scheme data
04:18mbarbierijustin_smith: ok thank you, will check avout
04:18andreiphilandstuff: Specifically I want inline LaTeX
04:18andreiphilandstuff: Which you can't even inline as a string
04:20andrei"\alpha" is not a valid string
04:20hiredman,"\\alpha"
04:20clojurebot"\\alpha"
04:20hiredman,(println "\\alpha")
04:20clojurebot\alpha\n
04:20andreiYes, but that defeats the whole purpose of what I'm doing
04:20justin_smithwhich is?
04:20justin_smiththe syntax for \ in a string is \\
04:20hiredmansure, you want like that haskell compiler that can take in haskell with inline latex
04:21andreiI want it to literally be LaTeX so that I can copy and paste between my papers and code
04:21hiredmanyou are one of those literate programming guys
04:21andreiSo that emacs can render it inline
04:21andreiAnd so that at compile-time it can generate code from my LaTeX
04:21andreihttps://github.com/abarbu/schemetex
04:22hiredmanno, clojure doesn't allow user definied reader macros
04:22andreiWell, the current reader doesn't. But is there a way to swap it out for one that does?
04:22hiredmanandrei: the way to "swap it out" would be to write another reader and call the read function for that reader
04:23hiredmanbut that won't change how the compiler reads code
04:23andreihiredman: Right. Has someone written a reader for clojure that supports reader macros and can I ask clojure to use that one?
04:23hiredmanso you'll need a new compiler too
04:23hiredmanandrei: no
04:25TEttingerandrei, maybe. you can kinda hack clojure's reader
04:26hiredmanandrei: are you using emacs? have you considered using something like org-babel?
04:26andreihiredman: To which of the two? I can't replace clojure's reader or there is none available?
04:26andreiTEttinger: Oh?
04:26TEttingerhttp://briancarper.net/blog/449/clojure-reader-macros
04:26andreihiredman: I use org-babel, yeah
04:27hiredmanandrei: technically you can turn off the access protection on the read table and fiddle it
04:27hiredmanbut that is seriously frowned on
04:27andreihiredman: Oh? How would one do this?
04:27hiredmanwhich is no doubt what that blog post is about
04:28hiredmanandrei: just don't
04:28andreihiredman: Yeah, seems like that's what they do
04:28andreihiredman: What other choice do I have?
04:28hiredmanandrei: if you are using org-babel then you can mix clojure code with org text already
04:29andreihiredman: But that's not what I want to do. I want plaintext files that I can distribute to others that have LaTeX that acts as code and renders as an equation
04:29hiredmanno one will want that code
04:29hiredmanif you want to redistribute code basing it on a hacked runtime is not good
04:30andreihiredman: I don't see the problem
04:30andreihiredman: This is clearly the clojure way of creating reader macros
04:30hiredmanthe reason clojure doesn't have user defined reader macros in the first place is issues with composability and code reuse
04:30hiredmanandrei: it is not
04:30hiredmanandrei: no one does it
04:31hiredmanandrei: it is one guy trying to show the world how smart he is by writing a blog post about it
04:31andreihiredman: Right. Except I need reader macros? I really don't see what else I can do. Unless you mean. Don't implement the feature that I want and use?
04:31hiredmanandrei: I am advising you against it, for the sake of whoever you are distributing this code to
04:32andreihiredman: No. It's one guy that allows me to do what I need to do. I really don't understand the problem or what else I can do to get around it?
04:32andreihiredman: So like.. I'm open to suggestions
04:33justin_smithandrei: I think a layer that de-clojures strings would be much easier than a layer that redefines string input to clojure
04:33hiredmanandrei: readjust your expectations, clojure is not scheme
04:33amalloyit's a feature that does not exist in the language. clojure does not contain all the features you could possibly want, and the fact that you can hack the runtime to make it work doesn't mean you should do it
04:33andreijustin_smith: Except that said layer needs to exist in LaTeX
04:33justin_smithor as a compromise a layer that takes plain latex and clojure-escapes it, but not at the clojure reader level
04:33andreijustin_smith: And I'm not writing that
04:33amalloyif you were asking for a way to mutate local variables, you would get the same response: that's not something you can do in clojure
04:33justin_smithandrei: it could exist in org/emacs
04:34hiredmanor use, what the web thing is called, tangle?
04:34andreijustin_smith: Then this would forever only work in org/emacs. Which doesn't work for me. And it's even worse
04:34andreiAn extra layer that requires escaping defeats the purpose
04:34justin_smithI think you want a language that is more flexible about parsing
04:35andreiI copy & paste between my code and my papers
04:38andreiThanks for the help!
04:38andreiamalloy: Actually. Mutating locals works just fine
04:40hiredmanandrei: I imagine coming from scheme you thinking you are mutating a local using a def, but in clojure def always creates a global
04:41andreihiredman: No. I realize defs are global
04:41hiredmanthen in what way do you think you are mutating locals?
04:42andreihiredman: But you can always mutate by having a java container for the object. I even found a nice library for it. https://github.com/ztellman/proteus
04:42hiredmanyou aren't using that right?
04:43andreihiredman: Totally. It made quite the nice performance improvement
04:43hiredman:(
04:44hiredmana. that isn't mutating locals, that is a macro that boxes things up in mutable cells
04:44hiredmanb. he wrote it as a joke
04:44andreihiredman: Right, but it ends up effectively being the same thing
04:44andreihiredman: Sure! Works for me
04:45andreihiredman: If you have suggestions for a container that's equally fast, I'll use it
04:49seriously_randomI can get rid of vector here: (concat (rest [1 2 3]) (vector (first [1 2 3])))
04:58fredyruser> (conj (rest [1 2 3]) (first [1 2 3]))
04:58fredyr,(conj (rest [1 2 3]) (first [1 2 3]))
04:58clojurebot(1 2 3)
04:59fredyroh nvm
04:59fredyrwrong ordering
05:02fredyruser> ,(conj (vec (rest [1 2 3])) (first [1 2 3]))
05:02fredyr,(conj (vec (rest [1 2 3])) (first [1 2 3]))
05:02clojurebot[2 3 1]
05:03fredyrseriously_random: you need the vector somewhere, is the answer
05:03fredyreither on the sequence, with conj, or on the element as in your example
05:03seriously_randomfredyr, ok thanks
05:04fredyr[(first [1 2 3])] is bit shorter than (vector ..) though
05:06hiredman,(doc take)
05:06clojurebot"([n coll]); Returns a lazy sequence of the first n items in coll, or all items if there are fewer than n."
06:11dabdIs it considered good style to rebind a fn parameter in a let?
06:12dabdI find myself doing something like (defn f [x] (let [x* (transform x)] (g x*)....))
06:12arcatani wouldn't do it, but i don't know if my clojure style is reflective of the common clojure style
06:15clgvdabd: that's totally fine if it is a simple way to express the functionality
06:16clgvdabd: one recuring pattern I noticed for a certain domain is (defn [v, ...] (let [v (ensure-vector v)] ...))
06:17dabdI don't like using x*, x** everytime i need to transform a parameter but otoh rebinding it makes the code a bit harder to read
06:17clgvdabd: if the solution really needs to replace the value of "x" just rebind the local
06:18clgvdabd: in that case it also avoids errors like usin "x" instead of "x*" accidently
06:23kandinskiI've arrived to problem 51 in 4clojure from problem 50, but it feels like I've missed a previous one
06:24kandinskiproblem 51 talks about "some more sophisticated destructuring" when there's been no destructuring before
06:27arcatankandinski: weirdly enough, problem 52 is called "Intro to Destructuring"
06:27kandinskiarcatan: shuffle then
06:27clgvwell just search for the term in the list ;)
06:28kandinskiclgv, I meant "they must have gotten shuffled then"
06:28clgvyeah probably
06:28clgvbut I do not know if the order means anything.
06:29clgvbecause simple or basic excercises got added later as well and thus have a higher number
06:29kandinskiah, that explains
06:29kandinskialso that would explain why the numbers aren't visible in the problem list
06:29clgvI'd just sort by difficulty...
06:30kandinskiI'm letting the thread take me
06:31kandinskiwhich of the available books is best for someone with programming experience? I've just dived into 4clojure and the cheatsheet, but I would profit from more structured study.
06:31clgv"Clojure Programming" is recommended a lot
06:31kandinskiI know python itertools and functools well, and have a bit of experience using scheme as a scripting language
06:31kandinskik
06:32clgvimho it is the most recent introductory one
06:33kandinskithanks
07:30justdithi all! I've a problem with `resolve` - it does resolving when I do it in repl, but returns nil when run as a program. Anything I'm missing?
07:36seriously_randomthis simple unfinished function doesn't return a set, why? http://pastebin.com/1Z0VLxA9
07:38lumafiyou're missing parentheses around "my-frequencies-helper freqs a-seq", if you want to call the my-frequencies-helper function
07:38lumafinow it just evaluates my-frequencies-helper, freqs and a-seq in order and returns the last one, a-seq
07:38si14what's a "Pop without matching push" error?
07:39si14in core.async
07:39si14I mean
07:43seriously_randomlumafi, I see. thanks
07:44si14and one more question: what's a best practice to ensure that some thread keeps looping in some function, regardless of exceptions? catch Exception e?
07:45si14in Erlang errors in long-running processes are handled by supervisor. How one deals with such things in Clojure? Let's assume that we are using core.async here to communicate between processes.
07:49justditsi14: you can use setDefaultUncaughtExceptionHandler of the Thread class - the same as in Java
07:49Anderkentsi14: pop without matching push sounds like an internal error, I don't think you're supposed to be able to trigger it
07:49Anderkentdo you have a repro example?
07:49si14Anderkent: nope. it just happened in production once
07:50si14Anderkent: hate those transient bugs
07:50Anderkentright. basically what core.async does behind the stages is save your thread state with {push,pop}-thread-bindings
07:50Anderkentpop without matching push would mean it got very confdused
07:51si14Anderkent: I've updated core.async version from 0.1.256.0-1bf8cf-alpha to 0.1.267.0-0d7780-alpha, maybe this will fix it
07:52si14justdit: I suppose this will work with threads, but not with go-blocks, right?
07:52Anderkentsi14: It plausibly might happen if the thread that the state machine operates on is changed?
07:53Anderkentthough I'm not sure about that
07:53Anderkentdepends if core.async uses Var/pushThreadBindings or their own implementation... Probably their own
07:53si14Anderkent: how can this happen? I can send you a piece of code that produced the error in PM.
07:53AnderkentI'm not sure, sorry. Mostly theorycrafting here
07:55justditsi14: correct. I don't think that there's Erlang like solution for this
07:55Anderkentah, okay, no it shouldn't happen like that; core.async keeps track of thread frames on its own
07:55AnderkentIt's plausibly completely unrelated to core.async then
07:57si14Anderkent: here is the trace: https://gist.github.com/si14/f8ee24e9a38ad33da17b
07:59Anderkentright, it's hard to say what could trigger it without processor.clj
08:00si14Anderkent: and here is the relevant piece of processor.clj: https://gist.github.com/si14/e7bc3c17ce3316567c03 :)
08:06Anderkentthat all looks good to me. Sorry :( I guess if you really need to figure this out I'd try running the start function through a full macroexpander, see from where the pop_thread_bindings call comes.
08:06si14Anderkent: thanks a lot for your time
08:07seriously_randomconvert a set to hashmap, e.g. (set [:a "b" 3])
08:08ddellacostaseriously_random: today's homework? ;-)
08:08ddellacostaseriously_random: did you figure out the thing yesterday, btw?
08:10seriously_randomddellacosta: yes, the task was actually much simpler. I overthought it.
08:10ddellacostaseriously_random: I know how that is...
08:10fredyrsi14: it doesn't seem that core.async is calling pop-thread-bindings anywhere in the code
08:11fredyrsi14: the bindings being kept in the state machine are kept in an ordinary map
08:12Anderkentfredyr: yeah but common clojure macros expand into pop-thread-bindings which might throw this exception
08:12fredyroh
08:14CookedGryphonHey, does anyone have any good suggestions for an interactive workflow with core.async? I have a number of little event loops, and when I make a change to the logic, I need to close the channel and restart the go loop
08:14CookedGryphonI miss being able to just evaluate the form
08:14CookedGryphonbut if I make it something which runs when I evaluate the form, it's going to run when I aot compile and is generally bad form
08:14CookedGryphonany thoughts?
08:15CookedGryphonis there a way to hook into the redefinitian of a var for a development workflow?
08:16fredyrAnderkent: are there other common macros that binding, with-bindings/* that does that?
08:16fredyrs/that/than
08:18Anderkentfredyr: hm, not of top of my head, actually. grepping for pop-thread-bindings in clojure jar gives mostly pprint related files other than the two core occurences
08:18Anderkentbut that's probably because it's .class files so possibly already macroexpanded
08:19si14CookedGryphon: you can do it with "lifecycle" idiom and "control channel"
08:20fredyryeah i did that same grepping on both core.async and clojure
08:20si14CookedGryphon: take a look at control-c here: https://gist.github.com/si14/e7bc3c17ce3316567c03#file-processor-clj-L37
08:20si14we are closing this chan to stop the loop
08:21CookedGryphonsi14: Yeah, I can close and restart the channel, that's not my problem
08:22CookedGryphonthe issue is that I have to do that manually
08:22CookedGryphonso I can't do my normal workflow of tweak code, C-M-x evaluate the form, play with the results
08:22fredyrAnderkent: in any case, I couldn't find any uses of those macros in core.async either
08:22si14CookedGryphon: I see.
08:23CookedGryphoni need to evaluate the form, close the input channel for that form, then re-run my go block which is fine, just not as smooth as I've got used to with the rest of clojure
08:23Anderkentfredyr: yeah as I said before I don't think it's core.async triggering it any more, sorry for not being clearer
08:23Anderkentas the stack trace suggests the exception comes from the start function
08:23fredyrAnderkent: ah right, agreed then :)
08:26si14Anderkent: I thought that that "start" means that the go block is located in start function, am I wrong?
08:27fredyrsi14: Its one of the execution steps in the state machine inside the start functions causing the error
08:28Anderkent.. probably
08:28Anderkent:P
08:30fredyrotoh if it was one of the function calls, like process or check-undone, wouldn't it show up on the call stack then?
08:30fredyroh
08:31fredyrwith-out-str calls binding
08:31Anderkentif they're functions, yeah, if they're macroes they won't
08:32fredyrAnderkent: right
08:33fredyrwith-out-str does call pop-thread-bindings
08:33si14fredyr: is there any idiomatic way to avoid that binding there?
08:33Anderkentno, and binding in general should work in that case
08:34si14(oops, erroneous /me)
08:40seriously_randomhow to implement a base case for a recursion like this: http://pastebin.com/yBEduRfD
08:43progobase case is "a-map"
08:45progoalso: (into (hash-map) (for [k a-set] [k 0]))
08:45Anderkentseriously_random: so when the set is empty, you want to return the map, otherwise you want to add an item to the map and recurse. Your recursive call does not work here though, assoc does not modify a map in place, it returns a new map with the changes included
08:46si14wow, so print-stacktrace can throw exceptions of it's own. kinda epic! https://gist.github.com/vadim-for-test/44a1af40dc3f0a4a1981
08:47si14is there anything bulletproof in JVM at all?
08:47si14*Clojure
08:47seriously_randomAnderkent, nothing modifies a map in place?
08:47Anderkentseriously_random: that's right, clojure data structures are immutable
08:48Anderkentsi14: no, anything can throw an exception; think of OutOfMemoryException for example
08:49si14Anderkent: OOM is another beast and at least can be monitored from outside
08:49si14Anderkent: and there is nothing to be done with it, too
08:50Anderkentwell, there's nothing to be done with a null pointer either, really.
08:50si14Anderkent: ignore the error and carry on?
08:50Anderkentexcept if you expect it
08:50Anderkentoh well, you can do it with an OOM too :)
08:50si14Anderkent: I certainly don't expect NPE from *print-stacktace*
08:50Anderkentneither do I, so I expect you're passing it something it doesnt like?
08:51si14Anderkent: caught exception?
08:51Anderkentdoes the exception have a stack trace?
08:52Anderkenthm, should if it's caught and not crafted
08:53Anderkentit really looks like if you were giving it null
08:53si14https://gist.github.com/vadim-for-test/44a1af40dc3f0a4a1981
08:53si14how can I give it null here?
08:55Anderkentah no, ok, it seems it just doesn't have a stack trace
08:55Anderkentare you on sun jvm?
08:56seriously_randomAnderkent, sorry, but how do you recurse after you add an item to the map? http://pastebin.com/1enngf5y
08:56AnderkentI think there was a flag like OmitStackTraceInFastThrow in one of the jvms
08:57Anderkentseriously_random: you must pass the result of (assoc cur-map key value) to the recur call
08:57Anderkentseriously_random: i.e. (if (empty? a-set) a-map (recur (assoc a-map (first a-set) 0) (rest a-set)))
08:58seriously_randomAnderkent, thanks
08:58Anderkentsi14: http://jawspeak.com/2010/05/26/hotspot-caused-exceptions-to-lose-their-stack-traces-in-production-and-the-fix/
08:58Anderkent2010 though, so not sure if up to date
08:59Anderkentit's possibly worth raising this as an issue on clojure mail lists or something. print-stack-trace NPE'ing because the exception has no stack trace is meh
09:00si14Anderkent: ok, thank you
09:23stuartsierra`pst` probably tries to do too much.
09:24mdrogalisWest coast doesn't sleep, stuartsierra.
09:24stuartsierramdrogalis: huh?
09:24mdrogalisstuartsierra: PST.
09:24mdrogalisIt was a joke. :(
09:24stuartsierraoh, I see :)
09:25mdrogalisTuesday morning humor.
09:28si14wow. Arctic Sunrise members will give a public meeting in my city (Saint-Petersburg).
09:55jcromartiesomebody remind me of the difference between clojure.lang.IPersistentMap and clojure.lang.APersistentMap again
09:55jcromartieone is the protocol interface and one is the old-school interface, right?
09:56jcromartiewhich is better to use for dispatch
09:56stuartsierraNeither is a protoc.l
09:56stuartsierra*protocol
09:56stuartsierraIPersistentMap is a Java interface.
09:56stuartsierraAPersistentMap is a Java abstract base class.
09:56jcromartiealright, better to dispatch on the interface of course
09:56jcromartieOK thanks
09:57stuartsierraIt depends: Java allows multiple inheritance of interfaces, which can lead to ambiguities if, say, you extend a protocol to two different interfaces and call it on an object that implements both.
09:59jcromartieyeah I suppose so. if I'm implementing a protocol for most of the persistent collections, then maybe I should use the abstract base class to be more explicit
09:59jcromartiesets, maps, vectors
10:00stuartsierraThat's usually how I do it.
10:00jcromartieand where I'm implementing it for fns I obviously don't want the IFn interface
10:00jcromartiesince maps and sets implement it
10:00jcromartieand vectors!
10:00philandstuffdon't forget PersistentQueue
10:00stuartsierraExamining the class hierarchies is helpful here: https://github.com/stuartsierra/class-diagram
10:00jcromartieah yes :)
10:01jcromartieoh, beautiful
10:02gvickersHey I am having trouble conceptually with reify, does it literally instantiate an object implementing whatever interface i am reify-ing?
10:03joegallostuartsierra: that's pretty dang neat
10:03stuartsierrajoegallo: thanks
10:03stuartsierraI wrote it specifically to help me figure out which classes I needed to extend to work with Clojure's built-in data structures. :)
10:04joegalloall of the classes
10:04stuartsierrafortunately, no :)
10:09stuartsierragvickers: yes
10:09stuartsierragvickers: `reify` generates an anonymous class implementing the interfaces you specify, then constructs an instance of that object.
10:15gvickersstuartsierra: is passing a reified interface the prefered way to pass java classes event handlers? Or is there some gotcha I'm missing with java interop arround this
10:16stuartsierragvickers: `reify` is often useful for callback interfaces.
10:16gvickersstuartsierra: thanks!
10:16stuartsierraIf you need to inherit from a *class* instead of an interface, then `reify` is insufficient and you have to use `proxy`
10:22philandstuffhttp://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/ attempts to help choose
10:23gvickersphilandstuff: wow very cool
11:04rkneufeldJust pushed a basic shell for the core.async wiki: https://github.com/clojure/core.async/wiki . Anyone starting to play/work with core.async, I encourage you to add to the wiki as you see fit.
11:05mdrogalisMuch needed. Thanks rkneufeld.
11:12coventryI'm getting a "java.sql.SQLException: Connections could not be acquired from the underlying database!" in a project which uses korma with a postgresql database. The database exists according to the psql command, and I can telnet to the database port specified in the project, localhost:5432. How can I debug this? Is there a way to trace the traffic over the database port?
11:20rukorCoventry: are you able to get connections using plain old jdbc?
11:21coventryrukor: Is there a quick way to test that, given a uri like postgres://coventry@localhost:5432/dbname?
11:22coventryrukor: Oh, I'll crib from the "example usage" section of the jdbc readme.
11:25rukorYes. (DriverManager/get connection uri)
11:26rukorgetConnection
11:26rukorjava.sql.DriverManager
11:28coventryHmm, well I can connect using a variant of the "Example Usage" code, but not with DriverManager. It gives me "SQLException No suitable driver found for <uri>."
11:36rukorYou need the driver in the class path. But since you can connect using the plain jdbc, it's more likely that something is wrong with the connection settings when using korma
11:37rukorIs it exactly the same settings you tried?
11:42coventryIn the project, I do get a different dbspec being passed to korma.db/postgres. Is it the same as the spec passed to jdbc commands? I will try pasting it in and varying it.
11:44coventryHmm, the dbspec from the project works unmodified in the example...
11:58CaptainLexIf I need to add cljs to an extant clj project, how should I structure the directory?
11:59technomancyCaptainLex: most people move src/ to src/clj and add src/cjls. not a fan personally; I'd just add cljs/ to the project root
12:00rukorcoventry: Hmmn, can only suggest some trial n error here. Is are you able to connect to another dB say h2 from your korma setup.
12:00CaptainLextechnomancy: Thanks! I was just making sure I wouldn't have to refactor any of my namespaces. But I see now I wouldn't have had to anyhow
12:02rukorcoventry: also ensure the driver is in the class path.
12:02CaptainLextechnomancy: to the project root or the src root? Does cljs-build just find .cjls files where they are?
12:04pbostromCaptainLex: you specify the location of your cljs files to cljsbuild in your project.clj file
12:04technomancycljsbuild doesn't do much without a lot of spoon-feeding afaict
12:04technomancynot that I've used it personally
12:04CaptainLexpbostrom && technomancy: Thanks! I
12:11coventryrukor: Thanks for the suggestions.
12:27seangroveDefinitely would like to see much more static analysis for cljs, much like what Chas suggested on the ml
12:34modulusSo guys, when using korma.db's defdb sqlite3 helper, what's the default path for the database file?
12:35modulusand does it vary when running the project or from repl?
12:39luxbockhttps://gist.github.com/luxbock/dc84ef7d4a34f80c6af9
12:39luxbockwhy does this not work?
12:44amalloy&(re-matches #"\d+" "abc")
12:44lazybot⇒ nil
12:44amalloy&(re-matches #"\d+" "123")
12:44lazybot⇒ "123"
12:44amalloy&(true? "123")
12:44lazybot⇒ false
12:44luxbockah yeah just realized I need to use `boolean` instead of true?
12:45amalloyluxbock: just don't use anything
12:45S11001001luxbock: you also don't need the partial; just use the re from the enclosing environment
12:45amalloyand using complement on a lambda is pretty weird
12:45S11001001(fn [f] (fn [x] (f x) #_(<<- perfectly legal)))
12:45amalloyjust put a (not ...) inside the lambda
12:46luxbockhmm yeah I guess I was overthinking this
12:49TimMcFor that matter, you can swap the filter + not for a remove.
12:50clgvhow would you implement the following scenario? I have a non-trivial function that is a recursion on 3 values. now I need to use the recursion step in a different iterative scenario. extracting the step in a defn will result into packing the 3 values in a vector and destructure it again which is not optimal
12:50logic_progis there a pure clojure / pure java solution for pdf ->png ? (i.e. something like ghostscript, but only requires jvm)
12:51clgvin CL (e.g. SBCL) I could return the 3 values from the function efficiently without packing and unpacking
12:51logic_progi'm converting pdfs that _might_ be malicious, thus I'd prefer something hosted on the jvm, rather than gs (which probably has some buffer overflow)
12:51clgvlogic_prog: maybe itext has some function for that?
12:52`cbpclgv: wat
12:52`cbpwhy do you need to pack/unpack? just pass them as arguments
12:52`cbpaka I don't understand your problem
12:54clgvImagine (defn f [x y z] (let [...calculations...] (recur x, y, z)) now I'd need to do the calculations stepwise which would work if it was (defn calculations [x, y, z] [x*, y*, z*]) but then I'd need to pack and unpack from a vector to have the recursion with the same code as well...
12:56clgvI could probably try to do some macro wizardry there. but the question is whats the simplest approach
12:56amalloyif it's any consolation, i bet it costs you something to call (values x y z) in CL as well, it's just not as explicit
12:57`cbpOh, well uhm yes that's unfortunately how you pack values in clojure
12:57`cbpyou can use a java array if it bothers you too much I guess?
12:57`cbpIt's what I do when I wanna pack values in java
12:57clgvamalloy: I researched it as deeps as I could and it seems that it is really operating on the stack in the internal implementtion
12:58seangrovebitemyapp: You around to help with a korma connection problem?
13:00clgvI probably want a macro: (defn-awesome mystep [FLIP recur] [x y z] (let [x* ..., y* ..., z* ....] (FLIP x, y, z))
13:00amalloyi think you probably want a function, and to not worry so much about the "expense" of building a 3-tuple
13:00`cbpwhy not just a global java array that the function mutates if you want it to be fast
13:01clgvamalloy: no. I know from measuring that this code is the hotspot of the algorithm ;)
13:01amalloy`cbp: i'm sorry to tell you you just got voted out of #clojure for suggesting the strtok algorithm
13:01`cbp:(
13:01amalloywell, not strtok, because it reuses that global as input. there's some other c function that has a global output buffer, though
13:02amalloyanyway, it has the serious serious problem of being totally unusable with multiple threads
13:02amalloyand not reentrant at all
13:03clgvamalloy: isnt it a c static in the function instead of a global variable? which doesnt change the implications you just mentioned ;)
13:04clgvis there some codewalking functionality which allows replacement of symbols?
13:04amalloyclgv: clojure.tools.macro/symbol-macrolet
13:05clgvamalloy: symbol-macrolet preserves clojure's special forms?
13:06clgvin contrast to macrolet?
13:06amalloyuhhhh?
13:06clgvamalloy: ok rephrased: why symbol-macrolet and not macrolet?
13:06amalloybecause...you wanted to replace a single symbol, it sounded like
13:07clgvyeah, ok. ah the second one is for general local macros
13:08clgvthe readme could use an update with respect to the current version^^
13:12clgvamalloy: works as intended. thank you for that pointer
13:16TimMcclgv: I think ztellman has a clj-tuple lib that might be pretty fast.
13:18clgvTimMc: the problem is upto now I do not need to create anything there and just for comparison with published results I need to implement the iterative special case. hence I do not want to ruin the runtime of my working algorithm ;)
13:19clgvI am building a pretty simple macro `alternatives` on top of `symbol-macrolet` which allows me to define the recursive function and the iterative step function with the same function code
13:39jcromartiewhy hasn't clojure.lang.PersistentQueue been exposed via Clojure functions yet? is it considered "private" or maybe even deprecated
13:40technomancyit's an easter egg!
13:40clgvtechnomancy: :P
13:44jcromartiethe point-free style is flowing in me right now
13:47dabdI am learning to use instaparse. Great library!
13:48bitemyappseangrove: I can try.
13:48dabdIs it possible to add dependencies to project.clj without quitting your repl?
13:48CaptainLexI must be very thick. How do I clone a DOM element using dommy?
13:49technomancydabd: check out alembic
13:49bitemyappdabd: keep in mind that Instaparse is part of a family of parsing libraries. GLL-based parser combinators.
13:50nopromptbitemyapp: haskell has irritating syntax.
13:50nopromptbitemyapp: i want to like this language. i really do.
13:50CaptainLexInfix notation makes me :(
13:50dabdtechnomancy: ty
13:51dabdbitemyapp: ty for the warning but I am parsing simple files.
13:51seangrovetechnomancy: That used to be a pretty good cocktail place on haight. Not so much anymore :P
13:52bitemyappdabd: it wasn't a warning, I'm letting you know it isn't unique so that you know to poke around if you're in a different territory and need a parser.
13:52bitemyappnoprompt: I disregarded syntax when I was teaching Clojure, I do the same with Haskell.
13:52bitemyappnoprompt: it just doesn't matter.
13:52bitemyappnoprompt: at least use Haskell long enough to come up with a less petty complaint >:P
13:53bitemyappit's equally petty to complain about S-exprs :)
13:54dabdI am learning haskell slowly at the moment. Working through the book "Learn you a Haskell...". It is unfortunate they didn't use S-expr syntax. I remember some time ago there was a project with that purpose. Liskell or something like that.
13:55nopromptbitemyapp: not really. the benefits of haskell's type system are obvious.
13:55justin_smithwhat is the best option for clojure client-side http ssl?
13:56bitemyappnoprompt: you could go full unabomber and be the only dude writing S-expr Haskell.
13:56coventrybitemyapp: I'd be grateful for any suggestions you have for debugging this korma connection issue. http://clojure-log.n01se.net/#11:12
13:56nopromptbitemyapp: between a ParseError and an UnexpectedEOF (Lisp), i'll take the latter any day.
13:56bitemyappjustin_smith: clj-http.
13:56tim___(inc noprompt)
13:56lazybot⇒ 2
13:56bitemyappcoventry: I'll need the URI and the code.
13:57bitemyappnoprompt: I've not actually seen somebody stumble that much over it.
13:57bitemyappnoprompt: I still think you should move it over to #haskell so we can spam the people here less.
13:58nopromptbitemyapp: what am i gonna say? "i don't like the syntax. wha, wha, wha, ;_;"
13:58coventrybitemyapp: Makes sense, but it's closed source. I'll muddle along for now, see whether the owner would be OK with sharing.
13:58noprompt:|
13:58nopromptbitemyapp: but i will stop spamming this channel.
13:58justin_smithbitemyapp: I didn't express that clearly enough: I want a clojure http server but client-side ssl
13:58coventrybitemyapp: Thanks for taking a look, though.
13:59bitemyappjustin_smith: you're not explaining this well.
13:59justin_smithhttp://pilif.github.io/2008/05/why-is-nobody-using-ssl-client-certificates/
13:59bitemyappcoventry: I'd reach past the Korma bit and google around for that error in a Java oriented context. See what causes it for them and translate.
13:59justin_smithbitemyapp: ^^ above link
13:59bitemyappjustin_smith: I don't even know what that is. good luck.
14:01coventrybitemyapp: Yeah, the confusing thing is, I actually have an effective way to connect with raw jdbc, using the same db spec I pass to korma. That makes it harder to translate, because the usual reason is "The database is inaccessible", and that's not the case, here.
14:01justin_smithbitemyapp: elevator pitch is "like standard https, but the client has the certificate" - useful for a connection where an enumerated set of users should have secure access
14:01`cbppython is the shortest path to hell
14:01technomancyclient certs are amazing
14:02justin_smithtechnomancy: I think so too - do you have any leads on using them with a clojure stack?
14:02edwI've noticed that for dependencies in a lein project file, order is important, at least when multiple versions of a package are included transitively through. I would've guessed that listed dependencies would take precedence over transitive ones.
14:02bitemyappcoventry: I don't repro other peoples' problems de novo for free. refheap or I can't do anything.
14:02technomancyjustin_smith: no, my web experience is very limited
14:02bitemyappcoventry: I'm sorry. It's just not fair to expect me to be able to do anything with zero information unless it's truly trivial/googleable.
14:02bitemyapp`cbp: slip-n-slide.
14:03coventrybitemyapp: I'm the one who should apologize for not being able to give more info. Thanks for the suggestion.
14:03bitemyappcoventry: in general, worrying about IP in the course of doing work for a client/employer isn't wise. They're paying you to get things done, sanitize the information then pass it on.
14:03bitemyappI can almost guarantee they don't give a fuck about some database connection code.
14:04bitemyappit's a parsimonious and short-sighted mindset that worries about sharing that as if you're somehow damaging the owner when you're losing them time.
14:05bitemyappcoventry: http://stackoverflow.com/questions/13175655/trouble-connecting-to-postgresql-db-on-heroku-with-korma-clojure
14:05bitemyapphttps://github.com/korma/Korma/issues/14
14:05bitemyapphttps://groups.google.com/forum/#!topic/clojure/n6RT_5pUtc4
14:05bitemyappcoventry: it wasn't any of those things ^^ ?
14:05bitemyappcoventry: what version of Korma?
14:10coventryIt's a local postgresql database, running on ubuntu, so not the first two. I will experiment with the suggestion in the last url. Thanks. Tried with korma version is "0.3.0-RC4" and a fresh github checkout (RC6) from today.
14:11bitemyappwhy is the cognicast episode about Lacan?
14:11dnolennoprompt: secretary is your lib right? I ended up using it in my Om TodoMVC, works as advertised.
14:13algaljustin_smith: I'm also going to be tangling with ssl client certs in clojure shortly. Are you looking for a library or examples showing how to authenticate the :ssl-client-cert param delivered by the ring request map?
14:14justin_smithalgal: I am much earlier in the research than that even :)
14:14justin_smithjust figuring out how it would integrate with my ring library
14:14nopromptdnolen: it's actually gf3's lib, but i'm a contributor. :-)
14:14justin_smithalgal: I have a usecase that looks like a good match for client-side ssl certs
14:14dnolennoprompt: I just hooked into goog.History is that what you do?
14:15nopromptdnolen: that's what i've done.
14:16nopromptdnolen: patches are certainly welcome if you find faults with it.
14:16dnolennoprompt: nah, I just needed a router and I didn't want to integrate some random JS thing
14:16dnolennoprompt: secretary + goog.History works great
14:18bitemyappjustin_smith: the way we secure this sort of thing is via VPNs.
14:18algaljustin_smith: And you're running clojure on the server, and wondering how to get the clojure-based server to properly authenticate requests from clients using SSL cient certs?
14:19clgvjustin_smith: I am using client side ssl certificates for a computation service implemented in clojure
14:20clgvjustin_smith: do you need info how to set this up on the jvm?
14:21justin_smithclgv: looking for an overview of using this with ring
14:21justin_smithalgal: exactly!
14:21algalclgv: Me too.
14:21rkneufeldbitemyapp: I think it just came up (or Maggie wanted to talk abou tit)
14:22clgvjustin_smith: oh ok. I am using it with RMI. probably you can try to sneak your own SSlContext into jetty
14:22justin_smithI would prefer something general, and if anything backend-specific http-kit
14:22clgvjustin_smith: the important java bits are (javax.net.ssl SSLContext KeyManagerFactory TrustManagerFactory) and java.security.KeyStore
14:23justin_smithclgv: cool
14:23bitemyapprkneufeld: is there some connection to software I'm missing here?
14:24justin_smithclgv: algal is there a good blog post or article or book that covers this? maybe I'll put together a blog post after I figure it out if the resource does not exist yet
14:24clgvjustin_smith: gotta go. but I think you can find the relevant documentation with these classnames. otherwise ask again tomorrow ^^
14:24rkneufeldbitemyapp: Maggie's a PM here at cognitect and is very interested in psychology and philosophy
14:24tbaldridgebitemyapp: the Cognicast is a podcast about Cognitect. Not always about software/programming.
14:24justin_smithclgv: thanks again
14:25algaljustin_smith: I've assumed this would be relatively straightforward but a little googing now shows that it is not.
14:25algaljustin_smith: There is nothing obvious showing how to use SSL client certs to authenticate clients from a server-side clojure code.
14:26bitemyapprkneufeld: I'm interested in psychology and philosophy too, that's why the Lacan is o_O
14:26algaljustin_smith: I would think it definitely deserves a blog post or a SO snippet or (even better) a piece of ring middleware or plugin for cemerick.friend .
14:26edwHas anything changed in lein since 2.1.x that would make log4j's behavior change i.e. be quieter?
14:26justin_smithalgal: hmm - maybe I can turn whatever I figure out into a ring middleware if it is not just a plug and play thing already
14:26justin_smithalgal: jynx!
14:27algaljustin_smith: Yeah, one of us should do it. I expect I'll be tacking this sometime this month, but not sure.
14:27algaljustin_smith: Seems like the main complexity is just finding the right bits of Java API to wrap.
14:27edwWe spent an hour trying to figure out why our servers weren't starting and we found that it was because 1) they did start! but 2) the machine had lein 2.3.3 and it didn't print a message.
14:27justin_smithwell I'll keep in touch via this channel as I make progress, if nothing else
14:28justin_smithedw: do not use lein on a server
14:28algaljustin_smith: Ring already has a param in the request map for passing the client's X509 cert to your handler. So what's needed is something that can easily wrap the checking of a cert.
14:28justin_smithedw: send up an uberjar and run that
14:28bitemyappedw: do not use lein on a server you care about
14:28bitemyapplein is a build tool, not a server runtime.
14:29edwYou hear that, guys from Heroku?
14:29justin_smithalgal: cool, maybe it is super simple and I just need a blog post so others can see immediately how easy it is
14:29bitemyappedw: if by, "guys from Heroku", you mean the guy that wrote Leiningen, I'm sure he does.
14:29edwjustin_smith, bitemyapp: We're running a server locally on someone's desktop.
14:29edwHeroku uses lein to run apps.
14:29bitemyappedw: okay? so add logging to your application.
14:29bitemyapp"Hey, I started up!"
14:30bitemyapp(t/info ...)
14:30algaljustin_smith: I know cemerick's friend library is not universally beloved, but ssl client auth would fit in nicely alongside other authentication modes right on this page: http://friend-demo.herokuapp.com
14:30bitemyappedw: thanks, I know that. But that's just one build-pack.
14:30edwbitemy app: I did not just fall off the apple cart. I'm just wondering if some logging-relevant change was made, because output was previouly logged.
14:31technomancyedw: the docs have been updated to recommend uberjars over lein run actually
14:31bitemyapp^^ lol.
14:31technomancythe default is still lein run because we cant' break backwards compat
14:31justin_smithalgal: alongside my plans for client-side ssl is friend integration of the app, so I will likely pull these threads together, thanks
14:31edwbitemyapp: Care to stop being an asshole?
14:31bitemyappedw: I'm working with what I'm presented. If a dude shows up and says he feels faint and has a sucking chest wound, I'm going to touch on that first.
14:31loliveirahi, how do I make .getBytes accessible inside comp? ((comp count .getBytes) "test")
14:31bitemyappedw: no.
14:32bitemyappedw: this is a previously established universal constant. Such as, "Clojure is awesome" and "bitemyapp brooks no fools"
14:32edwtechnomancy: When was this change in recommendations made?
14:32technomancyedw: some time over the summer I think
14:33edwAh, our last new app was first deployed in April or so.
14:34technomancyit's unfortunate that the original recommendation lasted as long as it did
14:34edwOur new-to-Clojure folks generally read through the Heroku docs; I figured they would've noticed.
14:34technomancyI mean you can do it, there are just way more subtle ways to get it wrong
14:34bitemyapp~catfacts is Hi, you've been subscribed to cat facts! Your first fact is: Both humans and cats have identical regions in the brain responsible for emotion.
14:34clojurebot'Sea, mhuise.
14:35edwActually, that's awesome; that solves our long-term problem building using private repos.
14:35bitemyapp~catfacts is A cat's brain is more similar to a man's brain than that of a dog.
14:35clojurebotIn Ordnung
14:35bitemyapp~catfacts is Cats dislike citrus scent.
14:35clojurebotYou don't have to tell me twice.
14:35bitemyappstashin' those for later...
14:35algaljustin_smith: groups thread where Ring's author confirms that you need to interact with Java trust store stuff in order to use ssl client certs: http://grokbase.com/t/gg/ring-clojure/12acrky25j/ssl-client-cert-always-nil
14:35justin_smithalgal: awesome, thanks
14:35bitemyapp~catfacts is Cats will avoid drinking water near their food and that is why you often see them trying to drink out of a bathroom sink!
14:35clojurebotRoger.
14:37jcromartiebitemyapp: are you being ironic?
14:38bitemyappjcromartie: I'm mostly convinced nihilism makes people more effective and productive.
14:39mdrogalisFirst few minutes of Maggie's Cognicast. Pretty awesome stuff.
14:39edwtechnomancy: So, to be precise, one is still using lein, but we should specifiy an :uberjar-name key in project.clj?
14:39edwtechnomancy: And change our Procfile?
14:40technomancyedw: right; that will let you skip lein at runtime, resulting in faster app boot and smaller slugs
14:40technomancylein will still be available in interactive sessions, but it'll be downloaded on-demand
14:40bitemyappI should make up unfalsifiable hypotheses about human nature and propagate it among the pseudo-educated.
14:40edwtechnomancy: OK, cool.
14:41bitemyappmaybe I could convince some yuppies to give me money or something. That's what Kickstarter is for right?
14:42edwtechnomancy: That should be a pretty easy migration. Even for a pseudo-educated yuppie.
14:42algalbitemyapp: aren't yuppies an 80s phenomenon? Like hippies from the 60s? We're all yuppies/hippies/bobos/hipsters now.
14:42TimMcbobos, that's a new one for me
14:42bitemyappalgal: I didn't say I wasn't a self-loathing yuppie.
14:43technomancyedw: yeah maybe we should have a section in the docs for switching rather than just documenting it for new apps
14:43bitemyappalgal: I try to hold onto some semblance of my blue collar credentials though. Not having a degree helps.
14:43bitemyappthe banana republic compromises my purity though.
14:43algalTimMc: Bobos = bohemian bourgeois. good book, actually: http://www.amazon.com/Bobos-In-Paradise-Upper-Class/dp/0684853787
14:43algalbitemyapp: I don't say you weren't a self-loathing yuppie! In fact, I sort of assume it. :)
14:44edwtechnomancy: I usually stare at the deploys (the compiles sometime time out); have you considered printing a deprecation notice during deploy?
14:44bitemyappalgal: uhm, sorta. I come from poor peeps and couldn't afford to go to school.
14:44bitemyappalgal: I'm still in the "burn the urban middle upper class for the warmth and light" camp.
14:45technomancyedw: wellll... for folks that already have it working with lein run I'm inclined to say don't fix what ain't broke
14:45dsevillaGuys, I suppose some of you use CounterClockwise Eclipse plugin. I've noticed it does not auto-complete existing classes to be added to the import directive.
14:45dsevillaDo you know if this is the expected behavior?
14:46edwtechnomancy: Well based on feedback here...
14:46bitemyappyeah, roll your eyes. See if that helps you waste less time.
14:47edwtechnomancy: But seriously, if it puts less of a load on your infrastructure, I'd do it just to be a good citizen.
14:47logic_prog_why is intellij so popular
14:47bitemyapplogic_prog_: most people/programmers are muggles.
14:47technomancyedw: a lighter-weight slug is just as good for users as for us
14:48logic_prog_stallman = dumbledore?
14:48bitemyappouf.
14:48edwtechnomancy: I always forget what the maximum slug size is, and as I see ours creep higher, I get nervous.
14:48algallogic_prog: This is a fun game. Slytherin house == ?
14:49logic_prog_hmm
14:49logic_prog_so it needs to be evil, but also efficient
14:49logic_prog_C++
14:49technomancyedw: we've boosted it to 300 since we started recommending including the jdk in the slug
14:50algalbitemyapp: FWIW, my parents still refer to pre-bagged salad at the supermarket as "yuppie greens". I think they might not realize they are the only people on the planet who use this term.
14:50bitemyappalgal: me gusta.
14:51edwtechnomancy: Thanks for the info. I'll do a test deploy and see how it goes.
14:55algaljustin_smith: I'm out for now. But let's stay in touch on this SSL client cert stuff, since it would be nice to put a bow on it for others.
15:00edwIt just occured to me: we're over ten years into Eternal September.
15:00ToxicFrogEternal September?
15:00edwI mean twenty years. Whoa!
15:01edwToxicFrog: It's an old USENET thing.
15:01danielszmulewiczHappy mood tonight.
15:01CaptainLexedw: I was gonna say, ten years is a bit of an understatement!
15:01danielszmulewiczOn the channel.
15:01danielszmulewiczNice.
15:10danielszmulewiczI have a VPS with 1GB of RAM. I'm running a smallish ring app on it, as of now it runs as a standalone jar. When I run `top, I see the JVM process consumes around 12% of the memory. How many jars would I be able to run without straining the server? And how advisable is it to install Tomcat, and deploy my ring apps as wars?
15:11jcromartieJVM does use a lot of memory, relatively speaking. But a lot of that may be GC'ed.
15:12tbaldridgedanielszmulewicz: always remember, the GC doesn't always hand back RAM to the OS. So you may be using much less ram. Don't use top to profile JVM memory usage.
15:14danielszmulewicztbaldridge and jcromartie: Thanks. That's nice to know. But roughly speaking, how many JVM instances can I reasonably run on a small VPS?
15:14tbaldridgedanielszmulewicz: it depends highly on what your app is doing.
15:14technomancyyou mean how many hello worlds?
15:14danielszmulewicztechnomancy: yes
15:14SegFaultAXProbably a lot.
15:14technomancy"hellos world"
15:14danielszmulewicztbaldridge: Understood.
15:15SegFaultAXdanielszmulewicz: Why do you care about such a useless benchmark?
15:15jcromartieSegFaultAX: no need to get snappy
15:15technomancyI don't know what the answer is, but I can't imagine it being remotely relevant
15:15SegFaultAXjcromartie: I'm not, it's an honest question.
15:15jcromartieok
15:16danielszmulewiczI think so. A bit constrained, admittebly.
15:17SegFaultAXdanielszmulewicz: If you really care to find out, why not just try it?
15:18danielszmulewiczBut I would like to confirm my (lack of) understanding. If I run Tomcat with wars, then I'm running only one JVM instance, right?
15:18SegFaultAXdanielszmulewicz: Correct.
15:18SegFaultAXUnless you're running multiple tomcats, too. Which is possible.
15:21danielszmulewiczOK. And what is the "best practice" here regarding ring apps deployment. As standalone jars or as wars in an application server? Any strong opinions on the topic, or not really important?
15:24danielglauserI don't think there is a "best practice" here because there are way too many variables.
15:24SegFaultAXdanielszmulewicz: I mean that really depends.
15:24hiredmanit really depends, if you are integrating with existing web infrastructure, or you want to use those tools, then a war makes sense, if you are writing a server that does many other things and an http interface is one part then it doesn't make as much sense
15:25danielszmulewiczI mean, jar deployment is easy and immediate. Tomcat introduces another layer. Does it pay off immediately?
15:25SegFaultAXWell WAR files can be deployed to a hell of a lot of stuff.
15:25hiredmandanielszmulewicz: do you want to use tomcat for some reason?
15:25SegFaultAXTomcat, jboss, elastic beanstalk, heroku, etc. etc.
15:25danielszmulewiczhiredman: to save the cost of multiple JVM instances.
15:26SegFaultAXdanielszmulewicz: Have you done any actual profiling of your application or are you just guessing?
15:26SegFaultAXdanielszmulewicz: If you're just getting started, go with embedded jetty. It's easy to deploy and maintain.
15:26danielszmulewiczSegFaultAX: Just guessing.
15:26amalloydanielszmulewicz: you can easily run a clojure webserver in less than the 100MB you're seeing, you just have to ask the jvm to try
15:26SegFaultAXIf there is a time where you have multiple apps that you'd like to deploy together, consider using an application container like tomcat or jboss.
15:26SegFaultAXBut don't do it in the absence of data.
15:27hiredmandanielszmulewicz: I would start with jetty then
15:27danielszmulewiczSegFaultAX: That's what I'm doing now. Embedded jetty in a jar. But soon I have to add another app (another embedded jetty with a war). Maybe I should already think about installing Tomcat.
15:27danielszmulewiczjar
15:27hiredmandanielszmulewicz: you can build war files and have jetty serve up multiple wars with almost no configuration (everything passed as command line arguments)
15:27SegFaultAXdanielszmulewicz: Nah, just keep them embedded until the overhead is enough to warrant it.
15:28SegFaultAXThat's true, you could totally use jetty as a multi-tenant application container itself if you wanted to.
15:28danielglauserhiredman: +1
15:29danielszmulewiczOh, that's intriguing.
15:29SegFaultAXdanielszmulewicz: For the record, you might also check out immutant.
15:29SegFaultAXJBoss AS 7 for Clojure.
15:29SegFaultAX(If full stack deployment is what you're after)
15:29danielszmulewiczImmutant is huge, and I don't need it those behemoths. I want to keep it simple.
15:30SegFaultAXWhat immutant gives you is the ability to leverage what JBoss AS already provides. But you don't have to use the parts you don't need.
15:30SegFaultAXI don't use JBoss, but if you're considering application containers, it's an option.
15:31danielszmulewiczI'm looking for ease when deploying. I spend most of my time developing, not provisioning. I actually want to minimize my time doing devops stuff.
15:31danielszmulewiczI have ring apps that talk to datomic. And I want to run multiple apps on a 1GB VPS. That's my story.
15:31dsevillaGuys, just a question. I've seen already that Counterclockwise does not complete java method or classes in imports
15:32dsevillathe question is what configuration is the best for working with legacy Java libraries with Clojure?
15:32dsevillathat facilitates, for example, automatically importing a class you use in the current namespace
15:34danielszmulewiczI thought Tomcat made sense. Not a full blown application server. Small and lean. Good for multi-tenancy.
15:34gf3dnolen: So glad to hear that secretary worked out for you :)
15:34dnolengf3: yes simple and nice
15:35danielszmulewiczgf3: I'm next in line. I need a client-side routing solution.
15:35gf3danielszmulewicz: Well hopefully you'll find it useful, it's pretty simple
15:36gf3I'd like to add the notion of HTTP verbs to it, I think it'd be useful to handle more than simple history changes
15:36danielszmulewiczI glanced at the github page today. I was wondering if there was more sample code somewhere.
15:38noncomis there any ready-to-use solution for remote computer control with clojure? i mean that a thin client with nrepl and pomegranate could be getting expressions to evaluate from a server and giving the feedback.. or something like that?
15:38gf3danielszmulewicz: Sure, sec'
15:39danielszmulewiczgf3: thanks.
15:39gf3danielszmulewicz: https://gist.github.com/noprompt/6775563
15:40danielszmulewicznoncom: start-nrepl-server in your app.
15:40gf3danielszmulewicz: And this is old old old gross code from maybe 3 years ago, but you get the idea: https://gist.github.com/gf3/5df04fc4ed3a8bc4f84a
15:40danielszmulewiczgf3: oh, thank you, I'll be looking and learning.
15:43danielszmulewiczgf3: I suppose it would be gross to even want to do that in a single-page app, but suppose my single-page is not completely single-page, and I would like to run clojurescript code conditionally, depending on the server page, would secretary still be useful in that case?
15:44gf3danielszmulewicz: Sure—it's useful as long as you'd like to respond to routes/URLs on the client side
15:45gf3danielszmulewicz: And it's not particularly expensive or large
15:45danielszmulewiczso routes can be mapped to URLS. That's what I want.
15:45gf3danielszmulewicz: Yes exactly
15:45danielszmulewiczVery cool.
15:45gf3danielszmulewicz: They alternative on the client-side is setting up event listeners for all the DOM elements you care about
15:46gf3danielszmulewicz: But that kind of close-coupling can get messy and is hard to maintain on a large scale
15:46danielszmulewiczYes, I was struggling with that.
15:48danielszmulewiczgf3: the example on the readme shows the dispatch function. That would be manual.
15:48danielszmulewiczgf3: How do I map the routes to URLS?
15:49gf3danielszmulewicz: The easiest and probably most common way is to use goog.History, like in the examples
15:49danielszmulewiczgf3: OK, understood.
15:49gf3danielszmulewicz: This is probably the most succinct example: https://gist.github.com/noprompt/6775563
15:52danielszmulewiczgf3: That's exactly what I need. Thanks a bunch.
15:52gf3danielszmulewicz: NP
15:52gf3danielszmulewicz: The other example, although messy and out of date, shows a bit more functionality like checking click events and seeing if routes match
15:52danielszmulewiczgf3: Not that it matters, but this is where I'm going to use it: http://videos.tuppu.net/user/17592186045424
15:53danielszmulewiczgf3: If you like world music, consider yourself served.
15:53gf3danielszmulewicz: oh cool, send me a link when you're done, I'd love to see
15:54danielszmulewiczgf3: Cool.
15:54edwtechnomancy: Good news: Slug shrank by 23MB for my guinea pig app.
16:05devinusdoes anybody know what happened to (def newsletter) ?
16:07`cbpfml homebrew effed everything. Never again
16:09seuberthow..
16:09seuberthomebrew doesn't mess with your other stuff
16:11`cbpIdk, some dylibs cant be found now, xcode crashes
16:26SegFaultAX`cbp: That happened to me yesterday.
16:26SegFaultAXAlthough in my case it wasn't necessarily homebrew's fault.
16:27SegFaultAXIt upgraded zsh for me from 4.x to 5.x and 5.x is /completely/ broken.
16:28SegFaultAXOr it borked the install somehow and broke it, I'm not sure which.
16:30danielszmulewiczgf3: The token returned by the History is always the empty string. I must be doing something wrong.
16:30danielszmulewiczgoog.history.Event {type: "navigate", target: goog.History, currentTarget: goog.History, token: "", isNavigation: falseÉ}
16:31coventryWhat's the right way to write this jdbc sql vector? I'm trying to get "interval '10 day'" and "account_id = 9". ["select * from emails where (created_at >= (now() - interval '? day')) and (account_id = ?)" 10 9]
16:32coventryThat gives me the error "PSQLException The column index is out of range: 2, number of columns: 1"
16:32dnolendanielszmulewicz: http://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/app.cljs#L20
16:37bitemyapparrdem: DayZ came out.
16:39bitemyappnoprompt is a hero, fighting the good fight.
16:40noprompthaha. zero is a value!
16:40danielszmulewiczdnolen: Thank you indeed.
16:40gf3noprompt: wb
16:40gf3danielszmulewicz: That shouldn't be
16:42nopromptgf3: wassup?
16:43gf3noprompt: Nadda
16:43gf3noprompt: I'm thinking I might add a goog.History example to the secretary readme
16:44nopromptgf3: i think i may still have a gist.
16:44gf3noprompt: ja i just used it an hour ago
16:44nopromptgf3: https://gist.github.com/noprompt/6775563
16:44nopromptoh, kk
16:44bitemyappgf3: !!!
16:45bitemyappgf3: w/b!
16:45gf3THX U
16:45bitemyapp`cbp: how have you been?
16:45bitemyappgf3: and you? ^^
16:45gf3bitemyapp: I moved back to EST
16:45gf3Last week
16:45gf3With my cat
16:45gf3That was "fun"
16:45bitemyappgf3: hawdamn. Mtl?
16:45gf3bitemyapp: Torononto
16:46bitemyappgf3: cool, been there 3 or 5 times. I miss the jerk chicken.
16:46gf3the jerk chickens miss you, chris
16:46bitemyappgf3: I can only hope. What inspired the geographical shift?
16:46bitemyappgf3: also people were loving on secretary earlier.
16:47gf3bitemyapp: Just family and junk
16:47gf3bitemyapp: Still working for MetaLab for the moment though
16:47gf3remote lyf
16:48bitemyappgf3: I'm trying to go remote myself. Considering Seattle and Austin so I can escape the land of VC and $1.5mm houses.
16:49hiredmansyn/ack
16:49gf3bitemyapp: Those are both nice places
16:49gf3hiredman: You can't ack your own syn
16:50gf3hiredman: That's like ponging your own ping
16:50hiredmangf3: sure, I am just saying, that is the remote handshake
16:50gf3it's gotta be two ways
16:50gf3worst multiplayer
16:52rovaranyone here tackled webgl + cljs?
16:52rovarI'm looking for strategies for managing shaders / shader/files.
16:54rovarjust me?
16:54rovar:(
16:56akhudekhmm, ndarray-double in core.matrix seems to not work for even 100k element vectors
16:56akhudekby not work, I mean trying to fill it with random values never finishes
16:57akhudekat least not in any reasonable time
16:57hiredmanakhudek: what jvm heap size?
16:57akhudek10gb
16:57hiredmanheh
16:58hiredmanhow long have you waited for a gc to complete on a 10gb heap?
16:58akhudeksorry, it's only 6gb right now
16:58akhudekgc isn't usually too bad
17:03bitemyapprovar: I'm too faithless to attempt that. Good luck and awesome of you to explore that though :)
17:04rovarbitemyapp: there is this: https://github.com/Asakeron/cljs-webgl which seems clean and frequently updated
17:05rovarmy problem is that I need to include script tags full of OpenCL code
17:05rovarand anything I do just seems yucky. There is a way to load the files from the server, but not as src= attributes.
17:06rovarbecause they're not really scripts...
17:06rovarso I'm thinking about writing a cljs util to fetch these files from the server..
17:06rovarbut then I think I'm too far off into yak shaving field
17:16vijaykirandnolen: the example on https://github.com/swannodette/om seems to be broken - dom/component => om/component and extra )
17:20zerokarmaleftdnolen: oh man, om+core.async is slick
17:21dnolenvijaykiran: fixing
17:21dnolenzerokarmaleft: there are some things to figure there but yes I think it will be cool
17:24`cbpbitemyapp: hey
17:25`cbpbitemyapp: just 1 more week and ill be free as a bird. I spent last weeks installing python stuff on aix, solaris, debian and os x and finally succeeded. I feel like a god
17:27justin_smithrovar: the other day you were complaining about buffer switching in emacs - since I learned to use iswitchb I have wished I could use iswitchb in my browser instead of tabs
17:27justin_smithrovar: provides incremental interactive completion of buffer name substrings
17:27rovarjustin_smith: I will check it out
17:27bitemyapp`cbp: jfc. You are a hero.
17:29`cbpI know right, i shouldve just picked effing java
17:29bitemyapp`cbp: 4rlz.
17:29bitemyapp`cbp: https://www.refheap.com/22002
17:30`cbp:-)
17:31bitemyapp`cbp: just wanted a test that was supposed to produce error output to stfu.
17:32rovarjustin_smith: hmm.. it doesn't appear to update its index..
17:33justin_smithrovar: update its index?
17:33rovarfor autocompletion..
17:33rovari'm assuming it's using a trie or a suffix tree or somesuch
17:33rovarbut it just says "dummy" but if I type the entire filename it still switches buffers.
17:34justin_smithyou type a substring or subset of characters
17:34rovarsure.. the only option is [dummy] regardless of what I type :)
17:34rovarI also just reloaded init.el
17:34rovarI might need to bring er down
17:34justin_smithhmm - how are you running it?
17:35justin_smithM-x iswitchb-buffer seems to be the command for direct access
17:35justin_smithI just have C-x b bound to that
17:35rovar(iswitchb-mode 1)
17:35justin_smithand then what happens when you do C-x b
17:36rovarC-x b brings up iswitch
17:36justin_smithand that is not completing properly?
17:36bitemyapp`cbp: been doing Haskell with a couple of coworkers and noprompt.
17:36rovarit looks like it wants to be doing the right thing..
17:37rovarwhen I do C-x b, it brings up iswitch
17:37arrdemtools.nrepl +1 now we just need a way to dump nrepl defined symbols to a file :P
17:37justin_smithrovar: try M-x ido-swtich-buffer
17:37`cbpbitemyapp: apparently homebrew fked up everything and now i can't start ghci because of some missing dylibs which are not actually missing :P
17:37rovarand the line at the bottom reads: iswitch [dummy] [no match]
17:38justin_smithweird
17:38rovarwhich before it would at least give me a useful list..
17:38justin_smithyeah, try it in a fresh emacs instance
17:38justin_smithcould be your elisp got in a weird state
17:38bitemyapp`cbp: don't use homebrew!
17:38rovarthat is a fresh instance
17:38bitemyapp`cbp: just install Haskell platform for OS X.
17:38bitemyapparrdem: DayZ.
17:39bitemyapp`cbp: then upgrade to Cabal 1.18 so you have sandboxes.
17:39rovarso ido-switch-buffer seems to offer a reasonable behavior
17:39arrdembitemyapp: lolwhyarma
17:39rovarbut I think that's what I already had..
17:39`cbpbitemyapp: yeah i installed that and after that i installed homebrew and im all regrets now
17:39bitemyapparrdem: the standalone game came out.
17:39arrdemook
17:39bitemyappalpher.
17:39bitemyapparrdem: you don't like? :(
17:39arrdemI think you mean the first build that guy was able to kick out, not alpher
17:39bitemyapparrdem: worked fine for me last night. I'm about halfway to NW airfield.
17:40bitemyapparrdem: it's a great game to play with other people.
17:40arrdembitemyapp: I may check it out. arma/dayz isn't something I ever got into
17:40bitemyapp`cbp: uninstall and unlink the haskell stuff from homebrew and just use platform :(
17:40arrdemin the meantime, m0ar dotaz
17:40bitemyapparrdem: uh, I didn't like vanilla ArmA nearly as much. DayZ is a lot more fun and 10x as much with friends.
17:40bitemyapparrdem: what if I bought you the alpher for Christmas?
17:41kandinskiyay, OT time
17:41arrdembitemyapp: then you would compell me to actually do something for people for christmas, and I may actually play the alpher
17:42bitemyapparrdem: buying it tonight when I get home.
17:43bitemyapparrdem: send to the steam account I have on my friends list right?
17:43arrdembitemyapp: ofc
17:44bitemyappkk
17:44arrdemfine I'll do some haskell after this game, thaks for making me feel unproductive :P
17:44justin_smithrovar: looking at my own config, it looks like I have both iswitchb and ido turned on, it may be ido is needed
17:45rovarjustin_smith: I have (ido-mode t)
17:46rovarjustin_smith: you know, with iswitch commented out, and just ido-mode t, I think I get the behavior that iswitch advertises
17:46rovarI can type any part of the name of the file to which I want to switch and it selects it
17:46justin_smithrovar: cool, ido may be a superset actually
17:47rovarwhen their enabled at the same time they appear to dislike one another.
17:47justin_smithahh ok
17:48rovarwow.. even the arrow keys work as described in
17:48rovarhttp://www.emacswiki.org/emacs/IswitchBuffers
17:48bitemyappiswitchb is the stuff. <3
17:48justin_smithyeah, once you get used to it, you will wish every program let you pick documents that way
17:49justin_smithwe totally need iswitchb for chrome,firefox
17:49technomancyconkeror has it
17:49justin_smithseriously? awesome!
17:49rovarso I'm torn. For small lists of files, I think my (and vim's) buffer numbering scheme is faster. But I could see how the iswitch method would scale better
17:49technomancyunity kinda has it too, but it's difficult to recommend for other reasons
17:49rovari use ctrl-# for chrome and ff too.
17:49technomancyconkeror is the best
17:50rovarvery fast for tabs < 10 :)
17:50technomancyO(1)
17:50rovarnot useful at all for > 9 :)
17:50rovarexactly
17:50technomancythen jumps up to O(n)
17:51rovarit jumps up to grab mouse, which is still technically constant time, but that's where BigO breaks down :)
17:51bitemyappspatially reasoning about how to jump to context is flawed
17:51justin_smithmy hand-eye-coordination for small tabs is not constant time at all
17:51bitemyappit's more declarative and scalable to just say which context you want descriptively.
17:51technomancymouse doesn't help once the tabs get too small to show titles
17:51rovarit's non-deterministic
17:51bitemyapp"gmai" -> gmail tab
17:52rovarvaries with tab size, alcohol consumption and time of day
17:52technomancyfitt's law?
17:53r4vihas anyone made something like frozen-flask for ring/compojure? http://pythonhosted.org/Frozen-Flask/
17:53rovarsimilar in many ways to this channel's effect on my productivity
17:53rovarsometimes very positive, sometimes very negative :)
17:54rovarr4vi: ring-bake
17:54r4vithanks rovar
17:54rovarimo they could have come up with a better name..
17:54rovarit looks a bit more like a POC.. it could probably use some updating..
17:55r4vilooks good enough for what i need
18:05seangrovetechnomancy: Is there nrepl.el/cider support for drawbridge?
18:05technomancyno =(
18:06technomancyworks with inf-lisp tho
18:06technomancyvia lein repl :connect
18:07seangroveHeh, no worries, just curious :)
18:08seangroveHaven't used inf-lisp much, I'll look into it
18:09technomancyit's pretty simple
18:09technomancyno completion tho
18:13AeroNotixWhat are people's favourite feature of cider?
18:13andyfBronsa: ping
18:14technomancyAeroNotix: jump-to-definition
18:14technomancywhich wouldn't worx remotely anyway
18:14AeroNotix:)
18:19seangrovetechnomancy: Wouldn't it work remotely with cl/slime?
18:19seangroveIt's been a few years since I've done remote slime debugging
18:19bitemyappyou know it's a serious problem when you gotta get ya SWANK on.
18:19technomancyseangrove: it works with tramp if you can open an SSH connection
18:20technomancybut slime doesn't work over HTTP
18:20`cbpfml im so dumb time to format
18:21bitemyapp`cbp: ?
18:21`cbpi was cleaning up the homebrew stuff and rm some files in /usr/lib instead of the directory i wanted..
18:21seangrovetechnomancy: Yeah
18:22technomancyI think cider can do the tramp/ssh stuff too fwiw
18:22technomancylolbrew
18:24`cbpheh now emacs is about the only program that works
18:24arrdemgotta love that build in platform :D
18:25rovarI still haven't gotten around to exploring tramp
18:25seangrove`cbp: Luckily, that's just about a full dev environment
18:26seangroveAnd mail client, news readers, etc....
18:26rovarconj things-to-do
18:26bitemyapptramp is great.
18:26seangroveJust switch to el-node and really you don't need anything else
18:26rovarI used to joke about doing a shootout to see which operating system was better OSX, Linux and Emacs
18:27arrdemI wonder if someone's done a "boot to emacs" os as a joke...
18:27rovarwith all of this boot-into-process stuff that's been going on, it's not far off
18:27rovarI bet I could get xen booting into emacs in a week
18:27rovarbooting onto bare metal with uefi would take considerably longer..
18:27seangroverovar: It's hit-or-miss with me. Nice to have sometimes, certainly.
18:27technomancyyou can do it with user-mode linux iirc
18:28technomancyor you could a few versions ago when static co
18:28bitemyappgf3: http://www.youtube.com/watch?v=JqYhuwu614Y
18:28bitemyappRaynes: ^^
18:28technomancystatic linking still worked
18:28rovaror there is also this: www.osv.io
18:28rovaruser mode linux vs kernel mode process :)
18:29bitemyappkernel mode erlang IMO
18:29technomancytramp is a bit flaky due to not being async in a single-threaded runtime
18:30justin_smithcljmacs would totally rock, if only it were a sane prospect
18:30technomancyutf-16 all the things!!!
18:31arrdembitemyapp: QUAD GOLEMS IS BEST GOLEMS
18:31bitemyappjustin_smith: the Haskellers have multiple editors in their own language.
18:31arrdemjustin_smith: what makes it insane? I just don't expect to see it in several years
18:31bitemyapphaving fast starting binaries goes a long way.
18:32technomancysays the guy who doesn't use autoloads...
18:32justin_smitharrdem: remaking emacs is like a land war in asia - often attempted, rarely ends with success
18:32rovarI would first like to see a full llvm implementation of clojure
18:32technomancyjustin_smith: only once, to my knowledge =)
18:32rovarthen I'd go for the editor
18:33rovari'll take both in parallel, if someone wishes
18:34arrdemI mean we already have lighttable... do we really need a "pure" emacs in clojure?
18:34arrdemI think LT totally counts
18:34seangrovejustin_smith: rarely?
18:34seangroveI suppose xemacs was successful-ish
18:35hiredmanrovar: how familiar are you with llvm?
18:35technomancyarrdem: half the point of emacs is the license
18:36arrdemtechnomancy: in being GPL/2'd?
18:36justin_smithseangrove: yeah, rarely was an understatement. And remember that gnu emacs was a remake of teco-emacs
18:36hiredmanrovar: because generally that kind of talk gets people lumped in to the "don't know anything about llvm" catagory
18:36bitemyappI love it when the only github issue that gets filed with a non-trivial project of mine is that a parameter when unused in a function.
18:36bitemyappreally makes me get the warm fuzzies for open source.
18:36bitemyappwent*
18:37amalloyhiredman: what kind of talk? implementing clojure in llvm?
18:37hiredmanamalloy: yes
18:37seangroveHrm, I had missed this http://www.chris-granger.com/2013/12/11/light-table-is-growing/
18:37S11001001arrdem: that it is free at all
18:37arrdemS11001001: right. forgot about that.
18:37amalloyi've known several people who were excited to write clojure on llvm, and none of them knew anything about llvm. story checks out
18:37hiredman:)
18:37seangrovearrdem: I suppose it'd still be nice to have some better concurrency constructurs underlying LT, but it could still pull something off, possibly
18:37amalloyi don't know anything about llvm myself, and it sounds pretty great
18:37arrdemhiredman: where'd the link go?
18:38hiredmanllvm isn't a vm or a runtime
18:38hiredmanamalloy: sure, it is neat for what it is, but it isn't what half the people talking about it want it to be
18:38bitemyappClojure-LLVM doesn't make a ton of sense.
18:39arrdembitemyapp: I would disagree if only for adding a fast-start capability to clojure code
18:39bitemyappyou'd have to make a ton of decisions about the host replacement for Java/JS/.NET. I'm pretty sure GC is still an unsolved problem too.
18:39tbaldrid_normally what people want when they say clojure on llvm is just a faster booting clojure with easy ffi. Getting that is harder than it sounds.
18:39hiredmantbaldrid_: indeed
18:39bitemyapptbaldrid_: that's my point, it opens up a war on a bunch of fronts that have nothing to do with starting fast or FFI.
18:39arrdembitemyapp: but in that clojure-llvm would throw away all the JVM infrastructure that makes clojure awseome I agree
18:39hiredmantbaldrid_: they want a jvm without the j
18:39seangroveI don't think we can stay on heroku much longer, the deploy process is just too flakey
18:39bitemyapparrdem: right.
18:39tbaldrid_bitemyapp: not true, bohem gc and MPS are good systems.
18:39bitemyappseangrove: if you need dev-ops help, ping me.
18:39bitemyapptbaldrid_: Boehm isn't a proper GC. come on.
18:39amalloyso llvm is mostly a set of libraries for writing compilers?
18:39bitemyappyou can't be serious.
18:39technomancyseangrove: what happened?
18:39technomancy
18:39amalloyi always thought it was a vm
18:40arrdemamalloy: basically
18:40rovarhiredman: rather familiar
18:40bitemyappamalloy: uhhh. close enough. yes.
18:40bitemyappamalloy: there is no actual vm.
18:40arrdemamalloy: it's a lot more that that, but yes
18:40hiredmanamalloy: more or less
18:40tbaldrid_bitemyapp: sure it is, it collects garbage after all.
18:40technomancyamalloy: and zeromq is a message queue
18:40rovarit's basically a cross-platform asm.. maybe not that severe.. and it does have runtime bits.. though they may not apply.
18:40bitemyappamalloy: it's an IL for describing a low level machine language analogous to a portable assembler that will get compiled into a bunch of targets.
18:40bitemyapptbaldrid_: not reliably.
18:40hyPiRionthe LLVM project contains a bytecode interpreter
18:40bitemyappBoehm was an acceptable GC 20 years ago, not today.
18:40bitemyappwe have higher standards than that.
18:40rovarwill it take a tonne of work? yes. will it be worth it? yes.
18:40amalloytechnomancy: i get the joke, but it's lost on me, with no 0mq experience
18:40hiredmanit doesn't have a gc, or a higher level notion of a type system
18:41bitemyapprovar: er, you say that, but...
18:41tbaldridgebitemyapp: depends on your definition of reliably, I used Mono with Bohem for quite some time without issues.
18:41arrdembitemyapp: I'd write C in clojure if I could...
18:41technomancyamalloy: tl;dr: 0mq is not a message queue
18:41rovarErlang or Haskell's GC would apply very well to clojure.
18:41bitemyapptbaldridge: I wasn't aware anybody took Mono seriously in general either.
18:41tbaldridgebitemyapp: you should get out more ;-)
18:41bitemyappHaskell's GC would be the closest match.
18:41rovaryou can make a lot of assumptions about parallel GC when you don't have any shared state between threads.
18:41technomancythe GC is typically touted as the biggest weak point of mono
18:41technomancywhen
18:41hiredmantbaldridge: I imagine bitemyapp is confusing precise gc with reliable gc
18:41bitemyapp^^ yep.
18:41technomancywhen compared to the JVM/.net
18:42bitemyapphiredman: no, I just happen to know Mono's GC is terrible.
18:42bitemyappand has been for years.
18:42bitemyappand Boehm is terrible too, even compared to other conservative GCs.
18:42hiredmanhttp://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29#Precise_vs._conservative_and_internal_pointers
18:42rovarhttp://llvm.org/docs/GarbageCollection.html
18:42tbaldridgebut even then, MPS is also an option. Start with Bohem move to MPS later on.
18:43bitemyappgenericizing conservative collection is a recipe for leaks.
18:43tbaldridgerovar: yeah, LLVM's support for GCs is more or less a joke.
18:43tbaldridgebitemyapp: have you tried the precise mode in Bohem?
18:43rovartbaldridge: I've never tried to use it, but I have heard basically the same from people building functional languages
18:43hiredmanrovar: right, llvm doesn;t provide a gc, it sort of provides hooks to attach a gc to, which many people who have done runtimes using llvm complain about being a pain in the ass
18:43bitemyappif you wanted a fast-starting compiled Clojure it would probably be easier to target Haskell or GHC Core for your compiler output.
18:43rovarinteresting..
18:43bitemyappleveraging the core libraries and compiler tooling provided.
18:44bitemyappit's not that hard to just a slap a uni-type on everything.
18:44rovarso compile clojure into a spineless-tagless-g-machine
18:44rovarare they still using that?
18:44rovarthings change so quickly..
18:44hiredmansteal the backend of haskell's llvm based runtime
18:45rovarI guess my point is the concurrency model and the GC model in the JVM are a bad fit.. maybe targetting haskell is the right answer.. at least then we'd get a (quirky) stdlib.. :)
18:45bitemyapprovar: so far as I know, but they have LLVM output in addition to C and all that now.
18:45bitemyappthe stdlib isn't quirky.
18:45technomancyhow is the JVM's GC a bad fit?
18:45bitemyappanyway, the point of targeting Haskell wouldn't just be the LLVM generator, it'd be the host wrapper and concurrency tools too.
18:45rovarghc is actually quite modular. one could easily target one of their IM
18:46rovar(relatively)
18:46bitemyappand the GC. omg. Avoiding having to implement GC on LLVM yourself would be a fucking coup.
18:46hiredmanrovar: see, the thing is, when people starting talking llvm, they eventually start talking about why they want another runtime, and they say things that are complete nonsense like that
18:46bitemyapprovar: yeah you can dump GHC Core directly.
18:46rovarerr IR, not IM
18:46bitemyappthe GC and concurrency model in the JVM are fine, I'm just saying we can swap them out for Haskell's and possibly get something that starts faster if you batch compile.
18:47bitemyapphaving native green threads would kinda cool anyway.
18:47rovarI'm not sure how haskell does at runtime compilation..
18:47hiredman(by nonsense I mean "the concurrency model and the GC model in the JVM are a bad fit")
18:47rovargenerally something that's needed in lisps
18:47hiredmanwell ghc has a repl
18:47bitemyapprovar: there are ways to kick around runtime Haskell but you wouldn't approach it like that
18:48bitemyapprovar: you'd approach it like Clojure's resident compiler, not like the ghci REPL
18:48bitemyappwell, I guess you could appropriate that.
18:48hiredmanbut that can be a real problem, for example the go runtime makes no allowances for dynamic code loading
18:48bitemyappthat sounds like a bad idea to me though.
18:49rovarhiredman: I have followed a bit of the java GC design and my only point was when you don't have shared state between processes you can make some assumptions that lead to optimizations, e.g. you could possible have multiple parallel gc's per thread/green-thread ala Erlang
18:49bitemyappthere are pretty serious trade-offs involved with Erlang's approach
18:49hiredmanrovar: erlang's model has its own trade-offs
18:49bitemyappand the approach isn't as generally applicable as the JVM's.
18:50bitemyapprovar: erlang's model isn't close to being a pure-win.
18:50rovarI don't want to denigrate Java's GC. I'm pretty sure more work has gone into that GC than any other language.
18:50bitemyappwell, if PHP is any indication, work input doesn't lead to a linear improvement in quality of output.
18:50logic_progin cljs, how do I detect is a left button is pressed?
18:50logic_progsomeone needs to write a cljs cookbook of all these things
18:50bitemyappsometimes not even a monotonic improvement.
18:50rovarfair enough :)
18:51hiredmanthere is a blog post floating around where a guy who wrote a blog post about erlang's model being great says "jk, the jvm and azul are way better"
18:51arrdembitemyapp: there is some requirement for language sanity here come on
18:51bitemyappbut the JVM has a seriously tunable GC.
18:51bitemyapphiredman: he's right, lol.
18:52bitemyapparrdem: I still say Clohask is a good idea if you actually want fast-starting binaries for Clojure.
18:52bitemyappwithout retreading a bunch of unproductive territory.
18:52bitemyapplike creating a core host from scratch (gag gag gag)
18:52technomancywell it depends on your goals. erlang can do a ton of cool stuff clojure can't, but the GC is slower.
18:52logic_progwhat is Clohask ?
18:52bitemyapptechnomancy: everything is slower, but it is nice.
18:52bitemyapplogic_prog: Clojure->(Haskell/GHC Core)
18:53logic_progick
18:53arrdemlogic_prog: it's a clojure compiler targeting the haskell core
18:53logic_progI thought part of the allure of Clojure are the JVM libraries
18:53rovarlogic_prog: (d/listen! $input :keyup (fn [e] (when (= 37 (.-keyCode e))
18:53bitemyappI'm still pissed about Elixir using uncounted lists.
18:53rovarwhere d is dommy.core
18:53logic_progrovar: I have key board input working, but it's the stupid mouse stuff that I don't have working
18:53hiredmantechnomancy: lets be specific here, rovar is touting erlang's process model, not a general language x vs. language y
18:53logic_progrovar: in particular, I'm listening to :mousemove
18:53logic_progbut I want to know if a button is down (i.e. dragging) or if it's just moving
18:53rovaroh. left mouse button
18:54logic_progyeah, stackoverflow says (.-buttons evt) but that's null
18:54hyPiRionPeople generally just want faster startup times, with the same functionality. Generally the GC speed or the adaptive JIT optimizer isn't critical
18:54logic_progthen there's (.-button evt) but everyone says it's fucking outdated
18:54technomancyhiredman: but the same limitations that affect the GC are what allow it to do some of its crazy stuff
18:54bitemyappcljs is not the place to be if you want your code to stay the same month to month.
18:54clojurebotOk.
18:54bitemyappoh that was unintentional. I'm keeping it.
18:54hyPiRionlol @ clojurebot picking up that.
18:54logic_proga is b + c - d.
18:54bitemyapp~botsnack
18:54clojurebotThanks! Can I have chocolate next time
18:55bitemyappno, brat.
18:55hiredmantechnomancy: what crazy stuff?
18:55rovarlogic_prog: I'd just use the ugly cljs version of what's prescribed here: http://www.html5rocks.com/en/mobile/touchandmouse/
18:56bitemyapphttp://www.youtube.com/watch?v=PrZZfaDp02o
18:56technomancyhiredman: like hot reloads
18:57rovarlol@INXS
18:57logic_progerlang is better for (1) messaging model and (2) hot reloads
18:57logic_progclojure wins for pretty much everythign else
18:57bitemyappqueue is a good way to avoid caring about hot reloads.
18:57bitemyapp~cljs
18:57clojurebotcljs is not the place to be if you want your code to stay the same month to month.
18:57logic_progdude, someone should do a badass port of riak from erlang to clojure
18:57bitemyappyissss
18:57bitemyapplogic_prog: lolno.
18:57hiredmantechnomancy: you can do that with the jvm too, generally provided via something like an app server
18:57rovarconsistency in the face of hot reloads is something that even erlang can't fix :)
18:57arrdemdoes anyone here do hot reloads? srsly?
18:58rovarI wrote call accounting in erlang about a decade ago..
18:58bitemyapparrdem: I hotpatch my code via nrepl.
18:58hiredman(delivered as a library/framework even, not a core language feature)
18:58arrdembitemyapp: yeah but you're the loony fringe even here
18:58rovarI don't do hot reloads in prod.. not in the days of free VMs
18:58technomancyhiredman: in some limited contets, sure
18:58rovarclojure + marathon + mesos == joy
18:58technomancybut it doesn't offer the same safety guarantees
18:59arrdemtechnomancy: when you're reloading code at runtime it's a miracle that anything works
18:59rovaractually.. I've not used clojure in that mix, I'm speculating. But with other languages it has been quite nice.
18:59hiredmanrovar: ugh
18:59rovar?
18:59hiredmanrovar: I mean, about your "I've not used clojure in that mix"
18:59rovarI'm working towards it.
18:59hiredmanI am interested in mesos
19:00rovarGot a cascalog app I'm working on..
19:00hiredmantechnomancy: what safety guarantees
19:00bitemyapparrdem: I'm the mad wizard that will create the black hole that collapses the planet.
19:01bitemyapp"how was I supposed to know monkey-patching the particle accelerator's firmware would do that?"
19:01arrdembitemyapp: as long as I get to slap my name on the imploder somewhere I'm all for it
19:01bitemyappDeal.
19:01arrdem"*** TODO Fix FIXME annotated fns" thank you previous me, go suck eggs
19:02rovarI wonder what it would take to replicate something like Atom in clojure
19:02rovarmy guess is less effort.. template haskell is a bit of a bear
19:02bitemyapprovar: wut
19:02rovarI actually am faced with the spectre of broad deployment of embedded code onto tiny devices some time next year..
19:02bitemyapprovar: atom?
19:02rovarI'd prefer to also not have to write C if I can help it.
19:02rovarya
19:03arrdemrovar: c99 is the best I don't know what you're talking about
19:03bitemyapprovar: ...and which of the many possible things named atom are you referring to?
19:03bitemyapparrdem: I'd rather use C++ I wrote myself.
19:03rovararrdem: for your particle accelerator, absolutely.
19:03hyPiRionbitemyapp: clojure atoms, likely. like (atom {})
19:04arrdembitemyapp: as long as you're using the subset of c++11 that's a supserset of C99 sure
19:04rovarhttp://hackage.haskell.org/package/atom
19:04rovarhyPiRion: neg
19:04bitemyapphyPiRion: see, that you were wrong is why I was doubting.
19:04hyPiRionoh, I read it in reverse
19:04bitemyapphyPiRion: he said, "implement it in Clojure"
19:04bitemyapparrdem: you need to look at this: http://hackage.haskell.org/package/atom
19:04rovari will likely just end up using atom in haskell
19:04technomancyhiredman: stuff like leaving sockets open but having their connections served by new code
19:04rovarbut I'm kind of in to this "one language to rule them all" thing
19:05bitemyapprovar: better make that language Haskell >:)
19:05rovar:o
19:05bitemyappSHOTS FIRED
19:05technomancyone language for all is as silly for clojure as it is for java
19:05bitemyapp^^ agree, actually.
19:06arrdemrovar: ffs you're doing embedded. c99 + linux...
19:06rovar(╯°□°)╯︵ ┻━┻
19:07rovartechnomancy: I've always been a best tool for the job kind of a guy. But I'm currently in the honeymoon phase with Clojure
19:07arrdemrovar: if it's any consolation I wish I could write C in Clojure, but the rest of the dev team would kill me
19:07rovarso let us have some alone time
19:07technomancyrovar: as long as you see it for what it is, cool
19:08rovararrdem: back when I didn't know any better, I worked at a game studio that had a very basic scheme that compiled to C
19:08rovarit was quite pleasant, even though I knew next to nothing about functional programming.
19:08rovarit looked more like C with collections..
19:08rovar+ lambdas
19:09arrdemrovar: cool! the system I work on doesn't have enough memory for that sorta thing but I'm definitely interested in the embedded scheme stuff I see floating around
19:09rovararrdem: are you working heapless?
19:09arrdemrovar: oooh yeah. I'm working sub-os :/
19:09arrdemrovar: compile time static allocations. more please.
19:10rovarcool.. yea.. atom looks kind of nice for that
19:10arrdem(dec bitemyapp) ;; get off my lawn
19:10lazybot⇒ 13
19:10hiredmantechnomancy: that "feature" of erlang is part of the otp runtime library, and requires you to use gen_server, and implement the code_change function for gen_server, given those restrictions (and it not being just magic) doing it on the jvm wouldn't be a problem
19:10rovarI haven't done a ton of embedded, and am going to have to do some sensors next spring.. very small space..
19:11rovarhiredman: I agree, code swaps at the service/process level have been supported by erl/otp for a while.. all you really need is for a container to queue all IO
19:11rovarI think Redhate's OpenShift works on this model with (i think) java and other friends..
19:12technomancyhiredman: you'd need to be able to isolate everything mutable and have a lot of extra app-level logic around how to safely upgrade
19:12hiredmantechnomancy: that is no different from what you need in erlang
19:12rovarthere is nothing mutable at that layer in erlang
19:12rovarthat's how they do it.
19:13technomancyhiredman: but it's enforced for you
19:13rovarhttp://learnyousomeerlang.com/designing-a-concurrent-application#hot-code-loving
19:14rovartechnomancy: hiredman: I think we're all saying the same things here.
19:14rovarso it would be something like a servlet container, as long as no mutable references could leak into the container you're golden.
19:15arrdemhow do you instruct clojurebot to pattern match without the ~ prefix?
19:15hiredmanI'm saying erlang is hyper as having all these magic features, but really it is just another language on another runtime, with plenty of warts
19:15hiredmanhyped
19:16technomancyit chooses a different set of trade-offs
19:16technomancyreliability over performance
19:16hiredmansure, it makes a few different trade offs, and also has a huge set of warts
19:17technomancyhow is that relevant to the topic though?
19:17rovarwe have a topic?
19:17arrdemrovar: it's at the top of the screen :P
19:18rovarXChat: rovar @ FreeNode
19:18rovarnice topic :)
19:18hyPiRionwoh, not been changed since July 2011
19:19hiredmantechnomancy: I was constraining it to gc related issues, but someone suggested the gc trade offs erlang makes allows it do something good
19:19rovarhmm..
19:23rovarhiredman: so we can summarize by saying process-isolation == freedom && reduced performance?
19:23hiredmanrovar: no
19:24rovarin this case, not OS level processes, but some notion of data isolation and asynchrony
19:25hiredmannone of which is unique to erlang
19:25rovarI think the GC leveraging that is
19:26rovarseparate GCs for separate processes is what allows one to easily guarantee that it is safe
19:26rovarit's not the only way..
19:27hiredmanI'd expect the result of any "leverage" would be a better gc
19:27hiredmanbut the beam gc "leverages" and comes out even or worse
19:27rovardoes it? I've heard SPJ say good things about it, that there are many things that they'd like to emulate in the erl gc
19:28rovarI think beam itself is just slower..
19:28technomancythe advantage is it's solving a much simpler problem. actual concurrent GC is a problem tat's only been solved well a handful of times in human history.
19:30technomancygiven the hacker resources erlang has at its disposal, they are not stuck with single-threaded processes like ocaml is.
19:30hiredmansure, it is solving a simpler problem, but does it gain anything over other platforms by that? not as far as I can tell
19:30arrdem$google clojure emacs mode
19:30lazybot[clojure-emacs/clojure-mode · GitHub] https://github.com/clojure-emacs/clojure-mode
19:30technomancyhiredman: over ocaml?
19:30hiredmantechnomancy: not everyone takes ocaml seriously :)
19:31technomancyhiredman: even go's GC isn't concurrent
19:31technomancynot that I take Go seriously
19:32rovarmental note: don't google for the arbitrary command in emacs, just type M-x and type what you'd expect, it's probably there.
19:32bitemyapprovar: use the help prefix.
19:33hiredmango is gross, but unfortunately very serious http://www.techempower.com/benchmarks/
19:34bitemyapphiredman: they're cheating.
19:34technomancyhaskell is afaik the only runtime with concurrent GC that hasn't had a bazillion dollars poured into it by a megacorp
19:34bitemyappor, at best, they're investing direct effort into gaming the benchmarks above and beyond anybody else right now.
19:34bitemyapptechnomancy: it's parallel. I don't know that I would describe it as concurrent.
19:34technomancybitemyapp: that's what benchmarks are for
19:34AimHeretechnomancy, Doesn't the top Haskell guy get paid by Microsoft to sit and be a cleverclogs?
19:35bitemyappthat's rather different from the effort the JVM has had put into it.
19:35technomancyAimHere: sure, but he is paid < $megabucks
19:35bitemyappthere is an erlang style GC branch of GHC. I'm not aware of any that use it.
19:35akhudekAimHere: I think facebook hired him now, no?
19:35bitemyappakhudek: wrong Simon.
19:35bitemyappthere is more than one.
19:36technomancyI wish tehy would hire the Cartesian Closed Comic guy because he's hilarious and seems to have dropped offline
19:36AimHereFacebook AND Microsoft, and they're still not rolling in megabucks? Haskell's funding scroungers really need to up their game
19:36rovarmental note #2, debugging vertex shaders when one knows neither webgl, nor cljs nor clojure very well is not recommended.
19:36technomancyavoid success at all costs dude
19:36bitemyapptechnomancy: I love those comics.
19:36bitemyappAimHere: they don't need Pharaonic mass slave labor like Java projects.
19:37bitemyappAimHere: just time to think.
19:37clojurebotI don't understand.
19:37technomancybitemyapp: ahaha
19:37rovarAimHere: All of Microsoft Research exists to keep top minds from being productive for other companies.
19:37technomancythat metaphor... I approve
19:37bitemyapptechnomancy: That's what Java and Go are designed for.
19:37AimHereBut just think ... what Haskell could do with Pharaonic mass slave labour!
19:37rovarhah
19:37hiredmantechnomancy: you seem to be arguing good intentions as a substitute for performance?
19:37rovarwe'd be rolling in the monads
19:38AimHeremonads up to the gonads
19:38bitemyapprovar: you would *not* want to use the STG if you were targeting Haskell as a host for Clojure by the by.
19:38bitemyappyou'd want .hs or GHC Core.
19:38rovarbitemyapp: thanks for the tip
19:38hiredmanwhen I am considering erlang as means of solving a problem, I shouldn't fault its faults because it didn't have lots of money poured in to it?
19:38arrdemclojurebot: haskell is pharaonic mass slave labour
19:38clojurebotAlles klar
19:39bitemyapparrdem: first thing I am going to do in DayZ is bludgeon you with a wrench.
19:39rovarif one blurs ones eyes, compiling to haskell could look similar to compiling to SSA
19:39arrdembitemyapp: you'll have to catch me first. MOBAs and starcraft have sharpened my juking skills considerably
19:39bitemyapp~forget haskell is pharaonic mass slave labour
19:39clojurebotAck. Ack.
19:39bitemyapparrdem: that's actually a good thing
19:40bitemyapparrdem: until you get a rifle, main survival technique is juking and sneaking.
19:40rovararrdem: MOBA?
19:40bitemyapparrdem: stick to the treeline. Avoid the zeds. stay away from humans you don't know.
19:40arrdemrovar: Multiplayer Online Battle Arena
19:40rovarah
19:40bitemyapparrdem: we'll link up in a server. you know DayZ is semi-persistent right?
19:40arrdemrovar: LoL and other DOTA-likes
19:40arrdembitemyapp: yerp
19:40bitemyappkk, just making certain you understood.
19:41rovararrdem: I have been so far unsuccessful getting that to run in Wine
19:41bitemyappalso I wouldn't attempt server teleportation, they'll probably ban you for that.
19:41technomancyhiredman: I'm saying it's a remarkable achievement even if the trade-offs it chooses don't fit the problem you have at hand
19:41rovarnot devoted much effort to it either..
19:41arrdemrovar: I tried wine a couple times, it's always ended badly
19:41rovarif you know of alternates that run natively on Linux I'd give it a try.
19:41rovarbeen in the market for a good video game.. things have been stressful as of late.
19:41arrdemrovar: dota2 is native for linux :D
19:42technomancyrovar: http://ftlgame.com
19:42technomancyooh, it's on sale
19:42arrdemtechnomancy: oh gods ftl
19:42AimHereHoN and awesomenauts are also linux-native, but go with Dota2
19:43arrdemrovar: if you by FTL, may the RNG gods smile on you, because they don't on me
19:43technomancyyou will die. many times...
19:43rovarheh
19:43rovari love procedurally generated games.
19:43arrdemtechnomancy: I love the teleporter invasion strategy but I keep killing my away team Q_Q
19:43andyfFTLFTW
19:43hyPiRionI like how FTL is actually hard though
19:43hyPiRionnot beaten it on normal mode, even
19:44arrdemhyPiRion: I just want to win on easy....
19:44technomancytook me twelve times
19:44hyPiRionarrdem: isn't it just normal and hard? If not, I haven't beaten it on easy.
19:44AimHereIt's easy and normal
19:44hyPiRionoh lol
19:44technomancy"easy" heh
19:44rovardota looks decent..
19:45riley526rovar: just don't take the community too seriously
19:45rovarI have been playing Kingdom Rush on my daily trainride
19:45rovarthat's as far as I get into games these days..
19:45bitemyapprovar: DotA is a good way to drink deeply of hatred for all mankind.
19:46arrdemgoddamnit pacman thanks for eating 24% of / with cached old packages
19:46rovars/dota/any-multiplayer-game-ever/g/i
19:46AimHereI didn't think the DotA community was that bad when I played it. I've heard that HoN is worse
19:46bitemyappAimHere: HoN was pretty bad.
19:46rovarclojurebot: google HoN
19:46clojurebotFirst, out of 15100000 results is:
19:46clojurebotHON Office Furniture – Desks, Workstations, Chairs, Storage &amp; Files
19:46bitemyappAimHere: most of that period of my life is a white-hot haze of hatred.
19:46clojurebothttp://www.hon.com/
19:46rovarmeh
19:46bitemyapprovar: heroes of newerth.
19:46AimHereHeroes of Newerth
19:47bitemyappHoN was really intense.
19:47rovarok.. downloading on steam
19:47bitemyappDotA2 is a bit slower and more casual, but way better than LoL
19:47rovarneed to dust off my Nostromo
19:48rovarprobably means I'm going to need to do some serious button mapping on linux, it will probably register as a mouse..
19:49rovaralso FORCED looks fun. I backed it on kickstarter, but don't have any friends to coop with
19:49justin_smithit's OK rovar, none of us would be in IRC if we had friends
19:49arrdem(inc justin_smith)
19:49lazybot⇒ 18
19:49rovarjustin_smith: we can all be lonely together
19:50bitemyapparrdem and I are going to go camping!
19:50bitemyapp(in DayZ)
19:50rovarimperialist windows games
19:53AimHereNow we have games, our next goal is Linux/SteamOS exclusives
19:53xeqicemerick: query about queue length and PR status
19:54AimHereIf we start with Half Life 3, I won't complain
19:54nDuffBlegh. Spending a few minutes dealing with concurrency in Java-land, and wishing so much for Clojure's STM.
19:55nDuff(dealing with a bug report against locking code in Apache Ant that I was the last person to touch).
20:07cemerickxeqi: Answer hazy. Ask again later. :-/
20:29jtoyis there a way I can override defn so that in debug mode it prints out all its arguments?
20:31technomancy~tools.trace
20:31clojurebotHuh?
20:31technomancyderp
20:31technomancy$google clojure tools.trace
20:31lazybot[clojure/tools.trace · GitHub] https://github.com/clojure/tools.trace
20:37jtoytechnomancy: that looks like I need to change around all my code though? I basically want all user defined functions to output their inputs and outputs without changin code around, i guess that isnt really possible?
20:37jtoyoh, i see I can trace a whole namespace
20:37bitemyapparrdem: mumbur plz
20:37jtoycool, I'll test that out, thanks
20:38technomancynp; it's a neat lib
20:39arrdembitemyapp: but I was almost motivated to write code again...
20:40arrdemnot like it's code anyone else will use but still
20:41bitemyapparrdem: ALPHER TAIM
20:41yedi@dnolen: is this because you need to wait for om to update the dom first? https://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/item.cljs#L29
20:41arrdembitemyapp: fiiiine
20:41arrdembitemyapp: god making me play games
20:42dnolenyedi: I think so and the React TodoMVC version works around this by calling the parent to setState first and then call setState on the child.
20:43dnolenyedi: likely easily worked around but just wasn't a priority - took a long time to put that together since I was co-developing Om at the same time.
20:43dnolenyedi: now that it's done I'm pretty excited, kovasb is already building some really cool stuff w/ it
20:43dnolenrepresenting UIs as ClojureScript data is radical.
20:44yedii saw the readme update and was wondering if it was "complete" yet
20:44dnolenyedi: I'd consider it far too early days to be anything more than something to play with
20:44dnolenfeedback most welcome of course.
20:58xeqidnolen: any links for the "representing UIs as cljs data"?
21:02hiredman#ui/component {...}
21:13dnolenxeqi: it's just how Om works, convert EDN data into DOM.
21:14dnolenxeqi: w/o having to actually touch the DOM
21:15dnolenxeqi: in the end conceptually similar to WebFUI, but way faster because of React and how we integrate w/ it.
21:16nopromptwhy do protocol functions sometimes start with a hyphen in cljs?
21:16noprompti forgot and can't seem to get a solid answer from google.
21:17rovarnoprompt: protocol functions? I know accessing attributes of objects requires a hyphen
21:18dnolennoprompt: just a convention from core.cljs, usually when a it's backed by a real function
21:18dnoleni.e. first -first
21:19nopromptdnolen: ok. so the function can be called w/o the leading hyphen?
21:19dnolennoprompt: absolutely, function names can be any valid symbol (I think)
21:21nopromptdnolen: my question was if a protocol has an fn spec for (-foo [this]) it can be called as (foo obj)? or would you wrap the call to (-foo obj) in another fn?
21:21dnolennoprompt: protocol functions are just functions, in the case of the -first, first, the real first function dispatches to -first
21:22dnolennoprompt: but this isn't automatic, you have to write it that way
21:23nopromptdnolen: ah ok, so, for instance, (first xs) and (-first xs) are two separate things.
21:23dnolennoprompt: they are
21:23dnolennoprompt: and in fact calling -first is not a good idea unless you know what you're doing.
21:24nopromptdnolen: so why convention with the leading hyphen? why not write protocal fn specs sans hyphen? this is what confuses me.
21:24dnolennoprompt: it just signifies something that digs a bit into implementation details, it's just a convention - no need to follow it
21:25nopromptdnolen: ok. i appreciate you helping me here. :) i'm sure sooner or later somone on my current team is going to ask me about it.
21:25dnolennoprompt: I may change it in Om, since we don't really need the leading dash there, there won't be another function in front of the protocol fns
21:27nopromptdnolen: a little enthusiasm has built for cljs at work. originally the guys weren't sure but om, core.async, and immutable data structures is starting to make those parens look good. :)
21:28dnolennoprompt: cool :)
21:28dnolennoprompt: I changed Om no more leading dash on protocol fns
21:30rovar:)
21:31rovarI'm in the same boat.
21:32rovarwas not a lisp fan, but my primary bag is concurrent c++ applications. After mucking with scala, I started implementing actors in C++.. partway through I was like "I don't really need to go through all of this hassle for an actor. What I really need is serialized accesses to variables"
21:33nopromptdnolen: cool. so far this has been nice. it really feels like this was the missing peice for the frontend.
21:33rovaralso, I've implemented a poor mans STM where one would basically version references to roots of data structures atomically.
21:33rovarlittle did I know, I was re-inventing clojure.
21:34rovarthe power got me over my fear of paren-matching
21:34rovarI've even gone so far as to switch from vim to emacs..
21:34nopromptrovar: paredit helps too. :)
21:34rovarparedit was my mortal enemy
21:34nopromptrovar: did you install evil-mode?
21:34rovaruntil I learned that its basically an eager, stupid assistant
21:35rovarno
21:35rovarI'm trying to go native :)
21:35nopromptrovar: ah, yeah, that didn't exactly work out for me.
21:35rovarbeen using vim exclusively for 7 years
21:35rovarstarting to get the hang of the basics...
21:35nopromptrovar: i installed evil, keychord, evil-paredit, etc.
21:35rovarI google a lot
21:35rovarheh
21:35nopromptmodal editing is the "right" way. >:)
21:36dnolennoprompt: agreed! while I think it's great that people have been making do w/ lesser tools, WebFUI and Om are closer to the Clojure spirit, hopefully this is just a jumping off point for people built really awesome libraries.
21:36dnolens/built/to build
21:37rovardnolen: don't forget cljs-webgl :)
21:38rovarat the moment I have a javascript nrepl with https://github.com/Asakeron/cljs-webgl and frodo working
21:38echo-arearovar: I have tried paredit and the likes and removed them too
21:38rovarso I'm marvelling at my ability to change the color of a triangle from emacs
21:38nopromptdnolen: it definitely helps. with a dsl and a few convenience macros it's fairly easy to write the view layer that does what advertises.
21:39dnolenrovar: haha, awesome haven't seen that before
21:39dnolenrovar: cljs-webgl I mean
21:39rovarI'll check in my project when I make it do a bit more..
21:40rovarkind of a scaffolding/sample of dommy and webgl
21:40rovarI want to make an interactive shader IDE for my own purposes..
21:40rovarOm looks great
21:40rovarI'm not much of a web UI guy. So I'll need all the help I can get.
21:40dabdanyone knows how can I get rhizome to save an image in pdf?
21:41rovardabd: what is this rhizome of which you speak?
21:42dabdhttps://github.com/ztellman/rhizome
21:44sritchieanyone have tips on a really simple logging lib?
21:44sritchieno timestamps, none of that...
21:44sritchiejust levels, basically
21:45rovarsritchie: umm. File ?
21:45rovarmyfile.append :)
21:45sritchieyeah, I guess that's the simplest :) or just println with an on/off switch
21:45sritchieI just need to figure out how to customize the formatting in timbre
21:46rovaryou could redir stdout to a file descriptor and use println
21:47rovarone downside of frodo/austin is I seem to be able to hang emacs so hard that I have to kill -9 it
21:51justin_smithrovar_away: nohup is nice for that, automatic appending of all output, and keeps things running while you log out
21:52shriphanihi any incanter users here ?
21:53SegFaultAXshriphani: Ask here first, if you don't get any responses, try on the mailing list.
21:53SegFaultAXThere are lots of users on the mailing list.
21:54sritchiecan you guys help me match a bracketed string? seems so easy… gahhh
21:54shriphani ok. I was wondering if there was a partial-svd implementation available? I only see a full decom-svd.
21:54sritchieERROR [paddleguru.config] - Everything else
21:54sritchiethat's the pattern
21:54justin_smithsritchie: are you using emacs?
21:54sritchieyeah, actually
21:54sritchieoh, whoops
21:55sritchiesorry, thought I was in logstash
21:55justin_smiththere is a tool for regex building
21:55justin_smithhttp://emacsworld.blogspot.com/2009/10/using-emacs-regular-expression-builder.html
21:55sritchieoh, nice
21:56rovar_awayi wonder if anyone's made a ragel style state machine generator in a lisp dialect
21:56justin_smithI bet there are like 200 dissertations from the late '70s on that topic
21:57rovar_awayspeaking of... have you seen Bret Victor's talk on programming languages
21:57justin_smithjust joking, it just sounded good
21:57rovar_awayyou're probably off by a decade.. it was probably the late 60s
21:58justin_smithheh, good call
21:58rovar_awaywatch this: you'll be glad you did
21:58rovar_awayor angry.. or both
21:58rovar_awayhttp://vimeo.com/71278954
21:58rovar_awayBret Victor is one of my heros