#clojure log - Aug 20 2013

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

0:00 dnolen: [Neurotic]: yeah if you need to refer to some global JS object you need to prefix with js/

0:00 [Neurotic]: duh of course :/

0:00 (facepalm)

0:00 dnolen: [Neurotic]: not that obvious :)

0:01 qz: TEttinger: running with empty main (just one println) have same effect.. so it must be something somewhere else

0:01 [Neurotic]: dnolen: there we go

0:01 thanks

0:01 dnolen: [Neurotic]: np

0:01 TEttinger: qz: could you do a gist or refheap paste?

0:02 I have a feeling like this is multiple files, and is affected by project.clj

0:06 qz: TEttinger: project.clj also?

0:06 [Neurotic]: dnolen: looks like this did the job nicely. Now I just need to call it ;) http://pastebin.com/CQjmNdFc

0:06 TEttinger: qz, if possible

0:08 qz: TEttinger: https://www.refheap.com/17783 https://www.refheap.com/17784

0:08 fbernier: How would this java be written in clojure ?: (PDPage)document.getAllPages().get( 0 );

0:09 qz: TEttinger: on fresh project repl works fine, so it must be something with this one

0:09 TEttinger: wrong ns name for the :main in project

0:09 it's testme in project.clj, ocr something in the actual file

0:09 needs to match the folder

0:10 dnolen: [Neurotic]: I would probably write it like this (def get-user-media (some #(aget js/navigator %) ["getUserMedia" "webkitGetUserMedia" "mozGetUserMedia"]))

0:10 [Neurotic]: dnolen: oh that makes more sense.

0:10 qz: TEttinger: it used to be same, i'm just in process copying everything to fresh project (because repl works fine in just-created project)

0:10 [Neurotic]: << clojure newb

0:11 dnolen: [Neurotic]: or if I was feeling like the pattern was too common, I might write a macro (detect js/navigator -getUserMedia -webkitGetUserMedia -mozGetUserMedia)

0:11 qz: TEttinger: worst thing is that run/compile work just fine..

0:12 TEttinger: qz, my interest is piqued. it works in a new project -- different name, different thisnamehere in src/thisnamehere/core.clj , but doesn't in the old one?

0:13 [Neurotic]: dnolen: cool. Haven't got as far as macros yet, but getting there. Thanks for the tip

0:13 qz: TEttinger: it works on fresh project without anything added to it. but fails with this project.clj and this simple main function

0:13 dnolen: [Neurotic]: fun stuff, np

0:14 TEttinger: qz: hm, that project.clj right? and the src folder has a subfolder, testme?

0:14 qz: TEttinger: removed maven local repo and import from that -- and now it works

0:14 TEttinger: oh, didn't even see that the first time

0:15 great

0:15 qz: :repositories {"local" ~(str (.toURI (java.io.File. "mvn_repo")))}

0:15 :dependencies [

0:15 [com.wcohen/secondstring, "13.08.15"]

0:15 ]

0:15 these 3 lines cause it to blow up

0:17 TEttinger: qz, I hope someone who is more competent with macros than myself can figure out why those lines do that...

0:18 can you legally use ~ in defproject?

0:18 qz: TEttinger: well, it works with compile/run in lein :p

0:19 TEttinger: I call it a victory

0:19 qz: TEttinger: well, i'd prefer repl to work also

0:20 TEttinger: ah.

0:20 wasn't sure if repl worked now.

0:21 oh

0:21 qz: TEttinger: those 3 lines kill repl, but everything else works fine

0:21 TEttinger: use :require and :import ?

0:21 in the ns, it uses :

0:21 outside the ns, those are functions, so it might be confused

0:22 qz: TEttinger: same thing

0:22 TEttinger: yeah, was a long shot

0:23 qz, what's the error now?

0:23 when you start a repl, is there a file or line number?

0:24 qz: TEttinger: same - https://www.refheap.com/17785

0:30 TEttinger: qz, woah... it may be a problem with nrepl?

0:31 qz, that file, form-init746830720517731947.clj , does it exist somewhere? either .m2 or target in your project directory?

0:32 it may have been a temporary file and deleted

0:33 qz: TEttinger: does not exist. must be deleted at some point..

0:33 TEttinger: yeah...

0:34 so has the repl worked at all in any version of this project?

0:35 qz: TEttinger: it works if i remove those 3 lines with local mvn repo

0:36 TEttinger: maybe the problem is with the local maven repo or how it's accessed? I haven't done that yet

0:38 qz: TEttinger: might be, but how to debug it? and again, it works if i just do "lein run"

0:38 TEttinger: where's technomancy when you need him...

0:39 technomancy: what is the recommended way to use a local maven repo in lein 2.x ?

0:42 qz: oh, lein author is around :)

0:43 TEttinger: but it might not be a lein problem

0:43 nrepl might not be working as hoped

0:46 callen: qz: read the docs?

0:47 er

0:47 TEttinger: ^^

0:47 not trying to be a pain, but I see the answer to that question almost everytime I skim the docs.

0:47 TEttinger: heh, I haven't read the docs on that yet. going now

0:48 qz: callen: non-working repl is mentioned in docs somewhere?

0:49 callen: qz: I misfired at the wrong person, sorry.

0:49 TEttinger: google picks up leiningen documentation just fine, in my experience.

0:49 if you just ask your question and append "leiningen" at the end, you'll be fine.

0:49 and if you aren't, well then it's time to ask in here and potentially file a github issue if it seems like a bug.

0:52 qz: callen: well actually its me with problem here, not TEttinger ;) and googling didnt help..

0:52 callen: oh. I'm a little soft eyed at the moment, sorry.

0:52 TEttinger: https://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md is the file in question

0:53 looks like you can use file:/// ... wait, 3 slashes?

0:55 sevvie: TEttinger: (str "file://" "/home/user")

0:55 TEttinger: ah. might work badly on windows.

2:02 holo: anyone here heard about "prayer oriented programming"?

2:14 Raynes: That's when you let amalloy work on your code and you immediately go to the nearest place of worship and pray for its integrity?

2:16 callen: holo: http://ninjahumor.com/wp-content/uploads/2013/05/My-code-doesnt-work-I-have-no-idea-why-My-code-works-I-have-no-idea-why.jpg

2:18 holo: hehe

2:32 Raynes: ucb: http://www.youtube.com/watch?v=SzRnZu-S6NE

2:38 wolfes: does anyone have thoughts on monitors? perhaps between a laptop with ext monitor of: 21" 1920x1080, 24" 1920x1200, 29" 2056x1080, or 30" 2056x1600

2:44 SegFaultAX: Go for 2x29 if you can.

2:44 Well, 2xmonitors in general is really handy.

2:45 And more screenspace is better if you have the desk for it.

2:48 TEttinger: wolfes, 8x30"

2:49 all just playing youtube

2:50 but seriously, I get by OK with 1080p on a laptop, but I can barely fit anything on smaller, like the common 1366x768

2:56 callen: wolfes: gaming or just work?

2:56 also it's 2560x(1440|1600) generally.

2:57 I'd argue 2x 1080p is more useful than 1x 2560x1600, if that's any consideration. porque no los dos? applies.

2:57 just be aware that anything above 1080p requires careful consideration with respect to hardware.

2:57 many, many laptops do not support anything higher than 1080p for an external display for various hardware reasons.

2:57 TEttinger: and anything more than 2 monitors?

2:57 callen: if more than 2 monitors are involved, do whatever.

2:57 TEttinger: (anything more than 2 needs special hardware right?)

2:58 callen: you're generally talking a desktop computer with at least one gaming grade graphics card.

2:58 AMD makes triple-display single-card graphics cards, but you won't want to deal with the drivers.

2:58 TEttinger: "perhaps between a laptop with ..."

2:58 callen: the only laptops I know of that support 2x 2560x1600 are extremely expensive gaming laptops and Apple Macbook Pros.

2:58 TEttinger: woah

2:59 callen: Macbook Airs support 1x 2560x1600

3:12 wolfes: callen: mostly work

3:13 i've set up 3x 21" 1920x1080 on my desktop, but i do most of my work on my macbook air now

3:13 callen: the macbook air can support one display unless you chain two thunderbolt displays (assuming it's a thunderbolt macbook air)

3:13 wolfes: early 2010 macbook air :(

3:14 no thunderbolt, will probably upgrade when retina comes to the next air model

3:14 Ember-: retina mbp is pretty damn light

3:14 it's thinner than the earlier mbp

3:14 I have the 13" model at home

3:15 so if it is the weight that's putting you off I suggest you go and try it out and see for yourself if it is too heavy

3:15 callen: I use a 15" Retina MBP for work, but have a frankly terrible monitor hooked up to it. I need to fix the ergos and workspace at work. :|

3:16 Ember-: 1.62 kg for the retina 13" mbp

3:16 13" air weighs 1.08kg

3:16 so significantly less but not THAT much

3:16 wolfes: oO

3:17 that's like 1 mango of weight

3:17 Ember-: I find that 1.62kg to be of no issue

3:17 only problem with 13" retina mbp is that it's gpu isn't quite up to the retina resolution

3:17 callen: Ember-: that's regrettable.

3:17 Ember-: it works just fine but now and then it can get a tad sluggish

3:18 wolfes: actually, the thing i dislike most about 15" mbp from a year ago is the way the front edge cuts into your hand

3:18 Ember-: if your mojo doesn't break into little pieces if it's not super smooth *all* the time then it's fine

3:18 wolfes: the other thing i haven't gotten used to is how hot the 15" model gets

3:18 Raynes: wolfes: Duct tape bro.

3:19 Ember-: but I'd expect the exact same problem with retina air models when they come out

3:19 wolfes: you're probably right :(

3:19 Ember-: you just can't push good enough gpu into air currently to handle retina

3:19 but it's not as bad as it sounds really

3:19 wolfes: i thought there were 2560x1600 screens on ultrathin windows laptops nowadays?

3:20 Ember-: yeah

3:20 retina is nothing spectacular anymore

3:20 it's great but not only on apple

3:21 the thing is though that osx is designed to scale nicely when the resolution goes up

3:21 windows doesn't scale as well

3:21 wolfes: i see

3:21 Ember-: small screen with huge resolution and with windows you better have good eyes :)

3:22 on osx you can choose the level of scale

3:22 wolfes: as a kid, i used to be able to barely read the fine print at the bottom of the eye charts

3:22 tsantos: I'm guessing Linux doesn't do so well either.

3:22 Ember-: photos etc will be at retina sharpness no matter the scaling

3:22 tsantos: no idea what's the current status there

3:22 would guess that gnome scales as well

3:23 kde might not, although I think there *just* came out a new version of kde

3:23 and of the more minor windowing managers I have no clue

3:25 glosoli: Hey folks, what would be the right way to create global JDBC connection that could be shared between threads ?

3:25 tsantos: I'm surprised how well 1920x1200 works on the MBP Retina display… it's actual resolution isn't a multiple at all, as far as I recall.

3:29 rurumate: Oi #clojure, how to generate a java class (for calling from java) with types? Say I want to generate a static java method SomeClass#doGoodThings(Integer, String), how do? gen-class? defrecord? reify? help thanks

3:29 TEttinger: rurumate, type hints?

3:30 rurumate: TEttinger: and gen-class?

3:30 is there an complete example somewhere?

3:30 TEttinger: yeah, that could work. not sure quite how type hints work.

3:31 http://www.learningclojure.com/2010/09/macros-and-type-hints-metadata-and.html some good tips here

3:32 rurumate: .. because java folks don't like a library where every method takes and returns an object

3:33 TEttinger: (let [^int x (rand-int 5)] (class x))

3:33 ##(let [^int x (rand-int 5)] (class x))

3:33 lazybot: ⇒ java.lang.Integer

3:34 rurumate: nice

3:36 TEttinger: you can add types for certain things by putting ^typename before the name. also helps avoid reflection

3:36 ##(let [^int x 5] (class x)) ;; this might error

3:36 lazybot: ⇒ java.lang.Long

3:36 TEttinger: huh, Long?

3:37 sometimes type hinting primitives throws errors

3:37 rurumate: so in general, gen-class should bake the type hints into the generated code (signatures)?

3:38 TEttinger: yeah, if it has type hints I think it will know about them

3:38 rurumate: oh by the way, how to generate a static method using gen-class?

3:38 TEttinger: type hints are pretty useful for java interop

3:38 oh I knew this

3:39 By adding metadata – via #^{:static true} – to a method declaration you can also define static methods.

3:40 https://kotka.de/blog/2010/02/gen-class_how_it_works_and_how_to_use_it.html

3:42 fredyr: apparently clojure auto-coerce primitive ints to Long

3:42 didn't know that

3:42 Ember-: and keeps on going to BigInteger

3:42 if you grow your numbers big enough

3:43 TEttinger: ,36rzzzzzz

3:43 clojurebot: 2176782335

3:43 TEttinger: hm

3:43 ,36rzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

3:43 clojurebot: 407457724995492699013934674155873859903826201780617058274757322369122994702986811490015284518679754852398694137855N

3:44 TEttinger: the N is for BigInteger

3:47 fredyr: btw the coercion is only for primitive ints

3:47 rurumate: something like (defn ^{:static true :tag Integer} -onlineLink [^Integer a ^String b]) maybe

3:47 fredyr: ,(class (Integer/parseInt "5"))

3:47 clojurebot: java.lang.Integer

3:48 TEttinger: ,(class (int 4.2))

3:48 clojurebot: java.lang.Integer

3:57 hardfire: hi, i was trying 4clojure and am having an issue .. the same code piece works for me in light-table but the site says unable to resolve symbol

3:58 SegFaultAX: hardfire: We'll need to see some code before we can help.

3:58 hardfire: http://pastebin.com/Mt0MsjU1 this is what i am trying ..

3:59 * hardfire was just pasting it

3:59 hardfire: it is the fibonacci one ..

3:59 i know i have not taken care of first 2 numbers .. but wanted to give it a shot .. couldn't understand why the error was showing up

3:59 trying it http://www.4clojure.com/problem/26 here

4:00 fredyr: java.lang.RuntimeException: Unable to resolve symbol: get-fib in this context"

4:00 ucb: morning

4:01 hardfire: exactly .. it works in light-table though

4:01 SegFaultAX: hardfire: You need to give your fn a name.

4:01 (fn get-fib ...

4:01 hardfire: Better yet, use letfn for this.

4:02 (Note that you can't rely on the label in the let binding because it isn't yet in scope when the function is compiled)

4:02 hardfire: u mean inside the let block too ? doesn't the (let [fn-name (function)]) work ?

4:02 doesnt work after giving it a name too though

4:02 SegFaultAX: No?

4:02 fredyr: hardfire: the let work, but your using the fn outside of the let block

4:02 SegFaultAX: Oh there's that too.

4:03 hardfire: aha! that was it .. though that means there's a bug in light-table's repl or the compiler

4:04 4clojure is really helping me grasp the concept . was trying SICP earlier but that takes a lot of time and pain .. no paitience for that

4:07 fredyr: right, letfn it should be

5:19 schmir: where can I find the -?> macro?

5:21 Anderkent: schmir: I know -?<> is in swiss-arrows, but not sure about -?>

5:23 AWizzArd: core.match — does it now work in AOTed code too?

5:28 schmir: Anderkent: looks like -?> is missing, but thanks for the pointer anyway.

5:30 Anderkent: AWizzArd: somewhat. Some match expressions still don't work, I think. Search for aot for core.match project on http://dev.clojure.org/jira/

5:31 ucb: callen: I'm really liking Black Moth

5:34 AWizzArd: Anderkent: kthx

5:58 turbopape: Hi guys,

5:59 anyone dit any work on anlyzing languages, preferably fench, who would share pointers, resources, etc... ?

5:59 I mean "natural languages", not compilers and the like ...

6:04 mpenet: what do you mean by analyzing?

6:06 noncom: why are here so many people that never talk?

6:06 who are they?

6:06 why are they here?

6:06 turbopape: mpenet, I mean processing these languages,

6:06 detecting knowledge, creating entities, etc...

6:06 I wanted to know if someone could help with some clojure material on the subject,...

6:06 mpenet: turbopape: opennlp and its clojure wrapper is probably the way to go

6:06 turbopape: to get me started...

6:06 ok, thank yo =u ...

6:07 mpenet: turbopape: it only comes with en models though, so you will have to do some home work first

6:07 turbopape: ok, I assume,

6:07 mpenet: easy enough to find online

6:08 turbopape: but I see a huge opportunity in localizing it in the languages we use in our region,

6:08 french and most probably arabic ...

6:12 mpenet: les modeles pour le francais sont trouvables via google, pour l arabe ca sera plus difficile a trouver j imagine

6:12 supersym: noncom: I figured half of them are foreign intelligence agencies ;)

6:12 noncom: :)

