#clojure logs

2013-08-15

01:17ed_gis it possible to pass a dynamic variable into an agent's context?
01:17technomancyed_g: you can send it a bound-fn
01:20ed_gdoes that mean send-off a lambda which has a copy of the dynamic variable?
01:20ztellmaned_g: I'm pretty sure that's the default behavior
01:24technomancyoh yeah; I'm thinking of the 1.2 behaviour
01:24callenother than Incanter, what's a respectable analogue to NumPy for clojure? Ideally equally as performant or better.
01:25callenI'm aware of ztellman's mad scientist oeurve although I can't be sure if any of it is applicable.
01:25ztellmancore.matrix seems promising
01:25ztellmannot sure how completely realized it is
01:25callenztellman: thanks :)
03:34H4nshow do i synchronously access the body of a request in a POST handler in http-kit? the documentation says it conforms to the ring spec, but i'm lost in the documentation.
03:37H4nsseems that i need to have a json middleware like ring-json
04:55H4nsis there a function that gives me a count of elements in a seq that satisfy some predicate (i.e. count-if)?
04:56Raynes(count (filter ...))
04:56TEttinger,(count (filter pos? ["darn you" "Raynes" 11 -1]))
04:56clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number>
04:57RaynesH4ns: This won't make two passes because filter returns a lazy seq.
04:58H4nsRaynes: ah, nice. thanks!
05:27H4nswhat's an idiomatic way to call a function for number of elements from a seq and return the results? (the-fn + [1 2 3 4]) => (3 7)
05:27supersymreduce
05:28H4nsthanks
05:29H4nserm, well, reduce always takes one element. i'll probably have to use group
05:31supersym,(map #(reduce + %) (partition 2 [1 2 3 4 5]))
05:31clojurebot(3 7)
05:31H4nsah, partition! thanks!
05:31supersym:)
05:36TEttingerH4ns, reduce is fantastically flexible. you can see some things on clojuredocs that use reduce with a function that takes a vector and an item from the collection you pass it... really potent stuff
05:37TEttingererr, it was somewhere else, but http://clojuredocs.org/clojure_core/clojure.core/reduce
05:42TEttingerah, it may have been here http://www.learningclojure.com/2010/08/reduce-not-scary.html
05:52supersymTEttinger: yeah... I seemed to keep getting confused by it first
05:53supersymthis is my first lisp :P
05:53TEttingerme too
05:53TEttingerand it's the way I think now
05:53TEttingermaybe always has been
05:53supersymyeah once you get it you get it :P
05:53TEttingerI remember programming in lua with tons of functions getting passed around, before I knew clojure
05:54TEttingerlisp is just... cleaner
05:54supersymgod... I used to have awesome as my wm before xmonad
05:54TEttingerlua's great though
05:54supersymI remember it exceptionally well for killing my desktop on the slightest typo
05:54supersymyeah
05:55supersymI know.... really powerful embedded scripting/extensions using tables
05:56TEttingerluajit is a masterpiece of compiler tech and easy to use. there was a project called Vortex to add lisp and F# features to lua and have it compile to LuaJIT dialect lua
05:56supersymoh ok :)
05:57supersymI never really tried F#, once I reached that stage in my visual studio adventures, I decided to dump windows for linux
05:57TEttingerI haven't seen much difference in my productivity on windows or linux
05:57TEttingerhttp://quaker66.github.io/vortex/
05:58TEttingerbut a significant amount of my work is with windows-only multimedia stuff
05:59supersymwell productivity, maybe, I was pretty damn at home in VS2010 and that was a really nice (12.000 dollar) tool
05:59supersymbut I was tired of all the bloat, the background automated enabling of services, the malware
06:01supersymtbh tho: stuff like git etc isn't the same in windows
06:01supersymand powershell really sucks once you mastered zsh :)
06:06arcatanugh. i'm not slacking off, i'm waiting for git to checkout my branch on windows.
06:58H4nsis there a way to limit the amount of data that nrepl prints? i'm dealing with large structures which take too long to print in emacs.
07:00hugodH4ns: *print-length* might help
07:01H4nshugod: thanks, that was precisely what i wanted to have :)
07:06H4nserm, only that it does not work :(
08:00H4nsis defstruct gone from clojure? i have stuart halloway's book from 2009 which mentions it, but i can't see it on the cheat sheet.
08:04jkkramerH4ns: it's deprecated in favor of defrecord
08:08H4nsjkkramer: and i should not be scared by the "alpha" label that it has?
08:09shafireHi
08:09shafireCan I prove clojure programs?
08:10jkkramerH4ns: no need to be scared. it's not going anywhere
08:14Anderkent[away]H4ns: it's not going anywhere but it might not work perfectly with dynamic development (lots of code reloading in a repl tends to mess with compiled types like records/protocols)
08:14H4nsokay, i guess i'll just stick with maps and be done with it.
08:14jkkramerit's often a good idea to put your records and protocols in their own ns to avoid such issues
08:15jkkrameryeah, maps are good unless you have a specific need for records
08:30hugodH4ns: looks like nrepl isn't printing the result within the session bindings - possibly a bug in nrepl
08:41hugodH4ns: (set! *print-length* 10) should work
08:42hugodthere is also *print-level*, which depending on your data structure, could help
08:42ro_sthugod: are you aware of any way to stop the pprinter from including commas in its output?
08:42ro_stso annoying when using CuCxCe in emacs and getting commas back
08:42hugodro_st: not that I am aware of
08:42ro_stalso, an aside: thanks for crtierium! awesome lib
08:43ro_stcriterium, too -grin-
08:43hugodglad you find it useful
08:43H4nshugod: that seems to work, thanks! i don't quite know what stopped it from working when i tried before.
08:45hugodH4ns: it seems a bit subtle - using `binding` of course doesn't work to set it, as the printing is done outside of the scope of the `binding` form, and alter-var-root doesn't work, as it has a thread-local value, which is what set! modifies
08:47H4nshugod: is there a good place to put such initialization so that it modifies the right values for the nrepl repl, for all projects?
08:49Anderkenti think if you have a file "user.clj" on your classpath it will be executed whenever your repl starts
08:49Anderkentbut if you only want it for repls started by your editor I think the editor must do the work
08:50H4nsAnderkent: i see, thanks.
08:50hugodH4ns: There is also the :init option you should be able to set in your leiningen user profile https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L148
08:50`cbpH4ns: you can set :global-vars on your project.clj
08:51hugod`cbp: not sure that will work with thread locally bound vars, but worth a try
08:53tcrayfordis there a decent clojure testing library with completely parallel testing?
08:53tcrayfordI realized recently that literally none of my tests touch any shared globabl resources anymore, so I'd like to run everything in parallel for performance
08:54tcrayford(alternatively if there's a clojure.test plugin that does parallel testing, that'd be fine too)
09:10hugod`cbp, H4ns: :global-vars seems to do the job nicely
09:12H4nshugod/`cbp: thanks, done :)
09:15hugodro_st: you could define your own print-method for IPersistentMap that called a modified print-map
09:38bdeshamI'm trying to generate a matrix where the i,j element is the result of (f i j). Is there a more idiomatic way than <https://gist.github.com/bdesham/6240709&gt;?
09:39ro_st,(map + [1 2 3] [4 5 6])
09:39clojurebot(5 7 9)
09:41chouserbdesham: that's pretty common. See also clojure.math.combinatorics/cartesian-product
09:42bdeshamchouser: ok, thanks
09:48ro_stto call a js method in the global scope from cljs would be (.it js/window) right?
09:49ro_stne'ermind.
09:56gvickersI am working on a project that requires the ability to dynamically load jars and execute them in their own thread. Conceptually, I am having a hard time figuring out the best way to load the namespace and call the functions. Anyone work on something similiar?
09:57chousergvickers: dynamically loading jars is rather a pain. Generally it means manipulating the Java classpath. You might look at pomegranate
10:02mdrogalisgvickers & chouser: I can second that it's quite a headache.
10:04pandeiroanybody know if lein is broken for glibc 2.18?
10:04pandeirohttp://sprunge.us/SCOa
10:04shafireCan I prove clojure programs on correctness? (mh, how to say that)
10:04ro_stlike you would with Haskell?
10:05ro_sti don't think so, because Clojure isn't a pure language
10:17pandeirok my problem is not lein-specific; having to rebuild openjdk due to a gcc/glibc upgrade
10:18nDuffshafire: ...only if you're willing to make a bunch of assumptions. You can certainly have a subset of the program that uses only pure functions, and use formal reasoning around that.
10:19H4nshow can i create a map from a & rest parameter? i want to merge any extra keyword arguments supplied to a function with another map.
10:19H4ns(into map rest) gives me IllegalArgumentException Don't know how to create ISeq from: clojure.lang.Keyword clojure.lang.RT.seqFrom
10:19mdrogalisH4ns: Can I see an example of input/output that you want?
10:20fredyr,(merge {:a 1 :b 2 :c 3} {:b 9 :d 4})
10:20clojurebot{:d 4, :a 1, :c 3, :b 9}
10:20H4ns,(let [[& rest] [:a 1 :b 2]] (into {} rest))
10:20chouserH4ns: (into map (apply array-map rest))
10:20clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
10:20fredyrH4ns: merge might do the trick?
10:20shafirenDuff: ro_st: thanks
10:21H4nschouser: thanks!
10:21mdrogalis,(apply hash-map [:a 1 :b 2])
10:21clojurebot{:a 1, :b 2}
10:21mdrogalisThat sort of thing?
10:22H4nsright
10:22chouserthe problem was that into turns its second arg (rest) into a seq and calls conj on each
10:22chouserSo you were getting (conj map some-key) and then (conj map some-val), etc.
10:23chouserbut conj on a map requires a key-value pair, that is a mapentry or 2-element vector
10:23chouserhence the error
10:23H4nsok. probably requires some more practice to deduce that from the message :)
10:25chouserWell, the error message told you it wanted a seqable (ISeq) but you were giving it a keyword
10:26H4nsi'm not saying that the message is bad, i'm just too inexperienced to draw the right conclusions from it.
10:27FoxboronH4ns: the biggest challange IMO is the clojure errors. Once you get over that, it's is not that bad
10:27H4nsFoxboron: coming from common lisp, i find the stack traces a bit lacking :)
10:28FoxboronH4ns: go blame java :3
10:28H4nsFoxboron: but there is a lot good in exchange, so i'm not complaining.
10:32chouserif you looked at the trace you'd see it was conj complaining about that.
10:32chouserSo yes, I agree the errors could be a lot better. Also, the errors are currently quite useful if you learn how to use them.
10:34Foxboronchouser: yeah, as i said. It is a little learning curve. Not quite there myself
10:37mdrogalisEeek. Why are conferences so expensive?
10:38mdrogalisNot even programming-related. Just in general, for any field.
10:38ro_stask puredanger. he should know :-)
10:38Ember-because those conferences need to cover their expenses?
10:39mdrogalisIt's naive, but I'll ask it anyway. Aside from venue, what are their expenses?
10:40tbaldrid_mdrogalis: and remember, these are fairly small conferences ~350 people, I'd imagine they'd get cheaper if the numbers got higher
10:40nDuffmdrogalis: venue is the really, really big one -- but there's also speakers.
10:40chousermdrogalis: I think the venue and food (even snacks) are more expensive than you might think. Then they also cover travel and lodging for the speakers, who are otherwise donating their time to produce the talks.
10:40ro_stcatering. some confs pay a stipend to speakers. not sure what goes into getting discounted hotels either
10:40nDuffmdrogalis: ...venues are more expensive than you'd think, though. They charge through the nose for things like box lunches, coffee, &c.
10:41mdrogalisHeh, I had no idea.
10:41mdrogalisYeah, I just noticed it's consistently really expensive across a few different engineering and academic fields.
10:41chouserThe conj and strange loop don't pay the speakers beyond travel and lodging. (except maybe the keynote speakers? not sure about them)
10:46Mudgehello
10:53NiKo`hi people
10:53NiKo`trying to use leiningen on osx but it's painfully slow
10:53NiKo`google doesn't bring much help about this :/
10:54NiKo`I'm using stock jvm provided by osx and a fresh installation of lein through brew
10:54NiKo`hints?
10:55NiKo`(slow == lein help 46,84s user 1,73s system 262% cpu 18,517 total)
10:57timvisherso repl development may have finally hit me last night as far as why anyone would do it. it's the same reason one might use a shell over `M-!` and it's ilk in that you have automatic records of the development of your function as it grows and if you make a mistake you just go back a definition and start again without having to muck about with undo/redo.
10:57timvishernow i don't think it would be too hard to have every form i send to the repl via `C-x C-e` or it's ilk be also displayed in the repl. i feel like someone was already doing work along these lines though. is that the case?
10:58Rubixis there a dead-simple way to ramrod a pojo into a clojure map such that each key is a string representation of the declared data member ?
10:59timvisherRubi: I think you're thinking of http://clojuredocs.org/clojure_core/clojure.core/bean
10:59timvisher?
10:59timvisherRubix: ^^
10:59timvisherwith a bit of help if you really want the string keys
11:00Rubixtimvisher: that would be exactly what I want
11:00Rubixoh, snap, is that my n00b showing?
11:00timvisheralso note https://github.com/clojure/java.data
11:00timvisher
11:01`cbp`I had to google pojo
11:01Rubixcbp: it sounds dirty to me
11:01`cbpit sounds like chicken in spanish
11:02timvisher`cbp`: i take you're not from a jvm background? or has it just been that blissfully long since you've been paid to write Java? :)
11:02Rubix"spanish chicken" could be dirty too
11:04`cbptimvisher: java was actually my first language but i've never been paid for writing it. I'm mostly a php guy :(. I do get paid to write clojure though in a way.
11:04timvisher`cbp: that's awesome. i had that for about 11 months. it twas a blissful time. :)
11:05timvishernot the php part. i'm enough a snob i suppose to turn my nose up that
11:05timvisheralthough i have been paid to write it. lol
11:06jtoyhi chunfeng
11:06chunfenghi
11:14mdrogalisjtoy: Everytime I see you on IRC, I think "Man I should read that neuroscience book he recommended" Someday it will happen.
11:16jtoymdrogalis: which one?, i've read and recommend a bunch :)
11:16mdrogalisjtoy: I'll look it up in my favorited tweets when the time is right. Can't even remember, ha.
11:17pandeirodo i need to install elasticsearch manually to use the http api with elastisch? anybody know?
11:19schmirpandeiro: I'm also using elastisch with elasticsearch. but I don't quite understand your question.
11:20pandeiroschmir: i am just running thru the getting started guide but it's not clear if elastisch installs elasticsearch or not
11:20GeneralMaximushow does one get rid of those autocomplete frames that Emacs pops up at the bottom of the screen?
11:20schmirpandeiro: elastisch does not install elasticsearch
11:20pandeiroand when i try to run the initial examples, i get a Connection refused, so i assume the server is not running
11:22schmirpandeiro: right. you need to start an elasticsearch instance. but that's quite easy
11:24pandeiroschmir: yeah almost got it
11:30pandeirohuh, doesn't seem to be running
11:31sharmsI have a failing test which I would like to take a look at in a repl
11:31sharmsdo I just do 'lein repl' then paste it all in, or is there a shortcut to have it load the same code it would load during 'lein test'
11:34supersymhttp://richhickey.github.io/clojure/clojure.test-api.html#clojure.test/run-tests
11:34supersym@sharms
11:35bbloomhmm what's that clojurebot prompt?
11:35bbloom~github
11:35clojurebothttp://github.com/richhickey/clojure/tree/master
11:35bbloom~richhickey
11:35clojurebotTitim gan éirí ort.
11:36bbloom~github
11:36clojurebotgithub is http://github.com/clojure/clojure
11:36bbloomclearly that one
11:36supersymbbloom: I wanted to say a thank-you for backtick...having a blast learning all about quoting :)
11:37bbloomsupersym: you're welcome! glad you like it
11:40`cbpGeneralMaximus: I think it doesnt do that if there's _something_ after what you're autocompleting. Like a newline
11:41ambrosebstype checking DOM manipulations with core.typed https://github.com/clojure/core.typed/blob/master/src/test/cljs/cljs/core/typed/test/dom.cljs
11:42GeneralMaximus`cbp: it is usually very intelligent. e.g, if i type "reduc" and hit tab, it pops up a frame with everything starting with those letters. if i go back and delete those letters, it hides the frame. but i have been stuck with that frame on several occasions.
11:42GeneralMaximus`cbp: in that case, i have to switch focus to that frame, delete it, and come back to the frame i was in
11:43GeneralMaximus(or is it called a window? sorry, my memory of Emacs terminology is sketchy.)
11:45`cbpGeneralMaximus: sorry i misunderstood your question. My autocomplete shows the completions automatically but sometimes it inserts like 20 newlines at the end of the file (or nrepl buffer) but doesnt seem to do that when theres something after what it's autocompleting. You can hide the completions with C-g
11:46GeneralMaximus`cbp: when i do C-g, it just beeps and says "Quit" in the minibuffer. doesn't actually close the window.
11:46GeneralMaximus`cbp: putting a space after what it's completing does get rid of the window, thought.
11:46GeneralMaximus*though
11:47`cbpGeneralMaximus: you can try looking at other people's autocomplete configuration. Emacs live has a good default for one
11:48GeneralMaximus`cbp: i will do that. thanks.
11:53supersymhuh... what is this tho, found a macro with final argument [s s′] but the quote isn't a backtick or normal quote
11:54supersymas in: (list 'defmacro s′ (str s) ... but here in irc it shows as a regular quote, hmmm. Anyone know what it does, the suffix quoting?
11:56mtpit shows up as a unicode PRIME
11:56mtpfor me
11:56mtpcodepoint #x2032
11:56supersymthnx
11:57`cbp´
11:57`cbp:-O
11:57learner__hi, in Clojure when on REPL, how can I see all global variables and their values (like *warn-on-reflection*) ? thanks for your time
11:57supersymyeah I don't think my keyboard has it
11:59supersymah, the same sign as in minutes, seconds etc... right now I remember thats a different one
12:01`cbplearner__: I guess you could use something like (clojure.repl/apropos #"\*.*\*")
12:02`cbplearner__: If you meant dynamic vars because otherwise every var is global.
12:03learner__`cbp: Thanks. I want to know the every single global variable and it's value
12:04seangroveIs storing code in database normal? I remember someone doing something like that in php with eval, and thinking it seemed an abomination, but maybe I'm just not open-minded enough.
12:04supersymseangrove: I don't find it normal
12:05supersymthough I see floating around sometimes, I've never found it a particularly attractive idea
12:05supersymanyway, clojure code=data, often you find yourself not needed a database at all
12:06dnolenbhauman: btw, that partition thing from yesterday looked good :)
12:07dnolenbhauman: I don't know if you saw but I said I'd be very surprised if making tons of channels and wiring them together was a performance problem.
12:08bhaumandnolen: the partition thing is working great cleans so many things up.
12:08dnolenbhauman: awesome
12:09bhaumandnolen: many channels may-not= bad performance. got it.
12:09`cbppostgresql has stored procedures which can run faster than client code
12:10`cbpnever really used them though :)
12:11supersymif you must use sql, stored procedures are wtg
12:12`cbpI guess i should be using them then :-)
12:12supersymor at least in mssql/.net they were rock solid but takes a lot of time to set up and very rigid
12:15dnolenbhauman: I also think in bigger designs it will be normal for channels and go processes to come and go, I'm doing this in my next post and it's pretty amazing IMO.
12:16bhaumandnolen: you are demonstration the creation and collection of lots of channels?
12:16supersymhmm github die for anyone else?
12:16bhaumansupersym: yep
12:16supersymaight
12:17dnolenbhauman: I'm doing it one place, hopefully easy to see how it can be applied at a larger scale.
12:18dnolenbhauman: but yes in principle you can create a process that represents some component that fires up a bunch of channels to do it's work and removes the event sources when it's done and exits, allowing all other processes to get GCed.
12:18bhaumandnolen: gotcha
12:18dnolenbhauman: for UI stuff I think this is a good pattern, just remove the sources (removeEventListener) and exit
12:20bhaumandnolen: gotcha, you are referring to while(true) go loops that don't close?
12:21eggheadbhauman: I've noticed mostly i've been using go blocks with in/out chans and rarely do I find myself using the go block to deliver the result of some computation
12:21eggheadbut it seems like that is probably the cleaner thing to do?
12:21eggheadI really liked the way bhauman did that in the dots game
12:22eggheadactually I might be mistaken, think I'm thinking about the little :draw :draw :draw :drawend pattern
12:22supersymwhats the difference between (declare foo) and (def foo)?
12:22dnolenbhauman: say a user clicks in a autocompleter field, you fire up all the channels and hook everything together, user makes a selection then tabs out, on tabout you can just remove listening on the event sources and exit the autocompleter loop
12:23bhaumanegghead: I think both are very appropriate. Think one for modifying a stream and another for creating a stream.
12:26supersymoh the dots game looks nice btw :)
12:26bhaumandnolen: nice, but in your case there is a tab event channel that acts like a switch to destroy the autocompleter?
12:26coventrysupersym: The source for declare in core.clj suggests that declare is a sequence of defs with {:declared true} as additional metadata.
12:26bhaumansupersym: thanks
12:27supersymcoventry: thank you
12:28supersymI should really check the source before asking
12:30seangrovebhauman: Enjoyed your core.async dots article!
12:30dnolenbhauman: I listen on blur which handles click elsewhere and and tab out
12:30dnolenbhauman: I've got a cool example where we need a cyclic barrier to deal w/ a browser quirk
12:30bhaumanseangrove: thanks, man :)
12:31bhaumandnolen: ^
12:31dnolenbhauman: cyclic barrier here just means a channel that waits for n other channels to write data before writing out their values in a vector
12:31dnolenbhauman: we need this because f**king browsers blur on mouse down, so we can't wait for click
12:31dnolenanyways the beautiful thing here is this is all quarantined from the actually autocompleter code
12:32dnolenall this crap is at the event layer where it belongs
12:33bbloomblur is extra broken in IE too
12:33bbloomblur events can just magically go missing sometimes
12:33bhaumandnolen: I totally commiserate about the complexity of raw events. I went down a deep rabbit whole drawing. And I'm still not at the bottom.
12:33bhauman"with the drawing" i mean
12:34dnolenbbloom: yeah I plan on doing the requisite IE compat stuff, though I'll probably cut it off at IE 7/8 for for lack of patience
12:34dnolenI expect most of the issues to be CSS, not the event stuff
12:34bbloomoh, nobody should care about 6 any more. fuck 7 too for most purposes. however, 8 has these bugs w/ blur too according to the react.js source
12:34dnolenthis has been the case w/ my other posts
12:35dnolenbbloom: I don't doubt it, my revelation here is we don't need to taint a correct process w/ this stuff
12:35dnolen"Quarantining Quirks"
12:35bbloomyes.
12:35bbloomreact does a nice job of creating a uniform event layer
12:36dnolenbbloom: cool, do they use queues as well?
12:36supersymbhauman: I was pondering some problems before really diving into cljs
12:36supersymseems like your post/game solved them quite elegantly
12:37bhaumansupersym: thanks, I am refactoring some of the examples right now to clean up a major short coming of the method used in that post
12:38bbloomdnolen: in a sense. they just have a bunch of javascript arrays that they use in queue-style and accumulate events up. they then wrap all the browser events in synthetic event objects that prevent a cross-browser interface & all the subscribe/unsubscribe stuff gets de-quirked as much as possible
12:38bbloomif github was working, i'd link you to their ascii architecture diagram
12:39bbloomit's in src/core/ReactEventEmitter.js
12:39dnolenbbloom: and this architecture is cleanly exposed to users who want to adopt the pattern?
12:40dnolenbbloom: one thing I'm seeing is that I rarely want subscribe/unsubscribe nor my early usage of `multiplex`
12:40bbloomdnolen: their dom structure / behavior stuff is relatively decoupled from their reactive stuff, but all 3 rely on an ID assignment scheme & use those IDs to maintain state external to the DOM
12:41bbloomyeah subscribe/unsubscribe is always a bad plan
12:41bbloomif you use react proper, they basically garbage collect after each "frame"
12:41eggheadmultiplex, more like broadcast amirite :p
12:41bbloomthey walk the change set and unhook all event handlers for objects that are no longer in the dom
12:41bbloomthey do that in a pass after updating the dom, iirc
12:42dnolenegghead: I not convinced about how often you need broadcast either
12:42dnolenegghead: my hunch it that should be avoided nearly everytime
12:44eggheadit's interesting to turn a chan into a fan-out style chan, but I agree that it's the edge case, sometimes you want multiple people to consume the message, what would be the better alternative to broadcast in that situation?
12:45bhaumanegghead: the :draw :draw :draw :drawend pattern is not bad but it is weak in that consumers of the stream have to manage and detect each whole draw action. The consumers have to manage that state transition.
12:45bbloomi prefer to coerce events in to state
12:45bbloomthen pass state as an argument to a pure function
12:46bbloomthen diff output w/ the previous output and coerce the diff in to dom mutations :-)
12:46bbloomthat's what react does. it's pretty magical
12:46bhaumanegghead: much better to do channel of channels [ [:draw :draw :draw] [:draw :draw :draw]]
12:46bbloommagical in the life changing sense, not in the opaque confusing negative sense
12:46eggheadI'm not in love with explicit mapping/filtering of chans I've been doing with cljs stuff since I always end up being subtly bitten by consuming the message before I intend to
12:47eggheadmaybe that will pas
12:47eggheads
12:47dnolenbbloom: with the DOM mutations, how do they make that consistent, do you have to follow conventions in your template?
12:47bhaumanegghead: yeah it's hard to put the message back on the queue without creating a new one
12:48pandeirois dir no longer required into nrepl by default?
12:49tbaldridgemdrogalis: ping
12:49dnolenegghead: I think subscribe may be OK for multiple views needing to get changes from a data source, but I think worth exploring alternative designs. Maybe writing the changes N times onto a channel for N consumers is simpler?
12:50dnolenegghead: there's lots to think about and invent - exciting stuff in my opinion. I definitely recommend ditching any previous notion of architecture you may have and try lots of stuff.
12:51eggheadagreed
12:51noncomhow do i access the main class file generated by lein from a java program? i do gen-class for that namespace and I think it must be compiled to a class available from java.. but i am a little confused, there are "core$_main.class" and "core$loading__4910__auto__.class" and "core__init.class" and "core.class" ... which one do i pick?
12:51eggheadoh hay github is back
12:52noncomand how do I call it from java anyway? what will be its java fully-qialified name?
12:53noncomoh, manifest says "Main-Class: lein_natives_test.core"
12:54noncomso it breaks java conventions and starts with a lowercase letter.. hmm
12:56eggheadnoncom: it's relatively common to just include the clj runtime and provide a java class that delegates to your clojure code
12:57eggheadls
12:57lazybotbin etc home lib lost+found opt root sbin srv tmp var
12:57eggheadoh thanks lazybot
12:57noncomegghead: is there an exception for that?
12:57noncoms/exception/example?
12:57eggheadnoncom: take a look at https://github.com/nathanmarz/cascalog/blob/develop/cascalog-core/src/java/jcascalog/Api.java for an example
12:57dnolenclojure-mode indentation is such an eyesore
12:57dnolenhttp://ragnard.github.io/2013/08/12/datomic-in-the-browser.html
12:57AnderkentI wouldn't do that unless you need to expose stuff to javaland anyway..
12:58seangrovednolen: What should it be instead?
12:58pjstadignoncom: also this https://github.com/clojure/clojure/blob/master/src/jvm/clojure/main.java
12:58noncomAnderkent: that is exactly what I need.. :)
12:58eggheadalong with https://github.com/nathanmarz/cascalog/blob/develop/cascalog-core/src/java/cascalog/Util.java#L36
12:58seangroveI wouldn't mind seeing a clj-fmt pre-commit hook tool
12:58dnolenseangrove: always 2 space, align only on binding forms and data structure literals
12:58`cbpdamn this gandalf theme from emacs live has some impossible to read colors. Does anyone have good light-colored clojure color themes? :-)
12:58Anderkentnoncom: oh, okay. I thought you were just looking to run something from a jar - java -cp <jarfile> clojure.main -m my.clojure.namespace is fine then
12:59egghead`cbp: I like http://chriskempson.github.io/base16/
12:59Anderkentnoncom: in that case https://github.com/mikera/clojure-utils/blob/master/src/main/java/mikera/cljutils/Clojure.java might be for you
12:59noncomAnderkent: for technical reasons I need to get the access to the class-file generated by lein...
13:00Anderkentoh ok
13:00Anderkentnvm then
13:00Anderkentwas wrong again :P
13:00`cbpegghead: :-)
13:01bhaumandnolen: we should throw some comments on that post eh?
13:02Anderkentdnolen: I don't see anything wrong with that indentation. Aligning call args is the right thing to do.. You can still put a newline right after fn name if it takes you too far right I guess
13:03dnolenAnderkent: I'm sorry it's an abomination plain and simple. My opinion of course.
13:05llasramIsn't it just the traditional way one idents Lisps?
13:05Anderkentso you'd do (f 2 3\n<indent>4 5) ? That's... surprising. For me the intiution of vectors with all members equal and lists with the first member priviledged (i.e skipped for alignment purposes) seems most natural
13:06dnolenllasram: no, this ugliness is a Clojure community innnovation
13:07Anderkentthe main thing I find confusing is that some forms are special cased - defn etc.
13:07hiredmandnolen: that is not true, it is how emacs indents lisp
13:07llasramLooks to be standard for Emacs, yah: http://www.gnu.org/software/emacs/manual/html_node/emacs/Lisp-Indent.html
13:08hiredmanyou can get emacs to indent random clojure forms like you are saying by telling emacs those forms get defun style indentation
13:08hiredman(defun is not a typo there)
13:10hiredmansome scheme style guides also recommend the aligned argument style
13:11dnolenhiredman: ok maybe it is an lisp dialect innovation, it's not something I've seen much in Scheme code
13:11Anderkentwell, I guess for me what exact style you use is not that important, as long as you can produce a config that automatically aligns according to that style... Consistency over prettyness.
13:12kastermaWhy do you value consistency over readability?
13:12hiredmandnolen: when you google "scheme style guide" the first one has the aligned arguments style
13:13hiredmanhttp://community.schemewiki.org/?scheme-style also
13:13hiredmanthe only place where it is a issue, and I suspsect this is why you are so annoyed by it, is when you have forms like core.logic's fresh
13:14dnolenhiredman: yes but unsurprisingly no examples of about how catastrophically ugly it is with moderately long function names
13:14pjstadigyeah you need to have clojure-mode indent that like a defun, and you're good
13:14Anderkentdnolen: just put a new line after function name?
13:19dnolenAnderkent: then you get 1 space indent *shakes fist*. I should probably stop complaining and write an elisp defun that does what I want.
13:20hiredman(put-clojure-indent 'fresh 'defun)
13:20clojurebotGabh mo leithscéal?
13:20coventrynrepl's M-. hits the leningen jar file for clojure source code, which is a bit slow. Is there a way to point it at an uncompressed tree?
13:21hiredmanclojurebot: what are you doing?
13:21clojurebotHuh?
13:21Anderkentthe one space indent makes sense to me since it's just a list. Otherwise you get indents in (quote (1 \n 2 \n 3))
13:22Anderkentunless you make your indent scroll a compiler I don't think you can reliably distinguish between list-to-be-executed and list-that-is-just-data
13:22Anderkentso you have to indent them the same way, and the 1 space indent is less ugly :P
14:08dnolensi14: what part about the core.match preallocated exception for backtracking is confusing?
14:10bbloomdnolen: sorry for the delayed response: the way you make that consistent is that you defer all dom operations & represent even the act of creating a node as data. when you write a render function in react, you don't actually create a node. you only create a node descriptor. and then if that descriptor matches the dom, nothing happens. so in effect, by always returning a plan instead of the result of executing the plan, then the runtime
14:10bbloom can enforce consistency for you
14:10dnolenbbloom: so they have some kind of language for all the different ways you can manipulate the dom?
14:11bbloomdnolen: their JSX language is optional. it basically adds XML literals to javascript, but they parse trivially from <Parent x="5"><Child/></Parent> to something like `new dom.Parent({x: "5"}, [new Child()])`
14:12bbloombut that just creates basically a description like: {"type": "Parent", "params": {"x": 5}, "state": {}, "content": [{"type": "Child" ....
14:13dnolenbbloom: yes so they fiddle with that, but how do they handle all the different kinds of dom manip you might do?
14:13dnolenappend, prepend, change attribute, HTMLFragment, etc
14:13dnolenbbloom: or do they try to abstract that away?
14:13bbloomyou don't do any of that nonsense :-)
14:14bbloomso there are two answers:
14:14bbloom1) you generally avoid that & instead write pure functions that return a new view. just like if you were rendering the full page server side. the runtime will make that efficient w/ memoization
14:14bbloom2) but of course you need to react to events
14:14dnolenbbloom: so do they always build DOM? behind the scenes do they do the fasting thing
14:14dnolenclone, HTMLFragment, string + innerHTML?
14:14bbloomyeah
14:14seangroveWoo, destructuring args in javascript
14:14dnolenbbloom: but not pluggable?
14:15seangroveIt's not beautiful, but a step forward, I suppose
14:15bbloomfor #2, you can call setProps on a child or whatever & that will maintain some stateful components. but all that state is processed transactionally. if you change props or state on yourself or a child, you can't observe the new props or state until the next frame
14:15bbloomall the props & state are applied in a transaction
14:15bbloomthen the recursive diffing happens
14:16dnolenbbloom: ok sounds good, but as usually I'm skeptical this covers all the cases I care about
14:16bbloomdnolen: the event system is pluggable, so you can add new event types to play with this system
14:16bbloomyou can't do jquery-like aspect-oriented things
14:16bbloomthat's the biggest limitation, which could be viewed as a feature for larger apps
14:16dnolenbbloom: yeah I don't really care if you can't eliminate the rendering mapping dilemma
14:16dnolenbbloom: would like a system that could abstract over DOM, WebGL, Canvas etc
14:16bbloomoh, they have an escape hatch
14:16bbloomyou can always request the underlying dom node
14:17bbloomand there are callbacks for when you are mounted or unmounted on to a node
14:17bbloomso you can do anything you want, but you just have to manage it yourself
14:17bbloomand you can package that behavior up in to a mixin if you want
14:17dnolenbbloom: that's good, though the point is can you reuse the architecture or not for new surfaces
14:17dnolenif not, it's the same garbage as everything else
14:18bbloomthe same *design* can be applied to other things, which is what i'm occasionally working on: getting that to work for HTML, or Canvas, or GL, or Swing, or whatever
14:18bbloombut their implementation is finely tuned for html/dom
14:21bbloomdoing this sensibly for an arbitrary backend & supporting a general notion of a "button" or other widget that is both abstract, but customizable per platform is *hard*
14:22bbloomdnolen: you can think of react's diff rendering loop as a little interpreter that's doing symbolic macro expansion and selective evaluation at runtime. hence why i'm talking to kovas about symbolic engines :-)
14:26dnolenbbloom: yeah I got that from your earlier descriptions, I just want support for multiple interpreters :)
14:28bbloomdnolen: me too :-) i started implementing it in an ad-hoc fashion, but there was a TON of boilerplate code & the interpreters were SLOW, but casual analysis showed that a lot of things can be trivially optimized
14:29tbaldridgeeric_normand: ping
14:29eric_normandtbaldridge: hey!
14:29bbloomdnolen: i found myself creating/flattening/reduce-ing large trees of s-expression encoded in vectors with keyword tags
14:29tbaldridgehey, I'm interested in the problem you mentioned on twitter. is there something we can do differently to solve your problem?
14:32eric_normandtbaldridge: I doubt it, but maybe.
14:32eric_normandtbaldridge: I converted many callbacks in our code into async channels
14:32eric_normandwith go blocks blocked listening for a message
14:33tbaldridgeeric_normand: ok, sounds reasonable
14:33eric_normandsome of the callbacks I converted were listening on chrome channels (different type of channel)
14:34eric_normandso the callback to add a message on the channel was waking up the event page
14:34eric_normandthen it would go into a loop (with setTimeouts)
14:34eric_normandlistening for the messages
14:34eric_normandso it would never sleep and took 100% CPU
14:35eric_normandafter a few days, the extension would crash
14:35eric_normandit could also be that it was creating a new go block (with infinite loop) per callback
14:35eric_normandI haven't diagnosed it that far
14:36tbaldridgeeric_normand: I assume this is the api you are using? http://developer.chrome.com/extensions/messaging.html
14:36eric_normandyes
14:37eric_normandmy conclusion was that we should not use core.async for these wakeup callbacks
14:38eric_normandand there is little other reason for core.async in the event page, since the event page is just a kind of relay between the content scripts
14:39dnoleneric_normand: huh reading the twitter convo and following this - I'm not sure I follow the reasoning.
14:39tbaldridgeeric_normand: that's the part I don't understand, something seems odd in the fact "listening for the messages" causes a infinite loop. All these apis are callback driven, so this should happen
14:39dnoleneric_normand: sounds like something you could repro in small example if it's as fundamental as you say.
14:39eric_normandeasy
14:40eric_normand(go (while true (let [x (<! c)] (.log js/console x))))
14:40eric_normandthen never put message to c
14:40eric_normanddon't even need the while loop
14:41tbaldridgeI do that exact code all the time, it shouldn't be a problem
14:41eric_normandthe problem is that the event page does not sleep
14:41eric_normandit will run forever as long as the browser is open
14:42tbaldridgeare there a large number of messages in c?
14:42eric_normandno
14:42tbaldridgeif the last reference to c is dropped, this go will be GC'd and the whole thing will go away
14:42eric_normandcorrect
14:42eric_normandbut I cannot drop the reference to c
14:43eric_normandit has to be listening for messages
14:43dnoleneric_normand: so are you saying this is Chrome Extension architecture thing, the event page must be completely restartable or something?
14:43eric_normanddnolen: yes
14:43eric_normandchrome manages the wakeup
14:43eric_normandyou register for events when you should wakeup
14:44tbaldridge"listening" in the code sample you gave above is just a callback attached to the channel. I assume you are using the stock core.async channels. i.e. you didn't re-implement the channel protocols
14:44eric_normandyes
14:44tbaldridgehow are you getting data into c?
14:45eric_normandlet me check
14:45dnoleneric_normand: I just tried you example, I see no calls to setTimeout
14:45eric_normandhmm
14:46tbaldridgeI wonder if the problem is on the putting side of c
14:46dnoleneric_normand: I've done quite a bit of basic profiling of core.async under CLJS around memory and event generation and haven't seen this issue.
14:47dnoleneric_normand: might be missing something but it's not coming up under the Chrome Timeline
14:47eric_normandok, I need to do deeper investigation
14:48dnoleneric_normand: ok there's exactly one call to MessageChannel in Chrome, no others
14:49dnoleneric_normand: we don't event use setTimeout for message sends, setTimeout only comes into play for put! and I think go block wakeup
14:49dnolentbaldridge might know a bit more
14:49eric_normandthere must have been something waking it up
14:50dnoleneric_normand: I'm assuming you can't keep state on the event page because of wakeup?
14:51eric_normanddnolen: right
14:51eric_normandwe use local storage
14:51dnoleneric_normand: ok, than it is probably the one message that screws everything up for you.
14:51eric_normandbut now I realize that we keep the channel in state
14:52eric_normandso that the callback can put the message onto the correct channel
14:52dnoleneric_normand: initially sounds like the Chrome Extension model is busted to me though - and core.async might be a bad model because event page is a dirty hack
14:52dnoleneric_normand: so yeah you create creating pages that stay awake because of one event
14:53eric_normandit looks like two problems: we keep channel around for the callback, and we don't check if the page is already loaded before initiating another channel
14:53dnoleneric_normand: right
14:53eric_normandI don't know if we can check
14:54eric_normandI basically ported all of our callbacks directly to channels
14:54eric_normandbut I failed to realize that the callbacks needed also to register themselves again
14:55eric_normandthey need to register each time the page is loaded, or it won't wake up again
14:56eric_normanddnolen: I think you're right. It's just a hack
14:56eric_normanddnolen: the script is meant to run to completion quickly and be run again later
14:56dnoleneric_normand: this is how I think it works
14:57dnoleneric_normand: they run the page expecting it to terminate, your event handler is listening on a queue
14:57dnoleneric_normand: but your code drops and event handler hanging the JS context
14:57dnolenevery event will create a new hung event page eventually crashing the browser
14:58eric_normanddnolen: agreed.
14:59potetmOkay, I have a newb question: what does the '#function-name syntax *actaully* mean?
14:59amalloy,'#'inc
14:59clojurebot(var inc)
14:59potetmIs that just clojure's way of denoting a function reference?
14:59potetm'#inc
15:00potetm,'#'inc
15:00clojurebot(var inc)
15:00potetm'#'inc
15:00eric_normanddnolen: my solution was to avoid core.async in the event page
15:00potetm,'#inc
15:00clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
15:00eric_normandpotetm: not function reference. it returns the Var
15:01dnoleneric_normand: yes, I think you're conclusion is reasonabe :)
15:01tbaldridgeeric_normand: yeah, that makes sense now.
15:01dnolens/you're/your
15:02potetmeric_normand: okay, so when I say (function-name arg1), in this context "function-name" is a symbol that refers to the var '#function-name
15:03potetmThat seems a little convoluted to me… maybe I'm missing some underlying simplicity…?
15:03dnoleneric_normand: I suspect it can be made to work, but I think you'd have to extra careful
15:04eric_normandpotetm: vars are there for interactive development
15:04eric_normanddnolen: agreed.
15:05juhu_chapaIs there a way to refer to parent namespace? i.e. (println ../somevar)
15:05eric_normandpotetm: they are an efficient way for the compiler to point to something that won't change (the var) but refers to something that will (the function)
15:05eric_normandpotetm: afk
15:06potetmeric_normand: afk? you mean afik?
15:06channelsafk is a reader macro equivalent to Away From Keyboard
15:07potetmlol
15:07potetmI wasn't sure if he actually meant it because it was directed at me personally. Thanks channels ;)
15:09callenTwitter is great today.
15:10eric_normandpotetm: sorry, just had something to attend to
15:10eric_normandpotetm: in the middle of the chat
15:10callenztellman: thanks for the laughs.
15:10ztellmanyou mean the totally reasonable solutions?
15:10potetmeric_normand: not a problem
15:12callenztellman: sure, but aphyr's reactions to the exchange were great.
15:12ztellmanyeah
15:13snake-johnHi, (let [x 2 y (- x)] (clojure.pprint/pprint ``(~y))) shows in the repl (clojure.core/seq (clojure.core/concat (clojure.core/list user/y))) . But I would have expected (clojure.core/seq (clojure.core/concat (clojure.core/list (-2)))). An anybody explain to me why the (-2) is not shown?
15:13callenztellman: I've had to write code to monkeypatch test ordering to keep coworkers from relying on stateful, specific-order hand-offs between test-cases before so I'm sympathetic to the problem.
15:13ztellmancallen: ha, I've never actually had to do that
15:13amalloysnake-john: not enough ~s
15:14callenztellman: work with more Python and Ruby programmers - and you will.
15:14ztellmanbut the tests don't run in the order they're defined in the file, right?
15:14ztellmanso how on earth can they rely on the ordering?
15:15callenztellman: people will use hacks to make it ordered
15:15callenjust google around for 'python unittest order'
15:15callenmy monkeypatch was a counter-measure.
15:15ztellmanfun
15:19gtrakugh seriously, I'm not mad at clojure for breaking changes, but ugh.
15:19gtrak1.3-1.4 was way more trivial.
15:20snake-johnamalloy: hmmh I would have thought the inner syntax quote gets run first which would yield (-2) and then the second syntax quote gets applied which would use the (-x). But this is probably not how nested quotes work
15:21ztellmangtrak: I dunno, that's a pretty flimsy invariant to rely on
15:21gtrakit's not done on purpose, but I think it ends up being transitive.
15:22gtrakI think the practice of simply copying output as the value you're testing for is the real malpractice.
15:22hammeri need to convince clojure to use one method on a java API, and not the other, one takes an Iterable<Pair<String, byte[]>>, the other takes a Map<String, byte[]>
15:22gtrakI can't go look at it later and see if the order really matters unless I wrote it.
15:22ztellmanhammer: hinting as ^Iterable or ^Map should do the trick
15:23hammerit's a both
15:23hammerPersistentArrayMap implements Iterable
15:23gfrederickshammer: yeah but you hint so it knows what to treat it as
15:24gtrakif the map instances randomized its storages, then the tests would never run correctly twice.
15:24gtrakand that's way better.
15:25gtrakinstead of acting as timebombs
15:25hammerwhere would i hint it? I've got map m, and I'm calling Foo.bar(Map<String, byte[]) from java, so I've tried (Foo/bar (^java.util.Map m))
15:25hammerbut that thinks I'm trying to call the function on m
15:25hammerArityException Wrong number of args (0) passed to: PersistentArrayMap clojure.lang.AFn.throwArity (AFn.java:437)
15:25gfrederickshammer: (Foo/bar ^java.util.Map m)
15:26cmatheson /b #e
15:26cmathesonoops
15:27hammerah awesome
15:27gfrederickscmatheson: that's a secure password because it has two special characters
15:27hammerthanks a bunch
15:28cmathesongfredericks: haha, just trying to switch channels
15:39gzmasklein uberjar just doesn't work and keeps giving me: could not find load main class error. I am pretty sure I got all the stuff right and it was working a month ago...
15:41gfredericksztellman: holy snap this potemkin
15:41ztellmangfredericks: ayup
15:42callengfredericks: I appreciate that he used the word conflate instead of complect in describing import-vars.
15:42gfredericksztellman: I keep wanting lazy maps everywhere
15:42callenI'm probably going to need potemkin soon because I have a library that is going to get hairy.
15:43ztellmangfredericks: lazy maps? maps with random key order? maps that only give you what you ask for every other time? use potemkin!
15:43ztellmanalso there's this, which I think is one of the funnier things I've written: https://github.com/ztellman/potemkin/blob/master/src/potemkin/types.clj#L37
15:43amalloyi feel like ztellman must have recently hired a PR person and handed over his twitter/irc credentials
15:43gfredericksztellman: I want to create a type which implements every interface in clojure.lang. Can potemkim help me do this?
15:43ztellmanwatches the protocol var, updates other protocols whenever it changes
15:44gfredericksperhaps defeverything?
15:44gtrakgfredericks: defclojure
15:45ztellmangfredericks; this gets you like 2/3rds of the way there: https://github.com/ztellman/potemkin/blob/master/src/potemkin/collections.clj#L21-L164
15:45ztellmanamalloy: it took me a while to find a PR firm fluent in Clojure, but it was well worth the effort
15:46ztellmangfredericks: https://github.com/ztellman/potemkin#unify-gensyms
15:49devnztellman: i just played hackey sack, sponsored by Factual
15:51ztellmanFactual is renowned as a great patron of the hackey sack
15:58noncom|2where is weavejester? haven't seen him for a while..
16:00eric_normandanybody going to play in Clojure Cup?
16:01`cbp:-O are there prizes?
16:02timvisherhas anyone heard of an effort to automitically build up var definition history in nrepl without directly interacting with the repl buffer?
16:02timvisheri.e. logging off the form that's evaled whenever one is evaled?
16:03noncom|2timvisher: no.. and what about you?
16:04timvishernoncom|2: indeed i have not. it finally hit me at the Clojadelphia's meetup last night that the reason you might want to use the REPL directly is to be able to scroll back through the intermediate definitions of a function as you're building it up
16:05timvisherit doesn't seem like it would be that hard to automatically print the evaled form in the REPL before actually evaluating it, so I thought someone else might have cooked one up already
16:05hiredmanI think that assumes a style of working that is not universal
16:05noncom|2timvisher: oh, i think that's what ccw does
16:05timvisherhiredman: ?
16:05timvishernoncom|2: that might be what i'm thinking of
16:06hiredmantimvisher: I generally don't build functions in the repl
16:06noncom|2but personally i use ctrl+up to wind the buffer and find a particular memory from the past
16:06timvisheri also thought that hugo duncan might have mentioned something in his nrepl talk
16:06hiredmanif I have a little expression or something I will build that up in the repl
16:06travisrodmanivaraasen: thanks for sharing your code example the other day, about how you consume the clojure code in java. it was in regards to the data importer. very helpful. thanks
16:06hiredmanbut often I start with (defn f [] ...) in a file, eval the whole file, call (f) in the repl
16:06timvisherhiredman: you're describing how i work, i believe
16:07eric_normandfrom the home page and the judges, clojure cup will be a game project
16:07noncom|2hiderman: timvisher: you all say this coz you no use lighttable yet
16:07timvisheryou don't just type (f) directly into the file, perhaps in a comment form, and eval it?
16:07hiredmanI extremely rarely type a form (defn …) in to the repl
16:07timvishernoncom|2: :)
16:08hiredmantimvisher: sure, I've done that too
16:08noncom|2i do defns in repl when i figure out how to construct that or another sequence of collection-operating àòû
16:08timvisherregardless, i realized last night that what that looses is the intermediate steps of building up my function
16:08hiredmantimvisher: but my point is, in that style a history of vars in the repl doesn't seem useful
16:09noncom|2that never exceeds oneliners though
16:09timvisherit seems like more people than not in the clojure community use the repl directly and then copy fully defed vars into their source file
16:09hiredmantimvisher: if you are reloading a hole file, how does your history thing work?
16:09timvisheri don't like that because my repl buffer is not 'savable'
16:10bbloomtimvisher: i think most of us write in to source files directly & then use a key combination to send forms to the repl
16:10timvisherhiredman: i'd assume that if a function definition hasn't changed it would not reprint
16:10timvisherbbloom: interesting. maybe i've just gotten an incorrect impression then. :)
16:10hiredman*shrug*
16:10noncom|2timvisher: usually it does reprint, since the other way requires more analysis
16:10hiredmanI am not advocating for something, or saying one thing is more common than another
16:11timvishernoncom|2: in ccw? i would be annoyed by that i think.
16:11hiredmanI am saying there are assumptions there that aren't universal
16:11timvisherhiredman: i'm assuming there would be a configuration option with that
16:11noncom|2timvisher: anyway, tell us what is your vision of the future?
16:11hiredmanso go a head and do whatever, just don't be surprised if no one cares :)
16:12chronnotimvisher: nrepl-send-to-repl in https://gist.github.com/kingtim/4349847 although I haven't tried it.
16:12timvisherso if you don't want your repl buffer filling up with intermediate definitions then you wouldn't turn the feature on
16:12timvisherchronno: interesting!
16:12timvisherhiredman: duly noted. :\
16:13timvishernoncom|2: vision is that curretly as i'm building up a form, i have to rely on undo to back off from a bad set of changes to a good state
16:14noncom|2timvisher: so, per-form history you want?
16:14timvisherif you think of the REPL as a shell, and your function as a complex set of piped together commands, then it would be like piping on 2 new commands, executing it, and realizing you screwed up, and not being able to press ↑ and try again
16:14timvisherinstead, you have to press your undo key a bunch of times, remembering what the form looked like before, and hope that you don't go to far
16:15hiredmantimvisher: what repl are you using that doesn't have history?
16:15noncom|2yes it is so currently
16:15timvisherso the vision would be that i can always go to the repl buffer and look through the history of things that i evaled, in order, and pick up where i left off
16:15noncom|2timvisher: i think you can device this repl youself?
16:16noncom|2in elisp or swing? depends on your preference..
16:16hiredmantimvisher: you just want to save the history?
16:16timvisherhiredman: nrepl.el does not do this by default (or in any configurable was afaict)
16:16noncom|2timvisher: once i made such an app. it was in java and for shell commands though. it was an easy task
16:16timvisherif i'm interacting with the repl directly it does, but i prefer to edit source files for basically any kind of editing, even if that's just exploratory
16:16hiredmanbecause for example, in nrepl.el M-p will give you the previously eval'ed code
16:17llasramtimvisher: Er, nrepl-history-size etc ?
16:17timvisherhiredman: do you have a source file open?
16:17timvisherif you do, type `(+ 1 1) C-x C-e` and then switch to the nrepl buffer and press `M-p`
16:17hiredmanI have many, in emacs buffers locally and remotelly
16:17timvisher`(+ 1 1)` does not show up for me
16:18timvisheronly what i actually have typed in the repl buffer is in that history
16:18hiredmansure
16:18timvisherhiredman: so that's the feature i'm talking about desiring. :)
16:18hiredmanand what do you want to happen when I hit C-c C-k and then M-p in the repl
16:19timvisherwhat does `C-c C-k` do?
16:19hiredmanloads the whole file
16:19timvisherinterestingly, it loads the buffer
16:19timvisherC-c C-l will load the file, but that's beside the point
16:19timvisheri would want to have only vars whose definitions have changed appear in the repl
16:20timvisherbut if it was too hard, i'd probably be ok with all the forms being printed as they are evaled
16:20llasramPerhaps you may be interested in inferior-lisp-mode?
16:20timvisherllasram: is this how inferior lisp works?
16:20timvisheri only used that briefly way back in the day and then moved onto slime
16:20timvisheri wouldn't want to miss all of nrepl's features just to get history
16:21llasramWell, then pick and or fork your poison :-)
16:21llasraminferior-lisp just has a process which you can pump forms to
16:21timvisherthat's what it's sounding like i'll have to do
16:22llasramSo they're all in history, but you can't ask the process anything (like get docstrings) etc
16:22timvisherllasram: yep. that's what i'm looking for but with all of the other nrepl goodness. :)
16:22timvisherthis would _definitely_ not be worth the tradeoff of loosing the rest of nrepl
16:22timvisherit's more of an expriment too
16:23timvisheri'm pretty happy with my current dev flow, i just finally realized why some people might develop at the repl rather than in their source files
16:23timvisherand it seems like it would be a good experiment to run
16:25`cbpAm I the only one that goes to the last paren of an expression then does C-x C-e? I feel like I should be able to C-c C-c inside the body like with common lisp :(
16:26technomancy`cbp: C-M-x
16:26eric_normand`cbp: I C-c C-c
16:28`cbpoh what the heck i swear i couldnt do c-c c-c before. Also i didnt know about C-M-x
16:29coventryC-u C-M-x is awfully useful for stepping through elisp.
16:29gtrak`cbp: huh, I still do it that way. thanks for the tip.
16:29`cbpmust have been used to an old version of nrepl
16:31gtrakI can neither do c-c c-c nor C-M x
16:31gtrakKDE grabs it I guess
16:32gtrakC-M anything seems not right
16:34gtrakah, my repl itself is hosed
16:38callenjust a reminder to everybody
16:38callenJava's SecureRandom is not secure, nor is any userland CSPRNG
16:38callenI just got done putting in a PR to weavejester's crypto-random to fix it.
16:40ivancallen: why not any userland CSPRNG?
16:41gtrakcallen: this wrecks my plans for a SecureRandomPersistentHashMap
16:41ivancallen: also Windows does not have /dev/urandom
16:41callenivan: CryptGenRandom for best-effort on Windows.
16:41callenbut CryptGenRandom has dubious-at-best entropy sources. Do not run things that need to be secure on Windows.
16:41callendon't use SecureRandom on Unix at the very least.
16:42callenor don't use SecureRandom with the expectation of cryptographically secure random bytes.
16:42callenivan: you cannot implement a cryptographically secure PRNG in userland.
16:42callenyou must use the kernel API.
16:42ivanwhy not
16:46callenivan: I can't tell if you're asking for a white paper or you want to discuss cryptography system implementation.
16:46ivancallen: I just need a summary of why it's impossible, or some citation
16:46ivanis it because timing attacks due to scheduling?
16:47callenthat's one of the reasons
16:49callenthere might be, in some perfect universe, a way to implement a secure CSPRNG in userland, but that never happens. So stop using them.
16:49callen or implementing them. Because you'll fuck up.
16:50gzmaskanyone use core.typed? how would you use it?
16:50ivanclaiming that something is impossible requires stronger support than that
16:51callenivan: it's a pretty standard understanding of CSPRNG
16:51technomancyivan: what have you got against arguments from authority bro?
16:51callentechnomancy: security is too fragile for amateur hour "good enough"
16:52callentechnomancy: particularly when secure options exist. it's stupid and unnecessary.
16:52xicubedi once interviewed at a lottery company, they had a server room with some radioactive substance who's decay provided the random seed...
16:52callenIt also requires a lot of background to really be able to do anything without deeply fucking up.
16:52technomancycallen: of course. that doesn't mean you can't back up your claims.
16:53callentechnomancy: I'm not really in the mood to go white paper hunting, I was scrambling to fix crypto-random and put the word out.
16:53callenanother problem with security is that there's a lot of out-of-date/wrong information that still comes up via Google
16:54callenlike OWASP's out of date recommendation to use SecureRandom without specifying impl.
16:55seangrovecallen: People are basically good.
16:55seangroveJust use a dialog to ask them if they agree to be good people, and don't bother with security
16:56callenseangrove: cute. Did you see http://amber-lang.net/ ?
16:56seangroveYeah, remember seeing this awhile ago, looks really great. Never got as far into smalltalk as I would have liked
16:57callenseangrove: I was actually thinking about a hybrid of that plus client-side (only) datomic with CLJS source maps
16:57callenvisually exploring your data and each object's history.
16:58seangroveWhat do you mean client-side only datomic - no datomic server?
16:58gzmaskanyone has experience with core.typed? does it type check on lein run or do you have to run some function in repl to type check?
16:58ivanheh "This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRandom using the default constructor. This will provide an instance of the most cryptographically strong provider available" https://developer.android.com/reference/java/security/SecureRandom.html
16:58callenivan: not actually true :\
16:59callenand like I said, there is out of date information out there.
16:59callensince I'm the only one that tracks security issues: http://android-developers.blogspot.com/2013/08/some-securerandom-thoughts.html
16:59callenthe Android bitcoin client was broken because of faults in SecureRandom's implementation.
16:59callenthe bitcoin client itself was not at fault.
17:00callenivan: satisfied?
17:02gzmaskhas anyone use core.typed before? does it do type checking during repl-function-calls or runtime?
17:04llasramgzmask: It's not widely used (yet?). The project-creator ambrosebs is frequently around this channel, but apparently not at the moment
17:05gzmaskllasram: hrmm, thanks... I kinda assume anthing has a core. prefix is wildly hip
17:05supersymgzmask: https://github.com/clojure/core.typed/wiki/User-Guide
17:06bbloomgzmask: type checking w/ core.typed is explicitly invoked
17:06supersymassertion seems to take place at the REPL
17:06supersymas well
17:08bbloomyeah, via calling cf (check form) or check-ns
17:09TimMccallen: So what's actually wrong with SecureRandom? I see something about "improper initialization", but no details.
17:10TimMcThe vague impression I've got is that it's not so much Java that's at fault, but the native code Java is calling into on Android.
17:10Raynestpope: Can I make vim-fireplace not try to start up a repl automatically?
17:10RaynesIt takes forever to load files in projects where `lein repl` fails because of it.
17:10RaynesBecause it tries every time.
17:11callenTimMc: Android's SecureRandom impl wasn't compliant. I don't think OpenJDK's was either.
17:11hiredmanwell, that is you call the runtime system on android "java"
17:11hiredmanif
17:12TimMccallen: :-(
17:13callenTimMc: I believe it had to do with the entropy sources used in the creation on the initialized seed. I could be wrong on that point.
17:14callenI'm trying to figure out a wrapper for enforcing the use of "/dev/urandom" || CryptGenRandom right now
17:15TimMcI was hoping this was just limited to Android.
17:16ivanwrapping /dev/urandom with some kind of buffer is a good idea if you don't want to pay a huge performance penalty
17:16TimMcDepends on the system, no?
17:16ivanwell, you can only open /dev/urandom, read, close, a few thousand times per second
17:17TimMcOh, I see.
17:17TimMcThere's also an issue where on a *few* systems, /dev/urandom will block until it has more of the good stuff (juiced entropy from system timings.)
17:18callenthat's sorta the point
17:18callenyou can stuff lower quality entropy in if you want, but you should stop pretending it's secure then.
17:19callenthe stuff that is supposed to be secure should stay so, and if you have some service or "thing" generating a ton of securely random bytes, it's time to get specialty hardware to provide extra entropy.
17:21TimMc/dev/random is the one that's supposed to block, right?
17:21callenyeap.
18:00justin_smithI wonder if anyone has used a shortwave radio on a adc to generate entropy
18:01justin_smithhttps://github.com/pwarren/rtl-entropy
18:02justin_smiththey have a todo to add entropy to the system pool
18:03callenjustin_smith: I know a good person to ask about that, they do work on ham radio drivers for FreeBSD
18:03justin_smithcool, it seems promising
18:03callenit's a nifty idea.
18:18justin_smithactually, lower tech, you could probably do a lot with a reverse biased zener diode connected to an adc
18:24justin_smithif I have two nrepl buffers open, how do I specify which one a given source buffer is connected to?
18:27`cbpwhy not just multiple emacs :-P
18:30justin_smith`cbp: that could be an option I guess, but I am doing one project that shares many properties with an older project: easier to be able to have both open in one emacs - until I deal with the "which of the repls does evaluation in this file connect to" issue
18:30justin_smithie. m-x ediff
18:30justin_smithbetween old core.clj and the new one
18:38justin_smithlooks like I need to run nrepl-connections-make-default before evaluating code that goes with that connection
18:40justin_smiththis is tied to nrepl-connection-browser
18:41justin_smithit looks like there is support for "projects" but only via nrepl-jack-in?
18:43glosoliHmm
18:49seangrovejustin_smith: You can switch to the nrepl buffer you want to be default, and then run nrepl-make-repl-connection-default
18:49seangroveI don't know if there's a per-buffer association
18:50seangrovejustin_smith: Sorry, just saw you already wrote that
18:50justin_smithno problem
18:50justin_smithdo you know anything about the "project" feature referenced here and there?
18:50justin_smiththat seems promising, but I am not seeing the big picture
18:51seangroveNo, I've been running several nrepls recently and would like something like that
19:26glosoliHow does one clear red overlay when something fails in code in Emacs Clojure Mode ?
19:38technomancyglosoli: clojure-test-mode?
19:38technomancyshould be C-c k or something?
19:39glosolitechnomancy: yeah for example I am in the file which has main method and some routes (compojure) defined, and I accidently press C-c k an it outputs some errors and adds the overlay
19:39glosoli:?
19:40technomancyyou're running clojure-test-mode on a file containing compojure routes?
19:40technomancythat's weird
19:40hiredmantechnomancy: could just be clojure-mode with compilation errors
19:41technomancyhiredman: huh; does nrepl.el emit overlays now?
19:41glosolihiredman: yeah this one
19:41hiredmanglosoli: have you fixed the errors and recompiled?
19:41hiredmantechnomancy: I dunno
19:41hiredmanI never make errors :P
19:42`cbpcough
19:43justin_smithone can walk the face overlays in an emacs buffer, find the offending item, and delete it - it is like a weird emacs parallel version of the dom
19:44justin_smithI forget the details at the moment, but I have done it before
19:44justin_smithof course the facility that generated the overlay *should* provide a way to remove it
19:53TakeVLightTables is still in active development, yes?
19:53RaynesCertainly.
19:54sinistersnarehasnt seen an update in a little while i think
19:54sinistersnarejudging from chris grangers blog still being about that cancer and startups thing after a few montsh
19:55glosolisinistersnare: There was some post in Github from him saying it should be released second week of the current month with no promises
19:55sinistersnareoh cool then!
19:56glosoliDunno it\s been easier for me to switch to Emacs than waiting for LightTable to improve lol
19:58justin_smithit was a nefarious conspiracy; lighttable was just a decoy to get people using clojure in emacs
20:02sinistersnareive been using Nightcode!
20:02sinistersnaresome random IDE a guy made and released a couple nights ago
20:03patchworkI really think we need some more code editors
20:04patchworkThere just aren't enough
20:04brehauti cannot tell if you are being sarcastic or sincere
20:05justin_smithI've been thinking of running a bunch of different window managers on my virtual terminals, and running a different editor under each window manager, and on each one I would listen to music in a different music player.
20:05sinistersnarei think competition is great
20:06patchworkbrehaut: I can't tell either
20:26s4mueli'm curious as to what most people here are using to develop clojure, or is that a long-hackneyed debate here
20:27patchworks4muel: Emacs
20:27plainmanemacs
20:27patchworkBut editors are religion
20:27jcsimsEmacs + nrepl
20:28s4muelmy experience with vim/fireplace etc has been off-putting in comparison to even just the default clojure-mode in emacs (autocompletion, etc) but i am just so used to vim
20:28patchworkThere is a vim mode in emacs
20:28jcsimss4muel: I was exactly the same way
20:28s4muelthe aptly named evil mode
20:28patchworkSo you can use all of your vim bindings from emacs
20:28patchworkI know quite a number of people in your boat, and it seems to work for them
20:28cmathesonis anyone using evil-mode? i tried it out and it seemed great, but i was oncerned about how it interacted with the various minor modes
20:29plainmanI started as a vi person, and I probably use it more than emacs, but I found it worthwhile to work at getting the emacs commands down into my fingers rather than try to use the vi mode
20:29s4muelI think part of it is also the repl-development 'ecosystem' as it were
20:30s4muelwhich is just bonkers with vim
20:31juhu_chapaHi guys!
20:31s4mueland try as i might i cannot get vim to do two things, and i know emacs does one: i want syntax highlighting for (defn my-symbol-i-want-highlighted-elsewhere [] ()), and doc strings for namespace/method outside of core
20:32patchworks4muel: Yeah, use emacs
20:32patchworkif you can overcome the blasphemy!
20:32sinsnareHow is repl development a thing though? It doesn't get saved anywhere, how does it work?
20:32TEttingerI use Light Table, which has had some issues with evaluating anything longer than a paragraph of code in the instarepl... but otherwise does what I need it to do.
20:33justin_smithsinsnare: there is repl history, and really you should be writing functions in your source, and playing with them in the repl (to experiment with variations, see what they do with various inputs, etc.)
20:33s4muelsinsnare: reloading your code -- the beauty of functional stateless-ness. For example I'm working on a lamina/aleph processing/plexer thing. I reload the namespace, pass in a message, and see what happens.
20:33TEttingergah you can reload namespaces? I've honestly been using lein repl, quit, lein repl as my workflow D:
20:33justin_smithand yes, redefining everything and seeing what it does next time
20:34sinsnareThat's a really interesting thought. Never thought of it like that
20:34justin_smith(require '[foo.bar] :reload)
20:34s4muelsome stuff requires state to be set up, example i have to prepare/enqueue dummy messages on a channel, but that's easy with some helpers like expectations run-before
20:34patchworkTEttinger: The greatest part of using clojure
20:34patchworkmodify function in source code, send the definition to the running repl, repl now uses updated code
20:34sinsnare I'm fairly new to repl stuff. Ive mostly done python repl as a calculator :p
20:34patchworkNow I can't live without it
20:34TEttingerI knew people were doing it, but I had no idea how
20:35sinsnareSo excuse ignorance
20:35cespareTEttinger: any workflow that requires you to run lein commands all the time is no good, it's slow as balls
20:35patchworkJust C-M-x somewhere in the function definition, repl is now using new code
20:35s4muelTEttinger: it gets complex when you have side-effect things like tcp servers that need to be restarted on reload
20:35TEttingercespare, yeah. I figured that part out myself.
20:35patchworkBAM!
20:36sinsnarethat's cool stuff
20:36patchworks4muel: In that case I have the servers referring to #'function-name (a reference to the var rather than the function itself)
20:36TEttingerthe other issue is with my code using Swing, and main needing to be in a UI thread
20:36patchworkThen when I update it, the server is now using my new code
20:38s4muelpatchwork: I am also doing that with a multimethod dispatch, cool that you can apply it there!
20:38patchworkDeveloped webservers that way, irc bots, socket servers etc
20:38s4muelpatchwork: I am doing something like this to manage the tcp server from repl https://gist.github.com/shalicke/6246155
20:39abphttp://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded
20:39s4muelSeems ghetto now.
20:40patchworks4muel: Yeah, that is somewhat elaborate, but it works
20:40patchworkNot entirely necessary if you are using nrepl and emacs
20:41s4muelI have (usually) a vim window open, lein autoexpect, and lein repl
20:45TEttingerso... I made a small swing app with clojure, but when I wanted a friend to run it, he didn't have java installed. I thought it was going to be rare, but a fair amount of end-users seem to be avoiding installing a JVM these days... What do you think about clojurescript for an application meant for less-technical users?
20:45s4muelThat's another discussion, tdd workflow -- I'm new & landed on expectations / lein-autoexpect, the other camp(s) seem to be Midje or speclj, any thoughts from the peanut gallery?
20:46technomancyclojure.test is great
20:46technomancyexpectations seems the least crazy of the options you listed though
20:46s4muelYeah I needed something that would ... not be too much of a learning curve, really, and automatic
20:47s4muelMidje seems like that camp of almost-bdd where it's a journey to write the tests themselves (think webrat/selenium/argh)
20:47technomancyright; the main advantage of clojure.test is that basic usage involves a total of two macros; advanced usage typically only adds one more
20:48callenMidje is silly and was written by silly people emulating the efforts of nihilists.
20:48callenNone of them are to be trusted.
20:48s4muelauthor of Midje is probably in this channel somewhere. Don't get me wrong, better developers than me use it, I'm just saying it seems like a real commitment :)
20:49hiredmanunlikely
20:51callenhe's not here.
20:52callens4muel: very thoughtful of you, but ad hominem is pretty valid when you're relying on their software. Pass.
20:52callenCf. Rich Hickey vs. Rasmus Lerdorf.
20:52s4muelcallen: true.
20:53cespare> ad hominem is pretty valid when you're relying on their software
20:53cesparewat
20:53callenfor any that might care, pending testing, I'll probably reverse my position on c.j.j vs. Korma due to the new API.
20:53callencespare: unless you're willing to audit all of the code, you have to extrapolate from their track record and their judgment.
20:53patchworkcallen: The new api for c.j.j or korma?
20:53callenpatchwork: the new API for c.j.j
20:53cesparecallen: != ad hominem
20:53callenit's greatly improved.
20:54patchworkAh, haven't heard that
20:54patchworkI'll check it out
20:54callencespare: it really is. The person that wrote the software can invalidate my willingness to consider the software.
20:54patchworkYeah korma has not been updated in a while
20:54callencespare: concordantly, the point of ad hominem is to use the person behind the argument to invalidate the argument.
20:54cesparecallen: what you're describing is not an ad hominem argument
20:54callenyou are seriously misunderstanding me.
20:54patchworkcespare: Well, callen says so so it must be wrong
20:55callenI am saying ad hominem is a reason to ignore software from certain people. I'm explaining how it's parallel to the use of ad hominem in arguments.
20:55callenArguments can be evaluated on their merits completely within the context of a single discussion, code typically isn't that easy to box up.
20:55s4muelreputation as code
20:56callenAs a result, evaluating the quality of the source becomes a potentially valid and definitely more efficient way to evaluate software from afar.
20:56callenI really do not think it was a very subtle or difficult point to make
20:56callenI figured the Rasmus/Hickey thing would make it obvious. I guess not.
20:56callengoing back the original point, anybody who reads the mailing list knows what I'm talking about.
20:59patchworkcallen: I missed out on the mailing list discussion. Has midje been discredited?
20:59patchworkI have never used it
21:00callenThere are people that use clojure.test because they don't care, people that use midje because they don't care, people that use clojure.test because they "been there, broke that" with testing frameworks like Midje and are duly terrified, and people that use Midje because they forgot to leave the Ruby at the door.
21:01callenit's my personal opinion that syntax/DSL is a matter of "least concern" when it comes to testing and instead automating/managing things like fixtures, functional testing, integration testing is a lot more valuable and "labor saving"
21:01patchworkSo midje uses rubyisms? Hmm… I always thought ruby used lispisms. Well, and smalltalkisms
21:01patchworkAh, so it emphasized DSL over actual functionality
21:01patchworkGot it
21:01callenRuby is syntactically Perl, semantically a mutable OOP lang, and the Smalltalk has been beaten vicious and put in the closet.
21:02callenbut because any jackass of the street can believe themselves to be capable of evaluating the readability of syntax, that's what everybody wants to fuck with when it comes to testing.
21:02patchworkHa. Poor smalltalk
21:02callenain't nobody want to do the subtle, more difficult work of making tests more useful or comprehensive.
21:02callenor more interesting things like auto-generating test cases against defined constraints and input spaces.
21:03s4muelThat would be very handy for testing channels and inputs.
21:03callens4muel: google, "haskell quickcheck"
21:03patchworkcallen: So is there a clojure testing library that does tackle that?
21:03patchworkCount me as in the "uses clojure.text because they don't care" camp
21:03patchwork*test
21:04callenthere are implementations of QuickCheck for Clojure which is a good start. I just use clojure.test and write tooling to wrap the ugly of whatever I'm working on.
21:04patchworkQuickCheck, interesting...
21:04callenI've had to work on algorithms with non-deterministic/unverifiable output once the solution space gets large enough, so I basically had to write a fuzzing library.
21:06callenthere's also just typical web apps. Vanilla unit testing is not very well suited to verifying web apps these days.
21:06callenfucking with syntax won't change that.
21:08`cbpcallen: hi
21:08s4muelYes. Although I think the problem lies at a lower level with simply managing side effects of tests and state in regards to that. Serving an http request is nothing special per se, it's the management of the state of the client, dbs, services, etc. that are ugly, IMO
21:08`cbpcallen: any more projects i can help with? :-) I need some clojure in my spare time or ill go insane
21:08s4muels/are/is/
21:10callen`cbp: I have many. Some hairier than others.
21:10callen`cbp: I'm working on bulwark right now, it's a bit fiddly and early stage though.
21:10callens4muel: That's a part of the ugly in terms of implementation details, but I feel like the whole problem is waiting for a nice "gift-wrapped" clean-up like Leiningen was for packaging.
21:11callens4muel: I work on a lot of services/web app type stuff, so half of my shit that can break isn't even technically Clojure code. Being able to sanely test/mock that stuff without a ton of trouble would be nice.
21:17callen`cbp: my todo-list includes: Bulwark (Rack::attack for Clojure), proxy+ with JVM annotation bytecode support, pomegranate "sync with project.clj", clj-time API rewrite, Rewriting Selmer with Instaparse as an experiment, possibly quickcheck for Clojure if the existing impls suck, and selmer leiningen plugin for testing batch compliation and reporting any errors if applicable
21:17callen`cbp: want in on any of that?
21:20`cbpyeah sure
21:20callen`cbp: also fun bit of evil: https://www.refheap.com/17695
21:21callen`cbp: are you familiar with how proxy works?
21:21xeqicallen: can you expand on pomegranate "sync with project.clj"
21:22callenxeqi: what it says on the tin. Like what Ritz can do.
21:22callenwalks up the directory path until it finds a project.clj, checks the dependencies against what's in the classpath as well as the any possibly provided maven repos in the project.clj
21:22callenadds things that need added, removes things that need removed.
21:23callen`cbp: the pomegranate sync with project.clj or proxy+ thing would be good places to start since they're less fiddly than the other options.
21:24`cbpcallen: if youre asking me how a proxy server works sure, if proxy is a noun for something else then nope :-P
21:24callen`cbp: hoo boy. You're in for it now.
21:24callen`cbp: http://clojure.org/java_interop#Java%20Interop-Implementing%20Interfaces%20and%20Extending%20Classes-%28%20proxy%20[class-and-interfaces]%20[args]%20fs+%29
21:25`cbpOH that proxy
21:25callenyeah, it doesn't support annotations.
21:25callenit needs to.
21:25callenso a library form of proxy+ with annotations is what's desired.
21:25callenthis is so things like Netty can be properly wrapped.
21:26`cbpoh yeah i get it
21:27callengood news, a test case is easy enough to slap together
21:27callenbad news is, you'll probably end up balls deep in Clojure's Annotation*.java
21:32`cbpso the pomegranate stuff would let people add dependencies without leaving the repl? That sounds nice
21:34callen`cbp: well it already does that, but the idea is to not force them to use pomegranate's somewhat tedious and obviously stateful API
21:34callenand instead just make the workflow "edit project.clj => (pom/sync!)"
21:34`cbpjust modify project.clj and come back to the repl?
21:34callenyep!
21:34TEttinger`cbp, I've done it. it's cool. but as I established earlier, I have no idea how to properly use a REPL...
21:35callenI'm tired of restarting my lein repl
21:35callenit's fucking annoying.
21:35callenI lose all my stuff and end up making temp buffers of intermediate state/code for testing in a REPL
21:35callenjust so I can restart the REPL for dependencies
21:35callenI could use pomegranate, but I find the API tedious even if it works fine.
21:37`cbpok i'll se what i can do :-)
21:46technomancycallen: I think maybe the ritz project.clj stuff exists in its own lib?
21:46technomancyalembic or something
21:46technomancyhaven't gotten a chance to try it
22:40cjfrisz500-some people and we're all too shy
22:40cjfriszOr else everyone else figured out all the secrets of programming, and I'm alone in my ignorance
22:41cjfriszThat is pretty much the scariest world I can imagine
22:45cjfriszping dnolen
22:46eric_normandcallen: better: https://gist.github.com/ericnormand/6246733
23:12hugodalembic isn't quite the ritz project.clj stuff, though it does use lein, so it would be straightforward to add support for incrementally reloading the project.clj file. It is only really possible to add dependencies to the classpath though, not change them or remove them.