#clojure log - Dec 17 2013

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:04 kandinski: is the max stack depth on 4clojure very small, or is a StackOverflowError a sign that there's certainly a bug?

0:07 or, why should this overflow the stack with the toy inputs from 4clojure? http://paste.ubuntu.com/6587241/

0:07 it's an answer to problem 28, or it tries to be

0:10 amalloy: kandinski: 4clojure has the same stack depth as you'd expect. the problem is your recursive function has no base case

0:10 kandinski: amalloy: when the first of foo is non-sequential

0:11 that's the base case

0:11 amalloy: how can you call it the base case, when you call flat twice?

0:11 kandinski: three times in total

0:12 I call it on either first and rest of foo

0:12 or only on rest of foo

0:12 amalloy: by the way, I'm not arguing that I'm right and you're wrong

0:12 I'm arguing what I understand, which is obviously not correct, since I overflow the stack

0:12 amalloy: there 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?

0:13 kandinski: amalloy: yes. I would think that (flat '(1 2 3)) should produce [1 2 3], but nope

0:13 hmm

0:14 amalloy: how could it ever produce that? you make it call flat again, twice

0:14 and each of those calls will call flat again...

0:14 kandinski: well, (first '(1 2 3)) is not sequential

0:14 so I call (into [1] (flat '(2 3)) (or so I thought I was)

0:15 echo-area: amalloy: What do you think about defining a function such as (fn [tag & _] tag) as the dispatch function of many multimethods?

0:15 amalloy: you call (into (flat [1] (flat [2 3])))

0:15 kandinski: then, same with '(2 3)

0:15 amalloy: er, (into (flat [1]) (flat [2 3]))

0:15 kandinski: amalloy: that's when (first foo) is sequential, not the case when (first foo) is 1

0:16 amalloy: oh, so it is. i sorta expected the first half to be the base case

0:16 well, in the second half, the base case, you call flat exactly once

0:16 regardless of the contents of foo

0:16 that's one too many times, for a base case

0:17 kandinski: it's (into (base case) (recur on rest of sequence))

0:17 but since it's not working...

0:18 amalloy: kandinski: if there is any more recursion, that is not a base case. because you never stop

0:18 you probably want a check on (empty? coll) or something

0:18 kandinski: amally

0:18 the problem is that (sequential '()) is true

0:19 so (flat (rest foo)) won't stop

0:19 yes, empty

0:19 amalloy: (flat (rest foo)) will not stop in any case, because both halves of your if condition contain recursion

0:19 kandinski: grumbleor something

0:19 amalloy: replacing sequential? with empty? will not change that

0:20 you will need a branch that does not call flat at all

0:24 TEttinger: amalloy, as I understand it, J has ways of finding the inverse of some functions (or has them declared for stb lib ones).

0:26 I'm not sure how you would programatically find square root as the inverse of square, or something like #(Math/pow % 3.5)

0:27 kandinski: amalloy: I got to have my cake and eat it

0:27 added a base case and kept the one I had

0:29 amalloy: http://paste.ubuntu.com/6587296/ if you are interested, and thanks for the prodding

0:30 amalloy: incidentally, (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

0:30 kandinski: just to make sure I get the right order

0:32 amalloy: also, in my basecaseless version, I did not have an empty list to start consing onto

0:32 echo-area: amalloy: http://pastebin.com/5KXJFcFK <-- Here's what I meant. What do you think about it?

0:32 kandinski: amalloy: amcnamara's solution is interestingly similar to mine

0:32 xpera: how can I specify in my project.clj that java 7 is a requirement?

0:33 amalloy: echo-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

0:33 echo-area: I asked yesterday, nobody answered :(

0:33 kandinski: xcept the fact that he uses an accumulator

0:33 and a matcher

0:33 weird

0:34 amalloy: xpera: ;; plz use java 7

0:35 xpera: amalloy: haha, ok, if you twist my arm

0:35 amalloy: AFAIK there's nothing more formal

0:35 xpera: but you don't have to wink twice to convince me

0:36 i'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

0:37 echo-area: amalloy: And sorry, I asked you specifically because I thought your answer would be inspiring. Again, I didn't mean to offend you.

0:38 Would somebody else like to take a look at it?

0:38 http://pastebin.com/5KXJFcFK <-- Is this a abuse or not?

0:38 *an

0:40 levinm: there must be a function that returns a collection of every item in a collection for which a predicate is true

0:40 (gather even? [2 4 5 6]) would return (2 4 6)

0:40 What function goes where I wrote "gather"?


0:40 echo-area: levinm: filter

0:40 levinm: See also remove

0:40 levinm: thanks, hard to google for

0:40 rovar: what's the paredit command to wrap a word in parens?

0:41 echo-area: levinm: core.clj is a good place to look at

0:41 levinm: I get lost there ... so many things to click

0:41 rovar: M-(

0:41 rovar: thanks.

0:41 rovar: np

0:42 * xpera is confused

1:13 andyf: levinm: 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?

1:14 bitemyapp: andyf: well the bot can do that, for one.

1:15 andyf: bitemyapp: Do you know how? Or even better, is there a description somewhere of most or all that the bot can do?

1:15 TEttinger: msg lazybot with findfn is it?

1:16 I don't remember, I will take a look

1:16 noprompt: bitemyapp: ugh. i dunno. i like this language but i don't feel like i'm *this* anal of a person.

1:16 bitemyapp: noprompt: you don't have to be anal.

1:17 noprompt: you can write the language as strictly or liberally as you want, really.

1:17 noprompt: there's a uni-type you can slap on stuff if you're feeling truly lazy.

1:17 TEttinger: andyf, try: /msg lazybot findfn 1 2

1:17 noprompt: bitemyapp: sure i get that.

1:17 TEttinger: it takes a while

1:17 bitemyapp: noprompt: 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.

1:18 TEttinger: what language?

1:18 bitemyapp: noprompt: 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.

1:18 TEttinger: Haskell.

1:18 noprompt: bitemyapp: like i don't even know where to begin with this. clojure makes data problems obvious.

1:19 xpera: amalloy: 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

1:19 bitemyapp: noprompt: hum. you're working with roughly the same set of data structures plus some extras in Haskell, with some slightly different defaults.

1:19 TEttinger: nice xpera

1:19 bitemyapp: noprompt: talk to me about what you want to do/represent and I can help.

1:19 noprompt: bitemyapp: like none of the monad stuff i've read anywhere makes any sense.

1:19 bitemyapp: noprompt: leave the monads alone.

1:19 those'll come when you need them.

1:20 seriously, they're not even important right now.

1:20 They're good to know, but it doesn't really matter.

1:20 you can probably just slap everything in IO for now, no distinctions made, and leave the rest of your code pure.

1:20 noprompt: talk to me about your data.

1:21 TEttinger: tell me about your mother I mean data

1:23 noprompt: bitemyapp: we'll chat about it when we pair this week. right now, i just need to fumble around and be cranky.

1:23 andyf: bitemyapp: As long as you entice Haskell folks to the Clojure channel every now and then, too :-)

1:24 bitemyapp: noprompt: you'll be okay.

1:25 andyf: ¯\_(ツ)_/¯

1:25 noprompt: bitemyapp: omfg. dude. these people do not understand programming https://github.com/hylang/hy/issues/373#issuecomment-30728838

1:25 bitemyapp: read the whole thread.

1:25 bitemyapp: noprompt: funny you mention that, I dropped into their channel to talk about translating between edn and Python data today

1:26 noprompt: bitemyapp: please tell me they are competent.

1:26 bitemyapp: from the responses...

1:26 bitemyapp: noprompt: uhhh, they didn't have anything shake and bake for my problem.

1:26 noprompt: unless I wanted to make a translation layer between their parser and AST to Python native data.

1:27 I didn't talk to many of them, nothing impressive came of it.

1:27 I came by way of Fox, really.

1:27 I was kind of surprised the Hylang people hadn't made an edn/python library.

1:27 because uh. you know.

1:27 :|

1:27 * bitemyapp goes back to reading thread

1:28 noprompt: bitemyapp: i just don't see how anyone could make such a simple problem so difficult.

1:28 bitemyapp: ...are these motherfuckers for real?

1:28 I might just rage out of my browser tab.

1:29 noprompt: bitemyapp: seriously. it's like they're *not* thinking.

1:29 bitemyapp: the problem is SO EASY.

1:29 bitemyapp: noprompt: I understand not retaining Clojure's semantics 1:1 in some cases, but the truthiness stuff is pretty fundamental and nice.

1:29 noprompt: does this mean I shouldn't bother asking them if they've implemented immutable collections?

1:29 / persistent

1:30 noprompt: bitemyapp: no don't. you'll kill them.

1:31 bitemyapp: probably.

1:31 noprompt: bitemyapp: i mean they act as if they have no control over the code they wrote.

1:31 bitemyapp: devn: this is why I'm grumpy all the time.

1:31 noprompt: LOL. I love it when I see people like that.

1:32 xpera: noprompt the point that it will work to make `if` behave properly without break other python code...

1:32 ...that was funny. and sad.

1:32 err. without breaking

1:33 noprompt: bitemyapp: and the last comment in the thread is seriously icing on the cake.

1:34 xpera: "when Hy code is mixed with python code and calls are made to both directions" WHAT?

1:34 i'm envisioning some kind of HYDOC dropped in the middle of a python program now

1:35 python -- now lisp -- now python. whee!

1:35 bitemyapp: Which is it? NOBODY KNOWS

1:35 ivaraasen: xpera: I was imagining some sort of two-headed troll ravaging Norwegian peasants.

1:35 bitemyapp: why not pick one set of semantics and stick wit hit?

1:35 either it's a shitty syntax transpiler with macros or it's a Clojure-derivative.

1:36 xpera: I can see the sequel: Python snakes on a plane, very much confused

1:37 bitemyappALL THE POWER OF LISP, but improved with Python if semantics!

1:39 bitemyapp: noprompt: added my usual gasoline to the fire.

1:43 Speaking of terrible languages and the decisions associated with them: http://news.php.net/php.internals/70691

1:44 guns: "the

1:44 function hashing mechanism was strlen()."

1:44 if anyone missed that

1:46 ddellacosta: bitemyapp: please, why must you try to make me cry

1:46 andyf: I'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?

1:47 ddellacosta: I'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?

1:47 noprompt: bitemyapp: i'm having a hard time not coming off as a dick in this comment i'm about to post.

1:47 amalloy: &(doc partition)

1:47 lazybot: ⇒ "([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

1:47 ddellacosta: Seems like some mix of take 2, partition, etc.. but I'm having trouble nailing it down

1:48 bitemyapp: ddellacosta: I don't mean you make you cry :(

1:48 ddellacosta: amalloy: argh, I thought I'd reviewed doc partition already, thanks

1:48 amalloy: &(partition 2 1 (range 1 5))

1:48 lazybot: ⇒ ((1 2) (2 3) (3 4))

1:48 bitemyapp: gerd dermert

1:48 I was about to paste that.

1:48 amalloy: &((fn [coll] (map list coll (rest coll))) (range 1 5))

1:48 lazybot: ⇒ ((1 2) (2 3) (3 4))

1:48 bitemyapp: I need to start guessing instead of double-checking my answer.

1:49 ddellacosta: amalloy, bitemyapp: yeah, I just didn't read the partition doc carefully enough.

1:49 * ddellacosta is embarrassed but thankful to amalloy

1:50 bitemyapp: ddellacosta: at least the Clojure core library is that nice.

1:51 ddellacosta: bitemyapp: yeah, seriously. I knew I was missing something that was definitely in there, which is why I asked

1:55 bitemyapp: noprompt: 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*

1:55 you can measure how angry I am by how many times I *C-a del* before getting something remotely acceptable.

1:56 andyf: bitemyapp: Does the success of that project matter to you?

1:56 TEttinger: very rage. such take offense. wow.

1:57 bitemyapp: (inc TEttinger)

1:57 lazybot: ⇒ 8

1:57 TEttinger: my brother got a 3d-printed doge for hanukkah.

1:57 bitemyapp: andyf: *sigh* Not really, no. I'd like Lispers to seem less derpy though.

1:57 noprompt: lol

1:57 bitemyapp: TEttinger: that's a pretty awesome gift.

1:58 TEttinger: https://www.shapeways.com/model/1496035/doge.html?li=search-results&materialId=26 it printed pretty well.

1:58 andyf: One of the properties of Lisp is that its core is small enough that lots of programmers have implemented at least part of one.

1:59 logic_prog: is 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

1:59 andyf: They aren't all going to have equal quality.

1:59 logic_prog: or is this fundamentally incompatible with core.async design?

1:59 bitemyapp: Whenever I find myself surrounded by pop culture or people I don't respect, I climb for higher ground.

1:59 logic_prog: fan-out yo.

1:59 ddellacosta: logic_prog: are you looking for a pub-sub kind of thing?

1:59 logic_prog: I don't know

1:59 let me read up on both

2:00 bitemyapp: fan-out is a generic signals/channels thing.

2:00 ddellacosta: logic_prog: easy to do with http://clojure.github.io/core.async/#clojure.core.async/pub

2:00 andyf: If 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.

2:00 xeqi: ddellacosta, logic_prog: or http://clojure.github.io/core.async/#clojure.core.async/mult + tap

2:01 logic_prog: fan-out is not waht I want

2:01 reading about pubsub now

2:01 andyf: s/Huge/Hugo/

2:01 logic_prog: xeqi: will try that if pubsub does not work

2:02 bitemyapp: andyf: I was thinking about programming communities.

2:03 logic_prog: ddellacosta, zeqi: pubsub looks like hwat I want

2:03 xeqi: I think under the hood, it's the mult + tap you suggested?

2:04 ddellacosta: logic_prog: yep

2:06 noprompt: bitemyapp: ok. https://github.com/hylang/hy/issues/373#issuecomment-30730315

2:06 lol

2:07 bitemyapp: noprompt: I like and agree with your response.

2:08 noprompt: bitemyapp: i feel so... experienced?

2:08 bitemyapp: rational? what's the fucking word i'm looking for here?

2:09 * bitemyapp shrugs, speechless

2:09 noprompt: bitemyapp: i feel like i unloaded.

2:09 bitemyapp: i feel better.

2:09 haha

2:10 bitemyapp: Good.

2:10 noprompt: sorry everyone!

2:10 :)

2:10 bitemyapp: I'm watching the Walking Dead. It's keeping me hooked so far but it's not that appealing.

2:12 andyf: I 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.

2:13 bitemyapp: andyf: the thing with the presaged dream crap was too predictable and stupid.

2:13 now that I know the people from Lost are involved, I'm pondering quitting now.

2:14 andyf: Recommended things to watch if you haven't seen them already: Firefly, The IT Crowd, Father Ted

2:15 bitemyapp: I loved Firefly but it's hole in my chest now.

2:15 noprompt: bitemyapp: Boardwalk Empire, now that's a show.

2:16 bitemyapp: noprompt: I watched the first season and a half, got exhausted with it.

2:16 noprompt: bitemyapp: 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."

2:17 bitemyapp: noprompt: ick.

2:17 noprompt: bitemyapp: i like it so far. Breaking Bad, BattleStar Gallactica, and Caprica have been the only shows which have made me a pretty happy customer.

2:17 bitemyapp: noprompt: I liked BB, BSG, and Caprica too.

2:18 BSG made me happy.

2:18 noprompt: bitemyapp: Boardwalk Empire is good enough entertainment when i don't feel like thinking hard. generous helpings of nudity and violence.

2:19 bitemyapp: noprompt: have something happy: http://i.imgur.com/oCmvTas.jpg

2:20 noprompt: I found the scheming the most interesting part of BE.

2:21 noprompt: hahahhaa

2:23 jonasen: andyf: is crucible broken on master? I get lot's of exceptions

2:24 andyf: jonasen: Crucible wasn't intended to have no exceptions. It was intended to bring them to the forefront :-)

2:24 bitemyapp: andyf: crucible?

2:25 andyf: Test suite for Eastwood Clojure lint tool we are working on

2:25 Runs the linter on all Clojure contrib libraries, and about a dozen 3rd party open source libs

2:26 bitemyapp: yoish. That's thorough.

2:27 andyf: I 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.

2:27 jonasen: andyf: 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

2:28 andyf: jonasen: Most of the libs are pretty small, but yeah, it can take a bit.

2:28 I haven't seen NPEs while cloning github repos, but haven't done it much recently.

2:29 jonasen: You are using a recent Leiningen version? Not that I know whether that would matter for sure, but worth asking.

2:30 jonasen: andyf: 2.3.3

2:31 andyf: that'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.

2:31 jonasen: andyf: the linting has now started.. still only NPE

2:33 andyf: jonasen: I get exceptions while linting, but they are all during analysis, emit-form, or eval, with no NPEs.

2:33 Let me try pulling a fresh copy and see what happens.

2:34 jonasen: andyf: oh, sorry.. they're no longer NPEs.. it's java.lang.IllegalAccessError

2:35 seriously_random: problems with cons, need a hint: http://pastebin.com/zgXHt5Vs

2:36 andyf: What JVM version?

2:37 jonasen: 1.7.0_25

2:40 andyf: I've been doing most of my testing with a similar version. You have latest tools.analyzer(.jvm) installed?

2:41 Bronsa keeps improving them.

2:41 jonasen: andyf: yes, via checkouts

2:41 andyf: I usually just 'lein install' them. Don't know if that should make any difference.

2:42 jonasen: it works fine when I run 'lein eastwood' in the eastwood root folder

2:42 that's why I think it has something to do with the scripts

2:43 andyf: I 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.

2:43 Then I run the lint.sh script in crucible.

2:43 with eastwood in my ~/.lein/profiles.clj

2:44 jonasen: andyf: ok, I'll try that

2:44 (later, gotta run now)

2:44 andyf: bye

2:56 serioiusly_random: Try returning nil in the base case

2:57 when how many times is 0 rather than 1

2:57 ,(cons :a :a)

2:57 clojurebot: #<ExceptionInfo clojure.lang.ExceptionInfo: Don't know how to create ISeq from: clojure.lang.Keyword {:instance :a}>

2:57 andyf: ,(cons :a nil)

2:57 clojurebot: (:a)

3:24 andrei: I have a strange macro bug that I can't understand

3:24 The same code expands in two different ways depending on the context

3:24 (use 'monads.core) (defmacro w [a] `(mdo a# <- ~a (return a#)))


3:24 (pprint (macroexpand-all '(w 1)))

3:24 (pprint (macroexpand-all '(mdo a <- 1 (return a))))

3:25 The two print statements should have exactly the same output

3:25 But they do not

3:25 Am I missing something?

3:25 (the same up to variable renaming of course)

3:28 andyf: Are you referring to the differene of namespace prefixes, e.g. user/mdo instead of mdo?

3:29 andrei: andyf: No. It generates incorrect code

3:29 The correct code is: (monads.core/>>= 1 (clojure.core/fn [a] (return a)))

3:29 But the output of (pprint (macroexpand-all '(w 1)))

3:30 (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)))))))

3:30 (I renamed variables for readability)

3:31 Note how mdo didn't work, it did not parse <- correctly

3:33 andyf: I'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.

3:34 andrei: mdo is https://github.com/bwo/monads/blob/master/src/monads/mdo.clj

3:48 amalloy: andrei: clojure.walk/macroexpand-all is not close to a canonical/correct macroexpander

3:49 the most obvious/common issue is that it doesn't do anything with &env like the compiler does when it's expanding macros

3:49 andrei: amalloy: You get the same reuslts with macroexpand

3:49 amalloy: And I discovered this because the code also executes incorrectly :)

3:52 amalloy: oh. your definition of w results in an expansion that is not exactly the same as your by-hand mdo

3:52 it's putting `<- in there instead of '<-

3:53 and 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

3:54 (defmacro w [a] `(mdo a# ~'<- ~a (return a#))) should make them equivalent, andrei

3:55 andrei: amalloy: Yup. That works. Thanks! So does defmacro always fully-qualify the names?

3:55 amalloy: imo that's an issue with mdo, but it's not surprising that clojure's macro libraries have bugs :P

3:55 no, defmacro never does that. it is ` which always does that

3:55 andrei: amalloy: Ah, should I use something else instead?

3:56 amalloy: haskell? 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

3:56 andrei: amalloy: What should mdo be looking for?

3:56 amalloy: er, monad libraries

3:56 andrei: amalloy: I mean, in my macros to preven this :) (but yes, I do write a lot of haskell code)

3:56 prevent

3:56 amalloy: it should be looking for any symbol whose name-part is <-, rather than only the symbol with no namespace and whose name is ->

3:57 no, 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

3:57 andrei: Ah, is there some easy function/syntax to do that or to break the name up?

3:58 amalloy: &(name 'user/<-)

3:58 lazybot: ⇒ "<-"

3:58 andrei: Neat, thanks

3:59 Is this somewhere I should have read about this behaviour of defmacro but missed it?

3:59 amalloy: again, it is not a part of defmacro at all, but of `

3:59 &`<-

3:59 lazybot: ⇒ clojure.core/<-

3:59 andrei: Oh, I see what you mean

4:00 philandstuff: &`~'<-

4:00 lazybot: ⇒ <-

4:00 andrei: That's pretty odd behaviour

4:00 Is there a rationale behind this?

4:00 amalloy: $google symbol capture clojure

4:00 lazybot: [Unhygienic ("anaphoric") Clojure macros for fun and profit - amalloy] http://amalloy.hubpages.com/hub/Unhygenic-anaphoric-Clojure-macros-for-fun-and-profit

4:00 amalloy: hey, that's by me!

4:01 it's really not a good answer to your question though

4:01 andrei: amalloy: Yeah, that seems to discuss macros; not specifically `

4:02 amalloy: andrei: 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

4:02 clojure's ` behavior fixes this very neatly, but causes some mild irritation when you actually wanted unqualified symbols

4:03 andrei: Hmm. I have some difficulty seeing this. Can you give me some examples (non-defmacro-based)?

4:03 amalloy: well, they mostly don't matter except for in macros

4:03 $google on lisp symbol capture

4:03 lazybot: [On Lisp: Variable Capture - Dunsmor.com] http://dunsmor.com/lisp/onlisp/onlisp_13.html

4:04 amalloy: yeah, that's exactly what you should read

4:04 andrei: I'm familiar with variable capture and the different macro systems out there

4:04 (including the scheme ones)

4:05 But changing the semantics of ` seems like an odd choice for building a more hygenic macro system

4:05 amalloy: well, 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

4:06 andrei: 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

4:06 andrei: But surely far more people use ` outside the use case of macros?

4:06 amalloy: no?

4:06 clojurebot: no is tufflax: there was a question somewhere in there, the answer

4:06 amalloy: ` is overwhelmingly used inside macros

4:07 andrei: amalloy: Really? That's highly surprising

4:07 amalloy: quasiquote/unquote are regularly used in scheme outside of macros

4:08 amalloy: Is there an actual quasiquote/unquote for clojure that doesn't namespace qualify?

4:08 amalloy: no

4:12 andrei: amalloy: 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.

4:12 amalloy: andrei: ` in non-macro code is perfectly fine too, it's just not great for inserting literal symbols

4:12 andrei: amalloy: Speaking of. Do you know if there's a way to get reader macros? Like to swap out the reader for a compatible one?

4:13 amalloy: which is mostly fine because clojure doesn't use symbols in as many places, since it has keywords

4:13 mbarbieri: Hi, 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?

4:14 amalloy: eg, `(~x ~@ys ~z) is a perfectly reasonable thing to write, and totally unaffected by namespacing

4:15 justin_smith: mbarbieri: 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

4:16 mbarbieri: avout uses apache zookeeper to make distributed (multi server) versions of refs and atoms

4:16 philandstuff: andrei: do tagged literals do enough for you?

4:16 andrei: philandstuff: Nope

4:16 justin_smith: mbarbieri: avout has implementing distributed agents on their roadmap, which is exactly what I think you would want

4:16 andrei: philandstuff: I have to have non-scheme data

4:18 mbarbieri: justin_smith: ok thank you, will check avout

4:18 andrei: philandstuff: Specifically I want inline LaTeX

4:18 philandstuff: Which you can't even inline as a string

4:20 "\alpha" is not a valid string

4:20 hiredman: ,"\\alpha"

4:20 clojurebot: "\\alpha"

4:20 hiredman: ,(println "\\alpha")

4:20 clojurebot: \alpha\n

4:20 andrei: Yes, but that defeats the whole purpose of what I'm doing

4:20 justin_smith: which is?

4:20 the syntax for \ in a string is \\

4:20 hiredman: sure, you want like that haskell compiler that can take in haskell with inline latex

4:21 andrei: I want it to literally be LaTeX so that I can copy and paste between my papers and code

4:21 hiredman: you are one of those literate programming guys

4:21 andrei: So that emacs can render it inline

4:21 And so that at compile-time it can generate code from my LaTeX

4:21 https://github.com/abarbu/schemetex

4:22 hiredman: no, clojure doesn't allow user definied reader macros

4:22 andrei: Well, the current reader doesn't. But is there a way to swap it out for one that does?

4:22 hiredman: andrei: the way to "swap it out" would be to write another reader and call the read function for that reader

4:23 but that won't change how the compiler reads code

4:23 andrei: hiredman: Right. Has someone written a reader for clojure that supports reader macros and can I ask clojure to use that one?

4:23 hiredman: so you'll need a new compiler too

4:23 andrei: no

4:25 TEttinger: andrei, maybe. you can kinda hack clojure's reader

4:26 hiredman: andrei: are you using emacs? have you considered using something like org-babel?

4:26 andrei: hiredman: To which of the two? I can't replace clojure's reader or there is none available?

4:26 TEttinger: Oh?

4:26 TEttinger: http://briancarper.net/blog/449/clojure-reader-macros

4:26 andrei: hiredman: I use org-babel, yeah

4:27 hiredman: andrei: technically you can turn off the access protection on the read table and fiddle it

4:27 but that is seriously frowned on

4:27 andrei: hiredman: Oh? How would one do this?

4:27 hiredman: which is no doubt what that blog post is about

4:28 andrei: just don't

4:28 andrei: hiredman: Yeah, seems like that's what they do

4:28 hiredman: What other choice do I have?

4:28 hiredman: andrei: if you are using org-babel then you can mix clojure code with org text already

4:29 andrei: hiredman: 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

4:29 hiredman: no one will want that code

4:29 if you want to redistribute code basing it on a hacked runtime is not good

4:30 andrei: hiredman: I don't see the problem

4:30 hiredman: This is clearly the clojure way of creating reader macros

4:30 hiredman: the reason clojure doesn't have user defined reader macros in the first place is issues with composability and code reuse

4:30 andrei: it is not

4:30 andrei: no one does it

4:31 andrei: it is one guy trying to show the world how smart he is by writing a blog post about it

4:31 andrei: hiredman: 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?

4:31 hiredman: andrei: I am advising you against it, for the sake of whoever you are distributing this code to

4:32 andrei: hiredman: 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?

4:32 hiredman: So like.. I'm open to suggestions

4:33 justin_smith: andrei: I think a layer that de-clojures strings would be much easier than a layer that redefines string input to clojure

4:33 hiredman: andrei: readjust your expectations, clojure is not scheme

4:33 amalloy: it'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

4:33 andrei: justin_smith: Except that said layer needs to exist in LaTeX

4:33 justin_smith: or as a compromise a layer that takes plain latex and clojure-escapes it, but not at the clojure reader level

4:33 andrei: justin_smith: And I'm not writing that

4:33 amalloy: if 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

4:33 justin_smith: andrei: it could exist in org/emacs

4:34 hiredman: or use, what the web thing is called, tangle?

4:34 andrei: justin_smith: Then this would forever only work in org/emacs. Which doesn't work for me. And it's even worse

4:34 An extra layer that requires escaping defeats the purpose

4:34 justin_smith: I think you want a language that is more flexible about parsing

4:35 andrei: I copy & paste between my code and my papers

4:38 Thanks for the help!

4:38 amalloy: Actually. Mutating locals works just fine

4:40 hiredman: andrei: I imagine coming from scheme you thinking you are mutating a local using a def, but in clojure def always creates a global

4:41 andrei: hiredman: No. I realize defs are global

4:41 hiredman: then in what way do you think you are mutating locals?

4:42 andrei: hiredman: 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

4:42 hiredman: you aren't using that right?

4:43 andrei: hiredman: Totally. It made quite the nice performance improvement

4:43 hiredman: :(

4:44 a. that isn't mutating locals, that is a macro that boxes things up in mutable cells

4:44 b. he wrote it as a joke

4:44 andrei: hiredman: Right, but it ends up effectively being the same thing

4:44 hiredman: Sure! Works for me

4:45 hiredman: If you have suggestions for a container that's equally fast, I'll use it

4:49 seriously_random: I can get rid of vector here: (concat (rest [1 2 3]) (vector (first [1 2 3])))

4:58 fredyr: user> (conj (rest [1 2 3]) (first [1 2 3]))

4:58 ,(conj (rest [1 2 3]) (first [1 2 3]))

4:58 clojurebot: (1 2 3)

4:59 fredyr: oh nvm

4:59 wrong ordering

5:02 user> ,(conj (vec (rest [1 2 3])) (first [1 2 3]))

5:02 ,(conj (vec (rest [1 2 3])) (first [1 2 3]))

5:02 clojurebot: [2 3 1]

5:03 fredyr: seriously_random: you need the vector somewhere, is the answer

5:03 either on the sequence, with conj, or on the element as in your example

5:03 seriously_random: fredyr, ok thanks

5:04 fredyr: [(first [1 2 3])] is bit shorter than (vector ..) though

5:06 hiredman: ,(doc take)

5:06 clojurebot: "([n coll]); Returns a lazy sequence of the first n items in coll, or all items if there are fewer than n."

6:11 dabd: Is it considered good style to rebind a fn parameter in a let?

6:12 I find myself doing something like (defn f [x] (let [x* (transform x)] (g x*)....))

6:12 arcatan: i wouldn't do it, but i don't know if my clojure style is reflective of the common clojure style

6:15 clgv: dabd: that's totally fine if it is a simple way to express the functionality

6:16 dabd: one recuring pattern I noticed for a certain domain is (defn [v, ...] (let [v (ensure-vector v)] ...))

6:17 dabd: I 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

6:17 clgv: dabd: if the solution really needs to replace the value of "x" just rebind the local

6:18 dabd: in that case it also avoids errors like usin "x" instead of "x*" accidently

6:23 kandinski: I've arrived to problem 51 in 4clojure from problem 50, but it feels like I've missed a previous one

6:24 problem 51 talks about "some more sophisticated destructuring" when there's been no destructuring before

6:27 arcatan: kandinski: weirdly enough, problem 52 is called "Intro to Destructuring"

6:27 kandinski: arcatan: shuffle then

6:27 clgv: well just search for the term in the list ;)

6:28 kandinski: clgv, I meant "they must have gotten shuffled then"

6:28 clgv: yeah probably

6:28 but I do not know if the order means anything.

6:29 because simple or basic excercises got added later as well and thus have a higher number

6:29 kandinski: ah, that explains

6:29 also that would explain why the numbers aren't visible in the problem list

6:29 clgv: I'd just sort by difficulty...

6:30 kandinski: I'm letting the thread take me

6:31 which 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.

6:31 clgv: "Clojure Programming" is recommended a lot

6:31 kandinski: I know python itertools and functools well, and have a bit of experience using scheme as a scripting language

6:31 k

6:32 clgv: imho it is the most recent introductory one

6:33 kandinski: thanks

7:30 justdit: hi 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?

7:36 seriously_random: this simple unfinished function doesn't return a set, why? http://pastebin.com/1Z0VLxA9

7:38 lumafi: you're missing parentheses around "my-frequencies-helper freqs a-seq", if you want to call the my-frequencies-helper function

7:38 now it just evaluates my-frequencies-helper, freqs and a-seq in order and returns the last one, a-seq

7:38 si14: what's a "Pop without matching push" error?

7:39 in core.async

7:39 I mean

7:43 seriously_random: lumafi, I see. thanks

7:44 si14: and one more question: what's a best practice to ensure that some thread keeps looping in some function, regardless of exceptions? catch Exception e?

7:45 in 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.

7:49 justdit: si14: you can use setDefaultUncaughtExceptionHandler of the Thread class - the same as in Java

7:49 Anderkent: si14: pop without matching push sounds like an internal error, I don't think you're supposed to be able to trigger it

7:49 do you have a repro example?

7:49 si14: Anderkent: nope. it just happened in production once

7:50 Anderkent: hate those transient bugs

7:50 Anderkent: right. basically what core.async does behind the stages is save your thread state with {push,pop}-thread-bindings

7:50 pop without matching push would mean it got very confdused

7:51 si14: Anderkent: I've updated core.async version from to, maybe this will fix it

7:52 justdit: I suppose this will work with threads, but not with go-blocks, right?

7:52 Anderkent: si14: It plausibly might happen if the thread that the state machine operates on is changed?

7:53 though I'm not sure about that

7:53 depends if core.async uses Var/pushThreadBindings or their own implementation... Probably their own

7:53 si14: Anderkent: how can this happen? I can send you a piece of code that produced the error in PM.

7:53 Anderkent: I'm not sure, sorry. Mostly theorycrafting here

7:55 justdit: si14: correct. I don't think that there's Erlang like solution for this

7:55 Anderkent: ah, okay, no it shouldn't happen like that; core.async keeps track of thread frames on its own

7:55 It's plausibly completely unrelated to core.async then

7:57 si14: Anderkent: here is the trace: https://gist.github.com/si14/f8ee24e9a38ad33da17b

7:59 Anderkent: right, it's hard to say what could trigger it without processor.clj

8:00 si14: Anderkent: and here is the relevant piece of processor.clj: https://gist.github.com/si14/e7bc3c17ce3316567c03 :)

8:06 Anderkent: that 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.

8:06 si14: Anderkent: thanks a lot for your time

8:07 seriously_random: convert a set to hashmap, e.g. (set [:a "b" 3])

8:08 ddellacosta: seriously_random: today's homework? ;-)

8:08 seriously_random: did you figure out the thing yesterday, btw?

8:10 seriously_random: ddellacosta: yes, the task was actually much simpler. I overthought it.

8:10 ddellacosta: seriously_random: I know how that is...

8:10 fredyr: si14: it doesn't seem that core.async is calling pop-thread-bindings anywhere in the code

8:11 si14: the bindings being kept in the state machine are kept in an ordinary map

8:12 Anderkent: fredyr: yeah but common clojure macros expand into pop-thread-bindings which might throw this exception

8:12 fredyr: oh

8:14 CookedGryphon: Hey, 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

8:14 I miss being able to just evaluate the form

8:14 but 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

8:14 any thoughts?

8:15 is there a way to hook into the redefinitian of a var for a development workflow?

8:16 fredyr: Anderkent: are there other common macros that binding, with-bindings/* that does that?

8:16 s/that/than

8:18 Anderkent: fredyr: 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

8:18 but that's probably because it's .class files so possibly already macroexpanded

8:19 si14: CookedGryphon: you can do it with "lifecycle" idiom and "control channel"

8:20 fredyr: yeah i did that same grepping on both core.async and clojure

8:20 si14: CookedGryphon: take a look at control-c here: https://gist.github.com/si14/e7bc3c17ce3316567c03#file-processor-clj-L37

8:20 we are closing this chan to stop the loop

8:21 CookedGryphon: si14: Yeah, I can close and restart the channel, that's not my problem

8:22 the issue is that I have to do that manually

8:22 so I can't do my normal workflow of tweak code, C-M-x evaluate the form, play with the results

8:22 fredyr: Anderkent: in any case, I couldn't find any uses of those macros in core.async either

8:22 si14: CookedGryphon: I see.

8:23 CookedGryphon: i 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

8:23 Anderkent: fredyr: yeah as I said before I don't think it's core.async triggering it any more, sorry for not being clearer

8:23 as the stack trace suggests the exception comes from the start function

8:23 fredyr: Anderkent: ah right, agreed then :)

8:26 si14: Anderkent: I thought that that "start" means that the go block is located in start function, am I wrong?

8:27 fredyr: si14: Its one of the execution steps in the state machine inside the start functions causing the error

8:28 Anderkent: .. probably

8:28 :P

8:30 fredyr: otoh if it was one of the function calls, like process or check-undone, wouldn't it show up on the call stack then?

8:30 oh

8:31 with-out-str calls binding

8:31 Anderkent: if they're functions, yeah, if they're macroes they won't

8:32 fredyr: Anderkent: right

8:33 with-out-str does call pop-thread-bindings

8:33 si14: fredyr: is there any idiomatic way to avoid that binding there?

8:33 Anderkent: no, and binding in general should work in that case

8:34 * si14 I didn't find something like stacktrace-to-string. Maybe I missed something

8:34 si14: (oops, erroneous /me)

8:40 seriously_random: how to implement a base case for a recursion like this: http://pastebin.com/yBEduRfD

8:43 progo: base case is "a-map"

8:45 also: (into (hash-map) (for [k a-set] [k 0]))

8:45 Anderkent: seriously_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

8:46 si14: wow, so print-stacktrace can throw exceptions of it's own. kinda epic! https://gist.github.com/vadim-for-test/44a1af40dc3f0a4a1981

8:47 is there anything bulletproof in JVM at all?

8:47 *Clojure

8:47 seriously_random: Anderkent, nothing modifies a map in place?

8:47 Anderkent: seriously_random: that's right, clojure data structures are immutable

8:48 si14: no, anything can throw an exception; think of OutOfMemoryException for example

8:49 si14: Anderkent: OOM is another beast and at least can be monitored from outside

8:49 Anderkent: and there is nothing to be done with it, too

8:50 Anderkent: well, there's nothing to be done with a null pointer either, really.

8:50 si14: Anderkent: ignore the error and carry on?

8:50 Anderkent: except if you expect it

8:50 oh well, you can do it with an OOM too :)

8:50 si14: Anderkent: I certainly don't expect NPE from *print-stacktace*

8:50 Anderkent: neither do I, so I expect you're passing it something it doesnt like?

8:51 si14: Anderkent: caught exception?

8:51 Anderkent: does the exception have a stack trace?

8:52 hm, should if it's caught and not crafted

8:53 it really looks like if you were giving it null

8:53 si14: https://gist.github.com/vadim-for-test/44a1af40dc3f0a4a1981

8:53 how can I give it null here?

8:55 Anderkent: ah no, ok, it seems it just doesn't have a stack trace

8:55 are you on sun jvm?

8:56 seriously_random: Anderkent, sorry, but how do you recurse after you add an item to the map? http://pastebin.com/1enngf5y

8:56 Anderkent: I think there was a flag like OmitStackTraceInFastThrow in one of the jvms

8:57 seriously_random: you must pass the result of (assoc cur-map key value) to the recur call

8:57 seriously_random: i.e. (if (empty? a-set) a-map (recur (assoc a-map (first a-set) 0) (rest a-set)))

8:58 seriously_random: Anderkent, thanks

8:58 Anderkent: si14: http://jawspeak.com/2010/05/26/hotspot-caused-exceptions-to-lose-their-stack-traces-in-production-and-the-fix/

8:58 2010 though, so not sure if up to date

8:59 it'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

9:00 si14: Anderkent: ok, thank you

9:23 stuartsierra: `pst` probably tries to do too much.

9:24 mdrogalis: West coast doesn't sleep, stuartsierra.

9:24 stuartsierra: mdrogalis: huh?

9:24 mdrogalis: stuartsierra: PST.

9:24 It was a joke. :(

9:24 stuartsierra: oh, I see :)

9:25 mdrogalis: Tuesday morning humor.

9:28 si14: wow. Arctic Sunrise members will give a public meeting in my city (Saint-Petersburg).

9:55 jcromartie: somebody remind me of the difference between clojure.lang.IPersistentMap and clojure.lang.APersistentMap again

9:55 one is the protocol interface and one is the old-school interface, right?

9:56 which is better to use for dispatch

9:56 stuartsierra: Neither is a protoc.l

9:56 *protocol

9:56 IPersistentMap is a Java interface.

9:56 APersistentMap is a Java abstract base class.

9:56 jcromartie: alright, better to dispatch on the interface of course

9:56 OK thanks

9:57 stuartsierra: It 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.

9:59 jcromartie: yeah 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

9:59 sets, maps, vectors

10:00 stuartsierra: That's usually how I do it.

10:00 jcromartie: and where I'm implementing it for fns I obviously don't want the IFn interface

10:00 since maps and sets implement it

10:00 and vectors!

10:00 philandstuff: don't forget PersistentQueue

10:00 stuartsierra: Examining the class hierarchies is helpful here: https://github.com/stuartsierra/class-diagram

10:00 jcromartie: ah yes :)

10:01 oh, beautiful

10:02 gvickers: Hey I am having trouble conceptually with reify, does it literally instantiate an object implementing whatever interface i am reify-ing?

10:03 joegallo: stuartsierra: that's pretty dang neat

10:03 stuartsierra: joegallo: thanks

10:03 I wrote it specifically to help me figure out which classes I needed to extend to work with Clojure's built-in data structures. :)

10:04 joegallo: all of the classes

10:04 stuartsierra: fortunately, no :)

10:09 gvickers: yes

10:09 gvickers: `reify` generates an anonymous class implementing the interfaces you specify, then constructs an instance of that object.

10:15 gvickers: stuartsierra: 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:16 stuartsierra: gvickers: `reify` is often useful for callback interfaces.

10:16 gvickers: stuartsierra: thanks!

10:16 stuartsierra: If you need to inherit from a *class* instead of an interface, then `reify` is insufficient and you have to use `proxy`

10:22 philandstuff: http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/ attempts to help choose

10:23 gvickers: philandstuff: wow very cool

11:04 rkneufeld: Just 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:05 mdrogalis: Much needed. Thanks rkneufeld.

11:12 coventry: I'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:20 rukor: Coventry: are you able to get connections using plain old jdbc?

11:21 coventry: rukor: Is there a quick way to test that, given a uri like postgres://coventry@localhost:5432/dbname?

11:22 rukor: Oh, I'll crib from the "example usage" section of the jdbc readme.

11:25 rukor: Yes. (DriverManager/get connection uri)

11:26 getConnection

11:26 java.sql.DriverManager

11:28 coventry: Hmm, 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:36 rukor: You 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:37 Is it exactly the same settings you tried?

11:42 coventry: In 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:44 Hmm, the dbspec from the project works unmodified in the example...

11:58 CaptainLex: If I need to add cljs to an extant clj project, how should I structure the directory?

11:59 technomancy: CaptainLex: 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:00 rukor: coventry: 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:00 CaptainLex: technomancy: 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:02 rukor: coventry: also ensure the driver is in the class path.

12:02 CaptainLex: technomancy: to the project root or the src root? Does cljs-build just find .cjls files where they are?

12:04 pbostrom: CaptainLex: you specify the location of your cljs files to cljsbuild in your project.clj file

12:04 technomancy: cljsbuild doesn't do much without a lot of spoon-feeding afaict

12:04 not that I've used it personally

12:04 CaptainLex: pbostrom && technomancy: Thanks! I

12:11 coventry: rukor: Thanks for the suggestions.

12:27 seangrove: Definitely would like to see much more static analysis for cljs, much like what Chas suggested on the ml

12:34 modulus: So guys, when using korma.db's defdb sqlite3 helper, what's the default path for the database file?

12:35 and does it vary when running the project or from repl?

12:39 luxbock: https://gist.github.com/luxbock/dc84ef7d4a34f80c6af9

12:39 why does this not work?

12:44 amalloy: &(re-matches #"\d+" "abc")

12:44 lazybot: ⇒ nil

12:44 amalloy: &(re-matches #"\d+" "123")

12:44 lazybot: ⇒ "123"

12:44 amalloy: &(true? "123")

12:44 lazybot: ⇒ false

12:44 luxbock: ah yeah just realized I need to use `boolean` instead of true?

12:45 amalloy: luxbock: just don't use anything

12:45 S11001001: luxbock: you also don't need the partial; just use the re from the enclosing environment

12:45 amalloy: and using complement on a lambda is pretty weird

12:45 S11001001: (fn [f] (fn [x] (f x) #_(<<- perfectly legal)))

12:45 amalloy: just put a (not ...) inside the lambda

12:46 luxbock: hmm yeah I guess I was overthinking this

12:49 TimMc: For that matter, you can swap the filter + not for a remove.

12:50 clgv: how 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:50 logic_prog: is there a pure clojure / pure java solution for pdf ->png ? (i.e. something like ghostscript, but only requires jvm)

12:51 clgv: in CL (e.g. SBCL) I could return the 3 values from the function efficiently without packing and unpacking

12:51 logic_prog: i'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:51 clgv: logic_prog: maybe itext has some function for that?

12:52 `cbp: clgv: wat

12:52 why do you need to pack/unpack? just pass them as arguments

12:52 aka I don't understand your problem

12:54 clgv: Imagine (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:56 I could probably try to do some macro wizardry there. but the question is whats the simplest approach

12:56 amalloy: if 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 `cbp: Oh, well uhm yes that's unfortunately how you pack values in clojure

12:57 you can use a java array if it bothers you too much I guess?

12:57 It's what I do when I wanna pack values in java

12:57 clgv: amalloy: I researched it as deeps as I could and it seems that it is really operating on the stack in the internal implementtion

12:58 seangrove: bitemyapp: You around to help with a korma connection problem?

13:00 clgv: I probably want a macro: (defn-awesome mystep [FLIP recur] [x y z] (let [x* ..., y* ..., z* ....] (FLIP x, y, z))

13:00 amalloy: i think you probably want a function, and to not worry so much about the "expense" of building a 3-tuple

13:00 `cbp: why not just a global java array that the function mutates if you want it to be fast

13:01 clgv: amalloy: no. I know from measuring that this code is the hotspot of the algorithm ;)

13:01 amalloy: `cbp: i'm sorry to tell you you just got voted out of #clojure for suggesting the strtok algorithm

13:01 `cbp: :(

13:01 amalloy: well, not strtok, because it reuses that global as input. there's some other c function that has a global output buffer, though

13:02 anyway, it has the serious serious problem of being totally unusable with multiple threads

13:02 and not reentrant at all

13:03 clgv: amalloy: isnt it a c static in the function instead of a global variable? which doesnt change the implications you just mentioned ;)

13:04 is there some codewalking functionality which allows replacement of symbols?

13:04 amalloy: clgv: clojure.tools.macro/symbol-macrolet

13:05 clgv: amalloy: symbol-macrolet preserves clojure's special forms?

13:06 in contrast to macrolet?

13:06 amalloy: uhhhh?

13:06 clgv: amalloy: ok rephrased: why symbol-macrolet and not macrolet?

13:06 amalloy: because...you wanted to replace a single symbol, it sounded like

13:07 clgv: yeah, ok. ah the second one is for general local macros

13:08 the readme could use an update with respect to the current version^^

13:12 amalloy: works as intended. thank you for that pointer

13:16 TimMc: clgv: I think ztellman has a clj-tuple lib that might be pretty fast.

13:18 clgv: TimMc: 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:19 I 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:39 jcromartie: why hasn't clojure.lang.PersistentQueue been exposed via Clojure functions yet? is it considered "private" or maybe even deprecated

13:40 technomancy: it's an easter egg!

13:40 clgv: technomancy: :P

13:44 jcromartie: the point-free style is flowing in me right now

13:47 dabd: I am learning to use instaparse. Great library!

13:48 bitemyapp: seangrove: I can try.

13:48 dabd: Is it possible to add dependencies to project.clj without quitting your repl?

13:48 CaptainLex: I must be very thick. How do I clone a DOM element using dommy?

13:49 technomancy: dabd: check out alembic

13:49 bitemyapp: dabd: keep in mind that Instaparse is part of a family of parsing libraries. GLL-based parser combinators.

13:50 noprompt: bitemyapp: haskell has irritating syntax.

13:50 bitemyapp: i want to like this language. i really do.

13:50 CaptainLex: Infix notation makes me :(

13:50 dabd: technomancy: ty

13:51 bitemyapp: ty for the warning but I am parsing simple files.

13:51 seangrove: technomancy: That used to be a pretty good cocktail place on haight. Not so much anymore :P

13:52 bitemyapp: dabd: 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:52 noprompt: I disregarded syntax when I was teaching Clojure, I do the same with Haskell.

13:52 noprompt: it just doesn't matter.

13:52 noprompt: at least use Haskell long enough to come up with a less petty complaint >:P

13:53 it's equally petty to complain about S-exprs :)

13:54 dabd: I 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:55 noprompt: bitemyapp: not really. the benefits of haskell's type system are obvious.

13:55 justin_smith: what is the best option for clojure client-side http ssl?

13:56 bitemyapp: noprompt: you could go full unabomber and be the only dude writing S-expr Haskell.

13:56 coventry: bitemyapp: I'd be grateful for any suggestions you have for debugging this korma connection issue. http://clojure-log.n01se.net/#11:12

13:56 noprompt: bitemyapp: between a ParseError and an UnexpectedEOF (Lisp), i'll take the latter any day.

13:56 bitemyapp: justin_smith: clj-http.

13:56 tim___: (inc noprompt)

13:56 lazybot: ⇒ 2

13:56 bitemyapp: coventry: I'll need the URI and the code.

13:57 noprompt: I've not actually seen somebody stumble that much over it.

13:57 noprompt: I still think you should move it over to #haskell so we can spam the people here less.

13:58 noprompt: bitemyapp: what am i gonna say? "i don't like the syntax. wha, wha, wha, ;_;"

13:58 coventry: bitemyapp: Makes sense, but it's closed source. I'll muddle along for now, see whether the owner would be OK with sharing.

13:58 noprompt: :|

13:58 bitemyapp: but i will stop spamming this channel.

13:58 justin_smith: bitemyapp: I didn't express that clearly enough: I want a clojure http server but client-side ssl

13:58 coventry: bitemyapp: Thanks for taking a look, though.

13:59 bitemyapp: justin_smith: you're not explaining this well.

13:59 justin_smith: http://pilif.github.io/2008/05/why-is-nobody-using-ssl-client-certificates/

13:59 bitemyapp: coventry: 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:59 justin_smith: bitemyapp: ^^ above link

13:59 bitemyapp: justin_smith: I don't even know what that is. good luck.

14:00 * bitemyapp goes back to fucking with parsers in Python and being angry

14:01 coventry: bitemyapp: 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:01 justin_smith: bitemyapp: 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 `cbp: python is the shortest path to hell

14:01 technomancy: client certs are amazing

14:02 justin_smith: technomancy: I think so too - do you have any leads on using them with a clojure stack?

14:02 edw: I'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:02 bitemyapp: coventry: I don't repro other peoples' problems de novo for free. refheap or I can't do anything.

14:02 technomancy: justin_smith: no, my web experience is very limited

14:02 bitemyapp: coventry: 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:02 `cbp: slip-n-slide.

14:03 coventry: bitemyapp: I'm the one who should apologize for not being able to give more info. Thanks for the suggestion.

14:03 bitemyapp: coventry: 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:03 I can almost guarantee they don't give a fuck about some database connection code.

14:04 it'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:05 coventry: http://stackoverflow.com/questions/13175655/trouble-connecting-to-postgresql-db-on-heroku-with-korma-clojure

14:05 https://github.com/korma/Korma/issues/14

14:05 https://groups.google.com/forum/#!topic/clojure/n6RT_5pUtc4

14:05 coventry: it wasn't any of those things ^^ ?

14:05 coventry: what version of Korma?

14:10 coventry: It'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:11 bitemyapp: why is the cognicast episode about Lacan?

14:11 dnolen: noprompt: secretary is your lib right? I ended up using it in my Om TodoMVC, works as advertised.

14:13 algal: justin_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:14 justin_smith: algal: I am much earlier in the research than that even :)

14:14 just figuring out how it would integrate with my ring library

14:14 noprompt: dnolen: it's actually gf3's lib, but i'm a contributor. :-)

14:14 justin_smith: algal: I have a usecase that looks like a good match for client-side ssl certs

14:14 dnolen: noprompt: I just hooked into goog.History is that what you do?

14:15 noprompt: dnolen: that's what i've done.

14:16 dnolen: patches are certainly welcome if you find faults with it.

14:16 dnolen: noprompt: nah, I just needed a router and I didn't want to integrate some random JS thing

14:16 noprompt: secretary + goog.History works great

14:18 bitemyapp: justin_smith: the way we secure this sort of thing is via VPNs.

14:18 algal: justin_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:19 clgv: justin_smith: I am using client side ssl certificates for a computation service implemented in clojure

14:20 justin_smith: do you need info how to set this up on the jvm?

14:21 justin_smith: clgv: looking for an overview of using this with ring

14:21 algal: exactly!

14:21 algal: clgv: Me too.

14:21 rkneufeld: bitemyapp: I think it just came up (or Maggie wanted to talk abou tit)

14:22 clgv: justin_smith: oh ok. I am using it with RMI. probably you can try to sneak your own SSlContext into jetty

14:22 justin_smith: I would prefer something general, and if anything backend-specific http-kit

14:22 clgv: justin_smith: the important java bits are (javax.net.ssl SSLContext KeyManagerFactory TrustManagerFactory) and java.security.KeyStore

14:23 justin_smith: clgv: cool

14:23 bitemyapp: rkneufeld: is there some connection to software I'm missing here?

14:24 justin_smith: clgv: 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:24 clgv: justin_smith: gotta go. but I think you can find the relevant documentation with these classnames. otherwise ask again tomorrow ^^

14:24 rkneufeld: bitemyapp: Maggie's a PM here at cognitect and is very interested in psychology and philosophy

14:24 tbaldridge: bitemyapp: the Cognicast is a podcast about Cognitect. Not always about software/programming.

14:24 justin_smith: clgv: thanks again

14:25 algal: justin_smith: I've assumed this would be relatively straightforward but a little googing now shows that it is not.

14:25 justin_smith: There is nothing obvious showing how to use SSL client certs to authenticate clients from a server-side clojure code.

14:26 bitemyapp: rkneufeld: I'm interested in psychology and philosophy too, that's why the Lacan is o_O

14:26 algal: justin_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:26 edw: Has anything changed in lein since 2.1.x that would make log4j's behavior change i.e. be quieter?

14:26 justin_smith: algal: 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:26 algal: jynx!

14:27 algal: justin_smith: Yeah, one of us should do it. I expect I'll be tacking this sometime this month, but not sure.

14:27 justin_smith: Seems like the main complexity is just finding the right bits of Java API to wrap.

14:27 edw: We 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:27 justin_smith: well I'll keep in touch via this channel as I make progress, if nothing else

14:28 edw: do not use lein on a server

14:28 algal: justin_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:28 justin_smith: edw: send up an uberjar and run that

14:28 bitemyapp: edw: do not use lein on a server you care about

14:28 lein is a build tool, not a server runtime.

14:29 edw: You hear that, guys from Heroku?

14:29 justin_smith: algal: cool, maybe it is super simple and I just need a blog post so others can see immediately how easy it is

14:29 bitemyapp: edw: if by, "guys from Heroku", you mean the guy that wrote Leiningen, I'm sure he does.

14:29 edw: justin_smith, bitemyapp: We're running a server locally on someone's desktop.

14:29 Heroku uses lein to run apps.

14:29 bitemyapp: edw: okay? so add logging to your application.

14:29 "Hey, I started up!"

14:30 (t/info ...)

14:30 algal: justin_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:30 bitemyapp: edw: thanks, I know that. But that's just one build-pack.

14:30 edw: bitemy 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:31 technomancy: edw: the docs have been updated to recommend uberjars over lein run actually

14:31 bitemyapp: ^^ lol.

14:31 technomancy: the default is still lein run because we cant' break backwards compat

14:31 justin_smith: algal: alongside my plans for client-side ssl is friend integration of the app, so I will likely pull these threads together, thanks

14:31 edw: bitemyapp: Care to stop being an asshole?

14:31 bitemyapp: edw: 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:31 loliveira: hi, how do I make .getBytes accessible inside comp? ((comp count .getBytes) "test")

14:31 bitemyapp: edw: no.

14:32 edw: this is a previously established universal constant. Such as, "Clojure is awesome" and "bitemyapp brooks no fools"

14:32 edw: technomancy: When was this change in recommendations made?

14:32 technomancy: edw: some time over the summer I think

14:33 edw: Ah, our last new app was first deployed in April or so.

14:34 technomancy: it's unfortunate that the original recommendation lasted as long as it did

14:34 edw: Our new-to-Clojure folks generally read through the Heroku docs; I figured they would've noticed.

14:34 technomancy: I mean you can do it, there are just way more subtle ways to get it wrong

14:34 bitemyapp: ~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:34 clojurebot: 'Sea, mhuise.

14:35 edw: Actually, that's awesome; that solves our long-term problem building using private repos.

14:35 bitemyapp: ~catfacts is A cat's brain is more similar to a man's brain than that of a dog.

14:35 clojurebot: In Ordnung

14:35 bitemyapp: ~catfacts is Cats dislike citrus scent.

14:35 clojurebot: You don't have to tell me twice.

14:35 bitemyapp: stashin' those for later...

14:35 algal: justin_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:35 justin_smith: algal: awesome, thanks

14:35 bitemyapp: ~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:35 clojurebot: Roger.

14:37 jcromartie: bitemyapp: are you being ironic?

14:38 bitemyapp: jcromartie: I'm mostly convinced nihilism makes people more effective and productive.

14:39 mdrogalis: First few minutes of Maggie's Cognicast. Pretty awesome stuff.

14:39 edw: technomancy: So, to be precise, one is still using lein, but we should specifiy an :uberjar-name key in project.clj?

14:39 technomancy: And change our Procfile?

14:40 technomancy: edw: right; that will let you skip lein at runtime, resulting in faster app boot and smaller slugs

14:40 lein will still be available in interactive sessions, but it'll be downloaded on-demand

14:40 bitemyapp: I should make up unfalsifiable hypotheses about human nature and propagate it among the pseudo-educated.

14:40 edw: technomancy: OK, cool.

14:41 bitemyapp: maybe I could convince some yuppies to give me money or something. That's what Kickstarter is for right?

14:42 edw: technomancy: That should be a pretty easy migration. Even for a pseudo-educated yuppie.

14:42 algal: bitemyapp: aren't yuppies an 80s phenomenon? Like hippies from the 60s? We're all yuppies/hippies/bobos/hipsters now.

14:42 TimMc: bobos, that's a new one for me

14:42 bitemyapp: algal: I didn't say I wasn't a self-loathing yuppie.

14:43 technomancy: edw: yeah maybe we should have a section in the docs for switching rather than just documenting it for new apps

14:43 bitemyapp: algal: I try to hold onto some semblance of my blue collar credentials though. Not having a degree helps.

14:43 the banana republic compromises my purity though.

14:43 algal: TimMc: Bobos = bohemian bourgeois. good book, actually: http://www.amazon.com/Bobos-In-Paradise-Upper-Class/dp/0684853787

14:43 bitemyapp: I don't say you weren't a self-loathing yuppie! In fact, I sort of assume it. :)

14:44 edw: technomancy: I usually stare at the deploys (the compiles sometime time out); have you considered printing a deprecation notice during deploy?

14:44 bitemyapp: algal: uhm, sorta. I come from poor peeps and couldn't afford to go to school.

14:44 algal: I'm still in the "burn the urban middle upper class for the warmth and light" camp.

14:45 technomancy: edw: wellll... for folks that already have it working with lein run I'm inclined to say don't fix what ain't broke

14:45 dsevilla: Guys, 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:45 Do you know if this is the expected behavior?

14:46 edw: technomancy: Well based on feedback here...

14:46 * edw rolls eyes.

14:46 bitemyapp: yeah, roll your eyes. See if that helps you waste less time.

14:47 edw: technomancy: But seriously, if it puts less of a load on your infrastructure, I'd do it just to be a good citizen.

14:47 logic_prog_: why is intellij so popular

14:47 bitemyapp: logic_prog_: most people/programmers are muggles.

14:47 technomancy: edw: a lighter-weight slug is just as good for users as for us

14:48 logic_prog_: stallman = dumbledore?

14:48 bitemyapp: ouf.

14:48 edw: technomancy: I always forget what the maximum slug size is, and as I see ours creep higher, I get nervous.

14:48 algal: logic_prog: This is a fun game. Slytherin house == ?

14:49 logic_prog_: hmm

14:49 so it needs to be evil, but also efficient

14:49 C++

14:49 technomancy: edw: we've boosted it to 300 since we started recommending including the jdk in the slug

14:50 algal: bitemyapp: 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:50 bitemyapp: algal: me gusta.

14:51 edw: technomancy: Thanks for the info. I'll do a test deploy and see how it goes.

14:55 algal: justin_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:00 edw: It just occured to me: we're over ten years into Eternal September.

15:00 ToxicFrog: Eternal September?

15:00 edw: I mean twenty years. Whoa!

15:01 ToxicFrog: It's an old USENET thing.

15:01 danielszmulewicz: Happy mood tonight.

15:01 CaptainLex: edw: I was gonna say, ten years is a bit of an understatement!

15:01 danielszmulewicz: On the channel.

15:01 Nice.

15:10 I 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:11 jcromartie: JVM does use a lot of memory, relatively speaking. But a lot of that may be GC'ed.

15:12 tbaldridge: danielszmulewicz: 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:14 danielszmulewicz: tbaldridge and jcromartie: Thanks. That's nice to know. But roughly speaking, how many JVM instances can I reasonably run on a small VPS?

15:14 tbaldridge: danielszmulewicz: it depends highly on what your app is doing.

15:14 technomancy: you mean how many hello worlds?

15:14 danielszmulewicz: technomancy: yes

15:14 SegFaultAX: Probably a lot.

15:14 technomancy: "hellos world"

15:14 danielszmulewicz: tbaldridge: Understood.

15:15 SegFaultAX: danielszmulewicz: Why do you care about such a useless benchmark?

15:15 jcromartie: SegFaultAX: no need to get snappy

15:15 technomancy: I don't know what the answer is, but I can't imagine it being remotely relevant

15:15 SegFaultAX: jcromartie: I'm not, it's an honest question.

15:15 jcromartie: ok

15:16 danielszmulewicz: I think so. A bit constrained, admittebly.

15:17 SegFaultAX: danielszmulewicz: If you really care to find out, why not just try it?

15:18 danielszmulewicz: But 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:18 SegFaultAX: danielszmulewicz: Correct.

15:18 Unless you're running multiple tomcats, too. Which is possible.

15:21 danielszmulewicz: OK. 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:24 danielglauser: I don't think there is a "best practice" here because there are way too many variables.

15:24 SegFaultAX: danielszmulewicz: I mean that really depends.

15:24 hiredman: it 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:25 danielszmulewicz: I mean, jar deployment is easy and immediate. Tomcat introduces another layer. Does it pay off immediately?

15:25 SegFaultAX: Well WAR files can be deployed to a hell of a lot of stuff.

15:25 hiredman: danielszmulewicz: do you want to use tomcat for some reason?

15:25 SegFaultAX: Tomcat, jboss, elastic beanstalk, heroku, etc. etc.

15:25 danielszmulewicz: hiredman: to save the cost of multiple JVM instances.

15:26 SegFaultAX: danielszmulewicz: Have you done any actual profiling of your application or are you just guessing?

15:26 danielszmulewicz: If you're just getting started, go with embedded jetty. It's easy to deploy and maintain.

15:26 danielszmulewicz: SegFaultAX: Just guessing.

15:26 amalloy: danielszmulewicz: 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:26 SegFaultAX: If 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:26 But don't do it in the absence of data.

15:27 hiredman: danielszmulewicz: I would start with jetty then

15:27 danielszmulewicz: SegFaultAX: 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:27 jar

15:27 hiredman: danielszmulewicz: you can build war files and have jetty serve up multiple wars with almost no configuration (everything passed as command line arguments)

15:27 SegFaultAX: danielszmulewicz: Nah, just keep them embedded until the overhead is enough to warrant it.

15:28 That's true, you could totally use jetty as a multi-tenant application container itself if you wanted to.

15:28 danielglauser: hiredman: +1

15:29 danielszmulewicz: Oh, that's intriguing.

15:29 SegFaultAX: danielszmulewicz: For the record, you might also check out immutant.

15:29 JBoss AS 7 for Clojure.

15:29 (If full stack deployment is what you're after)

15:29 danielszmulewicz: Immutant is huge, and I don't need it those behemoths. I want to keep it simple.

15:30 SegFaultAX: What 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:30 I don't use JBoss, but if you're considering application containers, it's an option.

15:31 danielszmulewicz: I'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:31 I have ring apps that talk to datomic. And I want to run multiple apps on a 1GB VPS. That's my story.

15:31 dsevilla: Guys, just a question. I've seen already that Counterclockwise does not complete java method or classes in imports

15:32 the question is what configuration is the best for working with legacy Java libraries with Clojure?

15:32 that facilitates, for example, automatically importing a class you use in the current namespace

15:34 danielszmulewicz: I thought Tomcat made sense. Not a full blown application server. Small and lean. Good for multi-tenancy.

15:34 gf3: dnolen: So glad to hear that secretary worked out for you :)

15:34 dnolen: gf3: yes simple and nice

15:35 danielszmulewicz: gf3: I'm next in line. I need a client-side routing solution.

15:35 gf3: danielszmulewicz: Well hopefully you'll find it useful, it's pretty simple

15:36 I'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:36 danielszmulewicz: I glanced at the github page today. I was wondering if there was more sample code somewhere.

15:38 noncom: is 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:38 gf3: danielszmulewicz: Sure, sec'

15:39 danielszmulewicz: gf3: thanks.

15:39 gf3: danielszmulewicz: https://gist.github.com/noprompt/6775563

15:40 danielszmulewicz: noncom: start-nrepl-server in your app.

15:40 gf3: danielszmulewicz: 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:40 danielszmulewicz: gf3: oh, thank you, I'll be looking and learning.

15:43 gf3: 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:44 gf3: danielszmulewicz: Sure—it's useful as long as you'd like to respond to routes/URLs on the client side

15:45 danielszmulewicz: And it's not particularly expensive or large

15:45 danielszmulewicz: so routes can be mapped to URLS. That's what I want.

15:45 gf3: danielszmulewicz: Yes exactly

15:45 danielszmulewicz: Very cool.

15:45 gf3: danielszmulewicz: They alternative on the client-side is setting up event listeners for all the DOM elements you care about

15:46 danielszmulewicz: But that kind of close-coupling can get messy and is hard to maintain on a large scale

15:46 danielszmulewicz: Yes, I was struggling with that.

15:48 gf3: the example on the readme shows the dispatch function. That would be manual.

15:48 gf3: How do I map the routes to URLS?

15:49 gf3: danielszmulewicz: The easiest and probably most common way is to use goog.History, like in the examples

15:49 danielszmulewicz: gf3: OK, understood.

15:49 gf3: danielszmulewicz: This is probably the most succinct example: https://gist.github.com/noprompt/6775563

15:52 danielszmulewicz: gf3: That's exactly what I need. Thanks a bunch.

15:52 gf3: danielszmulewicz: NP

15:52 danielszmulewicz: The other example, although messy and out of date, shows a bit more functionality like checking click events and seeing if routes match

15:52 danielszmulewicz: gf3: Not that it matters, but this is where I'm going to use it: http://videos.tuppu.net/user/17592186045424

15:53 gf3: If you like world music, consider yourself served.

15:53 gf3: danielszmulewicz: oh cool, send me a link when you're done, I'd love to see

15:54 danielszmulewicz: gf3: Cool.

15:54 edw: technomancy: Good news: Slug shrank by 23MB for my guinea pig app.

16:05 devinus: does anybody know what happened to (def newsletter) ?

16:07 `cbp: fml homebrew effed everything. Never again

16:09 seubert: how..

16:09 homebrew doesn't mess with your other stuff

16:11 `cbp: Idk, some dylibs cant be found now, xcode crashes

16:26 SegFaultAX: `cbp: That happened to me yesterday.

16:26 Although in my case it wasn't necessarily homebrew's fault.

16:27 It upgraded zsh for me from 4.x to 5.x and 5.x is /completely/ broken.

16:28 Or it borked the install somehow and broke it, I'm not sure which.

16:30 danielszmulewicz: gf3: The token returned by the History is always the empty string. I must be doing something wrong.

16:30 goog.history.Event {type: "navigate", target: goog.History, currentTarget: goog.History, token: "", isNavigation: falseÉ}

16:31 coventry: What'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:32 That gives me the error "PSQLException The column index is out of range: 2, number of columns: 1"

16:32 dnolen: danielszmulewicz: http://github.com/swannodette/todomvc/blob/gh-pages/labs/architecture-examples/om/src/todomvc/app.cljs#L20

16:37 bitemyapp: arrdem: DayZ came out.

16:39 noprompt is a hero, fighting the good fight.

16:40 noprompt: haha. zero is a value!

16:40 danielszmulewicz: dnolen: Thank you indeed.

16:40 gf3: noprompt: wb

16:40 danielszmulewicz: That shouldn't be

16:42 noprompt: gf3: wassup?

16:43 gf3: noprompt: Nadda

16:43 noprompt: I'm thinking I might add a goog.History example to the secretary readme

16:44 noprompt: gf3: i think i may still have a gist.

16:44 gf3: noprompt: ja i just used it an hour ago

16:44 noprompt: gf3: https://gist.github.com/noprompt/6775563

16:44 oh, kk

16:44 bitemyapp: gf3: !!!

16:45 gf3: w/b!

16:45 gf3: THX U

16:45 bitemyapp: `cbp: how have you been?

16:45 gf3: and you? ^^

16:45 gf3: bitemyapp: I moved back to EST

16:45 Last week

16:45 With my cat

16:45 That was "fun"

16:45 bitemyapp: gf3: hawdamn. Mtl?

16:45 gf3: bitemyapp: Torononto

16:46 bitemyapp: gf3: cool, been there 3 or 5 times. I miss the jerk chicken.

16:46 gf3: the jerk chickens miss you, chris

16:46 bitemyapp: gf3: I can only hope. What inspired the geographical shift?

16:46 gf3: also people were loving on secretary earlier.

16:47 gf3: bitemyapp: Just family and junk

16:47 bitemyapp: Still working for MetaLab for the moment though

16:47 remote lyf

16:48 bitemyapp: gf3: I'm trying to go remote myself. Considering Seattle and Austin so I can escape the land of VC and $1.5mm houses.

16:48 * technomancy does the secret remote handshake

16:49 * gf3 goes to shake technomancy's hand but misses by two timezones

16:49 hiredman: syn/ack

16:49 gf3: bitemyapp: Those are both nice places

16:49 hiredman: You can't ack your own syn

16:50 hiredman: That's like ponging your own ping

16:50 hiredman: gf3: sure, I am just saying, that is the remote handshake

16:50 gf3: it's gotta be two ways

16:50 worst multiplayer

16:52 rovar: anyone here tackled webgl + cljs?

16:52 I'm looking for strategies for managing shaders / shader/files.

16:54 just me?

16:54 :(

16:56 akhudek: hmm, ndarray-double in core.matrix seems to not work for even 100k element vectors

16:56 by not work, I mean trying to fill it with random values never finishes

16:57 at least not in any reasonable time

16:57 hiredman: akhudek: what jvm heap size?

16:57 akhudek: 10gb

16:57 hiredman: heh

16:58 how long have you waited for a gc to complete on a 10gb heap?

16:58 akhudek: sorry, it's only 6gb right now

16:58 gc isn't usually too bad

17:03 bitemyapp: rovar: I'm too faithless to attempt that. Good luck and awesome of you to explore that though :)

17:04 rovar: bitemyapp: there is this: https://github.com/Asakeron/cljs-webgl which seems clean and frequently updated

17:05 my problem is that I need to include script tags full of OpenCL code

17:05 and anything I do just seems yucky. There is a way to load the files from the server, but not as src= attributes.

17:06 because they're not really scripts...

17:06 so I'm thinking about writing a cljs util to fetch these files from the server..

17:06 but then I think I'm too far off into yak shaving field

17:16 vijaykiran: dnolen: the example on https://github.com/swannodette/om seems to be broken - dom/component => om/component and extra )

17:20 zerokarmaleft: dnolen: oh man, om+core.async is slick

17:21 dnolen: vijaykiran: fixing

17:21 zerokarmaleft: there are some things to figure there but yes I think it will be cool

17:24 `cbp: bitemyapp: hey

17:25 bitemyapp: 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:27 justin_smith: rovar: 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:27 rovar: provides incremental interactive completion of buffer name substrings

17:27 rovar: justin_smith: I will check it out

17:27 bitemyapp: `cbp: jfc. You are a hero.

17:29 `cbp: I know right, i shouldve just picked effing java

17:29 bitemyapp: `cbp: 4rlz.

17:29 `cbp: https://www.refheap.com/22002

17:30 `cbp: :-)

17:31 bitemyapp: `cbp: just wanted a test that was supposed to produce error output to stfu.

17:32 rovar: justin_smith: hmm.. it doesn't appear to update its index..

17:33 justin_smith: rovar: update its index?

17:33 rovar: for autocompletion..

17:33 i'm assuming it's using a trie or a suffix tree or somesuch

17:33 but it just says "dummy" but if I type the entire filename it still switches buffers.

17:34 justin_smith: you type a substring or subset of characters

17:34 rovar: sure.. the only option is [dummy] regardless of what I type :)

17:34 I also just reloaded init.el

17:34 I might need to bring er down

17:34 justin_smith: hmm - how are you running it?

17:35 M-x iswitchb-buffer seems to be the command for direct access

17:35 I just have C-x b bound to that

17:35 rovar: (iswitchb-mode 1)

17:35 justin_smith: and then what happens when you do C-x b

17:36 rovar: C-x b brings up iswitch

17:36 justin_smith: and that is not completing properly?

17:36 bitemyapp: `cbp: been doing Haskell with a couple of coworkers and noprompt.

17:36 rovar: it looks like it wants to be doing the right thing..

17:37 when I do C-x b, it brings up iswitch

17:37 arrdem: tools.nrepl +1 now we just need a way to dump nrepl defined symbols to a file :P

17:37 justin_smith: rovar: try M-x ido-swtich-buffer

17:37 `cbp: bitemyapp: apparently homebrew fked up everything and now i can't start ghci because of some missing dylibs which are not actually missing :P

17:37 * arrdem realizes he was 8 hrs back up the scrllbakc and feels silly

17:37 rovar: and the line at the bottom reads: iswitch [dummy] [no match]

17:38 justin_smith: weird

17:38 rovar: which before it would at least give me a useful list..

17:38 justin_smith: yeah, try it in a fresh emacs instance

17:38 could be your elisp got in a weird state

17:38 bitemyapp: `cbp: don't use homebrew!

17:38 rovar: that is a fresh instance

17:38 bitemyapp: `cbp: just install Haskell platform for OS X.

17:38 arrdem: DayZ.

17:39 `cbp: then upgrade to Cabal 1.18 so you have sandboxes.

17:39 rovar: so ido-switch-buffer seems to offer a reasonable behavior

17:39 arrdem: bitemyapp: lolwhyarma

17:39 rovar: but I think that's what I already had..

17:39 `cbp: bitemyapp: yeah i installed that and after that i installed homebrew and im all regrets now

17:39 bitemyapp: arrdem: the standalone game came out.

17:39 arrdem: ook

17:39 bitemyapp: alpher.

17:39 arrdem: you don't like? :(

17:39 arrdem: I think you mean the first build that guy was able to kick out, not alpher

17:39 bitemyapp: arrdem: worked fine for me last night. I'm about halfway to NW airfield.

17:40 arrdem: it's a great game to play with other people.

17:40 arrdem: bitemyapp: I may check it out. arma/dayz isn't something I ever got into

17:40 bitemyapp: `cbp: uninstall and unlink the haskell stuff from homebrew and just use platform :(

17:40 arrdem: in the meantime, m0ar dotaz

17:40 bitemyapp: arrdem: uh, I didn't like vanilla ArmA nearly as much. DayZ is a lot more fun and 10x as much with friends.

17:40 arrdem: what if I bought you the alpher for Christmas?

17:41 kandinski: yay, OT time

17:41 arrdem: bitemyapp: then you would compell me to actually do something for people for christmas, and I may actually play the alpher

17:42 bitemyapp: arrdem: buying it tonight when I get home.

17:43 arrdem: send to the steam account I have on my friends list right?

17:43 arrdem: bitemyapp: ofc

17:44 bitemyapp: kk

17:44 arrdem: fine I'll do some haskell after this game, thaks for making me feel unproductive :P

17:44 justin_smith: rovar: looking at my own config, it looks like I have both iswitchb and ido turned on, it may be ido is needed

17:45 rovar: justin_smith: I have (ido-mode t)

17:46 justin_smith: you know, with iswitch commented out, and just ido-mode t, I think I get the behavior that iswitch advertises

17:46 I can type any part of the name of the file to which I want to switch and it selects it

17:46 justin_smith: rovar: cool, ido may be a superset actually

17:47 rovar: when their enabled at the same time they appear to dislike one another.

17:47 justin_smith: ahh ok

17:48 rovar: wow.. even the arrow keys work as described in

17:48 http://www.emacswiki.org/emacs/IswitchBuffers

17:48 bitemyapp: iswitchb is the stuff. <3

17:48 justin_smith: yeah, once you get used to it, you will wish every program let you pick documents that way

17:49 we totally need iswitchb for chrome,firefox

17:49 technomancy: conkeror has it

17:49 justin_smith: seriously? awesome!

17:49 rovar: so 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:49 technomancy: unity kinda has it too, but it's difficult to recommend for other reasons

17:49 rovar: i use ctrl-# for chrome and ff too.

17:49 technomancy: conkeror is the best

17:50 rovar: very fast for tabs < 10 :)

17:50 technomancy: O(1)

17:50 rovar: not useful at all for > 9 :)

17:50 exactly

17:50 technomancy: then jumps up to O(n)

17:51 rovar: it jumps up to grab mouse, which is still technically constant time, but that's where BigO breaks down :)

17:51 bitemyapp: spatially reasoning about how to jump to context is flawed

17:51 justin_smith: my hand-eye-coordination for small tabs is not constant time at all

17:51 bitemyapp: it's more declarative and scalable to just say which context you want descriptively.

17:51 technomancy: mouse doesn't help once the tabs get too small to show titles

17:51 rovar: it's non-deterministic

17:51 bitemyapp: "gmai" -> gmail tab

17:52 rovar: varies with tab size, alcohol consumption and time of day

17:52 technomancy: fitt's law?

17:53 r4vi: has anyone made something like frozen-flask for ring/compojure? http://pythonhosted.org/Frozen-Flask/

17:53 rovar: similar in many ways to this channel's effect on my productivity

17:53 sometimes very positive, sometimes very negative :)

17:54 r4vi: ring-bake

17:54 r4vi: thanks rovar

17:54 rovar: imo they could have come up with a better name..

17:54 it looks a bit more like a POC.. it could probably use some updating..

17:55 r4vi: looks good enough for what i need

18:05 seangrove: technomancy: Is there nrepl.el/cider support for drawbridge?

18:05 technomancy: no =(

18:06 works with inf-lisp tho

18:06 via lein repl :connect

18:07 seangrove: Heh, no worries, just curious :)

18:08 Haven't used inf-lisp much, I'll look into it

18:09 technomancy: it's pretty simple

18:09 no completion tho

18:13 AeroNotix: What are people's favourite feature of cider?

18:13 andyf: Bronsa: ping

18:14 technomancy: AeroNotix: jump-to-definition

18:14 which wouldn't worx remotely anyway

18:14 AeroNotix: :)

18:19 seangrove: technomancy: Wouldn't it work remotely with cl/slime?

18:19 It's been a few years since I've done remote slime debugging

18:19 bitemyapp: you know it's a serious problem when you gotta get ya SWANK on.

18:19 technomancy: seangrove: it works with tramp if you can open an SSH connection

18:20 but slime doesn't work over HTTP

18:20 `cbp: fml im so dumb time to format

18:21 bitemyapp: `cbp: ?

18:21 `cbp: i was cleaning up the homebrew stuff and rm some files in /usr/lib instead of the directory i wanted..

18:21 seangrove: technomancy: Yeah

18:22 technomancy: I think cider can do the tramp/ssh stuff too fwiw

18:22 lolbrew

18:24 `cbp: heh now emacs is about the only program that works

18:24 * `cbp facepalms

18:24 arrdem: gotta love that build in platform :D

18:25 rovar: I still haven't gotten around to exploring tramp

18:25 seangrove: `cbp: Luckily, that's just about a full dev environment

18:26 And mail client, news readers, etc....

18:26 rovar: conj things-to-do

18:26 bitemyapp: tramp is great.

18:26 seangrove: Just switch to el-node and really you don't need anything else

18:26 rovar: I used to joke about doing a shootout to see which operating system was better OSX, Linux and Emacs

18:27 arrdem: I wonder if someone's done a "boot to emacs" os as a joke...

18:27 rovar: with all of this boot-into-process stuff that's been going on, it's not far off

18:27 I bet I could get xen booting into emacs in a week

18:27 booting onto bare metal with uefi would take considerably longer..

18:27 seangrove: rovar: It's hit-or-miss with me. Nice to have sometimes, certainly.

18:27 technomancy: you can do it with user-mode linux iirc

18:28 or you could a few versions ago when static co

18:28 bitemyapp: gf3: http://www.youtube.com/watch?v=JqYhuwu614Y

18:28 Raynes: ^^

18:28 technomancy: static linking still worked

18:28 rovar: or there is also this: www.osv.io

18:28 user mode linux vs kernel mode process :)

18:29 bitemyapp: kernel mode erlang IMO

18:29 technomancy: tramp is a bit flaky due to not being async in a single-threaded runtime

18:30 justin_smith: cljmacs would totally rock, if only it were a sane prospect

18:30 technomancy: utf-16 all the things!!!

18:31 arrdem: bitemyapp: QUAD GOLEMS IS BEST GOLEMS

18:31 bitemyapp: justin_smith: the Haskellers have multiple editors in their own language.

18:31 arrdem: justin_smith: what makes it insane? I just don't expect to see it in several years

18:31 bitemyapp: having fast starting binaries goes a long way.

18:32 technomancy: says the guy who doesn't use autoloads...

18:32 justin_smith: arrdem: remaking emacs is like a land war in asia - often attempted, rarely ends with success

18:32 rovar: I would first like to see a full llvm implementation of clojure

18:32 technomancy: justin_smith: only once, to my knowledge =)

18:32 rovar: then I'd go for the editor

18:33 i'll take both in parallel, if someone wishes

18:34 arrdem: I mean we already have lighttable... do we really need a "pure" emacs in clojure?

18:34 I think LT totally counts

18:34 seangrove: justin_smith: rarely?

18:34 I suppose xemacs was successful-ish

18:35 hiredman: rovar: how familiar are you with llvm?

18:35 technomancy: arrdem: half the point of emacs is the license

18:36 arrdem: technomancy: in being GPL/2'd?

18:36 justin_smith: seangrove: yeah, rarely was an understatement. And remember that gnu emacs was a remake of teco-emacs

18:36 hiredman: rovar: because generally that kind of talk gets people lumped in to the "don't know anything about llvm" catagory

18:36 bitemyapp: I 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:36 really makes me get the warm fuzzies for open source.

18:36 went*

18:37 amalloy: hiredman: what kind of talk? implementing clojure in llvm?

18:37 hiredman: amalloy: yes

18:37 seangrove: Hrm, I had missed this http://www.chris-granger.com/2013/12/11/light-table-is-growing/

18:37 S11001001: arrdem: that it is free at all

18:37 arrdem: S11001001: right. forgot about that.

18:37 amalloy: i've known several people who were excited to write clojure on llvm, and none of them knew anything about llvm. story checks out

18:37 hiredman: :)