6:13 mpenet: turbopape: sinon tu devras les creer a la main

6:13 turbopape: merci pour le coup de pouce mpenet !

6:14 mpenet : mais c'est le truc le plus utilisé en industrie, opennlp ?

6:29 raxelo: Hi all, what can be the problem, when I run `lein compile` nothing happens

6:34 turbopape: raxelo, are you running this command inside your project's directory ?

6:34 raxelo: turbopape: yes I have created new project

6:34 Leiningen 2.3.1 on Java 1.7.0_25 Java HotSpot(TM) 64-Bit Server VM

6:35 when I run `lein check` it show my intionally made errors

6:35 but when I run `lein compile` nothing happens

6:37 turbopape: Indeed, I run across the same problem with the same lein version as raxelo

6:39 raxelo, I think you should specify (:gen-class :main true) in your ns declaration

6:40 Or at least this is what I found in a related forum thread

6:40 TEttinger: or :aot and the namespaces in project.clj

6:40 turbopape: raxelo, https://groups.google.com/forum/#!topic/leiningen/Z2bQAaluggY

6:40 TEttinger: otherwise it won't know to compile anything

6:40 :main doesn't automatically :aot anymore

6:41 turbopape: ok TEttinger ,

6:42 TEttinger: I solved the same issue with help in #leiningen a few days ago

6:42 turbopape: so one must specify :aot in the project.clj as the only way to tell "lein compile" what to do ?

6:42 noncom: raxelo: when i run compile, it does not say anything too. that always surprised me.. but the real result will appear in the "target" directory. try deleting it and funning compile again, see it will appear

6:42 raxelo: TEttinger: thanks - it helped

6:42 TEttinger: turbopape, I think lein compile only works when you have namespaced to :aot compile.

6:42 raxelo, great!

6:43 raxelo: TEttinger: yes I have added module to the :aot

6:43 noncom: for me it nevertheless fills in the "target" directory

6:43 raxelo: noncom: what is the version of lein ?

6:43 TEttinger: noncom, what version?

6:43 ha

6:43 noncom: 2.3.1 ?

6:43 TEttinger: it changed in 2.2.0, odd

6:43 maybe earlier

6:44 noncom: nope :)

6:44 TEttinger: maybe it's not compiling AOT, just making class files, but since it isn't using AOT it doesn't print?

6:44 raxelo: in my 2.2.0 it still works, so, yes it

6:44 TEttinger: I have no clue

6:45 noncom: i have aot and i have none-aot, so i have like all kinds.. and then it is simply silent

6:45 TEttinger: noncom, that is odd

6:45 you'd think it would print something

6:46 noncom: silently pushes all to the target dir, surely creating .class files for aot-genclasses and javac targets

6:46 yea, i thought it should too but...

6:46 i think that is no big problem (for me now) because i do not use plain leiningen for development.. the IDE does it all

6:47 does anyone here need packaging native libraries with lein?

6:47 i mean, projects that rely on native libs

6:47 TEttinger: I used to, I took them out

6:47 it didn't have issues

6:48 noncom: waht do you mean

6:48 TEttinger: but the native dependencies were themselves dependencies of a java maven project

6:48 lein fetched them just fine, I didn't use the native lib parts of the java maven lib but I didn't have problems

6:48 noncom: so did you have problems or did all go well?

6:48 oh i see

6:49 there were talks on problems with support for native inclusions, is that still true?

6:49 TEttinger: it's in the future of lein stuff

6:49 http://librelist.com/browser//leiningen/2013/8/8/what-s-next-for-leiningen/

6:51 noncom: what is *making* native dependencies?

6:51 doing jni?

6:51 s/doing/creating

7:12 Anderkent: i always thought the `jvm startup` was misnamed... It's not jvm startup, it's '120-jars-in-dependency-tree'-startup... time java Hello gives me 0.01s

7:21 noncom: Anderkent: yes.. and i'm not sure it can be fixed...

7:29 mikerod: emacs noob question: if you have multiple `package-archives` defined and you install a package found in more than one archive, where does it get installed from through `package-install`. (maybe this is a dumb question?)

7:43 agumonkey: mikerod: you should ask this on #emacs

7:48 mikerod: agumonkey: I suppose you're right

7:49 agumonkey: mikerod: not that there's much activity right now

7:49 mikerod: everyone must be asleep

8:09 ker2x: friendly greetings \o/

8:09 supersym: I dont know about emacs

8:10 but at least in here the majority is USA

8:10 aka different timezone :)

8:14 ker2x: i need just a littlebit of help with catnip please. my linux server is headless, so no graphic brower. so i installed lein on my windows and nodejs too. lein edit is working. i added nodejs to my project, now when i ctrl-s in catnip i have this error java.io.FileNotFoundException: Could not locate cljs/nodejs__init.class or cljs/nodejs.clj on classpath... how can i tell to install the...

8:14 ...missing bits of thingy that's needed to compile to nodejs target please ?

8:15 should i run lein cljsbuild once ?

8:15 mmm ho wait, idea

8:16 hehe i think that's the problem, the file is core.clj, not core.cljs

