#clojure logs

2012-10-26

00:00egghead;)
00:00SgeoHeard of it, didn't pay much attention
00:00ynnivSgeo: that's what we all want...
00:01eggheadSgeo: they have optional types and mirror-based reflection like strongtalk, but it's a browser thing...
00:01SgeoI've heaerd of them in the context of Newspeak
00:06bfabry*sigh* nope, lein trampoline repl still gives me a repl that doesn't reload when I tell itto
00:21amalloyi think ynniv missed my point, which was that *especially* if your codebase is mostly correct, any rate of false positives will lead you to get more false positives than true positives
00:55uroborus_labsDoes anyone know of a good example of using a jquery plugin with clojurescript?
00:56uroborus_labsI seem to be having trouble mostly with the externs I think...
01:44tomojstandard java.util.concurrent.Future behavior seems to be that .cancel permamently breaks the Future
01:45tomojshouldn't we get something better for clojure?
01:54antares_tomoj: what should .cancel do in your opinion?
01:58uroborus_labsIs there a dedicated clojurescript channel?
01:59ivanuroborus_labs: yes but nobody uses it
01:59uroborus_labsYeah noticed that...
01:59uroborus_labsI have having a lot of trouble getting externs to work with it
01:59ivannobody uses the channel, that is
02:01ivanuroborus_labs: did you add some :externs to your project.clj for lein-cljsbuild?
02:02uroborus_labsYup
02:02ivanhave you written working externs before?
02:02uroborus_labsI placed the file in resources/externs/myexternfile.js
02:02uroborus_labsNope
02:02uroborus_labsDoes cljsbuild auto scan for changes in project.clj?
02:03ivanI have no idea, I'm only familiar with the vanilla Closure Library toolchain
02:03uroborus_labsahh ok
02:04dnolenuroborus_labs: have you seen http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html?
02:04dnolenuroborus_labs: also you should look at how jayq does it.
02:05uroborus_labsYeah I read that and scaned the jayq source code
02:05uroborus_labsMultiple times
02:05uroborus_labslol
02:05ivanhow do you know your extern isn't working? are you seeing renamed properties in the compiled code?
02:06uroborus_labsYes
02:06dnolenuroborus_labs: there's also a thread about that on the Clojure ML right now
02:10uroborus_labsivan: Thanks for the release-notes link. Doing some digging now about the auto extern loading
02:25Momolhi there
02:26Momolis anyone progamming in clojure uses a BSD system ?
02:58uroborus_labsGood lord, 3 hours of BS bug finding on why I was not doing externs correctly when the issue was somewhere in setting cljsbuild compilation from :advanced to :simple
03:00uroborus_labsI should say setting :optimizations
03:00tomojyou abandoned advanced?
03:00uroborus_labsFound this out through testing https://github.com/clojure/clojurescript/tree/master/samples/hello-js
03:00uroborus_labsThe examples in the readme failed to work unless advanced was set
03:00uroborus_labstomoj: Any idea why that would be?
03:00uroborus_labsOr anyone else for that matter?
03:01uroborus_labsI should say, the example while following the readme failed when :optimizations was set to :advanced
03:02uroborus_labsSetting it to :simple both allowed the example to work and fixed the issue I have been stuck on for many many hours.
03:02uroborus_labsIs this a bug?
03:08amalloyMomol: everyone on osx, right?
03:09Momolamalloy: was thinking about openbsd and freebsd
03:09amalloy~anyone
03:09clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
03:13MomolI wanted to know if BSD are a good system for clojure developpment. Java is not popular on these systems so
03:13Momolfor linux, you have libraries and all tools to develop quickly in clojure, but I have some doubt on *BSD. Maybe it is complex
03:14tkoskineOpenBSD ports/packages (on -current) have clojure and leiningen.
03:16amalloythe only thing you need is the jre, and a bash interpreter for leiningen
03:17amalloyfamous last words maybe, but as far as i know that's all you need
03:23Momolamalloy: and jre isn't a prob on *BSD ?
03:26tkoskineWell, you could go and test it :). If there is a bug the jre maintainers on *BSDs would probably like to know about it.
03:26tomojwas the question about advanced and externs answered?
03:34SgeoHmm.
03:35SgeoCan someone help me please?
03:35shachafSorry, Sgeo.
03:35SgeoI need to know what the likely response would be if I asked, can someone help me please?
03:36tomojanyone?
03:36clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
03:36Sgeo....I fail at humor
03:36tomojno, I do
03:36shachafNope, it's definitely Sgeo.
03:36tomoj:)
03:36SgeoI think shachaf is likely to poke fun at me in any event.
03:38SgeoWhich is good, because I like collecting fun, and every planck time of every planck length is an event.
04:02tomojhmmm https://gist.github.com/32b0838b3d1f6322a10b
04:04tomoj&(next (reductions conj [] [1 2 3]))
04:05lazybot⇒ ([1] [1 2] [1 2 3])
04:05tomojbetter way?
04:06bosiehttps://gist.github.com/3957533 why is my output empty?
04:07tomojfor?
04:07clojurebotfor is not a loop
04:07tomojlazy?
04:07clojurebotlazy is hiredman
04:07tomoj:(
04:07tomojwell
04:08bosietomoj: not sure i understand you ;)
04:08bosietomoj: because for is lazy, i wrapped it in take
04:08tomojtake is lazy too
04:08bosiedang
04:08tomoj(doseq [x [0 1 2 3] y [3 2 1 0] :while (< 0 x)] (println x y))
04:09bosietomoj: right but then i have to change my for loop
04:09bosietomoj: wouldn't doall do what i want?
04:10Sgeotomoj, doc is a macro
04:11Sgeobosie, doall works if you want the results from the for
04:11SgeoSo yes
04:11bosieSgeo: cheers
04:12tomojSgeo: that's not the problem
04:13tomojbosie: I doubt you want all the nil return values of println
04:13tomojyou can use dorun
04:13amalloyhe probably doesn't want the printing effect of println either. just use for and return a bunch of vectors
04:13bosietomoj: good point
04:14Sgeobosie, is that your exact code, or is it a substitute for ... hmm
04:14SgeoAh. I wasn't sure
04:14bosieSgeo: exact code. i was just playing with for in the repl
04:14SgeoAh
04:14SgeoHmm, usually attempting to show a lazy-seq at the REPL forces the lazy-seq to be fully realized
04:15SgeoAlthough of course a take would allow for only the realization of ... you get the point
04:16bosieSgeo: yes, i overlooked that take is lazy too
04:17SgeoAnd the fun thing is, by using take at the REPL like that, you actually prevented the entire lazy sequence from the for from being realized
04:17bosiefun isn't the word i would have used ;)
04:19bosiethanks
04:21josteinkis there any shell-like command like ls to list out the members of a namespace?
04:22tomojshell-like? you mean you want to use it from a shell?
04:22tomoj&(keys (ns-publics (find-ns 'clojure.repl)))
04:22lazybotjava.lang.SecurityException: You tripped the alarm! ns-publics is bad!
04:23josteinktomoj: a repl often gives me the same feeling as a shell :)
04:23josteinklets see
04:25josteinkcool
04:26josteinkis there some function to call to get the name/symbol of the current repl namespace?
04:26Sgeo,*ns*
04:26clojurebot#<Namespace sandbox>
04:27josteinkoh
04:27josteinkI see
04:27josteinkthanks
04:27Sgeo,(ns-name *ns*)
04:27clojurebotsandbox
04:28Sgeo,(special-symbol? '*ns*)
04:28clojurebotfalse
04:30tomoj&(.name *ns*)
04:30lazybotjava.lang.SecurityException: You tripped the alarm! class clojure.lang.Namespace is bad!
04:30tomoj:(
04:30tomojI think namespaces should be Named
04:30tomojoh
04:30tomojns-name
04:31SgeoIt just calls .getName
04:31Sgeo,(.getName *ns*)
04:31clojurebotsandbox
04:31josteinknow if I could find a way to quote that, I would actually have an automated ls command
04:31Sgeo,(ns-name 'sandbox)
04:31clojurebotsandbox
04:32Sgeoquote?
04:32clojurebotquote is is unsyntax quote and '
04:32tomoj:(
04:32Sgeojosteink, what do you mena?
04:32Sgeomean
04:32josteink(ns-name *ns*) => user
04:32josteinkI want 'suer
04:32josteinker
04:32josteink'user
04:33SgeoWithout ' is how symbols typically print
04:33SgeoHmm
04:33josteinkso that I can pass it to (keys (ns-publics (find-ns NS)))
04:33josteinklets test
04:33Sgeo,(pr-str 'foo)
04:33clojurebot"foo"
04:33Sgeo,*print-readably*
04:33clojurebottrue
04:33josteinkmy bad
04:33amalloyjosteink: i don't think you understand quoting yet. the value is the symbol user (which doesn't have any special decoration on it); you put the ' in to ask the compiler not to try to evaluate it
04:33SgeoSomehow I don't think printing the symbol foo as foo is "readable"
04:33josteink(keys (ns-publics (find-ns (ns-name *ns*)))) actually print out things correctly
04:34josteinkSgeo: heh
04:34amalloySgeo: of course it is (let [f 'foo] (= f (read-string (pr-str f))))
04:34Sgeo,(read-string "foo")
04:34clojurebotfoo
04:35Sgeohuh.
04:35SgeoI have a feeling I'm derping a bit
04:35Sgeojosteink, I have to know why you're doing ns-name then find-ns
04:35Sgeo,(doc find-ns)
04:35clojurebot"([sym]); Returns the namespace named by the symbol or nil if it doesn't exist."
04:36SgeoThey're approximately inverses
04:36josteinkSgeo: oh I see
04:37josteinkagreed. this is much simpler
04:37josteink(defn ls [] (keys (ns-publics *ns*)))
04:40Mr_Bondhey josteink, where are you from?
04:40Mr_BondScandinavia?
04:40josteinknorway
04:40Mr_BondSame, kewl ;)
04:41josteinkbasically just thought it would be useful to have a "ls command" to investigate the namespaces Im in when running tutorials from git-repos
04:41josteink:)
04:42josteinkyou know, when the tutorial starts with "git clone", "lein repl" and "(load"
04:54Mr_Bondjosteink: good idea! :) Clojure is fun, just started learning it my self.
04:55Mr_BondOnly thing that I find difficult, is pinpointing issues turning up in java backtrace
04:55josteinkheh
04:55tomoja hopefully soon-to-be-released library may help with that
04:58Mr_Bondtomoj: yeah, that would be very nice. Is there one on the roadmap?
04:58Mr_BondI would still use clojure without one.
05:00amalloytomoj's boundless optimism is an inspiration to us all
05:00tomojhttp://www.infoq.com/presentations/Clojure-Stack-Trace
05:04josteinkanyone know who runs infoq or what their primary target/aim is?
05:05josteinkive seen it mentioned quite a few times for programming related content and functional programming in paritcular
05:09Raynesjosteink: http://www.infoq.com/about
05:10josteinkwell that was easy :)
05:11RaynesI liked Google currents when my phone had the space to use it.
05:11RaynesThat thing sucks up disk like a vacuum cleaner.
05:11josteinkheh
05:12josteinkI have 6GBs space or so on my galaxy nexus
05:12josteinkthat should be gooxd enough :)
05:12RaynesI have about 10MB of space on my Evo.
05:12josteinkevo....
05:12josteinkis that the carrier-mungled version of the galaxy s1?
05:13RaynesNo idea.
05:13RaynesThis is the old evo, anywyas.
05:13Raynesanyways*
05:13josteinkah. htc desire
05:13RaynesNot actually mine anymore. Giving it to my mother since I got an iPhone 5 today.
05:13josteinkknown for its infinitely insufficent storagecapacity
05:13RaynesNo kidding.
05:16kralnamaste
06:18leoncamelhey. As a newbie, I can def a variable, like this (def a 1). But, how can I *undefine* a ?
06:18leoncamel(def ^:dynamic a 1)
06:19leoncamelsorry, wrong window. :)
06:19tomoj(ns-unmap *ns* 'a)
06:19leoncameltomoj: OK. cool. thansk.
06:19shachafYou can do that (it seems), but are you sure you want to?
06:20tomojI understood "undefine" to mean "completely undo the effect of the def on the namespace"
06:20tomojbut I wonder about "make it appear as if the root is unbound"
06:21leoncamelWhat is the side-effect about (ns-unmap *ns* 'a) ?
06:22tomojif you do that, evaluating 'a would cause "Unable to resolve symbol: a in this context"
06:22tomojas if you had never evaluated '(def a 1)
06:23leoncamelI am newbie, just playing in my REPL. When I type "(def a 1)", a quick question just come to my mind: How can I undefine(or remove) symbol a from current environment.
06:24tomojyes, that sounds like ns-unmap
06:24tomoj(doc ns-unmap)
06:24clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
06:24leoncameltomoj: OK. I got it.
06:25tomojwow, datomic will not let you stick a long in a double field
06:31bosietomoj: since you mentioned datomic, how is the "db is effectively local"?
06:31tomojI like it so far
06:32bosietomoj: in sql terms, it would query the entire dataset and process it locally? (e.g. apply a filter on it)
06:32tomojnot necessarily the entire index
06:32tomojer, dataset
06:32bosieno but the entire 'table'
06:32tomojwell there are no tables
06:32tomojbut there are indices
06:32bosieright
06:33tomojdepending on how you write a query, it may not need to fetch much more than needed
06:33bosietomoj: without processing on the server?
06:34tomojif by "server" you mean the transactor, it only does writes
06:34bosieok
06:36tomojwith the free version a peer has to talk to some processes the transactor starts to fetch data
06:36bosiewow
06:36bosiejust saw the pricing for datomic pro
06:36AtKaaZtomoj: what?
06:36tomojwhat what
06:37AtKaaZtomoj: on the free version the transactor fetches the data? ie. reads
06:37tomojwell, I don't understand the internals very well. the free transactor starts processes that listen on 3 ports. the peers have to talk to one or more of those to fetch data from the transactor-local storage
06:38tomojI suspect one of them is an h2 sql db which the peer talks to, but I'm not sure
06:38AtKaaZI don't know that many details, but I guess that could still mean that the transactor isn't used to read data ie. queries
06:39tomojright, that seems likely
06:39bosieAtKaaZ: so if the transactor isn't reading the data, who is?
06:39AtKaaZas I understand it the peers "talk" directly to the storage (so to speak)
06:40tomojpeers run queries, the transactor handles writes (and sometimes may run queries to service transactions..)
06:40tomojin pro the transactor and peer machines don't have to communicate directly at all, they just both talk to postgres or dynamodb
06:40AtKaaZtomoj: like the nested queries? those with d/entity
06:41AtKaaZtomoj: I mean, when does transactor run queries?
06:41tomojwhen a transaction function called in a transaction runs a query
06:41bosieAtKaaZ: http://www.datomic.com/uploads/3/5/9/7/3597326/6646785_orig.jpg
06:42AtKaaZthat makes sense
06:42tomojlike :db.fn/retractEntity probably runs a query to figure out what to retract?
06:43tomojs/directly at all/directly at all (for queries)/
06:45AtKaaZbosie: that Cache you see in peer app server, is reads/queries done by peer (directly getting them from storage/memcached) as I understand it
06:46bosieAtKaaZ: hm, then the arrows are wrong i guess
06:47AtKaaZbosie: the two arrows point to cache as in: reads from storage/memcached into cache
06:47bosieAtKaaZ: sorry, i misread you
06:48AtKaaZquery gets its data from liveindex+cache, where liveindex would be updated when trasactor did a write
06:50AtKaaZtomoj: I wonder if a :db.fn with like Thread.sleep can hold the transactor
06:51tomojI'd think so
06:51tomojno reason to sleep I can think of
06:51tomojnothing's going to be different when you wake up
06:52AtKaaZbut I'm just thinking if some evil function would take too long to compute
06:52tomojyeah, dunno
07:07bairuitomoj: s/foo/foo bar/ == s/foo/& bar/
07:08tomojorly
07:08bairuiin vim, anyway :)
07:08tomojneat
07:09tomojsed too
07:09bairuiyep; sed: vim, I am your father.
07:11bairuiwell... grandfather? ancestor?
07:11AtKaaZno no, leave it at that, it was funny;)
07:12bairui:) fair
07:26Girvohey everyone
07:27Girvoq: is TDD viable in Lisp/Clojure? I'm working in a dialect called Pharen, quite inspired by clojure (compiles to PHP) and am used to TDD using classes. how does it work with just functions?
07:31Girvoany good resources for TDD in clojure?
07:35CheironGrivo: check speclj
07:38Girvocheers @Cheiron
07:39CheironGrivo: and of course clojure.test , midje
07:41JulioBarrosHi. I'm coming back to a web app I have not touched in a long time. Had to resolve a couple of dependency issues but now am getting "Could not locate ring/util/serve__init.class"
07:41JulioBarrosAny ideas on what could be causing it?
08:01josteinkwhat's the difference between (ns somenamespace) and (in-ns 'somenamespace) ?
08:02tomoj(ns foo.bar) can do more, like (ns foo.bar (:require foo.baz)), and it also refers to clojure.core automatically
08:04shachafLenses are "pretty nifty".
08:04shachafDo they have those in Clojure?
08:04josteinktomoj: ah ok. thanks
08:05tomojI don't know
08:05tomojare lenses anything like conal's semantic editor combinators?
08:05tomojcgrand referenced lenses in a talk
08:05josteinkgoogle says "Lenses are the coalgebras for the costate comonad "
08:05tomojbut I only read the slides
08:06josteinklenses are coco
08:06tomojand I think the conclusion was "that's too complicated for this task"
08:06tomojhttp://vimeo.com/45695419
08:08shachaftomoj: Yep, they're related.
08:08shachafA simple version of a lens is a (getter,setter) pair.
08:08tomojI still don't understand semantic editors, but I feel vaguely like I want them in clojure
08:09shachafThey can be composed, which is the nice part.
08:09shachafThe new "lens" library for Haskell way generalizes them, of course.
08:30antoineBhello, i would like get the "first" element of a concurrent list, and update the list to "rest"
08:30antoineBshould i use a ref or atom?
08:32antoineB(first @my-list) (swap! my-list rest) is unsafe between the two sexp
08:32josteinkso ... you are creating a queue? :)
08:33antoineByes
08:33antoineBFIFO
08:34_ulisesantoineB: why do you say those two sexps are unsafe?
08:35antoineBthe thread can stop at end of first sexp, and another can start at fist sexp
08:36antoineBthe two thread will peek the same "first" element
08:36_ulisesantoineB: I didn't know you were talking threads :)
08:36_ulisessorry for the silly question
08:40josteink_ulises: when you are talking "concurrent" you are talking about threads ;)
08:40_ulisesjosteink: I'll blame it on the lack of caffeine
08:40josteinkheh
08:40josteinkpersonally I usually blame that I mostly ready the bottom 5 lines, not a 2 page backlog :P
08:41_uliseswhat backlog?
08:42josteinkhttp://invalid.ed.ntnu.no/~jostein/uploads/irc_backlog.png
08:42josteinkwhatever has passed out of the screen
08:42josteink:)
08:43_ulises1) I can see myself 2) I meant "what backlog" in a "I don't read the backlog at all" kind of way
08:44_ulises;)
08:44josteinkah
08:44josteinkheh
08:44antoineBjosteink: you can ignore connection/deconnection of user in irssi
08:45antoineBto get it more clear
08:45josteinkantoineB: considering it. Im no longer a channel-op in busy, troll-ridden channels
08:46josteinkso to quickly be able to spot a bad host is no longer that important ;)
08:50josteink/ignore -channels #clojure,#scheme,#linux * JOINS PARTS QUITS NICKS"
08:51josteinkthere we go :)
08:51AntelopeSaladi have a question, sort of... i've been reading through the clojure programming book and recently watched a video tutorial from one of the authors
08:51antoineBnobody answer my question
08:51AntelopeSaladhe built a url shortener using compojure and ring
08:51AntelopeSaladmy question is, everyone claims clojure is great because everything is immutable
08:51AntelopeSaladbut right off the bat he setup mutable variables
08:51Mr_Bondwow, your in both clojure and scheme. Isn't that a bit mongamist? :P
08:51josteinkantoineB: Im not competent enough to answer it. I would have cheated and just faceded a java concurrentqueue :)
08:52Mr_Bondmonogamist..
08:52AntelopeSaladwhat's the point in boasting about immutable data structures if you're just doing to use the function that makes things mutable?
08:52AntelopeSalad*doing = going
08:52_ulisesantoineB: what operations are you trying to implement on the queue? peek or pop?
08:52josteinkAntelopeSalad: well.. you probably need a sequence-number generatator
08:52antoineBpop
08:52josteinkAntelopeSalad: that function will probably need some mutable data
08:53antoineBbut a concurrent pop
08:53AntelopeSaladjosteink: he uses an atom on some counter and also made a mutable map
08:53_ulisesantoineB: so pop returns (first...) and updates to (rest...) right?
08:53ambrosebsCan someone please point me to a library that can call private Java methods/access Java fields?
08:53josteinkAntelopeSalad: ah well. havent seen the video. cant tell if the guy does stupid things or not :)
08:53antoineByes
08:53cemerickAntelopeSalad: Using an atom (or other reference type) does not make the data structures it holds mutable; rather, it provides a stable identity that does change over time.
08:53ambrosebsIs it in contrib?
08:53antoineBand i can't do the two in swap! or reset
08:53AntelopeSaladjosteink: he's the co-author of the clojure programming book, he can't be that stupid
08:54josteinkheh
08:54_ulisesantoineB: why not? (please excuse me if it's a silly question)
08:54cemerickAntelopeSalad: We discuss this in chapter 4
08:54AntelopeSaladi didn't get to chapter 4 yet in the book, i did a lot of reading in the past 2 days and then wanted to watch a video tutorial
08:55_ulisesantoineB: I think I get why you can't
08:55_ulisesget it*
08:55AntelopeSaladcemerick: you were the video author right?
08:55_ulisesnot my day today obviously
08:55AntelopeSaladi vaguely remember the name in the slide
08:55cemerickAntelopeSalad: FWIW, yeah
08:56AntelopeSaladyour book is really good btw
08:56AntelopeSaladi was just curious if a lot of web oriented clojure apps end up having a ton of mutable data (or things that act like they are mutable)
08:56AntelopeSaladis there no real downside to using atom? it seemed handy in that counter use case
08:57cemerickAntelopeSalad: Having a single identity is hardly a "ton", compared to typical imperative programming environments.
08:57cemerickIn the URL shortener example, it's just a convenient stand-in for an external database.
08:57antoineB_ulises: swap! and reset update the atom with the return of the function
08:58_ulisesantoineB: yeah, I realised that after I asked you the question :(
08:58AntelopeSaladah, i see. so normally you would be getting a count of entries from a db
08:59tomojis it possible that .take on a LinkedBlockingQueue never returns, while the queue fills up with items?
08:59AntelopeSaladcemerick: btw, do you have any other video tutorials floating around? i didn't see anymore in your channel
09:00tomojhmm
09:00tomojI switched to openjdk and the problem seemed to go away
09:00tomojnot sure if that was voodoo
09:01cemerickAntelopeSalad: I've done a couple, but they're not on youtube.
09:01cemerickNothing as comprehensive, though.
09:02AntelopeSaladok
09:05AntelopeSaladcemerick: can you post the links to them? even if they touch on some subjects in the book it wouldn't hurt to watch them
09:07KototamaHi, I know about checkouts but is there a way with leiningen to run lein clean / lein deps / lein install for 4 differents projects at once?
09:08TimMcKototama: With shell scripting, yes.
09:08cemerickAntelopeSalad: old, old, old: http://cemerick.com/2010/11/02/continuous-deployment-of-clojure-web-applications/ http://cemerick.com/2010/03/25/why-using-maven-for-clojure-builds-is-a-no-brainer/
09:08cemerickThe maven one in particular is quite irrelevant at this point.
09:09AntelopeSaladah, yeah you explained that lein is its successor
09:09TimMcKototama: for p in repos/foo repos/bar repos/etc ; do (cd -- "$p"; lein clean deps install); done
09:09antoineB_ulises: i used ref
09:10_ulisesantoineB: I was going to say that that's what you probably want if you want blocking reads, etc.
09:10TimMcAnd once I get to work, I'll be able to paste a little modification that makes that for loop stop if any of those repos fails to build.
09:10_ulisesantoineB: care to share the code? :)
09:11antoineBis not realy usefull because is not a generic queue
09:11antoineBhttps://gist.github.com/3958679
09:11KototamaTimMc: I need something platform independent
09:11KototamaI'm trying to get rid of our shell scripts
09:14TimMcWrite it in Python then.
09:15TimMcPython is great for cross-platform automation.
09:15Kototamai don't want windows developpers to have to install python to develop on a clojure project
09:15TimMcDo they have Cygwin?
09:15Kototamanope
09:15antoineBjscript ?
09:16Kototamayeah jscript lol but then I need to main two different set of build script
09:16Kototamamaintain
09:16TimMcWhat's wrong with installing Python?
09:16antoineBnever touch jscript
09:16antoineBTimMc: "installing" maybe
09:17TimMcMaven
09:17antoineBKototama: build a new clojure dsl, one for jscript and one for bash ? :)
09:17Kototama"please install java, leiningen, git" and also python but just two runs two shell commands thanks
09:18Kototamai think i'll create a lein plugin that go up one directory and launch the same commadn in the other if it's possible :p
09:18TimMcKototama: I think there's a lein plugin to develop multiple projects in the same tree.
09:19Kototamabut which one? I found https://github.com/maravillas/lein-multi but it's not what i'm looking for, nor checkouts directory solve the problem
09:19TimMclein itself uses something...
09:19Kototamai'm not even sure they work on windows, can you create a symlink on windows?
09:19TimMcNot really.
09:20TimMcNTFS has some weird shit that I don't know about, though...
09:20TimMcMaybe just have a "parent" (outer) project with a lein hook that distributes the commands in order to the various "subprojects"...
09:22TimMcKototama: If you can write the same thing in Windows batch scripting, just have two scripts.
09:22TimMcThat's not an uncommon or unreasonable thing to do.
09:22Kototamahow do hooks work?
09:23TimMcI don't recall, but I've used one... let me check.
09:23josteinkKototama: you can create symlinks on windows with NTFS. Its just that the OS provides no tools for it ;)
09:23Kototamaor I use the lein exec plugin and write a clojure script that do the 4 lein commands :D
09:24josteinkthe filesystem itself supports it fully
09:24josteinkwell screw me sideways
09:24josteinkhttp://pastebin.com/N0XDinvC
09:24josteinkthere you go :)
09:25Kototamaahhhhh maybe https://github.com/kumarshantanu/lein-sub
09:25TimMcjosteink: Cool!
09:25Kototamajosteink: not so bad :-)
09:25Kototamait does not solve the install problem though
09:26TimMcIt doesn't?
09:26Kototamano checkouts is more to augment the classpath than anything else
09:26TimMcOh, you mean checkouts, not lein-sub.
09:26Kototamayep
09:27Kototamai'm trying lein sub write know... we will see...
09:31Kototamalol the cljsbuild hook get applied to all projects ;-(
09:34Kototamabut otherwise it seems to work, this is really great
09:37clgvtools.logging: does not really give me correct line numbers within a namespace although I use the convenience macros. whats wrong there?
09:39Kototamawith profiles I can discriminate with project needs to be build a war or not, everything fine.
10:40tomojcrazy to find me asking a question hours ago on the second page of related google results
10:41clgvtomoj: it's a pretty unique question then?
10:42tomojnot really
10:42tomoj"LinkedBlockingQueue clojure seq" oslt
10:42clgvwhat do you want to know?
10:43clgvhappens that I currently have the LinkedBlockingQueue javadoc open ;)
10:44tomojI just want a seq from it
10:45clgvwith or without blocking?
10:45tomojblocking, of course
10:45clgvjust do (repeatedly #(.take lbq))
10:46ejacksontomoj: I've used cgrand's code for this to great effect: http://clj-me.cgrand.net/2010/04/02/pipe-dreams-are-not-necessarily-made-of-promises/
10:46tomojyeah I saw that, and based this on it
10:46clgvejackson: tomoj: he added a close-fn that put's an EOF in it.
10:46tomojhttps://gist.github.com/d5207c5a5074af29b4ac
10:47tomojrich is producing, not me, so don't need that
10:47ejacksonrightio
10:48clgvtomoj: ok then you could just use (repeatedly #(.take lbq))
10:48clgvtomoj: that gist is only more verbose
10:48tomojah!
10:48tomojI felt there must have been a better way
11:25ToBeReplacedfirst time using lein midje; when i do lein midje, i show my failures, then Subprocess failed before I get to any lein test summary.... lein test has no issues... anyone have any guesses where to look? Leiningen 2.0.0-preview10 on Java 1.7.0_09-icedtea OpenJDK 64-Bit Server VM
11:25leoncamelwhat is proper way to execute a external command? I can not find clojure.contrib.duck-streams now.
11:27clgv~contrib
11:27clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
11:28clgv"clojure.java.shell" or "conch" will help you
11:29leoncamelclgv: OK. thanks.
11:30AtKaaZanyone using emacs 24.2 can paste their init.el ?
11:31antares_I have an entire repo for emacs.d :)
11:31AtKaaZlol that's a lot of lines
11:32AtKaaZcool I'll check that
11:32antares_AtKaaZ: http://github.com/michaelklishin/emacsd, although it is by no means an example of an impressive Emacs setup
11:32leoncamelAtKaaZ: what are you looking for? configurations for nREPL+emacs?
11:33AtKaaZleoncamel: yes exactly (on windows)
11:35hyPiRionAtKaaZ: https://github.com/bodil/emacs.d is a good one to look at.
11:36AtKaaZthanks I'll check, antares_'s seems to be using .emacs I was expecting init.el
11:36hyPiRionThough it's not for windows.
11:37AtKaaZunderstood
11:39BodilhyPiRion: Thanks, I guess. :)
11:39leoncamelAtKaaZ: My emacs.d become complex and complex, I don't know if it helps. But, I would like recommend this repo : https://github.com/purcell/emacs.d
11:40nDuffAtKaaZ: See https://github.com/overtone/emacs-live -- there are videos showing the features and such.
11:41S11001001AtKaaZ: my emacs config is top secret, can't share without risking national security
11:41AtKaaZ:))
11:41leoncamelnDuff: yes. It so dam cool... :) I LOVE that.
11:45AtKaaZawesome video, I wonder if the text really glows like that
11:46aduwhich video?
11:46AtKaaZhttp://vimeo.com/22798433
11:47adudoubtful
11:47AtKaaZyep I just saw the end:)
11:48ambrosebsJust released Typed Clojure 0.1, please try it out https://github.com/frenchy64/typed-clojure
11:48aduOMG
11:48adutyped clojure!
11:48nDuffsweet!
11:48aduis it anything like typed racket?
11:49ambrosebsit's wannabe typed racket, yes :)
11:49ambrosebsnDuff: thanks!
11:49nDuffadu: If you're curious, you should read the paper ambrosebs published.
11:49aduambrosebs: I think something just happened in my pants
11:49aduwhich paper?
11:49ambrosebsshould be in the readme
11:49clgvambrosebs: does it work without a modified clojure?
11:50adu"A Practical Optional Type System for Clojure"?
11:50ambrosebsclgv: It only works on 1.5.0-beta1
11:50ambrosebsclgv: probably
11:50ambrosebsadu: yep
11:51clgvambrosebs: why i "tc-ignore" not metadata?
11:51aduambrosebs: did I show you my typed lisp thing?
11:51aduhttp://andydude.github.com/droscheme/cmd/gos.html
11:52aduit's just an S-expr representation of Go code
11:53ambrosebsclgv: the library "analyze" generates an AST from the Clojure compiler. Sometimes metadata doesn't make it through, so as a rule I don't do any metadata where you might expect.
11:54ambrosebsclgv: It was the quickest thing that works.
11:55clgvambrosebs: ah ok. then that might be a future feature ;)
11:56ambrosebsclgv: I don't see how (tc-ignore 1) would work with metadata though.
11:57clgvambrosebs: would `1` be type checked?
11:57ambrosebsI mean, 1 isn't IMeta
11:57clgvI know. but would it make sense to wrap it in tc-ignore?
11:58ambrosebsclgv: probably not. Until we have a new compiler, I'm happy with tc-ignore.
11:59ambrosebswhich may be never :)
11:59adunew compiler?
11:59clgvambrosebs: despite from tc-ignore you could have the "typed clojure" annotations in a different namespace, right?
11:59ambrosebsadu: ie. CLJS
12:00aduI thought CLJS was as good as CLJ
12:00ambrosebsclgv: sure
12:00ambrosebsclgv: these are the sorts of issues I haven't fleshed out yet though.
12:00clgvambrosebs: that was why tc-ignore disturbed me ;)
12:00ambrosebsclgv: yes, it's a horrible hack of course!
12:01ambrosebsadu: CLJS compiler is much nicer to work with.
12:01aduhmm, maybe I should check it out, I've only used CLJ
12:02ambrosebsadu: check out the compiler namespace, it's just multimethods and maps.
12:02ambrosebsquite remarkable.
12:04ambrosebsI would be grateful if anyone's tried Typed Clojure 0.1 to let me know that it works.
12:05ambrosebsI've been the only user for so long, it's a little nerve wrecking releasing it :)
12:05ambrosebsI probably screwed up something.
12:11aduI'd like to try it
12:12ambrosebsadu: Glad to help if you run into any trouble.
12:17aduambrosebs: "Could not find artifact typed:typed:jar:0.1 in central (http://repo1.maven.org/maven2)&quot;
12:17aduo wait n/m "Retrieving typed/typed/0.1/typed-0.1.jar (71k)from https://clojars.org/repo/&quot;
12:18ambrosebsI actually just pushed it 1m ago LOL
12:18adusweet
12:18ambrosebsforgot to release the release
12:19wunkiis there a thumbnail library in Clojure?
12:20aduambrosebs: is there a "defn>"?
12:21ambrosebsadu: nope, I wouldn't encourage one either.
12:21nDuffwunki: If you don't find anything on Clojuresphere, the typical thing is to pick a Java library that looks sane.
12:21technomancyambrosebs: would it be possible to specify annotations as metadata on vars?
12:21ambrosebsadu: just use (ann var type)
12:22aduambrosebs: is this important: "CompilerException java.lang.RuntimeException: Unable to find static field: COLUMN_AFTER in class clojure.lang.Compiler, compiling:(analyze/core.clj:825)"?
12:22ambrosebstechnomancy: no reason why not.
12:22wunkinDuff: doesn't seem to be. Adding java to the google query :)
12:22ambrosebsadu: ah.
12:22technomancyambrosebs: seems like the natural place for it provided you're not annotating someone else's code
12:23aduambrosebs: I got that after "(use 'typed.core)" in "lein repl"
12:23ambrosebsadu: *clojure-version* ?
12:23nDuffwunki: ...by the way, I _do_ recommend clojuresphere (http://www.clojuresphere.com/) as a good place to look for Clojure libraries.
12:23aduambrosebs: 1.4.0
12:23nDuffwunki: ...notably, searching there, it _does_ find a thumbnail library.
12:24ambrosebsadu: ok, it only supports 1.5.0-beta1
12:24aduoic
12:24adulet me change the project
12:24ambrosebsadu: can you run "lein deps :tree" and paste it somewhere?
12:24ambrosebsor just let me know where 1.4.0 is coming from
12:24TimMcadu: http://refheap.com
12:25ambrosebstechnomancy: is there a particular reason why you'd prefer metadata? I don't personally see the difference.
12:26aduhttps://www.refheap.com/paste/6161
12:26technomancyambrosebs: just that clojure already has a mechanism for annotating vars; seems odd to make up your own when one already exists
12:26gensymvhello, clojure newbiew here: what is the use case for "lein repl" starting a server?
12:26gensymv*newbie
12:26jkkramerwunki: I use Scalr in a clojure project. I have a ~100 line clj file to make working with loading/saving images a bit easier that I could open source
12:26ambrosebstechnomancy: fair enough. Blindly copied Typed Racket there.
12:26gensymv*starting to listen
12:26adugensymv: I just used lein repl to test stuff
12:26ambrosebsadu: what's your project.clj
12:27wunkinDuff: I didn't know clojuresphere was a site, I though it was a "saying". Thanks
12:27gensymvadu, my question has nothing to do with the code you posted^^
12:27gensymvi am just curious.
12:27technomancygensymv: leiningen used to have issues with stdin from within your project, so it had to set up a socket for repl communication
12:27technomancygensymv: turns out it's a useful property to have for remote debugging anyway
12:28gensymvso if i don't really know what i am doing (which is the case), i might as well continue using clojure with rlwrap.
12:28gensymvtechnomancy,thanks.
12:28technomancyrlwrap is pretty crappy actually
12:28aduambrosebs: ok, now that I have 1.5.0-beta1 in the project, leing repl/use now says "WARNING: defrecord already refers to: #'clojure.core/defrecord in namespace: user, being replaced by: #'typed.core/defrecord"
12:29gensymvtechnomancy, why do you say that?
12:29technomancygensymv: history support isn't as good; no tab completion
12:29ambrosebsadu: just require it, don't use
12:29ambrosebs(require 'typed.core)
12:29wunkijkkramer: you don't have to do it for me. I'm only using for a side project. If however you wanted to do it anyway. Let me know
12:30wunkijkkramer: pm me if so, gotta go eat
12:30aduI thought it didn't matter
12:30jkkramerwunki: it's short and relative self contained. i'll gist it...
12:30gensymvtechnomancy, as far as i see leiningen repl doesn't have tab completion either
12:30ambrosebsadu: could you possibly start a new file?
12:30technomancygensymv: lein1 or lein2?
12:30aduambrosebs: ok
12:30jkkramerwunki: https://gist.github.com/3959731
12:30gensymvtechnomancy, 1.7
12:31technomancygensymv: yeah, that's just using rlwrap. lein2 has a much better repl.
12:31ambrosebsadu: (:require [typed.core :refer [check-ns ann]])
12:32TimMctechnomancy: At least it's not jline.
12:33aduI tried "(require [typed.core :refer [check-ns ann]])" in the repl and got a ClassNotFoundException
12:33technomancyTimMc: jline1 is the crappy one; jline2 is sweet
12:33TimMcadu: Put a ' before [typed...
12:33TimMctechnomancy: Oh, interesting.
12:34aduYEY
12:34aduthat worke
12:34TimMcadu: require is a fn, not a macro, for better or worse -- so it needs to have the libspec quoted.
12:34ambrosebsadu: typed.core/cf checks a form, you might want that to experiment with
12:34ambrosebsadu: try (cf 1)
12:35aduambrosebs: I get "[(quote 1) {:then tt, :else ff} empty-object]"
12:35ambrosebsgreat
12:35aduI have no idea what that means
12:36ambrosebsadu: it's a bit complex. (quote 1) is the singleton type containing just one.
12:36ambrosebsadu: the rest is extra stuff.
12:37ambrosebstry (ann-form (fn [a] a) (All [x] [x -> x]))
12:37ambrosebsand import ann-form
12:37ambrosebsit should all be working.
12:38ambrosebstechnomancy: what kinds of better inference were you expecting from Typed Clojure?
12:38aduambrosebs: "(typed.core/cf (Math/sqrt 4))" gives me "AssertionError Assert failed: (class? cls) typed.core/Class->symbol (core.clj:2275)"
12:38ambrosebsadu: that's not right :)
12:39adudo I win a beta testing chocolate cookie?
12:40technomancyambrosebs: well, trivially in the collatz example, it should be possible to infer the return value, right?
12:40ambrosebsadu: the first bug report :)
12:41ambrosebstechnomancy: yes, IMO that's only handy for anonymous functions. I have a convoluted syntax that infers the return: (fn> [[a :- Number]] a)
12:41TimMctechnomancy: COuld not reproduce, I was able to get a value other than 1.
12:42technomancyambrosebs: sure; cool
12:43TimMc(Never mind, my joke fails because his Collatz function doesn't actually check for loops, per se.)
12:44technomancyis it a goal at all to support checking code that's unannotated based on guesses coming from inference?
12:45ambrosebstechnomancy: that's for a separate tool.
12:45technomancyok, I see
12:47ambrosebstechnomancy: a tool between those is one that gives a pretty good guess of the types, and allows the user to double check them before being used like normal.
12:48edward_123anyone used compojure knows how to redirect to a custom 404 page when 404 happens? right now i only have route/not-found "page not found."
12:48technomancyambrosebs: I expect there's also room for a tool that can avoid reflection that way too
12:49ambrosebstechnomancy: yes, just need to figure out how to integrate it into the Compiler.
12:49dnolenambrosebs: so you see typed clojure as kind of a final pass after an more robust inferencer pass?
12:51ambrosebsdnolen: I meant porting a large amount of untyped code could be pretty annoying, so a decent inferencer would help there. Typed Clojure is fundamentally bidirectional checking only.
12:52ambrosebsadu: fixed it, any more ;)
12:54aduambrosebs: nice
12:54eggheadedward_123: just put the html instead of "page not found."
12:58dnolenambrosebs: ejackson mentioned S Peyton-Jones was excited about Typed Clojure at FPDays ;)
12:58ejacksonindeed !
12:59ejacksonI pointed him at your dissertation - hot off the presses.
12:59edward_123@egghead, oh it can also be dynamic content if I can corresponding function as long as the function returns string right?
12:59eggheadya edward_123
13:01edward_123Thanks!
13:08dnolenejackson: so did you get any feedback from folks that were familiar w/ constraint solvers?
13:08ambrosebsdnolen: ejackson: no way!
13:09ejacksonambrosebs: yes way. He is working at the moment on optional static typing in Haskell too.
13:10dnolenword on the street is that all the cool kids are doing it
13:10ejacksonThe idea is that it turns all static errors into warnings at compile time, and throws at runtime instead
13:10technomancysounds like a hard sell to haskellers
13:10dnolentechnomancy: it's already in GHC
13:10ejacksonstuff is available and more coming.
13:11ejacksonapparently their main use case is refactoring
13:11technomancysure, haskellers just like to talk about how runtime errors are a thing of the past
13:12ambrosebsWell, we're about to find out if the monads in my dissertation are actually well typed then ;)
13:12ejacksondnolen: feedack - not really. Did have a prologer cut off one of my answers to say how much more expressive core.logic was than prolog in solving the soduku puzzle.
13:12ejacksoni certainly wasn't about to disagree.
13:13dnolenejackson: heh
13:13dnolentechnomancy: just like the SMLers & OCamlers before them.
13:14technomancydnolen: ocaml struck me as a much more chill community
13:14technomancy"Oh, you absolutely need speed? It's cool if you write mutable code then. We won't judge you."
13:15technomancymuch less dogmatic
13:15dnolentechnomancy: maturity of community perhaps?
13:15technomancycouldn't say for sure. maybe being slightly more industry-leaning than haskell.
13:16Iceland_jackHaskell is too divided between research and usability I feel
13:19eggheadIceland_jack: why do you say that? haskell is certainly useable, just not necessarily accessible :)
13:19Iceland_jackI probably wasn't specific enough
13:20Iceland_jackIt is useable but sometimes you need stability of ideas as much as you need stability of libraries or code
13:22Iceland_jackWith Haskell there are always new things--arrows, lenses--that mix with people trying to solve problems
13:22Iceland_jackI do love Haskell though
13:23gtrak`I find myself writing this a lot in async code, is there a better way? (let [call #(if % (%))] ... (call some-param))
13:24djcoinI'm far from being an expert, but my trouble with haskell is functional overengineering maybe and laziness. Ocaml is more pragmatic but for ~20 years it seems it did not evolved as much as it should have (and by the way, not used at much as it should I guess - when I see how Go is getting traction .. it seems to me as a weaker OCaml). Again, i'm far from an expert.
13:25Iceland_jackI think Haskell is definitely on the right track
13:25technomancyyeah, it's a shame Go has so much momentum while OCaml comparatively languishes
13:25Iceland_jackOCaml is an excellent language
13:25djcoinYeah, it is a total incomprehension for me. You can take OCaml + Lwt, and you get basically Go
13:26technomancyit's the curly braces
13:26djcoin:(
13:26gtrakcurly braces make it go fast
13:27dnolentechnomancy: I don't think I'll ever use Go myself but I understand the appeal for the mainstream devs.
13:28djcoindnolen: maybe their were told that it is web scale yet imperative :)
13:29djcointhey *
13:29technomancymaybe it's like the groovy of systems-level code
13:29technomancythe appeal comes from addressing the obvious pain points without requiring you to change the way you think
13:30nDuff${DEITY} that thing is awful
13:30technomancyyeah that's probably not quite fair to go
13:30nDuffbloody near impossible to tell what a given piece of code does without ridiculous amounts of context
13:31technomancyit's not *bad* (apart from ignoring interactive development, which is unforgivable) it's just unambitious
13:34ToBeReplacedokay i can't get midje to work at all >> has anyone else had any issues? i'm reckoning that i just don't know what i'm doing with java
13:35ToBeReplacedif i do lein new foo; cd foo; lein midje; i get ran 1 test, yadda yadda, then finally "Subprocess failed"
13:37eggheadcan anyone speak to clj-metrics vs something like reimann ?
13:45ambrosebsadu: Gos is pretty cool!
13:45ambrosebsadu: any macros?
13:46ambrosebsadu: or is that more droscheme's thing?
13:53aduambrosebs: right
13:53aduambrosebs: droscheme is the macros, and gos is just a transpiler from S-expr => Go
13:54ambrosebsadu: and the types are just directly from Go?
13:54aduyes
13:54ambrosebscool
13:54aduI've been meaning to do a release of droscheme
13:54adubut I've been so busy with my new job
13:55aduiirc, the andrew-working branch (https://github.com/andydude/droscheme/tree/andrew-working) is half-way between master branch and what I have now
13:57ambrosebsI should go to bed :) Hearing SPJ knows about Typed Clojure kept me up another hour :P
13:57adunice
13:58ambrosebsthanks a bunch for being the first known user of Typed Clojure xD
13:58ambrosebsseriously.
13:58adunp :)
13:58ambrosebscya
13:58adulater
14:07mac_Hello folks! Anybody up for a short code review (80-odd lines)? I'm getting performance that's surprising me with its slowness, and I thought somebody might see where I've gone wrong.
14:07emezeske~anyone
14:07clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
14:07emezeskemac_: Nothing wrong with pasting the code in question
14:08emezeskemac_: But people might not want to commit to a code review before seeing it :)
14:08mac_oh, of course.
14:09grzmJust getting started with clojurescript and following along Mark McGranaghan's node.js clojurescript demo at http://mmcgrana.github.com/2011/09/clojurescript-nodejs.html and am getting the following error:
14:09grzm.ObjMap.fromObject(["Content-Type"], {"Content-Type":"text/plain"}).strobj());
14:09grzm ^
14:09grzmTypeError: Property 'strobj' of object {"Content-Type" "text/plain"} is not a function
14:09mac_It's a backtracking sudoku: https://gist.github.com/3960341
14:09dnolengrzm: it's probably unwise to follow that particular tutorial it's quite old.
14:09grzmThis is when running the first http example.
14:09grzmdnolen: that's what I was gathering.
14:09dnolengrzm: it's relies on private implementation details
14:10grzmdnolen: and that too, from here : http://stackoverflow.com/questions/9193705/where-in-clojurescript-is-the-strobj-function-defined
14:10grzmdnolen: any pointers on more modern places to start? In particular, I'm interested in using cljs with node.js
14:12emezeskemac_: Probably not performance-related, but do you know about get-in and assoc-in?
14:12grzmdnolen: btw, I'm incredibly impressed with the level of activity you're able to maintain on the lists, Stackoverflow, and I see it extends to IRC as well :)
14:12dnolengrzm: wild west that. node.js support is still early days.
14:12mac_emezeske: I see I've reinvented the wheel.
14:12dnolengrzm: ohpauleez is forging some ground there.
14:12mac_Thought I might have.
14:13emezeskemac_: Only a little bit :)
14:13grzmdnolen: cheers. I'll take a look
14:13mac_That implementation is slower than a Python implementation that's using (broadly) the same algorithm; Python gets mutable arrays, of course, so there's likely a meaningful win there, but I'm still surprised.
14:14mac_(Python wins when I have it do many boards, in an attempt to amortize startup costs)
14:14ohpauleezgrzm: Let me scroll back a second and catch up
14:15ohpauleezgrzm: I'm your man!
14:15__zfn__Hi all/
14:15__zfn__I use lein with clojure 1.2.1
14:15grzmohpauleez: good to hear :)
14:16__zfn__How to update clojure version?
14:16dnolenmac_: you are constructing many transient values tho right? lots of conversions to set, and calls to set/difference. that's not the case in the Python code if I recall
14:16technomancythree remaining blockers on lein2 rc; woo
14:16ohpauleezI have a full app - disk-io, lots of Clojure/edn data, core.logic, interaction with unix utilities - all on node.js
14:16mac_dnolen: I'm constructing many transient sets in my python version, as well.
14:16ohpauleezas a scripting app
14:16technomancyanyone want to fix https://github.com/technomancy/leiningen/issues/805?
14:16dnolenmac_: by converting to python sets?
14:16dnolenmac_: I'm assuming you're basing this on Norvig's version?
14:17mac_dnolen: No, from-scratch by me.
14:17ohpauleeztechnomancy: exciting!
14:17ohpauleezgrzm: Are you stuck with anything in particular or just looking for starting points?
14:17grzmohpauleez: currently googling you and node.js to see what you've got out there, but currently only see links to irc logs. do you have any node.cljs articles/projects out there I might take a gander at?
14:17mac_dnolen: My python version does the same build-three-sets thing that my clj version does; mutability is likely adventageous there too, though.
14:18dnolenmac_: are you running the JVM w/ -server?
14:18mac_dnolen: dunno; lemme see.
14:18grzmohpauleez: just getting started. Haven't done extensive js work, much less node.js, and thought using clojurescript would make it a little less painful
14:18dnolenmac_: if you're using lein you probably are
14:18mac_dnolen: using the clj wrapper script from homebrew.
14:18ohpauleezgrzm: I was going to hold off pushing mine to Github, but let me add that remote and I'll link you
14:18mac_it's not passing -server.
14:18mac_Lemme try.
14:18grzmohpauleez: so I was going to work through Mark's demo
14:19grzmohpauleez: cheers
14:19ohpauleezgrzm: That's a good place to start - the latest Google Closure Lib has promises in it (they're called Resultes)
14:19ohpauleezYou need to use them to escape callback hell and program with values
14:19technomancynever mind; I think that issue I linked to is already fixed
14:19ohpauleezI'm going to highlight that in my Conj talk this year
14:20mac_dnolen: can't tell if that made a difference.
14:20mac_My "benchmarking" (using the term loosely) isn't good enough to tel.
14:20dnolenmac_: you generally need multiple runs for the JVM to warm up, how long does it take to solve your board?
14:21emezeskemac_: This is probably micro-micro optimization, but it seems like representing the board using numbers instead of strings would be appropriate
14:21dnolenmac_: also if you're doing this at the terminal w/ clj then you're messing JVM+Clojure+compile your script startup time
14:21dnolenyou're measuring I mean
14:21mac_dnolen: yeah, I know I'm paying all the startup time every time.
14:22mac_But if I have it solve say 20 boards, python still wins.
14:22grzmohpauleez: I take it https://github.com/ohpauleez/ttt is what I'm looking forward to?
14:22ohpauleezyes
14:22ohpauleez:)
14:22dnolenmac_: how long does it take?
14:22mac_oh, hang on.
14:23mac_at ~20 boards, clj takes ~13 seconds wall time, and python takes ~20.
14:23mac_So it looks like I'm catching up after all.
14:23mac_(Although that second thread means my CPU time is higher)
14:23mac_Clearly, I need to examine this more closely.
14:23mac_(I take it from the other quietness that nobody has seen a drastic performance foulup in that implementation?)
14:24dnolenmac_: it's actually pretty nice looking code, minor things here and there.
14:24mac_dnolen: thanks!
14:24mac_It's my first real lisp program.
14:24mac_Done a fair amount of functional (OCaml, mostly), but never typed this many parentheses in a row before.
14:25dnolenmac_: i was going to say, it seemed like you done some FP before
14:25amalloyyeah, agreed it reads pretty well mac_. that last (if (empty? wins) nil (first wins)) could just be (first wins)
14:25Kneferilishow clojure compares to falcon?
14:25mac_amalloy: oh, excellent. What I did felt gross.
14:26mac_Got a meeting to run to. Thanks for the help!
14:26amalloyoh, and (apply str (interleave x y)) is (clojure.string/join x y)
14:28hyPiRion,(clojure.string/join "," [1 2 3])
14:28clojurebot"1,2,3"
14:28tomojit seems clj-http is incompatible with cheshire.custom? :(
14:28hyPiRion,(apply str (interleave "," [1 2 3]))
14:28clojurebot",1"
14:29amalloyoh, i see. i was thinking of interpose, because it's such a common pattern
14:29amalloythanks hyPiRion
14:30hyPiRionI tend to mix them up as well, I feel like I always have to check if I'm using the right one
14:31Apage43tomoj: you can always ask clj-http for a stream and pass it to decode-stream
14:31tomojencoding is the problem
14:32tomojotherwise I could maybe implement a custom response coercion (except clutch won't use it)
14:40amalloyam i totally crazy for wanting to turn an if-let into let+if? i have something like (if-let [x (...)] (f x) (let [x' (...)] (g x))), where f and g are very similar-looking expressions. it seems like it might read better to do (if (x-exists?) (let [x (...)] (f x)) (let [x' (...)] (g x)))
14:43dakronetomoj: check out https://github.com/dakrone/clj-http/blob/master/src/clj_http/client.clj#L41-51
14:43dakronetomoj: you can rebind the fns for it if you want to use whatever you'd like
14:43tomojohh
14:43tomojI didn't notice they were dynamic
14:43tomojexcellent, thanks
14:44hiredmanamalloy: we need compiler magic to take let-if-try-let do the right thing
14:44Apage43oh neat, that means I could pull in clj-http without cheshire. Mind I don't think I've ever actually used one and not the other in any project yet..
14:44hiredmanlike other lisps have cdddddr
14:45dakroneApage43: yes, it's all set up so you can exclude cheshire from the deps if you don't want to use it
14:45spligakcould someone explain this idiom to me? I understand you can drop a hash-map into it, but I'm curious as to what's happening in the function arguments. is there some implicit conversion going on? https://github.com/dakrone/clj-http/blob/master/src/clj_http/client.clj#L75
14:46tomojdestructuring?
14:46clojurebotdestructuring is http://clojure.org/special_forms#let
14:46amalloygood idea. if the compiler sees you've mashed the names of six built-ins together into a single symbol, it should figure out what the heck you want that to do
14:46hiredmanyes
14:46hiredmandwim
14:46dakronespligak: the response map is being destructured, the :status key is being pulled out and bound to 'status'
14:47tomoj(g x') I assume?
14:47amalloyi remember having a hell of a time figuring out destructuring from the examples in JoC. might have been the hardest part of the book for me to understand
14:47amalloytomoj: yep, good catch
14:47ohpauleezgrzm: Take a look now: https://github.com/ohpauleez/ttt
14:47ohpauleezshield your eyes from all the hacks
14:47ohpauleez:)
14:48tomojhmm
14:48ohpauleezit's very much a scratching pad for me
14:48dakronehttp://clojure-doc.org/articles/language/functions.html#destructuring_of_function_arguments
14:49spligaktomoj, dakrone interesting. thanks for the direction here - had skimmed a bit on the topic. was jarring to see it in the wild for the first time.
14:49spligak(very new to clojure)
14:50Gurragchaaso Clojure runs anywhere that has a JVM installed, right? And if so, can it call all the functions from the Java API, OpenGL in particular?
14:50spligakdakrone, oh wow. those examples are excellent. thanks.
14:50technomancyGurragchaa: not really, OpenGL is typically native code
14:50eggheadhey sjl are you around?
14:51dakronespligak: np, good luck!
14:51sjlegghead: yes
14:52eggheadsjl: I was playing with your wrapper around codahale's metrics -- by default all my bean metrics are under default.default.metricname -- is there any way to change this?
14:52emezeskeGurragchaa: If OpenGL can be used by Java on a given platform, then yes, Clojure can use OpenGL via the Java APIs.
14:52sjlegghead: http://metrics-clojure.readthedocs.org/en/latest/names.html
14:53Gurragchaaso Clojure could theoretically be useful for cross-platform OpenGL game development?
14:53eggheadd'oh, figures I would have missed it, thanks sjl
14:53sjlnp
14:53emezeskeGurragchaa: Yes
14:53emezeskeGurragchaa: https://github.com/ztellman/penumbra
14:54emezeskeGurragchaa: Look in the test/ directory for examples of simple games
14:54technomancyGurragchaa: yeah, but not everywhere Java runs
14:55tomojdakrone: needs to be bound at middleware time, though?
14:55technomancyjust on whatever subset of platforms have lwjgl support
14:55tomojhmm, that shouldn't be the case, I must have screwed up
14:55dakronetomoj: I didn't think it did, but I haven't actually tried it with a different library
14:57tomojoh, looks like clutch calls cheshire.core/generate-string directly
14:58dakroneahh, can't help there then
15:15frawrHi, I have some weird behaviour with lein uberjar. When I run the project with lein run it works, but when i java -jar my standalone jar my main can't be found. Any clues?
15:16technomancyfrawr: missing a gen-class
15:16frawrOnly needed in the main's ns right?
15:17dnolenohpauleez: so I see ttt is out there.
15:18technomancyfrawr: specifically for uberjar, yes
15:18antares_frawr: for the standalone jar to work, yes, it is unlikely that you are implementing Java classes in Clojure if you are asking this
15:19frawr(ns ap.server.setup (:gen-class)) and in the project definition :main ap.server.setup/quick-start, and quick-start is a fn with only the rest argument in the labdalist
15:19TimMcfrawr: You can also use my lein-otf plugin if you don't want to have your code AOT'd (so gen-class would be unnecessary of course).
15:20TimMcSomeone has made a fork of it for lein 2 as well.
15:20technomancyfrawr: you can also do java -cp my-standalone.jar clojure.main -m my.ns
15:20frawrantares_: I don't think that's what I'm asking
15:20technomancywithout any aot
15:20antares_technomancy: isn't :main supposed to take an ns name?
15:20technomancyantares_: it can take a var name too, but that's not very well-tested
15:20technomancycould be a bug
15:21antares_technomancy: I am curious how that works for uberjars
15:21antares_if Main-Class in the jar manifest is a class
15:21technomancyoh yeah, not at all
15:21technomancyit's only for lein run
15:21technomancyfrawr: that's your problem
15:21technomancyshould probably put a warning around that or something
15:22technomancynot really any way we could support that
15:22antares_frawr: your main class ns should have a function named -main and in :main you should specify only namespace, not a var/function
15:22amalloytechnomancy: whaaaat, of course you could. emit your own gen-classed -main that calls the named var
15:22frawrAah ok
15:22technomancyamalloy: right, I mean not without violating the prime directive
15:22amalloy$google leiningen prime directive
15:22lazybot[compilation - FileNotFoundException when making a jar file from the ...] http://stackoverflow.com/questions/3246883/filenotfoundexception-when-making-a-jar-file-from-the-clojure-file
15:23frawrdidn't know that
15:23amalloyi'm disappointed
15:23technomancyI just made that up
15:23clojurebotI don't understand.
15:23technomancybut it sounds good
15:23antares_$google what is clojurebot
15:23lazybot[irc log: #clojure on 2012-10-12] http://www.unexpected-vortices.com/clojure/irc-logs/2012/10-12.html
15:23amalloyit sure does. in this context what does it mean? don't make up code in the user's project or something?
15:23frawrand when using java -cp standalone.jar clojure.main -m my.ns, should my.ns be just a ns with a -main too?
15:25amalloyyes
15:25antares_frawr: basically, you run namespaces. By convention they must have the -main function that takes & args
15:27frawrThe error running my jar makes more sense too then, it listed the fn i wanted to use as mai as part of the ns, with a dot instead of a slash
15:29frawrthnx, works!
15:33grzmohpauleez: thanks! looking forward to it (was pulled away from my desk for a bit)
15:39technomancyfrawr: yeah, we should probably warn in uberjar when :main is set to a var
15:39technomancyit's useful for specifying several run targets in aliases but not or uberjars
15:39frawrDidn't really think about it, but that makes sense.
15:42Cheironclojurebot: besame mucho
15:42clojurebotIt's greek to me.
15:49frawrAnyone from the netherlands here?
15:59jamiiFun with parsing - http://scattered-thoughts.net/blog/2012/10/25/strucjure-reading-the-readme/
16:03flying_rhinohello guys
16:04AntelopeSaladis there anything better than ring/jetty out there for powering a web server?
16:04dnolenjamii: neat stuff, is there some specific you have planned for strucjure?
16:04emezeskeAntelopeSalad: Do you have a specific problem with ring/jetty?
16:05AntelopeSalademezeske: yes, it's getting destroyed under load by artifical benchmarks
16:05flying_rhinoI am wondering is it possible to program in clojure in imperative way, like in Java. I am not saying imperative is better, I just want to know is it doable in principle?
16:05hiredmanflying_rhino: no
16:05emezeskeAntelopeSalad: And you're convinced that this is ring or jetty's fault?
16:05nDuff...well...
16:05ivanflying_rhino: yes
16:05AntelopeSalademezeske: no, that's why i asked if there's an alternative to test against
16:05nDuffflying_rhino: _possible_, yes, but very painful.
16:06ivanis it really that painful to use doto and mutable objects?
16:06ivanit's just freakishly ugly
16:06AntelopeSaladi basically put up a node/express server vs clojure/ring (i would have used compojure but the documentation is bad) , and the ring setup was getting beat up, i was hoping there was an alternative
16:06nDuffivan: When all your language facilities are built to work with immutible objects? Yes.
16:07dnolenAntelopeSalad: ring/jetty and are very fast.
16:07emezeskeAntelopeSalad: It's pretty unlikely that the bottleneck is in ring or jetty, as opposed to your application code
16:07jamiidnolen: I'm really excited by http://www.viewpointsresearch.org/html/work/ifnct.htm and http://boom.cs.berkeley.edu/
16:07dnolenAntelopeSalad: you probably testing w/ a bunch of silly dev route stuff in place.
16:07flying_rhinothe thing is, I like some stuff about lisp (like macro system and first class functions), and I even like a lot of things about immutability but there are things I can't use it for. For example, game development (I am thinking of developing a game for JVM), almost screams mutable state.
16:07AntelopeSaladi dunno, the app code came from the ring documentation
16:07jamiidnolen: I want to apply the same kind of thinking to building p2p networks
16:08jamiidnolen: I'm going to start porting bloom to clojure next week
16:08dnolenAntelopeSalad: doesn't mean much. I've done a ton of pointless benchmarking of netty/jetty/node.js in the past. netty can eat Node.js for breakfast.
16:08dnolenAntelopeSalad: jetty is fine for nearly any workload that's not a chat server.
16:08AntelopeSaladall i did for clojure was setup a handler to report back hello world with no templating
16:09ohpauleezdnolen: ttt is in the wild, but shield your eyes - I did it premature so there was an example of some node.js magic people could work from
16:09AntelopeSaladand then i did the same with express
16:09AntelopeSaladthen i ran it against ab
16:09flying_rhinoso basically what do you do for things that are best done in mutable way (like some things in game development?)
16:09tomojsounds like a good test if you're going to be serving 100000 'hello world's a second
16:09AntelopeSaladhttp://pastebin.com/FP5vxyWT
16:09ohpauleezI ripped the logic query out temporarily and restored the working, but extremely naive for-comprehension
16:09AntelopeSaladthat is the test setup and results
16:09dnolenAntelopeSalad: do some more homework, look at the Jetty docs, if you seeing less than 4000-5000 req/s you're doing something wrong. if you're building a regular website, who cares anyway.
16:10AntelopeSaladthis is on my horrible computer running in a VM so the reqs/s will be low for both
16:10dnolenohpauleez: still looks like it will be a really sweet resource!
16:11tomojthe req/s differences there look.. unimportant
16:11flying_rhinoguys?
16:11ohpauleezdnolen: Here's hoping! :)
16:11emezeskeAntelopeSalad: How are you running the clojure code? lein ring?
16:11AntelopeSaladtomoj: look at the -c 150 one, the node server is pumping out 50% more reqs/s
16:12AntelopeSaladthat is a non-trivial amount
16:12AntelopeSalademezeske: i followed the ring's documentation
16:12dnolenjamii: yeah I've been following along - sounds like you've finally find some time to put it together. You're at HackerSchool right?
16:12AntelopeSaladhttps://github.com/mmcgrana/ring/wiki/Getting-Started
16:12AntelopeSaladi used this exactly, except ring 1.1.6
16:12AntelopeSaladand clojure 1.4
16:12jamiidnolen: Yep. I really needed this kind of environment to actually get moving. Far too easily distracted otherwise :)
16:12tomojyeah, if you're just serving hello worlds
16:13dnolenjamii: been wanting to find some time to really dig into Bloom but I've been busy w/ other things, look forward to seeing the trail you blaze.
16:13jamiidnolen: thanks
16:13dnolenjamii: yeah I love the VPRI/FONC stuff
16:13AntelopeSaladtomoj: what do you propose is a better test, should i return a 5kb string instead?
16:14ordnungswidrighmm, me has only 500/s for a simple "OK" response with -c 50
16:14ordnungswidrigosx seems to do sth wrong
16:14dnolenAntelopeSalad: actually those benches look about right, the difference doesn't look large enough to care though. Once you have template, DB, etc I can't imagine there being an interesting diff.
16:14ohpauleezamalloy: Thanks for the typo catches
16:15AntelopeSaladdnolen: 50% isn't enough to care about?
16:15AntelopeSaladwhat about an api server that doesn't serve templates?
16:15AntelopeSalador a game backend that's just returning json too with websockets, etc.
16:15emezeskeAntelopeSalad: That benchmark is fairly useless with respect to both of those examples
16:15ordnungswidrigAntelopeSalad: is it tuned until no more? Regarding settings, buffer sizes etc?
16:16AntelopeSaladordnungswidrig: not at all, i have no experience with clojure. i was just bored this afternoon and wanted to setup a comparison between it and node
16:16AntelopeSaladbecause i'd like to learn something as a general purpose web language
16:16dnolenAntelopeSalad: if you want better than Node.js async perf, I already said use Netty.
16:16ordnungswidrigAntelopeSalad: don't do it :-)
16:17AntelopeSaladordnungswidrig: don't do what?
16:17AntelopeSaladdnolen: will that still work with ring and compojure?
16:17dnolenAntelopeSalad: w/o seeing a real workload, it's hard to extract any meaning from those numbers.
16:17AntelopeSaladi like the way compojure handles routes a lot
16:17emezeskeAntelopeSalad: To answer your question earlier, 50% is definitely not enough to care about, compared to other factors like developer productivity
16:18emezeskeAntelopeSalad: Unless you really, really know you're going to be serving tens of thousands of qps or something
16:18dnolenAntelopeSalad: I believe Aleph may have ring compat.
16:18ordnungswidrigAntelopeSalad: such tests, when you don't know how to tweek to max performance
16:18AntelopeSaladyeah, it's just bs tests atm, there's no real world data to run it against
16:19ordnungswidrigI do web development since 15 years and I never had a case where the bottleneck was the http server implementation :)
16:20AntelopeSaladi only asked because cost might be a deciding factor at some point
16:20AntelopeSaladi figured "oh man, 50% wtf... that's going to be 50% more expensive"
16:20emezeskeordnungswidrig: I've run into cases where the HTTP server was the bottleneck, and the answer was _easily_ "throw a couple more servers at it."
16:20nDuffAntelopeSalad: I've never, ever seen the bottleneck be there.
16:21nDuffAntelopeSalad: it's pretty much always datastore, occasionally inefficient app-layer logic...
16:21emezeskeAntelopeSalad: Unless you are serving at a massive, massive scale, paying for engineers dominates paying for servers
16:21nDuffAntelopeSalad: "50% more" doesn't matter if that 50% is 0.5% of your runtime.
16:21ordnungswidrigemezeske: sure, there are those cases. But they are special in my experience. and often enough you can change application architecture to reduce the necessary load on servers, conditional requests, caching etc.
16:21AntelopeSalademezeske: yeah of course, if it gets really big then you're in a great position to hire people who know how to deal with it
16:21ordnungswidrignDuff: exactly!
16:22AntelopeSaladi was looking at it from a perspective of playing a game
16:22ordnungswidrigAntelopeSalad: it's like having to pay income tax. it's a good sign, saying that you acutally have income
16:22AntelopeSaladit may involve sending back and forth a lot of small size packets
16:22emezeskeordnungswidrig: We agree: 50% means basically nothing. :)
16:23ordnungswidrigAntelopeSalad: your problem will be more likely how many connection can be handled at once.
16:23nDuffAntelopeSalad: ...also, you want to pay attention (lots of attention!) to how things scale on multi-core architectures
16:23nDuffAntelopeSalad: ...which is not really one of node's strengths, but the direction hardware has been heading in for ages.
16:23AntelopeSaladord: from those tests it looks like the jetty server would eventually crumble with more concurrency
16:23dnolenAntelopeSalad: I ran a Netty+Clojure benchmark on an Amazon Compute Cluster 2 years - I had no idea what I was doing & the hello world benchmark hit >20K req/s.
16:24AntelopeSaladnDuff: my VM is only running off 1 core, and scaling node to use multi-cores is nearly automatic and super easy
16:24dnolenAntelopeSalad: I'm sure Jetty could break 10-15K on the same machine.
16:25technomancyflying_rhino: you can use java arrays and such from clojure
16:25AntelopeSaladdnolen: i'm not sure what that is, some type of server cluster?
16:25dnolenAntelopeSalad: 8 core 23gb box.
16:25flying_rhinotechnomancy: that's good to know
16:25AntelopeSaladprocessor concurrency is something clojure gives us for free right?
16:26emezeskeAntelopeSalad: Jetty is _not_ going to be your bottleneck for serving http. It just isn't worth worrying about.
16:26dnolenAntelopeSalad: my point is, I'd trust any JVM lib for scaling over Node.js
16:26technomancyflying_rhino: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html <- good example of falling back to java-like code when speed is more important than maintainability
16:26AntelopeSaladi mean, to utilize >1 core there's nothing you have to touch?
16:26dnolenAntelopeSalad: Jetty & Netty autoscale yes.
16:26flying_rhinocan I create something like Java struct? (mutable class with no methods)
16:26dnolenAntelopeSalad: of course in a real app you probably need to do a lot of knob twiddling.
16:26technomancyflying_rhino: you can do that with deftype, but usually it's a waste of time
16:27technomancyit's there for those 2% cases when mutability is actually a problem, but it's extremely rare
16:27antares_AntelopeSalad: there is no such as "concurrency for free". If your server or app does use concurrency in bottleneck areas, with multiple cores you will get close-to-linear throughput increase.
16:27flying_rhinotechnomancy: well some things about games are inherently mutable, unfortuantely
16:27technomancythat's one opinion
16:27AntelopeSaladantares_: i meant from a writing code perspective
16:27antares_jetty will make use of extra cores to some extent, given that you have many concurrent requests
16:28nDuffflying_rhino: Remember the ants demo? :)
16:28AntelopeSaladif you setup a few lines of logic to handle spawning child processes in node it'll do its thing automatically give you multi-core usage
16:28technomancythe only thing inherent about mutability is the fact that you're running on a Von Neumann architecture
16:28hyPiRionI've made a lot of different simulators and agents for different bots without mutability
16:28flying_rhinotechnomancy: you pretty much have to update entire state every tick. In case of RPG I intend to make taht's every 0.25 seconds.
16:28AntelopeSaladantares_: ok, that sounds good
16:28hyPiRion/s/bots/games
16:28antares_AntelopeSalad: Clojure gives you safe defaults and building blocks. No "concurrency for free" with any language.
16:28antares_AntelopeSalad: yeah except that spawning a new OS process is dead slow
16:29emezeskeflying_rhino: It's perfectly possible to write a Clojure game without using mutable structs
16:29flying_rhinonDuff: I am not aware of any ants demo. Can you provied me a link.
16:29antares_comparatively to a new thread or Erlang process/Gorouting
16:29technomancyflying_rhino: you're coming at the problem with preconceived biases that aren't based on empirical measurements
16:29nDuffflying_rhino: https://gist.github.com/1093917
16:29amalloy$google functional retro games
16:29lazybot[Purely Functional Retrogames, Part 1] http://prog21.dadgum.com/23.html
16:30AntelopeSaladbtw i didn't intend for this to be any type of flame-y conversation
16:30AntelopeSaladi seriously like clojure a lot
16:30AntelopeSalad(from what i've read so far at least in the "clojure programming" book and fooling around with the repl)
16:30nDuffflying_rhino: ...or, for a newer version: https://www.refheap.com/paste/3099
16:30antares_AntelopeSalad: me neither, I find node.js a good choice for Web apps. See http://aphyr.com/posts/244-context-switches-and-serialization-in-node
16:31riddochcSorry, been busy.
16:32emezeskeamalloy: That's a good entry, although some of the problems he runs into are pretty erlang-specific
16:32ordnungswidrighmm, any idea why stock run-jetty will stop at 50% cpu on both cores?
16:32AntelopeSaladantares_: this looks like a good article but wouldn't you share state in the db most of the time anyways?
16:32AntelopeSaladseems like suicide to have state locked into your app process
16:32ordnungswidrigwith stop I mean, limit
16:32AntelopeSaladthen you lose any form of scaling out
16:32emezeskeamalloy: Like I guess erlang doesn't let you keep shadowing the same local, e.g. (let [a 1 a (+ a 1) a (- a 5)] ...) ?
16:32antares_AntelopeSalad: this is a typical Web app developer perspective
16:32emezeskeamalloy: I could see how that would be annoying
16:32ordnungswidrigAntelopeSalad: you will limit yourself to how fast you can seek a disk.
16:32antares_AntelopeSalad: google for Wooga and Erlang. They used to share state via data stores. 24 boxes. In-process state with Erlang in the app — 1 box.
16:33AntelopeSaladi mean, if i wanted to store session info on a user. i'd surely put it into redis or some other third party memory storage not the app
16:33ordnungswidrigAntelopeSalad: session does not scale. it's shared state that forces you to synchronization, transactions etc.
16:33antares_AntelopeSalad: yeah, that's what Wooga did in one of their games
16:34AntelopeSaladthis way you could have 1 or 50 app servers reading from the same redis server
16:34antares_AntelopeSalad: grew up to 24 machines. Shoveled state in and out all the time for no reason. In-process state reduced hardware requirements to 1 machine.
16:34amalloyemezeske: i actually haven't read much of it, but i don't think that matters. it's a series on writing games without state, which must be of interest
16:34antares_AntelopeSalad: when all you do is Web apps, everything looks like a bunch of stateless servers and shared state in Redis
16:34antares_a lot of software is not like that or should not be like that
16:35AntelopeSaladantares_: yeah, that is good right?
16:35ordnungswidrigAntelopeSalad: datomic has a nice model: a writer (transaction) multiple reader nodes having local caches for indexes etc.
16:35emezeskeamalloy: Oh, it is very much of interest.
16:35antares_AntelopeSalad: how is that good?
16:35AntelopeSaladif you keep state out of your process, then you can freely scale out without it being a big deal
16:35antares_AntelopeSalad: having just 1 option you try to apply to everything does not sound good to me
16:35AntelopeSalad*app process
16:35emezeskeamalloy: I think I ended up on that blog from that series, and ended up reading every entry exhaustively... O_o
16:35amalloyyeah, i like his blog too
16:36antares_AntelopeSalad: is a game something you'd do like that?
16:36antares_AntelopeSalad: with game/player state always being stored in and taken out of Redis?
16:36AntelopeSaladfor a game? i'm not sure. i haven't really thought about that fully ever
16:37AntelopeSaladif it's important data i'd probably save it on disk and have a copy in memory for faster access
16:37antares_AntelopeSalad: see http://www.slideshare.net/wooga/erlang-factory-sanfran
16:37ordnungswidrigAntelopeSalad: btw. think of cutting your state into parts. maybe you can distribute the state on different nodes then. or you can work with eventual consistency.
16:38AntelopeSaladwow this talk looks like it'll be quite interesting
16:40AntelopeSaladantares_: do you happen to know if the video of this is posted anywhere?
16:40antares_AntelopeSalad: I don't know. Another talk by the same person: http://www.slideshare.net/hungryblank/getting-real-with-erlang, see slide 46
16:41AntelopeSaladapp servers don't need to be monolithic either
16:42antares_the only reason is why so much software is I/O bound is because a lot of software is written that way: all state is always sholved in and taken out of a data store, even if there is no real reason for doing so
16:42antares_"we just have always been doing it, right?"
16:43AntelopeSaladright
16:43antares_that's not at all how things are in many other areas of software
16:43AntelopeSaladi think it's because we can't even trust our web servers
16:43AntelopeSaladthey need to be restarted pretty frequently
16:43emezeskeantares_: You know... there are some good reasons for how web apps are architected, with databases, etc. Right?
16:44AntelopeSaladalso (maybe not in clojure's case tho) if you push a new build that requires restarting the app
16:44antares_with erlang and to some extent Clojure (or Scala and Java w/ Akka), you can have sane state management and recovery
16:44antares_so keeping state in-process is not a problem
16:44antares_emezeske: there are good reasons but Web developers blindly apply the same approach to EVERYTHING
16:45AntelopeSaladi thought one of clojure's main philosophies was to eliminate state and only deal with pure data
16:45emezeskeantares_: Well, it turns out that most web apps are kinda similar to one another
16:45antares_and then spread the gospel of node.js, redis and other stuff that is only necessary if you do things in a particular way
16:45hyPiRionAntelopeSalad: Clojure's main philosophy is to make software development less complex.
16:46antares_AntelopeSalad: eliminate state? Useful programs always have state. The question is how you change and incapsulate it.
16:47AntelopeSaladantares_: in the first slide show, what are those blue dots on slide 46?
16:47AntelopeSaladare they supposed to be processes?
16:47antares_presumably processes, Erlang or not
16:47antares_the point is that in Erlang, distribution is transparent and processes across machines form a single "cluster"
16:48ordnungswidrigwhy ist there still no OTP for clojure? Seems so natural.
16:49AntelopeSaladwhat would be contained in each process in this example?
16:49antares_AntelopeSalad: in their game example, one player's state
16:49AntelopeSaladsome piece of the final app and then the "process cluster" is the combination of each sub-app?
16:49antares_but there are always additional processes that carry out smaller tasks
16:49ordnungswidrighttp://www.12factor.net/processes
16:51antares_ordnungswidrig: keep in mind that that "guide" assumes that what you build is Web apps, on multiple layers. Assets packagers clearly indicate that.
16:52ordnungswidrigabsolutely. but the idea of process as an complete processing unit is nice.
16:52AntelopeSaladi'm not sure i understand how their state is stored and gotten back out
16:52antares_AntelopeSalad: in erlang processes. Do you know anything about Erlang?
16:53antares_AntelopeSalad: it is NOT stored until a round or the entire game is over
16:53AntelopeSaladi know nothing except a lot of people joke at how cryptic its syntax is
16:53antares_not stored to a database
16:54antares_erlang VM can have up to millions of Erlang processes, some of them store state for the duration of a game round
16:54antares_when the round is over, it is stored to the database
16:55antares_but all intermediate changes are not stored there, they are kept in the app and propagated to players
16:55AntelopeSaladsounds dangerous
16:55antares_this cuts number of requests by 99%, as slide 46 indicates
16:55AntelopeSaladwhat happens if something goes wrong and the process crashes?
16:55antares_AntelopeSalad: it is not dangerous because Erlang has the concept of supervision trees
16:56antares_AntelopeSalad: it is restarted by its supervisor. Whole trees of processes can be restarted.
16:56AntelopeSaladand it knows what to put back in?
16:56antares_AntelopeSalad: that is NOT an OS process, so process crashes means you have issues in your code or something like a network split has happened
16:56AntelopeSaladah
16:57antares_AntelopeSalad: it can load something form a database or simply start from scratch
16:57antares_in an interactive game if a piece of state is gone, it sucks but you cannot make every single change persistent anyway
16:57antares_there are too many of them
16:57AntelopeSaladi was thinking of it as a worst case scenario like
16:57AntelopeSaladwhat if you pay for something in the game and then something happens with the process, the round isn't over yet
16:57AntelopeSaladif it crashes and restarts you lose what you paid for
16:57antares_so they are batched in some shape or form. The difference is that if an OS process goes down, you lose a lot of state + need to reinitialize everything
16:58antares_in Erlang, a process that goes down is usually monitored by another process and will be restarted
16:58antares_(or not, it is up to developers)
16:58antares_AntelopeSalad: changes that you pay for are probably not stored just in process
16:58antares_AntelopeSalad: but 99% of state changes can be
16:59AntelopeSaladi see an item moving into your inventory as being a state change
16:59antares_AntelopeSalad: that does not happen that often
16:59antares_if you care, you can store that
17:00antares_but movements that happen all the time, it makes no sense to try to store every single one of them
17:00antares_that's just too wasteful
17:00AntelopeSaladyeah, i agree with that, trying to store every single one would be a bit much
17:00antares_and if you crash it does not necessarily make sense to recover EVERYTHING
17:00AntelopeSaladit would only be useful if you wanted to make a full on replay of something
17:01antares_AntelopeSalad: databases have buffers and periodically flush data to disk, nobody seems to be too concerned about that
17:01antares_one database goes so far its clients do not check for network errors, and Web developers go gaga over its benchmarks
17:01Apage43..
17:01AntelopeSaladin most cases that is their job
17:01antares_AntelopeSalad: but it's the same thing
17:01emezeske /join #erlang
17:01antares_you cannot persist everything, it will be too time consuming
17:02antares_so you choose what to store (in case of databases, fsync), apparently in many cases that is a tiny fraction of total state changes
17:02AntelopeSaladyou might not need to persist everything, but you'll probably have to handle everything in your app
17:02AntelopeSaladlike, player x moved from old-coords to new-coords
17:03antares_so?
17:03CheironA java method requires Class as a parameter, how to pass that in clj?
17:03Sgeo,(class Object)
17:03clojurebotjava.lang.Class
17:03AntelopeSaladi was just getting that in the end you will transfering back and forth a lot of traffic
17:03antares_Cheiron: (class x) or (Class/forName "String")
17:04antares_AntelopeSalad: eh?
17:04TimMcCheiron: Just write the classname.
17:04antares_AntelopeSalad: no you won't. 99% of your state changes happen in-process.
17:04antares_or at least they can
17:04CheironTimMC: using the class name is throwing classnotfoundexception
17:04clojureohpauleez: so is ttt pretty zippy on the command line?
17:04AntelopeSaladclient moves from old to new -- client sends that to the server -- server says ok, it's a legit movement back to the client -- client continues
17:05antares_AntelopeSalad: well, if clients cannot talk to each other directly, there is no way around that
17:05antares_a lot of state can even be stored on the client only (maybe not in multiplayer games, but just software)
17:05ohpauleezFor those curious, here's a screencast of me using ttt and how to use it (2 min): http://www.pauldee.org/TTT-Intro.mov
17:05dnolenohpauleez: oops that was my question, about ttt's on the command line.
17:05AntelopeSaladyou might need to check vs a central server to make sure it's within a specific bounds
17:05dnolenohpauleez: sweet!
17:05ohpauleezdnolen: ^ very zippy
17:05antares_AntelopeSalad: and how is it different when your server is completely stateless?
17:05AntelopeSaladsort of like having validation code running on your server, of course you need it -- you can't just trust the client (javascript) straight up
17:06antares_it is not but you send even more data around, for no good reason
17:06antares_AntelopeSalad: again, why?
17:06AntelopeSaladyeah it's not different in the end
17:06antares_because Ruby on Rails works that way?
17:06dnolenohpauleez: are you going to publicize this or waiting to clean it up a bit?
17:06AntelopeSaladi have no idea, i never used rails
17:06antares_of course you can (again, maybe not in games, but in general you can)
17:06Apage43multiplayer games do a -lot- client side. The server is there mostly to make sure the things the clients say make sense (aren't cheating), and that they sync up.
17:06nDuff*nod*.
17:06antares_in games client-side state means cheaters will try to exploit it
17:06emezeskeantares_: Are you suggesting that you can leave validation to the client?
17:07antares_but you sure can store and change a lot of the state in the client
17:07ohpauleezdnolen: I'm ok with people checking it out now, but I'm going to clean it up a little bit before I hit the list with it
17:07antares_emezeske: absolutely
17:07dnolenohpauleez: cool
17:07nDuffAntelopeSalad: ...you don't need to make the server validate _every_ move -- those can be batched.
17:07antares_emezeske: the only case where it won't work is if you also have an API
17:07nDuffNo point to making your app unnecessarily latency-sensitive.
17:07ohpauleezdnolen: The best piece of code in there is "blocking-deref" which I think is pretty essential for sane use of Node.js
17:07AntelopeSaladnDuff: yeah, i'm not a game dev -- i'm sure there's all sorts of tweaks you can do to minimize the back and forth traffic
17:07AntelopeSaladbut it's something i want to persue in the future
17:07dnolenohpauleez: is that a macro?
17:08TimMcCheiron: You'll need to (:import ..) it then.
17:08emezeskeantares_: Uh...
17:08dnolenohpauleez: demo looks cool, and yeah, fun to see command line usage of Clojure that isn't glacial
17:08antares_AntelopeSalad: on crappy mobile networks, again, a lot of state is kept in the client for at least some time
17:08TimMcCheiron: or use the pacakge-qualified name.
17:08antares_emezeske: Uh what?
17:08ohpauleezdnolen: Function - it just ticks Node.js until a promise is fulfilled
17:08dnolenohpauleez: neat
17:09dnolenohpauleez: sounds worthy of blog post
17:09antares_emezeske: are you saying that nobody does that? How about lots-of-state-on-the-client libraries like Ember or even backbone?
17:09ohpauleezdnolen: it's coming :)
17:09AntelopeSaladantares_: handling a lot of state on the client seems worse for mobile dev
17:09antares_AntelopeSalad: yeah? what will you do when your app detects there is no network connection?
17:09AntelopeSaladif you're talking about stiching up templates with js template libs, that's going to be put serious stress on a mobile device
17:10AntelopeSalad*stitching
17:10emezeskeantares_: You made it sound like the server doesn't need to validate input it's receiving. If that's not what you mean, then fine.
17:10SgeoI'm under the impression that multiplayer games sometimes do store quite a bit of state client-side that server doesn't check, because a bit of cheating is not as bad as having a server that barely runs because it needs to check everything
17:10SgeoAnd using a lot of bandwidth and time for every frame that the client needs to display
17:10ordnungswidrigSgeo: the server can batch-validate later
17:10antares_AntelopeSalad: what will your super-neat server-based mobile app do when it has no network connection? it has to either keep state in the app for at least some time or drop it on the floor
17:10AntelopeSaladSgeo: there's probably client side prediction to make it look smooth without crushing the server, but then every x frames or milliseconds it checks back to make sure you're in bounds
17:11SgeoCan't batch-validate whether client is using semitransparent textures on walls in 3d games
17:11emezeskeSgeo: The server in a multiplayer game should check *all* state that could affect the outcome of the game
17:11antares_so, it turns out, completely stateless apps is just one historically formed case with "traditional Web apps"
17:11AntelopeSaladantares_: i don't know, i don't develop for mobile devices yet
17:11emezeskeSgeo: Of course graphical state doesn't matter, e.g. in counterstrike source, the ragdoll physics are not synced among clients because they don't really affect the outcome
17:11antares_with mobile clients, real-time games and data processing, in-process state is an important part of the equation
17:12dnolenohpauleez: cool to see the datalog query lang, I checked out the core.logic bits seems like a nice and simple use case.
17:12emezeskeSgeo: For things like transparent texture hacking, they do a lot of hashing to check things server side, but obviously that's a cat and mouse game
17:13ohpauleezdnolen: I agree; it's a simple way to say, "Here's a quick way logic makes this easy"
17:13SgeoBut the possibility of cheating is still better than the alternative of having the server compute every bitmap and send it to the client
17:13AntelopeSaladantares_: in the case of losing connection, i have to guess that the server will keep everything in order and keep trying until it eventually either times out or the client comes back from the dead
17:13ohpauleezdnolen: I agree with martin - you can get pretty far with unify, binding-map, set, and filter
17:13antares_AntelopeSalad: that's not what I am talking about
17:13antares_AntelopeSalad: my network is down, the user added something in the app
17:13antares_AntelopeSalad: what do you do if you cannot send a piece of data to your shiny node.js backend?
17:13emezeskeSgeo: Well, onlive did it the latter way (server computes everything), although they did not do well as a business
17:14antares_AntelopeSalad: drop the change or keep it in the app until network access is back? I think the answer is obvious.
17:14AntelopeSaladantares_: in that case, keep it in the app for sure -- if we're talking about a content oriented web app that isn't really multi-player
17:15AntelopeSaladbut "app" in this case would be javascript on the client most likely
17:15antares_AntelopeSalad: so there you go, you are dealing with more sophisticated state changes. If that happens to include concurrency, bam, it's a lot of fun. Clojure is one of a few languages where state management is much more predictable, even with a lot of concurrency going on.
17:16AntelopeSaladi'm not sure why node would fail with that use case
17:16antares_AntelopeSalad: javascript or not, the belief that all software is stateless or should be such is wrong
17:16dnolenohpauleez: yep. lynaghk is working on some cool things it's giving me ideas for things to work on.
17:16AntelopeSaladyour state would be partially stored in some client side code that is 100% isolated from the server -- the server choice at this point has no bearing
17:16antares_AntelopeSalad: node tries to hide concurrent state management from you by only having 1 thread and callback soups everywhere
17:17AntelopeSaladit auto-spawns child processes and manages them internally, i don't know the exact details though
17:17dnolenohpauleez: I think by making it clear how to build simple rules system maybe be a better entry point for most people than the raw miniKanren itself
17:17Apage43wait what
17:17antares_AntelopeSalad: yeah, I guess you never developed anything that's not a Web app and my point will not get across
17:17ohpauleezdnolen: We were just hacking on all that stuff this past weekend - you should have seen the whiteboard - so.much.core.logic.
17:17antares_AntelopeSalad: it does not autospawn a thing
17:17dnolenohpauleez: ah right, did you meat up with Kevin in NYC?
17:17dnolenohpauleez: oh, your in Portland now right?
17:18AntelopeSaladantares_: if you use the cluster module it forks children and then has its own messaging system setup
17:18antares_AntelopeSalad: maybe some servers do, again, this can be "automatic" only as long as there is no need to share any state and process interactions are trivial
17:18ohpauleezdnolen: I totally agree - more than happy to help with those efforts. Yeah, I'm out in Portland mostly full-time now
17:19dnolenohpauleez: he's got some neat things he wants to do w/ the grammar of graphics stuff, a lot of it really can be done w/ simple unification + simple constraints (my new idea)
17:19AntelopeSaladantares_: i think that brings us in a full circle haha
17:19antares_AntelopeSalad: but that's not Node. That's some cluster module. And fork(2) is an expensive operation.
17:20AntelopeSaladit might not be able to handle state in that case which is why people just throw their state in redis
17:20AntelopeSaladcluster is a core module for node
17:20AntelopeSaladjust like http is a core module for node
17:21ohpauleezdnolen: For sure. I'd be interested in taking a look at what you cook up for simple constraints- it's one area of core.logic I haven't ventured into yet
17:21Apage43I remember when it wasn't =P
17:21Apage43that is, it used to be its own thing
17:22Apage43it's been pulled into the standard distribution, but it doesn't do anything "special" to make it work well with node
17:22SgeoSimilarly to how lazy-seq exists, something for developers to make their own lazy-seq like things
17:22Apage43it just sets up a way for you to message the leader, basically
17:22AntelopeSaladApage43: yeah
17:22AntelopeSaladit works though
17:22SgeoSuch that client code does not have to deal with forcing
17:22AntelopeSaladand it's basically hands free once you set it up
17:23Apage43right, assuming no shared state
17:23AntelopeSaladyep
17:23dnolenohpauleez: basically a simple way to take any predicate and attach it to a var, soon as the var becomes ground it will run. This will let people say things like only unify if number, or if this class, etc.
17:23AntelopeSaladthat's why everyone keeps their web servers statelesss
17:23AntelopeSaladand all of this stemmed from the TL;DR part of this: http://aphyr.com/posts/244-context-switches-and-serialization-in-node
17:23ohpauleezdnolen: YES!!!
17:24Apage43because it sucks to write a stateful one in node =P
17:24AntelopeSaladhe basically says it's not an issue if you keep state out of the app
17:24ohpauleezIt's like you were sitting on my laptop last night
17:24ohpauleezI was in the weeds working on core.contracts+test.generative+Alloy and facing that exact situation
17:24AntelopeSaladApage43: and in clojure it won't be a problem to run a multi-core/server stateful app?
17:24AntelopeSaladi haven't gotten to managing state and concurrency yet in the book
17:25Apage43not nearly so much as in node, no
17:25Apage43multi-server you have the same issues
17:25Apage43but not with multi-core
17:25AntelopeSaladmulti-server seems pretty standard to me
17:25ohpauleezdnolen: ^ (my current approach is a generic "spec" hashmap that gets unified and processed for each any backend. Making it open for extension)
17:25antares_AntelopeSalad: I am convinced that Web developers run everything stateless because 1) they have never seen a different approach because Web devs only work on Web apps, 2) almost all modern languages suck at error handling and recovery, which is very important for in-app state
17:26antares_it has nothing to do with "scaling out". Your state is still shared, you just shifted the bottleneck to the database. And once you have a few DB machines, the whole consistency/availability dance begins.
17:26AntelopeSaladno matter what choice you make, a single server is eventually going to crumble with enough pressure
17:26ordnungswidrigantares_: and today's web developers know only database for persistence.
17:26nDuffAntelopeSalad: Nobody is denying the need to scale to multiple servers.
17:27antares_AntelopeSalad: cool, why again should I keep my app completely stateless?
17:27Apage43AntelopeSalad: sure, but with the node-cluster approach you couldn't easily do something like distributing users over the works, but then giving the users affinity to a particular worker, and then just manage that state on that worker
17:27technomancyI dunno, I think people spend way too much time thinking "what if we become the next facebook"
17:27Apage43*workers
17:27antares_AntelopeSalad: I can keep it mostly stateful and sync when important evens happen
17:27antares_*events
17:27nDuff...trying to hard to keep things stateless means your caches aren't close to your requests
17:27AntelopeSaladApage43: can't you use a load balancer that handles sticky sessions?
17:27antares_that's what the presentation above basically demonstrates
17:27Apage43AntelopeSalad: not with node-cluster..
17:28nDuffso you move things out into memcached or such, but then you're going over a network rather than being able to refer to local memory.
17:28AntelopeSaladApage43: why not?
17:28Apage43because once it hits a server you don't get to pick what worker the connection goes to
17:28nDuffApage43: ...well, that's not quite true; there are techniques for that.
17:28Apage43since its dispatched before you know who it's from
17:28AntelopeSaladyour clustered app is running on 1 port, it doesn't spawn a "real" new process
17:29nDuffApage43: First person to get a request assigns a cookie. Cookie comes through on all future requests. Load balancer looks at it to pick first-choice handler.
17:29AntelopeSaladas far as your load balancer knows, it's just a single app (i would think, i never tested it full hand)
17:29AntelopeSalad*first
17:29ivancan I query postgres with datalog queries yet?
17:30nDuff...oh, you're talking about separate-process workers being locally dispatched w/ something not as smart as HAProxy or such? Ugh.
17:30antares_nDuff: this means now you have a stateful load-balancer ;) won't you want to scale load balancers once you become the next facebook?
17:30AntelopeSaladi don't even care about scaling right now haha
17:30AntelopeSaladi just didn't want to spent 50% more
17:30AntelopeSaladand you guys cleared it up that it won't be a direct 50% cost increase
17:30nDuffantares_: Yes, I have a stateful load balancer. There are damned good ones on the market -- but it doesn't need to be as stateful as you think, if it's just using a hash of the cookie for assignment.
17:30wingytechnomancy: or they are just curious about how it works :)
17:31antares_nDuff: I was kidding. "Smart proxies" definitely can solve some problems well, and there are good off-the-shelf solutions.
17:32AntelopeSaladnDuff: are you running any decently large sites atm with ring serving everything?
17:32dnolenohpauleez: another thing would be "ghost" values
17:33dnolenohpauleez: values which can be replaced by other values w/ failing unification
17:33nDuffAntelopeSalad: Nope. My last decently large site was a Django shop. Python's not exactly a high-performance language, not Django a high-performance stack... but it didn't matter, because we did a decent job at horizontal scaling.
17:33nDuffAntelopeSalad: Same thing applies here, except that the JVM is one helluva faster runtime than CPython.
17:34dnolenohpauleez: w/o I mean
17:34AntelopeSaladcan you give me a ballpark on how much traffic you guys had and how much it cost per month for hosting?
17:34AntelopeSaladdoesn't need to be exact, just a rough estimate
17:35ohpauleezdnolen: ahh gotcha - would be useful when doing a lot of data-oriented unification
17:37nDuffAntelopeSalad: In PM.
17:37wei_in clojure, you extend the reader by rebinding *data-readers*. how to do so in clojurescript? looks like *data-readers* is not bound.
17:41dnolenwei_: hasn't been done yet as far as I know. could be wrong
17:42wei_i see, thanks
17:44CheironHi, any idea what is this ? http://pastie.org/5120925
17:45scriptorwhat's the code giving that error, Cheiron
17:45Cheirontrying to test Storm topology with Storm provided macros
17:54riddochc1that feels like chaos
17:54riddochc1SOrry.
17:54riddochc1Wrong channel.
17:55Cheironit it possible to exclude a namespace from :aot of lein?
18:01technomancyCheiron: ...yes?
18:02CheironI checked the sample.project.clj
18:02Cheironbut didn't find an option to exclude a namespace from :aot
18:02technomancy:aot is a vector
18:03technomancyoh, you mean exclude it from :aot :all? there's nothing for that, no.
18:04CheironI see, thanks!
18:05technomancyI think :aot might support a vector of regexes as well though
18:07aperiodicit does
18:10Cheironit does? so something like com.domain.* will compile the whole name space but not clojure.pprint ?
18:11aperiodicit will compile every namespace that match com.domain.* and any namespaces they use/require
18:12aperiodicas far as i know there's no way around that
18:13CheironI see
18:14wingydoes aleph work with ring/compojure?
18:14technomancyyeah, that's a long standing clojure bug
18:25ivanwingy: pretty sure it does
18:27Apage43wingy: you can even use compojure to route async stuff
18:27Apage43see (wrap-ring-handler) and (wrap-aleph-handler) in the Aleph API
18:28wingyhttps://github.com/ztellman/aleph/wiki/HTTP
18:28wingyyeah .. nice
18:28wingynow i can choose when to do (a)synchronous handling
18:28Apage43yup.
18:30Apage43you can do stuff like use compojure to dispatch to a websocket handler
18:31wingyare there reasons to use jetty instead of aleph? seems like aleph scales better
18:32tomoj:(
18:32Apage43well if you stick with pure ring, you get the rest of the servlet ecosystem
18:32Apage43if you're into that kind of thing
18:33Apage43you can spit out WAR files that you can just drop on any servlet-compatible container and have them go
18:33xeqiwingy: source?
18:33wingyokay .. im not familiar with WAR files and servlets .. have to read up on that
18:34Apage43it's the sort of thing that's more valuable if you have lots of existing Java infrastructure
18:34wingyxeqi: coming from node.js where we learned async handling = higher performance
18:35wingyApage43: i see
18:36Apage43there are places where it's faster to just respond immediately, rather than do the whole async queueing hoopla, especially if its a request that you can fulfill very quickly (don't have to hit network or disk) and without much computation
18:38Apage43async handling isn't magic, it's just a way of coordinating work that happens to make a lot of sense if you have lots of things that wait on other things
18:40wingyisnt that the case when doing web apps with a database?
18:40emezeskeI feel like the disadvantages of async I/O aren't mentioned enough
18:40emezeskeIt makes things harder to debug, and opens you up to spaghetti callback code
18:41emezeskeYou can also introduce horrible problems by accidentally doing CPU-intensive work in the worker
18:41Apage43++
18:42Apage43yeah, there's a lot you have to be careful around
18:42wingyemezeske: what if you don't have to mess with callbacks
18:42emezeskewingy: All the other things still apply
18:42technomancynever thought I'd be so happy to see a proper stack trace after that
18:42wingyif you just wrap your functions with an async handler that will take care of putting your return value to the callback (https://github.com/ztellman/aleph/wiki/HTTP)
18:43emezesketechnomancy: Exactly -- async callstacks are so not helpful
18:43wingyso it makes sense to just stick with jetty instead of aleph?
18:43emezeskewingy: Unless you have a very specific workload where jetty is just not working out for you? Yes. (IMHO)
18:44wingylets just do that then .. jetty .. you are a damn lucky server
18:44aperiodici get the impression that everybody who uses node.js writes their own idiosyncratic flow control library in order to avoid losing their mind
18:45emezeskeaperiodic: Yep! Everyone ultimately tries to create a synchronous-looking API on top of the async :)
18:45Apage43aperiodic: not everyone, a lot of them have already lost their minds and have become comfortable with it :)
18:45wingyeveryone is using async.js
18:46emezeskeaperiodic: haha
18:47wingythe fact is that i feel synchronous coding where you don't have to think about server arhictecture is better .. you just focus on the domain problem
18:47emezeskewingy: Synchronous code is undoubtedly easier to read.
18:48Apage43and reason about
18:48wingyscrew scaling .. i want a happy life :)
18:49emezeskewingy: You can scale both ways
18:53tomojasync.js seems way off
18:56wingytomoj: it's whatever node.js needs it to be
18:59dnolenohpauleez: LOGIC-63 resolved
18:59ohpauleezdnolen: Excellent, I'll take a look at the ticket now to see the resolution, I'm definitely curious
18:59dnolenohpauleez: typo :P
19:00ohpauleez:(
19:00ohpauleezdnolen: I apologize
19:00dnolenohpauleez: from copy and pasting Clojure into ClojureScript, -withMeta -> -with-meta
19:00dnolenohpauleez: on LCons deftype
19:00dnolenohpauleez: nah, wasn't obvious
19:00SgeoWhy does tryclj allow def and the bots don't?
19:00ohpauleezAhh that makes sense
19:01dnolenohpauleez: thanks for actually trying / using core.logic on CLJS :)
19:01ohpauleezdnolen: Thank you for providing me with something to try!
19:06technomancySgeo: probably because everyone in the channel shares a sandbox with lazybot
19:06RaynesSgeo: Well clojurebot doesn't use clojail, so it has no def sandboxing at all.
19:06technomancywhereas tryclj can build the notion of a session
19:06RaynesSgeo: On tryclj, everyone gets their own sandbox. In this channel, everybody shares a single sandbox.
19:06RaynesSgeo: It is entirely possible to make lazybot work like tryclj, I just haven't done it.
19:09dnolenohpauleez: whenever I work on core.logic on CLJS - I realize, CLJS is pretty freaking awesome.
19:10ohpauleezdnolen: It really is incredible - the reader, protocols, rich data types, and macros - you can pretty much build anything
19:11dnolenohpauleez: LOGIC-61 resolved
19:11dnolenohpauleez: I think that's it for your CLJS tickets
19:12ohpauleezdnolen: Thank you so much, definitely very helpful (I needed partial-map for something)
19:12dnolenohpauleez: partial maps will no longer escape, really meant to be used internally anyway. They always become regular maps when they become a result
19:13ohpauleezexcellent, that totally works for me
19:39dnolencore.logic 0.8.0-beta2 going out
19:40pandeirodnolen: know anything about elm?
19:40dnolenpandeiro: yeah I saw a presentation about it at ELC
19:40dnolenat StrangeLoop
19:41pandeirojust discovered it, some interesting ideas applicable to cljs dev
19:41technomancywhich one was presented first?
19:42dnolentechnomancy: Elm was I think
19:42dnolenpandeiro: what in particular?
19:42pandeirodnolen: functional reactive programming
19:43technomancyelm was the more reactive one, yeah
19:43technomancythat was rockin'
19:44pandeirosomething like Mouse.position always having the cursor's coords, is that really 'functional'?
19:44pandeiroi am not interested in paradigm purity, just trying to understand things
19:44dnolenpandeiro: it's very interesting I'd like to see much more non-trivial examples though. I also wasn't sold on hiding the details of the platform
19:45dnolenpandeiro: my impression was a FP version of Lively Kernel but much less mature.
19:45pandeirodnolen: i am torn on that b/c it seems js can be so low level for a high level language
19:45pandeirothe way you have to do things
19:45pandeirothe need for jquery
20:06ohpauleezTo those interested in learning more about ClojureScript+Node.js
20:06ohpauleezhttp://www.pauldee.org/blog/2012/clojurescript-and-node-js-an-experience-report/
20:15wingyis there a way to add a key/value pair to a map if the key value pair is inside a list or vector?
20:15wingy[key value]
20:16black_joe(keyword) will convert data of another type into a key.
20:16RaynesNot what he wants.
20:16wingynope
20:17Raynes&(apply assoc {:a :b] [:c :d])
20:17lazybotjava.lang.RuntimeException: Unmatched delimiter: ]
20:17Raynes&(apply assoc {:a :b} [:c :d])
20:17lazybot⇒ {:c :d, :a :b}
20:17Rayneswingy: ^
20:17wingy(some-fn {} [key value]) ;=> {key value}
20:17jkkramer&(conj {:a :b} [:c :d])
20:17lazybot⇒ {:c :d, :a :b}
20:18RaynesHuh, cool.
20:18wingyjkkramer: there you go
20:18jkkramer&(conj {:a :b} '(:c :d)) ;but not this
20:18lazybotjava.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map$Entry
20:19wingyyeah vector only
20:25SgeoAre there any good libraries for making lazy data types and functions to operate on them?
20:32dnolenohpauleez: nice post
20:32ohpauleezdnolen: Thanks, I hope people find it useful (and don't mind the bits of passive voice use)
20:34ivandoes tools.nrepl support any kind of incremental response? I'd like to write command-line tools that don't want for all of stdout before writing something
20:53SgeoWhen is it appropriate to use get?
20:53Sgeo(doc get)
20:53clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
20:58ohpauleezSgeo: When your key is not a keyword
20:58ohpauleezor when your collection can be a number of things (all that support get)
20:58Sgeo,({1 2 3 4} 1)
20:58clojurebot2
20:59ohpauleez,([1 2 3 4] 1 2)
20:59clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector>
20:59Sgeo,(get [1 2 3 4] 1 2)
20:59ohpauleez,(get [1 2 3 4] 6 2)
20:59clojurebot2
20:59clojurebot2
21:00ohpauleez,(get {"a" 1} "a" 2)
21:00clojurebot1
21:00jamiiI keep getting bitten by this:
21:00jamiisecd.core> NIL
21:00jamii#secd.core.NIL-I{}
21:00jamiisecd.core> (class NIL)
21:00jamiisecd.core.NIL-I
21:00jamiisecd.core> (class #secd.core.NIL-I{})
21:00jamiiclojure.lang.PersistentArrayMap
21:00ohpauleez,(get {"a" 1} "b" 2)
21:00clojurebot2
21:00ohpauleezSgeo: does that help?
21:00SgeoYes
21:01ohpauleezexcellent
21:01ohpauleezjamii: What is it you're trying to do?
21:01technomancySgeo: OTOH calling the map without get will do the same thing
21:01technomancyso get is typically used if the map might be nil
21:01ohpauleezjamii: Ohh, nil is lowercase
21:01technomancyand you're looking up a non-keyword key
21:02ohpauleezyes
21:02ohpauleezI use it most in threading macros
21:02ohpauleezfor that reason
21:02jamiiohpauleez: this is a record called NIL. The name is not important. The problem is whenever you use record literals to construct a record that has zero args, the resulting object is a map.
21:02jamiiohpauleez: Which breaks protocol dispatch
21:02amalloytechnomancy: get can probably optimize better than calling the map as well
21:03gfrederickswhat are records that have zero args?
21:03ohpauleezjamii: Definitely sounds like a bug to me. Is there any literature against creating Records of zero args?
21:03gfredericks(defrecord Foo [] ...)?
21:03ohpauleezgfredericks: My thought too
21:03gfredericksthe point is to have a mappish thing of a custom type, but not caring about any particular fields?
21:04amalloyon reflection i don't think that's true actually, never mind
21:04ohpauleezjamii: Would you better served with deftype?
21:04jamiiohpauleez: deftypes don't have literals at all, so I can't prn and then read them
21:05ohpauleezjamii: You could define reader-literals (if you're ok using 1.5.0-beta1)
21:05ohpauleezactually - they're in 1.4 too
21:06jamiisecd.core> (class `~NIL)
21:06jamiisecd.core.NIL-I
21:06jamiisecd.core> (class (eval `~NIL))
21:06jamiiclojure.lang.PersistentArrayMap
21:06ohpauleezand if you need the the reader, what's wrong with using nil, which would give you the protocol dispatch
21:07amalloyjamii: `~x is always identical to x
21:07jamiiamalloy: ok, so this is the core of the problem
21:07jamiisecd.core> NIL
21:07jamii#secd.core.NIL-I{}
21:07jamiisecd.core> (eval NIL)
21:07jamii{}
21:08jamiiCompared to:
21:08jamiisecd.core> (SEL 't 'f)
21:08jamii#secd.core.SEL-I{:then t, :else f}
21:08jamiisecd.core> (eval (SEL 't 'f))
21:08jamii#secd.core.SEL-I{:then t, :else f}
21:08jamiiRecords with zero args eval to maps, not themselves
21:08amalloywhy are you calling eval on a defrecord? like, agreed it probably shouldn't behave this way, but...
21:08gfredericksrecord literals in the code get eval'd right?
21:09jamiiamalloy: I'm splicing a record into a macro. Then trying to figure out why the result has a map in it.
21:10jamiiamalloy: https://www.refheap.com/paste/6177
21:12jamiiI think record literals with zero args are broken and splicing in macros is just one of the places it shows up
21:13gfredericksjamii: this isn't actually a blocker for you, right? you could emit a call to the constructor instead?
21:13amalloywell '(run NIL empty-registers) isn't the same as `(run ~NIL ~x), it's the same as `(run ~'NIL ~x)
21:13jamiigfredericks: I'm just playing around anyway so its not blocking anything important.
21:14jamiiamalloy: ok, say we do this the other way around
21:15jamiiamalloy: huh, thats interesting - this actually works
21:16jamiihttps://www.refheap.com/paste/6178
21:17jamiiBut this doesn't: https://www.refheap.com/paste/6179
21:17SgeoI should set up an IRC bot based on .... a UMLbox bot in another channel
21:17SgeoWould be nice to have a Clojure bot where defmacro works
21:17amalloyof course. in the first, instr is the symbol NIL, and in the other it's the value of NIL in your namespace
21:18amalloyyou want the symbol, not the value, so what happens when you eval a record shouldn't be relevant to you
21:18jamiiamalloy: Right. Except I am actually using eval at runtime.... :)
21:19jamiiamalloy: Ok, so what I'm actually trying to probably do doesn't make much sense and I'm not at all blocked on this. I'm just trying to verify that the eval behaviour is wrong.
21:19amalloylooks wrong to me
21:19jamiiamalloy: ok
21:19jamiiSo I'm sane
21:19jamiiHuzzah
21:20jamiiamalloy: the code that ran into this was (eval `(fn [registers#] (run ~(vary-meta form assoc :tag (class form)) registers#)))
21:20jamiiamalloy: Since I have to run those instructions a couple of thousand times I was wondering if it would be faster to replace them by a clojure where the dispatch was already known
21:21jamiiamalloy: But it doesn't work because the zero-arg instructions eval to {} in the above
21:21Sgeoo.O eval is broken?
21:21jamiiSgeo: I think so? Records should probably eval to themselves
21:24jamiiAha - http://dev.clojure.org/jira/browse/CLJ-1093
21:25jamiiWorkaround - (eval (assoc NIL :dummy nil))
21:34wingyis it possible to use clojure to make android apps?
21:35RaynesYes.
21:36Rayneshttps://github.com/alexander-yakushev/lein-droid
21:36wingythx
21:47tbaldridgeso, I'm trying to install the clojure-starter-kit for emacs 24.2 on osx (in terminal mode)
21:47tbaldridgefor some reason it's not doing anything at all
21:47tbaldridgeI'm doing this: https://github.com/technomancy/clojure-mode/blob/master/README.md
21:48tbaldridgebut emacs complains that "clojure-mode is not available for install"
21:48tbaldridgeany ideas?
21:52tbaldridgeso for the logs...aparently it's M-x package-install starter-kit
22:39SgeoOh hey, Clojure Conj is in NYC?
22:40SgeoOh, it differs every year. Darn.
22:42TimMcHas it ever been in NYC?
22:44amalloyno
22:44TimMcThat's what I thought.
22:45SgeoHmm, what is http://www.meetup.com/Clojure-NYC/events/16166984/
22:54ToBeReplacedwhat does "Core was generated by `java -client -XX:+TieredCompilation -Xbootclasspath/a:/home/ToBeReplaced/.lein/'" mean?
22:55TimMcSgeo: "NYC Clojure Users Group" - "Clojure Conj 2011 Roundup"
22:55TimMcDeviously misleading title, I'll agree.
22:56SgeoOh.
22:56SgeoWell, hey, at least I learned there's an NYC Clojure users group
22:56SgeoWonder if I should try going