18:37 seangrove: arrdem: I suppose it'd still be nice to have some better concurrency constructurs underlying LT, but it could still pull something off, possibly

18:37 amalloy: i don't know anything about llvm myself, and it sounds pretty great

18:37 arrdem: hiredman: where'd the link go?

18:38 hiredman: llvm isn't a vm or a runtime

18:38 amalloy: sure, it is neat for what it is, but it isn't what half the people talking about it want it to be

18:38 bitemyapp: Clojure-LLVM doesn't make a ton of sense.

18:39 arrdem: bitemyapp: I would disagree if only for adding a fast-start capability to clojure code

18:39 bitemyapp: you'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:39 tbaldrid_: 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:39 hiredman: tbaldrid_: indeed

18:39 * seangrove sighs

18:39 bitemyapp: tbaldrid_: 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:39 arrdem: bitemyapp: but in that clojure-llvm would throw away all the JVM infrastructure that makes clojure awseome I agree

18:39 hiredman: tbaldrid_: they want a jvm without the j

18:39 seangrove: I don't think we can stay on heroku much longer, the deploy process is just too flakey

18:39 bitemyapp: arrdem: right.

18:39 tbaldrid_: bitemyapp: not true, bohem gc and MPS are good systems.

18:39 bitemyapp: seangrove: if you need dev-ops help, ping me.