8:16 Ember-: (demoing clojurebot for friend, don't mind me)

8:17 ,(for [[k v] {:foo "foo" :bar "bar"}) k)

8:17 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>

8:17 Ember-: ,(for [[k v] {:foo "foo" :bar "bar"}] k)

8:17 clojurebot: (:foo :bar)

8:19 ker2x: src\snowtrail\core.cljs saved. Failed to serialise response. java.lang.NullPointerException: null

8:19 well, that's a fail

8:19 perhaps catnip is not to be used for nodejs project ?

8:21 supersym: ker2x: no idea, I use lighttable

8:22 ker2x: i can use it for clojurescript and nodejs ? i'll try then

8:22 supersym: which shouldn't have problems connecting, plus it works great on windows from my experience

8:22 yes its made using that

8:23 ker2x: well, actually i installed everything on my windows because catnip is hardcoded to listen to

8:23 supersym: you can add node.js connections, or the traditional REPL, hook stuff up..

8:23 ker2x: i'll take a look at lighttable, thank you

8:23 supersym: https://f.cloud.github.com/assets/3727933/992025/9fab79ce-0974-11e3-83a4-6bc2ffef7e89.png

8:24 ker2x: look good. testing. brb

8:24 supersym: left hand side, I evaluate a .js file generated by pedestal (ctrl+enter), and LT fires up a connection

8:24 that last bit can be less obvious to people

8:24 gl

8:26 ker2x: ./LightTable: error while loading shared libraries: libXrandr.so.2: cannot open shared object file: No such file or directory. ok, won't work on an headless server. testing on my windows then :)

8:28 ha of course, it's not a webapp :)

8:31 noncom: i have found a killing bug in cljs

8:32 something like (apply str (repeat 5)) hangs the entire web browser page and then it craches

8:32 tested also here: http://www.clojurescript.net/

8:33 is it a bug or is it a feature?

8:34 omg, it also hangs clojure itself

8:34 rkneufeld: noncom: That's an infinite string though

8:34 noncom: like (repeat 5)

8:35 rkneufeld: yeah, it is, but it is not an excuse to hang the whole browser page

8:35 ker2x: why not ?

8:35 noncom: ker2x because (repeat n) is a valid usage of repeat

8:36 rkneufeld: Sure, that's valid. But trying to print it is infinite (unless you use '(set! *print-length* 10)` or something)

8:36 noncom: i forgot to put smth like (repeat n "-") and spent long time finding the bug.

8:36 i understand why that happens, but that is not very good..

8:37 in nrepl with regular clojure i get that:

8:37 ker2x: it should solve the halting problem and don't run anything that's not halting :)

8:37 noncom: => (repeat 5) OutOfMemoryError Java heap space java.util.Arrays.copyOf (:-1)

8:37 ker2x: back to lighttable, brb

8:38 rkneufeld: Sure, it's trying to realize the entire list. Have you tried setting *print-length*–that should let you work more easily with infinite lazy sequences like that

8:39 noncom: rkneufeld: yeah, agree, *print-length* is a must to know, but still i do not agree on the behavior of repeat. let alone cljs, it is still young but clj comes up with heap space error wow!

8:40 rkneufeld: noncom: I'm not following what specific part you disagree with?

8:40 noncom: that it silently hangs the entire system, while (repeat n) is listed in the doc as a valid call

8:41 ,(doc repeat)

8:41 clojurebot: "([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."

8:41 TEttinger: ,(take 20 (repeat 5))

8:41 clojurebot: (5 5 5 5 5 ...)

8:41 noncom: ,(repeat 5)

8:41 clojurebot: (5 5 5 5 5 ...)

8:41 rkneufeld: I think it is important to separate the sequence (range x) returns, and the act of printing it. If you never try to print the entire list, it doesn't realize it.

8:42 TEttinger: ##(take 20 (repeat 5))

8:42 lazybot: ⇒ (5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5)

8:42 TEttinger: ##(repeat 5))

8:42 lazybot: java.lang.OutOfMemoryError: Java heap space

8:42 TEttinger: and this won't finish

8:42 ker2x: and the browser hang until it does it's equivalent of out of memory error, that make sense

8:42 its*

8:43 noncom: well, ok, idk then. now in ccw under eclipse i simply put (repeat 5) into the repl and it comes with the out of heap err

8:43 yeah, sure i understand the technology and theory behind that, but...

8:43 well if you say that this is ok, then ok then

8:44 rkneufeld: If you want to play with the infinite sequence, why not try using a def instead (and not trying to print the whole thing)

8:44 TEttinger: noncom, it's very useful when using take and stuff that deals in lazyseqs

8:44 ker2x: i don't know when the whatever-javascript-engine is deciding that you ran out of memory

8:45 TEttinger: ##(take 20 (map inc (repeat 5)))

8:45 lazybot: ⇒ (6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6)

8:45 noncom: in my console in ccw (repeat 5) comes up with java heap error

8:45 hyPiRion: ,(repeat 20 5)

8:45 clojurebot: (5 5 5 5 5 ...)

8:45 TEttinger: it's repeating the number 5 infinitely. so it runs out of heap yeah.

8:45 noncom: here it works right

8:45 oh, nvm

8:45 ker2x: change the soze of the java heap and wait until it swap :)

8:45 TEttinger: did you use take?

8:45 noncom: no

8:46 TEttinger: take makes it finite

8:46 noncom: i suppose it must return LazySeq@something

8:46 but it does not

8:46 rkneufeld: noncom: I think the bot has done (set! *print-length* 5)

8:46 noncom: good guess about the not, i'm sure this is the case

8:46 try in your repls

8:47 alright, ehere is the ultimate

8:47 go here: http://www.clojurescript.net/

8:47 type in (repeat 5)

8:47 hit enter

8:49 i guess as the console in CCW, so as HIMERA are calling to realize the seq

8:49 but, bear me, that is weird

8:50 at least the doc must say "no use in repls or calculation without *print-length*, (take) and the friends, otherwise all will hang"

8:50 IamDrowsy: noncom: well... you don't want to return (inc 5) something like Long@something... idk if the repl uses toString. but it will try to print some readable representation... and for seqs its the content.

8:51 noncom: i think it should be intelligent enough to understand that the seq is lazy and it is commiting a suicide

8:51 TEttinger: what if the seq is just very large?

8:51 IamDrowsy: lazy is not the problem here... infinite is

8:52 noncom: very large is what? exceeding memory capacity?

8:52 TEttinger: larger than what you expect to handle in a web app, so there's some limit set, like *print-length* 2000

8:53 someone with a 2500 item seq would be in trouble

8:53 noncom: idk. there must be something

9:08 ker2x: mmm i don't understand how to compile a lein projet with lighttable

9:10 To eval Clojure, open a .clj file and press Cmd/Ctrl+Enter. Light Table will find a leiningen project if there is one or it will use it's local REPL client to evaluate your code.

9:10 mmm k

9:12 Anderkent: whee finally got junit output working for midje ran by maven

9:14 noncom: hwo is your experience from lighttable?

9:14 would you consider a major production project with it already?

9:15 ker2x: i have a few mn of experience with lighttable :)

9:15 noncom: i'm trhinking about trying it for one of my next proj

9:15 eh, me too

9:16 ker2x: i'm trying to compile a clojurescript/nodejs project

9:16 probably not the best thing to start with

9:17 turbopape: ker2x, aren't you afraid by the long release cycle of lightable ?

9:17 noncom: i am afraid

9:17 ker2x: i'm not

9:17 noncom: why, are you fearless?

9:18 turbopape: easy guys ! didn't mean to scare nobody :)

9:18 noncom: :D

9:18 ker2x: if it does what i need why would i want an upgrade every weeks ?

9:18 turbopape: well, it seems not like stable stable, I mean, ...

9:18 noncom: actually i tried it and hoped for more improvements, so i'm kinda hesitate to see new releases, and they take sooo long...

9:19 0.3 -> 0.4 is a huge leap, but still there is much needs to be done

9:19 ker2x: my project isn't vital anyway, i'm in holliday and it was already wrote in good old regular nodejs. it's just for fun. my main ide is vim

9:19 wrote ? written ?

9:19 noncom: written

9:19 ker2x: thx

9:20 noncom: "i wrote" and "it was written"

9:20 ker2x: :)

9:20 noncom: passive-agressive voice :)

9:20 ahah

9:20 turbopape: by the way, ker2x, does it use your leiningen or its own bundled one ? I forgot...

9:21 ah its own ... I was mistaken with nightcode.info...

9:21 ker2x: i don't know. i just opened the directory i already wrote(!)

9:21 turbopape: actually your lein...

9:22 ker2x: i started clojurescript yesterday.

9:22 1) a single file without lein only linux using vim. it worked

9:22 2) same but with lein and cljsbuild. it worked too

9:23 turbopape: ok...

9:23 ker2x: got some toubles because nodejs fail with :whitespace optimization

9:23 today i tested catnip and lighttable

9:24 but can't compile anything successfilly, yet

9:25 being on windows isn't helping. i'm not even sure my nodejs install is ok

9:25 doesn't seems to be in PATH

9:25 ha no, it is :)

9:26 F:\clojure\snowtrail\out>node.exe main.js

9:26 Starting server

9:27 but it's an old version :(

9:27 so lighttable isn't compiling my project

9:37 Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cljs/*cljs-warn-on-undeclared* in this context, compiling:(lighttable/hub/clj/eval.clj:218:7)

9:37 etc

9:43 vmarcinko: hello, some newb question here from someone who wokred voerly long solely in java land... Unlike in java, source files that define namespaces and its functions (or global fields), are nothing but "shell scripts" that can contain arbitrary clojure operation calls, and are executed only once when someone requires that source file (.clj). Having namespace definition first (via ns), and function in that namespace

9:43 (via defn) is purely by convention, nothing is enforced, right? One can easily place other calls (scuh as println something), but this doesn't make sense, right?

9:44 Whereas in java, source files found on classpath are not some command scripts, they are declarative way to describe definition of classes, its methods, fields, namespaces etc...

9:44 opqdonut: yeah that's right

9:44 however it can make sense to have side effects in .clj files

9:44 something like (defn foo ...) (swap! global-nice-functions-atom conj foo)

9:44 hyPiRion: java files may have side effects too

9:44 opqdonut: as an example

9:45 Anderkent: vmarcinko: yes, you're right. One 'gotcha' is that the namespace is evaluated also when it's compiled

9:45 hyPiRion: put `static { System.out.println("heyoo"); }` and check what happen when you load it

9:45 Ember-: yup, those are called static constructors

9:45 Anderkent: so you can't expect the environment to be what it's gonna be on runtime - your file might be compiled before being put in a jar, or whatever

9:46 Ember-: ran on class load time

9:46 just the way it is in clojure namespaces

9:47 ker2x: well enough for now. i go play dcs ka-50, have fun :)

9:48 Anderkent: Ember-: well, not 'just like'. The clojure code is ran both on compilation and on class load time. The java is ran only on class load time

9:48 (but given that usually you only compile during ns load it's not apparent)

9:48 Ember-: Anderkent: true

9:49 vmarcinko: Ok, my point is that unlike java, where source files are meant to solely be some kind of declarative description of classes/packages/methods/fields, clojure source files are just command scripts, which by convention should use calls to define the namespace and functions, not having some special additional declarative language that would contraint source file writer to only use the file for that

9:49 Anderkent: yes, that's correct. The ns form is a convention, not requirement

9:51 nDuff: vmarcinko: if you *want* to constrain your source files, you can do that -- the available static-analysis tools are very much up to that task. I'm not sure why you would, though.

9:51 vmarcinko: ...incidentally, Ruby, Python, and others follow this same pattern; I wouldn't so much liken it to shell.

9:52 vmarcinko: ...moreover, if your .clj file _doesn't_ define a like-named namespace, that results in a compile-time error when trying to require that ns, so it's not actually true that you can have literally anything in them.

9:53 Anderkent: well, you can still load-file :)

9:53 vmarcinko: well, i tried having .clj files that define some vars without using ns before that, and it creates these var udner namespace of the namespace that required it

9:55 im not criticising the way, I just had some trouble udnerstanding it and this morning i noticed what was the difference between java and clojrue source files

9:56 or to describe in HTML example - definition of model that is to be shown in browser page is DOM tree in memory, and it can be generated in declarative way (HTML markup), or imperative way (JS calls to generate DOM elements). So clojure way would be something like if HTML files would be just sequence of JS calls to add HTML DOM elelment, then to add body DOM element underneath it etc...

9:59 bja: does >! return the port it puts to?

9:59 supersym: vmarcinko: you mean load-file? Besides that, I must have missed the beginning, but isn't maps something that would fit the description?

10:05 dnolen: bja: no it returns nil

10:09 vmarcinko: namespaces more or less maps to a Java packages, Clojure source file aren't "scripts" and namespaces have lots of value when constructing libraries designed to be consumed by other people.

10:13 vmarcinko: dnolen: i never said that they dont have a value, but it just seem to me they are much more script-y than java source files.. Actually, there is a value in being that way - a clojure developer already have to know scripty way of defining program structure because of REPL way of developing that structure, so its much easier than to just reause these same operation that we use in REPL in clojrue source files, without

10:13 the need to introduce some new declarative language just for that same purpose...If clojrue was static language, such as java, then of course, and developer would not to have structure defining API exposed to it, then solely declarative langage would serve better IMO

10:15 ugh, I made so many typos above, I hgope I made my point :)

10:15 dnolen: vmarcinko: many aspects of Clojure are surprisingly static, macros for one others because the host itself is static biased.

10:16 vmarcinko: ns has warts, but it gets the job done and unlikely to evolve much - if you're not writing everything with `load-file` put your ns form at the top.

10:26 mdrogalis: dnolen: I was monitoring mutually tail-recursive fns of go blocks. They don't seem to kill memory.

10:26 clojurebot: I don't understand.

10:26 mdrogalis: Kind of neat. Not sure how that happens.

10:49 mpenet: that sums up core.async nicely :)

10:52 atyz: Hey all - I'm trying to use a java sdk. So I've built the clojar and put it on clojars but when I try to use it I get the following: https://www.refheap.com/17833

10:52 Could anyone tell me if maybe I'm building it wrong?

11:03 Anderkent: argh. anyone here using mvn with clojure? (either clojure-maven-plugin or zi)

11:03 need to rant :D

11:04 turbopape: face

11:04 nDuff: atyz: ...eh. Why is it looking for all those 3rd-party pieces with your groupId?

11:04 matthavener: ~.

11:04 clojurebot: Cool story bro.

11:04 turbopape: oops, that was not intended to land here :)

11:05 matthavener: turbopape: whoops, me either :)

11:06 atyz: nDuff: it's looking for these files I believe https://github.com/box/box-java-sdk-v2/tree/master/BoxJavaLibraryV2/libs

11:06 nDuff: ...

11:06 Eww.

11:06 You really shouldn't be republishing 3rd-party jars under your own name.

11:06 atyz: I am not goign to publish it - I just want to use it

11:07 Anderkent: nDuff: org.clojars.name is the right way for non-public forks

11:07 atyz: your pom.xml/project.clj is wrong

11:08 nDuff: ...build.gradle, rather, but I don't know Gradle well enough to know why it's doing that -- the entries in the dependencies lists really are using their upstream groupIds.

11:08 Anderkent: you should change the group names for your dependencies to their publishers - org.apache for commons-lange etc.

11:08 atyz: If there is another way to use this without making a clojar I would be happy to use it

11:08 nDuff: Anderkent: atyz _is_ using org.apache.httpcompononts &c. in https://github.com/box/box-java-sdk-v2/blob/master/BoxJavaLibraryV2/build.gradle

11:08 atyz: I don't see your jar published to clojars at all. Do you just mean you're publishing to a local Maven repo?

11:08 Anderkent: Ah. I thought he was forking that jar, not that he owned it

11:54 futile: quick off topic question: do any of you use a Mac and want to beta test a minimalist music player?

11:55 if so, PM me.

11:55 </offtopic>

11:56 arrdem: $seen Engelberg

11:56 lazybot: I have never seen Engelberg.

12:01 noncom: atyz: hey

12:02 noncom: that's the dependency hell with clojars sauce

12:02 omfg i'm writing to myself... that must have been a stray mouseclick

12:02 atyz: did you solve your case

12:02 ?

12:03 atyz: noncom: hello!

12:03 I did thank you

12:03 noncom: you managed to push them all?

12:03 atyz: It was the that the dependencies were incorrect

12:03 I did thanks to Anderkent and nDuff

12:03 noncom: oh, so you fixed them for these that are present on clojars and all went fine?

12:04 atyz: noncom: i'm about to try and use the library - but everything is installing correctly

12:04 noncom: i see, i had a similar issue.. just wondering about how people solve it

12:05 Anderkent: noncom: it wasnt really a depencency hell problem, just a packaging mistake

12:05 nothing more complex than a miswritten pom :P

12:05 noncom: uh...

12:05 atyz: noncom: Anderkent is right - my bad :)

12:06 dnolen: tbaldridge: ping

12:06 atyz: It just came down to me not knowing how to do it correctly

12:06 tbaldridge: dnolen: pong

12:06 noncom: i thought you'd give me a recipe for my problem :)

12:06 dnolen: tbaldridge: so I'm looking at optimizing the CLJS core.async stuff

12:06 tbaldridge: dnolen: cool

12:07 dnolen: tbaldridge: I'm trying to understand the semantics of take-cb put-cb

12:07 sometimes these are boolean values and sometimes functions?

12:07 tbaldridge: dnolen: sometimes nil sometimes a fn.

12:08 noncom: dnolen: that's what i wanted to ask you about: a simple question: i have a table with like 100 rows and 20 columns. is it ok to give each cell a dedicated channel? what will it be in terms of speed and consumption?

12:08 tbaldridge: dnolen: if you get a fn back, you should can call it to continue execution of the go block. If you get a nil back then it's been enqueued into a dispatcher or attached to a channel

12:08 noncom: or maybe it is recommended to give one channel for the whole table?

12:08 tbaldridge: dnolen: eh...that might be wrong...can I get a line number?

12:08 dnolen: tbaldridge: put-cb and take-cb often come from impl/commit, but looking at the implementations sometimes a boolean value is returned

12:09 tbaldridge: I'm just looking at channels.cljs and async.cljs

12:09 the implementations of commit and the how ManyToManyChannel calls it and locally binds to put/take-cb

12:10 noncom: 2000 channels is not that many, just depends on how much traffic you want to go through the system, I'm actually looking at optimizing this right now

12:10 tbaldridge: dnolen: okay, now I see it.

12:10 dnolen: noncom: tbaldridge: in my simple throughput benchmarks take! and put! are the bottleneck

12:11 tbaldridge: yeah, to start it is either nil or a cb, and after the call to active?/commit it's a null/true

12:11 noncom: i see, looks like its ok then

12:12 tbaldridge: dnolen: to be honest, I'm not completely sure we need the commit thing. active we'll need, but I think commit is an artifact of the JVM impl

12:13 dnolen: tbaldridge: what doesn't commit do on the JVM?

12:13 tbaldridge: well alt uses commit, so perhaps we do need it.

12:13 bbloom: dnolen: what kind of throughput are you seeing currently? any idea what the target should be?

12:13 dnolen: bbloom: I'd like to see w/ in 4X of JVM

12:13 bbloom: dnolen: and what are we seeing on JVM now?

12:14 dnolen: I think we can probably do much better than 4X

12:14 ~400-500ms to spool a range of 1 million items

12:14 clojurebot: Pardon?

12:14 dnolen: 2.7 seconds on WebKit Nightly, 4-5seconds on Chrome Canary

12:15 bbloom: hm ok thx

12:17 tbaldridge: dnolen: you once mentioned switching to a linked list instead of using arrays for the queues, we could look into that as well

12:17 dnolen: tbaldridge: we could though I'm not convinced that's the bottleneck

12:17 tbaldridge: what does the bottleneck appear to be?

12:17 dnolen: there's a lot of function allocation going on right now when calling into put! and tak!

12:17 take!

12:18 tbaldridge: in CLJS complex boolean conditions (and (...) (...)) will often generate

12:18 cljs.core.truth(function() { .... }) if you are not careful

12:18 rarely matters for most code, but definitely matters for core.asycn

12:18 tbaldridge: yeah

12:19 dnolen: tbaldridge: so commit will return either a function or true

12:20 tbaldridge: where does it ever return nil?

12:23 tbaldridge: ok, so looking at the code now, it only ever returns a callback

12:24 dnolen: tbaldridge: line 107 in async.clj returns true

12:24 async.cljs

12:24 tbaldridge: dnolen: yeah, but that is never actually called, we allocate one flag per alt statement, and then wrap it for each clause in the alt

12:25 dnolen: tbaldridge: so alt-flag is dead code?

12:25 or you mean commit is never called?

12:25 tbaldridge: *called by the channel

12:25 it is called by the alt-handler commit fn

12:25 dnolen: tbaldridge: ok, so I just need to handle nil or a fn

12:26 tbaldridge: ish, but since we're on a JS JVM, we'll never get nil from alt-handler, since on the line before we say "active? handler"

12:27 dnolen: tbaldridge: k

12:27 tbaldridge: *JS VM

12:27 I can't type today.

12:28 on CLJS we'll never call commit on a inactive alt-handler. On JVM it's possible.

12:30 shdwprince: js have virtual machine?

12:30 juhu_chapa: Hi all!, How to debug the following line? CompilerException java.lang.RuntimeException: Unable to resolve symbol: in this context, compiling:(NO_SOURCE_PATH:1:792)

12:30 shdwprince: I thought it was interpreter

12:31 dnolen: shdwprince: nope, the big JS engines JIT

12:31 TimMc: shdwprince: JS has come a long way!

12:31 sinistersnare: shdwprince: yes.

12:32 well, you can be an interpreter and a JIT

12:32 java byte code is interpreted

12:32 tbaldridge: sinistersnare: I'm not completely sure that that happens any more.

12:33 sinistersnare: http://stackoverflow.com/questions/5625512/why-is-java-bytecode-interpreted i think this is the reason why

12:38 jkkramer: has anyone been able to use lein-difftest via repl? it's not working for me

12:38 `lein difftest` works fine

12:43 noprompt: dnolen: mind if i borrow your scripts in mori/bin?

12:43 dnolen: noprompt: nope

12:44 noprompt: dnolen: thanks :)

12:46 guns: noprompt: you should have told me writing for both CLJ and CLJS was a pain

12:46 :)

12:46 mullr: I made a macro which turns mutually recursive functions into a loop/recur block… I wonder if anything else like it exists already? It has many flaws, but perhaps is interesting: https://www.refheap.com/17846

12:47 (see the bottom to quickly understand its conventions and expansion)

12:47 noprompt: guns: it is a bit of a pain yes. however cemerick and lynaghk pointed me to https://github.com/lynaghk/cljx and that's a pretty good pain killer.

12:47 wolfes: what's a good pure-javascript clientside websocket library for connecting to http-kit server's websocket endpoints?

12:47 guns: noprompt: I looked at that, and it's great, but it feels like hacking on C with #ifdefs

12:47 wolfes: ie, for a chrome extension to connect

12:48 guns: not really REPL friendly

12:48 timsgardner: Anyone know a nice way to automatically and invisibly include namespaces for development? Sick of typing (use 'clojure.repl), (use 'clojure.pprint)

12:48 noprompt: guns: exactly my thoughts.

12:48 shdwprince: humm.. cpython compiles python files to pyc (byte-code), and inteprete it (even with JIT with pypy). Should I call CPython VM too?

12:48 wolfes: timsgardner: you want :repl-options in project.clj

12:48 sinistersnare: shdwprince: yes

12:48 timsgardner: wolfes: cools, thanks

12:49 sinistersnare: lots of languages run on VMs

12:49 wolfes: timsgardner: reference here: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L252-L254

12:49 ToxicFrog: shdwprince: VM applies not only to JITs.

12:49 sinistersnare: haskell does, lua....

12:49 _Bravado: is there a guide to idiomatic clojure

12:49 futile: yeah

12:49 ToxicFrog: It is exactly what it sounds like, a "virtual machine"; generally that means any target with no hardware realization whether the opcodes get JITted or not.

12:49 sinistersnare: _Bravado: best i can find http://clojuredocs.org/examples_style_guide

12:49 futile: _Bravado: this is a good start: https://github.com/bbatsov/clojure-style-guide

12:50 shdwprince: ToxicFrog: VM intepret it's own byte-code, when R(eal)M inteprets machine code

12:50 noprompt: guns: well, actually the cljx nrepl middleware seems seems to work out pretty nice.

12:50 shdwprince: but cpython called intepreter, and jvm - VM

12:50 ToxicFrog: shdwprince: my point is that cpython and puc-lua are python and lua VMs even though they don't jIT.

12:50 shdwprince: world full of lie

12:50 ToxicFrog: No

12:50 sinistersnare: shdwprince: words

12:50 shdwprince: ToxicFrog: jit its only dirty trick

12:51 *is

12:51 sinistersnare: dont think theyre mutually exclusive

12:51 arrdem: shdwprince: jit is a beautiful hack. get your wording right.

12:51 ToxicFrog: cpython is an implementation of a python VM. The fact that it doesn't JIT is irrelevant.

12:51 sinistersnare: you can interpret on a VM

12:51 guns: noprompt: Oh, I should look at that; I have a build of optparse.clj for CLJS, but I'm stuck on compiling a sample CLJS program in :advanced

12:51 ToxicFrog: The fact that it's an interpreter is orthogonal to that.

12:51 guns: No arguments are being passed to *main-cli-fn*

12:51 noprompt: guns: what are you running into?

12:52 sinistersnare: ToxicFrog: correct

12:52 ToxicFrog: You can have non-VM interpreters (bash, early Ruby implementations)

12:52 And generally "interpreter" carries the connotation that you can feed it source directly rather than needing a distinct compile step as with Java.

12:52 guns: noprompt: Nothing with optparse, just can't seem to get args passed to -main in :advanced; works with :simple

12:53 shdwprince: ToxicFrog: yeah, I figure it out

12:53 sinistersnare: ToxicFrog: correction: the .java is actually compiled (but to bytecode), then the JBC is interpreted

12:53 and JITed (compiled) when needed

12:53 so its all a great little scheme

12:53 arrdem: ok so I'

12:54 m sitting on this hoard of language grammars for instaparse..

12:54 how to publish? blog or github?

12:54 hyPiRion: gh with a blog which explains and elaborates on them?

12:54 arrdem: sounds good to me...

12:55 noprompt: guns: hmm... well if you push it to a branch i might be able to check it out later. or someone else here could help. :)

12:56 ToBeReplaced: Is there a library that does a better job of this: https://gist.github.com/ToBeReplaced/6283875

12:56 It's useful for programmatic docstring creation

12:56 noprompt: guns: maybe you need ^:export? :/

12:56 guns: noprompt: branch: https://github.com/guns/optparse-clj/tree/cljs ; But don't bother if you are busy! This just looks like a good ol debugging session

12:56 arrdem: ToBeReplaced: emacs meta-q?

12:56 ToBeReplaced: The equivalent of that, yeah

12:56 guns: noprompt: Okay, thanks for the hint

12:57 ToBeReplaced: Need it at clojure runtime

12:57 arrdem: urgh. I don't know of one.

12:58 noprompt: guns: yeah, i've gotta take off to go work my house for a little while. but i'll jump back on later today and take a look if you haven't figured it out already. ;)

12:59 guns: thanks noprompt; ttyl

13:01 noncom: ,(floats [1 2 3])

13:02 fbernier: I have a namespace requiring another namespace. this second namespace callse ":use" to import some libraries. Is it possible to call those librariees from the first namespace ?

13:02 calls*

13:02 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [F>

13:02 arrdem: fbernier: no, the first namespace must explicitly import what it needs directly.

13:02 noncom: ,(floats [1 2 3])

13:02 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [F>

13:02 fbernier: arrdem: thanks

13:02 noncom: how do i use (floats)?

13:03 hyPiRion: noncom: floats just casts to float[].

13:03 arrdem: ,(floats (into-array [1.0 2.0 3.0]))

13:03 clojurebot: #<ClassCastException java.lang.ClassCastException: [Ljava.lang.Double; cannot be cast to [F>

13:03 hyPiRion: I think you want to do this instead

13:04 Anderkent: any licensing magicians know if mit and ecl are compatible?

13:04 ucb: ,(doc floats)

13:04 clojurebot: "([xs]); Casts to float[]"

13:04 timsgardner: Hm, still confused why one would use partials in noir rather than functions returning hiccup data

13:04 hyPiRion: ,(into-array Float/TYPE [1 2 3])

13:04 clojurebot: #<float[] [F@7ca7e4>

13:04 Anderkent: also what to do about a project that says :license eclipse in project.clj, but MIT in readme ;((

13:04 Raynes: Anderkent: Email the author and tell him he's dumb.

13:04 arrdem: ^ that

13:05 noncom: hyPiRion: into-array gives boxed floats?

13:05 dnolen: tbaldridge: ok here's something else to consider

13:05 Raynes: It's pretty much impossible to use a library without a clear license.

13:05 noncom: looks like yes

13:05 arrdem: Anderkent: I'd assume he forgot about :license, but IANAL

13:05 hyPiRion: noncom: only if you do Float instead of Float/TYPE

13:05 dnolen: tbaldridge: we don't have threads in JS so we call dispatch every time, this introduces massive amounts of latency

13:05 shdwprince: Anderkent: maybe author forgotted to change default eclipse license in project.clj?

13:05 Anderkent: yeah so I'm thinking

13:05 noncom: hyPiRion: cool, that's what i need

13:05 thanks

13:05 tbaldridge: dnolen: right

13:05 noncom: (i mean Float/TYPE is the way for me)

13:05 dnolen: tbaldridge: if we instead track tick and only host dispatch say every 1024 ticks

13:06 hyPiRion: sweet

13:06 dnolen: tbaldridge: 1000000 messages w/ a sliding buffer takes 10ms

13:06 tbaldridge: (side node fixed buffer add! is a bottle neck)

13:06 tbaldridge: dnolen: fixed buffer add! with a full buffer?

13:07 dnolen: s/node/note

13:07 tbaldridge: now just implementation of fixed buffer period

13:07 noncom: what about inventing a TUL, a Totally Unclear Licence? Which is something like uncomputable thing. While lawyers will spend their lifetimes trying to resolve the TUL, programmers will simply code and use? And anything that gets in touch with TUL becomes TUL too

13:07 tbaldridge: dnolen: because at that point you're basically benchmarking the take/put queues

13:07 dnolen: tbaldridge: using unshift

13:07 tbaldridge: no

13:07 tbaldridge: dnolen: okay

13:07 dnolen: tbaldridge: if remove the tick, sliding buffer takes 2.7 seoncds

13:07 tbaldridge: nice!

13:08 dnolen: tbaldridge: I push the ideas to a branch

13:08 bja: any idea how to delete enclosing parens in paredit.vim?

13:09 Raynes: bja: I use surround.vim for that.

13:09 dnolen: tbaldridge: basically we want to yield to the browser less often and keep control a bit longer, not sure what granularity makes sense

13:09 tbaldridge: dnolen: now that does mess with the semantics a bit, Imagine a endless loop of gos with two puts, we would cycle through the first put in each go before returning and running the second put.

13:10 dnolen: can we make it time based? i.e. yield every 10 ms or something?

13:13 dnolen: tbaldridge: I don't see how time based change anything over the tick approach.

13:14 tbaldridge: if each tick took 100ms, you wouldn't want to do 1000 of them before releasing

13:15 dnolen: tbaldridge: I'm not sure how we can solve this problem - Node has this problem too :)

13:15 tbaldridge: dnolen: ah, nvm I understand ticks now. I thought you were saying dispatch every 1024 puts! or takes!

13:15 are you talking about clock ticks?

13:15 dnolen: tbaldridge: sorry, what I meant was

13:16 tbaldridge: put!/take! calls dispatch/run, if ticket < 1024, we run the task *now*

13:16 tick > 1024 we reset and use a real dispatch

13:17 clearing the stack etc

13:20 tbaldridge: dnolen: but that means as long as a ring of gos has work to do, it will slow dow the execution of all other code

13:20 *down

13:21 dnolen: tbaldridge: what other code? :) JS is single threaded

13:22 augustl: dnolen: hey :) In mori, is there a built-in function to turn a hash_map into a plain JS object? The use-case is for JSON.stringify

13:22 dnolen: tbaldridge: right now core.async in CLJS introduces an incredible amount of latency - most work will in fact be async currently this work is slow

13:22 augustl: I think I exported clj->js

13:23 augustl: dnolen: ah, cool

13:23 dnolen: tbaldridge: that said I'm not sure where we should set the knob

13:24 augustl: dnolen: hmm, there's no mori["clj->js"] property. The closest I can find is into_array, but that's obviously just for arrays

13:25 tbaldridge: dnolen: I think this can work, but we need to write a better dispatch system. When we call run, the cb should always be put into a queue. Then if tick < 1024 (or whatever the condition is) the run function returns a cb that should be executed. That way we don't ignore some gos who are waiting on (timeout).

13:25 dnolen: augustl: I need to push another release first, will try to do that soon

13:25 augustl: dnolen: cool, I'll make my own fn for now :)

13:28 dnolen: tbaldridge: I tried that but it seemed to me queuing stuff like that is actually more complicated not less

13:28 tbaldridge: by using dispatch you put the task in a the browser queue which will more or less do things in relatively the right order

13:29 tbaldridge: but a complex graphs of go blocks that get queued manually and run later will suffer since you're not running tasks in their natural order w/o a ton of logic

13:29 tbaldridge: is this on github somewhere? I'd like to take a look at it

13:30 dnolen: tbaldridge: I think Rich's intuition for wanting to avoid a scheduler is nice, but doesn't really line up with the latencies introduced by using setTimeout, setImmediate, MutationObserver, or MessageChannel

13:30 `cbp: For a websocket which one is easier to use, http-kit or aleph?

13:31 dnolen: tbaldridge: https://github.com/clojure/core.async/tree/optimize

13:31 tbaldridge: dnolen: I agree, I'm pretty sure we need a scheduler here. I've heard him speak against it in the context of CLJS.

13:31 dnolen: tbaldridge: this is why I think tick maybe an OK compromise, allow work to be done in the natural order, pick a respectable granularity, yield for timeout

13:31 clojurebot: Ack. Ack.

13:31 dnolen: s

13:33 tbaldridge: dnolen: But this code doesn't really preserve order. Consider 5 goes that all are listening to the same timeout chan. The first go will be run until it blocks, then the next, then the next. In the current design only the first state of each go would be executed. then the first state of the next, etc.

13:39 dnolen: here's what I'm worried about with the approach in your branch. The semantics of this code changes: https://gist.github.com/halgari/6284406

13:39 Now the last go is only run every 1024 ticks.

13:39 dnolen: tbaldridge: ^ my point about the knob, bit a tick count lower than the latency of dispatch

13:40 pick

13:41 technomancy: Raynes: look what you did raynes https://twitter.com/fuadsaud/status/369866447301795840

13:42 tbaldridge: dnolen: what test are you using for this?

13:43 I'm interested in giving it a try as well

13:44 dnolen: tbaldridge: I'm trying yours added mine to your gist

13:51 tbaldridge: so the funny things is that w/ my optimizations it takes 45-50ms, w/ master 220-30ms

13:52 tbaldridge: dnolen: that's odd

13:52 ed_g: how can I add a jar file to the clojure class path? this jar is a local file, not available through maven etc.

13:52 dnolen: tbaldridge: that's by starting to time right after channel construction and ending as soon as the timeout yield

13:53 tbaldridge: I've been tweaking the dispatch stuff playing around with different approaches for a while now

13:53 tbaldridge: all dispatch is SLOW

13:56 TimMc: technomancy: And is "brew install leiningen" the correct answer, as the person received?

13:57 dnolen: tbaldridge: in your gist did you mean to write while loop around the top two go blocks?

13:57 technomancy: TimMc: yeah, it sounds like he just didn't read the message he got

13:57 just giving Raynes a hard time

13:58 tbaldridge: dnolen: yeah

13:58 dnolen: that's why I think we should look into a scheduler, dispatch to the browser when we want to yield, but keep a private queue of work to be done.

13:58 noncom: ed_g: try adding the :resource-paths in your project.clj

13:59 tbaldridge: we could track with a flag if dispatching has already been done or not, so we don't end up with two dispatches enqueued at the same time.

13:59 noncom: ed_g: or if you're asking about plain clojure, then idk, possibly it'll work with the classic -cp thing

13:59 dark_element: TimMc bhauman, I have put some log messages now. Can you check what the log messages says now? kapilreddy.me/examples/korova_drop/

14:00 ed_g: noncom: thanks! i'll give that a try. i've been looking on the internet but it seems like everyone has their own method all of which seem very compliated.

14:01 noncom: ed_g: yes, me myself got killed several times when i took that road

14:01 bpr: i just updated nrepl (on MELPA) and now the repl window doesn't show a prompt and is not functional. Has anyone else seen this issue?

14:01 arrdem: hum... is there a way to tell instaparse to throw away whitespace mod inserting < WS * > groups everywhere in the grammar?

14:02 noncom: ed_g: do you want to add it there for dev or for release?

14:03 ed_g: it's a one-line script, so while its for production I'm just trying to get it done so I can finish something else.

14:04 justin_smith: bpr: yes, and I made a stack overflow answer describing the fix

14:04 noncom: ed_g: i see, so you do not use lein for that, u use vanilla clojure?

14:04 dnolen: tbaldridge: yeah I'm not convinced about the scheduler, I don't think core.async is for building threading abstractions

14:04 justin_smith: bpr: basically, the new el files were compiled using old code which was not backward compatible (that is my theory at least)

14:05 dnolen: tbaldridge: my main concern is that core.async event latency is unsuitable for using core.async as general messaging mechanism because of bad performance

14:05 justin_smith: bpr http://stackoverflow.com/questions/18208947/emacs-clojure-lein-and-nrepl-nrepl-buffer-shows-up-blank/18218870#18218870

14:06 ed_g: I'm using lein to manage the project, and :resource-path ["jars/*"] with the jar files in $project-directory/jars and it seems to be working great!

14:06 dnolen: tbaldridge: so we could build high level UI components, but if you want to efficiently propagate messages for hundreds of components and hundreds of changes in a short time span, not possible.

14:07 tbaldridge: dnolen: and the only way you're going to make that happen is to do dispatching less often, agreed.

14:07 noncom: ed_g: cool!

14:07 tbaldridge: dnolen: but unless you built that system right, you're going to end up with odd behavior where half you UI components are serviced before the others are

14:07 *your

14:07 that's what I'm trying to avoid here.

14:08 dnolen: tbaldridge: this not a real problem

14:08 tbaldridge: you would build a render channel which would collect changes

14:08 tbaldridge: but events may not get to that channel in until 1024 ticks have passed

14:08 dnolen: if some changes split across a boundary, not much you can do about that - most UI systems work this way.

14:09 tbaldridge: in fact it's desirable, you want as many changes as possible, but w/o blocking repaint

14:11 tbaldridge: for games, this is possibly a problem - but I'm not convinced core.async is good for games where everything needs to be sync at all times - you would just write that as something atomic in your system anyway.

14:17 tbaldridge: so fwiw, w/ my tick idea all my blog posts work great even w/ tick 1024

14:18 tbaldridge: and your degenerate gist case is just slower and spins the CPU in Chrome just as much a my tick version

14:18 looks like even slightly more

14:19 tbaldridge: dnolen: that could be because the gos are all very light. I've concerned about some other situations where heavy lifting (serialization, rendering, etc.) is being done in a go.

14:19 dnolen: tbaldridge: I ran my 10,000 go blocks example w/ ticks works fine

14:20 tbaldridge: auto completer involves a realistic number of channels - works fine

14:21 tbaldridge: my intuition is that 1024 ticks is still cheaper than dispatch and does not affect order in any interesting way.

14:22 tbaldridge: dnolen: that could be, i'm just interested in trying some other approaches before we throw in the towel

14:23 srruby: What is the idiomatic way to change the first item in a vector? I've been using (into [] (concat ["new_first_item] (rest x))) where x is a vector

14:23 tbaldridge: srruby: use assoc

14:23 ,(assoc [1 2 3] 0 42])

