#clojure logs

2014-01-07

00:04tommo_is there way to shutdown/clear the clojure runtime from java?
00:08seancorfieldnot sure what you mean there tommo_ ?
00:08seancorfieldthere's (shutdown-agents) ...
00:09dnolenhuh I guess an Om cursor is maybe a lens zipper?
00:10tommo_nvm seancorfield, it seems i spent 15 minutes debugging, then ask then fix it :p
00:11tommo_i thought the rt was somehow keeping old code even after loading new
00:14tommo_problem was that i was def'ing a context for my functions when the proxy method was called, and ofc it would only bind once so after 1 run it would be invalid
01:02vdmit11Hi folks. Is it possible to hint Java interfaces, not Classes? I call a Java method that returns objects that have a certain interface, but different classes. Then I call instance methods of the object and get reflection warnings. I want to fix them, but can't figure out how to provide interface hints to the compiler. Is there any way to do that?
01:08vdmit11Oh, sorry for the stupid question. I just forgot to (import) the interface from a corresponding package.
01:50t3soro(hello clojurians)
03:05qradahey, can you pattern match 'empty list' in clojure? ie, (defn t ([] "empty") ([l] l)) , im recursing on 'l' and am wondering if i can 'break' out by matching on empty list some how
03:13noidithere's no built-in pattern matching in clojure, but there are libraries for that
03:13noidihttps://github.com/clojure/core.match
03:14noidihttps://github.com/jamii/strucjure
03:14qradacool thanks
03:17alewIs Quartzite the best option for scheduling in Clojure right now?
03:20noonianlooks pretty good
03:24noonianhttp://clojure-libraries.appspot.com/cat/Scheduling
03:26alewIt's too bad here are like 3 or 4 clojure library listings
03:26TEttingerclojure toolbox is (was?) good
03:26TEttingernot sure if it's still up-to-date
03:27noonianthat list matched my google search pretty well
03:28noonianalso https://github.com/james-henderson/chime
03:28andrew__why is this filtering numbers less than 5 rather than greater than five, as it suggests? (filter (partial > 5) [1 3 6 9])
03:28noonian,(doc filter)
03:28clojurebot"([pred coll]); Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects."
03:29alewyou want remove
03:29noonianit keeps the ones that the predicate returns true for
03:29andrew__noonian exactly; 1 is not greater than 5, yet it returns 1 (and 3)
03:29noonian,(filter (partial > 5) [1 3 6 9])
03:29clojurebot(1 3)
03:29alew,(remove (partial > 5) [1 3 6 9])
03:29clojurebot(6 9)
03:30noonian,(> 5 6)
03:30clojurebotfalse
03:30noonianbecause 5 is only greater than 1 and 3 in that collection
03:30whilo_dnolen: have there been attempts to implement https://github.com/webyrd/slpKanren with/in core.logic?
03:30andrew__ahh, i read it as "show me only those that are greater than 5"
03:31noonianyeah, the partial binding make (fn [n] (> 5 n))
03:31t3sorothe thing gets expanded to (filter #(> 5 x))
03:32noonian,(filter (partial < 5) [1 3 6 9])
03:32clojurebot(6 9)
03:33alewCronj looks really nice
03:33andrew__,(println "thanks")
03:34clojurebotthanks\n
04:29sm0keCan core.async be somehow wrapped for use from java?
04:45sm0kehow do i define a interface in clojure
04:45clgv sm0ke: there is definterface
04:46sm0keclgv: thanks
04:46clgvsm0ke: (definterface AwesomeNumeric (^int doSomething [^int x ^double y]))
04:46clgvsm0ke: as well as ^void
04:47sm0keclgv: does that interface resolved to namespace.AwesomeNumeric?
04:47sm0kewhat if i want something else
04:48clgvsm0ke: try full qualification. I am not sure whether it works but remember vaguely
04:48clgv,(aporpos "interface")
04:48clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: aporpos in this context, compiling:(NO_SOURCE_PATH:0:0)>
04:48clgv,(apropos "interface")
04:48clojurebot(gen-interface definterface)
04:49sm0kesucks
04:49sm0ke,(definterface org.pig.IClojure (^int dosome [^int x]))
04:49clojurebotsandbox.org.pig.IClojure
04:49sm0kehmm thats a problem
04:49clgvif definterface does not allow fullqualification, the maybe gen-interface does
04:49sm0keah nice
04:49sm0kethere is gen0interface
04:50clgvbut I did not use it, yet
04:50sm0ke,(gen-interface :name org.ping.IClojure :methods [[dosome [int] int]])
04:50clojurebotorg.ping.IClojure
04:51sm0kethanks clgv
04:52clgvsm0ke: so the definterface is the more idiomatic version if you need the current namespace as package of the interface - which is probably often the case
04:53clgvoh right, I already used gen-interface to support arbitrary numerics...
04:53clgv+primitive
04:53sm0kewell not really , i dont think clojure people name their namespaces as org.clojure.my.hi.hello.wtf
04:53sm0kewhich quite common in java
04:53sm0kewhich is*
04:54clgvsm0ke: yeah. but my.lib.impl.IAwesome fits as well ;)
04:56sm0kedid you sometime feel the raging anger while trying to navigate thorugh a java package folder ?
04:56sm0kefking nonsense
04:57sm0kefolder after folder, folder after folder, thats what source magaement is to java
05:00sm0keoh and once a colleague of mine named a folder 'con', and the development supposed to be working on windows as well
05:17shock_oneIs there a function like take-nth, but with step? I want to take 1st, 4th, 7th,.. elements of a sequence.
05:20lumafidoesn't take-nth do exactly that?
05:20lumafi,(take-nth 3 (range 1 10))
05:20clojurebot(1 4 7)
05:33clgvsm0ke: I prefer flat hierarchies for packages/namespaces as well
05:47sm0kehow do i cancel a promise/ future ?
05:48sm0ke,(def p (promise))
05:48clojurebot#'sandbox/p
05:48sm0ke,(future (prn @p))
05:48clojurebot#<SecurityException java.lang.SecurityException: no threads please>
05:48sm0ke,(prn @p)
05:48clojurebotExecution Timed Out
05:49sm0ke,(cancel p)
05:49clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: cancel in this context, compiling:(NO_SOURCE_PATH:0:0)>
05:53CookedGryphonsm0ke: ,(doc future-cancel)
05:53sm0keyeah i but found that
05:53sm0keCookedGryphon: what about promise?
05:54CookedGryphonwhat do you mean cancel a promise? That doesn't make any sense, tehre's nothing running to cancel
05:55CookedGryphonjust don't deliver it, and stop waiting to deref it
05:55sm0keCookedGryphon: CookedGryphon exactly
05:55sm0kewhat do you mean by stop waititng to deref it
05:55sm0kethere should be a way for me to canel promise so that waiting thread gets exception
05:56CookedGryphondeliver nil
05:56sm0kea weird thing would be to deliver an Exception
05:56CookedGryphonor something else which tells you to stop waiting
05:56CookedGryphonyou're still delivering a value, that value is just "no value"
05:56sm0ke'hollow promises'
05:56sm0kelol
05:57CookedGryphonthen yeah, have whatever you do with it in a (when-let [value @p] ...)
05:57CookedGryphonor something
05:58sm0kehmm if just dont deliver a promise, and there is no one derefing it it should be garbage collected right
05:58sm0keright?
05:59sm0keugh
05:59CookedGryphonI would guess so..?
06:17sm0kehow do i asynchronously execute a function after t time
06:19clgvsm0ke: no. just if there is no reference to the promise (or the referencing entity of the promise) anymore the it is garbage collected
06:20sm0keok
06:20sm0kemakes sense
06:21sm0kejust how java gc works i guess
06:23SouthyTimerTask and Timer java interop will let you do async scheduled tasks
06:23sm0keyea was thinking the same
06:24sm0kebut its a bit more effort i would have to proxy TImerTask
06:24sm0keSouthy: any idomatic way?
06:24sm0kesimple
06:24clgvsm0ke: there are clojure libs for timed events
06:24sm0kei saw this at at
06:24sm0kebut seems outdated
06:25clgvsm0ke: http://clojurequartz.info/
06:25sm0kepulling in quartz for one time scheduling is overkill
06:26CookedGryphonI use at-at for one time scheduling
06:26CookedGryphon(x seconds in the future etc)
06:26CookedGryphonand schejulure for cron-job style tasks
06:26sm0kehmm i guess a macro around Timer and TimerTask would be more simple
06:26sm0keand performant
06:26clojurebotExcuse me?
06:27CookedGryphonclojurebot disagrees
06:27sm0kehaha
06:27sm0ke?
06:27sm0ke??
06:27lazybotsm0ke: Definitely not.
06:27sm0keeaster eggs!
06:28CookedGryphonanyway, at-at is fairly simple and performant, I'd just use that
06:28alewquartzite is really hacky if you want persistent stores
06:29Southylooking at source for at-at, it is using java.util.concurrent.ScheduledThreadPoolExecutor which has good perfomance and is great if you want to add in more than 1 scheduled execution
06:31sm0kei doubt its better than TimerTask though
06:31sm0kei mean its meant to be used for scheduling right
06:32sm0keand iirc a Timer can have multiple timer tasks
06:32sm0keso its must be using a threadpool as well
06:33sm0kewell http://docs.oracle.com/javase/7/docs/api/java/util/Timer.html mentions its uses same thread pool
06:33sm0kewell not really!
06:33sm0kehmm it seems it advises to use java.util.concurrent.ScheduledThreadPoolExecutor instead
06:33sm0ke:P
06:35sm0keat-at it is then
06:36CookedGryphonif your needs are very basic, then just using scheduledThreadPoolExecutor directly isn't very painful
06:36CookedGryphonbut if you're going to start writing wrappers to hide the java calls, just use at-at
06:37sm0keoh and Timer seems to be singlethreaded too
07:10sm0kewith clojure i find myself spawning threads by putting a (thread) form in a namespace.
07:10si14_how do you profile "lein repl"?
07:10sm0keis this an antipattern for librariies?
08:08darthdeushow can i tell lighttable to stop "processing" when it constantly shows this thingy? http://i.imgur.com/a70VRqY.png
08:17expezafter running cider-jack-in a repl is started which major mode is nrepl-repl-mode. It should be cider-repl-mode, right?
08:18canassadarthdeus: I think there is a command for stoping it when it get stuck
08:20shock_oneIs there a site like clojuredocs, but up to date?
08:23clgvsi14_: what do you want to profile?
08:23clgvsi14_: runtimes of evaluations you do in the repl?
08:24si14_clgv: no, repl loading itself. it ends with timeout after every "lein clean"
08:24si14_*ends with timeout once, than starts on second try
08:24darthdeusi think there's a bug in luminus ... the sample app returns Content-Length: 4
08:24clgvsi14_: according to technomance the time consumed by "lein help" is an upper bound for "lein repl"
08:24darthdeuseven though there's shitton of html
08:25clgvsi14_: or phil hagelberg ;)
08:26clgvsi14_: if you use :aot that is probably not true
08:26si14_clgv: yes, but in my (arguably large) project it's not the case :) yes, I'm using AOT for one of namespaces
08:28clgvsi14_: well so the runtime is aot dominated. you can use "lein compile" and profile that one with linux tools
08:28clgvsi14_: "time lein compile" should work
08:30si14_clgv: it's very slow even after prior "compile". lein repl takes ~35 seconds compared to 8 for lein help
08:32clgvsi14_: well it also depends on how many namespaces have to be loaded - I assume there are many reference (at least transitively) in your :main namespace
08:35si14_clgv: with empty :main namespace it's down to ~18secs, thank you. still ~2x larger than "lein help"
08:47hyPiRionsi14_: there is some work in progress to speed up `lein help`, although I'm not sure whether it would decrease repl times
08:47hyPiRionSee technomancy/leiningen#1403
08:47lazybotSpeed improvement for the "lein help" command (with nicer code) -- https://github.com/technomancy/leiningen/pull/1403 is open
08:48clgvsi14_: do you see output whether it recompiles the namespaces?
08:51mdrogalishyPiRion: Yay profiles update. Thanks :)
08:59si14_clgv: no, I don't (not after "lein compile" at least)
08:59clgvsi14_: on different projects of mine: 9 sec, 6sec - on a pretty large with aot due to :main 29sec
09:00hyPiRionmdrogalis: np =)
09:00si14_clgv: stange. I've tried VisualVM during startup, but the output of it's sampler makes no sense to me
09:00clgvsi14: 9sec on the large one after compilation was done once
09:01clgvsi14_: you probably want instrumentation
09:01si14_(sorry for erroneous /me)
09:01clgvsi14_: "time lein help" => 7.7sec
09:02clgvsI14_: in profiling you usually have "sampling" and "instrumentation"
09:03clgvsi14_: the latter really writes down information about every single function invocation, often only for previously specified functions to avoid too much overhead
09:03si14_argh. hate this feature of irccloud
09:12jballancanyone know a relatively easy way to do "not-listo" in core.logic?
09:33dnolenjballanc: you could probably do it with the nafc constraint
09:33dnolennafc + project + seq? predicate
09:34clgvjballanc: "not" in logic programming is often done via explicit failing - afair from prolog
09:36jballancdnolen: for some reason all those combinations I tried, but couldn't get quite what I want :-/
09:36jballancit's ok, though, I think I've found a place where conda is actually useful :)
09:37jballancI'm trying to write an explicit flatten goal
09:37dnolenjballanc: it's a hard problem we inherit from a prolog like model
09:37jballancyeah, my problem was finding the right base case
09:38jballancthe base case for an already flattened list duplicates the base case for a singly nested list
09:38jballancbut if I use conda to check the singly nested list first, things seem to work
09:40jballancbtw, the "flatteno" in the core.logic tests doesn't make sense to me...seems to match any degree of flattening?
09:41jballanc...including none?
09:42dnolenjballanc: it's just the miniKanren one verbatim, I cannot attest to it usefulness
09:42jballancah, ok
09:42dnolenjballanc: we've included a lot of things from The Reasoned Schemer as it's still a good source of information
09:43dnolenjballanc: and you can work through it easily with core.logic
09:43jballancyeah, now I just need to get a hold of a copy ;-)
09:43dnolenjballanc: for 0.9 I'm probably going to do a pretty serious reorg so that the library is laid out more sensible.
09:43dnolensensibly
09:43dnolenand minikanren stuff will probably move back to a prelude namespace like it used to be
09:44jballancthat makes sense
09:44jballancif I manage to get this little project working maybe I'll have to blog about it...
09:45jballancI have a project with > 1000 Java class files and crazy mixed-up interdependencies
09:45jballanctrying to use core.logic to split it into chunks of modules that can be compiled independently
09:45jballanc...so that I don't need 2+ GB RAM for the build! :P
09:51teslanickPerhaps of mild amusement to #clojure - Yesterday I implemented PersistentVector in javascript: https://gist.github.com/nhusher/4ec5c83a263fb5ec2fe9
10:06clgvteslanick: did you compare it to the implementation of clojurescript performancewise?
10:06si14_dnolen: what was the reasoning behind negation-as-failure? can't properly wrap my head about this. it seems that negation works in FOPL and can be computed efficiently via resolution.
10:06si14_dnolen: doesn't it?
10:08avshalomhi all, is there anything wrong with nested pmaps? e.g. (pmap f1 (pmap f2 list)) Will this work as I hope it does: dishing out work to all the processors, allowing the inner and outer pmaps to maximally saturate the cpus?
10:08teslanickclgv: I haven't - I was mostly cargo-culting my way through the PersistentVector class file to see how it works.
10:09avshalomi am wondering if the inner pmap has to "materialize" before the outer one will execute
10:12augustlavshalom: never used pmap, but if it's like map, it's lazy, so it will run f2 then f1 on the first item first, not f2 on all items in list then f1 on all items in list.
10:14llasramavshalom: `pmap` is sometimes convenient for quick-and-dirty parallelization, but doesn't have anything explicit to nicely handle nested or otherwise concurrent pmaps
10:14augustlavshalom: ....I think
10:14llasramavshalom: Your best bet is to use Clojure 1.5's reducers library with `fold`
10:15llasramThat'll use a fork-join pool to intelligently run any degree of nested computation in parallel
10:18logic_progwhy don't people just use erlang? :-)
10:18stuartsierraavshalom: `pmap` is fairly naive, but it will help spread the work over multiple CPUs for simple cases.
10:18clgv avshalom: pmap uses futures and is semi-lazy
10:18augustlwhy does (first (filter #(do (println %) (> % 1)) [1 2 3])) print 1 2 3? I expected it to print 1 and 2, and then stop since first doesn't need to consume the lazy list anymore
10:19stuartsierraclojurebot: chunking?
10:19clojurebotNo entiendo
10:19stuartsierraaugustl: Chunked sequences. It's a performance optimization, some lazy seqs evaluate 32-at-a-time.
10:19augustlstuartsierra: Just tried on (range 0 100) after your clojurebot query, and it only printed to 31 :)
10:20augustlstuartsierra: for fewer nonliner allocations I suppose?
10:20avshalomthanks for the info. I will research your responses
10:20stuartsierraYes. Chunked Seqs can allocate arrays of 32 elements instead of 32 linked nodes.
10:21augustlstuartsierra: cool, thanks for the info!
10:21stuartsierranp
10:23augustlwas a little worried there for a sec, I've been using (first (filter ...)) as an example of the composability of lazyness (no need to write a separate find-first)
10:24katoxdid anyone have problems with prn (with enable-console-print!)?
10:24dnolensi14_: you need to look at Prolog
10:24dnolensi14_: we have a Prolog model and we inherit the same problems
10:24augustllogic_prog: something something always using message passing something something!
10:24katoxthe output seems somewhat unreliable in my code while (.log js/console ...) is always there
10:24si14_dnolen: yeah, I mean, what was the reasoning in Prolog :)
10:24stuartsierraaugustl: In general, combining lazy seqs with side effects leads to unexpected results.
10:24dnolensi14_: let me google that for you :)
10:25augustlstuartsierra: the docs for "filter" says pred shouldn't have side-effects. Is that a style thing, or a technical reason?
10:25augustlI'm guessing it's more that you shouldn't rely on anything other than this fn being called with a value. No ordering of the call to pred etc etc.
10:26si14_(sorry for erroneous /me)
10:26dnolensi14_: just read up on Prolog style resolution you'll see why it's hard.
10:27si14_dnolen: but there is "resolution" as in FOPL and it works (AFAIK answer-set programming is similar), doesn't it?
10:27stuartsierraaugustl: It's because of chunking.
10:27dnolensi14_: "works"
10:27dnolensi14_: efficiency
10:28si14_dnolen: you mean exponential complexity?
10:29stuartsierraaugustl: All the higher-order seq functions are meant to be used with pure functions. Use doseq, dorun, or doall to introduce side effects.
10:32katoxthe prn snippet: https://www.refheap.com/22564
10:33katoxif I change prn to (.log js/console ...) it seems to work fine
10:34katoxany ideas?
10:43andyfBronsa: ping
10:43Bronsaandyf: pong
10:52andyfSorry, got interrupted there. I think the recent trim changes you made to t.a(.j) cause ASTs to be created that leave out some expressions in some cases.
10:53andyfI guess a TANAL ticket with test case would be in order.
10:53Bronsawhat do you mean? (let [a 1 b 2] (do 3 4)) => 4 is intentional
10:54andyfBronsa: As in, you are intentionally doing simplifications in the analyzer as a sort of early compilation step?
10:55andyfBronsa: And this is new behavior with recent changes?
10:57andyfBronsa: I ask because a test case that was previously detecting a misplaced docstring no longer detects one, because the misplaced docstring isn't in the ast. It isn't all cases, just one where there are multiple methods defined for the fn.
10:57Bronsaandyf: oh, I see why this might be a problem for eastwood
10:58andyfBronsa: I am guessing this might be an optional step I could leave out when using t.a(.jvm) from eastwood?
10:59Bronsaandyf: well, it's explicit in the docstrings that the passes run by default on the AST are to produce an AST for tools.emitter.jvm
11:00andyfBronsa: That makes sense, and I don't want to change that goal. I am just hoping we can also perhaps support a subset of the passes that do a bit less.
11:00Bronsaandyf: yes, it seems reasonable.
11:00andyfBronsa: I am happy if that subset of passes is in Eastwood, not t.a(.jvm) code.
11:04Bronsaandyf: it's simply a matter of copying run-passes removing the trim pass, it's probably easier if that's done on the eastwood side right now
11:04andyfBronsa: Sounds good. I will give that a try and let you know if I have any troubles.
11:05andyfOn the plus side, I may be close to getting the changes into eastwood so it analyzes subforms of top-level do's separately, so simple-check and other code that uses it should work (among other things).
11:05Bronsaandyf: while you're at it, you can probably leave out the collect & clear-local passes since I don't think eastwood needs any of that information
11:06pepijndevoswtf: ClassCastException clojure.data.avl.AVLNode cannot be cast to clojure.data.avl.IAVLNode
11:07Bronsapepijndevos: a classloader issue maybe?
11:07andyfpepijndevos: Bronsa: I have seen that when running Eastwood on data.avl. I haven't tracked down the cause yet.
11:07pepijndevosprobably. The fn has a lot of typehints. Removing those solves it
11:08andyfMost likely a problem in Eastwood, not data.avl
11:08Bronsaandyf: I know, it's not a problem in data.avl
11:08pepijndevosIt has some fancy interface generation going on
11:09Bronsaandyf: I'd think the recent change in the ns lint order should have fixed that
11:10Bronsaandyf: I've seen errors where ClassCastException some.Class cannot be cast to some.Class, that's caused by the out-of-order ns evaluation
11:12andyfBronsa: OK. Like I said, I have only noticed them, but haven't tried to investigate the cause yet.
11:12andyfBronsa: I still see them after the dependency order changes went in.
11:13vdmit11Does referencing a keyword create any objects? Are there any objects created during invocation of this function: #(= % :keyword) ?
11:14Bronsaandyf: weird, there might be something more going on that I haven't considered then
11:14gfredericksvdmit11: I can't imagine so
11:15pepijndevosgfredericks, vdmit11 the keyword has to live somewhere right?
11:15Bronsapepijndevos: it's interned at compile time
11:15vdmit11pepijndevos: yep, but is the keyword created only once or a new instance is created on every call of the function?
11:16pepijndevosBronsa, what does interned mean?
11:18Bronsapepijndevos: the first time a keyword is encountered, a new instance is created and put in a table, when it's encountered again instead of creating it again the same instance is used.
11:18pepijndevosBronsa, right, so if I enter :foo in the repl. a new keyword is created
11:18pepijndevosprovided I never used :foo before, which is unlikely :P
11:18Bronsayes
11:19vdmit11Bronsa: thanks
11:19Bronsaactually, it looks like a new keyword is created every time https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java#L36
11:20Bronsabut anyway, if it's in a function that gets done only once in the static initializer
11:24vdmit11then, another question; consider the code: (let [foo 1] (defn get-foo [] foo)) Are there any instances created during when I invoke (get-foo)?
11:24Bronsano
11:26vdmit11because foo is resolved during defn evaluation and then (get-foo) always returns the same object?
11:31pepijndevosI'm struggeling with binery tree search :( I'm trying to implement NavigableMap on top of it.
11:32pepijndevosIt's not hard to write a specific case, like floor for a tree sorted by the default comparator.
11:32pepijndevosBut I'm trying if it's posisble to write one function that takes the comparator of the tree and a predicate.
11:32gfredericksvdmit11: right
11:51stuartsierravdmit11: You can use the `identical?` function to test if things are the same object.
11:59CaptainLexWhat'
11:59CaptainLexs preferred case style for Clojure? Is it train-case?
12:00jcromartielisp-style-is-like-this
12:00stuartsierraCaptainLex: The most common convention is hyphens-for-locals-and-functions, CamelCaseWithInitialCapital for protocol/record names.
12:01CaptainLexThought so. I'm slipping haphazardly between that and CamelCase in this project. I'll weight the hyphens for the future!
12:01CaptainLexThanks!
12:15mikerodtrain-case?
12:15mikerodnever heard that, I thought of it as kebab-case
12:15mikerodespecially after seeing https://github.com/qerub/camel-snake-kebab
12:18jcromartieEnlive is really shaping up to be a boon for our development process.
12:19jcromartieour UI designs get folded into the working app faster than I've ever seen
12:19dnolenCaptainLex: I like to use CamelCase only for types, records, and protocols, everything else hyphens
12:22TimMcclojurebot: kebab-case is ⟜better-with-unicode-
12:22clojurebotRoger.
12:22jcromartiekebab-case?
12:22clojurebotkebab-case is ⟜better-with-unicode-
12:22jcromartieclojurebot deals admirably with unicode
12:23TimMcThat's like saying "Bob is amazingly good at not punching random strangers."
12:23TimMcit's kind of a baseline
12:24jcromartiehah
12:25rasmustoCamelCase?
12:26hansel-hanjcromartie: I just started playing with Enlive after a full year of Hiccup-everything. (Not that Hiccup-to-represent-html is an incompatible alternative) But I'm really liking this concept of transforming a tree to render templates
12:26logic_progwhoa
12:26logic_progwe're tlaing POPL papers in clojure ?
12:27justin_smithlogic_prog: tla is the best tla
12:27logic_progwhat is tla?
12:27justin_smithit's a tla!
12:28justin_smithhttp://en.wikipedia.org/wiki/Three-letter_acronym
12:29logic_progpopl = premier conference on programming languages
12:29justin_smithfla
12:29logic_progwtf is fla?
12:29logic_progabc
12:29logic_progthk
12:30logic_progwow; so tla; much #$%; many ???
12:30lazybotlogic_prog: Oh, absolutely.
12:30justin_smithlogic_prog: four letter acronym, of course
12:30justin_smithnot to be confused with fla, five letter acronym
12:31TimMcETLA, Extended Three-Letter Acronym
12:31justin_smithnice
12:31TimMc^ from Wikipedia. Learned something today.
12:31bbloomdnolen: ThisCaseStyle is called PascalCase, camelCaseIsLikeThis
12:31dnolenbbloom: right I always forget the actual name
12:31bbloomdnolen: remember that a camel has humps on his back, not on his head :-P
12:31technomancybut... camels have heads
12:31dnolenhaha
12:31technomancythis terminology is zoologically troublesome
12:32TimMcyour face is zoologically troublesome
12:32technomancyoh snap!
12:33TimMc>all^i^g^a^tor^ca^se
12:34TEttingerվ vs. U
12:35TEttingerarmenian all the things!
12:35TimMc'ARMENIAN SMALL LETTER VEW' (U+057E)
12:35TEttingervev or vew
12:36TEttingerI wonder if there's a way to fetch the unicode info the JVM knows about a char
12:38TimMcj.l.Character doesn't seem to help...
12:38justin_smithhttp://docs.oracle.com/javase/6/docs/api/java/lang/Character.html I am not finding much here
12:39justin_smithahh, java 7 has getName
12:39logic_progsomeone needs to create hackernews for clojure
12:39logic_progpeople can post code snipplets
12:40justin_smith,(Character/getName (int\a))
12:40clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: getName, compiling:(NO_SOURCE_PATH:0:0)>
12:40jjl`_java.lang.ClassFormatError: Invalid method Code length 67858 in class file << what on earth does this mean?
12:40TimMc&(java.lang.Character$UnicodeBlock/of 0x57e)
12:40lazybot⇒ #<UnicodeBlock ARMENIAN>
12:40justin_smith,(System/getProperty "java.version")
12:40clojurebot#<SecurityException java.lang.SecurityException: denied>
12:40TEttingerjjl`_, I have gotten that
12:41TEttingerwhen you make incredibly huge literals, it results in that
12:41TEttingerhere
12:41jjl`_i have no incredibly huge literals
12:41TEttingerhm
12:41TEttingerpastebin?
12:41TEttingerhttps://dl.dropboxusercontent.com/u/11914692/weapons-map-too-large.clj is too big to load, for example
12:41TEttingerhttps://dl.dropboxusercontent.com/u/11914692/weapons-map.clj but this works
12:42gfredericksrunaway macros can give that error
12:42jjl`_TEttinger: https://github.com/jjl/mapmapper <- here, it's open source. i just pushed
12:43jjl`_TEttinger: using midje for tests. the broken test is mapmapper.sql.transform_test
12:44gfredericksthis gives an error I haven't seen before: (eval `(apply + [~@(range 100000)]))
12:44gfredericks"Invalid this class index 3171 in constant pool in class file"
12:44justin_smith,(Character/getName (int \☃))
12:44clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: getName, compiling:(NO_SOURCE_PATH:0:0)>
12:44TEttingerI wonder if that second facts fn, when macroexpanded, is too large
12:45justin_smith&(Character/getName (int \☃))
12:45lazybotjava.lang.IllegalArgumentException: No matching method: getName
12:45justin_smithbleh, no java 7 on either bot :(
12:45jjl`_TEttinger: you mean just break it out into two?
12:45justin_smithworks locally with java 7
12:45TEttingerI'd try it, jjl`_.
12:46TEttingerit could be a runaway macro, like gfredericks said
12:46jjl`_yeah, splitting it appears to work
12:47jjl`_that's quite annoying though
12:47hiredmanyet another data point confirming my decision to avoid midje
12:48justin_smithhiredman: what's that (I avoid it already but am morbidly curious)
12:49hiredmanjustin_smith: whatever jjl`_ is dealing with
12:49logic_progdnolen: you run http://swannodette.github.io/ right?
12:50jjl`_hiredman: i very much like midje. the autotest functionality saves me so much time it'd be worth putting up with a LOT of rap
12:50dnolen_logic_prog: yes
12:50logic_progdnolen: okay good, I need to sue you for violating one of my patents
12:50logic_progdnolen: I'm kidding, but can you please write more blog posts ?
12:50logic_progdnolen: they're really insightful, and I'd like to learn more from them
12:51dnolen_logic_prog: heh, they take a ridiculous amount of time to do
12:51hiredmanjjl`_: sure, saving you time, which you can then spend on irc asking about why it doesn't work :)
12:51dnolen_logic_prog: I think 1-2 posts a month is about all I can really do
12:51jjl`_hiredman: i was going to be on irc anyway... also, more importantly, testing got a lot less tedious. that alone is worth using it for
12:52dnolen_logic_prog: if you want more just look at the related repos and ask me questions here or in #clojurescript
12:52jjl`_in any case, on balance, i'm very happy with having moved to midje a couple of days ago
12:53Bronsawtf.
12:54logic_progdnolen_: so after reading your om/react blog posts, I went off and wrote a variant of react (without the key part of tree matching) in pure cljs (well, cljx) -- and it also has the "time travel" feature you mentioned
12:54logic_progdnolen_: I think part of the problem is that I don't know *xyz* is possible until I read it on the blog post
12:54logic_progdnolen_: for example, I didn't realize the power of core.async until I read the async posts
12:54logic_progdnolen_: and I didnt' realize the idea of "virtual dom" until reading the react/om posts
12:55logic_progdnolen_: as in part of th eproblem is *where to look* rather than *undersgatnding what is looked at*
12:55logic_progdnolen_: that I think is what I really like this series of blog posts -- the choice of topics and how concisely theyre explained
12:55CaptainLexWhoa, did I just miss a netsplit?
12:55logic_progdnolen_: to mix criticism with praise, the STLC posts are rather weak though
12:56justin_smithCaptainLex: freenode has been weird for me lately
12:59dnolenlogic_prog: yeah, I didn't really get to finish that line of thought
13:00logic_progdnolen: can you write a series of blog posts on lein middleware? :-)
13:01logic_progdnolen: I've been trying to read up on it, but there seems to be almost no documentation
13:01logic_progdnolen: I think it'd really benefit the clojure ide community if people started ahcking on middleware for fun
13:01jjl`_logic_prog: writing thereof?
13:01logic_progjj`_: ?
13:01dnolenlogic_prog: I will probably never write any such thing :)
13:01logic_progdnolen: why not?
13:01jjl`_logic_prog: you'd like to see docs on how to write middleware?
13:02logic_progjjl`_ : yes
13:02dnolenlogic_prog: I'm not really interesting the talking about the in/outs of lein and it's documented elsewhere
13:02logic_progtechnomancy: hmm, do you blog? ^^
13:03technomancylogic_prog: yes, but I kind of don't want more people using lein middleware
13:03jjl`_logic_prog: there's quite a lot of pre-written stuff to look at and learn from :)
13:03logic_progtechnomancy: why not?
13:03logic_progjjl`_ : can you point me to a good example on github?
13:03logic_progjjl`_ : I was trying to get cljx lein middleware to work, but I couldn't find documentation
13:03technomancyif I blog soon about lein it'll be about how people need to stop writing plugins for one-off things and just use aliases to lein run
13:04technomancylogic_prog: because middleware can do crazy things that are difficult to debug, as your current problem seems to indicate
13:04jjl`_logic_prog: first result on duckduckgo for "leiningen middleware" seems like a sane one https://github.com/dchelimsky/lein-expand-resource-paths
13:04technomancyif you have a problem that can't be solved without middleware, we should talk
13:05logic_progcemerick: you wrote cljx + lein's cljx middleware right?
13:05logic_progtechnomancy: noted, I will go bother cemerick now
13:05technomancybecause it means we're missing some functionality in lein
13:05technomancymiddleware is there in case you need to get stuff done before we can get around to fixing lein
13:05logic_progcemerick: see what technomancy is saying? :-) why does cljx need lein middlware?
13:05cemericklogic_prog: the Next Generation of it, yeah
13:06jjl`_in fact, that particular middleware would have made me less annoyed at lein a few weeks ago
13:06cemericklogic_prog: it probably doesn't. cljx was written before I (mostly?) understood what prep-tasks was for.
13:06logic_progcemerick: can you put up a site where we can donate dogecoins for you to finish the next generation of cljx sooner?
13:06cemericklogic_prog: what's missing from it?
13:07cemerickactually, gh-24 is not complete, but that's the only item I'm aware of
13:07logic_progcemerick: I start lein not via "lein repl", but via ... let me pull up the code ... I'm not sure how to get cljx to integrate with it
13:08logic_progcemerick: I start my nrepl server cia "(clojure.tools.nrepl.server/start-server :port 3001)"
13:08logic_progcemerick: how can I fix that so that I can send a cljx reload-file to my nrepl server?
13:08logic_prog(i.e. ahve hte #+clj and #+cljs macros be processed)
13:09logic_progcemerick: la slightly better rewrite. (1) I start nrepl with (clojure.tools.nrepl.server/start-server :port 3001) (2) I connect via emacs with M-x nrepl <cr> 3001 <cr> (3) I want to be able to send an entire *.cljx buffer to my nrepl
13:09logic_progQuestion: what do I need to do to the way I start nrepl, to hook in cljx, so that the #+clj and #+cljs macros are properly handled?
13:09logic_progcemerick: does my question make sense, or is it still a mess?
13:11cemericklogic_prog: You need to have cljx on the classpath, and include its middleware in your start-server call
13:11logic_progcemerick: is there an half-working gist I can copy/paste code from?
13:11logic_progcemerick: does this mean I need to add cljx as a _dependencies_ rather than a _plugins_ ?
13:12cemericklogic_prog: its plugin will add itself as a project dependency automatically
13:14logic_progcemerick: can you take https://gist.github.com/anonymous/8303836 and fix it ? :-)
13:14logic_progcemerick: it'll hopefullyt ake you < 5 mins, and I can learn from dissecting how it works
13:16rasmustodoes cljs not like my-ns.foo hyphens?
13:16cemericklogic_prog: No gist. See the docstring here (https://github.com/clojure/tools.nrepl/blob/master/src/main/clojure/clojure/tools/nrepl/server.clj#L114); something like (start-server :handler (default-handler #'cljx.repl-middleware/wrap-cljx))
13:17cemericklogic_prog: nope, sorry, busy. Teach someone to fish, etc. :-P
13:17dnolenrasmusto: should work fine
13:17dnolenrasmusto: but on disk you need _
13:17dnolenmy_ns/foo.cljs
13:17logic_progcemerick: trying to get this to work .... let's see
13:18rasmustodnolen: ah, I'm guessing that's for index.html too, I think that's my problem
13:18dnolenrasmusto: yep
13:18rasmustodnolen: awesome, thanks. I'll get back to om-fun.core then :>
13:18dnolenrasmusto: sweet!
13:20logic_progcemerick: in order to use that line, I needed to add (:require [cljs.repl-middleware]), which, unfortunately, cuases a :
13:21logic_progcemerick: Exception in thread "main" java.lang.RuntimeException: No such var: readers/source-logging-push-back-reader, compiling:(cljs/repl.clj:205:21)
13:21cemericklogic_prog: you're using a too-old version of ClojureScript and/or an explicit older version to tools.reader
13:21logic_progcemerick: okay, let me try to fix that
13:22logic_progcemerick: cljs was on 0.0-2120, trying 0.0-2138 now
13:23logic_progcemerick: taht did not fix it, upgrading tools.reader from 0.7.10 to 0.8.4-SNAPSHOT now
13:24dnolencemerick: I see you've come around to source maps
13:24logic_progcemerick: i can start the server now. let's see if emacs connections actually work
13:25cemerickdnolen: was never against ;-P
13:25logic_progcemerick: it appears to work now
13:25logic_progcemerick: thanks for all your help with debugging
13:25dnolencemerick: I so want a ClojureScript Chrome Dev Tools nrepl thing, that + source maps would just be so awesome
13:26cemericklogic_prog: glad it panned out :-)
13:26logic_progcemerick: the initial line + pointers to upgrading cljs/tools.reader were really key
13:26logic_progdnolen: I want that too (am using chrome + clojurescript). unlike me, you have talent, please write it :-)
13:26logic_progdnolen: we'll be willing to lose 1 months worth of blog posts in exchange for it
13:27dnolenlogic_prog: well considering how many other people works on source_maps who weren't familiar w/ the compiler I sure you can find a place to pitch in too.
13:27dnolens/works/worked
13:27cemerickdnolen: if you can write devtools extensions in js, then the path is clear. Though, what would having the REPL in devtools get you over a regular brepl?
13:27dnolencemerick: evaluation in stack frame
13:28cemerickah
13:28si14_dnolen: is it possible to add renderToString into Om?
13:28dnolensi14_: open an issue
13:29si14_dnolen: I'm playing around using Rhino to render the page, but I can't do it without it. I've tried to fake DOM for some time, but this wasn't successful.
13:30si14_*without renderToString
13:30dnolensi14_: we need it, open an issue I will add it and it'll appear in the next release
13:30si14_dnolen: ok, just wasn't sure that it worth an issue :)
13:31cemerickdnolen: it'd be nice to see if the existing brepl client-side stuff could be hoisted up into that environment when necessary, so all existing tooling could benefit. I don't fancy the notion of setting up whole separate compilation pipelines when there's already one sitting right there.
13:32si14_dnolen: done
13:33cemerickdnolen: oh, OT, unsigned-bit-shift-right needs to be added to the :refer-clojure :exclude in cljs/core.clj
13:33dnolencemerick: ah right
13:34dnolencemerick: yes I think it should be able to hook to existing running brepl
13:34dnolencemerick: it's only to be able to eval and set namespace, everything else is gravy
13:34dnolensi14_: thanks
14:09katoxhmmm, the prn issue seems to point down to dynamic bindings
14:09pandeiro<dnolen> cemerick: I so want a ClojureScript Chrome Dev Tools nrepl thing,
14:09pandeiro that + source maps would just be so awesome <-- amen
14:09katoxdnolen: is it supposed to be safe to use dynamic bindings with core.async?
14:10dnolenkatox: not in ClojureScript yet, it works in Clojure
14:10pandeirochrome, not content to be just a browser, or just an OS, is close to being a web dev IDE
14:11katoxdnolen: I see, that must be the source of the prob here: https://www.refheap.com/22564
14:11katoxdnolen: that's missing in cljs?
14:11stuartsierraOh darn, and here I was hoping core.async would finally kill dynamic binding. :P
14:11technomancylaziness already killed most dynamic binding
14:11dnolenkatox: not just missing, how to convey binding properly in CLJS is a big open question
14:11dnolenkatox: don't expect it to work anytime soon
14:12pjstadigdynamic binding has its uses
14:12katoxI don't really use it ... just bumped into this bug
14:12katoxSo I investigated it more and it pointed me to dynamic bindings.
14:15katoxstuartsierra: are there any real alternatives? I'm aware of threading probs
14:16katoxstuartsierra: in most of my code I just pass some kind of ctx explicitly (not super nice)
14:16stuartsierraDynamic binding is useful where true thread-local behavior is desired.
14:17stuartsierraPassing arguments explicitly is more reliable and easier to understand.
14:17tbaldridgebut most of the time, thread bindings are used when you want just don't want to refactor your code :-P
14:17tbaldridge*when you just don't want to refactor...
14:17jcromartiewe're having that very same argument
14:17jcromartiethere's nothing simpler than an argument to a function…
14:17stuartsierraFrankly, I consider code which relies on binding conveyance across threads to be broken.
14:18tbaldridgestuartsierra: although that becomes a bit more of an issue in core.async where different parts of your fn could be run on different threads
14:18jcromartieyou can always turn a bunch of arguments into a big map :P
14:19stuartsierratbaldridge: Right, you shouldn't be using dynamic binding in that case.
14:19jcromartiewe're trying to figure out the best way to handle the many *many* disparate services our app is using
14:19jcromartiewe have a database and at least four other external APIs
14:20jcromartieand so going the argument route is just not working because while we have those 5 services now, it could be 6 next week
14:20stuartsierrajcromartie: https://github.com/stuartsierra/component
14:20jcromartiestuartsierra always has an answer
14:20stuartsierraOr at least a glib response :)
14:20jcromartieit's not really runtime state for the external APIs though
14:21katoxstuartsierra: I'd expect namespaces to be something like this
14:21katoxstuartsierra: reloadable, discardable, with deps
14:21tbaldrid_katox: nah, namespaces should just be spaces for names
14:21stuartsierra^ What tbaldridge said.
14:22etehtseahow can I test library under clojurescript?
14:22etehtseaI mean crosstesting for library that supports clojure & clojurescrupt
14:23katoxtbaldridge_: that doesn't mean to be mutated all day along
14:24tbaldridge_katox: I'm not sure I understand, you just said that namespaces should be a place where you stick DB state. Or did I mis-read your comments?
14:25katoxtbaldridge_: aw, didn't mean that ... that's too far fetched ;)
14:26katoxtbaldridge_: what I meant was that ns could be loaded as sort of objs with dependencies
14:26katoxtbaldridge_: unlike mutable top level globals
14:27TimMckatox: What you're talking about, I think, is "instancing" namespaces.
14:27TimMcor whole libraries
14:28technomancyparameterized namespaces?
14:29stuartsierraIt comes up from time to time (see http://tech.puredanger.com/2013/11/19/state-of-clojure-language-features/) but isn't likely to happen.
14:30technomancyif there were a way to bootstrap an ns equivalent macro it could be done outside the language
14:30technomancyor if there were a way to use non-core functions in ns clauses
14:30technomancywhich is more reasonable and would be great in and of itself
14:30TimMcOr on the other end of things, I guess you'd have to alter var resolution/
14:30tbaldridgeSo how do you solve the problem where module A loads foo<int> and module B loads foo<float>, would those end up being two completely different namespace instances?
14:31technomancytbaldridge: sure
14:31stuartsierratechnomancy: Why the need for arbitrary ns clauses, when you can put arbitrary code at the top level of a file?
14:31technomancystuartsierra: because that's hideous
14:31stuartsierraAh, aesthetics.
14:31tbaldridgetechnomancy: like require?
14:32tbaldridgeI guess that comes after the ns is created, nvm
14:32technomancyalso because lots of tooling reasonably requires ns to be the first form in a file
14:32technomancy~guards
14:32clojurebotSEIZE HIM!
14:32hiredmantbaldridge: you use the existing namespace system to bootstrap a more full featured module system
14:33hiredman(module foo) would create some randomly named ns and know how to map the foo in (module bar :requires foo) to the random name
14:34pepijndevosDoes a function have its name on it, or only the var?
14:34katoxhiredman: sounds like nix (http://nixos.org/nix/)
14:34hiredmansure
14:34expezHow would you create a key to do lookup in a map based on the date? Use strings like "07-01-2014"?
14:35hiredman(module foo :parameters [A B C]) (module bar :requires (foo int float double)) or something
14:35TimMcexpez: Maybe use JodaTime dates?
14:36TimMcI wouldn't trust j.u.Date for that
14:37hiredmanTimMc: pretty sure he is asking because he comes from a place where you can only have certain things as keys (like strings) not because he doesn't trust Date
14:37TimMcah
14:37expezTimMc: Would it even work to use j.u.Date? That was my first thought, but it has millisecond resolution which would make it hard to lookup the keys?
14:37ToBeReplacedexpez: you could (pr-str (Date.))
14:37TimMcexpez: So you want to bucket the dates to a certain resolution, then.
14:37ro_stdnolen: om is looking awesome
14:38mdrogalisYeah, time slice them with multiple tiers.
14:38expezTimMc: I just want to do general lookup, like get me the entry for 01-01-1999, I only need resolution of days.
14:39TimMcSure, so format them to YYYY-mm-dd or whatever.
14:39TimMcYou'll get some weird looks if you use formats like 07-01-2014, of course.
14:40ToBeReplacedexpez: just use j.u.d with pr-str -- pr-str will print edn-flavored values like #inst{yadda} and then you're in data land
14:40pepijndevosHow do you get "Returns the least key strictly greater than the given key, or null if there is no such key." from a binay serach tree?
14:40TimMcToBeReplaced: That doesn't help with bucketing to the day level.
14:41TimMcpepijndevos: I think there's a JDK 7 data structure that supports this.
14:41ToBeReplacedTimMc: you'd only have to bucket if someone created j.u.d's with hours/minutes/econds
14:41TimMcFair.
14:41ToBeReplaceddoesn't sound like his/her use case
14:41pepijndevosTimMc, definitely. Are you siggesting I look at the Java code? Fair suggestion.
14:42expezToBeReplaced: doesn't all j.u.d have that resolution?
14:42TimMcpepijndevos: No, just that if you're on JDK 7 you may already have a data structure you can use that way.
14:43pepijndevosTimMc, I know, but I'm implementing it for AVL trees.
14:43whilo_dnolen: have there been attempts to implement https://github.com/webyrd/slpKanren with/in core.logic?
14:43ToBeReplacedexpez: yeah, but you don't have to use it -- if you don't fill it in you just get zeros past year/month/day... similar to a DateMidnight
14:43TimMcpepijndevos: Ah, so this is a general algorithmic question.
14:43TimMcnot API
14:43pepijndevosyea
14:43pepijndevosI figured it out for the inclusive case(floor, ceil)
14:44expezToBeReplaced: aight, thanks
14:44TimMcAh, I get it now -- with repeated keys you may need to iterate.
14:46pepijndevosNo repeated keys here.
14:47pepijndevosOh, I know...
14:47pepijndevosmaybe
14:47TimMc(and by "repeated" I mean "neither greater nor lesser")
14:47pepijndevosoh
14:48pepijndevosI think I'm not handling the 0 cse of compare correctly. Now I return the node if it matches the predicate, but it might need to descend further.
14:49ro_stdnolen: what problem is rhizome meant to solve?
14:51pepijndevosnowait, that's already to late. If I hit 0, I'm at the wrong node.
14:54jtoyis there a simple way to use a different version of a library from github? I just found a bug and i want lein to use my version instead
14:54technomancyjtoy: `lein install`
14:54joegallo:exclude the version you don't want, and add the version you do want
14:55jtoytechnomancy: sorry, I mean just by pointing my projects.clj to github, I dont want to install the lib on every box
14:55TimMcjtoy: You may wish to republish the library to clojars with your fix, like org.clojars.jtoy/the-lib
14:56TimMcthat's a good way to use a bugfix fork
14:56jtoyok, I'll try that
14:56dnolenro_st: you want to render something that isn't in the app state that need component local state
14:57dnolenwhilo_: not that I'm aware of
14:58ro_stdnolen: aha
14:58dnolenro_st: it's just a way to graft something onto the render tree, cause render is driven by data in app state
14:58ro_stwhat's missing from om, dnolen? what prevents us from using this to build real apps right now?
14:59dnolenro_st: not much, a lot of big things are in, the api will likely change, the issues currently cover what I'm thinking about
15:00ro_stwe've got a lot of cljs to build in the next while. i can't think of a better way to do it. been listening to that podcast. seems like a perfect match for persistent data structures
15:01ro_st#js just runs whatever you tag through clj->js?
15:01dnolenro_st: no, no conversions
15:01ro_sti've not kept up to date with the cljs announcements :-|
15:02chronnoro_st: Which podcast?
15:02bbloomro_st: the #js is a shallow object or array constructor call
15:02dnolenro_st: I would like Om to have more optimizations but what there isn't slow and I think there are enough hooks to optimize if you need it
15:02jcromartie,(cycle ["maybe" "maybe not"])
15:02clojurebot("maybe" "maybe not" "maybe" "maybe not" "maybe" ...)
15:02jcromartiethat's how I feel
15:02ro_sthttp://javascriptjabber.com/
15:02ro_sthttp://javascriptjabber.com/073-jsj-react-with-pete-hunt-and-jordan-walke/
15:02chronnoro_st: thx
15:04ro_stthx bbloom
15:04dnolenro_st: I was concered about React and doing highly interactive UIs, my experience doing a generic draggable + sortable addressed my concerns
15:04dnolenro_st: React rocks
15:04ro_stjust been playing with that and the typeahead
15:04dnolenro_st: and Om makes it play extra nice w/ CLJS
15:04ro_stit's awesome!
15:05ro_sttime to skill up on react. i'm sold on react, simply because of how battle tested it is. facebook.com probably only comes in second to google itself in terms of client diversity
15:06dnolenro_st: Google Closure + React is sweet combo
15:07ro_stlooks like the meat of learning react is the component lifecycle
15:07dnolenro_st: yes
15:07ro_sti'm getting flashbacks to the Flex framework
15:07ro_st-shudder-
15:07ro_stlooks like this time it's actually working as it should!
15:07ro_stGC + React is sweet combo becaus?
15:08dnolenro_st: cross browser issues
15:08ro_stah right
15:10ro_stdnolen: not many issues for om - looks like there's relatively little to get it to where you want it?
15:10dnolenro_st: yeah Om is not destined to do much
15:10ro_stas a wrapper, all the meat is in react i guess
15:11ro_stdo the react guys know about om? have you spoken with them? i wonder what they think
15:11dnolenro_st: oh they know :)
15:11dnolenro_st: my Om post was a huge hit, like 80,000 visits in 2-3 days
15:11ro_stcrikey
15:11dnolenbasically half my traffic for the year
15:11ro_stwell deserved
15:12dnolenro_st: the React devs rock, very helpful
15:13mrhankyhow to catch Error and Exception in clojurescript?
15:13mrhankycatch js/Object e ?
15:14bbloommrhanky: (catch :default e ...)
15:14ro_stit looks like a great complement to pedestal's dataflow stuff. keen to see how the new core.async redesign turns out. we want to build large clientside apps that need that sort of capability. until om, we were just going to go with dommy. but now, i think we have our toolkit
15:14mrhankybbloom, :default catches all?
15:14dnolenmrhanky: yes
15:16ro_stdnolen: the behaviour of react where it'll first write missing dom nodes and then decorate listeners is fully supported with om, too?
15:16dnolenro_st: we don't change any of that
15:17ro_stso we could produce html for existing work sessions on the server and have it all wire up nicely
15:17ro_sti guess the diff capability handles all that
15:17katoxro_st: I'd expect pedestal guys to reafactor to take om into account
15:17dnolenkatox: I doubt that, I think they'll probably just simplify their front end story
15:17ro_stkatox: let's hope so! i'd love to see what brenton thinks about om
15:17ro_stya. their rendering story is already pretty separate from the rest
15:18katoxdnolen: too bad, pedestal is just too heavyweight
15:18dnolenkatox: I think it's in the process of lightening up
15:18rkneufeldkatox: it should be slimming down with 0.3.0
15:18ro_strkneufeld -wave-
15:19ro_stya. 0.3 looks like it'll have a lot less -stuff- in it
15:19ro_stkatox: https://github.com/pedestal/pedestal/blob/master/app/examples/walkthrough.clj if you're interested in seeing where the thinking is
15:19rkneufeldI couldn't say what the timing of that is going to be, but its in good hands. I pulled out some of the new stuff as its own little library to play with it: https://github.com/rkneufeld/cornice (by no means official)
15:19ro_sthave you looked at om, rkneufeld?
15:20rkneufeldro_st: yeah, really exciting stuff. It has gotten us very excited.
15:20mrhankythanks dnolen
15:20katoxro_st: I'll have a look, thanks
15:20ro_strkneufeld: cornice is pedestal-app 0.3 but cljx-ified?
15:21katoxro_st: though I think I can get 80% of what I need from an om atom, cursors and a few wrapper funcions
15:21rkneufeld*prototype* of 0.3.0
15:21rkneufeldI know product folks over here have been mulling over design and are planning a more careful rewrite.
15:21ro_stof course, of course
15:21ro_stkatox: for small apps, sure
15:22ro_stpedestal is aimed at apps that have data streaming in and out of the browser continuously-ish
15:22ro_stie, state is altered by more than just key/mouse/client-side ajax request
15:23dgaffneyhey folks - I have a little web app that I run that has been working reliably for basically all recorded time
15:23dgaffneyjust a few minutes ago it started spewing out some anger about a case statement not having a matching clause - does this sound familiar to anyone?
15:26hiredmanit means what it says, case throws if it doesn't have a matching clause or a default
15:27dgaffneyI know - it's weird that its getting thrown now - nothing outside of its context has changed. It's a case statement on a section of a url's path. All the case statements in this code have defaults. could it be happening in some lower dependency?
15:28mrhankyis there any difference between (:use [foo :only (bar)]) and [bar] ?
15:28technomancymrhanky: http://p.hagelb.org/import-indent.html
15:29hiredmandgaffney: add logging
15:32katoxstumbled upon this https://github.com/jalehman/omtut-starter/
15:32technomancymrhanky: semantically there is no difference, but they imply different indentation rules which communicate something to a reader
15:32technomancy(a human reader)
15:32katoxupdated to lates om, nice
15:35ro_stkatox: nice - dnolen, i think you tweeted that when it came out? looks like he's upgraded it again - might be worth plugging it again?
15:37dnolenro_st: heh, I'd like things to settle down a bit more before I start recommending tutorials
15:37mrhankythx technomancy
15:37dnolenro_st: this is pre-pre-alpha software still
15:37ro_st-grin- true
15:39mrhankycan you guys recommend clojure lecture?
15:41ro_stvideos.lispcast.com is nice for beginners
15:46jcromartieneat
15:53bbloomdnolen: LOL: https://news.ycombinator.com/item?id=7019531
15:54dnolenbbloom: pretty good
15:54dnolenI really don't understand the proliferation of promise libs in the JS world when everyone has to implement a *SPEC*
15:54dnolenyou think they would just join forces and fix one thing
15:56bbloomnevermind that promises are totally the wrong thing....
15:56bbloomvalues are trees... but communication is sequential!
15:56bbloom:-)
16:00teslanickdnolen: People didn't agree on a spec until fairly recently, so it's a little bit understandable.
16:01dnolenbbloom: between Promises and Web Components it great to see the world is standardizing dumb shit
16:05bbloomdnolen: i'm so over standardization
16:05shep-werkreiddraper: all those closes you just did? I think your link for merge into contrib was wrong
16:05bbloomdnolen: defacto standards are the only standards that count
16:06teslanickhipster
16:06dnolenbbloom: sadly that doesn't mean bad paths won't be traveled
16:07dnolenbbloom: I remember browser vendors pushing back on the jQuery selector approach
16:07reiddrapershep-werk: indeed, thanks
16:07shep-werkreiddraper: but congratulations on the inclusion!
16:07teslanickI don't think I've heard anyone opine that promises were bad; I've not used them extensively, but they seem pretty ok to me.
16:07dnolenbbloom: the problem is that people need to solve their problems *today* and waiting for the right solution may mean you encourage and propagate and optimize bad ones
16:08bbloomdnolen: my biggest complaint is that people do that w/o admitting it
16:08reiddrapershep-werk: thanks :)
16:08reiddrapershep-werk: should be easier to contribute again once the move is complete
16:09bbloomdnolen: they lie to themselves & say they are doing it "right".... why? why not just admit you're hacking it b/c you got shit to do? that's totally fine by me. i get that. if you try to perfect everything, you'll never finish, but that doesn't mean you can't admit "i don't understand that, so i'm doing this"
16:10shep-werkreiddraper: I'm one of those people who is on the fence about CAs, but I imagine there are lots of people who can replace me :-)
16:11reiddrapershep-werk: fair enough -- it's a nontrivial subject
16:17shep-werkreiddraper: to make it more amusing to myself, I've considered making my own project with a CA - I think I'm bordering on being hypocritical :-)
16:18shep-werkdo you know what kind of work is involved in transitioning to a CA? I assume it's get approval from all prev contributors?
16:19reiddrapershep-werk: that's what I've had to do with simple-check, yes
16:19stuartsierrashep-werk: http://dev.clojure.org/display/community/Moving+Projects+Into+Contrib
16:21shep-werkthx stuartsierra
16:21shep-werkdoesn't seem like too much work
16:24technomancydepends on how much you like turning down patches for nontechnical reasons
16:26katratxohi all, i need some help figuring out where those `nil` are comming from? i have 2 sequences of uuids (strings) and i want to compare them https://www.refheap.com/22575
16:28hiredmankatratxo: read the docstring for diff?
16:29jcromartieseriously, what the heck
16:29katratxohiredman: i checked it but i can't spot my mistake :s
16:30gtrakjcromartie: it helps out slingshot
16:31katratxohiredman: `things-only-in-a` has a nil which is not present on none of the seqs
16:32shep-werkkatratxo: All sequential things are treated as associative collections by their indexes, with results returned as vectors
16:32katratxoshep-werk: yeap, i just re-read it, sorry
16:32katratxohiredman: shep-werk thanks
16:32shep-werkkatratxo: np - I just learned about diff thanks to you :-)
16:33marissagroveCan anyone suggest a core.async tutorial for a relative clojure newb?
16:33dnolenmarissagrove: tbaldrid_'s video from Clojure Conj is good
16:34dnolenmarissagrove: http://www.youtube.com/watch?v=enwIIGzhahw&amp;feature=youtu.be
16:35marissagrovednolen: Thank you!
17:09stuartsierraIs Jim Crossley here?
17:10corecodeis there some reader magic that allows (.length "foo"), but does not allow me to (let [s "foo", lfn .length] (lfn s))?
17:10Bronsacorecode: yes ##(macroexpand-1 '(.toString ""))
17:10lazybot⇒ (. "" toString)
17:11corecodemacro magic!
17:11corecodethanks.
17:11Bronsanot really a macro
17:11corecodereader magic, ok.
17:11Bronsanot even in the reader :)
17:11corecodeoh?
17:11corecodewhat then?
17:11Bronsait's part of the macroexpander
17:12corecodeok
17:12corecodefair enough
17:12hiredmanit is the compiler, you can only use literal symbols for method names
17:12arrdem,(nth (range 10) -3)
17:12clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
17:12corecodei'm just asking, because i'm trying to prototype a language with clj
17:12arrdemdang
17:13Bronsacorecode: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6506
17:13arrdemcorecode: what are you building?
17:13corecodeand accessing subordinate symbols seems better than using keywords
17:13corecodearrdem: i am investigating a circuit description language
17:14corecodearrdem: as alternative to schematic entry
17:14arrdemcorecode: cool!
17:15corecodewell, i'm not experienced in language design, so i don't quite know how to start
17:15arrdemcorecode: the best thing to do is probablty just write a Clojure DSL TBH.
17:15arrdemcorecode: no need to build a full parser and associated mess when you can just host inside of Clojure or something else
17:17corecodeyes
17:17corecodesyntax is the least of my concerns
17:24arrdemcorecode: do you know how Spice and other circuit systems do their internal modeling?
17:25bitemyapparrdem: http://www.haskell.org/haskellwiki/Applications_and_libraries/Hardware_verification ?
17:25bitemyapparrdem: I'd have pasted you a link to Clojure equivalents but there isn't a wiki so...
17:25justin_smithbitemyapp: what about that one you made?
17:26corecodearrdem: netlists
17:26corecodearrdem: no?
17:28bitemyappjustin_smith: it exists, I bootstrapped some content. Got maybe 2 or 3 edits that weren't mine.
17:28bitemyappjustin_smith: even if it languishes, it was worth it to discover that wiki gitit. Very nice.
17:30justin_smithyeah, it does look cool
17:32corecodebitemyapp: all these somehow seem to compile to vhdl. i'm talking about circuit design.
17:32arrdembitemyapp: link to your wiki? I'll throw content at it at any rate...
17:32arrdembitemyapp: made it to 12.5 before sheer rage made me quit and resume coding
17:33bitemyapparrdem: god damn.
17:33bitemyapparrdem: I beg of you, hit level 13 before I get home tonight.
17:33bitemyapparrdem: http://clojurewiki.com/
17:33arrdembitemyapp: lol we'll see
17:33arrdembitemyapp: it's a Warmachine night so there like as not won't be a "tonight".
17:33arrdemcorecode: I mean... do you have a specific reason not to compile to the industry standard description language?
17:34bitemyapparrdem: well. sometime then.
17:34corecodearrdem: you'd compile to whatever the input format to the layout package is
17:34arrdembitemyapp: if I manage to track down where my processors are misbehaving, I'll go crush my jubilee with pugs. how's that sound.
17:36bitemyapparrdem: <3
17:37devinusdoes anybody know what happened to (def newsletter) ?
17:40eric_normanddevinus: I'm not positive if it's the reason, but the author had a kid
17:41devinusah. damn, i really looked forward to that every week
17:41eric_normanddoes anyone know why clojuredocs.org has not been updated in a while?
17:41arrdemeric_normand: the owner is unresponsive IIRC
17:42arrdemeric_normand: nobody has access to update it
17:42bitemyapperic_normand: are you serious man? We've been griping about this for years.
17:42bitemyapperic_normand: it's like half the reason I made clojurewiki.com - The other being a total lack of wiki.
17:43eric_normandbitemyapp: it was a serious question. I assumed it was dead, of course. I just thought someone might have an answer.
17:43arrdemwhelp, my second JVM tome arrived.. I now have no excuse besides Batbridge/Toothpick from getting started on CinC...
17:44hyPiRionarrdem: what's the issue?
17:44arrdemhyPiRion: ??
17:44lazybotarrdem: What are you, crazy? Of course not!
17:44arrdemlazybot: who asked you!
17:47hyPiRionarrdem: I somehow read tome as tonsil.
17:49arrdem(inc hyPiRion) ;; at least you're honest about being crazy
17:49lazybot⇒ 28
17:50hyPiRionI thought that was evident when I started working on Swearjure.
17:59corecodei don't even know how to maintain a database of objects with everything being immutable...
17:59corecode:/
18:00bitemyappcorecode: ?
18:02corecodebitemyapp: for my circuit description language; i think i want to keep a graph of modules and their connections, but that requires mutating state, or recursing over the mutations (which is more difficult)
18:03bitemyappcorecode: you've never used a log?
18:04justin_smithcorecode: you can recur and pass new versions of the graph to reach iteration in a loop, or, an atom with a map in it is perfectly cromulent
18:04bitemyappcorecode: http://www.martinfowler.com/eaaDev/EventSourcing.html
18:04rasmustocdl == hdl? :p
18:04bitemyappcorecode: you can just fold the graph.
18:05corecoderasmusto: no, hdl typically is used for vlsi design
18:05corecodei.e. rtl
18:05rasmustoah, is yours more lower level then? or analog or something?
18:06corecoderasmusto: just for circuits, i.e. pcbs
18:07rasmustocorecode: ah, makes more sense now. "Circuits" means a lot of different things to me
18:07corecodejustin_smith: unsure about cromulent. atom it is for now.
18:09arrdemBOOYEAH. bytecode works, the assembler works, tests are clean.
18:19jballancholy crap! I actually managed to write flatteno!
18:19jballanchttps://gist.github.com/jballanc/8308717
18:20jballancthe only problem is that it seems I can't get it to ever terminate if run in reverse... :-/
18:21dnolenjballanc: yeah that's pretty normal.
18:21hyPiRionjballanc: for run* or run 1? It's obvious that it cannot terminate "in reverse"
18:21jballanceven for run 1, unless I give another constraint
18:22dnolenjballanc: conda is some voodoo, to be honest I never understood how to properly use it
18:22jballancunfortunately I can't get a unique answer *and* avoid infinite recursion in reverse
18:22jballancdnolen: I didn't either until just now! :P
18:23dnolenjballanc: whenever you have two recursion things get gnarly w/ respect to termination
18:23jballancsubbing conde for conda gives answers like ((1) ([1])) when trying to flatten [[1]]
18:23dnolenjballanc: 2 recursions + appendo ... forget about it
18:23jballanc...because a doubly nested list is also a singly nested list
18:24jballancso, it turns out that so long as I unify q to something before running unwrapo or flatteno it'll terminate in reverse
18:24jballanc (cl/run* [q] (cl/== q [[[1 2]]]) (unwrapo q [1 2]))
18:24jballanc...but I think this'll work for my purposes
18:26jballancah, I think that last match term on unwrapo is unnecessary
18:27jballancit took me a while to realize that the trick was to reverse the base cases for unwrapo and flatteno with conda
18:29hiredmanjballanc: I can't imagine flatten is any less gross in the logic program as it is else where
18:29jballanchmm...I feel like I should be able to get rid of that last appendo in flatteno too with the right pattern for matching o, but my brain is fried right now
18:30jballanchiredman: yeah, I spent the better part of the last 10 hours or so noodling over this :(
18:30hiredmaninstead of trying to write a flatten relation you should just get rid of need for it
18:30jballancwell, maybe not quite that many
18:30dnolenjballanc: crazy what 20 lines of code can do to your brain
18:30technomancyhiredman: but logic programming makes everything better
18:30jballancheh
18:30hiredman~flatten
18:30clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
18:31jballanchiredman: the issue is that if I don't have flatten, everything else further downstream just gets super gnarly
18:32jballancI need to be able to check membership, which is fine when you can iterate a list normally, but it's a bitch in core.logic
18:32jballanc...if the list isn't flattened, that is
18:32jballancwith a flattened list, it's as easy as membero :)
18:33dnolenjballanc: in my experience I don't find data transformation particularly fun in core.logic
18:33dnolenjballanc: it much better to put data in that's already in the right shape
18:33jballancdnolen: yeah, definitely something I'm going to be keeping in mind going forward
18:33hiredmanjballanc: if you know the nesting you don't need anything as general as flatten, if you don't know the nesting you are doing it wrong :)
18:33dnolenjballanc: core.logic works best when you're looking for patterns in data
18:34dnolenjballanc: or generating data from existing patterns
18:35jballanchiredman: so, the problem is I have > 1000 java class files, with mixed-up interdependencies, and I'm trying to figure out what order I can compile modules in such that all imports are satisfied either by the classes in the group being compiled or in a previously compiled group
18:35jballancso, I'm using (or trying to, at least) core.logic to construct a build order
18:36hiredmanjballanc: use a graph library and do a topological sort?
18:36jballanchiredman: yup, that's what I started with
18:36jballancbut I have other plans for core.logic down the road
18:36jballancthis was more of a push myself/core.logic to the limit and see what's possible
18:37dnolenjballanc: well rule of thumb, if you're doing anything more complex then concatenating lists, you probably want to do it in Clojure first
18:37clojurebotNo entiendo
18:38hiredmanand flatten is gross
18:38jballancno argument here :)
18:38hiredmangreat, so you'll stop trying to use it, wonderful
18:39jballancwell it's definitely been a good katta
18:40jballancbah...I mean kata
18:40jballancwow...I had no idea the difference a "t" can make
18:43the-kennydnolen: Is it expected that `first' on a MapCursor doesn't work? I thought it's implemented in all map types?
18:44dnolenthe-kenny: can you be more specify, MapCursor implements ISeq
18:44dnolener I mean ISeqable
18:44dnolens/specify/specific
18:45the-kennyNevermind :/ My bad
18:46the-kennyI was just updating a small Om test application I had lying around and used a wrong value
18:46the-kennySorry for bothering you
18:46dnolenthe-kenny: it's no problem
18:47the-kennyI still have to build something bigger to get more used to it
18:47the-kennys/it/om/
19:16hansel-hanIf you had a dedicated box with a webhost for years and, in a turn of events, you weren't around to pay the $300 bill for December (due the 3rd) so they parted the server out on December 27th, would a webhost probably have your data retained somewhere?
19:17justin_smithhansel-han: ouch - that seems very short sighted that they would part out the box of a long term customer because one bill was late
19:18hansel-hanjustin_smith: yeah, i agree. it's far from compelling
19:19hansel-hani'm just waiting back to hear if they at least have my data
19:20justin_smithdid they at any point say "we have a data archive and backup service you can't refuse" by any chance?
19:24benkayhas anyone ever set leiningen up to accept remote connections? i'd like to boot leiningen's REPL inside a Docker container inside a Vagrant VM (yo dawg i herd u liek virtualization) and then attach to that via Emacs/Cider on my host OS X box so that the stateful things I want to do to the machine on which my JVM processes is running are nicely isolated. thoughts?
19:25benkay(btw I have successfully booted `lein repl :headless :port 8191`, but am failing to connect to it from either the host vm or my host os x machine)
19:27justin_smithbenkay: I use ssh -X to tunnel in in order to connect to a repl on a remote box
19:27justin_smiththat should work w/ virtualization too
19:28hansel-hanjustin_smith: heh, dunno. but they just sent me this "I'm sorry but I can only confirm what billing has already said which is that the server has been parted out and the drives have been wiped. We're here at any time if you would like to have a dialogue about future backup strategies.
19:28hansel-hangonna assume that's a wipe
19:29justin_smithman, that sucks
19:29hansel-hani know that it's my problem that i backed up my forum to the same host i hosted it on (lesson learned) but for what it's worth, the webhost is wickedfire.com
19:29hansel-haner
19:29hansel-hanwiredtree.com
19:50benkayjustin_smith: do you repl raw or run an emacs instance on those machines?
19:52darthdeushey guys, i'm having trouble with various clojure web thingies (now clojurescript) in chrome
19:53darthdeusbefore that i got weird content-length with luminus, and now with cljs i'm getting "exceed max line 4096"
19:53darthdeuseven though the page renders in sfarai
19:53akurilinWoot, just managed to power through 150+ topics on the mailing list, almost catching up with it. Every page has around 3 announcements of new clojure.jdbc version :P
19:54justin_smithbenkay: raw repl on the server, tramp to edit files on the server
19:54justin_smithand nrepl on my host connecting to the ssh-tunneled local port
19:55justin_smithwhich is really the remote nrepl port of course (above I mean emacs-nrepl of course)
19:55benkaymakes sense
19:55benkaythanks, justin_smith
19:56justin_smithnp - using that workflow I was able to do the "remote machine with resources runs clojure, local machine with UI I want does the editing / repl UI" pretty smoothly
19:57logic_progcemerick: is there a nice way to package *.cljx files into clojure libraries?
20:00nooniani've never used cljx but from the git page it seems like you could just add the cljx.hooks to your hooks vector and it should just work when it builds the jars
20:17konrwhat is that function that can divide a sequence in various equal parts, like [1 2 3 4 5 6] => [[1 2] [3 4] [5 6]]?
20:18amalloy&(doc partition)
20:18lazybot⇒ "([n coll] [n step coll] [n step pad coll]); Returns a lazy sequence of lists of n items each, at offsets step apart. If step is not supplied, defaults to n, i.e. the partitions do not overlap. If a pad collection is supplied, use its elements as necessary to complet... https://www.refheap.com/22581
20:18konrthanks!
20:35logic_progis there anything bad about using zeromq with clojure (besides idiots won't be able to use zeromq) ?
20:44ToBeReplacedlogic_prog: nope, we've used jzmq in production
20:55SrPxHello CLojure community. I've been developing a great, really cool structural editor for lisp-like languages. It runs mostly on the browser. So I would like to know, is there any project for a fast (as in, compilation time) Clojure compiler (or interpreter) running on the browser? This is very important for the feedback cycle of the editor.
20:56seangroveSrPx: No self-hosted ClojureScript compiling yet
20:57logic_progToBeReplaced: noted, thanks
20:57logic_progSrPx: can we try your tool ?
20:58SrPxSad :( logic_prog let me get it straight, it is still early and I don't know its future :/ I'm trying to create a language for it as it seems like there is no other way to do it as of now
20:58SrPxwhich will take some time
20:59logic_progSrPx: I played with something similar in the browser.
20:59technomancythere's a self-hosted clojurescript proof-of-concept
20:59SrPxthere is?
20:59logic_progSrPX: I think the easiest thing is to srite a mini scheme interpreter in clojure.
20:59technomancyjust nothing blessed by cognitecht
20:59logic_progSrPX: it should take about 100 lines of code.
20:59seangroveSrPx: It's a slightly strange idea, why do you need it in the browser?
21:00SrPxlogic_prog: I know, my language is pretty much it already... actually just lambda calculus with arrays and numbers. it is working great, honestly, I've made cool things with it (ie sprite lamp, few games). the editor makes it so easy. but it is above me and my time constraints to get the language to work properly. too much theory... optimizers, stream fusion... i dont know what to do
21:01SrPxseangrove: because... I love the browser
21:01logic_progin theory, you can try to emascripten llvm the jvm
21:01logic_progthen you can get clojure in the browser
21:01SrPxI love the fact I can send a link to someone and he will see what I did without having to download. regardless of platform sex or religion
21:01seangroveSrPx: Yeah, but that's just final deployment
21:02SrPxlogic_prog: llvm the jvm!?? hahah
21:02SrPxseangrove: ... pardon?
21:02seangroveIt's personal preference, but emacs + cider + clojurescript repl, is a very good workflow
21:02seangroveNot for everyone though
21:03benkayso ubuntu universe is only carrying leiningen 1.7.3
21:04SrPx_Sorry my macbook fell out the window, lost anything?
21:04benkayjust you know fyi etc
21:05SrPx_hmm if nobody said anything may I just ask another question that was bugging me other day
21:06SrPx_are hashes the "right" way to store data you would store on objects if you were using an OOP language? (wouldn't it be really slow?)
21:08justin_smithSrPx_: generally clojure hashes are fast enough (they are not just normal hashes) but there is defrecord when you need the equivalent of object field lookup for a performance boost
21:08justin_smithhttp://clojuredocs.org/clojure_core/clojure.core/defrecord
21:09danneuSrPx: coming from ruby? in general you just use maps.
21:09SrPxruby? not really why
21:09danneubecause you called them hashes
21:10SrPxjustin_smith: interesting. thanks! that is what I needed
21:10amalloySrPx: http://logs.lazybot.org/irc.freenode.net/%23clojure/2014-01-07.txt so you can stop asking whether you missed anything
21:10teslanickWhere's that flowchar about when to use each thing
21:10SrPxmay I ask some questions about performance, then? Clojure is pure? Does the compiler use it to apply aggressive inlining? Is there stream fusion or shortcut fusion so (map f (map g x)) avoids the intermediate representation?
21:11teslanickThis: http://chasemerick.files.wordpress.com/2011/07/choosingtypeforms2.png
21:11danneuSrPx: well, map is lazy
21:11danneuit will compose f and g
21:12SrPxteslanick: wow some ways
21:12technomancythe main thingc about records isn't that they're faster but that they use less memory for their keywords
21:12technomancythey're faster than multimethods, but that's different
21:12amalloySrPx: no, none of the things you asked about happen. and clojure isn't really pure, it just encourages purity, so a lot of optimizations aren't possible
21:12amalloybut the JVM is very good, and there are ways to further tune performance for the 1% of cases where it really matters
21:13hiredmantechnomancy: field lookup will be faster too
21:13tommoI'm having some problems binding a context var to 'this' in a proxy, https://www.refheap.com/22586
21:13SrPxdanneu: on is it? Interesting! Thanks. About numeric computation. Something I never understood. If I am dealing with a game / bitmaps, for example, where I need to remap a very big array of pixels every tick. Won't persistent structures make this unbearably slow?
21:13technomancyamalloy: (map f (map g x)) will avoid the intermediate representation of (map g x), if that's what he's asking
21:13tommoalso what's a more clojurish approach to something like that?
21:13SrPxamalloy: oh ... I see
21:13hiredmantechnomancy: no it won't
21:13amalloytechnomancy: no it won't
21:13danneuSrPx: no, because editing the big map doesn't copy the whole thing.
21:14teslanickAll the persistent data structures in Clojure use structural sharing.
21:14technomancyamalloy: the whole thing isn't in memory at once is what I mean
21:14amalloyit doesn't hold it all in memory at once, of course, just like the final result isn't all in memory at once
21:14hiredmanamalloy: it would be more entertaining if we coordinated and switched off every other line
21:14technomancyI guess the question is ambiguous
21:14SrPxdanneu: pardon, I mean, visualize a 1000x1000 arrays of floats. Suppose this arrays is updated 30x/s, that is, every single pixel is modified (as the character moves, for example). Is this a problem?
21:15amalloytechnomancy: in the context of stream fusion i thought it was pretty likely he was asking about whether (map g x) ever actually exists
21:15justin_smithSrPx: clojure can use native arrays, and for a situation like that, I think it is called for
21:15danneuSrPx: in that cast you'd opt in to mutable data structures
21:15teslanickProbably. That's not a really the ideal place for a clojure data structure
21:15justin_smithSrPx: conceptually, those pixels would be generated based on your data, they are not your data
21:15justin_smiththat is how I think of it at least
21:15SrPxamalloy: pardon? I'm not sure what you mean but you can ask me if you didn't understand! You guys are debating what I asked like I'm not here lol
21:16SrPxjustin_smith: sure, so?
21:16teslanickClojure would be the thing before the image generation, so: (clojure gameState) => render => pixel buffer
21:16justin_smithSrPx: that's my rationale for "don't use persistend data structures there"
21:16justin_smithSrPx: persistent data structures are ubiquitous in clojure, but are not manditory
21:16SrPxoh there is those, okay! Learning a lot there. So it is NOT a problem that is inherently slow on the language at all, right?
21:17amalloytommo: i don't understand that paste. how do you know you're having trouble binding *context*, if you never attempt to use it?
21:17SrPxthere are * english is hard
21:17tommoat compile time amalloy: Caused by: java.lang.RuntimeException: No such var: cljscript/this
21:17tommoi think it may be a problem with the macro itself?
21:18justin_smithSrPx: there are tradeoffs but clojure does persistence in smart ways, for DSP or for raster data I would totally use arrays, but most of my data can be persistent data structures without a huge performance hit
21:18technomancyhiredman: I understand record field access is technically faster, but when someone says "use records for performance" that is almost certainly not what they're talking about
21:18justin_smithand that can be fixed where it matters, case by case
21:18technomancy^ "the main thing"
21:18amalloyoh. yeah, the macro is qualifying this. you can paper over it with ~'this
21:18amalloyalthough really i don't see any reason this is a macro at all
21:19tommowhat's a more idiomatic way of doing it amalloy?
21:19tommoim just exploring different approaches
21:19SrPxjustin_smith: uh huh I see, enlightening thanks
21:20hiredmanugh, and the metadata, and def the result of a def
21:20amalloyyou just want (defn make-script [f] (proxy [...] (binding [*context* this] (f))), (def ^{...} script (make-script #(...))
21:20SrPxWell I really wish I could try to plug in my editor into clojure and see how it would go... you guys mentioned an interpreter running on the browser or I'm imagining this?
21:20danneuSrPx: what editor do you use
21:20hiredman(iterate terrible ...)
21:20SrPxone very cool editor for lispy like languages I made
21:21hyPiRionoh man, SrPx is rsm in disguise
21:21tommoo i see, makes sense
21:21justin_smithwell nrepl is the protocol that the standard "lein repl" task uses
21:21danneuhaha
21:21justin_smithyou could implement a client of that :)
21:21technomancySrPx: you can try the experimental self-hosting cljs fork, but it's probably pretty outdated at this point
21:21SrPxWho is rsm? :o
21:21SrPxtechnomancy: that is bad :/
21:22hyPiRionrms*
21:22danneuSrPx: just have your editor talk to nrepl
21:22danneuthat's how all the editors work
21:22technomancySrPx: yeah, I don't understand why it wasn't continued
21:22technomancymabye just the standard hostility to development that happens from outside the core contributors or something
21:22SrPxreally? why?
21:23technomancyhttp://p.hagelb.org/mystery.gif
21:23danneuSrPx: i like that you have your own very cool editor for lispy like languages though. yak shave cred goes a long way here.
21:23seangrovetechnomancy: Do you have those links on autoexpand?
21:24hyPiRionThat's the third time I've seen that link today
21:24technomancyseangrove: not ... yet
21:24SrPxtechnomancy: hahaha
21:25seangrovehyPiRion: Better than the party-time/cool-jazzy-horse one
21:25SrPxsaving that
21:25technomancycurating a healthy catalog of gifs is an important skill for any aspiring computorist
21:25SrPxDeraen: yak shave cred <- what does that mean? me no english
21:25jcromartieyak shaving spans all cultures
21:25SrPxwat
21:25justin_smithhttp://www.catb.org/jargon/html/Y/yak-shaving.html
21:26teslanick"Any apparently useless activity which, by allowing you to overcome intermediate difficulties, allows you to solve a larger problem. -- I was doing a bit of yak shaving this morning, and it looks like it might have paid off."
21:26teslanickFrom - http://en.wiktionary.org/wiki/yak_shaving
21:26justin_smithsomeday I will figure out a project worthy of the name yak-electralysis
21:27jcromartieyakwax?
21:27SrPxThis kinda of makes sense but I still have no idea wether he is supporting or joking about my editor c:
21:27danneuyakshaving http://i.minus.com/ibaDjk7AeIcvxv.gif
21:28pdkwhere can we find this editor
21:29danneupdk: https://github.com/hraberg/deuce
21:29pdkthat's pretty neat
21:29seangroveDeuce is not emacs!
21:29jcromartieyak shaving AKA "because you can't just do a thing"
21:30seangrovepdk: The SkillsMatter talk on it is pretty good
21:30pdkis the talk listed on the source page
21:30SrPxyou guys seems interested in such a thing... maybe it would be a good idea to stop trying to create my own language and use clojure as the language :D
21:30seangroveYeah
21:30pdkor compile your language to clojure!
21:31SrPxlolwat
21:31seangroveJust add instaparse, and you're done!
21:31teslanickI'm going to compile JS to clojure. And from there into clojurescript. And the circle of life will be complete.
21:32seangroveteslanick: Actually, a JS compiler in clojure could potentially be nice. We could do away with the closure compiler, possibly
21:32SrPxteslanick: well if you manage to fit the third cycle on your HD you won life indeed
21:33ambrosebscan anyone with maven-fu work out why core.typed's AOT'ed jar includes all the unit test namespaces?
21:33ambrosebspleeease? :)
21:33hyPiRionI think it would be easier to just port the closure compiler instead of building a VM for JS on top of the JVM, sir.
21:33ambrosebsit's getting big
21:33teslanickI hadn't thought of that. I was about to make a joke about the algorithms being embedded in the text of The King in Yellow.
21:40bbloomtechnomancy: the self hosting cljs port was deeply flawed
21:40bbloomtechnomancy: i forget the guys name. he did reasonably good work, but overall he punted on the hardest problems
21:40seangroveChouser?
21:40clojurebotWho??
21:41bbloomno no
21:41bbloomhttps://github.com/kanaka/clojurescript that one, right technomancy ?
21:42seangrovebbloom: Ah yes, you're right
21:42bbloomhe never managed to reify namespaces or vars. the google closure compiler can't run on the result at all.
21:42seangroveJoel Martin
21:43bbloomoh apparently chouser worked on it too?
21:43bbloomor apparently just worked on it during the conj & kanaka has worked on it alone since
21:44bbloomapparently he didn't get it to self host yet anyway
21:45bbloomanyway, not to shit all over his work or anything, but there are hard problems to self host and still be production caliber. he didn't solve those hard problems. dnolen et al have prioritized other problems
21:46dnolenas I've said before we aren't even that far away
21:46bbloomespecially with lots of little things that have lit up along the way, like constant tables, reified keywords/symbols, etc
21:47dnolenCLJS + Node.js port of tools.reader w/ symbol translation table + native macro expander would take us there pretty much there.
21:52seangroveWow, react has the ability to fix a lot of things that are wrong with the browser. Very nice that they've normalized values/events/attributes on <select>, <textarea>, etc.
21:53teslanickYeah, virtualizing the DOM lets you solve a lot of those problems elegantly.
22:01dnolenseangrove: React rocks
22:02seangrovednolen: Yeah, I'm converting the last of our new app that doesn't use it over to it
22:02seangroveAn incredible improvement over the core.async-focused stuff we had
22:02dnolenseangrove: so much accidental complexity ... evaporated
22:02seangroveReact for the core, core.async shell, it's all so much more straightforward now
22:02dnolenseangrove: yeah I think React is superior to anything built around mostly around core.async
22:03dnolenseangrove: core.async just for the links between components
22:04bbloomcore.async, a bad idea unless it's the only idea left, then it's a damn great idea :-)
22:04seangrovednolen: That's what we ended up doing
22:04bbloomi feel like a proper core.async usage should be like ~20 lines tops
22:04dnolenseangrove: my favorite thing is w/ React/Om + core.async you can write these ridiculously concurrent client side applications
22:04dnolenand actually know what the fuck is going on
22:06seangrovebbloom: I suppose I should thank you as well for pushing the right people to notice ;)
22:06bbloomseangrove: my pleasure, this excitement has been so enjoyable to watch
22:07dnolenso Om made me realize functional lenses are kinda of cool
22:07bbloomseangrove: i'm such a slow implementer compared to some other folks that i know the best way to get ideas across is to concurrently push 25 ideas to 5 or so solid implementers and hope to get like 3 of them to change the world for me :-)
22:07dnolenOm basically gives you a functional lens / zipper via Clojure collection operations
22:07bbloomseangrove: dnolen is a machine
22:07seangrovednolen: I didn't realize what a functional lens / zipper was until that last blog post
22:07seangroveNow it makes quite a bit of sense
22:08bbloomseangrove: this series is where it's at for zipper explainations: http://pavpanchekha.com/blog/zippers/huet.html
22:09seangroveAh, progress
22:09bbloomseangrove: personally, i think kiselyov zippers are much easier to think about than huet zippers, if you realize the call stack maintains the traversal context, which is essentially update-in and friends like that that operate on key paths
22:09seangroveI feel like there's hope to move out of the swamp we've been digging into and drowning in
22:10bbloomseangrove: lenses are super cool too though. the *-in functions approximate them in many ways. who was it here in irc that was exploring that deeper? was that you?
22:10dnolenbbloom: the problem with zippers is the navigation api
22:10dnolenbbloom: much more natural to be able to navigate via ILookup and IIndexed
22:11bbloomdnolen: that's the problem with HUET zippers, not oleg kiselyov's zippers
22:11dnoleni.e. lenses on records and vectors
22:11dnolenbbloom: oh interesting
22:11bbloomdnolen: also perf of huet zippers is only really good if you plan on navigating around the tree kinda randomly & then more or less rewriting everything, where as an update-in style operation performs much better if you only want to change a sub tree here or there
22:12bbloomdnolen: i've written about 2/3rds of my talk for next week, but i think the last 3rd i'll try to cover zippers in detail :-)
22:12dnolenbbloom: got it, cool
22:12dnolenbbloom: sweet looking forward to it
22:13bbloomdnolen: in short though, huet zippers are the derivative of the data type & oleg's zipper's are the derivative of a traversal procedure over that data type :-)
22:13bblooman inside out tree tree vs a path pulled from the traveral's stack ;-)
22:16seangrovebbloom: Going to be recorded at all? I'd definitely be interested in hearing it
22:16bbloomseangrove: i'm pretty bummed that my fipp talk wasn't recorded last year, so i'm gonna bug david greenberg to make sure he brings the camera/stand this time :-)
22:17seangroveAh, yes, that would have been nice too..
22:17seangroveI think we'll hold off on the Om/react talk until next month for the ClojureScript SF meetup
22:17seangroveGive people a chance to prepare a bit more, and for Om to become just a little less bleedy-edgey
22:29seangrovednolen: Now that I have the dev version of react, it's even nicer. Any chance there's something Om could do to fix this warning though? http://dl.dropbox.com/u/412963/Screenshots/9b.png
22:30seangroveThe "Check the render method of undefined"
22:30seangroveI've noticed that Om could probably be slightly nicer about the names it generates for stack traces, etc.
22:35technomancybbloom: ah, thanks for the clarification
22:35technomancyseems like a shame for all that to be thrown away
22:36technomancyI guess it was just poor communication or somthing
22:36bbloomtechnomancy: it was more like zero communication
22:36technomancythat would do it
22:40dnolenseangrove: I don't know how we can improve that one
22:42dnolenseangrove: not sure what you mean about improving names in stack traces
22:43seangrovednolen: I could be off, but whenever an error happens in the render method of some om/component, the call site is usually in a method calld e.g. t432534
22:43seangroveBut I'll come back to you with a specific example
22:43seangrove(later)
22:43seangroveWay behind for today as-is
23:07sritchiehey guys, is there a way to only have a compojure route match if a matched component passes a predicate?
23:08technomancy~guards
23:08clojurebotSEIZE HIM!
23:08technomancyget it? because pattern matching?
23:09technomancyyeah, um sorry
23:10logicprogare there any best practices when it comes to writing multi machine distributed clojure code?
23:11tbaldridgerabbitmq + core.async?
23:12technomancyI can confirm that sending sexps over rabbitmq is pretty great
23:12logicprogwhy not zeromq?
23:12technomancyzeromq doesn't provide the primitives you need
23:12logicprogI'm also tempted to have clj code run in individual node.is instead of one gigantic jvm
23:13logicproghmm,reading zeromq guide and liking it
23:13technomancyit's not a message queue; you have to build a coordination scheme on top of it before you could use it for that
23:13seangrovelogicprog: best practice #1 - don't do it if you can avoid it at all
23:13technomancyit's not bad, it just does a lot less than what most people think
23:13seangrovelogicprog: zeromq is more like sane sockets
23:16ToBeReplacedzeromq when you want/need brokerless messaging... it's a bad fit for anything that requires any kind of guarantees
23:17ToBeReplacedthat's a bit of a generalization, but that's what we're doing here, right?
23:56andrew__I'm reading a book on Clojure, and on one page it says: "Remember always that macros execute at read time, not runtime." Then on another page, it says: "Lisp is powerful, providing a compiler and macro system at runtime." This seems contradictory, doesn't it?
23:57CaptainLexandrew_: That's because you can use Clojure in two different wats
23:57CaptainLexways
23:58CaptainLexYou can use it as a compiled language, right, by writing normal files and then running a program like through lein run
23:58CaptainLexOr you can use it at the REPL
23:59CaptainLexAt the REPL, the compilation and run steps happen really quickly
23:59andrew__and what is the other way?
23:59andrew__oh, sorry, didn't scroll down
23:59andrew__I see.
23:59CaptainLexSo, the thing about macros executing at read time means
23:59andrew__the REPL would be the "read time" answer, while the file is the "runtime" version, yes?