18:39 tbaldrid_: Boehm isn't a proper GC. come on.

18:39 amalloy: so llvm is mostly a set of libraries for writing compilers?

18:39 bitemyapp: you can't be serious.

18:39 technomancy: seangrove: what happened?


18:39 amalloy: i always thought it was a vm

18:40 arrdem: amalloy: basically

18:40 rovar: hiredman: rather familiar

18:40 bitemyapp: amalloy: uhhh. close enough. yes.

18:40 amalloy: there is no actual vm.

18:40 arrdem: amalloy: it's a lot more that that, but yes

18:40 hiredman: amalloy: more or less

18:40 tbaldrid_: bitemyapp: sure it is, it collects garbage after all.

18:40 technomancy: amalloy: and zeromq is a message queue

18:40 rovar: it's basically a cross-platform asm.. maybe not that severe.. and it does have runtime bits.. though they may not apply.

18:40 bitemyapp: amalloy: 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:40 tbaldrid_: not reliably.

18:40 hyPiRion: the LLVM project contains a bytecode interpreter

18:40 bitemyapp: Boehm was an acceptable GC 20 years ago, not today.

18:40 we have higher standards than that.

18:40 rovar: will it take a tonne of work? yes. will it be worth it? yes.

18:40 amalloy: technomancy: i get the joke, but it's lost on me, with no 0mq experience