14:23 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>

14:23 tbaldridge: ,(assoc [1 2 3] 0 42)

14:23 clojurebot: [42 2 3]

14:23 eric_normand: srruby: (assoc v 0 42)

14:24 srruby: should be much faster

14:24 srruby: Thanks!

14:24 dnolen: tbaldridge: sure, but my hunch is that a scheduler will likely just add complication and latency, and honestly can't really be done correctly because lack of strong timing facilities in the browser

14:26 * bhauman is glad to hear dnolen and tbaldridge talking about this issue

14:26 tbaldridge: dnolen: yeah, perhaps scheduler is a bit to loaded of a term to use here. I'm more thinking a queue backed by a few int flags. Still FIFO, perhaps even tick based, but hopefully preserving order a bit better. And I may be completely wrong

14:26 bbloom: dnolen: tbaldridge: i just went back & re-read your discussion

14:27 tbaldridge: bbloom: I'm sorry

14:27 dnolen: bhauman: well this issue is blocking for doing more sophisticated with CLJS core.async :)

14:27 bbloom: tbaldridge: heh :-)

14:27 regarding "repaint" or yeilding or whatever

14:27 bhauman: dark_element: link again?

14:27 bbloom: i think it's perfectly reasonable to require that apps that need to handle "frames" require explicit buffering and "flush" operations

