#clojure logs

2013-09-07

00:02brehautuvtc: https://github.com/technomancy/better-defaults/blob/master/better-defaults.el has replaced it i think
00:12zanesweavejester: You might enjoy prelude. https://github.com/bbatsov/prelude
00:13weavejesterzanes: I'll take a look
00:14zanesweavejester: Not sure what's stymying you with paredit, but you'd probably at least need to understand hooks and such to get any of these kits set up the way you want.
00:14zanesweavejester: If I remember, prelude uses smartparens instead of paredit, even for Lisps.
00:15zanesweavejester: Don't' know what you've tried already, but I would imagine the problem with ESK is with some errant hook that's still hanging around.
00:15zanesAnyway.
00:16weavejesterzanes: ESK sets up hooks for lisp modes for paredit. I couldn't figure out a way to disable it without creating my own copy of it.
00:16zanesYikes.
00:17weavejesterNow I just need to figure out why eldoc isn't working :/
00:17zanesESK was enabling it via some unnamed hook or something? I always felt like that shouldn't even be possible.
00:18weavejesterzanes: The hook was named, but fixed as (paredit-mode t). Overriding the name didn't seem to work.
00:18zanesweavejester: Hum. Can't you just remove-hook?
00:20weavejesterzanes: Ah, I didn't know about that one.
00:20weavejesterI'll try that
00:20zanesweavejester: \o/
00:21weavejesterAlthough I'm still puzzled as to why eldoc isn't showing up :/
00:21zanesweavejester: I'd still recommend prelude as a better base, though.
00:21weavejesterI'll take a look at it tomorrow
00:21zanesweavejester: eldoc-mode is enabled?
00:22weavejesterzanes: Yep, and it's connected, and auto-complete works fine
00:22zanesAlas.
00:25seabreAnyone know if this is a good lein template to get started with playing around with clojurescript?: https://github.com/konrad-garus/cljs-kickoff
00:26timg1I used that recently and thought it was good, yes
00:27seabresweet
00:27timg1I also found this to be pretty helpful if you haven't seen it: https://github.com/magomimmo/modern-cljs
00:30weavejesterHm, it looks like nrepl.el is having trouble talking to the nrepl in the latest lein...
00:32weavejesterAhah: https://github.com/clojure-emacs/nrepl.el/issues/356
00:32weavejesterLooks like I need to update my emacs
00:34SegFaultAXtimg1: That project has always confused me. How can you have a "modern" of something that's only 2-3 years old.
00:34SegFaultAXgfredericks: Ping.
00:35timg1I know, it's not like there's a ton of antique implementations around
00:35supersymcurrent-cljs might be more suitable
00:36SegFaultAXsupersym: It's all current. ;)
00:36timg1So would you say that's a bit more, ah… modern?
00:36supersymnah
00:36seabretimg1, thanks that's perfect
00:37supersymtimg1: dang.. I can be slow sometimes.. oh and its late ^^
00:37SegFaultAXgfredericks: Just wanted to let you know I really enjoyed your talk. Most of it wasn't new content for me, but it was pretty good all the same. I did appreciate how you wrote out all the macros long hand before showing the how/why of syntax quote.
00:38timg1np. I like the kickoff one because it's small, but I liked all the tutorial stuff in the modern-cljs one (though I didn't wind up using domina myself)
00:43seabreHaha SegFaultAX, at the rate webdev land moves, 2-3 years is old
01:10dissipate_SegFaultAX, which talk?
01:13amalloydissipate_: presumably his introductory macro talk at clojure/west
01:14zanesYeah, SegFaultAX. You can't throw something like that out there without a link. Haha
01:17seabrehttps://github.com/strangeloop/clojurewest2013/tree/master/slides/sessions/Fredericks-Macros
01:17amalloy$google gary fredericks macro talk
01:17lazybot[Macros: Why, When, and How - InfoQ] http://www.infoq.com/presentations/macros-clojure-west-2013
01:17amalloynot that hard to find without a link
01:25wastreli will watch your video
01:25dissipate_seabre, ah, i have that one bookmarked
01:26dissipate_seabre, unfortunately, there aren't any books on clojure macros
01:31clj_newb_2345besides nrepl + paredit, what else should I use for editing clojure in emacs?
01:31dissipate_amalloy, where is the advanced talk?
01:40seabredissipate_: I'm pretty sure this is still *the* book on macros: http://www.paulgraham.com/onlisp.html
01:45dissipate_seabre, too bad it's not on clojure macros. :(
01:54seabredissipate_: http://blog.fogus.me/2009/01/15/on-lisp-clojure-prolog-pt-1/
02:06sdegutisMade it a little better: http://clojuretip.herokuapp.com/
02:09uvtcsdegutis, neat.
02:10uvtcsdegutis, might be useful to also provide a link with each tip to the relevant clojuredocs.org page.
02:10sdegutisOh yeah good idea.
02:12seabresdegutis: whoa, where's your HTML doctype?
02:12sdegutisseabre: I thought hiccup.core/html gave me one :(
02:12seabrenope
02:16seabreSomething like: (html (html5 [...])) should do the trick
02:54sdegutisFixed. Thanks seabre.
02:55sdegutisHuh, this looks neat: http://clojuretip.herokuapp.com/line-seq
02:59vijaykiranhmm - random isn't too random
03:00sdegutisvijaykiran: it changes every 5 sec
03:00vijaykiranAh - I should wait 5 seconds :)
03:00sdegutisWell, I mean, you still have to refresh.. I should reword that.
03:00vijaykiranyeah, I was waiting for auto-refresh
03:01johnmn3aloha
03:01sdegutisvijaykiran: I'm not sure if auto-refresh would be a good idea or a bad idea.
03:01johnmn3I am attempting to chain a few functions together, which lazily consume a potentially large collection.
03:01vijaykiransdegutis: It'd be bad, IMHO
03:01seabreif you do it, give the user a way to turn it off.
03:02sdegutisoh neat, http://clojuretip.herokuapp.com/rseq
03:02johnmn3for one of the functions, I need to "look ahead" about three elements...
03:02vijaykiranseabre: may be "autorefresh" enable disable could be nice
03:02johnmn3the way I've constructed it though, it wants to consume the whole collection.
03:02jack_rabbitjohnmn3, well...
03:02sdegutisjohnmn3: use lazy-seq and take (or nth)
03:02johnmn3How do I lazily consume three elements at a time?
03:03johnmn3lazy-seq...
03:03SegFaultAXOr perhaps lazy-cat
03:03seabreisn't partition lazy?
03:03vijaykiranSo, who else is on ClojureCup ?
03:04SegFaultAXWhat's that?
03:04johnmn3https://www.refheap.com/18420
03:04sdegutis,(nth (repeatedly #(println "hi")) 3)
03:04clojurebothi\nhi\nhi\nhi\n
03:04seabreSegFaultAX: http://clojurecup.com/
03:04vijaykiranSegFaultAX: http://clojurecup.com .. if your question was directed towards me ..
03:05SegFaultAXjohnmn3: Try this
03:05SegFaultAX,(apply = (take 3 (range)))
03:05clojurebotfalse
03:05SegFaultAX,(apply = (take 3 (repeat 1)))
03:05clojurebottrue
03:05sdegutisjohnmn3: what is "s" and what should (drop-three-in-a-row s) return?
03:06SegFaultAXsdegutis: A seq of some kind, probably.
03:06seabrevijaykiran: I'd like to. I even have an idea, but I'm not confident enough in my clojure skills to get enough done in 48 hours.
03:06johnmn3it is supposed to eliminated long strings of characters that are the same, with the threshold being 3 in a row
03:07vijaykiranseabre: You can always try :)
03:08johnmn3the (if (> 4 (count l)) ... is simply to prevent index out of bounds... so it just throws away the last few.
03:08vijaykiranseabre: I registered as well .. with a couple of things in my mind .. but I need to work on designs and such
03:08vijaykiranseabre: btw there's #clojurecup channel
03:08johnmn3sdegutis: S is just a collection of things
03:08sdegutisjohnmn3: ah I see. Hmm interesting problem.
03:09SegFaultAXvijaykiran: Neat!
03:09johnmn3I was thinking partition, but...
03:09johnmn3it has to be a sliding window
03:10sdegutisjohnmn3: why wouldn't partition work? I don't understand what you mean by sliding window.
03:10johnmn3it has to compare three elements each iteration, but iterate by one
03:10sdegutisAh right.
03:10SegFaultAX,(take 4 (parition 3 1 (range)))
03:10clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: parition in this context, compiling:(NO_SOURCE_PATH:0:0)>
03:10SegFaultAX,(take 4 (partition 3 1 (range)))
03:11clojurebot((0 1 2) (1 2 3) (2 3 4) (3 4 5))
03:11johnmn3er we are
03:11sdegutisSegFaultAX: you could do that but you'd have to remove offending matches from the prev/next tuples too
03:11sdegutisSegFaultAX: which gets ugly anyway
03:12SegFaultAXsdegutis: Meh
03:12sdegutisOh wait! You could do partition *twice*.
03:12johnmn3I think it will work
03:12SegFaultAXjohnmn3: Why cap it at 3?
03:13johnmn3SegFaultAX: it's subjective really.
03:13sdegutisSo for [1 2 3 4 5] you'd get ((0 1 2) (1 2 3) (2 3 4) (3 4 5)), and then you partition it again to get (((0 1 2) (1 2 3) (2 3 4)) ((1 2 3) (2 3 4) (3 4 5)))
03:13johnmn3just trying to make noisy data more noisy
03:14sdegutisThis way you get to compare ((0 1 2) (1 2 3) (2 3 4)) all at once, and if the middle set is all equal, then filter that whole set-triple out... or something
03:15sdegutisActually no, because then your next set-triple will still have dups. This plan no worky.
03:15amalloyjohnmn3: you really shouldn't use (> x (count coll)) unless you know coll is counted - it breaks on infinite seqs, and is unnecessarily slow for large, finite sequences
03:15amalloyinstead, (nthnext x coll) does the same thing
03:15johnmn3amalloy: thanks!
03:16sdegutishttp://clojuretip.herokuapp.com/nthnext for reference
03:17sdegutis,(dec' 1.5)
03:17clojurebot0.5
03:17sdegutis,(dec 1.5)
03:17clojurebot0.5
03:17SegFaultAX,((fn rle [s] (when (seq s) (let [run (take-while #(= (first s) %) s) c (count run)] (cons [c (first s)] (rle (drop c s)))))) "111111222222333333abccccd")
03:17clojurebot([6 \1] [6 \2] [6 \3] [1 \a] [1 \b] ...)
03:18SegFaultAXI meant to make that lazy, but yea. RLE.
03:18amalloy&((fn rle [s] (map (juxt count first) (partition-by identity s))) "111111222222333333abccccd")
03:18lazybot⇒ ([6 \1] [6 \2] [6 \3] [1 \a] [1 \b] [4 \c] [1 \d])
03:18SegFaultAXOr that.
03:19SegFaultAXOh yea, partition-by
03:19SegFaultAXMan I love clojure.core
03:19amalloythat's a classic rle impl, actually
03:20SegFaultAXamalloy: Yea, I didn't think of it.
03:20SegFaultAXNot sure why. :/
03:20amalloythe decoder is even simpler: ##((fn rld [s] (mapcat (partial apply repeat) s)) '([6 \1] [6 \2] [6 \3] [1 \a] [1 \b] [4 \c] [1 \d]))
03:20lazybot⇒ (\1 \1 \1 \1 \1 \1 \2 \2 \2 \2 \2 \2 \3 \3 \3 \3 \3 \3 \a \b \c \c \c \c \d)
03:20amalloySegFaultAX: eh. these tricks all look easy when you've already seem them once
03:20johnmn3what's rle stand for?
03:20SegFaultAXRun-length encode
03:21SegFaultAXIt's a standard compression technique
03:21sdegutisReworded http://clojuretip.herokuapp.com/ to make it clearer how randomness is cached.
03:21SegFaultAXamalloy: No I've definitely implemented it in terms of partition-by before (thought not juxt).
03:21johnmn3ah, k
03:22SegFaultAXThough*
03:22SegFaultAXI started mentally from implementing it in Ruby instead of doing it properly in a Clojure mindset.
03:22amalloysdegutis: it's not clear to me why anyone would care about your randomness source?
03:23sdegutisamalloy: mainly because people might get confused why clicking random twice in a row isn't changing anything
03:23amalloyexcept that it makes the app way worse IMO: now i can't just pound on refresh until i get something i don't already know
03:23sdegutisamalloy: hmm yeah that was annoying to me too.. maybe the cache should be optional or just taken off
03:23amalloyoff. there's no reason for it at all
03:24sdegutisFixed.
03:25seabresdegutis: That's way better
03:26sdegutisYeah, not sure why I added the caching.
03:26amalloyanyway, without the cache it's a neat little toy that will probably help some people. thanks for making it
03:27sdegutisthank TimMc
03:27sdegutishis idea :)
03:27kohkaneHey guys, I was just wondering if there was any way to recursively call an anonymous functions?
03:27SegFaultAXkohkane: Y-combinator
03:27sdegutisOh neat, http://clojuretip.herokuapp.com/replace
03:28SegFaultAXkohkane: Or just give your thing a name. ;)
03:28ddellacostasometimes my repl just freezes, there is some key command (ctrl-<something>) I'm doing to cause it, but I can't do anything without killing it and restarting the repl
03:28ddellacostavery frustrating, anyone else experienced this?
03:29sdegutisnot I
03:29amalloy&((fn ! [x] (if (zero? x) 1 (* x (! (dec x))))) 5) ;; kohkane
03:29lazybot⇒ 120
03:29amalloyddellacosta: if you're in emacs, you can C-h C-l to see what keys you just pressed
03:29ddellacostaamalloy: yeah, I'm not
03:30ddellacostaamalloy: I use a repl from outside emacs mostly
03:30ddellacostaamalloy: although I really need to start using it in emacs. Just haven't bothered yet since this mostly works for me beautifully
03:30amalloyso...surely you have readline support, at least, right?
03:31kohkaneamalloy: Thanks
03:32amalloyi'm just trying to rule out the possibility that it's your tty STOP character, ddellacosta (which is C-s in most non-readline instances)
03:32amalloyif it's that, C-q should free it back up
03:33ddellacostaamalloy: yeah, I've tried that and it doesn't work--I figured I was doing exactly that and no dice. Ah well, I guess this is the thing that is telling me I really need to get comfortable with emacs repl
03:34amalloyif you're already happy with emacs, slime (or i guess nrepl these days, though i still prefer the Old Ways) is so so much better than a standalone repl
03:35ddellacostaamalloy: it's really stupid but I haven't bothered yet because I don't know all the key bindings to push stuff to the repl, and I find it really frustrating looking at the repl always at the bottom of the buffer--I'm constantly hitting ctrl-l in my terminal. I'm sure it's just configuration but it's something I'll have to sit down and figure out, and since what I have works quite well, I haven't tried yet. But there are a number of
03:35ddellacostareasons I really need to give it a shot.
03:36ddellacostaI'm going to have to just sit down one of these days and slog through learning everything I need to get productive in emacs + nrepl
03:36amalloyddellacosta: all you really need are C-c C-k, C-M-x, C-c C-z (optional), and C-c M-n (for nrepl; slime uses C-c M-p)
03:37amalloyrespectively, those are: eval entire file; eval one form; switch to repl buffer; set repl namespace to current file's namespace
03:38ddellacostaamalloy: thank you!
03:38amalloyoh, and bind nrepl-jack-in to something; i like C-c j
03:39ddellacostaamalloy: alright, now I have no excuses. ;-)
03:40ddellacostaamalloy: and now that I'm playing with it, really not sure what I was complaining about re: repl being stuck at bottom of buffer…responds to ctrl-l just like any other emacs buffer it would seem.
03:40ddellacostahuh, maybe it was an older version? dunno
03:41ddellacostaomg it is really so much better what was I thinking
03:41amalloythat was fast!
03:42ddellacostaamalloy: I swear, the last time I tried it it did not work this smoothly for me
03:42ddellacostaamalloy: now it's just, like, bam
03:42amalloyi've tried nrepl a couple times, but i keep going back to swank
03:43amalloymostly i can't stand how nrepl behaves when an exception is thrown
03:43ddellacostawhoops, meant that to be a question
03:43ddellacostaah, hmm--let me see
03:43amalloythere are one or two other minor things, mostly related to keybindings that wouldn't be too hard to fix. i forget, really; just a lack of polish that someone will get around to fixing eventually
03:44ddellacostaamalloy: gotcha.
03:44sdegutis,(memfn length)
03:44clojurebot#<sandbox$eval31$fn__32 sandbox$eval31$fn__32@5e6f01>
03:44sdegutis,((memfn length) "foo")
03:44clojurebot3
03:44ddellacostaamalloy: well, sincerely, thanks for that little push, it was just what I needed. Now I have to get my CLJS flow integrated with this too, which hopefully won't be too hard.
03:45ddellacostaxeqi was giving me some tips last week or something, and it seems like it shouldn't be hard either
03:45amalloyyou're on your own with cljs, though. i don't really remember who uses nrepl+cljs
03:46johnmn3can flatten work lazily?
03:46johnmn3like (take 5 (flatten (stuff large-coll)))
03:46ddellacostaamalloy: hmm, how do I get access to the namespace of the directory I'm in? Do I need to connect to a repl session explicitly started up in that dir.?
03:47SegFaultAXjohnmn3: Why do you need flatten? Using it sometimes indicates that you've done something you shouldn't have.
03:47SegFaultAXSometimes, not always.
03:48seabrejohnmn3: I'm pretty certain flatten does not work lazily.
03:48johnmn3well, the function I am mapping returns a seq but I need the end result to be in one collection.
03:48ddellacostaah, nevermind
03:48amalloy~flatten
03:48clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
03:48seabrejohnmn3: http://stackoverflow.com/a/12627760
03:49johnmn3got it
03:50johnmn3looks like mapcat worked out of the box.
04:38dobry-denwow. there's nothing like wrestling with strings for an hour wondering why (get {"cat" "Mittens"} "cat") => nil. until finally deciding to (map int "cat") => [65279 99 97 116]
04:39dobry-deni need to find a repl setting that displays every nondisplayable character as a flaming gif.
04:55callendobry-den: lol :)
04:55callendobry-den: happens to the best of us.
05:19TEttinger,(char 65279)
05:19clojurebot\?
05:47roybattywhat's the political channel on #freenode?
05:47roybattyyogothos you're a machine
05:47TEttingerroybatty: I'm guessing after not too long, #suicide
05:48roybattyTEttinger: are you european?
05:48TEttingerno.
05:48TEttingerI just think politics discussions on IRC are futile
05:48roybattyamerican?
05:48TEttingerand will make you consider the futility of life itself
05:48TEttingeryes
05:48roybattyfutility of life
05:49roybattythat somehow reminds me of my favorite movie Blade Runner
05:49TEttingerit reminds me of monty python
05:49roybattyyou an atheist?
05:49TEttingeryes
05:49roybattyi'm agnostic
05:50roybattyatheist is a hard hard life
05:50TEttingerreligion is very hard to talk about on IRC as well
05:50roybattythis is clojure...sorry
05:50TEttingermy religion is lisp
05:50TEttingerlanguage holy wars
05:50roybattymy religion is static typing
05:50TEttingercrusade!
05:51roybattymy religion is syntax
05:51roybattywhat am i doing here
05:51TEttingerclojure.typed shows up to merge the two, gets crucified
05:51roybattyno, no
05:51roybattyno, and another no
05:51roybattyi like static for the tools
05:51roybattygodamn javascript errors
05:51TEttingerif you don't know if god exists, how can he damn javascript errors?
05:52roybattyfucking jquery let's $("whatever)
05:52roybattystalin is a loosey goosey javascript asshole
05:52TEttingerthis is entertaining
05:52roybattyi'm not bothering yet?
05:52roybatty;)
05:52TEttingernope!
05:52roybattycool
05:53TEttingerhttp://dimethyltryptamine.info/ link this when you find a politics channel, see what happens
05:53roybattyTEttinger: : you american?
05:53TEttingeryes
05:53roybattyahh
05:53roybattyi love semantics, but hate syntax
05:54roybattyi want python syntax and static typing and clojure semantics
05:54roybattyperfect
05:54roybattythen we have perfection
05:54TEttingersomeone needs to finish salmon. the craziest type system
05:54roybattynobody can read everybody elses clojure
05:54roybattythere's no fucking types
05:55TEttingerhttp://salmonpl.net/docs/features/type_system.html
05:55TEttingerthere are
05:55roybattyand we're told we don't need a fucking debugger
05:55TEttingerwe have a repl
05:55roybattyi can't step through
05:56roybattyno, no, no
05:56roybattyi want a debugger
05:56roybattyi'm not hardcore like you guys
05:56roybattyeither are 99.99% of others
05:56roybattygive a brother a break-point and a step
05:56roybattyand a inspect
05:56roybattythere we go
05:56TEttingerbut yeah, if you want to make a programming language, the salmon type system would be a good thing to copy
05:57roybattyshit, if i could just get a breakpoint in counterclockwise just to check things out
05:57roybattybut that's bullshit anyway..
05:57TEttingerif I could figue out why light table can't eval a file that would be nice
05:58roybattylight table is cool
05:58roybattydownloaded 4.0 or whatever a few days ago
05:58roybattybut it doesn't give us anything we don't already have
05:59roybattyfuck this animation javascript/clojurescript crap
05:59roybattyhow does it help us in the field
05:59roybattyi just love the semantics of clojure
05:59roybattyso beautfiul
05:59roybattyno OO, no OO!
06:00roybattylike Milton in Office Space, No salt!, NO Salt!
06:00danielszmulewiczWhat is more idiomatic regarding passing arguments to a function: a map with keys and values or named parameters?
06:01roybattydanielszmulewicz: : without types, nobody knows
06:01TEttingerdanielszmulewicz, I've seen destructuring a lot to get named params from a map
06:01roybattycan i pay some kid in Bulgaria to translate clojure to python syntax?
06:02roybattywith gradual typing
06:02danielszmulewiczYes, you can destructure both with just an ampersand difference.
06:03roybattydanielszmulewicz: : yeah you think you're cool with your polish last name don't you!
06:03TEttingerit is a cool name
06:03roybattyhow
06:03roybattyjust kidding
06:03roybattymessing around ;)
06:03danielszmulewiczthanks! As a matter of fact, I don't think about too much
06:03roybattyso many consonants
06:04danielszmulewiczit's a jewish/polish name
06:04roybattyyeah, you're american
06:04danielszmulewiczit means "son of samuel"
06:04roybattyit's cool, just busting balls
06:04danielszmulewicznot american
06:04roybattyisrael?
06:04danielszmulewiczyup
06:05roybattycool bro
06:05roybattylove me a cool israeli brother
06:05roybattyi'm american
06:05danielszmulewiczyou're a bored american
06:06danielszmulewicz:-)
06:06roybatty;waiting for obamacare to lob some cruise missiles
06:06roybattywhat a dork
06:06roybattyamericans are sick of fighting
06:07roybattythat's a lie
06:07roybattyamericans are never sick of fighting
06:07roybattywe're american, it's our nature to fight
06:08TEttingerdanielszmulewicz, this might be handy http://clojure-doc.org/articles/language/functions.html#extra_arguments_aka_named_parameters
06:08roybattyback to clojure
06:08roybattywhy does clojure have the best community?
06:08roybattyRich is a svengali or something
06:10TEttingerbecause clojure is productive and focuses on getting things done, as a language it's pragmatic. also it's really slow, so we were able to steal a bunch of ruby type programmers who were used to slow but wanted more power
06:10danielszmulewiczTEttinger: thabks!
06:10TEttingerthere are caveats to clojure is slow, parts can be fast, but idiomatic clojure is slow
06:12roybattyhere's the deal
06:12roybattyon hacker news and other places
06:12roybattyclojure is read-only
06:12Brand0just like its data
06:13roybattyif we had clojure semantics with python syntax and gradual typing it would rule
06:13roybattyand i'll shut up
06:13roybattybecause i know that's sacrilegi
06:14roybattywe can't figure things out without types
06:16TEttingerroybatty, people do figure plenty out without types, but definitely use type hints and it gets clearer. and faster
06:17roybattyTEttinger: : i understand that
06:17roybattyTEttinger: I don't. I have visual studio, C#, and resharper
06:18TEttingerroybatty, this IS sacrilege but you can do exactly what you said with racket, by using one of their different syntaxes and type contracts
06:18roybattyi let the machine figure out my refactoring for me
06:18roybattywith dynamic i can't
06:18roybattywith resharper its a given
06:18TEttingeroh and roybatty, there are some utility libs for racket to get clojure data types I think
06:18roybattywith static i'm guaranteed my refactoring is good
06:19roybattyresharper never lies to me:)
06:20roybattywell, most of the time she don't lie
06:20roybattyi love the non-OO of clojure
06:20roybattywhich is easy for intellisense
06:20roybattycode-completion
06:22roybattybrothers...but what hacker news people and me always dig down to is that once you get down to s-expression after s-expression you can't read that without machine help or type
06:23roybattys-expression after s-expression
06:23roybattynot
06:23roybattynot in a team environment, no way
06:24roybattywe need types in the core of the language
06:45roybattybahh,,
06:46roybattyif you man up
06:46roybattyand lob missiles in
06:46roybattythen man up and put man in
06:49roybattyman up and lob something at Iran
06:49roybattyobama says
06:50roybattyiran is a real war
06:51roybattyreal boots on the ground
06:51roybattysorry clojure, but i know you guys love a little side commentary
06:57roybattystraight outta comptan
09:06grandycomments on using sqlite in clojure?
09:24muhoograndy: works, last i tried it. warning: jdbc, though.
09:24grandymuhoo: any alternatives you'd recommend?
09:31grandyanyone have recommendations for similar/better approaches to this: https://clojars.org/validation-clj
09:33hyPiRiongrandy: perhaps bouncer?
09:33hyPiRionhttps://github.com/leonardoborges/bouncer
09:33grandyhyPiRion: thanks!
10:21sdegutisWhy does nrepl-eval-last-expression (in nrepl.el) lately say "Namespace not found." instead of just doing good stuff?
10:24sdegutisOh, you have to manually do (ns user) in the repl first now.
10:25grandyHello, looking for advice on displaying an incanter chart in a seesaw ui frame ...
10:39sdegutis,(+ 1 2 3)
10:39clojurebot6
11:12stanislavsobolevhello guys, can anybody help me with parsing big xlsx file?
11:13stanislavsobolevsmart man say to me, that i need using Apache POI streaming API, but i cant find any wrapper for that api, all wrapper build on org.apache.poi.xssf.usermodel
11:13stanislavsobolevand not on org.apache.poi.xssf.streaming SXSSFWorkbook
11:58coventry`sedgutis: C-c M-n to evaluate namespace form in current buffer.
12:21jjttjjanyone know how hard it would be to do an emacs plugin that allows quick toggling between html and hiccup, ie so i can edit html files in hiccup then toggle them back? Is it a realistic first emacs lisp project?
12:23jjttjjhiccup + paredit, etc totally spoiled me and I can hardly look at normal html anymore
12:44seangrov`jjttjj`: That's a pretty sizeable first emacs project
12:44seangrov`I'd definitely use it though
12:46arrdemjjttjj`: A while ago I built an html -> hiccup reader only to find that someone else had a better one already. I'm sure you could cobble something together using nrepl, a html reader lib and hiccup itself
12:46arrdemjjttjj`: I too would use such a thing heavily
12:50arrdemhow would you guys represent "mixin" attributes in data?
12:51sdegutisarrdem: assoc?
12:52arrdemsdegutis: I'm thinking I'll wind up with a :mixins {}
12:52sdegutisarrdem: I don't understand what you're asking for or why.
12:52arrdemso I'm trying to describe the models in a table top game
12:52arrdemfor the most part they're all the same with a fixed bunch of stats
12:53arrdembut some have "special rules" that apply
12:54arrdemso I'm trying to think of a nice way that I can indicate the involvement of such rules while keeping my data structure JSON serializable
12:54sdegutisarrdem: I assume by "model" you're talking about an ORM you're using?
12:54arrdemsdegutis: nope, physical model like a chess piece
12:56sdegutisarrdem: Why not hierarchical data? They can each include a :stats key.
12:57arrdemsdegutis: yeah that's probably the right approach
12:57arrdem
12:58arrdem,(= ::cold :cold)
12:58clojurebotfalse
12:59bbloomarrdem: ##(prn ::cold :cold)
12:59lazybot⇒ :clojure.core/cold :cold nil
13:00arrdem,(do (in-ns 'arrdem-derpin) (read-string "::cold"))
13:00clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: read-string in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:06sdegutis,*ns*
13:06clojurebot#<Namespace sandbox>
13:07arrdem,::foo
13:07clojurebot:sandbox/foo
13:07arrdem##::foo
13:08arrdem&::foo
13:08lazybot⇒ :clojure.core/foo
13:08sdegutis,(find-var 'clojure.core//)
13:08clojurebot#'clojure.core//
13:08sdegutis,(find-var (symbol "clojure.core//"))
13:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No such namespace: clojure.core/>
13:08sdegutiswat
13:10Bronsasdegutis: that's weird, it works on my repl
13:10sdegutisBronsa: Clojure 1.5.1 ?
13:11sdegutisFails in my repl.
13:11Bronsa1.6.0-SNAPSHOT
13:11sdegutiso
13:13Bronsasdegutis: https://github.com/clojure/clojure/commit/88cad2510243289d2bbe28cf8bd14007d9df5fc3#L1L60
13:13sdegutis:D
13:14arrdemw00t!
13:15bbloomBronsa: that change too waaaayyy too long to show up :-P
13:20sdegutis,(find-var (symbol "clojure.core" "/"))
13:20clojurebot#'clojure.core//
13:20sdegutisGud nuff.
13:30sdegutisTimMc: ping
13:53sdegutis,..
13:53clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/.., compiling:(NO_SOURCE_PATH:0:0)>
13:53sdegutis,.
13:53clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: . in this context, compiling:(NO_SOURCE_PATH:0:0)>
13:53sdegutis:(
14:01llasram&@#'..
14:01lazybot⇒ #<core$_DOT__DOT_ clojure.core$_DOT__DOT_@159e10c>
14:18callengahhhh unhappy people :(((
14:21seangrov`Unhappy people?
14:24mimmoQUIT
14:26callenseangrov`: trying to catch up on Korma issues/PRs this weekend, some are a little derelict and need dealt with quickly.
14:27callenseangrov`: people get (and not without reason) unhappy if contributions languish. I feel bad :|
14:27konrApparently I can't `read-string` some strings, like "\" \\ABC \""
14:28konr,(read-string "\" \\ABC \"")
14:28clojurebot#<RuntimeException java.lang.RuntimeException: Unsupported escape character: \A>
14:28konrIs there any way around that?
14:28callenseangrov`: had a lot of fun last night, thanks for your time and the food/drinks :)
14:29seangrov`callen: Same here, very enjoyable.
14:32sdegutiskonr: what's it supposed to be?
14:36konrsdegutis: the string " \ABC "
14:38brainproxyhttps://groups.google.com/forum/#!topic/clojure/KQhMkNl6RDs
14:38brainproxy^ mentioned DevDocs last night in channel; if you're so inclined, go vote for Clojure docs to be ported to it
14:38brainproxydetails in the gg thread
14:41sdegutiskonr: ##(read-string "\" \\\\ABC \"")
14:41lazybot⇒ " \\ABC "
14:56callenbrainproxy: I'm really not a huge fan of community resources, especially documentation, wikis, etc that the community cannot step in an improve themselves.
14:57callenWe got in the same exact situation with clojuredocs.org, and lo-and-behold, that damnable Rails app is still on Clojure 1.2 and 1.3
14:57brainproxycallen: as i noted in the gg thread, i prefer that too
14:57sdegutisI wonder if clojuretip could reasonably be extended to be more like clojuredocs
14:58callensdegutis: no.
14:58sdegutiscallen: why not?
14:58brainproxythat being said, i've found devdocs saving me time (and serving as a learning resource) over and over again, so if i had the clojure documentation in the same tool, it would be all the sweeter
14:59callenbrainproxy: you...could use clojuredocs.org
14:59brainproxycallen: have, still do
14:59sdegutiscallen: stuck on 1.3
14:59brainproxywell that
15:00callensdegutis: that's not a complete roadblock for basic Clojure.
15:00sdegutisOkay Mr "you can't make it perfect so don't even try at all"
15:01sdegutisStarting on http://clojuredocs.herokuapp.com/ now.
15:01callenmore of a root cause issue.
15:01sdegutisCan you elaborate?
15:01callenit's not really worth it unless you address it. 5 whys and all that.
15:02sdegutisI am so confused in this conversation.
15:02sdegutisLet's start over. Hi, my name's Steven.
15:02brainproxylol
15:03zanesbrainproxy: If you're on a Mac you might like Dash. It seems pretty similar. http://kapeli.com/dash
15:03zanesbrainproxy: Already supports Clojure.
15:03brainproxylet me put it this way, if the maintainer ports the clojure docs into it, I'll make good use of that and will be grateful
15:03callenzanes: I already pointed it out to him, I don't really know why he didn't take it seriously.
15:04brainproxycallen: it's fine, it's neat
15:04zanescallen: Ach. Sorry; I missed that.
15:05callenzanes: no it's fine, this is from...like last night.
15:05brainproxyi like DevDocs, i would like to see clojure's docs available in devdocs, if other's feel the same way, just wanted them to know they may be able to help make it happen
15:05brainproxythat's all i'm saying
15:05brainproxyand I did bookmark dash
15:05callenyou'd be able to port them yourself if it was a wiki or dash.
15:05brainproxythat is a true statement
15:06seangrov`callen sdegutis I might take a stab at an implementation of clojuredocs
15:06seangrov`Have it hosted on github and allow updates to it via PR's
15:06sdegutisseangrov`: https://github.com/sdegutis/clojuredocs/commit/445d44d4c0b9e2e80823e9c1c32937a343ad3ecd
15:06callenseangrov`: I'm a wiki nut, is there a good way to discuss it?
15:07callenseangrov`: my problem with clojure-doc was that it was github PRs, I'd really like to see something lower friction like EmacsWiki.
15:07sdegutisI think I'll have a decent prototype in about 20 mins.
15:07callenso that more people actually contribute.
15:07sdegutisOh yeah, I hadn't thought of the examples part of clojuredocs.
15:08brainproxythere's also wikemacs, which is mediawiki based
15:08brainproxynot nearly as popular though
15:08sdegutisI think it's still doable without being a wiki.
15:08callenit's not about being "doable", but rather dealing with the problem more conclusively so that we don't get stuck with something like clojuredocs for multiple years again.
15:08seangrov`callen: Yeah, makes sense
15:09callenseangrov`: so, my idea is to have a split in the wiki, some parts are semi/fully automatically generated, but then sections underneath the auto-generated bits are open to community editing, including examples and the like.
15:09callenfrom there, it's a wiki, so any of the unprotected pages can be fully modified and you can make new content as you'd expect.
15:09konrI have clojurewiki.org. It was overrun by spambots, then I turned it off, but perhaps it's time to ressurect it
15:10callenkonr: I own clojurewiki.com :P
15:10seangrov`hah
15:11callenseangrov`: I used to be notorious for complaining about template libraries (until we made Selmer)
15:11callenseangrov`: the other leg to that chair of complaining for the last couple years has been the lack of a decent wiki.
15:12seangrov`callen: emacswiki has been useful, but it's so incredibly messy and at times incoherent that it took me awhile to figure out how to get value from it
15:12seangrov`Inline discussions, etc.
15:13callenseangrov`: yeah that's why I was imagining having curated content at the top, contributed and refined content in the middle, and discussion at the bottom.
15:13callenseangrov`: I never minded the old-fashioned wiki style because I was weaned on c2 wiki.
15:13konrCliki is pretty well-organized ttp://cliki.net/
15:13konrhttp://cliki.net
15:13callenit's pretty good, yeah.
15:15callenI'm headed out, bbl - looks like my weekend is spoken for :)
15:15bbloomdnolen: I remember you telling me about "nanopass". have you read Sarkar's dissertation?
15:15dnolenbbloom: haven't
15:16bbloomdnolen: took me a while to find it, since the earlier Dybvig paper dominates the results.
15:17bbloomdnolen: i'll let you know how it is
15:17dnolenbbloom: I chatted some with Andy Keep about Chez, not sure if/when the new nanopass version will see the light of day.
15:18brainproxycallen: downloaded dash, will play with it
15:19bbloomdnolen: i'm interested both for cljs & for another project. this other thing i'm working on has some input tree structure & several different output targets, so it's starting to get pretty unwieldy. hoping to learn some tricks for dealing with the proliferation of traversal & dispatch logic
15:19dnolenbbloom: actually, looky here - http://github.com/akeep/nanopass-framework
15:20bbloomdnolen: yeah, already got it started :-)
15:20bbloomdnolen: reference [2] was easy to find, but took me a bit to dig up [1]
15:21bbloomdnolen: let me know if you want it
15:23callenbbloom: reddit.com/r/scholar ?
15:23bblooms/started/stared/
15:23bbloomcallen: didn't know about that. thanks
15:24dnolenbbloom: found it thanks
15:24callenbbloom: you seemed to need papers on a regular basis, figured it could help you out.
15:24bbloomcallen: i usually have very good luck w/ scholar.google.com
15:24callenalways nice to have a fallback though.
15:25bbloomyup
15:26callenthey're stealing our toys: "Okay, managed to get #clojure http-kit server working from #jruby. Rack adapter will be next. Eager to have fastest http server in jruby! ;D"
15:28sdegutisbrainproxy, seangrov`: thoughts? http://clojuredocs.herokuapp.com/
15:28bbloomcallen: i don't understand jruby...
15:28bbloomit just seems like a game of kick the can
15:28callenbbloom: "lets make libraries thread-safe for a runtime nobody uses while people continue to make thread-unsafe libraries"!
15:28headiuskick the can?
15:28bbloom"oh, your rails app is too slow? rather than factor out components, why don't you just make it less compatible with everything else!"
15:28callenbbloom: I think the real reason is you don't have to give up Ruby if you need to use JVM tooling/libraries.
15:28bbloomheadius: heh, we had this chat on twitter already
15:28headiusdid we?
15:29brainproxysdegutis: what is your goal?
15:30bbloomheadius: yeah on Jun 24th :-P I won't rehash it here
15:30headiusdid I win?
15:30bbloomheadius: i think by viewing it as win or lose, you de facto lose :-)
15:30brainproxysdegutis: i like the simplicity of it, btw
15:30headiusbbloom: or I could be joking
15:31bbloomheadius: *shrug* ok
15:31sdegutisbrainproxy: For starters, to be kind of like clojuredocs.org but for Clojure 1.5.1
15:31headiusI think the point you guys are missing is that some people *like* Ruby, but don't like the C runtime
15:32bbloomheadius: i quite like Ruby/Rails
15:33mtprails was way too magicky for me
15:33callenditto, but I was a Django user. Might be biased.
15:33mtpi lean towards frameworks like Sinatra/dancer/flask :p
15:33bbloomheadius: I just don't think that it's a good move to port large apps to another platform hoping for access to some particular JVM library or marginal performance improvement, at the cost of dramatic ecosystem complexity
15:33mtpbecause i can actually read the code for these things and explain to, e.g., my nontechnical partner{,s}
15:33mtpwhereas rails immediately jumps off the rails into metametaprogramming
15:34mtp:)
15:34headiusbbloom: we don't recommend porting large apps either...we recommend starting new apps on JRuby
15:34bbloomheadius: that makes even less sense to me….
15:34headiusand the ecosystem complexity is no worse than the nonsense people put up with on C Ruby
15:34bbloomheadius: sure it is. there are tons of libs that don't work on jruby
15:35headiusfunny thing...there's tons of libs that don't work on MRI
15:35bbloomheadius: … that are written in ruby for MRI? lol
15:35headiusI don't think it's a good idea to stay on MRI just for libraries when you have a crap garbage collector, no concurrency, and need to spin up two dozen processes just to run a site
15:36headiusof course what makes even less sense is you being a clojure fan and not getting why JRuby is a good idea
15:36headiusthe JVM is awesome...unless it's JRuby, which is dumb!
15:37callenheadius: we get lisp, performance, power, ease of use, and the JVM. #FirstWorldLispProblems ?
15:37callenwe even get to use our own language on the frontend with the same async concurrency library.
15:38headiuscallen: and JRuby users get ruby, performance, power, ease of use, and the JVM
15:38bbloomif GC or concurrency are your issues w/ a ruby app, then you're gonna need to ditch rails & tons of other things that actually make ruby interesting (to me)
15:38callenheadius: no STM though right?
15:38callenmutable semantics, so you're still in the tar pit.
15:38headiusyou can use an STM library...I have a gem for JRuby that exposes clojure's
15:38bbloomclojure being on the JVM is probably the least interesting bit for me, btw. i could care less & i use very few java libraries
15:38callenheadius: I'm not trying to diminish your work, it's just that the trade-offs don't make sense for me. I'd rather make a bigger leap from MRI Ruby if I needed srs-mode JVM than JRuby.
15:39headiuswell, I won't get into the mutability versus immutability argument because that's more religious than anything
15:39callenI don't think it really is.
15:39sdegutisCool, this already does most of what I need: http://clojuredocs.herokuapp.com/
15:39bbloomcallen: lol i was gonna say that, but then realized that we're pretty religious about it :-P
15:39callenClojure offers both, but the better defaults make things like core.async possible.
15:39headiusI'll believe that immutability is the only answer when everything is implemented immutably down to the metal
15:39headiusuntil then, it's always a continuum
15:40callenheadius: that's like saying because houses are made of wood and concrete, we shouldn't use carpet.
15:40callenheadius: that's a sibling of the ridiculous turing-completeness false-equality arguments people make.
15:40bbloomheadius: i think JRuby is a neat piece of tech & i think you've done great work on it. From a scientists point of view: good shit! From an engineers point of view: I don't understand why I'd ever choose to use it
15:41callencars have steering wheels, you don't manipulate the rack-and-pinion with your bare hands.
15:41headiusmy argument is not that we shouldn't hold up immutability as the right way to build concurrent programs...my argument is that saying everything should be immutable all the time is ignoring the fact that you *can't* write everything that way
15:41callenheadius: I just got done making a point of the fact that Clojure makes mutability *available*, just not the *default*
15:41bbloomheadius: clojure isn't saying that. in fact it's saying THE OPPOSITE of that
15:41headiushow is it not the default?
15:41bbloomheadius: clojure is saying that you need to give deeper thought to *which* things are immutable
15:42callenheadius: and much of what makes "mutable" semantics usable in Clojure is that the foundation is immutable, enabling STM and trivially thread-safe code.
15:42bbloomer i mean which are mutable
15:42headiusoh, I read that wrong
15:42headiussure... and in Ruby immutability is available but not the default
15:42callenheadius: (def blah (atom {})) (swap! blah assoc :a 1) @blah => {:a 1}
15:42headiusso where on the continuum is the right place? there is no one place
15:42bbloomheadius: sure, and i used Hamster.rb a few client projects to great effect
15:42callenheadius: we only have the STM to express the mutation I just demonstrated because the foundational data structures are immutable
15:42callenheadius: you are needlessly impoverishing yourself.
15:43headiusimpoverishing myself?
15:43dnolenheh, I don't recall this being the Clojure vs. JRuby channel
15:43callenyou can have the semantics you want, but you can make them more powerful, safer, and more flexible if you use the right, simple foundations for everything.
15:43headiusdnolen: I didn't start it :-)
15:43callenheadius: so yes, you are impoverishing yourself. Using mutable foundations and a smattering of immutability on top is eating your corn seed instead of planting it.
15:44headiuscallen: I'm saying there's no one "right" foundation
15:44callenI'm not either, but there are better ways than what Ruby does.
15:44callenjust because we haven't achieved perfection doesn
15:44headiusI never said there wasn't
15:44bbloomI don't wanna argue about whether or not ruby is worthwhile at all
15:44bbloomit's got it's place
15:44callendoesn't mean we shouldn't strive to improve things.
15:44headiusindeed...that's the point of JRuby
15:44headiusthank you for making it for me :-)
15:45headiusFWIW, I love clojure's principals and lament the lack of pervasive immutability in Ruby on a daily basis
15:46headiuswhat I like about working on JRuby is that I'm helping to build a foundation for future versions of Ruby to make better decisions in that regard
15:46seabreImmutability as a default in ruby would be nice.
15:46callenheadius: but what worries me is that I can't tell if you've noticed the many, many things immutable foundations win you beyond simply being a safer default.
15:46hyPiRionI'm not even sure what you guys are discussing.
15:46headiuscallen: I'm aware
15:47headiusare you saying we should just throw Ruby away because it isn't immutable by default?
15:47bbloomheadius: I guess it boils down to this for me: If I'm gonna start a new project that needs to be fast/concurrent, then Ruby (be it MRI or JRuby) is not an ideal choice because of weak concurrency support in the language and ecosystem
15:47headiusas bbloom says...Ruby has its place, and there's a lot you can do in Ruby even with the mutability tarpit
15:48headiusbbloom: sure, I agree in general... but if you're going to start a new project that needs to fast/concurrent and you want to use Ruby, JRuby would be the better of the two choices
15:48headiusI'm not trying to make JRuby the best language impl...I'm just trying to make it the best Ruby
15:49bbloomheadius: If I'm porting an application to a faster host, I expect very-high compatibility with low cost of porting, but I don't get that: I get serious library compatibility issues and dramatically slower startup time (and i view fast startup time as a primary reason to use ruby, which rails kills too)
15:49bbloomheadius: being the better of two choices in a sea of 100s of choices seems moot
15:49bbloomparticularly when scala & clojure are right next door....
15:49headiuswell...as I said, if you *want* to use Ruby, there's not 100s of choices
15:50headiuswhether Ruby is the right choice in the first place is a debate I won't get into
15:50bbloomheadius: and as a polyglot, that makes no sense to me :-P
15:50callenis JRuby designed to accommodate mono-language programmers?
15:51sdegutisheadius: "my argument is that saying everything should be immutable all the time is ignoring the fact that you *can't* write everything that way" -- heh, you'd be surprised
15:51headiuscallen: it's designed to accommodate Ruby programmers :-)
15:51bbloomsdegutis: heh, i've written some pretty large programs that have ONE atom in them :-P
15:51callensdegutis: the issue isn't can/can't, but rather how awkward certain things can be to express in one semantic model vs. another.
15:52bbloomentertaining bit: that one client who's day i saved w/ Hamster (immutable collections in Ruby)…. he had his whole team go watch the Value of Values
15:52sdegutisLike I said. You'd be surprised.
15:52bbloomlol
15:52s4muelheadius: You should check out the talks 'simple made easy' and 'the value of values' if you haven't already. Might give you some more perspective, aside from being great talks on programming in general
15:53headiusyep, I've seen them
15:53bbloomheadius: sorry to pile it on, you are in hostile territory. for all the nice things about ruby and it's ecosystems, many folks here are refugees :-)
15:53bbloomheadius: we do try to learn from other communities here though
15:53headiusI've also seen clojure evolve to make it possible to do mutable things within controlled contexts
15:53headiusanyway, I actually have to run, as fun as this is
15:54callencan someone email headius those links?
15:54sdegutisheadius, callen: I'm well aware that mutability is sometimes necessary for either making things work or making them look good or making them work well. I just know from (tons of) experience that it's a lot less necessary than we think.
15:54bbloomhe says he's seen them
15:55callenoh woops/
15:55sdegutisThe (very) few times you need mutability in Clojure, you already have plenty of ways to use it, without having to resort to a really insane language.
15:55dnolenI think headius is pretty familiar with Clojure's value propositions, he's been in this channel for years :)
15:56callendnolen: on to the rubber hose and ski masks then?
15:57sdegutisTo me, using Ruby instead of Clojure just to solve problems mutably is like trying to stun someone by shooting them on the very edge of their torso with a real gun instead of just using a stun gun.
15:57sdegutisWorst analogy ever, I know, but it's the best I can do right now.
15:57callenhttp://martintrojer.github.io/clojure/2013/09/07/retrofitting-the-reloaded-pattern-into-clojure-projects/
15:58bbloomcallen: i think that core.async offers an interesting alternative to start/stop style lifestyle management objects
15:59callenbbloom: the content was relevant to me because that's what I've been wrangling the last week.
15:59bbloom(defn run [c] ((init-here) (loop [] (when whatever (recur))) (shutdown-here)))
16:00sdegutisOh wait, why am I writing a dynamic web app when I could just build a static site generator and deploy to github pages? What a crazy person I am.
16:01bbloomcallen: try a go-loop instead of LifeCycle protocol. you might like it :-)
16:01bbloombasically, you just replace your start with run and your stop with send-shutdown-message
16:02s4muelthat's an interesting take -- just have a lifecycle controller listening for messages?
16:03bblooms4muel: yeah, basically. think about it. that's how you write collections of processes if you're doing several collaborating C servers, instead of a bunch of java threads
16:04bblooms4muel: the model works great! you fork/join with go (or thread) and <! (or <!!)
16:04bblooms4muel: then you don't need a complex stateful object with various states
16:04s4muelthat's really interesting. Seems like it would work well distributed too
16:05bblooms4muel: see this: https://code.google.com/p/guava-libraries/wiki/ServiceExplained
16:05bbloomthere is NEW, STARTING, RUNNING, STOPPING, and TERMINATED states
16:05bbloomthe reason for new & terminated are to have state without process: so that's input args and return value
16:06bbloomstarting/running/stopping are basically just before/inside/after a message pump
16:06bbloomyou've got start, then startAndWait… isn't that just (run-server input) and (<! (run-server input)) ?? :-)
16:07bbloomif you care about the transition from initialization to running, you can just send a message
16:17s4muelbbloom: any opinion on core.async vs other similar stream/channel libs? I'm doing event processing and kind of evaluating the landscape
16:18bblooms4muel: we've been discussing this a bunch here in irc, you can go back in the logs & see mentions of core.async w/ me, dnolen, ztellman and a few others
16:18bblooms4muel: but in short:
16:18bbloom1) write a lot less asynchronous code than you think you have to. just like you need less state with fewer identities than you'd think, you need fewer message pumps / asynchronous devices than you'd think
16:19bbloom2) core.async is not about "streams" as lamina & Rx and others are. Streams are a special case of asynchronous messaging for a use case that, in my recent opinion, is less common than general communicating services. Think long and hard if you've actually got a linear stream or some very one-directional pipeline before choosing a stream library over a more general purpose concurrency library
16:20s4muelI'm not concerned about the asynchronicity as much as I am about streams and a stream API
16:20s4muelYeah.
16:20bblooms4muel: consider instead replacing your entire stream with functionally pure synchronous code bounded on either end by a consumer/producer pair
16:22s4muelWell, the general design plan was essentially -- open tcp, stream messages directly to a dispatch handler that are eventually bounded by network output or writing to disk, in is bounded by incoming events rate
16:23bbloom(loop [state init-state] (when-let [x (<! in)] (let [[y state*] (pure-function x state)] (>! out y) (recur state*))))
16:23s4mueland a bunch of pure stream processing functions in the middle
16:23bbloomstream processing is inherently impure unless you memoize, which is what lazy sequences basically do
16:23bbloompurity requires that you can ask the same question tiwce and be sure you'll get the same answer
16:23bbloompurity requires that you can back up and try again and be sure that your two branches will be consistent
16:24bbloomstreams offer neither
16:27s4muelHrm, what I meant here was stuff like tokenizing input. I can guarantee that the same input will be tokenized to the same output, or that given a message certain fields would be added, etc
16:28bblooms4muel: sure, use lazy-seqs
16:29s4muelNot necessarily manipulating the stream primitives like split this stream X into X->Y X->Z. I get what you're saying here in that it's impure because it's not the result of a computation, it's a side effect like 'create another lightweight process'. I think that's what you're saying.
16:41yediso i want to see if a string ends with either .png .gif .jpg... + more defined extensions. What would be an idiomatic way in clojure to test this
16:41yedis/test/do . I know there's the .endswith fn
16:42bbloomyedi: just stick the extensions in to a set, then strip off a string with a regex & test set membership
16:43dissipate_the lack of in depth literature on clojure macros is really bad
16:43arrdemyedi: yep, just take the match of something like #".*(\.\w+)" and follow bbloom's advice
16:44arrdemdissipate_: something in particular you're looking for?
16:46dissipate_arrdem, a comprehensive book on clojure macros. everyone just keeps referring me to Paul Graham's books on common lisp
16:46bbloomdissipate_: that's b/c pg's books on common lisp are excellent & cover macros in extreme depth
16:46turbopapeI really love intellij IDEA for doing clojure. How come I didn't try it sooner ?
16:46turbopapeLitterally fell in love. And it is open source (for the community edition)
16:47bbloomdissipate_: the biggest differences between clojure's macros and common lisps will be *mega easy* to understand, if you can understand pg's stuff
16:47dissipate_bbloom, but CL macros are not clojure macros, especially because clojure macros deal with the JVM
16:47bbloomdissipate_: what does the JVM have to do with clojure's macro system?
16:47arrdemdissipate_: not really...
16:48arrdemdissipate_: the scope semantics and code generation that PG shows off totally works
16:48dissipate_bbloom, watch this talk and find out: http://www.infoq.com/presentations/Clojure-Macros
16:48arrdemdissipate_: it's just the exact notation for macros that differ
16:49dissipate_arrdem, are you saying a book on clojure macros would be worthless?
16:49bbloomdissipate_: i don't need to watch that. I understand Clojure's macro system quite deeply.
16:49bbloomdissipate_: He's saying that the book would basically be On Lisp with an extra chapter :-P
16:49arrdembbloom: yerp and a few syntax changes
16:50arrdemdissipate_: once you grock the idea of code writing code through AST transforms everything else kinda falls away....
16:50dissipate_the fact that i have to read a book on another language. that's sad
16:50arrdemwhat part of lisp as a language _familly_ are you missing here?
16:51dissipate_arrdem, i want to study clojure, not old lisps
16:52bbloomdissipate_: That's like saying "Why are there no books on algorithms in Python?!?!? I want to study python, not algorithmic pseudo code"
16:52coventry`dissipate_: I think the CL-specific parts of On Lisp would be near-trivial to absorb if you know clojure well. I read On Lisp knowing only emacs lisp, and found those sections very accessible.
16:53sdegutisI've been thinking of having a ClojureDocs clone that would generate static doc pages via Clojure. It would be hosted on github and where examples/see-also's are added via pull requests.
16:53bbloomdissipate_: numerous knowledgable people have recommended a particular resource to you, but you write them off & call the community "sad". We've done our part...
16:53sdegutisThoughts?
16:53dissipate_bbloom, there are books on algorithms in python
16:54arrdemdissipate_: sure, and they add _nothing_ to the original papers or pick your algo textbook in any other language.
16:54bbloomdissipate_: *sigh* forrest => trees
16:54coventry`sdegutis: What's the licence on the existing clojuredocs examples? Can you rip them off? It is the examples which really make clojuredocs valuable. Otherwise, might as well read the source.
16:55sdegutiscoventry`: yeah that was my plan.. didn't check the license
16:55sdegutiscoventry`: new examples would be added via pull-requests though
16:55dissipate_arrdem, actually, there are idioms in languages that significantly impact how algorithms are expressed in those languages
16:55bbloomdissipate_: yeah, making it HARDER to learn the algorithms
16:56arrdem(inc bbloom)
16:56lazybot⇒ 15
16:56yedibbloom: how would I go about stripping up until the final "." with regexes? (I know how i'd do it without them, but I'm tryna wrap my head around working regex in clojure)
16:56bbloomdissipate_: learning macros in clojure actually obscures some of the complexities of variable capture b/c clojure has facilities/idioms to minimize the impact of such problems. Learning macros in common lisp is actually easier to get started.
16:56dissipate_bbloom, your claim is that macros are independent of language implementation?
16:57bbloomdissipate_: my claim is that there are underlying ideas that can be understood in any language and PG covers them very well…. in common lisp
16:57coventry`sdegutis: Looks like they make it easy to pull the examples out: https://github.com/zk/clojuredocs/downloads
16:57bbloomdissipate_: you wouldn't repaint the sistine chapel because you don't like the color of the front door
16:57arrdemyedi: (re-find #".*(\.\w+)" "foo.bar.baz")
16:58dissipate_bbloom, BTW, the talk i linked you to specifically mentions an issue the JVM causes with macros, namely limits on the number of arguments to java methods.
16:58yedi&(re-find #".*(\.\w+)" "foo.bar.baz")
16:58lazybot⇒ ["foo.bar.baz" ".baz"]
16:58arrdemyedi: the .* matches the entire string lazily, and the (\.\w+) group matches the _last_ dot in the string and all trailing word characters
16:59bbloomdissipate_: again, that's missing the forest for the trees. I could have the same limitation in a particular common lisp implementation. Nevermind the fact that I've never experienced that problem in practice & i've written A LOT of macros
17:00dissipate_bbloom, well, maybe you should watch the talk and see the example.
17:00coventry`You can find translations into clojure of most of PG's early macros, anyway, if you google "on-lisp clojure."
17:01bbloomdissipate_: I don't need to. I know precisely what you're referring to
17:02dissipate_coventry`, how many people trying to learn clojure are going to google common lisp?
17:02arrdemdissipate_: anyone who takes our advice, which you seem unwilling to do
17:02dissipate_i know i haven't
17:02bbloomdissipate_: how many people trying to learn macros are gonna google macros?
17:03dissipate_arrdem, i will take your advice
17:04dissipate_but only begrudgingly. now i have to buy another book that isn't even on clojure.
17:04bbloomOn Lisp is free
17:04bbloomhttp://www.paulgraham.com/onlisp.html
17:04bbloomdissipate_: if you bothered to look at all, you'd have discovered that
17:04coventry`The bandwidth is a killer, though.
17:04sdegutisbbloom: I've had a heard time swallowing the "it's never been a problem for me in practice" argument ever since I tried Go and realized they don't/won't have filter/map/reduce/etc.
17:05bbloomsdegutis: the issue he's referring to is that clojure has a max EXPLICIT argument limit
17:05sdegutisLOL
17:05bbloomsdegutis: in practice, it's not an issue b/c you can use apply, which works with extremely large lazy sequences
17:05arrdemsdegutis: THANK YOU
17:05bbloomsdegutis: it can SOMETIMES be an issue in macros if you are generating a very long list
17:05bbloomsdegutis: but you can trivially replace `(f ~@args) with `(apply f [~@args])
17:06bbloomsdegutis: but I've never written such a macro that would need such craziness :-P
17:07technomancysdegutis: why doesn't Go have map/reduce?
17:08dissipate_arrdem, are you saying i can start reading 'on lisp' after learning clojure? seems like i would probably have to read an intro book on common lisp first
17:08sdegutistechnomancy: "just use a for loop"
17:09technomancysdegutis: I... but...
17:09seabreeven php has map/reduce
17:09technomancysdegutis: does it have lambda?
17:09arrdemseabre: now there's damning with faint praise
17:09bbloomdissipate_: page V, "Preface", first four words: "This book is intended for"
17:09sdegutistechnomancy: a type-strict one
17:09seabreAND closures
17:10technomancysdegutis: because of no generics? or are generics just for collections?
17:10sdegutistechnomancy: no generics
17:10bbloomtechnomancy: Go has this weird relationship w/ higher order functions
17:10sdegutistechnomancy: "in practice I've never missed them"
17:10coventry`dissipate_: Speaking as someone who read it without knowing common lisp, I can say with a fair degree of confidence that basic understanding of clojure will be enough. On Lisp explicitly tries to give a self-contained treatment of Common Lisp.
17:11dissipate_bbloom, how do you know he isn't implying "common lisp" when he says "lisp"?
17:11sdegutistechnomancy: half this page is dedicated to mutual-back-slapping on being okay without generics: http://golang.cat-v.org/quotes
17:11sdegutisIgnore the quote with my name in it, that was ages ago. I'm a better man now.
17:11technomancysdegutis: "if I keep telling myself everything is OK, eventually I'll believe it"
17:11bbloomdissipate_: because I've read the fucking book and I'm telling you, as an expert in both macros and the implementation of Clojure, it's a good book from which you will learn a lot about all sorts of lisps and macros
17:12technomancyout of curiosity, are generics specific to collections, or is that just a java-ism?
17:13technomancy(or is it not even a java-ism? I don't know java)
17:13bbloomtechnomancy: sdegutis: the bigger thing is that side effects and higher order operations don't mix. so the fact that you'd have a Map function would make you try to send or receive a message in there & that would be bad
17:13sdegutistechnomancy: I don't think it's specific to collections. You can have a custom type that has an instance variable of a given type.
17:13bbloomGo is a systems language by default & a logic language only by necessity
17:13bbloomwhich is the opposite of Clojure & core.async :-P
17:13sdegutis:)
17:13technomancyso like type variables in OCaml would be a kind of generics?
17:13sdegutistechnomancy: wait, hold on now, am I being trololololed?
17:14sdegutishttp://trololololololololololo.com/
17:14technomancysdegutis: I am a type noob
17:14technomancythree weeks in
17:14bbloomtechnomancy: lol
17:14arrdem(inc sdegutis)
17:14lazybot⇒ 5
17:14sdegutisOh sweet, this nick must be lucky, I have way more karma than when I was futile.
17:14sdegutis$karma futile
17:14lazybotfutile has karma 2.
17:15technomancythe "I like that Go forces you to clean up little messes" guy is a co-worker =\
17:15sdegutisHeroku's got all kinds.
17:16dissipate_i haven't heard of any theoretical language breakthroughs in Go. if it's a better C++, then more power to it.
17:16bbloomtechnomancy: is that the comment about unused variables?
17:16technomancybbloom: yeah
17:17sdegutisOh man. I *hate* that feature.
17:17bbloomtechnomancy: reminds me of some build failures I've seen where my java import statements weren't in alphabetical order
17:17sdegutisOne of the most annoying aspects of Go.
17:17dissipate_bbloom, why not use haskell as a systems language?
17:17bbloomdissipate_: OK, at this point I'm quite certain you're a troll
17:17sdegutisdissipate_: why not use C?
17:17arrdemsdegutis: bbloom[-1]
17:18sdegutisarrdem: undefined symbol bbloom
17:19dissipate_bbloom, who isn't using google now? http://book.realworldhaskell.org/read/systems-programming-in-haskell.html
17:20arrdemsdegutis: I'm failing to come up with an idiomatic fetch of "bbloom" from "#clojure" referencing send -1 :/
17:20bbloomdissipate_: Oh, Hey, Haskell has an FFI. I didn't know! This changes everyting!
17:20bblooms/apologies/apologizes/
17:20RaynesLet's call out everyone all at once! That'll go over well!
17:21RaynesAlso, that's not like callen.
17:21Raynescallen isn't into passive aggression and sarcasm.
17:23dissipate_sdegutis, C isn't expressive
17:23Mendor|scrnewbie's question: what is the difference between 'binding' and 'let'? They looks like doing same things
17:24bbloomMendor|scr: binding=dynamic, let=lexical
17:24bbloomMendor|scr: let assigns values to names in a particular space, where as binding assigns values to names for a span of time
17:25Mendor|scrbbloom: thank you
17:25arrdemdissipate_: I beg to differ, have you checked out libchello?
17:26dissipate_arrdem, no, looks interesting though.
17:26dissipate_arrdem, can you give any good reason not to do systems programming in haskell?
17:27arrdemdissipate_: the rest of my embedded OS team would crucify me?
17:27arrdemdissipate_: I would have to port 4.1M lines of C to Haskell?
17:28arrdemdissipate_: I would have to deal with Haskell?
17:28dissipate_arrdem, and would you not have to do the same with Go?
17:34Raynesarrdem: You just got LOGIC'D
17:35arrdemRaynes: I just got asked about a language I don't write... my language learning latency is being incurred on the answer
17:42coventry`It seems that the :reload keyword to (require) causes reloading of all namespaces. If I just want one namespace reloaded, should I do that in a separate require?
17:44coventry`(causes reloading of all (require)d namespaces, that is.)
17:44sdegutisdissipate_: C is perfectly expressive
17:44dissipate_sdegutis, you mean compared to asm?
17:45sdegutisdissipate_: you just need to learn how to express yourself in C first, that's all
17:45hyPiRionSwearjure is perfectly expressive too. It's turing complete and all that.
17:45arrdemRaynes: ^ dat logic yo
17:45amalloyarrdem: language learning latency combined with haskell reminds me of http://ro-che.info/ccc/11.html
17:46arrdem(inc amalloy) ;; day made
17:46lazybot⇒ 71
17:47dissipate_sdegutis, i did embedded linux development in C for a short while. wasn't expressive enough for me.
17:47benkay,(+ 1 2)
17:47clojurebot3
17:47bbloomamalloy: nice.
17:48amalloybbloom: credit goes to brehaut (i think?), who's linked http://ro-che.info/ccc/12.html a few times
17:48bbloomamalloy: i also enjoy the first/prev/current/next/last navigators
17:48sdegutis,(defmacro with-all-due-respect [& body] `(binding [*in* (java.io.StringReader. "")] ~@body))
17:48clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
17:48sdegutis##(defmacro with-all-due-respect [& body] `(binding [*in* (java.io.StringReader. "")] ~@body))
17:48lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
17:49sdegutisMeh, gud nuff.
17:49dissipate_amalloy, the funny thing about that comic is: who is hiring for haskell positions in the first place? :P
17:51arrdemhttp://ro-che.info/ccc/20.html
17:51bbloomarrdem: zing.
17:53sdegutisouch, http://ro-che.info/ccc/17.html
17:53sdegutisDo not want.
17:53bbloomsdegutis: I think 9/10 of the people in that little red/green section are in this room :-P
17:54sdegutisBut.. but.. Clojure is dynamically typed!
17:54bbloomsdegutis: but people in this room understand type theory!
17:54sdegutisOh.
17:55hyPiRionI don't believe in the type theory. It's just a theory, it's not proven or anything.
17:56hyPiRionHm, I wonder if such arguments would actually work in IT?
17:56sdegutisJust like set theory!
17:57sdegutisAnyway I really liked that with-all-due-respect joke.
17:57sdegutisI should make a website for it.
18:03winkI think the diagram is off a little
18:03winkI've hardly seen any mathematicians argue for typing in programming :P
18:04winkso the blue/red crossover should be smaller imho
18:05winkthen again I think I read that blog post linked on the bottom already
18:07bbloomwink: we just discussed that article in here yesterday
18:07winkbbloom: I missed that, I meant.. a lot earlier, maybe 2011 :)
18:09sdegutisCan anyone recommend Java Swing (O'Reilly) vs The Definitive Guide to Java Swing (Apress)?
18:20sdegutisOh never mind, JavaFX seems to be the new hotness.
18:20arrdemdevn: sleeping on your keyboard is awesome, isn't it?
18:23llasramarrdem: devn's cat apparently thinks so
18:23llasramdevn: We've all been there (where "all" is cat-owners)
18:23arrdemllasram: that or the above cat has learned C-p in which case I'm impressed
18:24devni was impressed too
18:24devnit was kind of amazing how many apps had text in them
18:24devni started looking through my terminal windows filled with random text to make sure she didn't commit some code and git push
18:25devnmoving through those tab windows requires Cmd + {
18:25devni feel like she's learning how this machine works
18:28winkdevn: I can only suggest xmonad, changing windows is not so easy anymore
18:29devnM-j?
18:29winkwell, it's only one workspace. so Super-0-9 and then Super-jk yes
18:29devnsure, but then i get back and see 200 spawned terminals
18:30devnall with scary text in them
18:30devnS-RET * 1000000000
18:30arrdemdevn: in one lurks an `rm -rf /`
18:32gfredericksdoes anybody have opinions about enhancing pre/post conditions to allow an error msg in the metadata?
18:32sinistersnaredo you guys know if asm.js is a viable backend for cljs? i know that asm.js is basically statically typed, so maybe it should be for core.typed clojurescript
18:32arrdemgfredericks: please elaborate
18:32bbloomsinistersnare: how familiar with asm.js are you?
18:32sinistersnarenone! im just curious :p
18:33bbloomsinistersnare: you should go read up on it. the spec is like a 1 pager, then you'll probably have a much different question :-)
18:33sinistersnare:D ok ill see then
18:33gfredericksarrdem: I often want to use pre/post conditions but the fact that the resulting error message is likely unhelpful compels me to not use them or do a manual assert in the function body
18:33sinistersnarehttp://asmjs.org/spec/latest/ 1 page? o.O
18:34gfredericksarrdem: so if I could (fn [a] {:pre [^{:msg "arg to this fn must be positive"} (pos? a)]} ...)
18:34gfredericksthen I would use them a lot more often
18:34bbloomsinistersnare: it seams to have grown :-) h/o 1 sec
18:34gfredericksand obviously anything along those lines is fully backwards compatible
18:34gfredericksanother option is a vector pair
18:34arrdemgfredericks: yerp by dint of abusing reader metadata
18:34gfrederickswhich is technically backward-breaking but not for significant things
18:34sinistersnarei think i realize that its for more unsafe langauges, and is supposed to be c/c++ like, but isnt it very efficient, therefore a good idea? idk...
18:35bbloomsinistersnare: http://ejohn.org/blog/asmjs-javascript-compile-target/ is a decent intro
18:35gfredericksarrdem: what is the principle of reader metadata usage by which that is an abuse?
18:35bbloomsinistersnare: in short, it's more like C with bad syntax
18:35bbloomsinistersnare: we'd have to write a VM too
18:35bbloomsinistersnare: you basically just get arrays of integers & can use other integers as pointers
18:35arrdemgfredericks: it's not an abuse at all... but that's a cute way to sneak in the string.
18:35sinistersnareoh ok, so its not as viable as just changing the compile target?
18:36arrdemgfredericks: it's been too long since I've used :pre and :post to comment but in theory I'm a fan
18:36gfredericksarrdem: does [(pos? a) "a must be positive"] seem cleaner?
18:36sinistersnarei mean thats a task in itself, but not just comforming to it? im just confused i guess
18:36SegFaultAXgfredericks: Did you get my note from earlier?
18:36gfredericksSegFaultAX: prolly not lemme look
18:36bbloomsinistersnare: like i said, you should go read up on asm.js & then it will be much clearer. it's probably not what you think it is
18:37SegFaultAXgfredericks: Oh I just was letting you know that I really enjoyed your talk. Most of it was not new content for me, but one thing I really appreciated was how you wrote out all the macros longhand before introducing the awesomeness of syntax quote.
18:37gfredericksSegFaultAX: oh cool -- thanks for the feedback
18:37sinistersnaretrue, i figured there was a miscommunication somewhere; i knew it wouldnt be some end all be all superfast javascript. thanks :)
18:37bbloomsinistersnare: there is no garbage collection, or object system, or anything like that. it's literally just byte buffers
18:37sinistersnareok that makes more sense
18:37coventry`gfredericks, SegFaultAX: I skimmed through it today. It was good.
18:37gfredericksSegFaultAX: yeah I feel like macros and syntax-quote are both manageable independently, but if you do them at the same time the odds are against you
18:38SegFaultAXgfredericks: Totally. I think the biggest hurdle for most people (from my experience) is getting your head around the fact that you can do things at compile time.
18:38irctcI'm a newbie and just started studying books (clojure in Action and Prog Clojure). Both books does not use ^{ dynamic : true } in their samples but samples does not work. I have to put that declaration for defn to make them work for binding. Do anyone knows why those books fail to mention this or am I making a mistake. Thanks.
18:39gfredericksSegFaultAX: yeah separating the times is a big mental leap
18:39yediwhen using elastisch, is there a way to see the query json that esd/search sense to the ES api?
18:39SegFaultAXMost of the time that's a closed phase, the compiler is a black box until run time.
18:39gfredericksSegFaultAX: but if you talk about it that way it sounds as if it can only be terribly hard; not that you're just writing regular code and dealing with familiar data
18:39SegFaultAXgfredericks: Second biggest hurdle is the idea of processing unevaluated lisp forms. There just isn't really anything like it in languages that don't support proper first class macros.
18:39llasramirctc: That was a change in... Clojure 1.3? Before then all vars were dynamic. So probably older books
18:40gfredericksSegFaultAX: yeah that's why I spent so much time up front playing with quote and eval
18:40arrdemgfredericks: ah ok just re-read fogus's pre/post post and my old code
18:40SegFaultAXgfredericks: The whole "code is just data" thing is a huge hurdle for some.
18:40arrdemgfredericks: I like what you're doing in that second one
18:40arrdem,(true? "foo")
18:40clojurebotfalse
18:40SegFaultAXgfredericks: Anyway, great work. I look forward to your future talks. :)
18:40gfredericksarrdem: it's technically breaking but you wouldn't have used a vector like that anyhow since it's trivially truthy
18:40irctcI see. So I should be typing that each time, right? Do you do that for that purpose?
18:40gfredericksSegFaultAX: the swearjure talk comes out in a month or two or something
18:41coventry`gfredericks: Loved the ->> quarter-quine.
18:41gfrederickscoventry`: ha, I think that was due to TimMc
18:41SegFaultAXgfredericks: Oh that ought to be interesting.
18:41llasramirctc: Each time you want to use `binding` to change value of a var, yes. But those times should be pretty close to "never" in practice
18:41gfrederickscoventry`: also fixed in 1.6
18:42dissipate_gfredericks, asm.js, another ridiculous project spawned from the fact that browsers should run bytecode, not javascript.
18:42SegFaultAXdissipate_: Haven't you heard? Javascript is the bytecode of the internet!
18:43gfredericksJavaScript is the node.js of the internet
18:43arrdemgfredericks: wat
18:43gfredericksthe wagon wheel was the internet of the 19th century
18:44arrdemgfredericks: is that change really breaking?
18:44arrdemgfredericks: I'm playing with fogus's demo and haven't smashed 1.5.1 yet...
18:44gfredericksarrdem: sure; (fn [a] {:pre [[false "foo"]]} a)
18:45dissipate_SegFaultAX, i know it is. why not just have browsers run byte code so you could compile from any language X to that bytecode and not have to go through JS?
18:45gfredericksarrdem: ^ always succeeds in current code, always fails in my proposed version
18:45irctcllasram: I understand that dynamic binding can make the code a hairball easily if not used sparingly, however within the context of writing scaffolding code like test it makes sense to use dynamic. It is just weird to have to type that when I need it. Is there a special "declare" to do that so that my test code utilize this behaviour. Probably this is not how the "professionals" are doing it.
18:45arrdemgfredericks: I don't follow why that will always bomb for you.
18:46arrdemgfredericks: that it succeeds currently is trivial
18:46llasramirctc: Oh, for tests etc just use `with-redefs`. That changes the root binding of vars within the dynamic scope of the `with-redefs`.
18:46gfredericksarrdem: because the left half of the pair is always falsy
18:46gfredericksthat it fails in my version (as it should) is also trivial
18:47arrdemgfredericks: ah so you are proposing to unpack vector pairs into [pred msg]
18:47gfredericksarrdem: yes exactly
18:47arrdems/into/of the form/
18:47llasramirctc: (without requiring the var to be dynamically thread-locally re-bindable)
18:47gfredericksarrdem: which doesn't "abuse" metadata but is technically (though not importantly) breaking
18:48arrdemgfredericks: could one not also write [(number? x) "x must be a number" true "how did that fail"]
18:48arrdemgfredericks: that would seem to fit more with the let semantics
18:49dissipate_"What is the goal of Asm.js? Who do you see as the target audience for the project? Our goal is to make the open web a compelling virtual machine, a target for compiling other languages and platforms.
18:49arrdemgfredericks: but would also be breaking.... hum...
18:49dissipate_hilarious. absolutely hilarious.
18:50arrdemgfredericks: ok. I agree with your metadata approach as the best implementation but I hold that the optional trailing string would be nicer to read.
18:51irctcllasram: I changed the code to use with-redefs instead of binding, it worked like a charm. Thanks.
18:51llasramirctc: np!
18:52gfredericksarrdem: I'm gonna send an email to clojure-dev
18:52gfredericksarrdem: thanks for feedback
18:53arrdemgfredericks: np. who do I need to bug to get verified as a list subscriber?
18:54bbloomI use my Windows VM like once every 2 months, but somehow everytime, Windows seems to degrade…. this time, after about 3 minutes of use, it just goes to a black screen
18:55callenbbloom: Windows is one big experiment in software entropy.
18:55SegFaultAXs/windows/operating systems/
18:55gfredericksarrdem: man I have no idea; it's been a while. you've "applied" or something?
18:55bbloomI must say, I am impressed with Window 8s boot times, especially in my VM
18:56Pupnik_solar radiation corrupting your install
18:57arrdemgfredericks: yerp. I mean I'm kinda the lurnking script kiddie not a core contributor but I'm interested in what's changing so....
18:57gfredericksarrdem: huh; is there not some read-only subscription mechanism that doesn't require approval?
18:58arrdemgfredericks: doesn't seem to be... besides making googling clj-dev part of my daily news read
19:08gfrederickshttps://groups.google.com/forum/#!topic/clojure-dev/eNK9UZ5HklI
19:14crocketDoes clojure have very little flaws to overcome?
19:14crocketin the langauge itself
19:15llasramcrocket: I'm not sure what sort of answer you expect, asking in #clojure :-)
19:16llasramIt's practically perfect in every way!
19:16crockethmm
19:16crocketPHP people say clojure already has a flaw which is 'nil'.
19:16gfredericksit's not a very precise question
19:16llasramThat's cool. I think PHP has a flaw which is 'PHP'
19:16gfredericks"to overcome" means to overcome by future language development? or by the programmer?
19:16nightflyPHP people judging another langauge?
19:16crocketI say PHP has "global" and "use" keywords.
19:17crocketgfredericks, by the programmer
19:17gfredericksthere are plenty of little details and gotchas that could be different/better
19:17gfredericksit's the higher-level design that makes it really compelling
19:17wkellydoesn't php have null?
19:17dnolenwkelly: it does
19:17wkellyI am confused by this alleged criticism
19:18crocketI haven't learned clojuer yet. How is 'nil' a flaw?
19:18llasramcrocket: The fundamental design of the language can make it difficult to provide sensible error messages for some kinds of structural errors. That's the biggest "flaw" for me
19:18llasram(not really a flaw -- a decision, with trade-offs)
19:19crocketllasram, Do you mean fundamental design flaws?
19:19dnolencrocket: if it's flaw it's precisely in the same way that null is a flaw in PHP
19:20dnolencrocket: whatever you don't like about null in PHP is true for nil in Clojur
19:20dnolene
19:20wkellycrocket: a lot of people from languages with fancy type systems that can detect at compile time whether a null can get passed around, which can help to avoid lots of bugs that arise from failing to consider the special case of null
19:20wkellythat wasn't really a great sentence :P
19:20pmonksNote: PHP is not one of those languages. ;-)
19:21crocketwkelly, That includes clojure.
19:21crocketAnyway
19:21SegFaultAXcrocket: Hoare has already appologized profusely for inventing null, what more do you want?
19:21crocketI heard clojure has very little flaws to overcome in the language itself.
19:21SegFaultAXcrocket: That's entirely subjective, I think.
19:22coventry`Is the signature for the special form case* documented anywhere?
19:23sontekAre there any good 'hello world' tutorials for doing clojure web apps? Whats a good default lib to start with for handling basic web requests? Good default webserver?
19:24wkellycrocket: this is the sensible null argument (as opposed to the php criticism :P): https://ocaml.janestreet.com/?q=node/78
19:24dnolensontek: people like ring with jetty
19:25sontekdnolen: I'll check them out, thanks!
19:25dnolensontek: http://mmcgrana.github.io/2010/03/clojure-web-development-ring.html
19:26SegFaultAXsontek: Check out luminus
19:26dnolensontek: there are probably bits of this that need to be updated
19:27SegFaultAXsontek: Luminus will introduce you to a great many libraries commonly used in Clojure web dev including ring, compojure, and jetty.
19:27dissipate_wkelly, one rule of good function design is to not return nulls
19:27sontekIs there a decent template framework as well?
19:28dnolensontek: http://www.luminusweb.net/
19:29sinistersnarelunimus uses the selmer template language
19:29SegFaultAXPlus you can check out enlive and hiccup if that's your cup of tea.
19:31mheldso. do I have to do anything crazy to get static resources set up with luminus?
19:31mheldit doesn't look like my instance is able to find my static resources (in like resources/public/css/)
19:32arrdemso just for my entertainment, who all has submitted a CA to Rich?
19:32sontekIn general, static resources should usually be served via CDN or server like nginx, its usually not good to server from your app server
19:32gfredericksarrdem: http://clojure.org/contributing
19:32mheldsontek: I'm aware
19:32mheldsontek: but I'm not pushing my stuff to a CDN for development
19:32arrdemgfredericks: thank you.....
19:33gfredericksarrdem: I certainly wouldn't have thought to look there
19:33arrdemgfredericks: of course not, especially not after I clicked the CA link at the top of the page...
19:34coventry`What is the :tag metadata for? As in (with-meta (gensym) {:tag Object}) in the case macro?
19:34coventry`Oh, it's just some type indication.
19:35gfrederickscoventry`: yeah that's how type-hints work
19:35coventry`gfredericks: Thanks.
19:36SegFaultAXmheld: Luminus doesn't really do anything. It's just a collection of libraries.
19:36SegFaultAXmheld: Anyway, read the compojure docs.
19:37SegFaultAXsontek: That's just not true. Like, at all.
19:42sontekSegFaultAX: Maybe the clojure community is different than what I'm used to, but in my experience serving static assets via an appserver is always slower
19:43nightflySlower, but not always slow enough to matter
19:43SegFaultAXsontek: Jetty serves static assets well enough for most small sites. nginx or varnish in from of it can speed it up dramatically.
19:44arrdemis fogus's trammel depricated for core.contracts?
19:44SegFaultAXIn front*
19:44mheldSegFaultAX: yeah, I'm not finding anything of value
19:44sontekDo most of the db libraries in clojure take advantage of core.async?
19:45SegFaultAXsontek: None as far as I'm aware.
19:45SegFaultAXmheld: compojure.core/resources isn't what you're looking for?
19:45sontekso if you wanted to do something like a websocket request inside ring, the calls to the DB are still going to block?
19:46SegFaultAXmheld: Whoops, that's in compojure.route
19:46sonteki'm coming from python, so my worries might not be valid on something like clojure + jvm
19:46mheldSegFaultAX: yeah, I'm using it but nothing's coming out of resources/public
19:46sontekIn python, to do async we use coroutines but need to make sure we aren't blocking or we'll eatup all our workers
19:47SegFaultAXsontek: Python doesn't have coroutines.
19:47SegFaultAXGenerators are not coroutines, rather.
19:47SegFaultAXmheld: Paste your routes.
19:47bbloomSegFaultAX: doesn't python have "send" now back for iterators?
19:48SegFaultAXbbloom: It always has, that's not what makes them not coroutines.
19:49mheldSegFaultAX: HA, figured it out -- turns out that it looks at :resource-paths in project.clj only
19:49mheldwhich.. makes sense
19:49bbloomSegFaultAX: a bidirectional generalization of generators has been proven to be equivilant to delimited continuations, and hence coroutines: http://lambda-the-ultimate.org/node/4349
19:49mheldSegFaultAX: (was using some local jars)
19:49SegFaultAXbbloom: You can still only yield from the top-level frame.
19:50SegFaultAXbbloom: Generators are degenerate coroutines.
19:50bbloomSegFaultAX: right, so they are lexical in extent, just like core.async
19:51SegFaultAXbbloom: Ok? They still aren't full coroutines.
19:51bbloomSegFaultAX: eh, ok now you added the word "full" :-P
19:51SegFaultAXIt's a pointless modifier.
19:51SegFaultAXThey aren't coroutines.
19:52sontekSegFaultAX: Have you heard of gevent?
19:52SegFaultAXsontek: Sure.
19:52mheldI don't know what the original value is for :resource-paths ["resources/jars/*"] is... which would be really helpful
19:52mheldanybody know?
19:52sontekSegFaultAX: gevent enabled you to do coroutines in python
19:52sontekSegFaultAX: which is what I'm talking about
19:53SegFaultAXsontek: That's not part of Python, though.
19:53SegFaultAXNot cpython anyway.
19:53sontekSegFaultAX: It sits on top of python and its how you do stuff like long running requests in python
19:53sontekSegFaultAX: Python is just as much about the libraries around it as it is the core built-in
19:54sontekSegFaultAX: the selling point of python isn't cpython, its gevent, numpy, sqlalchemy, etc
19:54SegFaultAXsontek: gevent is an extension module for Python.
19:56SegFaultAXsontek: The selling point for Python is different for each buyer. I use python these days mostly for sysadmin stuff (in place of perl, which is what I used to use)
19:56sontekSegFaultAX: Does the clojure community try to stick with only using the core library instead of the opensource libraries built on top of it?
19:56SegFaultAXsontek: You're missing the point. Cpython lacks coroutines. I didn't say there weren't libraries to add them. I didn't say there weren't alternative implementations of Python that has them built in. But the language by definition lacks them.
19:57sontekSegFaultAX: sysadmin stuff also benefits from the opensource community around it. Ansible, Salt, etc
19:57SegFaultAXsontek: I don't know what you're talking about anymore.
19:57sontekSegFaultAX: Well, I said I do coroutines in python and you said I can't ;)
19:57SegFaultAXsontek: No, I didn't.
19:58sontekso, back to the original question...
19:58sontekso if you wanted to do something like a websocket request inside ring, the calls to the DB are still going to block? How do you handle this in clojure?
19:58sontekIn python, to do async we use coroutines but need to make sure we aren't blocking or we'll eatup all our workers
19:58dnolensontek: it's unsolveable problem, if the think is blocking it's blocking you can't magically fix it.
19:58sontek^ this isn't saying "do async using only the core libraries in cpython"
19:59dnolens/think/thing
19:59sontekdnolen: In python we patch the db libraries to use "green threads" which are coroutines to make sure they don't block
19:59SegFaultAXsontek: Your question is also fundamentally flawed.
19:59sontekdnolen: was wondering if the same could be done in clojure
20:00sontekusing core.async
20:00sontekbut since python also has horrible threading, maybe with true threads and havine async built-in, it might not matter
20:00coventry`Anyone got some examples of what the shift, mask and skip-check arguments to case* mean? I don't think I need to know for my project, but am curious.
20:00llasramsontek: That's not the approach of core.async, but something similar is possible on the JVM: http://blog.paralleluniverse.co/post/49445260575/quasar-pulsar
20:01SegFaultAXsontek: That's the thing, many Java webservers are threaded. So the blocking issue doesn't matter since you're only blocking that one thread for that one request.
20:01SegFaultAX(Not to say that threaded servers don't have other issues)
20:01dnolensontek: what core.async gives you are knobs, so you can say drop this request instead of running out of resources.
20:02sontekok, that makes sense
20:03sontekI'll just load up some sample apps and test to see, I'm assuming most of what I deal with for concurrency in python doesn't matter with a language that doesn't have a global interpreter lock
20:05SegFaultAXsontek: That's what makes core.async awesome compared to eg gevent or celluloid. We get coroutines /and/ we get to multiplex them over multiple cores since we have proper threading.
20:06SegFaultAXWell that, and that works in clojurescript and clojure seemlessly.
20:07sontekThe future!
20:07seangrov`Is there a book that's worthwhile for a medium-to-advanced clojure user?
20:08SegFaultAXJoy of Clojure is pretty awesome.
20:08coventry`seangrov: Joy of Clojrue?
20:08seangrov`Just got a kindle and going on a few long flights, looksing for good material. Going through Lisp in Small Pieces again
20:08augustl+1 to joy of clojure
20:08SegFaultAXseangrov`: Also, not Clojure specific, but The Reasoned Schemer.
20:08SegFaultAXDo not get it for Kindle, though.
20:08seangrov`SegFaultAX: Oh, why not?
20:09SegFaultAXCompletely unreadable.
20:09dnolenseangrov`: horrible formatting
20:09bbloomSegFaultAX: based on your definition, core.async does not provide co-routines
20:09seangrov`And The Joy of Clojure isn't meant as an intro to Clojure, right?
20:09coventry`It has some introductory material but it revs up pretty fast.
20:09SegFaultAXbbloom: Correct. I didn't know what to call them, just "go blocks" perhaps. And it isn't /my/ definition.
20:10seangrov`coventry`: Thank you
20:10bbloomSegFaultAX: I was just pointing out that while coroutines may have a formal definition, colloquially they include any sort of interleaving of control
20:10coventry`seangrov: It covers this fairly late in the book. It if seems passe, the book might be too easy for you: https://coderwall.com/p/xayyvq
20:11coventry`(I.e., I think it's pretty representative of the level of the book.)
20:12SegFaultAXbbloom: And I was pointing out that generators lack necessary elements to be considered coroutines. That isn't a bad thing, per se.
20:13SegFaultAXIn practice, it basically never matters in Python. Especially with `yield from`
20:21dnolenanybody see anything wrong with this CLJS change? http://github.com/clojure/clojurescript/compare/580-fn-name
20:21dnolena fix for http://dev.clojure.org/jira/browse/CLJS-580
20:22dnolenI see no need to pass name into the analyze data literal cases, seems like it's only needed by analyze-seq for the fn case
20:23bbloomdnolen: i never quite figured out what the name was for in general
20:24dnolenbbloom: it's useless to me outside of special case for (def foo (fn [] ...))
20:24dnolenit seems useless to me I mean
20:24bbloomdnolen: why is that special cased?
20:27dnolenbbloom: that's a good question ... thinking, probably something to do w/ recursive definitions and the REPL?
20:27bbloom,(macroexpand '(defn id [x] x))
20:27clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
20:27bbloombooo
20:28bbloomdnolen: the problem is that defn is bugged
20:28bbloomthat produces: (def id (clojure.core/fn ([x] x)))
20:28bbloomit should produce:
20:28bbloom(def id (clojure.core/fn id ([x] x)))
20:28bbloomdnolen: if you do that, the special case goes away
20:29bbloomdnolen: that said, your change looks good. i'd commit that as an intermediate step
20:30dnolenbbloom: I think fixing it at defn macro might be problematic? thinking about custom defn like macros, this way you can have a complex expression and the function will still get a name.
20:32bbloomdnolen: (def f (fn [x] (if (zero? x) :done (f (dec x))))), (f 5)
20:32bbloomdnolen: wacky, that works.
20:32bbloomdnolen: seems wrong to me
20:33coventry`Why is that surprising?
20:33hfaafbcan i evaluate the body of 'for' *once* even if :while fails?
20:33bbloomcoventry`: that's surprising because:
20:34bbloom((fn [x] (if (zero? x) :done (f (dec x)))) 5)
20:34bbloomcoventry`: the inner fn form is magically influenced by it's presence inside the def form
20:36bbloomconsider: (let [g (fn [x] (if (zero? x) :done (f (dec x))))] (def f g))
20:36coventry`bbloom: Gotcha. Interesting.
20:36bbloomclearly that doesn't work :-P
20:36seangrov`((fn f [x] (if (zero? x) :done (f (dec x)))) 5)
20:36bbloomseangrov`: yeah, that's what i'm saying it *should* be, but apparently def is magic when an fn is inside it syntactically
20:36seangrov`bbloom: Ah, yes, I see that now
20:37bbloomdnolen: so you're saying that there are likely defn-style macros that depend on this odd behavior?
20:37dnolenbbloom: not completely sure
20:42dnolenbbloom: doing some spelunking, the passing of name is from the earliest days
20:42dnolenbbloom: present before my first commit 2 years ago
20:42bbloomdnolen: i suspect it was more or less directly copied from clojure
20:43dnolenbbloom: yeah but I'm trying understand it's purpose, I just don't see the point of passing name into map or set analysis
20:43dnolenbbloom: after my change all tests pass
20:43bbloomdnolen: the point would be if you had something like #{(def f (fn …))}
20:43bbloomdnolen: which seems absurd :-P
20:44coventry`bbloom: FnExpr has an emitForDefn, which DefExpr calls when the init form is a fn. emitForDefn doesn't seem to do much, though.
20:44dnolenbbloom: I don't see how that case is involved here, it appears this is meant for (def foo #{(fn []) ...}), but that doesn't really make sense to me either.
20:44bbloomcoventry`: my guess is that emitForDefn predates the recursive fn syntax
20:45bbloomcoventry`: i've got the instincts of a professional software archeologist :-)
20:46coventry`bbloom: I'm pleased to meet another Vinge fan. :-)
20:46bbloomcoventry`: sorry, i have no idea what that is
20:46bbloomlol
20:47coventry`bbloom: Thought you were referring to this: http://en.wikipedia.org/wiki/A_Deepness_in_the_Sky#Interstellar_culture
20:48bbloomcoventry`: oh, i think i've heard of that
20:50coventry`bbloom: What do you mean by recursive fn syntax?
20:50bbloom(fn THIS-NAME-HERE [...
20:50coventry`Oh, right.
20:56sontekdnolen: In the tutorial you sent me: http://mmcgrana.github.io/2010/03/clojure-web-development-ring.html it does things like :dependencies and then indents everything underneath that
20:56sontekdnolen: is that the standard way to indent in clojure?
20:56dnolensontek: matter of personal preference
20:58dnolenbbloom: yeah I can't really figure out what the point of name is even looking at the old code
20:58sontekdnolen: I was asking because emacs thinks its not a valid indention
20:59bbloomdnolen: lol, yeah, i was pretty confused by it so i ignored it
20:59bbloomdnolen: i feel that way about a bunch of things in there :-P
20:59dnolensontek: you can customize identation
21:00sontekdnolen: yeah, I just want to follow whats the community standard way of doing things
21:00sontekI couldn't find many best practices docs
21:01dnolenbbloom: I think you're right about this being copied over from Compiler.java ...
21:01bbloomsontek: just focus on getting working code, then you can worry about what it should look like later. as you look at more & more clojure, you'll get a feel for it
21:01dnolenbbloom: but actually ...
21:01dnolenbbloom: in Compiler.java they don't pass name along to every case
21:01bbloomdnolen: heh
21:02dnolenbbloom: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6375
21:02dnolenbbloom: this looks exactly like my change :P
21:02bbloomdnolen: history repeats itself
21:02dnolenbbloom: only analyzeSeq gets name
21:03dnolenk I'm not crazy merging this in
21:05sontekIs my leinigen out of date if I get exceptions like this? http://paste2.org/ZzmZfCIC
21:05sontekthats from lein deps
21:06sontekLeiningen 1.7.1 on Java 1.7.0_25 OpenJDK 64-Bit Server VM
21:06sontekMaybe because i have openjdk instead of real java?
21:07coventry`sontek: Definitely out of date. Not sure whether that's the cause of your error.
21:07coventry`sontek: Get the latest: https://github.com/technomancy/leiningen#installation
21:08sontekThats the version shipped with Fedora 19, which came out a couple months ago
21:08sontekI'll grab latest
21:10sontekyeah, latest works way better
21:13sontekis there a way to define dependencies as "latest" instead of hardcoding versions?
21:17coventry`I've only experimented with it once, and I can't find documentation on it, but it seems that if you replace the version string with "RELEASE", you'll get the latest version.
21:17s4muel"LATEST" works.
21:18sontekI didn't see either of those listed on the leinigen docs
21:18sontekI'll dig around
21:21coventry`Oh, it's a maven thing: http://stackoverflow.com/a/1172371
21:22s4muelThere's lein-ancient too
21:22sontekahh, nice, good to know
21:22sonteknot from the java world, so I have plenty to learn
21:59clj_newb_2345besides pedestal, is there any library which does the following: I have a data structure, and a function which mapps data to DOM tree; ... then, as I make incremental updates ot the data structure, the DOM tree gets incremental updates
22:00coventry`Isn't that the basic idea behind c2? http://keminglabs.com/c2/
22:00gfredericksclj_newb_2345: web-fui _maybe_
22:01clj_newb_2345coventry`: I think c2 is about wrapping d3
22:01clj_newb_2345and producint viosusalizations
22:01clj_newb_2345I want something more generic
22:01clj_newb_2345that I can say, write we bapps with
22:01john2xyeah web-fui does that.. but it's not production ready I think
22:02john2xpretty cool project
22:02coventry`clj_newb_2345: Yes, but D3 stands for "Data-driven documents."
22:02sontekCouldn't you just hook into something like backbone/angular from clojurescript?
22:03callenyou can use it for another things, but d3 is generally best for "explanatory" rather than "exploratory" content.
22:06coventry`callen: Could you give an example of the distinction you're drawing?
22:06callencoventry`: a pre-prepared infographic vs. a dashboard for viewing dynamically loaded aggregate data with multiple views.
22:06callenyou can do the latter with d3, but it'll hurt.
22:09callencoventry`: I will say this though, c2 does make things a lot less painful.
22:10callenhttps://github.com/Mamun/clojure-web-app
22:10coventry`I thought c2 was released with demonstrations of visualisations which responses to data changes, but it was a while ago. I might be misremembering.
22:11callenI said you could do it, and that c2 made it a lot less painful.
22:11callendoing that sort of thing in d3 and JS directly is incredibly tedious though.
22:11callendnolen: okay, what'd I say?
22:12dnolenI just made CLJS incremental compilation like 10X faster :P
22:12callenwhoa, congrats!
22:14devnwahhh!
22:14devndnolen: how?
22:15dnolendevn: eliminating pointless analysis if you're running auto builds
22:15bbloomdnolen: ie not re-analyzing namespaces that haven't changed?
22:15dnolenbbloom: yes
22:15bbloomdnolen: heh.
22:15bbloomdnolen: derp. shoulda figured that one out earlier
22:17dnolenhttps://github.com/clojure/clojurescript/compare/509-protocol-warn
22:17dnolenbbloom: while you like to complain about analyzer/compiler.clj, I think closure.clj is a lot harder to understand :)
22:18bbloomdnolen: agreed. i only complain about analyzer/compiler .clj b/c i can articulate complaints :-P
22:18dnolenbbloom: haha :D
22:18bbloomdnolen: i have about 1/3rd the mental cache space that you have. that's why you think my code is so pretty: b/c i'm too dumb to understand it unless it's absurdly well factored
22:19bbloomtakes me 10X longer to make it look that nice, but shhh don't tell anybody :-P
22:20dnolenit's nice to see that ClojureScript can have CoffeeScript speed compile times
22:20dnolenonce JVM warm and core.cljs compiled
22:22bbloomdnolen: that's a big deal
22:22dnolenit is
22:23sdegutisWhat's a good way to inspect a Leiningen project from without but as if from within, i.e. with full access to all the Clojure files it contains?
22:24callensdegutis: inspect?
22:24callensdegutis: do you mean checkouts?
22:24sdegutisUm, like all the introspective tools you could otherwise use if you were inside the project, like (the-ns 'hello.world) etc.
22:24callensdegutis: use checkouts.
22:25sdegutisOh.
22:25sdegutisI misunderstood your answer :)
22:26sontekIs there a thread.sleep in clojure?
22:26sdegutiscallen: Ah, this solution won't work for me because my app will be a jar file, which won't have a source directory to create a 'checkouts' dir inside. But thanks :)
22:27sdegutissontek: ##(Thread/sleep 1000)
22:27lazybot⇒ nil
22:28sdegutisOh I wonder if tools.namespace will do this.
22:33dnolenbbloom: 0.2 seconds to recompile a single changed file w/ a couple of functions now w/ :whitespace optimizations
22:33bbloomdnolen: glorious
22:34coventry`,(the-ns 'clojure.core) isn't a very informative example. Not clear how it relates to a Leiningen project's files.
22:34clojurebot#<Namespace clojure.core>
22:34dnolenbbloom: ~0.04s if you leave Closure out of it
22:36sdegutisdnolen: is cljs your day job?
22:36dnolensdegutis: heh, no
22:37bbloomdnolen: I'd like to submit a patch via IRC. please run this in the root of the CLJS directory:
22:37bbloomsed -i '' 's/ new//' README.md
22:42sdegutisdnolen: oh.
22:43sdegutissed -i '' 's/Clojure/Lava/' **
22:44sdegutissmthn lk tht
22:47dnolensdegutis: I work on ClojureScript because otherwise I'll be stuck writing JS or managing people that write JS, do not want that future.
22:48sdegutisdnolen: Ah. That makes sense. I've noticed that the only tools I ever actually do work on are ones I plan to use as soon as (before?) they're done.
22:55sontekSo can you call into actual js libraries from clojurescript? So you can basically write all the clientside code in clojure?
22:55sontekThat would be pretty wonderful
22:56dnolensontek: calling in to JS libs from CLJS is easy, people are more or less doing what you're describing :)
22:56sontekoh my, I feel like I've wasted so much of my life all of a sudden
22:56dnolensontek: CLJS core.async is massively sick IMO http://swannodette.github.io/2013/07/12/communicating-sequential-processes/
22:59sontekI'm even happier I decided to checkout clojure now
22:59sontekDo you guys know where ring.middleware.stacktrace went?
23:00sdegutisOH!
23:00sdegutisIDEA.
23:01sontekI see it here: http://mmcgrana.github.io/ring/ring.middleware.stacktrace.html but not here: https://github.com/mmcgrana/ring/tree/master/ring-core/src/ring/middleware
23:01sdegutisI-FRICKEN-DEA.
23:01sontekdooo itt
23:03sontekhttps://github.com/mmcgrana/ring/tree/master/ring-devel/src/ring/middleware its there though
23:03callensontek: lib-noir and wrap-failsafe.
23:03callenyou can write your own trivially.
23:04callensontek: if you have lein ring it will display pretty stacktraces automatically for any uncaught exceptions.
23:05callencaveat to lein ring being that it's jetty only.
23:05callenif that matters.
23:10sonteknice, lein ring works pretty well
23:11sontekI've been doing all my testing with jetty, its seems like its more than enough for me. I'm actually doing a port of my existing app to see if I can squeeze more performance out of it
23:11sontekbut the jvm seems to be way nicer than I was hoping for
23:12callensontek: clojure is doing a fair to clean it up wrt APIs and tooling.
23:12callena fair bit*
23:14SegFaultAXsontek: You were hoping the JVM would be shittier?
23:16sontekSegFaultAX: haha, its just better than I hoped for
23:17sontekSegFaultAX: I've only ported 3 APIs but I'm seeing about a 4x speed improvement from my python code and concurrency wise, I couldn't get it to blow up with ab
23:18sontekin my python server, it degrades pretty quickly once you get a lot of concurrent requests
23:18Pupnik_say what you like about the JVM, but you can't say its slow
23:19sontekand this is knowing very little about clojure/jetty, I'm sure I could tweak both to get it even faster, since I've done all kinds of tweaks on the python side to get the current performance I have
23:21callensontek: you don't really need to do much to make it acceptably performant - if anything. Hypothetically you could use http-kit if you needed async or expected high concurrency but that's not obligatory by any means.
23:21callenDoes enforce good habits in terms of not relying on thread-local state though :)
23:22akurilinWith leiningen, is my only option for including non-clojure binary and text assets, to stuff them all under resources?
23:23llasramWhat other kind of option would you want?
23:24llasramThat's what "resources" is for -- things other than source code which should end up in your project JAR
23:24akurilinWell I'm thinking with Rails in mind where you have app/views which contains .erb
23:24akurilinllasram, would you create something like resources/views for that purpose?
23:25callenakurilin: for templates, I put things like that in src/templates or src/views/templates
23:25callenakurilin: having erb files in a clojure project is pretty strange though.
23:25ArthurZHow hard would it be to pickup Clojure?
23:26llasramakurilin: I don't do that much Web stuff, so I yield to other in the common patterns here
23:26akurilincallen, do you have to change project.clj to have those folders included in the uberjar?
23:26dnolenArthurZ: coming from what language/experience?
23:26akurilincallen, or is everything under src included?
23:27callenakurilin: I don't mess with my leiningen in order to do that.
23:27akurilin(I'm not fully clear on how uberjars work internally as you can tell, I'll need to look more deeply into it at some point soon)
23:27ArthurZNo functional languages
23:27callenSelmer uses the classpath (resources, src, test, etc) to find templates.
23:27callenakurilin: what you're talking about is by no means specific to uberjars.
23:27ArthurZThinking of buying http://www.packtpub.com/clojure-data-analysis-cookbook/book?utm_source=Deal+Of+the+Day&amp;utm_campaign=309e9282fe-8th_Sept_8_30_2013&amp;utm_medium=email&amp;utm_term=0_1299a68014-309e9282fe-54288189&amp;mc_cid=309e9282fe&amp;mc_eid=ab6778ae1d
23:28callenakurilin: the weird part about uberjars is the AOT.
23:28callenArthurZ: that looks neat, but you probably want http://clojurebook.com/ first.
23:28dnolenArthurZ: getting your head around programming w/ immutable data structures is a hurdle - I personally recommend Clojure Programming
23:29callenwhich incidentally is what I just linked. Koans help too.
23:29callengood to know I'm not the only one that thinks the immutable bits take some working through.
23:29ArthurZI am a t-sql guy
23:30akurilincallen, I see, so as long as something is under one of the default folders, it will make it to the uberjar, and then I should be able to refer to that file through a path relative to the classpath?
23:30callenit's not about default vs. not default directories, it's about the classpath.
23:31callensome stuff is in it, some stuff ain't. just start dumping the classpath in an empty project and learn what's in there.
23:31ArthurZThx callen: any free as in beer books are around?
23:32sontekcallen: http-kit looks pretty nice, is there a reason not to use it upfront since it is compatible with ring?
23:33akurilincallen, got it.
23:33callenArthurZ: any reason you can't afford it?
23:33akurilincallen, lein classpath is pretty handy here, I imagine that's what you were referring to
23:33callenakurilin: yes but I wanted you to go on your own path of enlightenment.
23:33sontekjust that it has to be ran by its own async-server instead of jetty?
23:33callensontek: uhm, you don't want to use thread-local state in http-kit. That's a blocker for some people, not for others.
23:33callenno thread affinity.
23:34akurilincallen, I'm looking at the leiningen "specification" and it seems to support 4 default paths: source, java source, test and resource. Shouldn't those be considered "default"?
23:34callenbeing shen feng means not understanding the needs of mere mortals.
23:34akurilincallen, is that a java concept?
23:34callenakurilin: we can go with 'default' if you like, but the classpath is the real thing that decides what gets found and what doesn't :P
23:35sontekcallen: I'm firmly against threadlocals
23:35technomancyakurilin: tests are on the classpath but don't get put into jars
23:35callensontek: then go for it.
23:36akurilincallen, I guess the point is that you wouldn't really add more folders to that classpath unless you had some really specific needs, right?
23:36ArthurZCallen: using an OSS product makes me think so
23:37callenakurilin: pretty much. you should avoid doing so unless you have an exceptionally good reason.
23:37akurilin(in fact I can't see an obvious way of doing that through lein configs)
23:37akurilincallen, gotcha, thx for the explanation
23:38dnolenArthurZ: you really can't beat the Clojure books, online resources are not quite up to snuff w/ the good books.
23:38akurilintechnomancy, good reminder!
23:38SegFaultAXsontek: If you're doing your job right, your Clojure code should run circles around your Python code once the JVM warms up.
23:39ArthurZAha dnolen: figured as much
23:39callenand you can use drip for the latter if you want to cheat.
23:39ArthurZWhat would you say about http://www.packtpub.com/clojure-data-analysis-cookbook/book?utm_source=Deal+Of+the+Day&amp;utm_campaign=309e9282fe-8th_Sept_8_30_2013&amp;utm_medium=email&amp;utm_term=0_1299a68014-309e9282fe-54288189&amp;mc_cid=309e9282fe&amp;mc_eid=ab6778ae1d
23:39callendnolen: might change someday, but for now, Emerick's book is king of the hill for new people.
23:40akurilincallen, and no I'm not using erb. Sticking to mustache for this one really basic email template I'm writing, and then I might seriously need to look into Enlive. I've used underscore.js's templating for a while so perhaps clostache would be the most similar to that.
23:41callenakurilin: 2 things: try Selmer - http://github.com/yogthos/Selmer/ - and - did you end up using Blackwater?
23:42akurilincallen, 1. any specific reason you'd recommend it over the more basic option I mentioned? 2. not yet, sorry!
23:45callenakurilin: mustache is fine if it works for you, but if you start needing smarter templates, give Selmer a try.
23:47akurilincallen, deal.
23:48ArthurZIs there a Clojure driver for SQL Server?
23:49callenArthurZ: anything in Clojure that uses JDBC supports whatever JDBC supports. This includes Korma and c.j.j
23:51ArthurZCallen: no idea on Korma or cjj
23:51mrcheekswhat about google ^^ :-)
23:52ArthurZGoogle spies lol
23:52callenoh this is cool, I don't have to be the meanie that says to google anymore.
23:52callenArthurZ: then duck-duck-go-it.
23:52mabesArthurZ: I've use the SQL server jdbc driver from clojure before without problems
23:52ArthurZSeriously, I use duck-duck or Bing
23:53callenArthurZ: okay?
23:53akurilinOh actually on that note let me ask this here rather than on the groups. I'm trying to figure out a sane way of avoiding repetition when building different flavors of the same SQL query. For example I have a select, but I might want to add in a limit, an offset, a sorting order, perhaps a count etc all based on the same base query. Or for inserts, sometimes I want to add RETURNING at the end. Can I avoid doing this by hand? Is Korma/Honey what people
23:53akurilinuse for that?
23:54ArthurZMables: does it handle sql errors well? E.g. do schema errors bubble up?
23:55ArthurZSorry callen: ok re what?
23:55akurilinI get the feeling that what I'm asking for must have been solved and resolved a few hundred times already.
23:57ArthurZakurilin: AFAIK ANSII SQL was never implemented in any RDBMS
23:57callenakurilin: Korma.