18:40 hiredman: it doesn't have a gc, or a higher level notion of a type system

18:41 bitemyapp: rovar: er, you say that, but...

18:41 tbaldridge: bitemyapp: depends on your definition of reliably, I used Mono with Bohem for quite some time without issues.

18:41 arrdem: bitemyapp: I'd write C in clojure if I could...

18:41 technomancy: amalloy: tl;dr: 0mq is not a message queue

18:41 rovar: Erlang or Haskell's GC would apply very well to clojure.

18:41 bitemyapp: tbaldridge: I wasn't aware anybody took Mono seriously in general either.

18:41 tbaldridge: bitemyapp: you should get out more ;-)

18:41 bitemyapp: Haskell's GC would be the closest match.

18:41 rovar: you can make a lot of assumptions about parallel GC when you don't have any shared state between threads.

18:41 technomancy: the GC is typically touted as the biggest weak point of mono

18:41 when

18:41 hiredman: tbaldridge: I imagine bitemyapp is confusing precise gc with reliable gc

18:41 bitemyapp: ^^ yep.

18:41 technomancy: when compared to the JVM/.net

18:42 bitemyapp: hiredman: no, I just happen to know Mono's GC is terrible.

18:42 and has been for years.

18:42 and Boehm is terrible too, even compared to other conservative GCs.