14:27 or "flip" in the double buffering sense

14:28 dnolen: bbloom: I wouldn't disagree w/ that

14:28 bbloom: you shouldn't be modifying the DOM directly in event callbacks if you need to prevent frame-tearing

14:28 dnolen: bbloom: you could push thousands of updates to a render channel, when it receives flush it calls requestAnimationFrame

14:28 bbloom: yep

14:28 dark_element: bhauman sure. kapilreddy.me/examples/korova_drop/

14:28 dnolen: bbloom: but currently channel put! latency is too high to do this.

14:29 bbloom: dnolen: yes, i know. you and i were discussing it a while ago where i suggested a "scheduler" that does precisely the thing you're calling not a scheduler w/ doing more work for a certain number of ticks :-)

14:29 dnolen: bbloom: heh, I remember you wanting it to be more sophisticated than a tick counter ;)

14:29 srruby: I've been thinking erroneously that assoc only applies to hashmaps. I guess for vectors (assoc v 0 42) is almost like v[0]=42 in other languages except that a new array is returned.

14:30 bhauman: dnolen: don't know if its helpful but I used googles new Web Tracing Framework to profile the dots game and setTimeout seems to be introducing the most latency

14:30 dnolen: that's if I'm interpreting things correctly

14:30 wink: is there any easy way to get the current vhost name used from luminus/libnoir/ring.. well, anywhere.

14:30 dnolen: bhauman: yes, this is true for setTimeout, setImmediate, MessageChannel, and MutationObserver

14:30 I've tried them all

14:30 augustl: wink: there's always the host header

14:31 hequ: I ran into "clojure.browser.repl is unidentified" problem when trying to open connection to piggieback nrepl from browser. has anyone been able to solve this issue?

14:31 bbloom: dnolen: all i was suggesting was not one-to-one message dispatch. adding a level of indirection through a queue or buffer or whatever for when callbacks get run is, in my mind, a scheduler, albeit a very simple one

14:31 dnolen: that's what you've discovered is necessary :-) so i'm glad we're on the same page now

14:31 wink: augustl: yeah, thought there might be a convenience function I missed

14:31 tbaldridge: bbloom: I would argue that putting rendering commands into a channel may be the wrong way to do it. Why not use an atom, and have changes insert a single value into a (chan (sliding-buffer 1)). The render go then uses a combination of timeouts and take to only render when needed.

14:31 bbloom: we can experiment with more sophisticated schedulers, if necessary, once the initial change is made

14:32 tbaldridge: bbloom: I've used that approach recently and it worked just fine.

14:32 dnolen: tbaldridge: using a atom for rendering commands just sound awful

14:32 bbloom: tbaldridge: sure, that works. the main point was that if you're modifying the dom after reading from a channel, you explicitly don't care about frame tearing

14:32 dnolen: tbaldridge: graphics pipelines are basically what bbloom and I are describing

14:33 tbaldridge: and why introduce an atom as intermediate if you can just write command to a channel directly?

14:33 seems like a middleman that does nothing

14:34 bbloom: however, if you have a frame-based system, i'm not convinced core.async is appropriate at all for handling of events

14:34 you need the ability to "drain" your event queue

14:34 bhauman: it does seem strange to implement an atom to handle a queue of messages when you already have a channel

14:34 seangrove: Isn't the atom effectively a "double buffer" that you can write to, and then read/render from every Xms?

14:34 tbaldridge: dnolen: less overhead. the atom can now update 10000 times in between a single repaint. So in my situation I was working on a game. The render loop was a go that executed roughly 30 times a sec. The game state was held in an atom. Game logic was held in gos that updated different parts of that atom.

14:35 bbloom: which potentially involves differentiating between Tn -> Tn vs Tn -> Tn+1

14:35 dark_element: hequ, is your source code pushed somewhere?

14:35 seangrove: tbaldridge: Sounds very reasonable

14:35 bbloom: tbaldridge: yeah, that's the sort of thing that only works w/ immutable data :-) hurray!

14:35 dnolen: tbaldridge: less overahead?

14:36 tbaldridge: I just demonstrated I could write 1 million update into a channel with a sliding buffer in 9ms

14:36 bhauman: whoa

14:36 bbloom: tbaldridge: in a more traditional C++ game engine, you can't do that b/c you need to stop all threads to not get all sorts of badness when some game world agent is modifying while you're trying to render it

14:36 dnolen: tbaldridge: that's approach 60ms territory

14:36 well it's well in 60ms territory

14:37 er 60fps

14:37 bbloom: my biggest issue w/ using core.async inside a game engine or UI framework is that it's explicitly non-determinisitc

14:37 that's a good thing in many cases, but it's a problem if you want to do things like replays or anything like that

14:37 dnolen: bbloom: yes, I'm really setting games to one side here

14:38 bbloom: I want fast channels so I can use channels fearless where I would traditional write

14:38 addEvent, fireEvent

14:38 bbloom: dnolen: yeah, that's a good goal

14:38 dnolen: i think it's a dramatic improvement over traditional events for UI work

14:38 hequ: dark_element: actually not and I also cannot do that because it's not open-source

14:39 bhauman: dark_element: Error creating WebGL context. three.min.js:428;

14:39 Uncaught TypeError: Cannot call method 'getExtension' of null

14:39 bbloom: dnolen: i'll save the non-core-async based ideas for another discussion

14:39 `cbp: anyone have an opinion on http-kit vs lamina for websockets?

14:39 hequ: I just don't get it why the piggieback nrepl doesn't work but I get it working from the lein trampoline cljsbuild

14:39 bhauman: dark_element: I'm on OSX Chrome 29.0

14:40 ibdknox: bbloom: I think you can do something far more clever for games that doesn't actually need core.async

14:40 bbloom: ibdknox: that's what i'm saying, only i'm saying it's even less clever :-)

14:40 ibdknox: bbloom: carmack talked a bit about it in his quake con thing

14:40 bbloom: ibdknox: yeah, he was talking about the full-memcopy w/ the write barrier. that's a damn good idea, he should do that :-)

14:41 i think that actors make more sense than channels for game agents

14:41 tbaldridge: ibdknox: I really want to try that in clojure, transients for the current state, persistent for past state

14:41 or actually frozen/unfrozen js objects

14:41 ibdknox: tbaldridge: it seems like tit would be pretty easy to put together

14:41 it*

14:42 bbloom: as awesome as core.async is, i want to write as little of it as possible :-)

14:42 ibdknox: me too

14:42 tbaldridge: ibdknox: I think it is

14:42 bbloom: principal of least power & all that

14:42 ibdknox: I don't want to manage time anymore

14:42 dnolen: tbaldridge: well you don't want to use Object.freeze in JS

14:42 ibdknox: we manage memory, why are we still managing time? :p

14:42 bhauman: whoa are we post core.asyc already

14:43 ibdknox: bhauman: give me a month ;)

14:43 amalloy: tbaldridge: i dunno, making the current state be a big transient doesn't sound great to me. it will be difficult to change anything in it, because you lose seqs, update-in, and many other useful abilities

14:43 ztellman: `cbp: can't give an impartial opinion, but let me know if you have questions about websockets in aleph

14:43 ibdknox: amalloy: I'd do each entity as a transient

14:44 tbaldridge: amalloy: are you familiar with carmack's talk? If not, watch the part on GCs and it'll make sense

14:44 `cbp: ztellman: awesome seems I'm trying aleph then :-)

14:44 amalloy: `cbp: i haven't tried using http-kit, but lamina has been doing a great job managing thousands of websockets for us for months

14:45 `cbp: kk

14:46 bhauman: ibdknox: amalloy: that shows up in my dots game example. I keep a reference to the dom element and mutate it

14:46 bbloom: bhauman: i was always more excited about tbaldridge's IOC macros than the CSP model, however good it is as a foundational model

14:46 amalloy: bhauman: nothing against mutable objects, just transients in particular since they're so hard to use

14:47 (nothing against transients *either*, of course, it just doesn't seem like using them to represent an entire game state will work well)

14:48 tbaldridge: amalloy: watch about 10 min of this vid starting here: http://www.youtube.com/watch?v=1PhArSujR_A&feature=player_detailpage&t=1354

14:48 bhauman: tbaldridge: thanks for that link

14:48 bbloom: tbaldridge: yeah, but the transient/mutable part isn't that interesting. carmack is talking about how to make existing stuff work sensibly in a mutable c++ world

14:49 ibdknox: who was that that wrote about "automatic time management" ? i saw that somewhere, heh

14:49 tbaldridge: bbloom: actually he's talking about how to get by using functional programming in a game engine. Basically how to have a GC without it killing performance

14:49 ibdknox: bbloom: the strategy of collecting partially applied functions and working against the previous state of the game world is interesting though

14:50 tbaldridge: bbloom: if you express your world as a series of states, then (dec state) can be read-only and state can be write only.

14:50 bbloom: tbaldridge: oh yeah, that's in there too. i'm a huuuge believer in the idea that we need runtimes w/ configurable heaps & GC as a library at what not. i want to be able to create a heap for each object, plus a heap for the game world the objects live in. real games do this sort of thing w/ crazy allocation pool nonsense

14:50 * bhauman has changed the look of his dots game example http://rigsomelight.com/dotsters/ in response to the branding concerns from weplaydots

14:51 ibdknox: bbloom: I don't remember, likely someone in FRP world.

14:51 dark_element: bhauman, what does chrome://gpu say?

14:52 bhauman: dark_element: well there you go WebGL: Unavailable. Hardware acceleration unavailable

14:53 dark_element: why would that be the case

14:53 dark_element: ?

14:53 dark_element: Oh i see a list of reasons below

14:54 dark_element: bhauman ahh bummer

14:54 bhauman: dark_element: it says I have an old computer

14:54 dark_element: WebGL is buggy with the NVIDIA GeForce GT 330M, 9400, and 9400M on MacOSX earlier than 10.8: 233523

14:55 dark_element: sorry I can't help more

14:55 dark_element: bhauman, no problemo

14:55 bhauman, thanks for taking a look

14:57 agumonkey: hey there

14:58 is there some kind of follow to clojure koans ? or clojure kata / golf ?

14:58 dnolen: tbaldridge: tick stuff aside, is it cool if I merge in my fixes around the boolean tests?

14:59 `cbp: agumonkey: maybe try 4clojure.com?

