#clojure logs

2013-08-28

00:01bbloomi've got a toy interpreter that is dispatching on type & experimenting w/ some of the ideas related to Cleff. in the theoretical background for algebraic effects, they consider it an effect to allocate a new "effect instance" which, if you're dispatching on type, must be a jvm type
00:01bbloomknowing full well that this interpreter is mega slow & will always be
00:01bbloomi just want it to not like EXPLODE
00:01bbloomso i wonder if types ever get GCed or anything like that
00:02bbloomotherwise, i need to add dispatch on instance, which i might have needed to do anyway :-P
00:03bbloomie something like http://dev.clojure.org/display/design/specify+i.e.+reify+for+instances
00:04bbloom*shrug* just wondering. probably won't change my hacky hack hacking either way
00:06grandyjust learning clojure and had a quick question. Trying to use the serial-port library with lein and apparently this library has binary deps and so only works with cake (https://github.com/samaaron/serial-port/issues/2). Anyone have any advice for how I ought to proceed?
00:07amalloygrandy: that's a two-year-old issue; lein has long since gotten support for native dependencies (although i don't know how to do it)
00:08grandyamalloy: ahh ok, i was hoping that would be the case. So I guess I should google for native dependencies lein
00:08bbloomhold on, i was on the PR for that… i can dig it up
00:09bbloomhttps://github.com/technomancy/leiningen/issues/898
00:10bbloomactually, that's a much more specific issue
00:10bbloombut it might help you find what to grep for. sorry, good luck!
00:11technomancyso... who wants faster lein task runs?
00:11bbloomactually, it's not so bad. i don't really feel the need to complain, but i basically live in the repl
00:12grandybbloom: thanks
00:12technomancybbloom: try a grenchman: https://github.com/technomancy/grenchman
00:13bbloomah, so this is your ocaml project :-)
00:13technomancyyes indeedy
00:13technomancyhttp://p.hagelb.org/grench <- 64-bit linux binary if you don't want to pull in the whole compiler chain
00:13bbloom`grench` is quite a bit longer than `lein` :-P
00:14technomancyhm; almost 50%
00:14bbloomthose extra characters are gonna suck up all the time i save with faster load times
00:14technomancythere's a cost to everything
00:14technomancytanstaafl, &c
00:14bbloom:-D
00:16bbloomi think i said this last time, but ocaml is so much easier to read than haskell
00:16grandynot trying to flood the channel with extremely dumb questions, but just curious, it would appear that serial-port would work with lein, so is it likely that I'm just doing something else wrong in trying to use it? https://clojars.org/serial-port
00:16bbloomi've written 10X and read 100X as much haskell as ocaml or ML, but meanwhile, i can actually read/write the latter
00:16technomancybbloom: because of fewer monads?
00:17technomancy(I have never tried to read haskell)
00:17technomancynot having whitespace-sensitivity is nice though
00:17bbloommore parenthesis :-P
00:17technomancyheh, well I might be putting them where it's not necessary
00:17technomancyI haven't internalized all the insane precedence rules
00:18bbloomthe bigger thing is that the type-level language in ocaml is MUCH SMALLER
00:18brehauttechnomancy: moar dollars!!1
00:18bbloomhaskell is really TWO languages: a term language and a logic engine. the logic engine has totally different syntax...
00:19brehauttechnomancy: http://www.haskell.org/haskellwiki/Keywords#infix.2C_infixl.2C_infixr is why you cant internalize all the precedence rules
00:19bbloomgood news is that you can solve a rubix cube at compile time!
00:19RaynesI
00:19RaynesI'm totally going to rewrite grenchman in Haskell.
00:21brehautbbloom: also, they added a functional view on the type system a year or so back, so you dont have to treat it as a logic engine
00:22bbloombrehaut: nice.
00:22brehautbbloom: also hugely magical
00:43wei_I'm expecting (let [u (<! c)] (.log js/console u)) to give me a value on the channel. but instead it prints the channel itself. what's going on?
00:44hiredmanwei_: are you sure you don't have a channel on a channel?
00:44hiredman(do c and u print out the same?)
00:47wei_actually, <! seems to not block like I expect. let me post a small gist, thanks for the help
00:51wei_https://gist.github.com/yayitswei/6362139
00:51wei_are you allowed to use macros inside of go blocks?
00:55amalloywei_: yes, but you can't use >! or <! from inside a lambda, and many macros expand into lambdas
00:55amalloygo can only transform the current local function, not any functions called from it
00:56wei_amalloy: i see, thanks
00:59wei_so in my code above should I just expand out the shoreleave.remotes.macros/letrpc macro
01:02amalloyuhhhh, if that were a solution you wouldn't have to do it: that's the macroexpander's exact job. the problem is that this macro expands to something that go can't work with
01:02rhg135quick ?, is theere a way to recurse on every item of a seq or is it a code-smell and I should refactor?
01:03amalloyit expands into something like (remote-callback "some-path" [some-args] (fn [result] (<! ...))), which can't be put into a go
01:04amalloyrhg135: i think that describes how almost everything works in a functional language, at a low level, so you have to be more specific about what exactly you want and why you don't like what you have
01:05rhg135im working on a fs, and i want this function to return a vector on a file node but recurs on it's subfiles if it's a directory
01:05rhg135huh
01:05rhg135typing it out it makes no sense
01:06rhg135i guess ill have to refactor a bit
01:07rhg135maybe return a map regardless of node kind
01:09wei_amalloy: oh right. so I have to turn the callback form into a blocking call instead
01:10amalloyrhg135: look up file-seq and tree-seq
01:11rhg135no i'm writing a fs, but yeah the source code may help
01:11rhg135thx
01:11rhg135also this is my current code https://www.refheap.com/18094
01:14futileDoes Clojure have something like select(), or something that can more efficiently communicate over a socket than just spawning new threads all the time?
01:14rhg135heh turns out I was re-implementing tree-seq
01:15rhg135amalloy++
01:15futile(inc amalloy)
01:15lazybot⇒ 70
01:15rhg135oh
01:15bbloomfutile: the JVM doesn't have anything like select… unless you count something like core.async
01:15futileYeah, you don't want to inc him much more than this. He'll get a big head.
01:15bbloomfutile: actually, that's not true. check out nio
01:16futileOkay, thanks.
01:16bbloomnio has Selectors
01:16bbloomfutile: more generally though, the JVM doesn't have anything like WaitForMultipleObjectsEx
01:16bbloombut if you only care about OS-level sockets, then nio will do the trick
01:17futileGreat.
01:18bbloomthe nio API is absurdly complex
01:18futileYeah, I'm not going to deal with that tonight.
01:19bbloomit's got about 37974353 interfaces w/ the idea that you can implement your own selectors, but it turns out that lots of stuff is incorrectly private or package level & it's actually impossible to implement custom multiplexing for your own objects
01:19futilebbloom: wow, that's a terrible design flaw.
01:20futilebbloom: I guess they need a nnio now
01:20bbloomi think they just need to make 2 or 3 private things public & write a scary docstring
01:21futileBut backwards incompatibility!
02:08futileI want to be that guy that's really smart and helpful but nobody's ever jealous of because he's always making you feel good about yourself and he really believes in you.
02:09futileBut he does really cool things like works at NASA and writes compilers and text editors and stuff, but he also always seems to find time to sit down with you for however long you want to just chat about what you want to chat about.
02:10ddellacostawoah, I didn't realize grenchman existed until now. freaking cool
02:10futileYeah.
02:10futileJust found it via trptcolin's public activity.
02:10futileWeird.
02:12futileWhat's the best way to parse Clojure code given as a string, and get data back about its structure?
02:18rhg135Read-str?
02:18futileWhere's that located?
02:18futile,read-str
02:18clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: read-str in this context, compiling:(NO_SOURCE_PATH:0:0)>
02:19rhg135Ing
02:19futileIs there a variation that can support partial forms, like "(+ 1 2" and give you back a data structure with information about how it's unfinished?
02:19rhg135
02:20rhg135Um*
02:20s4muel,read-string
02:20clojurebot#<core$read_string clojure.core$read_string@17b18c3>
02:20s4muel,(doc read-string)
02:20clojurebot"([s]); Reads one object from the string s. Note that read-string can execute code (controlled by *read-eval*), and as such should be used only with trusted sources. For data structure interop use clojure.edn/read-string"
02:21futile,clojure.edn/read-string
02:21clojurebot#<CompilerException java.lang.ClassNotFoundException: clojure.edn, compiling:(NO_SOURCE_PATH:0:0)>
02:21futile,(use 'clojure.edn)
02:21clojurebot#<SecurityException java.lang.SecurityException: denied>
02:21futile:(
02:21futile,(require '[clojure.edn :as e])
02:21clojurebotnil
02:21futile,e/read-string
02:21clojurebot#<edn$read_string clojure.edn$read_string@100a79b>
02:21futileNeat.
02:21futile,(e/read-string "(+ 1 2")
02:21clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
02:21futile:(
02:34callen,(e/read-string "(+ 1 2)"
02:34clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
02:34callen,(e/read-string "(+ 1 2)")
02:34clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: e, compiling:(NO_SOURCE_PATH:0:0)>
02:34callen,(require '[clojure.edn :as e])
02:34clojurebotnil
02:34callen,(e/read-string "(+ 1 2)")
02:34clojurebot(+ 1 2)
02:35callenfutile: ^^
02:35callen,(eval (e/read-string "(+ 1 2)"))
02:35clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
02:35callen"SANBOX"
02:35seangrov`hah
02:35futilecallen: I'm trying to get information about an unfinished form.
02:35futilecallen: i.e. that "(+ 1 2" is only waiting on one level before it's fully closed.
02:48murtaza52+cnt
02:49futilewat
02:59clj_newb_2345anyone have a toy impelemtnation of sql in clojure?
02:59clj_newb_2345(I'm not looking for production use; just something for reading the code
03:00futile(inc augustl)
03:00lazybot⇒ 1
03:27SegFaultAXHickey's most recent talk is sort of strange.
03:27SegFaultAXIt's interesting, but I think he leaned a little too hard on the music analogy.
03:36ambrosebsSegFaultAX: FWIW I loved it.
03:36ambrosebsI might be biased as a muso.
03:37ambrosebsThe analogy of things doing "one thing" really makes sense in the context of musical instruments.
03:37ambrosebsIMO
03:41ivanI wish infoq served video+slides mp4s or could play at faster speeds
03:42shaunxcodeSegFaultAX: which talk is that?
03:42ivanhttp://www.infoq.com/presentations/Design-Composition-Performance
03:51ka_\quit
04:55ddellacostais there a way to pass in a string to re-pattern so that it escapes regex chars?
05:11kralnamaste
05:22noididdellacosta, http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#quote%28java.lang.String%29
05:23ddellacostanoidi: thanks. I feel like this should be an option with re-pattern (or an alternative function), but I can see why they wouldn't want to do that by default.
05:23noidi,(java.util.regex.Pattern/quote "\\s")
05:23clojurebot"\\Q\\s\\E"
05:25ddellacostain any case, I just ended up manually escaping the "problem" characters, since it was just a few. If I was doing this on a larger scale I'd probably be using Pattern/quote.
06:38fuzhey guys, i'm using clojurescript but i'm having an error in my generated javascript. i don't know if it's a bracketing problem as I used to get two errors rather then just one. can someone take a look? http://pastebin.com/jSpKq52f
06:39clgvfuz: you should post the error message as well as a more explicit problem description
06:40fuzin general, the async channels work - i just get an error just before the 'hello from inside the channel!' - in Javascript, Uncaught TypeError: Object [object Object] has no method 'call'
06:41fuzthe last time i got this error, it was to do with bad brackets, so i'm a bit confused why it works and i still get an error
06:41fuzcould it be clojurescript?
07:50ciphergothHow nervous do I need to be about a blocking response to an HTTP request in Aleph?
07:50ciphergothDo I need to be strict about making everything properly asynchronous?
08:56arcatanis there some command-line program for sending commands to nrepl that does not incur JVM startup times?
09:01arcatani guess i could hack grenchman a bit to do that
09:23wei_is there a shoreleave/fetch like library that blocks instead of uses callbacks? would ilke to use it with core.async
09:29dnolenwei_: you can easily make a callback based library work w/ core.async
10:12noncomwhat is the best fifo stack for clojure? i need to be able to read the arbitrary stack entries too..
10:12noncomwill core.cache do/
10:12noncom?
10:12wei_dnolen: could you give an example of converting a callback-based library to work with core.async? my problem was that I couldn't use a go block in a lambda
10:13clgvnoncom: vector is a stack
10:13clgvbut a stack is first-in-last-out
10:14noncomclgv: i thought about vectors.. is it idiomatic to do a fifo with a vector?
10:14noncomwon't it pollute memory?
10:14clgvnoncom: what exactly do you want to do?
10:14noncomi need to keep a history of events coming from network. say i want to keep track of 100 last events
10:15noncomand be able to access all the stored events if i need to
10:15noncombut most often i only access the last one
10:15clgvnoncom: do you need a persistent data structure?
10:15clgvthere is clojure.lang.PersistentQueue for that case
10:16noncomi think that the queue has to be synchronized because some other thread might be reading the stack, while the netwrok acceptor will push in a new event, removing the old one
10:16clgvhmm well you need only the last element most of the time and less often the previous ones?
10:17clgvdo you discard the whole structure after you processed it?
10:17noncomclgv: it depends. these events are spatial coordinates. if the processor will need previous coordinates, say, to build a characteristic of the curve (a gesture), it will need them. this is for touch interface
10:18clgvnoncom. so if you need FIFO you can use clojure.lang.PersistentQueue within an atom
10:18noncomdiscard is only done if event becomes too old (number 101) or the touch is released, when the whole history is discarded since the touch is no more
10:19clgvor a reference if you need to coordinate more than just the queue
10:20clgvnoncom: hmm sounds not as if there was some datastructure implemented for that yet. you need a bounded queue
10:20noncomin java i used a linked list...
10:21clgvhmm you could use one of javas data structures in java.util.concurrent - there are bounded queues
10:21noncomvery good, i will look into those!
10:24noncomclgv: if i'll just go with atom with [], will it litter the memory much?
10:24clgvnoncom: you cant use vector in a non-destructive way as FIFO queue. that is not possible
10:26noncombut if it is stored in an atom, then i can (conj (drop veñ 1) evt), and whatever thread works with that atom, it works with the dereferenced value, and that ensures thread-safety... ?
10:27muckerHi all, I am looking for a template engine which is like jinja (template inheritance (have existing templates)). Does clojure have one ?
10:28clgvnoncom: I'd use ArrayBlockingQueue
10:28ro_stmucker: i've not used it, but selmer might do it for you: log-for-time-period
10:28noncomok, i'll try
10:28ro_sterk
10:28ro_sthttps://github.com/yogthos/Selmer
10:29muckerro_st: great ! thanks
10:29clgvnoncom: in case of conflicting changes atoms will retry the computation
11:08deechHi all, how do I pass a mutable variable to a Java function? For instance pass a Colloection from the Clojure side that will be filled up on the Java side.
11:09llasramdeech: Just like with Java, you'd just pass a reference to a mutable object
11:09llasramFor example, a new ArrayList: ##(java.util.ArrayList.)
11:09lazybot⇒ #<ArrayList []>
11:11deechllasram: Ah, so I couldn't just pass in a Clojure vector, right? I'd have to explicitly create a Collection.
11:11cmajor7deech: why can't your "Java side" return a collection that you can work with later on. e.g. what is a motive of passing an existing (state) collection
11:11cmajor7?
11:11deechcmajor7: Out of my control :). 3rd party lib.
11:12cmajor7the API takes an empty List ?
11:12deechYup.
11:12cmajor7deech: is it a closed sourced API? just curious why would anybody do that
11:14deechHere's the constructor: https://github.com/Cascading/maple/blob/develop/src/jvm/com/twitter/maple/tap/MemorySinkTap.java#L20, and here's where the list is filled (I think):https://github.com/Cascading/maple/blob/develop/src/jvm/com/twitter/maple/tap/MemorySinkTap.java#L52
11:17cmajor7deech: as I read it, it actually expects some "tuples", hence is taking a List (e.g. a list may have tuples at the point of creation)
11:18cmajor7deech: but then since it is not quite obvious what a "MemorySinkTap" is, it's hard to say
11:19cmajor7deech: but yea, if empty is fine then (java.util.ArrayList.)
11:19cmajor7deech: but a list does not need to be mutable, why do you think it should?
11:21cmajor7deech: e.g. clojure vector implements List interface as well: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentVector.java#L19
11:22deechcmajor7: I don't think a list should be mutable. That was my first (non-working) pass at trying to figure out how to pass an acceptable argument to the constructor.
11:22deechcmajor7: In fact I *love* that it is not.
11:23cmajor7deech: right, you said "how do I pass a mutable variable to a Java function?", which lead me to believe you wanted it mutable, but yea, a Clojure vector will do.
11:25rkneufeldyogthos: Congrats on the pragprog beta launch of "Web Development in Clojure" (http://pragprog.com/book/dswdcloj/web-development-with-clojure)
11:26deechcmajor7: thanks for your help!
11:26yogthosrkneufeld: thanks, it's nice to finally have it out :)
11:26ambrosebsyogthos: congrats
11:26yogthosrkneufeld: looking forward to the Cookbook :)
11:27rkneufeldyogthos: Me too! You probably know how stressful it is to be in the midst of writing a book ;)
11:27yogthosambrosebs: thanks
11:28yogthosrkneufeld: it's certainly more work than I originally anticipated, but rewarding as well
11:28rkneufeldMy sentiments exactly
11:28callenI need to get somebody to use bulwark.
11:28callenRaynes: you're on deck.
11:28callenPREPARE THYSELF
11:30seangrov`yogthos: I've heard a lot of authors share the sentiment of the first part of that statement, but not many share the second
11:31yogthosseangrov`: I really enjoyed the experience overall, forced me to learn a bunch of stuff and work on my writing skills
11:32seangrov`It's very cool from an outsider/non-author perspective, but it does seem a ton of work :)
11:32yogthosI won't lie it definitely is
11:32llasramdeech: Wandering back -- are you doing Cascalog foo, or trying to wire up some "raw" Cascading to Clojure?
11:33deechllasram: "raw" Cascading.
11:33callenseangrov`: you think he's got it bad, my idea for a book is to make people do something they don't usually want to do.
11:34llasramdeech: Ok. It might still be worth checking out Cascalog's code to see how they solved these sorts of issues
11:34deechllasram: That's a great call. Thanks!
11:35seangrov`callen: Altruistically may be good, though capitalism may punish you...
11:36callenseangrov`: I know nobody will buy the book, but there needs to be at least one resource out there on how to learn to read code.
11:36callen(that you didn't write)
11:36mlb-As I understand, (swap! x y & z) is something like (apply y x & z). I've come across code where x and y are not parameters. Is it some idiom/shorthand to use swap! instead of apply?
11:37seangrov`callen: Burn it (the code), and rewrite it from scratch. Done.
11:37seangrov`I like the idea though if there are actually helpful suggestions
11:37callenseangrov`: learning to read code, in my opinion, makes people become better programmers faster - by an order of magnitude.
11:37llasrammlb-: swap! is for mutating atoms -- if you didn't know that?
11:37alexyakushevmlb: swap! is an apply to change the value of an atom
11:38callenseangrov`: take for example libraries like JQuery. Imagine how much better off JQuery users would be if they understood what they were using?
11:38callenpeople need to be more patient. The rushing around to hammer out code and ship doesn't necessarily make you a better or more efficient programmer in the long run.
11:38seangrov`callen: So how much of it is "reading code" and how much is "understanding the system it describes"?
11:39callenseangrov`: 'tis both laddie. I start from one end and work towards the other. I planned to do it by "modules", each a module a decent sized library or system.
11:39seangrov`jQuery isn't too bad to read, function by function, but understanding the whole module system from the code is pretty laborious
11:39callenfirst I explain reading the code, start extracting common patterns, explain idioms, explain how to identify them, and then work towards tying it together.
11:40callenI'm also in the unfortunate position of writing an entire book about other peoples' code which leaves infinite surface area to be wrong. Sigh.
11:40mlb-llasram, alexyakushev: Oh. my bad. Had confused for haskell swap. Nevermind =]
11:40callenI'm considering a "test" blog post or series of blog posts to see how the idea shakes out in reality.
11:41seangrov`callen: I'd definitely be interested in reading it. Though part of me wonders how much of it relies on the reader's ability to suss out the patters, and how much is the responsibility of the author to maintain proper separation of code
11:41seangrov`Is it meant to work for both "good" and "bad" code bases?
11:41callenseangrov`: learning how to suss out patterns is part of the point.
11:42callenseangrov`: good/bad - haven't decided, I'm not super-duper concerned about the pathological case, the real problem is that 95%+ of programmers don't even read the good code that they rely on.
11:42callenso, why not solve that problem first?
11:42seangrov`Ok, that seems tractable
11:42callenI don't need to fix the universe in one go.
11:42callenI just want to get more programmers in the habit of reading the bloody code they use.
11:42seangrov`I'd like to read a post or two of that
11:47gfrederickswould we expect a (deftype Pair [a b]) to be faster for creation/access than a two-element vector?
11:48gfredericksI'm showing a factor of 6 slowdown and am terribly curious where that's coming from
11:49ambrosebsdeftype is slower?
11:49gfredericksusing (vector x (inc x)) and (second v) versus (Pair. x (inc x)) and (.right pair)
11:49gfredericksyes deftype is 6 times slower
11:49gfredericksI'm working on writing this up a bit more formally with criterium for a gist
11:59gfredericksyep, six times slower with criterium too: https://gist.github.com/fredericksgary/6367436
11:59noncomcallen: maybe somehow enforce that unless you read and understand the code of an opensource library, you cannot use it?
12:01gfredericksoh wait
12:01gfredericksI bet there's reflection in there *facepalm*
12:01ambrosebslol
12:02gfredericks(set! *punch-on-reflection* true)
12:08gfredericksyes deftype is moderately faster; 32ms vs 45ms.
12:13callennoncom: I think that's called just making the library hard to use and undocumented. Not really what I want. I'm in Klishin's camp on that subject.
12:14callengfredericks: you should add ztellman's tuple library.
12:14callengfredericks: to that test, that is. the tuples are WAY faster for things like two elements.
12:15TimMccallen: Nah, even that doesn't work, if you can find another codebase that uses the library. Monkey see, monkey do!
12:15callenTimMc: stop ruining my dreams of coder literacy with cargo cult :(
12:15noncomcallen: hey, i was joking :D.. however, interesting, what is it about Klishin's way? never heard of..
12:16callennoncom: ClojureWerkz crew, cool guys. Care about documentation and nice libraries. :)
12:16gfrederickscallen: I hadn't expected any tuple lib's approach to be substantially different from a (deftype Pair [a b])
12:17callengfredericks: please look at the library.
12:17gfrederickscallen: yessir
12:17callengfredericks: not trying to order you around, I just think it'll be illuminating.
12:22TimMcHmm, it uses a single-segment namespace. :-(
12:24mimieuxtechnomancy: regarding slamhound what does mean the following output? http://pastebin.com/anAGHbLT
12:24kyledMorning all
12:24jamiiThis is fun:
12:24jamiiuser> (eval ^{:line 11, :column 20} [])
12:24jamiiClassCastException java.lang.Long cannot be cast to java.lang.Integer clojure.lang.Compiler.eval (Compiler.java:6597)
12:24nDuffmimieux: FYI, pastebin.com is full of animated ads for anyone not using adblock/noscripts/&c.
12:27gfrederickscallen: this is comprehensive but I haven't seen anything particularly surprising yet; any hints why I would expect it to perform differently?
12:27jamiiuser> (eval '[do (inc 1)])
12:27jamii2
12:28clgv(edn/read (java.io.PushbackReader. (io/reader "samples/seattle/seattle-data0.dtm"))) results in RuntimeException No reader function for tag db/id. although db/id seems to be bound in *data-readers*
12:30clgvcontext: I am trying to do the datomic tutorial in clojure
12:33mimieuxnDuff: now using refheap :D
12:35gfrederickscallen: yeah it's about the same as the deftype; maybe you missed my facepalm about reflection?
12:36llasramclgv: edn/read doesn't use *data-reader* -- you need to pass a map if you want to use tagged literals. Check the docstring
12:37clgvllasram: oh thanks. didnt use edn before...
12:39`cbpwell it IS a deftype just fully featured and 1 deftype per size :D
12:40gfredericks`cbp: exactly, that's why I was wondering what callen thought was so illuminating
12:41noncomdoes anyone know, are there plans to add fast unboxed computations in some future?
12:42noncomi mean without using different quirks to acheive semi-unboxed ones
12:42llasramAFAIK Clojure already uses unboxed primitives for local computations, doesn't it?
12:43noncomyou mean with typehints or coercions?
12:44llasramWell, with whatever gives the compiler sufficient type information to know it can use primitives
12:45noncomyes, i think it is so..
12:46clgvnoncom: it is unlikely that it becomes possible to use primitives without type hints
12:47noncomyes that would require big changes aside from that it is almost undoable while preserving the paradigm
12:47clgvnoncom: what problem do you have with type hints?
12:49noncomno real problem with typehints... i have been talking in this irc some time ago with ppl that there is trouble for supporting floats and ints. just no real support. it seems to worry nobody, but for me it is a real pain.. oh well..
12:49noncomi guess my real problem is that i crave for 32-bit types
12:49noncomunboxed
12:50clgvnoncom: because you have a scenario with huge memory consuption and want to trade precision/range for memory space?
12:51clgvnoncom: in fact you can "patch" clojure to have functions accepting primitive ints or floats with a custom defn/fn but you will need to put all invocations in a macro.
12:52noncomnot really. the main reason is that i work with opengl much and with java opengl libraries. they all use 32 bit floats and ints because all the hardware does. all the implications of clojure havingonly 64-bit support boil down to such significant framedrops (even with all the typehinting and casting i can imagine) that i wake at nights
12:52clgvI managed to use primitive functions being passed as values that way
12:52dnolenbbloom: hrm, I guess with ANF transform will need to carefully propagate line number information
12:52dnolenseangrov`: did you get a chance to try out the keywords branch?
12:52seangrov`dnolen: No, I'll try it now
12:52noncompatch? i would do this. i have been looking at the clojure sources recently but did not start yet tying the ends... your experience is very interesting.. could you tell more?
12:53clgvnoncom: well you need arrays for those functions anyway - so why dont you use int or float arrays?
12:53dnolenseangrov`: thx!
12:53bbloomdnolen: yeah, it's easy to fuck it up anytime you synthesis your own symbols w/o metadata on them
12:53bbloomdnolen: but as long as you're just moving symbol objects, it's not too bad
12:53clgvnoncom: no! "patch"! that means writing macros :D
12:54noncomclgv: arrays are only at the bottom. i have to do dozens of computations which intertwine with opengl java lib calls and them use floats. such an intertwining implies 10x more casts.
12:54noncoms/dozens/billions
12:54clgvnoncom: do you have a short example?
12:55dnolenbbloom: in your version you would extract the original forms and rewrite into ClojureScript form and analyze - but I guess you have to carefully attach the metadata to generated forms and introduced symbols before calling analyze.
12:56noncomclgv: i can post a refheap of an example, i've been working with recently, although i'll have to tear it off of the rest of the code, but it is pretty readable in itself i guess..
12:56clgvdoes datomic have a macro version of datomic.api/q?
12:56bbloomdnolen: i think as long as you reuse the symbols, it's fine, right? or do you need the metadata on the lists too?
12:57bbloomdnolen: also the only reason i really do it the way i do it is b/c parsing is complected with analysis
12:57bbloomdnolen: i'll explain that comment in a moment, gotta finish something for a client
12:58noncomclgv: here: https://www.refheap.com/18111
12:58dnolenbbloom: pretty sure you do if you want accurate stepping information, it's why source maps support lines w/o symbols.
12:58noncomclgv: read from the bottom
12:59noncomthere is a println, but sure i was testing without it
12:59noncomthat piece simulates attraction of particles, according to some law
13:00clgvnoncom: first advice on reading. if you pass data to a clojure function there is no use type hinting it before
13:00noncom300 cubes show a very significant framedrop. about 1500 -> 17 fps. I have recently asynchronized the Control, which makes the calculations, so fps is now about 270, but due to the calculations running in another thread, they lose time coherence and animation is laggy
13:01noncomclgv: typehinting before you mean where before?
13:01noncomfor ex?
13:02clgvnoncom: you should annotate your constants with ^:const then the compiler can infer their primitive type if they have one
13:02clgvnoncom: for example in compute-offsets
13:02noncomit will infer doubles, but will it infer floats?
13:03rurumateI'm trying to connect emacs and the browser to a clourescript repl, using lein cljsbuild or something. lein-cljsbuild's advanced example seems a good starting point. I can manipulate the browser from the cli repl, but the emacs won't play nice yet. Does anyone have this setup (firefox + emacs + cljs-repl) running?
13:03clgvnoncom: not sure. cgrand had a macro where you could check
13:03seangrov`dnolen: As an aside, SpiderMonkey seems to fail on this test: out/core-advanced-test.js:485: Error: Assert failed: (not (integer? 1e+308))
13:04seangrov`Is that expected?
13:04aaelonyhey guys, looking for a bit of advice for a scheduling library. Basically, I am looking for a library to schedule function calls on an hourly interval. I see Chime, Quartzite, and at-at… which one is preferred ?
13:04rurumateaaelony: wait, I'll make a pastie
13:04justin_smithwhat's the predicate that tells me if something can be dereferenced?
13:04aaelonyrurumate: sweet!
13:05justin_smiththat I even want to know at runtime makes me think something is designed wrong... but I assume there must be some predicate
13:05aaelonyrurumate: you mean a refheap ?? ;)
13:06blrmjustin_smith: i think that would be realized?
13:06justin_smith,(realized? nil)
13:06clojurebot#<NullPointerException java.lang.NullPointerException>
13:06jkkramerjustin_smith: (instance? clojure.lang.IDeref x)
13:06justin_smiththat is the case I am looking at
13:06justin_smithcool!
13:07justin_smith(inc jkkramer)
13:07lazybot⇒ 5
13:08noncomclgv: other than that, you think the code is ok?
13:09noncomall the jme-related functions are typehinted in the jme-namespace. typehinting them improved performance, but not as much as i would like to...
13:09noncomjme is the opengl library
13:09clgvnoncom: well you have no primitive functions there so passing doubles/floats/ints/longs leads to boxing
13:09noncomclgv: what about primitive functions?
13:09seangrov`dnolen: I'm getting an error compiling on an certain js-obj form ... will look into it
13:09clgvnoncom: do you know the fibonacci example?
13:09noncomahaha which one?
13:10clgvnoncom: here http://dev.clojure.org/display/design/Enhanced+Primitive+Support
13:11clgvnoncom: but limited to double and long
13:11noncomugh
13:11noncomi'm thinking about looking at clojure sources to make it support ints and longs if it is possible. i think it is a matter of a little job. but who knows...
13:12noncoms/longs/floats
13:12clgvnoncom: no you do not need to change clojure source. you can implement it as a library
13:12noncomi will have to read the fibonacci example carefully when i have some free time today
13:13clgvnoncom: in fact clojure functions are (simplified) only objects of classes that implement IFn
13:13rurumateaaelony: http://pastebin.com/Xz9AtxAs
13:13zphdsis it ok to use (delay..) for creating 'lazy' vars? Like a db connection?
13:13seangrov`dnolen: Seems like it's choking on anonymous functions: https://www.refheap.com/45fd544bac82e81745a19fad5
13:13seangrov`Let me see if it happens with master
13:14jkkramerzphds: yes, quite common
13:14noncomwouldn't it about the compiler's core? adding primitive types knowledge for the compiler does not look like a library case... ?
13:14zphdsjkkramer: cool… thanks
13:14noncomi know about IFn yes
13:14aaelonyrurumate: thanks, man. So quartz is the way to go?
13:16rurumateaaelony: it's not a very nice api, but it works for me
13:17seangrov`dnolen: Ok, ran it on my local copy of master, compiled fine, updated to clojure/clojurescript master, same error. Works if I replace #(... %&) with (fn [& args] ... args). Seems like something has changed around this - is the shorthand no longer allowed?
13:17aaelonyrurumate: cool. have you tried other options and quartz is what you prefer?
13:17seangrov`Not the biggest deal in the worls if not, but worth bringing up
13:18rurumateaaelony: no, I had used quartz in java for some time, so I just ported my quartz code to clojure at some point
13:20cmajor7aaelony: do you need a full blown scheduling framework? will something like a function do: https://www.refheap.com/18114 ?
13:22bbloomdnolen: ok i'm ready to chat now
13:23dnolenseangrov`: seems unrelated since I didn't change anything around anonymous fn's would need more information
13:23seangrov`Ah, specifically it's the %& symbol, this is enough to cause the error: https://www.refheap.com/8a7fe4ec8af9c4f668f392ae3
13:23bbloomdnolen: preserving source tracking data is quite tricky with procedural transforms
13:24bbloomdnolen: symbols are atomic, so it's trivial to reuse them, but composites must have the source data copied
13:24bbloomdnolen: it's doable to auto-copy the top-level
13:25aaelonyrurumate: got it. I''m interested in hearing what people think about each sched lib
13:25bbloomdnolen: you basically have a fn that calls the multimethod, and the fn just calls with-meta to copy that data across
13:25bbloomdnolen: that should cover propagating 90% of the composite data, right?
13:25bbloomas long as :line info is "inherited" down the AST, such that un-annotated forms get their parent's source info
13:26dnolenbbloom: hmm interesting idea
13:26aaelonycmajor7: not sure what "full blown" means for a scheduling lib… I'm looking for an nice idiomatic way to register functions for execution on a schedule, most probably execute on each hour or every h hours
13:26seangrov`dnolen: I'll change the syntax for now to test the keyword-related changes
13:27bbloomdnolen: ok, so that's step 1 & that should basically prevent the transform from fucking us up
13:27cmajor7aaelony: right, so that one function does just that
13:27dnolenseangrov`: if you can git bisect that would be helpful - I don't see how keyword changes could have affected this
13:27aaelonycmajor7: your refheap looks attractive, that might be enough
13:27dnolenseangrov`: or at least write up a ticket if you don't have time for that
13:27coventryI'm trying to set up a lein checkouts dependency. I've got a checkouts directory with a symlink a clone of the tools.reader repository, but "lein deps" or "lein classpath" is failing with the complaint that it can't find "artifact org.clojure:tools.reader:jar:0.7.7-SNAPSHOT in clojars". Do I need to do anything else to get lein to recognize the dependency? https://www.refheap.com/18116
13:27bbloomdnolen: step 2 is much bigger & we should not tackle this now, but i'll mention it so that you understand where we need to go
13:27bbloomdnolen: we need to split analyze into two phases: parse & analyze
13:27seangrov`dnolen: It's not the keyword change, this happens on the latest master
13:28seangrov`Just as an aside
13:28bbloomdnolen: the ANF transform produces normal syntactical forms, b/c that's what the analyzer accepts
13:28seangrov`I'll check it out after I test the keyword stuff
13:28bbloomdnolen: but the syntactical forms are a human interface. the AST is the machine interface
13:28aaelonycmajor7: I suppose the only other nice feature to have would be to be able to easily cancel or change the execution schedule, and perhaps also to check on what is scheduled at a given moment
13:28bbloomdnolen: b/c of the way clojure works, parsing and analysis are mutually recursive
13:29bbloomdnolen: but you can parse something to "i dunno what to do with this" and then analyze & then keep on parsing
13:29dnolenbbloom: ANF won't happen at the analyzer, it will happen in a compiler pass
13:29bbloomdnolen: yes, but after you rewrite, you need to re-analyze
13:30bbloomdnolen: b/c your analysis is no longer valid
13:30cmajor7aaelony: it returns a future, so you can cancel those as you need to
13:30bbloomdnolen: you're introducing new local symbols, so the environment has changed
13:30aaelonycmajor7: that was my next question. sounds perfect!
13:30cmajor7aaelony: I guess changing the execution schedule would be cancel/reschedule
13:30bbloomdnolen: but i do things like `(~fn-sym ~@arg-syms)
13:31bbloomagain, this is step2 stuff we shouldn't be doing now, but ideally we'd do something like this instead:
13:31bbloom{:op :invoke :f fn-sym :args arg-syms}
13:32aaelonycmajor7: i like that. I'll create a collection for the futures and that should work
13:32bbloomdnolen: b/c quasi-quoting implies environment & resolution. that's part of why macros in clj are annoying for cljs
13:33bbloomdnolen: there are multiple environments inside the compiler, so it doesn't make sense to quasi-quote in the compiler's runtime environment when we are working with user-code environments
13:33bbloomdnolen: so right now you need to (analyze form env) but i'd rather (parse form env) and (analyze ast env)
13:33seangrov`dnolen: After change the anonymous fn syntax, code compiles and Zenbox is running fine alongside Rapportive, and the tests pass
13:34coventryAh, I needed to do "lein install" in the checkout dependency directory before it would work.
13:35bbloomdnolen: does that make sense?
13:35futileCan anyone recommend a certain fuzzy-string-matching library for use in a Clojure project?
13:35aaelonycmajor7: I can cancel any future, but how would I cancel the "every" call at some point?
13:36futileAlso, why do we call them "libraries" instead of "spellbooks"?
13:36futileA function is a whole lot more like a spell than a book.
13:36dnolenbbloom: it does somewhat, but it's also not an aspect of the compiler I'm concerned about yet :) it's annoying for sure.
13:37dnolenbbloom: I'm not going to do full ANF, just enough to make a pluggable pass solve this specific issue via ANF transform
13:37bbloomdnolen: yeah, that's why i suggested just doing a no-op pass first
13:37bbloomdnolen: so we can see how much that 1) impacts perf and 2) just to prove we can do it
13:37aaelonycmajor7: nevermind… getting it now
13:37dnolenbbloom: no-op pass is just identity but ok
13:37cmajor7aaelony: not sure I understand what you are asking. "every" returns a future, that you can cancel
13:37bbloomdnolen: well ok more generally: something that annotates every node with metadata like :was-touched true
13:38aaelonycmajor7: understand now.. thanks again
13:38cmajor7aaelony: sure
13:38dnolenbbloom: we can do this, but I'm really not as concerned about the perf of this as I was before.
13:38dnolenbbloom: we already have ad-hoc passes in the compiler
13:38bbloomdnolen: ok then
13:38dnolenbbloom: it probably makes sense to apply the first pass to the ad-hoc one around fns
13:39bbloomdnolen: yeah, the more we can split things up, the better
13:39bbloomdnolen: it's ok to have LOTS of passes if each pass is relative cheap
13:39dnolenbbloom: yep
13:39bbloomthe biggest perf issue is to avoid consuming fuckloads of memory, that's what makes gclosure slow
13:39dnolenbbloom: I'm shooting for [fn-self-recur-pass anf-let-pass]
13:39bbloomthey copy stuff left & right. we have a huge leg up having immutable structures!
13:40bblooms/immutable/persistent/
13:40bbloomdnolen: i think a vector of passes is a good starting point
13:46dnolenseangrov`: excellent, I think I might wait a bit to merge this into master, I'd like to get the ANF thing in, CLJS is taking a big perf hit right now everywhere because we don't have it.
13:47seangrov`dnolen: No worries, I have my fixes locally, I'm able to work on problems for the business rather than the runtime for now. Obviously getting it into master will be nice though.
13:48seangrov`The ANF transforms do seem like a big effort though.
13:58tufflaxI'm making a game. And there are a few subsystems in the game. I thought that most of them need to be updated every frame, so I made a protocol called Updatable, with just one function: (update [this]). But now, I need to pass an argument to one of the subsystems update function, and that's not something my design can easily handle. What am I doing wrong. It seems like such a simple thing, but my design can't handle it.
14:01mlb-I see many hyphenated names used as variables in Clojure. Taking a hint that this is the general style, why am I having trouble with hyphenated class names? Are there some filename/class name issues to be aware of?
14:01cmajor7mlb-: you mean module names?
14:02tufflaxmlb-: as far as I know, class names are written in Java style camel case.
14:02tufflaxmost of the time
14:02cmajor7mlb-: if it is indeed a module name, the name of the files needs to have an underscore instead of a hyphen
14:03cmajor7mlb-: a namespace/module can have a hyphen
14:03cmajor7mlb-: "your-module" would live in "your_module.clj"
14:03mlb-cmajor7: ah, that makes sense. I'd seen examples that followed that rule, but I hadn't seen an explicit rule
14:05cmajor7mlb-: some more info on the subject => http://stackoverflow.com/questions/4420944/why-does-clojure-convert-dashes-in-names-to-underscores-in-the-filesystem
14:15Apage43*cough* I just used leiningen to build a Java project that had no clojure in it
14:16Apage43i feel a bit weird about that, but man was it easier than the other stuff i had handy
14:23llasramApage43: I've got several small internal projects doing that
14:23llasramSide-benefit: it's easy to then write the tests in Clojure
14:23llasramAnd easy to turning it into a Clojure project if you start needing more than boilerplate
14:24Apage43ah, yeah. That's pretty fantastic as well.
14:24Apage43I just needed to bang out a single java file command line tool as an API example
14:25Apage43but it had a bunch of dependencies
14:29callenI'm guilty of doing this too.
14:29callenToo lazy to use maven myself.
14:31hyPiRionme too
14:32TimMcThat's what lein pom is for. :-P
14:32callenTimMc: I do that too.
14:33callenbut that's my point, everything I do with Java or Clojure is wrapped with Leiningen to varying degrees - usually holistically.
14:35brianwongthis may be more of a java problem, but i need help with my standalone jar that i created with 'lein uberjar'. When i run the jar on my mac workstation, it runs as expected. I move this jar onto the amazon linux instance and run the jar. I get this NPE. https://www.refheap.com/18117 . Could this be caused by different java versions?
14:36brianwongmy workstation uses a later version of java than the server.
14:36zphdsguys, is it ok to do assertions in let forms? as in, see if a var is truthy on something or error out before evaluating the let's body
14:36callenbrianwong: sure it's not just a null?
14:36callenzphds: you can do anything you want in a let form, but try to make it nice.
14:36zphdscallen: I also just discovered :pre, :post
14:36zphdsmaybe I will use that
14:37callenalso, I'm not really a fan of "error out" in the sense of an exception
14:37callenI prefer to return and chain nils, short-circuiting ala Option/Maybe.
14:37callenunless it's truly an exceptional case that merits immediate attention from the programmer.
14:37TimMcbrianwong: Given that it's occurring in your config ns, it sounds like something is making your code take a different path in the Amazon env.
14:38brianwongi thought that once i have an uberjar
14:38zphdscallen: ah… interesting… coming from a python world, I am used to raise exceptions… and then handle them
14:38brianwongthat it should be portable and behave the same way on the jvm regardless of host OS
14:38callenbrianwong: the uberjar doesn't freeze your environment variables or make things that don't exist suddenly exist on your deployment target.
14:38brianwongthat is why im wondering if it is a JVM version issue
14:38callenbrianwong: do you understand what environment variables are?
14:39callenzphds: avoid it unless it is truly exceptional.
14:39zphdscallen: yep
14:39callenzphds: consider the ease of use on the part of the caller.
14:39zphdscallen: right…
14:39callenI *hate hate hate* wrapping try/catch around stuff.
14:39brianwongi do know what environment variables are. Im not sure why it is relevant at the moment
14:39callenbrianwong: what TimMc said.
14:40zphdscallen: haha… I guess it's because try, catches doesn't look good in a lisp'y language.
14:40Phil_DDoes anyone have insight as to how to implement a "resolve"-like function in ClojureScript? Its absence is making it difficult to create complex and reusable functions.
14:40callenzphds: I will throw exceptions for things like configuration variables that should never be null
14:40TimMcbrianwong: Without seeing your code, I can only guess that it is taking a different execution path because of different data in the environment. (Config files, working dir, etc.)
14:40llasramPhil_D: Like resolving in a namespace?
14:41callenPhil_D: clojurescript doesn't have vars, you should avoid prolifically abusing that for metaprogramming, especially for code intended to be cross-platform.
14:41zphdscallen: a.k.a don't use exceptions to dictate program flows.
14:41callenzphds: precisely.
14:41callenzphds: but I do use it to catch misconfiguration, "zomg the database disappeared!", things like that.
14:42zphdsright
14:42callenthings where I want the program to crash in a pretty mess.
14:42callenzphds: for the record, I wrote my Python code like that too.
14:42zphds:)
14:42callenand still do.
14:44Phil_Dllasram: Yes, like taking a string or keyword, converting it to a symbol, then resolving it like so in Clojure: (resolve (symbol "helloworld")). It makes passing function arguments as keywords easier.
14:44Phil_Dcallen: I see. Yeah, I understand Clojure and ClojureScript are similar, but far different beasts. I'm confused as to how macros work in CLJS, but I may end up taking that route instead of trying to hack my way around resolving symbols.
14:45callenPhil_D: dude, do *not* do that prolifically.
14:45callen(resolve (symbol ...)) is extremely bad style.
14:46callenI sincerely hope you're not kicking around read-string and eval all over the place too.
14:46Phil_DNooooo no no no, haha.
14:46callenI'm unconvinced and regarding you with great suspicion.
14:46Apage43dude this isn't ruby
14:47llasramPhil_D: callen is overly brash, but I'd argue basically correct. Even in JVM Clojure `resolve` etc are for developer tools, not metaprogramming
14:47Phil_DOh, God. You guys can tell I used to program with Ruby. '''>.<
14:47llasramPhil_D: I'd suggest a different approach, where you create a map (as in {}) for mapping from keywords to functions
14:48llasramIf that's insufficiently dry, you can define a macro which creates the map
14:48llasrams,dry,DRY,
14:48callenPhil_D: Clojure gives you better, safer tools than this.
14:48callenPhil_D: specifically, compile-time (macros) tools that allow you to stop doing silly (and often slow) things at runtime.
14:48Phil_DOkay, glad I'm getting my knuckles slapped on this one.
14:49callenPhil_D: embrace the fact that Clojure is a language that "executes" in two different phases.
14:49callenPhil_D: understand what macro-expansion time means, how it works, how things "work" at that time, and how it can help you better structure your code for runtime.
14:49callenwe're not saying "go hogwild with macros", just that you have more and better options available to you.
14:49Phil_Dcallen: Awesome, thank you for opening my mind on this. I didn't know the implications until now.
14:49callenPhil_D: much of the misdesign of languages like Python and Ruby is that they have only one hammer - mutating state and eval'ing string-ish stuff at runtime.
14:50callenPhil_D: with Clojure, code is data and you can work with that data at macro-expansion *and* run time.
14:50callenPhil_D: embrace the parens :)
14:50callenPhil_D: thing in terms of structure, not specific names an dstrings.
14:50callenand string*
14:50callenthink*
14:50rasmustocallen: {()}
14:50callenjesus I can't type.
14:51Phil_DIs (pr-str) horrible practice as well? I only use it on the serverside to respond to (csrf protected) AJAX calls from ClojureScript.
14:51callenyou know what I mean.
14:51Phil_DOtherwise my response doesn't read as EDN. That may be something on my end I'm screwing up, though.
14:51callenPhil_D: pr-str is...sub-ideal...but not outrageous. I would strongly consider/recommend proper serialization.
14:51callenwhether that be JSON, EDN, or otherwise.
14:52TimMcWhen you have two hammers, everything looks like...
14:52llasramIs there some why of generating EDN *other* than pr-str?
14:52llasrams,why,way,
14:52llasram(well, or `pr` etc in general)
14:52Phil_DYeah, is there? I wasn't aware of EDN "serialization". I'm purposely avoiding JSON.
14:53callena lot of people do it that way, but I'm making the point of encouraging a prinicipled decision to use edn, not using pr-str just because it's there.
14:53callenI said pr-str wasn't outrageous.
14:53callenI'm just worried about abuse of bidirectional read-string/pr-str
14:54callenI haven't seen code so I can't get more specific than that, Phil_D's other indiscretions have me on the cautious side :)
14:54Apage43combine pr-str with clojure.edn/read-string rather than clojure.core/read-string
14:54brianwongcallen: i found it was doing (.toLowerCase nil). The weird thing is that it was throwing an NPE only on the amazon platform and not my workstation
14:54callen- http://clojure.github.io/clojure/clojure.edn-api.html
14:55callenPhil_D: ^^
14:55callensafer reader.
14:55callendefault read-string in Clojure is not safe.
14:55callenand not supposed to be.
14:55Phil_DYeah, I've read about that.
14:55callenjust making it explicit.
14:55callenPhil_D: do you have a copy of Joy of Clojure?
14:56callenit happens to cover introducing the Lispy-ness of Clojure and macro-expansion time reasonably well.
14:56Phil_DYes! I ordered the eBook. I've read through the first few chapters, but I'm taking it slow because it's a lot to chew on.
14:58futilePhil_D: you should take out the "il" from your nick
14:58futileshorter is better
14:58callenPhil_D: cool. Sounds like you're on the right track. I've done Python and Ruby before (more Python admittedly) and I'm far from the only one in this channel so if you have any questions/concerns or feel like you're going through an anti-pattern, ask in here.
14:59futilecallen: what better way to persist data than printing pr-str to a file and reading it back with read-str?
14:59Phil_Dcallen: Haha, I think I will do that. Thanks for your advice! I'm really excited to fully grasp the language.
15:02futileIs there a function that prints out its single arg and returns it?
15:03futileby prints out I mean using (prn)
15:03futilecallen: you would know this one
15:04futileBasically a shortcut for: &&(second ((juxt prn identity) 3))
15:04futileclojurebot: what's your syntax again?
15:04clojurebotCool story bro.
15:04futile:/
15:04futile,(second ((juxt prn identity) 3))
15:04clojurebot3\n3
15:06xeqi,(#(doto % prn) 3)
15:06clojurebot3\n3
15:06futileah yes!
15:06futileStill it'd be nice to have: (prn-ret 3)
15:06futileor something
15:06futileGuess I can make one.
15:07technomancyfutile: doto
15:07technomancybut it's not a function
15:07technomancyoh
15:07technomancyoops
15:07futile:)
15:07callenfutile: a database?
15:08futilecallen: WAT
15:08callen"what better way to persist data than printing pr-str to a file and reading it back with read-str?" - a database.
15:08futilecallen: i cant agree
15:08futilepr-str and read-str are perfect for this
15:09callen"perfect"
15:09futilethanks
15:09futilei think so too
15:09callenthose were scare quotes.
15:10futileso how are things
15:10futileIs it true JSON can't contain literal newlines?
15:10callen"can't"
15:11asteveuse vs. require, which is better? I feel that require is more descriptive which should cause less confusion and ultimately less bugs
15:11futilethis makes my protocol way easier. no longer need a length prefix, just consider \n as msg delims
15:11technomancyasteve: require
15:11futileasteve: require with :as
15:11futileI've seen gigantic (ns) blocks because they use :refer instead of :as
15:12futiledoes not need to be so
15:12callenasteve: use require.
15:13asteveand if I want to require a group of files under the same namespace should I do multiple [com.package.module :as module] or is there a better way?
15:13callen^^ I am delighting in the ambiguity of that in response to a question that was worded "use vs. require"
15:13callenasteve: a group of files under the same namespace? gather them in a core namespace or something.
15:13callenasteve: then :as the core
15:15callenasteve: I don't know if you noticed, but this is a common pattern in libraries. The core.clj will be used to gather things from all the other modules.
15:15callenso that users can just require the core.
15:15asteveah
15:15TimMcfutile: I've seen amalloy use a macro called "?" (or "spy"?) that prints the form, then the value, then returns the value.
15:15technomancydon't call it core though
15:15technomancyyou can come up with a better name
15:16technomancycore is clojurese for "I can't think of a good name right now sorry"
15:16callenbulwark.core => bulwark.defense mayhaps?
15:16futiletechnomancy: i think of core as "hey everyone start your diggin here"
15:16callen^^ me too, actually.
15:16TimMc[clj-thing.core "0.0.1-SNAPSHOT"]
15:16futilewhich is *super* helpful.
15:16technomancyfutile: I like having internal stuff nested a layer deeper
15:16futileTimMc: hmm interesting
15:16callenI use core as a signal that it's a "site-map" for the library.
15:16ro_stcore is the index.html of the clojure codebase :-)
15:16technomancyslam.hound / slam.hound.asplode / slam.hound.stitch
15:17callenfutile: he's making fun of it, not suggesting it.
15:17futiletechnomancy: oh yeah i never think of "core" as internal. im talking about user-facing APIs. sure, the name is backwards for that purpose, but its convention now
15:17TimMcfutile: I read that as "I was too lazy to start this properly and also too lazy to finish it."
15:17callenwell now I know what bulwark 0.0.4 will be.
15:17callen :P
15:17futileTimMc: well if there are others who used the same (legit) line of reasoning as me, that invalidates your way of reading it.
15:18technomancyfutile: I mean you can tell where to start digging because everything else is a layer deeper
15:18futileand you cant safely assume that anymore
15:18futiletechnomancy: oh
15:18TimMcfutile: If it's an app, foo.main is fine.
15:19technomancyyeah, main means "CLI entry point" to me
15:19TimMcfutile: My "lazy" comment refers to the combination of clj-*, core, 0.0.1, and SNAPSHOT.
15:20ztellmanI made my first clj-* library recently, made me feel a bit dirty
15:20callenTimMc: don't forget the real coup de grace - undeployed to clojars yet has a Leiningen vector in the README.
15:20callenztellman: I can name things. It's the only hard thing in Computer Science I'm good at.
15:20callenlet me help you!
15:21TimMcztellman: clj-tuple?
15:21ro_stztellman: you write so many libraries i'm sure we can forgive you. just this once.
15:21callenTimMc: which is a sweet library.
15:21ztellmancallen: it's a library that provides a clojure-specific tuple implementation, go
15:21ro_st-hides clj-madmimi-
15:21TimMcztellman: Name it after a legume genus, based on tuples looking like "peas in a pod".
15:21ztellmanit was either that or just "tuple", which has like 100 other entries in github
15:22ztellmanTimMc: why didn't I think of that
15:22callenztellman: yeah I know the library, I'm digging into the curry-howard isomorphism of tuples and logic to figure out a clever name.
15:22TimMcIt's not too late!
15:22callenTimMc: whoa that's pretty good.
15:23TimMcHmmm... carob is a legume, and alo very tasty.
15:23callenPisum sativum...
15:23TimMc(I discovered a jar of carob pods in the kitchen a couple weeks ago and have been working my way through them.)
15:23ztellmanI dunno, my rationale is that if something does a thing, and there's more or less only one way to do it, a more straightforward library name is ok
15:23callenztellman: French name for snap peas and snow peas is "mangetout"
15:24TimMcOoh, fancy.
15:24ztellmanthat sounds like someone who bets on mangy horses
15:24ztellmanperfect
15:24callenLOL
15:24callenwin.
15:24TimMchaha
15:24TimMccallen: Yeah, "Pisum" would be a weird name.
15:25callenTimMc: sadly all peas are the same species, snow/snap/etc are just variants, so there's not a lot of naming variety.
15:25callenbut the French saved the day.
15:26ystaelbut 'mangetout' refers to the fact that you eat the pod, right? is it better metaphorically to say the library does eat the pod (the tuple) or doesn't?
15:26TimMcI don't even know what language this is, but https://gn.wikipedia.org/wiki/Kumanda sounds pretty.
15:26TimMcThat was a language interwiki link.
15:26callenTimMc: Guarani
15:26Phil_DThis is a newbie question, but I'm trying to wrap my head around data binding in ClojureScript. I've done it successfully with atoms and the 'add-watch' function, but I'm forced to define the atom then pass it to a function. Is there a way to "create" the atom within the function? *braces for callen's wrath on my indoctrinated OO mind*
15:27callenI'm not that fearsome am I?
15:27bbloomcallen: i've told you before, your behavior influences the behavior of others
15:28bbloomfor every Phil_D who is willing to speak up, there are a countless others who are afraid to speak
15:28ro_stthe only stupid question is the one you don't ask.
15:28llasramPhil_D: Can you give a more full example?
15:28bbloomPhil_D: in my experience, add-watch is only really useful for quick debugging of atoms. it's not a great foundation to build a "data binding" system on
15:30callenbbloom: your proclivity for plonking disqualifies the persuasion. :)
15:31Phil_Dllasram: Basically I watch for the 'input' event from an HTML textarea that calls reset! on an atom bound to a DOM node (a </p> element).
15:31Phil_Dbbloom: Gotcha. What would you recommend? It 'works', but it's hardly idiomatic.
15:32bbloomPhil_D: there are a number of approaches out there, but it's a bit of an open research program to do idiomatic/functional UI stuff
15:32bbloomPhil_D: what approach you choose will depend on the scale of the problem you're trying to solve. what are you aiming for?
15:32callenPhil_D: functional reactive programming is one avenue of exploration. There are alternatives.
15:33llasramOh, I missed the Clojure*Script* part this time... I will defer entirely to bbloom
15:33ro_stPhil_D: http://keminglabs.com/blog/cljs-app-designs/ might be of interest to you
15:33clojurebotHuh?
15:34bbloomPhil_D: dnolen has been blogging a bit about using core.async for UI work, which is very promising. check out this post: http://swannodette.github.io/2013/08/17/comparative/
15:34bbloomPhil_D: his blog also has some simpler examples if you go back a few articles in the archives
15:35bbloomPhil_D: there are are also a number of bridges to existing javascript frameworks, such as angular & other popular ones
15:35Phil_DThanks bbloom and ro_st! I'll definitely check this stuff out.
15:35ro_stgreat. have fun with it!
15:35bbloomPhil_D: and there are a few more experimental / out-there explorations, such as pedestal
15:36dnolenPhil_D: watch out core.async is addictive. I got a couple more things in the pipeline but it needs Hammock Time as they say round these parts.
15:37xeqiI'm interested in hearing about any good solutions. Been trying the core.async go/loop with atoms instead of local state and it could be useful there
15:37dnolenxeqi: what leverage are you getting out of atoms? watches?
15:38xeqidnolen: debugging mostly
15:38ro_stdnolen, it's still early days for me with async. i saw tbaldridge tweet about how channels are for coordination, not for state. is what you're doing in accordance with his statement, or in violation of it?
15:39bbloomxeqi: my solution has been to use so few atoms/refs/etc that i can just debug with reductions instead of add-watch :-)
15:39Phil_Ddnolen: Definitely going to check this out then.
15:39xeqiattempting experimentation, I don't have a good feel for the split between what could be an external manipulatable element and internal state
15:39bbloomro_st: keeping "state" in the loop isn't that big a deal as long as you only have one loop/state/brain/whatever per logical unit of state (ie a stateful widget)
15:39xeqitake your highlight / selector examples. The selector has to duplicate the highlighted state. I'm not sure how much I like that vs an atom
15:39dnolenro_st: channels are for coordination, and no you should put queryable state into a go/loop
15:40bbloomi think "queryable" is the operative word
15:40bbloomgo-loops give you encapsulation
15:40bjago-loops are the addictive part
15:40dnolenro_st: I meant "no you should *not* put queryable state in a go/loop"
15:40Phil_Dbbloom: I was using purnam, which plays really nicely with Angular.js. This however was when I was just starting, so I realized I was just writing fancy-looking JavaScript, not embracing Clojure philosophy.
15:40futileIs it really true that JSON can't contain newline literals within strings?
15:40dnolenxeqi: the duplication is not a problem
15:41dnolenxeqi: you think those two components are related but they are not.
15:41dnolenxeqi: you can use one without the other, as it should be
15:41ro_stbbloom, dnolen, thanks
15:41dnolenxeqi: and you can test them insolation, as it should be
15:42dnolenro_st: however it's fine to push out the state changes so people can listen to them, that's the whole point.
15:43dnolenro_st: one thing I'm struggling with is how this pattern maps to MVC, where multiple components need to listen on some collection of data - I have some ideas, but still looking for cleanest manifestation.
15:43ro_stso what bhauman was doing with his dotsters game, there's no actual state in an atom, there. it's all either in channels or in the dom, i guess.
15:44dnolenro_st: I don't think he ever checked the state of the dom? so all in channel.
15:44dnolenro_st: or rather in the flow of the system.
15:45ro_stwell, i mean it's in the dom until you gesture and then it's back in channel
15:45dnolenro_st: yes, but his code is nearly abstracted away from event source, this is really important
15:46dnolenro_st: so anything could generate those events, they could even come from a sequence that you spool - again testing.
15:46xeqidnolen: ack, I meant I was concerned about the duplicated logic in state tracking. But I agree on the composability benefits.
15:47ro_stgotcha. yeah, it's a wonderful example. i often go and read through it just to stir up the pot.
15:47dnolenxeqi: yes, this is a non-concern
15:48dnolenxeqi: start thinking of your program as mini distributed network of nodes and these sorts idea of "duplication" become entirely irrelevant
15:48futileDoes anyone use validations libs in Clojure?
15:49futileI've just been using functions that return nil or a string (or seq of strings depending on the thing being validated), which works fine with cond and such.
15:49ro_stdnolen: it seems like core.async helps us to apply the lessons from the reactivemanifesto.org stuff to the stateful client
15:49dnolenro_st: yep, http://www.coursera.org/course/reactive
15:49ro_sti'm loving the idea that what we use for coordination and encapsulation in the large, between servers and processes, can be a big simplifying force in the small, in-process
15:50dnolenro_st: not surprising that the suggested readings are SICP and CTMCP
15:50ro_sti'm signed up :-) going to do my homework in clojure though
15:50ro_styeah
15:50`cbpoh nice link dnolen ill sign up for that
15:50dnolenro_st: agreed, it's very liberating, but it doesn't mean some biases about program organization have to be unlearned.
15:50dnolens/doesn't/does
15:51ro_sthttps://github.com/pedestal/pedestal/tree/with-core-async
15:51`cbpaw i need a scala book now though
15:51ro_stbrenton ashworth has been tackling the dataflow problem with core.asyc
15:52ro_stdnolen: yeah. in some ways, we're using tried and true techniques that are decades old, and in other ways, we're on the very forefront of system design and engineering
15:52ro_stgreat time to be a developer!
15:54squidzro_st: what kind of changes are expected for pedastal together with core.async?
15:54xeqidnolen: hmm, I think I might have the wrong granularity for my messages in my toy examples. I see in your example's the selector doesn't care about the original input, just the "state update" message from the highlighter
15:55xeqiI have a feeling this would work out better, time more exploration later
15:55bjaI I found tailrecursion/javelin fascinating wrt reactive programming
15:56dnolenxeqi: yep, easy bit to miss
15:56TimMc&(format "lib-%04d" (rand-int 1e4))
15:56lazybot⇒ "lib-6927"
15:56ro_stsquidz: i can't remember, i'm afraid. brenton does talk about it a bit in http://thinkrelevance.com/blog/2013/08/13/brenton-ashworth-podcast-episode-037
15:57ro_sti remember that derives were going to expose channels somehow
15:57squidzyeah I heard that podcast, that's why i'm interested but I guess the plans are under wraps for now. Can't wait to hear what they come up with though
15:58ro_stnot under wraps, just not nicely documented somewhere :-) you can read through the commits in the branch here https://github.com/pedestal/pedestal/tree/with-core-async
15:58ro_stgood luck, though. quite a lot going on there!
15:59ro_sti know that tim ewald has had success rewiring the interceptor stuff in services with core.async. pausing and resuming http requests from different threads of control is a great fit for CSP
16:01squidzcool thanks ill take a look
16:25brianwongi am writing a command line tool in clojure. some of the functions call (System/exit 1) in specific situations. How do I test for these situations? `lein test` considers these failures when in fact i want to verify them.
16:26technomancybrianwong: you can't do anything about System/exit calls
16:26ro_st(not (is …)) -shoots from the hip-
16:26ro_st-grin-
16:26technomancyyou need to wrap it in a clojure function and call with-redefs on that
16:26SegFaultAXWell you could wrap System/exit in your own fucntion
16:26SegFaultAXYea.
16:27SegFaultAXEssentially you need to mock out the exit call.
16:27technomancyclojure really needs an exit function so there's a standard way to do that
16:27brianwongso i can mock out System/exit in my deftest?
16:27brianwongand just check for whatever my mock returns?
16:28technomancybrianwong: no, you have to replace a clojure function that wraps System/exit
16:28technomancyyou can't replace Java methods =(
16:28brianwongderp
16:28brianwongi see
16:28brianwongso in my app code i replace all system exits with a function that just wraps it
16:28brianwongthen mock that new function in my deftests
16:28brianwonggotcha
16:29technomancyFSVO "mock"
16:29brianwongFSVO?
16:29Phil_Ddnolen: Oh no. I hope I sleep tonight. Core.async has sucked me in for good.
16:29nDuff"for some value of"
16:29technomancyI don't like to use the term because some TDD people get annoyed if you're not using their particular definition
16:29brianwongok with-redefs
16:29brianwongill try that
16:30brianwongthanks for the advice
16:30technomancynp
16:33glosoliHow could one jump into interop method source code ?
16:33technomancyglosoli: I think you have to be using ritz for that
16:33glosolitechnomancy: Hm nice, you answered two questions, (was gonna ask another, no need anymore)
16:34SegFaultAXtechnomancy: Meh, it's a mock. Screw TDD evangelicals.
16:34technomancySegFaultAX: I think with-redefs is more general, but in this case it's probably a mock
16:36glosoliHmm is there some way to destroy the binding? i.e. I have server function which executes http kit to run, and later I want to destroy it without restarting nrepl ?
16:37SegFaultAXtechnomancy: Agreed. with-redefs alone is much more powerful. But the pattern brianwong is implementing with it is mocky.
16:39technomancyglosoli: with jetty you just call .stop on the return value of run-jetty
16:39technomancyno idea about http-kit
16:58TimMcWell, this is infuriating. tools.namespace will give you a list of namespace names for a directory, *or* it will give you a list of ns declaration blocks from namespaces therein, but it doesn't provide any mechanism for converting between the two.
17:00TimMcIf you give it a file, it will give you the ns-decl... but it won't take ns symbol -> File.
17:00TimMcAnd if you give it an ns-decl, it won't tell you what the namespace symbol is!
17:11futileDear friends, why are we fighting amongst ourselves? Don't you see, this is what they want? Let us not give in to their dastardly plans, let us remember we're on the same team, Team Clojuriana!
17:13technomancyI thought we were on Team Lisp?
17:13technomancyor possibly Team FP
17:14joegallooh god, it's still here
17:14futileNo, it's Team Clojuriana.
17:15futiletechnomancy: you can be VP of Marketing, that last guy had an existential accident.
17:16technomancyI think you have to use Windows to be VP of Marketing
17:16futile(I mean he no longer exists now. Wiped from history. Was never born. What, who? I don't know who you're talking about.)
17:18futiletechnomancy: that's just an urban legend
17:20SegFaultAXThe number of dynamic vars in this code is too damn high! :(
17:23ozzloyrent is too damn high!
17:23glosoliyeah ;/
17:23ozzloyi'm on team edward, myself
17:24ozzloyon a more serious note, i think i'm more on team continuous unit testing than i am on team lisp or fp
17:26SegFaultAXozzloy: You just named three entirely orthogonal things.
17:26ozzloyyes
17:27ozzloyagreed
17:27SegFaultAXSo, why not all three?
17:27coventrySegFaultAX: You've gotta focus to succeed. :-)
17:27ozzloyoh, i'm in favor of continuous unit testing in FP style lisp
17:27SegFaultAXozzloy: There you go. ;)
17:27ozzloybut of the three, i think the first is most important
17:28ozzloyperhaps that was a better way to express it?
17:29SegFaultAXozzloy: As I said, they're orthogonal concerns.
17:29justin_smithteam tastes great vs. team edward, winner takes on team sparkle motion
17:29SegFaultAXCode can be more or less functional, but it can't be more or less functional /as a function of how unit tested it is/
17:29Raynesozzloy: Team Damon.
17:31ozzloySegFaultAX, we're in agreement on that
17:31ozzloyRaynes, matt damon?
17:31Raynesozzloy: The Vampire Diaries.
17:32seangrov`,(let [wrapper #(apply identity %&)] (wrapper [1 2 3]))
17:32clojurebot[1 2 3]
17:32ozzloyoh... uh... i don't actually know more than "team edward" is a thing i heard somewhere and it has to do with vampires and werewolves
17:32futile,(third [1 2 3])
17:32clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: third in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:32futilepfft
17:33futile,(let [[_ _ x] [1 2 3]] x)
17:33clojurebot3
17:33futilewooo
17:33s4muel,(doc nth)
17:33clojurebot"([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."
17:33SegFaultAXI also thought Matt Damon.
17:34s4muelalso team Raynes, I discovered laser while trying to do... well, the exact same thing laser does with hickory zippers, thankee for saving me a boatload of time
17:34futiles4muel: that takes too many args
17:34futile(Can someone please explain the latest http://buttersafe.com/ ?)
17:34seangrov`No one must be using anon fn shorthand with %& in clojurescript, it seems like it's been broken for awhile
17:34Rayness4muel: Sent gifts to Los Angeles.
17:34Raynessend*
17:35TimMcfutile: (def third #(`[~@%](+(*)(*))))
17:35TimMc&(#(`[~@%](+(*)(*))) [:a :b :c :d :e])
17:35lazybot⇒ :c
17:36SegFaultAXTimMc: Swearjure?
17:36futileTimMc: noooooo!!!!!!
17:36TimMcWhat else? :-D
17:36futile"whyyyyy!!!!!????"
17:36futileSegFaultAX: no its just ascii art
17:36futilebtw i found a great ascii art bed: "hmmm"
17:37ozzloyfutile, the two coins decided to have same location in relation to each other. coincide sounds like suicide. one jumped off the table, so the other had to too
17:37SegFaultAXfutile: http://hypirion.com/musings/swearjure
17:37ozzloythat's the joke. -mcbain
17:37coventryTimMc: Where do you come up with this stuff? I'm still not sure about all the details of your "out of order" example from yesterday. How come you can put the first "do" where you do?
17:37ozzloyalthough from the drawings, it looks like they weren't actually coincident during this event
17:38futileozzloy: oh. thanks.
17:38SegFaultAXcoventry: That's an easy one. They can get far more complex.
17:38futilewell i think ive done enough to bring this channel off topic, time to work again
17:39ozzloyfutile, "you suck, mcbain!"
17:39futileozzloy: im just disappointed. all the other buttersafes were funny.
17:39futileozzloy: but its not your fault. you're just the messager
17:40ozzloyat least i messaged you well!
17:40TimMccoventry: The "do" thing actually exploits a Clojure bug, and isn't Swearjure.
17:40futileozzloy: well except for that one lost packet
17:41futile(of ketchup?)
17:41futilejava.lang.RuntimeException: Unable to resolve symbol: of in this context
17:41futilewhat the hell have you guys done to me >:|
17:41ozzloyis swearjure still going on?
17:41TimMccoventry: http://dev.clojure.org/jira/browse/CLJ-1184 and then I rely on hash order to make the reader see the 'do as the first item.
17:41TimMcozzloy: Not actively, I think.
17:42coventryTimMc: Thanks.
17:42TimMccoventry: All those spurious keywords in there are to get the hashes to come out right. I did it by hand, and probably never again. :-P
17:43coventryTimMc: Yeah, I figured out the role of the keywords.
17:44TimMc&'#{(println "of") do (do :z/h283r (println "order")) (do :b121 (println "out"))} ;; here is what the reader sees
17:44lazybot⇒ #{do (do :b121 (println "out")) (println "of") (do :z/h283r (println "order"))}
17:45TimMcTheoretically, one could write a program to generate these programs by balancing the hashes correctly.
17:46coventry"You can write brainfuck in any language."
17:47coventryDidn't know that even with a quote, the order of entries in a set could change. Hmm.
17:48TimMcThey don't actually change.
17:50TimMcSets don't really have an order, but they need to serialize and deserialize in *some* (arbitrary) order. The reader doesn't care what order the items are in when it constructs the set, so #{1 2 3} and #{3 2 1} are the same.
17:51TimMcHowever, when you ask for (first some-set), the set has to pick *something*. That's what the compiler is asking for when it special-cases 'do, and if you arrange the contents of the set correctly, 'do will be picked as the first element.
17:51coventryOh, yeah, I meant in the reader representation. I have been thinking about things in terms of the reader representation, recently.
17:52TimMcI don't know if that example will work on different JVMs or Clojure versions, since the set's seq output might be different.
17:53coventryI'm interested in implementing a heuristic for mapping the (macroexpand)ed form back to the source form. I don't think this issue messes with my heuristic, though.
17:56Bronsaseangrove: what's broken with cljs' %&?
17:56TimMccoventry: Well, the reader should attach :line metadata, and I think there's :col support coming soon.
17:57BronsaTimMc: tools.reader already attaches :column and I believe LispReader.java too?
17:57coventryTimMc: Fortunately, Bronsa's tools.reader has already implemented column information.
17:58coventry(Oh, well, I needed to use tools.reader for other reasons, anyway.)
17:58Bronsayes, LispReader.java does too, tools.reader just attaches the info in more places
17:59seangrov`Bronsa: Just finished doing a git bisect, one second...
18:00coventryBronsa: I have a patch for changing the behavior of tools.reader/{dispatch-,}macros. I will wait and see whether it gives me everything I need before submitting a pull request, though.
18:00Bronsaseangrov` are you sure you upgraded tools.reader to 0.7.6? there was a bug in that
18:01seangrov`Bronsa: This is working off of clojurescript master
18:01seangrov`I'll check what version it's using
18:01Bronsacoventry: sure, just keep in mind that tools.reader is a clojure contrib project, this means that (unfortunately) I can't accept pull requests, only patches from registerd contributors
18:01Bronsaseangrov` right, bit if you're running clojurescript from script/repljs you need to ensure you grabbed the last tools.reader from script/bootstrap
18:02seangrov`Bronsa: re-running script/bootstrap
18:02Bronsabut*
18:02seangrov`Would be an poor use of time on my part if that turns out to be it
18:02seangrov`Still, hope that is it ;)
18:03coventryBronsa: Oh, that's interesting. Would that mean I have to get a registered contributor to vet a patch? (Worst case, I can probably just work with my patched library.)
18:03Bronsacoventry: yeah
18:03BronsaI'm sorry :(
18:03seangrov`Bronsa: Seems like the same error
18:04coventryBronsa: No, not a real problem. FWIW, the current patch moves the current tools.reader/{dispatch-,}macros to macros* and dispatch-macros*, and makes macros and dispatch-macros dynamic defs referring to them. It also makes tools.reader/wrapping-reader a public function. Does that sound workable?
18:04seangrov`Bronsa: Mind applying a test and running the test suite?
18:04Bronsaseangrov` sure
18:07Bronsacoventry: sure, I can do that myself if you really need it, but what's the rationale of renaming macros to macros*? We can just make macros :dynamic
18:08coventryBronsa: That allows me to do things like this: https://www.refheap.com/18121
18:09Bronsacoventry: I'll make wrapping reader public right now, still have to think about making {dispatch-}macros :dynamic, I have to find a good use case (as stuartsierra and tbaldridge mentioned some day ago, we don't really want to make the read-table extensible)
18:09seangrov`Bronsa: https://gist.github.com/sgrove/6371745
18:09seangrov`It literally seems to be the %& causing the problem
18:10seangrov`Bronsa: The actualy stack trace https://www.refheap.com/45fd544bac82e81745a19fad5
18:11Bronsammh
18:11Bronsauser=> (read-string "#(apply identity %&)")
18:11Bronsa(fn* [& rest__1632#] (apply identity rest__1632#))
18:11Bronsalooks all right to me
18:11Bronsa(this is tools.reader)
18:11seangrov`Yeah, works in the repl
18:11seangrov`Somehow it chokes when running the test
18:12Bronsaseangrov` last thing before I try to check it out any better, are you sure you don't have tools-reader-0.7.5.jar in lib/ ?
18:12seangrov`Let me doubly-verify that I'm running 0.7.6
18:12seangrov`I have it there next to tools-reader-0.7.6
18:12Bronsathat should be it
18:12Bronsatry removing it and re run the tests
18:13seangrov`Yeah, that seems to be it
18:13Bronsa(and this is why I'd like to see clojurescript deps managed by leiningen)
18:13seangrov`So I should blow away lib/ every time I run script/bootstrap?
18:13Bronsalooks like it doesn't do any cleanup
18:14Bronsaseangrov` I'm happy it wasn't a bug though, you had me panicking a bit :P
18:14seangrov`Yeah, all things considered, that is a better outcome
18:14seangrov`Still, frustrating to spend 30min on it
18:16Bronsaseangrov` next time there's a problem that might be caused by the reader, ping me and I'll try to help
18:17dnolenseangrov`: Bronsa: if somebody wants to give me a patch adding project.clj for development use I'll take it.
18:18Bronsadnolen: will do
18:19Bronsa(hoping that all the dependencies can be found in maven)
18:23dnolenBronsa: wasn't true in the past since we didn't package everything, we do now
18:35Bronsadnolen: is there a reason why pom.xml isn't fetching the last available com.google.javascript/closure-compiler or it just didn't get updated?
18:36`cbpyogthos: grats! I'll buy your book asap :D
18:36dnolenBronsa: we don't like doing that, we try make sure everything works together at a specific revision
18:36yogthos`cbp: hey thanks :)
18:36yogthos`cbp: let me know what you think
18:36`cbpsure thing
18:37Bronsadnolen: I wasn't saying "why it doesn't automatically fetch the last version" rather "why did't it get updated to the lastest version"
18:37Bronsadidn't*
18:37dnolenBronsa: it was the latest version whenever we decided to bump it.
18:37Bronsaok.
18:38callenI am having a dumb with Compojure - https://www.refheap.com/18125 - any advice for getting at what I want?
18:40pbostromcallen: get rid of the trailing slash?
18:40callenwhat? that's never broken it before.
18:40pbostromjust guessing
18:41callenthe URL in the link (href) has a trailing slash.
18:41callenI'll try it anyway, but :|
18:42amalloycallen: i'd say check what params is in the request "around" this one; it doesn't seem likely that using context is relevant
18:42callenamalloy: I am dumping params in all the handlers.
18:42callenI just bumped into something else that I think is promising though.
18:43callenhrm, no. boned.
18:45callendo url parameters not get merged into params or what?
18:46alexbaranosky_I want to access a package level variable on a Java object. What is the best way to do this?
18:49coredhi
18:49coredis there something equivalent to Scala School for Clojure?
18:50justin_smithcored: 4clojure has some similar stuff
18:50justin_smithwith an interactive interface more question / find answer oriented
18:50coredjustin_smith: talking about this http://twitter.github.io/scala_school/
18:50callenI don't think it's nearly as general.
18:51callencored: perhaps one of the various clojure koan projects?
18:51coredScala School looks more like some sort of specific overview for the language
18:51justin_smithcored: I know what you meant, just saying that individual problems on 4clojure have similar contents to the examples in scala school
18:51coventryThe early parts of Joy of Clojure or Programming Clojure give such an overview.
18:51alexbaranosky_anyone know how to access package level fields on java objects from Clojure?
18:52coredjustin_smith: I see
18:52coredjustin_smith: will try to check 4clojure and follow along with Scala School content
18:52callenalexbaranosky_: what does package level mean? Are you referring to restricted access?
18:52callenlike, "this field is private to the package" ?
18:52coredjustin_smith: want to learn both things to compare
18:52justin_smithcored: for example https://www.4clojure.com/problem/1
18:53justin_smithmostly that just has some intro info, and then you try to apply it
18:53justin_smiththen it leads you to the next one etc.
18:53callenjustin_smith: it doesn't serve the same need.
18:53coventryjustin_smith: I wouldn't want to work through 4clojure without the kind of overview cored is asking for.
18:53callenI'm with coventry, Scala School gives a nice overview.
18:53callenthe Clojure Koan projects I've seen are much closer to that than 4clojure.
18:54callen4clojure is puzzle grinding and "how can I abuse Seqs?"
18:55ambrosebscore.typed is "production ready" https://groups.google.com/forum/#!topic/clojure/U_aA_Ce3qWg
18:55coredagree with both of you
18:55coredtried first problem and failed :-P
18:55callenalexbaranosky_: I can potentially help you, but I need an answer first. If it's what I think it is, you can use reflection to bypass.
18:55coventry4clojure is great for someone coming from an imperative programming background who wants to learn fp. (Like me. I'm about halfway through it.)
18:55callencored: you're supposed to fail.
18:55coredmaybe it can be a good idea to create a Clojure School same thing as in Scala School but translate it to Clojure
18:55callencored: you don't pick up a guitar and start hammering out licks.
18:55coredcallen: yes, sure :-)
18:55muhoocallen: speak for yourself :-)
18:55callencored: creating a Clojure School equivalent to Scala School is already on my to-do list, thanks for bringing to my attention.
18:55brehautambrosebs: nice!
18:56callenmuhoo: blah blah. show off.
18:56callenmuhoo: farthest I got was grab-bag.
18:56ambrosebsbrehaut: :)
18:56callenambrosebs: really? how fast is the type-checker?
18:56muhoocallen: no, i mean guitar. musical instruments are a natural for me. clojure, i have to work hard at.
18:56ambrosebscallen: slow.
18:56coredcallen: I'm planning to fork that project and just change everything to match Clojure's :-P
18:56callenambrosebs: any particular plan of attack for addressing that?
18:57callencored: uh...it'd be best if somebody that knew Clojure did that.
18:57coventrycored: Those books I mentioned will give you a running start, though.
18:57callenI don't know about "cloning" either. Clojure is different and merits a somewhat differently structured overview.
18:58ambrosebscallen: lots of caching? :)
18:58coredcoventry: I see
18:58callenambrosebs: :|
18:58ambrosebscallen: but it's certainly a priority for the next reelases
18:58coredcallen: got it
18:58callenambrosebs: is there anything to be learned here from say - GHC?
18:58coredwill start checking Scala School until I get the book
18:58callencored: wat
18:59coredcallen: I want to check both languages, out of curiosity, I'm a Ruby developer ;-)
18:59ambrosebscallen: there's still some Typed Racket optimisations that I haven't stolen yet. Plus I'm sure some of my code is just really slow. I haven't put a large effort into speeding it up.
18:59ambrosebsjust a minor effort.
18:59callencored: well, I'll put it this way. You'll find a lot more people moving from Scala to Clojure than vice versa. I'll leave my own experiences out of it.
19:00callenambrosebs: hum. I hope you like rewrites :)
19:00coredcallen: and why is that?
19:00callenambrosebs: excellent work all in all :)
19:00callencored: lots of reasons, but sbt is a good place to start.
19:00clojurebotAlles klar
19:00coredcallen: I notice something in #scala at least, there's less people there than in here
19:00ambrosebscallen: hehe you get used it :) thanks!
19:00callencored: that might be a demographic thing, I wouldn't rely on that *too* much.
19:00callenbut it might be indicative :)
19:00callenI think Scala is - for now - more popular in the "enterprise"
19:01callenbut Clojure is eating up marketshare from the "bottom up" from startups, OSS, and SMBs.
19:01coredcallen: would like to know what is it that make it so
19:01justin_smithwhat I would avoid is a language that mostly gathers around AIM
19:01callencored: frankly, a smaller percentage of Scala users are active and doing any OSS.
19:01coredcallen: where I live there's just one company using Scala that I know of, none is using Clojure
19:01callenright, like I said, Scala is currently more popular in the "enterprise"
19:01callenbut far fewer people in Scala are writing code at home, OSS, etc.
19:01coredjustin_smith: AIM?
19:02callenso the tools are kinda languishing without Typesafe to shove them along.
19:02callenin Clojure you'll find more people scratching their own itches and contributing.
19:02coredcallen: that's weird
19:02callenthat's an important sign of health.
19:02callenNah, it makes sense to me :)
19:02coredweird in this context, mostly what I work on are web applications
19:02justin_smithcored: some languages will pull more people together on IRC than others
19:02callencored: great news, so do a lot of other Clojure users :P
19:02bbloomambrosebs: good stuff!
19:02coredI was trying to find some sort of web framework in Clojure too; find just compujure and the other day pedestal
19:02justin_smithcored: a language that pulls more people together on IRC may or may not be better than another
19:03ambrosebsbbloom: cheers!
19:03callencored: Luminus pulls together "good defaults" for web apps in Clojure.
19:03justin_smithcored: a language that mostly pulled people together on AIM on the other hand, I would not touch with a ten foot pole
19:03bbloomambrosebs: have you found any bugs in popular libraries yet? :-)
19:03coredjustin_smith: probably that's because is harder to learn
19:03coredjustin_smith: and people come here to ask questions
19:03ambrosebsbbloom: only in core.typed ;)
19:03callencored: you might consider looking into that. It's not a full blown "web framework" necessarily, unless you want to use it for the nice "ready-to-go" project templates.
19:03bbloomambrosebs: you should totally just fork projects, add type annotations, and report bugs, then brag about it :-)
19:03callencored: it's all just components you can swap out at your leisure.
19:03ambrosebsbbloom: aww can't someone else do that? :)
19:04ambrosebsI just build the type systems around here
19:04callenambrosebs: nope, your job to market your baby :)
19:04ambrosebs:P
19:04ambrosebsyes it's true
19:04coredcallen: Relevance is the closest thing as Typesafe that I found giving stuff to Clojure
19:04callennot a bad comparison, but Clojure doesn't need the shove-along nearly as much as Scala.
19:05callenwere it not for the Play community, Scala would be in a very sad state for web stuff. Comparable to Haskell.
19:05justin_smithcored: clojure has a much simpler semantics and syntax than scala; scala has the advantage of looking more like other popular languages
19:06coredcallen: shove-along?
19:06callenWriting Clojure code and pushing out Clojure projects is more fun and pleasant - no need to get into nitty-gritty.
19:06coredjustin_smith: yes, I saw that
19:06coredjustin_smith: also Play framework :-)
19:06yogthosScala feels enterprisey :)
19:07yogthosso I suspect it does better in shops that use Java today
19:07coredyogthos: how does Clojure feels?
19:07yogthosthey even look superficially similar
19:07callencored: fun, powerful, simple.
19:07yogthosit feels awesome, but it's a sisyphean task to get it going in enterprise I think :)
19:07callenit provides a good, safe default path for clean semantics but lets me monkey with stuff when I need/want to :)
19:07callenyogthos: you've had great success, be more fair :)
19:07yogthosit's much more likely to succeed in startup environments
19:08callenalexbaranosky: https://github.com/arohner/clj-wallhack
19:08yogthostook me 2 years :)
19:08bbloomcored: isn't the guy who made Play now chilling on the clojure mailing list? :-)
19:08callenyogthos: you work in gubbermint :P
19:08technomancybbloom: that's Lift
19:08yogthosI sure do
19:08coredyogthos: :-)
19:08callentechnomancy: I'd run for the hills if I made Lift too.
19:08coredbbloom: yes, where?
19:08bbloomah ok Lift, heh
19:08technomancyfrom what I can tell Play is more accessible to Java folks
19:08coredbbloom: :-P
19:08jkkrameras someone whose done a fair amount of both scala/play and clojure web dev, i vastly prefer clojure
19:09callenPlay is considerably better designed than Lift, but I still prefer Clojure to Scala/Play.
19:09yogthosI think most people do
19:09bbloomi think the scala people are publishing some great, practical research papers
19:09yogthosproblem is most people don't give clojure a chance :)
19:09coredbbloom: another weird thng, I remember that guy running away from Ruby and saying why strong typed languages are better going to Scala and building Lift, now he is using Clojure
19:09yogthosand part of it is lack of polish
19:09yogthosand that's changing nowadays
19:09callenbbloom: I tried running a research PDF with `/usr/bin/env scala` once, didn't work. Not very practical :(
19:10scottjarohner: you have you written any blog posts or such about circleci's experience using core.typed?
19:10coredjkkramer: why is that?
19:10yogthosI think tooling is a really big part though
19:10arohnerscottj: not yet. I mean to
19:10callenyogthos: well, it's huge when your tooling is as bad as sbt.
19:10yogthosagain from enterprise perspective people use stuff like eclipse and intellij
19:10jkkramertooling is big, yeah. leiningen is awesome
19:10jkkramer(inc technomancy)
19:10lazybot⇒ 73
19:10yogthosso working with scala feels very natural to them
19:10bbloomsbt and lein would probably feel like a really great case study on the typed and untyped approaches
19:10callenyogthos: CCW is fine though.
19:11jkkrameralso, play uses a lot of questionable design choices
19:11yogthosthat's what I use :)
19:11coredyogthos: well, I was trying Clojure with Eclipse and clockwise
19:11callenbbloom: I don't see how they're indicative of either side of the fence.
19:11yogthosgets my seal of approval
19:11arohnerscottj: it's worked well though. it's something of a pain to start using with 'legacy' code, because in general your type signatures are more gnarly w/o core.typed
19:11bbloomcallen: sbt's configuration is operator overloading EXPLOSION
19:11callenyogthos: I didn't know you used CCW, thought you were an Emacs user.
19:11yogthosbut it would be nice to have a good alternative to eclipse that's not emacs :)
19:11callenbbloom: oh yeah THAT. That shit is insane.
19:11coredjkkramer: I built an application on Play was the best thing I've ever use in a Java env, for web development. Before that I was using Structs/JSF both things I hate with all my heart
19:11bbloommeanwhile, lein is just a bag of data
19:11coreds/Structs/Struts
19:11arohnerwhere if you're using core.typed when you design the code, you say "wait, do I really want that gnarly signature? no. simplify"
19:11yogthosI think lein is a real winner for clojure
19:11arohnerand in general, that's a good thing
19:12yogthosespecially with lein templates
19:12callenbbloom: but that's data vs. executing operators against representations of data. Is that really indicative of typed vs. untyped?
19:12yogthosthe other thing that needs to shake out is some standard ways to do stuff
19:12callenarohner: you use core.typed at your startup?
19:12yogthosour philosophy is not to do frameworks and prefer libraries
19:12yogthosbut that's a big problem for new people
19:12yogthosbecause they don't know what libraries to use, or how to structure projects, and so on
19:12callento that end, Luminus is a roll-up of current best practices and libraries - not a reified framework unto itself.
19:13yogthosa lot of basic stuff can be frustrating to find
19:13bbloomcallen: you *need* types in order to make the operator overloading work
19:13yogthosthat's the plan :)
19:13jkkramercored: developing clojure web apps is much simpler (in the hickey sense of simple) - responses are simply functions of requests. that's sorta-kinda the case in play, but with awkward typing and implicit gunk getting in the way
19:13callenbbloom: necessary sure, but I don't see the other side of the mirror where you could use the abuse thereof to compare type systems.
19:13yogthosjkkramer: that's what I'm trying to convey with the book as well
19:13callenbbloom: maybe more of a cultural note?
19:13bbloomcallen: yeah, it's clearly cultural
19:13callenThat makes sense.
19:14bbloomalthough i guess you could use the Rep or Expr or whatever type they have
19:14yogthosI think that if there's a decent book describing the ecosystem people can get the basics nailed down
19:14bbloomand just get an AST and call that data
19:14callenyogthos: just...gotta stop using thread-locals in lib-noir man... :P
19:14yogthosthen they can jump start into doing stuff that makes sense for them :)
19:14yogthoscallen: patches accepted :P
19:14callenyogthos: you won't like this nihilist's solution to it, that's why I haven't PR.d
19:14callenand no, I don't mean just deleting it.
19:15yogthoslol
19:15callenyogthos: my solution would be request scope contract enforcement, surely you know that.
19:15callenyogthos: you know you can't do that in lib-noir without user education.
19:15yogthosyeah would be a big change
19:15callenwell? that's why you don't have my dirty dirty DIRTY macros in lib-noir.
19:15yogthosthe main thing is sessions
19:15callenbut I needed http-kit to work - so here we are.
19:15callenyogthos: same solution.
19:15callen(seriously)
19:16callenit's all just implicit request context scoping.
19:16coredjkkramer: have to re-watch that talk, probably
19:16yogthosand to be fair you don't want to make it a straight jacket either
19:16yogthosfor lots of apps jetty is perfectly fine
19:16yogthoseven with current setup if you use db sessions you're fine
19:16coredmaybe Clojure needs some sort of killing tool, like Rails or even Play
19:16callenyogthos: I'm not saying, "rm -rf / # if using jetty", I'm just saying, make it implementation agnostic, and the deeper magic requires obeying the scoping contract.
19:16coreddon't you guys think?
19:16callencored: no, we just got done explaining libraries > frameworks.
19:17jkkrameryogthos: i have some middleware i use a lot - interested in PRs for the generic ones? https://github.com/jkk/sundry/blob/master/src/sundry/ring.clj
19:17callencored: libraries > frameworks means, you don't throw away the whole car when the alternator needs replaced.
19:17hiredmancored: no
19:17yogthosjkkramer: absolutely :)
19:17callenambrosebs: does arohner use core.typed at CCI?
19:17ambrosebscallen: yep
19:17coredcallen: well that's what helped Rails in a way, even when Rails is kinda well not suited for doing big things
19:17ambrosebscallen: for a few months now
19:17callencored: you need to learn the "why" of how we do things first.
19:18callenambrosebs: sounds like an endorsement to me.
19:18ambrosebscallen: it's *the* endorsement ;)
19:18callenjkkramer: I like that wrap-failsafe.
19:19callenambrosebs: one of the more prominent "product" startups using Clojure. Very cool :)
19:19jkkrameryogthos: cool. happy to move these into community libs so i can shirk maintenance responsibilities ;)
19:19ambrosebscallen: arohner seems happy with it.
19:19hiredmancored: that assumes a goal of growing the language user base very quickly
19:19callenjkkramer: yeah uhh...I'm just going to steal all of this code. kthxbai.
19:19callencored: to roughly quote Rich Hickey - "we're happy being the BMW or Mercedes of programming langauges"
19:20coredhiredman: ?
19:20jkkramercallen: they could use some docs but yeah, they have come in handy
19:20coredcallen: what does that mean ? :-)
19:20callencored: look at my quote, it explains what hiredman said.
19:20callencored: we don't need a lot of users to be successful, as long as we're productive and happy.
19:20coredcallen: I was watching the Neal Ford presentation on Clojure Master Plan
19:20coredhe suggested somethings that the Clojure community needs
19:20callencored: such as?
19:20coredcallen: wait
19:20callencored: Neal Ford is ThoughtWorks, not Relevance.
19:21coredcallen: yes, I know :-)
19:21yogthosjkkramer: and it makes it easier to find the stuff too
19:21yogthosfor common utils I think it makes sense to have one lib
19:21callencored: the more subtle point being that people are more likely to take advice/ideas from those who actually use Clojure and understand the culture/aesthetic.
19:21callenyogthos: I like his stuff a lot.
19:22callenyogthos: I'm stealing the multi-arity wrap-failsafe immediately.
19:22yogthosnice :)
19:22alexbaranosky_callen: sorry was in a a meeting. I mean a field defined in a JAva class that has no private or public term in front of it
19:22callenalexbaranosky_: clj-wallhack?
19:23callenif you can't access it by default, surely clj-wallhack can.
19:23hiredmancored: I don't know that I would want something that did for clojure what rails did for ruby to exist
19:23callencored: you'll find more than one person here that doesn
19:23callendoesn't like the way Rails or frameworks like it are designed either.
19:23alexbaranosky_callen: thanks!
19:24mgaareNeal Ford tells this funny story about a consultancy that uses clojure (and often sells it in terms of 'java with an extensions library'). They only have 4 people, so to make companies take them more seriousy, they made fake linkedin profiles for 16 more employees. The feedback from customers is, "wow you guys must have the 20 best programmers in the industry"
19:24callenmgaare: :P:
19:24callener, mgaare: LOL
19:26Raynesambrosebs: Awesome work with typed clojure. :3
19:26ambrosebsRaynes: thx!
19:27`cbphah websockets are so cool. I feel like I might be doing something wrong with my approach of 'websocket on every page!'
19:29coredmgaare: yes, heard that on a podcast
19:29coredcallen: well he talks about an abstraction layer for jdbc
19:30coredcallen: also something like the pogniant ruby book for clojure
19:31akurilinyogthos, ping. Really tempted to buy your book in beta. How far along is it as of right now, if you don't mind me asking?
19:31yogthosakurilin: all the core content is there and code samples are all working
19:31yogthosakurilin: there's probably some typos and stuff along the way :)
19:32akurilinyogthos, Why is it 8 months away from being done then?
19:32callencored: the abstraction layer for jdbc is c.j.j, and there are higher level layers than that.
19:32yogthosakurilin: oh that's probably just standard boilerplate, it should be releasing in mid september
19:32akurilinyogthos, oooh well that's a completely different story then.
19:33yogthosakurilin: I'll ask the editor why that date is there :)
19:34akurilinyogthos, Is the book mostly based on your experience making Luminus?
19:35yogthosakurilin: mostly my experience using it at work for the last couple of years
19:36akurilinyogthos, awesome. I'm glad someone stepped up to write a book about that specific topic, it's super relevant to my day to day work.
19:36akurilinso gratz :)
19:36yogthosakurilin: luminus is spawned from that too so a lot of it is similar just explored deeper
19:36alexyakushevI need to force Clojure reader to read a map literal with uneven number of forms. Is there a simple way to do this?
19:36akurilinAlso nice to have it written by someone whose name is well known in our circles.
19:36yogthosfinding out how to do simple stuff was my big frustration :)
19:36yogthosI'd end up googling this and that and then going oh well that makes sense
19:36yogthosbut if you don't have anywhere to start it's definitely frustrating
19:37ddellacostaif anyone writes a version of the poignant guide for Clojure I will hurt them
19:37ddellacostajust sayin'
19:37callenddellacosta: haha, why?
19:37yogthosmy whole philosophy on this is that I love clojure and I want more people to use it :)
19:37akurilinyogthos, yeah that's what I've been doing for a while now, so it'd be good to learn from others who have gone through the process for much longer.
19:37yogthosonce people have a good initial experience the language really sells itself I think ;)
19:38yogthosakurilin: and I'm definitely open to feedback as it's mostly my own experience, so different angle is always good
19:38yogthosI'm sure some stuff I do might not work for others
19:38ddellacostacallen: I shouldn't get too deep into it, but as a Ruby/Rails dropout I have really conflicted feelings about "why" and think we should not emulate that approach to thinking about software and development.
19:39hiredmanalexyakushev: I've used a patched(not public) version of tools.reader to do that
19:39ddellacostacallen: but, you know, if someone really wants to do that, of course I won't *really* say anything, I'll just grumble away in my corner
19:39callenddellacosta: I'll just say it - I think _why is overrated - but I think a blend of Clojure's philosophy and code in some format could be very cool :)
19:39alexyakushevhiredman: Thank you, perhaps that's the only way
19:40hiredmanalexyakushev: did you accidentally print a map with *print-length* bound?
19:40ddellacostacallen: that is not at all the same thing, that sounds like it could be coherent, educational, useful, and all-around a good thing. I thought we were talking about why's poignant guide
19:40technomancyLearn You some Clojure for Great Good
19:40callenddellacosta: no no, you're right. It's very different, I'm just thinking of different solutions to similar problems.
19:40hyPiRionI wish there was one
19:41alexyakushevhiredman: Not really, I need to grab a top level form from Emacs in which user is currently in, and he may be in a process of writing a map
19:41ddellacostaI kind of feel like 4clojure is a pretty awesome way to learn Clojure, but I'm biased 'cause that's how I started
19:41akurilinyogthos, ok that's cool, I'll let you know if I spot anything :)
19:41brehauttechnomancy: im now imagining a clojure book made entirely out of repurposed wondermark and achewood
19:41coredcallen: I should list the things that he said exactly
19:41coredcallen: wait
19:42ddellacostatechnomancy: I didn't get far through it, but I recall Learn You a Haskell for Great Good being not-too-bad
19:43technomancybrehaut: tempted
19:43akurilinyogthos, happen to have any coupons I should know about? :P
19:43technomancyddellacosta: I work with the guy who wrote the Erlang one
19:43yogthosakurilin: none that I know :)
19:43akurilinyogthos, fair enough, was worth the try :)
19:44ddellacostatechnomancy: very cool. Gotta dig into Erlang too one of these days
19:44yogthosakurilin: indeed, I get like 5 free hard copies to give out when it's realeased and that's it I think :)
19:44hyPiRiontechnomancy: Wha, are there only awesome people working at Heroku?
19:44technomancyhyPiRion: well the FP nerds at heroku have to band together
19:44technomancyfend off the node onslaught
19:45hyPiRionah, good
19:45hyPiRionhopefully there aren't that few over there. For your sake, I mean
19:46yogthosand afk here
19:50[Neurotic]Anyone interested in testing out a fix for the leiningan plugin for IntelliJ 13 EAP? Looks like I have it working
19:50callen[Neurotic]: LaClojure?
19:50[Neurotic]Yah, works with La Clojure
19:51[Neurotic]La Clojure has nightly builds for the EAP (finally have nREPL support), but the Leiningan plugin wasn't supported for 13 yet
19:56seangrov`callen: Interesting, I suppose that'd make Haskell the Tesla of programming languages
19:57seangrov`With Tesla showing more signs of industry momentum...
19:57callenseangrov`: I beg your pardon?
19:57callenwhat did I say to make you think that?
19:57seangrov`"to roughly quote Rich Hickey - "we're happy being the BMW or Mercedes of programming langauges"
19:58callenI don't see Haskell's traction that you're talking about.
19:58callenlast I checked, there are still singular libraries that can still cause cabal to die from conflicts even if nothing else is installed.
19:58seangrov`Alright, let's say Tesla 10 years ago - brimming with potential to show the rest of the industry how it's done
19:58technomancylike elm?
19:58calleneven if you use cabal-dev (irrelevant if you haven't installed anything else)
19:58seangrov`Alright, let's say a fisker then
19:58callenseangrov`: fisker is failing/failed, I'm okay with that comparison.
19:59seangrov`Great ideas and good design, just not quite enough to push it to success
19:59callenBingo.
20:00seangrov`technomancy: Played with elm at all? cljs is still eating up all my "new language" quota these days
20:00callenso who else loves that destructuring is recursive? :D
20:00technomancyseangrov`: I tried last year but literally couldn't get past `cabal install elm`
20:01technomancyseangrov`: just as well; I don't have any need for web frontend stuff ATM
20:04callentechnomancy: re: literally couldn't get past `cabal install elm` - I keep trying to tell the Haskell users I know to take that problem more seriously and they don't listen.
20:05technomancy"The longer you have been working around a problem, the harder it is for you to see it as a problem." - Some Guy
20:06technomancyI got notified via github issues that "cabal install elm should work now, give it a try" like two weeks ago
20:07technomancy(on a bug I filed after last year's strangeloop)
20:07hyPiRionheh
20:09callentechnomancy: that's called 'schlep blindness' in the HN community.
20:12zachoakestechnomancy: i have a project that relies on two different libraries, one that relies on net.cgrand.parsley and one that relies on org.lpetit/net.cgrand.parsley (a fork).
20:12Bronsadnolen: would you accept this? http://sprunge.us/XjQP?diff
20:12zachoakessince they have the same name, it seems to conflict, and leiningen uses the first exclusively, thus causing an error. is there a way to avoid the conflict?
20:13technomancyzachoakes: it's easy enough to get it to prefer one over the other using :exclusions, but having both loaded into the same JVM is hard
20:13technomancyunfortunately aether doesn't have any notion of provides/requires or replacing one package with another
20:13technomancybut those kinds of problems can be worked around manually usually
20:14hiredmantechnomancy: I doubt he is describing a lein issue, I imagine both libraries provide the same clojure namespaces
20:14zachoakesright, it's not lein specific, i'm just wondering what the normal way of solving it is
20:15hiredmanthere isn't one
20:15technomancyhiredman: yeah, by provide/require I was thinking more about apt-get
20:15hiredmanzachoakes: you need to not depend on one or the other
20:15hiredmanthey cannot both be loaded in to the same clojure runtime
20:16technomancyzachoakes: what do you really want?
20:16technomancyis the lpetit one just the same as the original plus bugfixes?
20:16hiredmanyou can fiddle around with classloaders to load multiple clojure runtimes in the same jvm, but it is almost certainly not what you want
20:16zachoakesit's a fork but i don't know how substantial the changes are
20:18zachoakesi believe i tried adding net.cgrand.parsley to :exclusions at the top level of project.clj
20:19dnolenBronsa: I would rather that the patch leave the current stuff alone, this way people can transition. Best if it's just a project.clj and nothing more.
20:22Bronsadnolen: understandable, but that defeats entirely my rationale for having a project.clj at all: having lein automatically fetch and use new dependency as they get added instead of having to scrip/clean && script/bootstrap
20:23dnolenBronsa: I don't see how a project.clj is conflict with the other scripts
20:23hyPiRionzachoakes: it should be placed inside the dependency I believe, see sample.project.clj for an example
20:23dnolenBronsa: if you run lein instead of the other scripts you're good.
20:24Bronsadnolen: certainly, but then you have to interactively launch the test suite instead of script/test
20:25dnolenBronsa: I still don't see the conflict, lein test, instead of script/test
20:26dnolenBronsa: unless there's something about lein I don't know about
20:26Bronsadnolen: lein test is not going to work, script/test calls cljsc test and then invokes the output with various js engines
20:27dnolenBronsa: er I mean test-compile the on your changes
20:27dnolens/on/one
20:28Bronsadnolen: there is no test-compile on my changes, I only removed a script that was useless/not usable anymore if that patch is merged
20:29dnolenBronsa: you're not explaining yourself very well :) why do you need to change anything besides adding a project.clj?
20:31Bronsadnolen: I'm sorry. if you followed the discussion I had before with seangrove, he spent 30 minutes trying to find a bug that was caused by him not running lein clean && lein bootstrap to update to the new tools.reader dependency.
20:32zachoakeshyPiRion: i did try :exclusions inside the dependency as well but no luck. if there was a way to make both dependencies use the same copy of parsley i think it may work.
20:32Bronsadnolen: if we let leiningen handle dependency updates/classpath generation, once we bump a version in there, calling a script will automatically use the updated version without requiring us to script/clean && script/bootsrap every time
20:33Bronsadnolen: the clojurescript test suite is not invokable by leiningen since it requires clojurescript compilation && running the compiled code with a js engine
20:34Bronsa(script/clean && script/bootstrap not lein)
20:34dnolenBronsa: yes I follow your reasoning, I guess I wasn't clear earlier. I think it's better to do just one thing at a time. Add a project.clj let people know about it. Transition off the scripts in some later release.
20:35Bronsadnolen: ok, fair enough. two separate tickets then?
20:35dnolenBronsa: sure thing.
20:36dnolenBronsa: thanks much!
20:36Bronsadnolen: no problem, sorry for the misunderstanding :)
20:47dnolenBronsa: my fault really :)
20:49dnolenbbloom: ping
20:49bbloomdnolen: pong
20:50dnolenbbloom: Bob Nystrom's comments about limitations of CLJS core.async / Generators + channels go me thinking
20:50dnolenbbloom: tldr; you can't actually hide asynchrony
20:50bbloomlink?
20:50dnolenbbloom: no link just a twitter convo
20:51dnolenbbloom: anyways I realized that part of Rich's ideas is that go is kind of like loop/recur
20:51dnolenbbloom: in Erlang and Go like you lie and be unexplicit, but you run into the unbounded problem.
20:51dnolenbbloom: http://gist.github.com/swannodette/6373022
20:52callendnolen: 'unbounded problem' ?
20:52bbloomdnolen: i'm looking at the tweets now
20:52dnolenbbloom: f pretends to provide a sync interface, it does not
20:52bbloomdnolen: "poison the entire callstack" is true, which is why go dispatches at the infinity point: it forks the process off as a top-level resource, to use the algebraic effect parlance
20:53dnolenbbloom: yes, but my point is that it's a lie, anywhere a function is aync but present a sync interface is an unbounded queue
20:54bbloomdnolen: f IS a sync interface. you're making it async by writing "go"
20:54dnolenbbloom: but it's equally poisoned in the other directly :)
20:55dnolendireciton
20:55callencould someone explain the unbounded problem dnolen is referring to?
20:55dnolenbbloom: if I put this in a go block, I'm screwed
20:55bbloomcallen: he's talking about how you can create unbounded queues by using asynchronous send
20:55bbloomcallen: and asycnhronous send is trivial: you just wrap a send in a go and then ignore it
20:55bbloomor use put! directly
20:56dnolenbbloom: this is a trivial relation really, but I don't think I ever really understood the limitations of lightweight process model.
20:56callenbbloom: more to the point, lazily allocated channels?
20:56dnolenanywhere where you pretend the sync and async world can just transparently talk to each other - it's simply not true
20:56bbloomcallen: no
20:56dnolens/relation/realization
20:57bbloomdnolen: i don't follow how this doesn't also apply to core.async
20:57dnolenbbloom: oh no, of course it does :)
20:57bbloomoh lol ok then
20:57callenthat was part of what confused me.
20:57bbloomyeah, it's totally like recur
20:57dnolenbbloom: exactly!
20:57bbloomrecur == "tail call elimination is not an optimization, it's a feature"
20:58bbloomgo == "heap allocated stacks are not an optimization, they are a feature"
20:59bbloomso it turns out that Algebraic Effect handlers addresses *both* of these problems!
20:59bbloomyou can treat a tail call as an "effect" just as you can treat spawning a goroutine as an effect
20:59bbloomand you install an effect handler in your stack & if you try to use an effect that isn't in your dynamic extent, you fail
20:59bbloomthis way you can prove a program never spawns a process or makes an unoptimized tail call
21:00dnolenbbloom: seems worthy of blog post :)
21:00bbloomyou gonna write it? :-P
21:00dnolenbbloom: haha, no
21:00bbloomyou should write a post about recur & go
21:00bbloomi'll follow up about effects ;-)
21:01dnolenbbloom: but I might write something up about the unbounded queues where async and sync worlds meet
21:01seangrov`dnolen: I've been very interested in the boundary between async and sync, would definitely be interested in reading it
21:02bbloomdnolen: i have so many comments/corrections/challenges to tha ttwitter thread
21:02bbloombut i don't feel like explaining any of them in 140 chars
21:02bbloomnightmare.
21:03dnolenseangrov`: well in some sense this isn't a problem with CLJS core.async since you can't lie, if you really want to talk to async world, you need to lift yourself up into it via go.
21:03callenbbloom: which?
21:03bbloomall of it. :-P
21:03callenbbloom: if you drop a name I could use as an entrypoint to the thread, I'd appreciate it.
21:03dnolenbbloom: hehe, would happy to hear your thoughts, but yeah not a good twitter convo.
21:04bbloomcallen: https://twitter.com/munificentbob/status/372164340457041920
21:04seangrov`dnolen: Sure, but I've been wondering about the "infectious" nature of go-routines, callbacks, and sync-code, and the fact that none of them can seamlessly interop
21:04bbloomdnolen: but yeah, that's the thing about "go" is it says "spawn this to the top level"
21:04bbloomyou actually *can* do non-top-level goroutines, etc, but it's not truly asynchronous. you only have one thread of execution
21:04bbloomwhich would actually be useful to do in a game setting
21:05callenbbloom: thank you.
21:05dnolenbbloom: I haven't heard of that, how can you do this?
21:05bbloomif you go check out that paper on Eff, you'll see the distinction is one of whether or not you have a "resource" which is a top-level object from the outside world
21:05seangrov`If you have async code, sync code can no longer (meaningfully) interact with it without a very explicit understanding (or common patter), and the same for go channels and callbacks
21:05dnolenbbloom: do you mean in golang you can do this, or in genearl?
21:05dnolengeneral
21:05bbloomdnolen: no, not in Go
21:05dnolenbbloom: k
21:06seangrov`I think the core problem is that "return" is made meaningless with callbacks and go channels/routines
21:06bbloomdnolen: imagine you have a variable with a top level "system" for your go routines, channels, etc
21:07bbloomdnolen: every channel would have a pointer to this top-level system thing
21:07seangrov`The same thing effectively happens in twisted python - you have to resort to patterns (like the standard node callback signatures) because you no longer have a common way of communicating return values
21:07bbloomif it's the true top level, you don't really care what's in that pointer. it's global, so it's not important
21:07bbloombut let's say you wanted to create a mini little world w/ a particular scheduler & determinism and all that
21:07dnolenseangrov`: yeah, but part of my argument which I think is true, when you think of processes you don't really have a sensible return value outside of a channel anyway.
21:07bbloomyou could create a protocol for "effects" which are basically messages you send up the call stack like exceptions
21:08dnolenseangrov`: this is much messier if the async model is task oriented (i.e. one-off)
21:08bbloomand then "handlers" like catch blocks, can dispatch on those messages & continue at the point where the message was raised
21:08bbloomso you could just implement the channel protocols & dispatch to that implementation for some sub-tree of your dynamic extent
21:09dnolenbbloom: but inside the sub-tree are you saying you're not really async?
21:09bbloomdnolen: right
21:09dnolenbbloom: hrm
21:09bbloomdnolen: it would just be round robin or whatever
21:09bbloomthis would be super useful to do in general, b/c you could mock the outside world to test your goroutines
21:09bbloomyou could reify their execution state however you like & inspect it
21:09seangrov`dnolen: Yeah, I think yield is an interesting subset of channel-communication - it lets you give multiple "return values". But if you have multiple return values, you're sending messages
21:09bbloomsee http://math.andrej.com/wp-content/uploads/2012/03/eff.pdf
21:10bbloomexample 6.10
21:10bbloomon page 22
21:10bbloomthe protocol there is yield (not generator yield) and fork
21:10bbloomthey create a trivial round robin scheduler w/ a list & install it in the dynamic extent
21:11bbloomyou could create an effect with the following operations: new-channel, send, recv, alt
21:11bbloomoh and go
21:11bbloomi think that's the effect protocol: channel/send/recv/alt
21:12bbloomand i guess technically, send/recv can be implemented in terms of alt
21:13bbloomin addition to Cleff, which is lexical extent only still, i have a working interpreter w/ this stuff :-)
21:15dnolenbbloom: hrm, this model still seems broken even if you can do this in your world, it has a global side effect at the top.
21:15dnolenbbloom: how does the whole thing get unscheduled for some other top level process?
21:17bbloomdnolen: so there is this notion of a "resource" which is a top-level thing
21:18bbloomdnolen: everything is single threaded & if you want real threads & real asynchrony, you use a resource, which must be provided by the runtime
21:18bbloomthe idea is that you'll have very few top-level resources & anything else will wrap those as needed or just create local "pure" effects
21:19bbloomthe two most obvious resources are the store and IO
21:19bbloomthink of it like a kernel call
21:19bbloomwhenever you make a kernel call in C, your program suspends
21:19bbloomthe kernel does something, then resumes your program
21:19bbloomany time you send an "effect" and it bubbles all the way up to the top w/o being intercepted, then that's like a kernel call
21:20dnolenbbloom: feel like pushing the problem around but ok. I do like the effect handler bit - though I'm not convinced yet it's any better than core.async preventing unbounded queues.
21:20bbloomso your kernel API needs to have load/store memory, plus spawn/kill threads, etc
21:20dnolenbbloom: you would want the system to know that you're ok if the queue gets to a certain size, but this sounds like undecideable problem.
21:20bbloomyeah that's totally orthoginal
21:21bbloomyou can implement core.async with a cheap-threads resource
21:21bbloomor system threads
21:21bbloomcore.async is a stylized use of effects
21:21bblooma good stylized use!
21:21bbloomanyway, gotta run. ttyl
21:21dnolenbbloom: what I mean is you don't often want to prevent crossing the bounday
21:21dnolenbbloom: you want to specify some condition by which it is allowed
21:21dnolenbut maybe that's really hard to verify :)
21:52gdevdnolen, have you emblogenated all this? I'm trying to piece together the whole thing and I'm not following it very well =o
22:28gdevdnolen, nevermind, now that I've read the whole twitter conversation, previous blog posts, and Tony Hoar's book, I understand
22:28gdev*Hoare
22:35futileIs the Clojure compiler very complicated?
22:36brehauton the scale of compilers? not so much
22:36brehautand it depends waht you think of whitesmith style
22:37futileWould it be hard to write a parser for Clojure syntax in another language?
22:38brehautno
22:38gdevhard for who?
22:39futileMe.
22:39futileI'm considering a very stupid idea.
22:39jimrthyThe parser wouldn't be that hard...but actually running it would probably be pretty difficult
22:40jimrthyI'm a fan of stupid ideas
22:40hiredmanthe clojure compiler?
22:40futileI'm thinking of creating a Clojure IDE where the front-end is written in ObjC + Cocoa, and to do the integration features would communicate to a running Clojure process for that Lein project.
22:41hiredmanthe clojure compiler is hard to make changes to
22:41jimrthy(Sorry for interrupting, brehaut...sometimes I can't keep my mouth shut when I should)
22:41futileMainly because I'm much more proficient at Cocoa than Seesaw.
22:42gdevclojure IDE? like emacs?
22:42brehautfutile: writing a parser for clojure for a text editor his relatively straight forward, likewise nrepl shouldnt cause any major problems
22:43futilebrehaut: good to hear
22:43brehauti wrote a simple recursive descent one in javascript in a relatively short space of time
22:43futileIs there a definitive place to know all the syntax it supports?
22:44brehautthe implementation and clojure.org
22:44brehautthe reader page on clojure.org is relatively comprehensive
22:44gdevfutile, https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java
22:44futileActually better question: are there any surprise aspects to the syntax that aren't commonly used?
22:44futileBecause I think I know the syntax well enough right now.
22:45brehautthe parser is more permissive than it officially supports
22:45brehautand #_ might trip you up
22:45futilebrehaut: nah, it just expects a valid form afterwords right?
22:45brehautright
22:45futileeasy enough.
22:46brehautbut you probably have to special case it because its removed from the parsed form
22:46ivanfutile: people use all kinds of characters in keywords that clojure.org says aren't allowed
22:46futileSo I suppose all I need to do is build up an AST where each node includes the line/char coords, and what type it is. Then I can use that to decorate an existing text view.
22:47futileSo it sounds like this first part will be straight-forward. But integrating with a Lein project might not be.
22:48seangrov`Parsing will probably take up plenty of time
22:48futileLike, a few hours? Days? Weeks?
22:48futileI can't imagine it taking more than a weekend or two.
22:49seangrov`Few days to get something reasonable, probably
22:49futileReasonable in terms of performance, or actually working?
22:49seangrov`Actually working
22:49futile:/
22:49brehautfrom memory it took me a week all up to write a syntax highlighter including the shenanigans to hook into the javascript library i was using
22:49brehautand performance tuning it
22:50xeqiI feel like a reference to https://github.com/cgrand/sjacket might be appropriate here
22:51seangrov`Wow, very cool
22:51futilexeqi: that was my first thought, thank to trptcolin pointing it out to me
22:51xeqialso possibly https://github.com/laurentpetit/ccw/tree/master/paredit.clj
22:51futilexeqi: but I can't help but think I should do the parsing on the ObjC side to minimize the things needed to be communicated between ObjC and Clojure
22:52xeqitrue, these are better for a clojure based ide
22:52xeqilike say http://nightcode.info/
22:53futileThe only things I want to talk to Clojure about are the actual structure of the current project, things like jump-to-symbol etc
22:53xeqiah, then you want an nrepl frontend
22:55futilexeqi: frontend in what way?
22:56futileI figured I would have an ObjC GUI app that talks to a Clojure instance of [something] which sits inside the given project and can tell my ObjC all about its structure.
22:56futileI'm not sure if [something] is nrepl or not.
22:57futileWhatever it is, it needs to house several custom functions I create in Clojure.
22:58brehautnrepl perhaps with middlewares or whatever it has that ive forgotten
22:58xeqifutile: I would expect nrepl would be a good starting point
22:59xeqipossibly with custom middleware for your custom functions
22:59xeqiala the completion middleware, or ritz
22:59futilesounds good.
22:59futilethanks guys :)
22:59futileok ill start on the objc frontend with proper syntax highlighting
22:59futilewoot, exciting times
23:00futilei suddenly have lots of confidence in my ability to do things after the success of zephyros
23:00futilehopefully not overconfidence :)
23:00xeqicause I can associate your previous sentence with: have a C app (emacs, vim) that talks to a clojure instance of (nrepl running the project) and can tell the program all about the structure
23:01futilexeqi: well at first I had this vague feeling that it was *only* using nrepl, and nothing custom on top of it, and everything it needed was built *into* nrepl. In which case it wouldn't be a good fit. But if it has middlewares as you say, then that seems reasonable.
23:08ddellacostaare people interested in fixture/scaffolding kind of libs for clojure? I feel like I'm always writing ridiculous amount of setup/teardown crap. I'm not sure if my testing strategies suck (probably), but it seems like it would be handy to have a bunch of helpers which would let you spec out default fixtures in some way kinda like FactoryGirl/Machinist/etc. in Ruby-land. Does anything like this exist?
23:09ddellacostaalong those lines, I'd like something that makes it easy to sketch out DOM fixtures in CLJS-land.
23:09mgaareddellacosta: do you think like FactoryGirl buys you anything that isn't already there thanks to clojure's richer syntactical offerings?
23:10clj_newb_2345http://www.ymacs.org/ <-- is there anyting like this, but written in clojurescript?
23:10clj_newb_2345I'd love to have something emacs-like, running in the browser, and instead of elisp, uses clojurescript
23:11ddellacostamgaare: it's a good question. I'm not sure it built in clojure using an abstraction that would solve problems for people, but I'm imagining something that would like you specify simple keyword args and reasonable defaults and then handle the setup/teardown, if you merely plugged in a database config. I do a lot of that manually now, and it takes me time to build out helpers, always.
23:11ddellacostamgaare: so, I mean, I don't know. Maybe?
23:12SegFaultAX'ello boyos and girlos.
23:13ddellacostamgaare: I should be specific, I'm talking about targeting DB-driven apps, especially web-apps. But even with this there is a lot of variation with what folks are using, it seems…Datomic to Mongo to Postgres...
23:13ddellacosta'ello SegFaultAX.
23:13mgaareddellacosta: the other thing I've found working with idiomatic(ish) clojure is that doing tests that actually the railsey style of actually setting up a test db
23:13mgaarerather, I've found that I haven't needed to do that.
23:14mgaareall of the clojure database libs I've come across work in terms of maps. So I tend to prefer to just fake the database layer
23:15rhg135https://www.refheap.com/18133 can i make the tracer module close over the value of comp-num at the time? (comp-num is supposed to be a unique id)
23:15rhg135tracer function*
23:16SegFaultAXI have mixed emotions about that. For a lot of stuff it totally doesn't matter, so decoupling from the database is a good thing. But other times you really do want to see how the code interacts with the database.
23:16ddellacostamgaare: interesting. The thing is, my schema is complex enough that faking this in and of itself would take just as much time. And another thing I've struggled with lately is how coupled our DB layer should be with the "model" layer. I find that I enforce a lot less separation in Clojure-land, and rely on the DB more.
23:16SegFaultAXSince it's easily the most crucial component of your site.
23:16SegFaultAX(Even the site itself isn't as important in the grand scheme as the database)
23:16ddellacostayeah, I mean, I've really had to rethink my strategy for interacting with the DB since I started building apps in Clojure. It's turned a lot of my previous assumptions upside-down.
23:17SegFaultAXddellacosta: That's a feature!
23:17clj_newb_2345let's start a kickstarter for a emacs-writtten-in-clojure
23:17ddellacostaSegFaultAX: most definitely, I'm thankful for it! But it means I can't be lazy...haha
23:18SegFaultAXclj_newb_2345: Let's not.
23:18jack_rabbitclj_newb_2345, and never speak of this again.
23:18SegFaultAXThere should be a Greenspun-like law for editors relative to emacs.
23:18rhg135agreed
23:18clj_newb_2345jack_rabbit: are you an op here?
23:19SegFaultAXI think rhickey is the only op.
23:19SegFaultAXYou can get chan info from chanserv though.
23:19jack_rabbitclj_newb_2345, no.
23:19jack_rabbitclj_newb_2345, I was just joking.
23:19clj_newb_2345given the option, why would anyone prefer scripting their editor in elisp rather than clojure?
23:20SegFaultAXOh no, technomancy, chouser and a few other are also ops.
23:20amalloySegFaultAX: chouser is an op, and i think technomancy became one too
23:20mgaareddellacosta: there are definitely some style issues that I don't think have gotten entirely settled in clojure yet when it comes to db use
23:20SegFaultAXamalloy: Yea. /msg chanserv access #clojure list
23:20clj_newb_2345if you write some [piece of software, say lein, that every clojure user users, you deserve to be an op
23:20jack_rabbitclj_newb_2345, not sure. But I don't think re-writing the millions of lines of elisp is really feasible.
23:21clj_newb_2345if I wrote lein, my resumee would be "does your companay use clojure? hire me, bitches"
23:21SegFaultAXclj_newb_2345: If you wrote lein, all your resume would have to have on it is your name and email. Eg, hand them a business card
23:21SegFaultAXHired.
23:22clj_newb_2345right right, when you write lein, you don't apply for jobs; jobs apply for you
23:22amalloyi think technomancy's resume is more like "does your company use github? no? don't hire me then"
23:22jack_rabbitsounds about right.
23:22SegFaultAX"Oh and also, I wrote lein"
23:23brehautnah, its a single frame form a webcomic
23:23ddellacostamgaare: yeah…but I think that they point to a larger problem in software engineering in general, wrt databases. Coming from a Rails background myself, I feel like I had a lot of faulty assumptions based on the cardinal law that databases were some sort of "dumb store" and you need to enforce de-coupling…of course, this is not in any way a new thing:
23:23ddellacostahttp://www.codinghorror.com/blog/2006/06/object-relational-mapping-is-the-vietnam-of-computer-science.html
23:23timddellacosta: I like Rich Hickey's take in one of his talks: ORM == OGM
23:24tim*ORM == OMG
23:24clj_newb_2345btw, is there actually any _book_ on datalog? I hear that it's got the both of the relation model and prolog, but can't seem to find any structured infroamtion on datalog
23:24mgaareclj_newb_2345: there would need to be some big style changes with emacs to make it in line with idiomatic clojure. Almost all elisp assumes that there are mutable lists everywhere
23:24ddellacostamgaare: what clojure does, for me at least, is exposes the lazy assumptions I had for years and has forced me to think about what persistence means and what de-coupling means and etc.
23:24timclj_newb_2345: you have to define datalog, there are many flavours, do you mean the Datomic datalog?
23:25ddellacostatim: ha, I remember that, it gave me a chuckle. He always has some funny, pointed moments in his talks like that
23:25jack_rabbitddellacosta, that's the beauty of true functional programming.
23:25mgaareddellacosta: Rails migrations are a crime against humanity ;)
23:25ddellacostajack_rabbit: yah. heh
23:25SegFaultAXtim: TimMc?
23:25ddellacostamgaare: I didn't used to think so, which is more evidence to prove your point. :-)
23:26timSegFaultAX: nah sorry, tbaldridge
23:26SegFaultAXtbaldridge: Oh cool. Just wondering :)
23:26gdevclj_newb_2345, http://www.infoq.com/presentations/Datalog is a good place to start
23:26mgaareddellacosta: Another thing to bear in mind is that in clojure, the cool kids tend to like to use datomic as the db for new projects
23:26SegFaultAXRails migrations are one of the more useful things about Rails. There is a /lot/ of shit I hate about Rails, but migrations isn't one of them.
23:27ddellacostamgaare: I don't have the cash to use it. ;-(
23:27tbaldridgeddellacosta: the free version is well....free. And I know several companies who get along just fine with it.
23:27mgaareddellacosta: the free storage is actually pretty good
23:28mgaaredepends on what you're doing
23:28SegFaultAXOne transactor can take you pretty far from what I understand. Especially on super read-heavy apps (which a lot of apps tend to be anyway.
23:28mgaareif you're doing something that you would use mysql in a somewhat standard railsey way, then datomic's free storage should be awesome
23:29ddellacostaSegFaultAX: I feel mixed wrt Rails migrations. They can be handy. But I no longer trust down-migrations like I used to.
23:29SegFaultAXddellacosta: When using #change?
23:29ddellacostatbaldridge, mgaare: okay, I guess it's probably more accurate to say that I can't legitimately evaluate datomic right now because of other obligations, and I use price as an excuse. ;-)
23:30mgaareI've come to think that if you're doing a lot of rails migrations, then maybe a relational database isn't really what you want
23:30callenSegFaultAX: hypothetically 8.2 million transactions per second.
23:30SegFaultAXmgaare: What?
23:31gdevdatomic is only free if your time is worth nothing, ;0
23:31callenmgaare: what?
23:31gdevto repurpose a quote about linux
23:31callenDatomic is about to save me a ton of time and hassle at work, it's a win for me and my company anyway.
23:31ddellacostaSegFaultAX: generally speaking I mean. I agree with this: http://flywaydb.org/documentation/faq.html#downgrade
23:32tbaldridgegdev: learning anything takes time. Nice thing is, learning datomic too me way less than most DBs
23:32SegFaultAXddellacosta: Yea #change is shit. Just stick with explicit ups and downs.
23:32SegFaultAXIt's better that way.
23:32callenI don't think anybody is saying Datomic should be used for everything under the sun, but I think it's pretty straightforward to learn and it has more niceties and broader applicability than many may think.
23:32mgaareif you are making that many schema changes where rails migrations are solving a big problem for you, maybe a nosql database would be a better option
23:32ddellacostayeah, I can't say I wouldn't be using Datomic if I didn't have the option, I'm definitely interested.
23:32callenmgaare: ick, no.
23:33tbaldridgegdev: and if you get tasked with a project (like I was) where you need to do a 3 way compare on update with partial merging of data, Datomic is pretty much the only correct answer. SQL is a ugly hack in that case.
23:33SegFaultAXmgaare: Dude, just no.
23:33callenmgaare: migrations aren't nearly as painful as corrupted data.
23:34callenmgaare: I've happily used "NoSQL" data stores in the past, but you shouldn't abandon an RDBMS where its use is commended just because you're finding a migration sticky.
23:34SegFaultAXAnd rapid iteration and changing business requirements doesn't mean we should throw schema out the window.
23:34callenThat's like saying because stop signs are painful, we should just charge through and plow pedestrians over.
23:34ddellacostatbaldridge: oh god, I've done something like that 3-way compare in Ruby + SQL and it was hell
23:34callenI mean, don't get me wrong, I'm all for culling the herd - but that's not a good reason for doing it.
23:34SegFaultAXcallen: This is the sort of dribble I expect to hear from "webscale" type people. Not the fine upstanding citizens of #clojure
23:34ddellacostaheh
23:35gdevokay, so when I do winky o-face ;0 that means I'm kidding
23:35ddellacostaI got yer webscale right heah
23:35SegFaultAXs/dribble/drivel (don't know what my fingers were typing there)
23:35callenSegFaultAX: clearly your inputs needed validation...
23:36gdevI'm the guy trying to get Simulant as an approved testing framework at my job...Clojure Datomic and Datalog on the approved technologies list in one swoop, =D
23:36SegFaultAXgdev: Well done!
23:37SegFaultAXThere's a really hardcore process for adopting new tech at my job...
23:37SegFaultAX"Hey guys, I'm going to write this in Clojure. If you don't like that, please forward your complaints to /dev/null"
23:37mgaarecallen: one hard migration in an app that works well with rdbms, no problem. I think a big pile of migrations can be cause for concern though
23:37SegFaultAXThen I slam my macbook air on the ground and walk to blue bottle.
23:37callenthe process for getting Clojure + Datomic at my company involved explaining it to the project manager. PMs are often hackers, so it wasn't hard. That was about it.
23:37callenmgaare: I don't thin kso.
23:38callenSegFaultAX: macbook air? pleb laptop.
23:38callenSegFaultAX: only non-programmers have MBAs at my company. :P
23:38gdevSegFaultAX, I like it, are you guys accepting resumes?
23:38SegFaultAXcallen: Remember, it's pairing environment.
23:38callen...hrm. that's a truism.
23:38callenSegFaultAX: oh right, with that kind of efficiency you might as well code on chalkboards. Proceed.
23:38SegFaultAXcallen: Primary development is on beefy desktops.
23:39callenscreeeeech, "def get", scraaaaaaaaape
23:39SegFaultAXWell not beefy, but at least they're 486's!
23:39callen*chalk breaks* fuck it, lets scrum.
23:39SegFaultAXgdev: Why yes, yes we are.
23:39callenSegFaultAX: with the turbo button?
23:39mgaareI think nosql gets a bad rap because mongo sucks
23:39SegFaultAXcallen: Don't get crazy dude. We don't need that kind of speed.
23:40callenmgaare: Mongo sucks, but NoSQL is not a general purpose persistence solution - period.
23:40SegFaultAXmgaare: I think nosql is about as useful of a term as "OOP" or "FP"
23:40callengdev: don't let him fool you, they're a rails shop. No Clojure in sight :P
23:40SegFaultAXNot true!
23:40callenmgaare: NoSQL as a "term" and a VERY rough grouping fell out of the need for super high scale specialized persistence layers.
23:40SegFaultAXWell, the rails part is. But the Clojure part isn't!
23:41callenSegFaultAX: where's the beef?
23:41callenmgaare: note that none of what I just said includes, "dinky internal dashboard for SMB"
23:41SegFaultAXcallen: In your mums trousers! Oooooooh
23:42callenSegFaultAX: no but 5realz. Where the parens at?
23:42callenwe've upgraded to (inc :4realz) so truth me.
23:42mgaareI'm no new-db expert, to be sure. My "nosql" experience has mostly been with couchbase
23:42callenmgaare: that's not a general purpose persistence solution either.
23:43callenI bet it'd make a hell of a caching layer though.
23:43SegFaultAXcallen: Right now just internal stuff. But as we migrate more towards SOA/uSOA I'm hoping it will play a larger role.
23:43mgaareThat's sort of how we're using it now, on top of cassandra for the "raw" data
23:44callenSegFaultAX: yisssss
23:44callenmgaare: I'm sorry to hear that.
23:44mgaarecassandra has gotten much nicer this year
23:44callenI wasn't saying that re: Cassandra.
23:44callenCassandra has improved a lot.
23:44gdevI'm trying to use datomic to store all my repl history
23:45callengdev: any...particular reason?
23:45futile♫ this is the tale / of captain jack sparrow ♫
23:45mgaarecallen: saying it re: couchbase?
23:46gdevso when I get an error I can see if I've made the same mistake before
23:46SegFaultAXfutile: Hhheheh
23:46callenfutile: dare I ask what the prompt was?
23:46futile♫ michael bolton we're really gonna need you to focus up ♫
23:47futilecallen: you haven't seen it?
23:47callenI assumed there was a more specific prompt than merely watching the movie.
23:47futilecallen: http://www.youtube.com/watch?v=GI6CfKcMhjY
23:47`cbpwhat's the patrician's preferred laptop? :P
23:47gdevcallen, its also part of the functionality for a project I'm trying to hack together
23:48callen`cbp: retina MBP or thinkpad, but I was being facetious :)
23:48callengdev: that being?
23:49callenalthough Lenovo is doing a really good job of incrementally ruining the thinkpad series.
23:49callenI'm like two bottles of scotch away from doing a Kickstarter for a "hacker's laptop" product line.
23:50callenfutile: "Now I'm back to the good part!"
23:50gdevcallen, clojure-quest
23:50futile"not better"
23:50futilecallen: :D
23:56ddellacostaanyone around who is doing repl-based CLJS testing?
23:56mgaarecallen: that would be great. keep it simple. massive hi res display, tons of ram, fast processor, 1 ssd and 1 spinner, lots of ports. boom done :D
23:56tbaldridgeanyone know where the fn to greek lambda converstion code is in emacs live?
23:57callenddellacosta: sometimes I think you intentionally pick stuff that won't get answered in here.
23:57callenddellacosta: might I suggest Saint Jude?
23:57ddellacostacallen: haha, yeah, that was kind of a shot in the dark. I want to figure out a better CLJS testing flow than the one I have now, and I would like it to be repp-based (rather than the compiling via lein cljsbuild I am doing over-and-over these days…*sigh*)
23:58ddellacostarepp = repl
23:58ddellacostaif that wasn't obvious
23:58callenI've only used lein-cljsbuild :(
23:58callenddellacosta: I think some people do a browser repl based thing, and experiment in that.
23:58callenI don't know that they necessarily run unit tests from it though.
23:58xeqiddellacosta: https://github.com/cemerick/austin and https://github.com/cemerick/clojurescript.test might be of interest
23:59callenxeqi: good call :)
23:59ddellacostaxeqi: I've got a browser-based repl loaded up, and I am using clojurescript.test. The problem is that I have a good flow for writing a test in a file and having it get loaded quickly into my repl so that I can iterate through solving a test in "realtime."