18:42 hiredman: http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29#Precise_vs._conservative_and_internal_pointers

18:42 rovar: http://llvm.org/docs/GarbageCollection.html

18:42 tbaldridge: but even then, MPS is also an option. Start with Bohem move to MPS later on.

18:43 bitemyapp: genericizing conservative collection is a recipe for leaks.

18:43 tbaldridge: rovar: yeah, LLVM's support for GCs is more or less a joke.

18:43 bitemyapp: have you tried the precise mode in Bohem?

18:43 rovar: tbaldridge: I've never tried to use it, but I have heard basically the same from people building functional languages

18:43 hiredman: rovar: 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:43 bitemyapp: if you wanted a fast-starting compiled Clojure it would probably be easier to target Haskell or GHC Core for your compiler output.

18:43 rovar: interesting..

18:43 bitemyapp: leveraging the core libraries and compiler tooling provided.

18:44 it's not that hard to just a slap a uni-type on everything.

18:44 rovar: so compile clojure into a spineless-tagless-g-machine

18:44 are they still using that?

18:44 things change so quickly..

18:44 hiredman: steal the backend of haskell's llvm based runtime

18:45 rovar: I 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:45 bitemyapp: rovar: so far as I know, but they have LLVM output in addition to C and all that now.

18:45 the stdlib isn't quirky.