15:00 agumonkey: `cbp: not bad thanks

15:01 tbaldridge: dnolen: please do, I didn't know type hinting did anything in cljs

15:02 dnolen: tbaldridge: ^boolean is the one we really support, ^not-native is also there but a bit more experimental

15:02 bkirkbride: tbaldridge: thanks for the quick core.async fix yesterday

15:03 tbaldridge: bkirkbride: no problem, I was working in the codebase anyways.

15:04 bkirkbride: tbaldridge: is it normal to see a spike in threads when creating a bunch of go blocks?

15:05 tbaldridge: (dotimes [_ 10000] (go (>! ch))) bumped my JVM to 1800+ threads before GCing them

15:06 tbaldridge: bkirkbride: try the latest on master, I optimized that yesterday

15:06 bkirkbride: the current algorithm should use numcpus + 42.

15:06 dnolen: tbaldridge: mind if I fix the timeout channel race test?

15:06 bkirkbride: yeah, I thought it might be the cachedThreadPool thing

15:06 dnolen: tbaldridge: they just need to be in the same go block

15:07 tbaldridge: bkirkbride: that being said, your test is a bit contrived

15:07 dnolen: sure

15:07 bkirkbride: tbaldridge: sure, my example left out the msg and I think I was actually <! from the channel...

15:08 tbaldridge: I was testing the impact of spinning up go blocks that immediately blocked. To test my assumptions/understanding. Not as benchmark

15:08 tbaldridge: The really strange thing was that adding a Thread/sleep after creating the block made the thread count jump MUCH higher.

15:08 tbaldridge: bkirkbride: no, my point is, core.async isn't really a parallel processing library. So the idea is more that you should have 1 channel per task boundary, and just enough gos to swap things around. Anything else is overkill.

15:09 bkirkbride: yep, don't use Thread/sleep inside a go, the executor thinks you're doing work, and so it allocates more threads to do the work you were asking it to do (create more gos).

15:10 bkirkbride: here's the way I like to think about it, spin up numcpus gos for each task in your system. Then use channels to pass the data between gos

15:10 bkirkbride: if you don't have 10000 cpus, then starting that many gos just slows things down.

15:11 stuartsierra: tbaldridge: I wonder if Google would come after us if we called them "goroutines"?

15:13 bkirkbride: tbaldridge: Right. Depending on the granularity of your tasks it might involve a lot of threads though.

15:13 tbaldridge: Definitely not, the sleep was outside the go at the end of the dotimes, that's what was weird.

15:13 hyPiRion: seems okay, Go is under the BSD2 clause.

15:13 bkirkbride: tbaldridge: Ok. I hadn't thought about it that way. I found that go blocks make for a really clean limiter on parallelism.

15:13 hyPiRion: *license

15:13 technomancy: hyPiRion: that doesn't cover trademarks though

15:14 tbaldridge: bkirkbride: that's what reducers are for

15:14 bkirkbride: tbaldridge: I just created a go block for each task that blocked on a buffered channel with 10 things in it and they put another thing in it when done. Really, really nice thread limiter but apparently abuse of the system.

15:14 hyPiRion: technomancy: well, they've covered "Google Inc." and "the names of its contributors"

15:15 bkirkbride: tbaldridge: Hmm, I'd looked at doing it in a reducer and abandoned that. I'll take another look.

15:15 tbaldridge: Thanks for the tips, much appreciated!

15:15 hyPiRion: but hm, IANAL.

15:16 tbaldridge: bkirkbride: no, that's fine, I'd just say, if you need to process 10000 things either consider putting 10000 things into a channel, then use 4 goes to pull data out and do work on them.

15:16 just don't spin up 10000 gos, one for each item to process

15:16 stuartsierra: Of course, we could call them 'coroutines' and be in the clear.

15:21 Or come up with an even cleverer name.

15:21 zilti: Someone of you ever tried using JavaFX from Clojure? I ran into a small(?) problem: http://stackoverflow.com/questions/18341827/no-content-is-shown-on-the-stage

15:21 hiredman: coroujines

15:21 stuartsierra: ouch

15:21 * llasram groans

15:21 bbloom: *sigh* lol

15:25 seangrove: I'm curious to experiment with web-workers + reducers in cljs, but another day, perhaps

15:26 Hard to find "lowish-level" clojurescript hackers in SF willing to meet up and experiment

15:27 si14: how possibly this piece of code can cause reflection warning? (aset (double-array (.data new-m)) (int i) (int 0))

15:27 "call to aset can't be resolved"

15:27 muhoo: seangrove: clojure meetup

15:28 seangrove: or, suggest cljs for a dojo exercise

15:28 seangrove: muhoo: Clojure dojo has been good, but the skill level and time is spread pretty thin

15:28 Might be good to have an "intermediate/advanced" dojo meetup

15:29 muhoo: i like the mixed bag

15:29 hiredman: you are writing an int to a double array?

15:29 dnolen: stuartsierra: hmm when built CLJS it didn't create a tag in the GitHub repo, did I miss some step?

15:29 muhoo: i got to watch over zach's shoulder as he hacked, was a real treat

15:29 konr`: why should I use (seq x) instead of (not (empty? x))?

15:29 stuartsierra: dnolen: busy now, will investigate later

15:30 dnolen: stuartsierra: k thx

15:30 jtoy: can anyone recommend an article/info on how to write clojure objects to disk? Im not finding good info on google

15:31 muhoo: jtoy: pr-str

15:31 jtoy: thanks,

15:32 muhoo: writes sexps, not objects. read em back in with read edn, roundtrips nicely

15:32 zilti: dnolen you have to explicitly push tags to the repo

15:32 jtoy: muhoo: I just want to write maps out to a file, is that considered sexps?

15:33 zilti: jtoy: (spit "filename" (str datastructure))

15:33 konr`: nevermind, just rtfs :)

15:34 mpenet: jtoy: that kind of works, until you require to keep the types intact (numeric types, array-map vs hash-map, etc)

15:35 jtoy: then you use nippy or something similar

15:36 jtoy: hmm, json might be good for this too as its cross platform

15:37 zilti: jtoy: EDN is cross platform too

15:37 mpenet: if you need to be able to use it from other languages yes, but you loose Sets, arbitrary keys, keywords etc etc

15:37 zilti: There are EDN implementations for at least Java, C# and Ruby.

15:38 jtoy: im using ruby and clojure

15:38 zilti: So you could use the EDN-Library for Ruby instead of using JSON as an additional format

15:38 seangrove: zilti: Quite slow in the browser though, depending on the volume of data

15:38 si14: hiredman: yeah, you are right, that was the error — kinda strange that it was "can't resolve" error.

15:39 hiredman: well, not really. stupid mistake. my bad.

15:39 zilti: seangrove: Sure, since in the end Javascript it has to parse the whole structure character for character and can't just import it like JSON

15:40 ToBeReplaced: loosely on topic; how do people here feel about versioning data?

15:40 zilti: I'd like to punch the JavaFX API designer in the face

15:40 bbloom: ToBeReplaced: if you have to do it, it's a good idea to include a "tag"… and no that doesn't mean a version number

15:41 ToBeReplaced: bbloom: I was thinking #foo.bar{:x blah :version blah}

15:42 seangrove: ToBeReplaced: What's the goal of versioning?

15:42 bbloom: ToBeReplaced: it's OK to include a version number, but i don't believe in version arithmetic, so i'd rather the "version" just be "format" and be a string or map or something

15:42 ToBeReplaced: i'm new to this problem; dunno how it's handled... data contract between systems A and B changes, but there's still a lot of left over data to be consumed by B

15:43 seangrove: ToBeReplaced: Ah, got it

15:43 ToBeReplaced: I want to send more data with A, and have B be able to differentiate old vs new

15:43 bbloom: ToBeReplaced: there are several schema systems out there for EDN (i dunno if any of them are any good)

15:43 ToBeReplaced: bbloom: do i just google EDN schema? or do you have one/some in mind?

15:44 boodle: not sure why this won't work.. https://www.refheap.com/17863 I'm trying to replace empty strings w/nils in a map

15:45 bbloom: ToBeReplaced: none in mind, though a few were discussed on the mailing list. but it's unlikely to be worth the overhead. just say "i'll always send you a top-level map, and the map will always have a :format key, and the :format key must be X Y or Z"

15:45 ToBeReplaced: yeah

15:45 bbloom: ToBeReplaced: something like {:format :my.namespace/blarg2, :other "data :here 123}

15:46 zilti: boodle: (if (empty? %))

15:46 bbloom: that's as simple as it gets

15:47 boodle: zilti: I'm still getting weird err msgs about java.lang.String can't be cast to clojure.lang.Associative

15:47 dnolen: boodle: update-in doesn't work like that, you can't update keys in parallel in that way.

15:48 bbloom: boodle: yeah, re-read ##(doc update-in)

15:48 lazybot: ⇒ "([m [k & ks] f & args]); 'Updates' a value in a nested associative structure, where ks is a sequence of keys and f is a function that will take the old value and any supplied args and return the new value, and returns a new nested structure. If any levels do not exist, hash-maps will be created."

15:48 boodle: But I pass a sequence of keys (array) and thought it'd iterate through each passing its value into my fn

15:48 dnolen: (zipmap (keys map) (map #(when-not (= % "") %) (vals map)))

15:48 bbloom: hm, yeah, not completely clear...

15:48 dnolen: boodle: that's not how update-in works

15:48 bbloom: (doc get-in)

15:48 clojurebot: "([m ks] [m ks not-found]); Returns the value in a nested associative structure, where ks is a sequence of keys. Returns nil if the key is not present, or the not-found value if supplied."

15:49 bbloom: (doc assoc-in)

15:49 clojurebot: "([m [k & ks] v]); Associates a value in a nested associative structure, where ks is a sequence of keys and v is the new value and returns a new nested structure. If any levels do not exist, hash-maps will be created."

15:49 boodle: dnolen: k

15:49 bbloom: boodle: the operative words being "nested associative structure"

15:49 the keys are a *path*

15:49 otherwise, it would be a coll of keys, not a sequence

15:49 boodle: ok.. got it. I kept assuming that since it'd take a sequence it would iterate thru... oops

15:50 mpenet: ,(clojure.set/rename-keys {:a 1 :b 2} {:a :aa})

15:50 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>

15:50 mpenet: :(

15:51 bbloom: ,(require 'clojure.set)

15:51 clojurebot: nil

15:51 bbloom: ,(clojure.set/rename-keys {:a 1 :b 2} {:a :aa})

15:52 clojurebot: {:aa 1, :b 2}

15:52 bbloom: tada!

15:52 mpenet: ah! it's allowed?

15:52 bbloom: i was surprised by that too, heh

15:52 mpenet: I always wondered why it sits in clojure.set

16:01 bbloom: dnolen: i'm so glad people are paying attention to algebraic effects :-)

16:02 dnolen: i think it's *the* biggest missing puzzle piece in the functional programming world

16:02 muhoo: mpenet: lots of good stuff, like stringify-keys or keyordize-keys

16:06 dnolen: bbloom: hmm, I don't follow since I mostly see it as being mostly of theoretical interest if you don't mind the cost of reifying effectts at a higher level

16:07 bbloom: dnolen: it's only expensive perf wise b/c the JVM doesn't have delimited continuations or heap allocated stacks

16:07 dnolen: bbloom: for some stranger capabilities, like cheap amb, or the probabilistic stuff could be useful

16:08 bbloom: dnolen: having an effect handler system like this (albiet with proper dynamic extent) would open up a whole new world of experimentation with the ideas that gave birth to things like core.async

16:09 dnolen: bbloom: still more theoretical than practical - you need a machine and a surrounding language for it to matter

16:10 bbloom: or show that you can target traditional hosts w/o imposing significant overheads

16:10 bbloom: dnolen: the scala folks have proven that you can do delimited continuations on the JVM without significant overhead

16:10 dnolen: unfortunately, it's a type-directed approach

16:10 dnolen: bbloom: yes, that pretty cool

16:10 bbloom: it's entirely possible to do w/ clojure, but it would require the compiler perform static inlining of all higher order operations

16:10 which is also provably possible in practice for a dynamic language. Factor does it, for one

16:11 mpenet: muhoo: these in clojure.walk!

16:12 muhoo: these are *

16:13 bbloom: dnolen: if you recall back when i was trying to do the CPS transform, i was trying to follow the scala approach

16:13 dnolen: unfortunately, it requires tagging of functions that have control effects

16:13 dnolen: you can bypass that tagging if you only have to tag a few primitives & then defunctionalize (ie inline higher order functions)

16:14 but then you need to tag higher order functions… but luckily, you can do that with inference as long as the higher order functions are named arguments

16:14 if you have a truly dynamic higher order function, like a map with closures in it, then you wouldn't be able to support control effects inside that function

16:14 attempting to use a control effect in there would cause a runtime error

16:15 you can solve *that* problem by adding a "call" primitive, which is what Factor does

16:18 dnolen: bbloom: I guess what I mean is I find the literature about effect composition to be fascinating, but ultimately something neat to think about - most languages let you compose effects just fine - you just do it.

16:19 bbloom: dnolen: right, but the only way you have to *control* those effects is via dynamic scoping. for example the *out* var for controlling where printing goes

16:19 dnolen: effects give you a better way to structure that, such that all side effects always have their influence scoped to some control value

16:20 dnolen: that means you can do things like with-out-str where you can swap out the effect implementation, but you can do that for things like non-determinism, or mutable state

16:21 want to have every read/write logged to all your atoms? you can just make that work

16:21 you can't (reliably) do that via with-redefs or binding or whatever

16:25 dnolen: bbloom: are you saying you could make it so that the effect handle scope is a no-op and then becomes enabled when you need it?

16:26 bbloom: dnolen: in Eff, you can't have an effect unless you have a handle to an effect instance. that doesn't mean that you need to thread an argument through everywhere. it just means that, underlying every effect, is some single object that owns the effect operations

16:27 dnolen: in theory, you can view clojure as occuring inside the dynamic extent of a "java effect handler"

16:27 which gets dot operations, finds the global "java effect instance" and then sends it a message

16:27 the java handler evaluates java code, and continues clojure execution with the result

16:28 in theory, that is just optimized to directly pushing java on the stack, b/c java always returns

16:28 (baring exceptions, etc)

16:28 but imagine if you had clojure.core/java-effect

16:29 you could redefine that to trace EVERY INTEROP CALL

16:29 you get power to abstract over dynamic extent, communication with the outside world, etc

16:30 in a composable way

16:30 it's a big deal

16:30 the Eff guys say: "handlers are to delimited continuations what if/while are to goto"

16:31 so far, i'm inclined to believe them

16:38 dnolen: i should also add that effect instances make it possible to do effect inference

16:38 dnolen: just like type inference

16:50 noncom: are there any plans to extend core.async for network integration?

16:51 dnolen: noncom: tbaldridge was toying with that at one point

16:52 noncom: how was it?

16:52 dnolen: noncom: no idea ask him next time he's around

16:52 noncom: ok

16:54 stuartsierra: dnolen: I see the r1859 tag on GitHub, isn't that from the latest release?

16:54 dnolen: stuartsierra: oh hmm I didn't see it

17:01 shiranaihito: can i somehow "splice" a sequence into a function call's "variadic arguments"?

17:02 like python's "somefunc(*list_var)" -- where "somefunc" would take a variable number of arguments

17:02 guns: shiranaihito: Use the apply function

17:02 shiranaihito: the asterisk would tell python to "destructure" (or whatever :p) the list variable's contents into the call

17:02 hmm

17:03 llasram: shiranaihito: ##(apply + 1 2 [3 4 5])

17:03 lazybot: ⇒ 15

17:03 shiranaihito: alright, i'll look into it, thanks!

17:03 guns: With CLJS :nodejs :advanced compilation, the arguments to *main-cli-fn* are nil without an extern file for the process package

17:03 is this intended?

17:04 using lein-cljsbuild forgot to mention

17:09 rhg135: any news on clojure on android, i mean is it any faster/smaller, last time i tried it took ~1min to start and was ~10mb

17:11 nDuff: rhg135: AFAIK, targeting Dalvik is a non-goal for Clojure-on-JVM.

17:12 rhg135: cljs is in a much better state re: usability on smaller environments.

17:12 sevvie: guns: I know this doesn't solve your problem but I am curious what you put in externs.js for it?

17:12 rhg135: i know, buthas anyone worked on it recently?

17:13 dnolen: guns: probably makes sense to handle that at cljsbuild or in your project, node.js support is really rudimentary

17:13 guns: sevvie: I used an externs file for the node.js process module. The issue is that (.-argv nodejs/process) is optimized away without it

17:13 llasram: rhg135: https://github.com/clojure-android/lein-droid

17:13 guns: dnolen: ok, got it

17:14 rhg135: ok

17:14 just was wondering if that was dead?

17:14 llasram: It had a commit like 2 days ago :-)

17:15 sevvie: guns: ah, right, I see what you're saying now. Thank you.

17:16 rhg135: ic

17:17 zilti: I figured out JavaFX on Clojure, including how to use it from the REPL https://coderwall.com/p/4yjy1a Seems like OpenJDK is making problems.

17:17 clojurebot: Ack. Ack.

17:17 rhg135: it's hard to justify clojure to android devs if it's useless on dalvik

17:18 but i do it anyway

17:19 noonian: I hadn't touched android in a few years, but my first clojure app for android was was simpler than what I remember having to do from java

17:19 way* simpler

17:19 I'm not sure how well it would work with a larger app with real UI's though

17:20 rhg135: well i'm about to write a small radio app

17:20 it'll be open source

17:20 hope that goes well

17:20 noonian: nice, best of luck

17:24 TimMc: Multimethods question!

17:25 I have a namespace "auth" that defines a multimethod, and this is require'd by another ns. There are other namespaces that contain logic for various implementations, including additional defmethod dispatch targets.

17:26 In an interactive session today, I discovered that because these implementation namespaces were nto getting require'd, their dispatch targets were not getting called. My two questions: 1) How should I fix this, and 2) how did this ever work before?

17:29 konr`: on core.logic, I've got a symbol v from (membero [k v] foo) I'd like to test in inside of a conde to check if it's of a given type. How can I do it? `map?` etc fail because it's an c.c.l.LVar.

