#clojure logs

2013-08-20

00:00dnolen[Neurotic]: yeah if you need to refer to some global JS object you need to prefix with js/
00:00[Neurotic]duh of course :/
00:00[Neurotic](facepalm)
00:00dnolen[Neurotic]: not that obvious :)
00:01qzTEttinger: running with empty main (just one println) have same effect.. so it must be something somewhere else
00:01[Neurotic]dnolen: there we go
00:01[Neurotic]thanks
00:01dnolen[Neurotic]: np
00:01TEttingerqz: could you do a gist or refheap paste?
00:02TEttingerI have a feeling like this is multiple files, and is affected by project.clj
00:06qzTEttinger: project.clj also?
00:06[Neurotic]dnolen: looks like this did the job nicely. Now I just need to call it ;) http://pastebin.com/CQjmNdFc
00:06TEttingerqz, if possible
00:08qzTEttinger: https://www.refheap.com/17783 https://www.refheap.com/17784
00:08fbernierHow would this java be written in clojure ?: (PDPage)document.getAllPages().get( 0 );
00:09qzTEttinger: on fresh project repl works fine, so it must be something with this one
00:09TEttingerwrong ns name for the :main in project
00:09TEttingerit's testme in project.clj, ocr something in the actual file
00:09TEttingerneeds to match the folder
00:10dnolen[Neurotic]: I would probably write it like this (def get-user-media (some #(aget js/navigator %) ["getUserMedia" "webkitGetUserMedia" "mozGetUserMedia"]))
00:10[Neurotic]dnolen: oh that makes more sense.
00:10qzTEttinger: it used to be same, i'm just in process copying everything to fresh project (because repl works fine in just-created project)
00:10[Neurotic]<< clojure newb
00:11dnolen[Neurotic]: or if I was feeling like the pattern was too common, I might write a macro (detect js/navigator -getUserMedia -webkitGetUserMedia -mozGetUserMedia)
00:11qzTEttinger: worst thing is that run/compile work just fine..
00:12TEttingerqz, 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?
00:13[Neurotic]dnolen: cool. Haven't got as far as macros yet, but getting there. Thanks for the tip
00:13qzTEttinger: it works on fresh project without anything added to it. but fails with this project.clj and this simple main function
00:13dnolen[Neurotic]: fun stuff, np
00:14TEttingerqz: hm, that project.clj right? and the src folder has a subfolder, testme?
00:14qzTEttinger: removed maven local repo and import from that -- and now it works
00:14TEttingeroh, didn't even see that the first time
00:15TEttingergreat
00:15qz :repositories {"local" ~(str (.toURI (java.io.File. "mvn_repo")))}
00:15qz :dependencies [
00:15qz [com.wcohen/secondstring, "13.08.15"]
00:15qz ]
00:15qzthese 3 lines cause it to blow up
00:17TEttingerqz, I hope someone who is more competent with macros than myself can figure out why those lines do that...
00:18TEttingercan you legally use ~ in defproject?
00:18qzTEttinger: well, it works with compile/run in lein :p
00:19TEttingerI call it a victory
00:19qzTEttinger: well, i'd prefer repl to work also
00:20TEttingerah.
00:20TEttingerwasn't sure if repl worked now.
00:21TEttingeroh
00:21qzTEttinger: those 3 lines kill repl, but everything else works fine
00:21TEttingeruse :require and :import ?
00:21TEttingerin the ns, it uses :
00:21TEttingeroutside the ns, those are functions, so it might be confused
00:22qzTEttinger: same thing
00:22TEttingeryeah, was a long shot
00:23TEttingerqz, what's the error now?
00:23TEttingerwhen you start a repl, is there a file or line number?
00:24qzTEttinger: same - https://www.refheap.com/17785
00:30TEttingerqz, woah... it may be a problem with nrepl?
00:31TEttingerqz, that file, form-init746830720517731947.clj , does it exist somewhere? either .m2 or target in your project directory?
00:32TEttingerit may have been a temporary file and deleted
00:33qzTEttinger: does not exist. must be deleted at some point..
00:33TEttingeryeah...
00:34TEttingerso has the repl worked at all in any version of this project?
00:35qzTEttinger: it works if i remove those 3 lines with local mvn repo
00:36TEttingermaybe the problem is with the local maven repo or how it's accessed? I haven't done that yet
00:38qzTEttinger: might be, but how to debug it? and again, it works if i just do "lein run"
00:38TEttingerwhere's technomancy when you need him...
00:39TEttingertechnomancy: what is the recommended way to use a local maven repo in lein 2.x ?
00:42qzoh, lein author is around :)
00:43TEttingerbut it might not be a lein problem
00:43TEttingernrepl might not be working as hoped
00:46callenqz: read the docs?
00:47callener
00:47callenTEttinger: ^^
00:47callennot trying to be a pain, but I see the answer to that question almost everytime I skim the docs.
00:47TEttingerheh, I haven't read the docs on that yet. going now
00:48qzcallen: non-working repl is mentioned in docs somewhere?
00:49callenqz: I misfired at the wrong person, sorry.
00:49callenTEttinger: google picks up leiningen documentation just fine, in my experience.
00:49callenif you just ask your question and append "leiningen" at the end, you'll be fine.
00:49callenand 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.
00:52qzcallen: well actually its me with problem here, not TEttinger ;) and googling didnt help..
00:52callenoh. I'm a little soft eyed at the moment, sorry.
00:52TEttingerhttps://github.com/technomancy/leiningen/blob/stable/doc/DEPLOY.md is the file in question
00:53TEttingerlooks like you can use file:/// ... wait, 3 slashes?
00:55sevvieTEttinger: (str "file://" "/home/user")
00:55TEttingerah. might work badly on windows.
02:02holoanyone here heard about "prayer oriented programming"?
02:14RaynesThat's when you let amalloy work on your code and you immediately go to the nearest place of worship and pray for its integrity?
02:16callenholo: 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
02:18holohehe
02:32Raynesucb: http://www.youtube.com/watch?v=SzRnZu-S6NE
02:38wolfesdoes anyone have thoughts on monitors? perhaps between a laptop with ext monitor of: 21" 1920x1080, 24" 1920x1200, 29" 2056x1080, or 30" 2056x1600
02:44SegFaultAXGo for 2x29 if you can.
02:44SegFaultAXWell, 2xmonitors in general is really handy.
02:45SegFaultAXAnd more screenspace is better if you have the desk for it.
02:48TEttingerwolfes, 8x30"
02:49TEttingerall just playing youtube
02:50TEttingerbut seriously, I get by OK with 1080p on a laptop, but I can barely fit anything on smaller, like the common 1366x768
02:56callenwolfes: gaming or just work?
02:56callenalso it's 2560x(1440|1600) generally.
02:57callenI'd argue 2x 1080p is more useful than 1x 2560x1600, if that's any consideration. porque no los dos? applies.
02:57callenjust be aware that anything above 1080p requires careful consideration with respect to hardware.
02:57callenmany, many laptops do not support anything higher than 1080p for an external display for various hardware reasons.
02:57TEttingerand anything more than 2 monitors?
02:57callenif more than 2 monitors are involved, do whatever.
02:57TEttinger(anything more than 2 needs special hardware right?)
02:58callenyou're generally talking a desktop computer with at least one gaming grade graphics card.
02:58callenAMD makes triple-display single-card graphics cards, but you won't want to deal with the drivers.
02:58TEttinger"perhaps between a laptop with ..."
02:58callenthe only laptops I know of that support 2x 2560x1600 are extremely expensive gaming laptops and Apple Macbook Pros.
02:58TEttingerwoah
02:59callenMacbook Airs support 1x 2560x1600
03:12wolfescallen: mostly work
03:13wolfesi've set up 3x 21" 1920x1080 on my desktop, but i do most of my work on my macbook air now
03:13callenthe macbook air can support one display unless you chain two thunderbolt displays (assuming it's a thunderbolt macbook air)
03:13wolfesearly 2010 macbook air :(
03:14wolfesno thunderbolt, will probably upgrade when retina comes to the next air model
03:14Ember-retina mbp is pretty damn light
03:14Ember-it's thinner than the earlier mbp
03:14Ember-I have the 13" model at home
03:15Ember-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
03:15callenI 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. :|
03:16Ember-1.62 kg for the retina 13" mbp
03:16Ember-13" air weighs 1.08kg
03:16Ember-so significantly less but not THAT much
03:16wolfesoO
03:17wolfesthat's like 1 mango of weight
03:17Ember-I find that 1.62kg to be of no issue
03:17Ember-only problem with 13" retina mbp is that it's gpu isn't quite up to the retina resolution
03:17callenEmber-: that's regrettable.
03:17Ember-it works just fine but now and then it can get a tad sluggish
03:18wolfesactually, the thing i dislike most about 15" mbp from a year ago is the way the front edge cuts into your hand
03:18Ember-if your mojo doesn't break into little pieces if it's not super smooth *all* the time then it's fine
03:18wolfesthe other thing i haven't gotten used to is how hot the 15" model gets
03:18Rayneswolfes: Duct tape bro.
03:19Ember-but I'd expect the exact same problem with retina air models when they come out
03:19wolfesyou're probably right :(
03:19Ember-you just can't push good enough gpu into air currently to handle retina
03:19Ember-but it's not as bad as it sounds really
03:19wolfesi thought there were 2560x1600 screens on ultrathin windows laptops nowadays?
03:20Ember-yeah
03:20Ember-retina is nothing spectacular anymore
03:20Ember-it's great but not only on apple
03:21Ember-the thing is though that osx is designed to scale nicely when the resolution goes up
03:21Ember-windows doesn't scale as well
03:21wolfesi see
03:21Ember-small screen with huge resolution and with windows you better have good eyes :)
03:22Ember-on osx you can choose the level of scale
03:22wolfesas a kid, i used to be able to barely read the fine print at the bottom of the eye charts
03:22tsantosI'm guessing Linux doesn't do so well either.
03:22Ember-photos etc will be at retina sharpness no matter the scaling
03:22Ember-tsantos: no idea what's the current status there
03:22Ember-would guess that gnome scales as well
03:23Ember-kde might not, although I think there *just* came out a new version of kde
03:23Ember-and of the more minor windowing managers I have no clue
03:25glosoliHey folks, what would be the right way to create global JDBC connection that could be shared between threads ?
03:25tsantosI'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.
03:29rurumateOi #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
03:29TEttingerrurumate, type hints?
03:30rurumateTEttinger: and gen-class?
03:30rurumateis there an complete example somewhere?
03:30TEttingeryeah, that could work. not sure quite how type hints work.
03:31TEttingerhttp://www.learningclojure.com/2010/09/macros-and-type-hints-metadata-and.html some good tips here
03:32rurumate.. because java folks don't like a library where every method takes and returns an object
03:33TEttinger(let [^int x (rand-int 5)] (class x))
03:33TEttinger##(let [^int x (rand-int 5)] (class x))
03:33lazybot⇒ java.lang.Integer
03:34rurumatenice
03:36TEttingeryou can add types for certain things by putting ^typename before the name. also helps avoid reflection
03:36TEttinger##(let [^int x 5] (class x)) ;; this might error
03:36lazybot⇒ java.lang.Long
03:36TEttingerhuh, Long?
03:37TEttingersometimes type hinting primitives throws errors
03:37rurumateso in general, gen-class should bake the type hints into the generated code (signatures)?
03:38TEttingeryeah, if it has type hints I think it will know about them
03:38rurumateoh by the way, how to generate a static method using gen-class?
03:38TEttingertype hints are pretty useful for java interop
03:38TEttingeroh I knew this
03:39TEttingerBy adding metadata – via #^{:static true} – to a method declaration you can also define static methods.
03:40TEttingerhttps://kotka.de/blog/2010/02/gen-class_how_it_works_and_how_to_use_it.html
03:42fredyrapparently clojure auto-coerce primitive ints to Long
03:42fredyrdidn't know that
03:42Ember-and keeps on going to BigInteger
03:42Ember-if you grow your numbers big enough
03:43TEttinger,36rzzzzzz
03:43clojurebot2176782335
03:43TEttingerhm
03:43TEttinger,36rzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
03:43clojurebot407457724995492699013934674155873859903826201780617058274757322369122994702986811490015284518679754852398694137855N
03:44TEttingerthe N is for BigInteger
03:47fredyrbtw the coercion is only for primitive ints
03:47rurumatesomething like (defn ^{:static true :tag Integer} -onlineLink [^Integer a ^String b]) maybe
03:47fredyr,(class (Integer/parseInt "5"))
03:47clojurebotjava.lang.Integer
03:48TEttinger,(class (int 4.2))
03:48clojurebotjava.lang.Integer
03:57hardfirehi, 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
03:58SegFaultAXhardfire: We'll need to see some code before we can help.
03:58hardfirehttp://pastebin.com/Mt0MsjU1 this is what i am trying ..
03:59hardfireit is the fibonacci one ..
03:59hardfirei 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
03:59hardfiretrying it http://www.4clojure.com/problem/26 here
04:00fredyrjava.lang.RuntimeException: Unable to resolve symbol: get-fib in this context"
04:00ucbmorning
04:01hardfireexactly .. it works in light-table though
04:01SegFaultAXhardfire: You need to give your fn a name.
04:01SegFaultAX(fn get-fib ...
04:01SegFaultAXhardfire: Better yet, use letfn for this.
04:02SegFaultAX(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)
04:02hardfireu mean inside the let block too ? doesn't the (let [fn-name (function)]) work ?
04:02hardfiredoesnt work after giving it a name too though
04:02SegFaultAXNo?
04:02fredyrhardfire: the let work, but your using the fn outside of the let block
04:02SegFaultAXOh there's that too.
04:03hardfireaha! that was it .. though that means there's a bug in light-table's repl or the compiler
04:04hardfire4clojure is really helping me grasp the concept . was trying SICP earlier but that takes a lot of time and pain .. no paitience for that
04:07fredyrright, letfn it should be
05:19schmirwhere can I find the -?> macro?
05:21Anderkentschmir: I know -?<> is in swiss-arrows, but not sure about -?>
05:23AWizzArdcore.match — does it now work in AOTed code too?
05:28schmirAnderkent: looks like -?> is missing, but thanks for the pointer anyway.
05:30AnderkentAWizzArd: somewhat. Some match expressions still don't work, I think. Search for aot for core.match project on http://dev.clojure.org/jira/
05:31ucbcallen: I'm really liking Black Moth
05:34AWizzArdAnderkent: kthx
05:58turbopapeHi guys,
05:59turbopapeanyone dit any work on anlyzing languages, preferably fench, who would share pointers, resources, etc... ?
05:59turbopapeI mean "natural languages", not compilers and the like ...
06:04mpenetwhat do you mean by analyzing?
06:06noncomwhy are here so many people that never talk?
06:06noncomwho are they?
06:06noncomwhy are they here?
06:06turbopapempenet, I mean processing these languages,
06:06turbopapedetecting knowledge, creating entities, etc...
06:06turbopapeI wanted to know if someone could help with some clojure material on the subject,...
06:06mpenetturbopape: opennlp and its clojure wrapper is probably the way to go
06:06turbopapeto get me started...
06:06turbopapeok, thank yo =u ...
06:07mpenetturbopape: it only comes with en models though, so you will have to do some home work first
06:07turbopapeok, I assume,
06:07mpeneteasy enough to find online
06:08turbopapebut I see a huge opportunity in localizing it in the languages we use in our region,
06:08turbopapefrench and most probably arabic ...
06:12mpenetles modeles pour le francais sont trouvables via google, pour l arabe ca sera plus difficile a trouver j imagine
06:12supersymnoncom: I figured half of them are foreign intelligence agencies ;)
06:12noncom:)
06:13mpenetturbopape: sinon tu devras les creer a la main
06:13turbopapemerci pour le coup de pouce mpenet !
06:14turbopapempenet : mais c'est le truc le plus utilisé en industrie, opennlp ?
06:29raxeloHi all, what can be the problem, when I run `lein compile` nothing happens
06:34turbopaperaxelo, are you running this command inside your project's directory ?
06:34raxeloturbopape: yes I have created new project
06:34raxeloLeiningen 2.3.1 on Java 1.7.0_25 Java HotSpot(TM) 64-Bit Server VM
06:35raxelowhen I run `lein check` it show my intionally made errors
06:35raxelobut when I run `lein compile` nothing happens
06:37turbopapeIndeed, I run across the same problem with the same lein version as raxelo
06:39turbopaperaxelo, I think you should specify (:gen-class :main true) in your ns declaration
06:40turbopapeOr at least this is what I found in a related forum thread
06:40TEttingeror :aot and the namespaces in project.clj
06:40turbopaperaxelo, https://groups.google.com/forum/#!topic/leiningen/Z2bQAaluggY
06:40TEttingerotherwise it won't know to compile anything
06:40TEttinger:main doesn't automatically :aot anymore
06:41turbopapeok TEttinger ,
06:42TEttingerI solved the same issue with help in #leiningen a few days ago
06:42turbopapeso one must specify :aot in the project.clj as the only way to tell "lein compile" what to do ?
06:42noncomraxelo: 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
06:42raxeloTEttinger: thanks - it helped
06:42TEttingerturbopape, I think lein compile only works when you have namespaced to :aot compile.
06:42TEttingerraxelo, great!
06:43raxeloTEttinger: yes I have added module to the :aot
06:43noncomfor me it nevertheless fills in the "target" directory
06:43raxelononcom: what is the version of lein ?
06:43TEttingernoncom, what version?
06:43TEttingerha
06:43noncom2.3.1 ?
06:43TEttingerit changed in 2.2.0, odd
06:43TEttingermaybe earlier
06:44noncomnope :)
06:44TEttingermaybe it's not compiling AOT, just making class files, but since it isn't using AOT it doesn't print?
06:44raxeloin my 2.2.0 it still works, so, yes it
06:44TEttingerI have no clue
06:45noncomi have aot and i have none-aot, so i have like all kinds.. and then it is simply silent
06:45TEttingernoncom, that is odd
06:45TEttingeryou'd think it would print something
06:46noncomsilently pushes all to the target dir, surely creating .class files for aot-genclasses and javac targets
06:46noncomyea, i thought it should too but...
06:46noncomi think that is no big problem (for me now) because i do not use plain leiningen for development.. the IDE does it all
06:47noncomdoes anyone here need packaging native libraries with lein?
06:47noncomi mean, projects that rely on native libs
06:47TEttingerI used to, I took them out
06:47TEttingerit didn't have issues
06:48noncomwaht do you mean
06:48TEttingerbut the native dependencies were themselves dependencies of a java maven project
06:48TEttingerlein fetched them just fine, I didn't use the native lib parts of the java maven lib but I didn't have problems
06:48noncomso did you have problems or did all go well?
06:48noncomoh i see
06:49noncomthere were talks on problems with support for native inclusions, is that still true?
06:49TEttingerit's in the future of lein stuff
06:49TEttingerhttp://librelist.com/browser//leiningen/2013/8/8/what-s-next-for-leiningen/
06:51noncomwhat is *making* native dependencies?
06:51noncomdoing jni?
06:51noncoms/doing/creating
07:12Anderkenti 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
07:21noncomAnderkent: yes.. and i'm not sure it can be fixed...
07:29mikerodemacs 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?)
07:43agumonkeymikerod: you should ask this on #emacs
07:48mikerodagumonkey: I suppose you're right
07:49agumonkeymikerod: not that there's much activity right now
07:49mikerodeveryone must be asleep
08:09ker2xfriendly greetings \o/
08:09supersymI dont know about emacs
08:10supersymbut at least in here the majority is USA
08:10supersymaka different timezone :)
08:14ker2xi 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...
08:14ker2x...missing bits of thingy that's needed to compile to nodejs target please ?
08:15ker2xshould i run lein cljsbuild once ?
08:15ker2xmmm ho wait, idea
08:16ker2xhehe i think that's the problem, the file is core.clj, not core.cljs
08:16Ember-(demoing clojurebot for friend, don't mind me)
08:17Ember-,(for [[k v] {:foo "foo" :bar "bar"}) k)
08:17clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
08:17Ember-,(for [[k v] {:foo "foo" :bar "bar"}] k)
08:17clojurebot(:foo :bar)
08:19ker2xsrc\snowtrail\core.cljs saved. Failed to serialise response. java.lang.NullPointerException: null
08:19ker2xwell, that's a fail
08:19ker2xperhaps catnip is not to be used for nodejs project ?
08:21supersymker2x: no idea, I use lighttable
08:22ker2xi can use it for clojurescript and nodejs ? i'll try then
08:22supersymwhich shouldn't have problems connecting, plus it works great on windows from my experience
08:22supersymyes its made using that
08:23ker2xwell, actually i installed everything on my windows because catnip is hardcoded to listen to 127.0.0.1
08:23supersymyou can add node.js connections, or the traditional REPL, hook stuff up..
08:23ker2xi'll take a look at lighttable, thank you
08:23supersymhttps://f.cloud.github.com/assets/3727933/992025/9fab79ce-0974-11e3-83a4-6bc2ffef7e89.png
08:24ker2xlook good. testing. brb
08:24supersymleft hand side, I evaluate a .js file generated by pedestal (ctrl+enter), and LT fires up a connection
08:24supersymthat last bit can be less obvious to people
08:24supersymgl
08:26ker2x./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 :)
08:28ker2xha of course, it's not a webapp :)
08:31noncomi have found a killing bug in cljs
08:32noncomsomething like (apply str (repeat 5)) hangs the entire web browser page and then it craches
08:32noncomtested also here: http://www.clojurescript.net/
08:33noncomis it a bug or is it a feature?
08:34noncomomg, it also hangs clojure itself
08:34rkneufeldnoncom: That's an infinite string though
08:34noncomlike (repeat 5)
08:35noncomrkneufeld: yeah, it is, but it is not an excuse to hang the whole browser page
08:35ker2xwhy not ?
08:35noncomker2x because (repeat n) is a valid usage of repeat
08:36rkneufeldSure, that's valid. But trying to print it is infinite (unless you use '(set! *print-length* 10)` or something)
08:36noncomi forgot to put smth like (repeat n "-") and spent long time finding the bug.
08:36noncomi understand why that happens, but that is not very good..
08:37noncomin nrepl with regular clojure i get that:
08:37ker2xit should solve the halting problem and don't run anything that's not halting :)
08:37noncom=> (repeat 5) OutOfMemoryError Java heap space java.util.Arrays.copyOf (:-1)
08:37ker2xback to lighttable, brb
08:38rkneufeldSure, 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
08:39noncomrkneufeld: 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!
08:40rkneufeldnoncom: I'm not following what specific part you disagree with?
08:40noncomthat it silently hangs the entire system, while (repeat n) is listed in the doc as a valid call
08:41noncom,(doc repeat)
08:41clojurebot"([x] [n x]); Returns a lazy (infinite!, or length n if supplied) sequence of xs."
08:41TEttinger,(take 20 (repeat 5))
08:41clojurebot(5 5 5 5 5 ...)
08:41noncom,(repeat 5)
08:41clojurebot(5 5 5 5 5 ...)
08:41rkneufeldI 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.
08:42TEttinger##(take 20 (repeat 5))
08:42lazybot⇒ (5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5)
08:42TEttinger##(repeat 5))
08:42lazybotjava.lang.OutOfMemoryError: Java heap space
08:42TEttingerand this won't finish
08:42ker2xand the browser hang until it does it's equivalent of out of memory error, that make sense
08:42ker2xits*
08:43noncomwell, 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
08:43noncomyeah, sure i understand the technology and theory behind that, but...
08:43noncomwell if you say that this is ok, then ok then
08:44rkneufeldIf you want to play with the infinite sequence, why not try using a def instead (and not trying to print the whole thing)
08:44TEttingernoncom, it's very useful when using take and stuff that deals in lazyseqs
08:44ker2xi don't know when the whatever-javascript-engine is deciding that you ran out of memory
08:45TEttinger##(take 20 (map inc (repeat 5)))
08:45lazybot⇒ (6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6)
08:45noncomin my console in ccw (repeat 5) comes up with java heap error
08:45hyPiRion,(repeat 20 5)
08:45clojurebot(5 5 5 5 5 ...)
08:45TEttingerit's repeating the number 5 infinitely. so it runs out of heap yeah.
08:45noncomhere it works right
08:45noncomoh, nvm
08:45ker2xchange the soze of the java heap and wait until it swap :)
08:45TEttingerdid you use take?
08:45noncomno
08:46TEttingertake makes it finite
08:46noncomi suppose it must return LazySeq@something
08:46noncombut it does not
08:46rkneufeldnoncom: I think the bot has done (set! *print-length* 5)
08:46noncomgood guess about the not, i'm sure this is the case
08:46noncomtry in your repls
08:47noncomalright, ehere is the ultimate
08:47noncomgo here: http://www.clojurescript.net/
08:47noncomtype in (repeat 5)
08:47noncomhit enter
08:49noncomi guess as the console in CCW, so as HIMERA are calling to realize the seq
08:49noncombut, bear me, that is weird
08:50noncomat least the doc must say "no use in repls or calculation without *print-length*, (take) and the friends, otherwise all will hang"
08:50IamDrowsynoncom: 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.
08:51noncomi think it should be intelligent enough to understand that the seq is lazy and it is commiting a suicide
08:51TEttingerwhat if the seq is just very large?
08:51IamDrowsylazy is not the problem here... infinite is
08:52noncomvery large is what? exceeding memory capacity?
08:52TEttingerlarger than what you expect to handle in a web app, so there's some limit set, like *print-length* 2000
08:53TEttingersomeone with a 2500 item seq would be in trouble
08:53noncomidk. there must be something
09:08ker2xmmm i don't understand how to compile a lein projet with lighttable
09:10ker2xTo 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.
09:10ker2xmmm k
09:12Anderkentwhee finally got junit output working for midje ran by maven
09:14noncomhwo is your experience from lighttable?
09:14noncomwould you consider a major production project with it already?
09:15ker2xi have a few mn of experience with lighttable :)
09:15noncomi'm trhinking about trying it for one of my next proj
09:15noncomeh, me too
09:16ker2xi'm trying to compile a clojurescript/nodejs project
09:16ker2xprobably not the best thing to start with
09:17turbopapeker2x, aren't you afraid by the long release cycle of lightable ?
09:17noncomi am afraid
09:17ker2xi'm not
09:17noncomwhy, are you fearless?
09:18turbopapeeasy guys ! didn't mean to scare nobody :)
09:18noncom:D
09:18ker2xif it does what i need why would i want an upgrade every weeks ?
09:18turbopapewell, it seems not like stable stable, I mean, ...
09:18noncomactually i tried it and hoped for more improvements, so i'm kinda hesitate to see new releases, and they take sooo long...
09:19noncom0.3 -> 0.4 is a huge leap, but still there is much needs to be done
09:19ker2xmy 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
09:19ker2xwrote ? written ?
09:19noncomwritten
09:19ker2xthx
09:20noncom"i wrote" and "it was written"
09:20ker2x:)
09:20noncompassive-agressive voice :)
09:20noncomahah
09:20turbopapeby the way, ker2x, does it use your leiningen or its own bundled one ? I forgot...
09:21turbopapeah its own ... I was mistaken with nightcode.info...
09:21ker2xi don't know. i just opened the directory i already wrote(!)
09:21turbopapeactually your lein...
09:22ker2xi started clojurescript yesterday.
09:22ker2x1) a single file without lein only linux using vim. it worked
09:22ker2x2) same but with lein and cljsbuild. it worked too
09:23turbopapeok...
09:23ker2xgot some toubles because nodejs fail with :whitespace optimization
09:23ker2xtoday i tested catnip and lighttable
09:24ker2xbut can't compile anything successfilly, yet
09:25ker2xbeing on windows isn't helping. i'm not even sure my nodejs install is ok
09:25ker2xdoesn't seems to be in PATH
09:25ker2xha no, it is :)
09:26ker2xF:\clojure\snowtrail\out>node.exe main.js
09:26ker2xStarting server
09:27ker2xbut it's an old version :(
09:27ker2xso lighttable isn't compiling my project
09:37ker2xException 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)
09:37ker2xetc
09:43vmarcinkohello, 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
09:43vmarcinko (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?
09:44vmarcinkoWhereas 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...
09:44opqdonutyeah that's right
09:44opqdonuthowever it can make sense to have side effects in .clj files
09:44opqdonutsomething like (defn foo ...) (swap! global-nice-functions-atom conj foo)
09:44hyPiRionjava files may have side effects too
09:44opqdonutas an example
09:45Anderkentvmarcinko: yes, you're right. One 'gotcha' is that the namespace is evaluated also when it's compiled
09:45hyPiRionput `static { System.out.println("heyoo"); }` and check what happen when you load it
09:45Ember-yup, those are called static constructors
09:45Anderkentso 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
09:46Ember-ran on class load time
09:46Ember-just the way it is in clojure namespaces
09:47ker2xwell enough for now. i go play dcs ka-50, have fun :)
09:48AnderkentEmber-: 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
09:48Anderkent(but given that usually you only compile during ns load it's not apparent)
09:48Ember-Anderkent: true
09:49vmarcinkoOk, 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
09:49Anderkentyes, that's correct. The ns form is a convention, not requirement
09:51nDuffvmarcinko: 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.
09:51nDuffvmarcinko: ...incidentally, Ruby, Python, and others follow this same pattern; I wouldn't so much liken it to shell.
09:52nDuffvmarcinko: ...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.
09:53Anderkentwell, you can still load-file :)
09:53vmarcinkowell, 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
09:55vmarcinkoim 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
09:56vmarcinkoor 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...
09:59bjadoes >! return the port it puts to?
09:59supersymvmarcinko: you mean load-file? Besides that, I must have missed the beginning, but isn't maps something that would fit the description?
10:05dnolenbja: no it returns nil
10:09dnolenvmarcinko: 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:13vmarcinkodnolen: 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:13vmarcinko 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:15vmarcinkough, I made so many typos above, I hgope I made my point :)
10:15dnolenvmarcinko: many aspects of Clojure are surprisingly static, macros for one others because the host itself is static biased.
10:16dnolenvmarcinko: 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:26mdrogalisdnolen: I was monitoring mutually tail-recursive fns of go blocks. They don't seem to kill memory.
10:26clojurebotI don't understand.
10:26mdrogalisKind of neat. Not sure how that happens.
10:49mpenetthat sums up core.async nicely :)
10:52atyzHey 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:52atyzCould anyone tell me if maybe I'm building it wrong?
11:03Anderkentargh. anyone here using mvn with clojure? (either clojure-maven-plugin or zi)
11:03Anderkentneed to rant :D
11:04turbopapeface
11:04nDuffatyz: ...eh. Why is it looking for all those 3rd-party pieces with your groupId?
11:04matthavener~.
11:04clojurebotCool story bro.
11:04turbopapeoops, that was not intended to land here :)
11:05matthavenerturbopape: whoops, me either :)
11:06atyznDuff: it's looking for these files I believe https://github.com/box/box-java-sdk-v2/tree/master/BoxJavaLibraryV2/libs
11:06nDuff...
11:06nDuffEww.
11:06nDuffYou really shouldn't be republishing 3rd-party jars under your own name.
11:06atyzI am not goign to publish it - I just want to use it
11:07AnderkentnDuff: org.clojars.name is the right way for non-public forks
11:07Anderkentatyz: your pom.xml/project.clj is wrong
11:08nDuff...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:08Anderkentyou should change the group names for your dependencies to their publishers - org.apache for commons-lange etc.
11:08atyzIf there is another way to use this without making a clojar I would be happy to use it
11:08nDuffAnderkent: atyz _is_ using org.apache.httpcompononts &c. in https://github.com/box/box-java-sdk-v2/blob/master/BoxJavaLibraryV2/build.gradle
11:08nDuffatyz: I don't see your jar published to clojars at all. Do you just mean you're publishing to a local Maven repo?
11:08AnderkentAh. I thought he was forking that jar, not that he owned it
11:54futilequick off topic question: do any of you use a Mac and want to beta test a minimalist music player?
11:55futileif so, PM me.
11:55futile</offtopic>
11:56arrdem$seen Engelberg
11:56lazybotI have never seen Engelberg.
12:01noncomatyz: hey
12:02noncomnoncom: that's the dependency hell with clojars sauce
12:02noncomomfg i'm writing to myself... that must have been a stray mouseclick
12:02noncomatyz: did you solve your case
12:02noncom?
12:03atyznoncom: hello!
12:03atyzI did thank you
12:03noncomyou managed to push them all?
12:03atyzIt was the that the dependencies were incorrect
12:03atyzI did thanks to Anderkent and nDuff
12:03noncomoh, so you fixed them for these that are present on clojars and all went fine?
12:04atyznoncom: i'm about to try and use the library - but everything is installing correctly
12:04noncomi see, i had a similar issue.. just wondering about how people solve it
12:05Anderkentnoncom: it wasnt really a depencency hell problem, just a packaging mistake
12:05Anderkentnothing more complex than a miswritten pom :P
12:05noncomuh...
12:05atyznoncom: Anderkent is right - my bad :)
12:06dnolentbaldridge: ping
12:06atyzIt just came down to me not knowing how to do it correctly
12:06tbaldridgednolen: pong
12:06noncomi thought you'd give me a recipe for my problem :)
12:06dnolentbaldridge: so I'm looking at optimizing the CLJS core.async stuff
12:06tbaldridgednolen: cool
12:07dnolentbaldridge: I'm trying to understand the semantics of take-cb put-cb
12:07dnolensometimes these are boolean values and sometimes functions?
12:07tbaldridgednolen: sometimes nil sometimes a fn.
12:08noncomdnolen: 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:08tbaldridgednolen: 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:08noncomor maybe it is recommended to give one channel for the whole table?
12:08tbaldridgednolen: eh...that might be wrong...can I get a line number?
12:08dnolentbaldridge: put-cb and take-cb often come from impl/commit, but looking at the implementations sometimes a boolean value is returned
12:09dnolentbaldridge: I'm just looking at channels.cljs and async.cljs
12:09dnolenthe implementations of commit and the how ManyToManyChannel calls it and locally binds to put/take-cb
12:10dnolennoncom: 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:10tbaldridgednolen: okay, now I see it.
12:10dnolennoncom: tbaldridge: in my simple throughput benchmarks take! and put! are the bottleneck
12:11tbaldridgeyeah, to start it is either nil or a cb, and after the call to active?/commit it's a null/true
12:11noncomi see, looks like its ok then
12:12tbaldridgednolen: 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:13dnolentbaldridge: what doesn't commit do on the JVM?
12:13tbaldridgewell alt uses commit, so perhaps we do need it.
12:13bbloomdnolen: what kind of throughput are you seeing currently? any idea what the target should be?
12:13dnolenbbloom: I'd like to see w/ in 4X of JVM
12:13bbloomdnolen: and what are we seeing on JVM now?
12:14dnolenI think we can probably do much better than 4X
12:14dnolen~400-500ms to spool a range of 1 million items
12:14clojurebotPardon?
12:14dnolen2.7 seconds on WebKit Nightly, 4-5seconds on Chrome Canary
12:15bbloomhm ok thx
12:17tbaldridgednolen: you once mentioned switching to a linked list instead of using arrays for the queues, we could look into that as well
12:17dnolentbaldridge: we could though I'm not convinced that's the bottleneck
12:17tbaldridgewhat does the bottleneck appear to be?
12:17dnolenthere's a lot of function allocation going on right now when calling into put! and tak!
12:17dnolentake!
12:18dnolentbaldridge: in CLJS complex boolean conditions (and (...) (...)) will often generate
12:18dnolencljs.core.truth(function() { .... }) if you are not careful
12:18dnolenrarely matters for most code, but definitely matters for core.asycn
12:18tbaldridgeyeah
12:19dnolentbaldridge: so commit will return either a function or true
12:20dnolentbaldridge: where does it ever return nil?
12:23tbaldridgeok, so looking at the code now, it only ever returns a callback
12:24dnolentbaldridge: line 107 in async.clj returns true
12:24dnolenasync.cljs
12:24tbaldridgednolen: 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:25dnolentbaldridge: so alt-flag is dead code?
12:25dnolenor you mean commit is never called?
12:25tbaldridge*called by the channel
12:25tbaldridgeit is called by the alt-handler commit fn
12:25dnolentbaldridge: ok, so I just need to handle nil or a fn
12:26tbaldridgeish, 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:27dnolentbaldridge: k
12:27tbaldridge*JS VM
12:27tbaldridgeI can't type today.
12:28tbaldridgeon CLJS we'll never call commit on a inactive alt-handler. On JVM it's possible.
12:30shdwprincejs have virtual machine?
12:30juhu_chapaHi 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:30shdwprinceI thought it was interpreter
12:31dnolenshdwprince: nope, the big JS engines JIT
12:31TimMcshdwprince: JS has come a long way!
12:31sinistersnareshdwprince: yes.
12:32sinistersnarewell, you can be an interpreter and a JIT
12:32sinistersnarejava byte code is interpreted
12:32tbaldridgesinistersnare: I'm not completely sure that that happens any more.
12:33sinistersnarehttp://stackoverflow.com/questions/5625512/why-is-java-bytecode-interpreted i think this is the reason why
12:38jkkramerhas anyone been able to use lein-difftest via repl? it's not working for me
12:38jkkramer`lein difftest` works fine
12:43nopromptdnolen: mind if i borrow your scripts in mori/bin?
12:43dnolennoprompt: nope
12:44nopromptdnolen: thanks :)
12:46gunsnoprompt: you should have told me writing for both CLJ and CLJS was a pain
12:46guns:)
12:46mullrI 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:47mullr(see the bottom to quickly understand its conventions and expansion)
12:47nopromptguns: 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:47wolfeswhat's a good pure-javascript clientside websocket library for connecting to http-kit server's websocket endpoints?
12:47gunsnoprompt: I looked at that, and it's great, but it feels like hacking on C with #ifdefs
12:47wolfesie, for a chrome extension to connect
12:48gunsnot really REPL friendly
12:48timsgardnerAnyone know a nice way to automatically and invisibly include namespaces for development? Sick of typing (use 'clojure.repl), (use 'clojure.pprint)
12:48nopromptguns: exactly my thoughts.
12:48shdwprincehumm.. cpython compiles python files to pyc (byte-code), and inteprete it (even with JIT with pypy). Should I call CPython VM too?
12:48wolfestimsgardner: you want :repl-options in project.clj
12:48sinistersnareshdwprince: yes
12:48timsgardnerwolfes: cools, thanks
12:49sinistersnarelots of languages run on VMs
12:49wolfestimsgardner: reference here: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L252-L254
12:49ToxicFrogshdwprince: VM applies not only to JITs.
12:49sinistersnarehaskell does, lua....
12:49_Bravadois there a guide to idiomatic clojure
12:49futileyeah
12:49ToxicFrogIt 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:49sinistersnare_Bravado: best i can find http://clojuredocs.org/examples_style_guide
12:49futile_Bravado: this is a good start: https://github.com/bbatsov/clojure-style-guide
12:50shdwprinceToxicFrog: VM intepret it's own byte-code, when R(eal)M inteprets machine code
12:50nopromptguns: well, actually the cljx nrepl middleware seems seems to work out pretty nice.
12:50shdwprincebut cpython called intepreter, and jvm - VM
12:50ToxicFrogshdwprince: my point is that cpython and puc-lua are python and lua VMs even though they don't jIT.
12:50shdwprinceworld full of lie
12:50ToxicFrogNo
12:50sinistersnareshdwprince: words
12:50shdwprinceToxicFrog: jit its only dirty trick
12:51shdwprince*is
12:51sinistersnaredont think theyre mutually exclusive
12:51arrdemshdwprince: jit is a beautiful hack. get your wording right.
12:51ToxicFrogcpython is an implementation of a python VM. The fact that it doesn't JIT is irrelevant.
12:51sinistersnareyou can interpret on a VM
12:51gunsnoprompt: 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:51ToxicFrogThe fact that it's an interpreter is orthogonal to that.
12:51gunsNo arguments are being passed to *main-cli-fn*
12:51nopromptguns: what are you running into?
12:52sinistersnareToxicFrog: correct
12:52ToxicFrogYou can have non-VM interpreters (bash, early Ruby implementations)
12:52ToxicFrogAnd generally "interpreter" carries the connotation that you can feed it source directly rather than needing a distinct compile step as with Java.
12:52gunsnoprompt: Nothing with optparse, just can't seem to get args passed to -main in :advanced; works with :simple
12:53shdwprinceToxicFrog: yeah, I figure it out
12:53sinistersnareToxicFrog: correction: the .java is actually compiled (but to bytecode), then the JBC is interpreted
12:53sinistersnareand JITed (compiled) when needed
12:53sinistersnareso its all a great little scheme
12:53arrdemok so I'
12:54arrdemm sitting on this hoard of language grammars for instaparse..
12:54arrdemhow to publish? blog or github?
12:54hyPiRiongh with a blog which explains and elaborates on them?
12:54arrdemsounds good to me...
12:55nopromptguns: 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:56ToBeReplacedIs there a library that does a better job of this: https://gist.github.com/ToBeReplaced/6283875
12:56ToBeReplacedIt's useful for programmatic docstring creation
12:56nopromptguns: maybe you need ^:export? :/
12:56gunsnoprompt: 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:56arrdemToBeReplaced: emacs meta-q?
12:56ToBeReplacedThe equivalent of that, yeah
12:56gunsnoprompt: Okay, thanks for the hint
12:57ToBeReplacedNeed it at clojure runtime
12:57arrdemurgh. I don't know of one.
12:58nopromptguns: 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:59gunsthanks noprompt; ttyl
13:01noncom,(floats [1 2 3])
13:02fbernierI 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:02fberniercalls*
13:02clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [F>
13:02arrdemfbernier: no, the first namespace must explicitly import what it needs directly.
13:02noncom,(floats [1 2 3])
13:02clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to [F>
13:02fbernierarrdem: thanks
13:02noncomhow do i use (floats)?
13:03hyPiRionnoncom: floats just casts to float[].
13:03arrdem,(floats (into-array [1.0 2.0 3.0]))
13:03clojurebot#<ClassCastException java.lang.ClassCastException: [Ljava.lang.Double; cannot be cast to [F>
13:03hyPiRionI think you want to do this instead
13:04Anderkentany licensing magicians know if mit and ecl are compatible?
13:04ucb,(doc floats)
13:04clojurebot"([xs]); Casts to float[]"
13:04timsgardnerHm, still confused why one would use partials in noir rather than functions returning hiccup data
13:04hyPiRion,(into-array Float/TYPE [1 2 3])
13:04clojurebot#<float[] [F@7ca7e4>
13:04Anderkentalso what to do about a project that says :license eclipse in project.clj, but MIT in readme ;((
13:04RaynesAnderkent: Email the author and tell him he's dumb.
13:04arrdem^ that
13:05noncomhyPiRion: into-array gives boxed floats?
13:05dnolentbaldridge: ok here's something else to consider
13:05RaynesIt's pretty much impossible to use a library without a clear license.
13:05noncomlooks like yes
13:05arrdemAnderkent: I'd assume he forgot about :license, but IANAL
13:05hyPiRionnoncom: only if you do Float instead of Float/TYPE
13:05dnolentbaldridge: we don't have threads in JS so we call dispatch every time, this introduces massive amounts of latency
13:05shdwprinceAnderkent: maybe author forgotted to change default eclipse license in project.clj?
13:05Anderkentyeah so I'm thinking
13:05noncomhyPiRion: cool, that's what i need
13:05noncomthanks
13:05tbaldridgednolen: right
13:05noncom(i mean Float/TYPE is the way for me)
13:05dnolentbaldridge: if we instead track tick and only host dispatch say every 1024 ticks
13:06hyPiRionsweet
13:06dnolentbaldridge: 1000000 messages w/ a sliding buffer takes 10ms
13:06dnolentbaldridge: (side node fixed buffer add! is a bottle neck)
13:06tbaldridgednolen: fixed buffer add! with a full buffer?
13:07dnolens/node/note
13:07dnolentbaldridge: now just implementation of fixed buffer period
13:07noncomwhat 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:07tbaldridgednolen: because at that point you're basically benchmarking the take/put queues
13:07dnolentbaldridge: using unshift
13:07dnolentbaldridge: no
13:07tbaldridgednolen: okay
13:07dnolentbaldridge: if remove the tick, sliding buffer takes 2.7 seoncds
13:07tbaldridgenice!
13:08dnolentbaldridge: I push the ideas to a branch
13:08bjaany idea how to delete enclosing parens in paredit.vim?
13:09Raynesbja: I use surround.vim for that.
13:09dnolentbaldridge: basically we want to yield to the browser less often and keep control a bit longer, not sure what granularity makes sense
13:09tbaldridgednolen: 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:10tbaldridgednolen: can we make it time based? i.e. yield every 10 ms or something?
13:13dnolentbaldridge: I don't see how time based change anything over the tick approach.
13:14tbaldridgeif each tick took 100ms, you wouldn't want to do 1000 of them before releasing
13:15dnolentbaldridge: I'm not sure how we can solve this problem - Node has this problem too :)
13:15tbaldridgednolen: ah, nvm I understand ticks now. I thought you were saying dispatch every 1024 puts! or takes!
13:15tbaldridgeare you talking about clock ticks?
13:15dnolentbaldridge: sorry, what I meant was
13:16dnolentbaldridge: put!/take! calls dispatch/run, if ticket < 1024, we run the task *now*
13:16dnolentick > 1024 we reset and use a real dispatch
13:17dnolenclearing the stack etc
13:20tbaldridgednolen: 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:20tbaldridge*down
13:21dnolentbaldridge: what other code? :) JS is single threaded
13:22augustldnolen: 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:22dnolentbaldridge: 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:22dnolenaugustl: I think I exported clj->js
13:23augustldnolen: ah, cool
13:23dnolentbaldridge: that said I'm not sure where we should set the knob
13:24augustldnolen: hmm, there's no mori["clj->js"] property. The closest I can find is into_array, but that's obviously just for arrays
13:25tbaldridgednolen: 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:25dnolenaugustl: I need to push another release first, will try to do that soon
13:25augustldnolen: cool, I'll make my own fn for now :)
13:28dnolentbaldridge: I tried that but it seemed to me queuing stuff like that is actually more complicated not less
13:28dnolentbaldridge: 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:29dnolentbaldridge: 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:29tbaldridgeis this on github somewhere? I'd like to take a look at it
13:30dnolentbaldridge: 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`cbpFor a websocket which one is easier to use, http-kit or aleph?
13:31dnolentbaldridge: https://github.com/clojure/core.async/tree/optimize
13:31tbaldridgednolen: I agree, I'm pretty sure we need a scheduler here. I've heard him speak against it in the context of CLJS.
13:31dnolentbaldridge: 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:31clojurebotAck. Ack.
13:31dnolens
13:33tbaldridgednolen: 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:39tbaldridgednolen: 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:39tbaldridgeNow the last go is only run every 1024 ticks.
13:39dnolentbaldridge: ^ my point about the knob, bit a tick count lower than the latency of dispatch
13:40dnolenpick
13:41technomancyRaynes: look what you did raynes https://twitter.com/fuadsaud/status/369866447301795840
13:42tbaldridgednolen: what test are you using for this?
13:43tbaldridgeI'm interested in giving it a try as well
13:44dnolentbaldridge: I'm trying yours added mine to your gist
13:51dnolentbaldridge: so the funny things is that w/ my optimizations it takes 45-50ms, w/ master 220-30ms
13:52tbaldridgednolen: that's odd
13:52ed_ghow can I add a jar file to the clojure class path? this jar is a local file, not available through maven etc.
13:52dnolentbaldridge: that's by starting to time right after channel construction and ending as soon as the timeout yield
13:53dnolentbaldridge: I've been tweaking the dispatch stuff playing around with different approaches for a while now
13:53dnolentbaldridge: all dispatch is SLOW
13:56TimMctechnomancy: And is "brew install leiningen" the correct answer, as the person received?
13:57dnolentbaldridge: in your gist did you mean to write while loop around the top two go blocks?
13:57technomancyTimMc: yeah, it sounds like he just didn't read the message he got
13:57technomancyjust giving Raynes a hard time
13:58tbaldridgednolen: yeah
13:58tbaldridgednolen: 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:58noncomed_g: try adding the :resource-paths in your project.clj
13:59tbaldridgewe 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:59noncomed_g: or if you're asking about plain clojure, then idk, possibly it'll work with the classic -cp thing
13:59dark_elementTimMc bhauman, I have put some log messages now. Can you check what the log messages says now? kapilreddy.me/examples/korova_drop/
14:00ed_gnoncom: 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:01noncomed_g: yes, me myself got killed several times when i took that road
14:01bpri 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:01arrdemhum... is there a way to tell instaparse to throw away whitespace mod inserting < WS * > groups everywhere in the grammar?
14:02noncomed_g: do you want to add it there for dev or for release?
14:03ed_git'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:04justin_smithbpr: yes, and I made a stack overflow answer describing the fix
14:04noncomed_g: i see, so you do not use lein for that, u use vanilla clojure?
14:04dnolentbaldridge: yeah I'm not convinced about the scheduler, I don't think core.async is for building threading abstractions
14:04justin_smithbpr: basically, the new el files were compiled using old code which was not backward compatible (that is my theory at least)
14:05dnolentbaldridge: my main concern is that core.async event latency is unsuitable for using core.async as general messaging mechanism because of bad performance
14:05justin_smithbpr http://stackoverflow.com/questions/18208947/emacs-clojure-lein-and-nrepl-nrepl-buffer-shows-up-blank/18218870#18218870
14:06ed_gI'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:06dnolentbaldridge: 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:07tbaldridgednolen: and the only way you're going to make that happen is to do dispatching less often, agreed.
14:07noncomed_g: cool!
14:07tbaldridgednolen: 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:07tbaldridge*your
14:07tbaldridgethat's what I'm trying to avoid here.
14:08dnolentbaldridge: this not a real problem
14:08dnolentbaldridge: you would build a render channel which would collect changes
14:08tbaldridgebut events may not get to that channel in until 1024 ticks have passed
14:08dnolenif some changes split across a boundary, not much you can do about that - most UI systems work this way.
14:09dnolentbaldridge: in fact it's desirable, you want as many changes as possible, but w/o blocking repaint
14:11dnolentbaldridge: 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:17dnolentbaldridge: so fwiw, w/ my tick idea all my blog posts work great even w/ tick 1024
14:18dnolentbaldridge: and your degenerate gist case is just slower and spins the CPU in Chrome just as much a my tick version
14:18dnolenlooks like even slightly more
14:19tbaldridgednolen: 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:19dnolentbaldridge: I ran my 10,000 go blocks example w/ ticks works fine
14:20dnolentbaldridge: auto completer involves a realistic number of channels - works fine
14:21dnolentbaldridge: my intuition is that 1024 ticks is still cheaper than dispatch and does not affect order in any interesting way.
14:22tbaldridgednolen: that could be, i'm just interested in trying some other approaches before we throw in the towel
14:23srrubyWhat 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:23tbaldridgesrruby: use assoc
14:23tbaldridge,(assoc [1 2 3] 0 42])
14:23clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
14:23tbaldridge,(assoc [1 2 3] 0 42)
14:23clojurebot[42 2 3]
14:23eric_normandsrruby: (assoc v 0 42)
14:24eric_normandsrruby: should be much faster
14:24srrubyThanks!
14:24dnolentbaldridge: 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:26tbaldridgednolen: 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:26bbloomdnolen: tbaldridge: i just went back & re-read your discussion
14:27tbaldridgebbloom: I'm sorry
14:27dnolenbhauman: well this issue is blocking for doing more sophisticated with CLJS core.async :)
14:27bbloomtbaldridge: heh :-)
14:27bbloomregarding "repaint" or yeilding or whatever
14:27bhaumandark_element: link again?
14:27bbloomi think it's perfectly reasonable to require that apps that need to handle "frames" require explicit buffering and "flush" operations
14:27bbloomor "flip" in the double buffering sense
14:28dnolenbbloom: I wouldn't disagree w/ that
14:28bbloomyou shouldn't be modifying the DOM directly in event callbacks if you need to prevent frame-tearing
14:28dnolenbbloom: you could push thousands of updates to a render channel, when it receives flush it calls requestAnimationFrame
14:28dnolenbbloom: yep
14:28dark_elementbhauman sure. kapilreddy.me/examples/korova_drop/
14:28dnolenbbloom: but currently channel put! latency is too high to do this.
14:29bbloomdnolen: 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:29dnolenbbloom: heh, I remember you wanting it to be more sophisticated than a tick counter ;)
14:29srrubyI'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:30bhaumandnolen: 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:30bhaumandnolen: that's if I'm interpreting things correctly
14:30winkis there any easy way to get the current vhost name used from luminus/libnoir/ring.. well, anywhere.
14:30dnolenbhauman: yes, this is true for setTimeout, setImmediate, MessageChannel, and MutationObserver
14:30dnolenI've tried them all
14:30augustlwink: there's always the host header
14:31hequI 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:31bbloomdnolen: 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:31bbloomdnolen: that's what you've discovered is necessary :-) so i'm glad we're on the same page now
14:31winkaugustl: yeah, thought there might be a convenience function I missed
14:31tbaldridgebbloom: 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:31bbloomwe can experiment with more sophisticated schedulers, if necessary, once the initial change is made
14:32tbaldridgebbloom: I've used that approach recently and it worked just fine.
14:32dnolentbaldridge: using a atom for rendering commands just sound awful
14:32bbloomtbaldridge: 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:32dnolentbaldridge: graphics pipelines are basically what bbloom and I are describing
14:33dnolentbaldridge: and why introduce an atom as intermediate if you can just write command to a channel directly?
14:33dnolenseems like a middleman that does nothing
14:34bbloomhowever, if you have a frame-based system, i'm not convinced core.async is appropriate at all for handling of events
14:34bbloomyou need the ability to "drain" your event queue
14:34bhaumanit does seem strange to implement an atom to handle a queue of messages when you already have a channel
14:34seangroveIsn't the atom effectively a "double buffer" that you can write to, and then read/render from every Xms?
14:34tbaldridgednolen: 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:35bbloomwhich potentially involves differentiating between Tn -> Tn vs Tn -> Tn+1
14:35dark_elementhequ, is your source code pushed somewhere?
14:35seangrovetbaldridge: Sounds very reasonable
14:35bbloomtbaldridge: yeah, that's the sort of thing that only works w/ immutable data :-) hurray!
14:35dnolentbaldridge: less overahead?
14:36dnolentbaldridge: I just demonstrated I could write 1 million update into a channel with a sliding buffer in 9ms
14:36bhaumanwhoa
14:36bbloomtbaldridge: 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:36dnolentbaldridge: that's approach 60ms territory
14:36dnolenwell it's well in 60ms territory
14:37dnolener 60fps
14:37bbloommy biggest issue w/ using core.async inside a game engine or UI framework is that it's explicitly non-determinisitc
14:37bbloomthat'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:37dnolenbbloom: yes, I'm really setting games to one side here
14:38dnolenbbloom: I want fast channels so I can use channels fearless where I would traditional write
14:38dnolenaddEvent, fireEvent
14:38bbloomdnolen: yeah, that's a good goal
14:38bbloomdnolen: i think it's a dramatic improvement over traditional events for UI work
14:38hequdark_element: actually not and I also cannot do that because it's not open-source
14:39bhaumandark_element: Error creating WebGL context. three.min.js:428;
14:39bhaumanUncaught TypeError: Cannot call method 'getExtension' of null
14:39bbloomdnolen: i'll save the non-core-async based ideas for another discussion
14:39`cbpanyone have an opinion on http-kit vs lamina for websockets?
14:39hequI just don't get it why the piggieback nrepl doesn't work but I get it working from the lein trampoline cljsbuild
14:39bhaumandark_element: I'm on OSX Chrome 29.0
14:40ibdknoxbbloom: I think you can do something far more clever for games that doesn't actually need core.async
14:40bbloomibdknox: that's what i'm saying, only i'm saying it's even less clever :-)
14:40ibdknoxbbloom: carmack talked a bit about it in his quake con thing
14:40bbloomibdknox: yeah, he was talking about the full-memcopy w/ the write barrier. that's a damn good idea, he should do that :-)
14:41bbloomi think that actors make more sense than channels for game agents
14:41tbaldridgeibdknox: I really want to try that in clojure, transients for the current state, persistent for past state
14:41tbaldridgeor actually frozen/unfrozen js objects
14:41ibdknoxtbaldridge: it seems like tit would be pretty easy to put together
14:41ibdknoxit*
14:42bbloomas awesome as core.async is, i want to write as little of it as possible :-)
14:42ibdknoxme too
14:42tbaldridgeibdknox: I think it is
14:42bbloomprincipal of least power & all that
14:42ibdknoxI don't want to manage time anymore
14:42dnolentbaldridge: well you don't want to use Object.freeze in JS
14:42ibdknoxwe manage memory, why are we still managing time? :p
14:42bhaumanwhoa are we post core.asyc already
14:43ibdknoxbhauman: give me a month ;)
14:43amalloytbaldridge: 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:43ztellman`cbp: can't give an impartial opinion, but let me know if you have questions about websockets in aleph
14:43ibdknoxamalloy: I'd do each entity as a transient
14:44tbaldridgeamalloy: are you familiar with carmack's talk? If not, watch the part on GCs and it'll make sense
14:44`cbpztellman: awesome seems I'm trying aleph then :-)
14:44amalloy`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`cbpkk
14:46bhaumanibdknox: amalloy: that shows up in my dots game example. I keep a reference to the dom element and mutate it
14:46bbloombhauman: i was always more excited about tbaldridge's IOC macros than the CSP model, however good it is as a foundational model
14:46amalloybhauman: nothing against mutable objects, just transients in particular since they're so hard to use
14:47amalloy(nothing against transients *either*, of course, it just doesn't seem like using them to represent an entire game state will work well)
14:48tbaldridgeamalloy: watch about 10 min of this vid starting here: http://www.youtube.com/watch?v=1PhArSujR_A&amp;feature=player_detailpage&amp;t=1354
14:48bhaumantbaldridge: thanks for that link
14:48bbloomtbaldridge: 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:49bbloomibdknox: who was that that wrote about "automatic time management" ? i saw that somewhere, heh
14:49tbaldridgebbloom: 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:49ibdknoxbbloom: the strategy of collecting partially applied functions and working against the previous state of the game world is interesting though
14:50tbaldridgebbloom: if you express your world as a series of states, then (dec state) can be read-only and state can be write only.
14:50bbloomtbaldridge: 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:51ibdknoxbbloom: I don't remember, likely someone in FRP world.
14:51dark_elementbhauman, what does chrome://gpu say?
14:52bhaumandark_element: well there you go WebGL: Unavailable. Hardware acceleration unavailable
14:53bhaumandark_element: why would that be the case
14:53bhaumandark_element: ?
14:53bhaumandark_element: Oh i see a list of reasons below
14:54dark_elementbhauman ahh bummer
14:54bhaumandark_element: it says I have an old computer
14:54bhaumandark_element: WebGL is buggy with the NVIDIA GeForce GT 330M, 9400, and 9400M on MacOSX earlier than 10.8: 233523
14:55bhaumandark_element: sorry I can't help more
14:55dark_elementbhauman, no problemo
14:55dark_elementbhauman, thanks for taking a look
14:57agumonkeyhey there
14:58agumonkeyis there some kind of follow to clojure koans ? or clojure kata / golf ?
14:58dnolentbaldridge: tick stuff aside, is it cool if I merge in my fixes around the boolean tests?
14:59`cbpagumonkey: maybe try 4clojure.com?
15:00agumonkey`cbp: not bad thanks
15:01tbaldridgednolen: please do, I didn't know type hinting did anything in cljs
15:02dnolentbaldridge: ^boolean is the one we really support, ^not-native is also there but a bit more experimental
15:02bkirkbridetbaldridge: thanks for the quick core.async fix yesterday
15:03tbaldridgebkirkbride: no problem, I was working in the codebase anyways.
15:04bkirkbridetbaldridge: is it normal to see a spike in threads when creating a bunch of go blocks?
15:05bkirkbridetbaldridge: (dotimes [_ 10000] (go (>! ch))) bumped my JVM to 1800+ threads before GCing them
15:06tbaldridgebkirkbride: try the latest on master, I optimized that yesterday
15:06tbaldridgebkirkbride: the current algorithm should use numcpus + 42.
15:06dnolentbaldridge: mind if I fix the timeout channel race test?
15:06bkirkbrideyeah, I thought it might be the cachedThreadPool thing
15:06dnolentbaldridge: they just need to be in the same go block
15:07tbaldridgebkirkbride: that being said, your test is a bit contrived
15:07tbaldridgednolen: sure
15:07bkirkbridetbaldridge: sure, my example left out the msg and I think I was actually <! from the channel...
15:08bkirkbridetbaldridge: I was testing the impact of spinning up go blocks that immediately blocked. To test my assumptions/understanding. Not as benchmark
15:08bkirkbridetbaldridge: The really strange thing was that adding a Thread/sleep after creating the block made the thread count jump MUCH higher.
15:08tbaldridgebkirkbride: 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:09tbaldridgebkirkbride: 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:10tbaldridgebkirkbride: 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:10tbaldridgebkirkbride: if you don't have 10000 cpus, then starting that many gos just slows things down.
15:11stuartsierratbaldridge: I wonder if Google would come after us if we called them "goroutines"?
15:13bkirkbridetbaldridge: Right. Depending on the granularity of your tasks it might involve a lot of threads though.
15:13bkirkbridetbaldridge: Definitely not, the sleep was outside the go at the end of the dotimes, that's what was weird.
15:13hyPiRionseems okay, Go is under the BSD2 clause.
15:13bkirkbridetbaldridge: Ok. I hadn't thought about it that way. I found that go blocks make for a really clean limiter on parallelism.
15:13hyPiRion*license
15:13technomancyhyPiRion: that doesn't cover trademarks though
15:14tbaldridgebkirkbride: that's what reducers are for
15:14bkirkbridetbaldridge: 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:14hyPiRiontechnomancy: well, they've covered "Google Inc." and "the names of its contributors"
15:15bkirkbridetbaldridge: Hmm, I'd looked at doing it in a reducer and abandoned that. I'll take another look.
15:15bkirkbridetbaldridge: Thanks for the tips, much appreciated!
15:15hyPiRionbut hm, IANAL.
15:16tbaldridgebkirkbride: 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:16tbaldridgejust don't spin up 10000 gos, one for each item to process
15:16stuartsierraOf course, we could call them 'coroutines' and be in the clear.
15:21stuartsierraOr come up with an even cleverer name.
15:21ziltiSomeone 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:21hiredmancoroujines
15:21stuartsierraouch
15:21bbloom*sigh* lol
15:25seangroveI'm curious to experiment with web-workers + reducers in cljs, but another day, perhaps
15:26seangroveHard to find "lowish-level" clojurescript hackers in SF willing to meet up and experiment
15:27si14how possibly this piece of code can cause reflection warning? (aset (double-array (.data new-m)) (int i) (int 0))
15:27si14"call to aset can't be resolved"
15:27muhooseangrove: clojure meetup
15:28muhooseangrove: or, suggest cljs for a dojo exercise
15:28seangrovemuhoo: Clojure dojo has been good, but the skill level and time is spread pretty thin
15:28seangroveMight be good to have an "intermediate/advanced" dojo meetup
15:29muhooi like the mixed bag
15:29hiredmanyou are writing an int to a double array?
15:29dnolenstuartsierra: hmm when built CLJS it didn't create a tag in the GitHub repo, did I miss some step?
15:29muhooi got to watch over zach's shoulder as he hacked, was a real treat
15:29konr`why should I use (seq x) instead of (not (empty? x))?
15:29stuartsierradnolen: busy now, will investigate later
15:30dnolenstuartsierra: k thx
15:30jtoycan anyone recommend an article/info on how to write clojure objects to disk? Im not finding good info on google
15:31muhoojtoy: pr-str
15:31jtoythanks,
15:32muhoowrites sexps, not objects. read em back in with read edn, roundtrips nicely
15:32ziltidnolen you have to explicitly push tags to the repo
15:32jtoymuhoo: I just want to write maps out to a file, is that considered sexps?
15:33ziltijtoy: (spit "filename" (str datastructure))
15:33konr`nevermind, just rtfs :)
15:34mpenetjtoy: that kind of works, until you require to keep the types intact (numeric types, array-map vs hash-map, etc)
15:35mpenetjtoy: then you use nippy or something similar
15:36jtoyhmm, json might be good for this too as its cross platform
15:37ziltijtoy: EDN is cross platform too
15:37mpenetif you need to be able to use it from other languages yes, but you loose Sets, arbitrary keys, keywords etc etc
15:37ziltiThere are EDN implementations for at least Java, C# and Ruby.
15:38jtoyim using ruby and clojure
15:38ziltiSo you could use the EDN-Library for Ruby instead of using JSON as an additional format
15:38seangrovezilti: Quite slow in the browser though, depending on the volume of data
15:38si14hiredman: yeah, you are right, that was the error — kinda strange that it was "can't resolve" error.
15:39si14hiredman: well, not really. stupid mistake. my bad.
15:39ziltiseangrove: 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:40ToBeReplacedloosely on topic; how do people here feel about versioning data?
15:40ziltiI'd like to punch the JavaFX API designer in the face
15:40bbloomToBeReplaced: 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:41ToBeReplacedbbloom: I was thinking #foo.bar{:x blah :version blah}
15:42seangroveToBeReplaced: What's the goal of versioning?
15:42bbloomToBeReplaced: 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:42ToBeReplacedi'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:43seangroveToBeReplaced: Ah, got it
15:43ToBeReplacedI want to send more data with A, and have B be able to differentiate old vs new
15:43bbloomToBeReplaced: there are several schema systems out there for EDN (i dunno if any of them are any good)
15:43ToBeReplacedbbloom: do i just google EDN schema? or do you have one/some in mind?
15:44boodlenot sure why this won't work.. https://www.refheap.com/17863 I'm trying to replace empty strings w/nils in a map
15:45bbloomToBeReplaced: 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:45ToBeReplacedyeah
15:45bbloomToBeReplaced: something like {:format :my.namespace/blarg2, :other "data :here 123}
15:46ziltiboodle: (if (empty? %))
15:46bbloomthat's as simple as it gets
15:47boodlezilti: I'm still getting weird err msgs about java.lang.String can't be cast to clojure.lang.Associative
15:47dnolenboodle: update-in doesn't work like that, you can't update keys in parallel in that way.
15:48bbloomboodle: yeah, re-read ##(doc update-in)
15:48lazybot⇒ "([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:48boodleBut I pass a sequence of keys (array) and thought it'd iterate through each passing its value into my fn
15:48dnolen(zipmap (keys map) (map #(when-not (= % "") %) (vals map)))
15:48bbloomhm, yeah, not completely clear...
15:48dnolenboodle: that's not how update-in works
15:48bbloom(doc get-in)
15:48clojurebot"([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:49bbloom(doc assoc-in)
15:49clojurebot"([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:49boodlednolen: k
15:49bbloomboodle: the operative words being "nested associative structure"
15:49bbloomthe keys are a *path*
15:49bbloomotherwise, it would be a coll of keys, not a sequence
15:49boodleok.. got it. I kept assuming that since it'd take a sequence it would iterate thru... oops
15:50mpenet,(clojure.set/rename-keys {:a 1 :b 2} {:a :aa})
15:50clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
15:50mpenet:(
15:51bbloom,(require 'clojure.set)
15:51clojurebotnil
15:51bbloom,(clojure.set/rename-keys {:a 1 :b 2} {:a :aa})
15:52clojurebot{:aa 1, :b 2}
15:52bbloomtada!
15:52mpenetah! it's allowed?
15:52bbloomi was surprised by that too, heh
15:52mpenetI always wondered why it sits in clojure.set
16:01bbloomdnolen: i'm so glad people are paying attention to algebraic effects :-)
16:02bbloomdnolen: i think it's *the* biggest missing puzzle piece in the functional programming world
16:02muhoompenet: lots of good stuff, like stringify-keys or keyordize-keys
16:06dnolenbbloom: 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:07bbloomdnolen: it's only expensive perf wise b/c the JVM doesn't have delimited continuations or heap allocated stacks
16:07dnolenbbloom: for some stranger capabilities, like cheap amb, or the probabilistic stuff could be useful
16:08bbloomdnolen: 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:09dnolenbbloom: still more theoretical than practical - you need a machine and a surrounding language for it to matter
16:10dnolenbbloom: or show that you can target traditional hosts w/o imposing significant overheads
16:10bbloomdnolen: the scala folks have proven that you can do delimited continuations on the JVM without significant overhead
16:10bbloomdnolen: unfortunately, it's a type-directed approach
16:10dnolenbbloom: yes, that pretty cool
16:10bbloomit's entirely possible to do w/ clojure, but it would require the compiler perform static inlining of all higher order operations
16:10bbloomwhich is also provably possible in practice for a dynamic language. Factor does it, for one
16:11mpenetmuhoo: these in clojure.walk!
16:12mpenetmuhoo: these are *
16:13bbloomdnolen: if you recall back when i was trying to do the CPS transform, i was trying to follow the scala approach
16:13bbloomdnolen: unfortunately, it requires tagging of functions that have control effects
16:13bbloomdnolen: you can bypass that tagging if you only have to tag a few primitives & then defunctionalize (ie inline higher order functions)
16:14bbloombut 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:14bbloomif 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:14bbloomattempting to use a control effect in there would cause a runtime error
16:15bbloomyou can solve *that* problem by adding a "call" primitive, which is what Factor does
16:18dnolenbbloom: 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:19bbloomdnolen: 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:19bbloomdnolen: effects give you a better way to structure that, such that all side effects always have their influence scoped to some control value
16:20bbloomdnolen: 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:21bbloomwant to have every read/write logged to all your atoms? you can just make that work
16:21bbloomyou can't (reliably) do that via with-redefs or binding or whatever
16:25dnolenbbloom: 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:26bbloomdnolen: 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:27bbloomdnolen: in theory, you can view clojure as occuring inside the dynamic extent of a "java effect handler"
16:27bbloomwhich gets dot operations, finds the global "java effect instance" and then sends it a message
16:27bbloomthe java handler evaluates java code, and continues clojure execution with the result
16:28bbloomin theory, that is just optimized to directly pushing java on the stack, b/c java always returns
16:28bbloom(baring exceptions, etc)
16:28bbloombut imagine if you had clojure.core/java-effect
16:29bbloomyou could redefine that to trace EVERY INTEROP CALL
16:29bbloomyou get power to abstract over dynamic extent, communication with the outside world, etc
16:30bbloomin a composable way
16:30bbloomit's a big deal
16:30bbloomthe Eff guys say: "handlers are to delimited continuations what if/while are to goto"
16:31bbloomso far, i'm inclined to believe them
16:38bbloomdnolen: i should also add that effect instances make it possible to do effect inference
16:38bbloomdnolen: just like type inference
16:50noncomare there any plans to extend core.async for network integration?
16:51dnolennoncom: tbaldridge was toying with that at one point
16:52noncomhow was it?
16:52dnolennoncom: no idea ask him next time he's around
16:52noncomok
16:54stuartsierradnolen: I see the r1859 tag on GitHub, isn't that from the latest release?
16:54dnolenstuartsierra: oh hmm I didn't see it
17:01shiranaihitocan i somehow "splice" a sequence into a function call's "variadic arguments"?
17:02shiranaihitolike python's "somefunc(*list_var)" -- where "somefunc" would take a variable number of arguments
17:02gunsshiranaihito: Use the apply function
17:02shiranaihitothe asterisk would tell python to "destructure" (or whatever :p) the list variable's contents into the call
17:02shiranaihitohmm
17:03llasramshiranaihito: ##(apply + 1 2 [3 4 5])
17:03lazybot⇒ 15
17:03shiranaihitoalright, i'll look into it, thanks!
17:03gunsWith CLJS :nodejs :advanced compilation, the arguments to *main-cli-fn* are nil without an extern file for the process package
17:03gunsis this intended?
17:04gunsusing lein-cljsbuild forgot to mention
17:09rhg135any 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:11nDuffrhg135: AFAIK, targeting Dalvik is a non-goal for Clojure-on-JVM.
17:12nDuffrhg135: cljs is in a much better state re: usability on smaller environments.
17:12sevvieguns: I know this doesn't solve your problem but I am curious what you put in externs.js for it?
17:12rhg135i know, buthas anyone worked on it recently?
17:13dnolenguns: probably makes sense to handle that at cljsbuild or in your project, node.js support is really rudimentary
17:13gunssevvie: I used an externs file for the node.js process module. The issue is that (.-argv nodejs/process) is optimized away without it
17:13llasramrhg135: https://github.com/clojure-android/lein-droid
17:13gunsdnolen: ok, got it
17:14rhg135ok
17:14rhg135just was wondering if that was dead?
17:14llasramIt had a commit like 2 days ago :-)
17:15sevvieguns: ah, right, I see what you're saying now. Thank you.
17:16rhg135ic
17:17ziltiI 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:17clojurebotAck. Ack.
17:17rhg135it's hard to justify clojure to android devs if it's useless on dalvik
17:18rhg135but i do it anyway
17:19noonianI 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:19noonianway* simpler
17:19noonianI'm not sure how well it would work with a larger app with real UI's though
17:20rhg135well i'm about to write a small radio app
17:20rhg135it'll be open source
17:20rhg135hope that goes well
17:20nooniannice, best of luck
17:24TimMcMultimethods question!
17:25TimMcI 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:26TimMcIn 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:29konr`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:30sinistersnareis 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:31schmirsinistersnare: yes
17:31sinistersnareschmir: clever
17:32sinistersnarewould you mind telling me how?
17:33shdwprincesinistersnare: :repl-options :init in project.clj
17:33schmirhttps://github.com/technomancy/leiningen/blob/master/sample.project.clj#L294
17:33schmir(sorry, had to look it up)
17:33sinistersnareits ok
17:33sinistersnarethanks much guys
17:34fbernierHey, 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:34fbernierhttps://www.refheap.com/8c792058fea41edb0f9f8d127
17:35noncomfbernier: looks like you do not close the out stream?
17:36noncombut that wouldn't cause such a leak i guess..
17:36fbernierwhen I benchmark it I get at about 1.5g in a minute
17:37fbernierand it just never goes down
17:37noncomis it when there is no work or when there is work?
17:37noonianfbernier: 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:37fbernierwell memory is stable when there is no work
17:37fbernierand grows when there is
17:38jtoyhow can I say in clojure, give back to me from collection 4th element to the end?
17:38jtoyin ruby i would do collection[4...-1]
17:38konr`,(drop 4 (range 10))
17:38clojurebot(4 5 6 7 8 ...)
17:38noonianjtoy: it might not be idiomatic, but (-> col rest rest rest rest) would work :P
17:38benkay,(doc drop)
17:39clojurebot"([n coll]); Returns a lazy sequence of all but the first n items in coll."
17:39noonianah, drop
17:39AimHere,(nth (reverse [1 2 3 4 5 6 7 8 9]) 3)
17:39clojurebot6
17:39jtoynice,didnt know about drop
17:40shdwprincefbernier: I can only suggest closing streams in render-image
17:40edbondfbernier, try imagemagick convert
17:41fberniernoonian: unsure about that ... I'm quite green to clojure
17:41edbondfbernier, "convert -density 288 image.pdf[0] -resize 25% image.jpg"
17:41fberniernoncom: shdwprince: I'll try that.
17:42fbernieredbond: there's a reason I'm converting and serving them on the fly via http :)
17:42noncomfbernier: you might as well consider using a profiler
17:42shdwprincefbernier: and dont forget that you can monitor memory of JVM on fly
17:43fbernieryeah I know I can but I've never done this yet. WIll have to search and seek how.
17:47srrubyIs comp commonly used to compose functions in clojure?
17:47noncomsrruby: only when it heps
17:47sinistersnare,(doc comp)
17:47clojurebot"([] [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:48callentechnomancy: I presented and explained a Clojure project to my coworkers today. Leiningen was very popular. :)
17:49noncomcallen: what is the techno bckg of the coworkers?
17:51noncomwhat is the simplest way to reload all in ccw?
17:53Apage43technobackgammon
17:53callennoncom: they're all Python people with the greybeards being ex-Scala hackers.
17:53callenex, because of the Python people.
17:53callenI should do a presentation called, "JVM Strikes Back!"
17:54noncomnice!
17:54noncomApage43: i hear you
17:55shdwprincecallen: make 4 presentations first and name it episode 5
17:55noncomahahaha
17:55noncomand start from the 3rd one
17:55noncom(or 4th? omg i dont remember details about that saga)
17:55shdwprinceRevenge of the JVM?
17:56callennoncom: 4thm
17:56callennoncom: let me know if you figure out how to reload-all in CCW.
17:56noncomi always was more into start trek
17:56callenI was testing CCW the other day and couldn't figure out how to do that.
17:56shdwprinceclojure is a new hope of jvm
17:56callenthere might be a generic way to do it in any REPL
17:56callenand if there isn't, it should be written.
17:57noncomi guess 'll eventually ask laurent petit.. when i see him..
17:57noncomscala: the princess is in another castle
17:58technomancycallen: o/
17:59callentechnomancy: the guy who'd done Java + Maven before was especially impressed with Leiningen and that Clojure was "just a library"
17:59callenI showed him lein-scalac :)
18:00technomancyits-a-trap.jpg
18:04shdwprincecallen: when you write "just a library" you mean't "just a dependency"?
18:04moominpapaSorry, 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:05shdwprincemoominpapa: a.core.X should work
18:07moominpapaOkay, and how do you require it? (:require [a.core :refer [X]]) doesn't seem to be working.
18:08ToBeReplacedmoominpapa: your require should work
18:12moominpapaHuh.
18:12moominpapaIt's insisting no such protocol exists.
18:18moominpapaIt appears the refer line will accept any old rubbish, but deftype actually wants to check.
18:19moominpapaAnyone have an example of this working on github they can point me to?
18:20tim__dnolen: ping
18:22moominpapaActually, maybe it generates a warning but the generated code is OK. Let me investigate.
18:23tbaldridgednolen: 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:23hyPiRionyou must import it
18:23hyPiRionit's one of those things
18:26yediis there a blogpost that depicts the stages of a clojure programmer's journey?
18:27noncomyedi: there were some like that but i have no links.
18:28dnolentbaldridge: 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:32moominpapaHyperion: import doesn't seem to do the trick either :(
18:32moominpapaAssert failed: Only lib.Ctor specs supported in :import; offending spec: [ajax.core AjaxImpl]
18:32hyPiRionhm, strange
18:33moominpapaAnd now you can work out which project I'm working on :)
18:34moominpapaThe annoying thing is: the code actually works. I just can't make the "this protocol doesn't exist" warning go away.
18:36moominpapaAh, hang on...
18:36moominpapa...nope, stet. The protocol runs, the compiler just doesn't seem to like it.
18:40technomancyleiningen 2.3.2 is out; feel free to `lein upgrade`
18:40technomancyI think we got all the nasty bugs this time
18:40hyPiRion(inc technomancy)
18:40lazybot⇒ 69
18:40callen(inc technomancy)
18:40lazybot⇒ 70
18:40technomancy(inc cemerick)
18:40lazybot⇒ 13
18:40callentechnomancy: thanks for making it so easy to convince my workers to test Clojure for an important project. :)
18:40technomancy^ who actually performed the release this time around
18:40callen(inc cemerick)
18:40lazybot⇒ 14
18:41yesac(count (:bugs leiningen))
18:41technomancy(dec leiningen-bus-factor)
18:41lazybot⇒ -1
18:41sinistersnarebus!
18:41sinistersnare(leiningen-bus-factor)
18:41sinistersnarewhat is that?
18:41hyPiRiontechnomancy: yeah, it's up to 3 now, isn't it?
18:42hyPiRionand you should increase the bus factor mister, not decrease it :p
18:42technomancyhyPiRion: yeah. maybe I can rope you in for the next one =)
18:42callen(inc leiningen-bus-factor)
18:42lazybot⇒ 0
18:42technomancyhyPiRion: oh yeah; I always get that wrong
18:42callentechnomancy: you aren't thinking of handing it off are you? :(
18:43hyPiRioncallen: you need two ?? and you'll get an immediate answer for that
18:43hyPiRionright??
18:43lazybothyPiRion: What are you, crazy? Of course not!
18:43technomancycallen: no, just could be struck by sudden-onset-crippling-RSI or something
18:43callenhyPiRion: thanks. :)
18:43callentechnomancy: with that weird keyboard you use? no way.
18:43technomancycallen: heh... well it's about to get weirder
18:43hyPiRionsinistersnare: 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:43technomancyjust ordered an ergodox
18:44sinistersnarehyPiRion: so we need one more person on the project for it to die?
18:44sinistersnareits -1!
18:44callenhyPiRion: or at least necessitate a long time spent relearning or replacing the project.
18:44callensinistersnare: I inc'd it.
18:44hyPiRionsinistersnare: heh, it's 0 now. But yeah, it's up to three people now.
18:44sinistersnarewait
18:45sinistersnareso is it dead? im so confused
18:45technomancy(inc leiningen-bus-factor)
18:45lazybotYou want me to leave karma the same? Fine, I will.
18:45TimMcsinistersnare: No, it's just that the bus factor itself is disliked.
18:45hyPiRion(inc leiningen-bus-factor)
18:45lazybot⇒ 1
18:45technomancyderp
18:45hyPiRionWhaa
18:45hyPiRion(inc leiningen-bus-factor)
18:45lazybot⇒ 2
18:45hyPiRion(inc leiningen-bus-factor)
18:45lazybot⇒ 3
18:45hyPiRionthere
18:45sinistersnare:D
18:45sinistersnareyay!
18:45sinistersnarewho are the three main people? technomancy, ?, ?. ?
18:45technomancyI still need to get creds for updating leiningen.org and the leinreleases tweetor account
18:46technomancysinistersnare: xeqi and cemerick so far
18:46sinistersnareoh cool
18:47technomancythey'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:47sinistersnareyay
18:49TimMctechnomancy: I don't think I have your key.
18:49technomancyTimMc: we can remedy that at strangeloop or the conj, your pick =)
18:49TimMcI won't be at the Conj, unfortunately.
18:50TimMcOr SL.
18:50sinistersnareTimMc: you should buy me a ticket to the conj for technomancy's sake
18:50technomancyah bummer
18:51TimMcAre you 0x77E77DDC?
18:51sinistersnareis he a user here?
18:51sinistersnareno
18:51technomancymaaaaybe
18:51sinistersnareim sinistersnare
18:51sinistersnarebut youre probably talking to technomancy :p
18:52technomancyTimMc: that's my key, but you shouldn't trust it without verifying it in person
18:52TimMc*nod*
18:52technomancyor transitively verifying it via someone you trust in person
18:52TimMcOver 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:53technomancyI guess you could confirm it by asking hard questions about leiningen internals that an impostor wouldn't be able to answer
18:53technomancybut it's hard to give general advice about that kind of thing
18:53TimMcNah, still susceptible to MitM, if that's your concern.
18:53TimMcVerification 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:54technomancythis is true
18:54TimMcOoh, I wonder if...
18:54zero-ex-3BBF4E12nice
18:55zero-ex-3BBF4E12No leading numerals allowed, though.
18:55konr`on core.logic, is there something similar to `membero` for hash-maps?
18:56TimMctechnomancy: 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:56dnolenkonr`: not really, you can seq first - but if all you want to do is detect something you have featurec
18:57technomancyTimMc: easypg makes a *huge* difference vs what I used to use
18:57technomancybefore easypg it felt like eating my veggies; now it's just a seamless thing I take for granted
18:58TimMcOoh, and mail clients need to ad encrypt-to-self as a default.
18:58TimMcPeople are gonna be *pissed* if they find they can't read email they sent to someone else.
18:59winkeasypg? *googles*
18:59winkargh. emacs
19:00winkI should've known
19:00dnolentbaldridge: we definitely need to get rid of unshift from CLJS core.async - http://jsperf.com/array-push-vs-unshift/32
19:01tbaldridgednolen: yeah I was looking at that exact error earlier today
19:01callenemail just in the way its used can't really be secured.
19:01kyled1hmm, anyone have opnions about less vss scss (sass), vs stylus?
19:01callenyou'd have to "cut over" to something different in order to have everybody on board with full encryption
19:01winkkyled1: sass worked like a charm everyday, had some meh experience with less, but can't pin details anymore
19:01Apage43dude
19:01winks,everyday,every time,
19:01konr`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:01Apage43multiparty encryption in general is just pretty hard
19:02kyled1wink: thanks
19:03cesparekyled1: 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:03cespare*too
19:03dnolenkonr`: well seq definitely won't won't in general, perhaps worth adding some kind of constraint that will give you seqs
19:08TimMccallen: Email contents can be secured, but the tools for it are pretty annoying right now.
19:08kyled1cespare: cool, thanks
19:09kyled1i guess heres the bigger question, would you recommend using it with yui3 grid?
19:09cesparehaven't used yui3 myself, sorry
19:09kyled1woah, i jsut realized i am in the wrong channel haha, sorry
19:09cesparehaha
19:22supersym:)
19:32winkkyled1: if it soothes your mind, that wasn't especially offtopic :P
19:36bbloomdnolen: you ever look at Qi/Shen & it's logic system?
19:36bbloomcurious your thoughts on it
19:39kristofbbloom: it's prolog for clojure.
19:39kristofbbloom: Er, for Lisp I mean.
19:39bbloomkristof: sure, but i'm curious where it fits in to the CLP(X) worldview
19:40kristofbbloom: On one of the clojure conj 2012 videos (the one about Typed Clojure), Ambrose commented on it.
19:40kristofC-L-what?
19:40seangrovednolen: 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:40bbloomkristof: (for-all [x] (constraint-logic-programming x))
19:41kristofbbloom: Does clojure.logic not already have constraint based programming?
19:41kristofEr, core/logic
19:42kristof.... core.logic, it is
19:42bbloomkristof: there are many types of constraint programing models. core.logic supports several & aims to include others wherever it makes sense
19:42kristofCool =) I have to look it up sometime, after I read the Reasoned Schemer
19:42hiredmanbbloom: where x is some kind of adt?
19:42bbloomhence my interest in dnolen's view
19:43srrubyAre people using :pre and :post much ?
19:43hiredmanI've been using them a lot recently
19:43bbloomhiredman: i was being cute. much of the CLP lit refers to CLP(S) for sets or CLP(FD) for finite-domain
19:43technomancysrruby: I don't, but I know I should
19:44bbloomhiredman: hence CLP(X)
19:44glosoliHmm anyone uses some color scheme on VIM which could is friendly with clojure and highlights function calls ?
19:46dnolenseantallen: medium, probably same as fixing source maps
19:46arohnerwhat was the name of the library to use CLJS datastructures from plain JS?
19:46bbloomarohner: mori
19:46arohnerbbloom: thanks
19:47dnolenbbloom: it's cool, it's Prolog, far as I can tell core.logic is competitive in terms of resolution perf
19:48bbloomdnolen: 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:48dnolenbbloom: right, sequent calculus - which Prolog is a fragment of
19:48bbloomdnolen: it has defprolog or whatever that activates horn-logic syntax for doing *programming* which is clearly different than the underlying sequent calculus engine
19:49bbloomdnolen: gotcha
19:50bbloomdnolen: 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:50bbloomdnolen: seems like reified logic variables is the big idea that enables collaborating CLP models, no?
20:02dnolenbbloom: yes, most CLP system have some notion of logic variable
20:03dnolenbbloom: 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:04bbloomdnolen: 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:04dnolenbbloom: my assumption is there's to service the type system and it results in a fairly poke-y Prolog
20:05bbloomdnolen: from what i can tell, it's actually a more powerful prolog that exists to enable you to write your own type systems
20:05bbloom… of which they provide one
20:06dnolenbbloom: 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:13ed_gis there a clojure equivalent of MAPLIST?
20:14dnolenok more or less everything I said early today about core.logic messaging performance was wrong :P
20:14bbloomdnolen: core.async? lol. what did you discover?
20:14dnolener core.async CLJS messaging performance I mean
20:14dnolenbbloom: I just didn't understand when dispatching happened
20:14bbloomed_g: have you looked at clojure.walk ?
20:15dnolenbbloom: and I didn't understand why rhickey thought we don't need a scheduler
20:15dnolenbbloom: task granularity can be encoded in the buffers themselves
20:15dnolenbbloom: it wasn't obvious to me because CLJS core.async implementation of buffers is busted
20:15bbloomdnolen: what's busted about them
20:15dnolenbbloom: they're modeled around .unshift on arrays
20:16dnolencrazy slow
20:16bbloomdnolen: blargh. yeah full O(N) copy
20:16dnolenso for large buffers perf goes out the window
20:16bbloomdnolen: this is for buffered channels?
20:16bbloomdnolen: should use a circular array buffer
20:17dnolenso I think as soon as I fix this
20:17dnolenyou will get lightening fast message performance if you pick the right buffer size
20:17bbloomfor fipp, i experimented w/ several buffer sizes & found that *width* (the max look-ahead for the measuring process) worked out nicely
20:18bbloomi'm not really sure how to pick a buffer size in general though
20:18dnolenbbloom: I don't it can be done in general but it not something I really that much about
20:18dnolenpick a fat buffer when you're going to pumping out tons of updates
20:18dnolenand small ones or none otherwise
20:19dnolenthis why all my attempts at larger examples broken down
20:19dnolenpicking larger buffer sizes wasn't helping
20:19bbloomah makes sense
20:19bbloombenchmarking is hard.
20:19bbloomswitch to a ring buffer :-)
20:19bbloomi <3 ring buffers
20:20bbloommost under appreciated mutable data structure :-)
20:20dnolenbbloom: looking at them right now
20:21dnolenbbloom: seems like it would work for all the buffer types
20:21dnolenas ring buffer is just underlying storage
20:21bbloomdnolen: 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:22dnolentbaldridge: btw, forget everything I said earlier today about core.async
20:22dnolentbaldridge: all my issues are because the buffer implementation as array doesn't work for large buffers
20:22dnolentbaldridge: I'm thinking about implementing a ring buffer for core.async as suggested by bbloom
20:23ed_gbbloom: 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:23ed_gmaybe its there and I'm not seeing it
20:24bbloomegghead: 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:24bbloomed_g: oops for you, not egghead , sorry
20:24bbloomed_g: see also tree-seq
20:24ed_gbbloom: fantastic, thank you!
20:24bbloomdnolen: http://www.museful.net/2012/software-development/circulararraylist-for-java
20:25bbloomdnolen: 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:25bbloomyou can even drop get, set, remove(i) etc
20:25bbloom:-P
20:37dnoleneh, for core.async I don't think we need antyhing more than this http://gist.github.com/swannodette/6288965 :)
20:38bbloomdnolen: excellent
20:38bbloomdnolen: s/unshift/conj/ ?
20:39dnolenbbloom: it a low level thing to to be used only inside of buffers.cljs, drop in replacement for array is the idea here.
20:40dnolenshould be wicked fast
20:40bbloomdnolen: sure, but you're taking advantage of the overly permissible compiler. you need either a defprotocol or should make non-member functions :-)
20:41dnolenbbloom: nah, Object methods were intended for this as far as I can tell :)
20:41bbloomdnolen: also, does the surrounding code enforce the max size on the buffer? b/c your unshift method doesn't
20:41dnolenbbloom: surrounding code does this
20:42dnolenbbloom: ring-buffer really is perfect here, was thinking about a linked list
20:42dnolenbbloom: but this will have much better performance
20:42bbloomyup
20:42dnolenbbloom: thx
20:42tbaldridgednolen: this will only work for buffers though, as put/take queues need to be unbounded (or grow to max-queue-size)
20:43dnolentbaldridge: yes, where would I use it?
20:43bbloomi'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:43dnolentbaldridge: where else would I use it I mean except for buffers
20:45tbaldridgednolen: 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:45tbaldridgeidk, it seems that if we get (chan 1) working as fast as possible, all the rest will fall into place.
20:46bbloomtbaldridge: both shift & unshift are O(N)
20:46dnolentbaldridge: push shift both involve resizing, no JS engine is going to like that
20:46tbaldridgebbloom: but unshift is 98% slower
20:46bbloomtbaldridge: seriously? heh.
20:46dnolentbaldridge: how is unshift slower?
20:46bbloomfucking javascript
20:46tbaldridgethat's the link I posted a few minutes ago
20:46dnolentbaldridge: oh yeah in general yes
20:46dnolentbaldridge: that why I think switching to a ring buffer is the way to go
20:47bbloomcircular arrays are basically the optimal data structure for a fixed size buffer
20:47dnolentbaldridge: the JS engines likely do the same thing we do for small arrays, slightly bigger array to support shift unshift
20:47tbaldridgednolen: yeah, it probably is, we'll still need 3 implementations though, as sliding/dropping will do different things to head
20:47dnolentbaldridge: why?
20:47dnolentbaldridge: all them of them work on the array in the same way in the code?
20:48tbaldridgednolen: nope, notice the remove! in the add! of sliding buffer, it's not there in dropping buffer
20:48tbaldridgeah I suppose we could wrap the ring buffer, yeah, that could work.
20:49dnolentbaldridge: that's what I mean :)
20:49bbloomtbaldridge: yeah he just made a ring buffer w/o any invariants that mirrors the javascript array interface
20:49dnolentbaldridge: it's a drop in replacemnet for *array*
20:49tbaldridgesorry, I'm have a head cold, not exactly thinking straight tonight.
20:49bbloomtbaldridge: then move your ass to the couch & boot up netflix
21:02callenbbloom: have to be sometimes, especially if it's an unlimited vacation company.
21:17hiredmandnolen: fyi script/repl in the clojurescript repo doesn't have tools.reader on the classpath it seems?
21:17dnolenhiredman: oh hm, thx will add
21:36dnolenk 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:37dnoleneverything appears to get GCed beautifully too
21:37bbloom::thumbs up::
22:46bbloom*ugh* once again i wish javascript had weak references....
22:48callennote to self, firing off 10,000 simultaneous threads not a recipe for success.
22:49fbernierCan a compojure route match only of some specific query strings are present?
23:02amalloyfbernier: just return nil instead of a response if you don't like the query params
23:03bbloomawesome 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:22sevviebbloom: Such a tempting WARNING.
23:23TimMccallen: That depends on what you are trying to achieve.
23:23TimMcFor instance, perhaps you wanted a space heater.
23:38amacdougallAfter 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:38amacdougallGoogle 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:44TEttingeramacdougall: (require [your.namespace core] :reload)
23:44TEttingerI was told that or something like that would work, haven't tried yet
23:56callenTimMc: I was being lazy and doing the (doall #(future ... )) dilly.
23:56callenTimMc: I forgot the seq was ~10k elements long though.
23:56sinistersnarelol