18:45 technomancy: how is the JVM's GC a bad fit?

18:45 bitemyapp: anyway, the point of targeting Haskell wouldn't just be the LLVM generator, it'd be the host wrapper and concurrency tools too.

18:45 rovar: ghc is actually quite modular. one could easily target one of their IM

18:46 (relatively)

18:46 bitemyapp: and the GC. omg. Avoiding having to implement GC on LLVM yourself would be a fucking coup.

18:46 hiredman: rovar: 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:46 bitemyapp: rovar: yeah you can dump GHC Core directly.

18:46 rovar: err IR, not IM

18:46 bitemyapp: the 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:47 having native green threads would kinda cool anyway.

18:47 rovar: I'm not sure how haskell does at runtime compilation..

18:47 hiredman: (by nonsense I mean "the concurrency model and the GC model in the JVM are a bad fit")

18:47 rovar: generally something that's needed in lisps

18:47 hiredman: well ghc has a repl

18:47 bitemyapp: rovar: there are ways to kick around runtime Haskell but you wouldn't approach it like that

18:48 rovar: you'd approach it like Clojure's resident compiler, not like the ghci REPL

18:48 well, I guess you could appropriate that.

18:48 hiredman: but that can be a real problem, for example the go runtime makes no allowances for dynamic code loading