17:30 sinistersnare: is there a way i can auto import things when i type 'lein repl'? i just dont want to do a (use 'clojure.repl) (use 'clojure.pprint) everytime i start a repl up

17:31 schmir: sinistersnare: yes

17:31 sinistersnare: schmir: clever

17:32 would you mind telling me how?

17:33 shdwprince: sinistersnare: :repl-options :init in project.clj

17:33 schmir: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L294

17:33 (sorry, had to look it up)

17:33 sinistersnare: its ok

17:33 thanks much guys

17:34 fbernier: Hey, I've made this small app which converts a pdf page to an image and serves it via http. The memory keeps growing quite a lot at each request and never seem to go down. Can anyone spot why?

17:34 https://www.refheap.com/8c792058fea41edb0f9f8d127

17:35 noncom: fbernier: looks like you do not close the out stream?

17:36 but that wouldn't cause such a leak i guess..

17:36 fbernier: when I benchmark it I get at about 1.5g in a minute

17:37 and it just never goes down

17:37 noncom: is it when there is no work or when there is work?

17:37 noonian: fbernier: I don't know where the reference is being held on to, but could it be because you create a new ring handler with a pointer to the bytestream with each render call?

17:37 fbernier: well memory is stable when there is no work

17:37 and grows when there is

17:38 jtoy: how can I say in clojure, give back to me from collection 4th element to the end?

17:38 in ruby i would do collection[4...-1]

17:38 konr`: ,(drop 4 (range 10))

17:38 clojurebot: (4 5 6 7 8 ...)

17:38 noonian: jtoy: it might not be idiomatic, but (-> col rest rest rest rest) would work :P

17:38 benkay: ,(doc drop)

17:39 clojurebot: "([n coll]); Returns a lazy sequence of all but the first n items in coll."

17:39 noonian: ah, drop

17:39 AimHere: ,(nth (reverse [1 2 3 4 5 6 7 8 9]) 3)

17:39 clojurebot: 6

17:39 jtoy: nice,didnt know about drop

17:40 shdwprince: fbernier: I can only suggest closing streams in render-image

17:40 edbond: fbernier, try imagemagick convert

17:41 fbernier: noonian: unsure about that ... I'm quite green to clojure

17:41 edbond: fbernier, "convert -density 288 image.pdf[0] -resize 25% image.jpg"

17:41 fbernier: noncom: shdwprince: I'll try that.

17:42 edbond: there's a reason I'm converting and serving them on the fly via http :)

17:42 noncom: fbernier: you might as well consider using a profiler

17:42 shdwprince: fbernier: and dont forget that you can monitor memory of JVM on fly

17:43 fbernier: yeah I know I can but I've never done this yet. WIll have to search and seek how.

17:47 srruby: Is comp commonly used to compose functions in clojure?

17:47 noncom: srruby: only when it heps

17:47 sinistersnare: ,(doc comp)

17:47 clojurebot: "([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."

17:48 callen: technomancy: I presented and explained a Clojure project to my coworkers today. Leiningen was very popular. :)

17:49 noncom: callen: what is the techno bckg of the coworkers?

17:51 what is the simplest way to reload all in ccw?

17:53 Apage43: technobackgammon

17:53 callen: noncom: they're all Python people with the greybeards being ex-Scala hackers.

17:53 ex, because of the Python people.

17:53 I should do a presentation called, "JVM Strikes Back!"

17:54 noncom: nice!

17:54 Apage43: i hear you

17:55 shdwprince: callen: make 4 presentations first and name it episode 5

17:55 noncom: ahahaha

17:55 and start from the 3rd one

17:55 (or 4th? omg i dont remember details about that saga)

17:55 shdwprince: Revenge of the JVM?

17:56 callen: noncom: 4thm

17:56 noncom: let me know if you figure out how to reload-all in CCW.

17:56 noncom: i always was more into start trek

17:56 callen: I was testing CCW the other day and couldn't figure out how to do that.

17:56 shdwprince: clojure is a new hope of jvm

17:56 callen: there might be a generic way to do it in any REPL

17:56 and if there isn't, it should be written.

17:57 noncom: i guess 'll eventually ask laurent petit.. when i see him..

17:57 scala: the princess is in another castle

17:58 technomancy: callen: o/

17:59 callen: technomancy: the guy who'd done Java + Maven before was especially impressed with Leiningen and that Clojure was "just a library"

17:59 I showed him lein-scalac :)

18:00 technomancy: its-a-trap.jpg

18:04 shdwprince: callen: when you write "just a library" you mean't "just a dependency"?

18:04 moominpapa: Sorry, I know this is a stupid question but googling isn't helping me: if I've got a namespace a.core and a protocol defined in it X, what does deftype expect me to describe the protocol as in another NS? a.core/X doesn't seem to be working.

18:05 shdwprince: moominpapa: a.core.X should work

18:07 moominpapa: Okay, and how do you require it? (:require [a.core :refer [X]]) doesn't seem to be working.

18:08 ToBeReplaced: moominpapa: your require should work

18:12 moominpapa: Huh.

18:12 It's insisting no such protocol exists.

18:18 It appears the refer line will accept any old rubbish, but deftype actually wants to check.

18:19 Anyone have an example of this working on github they can point me to?

18:20 tim__: dnolen: ping

18:22 moominpapa: Actually, maybe it generates a warning but the generated code is OK. Let me investigate.

18:23 tbaldridge: dnolen: I think you have a bug in that gist you sent me. I added a count to the take side to count the number of messages received. It's only getting 1000 of them.

18:23 hyPiRion: you must import it

18:23 it's one of those things

18:26 yedi: is there a blogpost that depicts the stages of a clojure programmer's journey?

18:27 noncom: yedi: there were some like that but i have no links.

18:28 dnolen: tbaldridge: heh yes, I thought it about it some more, I think the event performance issue is trickier than I thought ... something to continue to ruminate on

18:32 moominpapa: Hyperion: import doesn't seem to do the trick either :(

18:32 Assert failed: Only lib.Ctor specs supported in :import; offending spec: [ajax.core AjaxImpl]

18:32 hyPiRion: hm, strange

18:33 moominpapa: And now you can work out which project I'm working on :)

18:34 The annoying thing is: the code actually works. I just can't make the "this protocol doesn't exist" warning go away.

18:36 Ah, hang on...

18:36 ...nope, stet. The protocol runs, the compiler just doesn't seem to like it.

18:40 technomancy: leiningen 2.3.2 is out; feel free to `lein upgrade`

18:40 I think we got all the nasty bugs this time

18:40 hyPiRion: (inc technomancy)

18:40 lazybot: ⇒ 69

18:40 callen: (inc technomancy)

18:40 lazybot: ⇒ 70

18:40 technomancy: (inc cemerick)

18:40 lazybot: ⇒ 13

18:40 callen: technomancy: thanks for making it so easy to convince my workers to test Clojure for an important project. :)

18:40 technomancy: ^ who actually performed the release this time around

18:40 callen: (inc cemerick)

18:40 lazybot: ⇒ 14

18:41 yesac: (count (:bugs leiningen))

18:41 technomancy: (dec leiningen-bus-factor)

18:41 lazybot: ⇒ -1

18:41 sinistersnare: bus!

18:41 (leiningen-bus-factor)

18:41 what is that?

18:41 hyPiRion: technomancy: yeah, it's up to 3 now, isn't it?

18:42 and you should increase the bus factor mister, not decrease it :p

18:42 technomancy: hyPiRion: yeah. maybe I can rope you in for the next one =)

18:42 callen: (inc leiningen-bus-factor)

18:42 lazybot: ⇒ 0

18:42 technomancy: hyPiRion: oh yeah; I always get that wrong

18:42 callen: technomancy: you aren't thinking of handing it off are you? :(

18:43 hyPiRion: callen: you need two ?? and you'll get an immediate answer for that

18:43 right??

18:43 lazybot: hyPiRion: What are you, crazy? Of course not!

18:43 technomancy: callen: no, just could be struck by sudden-onset-crippling-RSI or something

18:43 callen: hyPiRion: thanks. :)

18:43 technomancy: with that weird keyboard you use? no way.

18:43 technomancy: callen: heh... well it's about to get weirder

18:43 hyPiRion: sinistersnare: The bus factor of a project is the amount of people who needs to be hit by a bus (and thus die) to kill the project.

18:43 technomancy: just ordered an ergodox

18:44 sinistersnare: hyPiRion: so we need one more person on the project for it to die?

18:44 its -1!

18:44 callen: hyPiRion: or at least necessitate a long time spent relearning or replacing the project.

18:44 sinistersnare: I inc'd it.

18:44 hyPiRion: sinistersnare: heh, it's 0 now. But yeah, it's up to three people now.

18:44 sinistersnare: wait

18:45 so is it dead? im so confused

18:45 technomancy: (inc leiningen-bus-factor)

18:45 lazybot: You want me to leave karma the same? Fine, I will.

18:45 TimMc: sinistersnare: No, it's just that the bus factor itself is disliked.

18:45 hyPiRion: (inc leiningen-bus-factor)

18:45 lazybot: ⇒ 1

18:45 technomancy: derp

18:45 hyPiRion: Whaa

18:45 (inc leiningen-bus-factor)

18:45 lazybot: ⇒ 2

18:45 hyPiRion: (inc leiningen-bus-factor)

18:45 lazybot: ⇒ 3

18:45 hyPiRion: there

18:45 sinistersnare: :D

18:45 yay!

18:45 who are the three main people? technomancy, ?, ?. ?

18:45 technomancy: I still need to get creds for updating leiningen.org and the leinreleases tweetor account

18:46 sinistersnare: xeqi and cemerick so far

18:46 sinistersnare: oh cool

18:47 technomancy: they're the ones I have signed GPG keys for, so they get the keys to the kingdom. there are lots of other contributors too.

18:47 sinistersnare: yay

18:49 TimMc: technomancy: I don't think I have your key.

18:49 technomancy: TimMc: we can remedy that at strangeloop or the conj, your pick =)

18:49 TimMc: I won't be at the Conj, unfortunately.

18:50 Or SL.

18:50 sinistersnare: TimMc: you should buy me a ticket to the conj for technomancy's sake

18:50 technomancy: ah bummer

18:51 TimMc: Are you 0x77E77DDC?

18:51 sinistersnare: is he a user here?

18:51 no

18:51 technomancy: maaaaybe

18:51 sinistersnare: im sinistersnare

18:51 but youre probably talking to technomancy :p

18:52 technomancy: TimMc: that's my key, but you shouldn't trust it without verifying it in person

18:52 TimMc: *nod*

18:52 technomancy: or transitively verifying it via someone you trust in person

18:52 TimMc: Over the past year my thinking has changed on this; there is little to no evidence of MitM attacks (yet!) for key exchanges, so for most purposes an unverified key is just fine.

18:53 technomancy: I guess you could confirm it by asking hard questions about leiningen internals that an impostor wouldn't be able to answer

18:53 but it's hard to give general advice about that kind of thing

18:53 TimMc: Nah, still susceptible to MitM, if that's your concern.

18:53 Verification can always be done later. Using encryption and signing is better than not using encryption and signing, as long as you keep an eye on what you've set the trust level at for a key.

18:54 technomancy: this is true

18:54 TimMc: Ooh, I wonder if...

18:54 zero-ex-3BBF4E12: nice

18:55 No leading numerals allowed, though.

18:55 konr`: on core.logic, is there something similar to `membero` for hash-maps?