18:48 bitemyapp: that sounds like a bad idea to me though.

18:49 rovar: hiredman: 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:49 bitemyapp: there are pretty serious trade-offs involved with Erlang's approach

18:49 hiredman: rovar: erlang's model has its own trade-offs

18:49 bitemyapp: and the approach isn't as generally applicable as the JVM's.

18:50 rovar: erlang's model isn't close to being a pure-win.

18:50 rovar: I don't want to denigrate Java's GC. I'm pretty sure more work has gone into that GC than any other language.

18:50 bitemyapp: well, if PHP is any indication, work input doesn't lead to a linear improvement in quality of output.

18:50 logic_prog: in cljs, how do I detect is a left button is pressed?

18:50 someone needs to write a cljs cookbook of all these things

18:50 bitemyapp: sometimes not even a monotonic improvement.

18:50 rovar: fair enough :)

18:51 hiredman: there 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:51 arrdem: bitemyapp: there is some requirement for language sanity here come on

18:51 bitemyapp: but the JVM has a seriously tunable GC.

18:51 hiredman: he's right, lol.

18:52 arrdem: I still say Clohask is a good idea if you actually want fast-starting binaries for Clojure.

18:52 without retreading a bunch of unproductive territory.

18:52 like creating a core host from scratch (gag gag gag)

18:52 technomancy: well it depends on your goals. erlang can do a ton of cool stuff clojure can't, but the GC is slower.

18:52 logic_prog: what is Clohask ?

18:52 bitemyapp: technomancy: everything is slower, but it is nice.

18:52 logic_prog: Clojure->(Haskell/GHC Core)

18:53 logic_prog: ick

18:53 arrdem: logic_prog: it's a clojure compiler targeting the haskell core

18:53 logic_prog: I thought part of the allure of Clojure are the JVM libraries

18:53 rovar: logic_prog: (d/listen! $input :keyup (fn [e] (when (= 37 (.-keyCode e))

18:53 bitemyapp: I'm still pissed about Elixir using uncounted lists.

18:53 rovar: where d is dommy.core

18:53 logic_prog: rovar: I have key board input working, but it's the stupid mouse stuff that I don't have working

18:53 hiredman: technomancy: lets be specific here, rovar is touting erlang's process model, not a general language x vs. language y

18:53 logic_prog: rovar: in particular, I'm listening to :mousemove

18:53 but I want to know if a button is down (i.e. dragging) or if it's just moving

18:53 rovar: oh. left mouse button

18:54 logic_prog: yeah, stackoverflow says (.-buttons evt) but that's null

18:54 hyPiRion: People generally just want faster startup times, with the same functionality. Generally the GC speed or the adaptive JIT optimizer isn't critical

18:54 logic_prog: then there's (.-button evt) but everyone says it's fucking outdated

18:54 technomancy: hiredman: but the same limitations that affect the GC are what allow it to do some of its crazy stuff

18:54 bitemyapp: cljs is not the place to be if you want your code to stay the same month to month.

18:54 clojurebot: Ok.

18:54 bitemyapp: oh that was unintentional. I'm keeping it.

18:54 hyPiRion: lol @ clojurebot picking up that.

18:54 logic_prog: a is b + c - d.

18:54 bitemyapp: ~botsnack

18:54 clojurebot: Thanks! Can I have chocolate next time

18:55 bitemyapp: no, brat.

18:55 hiredman: technomancy: what crazy stuff?

18:55 rovar: logic_prog: I'd just use the ugly cljs version of what's prescribed here: http://www.html5rocks.com/en/mobile/touchandmouse/

18:56 bitemyapp: http://www.youtube.com/watch?v=PrZZfaDp02o

18:56 technomancy: hiredman: like hot reloads

18:57 rovar: lol@INXS

18:57 logic_prog: erlang is better for (1) messaging model and (2) hot reloads

18:57 clojure wins for pretty much everythign else

18:57 bitemyapp: queue is a good way to avoid caring about hot reloads.

18:57 ~cljs

18:57 clojurebot: cljs is not the place to be if you want your code to stay the same month to month.

18:57 logic_prog: dude, someone should do a badass port of riak from erlang to clojure

18:57 bitemyapp: yissss

18:57 logic_prog: lolno.

18:57 hiredman: technomancy: you can do that with the jvm too, generally provided via something like an app server

18:57 rovar: consistency in the face of hot reloads is something that even erlang can't fix :)

18:57 arrdem: does anyone here do hot reloads? srsly?

18:58 * bitemyapp points to self

18:58 rovar: I wrote call accounting in erlang about a decade ago..

18:58 bitemyapp: arrdem: I hotpatch my code via nrepl.

18:58 hiredman: (delivered as a library/framework even, not a core language feature)

18:58 arrdem: bitemyapp: yeah but you're the loony fringe even here

18:58 * bitemyapp grins toothily

18:58 rovar: I don't do hot reloads in prod.. not in the days of free VMs

18:58 * arrdem has also done nrepl monkey patching

18:58 technomancy: hiredman: in some limited contets, sure

18:58 rovar: clojure + marathon + mesos == joy

18:58 technomancy: but it doesn't offer the same safety guarantees

18:59 arrdem: technomancy: when you're reloading code at runtime it's a miracle that anything works

18:59 rovar: actually.. I've not used clojure in that mix, I'm speculating. But with other languages it has been quite nice.

18:59 hiredman: rovar: ugh

18:59 rovar: ?

18:59 hiredman: rovar: I mean, about your "I've not used clojure in that mix"

18:59 rovar: I'm working towards it.

18:59 hiredman: I am interested in mesos

19:00 rovar: Got a cascalog app I'm working on..

19:00 hiredman: technomancy: what safety guarantees

19:00 bitemyapp: arrdem: I'm the mad wizard that will create the black hole that collapses the planet.

19:01 "how was I supposed to know monkey-patching the particle accelerator's firmware would do that?"

19:01 arrdem: bitemyapp: as long as I get to slap my name on the imploder somewhere I'm all for it

19:01 bitemyapp: Deal.

19:01 arrdem: "*** TODO Fix FIXME annotated fns" thank you previous me, go suck eggs

19:02 rovar: I wonder what it would take to replicate something like Atom in clojure

19:02 my guess is less effort.. template haskell is a bit of a bear

19:02 bitemyapp: rovar: wut

19:02 rovar: I actually am faced with the spectre of broad deployment of embedded code onto tiny devices some time next year..

19:02 bitemyapp: rovar: atom?

19:02 rovar: I'd prefer to also not have to write C if I can help it.

19:02 ya

19:03 arrdem: rovar: c99 is the best I don't know what you're talking about

19:03 bitemyapp: rovar: ...and which of the many possible things named atom are you referring to?

19:03 arrdem: I'd rather use C++ I wrote myself.

19:03 rovar: arrdem: for your particle accelerator, absolutely.

19:03 hyPiRion: bitemyapp: clojure atoms, likely. like (atom {})

19:04 arrdem: bitemyapp: as long as you're using the subset of c++11 that's a supserset of C99 sure

19:04 rovar: http://hackage.haskell.org/package/atom

19:04 hyPiRion: neg

19:04 bitemyapp: hyPiRion: see, that you were wrong is why I was doubting.

19:04 hyPiRion: oh, I read it in reverse

19:04 bitemyapp: hyPiRion: he said, "implement it in Clojure"

19:04 arrdem: you need to look at this: http://hackage.haskell.org/package/atom

19:04 rovar: i will likely just end up using atom in haskell

19:04 technomancy: hiredman: stuff like leaving sockets open but having their connections served by new code

19:04 rovar: but I'm kind of in to this "one language to rule them all" thing

19:05 bitemyapp: rovar: better make that language Haskell >:)

19:05 rovar: :o

19:05 bitemyapp: SHOTS FIRED

19:05 technomancy: one language for all is as silly for clojure as it is for java

19:05 bitemyapp: ^^ agree, actually.

19:06 arrdem: rovar: ffs you're doing embedded. c99 + linux...

19:06 * arrdem goes back to writing c99 at his day jorb

19:06 rovar: (╯°□°)╯︵ ┻━┻

19:07 technomancy: 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:07 arrdem: rovar: if it's any consolation I wish I could write C in Clojure, but the rest of the dev team would kill me

19:07 rovar: so let us have some alone time

19:07 technomancy: rovar: as long as you see it for what it is, cool

19:08 rovar: arrdem: 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:08 it was quite pleasant, even though I knew next to nothing about functional programming.

19:08 it looked more like C with collections..

19:08 + lambdas

19:09 arrdem: rovar: 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:09 rovar: arrdem: are you working heapless?

19:09 arrdem: rovar: oooh yeah. I'm working sub-os :/

19:09 rovar: compile time static allocations. more please.

19:09 * bitemyapp waves from the malloc-and-GC-equipped first world to the dirty poor people

19:10 rovar: cool.. yea.. atom looks kind of nice for that

19:10 arrdem: (dec bitemyapp) ;; get off my lawn

19:10 lazybot: ⇒ 13

19:10 hiredman: technomancy: 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:10 rovar: I haven't done a ton of embedded, and am going to have to do some sensors next spring.. very small space..

19:11 hiredman: 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:11 I think Redhate's OpenShift works on this model with (i think) java and other friends..

19:12 technomancy: hiredman: 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:12 hiredman: technomancy: that is no different from what you need in erlang

19:12 rovar: there is nothing mutable at that layer in erlang

19:12 that's how they do it.

19:13 technomancy: hiredman: but it's enforced for you

19:13 rovar: http://learnyousomeerlang.com/designing-a-concurrent-application#hot-code-loving

19:14 technomancy: hiredman: I think we're all saying the same things here.

19:14 so it would be something like a servlet container, as long as no mutable references could leak into the container you're golden.

19:15 arrdem: how do you instruct clojurebot to pattern match without the ~ prefix?

19:15 hiredman: I'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:15 hyped

19:16 technomancy: it chooses a different set of trade-offs

19:16 reliability over performance

19:16 hiredman: sure, it makes a few different trade offs, and also has a huge set of warts

19:17 technomancy: how is that relevant to the topic though?

19:17 rovar: we have a topic?

19:17 arrdem: rovar: it's at the top of the screen :P

19:18 rovar: XChat: rovar @ FreeNode

19:18 nice topic :)

19:18 hyPiRion: woh, not been changed since July 2011

19:19 hiredman: technomancy: I was constraining it to gc related issues, but someone suggested the gc trade offs erlang makes allows it do something good

19:19 rovar: hmm..

19:23 hiredman: so we can summarize by saying process-isolation == freedom && reduced performance?

19:23 hiredman: rovar: no

19:24 rovar: in this case, not OS level processes, but some notion of data isolation and asynchrony

19:25 hiredman: none of which is unique to erlang

19:25 rovar: I think the GC leveraging that is

19:26 separate GCs for separate processes is what allows one to easily guarantee that it is safe

19:26 it's not the only way..

19:27 hiredman: I'd expect the result of any "leverage" would be a better gc

19:27 but the beam gc "leverages" and comes out even or worse

19:27 rovar: does 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:28 I think beam itself is just slower..

19:28 technomancy: the 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:30 given the hacker resources erlang has at its disposal, they are not stuck with single-threaded processes like ocaml is.

19:30 hiredman: sure, it is solving a simpler problem, but does it gain anything over other platforms by that? not as far as I can tell

19:30 arrdem: $google clojure emacs mode

19:30 lazybot: [clojure-emacs/clojure-mode · GitHub] https://github.com/clojure-emacs/clojure-mode

19:30 technomancy: hiredman: over ocaml?

19:30 hiredman: technomancy: not everyone takes ocaml seriously :)

19:31 technomancy: hiredman: even go's GC isn't concurrent

19:31 not that I take Go seriously

19:32 rovar: mental 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:32 bitemyapp: rovar: use the help prefix.

19:33 hiredman: go is gross, but unfortunately very serious http://www.techempower.com/benchmarks/

19:34 bitemyapp: hiredman: they're cheating.

19:34 technomancy: haskell is afaik the only runtime with concurrent GC that hasn't had a bazillion dollars poured into it by a megacorp

19:34 bitemyapp: or, at best, they're investing direct effort into gaming the benchmarks above and beyond anybody else right now.

19:34 technomancy: it's parallel. I don't know that I would describe it as concurrent.

19:34 technomancy: bitemyapp: that's what benchmarks are for

19:34 AimHere: technomancy, Doesn't the top Haskell guy get paid by Microsoft to sit and be a cleverclogs?

19:35 bitemyapp: that's rather different from the effort the JVM has had put into it.

19:35 technomancy: AimHere: sure, but he is paid < $megabucks

19:35 bitemyapp: there is an erlang style GC branch of GHC. I'm not aware of any that use it.

19:35 akhudek: AimHere: I think facebook hired him now, no?

19:35 bitemyapp: akhudek: wrong Simon.

19:35 there is more than one.

19:36 technomancy: I wish tehy would hire the Cartesian Closed Comic guy because he's hilarious and seems to have dropped offline

19:36 AimHere: Facebook AND Microsoft, and they're still not rolling in megabucks? Haskell's funding scroungers really need to up their game

19:36 rovar: mental note #2, debugging vertex shaders when one knows neither webgl, nor cljs nor clojure very well is not recommended.

19:36 technomancy: avoid success at all costs dude

19:36 bitemyapp: technomancy: I love those comics.

19:36 AimHere: they don't need Pharaonic mass slave labor like Java projects.

19:37 AimHere: just time to think.

19:37 clojurebot: I don't understand.

19:37 technomancy: bitemyapp: ahaha

19:37 rovar: AimHere: All of Microsoft Research exists to keep top minds from being productive for other companies.

19:37 technomancy: that metaphor... I approve

19:37 bitemyapp: technomancy: That's what Java and Go are designed for.

19:37 AimHere: But just think ... what Haskell could do with Pharaonic mass slave labour!

19:37 rovar: hah

19:37 hiredman: technomancy: you seem to be arguing good intentions as a substitute for performance?

19:37 rovar: we'd be rolling in the monads

19:38 AimHere: monads up to the gonads

19:38 bitemyapp: rovar: you would *not* want to use the STG if you were targeting Haskell as a host for Clojure by the by.

19:38 you'd want .hs or GHC Core.

19:38 rovar: bitemyapp: thanks for the tip

19:38 hiredman: when 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:38 arrdem: clojurebot: haskell is pharaonic mass slave labour

19:38 clojurebot: Alles klar

19:39 bitemyapp: arrdem: first thing I am going to do in DayZ is bludgeon you with a wrench.

19:39 rovar: if one blurs ones eyes, compiling to haskell could look similar to compiling to SSA

19:39 arrdem: bitemyapp: you'll have to catch me first. MOBAs and starcraft have sharpened my juking skills considerably

19:39 bitemyapp: ~forget haskell is pharaonic mass slave labour

19:39 clojurebot: Ack. Ack.

19:39 bitemyapp: arrdem: that's actually a good thing

19:40 arrdem: until you get a rifle, main survival technique is juking and sneaking.

19:40 rovar: arrdem: MOBA?

19:40 bitemyapp: arrdem: stick to the treeline. Avoid the zeds. stay away from humans you don't know.

19:40 arrdem: rovar: Multiplayer Online Battle Arena

19:40 rovar: ah

19:40 bitemyapp: arrdem: we'll link up in a server. you know DayZ is semi-persistent right?

19:40 arrdem: rovar: LoL and other DOTA-likes

19:40 bitemyapp: yerp

19:40 bitemyapp: kk, just making certain you understood.

19:41 rovar: arrdem: I have been so far unsuccessful getting that to run in Wine

19:41 bitemyapp: also I wouldn't attempt server teleportation, they'll probably ban you for that.

19:41 technomancy: hiredman: 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:41 rovar: not devoted much effort to it either..

19:41 arrdem: rovar: I tried wine a couple times, it's always ended badly

19:41 rovar: if you know of alternates that run natively on Linux I'd give it a try.

19:41 been in the market for a good video game.. things have been stressful as of late.

19:41 arrdem: rovar: dota2 is native for linux :D

19:42 technomancy: rovar: http://ftlgame.com

19:42 ooh, it's on sale

19:42 arrdem: technomancy: oh gods ftl

19:42 * technomancy cackles maniacally

19:42 AimHere: HoN and awesomenauts are also linux-native, but go with Dota2

19:43 arrdem: rovar: if you by FTL, may the RNG gods smile on you, because they don't on me

19:43 technomancy: you will die. many times...

19:43 rovar: heh

19:43 i love procedurally generated games.

19:43 arrdem: technomancy: I love the teleporter invasion strategy but I keep killing my away team Q_Q

19:43 andyf: FTLFTW

19:43 hyPiRion: I like how FTL is actually hard though

19:43 not beaten it on normal mode, even

19:44 arrdem: hyPiRion: I just want to win on easy....

19:44 technomancy: took me twelve times

19:44 hyPiRion: arrdem: isn't it just normal and hard? If not, I haven't beaten it on easy.

19:44 AimHere: It's easy and normal

19:44 hyPiRion: oh lol

19:44 technomancy: "easy" heh

19:44 rovar: dota looks decent..

19:45 riley526: rovar: just don't take the community too seriously

19:45 rovar: I have been playing Kingdom Rush on my daily trainride

19:45 that's as far as I get into games these days..

19:45 bitemyapp: rovar: DotA is a good way to drink deeply of hatred for all mankind.

19:46 arrdem: goddamnit pacman thanks for eating 24% of / with cached old packages

19:46 rovar: s/dota/any-multiplayer-game-ever/g/i

19:46 AimHere: I didn't think the DotA community was that bad when I played it. I've heard that HoN is worse

19:46 bitemyapp: AimHere: HoN was pretty bad.

19:46 rovar: clojurebot: google HoN

19:46 clojurebot: First, out of 15100000 results is:

19:46 HON Office Furniture – Desks, Workstations, Chairs, Storage &amp; Files

19:46 bitemyapp: AimHere: most of that period of my life is a white-hot haze of hatred.

19:46 clojurebot: http://www.hon.com/

19:46 rovar: meh

19:46 bitemyapp: rovar: heroes of newerth.

19:46 AimHere: Heroes of Newerth

19:47 bitemyapp: HoN was really intense.

19:47 rovar: ok.. downloading on steam

19:47 bitemyapp: DotA2 is a bit slower and more casual, but way better than LoL

19:47 rovar: need to dust off my Nostromo

19:48 probably means I'm going to need to do some serious button mapping on linux, it will probably register as a mouse..

19:49 also FORCED looks fun. I backed it on kickstarter, but don't have any friends to coop with

19:49 justin_smith: it's OK rovar, none of us would be in IRC if we had friends

19:49 arrdem: (inc justin_smith)

19:49 lazybot: ⇒ 18

19:49 rovar: justin_smith: we can all be lonely together

19:50 bitemyapp: arrdem and I are going to go camping!

19:50 (in DayZ)

19:50 rovar: imperialist windows games

19:53 AimHere: Now we have games, our next goal is Linux/SteamOS exclusives

19:53 xeqi: cemerick: query about queue length and PR status

19:54 AimHere: If we start with Half Life 3, I won't complain

19:54 nDuff: Blegh. Spending a few minutes dealing with concurrency in Java-land, and wishing so much for Clojure's STM.

19:55 (dealing with a bug report against locking code in Apache Ant that I was the last person to touch).

20:07 cemerick: xeqi: Answer hazy. Ask again later. :-/

20:29 jtoy: is there a way I can override defn so that in debug mode it prints out all its arguments?

20:31 technomancy: ~tools.trace

20:31 clojurebot: Huh?

20:31 technomancy: derp

20:31 $google clojure tools.trace

20:31 lazybot: [clojure/tools.trace · GitHub] https://github.com/clojure/tools.trace

20:37 jtoy: technomancy: 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:37 oh, i see I can trace a whole namespace

20:37 bitemyapp: arrdem: mumbur plz

20:37 jtoy: cool, I'll test that out, thanks

20:38 technomancy: np; it's a neat lib

20:39 arrdem: bitemyapp: but I was almost motivated to write code again...

20:40 not like it's code anyone else will use but still

20:41 bitemyapp: arrdem: ALPHER TAIM

20:41 yedi: @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:41 arrdem: bitemyapp: fiiiine

20:41 bitemyapp: god making me play games

20:42 dnolen: yedi: 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:43 yedi: 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:43 yedi: now that it's done I'm pretty excited, kovasb is already building some really cool stuff w/ it

20:43 representing UIs as ClojureScript data is radical.

20:44 yedi: i saw the readme update and was wondering if it was "complete" yet

20:44 dnolen: yedi: I'd consider it far too early days to be anything more than something to play with

20:44 feedback most welcome of course.

20:58 xeqi: dnolen: any links for the "representing UIs as cljs data"?

21:02 hiredman: #ui/component {...}

21:13 dnolen: xeqi: it's just how Om works, convert EDN data into DOM.

21:14 xeqi: w/o having to actually touch the DOM

21:15 xeqi: in the end conceptually similar to WebFUI, but way faster because of React and how we integrate w/ it.

21:16 noprompt: why do protocol functions sometimes start with a hyphen in cljs?

21:16 i forgot and can't seem to get a solid answer from google.

21:17 rovar: noprompt: protocol functions? I know accessing attributes of objects requires a hyphen

21:18 dnolen: noprompt: just a convention from core.cljs, usually when a it's backed by a real function

21:18 i.e. first -first

21:19 noprompt: dnolen: ok. so the function can be called w/o the leading hyphen?

21:19 dnolen: noprompt: absolutely, function names can be any valid symbol (I think)

21:21 noprompt: dnolen: 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:21 dnolen: noprompt: protocol functions are just functions, in the case of the -first, first, the real first function dispatches to -first

21:22 noprompt: but this isn't automatic, you have to write it that way

21:23 noprompt: dnolen: ah ok, so, for instance, (first xs) and (-first xs) are two separate things.

21:23 dnolen: noprompt: they are

21:23 noprompt: and in fact calling -first is not a good idea unless you know what you're doing.

21:24 noprompt: dnolen: so why convention with the leading hyphen? why not write protocal fn specs sans hyphen? this is what confuses me.

21:24 dnolen: noprompt: it just signifies something that digs a bit into implementation details, it's just a convention - no need to follow it

21:25 noprompt: dnolen: 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:25 dnolen: noprompt: 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:27 noprompt: dnolen: 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:28 dnolen: noprompt: cool :)

21:28 noprompt: I changed Om no more leading dash on protocol fns

21:30 rovar: :)

21:31 I'm in the same boat.

21:32 was 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:33 noprompt: dnolen: cool. so far this has been nice. it really feels like this was the missing peice for the frontend.

21:33 rovar: also, I've implemented a poor mans STM where one would basically version references to roots of data structures atomically.

21:33 little did I know, I was re-inventing clojure.

21:34 the power got me over my fear of paren-matching

21:34 I've even gone so far as to switch from vim to emacs..

21:34 noprompt: rovar: paredit helps too. :)

21:34 rovar: paredit was my mortal enemy

21:34 noprompt: rovar: did you install evil-mode?

21:34 rovar: until I learned that its basically an eager, stupid assistant

21:35 no

21:35 I'm trying to go native :)

21:35 noprompt: rovar: ah, yeah, that didn't exactly work out for me.

21:35 rovar: been using vim exclusively for 7 years

21:35 starting to get the hang of the basics...

21:35 noprompt: rovar: i installed evil, keychord, evil-paredit, etc.

21:35 rovar: I google a lot

21:35 heh

21:35 noprompt: modal editing is the "right" way. >:)

21:36 dnolen: noprompt: 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:36 s/built/to build

21:37 rovar: dnolen: don't forget cljs-webgl :)

21:38 at the moment I have a javascript nrepl with https://github.com/Asakeron/cljs-webgl and frodo working

21:38 echo-area: rovar: I have tried paredit and the likes and removed them too

21:38 rovar: so I'm marvelling at my ability to change the color of a triangle from emacs

21:38 noprompt: dnolen: 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:39 dnolen: rovar: haha, awesome haven't seen that before

21:39 rovar: cljs-webgl I mean

21:39 rovar: I'll check in my project when I make it do a bit more..

21:40 kind of a scaffolding/sample of dommy and webgl

21:40 I want to make an interactive shader IDE for my own purposes..

21:40 Om looks great

21:40 I'm not much of a web UI guy. So I'll need all the help I can get.

21:40 dabd: anyone knows how can I get rhizome to save an image in pdf?

21:41 rovar: dabd: what is this rhizome of which you speak?

21:42 dabd: https://github.com/ztellman/rhizome

21:44 sritchie: anyone have tips on a really simple logging lib?

21:44 no timestamps, none of that...

21:44 just levels, basically

21:45 rovar: sritchie: umm. File ?

21:45 myfile.append :)

21:45 sritchie: yeah, I guess that's the simplest :) or just println with an on/off switch

21:45 I just need to figure out how to customize the formatting in timbre

21:46 rovar: you could redir stdout to a file descriptor and use println

21:47 one downside of frodo/austin is I seem to be able to hang emacs so hard that I have to kill -9 it

21:51 justin_smith: rovar_away: nohup is nice for that, automatic appending of all output, and keeps things running while you log out

21:52 shriphani: hi any incanter users here ?

21:53 SegFaultAX: shriphani: Ask here first, if you don't get any responses, try on the mailing list.

21:53 There are lots of users on the mailing list.

21:54 sritchie: can you guys help me match a bracketed string? seems so easy… gahhh

21:54 shriphani: ok. I was wondering if there was a partial-svd implementation available? I only see a full decom-svd.

21:54 sritchie: ERROR [paddleguru.config] - Everything else

21:54 that's the pattern

21:54 justin_smith: sritchie: are you using emacs?

21:54 sritchie: yeah, actually

21:54 oh, whoops

21:55 sorry, thought I was in logstash

21:55 justin_smith: there is a tool for regex building

21:55 http://emacsworld.blogspot.com/2009/10/using-emacs-regular-expression-builder.html

21:55 sritchie: oh, nice

21:56 rovar_away: i wonder if anyone's made a ragel style state machine generator in a lisp dialect

21:56 justin_smith: I bet there are like 200 dissertations from the late '70s on that topic

21:57 rovar_away: speaking of... have you seen Bret Victor's talk on programming languages

21:57 justin_smith: just joking, it just sounded good

21:57 rovar_away: you're probably off by a decade.. it was probably the late 60s

21:58 justin_smith: heh, good call

21:58 rovar_away: watch this: you'll be glad you did

21:58 or angry.. or both

21:58 http://vimeo.com/71278954

21:58 Bret Victor is one of my heros

Logging service provided by n01se.net