18:56 TimMc: technomancy: What we really need at this point is good tooling: Automatic key fetching, searching of encrypted email, nice UIs for showing what's encrypted and what's not in an email...

18:56 dnolen: konr`: not really, you can seq first - but if all you want to do is detect something you have featurec

18:57 technomancy: TimMc: easypg makes a *huge* difference vs what I used to use

18:57 before easypg it felt like eating my veggies; now it's just a seamless thing I take for granted

18:58 TimMc: Ooh, and mail clients need to ad encrypt-to-self as a default.

18:58 People are gonna be *pissed* if they find they can't read email they sent to someone else.

18:59 wink: easypg? *googles*

18:59 argh. emacs

19:00 I should've known

19:00 dnolen: tbaldridge: we definitely need to get rid of unshift from CLJS core.async - http://jsperf.com/array-push-vs-unshift/32

19:01 tbaldridge: dnolen: yeah I was looking at that exact error earlier today

19:01 callen: email just in the way its used can't really be secured.

19:01 kyled1: hmm, anyone have opnions about less vss scss (sass), vs stylus?

19:01 callen: you'd have to "cut over" to something different in order to have everybody on board with full encryption

19:01 wink: kyled1: sass worked like a charm everyday, had some meh experience with less, but can't pin details anymore

19:01 Apage43: dude

19:01 wink: s,everyday,every time,

19:01 konr`: dnolen: the problem is that when I get a v in (membero [k v] (seq my-map)) that is also a map, in the original data, I lose the ability to do a (seq) on it, as it's an LVar

19:01 Apage43: multiparty encryption in general is just pretty hard

19:02 kyled1: wink: thanks

19:03 cespare: kyled1: I've used all of them for nontrivial projects, I rank them sass > less > stylus. Stylus is way to fast and loose (and nascent/poorly impelemented/documented) for my taste, but I'd be ok with either sass or less in future.

19:03 *too

19:03 dnolen: konr`: well seq definitely won't won't in general, perhaps worth adding some kind of constraint that will give you seqs

19:08 TimMc: callen: Email contents can be secured, but the tools for it are pretty annoying right now.

19:08 kyled1: cespare: cool, thanks

19:09 i guess heres the bigger question, would you recommend using it with yui3 grid?

19:09 cespare: haven't used yui3 myself, sorry

19:09 kyled1: woah, i jsut realized i am in the wrong channel haha, sorry

19:09 cespare: haha

19:22 supersym: :)

19:32 wink: kyled1: if it soothes your mind, that wasn't especially offtopic :P

19:36 bbloom: dnolen: you ever look at Qi/Shen & it's logic system?

19:36 curious your thoughts on it

19:39 kristof: bbloom: it's prolog for clojure.

19:39 bbloom: Er, for Lisp I mean.

19:39 bbloom: kristof: sure, but i'm curious where it fits in to the CLP(X) worldview

19:40 kristof: bbloom: On one of the clojure conj 2012 videos (the one about Typed Clojure), Ambrose commented on it.

19:40 C-L-what?

19:40 seangrove: dnolen: I'm working on implementing "real" keywords for clojurescript, think I have a reasonable grasp on how to do it, but want to get a sense for how long you would guess for it take - is it a small-to-medium project, or large?

19:40 bbloom: kristof: (for-all [x] (constraint-logic-programming x))

19:41 kristof: bbloom: Does clojure.logic not already have constraint based programming?

19:41 Er, core/logic

19:42 .... core.logic, it is

19:42 bbloom: kristof: there are many types of constraint programing models. core.logic supports several & aims to include others wherever it makes sense

19:42 kristof: Cool =) I have to look it up sometime, after I read the Reasoned Schemer

19:42 hiredman: bbloom: where x is some kind of adt?

19:42 bbloom: hence my interest in dnolen's view

19:43 srruby: Are people using :pre and :post much ?

19:43 hiredman: I've been using them a lot recently

19:43 bbloom: hiredman: i was being cute. much of the CLP lit refers to CLP(S) for sets or CLP(FD) for finite-domain

19:43 technomancy: srruby: I don't, but I know I should

19:44 bbloom: hiredman: hence CLP(X)

19:44 glosoli: Hmm anyone uses some color scheme on VIM which could is friendly with clojure and highlights function calls ?

19:46 dnolen: seantallen: medium, probably same as fixing source maps

19:46 arohner: what was the name of the library to use CLJS datastructures from plain JS?

19:46 bbloom: arohner: mori

19:46 arohner: bbloom: thanks

19:47 dnolen: bbloom: it's cool, it's Prolog, far as I can tell core.logic is competitive in terms of resolution perf

19:48 bbloom: dnolen: ignoring the goofy, very un-lispy syntax, it seems like it's a little different than prolog under the hood, but provides prolog as a stylized pattern of use

19:48 dnolen: bbloom: right, sequent calculus - which Prolog is a fragment of

19:48 bbloom: dnolen: it has defprolog or whatever that activates horn-logic syntax for doing *programming* which is clearly different than the underlying sequent calculus engine

19:49 dnolen: gotcha

19:50 dnolen: so i realize that core.logic's primary mode of use is comparable to prolog, but what of that underlying sequent thing? or other more rich logics?

19:50 dnolen: seems like reified logic variables is the big idea that enables collaborating CLP models, no?

20:02 dnolen: bbloom: yes, most CLP system have some notion of logic variable

20:03 bbloom: I'm not that familiar with Shen's resolution system but it can't be that dramatically different from what else is out there

20:04 bbloom: dnolen: that's what i figured. i was kinda hoping you had a more complete sense of the design space to compare & contrast for me. i just don't know much about the tradeoffs & priorities

20:04 dnolen: bbloom: my assumption is there's to service the type system and it results in a fairly poke-y Prolog

20:05 bbloom: dnolen: from what i can tell, it's actually a more powerful prolog that exists to enable you to write your own type systems

20:05 … of which they provide one

20:06 dnolen: bbloom: yes it's "lower" level than Prolog in some sense. Mark Tarver published a book on Qi II that explains the whole thing more or less. I have a copy and haven't gotten around to reading it.

20:13 ed_g: is there a clojure equivalent of MAPLIST?

20:14 dnolen: ok more or less everything I said early today about core.logic messaging performance was wrong :P

20:14 bbloom: dnolen: core.async? lol. what did you discover?

20:14 dnolen: er core.async CLJS messaging performance I mean

20:14 bbloom: I just didn't understand when dispatching happened

20:14 bbloom: ed_g: have you looked at clojure.walk ?

20:15 dnolen: bbloom: and I didn't understand why rhickey thought we don't need a scheduler

20:15 bbloom: task granularity can be encoded in the buffers themselves

20:15 bbloom: it wasn't obvious to me because CLJS core.async implementation of buffers is busted

20:15 bbloom: dnolen: what's busted about them

20:15 dnolen: bbloom: they're modeled around .unshift on arrays

20:16 crazy slow

20:16 bbloom: dnolen: blargh. yeah full O(N) copy

20:16 dnolen: so for large buffers perf goes out the window

20:16 bbloom: dnolen: this is for buffered channels?

20:16 dnolen: should use a circular array buffer

20:17 dnolen: so I think as soon as I fix this

20:17 you will get lightening fast message performance if you pick the right buffer size

20:17 bbloom: for fipp, i experimented w/ several buffer sizes & found that *width* (the max look-ahead for the measuring process) worked out nicely

20:18 i'm not really sure how to pick a buffer size in general though

20:18 dnolen: bbloom: I don't it can be done in general but it not something I really that much about

20:18 pick a fat buffer when you're going to pumping out tons of updates

20:18 and small ones or none otherwise

20:19 this why all my attempts at larger examples broken down

20:19 picking larger buffer sizes wasn't helping

20:19 bbloom: ah makes sense

20:19 benchmarking is hard.

20:19 switch to a ring buffer :-)

20:19 i <3 ring buffers

20:20 most under appreciated mutable data structure :-)

20:20 dnolen: bbloom: looking at them right now

20:21 bbloom: seems like it would work for all the buffer types

20:21 as ring buffer is just underlying storage

20:21 bbloom: dnolen: never implemented a circular buffer before? it's good fun the first time, you're basically 100% likely to fuck up an off-by-one edge case :-)

20:22 dnolen: tbaldridge: btw, forget everything I said earlier today about core.async

20:22 tbaldridge: all my issues are because the buffer implementation as array doesn't work for large buffers

20:22 tbaldridge: I'm thinking about implementing a ring buffer for core.async as suggested by bbloom

20:23 ed_g: bbloom: hmm, looks like walk still just gives each item, what I want is the entire lst, then (rest lst), then (rest (rest lst) etc.)

20:23 maybe its there and I'm not seeing it

20:24 bbloom: egghead: maplist doesn't exist in clojure b/c (with several types of collections) it would be unclear what behavior it should have. clojure.walk is a dramatically underpowered generalized structure walker. generally, you just have to peak at it's code and write the < 5 lines you need for your particular traversal

20:24 ed_g: oops for you, not egghead , sorry

20:24 ed_g: see also tree-seq

20:24 ed_g: bbloom: fantastic, thank you!

20:24 bbloom: dnolen: http://www.museful.net/2012/software-development/circulararraylist-for-java

20:25 dnolen: you wouldn't use that for clojure.core.async, since you need thread safety, but that code can be ported to cljs directly for the single threaded environment

20:25 you can even drop get, set, remove(i) etc

20:25 :-P

20:37 dnolen: eh, for core.async I don't think we need antyhing more than this http://gist.github.com/swannodette/6288965 :)

20:38 bbloom: dnolen: excellent

20:38 dnolen: s/unshift/conj/ ?

20:39 dnolen: bbloom: it a low level thing to to be used only inside of buffers.cljs, drop in replacement for array is the idea here.

20:40 should be wicked fast

20:40 bbloom: dnolen: sure, but you're taking advantage of the overly permissible compiler. you need either a defprotocol or should make non-member functions :-)

20:41 dnolen: bbloom: nah, Object methods were intended for this as far as I can tell :)

20:41 bbloom: dnolen: also, does the surrounding code enforce the max size on the buffer? b/c your unshift method doesn't

20:41 dnolen: bbloom: surrounding code does this

20:42 bbloom: ring-buffer really is perfect here, was thinking about a linked list

20:42 bbloom: but this will have much better performance

20:42 bbloom: yup

20:42 dnolen: bbloom: thx

20:42 tbaldridge: dnolen: this will only work for buffers though, as put/take queues need to be unbounded (or grow to max-queue-size)

20:43 dnolen: tbaldridge: yes, where would I use it?

20:43 bbloom: i'd still remove the members b/c they don't enforce any meaningful invariants & my inner/dead OOP programmer hates methods that leave objects in inconsistent states

20:43 dnolen: tbaldridge: where else would I use it I mean except for buffers

20:45 tbaldridge: dnolen: I'm just questioning if this is really the bottleneck right now. If we switch from pop/unshift to push/shift we get a massive perf boost right there, the current buffers are just using the wrong ones

20:45 idk, it seems that if we get (chan 1) working as fast as possible, all the rest will fall into place.

20:46 bbloom: tbaldridge: both shift & unshift are O(N)

20:46 dnolen: tbaldridge: push shift both involve resizing, no JS engine is going to like that

20:46 tbaldridge: bbloom: but unshift is 98% slower

20:46 bbloom: tbaldridge: seriously? heh.

20:46 dnolen: tbaldridge: how is unshift slower?

20:46 bbloom: fucking javascript

20:46 tbaldridge: that's the link I posted a few minutes ago

20:46 dnolen: tbaldridge: oh yeah in general yes

20:46 tbaldridge: that why I think switching to a ring buffer is the way to go

20:47 bbloom: circular arrays are basically the optimal data structure for a fixed size buffer

20:47 dnolen: tbaldridge: the JS engines likely do the same thing we do for small arrays, slightly bigger array to support shift unshift

20:47 tbaldridge: dnolen: yeah, it probably is, we'll still need 3 implementations though, as sliding/dropping will do different things to head

20:47 dnolen: tbaldridge: why?

20:47 tbaldridge: all them of them work on the array in the same way in the code?

20:48 tbaldridge: dnolen: nope, notice the remove! in the add! of sliding buffer, it's not there in dropping buffer

20:48 ah I suppose we could wrap the ring buffer, yeah, that could work.

20:49 dnolen: tbaldridge: that's what I mean :)

20:49 bbloom: tbaldridge: yeah he just made a ring buffer w/o any invariants that mirrors the javascript array interface

20:49 dnolen: tbaldridge: it's a drop in replacemnet for *array*

20:49 tbaldridge: sorry, I'm have a head cold, not exactly thinking straight tonight.

20:49 bbloom: tbaldridge: then move your ass to the couch & boot up netflix

20:50 * bbloom is always the guy who forces people to use their sick / vacation days

21:02 callen: bbloom: have to be sometimes, especially if it's an unlimited vacation company.

21:17 hiredman: dnolen: fyi script/repl in the clojurescript repo doesn't have tools.reader on the classpath it seems?

21:17 dnolen: hiredman: oh hm, thx will add

21:36 k with the ring buffer fix and a decent buffer size, Chrome Canary and WebKit Nightly can both push around 1000000 messages down a channel in ~2.3-5 on my machine - no too shabby I think

21:37 everything appears to get GCed beautifully too

21:37 bbloom: ::thumbs up::

22:46 *ugh* once again i wish javascript had weak references....

22:48 callen: note to self, firing off 10,000 simultaneous threads not a recipe for success.

22:49 fbernier: Can a compojure route match only of some specific query strings are present?

23:02 amalloy: fbernier: just return nil instead of a response if you don't like the query params

23:03 bbloom: awesome comment: "WARNING: Do not edit this class unless you fully understand both Java's memory and threading model and how the garbage collector(s) work. (You'll almost certainly 'break' something otherwise)."

23:22 sevvie: bbloom: Such a tempting WARNING.

23:23 TimMc: callen: That depends on what you are trying to achieve.

23:23 For instance, perhaps you wanted a space heater.

23:38 amacdougall: After learning the basics of Clojure, I've been getting started on my first app, a Liberator-backed REST API. I'm making good progress, but I'm curious if there's any consensus about interactive debugging. I've been using lein repl, and I'm able to redefine and test code in my namespaces, which is wonderful, but sometimes I wish I could break into a REPL with the full local context.

23:38 Google is very excited to tell me about emacs-specific techniques, but as a vim user, I've been using vim-slime to push code directly to a running terminal REPL. Fine so far!

23:44 TEttinger: amacdougall: (require [your.namespace core] :reload)

23:44 I was told that or something like that would work, haven't tried yet

23:56 callen: TimMc: I was being lazy and doing the (doall #(future ... )) dilly.

23:56 TimMc: I forgot the seq was ~10k elements long though.

23:56 sinistersnare: lol

Logging service provided by n01se.net