#clojure log - Apr 18 2012

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:13 jonas11235: guys, what is the right to way to execute a function asynchronously in clojure?

0:13 I don't have a state to use an agent

0:13 and I don't have a value to read back to use a future

0:13 technomancy: jonas11235: nothing wrong with a java.lang.Thread

0:14 (.start (Thread. my-fn))

0:14 for fire-and-forget

0:16 jonas11235: technomancy: I thought that was some abstraction like (spawn fn), ok, I will use a thread (yes, I avoid them as maximum as I can)

0:16 technomancy: [as much as I can]

0:16 technomancy: jonas11235: you can use a thread pool if you need it to be bounded

0:16 I don't know how off the top of my head; often it's easier to abuse futures unfortunately

0:17 jonas11235: technomancy: but if I don't deref the future, it will be executed?

0:17 technomancy: it will, yeah

0:17 jonas11235: technomancy: (future fn) nice :)

0:17 technomancy: actually it's a macro, so you need to call it: (future (my-fn))

0:18 jonas11235: technomancy: I don't want to mess with threads and thread pool

0:18 technomancy: ty :)

0:18 technomancy: sure

0:20 jedahu: weird, simply requiring cljs.repl.rhino in the same file as cljs.repl.browser causes some rhino stuff to be run when (repl <browser-repl-env>) is called, needless to say, it breaks things

0:22 ibdknox: note to self: this kickstarter things is unbelievably stressful lol

0:22 I'm not sure I'd do it again

0:23 technomancy: all you need to do is have fewer people interested in it; problem solved

0:23 brehaut: ibdknox: it was the php request that pushed it over the top right?

0:23 ibdknox: lol

0:23 I actually looked to see if there even was a php parser

0:23 and there is!

0:23 brehaut: haha

0:23 ibdknox: I was surprised

0:23 brehaut: is it crazy making

0:24 technomancy: there are some things no amount of money should be able to buy

0:24 ibdknox: haha

0:24 it's true

0:24 brehaut: damn right

0:24 technomancy: like ibdknox's dignity =)

0:24 brehaut: vbscript support as well

0:24 ibdknox: I shit you not

0:24 I had someone email me about classic ASP support

0:24 * Derander gags and vomits

0:24 * brehaut cries

0:25 brehaut: at my old job i very nearly wrote a VBScript to JScript cross compiler

0:25 technomancy: well right now there's this schrodinger's cat effect; since it hasn't been observed, the waveform hasn't collapsed, and everyone's imagining that their favourite cat is alive and well inside light table.

0:26 ibdknox: haha

0:26 brehaut: ibdknox: brainfuck would be easy to support

0:26 ibdknox: oh man

0:27 I could totally do that one ;)

0:27 brehaut: yes :)

0:27 even just for fun

0:27 easter egg styles

0:27 ibdknox: someone suggested lol code

0:27 technomancy: come on man, I want Piet support

0:27 brehaut: haha if you go down the DMM route, we'll be here all day :P

0:27 kovasb: i would like to code in cellular automata rule 110

0:28 should be pretty easy to support

0:28 ibdknox: I wrote Ook support for VS ;)

0:28 technomancy: can you support my hardware turing tape implementation that attaches over RS-232?

0:28 brehaut: ibdknox: thats awesome

0:28 antares_: is it a really bad idea to implement certain protocol functions for nil?

0:29 ibdknox: technomancy: lol there were several request for VHDL

0:29 brehaut: crap, im far to close to diving down the irregular webcomic back catalog

0:29 antares_: I am facing a (Java interop) situation where I need to either extend some conversion protocols for nil, or write a macro that will eliminate repetitive nil checks

0:30 brehaut: technomancy: this is all your fault!

0:30 antares_: ibdknox: is there a light table irc room? I have a question

0:30 ibdknox: #lighttable

0:31 amalloy: antares_: no, it's totally reasonable to extend protocols to nil

0:31 antares_: amalloy: aha. Thanks.

0:31 amalloy: for example, in cljs where all the core interfaces are protocols, you see something like (extend-protocol Collection nil (conj [this x] (list x)))

0:34 antares_: amalloy: and in JVM Clojure this case is handled w/o protocols because conj is implemented in Java?

0:34 amalloy: yeah

0:35 cmajor7: what is a recommended way to work with byte buffers? I see: https://github.com/geoffsalmon/bytebuffer => is there anything in core that I missed?

0:35 antares_: cmajor7: there is https://github.com/ztellman/gloss and momentum has many useful bits, too (although not extracted into a separate lib)

0:37 cmajor7: antares_: cool. I see it also uses a ByteBuffer underneeth e.g. (let [~buf (ByteBuffer/allocate ~size)] …

0:43 tolstoy: Doing schema validation, and need to provide a Source[] parameter. Is there a way to convince java that an array is the appropriate type?

0:44 amalloy: &(into-array Number [1 4.5])

0:44 lazybot: ⇒ #<Number[] [Ljava.lang.Number;@319df1>

0:46 tolstoy: Ah! Thanks! Phew.

0:59 brehaut: bah! stupid muttable django middlewares

0:59 mutable even

1:11 * technomancy <3 quil: http://p.hagelb.org/chap.png

1:50 laurus: Is there an easy way to make, say, an Nx2 "matrix" of zeroes?

1:51 raek: laurus: as a vector of vectors of numbers?

1:51 laurus: Yes :)

1:52 raek: I'd use for and vec:

1:52 &(vec (for [r (range 10)] (vec (for [c (range 2)] 0))9)

1:52 lazybot: java.lang.RuntimeException: EOF while reading, starting at line 1

1:52 raek: &(vec (for [r (range 10)] (vec (for [c (range 2)] 0))))

1:52 lazybot: ⇒ [[0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0] [0 0]]

1:53 laurus: raek, wow, that's really interesting.

1:53 amalloy: &(partition 2 (range 20)) ;; another option if you don't care about vectors

1:53 lazybot: ⇒ ((0 1) (2 3) (4 5) (6 7) (8 9) (10 11) (12 13) (14 15) (16 17) (18 19))

1:54 xeqi: &(take 10 (constantly (range 2)))

1:54 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.core$constantly$fn__3656

1:54 bbloom: &(map vec (partition 2 (range 20)))

1:54 lazybot: ⇒ ([0 1] [2 3] [4 5] [6 7] [8 9] [10 11] [12 13] [14 15] [16 17] [18 19])

1:54 bbloom: if you do care about vectors :-)

1:54 laurus: Wow, you are all so good!

1:54 amalloy: ,*clojure-version*

1:54 eggsby: :)

1:54 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}

1:54 amalloy: ,(mapv vec (partition 2 (range 20)))

1:54 clojurebot: [[0 1] [2 3] [4 5] [6 7] [8 9] ...]

1:55 ibdknox: cheater :p

1:55 bbloom: :-)

1:55 amalloy: i prefer golfer

1:55 ibdknox: haha

1:55 laurus: What if I want to make them all 0?

1:56 amalloy: hiredman: is clojurebot on a snapshot of 1.4? if so, any reason we can't update him to the release version?

1:56 jkkramer: ,(vec (repeat 10 [0 0]))

1:56 clojurebot: [[0 0] [0 0] [0 0] [0 0] [0 0] ...]

1:57 laurus: Thanks jkkramer.

1:59 amalloy: ,(mapv vec (take 10 (partition 2 (range 2 0 0))) ;; ...

1:59 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

1:59 amalloy: interestingly, if you give range a step of 0 it tries to count down instead of up, so you have to start at the higher number

2:02 bbloom: amalloy: wouldn't (range start stop 0) just be the same as (repeat start) ?

2:03 amalloy: bbloom: yeah, it's obviously a bad implementation; i was trying to keep consistent with my partition/range as a joke

2:03 bbloom: gotcha

2:03 ::whoosh::

2:10 michaelr525: hello!!

2:11 mrnex2010: in compojure i dont know how to catch GET params (like a = 1 in www.com/?a=1 ) how can i do that or at least see the current url the user is at?

2:19 devn: ibdknox: you around?

2:27 +500 to light table.

2:29 Raynes: II sure wish I had $500 to give.

2:29 devn: I don't, but I did it anyway.

2:29 Raynes: Yeah, when I say I don't I mean I literally don't have $500 at all to my name.

2:30 kovasb: maybe you should do a kickstarter :)

2:30 devn: lol

2:30 Raynes: Bahahaha.

2:30 I totally should. I could raise money and pipe it to Chris.

2:31 devn: we gotta get chris to develop mode

2:31 kovasb: f that just make something people want

2:31 devn: fruit roll ups?

2:31 Raynes: kovasb: I don't feel like taking nude selfpics.

2:31 kovasb: lol

2:31 i know, capitalism is degrading

2:34 devn: nude selfpics

2:34 no words,

2:34 words.*

2:34 Raynes: devn: Have you been to LA?

2:35 devn: Raynes: a long time ago

2:36 Raynes: devn: https://photos-5.dropbox.com/i/o/UFHe3hr1AB2CTr7hQAl44kc82fnjd27-5oXjL0VH9ho/23745600/1334818800/5b9cce4/IMAG0146.jpg Santa Monica is great.

2:37 devn: big sur!

2:45 tufflax: I hate these kinds of lines (even though it's not ONE line). What do you guys do about them? http://pastebin.com/MSDB0Rbi

2:47 bbloom: assign names to intermediate values?

2:47 using let

2:47 Raynes: tufflax: There are better ways to structure that code, not the least of which is to factor it into smaller pieces.

2:52 tufflax: Raynes: Yeah, maybe that's what I'll do. bbloom: Hm, it's not that easy. The second for uses the enviroment of the first, and so on.

2:54 michaelr525: how to exit the repl? :)

2:54 antares_: michaelr525: Ctrl + D

2:54 tufflax: Raynes did you have some more alternatives? I'm all ears, because, as I said, I really hate 'em. :)

2:55 michaelr525: antares_: thanks

2:55 bbloom: tufflax: more context is needed to refactor properly

2:59 michaelr525: so how should I name constants?

3:02 amalloy: tufflax: you can also combine the inner filter/for into a single for

3:02 tufflax: oh yeah, thanks

3:02 bbloom: michaelr525: there isn't really such a thing as a constant ;-)

3:03 michaelr525: the same way you name any symbol is fine

3:03 fhd: I have two values, and I want to put them into a map, but only if they're non-nil. e.g. I have [foo bar] and I want {:foo foo :bar bar}, but only if both are non-nil. I could just make that map and filter nil values out, but there must be a better way, eh?

3:03 tufflax: I think I'll pick this up tomorrow again, getting tired.

3:04 amalloy: (for [a sigma, :let [v (eclose ...)] :when v] [a v])

3:05 michaelr525: bbloom: well, i named it *something-something* and it complained that I should specify dynamic or change the name

3:05 amalloy: michaelr525: yeah, *foo* is the one thing you don't want to do for constants

3:05 tufflax: amalloy thanks

3:05 bbloom: michaelr525: the *earmuffs* imply dynamic scoping

3:05 amalloy: those scream "unlike everything else, this is not a constant"

3:05 michaelr525: haha

3:06 amalloy: some people (common-lisp converts?) like to use +some-const+, but we just kinda look at them funny

3:06 bbloom: michaelr525: you should also avoid unnecessary constants. no sense defining a bunch of ENUM_VALUE = 4 sorts of things, when you could use a :keyword

3:09 michaelr525: i'm have a constant which holds a name of directory such as *tmp-dir*

3:09 bbloom: oddly enough, that might be a valid reason for the earmuffs :-)

3:10 http://info.rjmetrics.com/blog/bid/51652/Lexical-vs-Dynamic-Scope-in-Clojure

3:10 that constant very well could be a configuration value, & it's common to use dynamic vars for configuration

3:11 michaelr525: hmm ok thanks

3:11 bbloom: but, in general, clojure favors immutability

3:11 so (def tmp-dir "/tmp") is totally A-OK

3:12 there are a number of ways to change that immutable, but they are somewhat advanced. other than simply redefining a new value over it, of course

3:13 if you wanted to let clients of your library override the configuration, then you could make the variable "dynamic" like so:

3:13 (def ^:dynamic *tmp-dir* "/tmp")

3:13 then people can use 'binding to set it on a per-thread basis

3:13 michaelr525: cool

3:15 bbloom: (binding [your-ns/*tmp-dir* (str "/tmp/" (.getName (Thread/currentThread)))] my-client-code-here)

3:16 michaelr525: thank you!

3:29 kral: namaste

4:08 muhoo: gawd, i'm spoiled. i just had to do some js, and was reaching for an immutable dissoc

4:09 bbloom: muhoo: http://documentcloud.github.com/underscore/#without

4:10 muhoo: bbloom: neat, thanks!

5:06 bohl: lein newbie here. "lein deps" result in error "clj-record:clj-record:jar:1.1.2-SNAPSHOT not found". Can't find it in mvnrepository.com, what do?

5:13 found it, needs version 1.1.1

5:45 ivan: https://github.com/brentonashworth/one <- on Ubuntu 12.04, lein 1.7.1, clean ~/.m2, the 'Getting started' result in FileNotFoundException Could not locate cljs/closure__init.class or cljs/closure.clj on classpath: clojure.lang.RT.load (RT.java:430)

5:45 I would guess as to what went wrong, but I have no idea how dependency resolution works

5:48 java -showversion is OpenJDK Runtime Environment (IcedTea7 2.1.1pre) (7~u3-2.1.1~pre1-1ubuntu2) / OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)

5:49 fortunately I am not particularly invested in this working! bbl.

5:50 BeLucid_: How is Leiningen pronounced? Like lennon - gin ? Or some other way?

5:51 vijaykiran: Q: How do you pronounce Leiningen?

5:51 A: It's LINE-ing-en. ['laɪnɪŋən]

5:51 BeLucid_: https://github.com/technomancy/leiningen FAQ :)

5:53 BeLucid_: thanks!

5:54 that's kind of an awkward pronunciation for American English

5:54 very consonant heavy

5:54 but got it

6:41 Fullmoon: How can I change a map with a function that takes [key val], and returns a new value for this key?

6:41 clgv: Fullmoon: assoc?

6:42 Fullmoon: wait, you probably mean update-in

6:42 Fullmoon: clgv: That was it, thank you!

6:43 clgv: Fullmoon: that one only gets the value but not the key ##(update-in {:a 10 :b 20} [:a] inc)

6:43 lazybot: ⇒ {:a 11, :b 20}

6:43 Fullmoon: clgv: Ah I see

6:59 stonebuilder: ./show 1

7:00 fliebel: Wrong screen window? Wow, that adds a whole new dimension.

7:00 rm -rf

7:00 woops

7:38 clgv: fliebel: you forgot /

7:38 ;)

7:38 and maybe an additional sudo :P

8:38 laurus: How do I simply access an attribute of a Java object in Clojure, without using a getter function?

8:38 clgv: laurus: if it is public, yo can accces it via (.attr obj)

8:39 samaaron: in 1.4: (.-foo myObj)

8:39 tomoj: if there is a getter of the same name, is there a workaround other than reflection?

8:39 oh, upgrade to 1.4 :)

8:39 samaaron: (although i've never used it, I just remember reading the changelog)

8:39 laurus: Thanks!

8:58 How can I use a named argument?

8:58 Just :nameofarg valueofarg ?

8:59 achin: laurus: This post is a little old, but it still works. http://stackoverflow.com/questions/3337888/clojure-named-arguments

9:00 laurus: achin, the problem is that this is an already existing function.

9:00 I'm using clojure-py, and this Python function accepts keyword arguments ;)

9:00 achin: laurus: What's the function's signature?

9:00 michaelr525: what's the short cut for filter-not-nil?

9:00 (filter #(not(nil?

9:00 I mean

9:01 llasram: michaelr525: (remove nil? ...)

9:01 ?

9:01 laurus: achin, it is:

9:01 numpy.array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0, maskna=None, ownmaskna=False)

9:01 achin: michaelr525: (remove nil? col)?

9:02 llasram: laurus: Wow, clojure-py. Cool. I think you're very much in "early adopter" territory though :-)

9:02 laurus: llasram, oh yeah.

9:02 ;)

9:02 achin, any ideas?

9:03 achin: laurus: Sorry, I'm not too familiar with clojure-py. I did notice this, though. https://github.com/halgari/clojure-py/issues/71

9:03 laurus: achin, oh great! Let me try that.

9:04 Wow, that actually worked.

9:04 Thanks a lot for finding that for me!

9:04 achin: laurus: Awesome. No worries.

9:04 laurus: I'm amazed by how well clojure-py works given that it's in such an early stage.

9:05 michaelr525: thanks

9:05 works as expected :)

9:58 neotyk: Good morning everyone!

10:01 mdeboard: hi

10:01 neotyk: noir question: how do I add file-info middleware to it, so static resources get served with proper content-type?

10:17 achin: technomancy: I'm trying to upgrade my plugin to 2.x and am having trouble understanding what to do with :dev-dependencies. Do I put them in the :plugins profile?

10:21 fdaoud: achin: "move from :dev-dependencies to :dependencies in the :dev profile"

10:22 achin: fdaoud: This is for migrating Leiningen plugins them selves, too?

10:23 fdaoud: I've upgraded lein projects before, but not lein plugin projects.

10:23 fdaoud: achin: I missed that you were talking specifically about plugins. Sorry about that.

10:24 achin: fdaoud: No worries.

10:34 technomancy: achin: if you need to introduce a dependency into the project for your plugin to work, you should call update-in on the project arg before you pass it to eval-in-project

10:34 see the example of lein-swank: https://github.com/technomancy/swank-clojure/blob/master/lein-swank/src/leiningen/swank.clj#L59

10:36 ejlo: .(conj (pop [1 2]) 3)

10:37 Bronsa: ,(conj (pop [1 2]) 3)

10:37 ejlo: clojurescript evaluates this to [1 2]

10:37 clojurebot: [1 3]

10:37 ejlo: thx

10:37 I think there is a bug in pop for PersistentVector

10:41 dnolen: mmarczyk: hmm I think your changes may have broken the browser REPL.

10:41 mmarczyk: I should have checked before applying, but when changing anything around net, dom, repl, we need to make sure browser REPL still works.

10:45 ejlo: please open a ticket in JIRA for that.

10:45 ejlo: ok

10:45 dnolen: ejlo: http://dev.clojure.org/jira/browse/CLJS

10:51 rplevy: did read-lines from duck-streams end up in any library? I can't seem to find it.

10:52 drewr: rplevy: wasn't it just a combo of clojure.java.io/reader and line-seq?

10:52 rplevy: except it closes the reader, right?

10:53 drewr: dunno I never used it

10:54 rplevy: it was like line-seq, except for automatically closing the reader when you have read everything in

10:56 drewr: I guess with-open/reader/line-seq still doesn't seem too ugly to me

10:57 rplevy: yeah I guess so, a little more verbose :)

11:04 jtoy: can you guys recommend a word stemming library for clojure?

11:08 technomancy: verbosity at the cost of avoiding a resource leak

11:08 rplevy: hmm yeah

11:10 achin: technomancy: I don't need to introduce a project dependency through my plugin. My plugin has midje tests, so I just want to figure out how to update that in my project.clj.

11:11 rplevy: achin: :profiles {:dev {:dependencies [[midje "1.3.2-alpha1"]]}}

11:12 achin: :plugins [[lein-midje "2.0.0-SNAPSHOT"]]

11:13 achin: rplevy: Yeah, that's how I did it with my project, but I'm updating a plugin project — lein-mustache.

11:13 rplevy: https://github.com/achin/lein-mustache/blob/master/project.clj

11:13 rplevy: is it different for plugins?

11:14 achin: rplevy: lein-precate and the wiki docs suggested that it was.

11:14 Lajjla: http://pastebin.com/qDLmivBz is this clojure?

11:15 rplevy: if you are using Clojure 1.4, for some reason including Midje causes the clojure version to stay at 1.3 (no other lib dependencies have this problem that I have seen, so it must be a bug in Midje) for this reason my midje dependency is [[midje "1.3.2-alpha1" :exclusions [org.clojure/clojure]]] which works

11:30 Lajla: yup

11:31 Lajla: rplevy, so it works and does what it's supposed to do?

11:31 Like (tens-fill 0 3 3 3) basically gives a 3x3x3 matrix of 0's?

11:32 clgv: Lajla: why dont you just execute it?

11:33 Lajla: Because I don't have clojure on this machine.

11:33 rplevy: just download lein and type lein repl

11:33 Lajla: http://tryclj.com/I tried this, but it bugs out on me

11:33 clgv: Lajla: the code is buggy. recur is only called with 1 argument

11:34 Lajla: Oh yeah

11:34 misplaced paren

11:34 rplevy, you assume that I am on a computer that is my own and people appreciate me installing stuff on.

11:35 clgv: seems to work then

11:35 Lajla: Schweet

11:35 bad style or whatever?

11:35 clgv: Lajla: well leiningen can be installed without any admin/root rights.

11:36 Lajla: One assumes, it's still not my computer.

11:36 S11001001: Lajla: do you work as a developer?

11:37 Lajla: Ehhh, I do some freelance PHP and Javascript a lot, that's it.

11:37 But I am second only to the microsoft chief software architect in terms of programming skills

11:37 clgv: Lajla: well you have a user account on it^^

11:38 Lajla: Alright, I'll look into how it works

11:39 Well yeah, this is a win 7 machine with no cygwin, which I'm also not going to install without her permission or wake her up for asking that, so oh well

11:40 it's not a big problem, I got all your guys as my team of genetically engineered monkeys to tell me if it works

11:44 otfrom: cemerick: I was wondering if there was something simple I was missing if I wanted to have a user be automatically logged in when they register as a user using friend.

11:45 S11001001: Lajla: just complain loudly that clojure sucks because it can't do X, if you are wondering how to do X in clojure :)

11:45 clgv: Lajla: well you dont need cygwin for leiningen. just download that lein.bat ;)

11:46 cemerick: otfrom: If you characterize your registration-related route as a friend workflow, then that becomes fairly simple.

11:47 Though, *any* handler can return a response with the session's ::friend/identity set.

11:47 Lajla: S11001001, what do you mean?

11:47 I know how to do X in clojure, I just did.

11:47 cemerick: otfrom: I have yet to extract some convenience fns for doing stuff like this from one of my apps. That'll all come through with the su capabilities, etc.

11:48 Lajla: I simply saw a discussion last night about how to make a Nx2 matrix of zeros and I was some-what confused by many of the methods proposed and wondered what was wrong with the 'standard' appraoch but it seemed to work fine in clojure

11:48 I was wondering if perhaps recur didn't like it if you supplied an apply-chain as one of its arguments, but apparently that's fine.

11:53 otfrom: cemerick: cool thx

12:11 dnolen: sweet datomic exposes index API, some fun in store for core.logic

12:14 ibdknox: not bad 1/4 of the way there in less than 24 hours?

12:14 ibdknox: dnolen: Likely means it won't happen

12:14 dnolen: you really only get one wave of hype

12:15 we'll see though. I've adjusted some things based on feedback

12:15 unfortunately kickstarter doesn't make that easy

12:15 muhoo: kickstarter is goos for $20k, i dunno about $200k

12:15 dnolen: ibdknox: well you've got 44 days, some ideas have legs ...

12:16 muhoo: if you need $200k, that might put it up into VC strata

12:17 scottj: muhoo: there was a kickstarter that raised 4 million recently

12:18 RickInGA: ibdknox is their a way to coordinate a 2nd wave?

12:18 scottj: another cool demo :)

12:18 clgv: scottj: that what I wanted to say as well ;)

12:19 ibdknox: muhoo: I did it primarily because the masses cried out for it :) It's been an interesting experiment, but I definitely don't think it fits software well

12:19 muhoo: scottj: wow, did not know that. that's fairly insane.

12:19 ibdknox: maybe a game because that hits a much broader audience

12:20 muhoo: what's the average donation size on kickstarter? $20? $50?

12:21 scottj: ah, i see http://www.macrumors.com/2012/04/17/iphone-compatible-pebble-wristwatch-tallies-nearly-4-million-in-kickstarter-presales/

12:22 scottj: has it only been high on HN/reddit? maybe reach out to slashdot/infoq/jsjabber

12:22 the-kenny: muhoo: The 4M is really insane as they raised that much in under a week.

12:22 30 days to go.

12:23 muhoo: average donatino size $143 on that one

12:23 &(/ 3800000 26500)

12:23 lazybot: ⇒ 7600/53

12:23 muhoo: foey

12:23 &(/ 3800000 26500.0)

12:23 lazybot: ⇒ 143.39622641509433

12:23 RickInGA: ibdknox is the graphics you did for the game editor planned as part of light table?

12:23 ibdknox: haha

12:24 RickInGA: what do you mean exactly?

12:24 RickInGA: your clojurescript game editor that you did after bret victor's presentation... is that part of light table?

12:25 the light table video seemed like it was all about text

12:26 ibdknox: RickInGA: it's something that can just be added as a plugin, so I think you'll probably see it at some point :)

12:27 devn: ibdknox: does the estimated delivery of Aug 2012 on kickstarter reflect the date at which "earliest" user testing is expected to begin?

12:27 muhoo: so you'd need like 4000 pre-orders at $50 a license? that doesnt' seem impossible.

12:27 ibdknox: devn: yeah

12:27 * devn gets all giddy

12:28 muhoo: devn: sounds like if you're giddy enough to open your wallet, it'll happpen :-)

12:29 devn: muhoo: already did :)

12:30 I'm voting for the future. I'd like to upgrade my 1970s editor to a 1980s editor. ;)

12:30 nDuff: ibdknox: ...will the folks who opened their wallet for the old $50 reward (w/o early access) get the new one (with early access included)?

12:30 ibdknox: yes

12:31 RickInGA: hah, this post starts of by mentioning light table... he doesn't like it, but some of the commentors do http://poincare101.herokuapp.com/post/18

12:31 nDuff: Does a subseq of a sorted-map hold a reference to the original map from which it's taken?

12:32 ibdknox: RickInGA: fortunately he has no idea what he's talking about :)

12:34 RickInGA: ibdknox your demo was clojure (which I think is really cool), do you also have any js pieces built? (which lots of people use)

12:34 ibdknox: RickInGA: only very early messing around kind of stuff. I have to start over, since the prototype wasn't built with longevity in mind

12:36 RickInGA: I'll do everything for Clojure first though

12:36 I can execute on that very quickly

12:37 which allows me to work out the kinks in things before I get to the harder language side of things

12:37 RickInGA: ibdknox: that makes sense... still from a funding perspective, there are a lot more js people than there are clj people... wonder what their default editor is. (notepad can't be the standard)

12:38 ibdknox: sublime, textmate, vim, emacs

12:38 one of those

12:39 bsteuber: maybe you can "fake" a js demo

12:50 bohl: Why can't I see the output of println after creating uberjar and running with java -jar? I see it when I do lein run..

12:52 timvisher: hi all

12:52 how can i add a local jar file to my leiningen project?

12:52 i tried dropping it into the libs directory but that doesn't seem to work

12:52 technomancy: clojurebot: repeatability?

12:52 clojurebot: repeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability

12:52 gfredericks: bohl: does the program do anything? I think the diff between uberjar and lein run is that you have to make sure the main class gets generated

12:53 technomancy: timvisher: it's covered on that wiki page ^

12:53 timvisher: technomancy: that's what i was looking for! :)

12:53 thanks

12:53 bohl: gfredericks: yes the program runs, I can show the output in a JOptionPane

12:53 gfredericks: bohl: oh then I have no idea

12:53 * gfredericks goes back to eating lunch

12:55 bsteuber: bohl: maybe the println is called from another thread? then *stdout* is not bound to the terminal

12:56 timvisher: technomancy: so it's looking like i need to get it installed in a repo in order to reference it? i'm writing some throwaway code and i just want to experiment with an api, which is why i was trying to avoid that

12:56 technomancy: timvisher: for throwaway code you might try lein-localrepo

12:56 bohl: bsteuber: how to make sure *stdout* is bound to the right thing, then?

12:57 eggsby: how can I use (require [... :as ...]) in the repl?

12:57 timvisher: cool

12:57 i'll go with that route

12:57 bsteuber: bohl: call (alter-var-root *out* (constantly *out*)) from the main thread

12:57 technomancy: I just hesitate to recommend that in public since people want to abuse it for real projects

13:03 fdaoud: eggsby: I think it's (require '(clojure [string :as s]))

13:05 bsteuber: eggsby: or just (require '[clojure.string :as str])

13:06 so the only difference is you nee to quote the symbols

13:06 *need

13:06 eggsby: ya bsteuber I found that out

13:07 I had to go (require ['my-lib.core :as 'whatever])

13:07 why is it that I need to quote those in the repl, but not in a clj file?

13:07 or I guess I don't quote them inside the ns macro?

13:09 timvisher: any way for me to examine my classpath at the repl?

13:11 Scriptor: ibdknox: new pricing scheme for backers, nice!

13:11 ibdknox: Scriptor: :) Unfortunately kickstarter is terrible for reacting to feedback.

13:13 Scriptor: hah, figures, still plenty of days to go

13:16 jodaro: ibdknox: will it collapse the new stuff for backers of the same rate but that backed before you changed it?

13:16 ibdknox: jodaro: absolutely

13:16 jodaro: i.e. there are two $50 levels now

13:17 ibdknox: edited that into the announcement

13:17 I'm not sure what people see

13:17 jodaro: rad

13:17 ibdknox: Kickstarter needs a lot of usability help

13:17 jodaro: when i go to the page there are two $50 levels

13:18 maybe you can start a meta kickstarter project to fix that

13:18 yo dawg, i heard you liked kickstarter so i kickstarted ....

13:21 ibdknox: jodaro: lol

13:21 jodaro: yeah, there will be two until everyone moves from the old one - I can't delete or modify them in any way if there's a single person on it.

13:22 jodaro: ok

13:22 TimMc: ibdknox: That's terrible. Can you hide one?

13:22 ibdknox: TimMc: no :(

13:22 TimMc: Ugh.

13:22 ibdknox: Like I said, I'm growing to hate this platform

13:22 immensely

13:23 jodaro: oh i get it

13:23 ok i moved mine

13:25 bsteuber: guess they make that to protect people from decreasing rewards

13:26 timvisher: (System/getProperty "java.class.path")

13:27 eggsby: yes not having to quote is a convenience of the ns macro

13:27 timvisher: bsteuber: thanks

13:28 bsteuber: ibdknox: nice new comment by a guy: "That new 15$ license = you've made me a supporter even though I don't know how to code :)"

13:29 fdaoud: bsteuber: link?

13:35 bsteuber: fdaoud: http://www.kickstarter.com/projects/306316578/light-table/comments top one

13:36 fdaoud: bsteuber: thanks.

13:36 eggsby: ya with how much money flows through kickstarter

13:36 you'd think they'd have their stuff together

13:38 bsteuber: let's kickstart a kickstart-competitor with better software and fairer rates ;-)

13:38 eggsby: how can I change the radix of a number in clojure?

13:39 jodaro: ibdknox: erlang support.

13:39 Raynes: Elixir!

13:39 jodaro: yeah i was just going to say

13:40 Raynes can do the elixir stuff

13:40 Raynes: Heh

13:40 jodaro: elix0r

13:40 ibdknox: haha

13:40 jaen: eggsby: wasn't that NrX?

13:40 RickInGA: http://pksunkara.github.com/semicolon/

13:41 ibdknox: done ;)

13:41 I added the ability to type a semi-colon

13:43 eggsby: oh cool jaen

13:43 so you can go 2r1100 to get 10r12

13:43 jaen: yeah, that's a pretty nice literal

13:43 eggsby: but how can I take '12' and turn it into base 2?

13:44 TimMc: &(Long/toString 12 2)

13:44 lazybot: ⇒ "1100"

13:44 RickInGA: wow

13:45 eggsby: thanks TimMc

13:45 good ol' java

13:50 nathanmarz: technomancy: yo, saw your question on twitter

13:53 technomancy: the ultimate goal is actually to use Kryo to do the serialization

13:53 technomancy: nathanmarz: I think something like this has the potential to be included in Clojure as part of the "dynamicity knobs" mentioned at the last conj

13:54 which is why it works with the reader

13:54 nathanmarz: yea, the problem with the reader is that you can't stick arbitrary objects in there

13:54 technomancy: well

13:55 you can, but it's hideous

13:55 https://github.com/technomancy/die-roboter/blob/master/src/die/roboter.clj#L78

13:55 nathanmarz: you mean essentially encoding the entire closure as "source code" to be evaled on the deserialization side?

13:56 technomancy: yeah... not saying it's a good idea =)

13:56 nathanmarz: ah... why didn't i think of that

13:56 what i'm doing is pretty hideous too

13:57 it would be cool to have this baked into the language

13:57 wkmanire: Howdy folks.

13:58 technomancy: nathanmarz: right, I think dynamicity knobs would make that work, since you would want it off by default for space reasons

13:58 nathanmarz: this approach does have some limitations though, not sure if rich et al would be ok with that

13:59 can you refresh my memory on the "dynamicity knobs"?

13:59 wkmanire: Just did my first bit of unit testing with Clojure.

13:59 Lein sure did make it easy.

13:59 technomancy: nathanmarz: 1.4 added the ability to elide metadata, allowing for more lightweight builds of Clojure (for android, etc)

14:00 nathanmarz: but the plan is to let it go the other way as well; for debug purposes you should be able to enable extra dynamicity that would be prohibitively expensive for production

14:00 nathanmarz: arguably the ability to disable locals clearing falls under that

14:00 nathanmarz: ah right

14:01 wkmanire: I think two more weeks of this and I'll be ready to start messing with noir.

14:01 :)

14:02 mmarczyk: dnolen: http://dev.clojure.org/jira/browse/CLJS-184

14:03 dnolen: sorry for the trouble, can't believe I missed that

14:06 the-kenny: Is there a timeframe when ClojureScript will get 1.4's reader literals?

14:08 dnolen: mmarczyk: great! thanks, applied to master.

14:09 mmarczyk: dnolen: thanks!

14:09 dnolen: the-kenny: whenever someone comes up with a patch we'll happily apply it.

14:10 the-kenny: dnolen: Let's see if I can find some time for this :)

14:11 dnolen: I was thinking about submitting a simple patch to add `int', `long' etc. to ClojureScript. Just to make porting of code easier

14:12 (not really "porting", cross-compilation)

14:14 dnolen: the-kenny: yes that simplify things - what do you think those fns should do?

14:15 arohner: I have (ref #{:a :b :c}). What's the cleanest way to disj N items from it, inside a transaction?

14:15 clojurebot: Titim gan éirí ort.

14:15 the-kenny: dnolen: That's what kept me from starting right then. I'm not really fluent with numerical stuff in javascript

14:15 int might just call .toFixed(), like integer? does for comparison

14:16 dnolen: the-kenny: toFixed converts to string

14:16 the-kenny: whoops

14:16 dnolen: the-kenny: it works for integer?

14:17 pjstadig: arohner: set/difference?

14:18 arohner: pjstadig: oh, interesting. I don't know which items to take, I just want the first N items, if there are at least N

14:18 the-kenny: dnolen: There are also some Closure classes regarding numbers. I think there's one for integer too

14:18 dnolen: the-kenny: maybe, http://stackoverflow.com/questions/596467/how-do-i-convert-a-float-to-an-int-in-javascript

14:19 the-kenny: dnolen: Yup, that's what I've done for my project. Replacing int with Math/floor

14:19 mmarczyk: arohner: (alter! r #(apply disj % (take n %))) ?

14:19 fdaoud: ibdknox: I just don't want to be backer #666.

14:19 bsteuber: ibdknox: maybe some kickstarter admin can help you update things

14:20 ibdknox: bsteuber: already sent mail

14:20 arohner: mmarczyk: pjstadig: thanks

14:20 RickInGA: bsteuber you are safe, 669 right now

14:22 dnolen: the-kenny: where do you see something in Closure?

14:22 TimMc: 673

14:23 the-kenny: dnolen: https://closure-library.googlecode.com/svn/docs/class_goog_math_Integer.html

14:23 Haven't had a look at it

14:23 dnolen: the-kenny: that yucky, a custom Integer type

14:23 that's

14:25 the-kenny: I think the approach specified by the StackOverflow answer is worth pursuing - especially the one that simulates truncate.

14:27 the-kenny: dnolen: Yeah, that looks good. Should `long' simply do the same as `int'?

14:28 TimMc: It does in Clojure, so why not? :-P

14:28 the-kenny: haha

14:28 dnolen: the-kenny: yep, feel free to open JIRA ticket and patch.

14:31 bsteuber: ibdknox: in case they can help you, you might want to make it even more regular - like adding beta to the 80$ option and have t-shirt-options everywhere

14:31 hope you can outsource all t-shirt-trouble to some printing company :)

14:32 dgrnbrg: I want to start using clojurescript--I know very, very little about javascript, the dom, and browsers, and nothing about ajax, but I'm an expert in clojure

14:32 where should I start?

14:37 nickik: ls

14:37 Im using lein2 for the first time. Does this work for other people?

14:37 http://paste.lisp.org/display/129027

14:39 technomancy: nickik: yeah, it works here. what are you seeing?

14:40 nickik: technomancy: nothing

14:40 dosnt output anything

14:40 technomancy: ok?

14:41 are you expecting to see something?

14:41 nickik: technomancy: where should the parsely jar be?

14:41 technomancy: nickik: ~/.m2/repository/net/cgrand/parsely

14:42 but you shouldn't care about that

14:42 if you're thinking about jar files then an abstraction has broken down somewhere

14:42 nickik: Yes normaly not but if it isnt there anywhere it cant possibly work, can it?

14:43 dnolen: dgrnbrg: there's not really a good starting place, here the mailing list are your best bet.

14:43 dgrnbrg: my one piece of advice - lein-cljsbuild

14:44 raek: nickik: are you looking for the lib/ directory? lein2 doesn't copy the jars there anymore

14:44 fdaoud: ibdknox: when did you post light table on kickstarter?

14:45 nickik: it seems to be working

14:45 ibdknox: fdaoud: yesterday around 4 I think

14:46 dgrnbrg: ibdknox: I am extremely excited about light table--not only have I funded it and promoted it to my friends and coworkers, but I'm trying to get my company to join on for $10k

14:46 ibdknox: dgrnbrg: thanks for the support! :)

14:46 clojurebot: Huh?

14:47 nickik: ibdknow: When you talk about supporting Clojure, do you mean Clojure or/and ClojureScript?

14:47 ibdknox: yeah, it'll be both

14:47 dgrnbrg: ibdknox: also, I don't know if you'll be hiring a team, but if you are, I've got experience in compiler tools design :)

14:47 ibdknox: The goal is to develop it in itself, so I'll need both :)

14:48 dgrnbrg: I'll definitely keep that in mind :) We'll have to see what happens though

14:48 fdaoud: ibdknox: although I know it is just a drop in the ocean, I've contributed to the project AND NOT to the t-shirt headache of shipping to Canada :)

14:48 ibdknox: haha

14:48 thanks :D

14:48 I ended up adding more of them, but I'm still a little worried about that being a time sink

14:48 TimMc: Submitted to /r/javascript, they should get excited aobut this.

14:48 nsxt_: Looking to finally get my hands dirty with my first application... anyone have experience with both slimv and vimclojure? I'm curious to know how they stack up.

14:49 dgrnbrg: nsxt_: I use vimclojure along with vimparedit, and together my environment is a dream (and pretty easy to set up)

14:50 nsxt_: dgrnbrg: thanks. I tried slimv a year ago when I was working with CL, and I remember the experience being a little frustrating.

14:51 aperiodic: i use slimv, and would say the same thing as dgrnbrg about my setup ;)

14:51 dgrnbrg: paredit mode is important (and easy to set up)

14:51 aperiodic: comes for free with slimv

14:51 nsxt_: paredit is pretty slick. dd and it preserves trailing braces... phew.

14:52 dgrnbrg: nsxt_: if you use lein, you can get ibdknox's lein-nailgun (or a new one that just came out called tarsier), and then you just need to install the vimclojure/ngclient yourself

14:53 nsxt_: dgrnbrg: great, thanks, will give it a shot.

14:54 dgrnbrg: if you need links/help, msg me

14:54 aperiodic: nsxt_: if you give slimv another shot, use sjl's fork that's tuned for clojure: https://bitbucket.org/sjl/slimv/overview

14:55 nsxt_: ah, mr. steve losh is behind that... :)

14:56 though i guess he just merged in vimclojure's files.

14:57 aperiodic: pretty much

15:01 beffbernard: I have a question of naming namespaces. Singular or plural?

15:04 emezeske: beffbernard: Have an example case? Offhand, I see far more singular namespace names, FWIW.

15:05 beffbernard: userevents.model vs. userevents.models

15:06 emezeske: Well, my personal convention is to name collections of things plurally, e.g. (get items 42) rather than (get item 42)

15:07 So if you view a namespace as a collection of things... plural? :)

15:07 beffbernard: emezeske: plural sounds better in my head me thinks

15:07 emezeske: Maybe there's some better wisdom about that, though, I don't know.

15:10 technomancy: IMO always using singular is more consistent

15:11 I don't think it makes sense to always use plural, and if you use both you'll end up in the tarpit of converting between the two

15:11 emezeske: technomancy: Are you referring to namespace names, or things in general?

15:11 technomancy: I guess naming in general

15:12 emezeske: I like being able to do (for [item items] ...), it seems very natural to me

15:12 technomancy: emezeske: oh yeah, naming collections that way makes sense

15:12 I'm thinking more about API endpoints

15:12 rather than locals

15:12 emezeske: Ah, yeah, consistency is much more important there

15:13 I love a good API, where I can guess the name of a function based on convention

15:14 I guess going all-singular would make that easier

15:15 technomancy: I guess I was thinking more about rest APIs and the weirdness around auto-pluralization that rails uses

15:16 emezeske: Oh, god, that

15:17 "Is it /indices or /indexes ?"

15:17 technomancy: "/boxen"

15:18 emezeske: http://www.futilitycloset.com/2012/04/07/the-arbitrary-english-language/

15:40 zzach: Using (clj-logging-config.log4j/set-logger! ...) (from github.com/malcolmsparks/clj-logging-config), is it possible to configure it in a manner that all Java exception messages go to a file (like using a log4j.properties file containing the lines log4j.rootLogger=DEBUG, A1 and log4j.appender.A1=org.apache.log4j.FileAppender ) and not to the console?

15:44 raek: zzach: if it turns out that clj-logging-config does not provide a way you can use java.lang.Thread.setDefaultUncaughtExceptionHandler

15:52 sjl: nsxt_: aperiodic: It's mostly just a merge of Vimclojure files, but I did write custom folding for .clj files that works pretty well

15:53 nsxt_: aperiodic: and there are some other tweaks too, like adding some of the macros from common libraries to the syntax file (like defsynth from overtone, defpage from noir, etc)

15:55 nsxt_: sjl: off-topic but thank you so much for gundo.

15:55 sjl: nsxt_: hah, no problem

16:04 jamii: Is this a bug?

16:04 user=> (match [(list 1 2)] [([& _] :seq)] :matched)

16:04 nil

16:04 user=> (match [(list 1 2)] [([_ & _] :seq)] :matched)

16:04 :matched

16:05 dnolen: jamii: core.match has lots of bugs and not enough patches

16:05 jamii: seq pattern matching going to way of the dodo, but I've been busy with other things.

16:06 jamii: dnolen: ok

16:08 dnolen: jamii: similar bugs exist for map patterns & vector patterns & AOT edge cases. they will be addressed one day - sooner if I get patches.

16:08 jamii: dnolen: I may do that once this bloom stuff is working

16:08 dnolen: I do miss proper pattern matching

16:08 dnolen: jamii: that would be awesome and much appreciated.

16:09 jamii: dnolen: I already have a few hacks around stuff https://github.com/jamii/mist/blob/master/src/mist/strict.clj

16:10 dnolen: I would like to support matching on types/records

16:31 the-kenny: Is the process of submitting a patch to clojurescript documented somewhere?

16:42 dnolen: Well, ClojureScript already has `fix' which does exactly what `int' should do. fix is private.

16:42 carllerche: I started using jvm7 and now when I run lein javac i get "warning: [options] bootstrap class path not set in conjunction with -source 1.5"

16:43 gfredericks: int would tempt you into thinking you're using an integer :/

16:44 the-kenny: gfredericks: Not having `int' and `long

16:44 whoops

16:44 is very annoying when deadling with code written for both targets

16:44 *dealing

16:44 gfredericks: should code written for both targets be doing low-level numeric stuff?

16:45 the-kenny: I used `int' mostly for dropping decimal places

16:46 gfredericks: yeah; I'm sure it's fine; I'm just pickier than most about being sloppy with numerics

16:46 the whole JS platform makes me cringe for that reason :/

16:47 I guess dropping decimal places is safe; int is just a misleading name for that action; but like you said shared code and such

16:47 boo js

16:49 yoklov: not having integers isn't that bad

16:49 unless they're huge i never run into an issue with it

16:49 technomancy: depends what you're doing

16:49 gfredericks: I've used JS bigint libraries a number of times

16:49 pre-cljs it's ugly as a pile of poo

16:50 technomancy: currency calculations done with floats are a huge source of bugs from people who don't know any better

16:50 gfredericks: technomancy: yeah that too

16:50 we've got a project where I would've been much more comfortable with rationals

16:50 heck with rationals you can stop thinking in cents as well

16:50 yoklov: yeah, if you're dealing with money you definitely need non-js numerics

16:51 * technomancy recalls "hey guys, floats aren't accurate; is this a bug in Ruby" coming up nearly as often as "hey guys, what if we made Clojure work *without* parens" back when I was in #ruby-lang

16:51 bradwright: gfredericks: not to entirely pimp our own wares, but we wrote a library for dealing with arbitrary precision integers in JS

16:51 https://github.com/smarkets/decnum

16:51 It stores them as integers internally

16:51 Precisely because JS numbers suck

16:51 gfredericks: bradwright: gclosure has bigints; at this point I'd rather just get cljs bootstrapped than look at any js libs

16:51 hiredman: s/numbers//

16:51 bradwright: heh

16:52 gfredericks: hiredman: ?

16:52 kurtharriger: how does the require refer thing work in clojure 1.4? I thought it was basically same as use :only

16:52 hiredman: js is a horrible language

16:52 kurtharriger: for example (require '[clojure.repl :refer [doc]]) doc remains undefined

16:52 gfredericks: I'll drink to that

16:52 kurtharriger: am I not using it correctly?

16:52 TimMc: Better than PHP!

16:53 ,(require '[clojure.repl :refer [doc]])

16:53 clojurebot: nil

16:53 TimMc: ,(doc doc)

16:53 clojurebot: "([name]); Prints documentation for a var or special form given its name"

16:53 kurtharriger: oh wait my slime connection is still 1.3

16:53 hmm

16:53 gfredericks: TimMc: at least PHP has a fuzzier monopoly

16:53 TimMc: Oh, but it probably already has doc...

16:55 jaen: TimMc: nothing is worse than PHP; I'm reading that PHP bashing post right now ; d

16:55 but I don't think that JS is THAT bad

16:55 kurtharriger: doh, I thought I had resolved this but I guess not leiningen repl is starting 1.3 not 1.4 even though my project file is updated

16:56 aaelony: Does anyone have experience with Docjure to read Excel files? Running into a strange error. Please see https://refheap.com/paste/2221. Help appreciated..

16:59 rplevy: aaelony: this is my first time hearing about docjure so I haven't tried it, but I love the name. It's like clojure, except its a library for reading docs, pretty clever.

16:59 ;)

17:00 aaelony: rplevy: it's pretty cool. Found my mistake as well. Using ->> works but I had typed ->

17:00 bradwright: So is the Stuart Holloway book any good? Or is there another book I should read to learn Clojure (or perhaps something else that isn't a book)?

17:02 devinus: are there any other readers than #uuid and #inst yet?

17:06 S11001001: rplevy is a big liar

17:06 kovasb_: bradwright: that was my first, I liked it. Joy Of Clojure is a bit newer and more in depth. All the books tend to be a bit behind the latest ecosystem developments

17:06 devinus: adding your own should be relatively easy

17:06 rplevy: S11001001: lol

17:06 devinus: kovasb_: yeah, i was just wondering if there were any more builtin ones

17:07 #uri would be pretty hawt

17:07 kovasb_: devinus: i think that's it for right now. Expect more later for sure

17:07 bradwright: kovasb_: I heard Joy of Clojure wasn't really for beginners though

17:07 devinus: bradwright: it's not, but it's a must have

17:07 bradwright: kovasb_: for background, I'm a good Python/JS programmer, but not really done much functional stuff

17:08 devinus: i recommend Programming Clojure

17:08 then maybe Practical Clojure if you're not comfortable yet

17:08 raek: bradwright: http://stackoverflow.com/questions/2578837/comparing-clojure-books

17:08 brehaut: bradwright: clojurebook.com is aimed squarely at java/py/ruby programmers wanting to get into clojure

17:08 kovasb_: bradwright: depends on definition of "beginner".. if you understand programming languages well it might be better

17:08 rplevy: how about the O'Reilley cemerick book

17:08 should be out any day now

17:09 gfredericks: is that the second O'Reilly clojure book?

17:09 rplevy: nope the first

17:09 gfredericks: hrm

17:09 cemerick: gfredericks: There can be only one. :-) http://clojurebook.com

17:09 bradwright: They'd need a new animal :)

17:09 raek: bradwright: also, there is a second edition of Programming Clojure nowadays (you might find reviews that tell you that the first version is outdated)

17:10 gfredericks: so in the original cljs talk that rich gave, when he mentioned that the Clojure book and Closure book both have birds on the cover, that was cemerick's in-progress book, or a made-up book?

17:11 nDuff: bradwright: I'm +1 on the Joy of Clojure suggestion; I don't think it's as not-for-beginners as some sources may suggest.

17:11 bradwright: ...but even if that _were_ true, it's good to get an overview of the high-level practices and concepts up-front, even if you end up using another resource for intermediate learning.

17:12 * nDuff strongly supports getting the "why" of things early.

17:13 bradwright: Cool thanks for the detailed feedback everyone

17:14 kovasb_: or you can just read the clojure.core source :)

17:14 gfredericks: oh but that's bad clojure most of the time

17:14 bradwright: Not quite there yet… hence the book recommendations

17:14 gfredericks: or non-idiomatic rather

17:19 dnolen: the-kenny: yeah, int and long should probably just call fix

17:24 yoklov: did you get my email about giving PHMs a try in your projects if you get a chance?

17:24 yoklov: yeah, i've been trying to make it work, actually

17:24 dnolen: yoklov: problems?

17:25 yoklov: i can't seem to get lein-checkout to work with it

17:25 its not using the updated cljs files

17:25 dnolen: yoklov: you need to set both classpaths I think, one to clj one to cljs

17:25 yoklov: oh, okay

17:26 * dnolen is thinking about doing synonym.dartlang.org/ for himera http://himera.herokuapp.com/index.html

17:29 yoklov: heh, that'd be cool. maybe lower the barrier of entry for javascript coders

17:29 kovasb_: dnolen: finally got my himera.next thing working this week

17:30 dnolen: yoklov: yeah, and pretty easy to do

17:30 kovasb_: nice, what does it do differently

17:30 ?

17:31 kovasb_: dnolen: the returned values can have arbitrary rendering rules

17:31 dnolen: kovasb_: ah nice!

17:31 kovasb_: based on the meta data

17:31 devinus: oh man

17:31 kovasb_: or tagged literals

17:31 devinus: a #currency reader would be hawt

17:31 kovasb_: yeah

17:31 devinus: #currency "45$US"

17:32 kovasb_: also you can save and re-enter the "sessions"

17:32 since the session itself is a datastructure

17:32 technomancy: I wonder if you could do #$ 0.45

17:32 probably not as the inaccuracy is introduced before your custom reader gets it

17:32 kovasb_: (well, the file loading uploading part i need to implement next)

17:33 technomancy: #€ 1.23, #£ 92.13

17:33 kovasb_: devinus: you need to namespace all your custom tagged literals unfortunately

17:33 devinus: technomancy: why do that when you can just use the ISO codes from java.util.currency ?

17:33 technomancy: it's too bad the M suffix makes people think of millions

17:33 kovasb_: i wish there was a way to "use" them so u can just use short names

17:34 technomancy: devinus: because I heart unicode so much!

17:34 devinus: kovasb_: oh wow that sucks :(

17:34 kovasb_: devinus: yeah, it makes using them directly in code a pain

17:34 devinus: so i'd have to do #devinshappyfuntimereaders/currency ? :(

17:34 kovasb_: though u can have really short namespaces

17:34 I'm using 2 or 3 letter ones

17:34 devinus: i plan to make a little package

17:35 with a bunch of these sweet readers

17:35 kovasb_: or, you can have helper functions which then return the longer namespace things

17:35 devinus: currency, URI's....

17:35 gotta think of some more

17:35 basically look at Rebol for inspiration :)

17:35 kovasb_: widgets :)

17:35 graphics :)

17:36 technomancy: I wonder if any languages have actual URI literal literals

17:36 devinus: XML literals?

17:36 #tag "<img></img>"

17:36 hiredman: :(

17:37 kovasb_: i definitely want tagged literals for various programming langauges

17:37 including the clojure-based ones, but also others

17:37 ambroff: oin #riemann

17:38 kovasb_: #polyglot/javascript "foo.bar()" etc

17:38 cemerick: reader literals have potential, but XML/URI/etc literals are frightening notions.

17:38 technomancy: cemerick: I think Scala has proven that XML literals were a mistake, but why do you say the same about URIs?

17:38 kovasb_: its not totally clear what an xml literal would evaluate to

17:38 cemerick: technomancy: anything worth its salt uses cents/pence/etc, so currency with integers would be great.

17:40 technomancy: cemerick: there's no unicode char for pence though =)

17:41 cemerick: technomancy: URIs are incredibly complicated. AFAICT, no one understands them fully.

17:41 devinus: xpath reader!!!

17:41 technomancy: cemerick: no one understands dates fully, but that didn't stop them =(

17:41 cemerick: technomancy: #p, then?

17:46 technomancy: I've heard that Scala's XML literals have primarily invoked feelings of regret, but what are the specific complaints about them?

17:47 zii-prime: is there a better way to say (every? identity coll) than that?

17:47 technomancy: zii-prime: there's an open ticket for letting you just say (every? coll)

17:48 zii-prime: technomancy: oh hey. ...um, where can I find those?

17:48 S11001001: zii-prime: where did coll come from?

17:48 technomancy: zii-prime: somewhere in jira; I don't know the number off the top of my head and I try to avoid jira if I can

17:49 zii-prime: S11001001: ... it's an example

17:50 S11001001: zii-prime: it depends, because sometimes you can get away with calling keep instead of map

17:50 (keep f xs) is like (map f xs) but drops nils

17:54 nDuff: technomancy: XQuery has XML literals, and they work well there

17:54 zii-prime: S11001001: oh. the fn is (defn +'' [& vecs] ‹(every? identity vecs) and (vec (apply map + vecs))›); keep won't help; I'm just checking returning nil if any arg is nil

17:55 S11001001: I see

17:55 * nDuff actually quite likes XQuery; the major thing it's missing is an equivalent to Clojure's do* -- it can sometimes be hard to do things for their side effects alone.

18:00 seancorfield: world singles is now running on clojure 1.4.0 in production - yay!

18:01 technomancy: good first step, but we shouldn't rest until all the :use calls are excised!

18:13 austinh: Do most people install Slime via leiningen/swank-clojure?

18:18 gfredericks: technomancy: is :use officially deprecated now?

18:19 s/technomancy: // ; no reason to bother him particularly about that

18:19 technomancy: gfredericks: no

18:19 Raynes: Does it matter?

18:19 gfredericks: Raynes: I expect so or else we should never officially deprecate anything

18:20 technomancy: https://mobile.twitter.com/janeonacalliope/status/15465958310

18:31 cemerick: technomancy: Stuart and McKellen in Waiting for Godot? Whoa.

19:06 seancorfield: technomancy: we're already working on removing :use from our code and using :require :refer as appropriate - definitely allowing some code cleanup!

19:06 technomancy: (mostly kidding)

19:08 aaelony: technomancy: what's the argument against :use?

19:09 Raynes: That it is unnecessary now, mostly.

19:09 aaelony: I see. Is there a link to read up on ?

19:09 Raynes: The argument for making it unnecessary was "Why do we have both use and require? Why can't require just do what use does too?"

19:09 aaelony: nice :)

19:09 technomancy: it's confusing for newbies to have more concepts to learn

19:10 unnecessary complexity

19:10 plus it has bad defaults (without :only)

19:10 aaelony: cool

19:10 so s/:use/:require/g ?

19:10 technomancy: clojurebot: ns macro?

19:10 clojurebot: Titim gan éirí ort.

19:10 technomancy: clojurebot: the ns macro?

19:10 clojurebot: Gabh mo leithscéal?

19:11 technomancy: clojurebot: ns?

19:11 clojurebot: ns is unfortunately more complicated than it needs to be, but http://blog.8thlight.com/articles/2010/12/6/clojure-libs-and-namespaces-require-use-import-and-ns may be helpful.

19:11 technomancy: should get trptcolin to update that re: 1.4

19:52 austinh: Anyone know why slime-selector won't take me to the REPL, unless the REPL is already visible?

19:53 Says, "slime-selector: Symbol's value as variable is void: slime-selector-other-window"

19:59 amalloy: just use C-c C-z?

20:00 austinh: amalloy: What is C-c C-z bound to in your setup?

20:01 amalloy: slime-switch-to-output-buffer

20:01 austinh: amalloy: Thanks. That appears to be bound in my clojure buffers, but not globally.

20:02 amalloy: yeah, i think clojure-mode binds it in its hook

20:02 austinh: I'm accustomed to using 'C-c s r', but that'll work.

20:07 meet_me_at_tarja: hey y'all

20:11 has anyone one worked on/played with clojure 1.4 yet?

20:11 i just saw it released today on hacker news

20:12 Raynes: It actually released yesterday or the day before.

20:12 But yeah, lots of people are using it.

20:13 It's mostly (totally?) compatible with 1.3, so anybody on that can pretty much just change version numbers.

20:13 trilisp: I don't know but when you clone the git repo at the repl says that is version 1.5-SNAPSHOT

20:13 meet_me_at_tarja: nice, I'm pretty psyched for mapv

20:13 Raynes: Yeah, because that's the git repo and not a release.

20:14 meet_me_at_tarja: Why?

20:14 trilisp: I'm a newbie with clojure

20:14 meet_me_at_tarja: why they blue hair raynes?

20:14 seancorfield: meet_me_at_tarja: yeah, we have mapv / filterv / reduce-kv in production as of today

20:14 trilisp: welcome to clojure!

20:14 meet_me_at_tarja: @sean, i'm really excited

20:14 trilisp: thank you guys! and gals!

20:14 Raynes: I'm not blue haired at the moment.

20:14 seancorfield: meet_me_at_tarja: so, yes, we have clojure 1.4 in production

20:14 meet_me_at_tarja: i've needed those tools for some algorithms

20:15 seancorfield: we've been testing against 1.4 builds for ages so it was an easy migration for us

20:15 Raynes: seancorfield: What are you using mapv and friends for?

20:15 technomancy: I'm surprised that mapv was considered more useful than map-map

20:16 seancorfield: once it was released a few days back, we started cleaning up ns macros and replacing (vec (map ...)) with (mapv ...)

20:16 and (vec (filter ...)) with (filterv ...)

20:16 Raynes: I guess I've just never seen code where someone did that.

20:16 seancorfield: only found a couple of places where reduce-kv helped up (where we had reduce over a map)

20:17 technomancy: seems like it could be used instead of doall+map too

20:17 which is not necessarily a good thing

20:17 Raynes: technomancy: Could and will.

20:18 meet_me_at_tarja: oh, so mapv is just (vec (map ...)?

20:18 Raynes: Not really.

20:18 Oh.

20:18 I guess it is.

20:18 I figured the source code was more complex than it actually is.

20:18 meet_me_at_tarja: i guess i need to see the source code, but thats ulitmately two linear scans

20:19 and wouldn't do anything to lower my time complexity constants

20:19 Raynes: It isn't calling vec on it.

20:19 It is reducing the collection into a transient vector.

20:19 seancorfield: mapv is the more efficicent way to run map over a sequence and get back a vector

20:20 heh, looking at the source i'm not even sure it is more efficicent

20:21 with a single coll, i guess it is?

20:22 mdeboard: just got cemerick's book hot off the presses

20:22 cemerick: mdeboard: enjoy! :-D

20:22 Raynes: If you call mapv on more than one collection, it just does (into [] (map ...))

20:22 trilisp: I've been following an excelent tutorial creating a blog with clojure, I want to incorporate clojurescript, any sugestion of the best way to do it? the tutorial uses enlive

20:24 mdeboard: cemerick: Oh I'm not going to read it, I'm just putting it on my bookshelf to fool everyone into thinking I know what I'm talking about

20:24 :P

20:26 meet_me_at_tarja: whether or not I use a mapv, filterv, etc, will have to come down to the results of running a jvisualvm test

20:27 seancorfield: got my copy of cemerick book on the 6th... ebooks rock :)

20:28 Raynes: I got mine before cemerick even thought about writing it. Reviewers get hardcore swag.

20:28 seancorfield: trilisp: not sure if it'll help you but i blogged a couple of examples of using clojurescript in simple situations: http://corfield.org/search/clojurescript

20:29 admittedly those links use FW/1 which is a very simple MVC web framework built on Enlive and Ring

20:29 but the basics of how to get clojurescript built should port over to whatever you're working on

20:34 _ato: xb

20:35 trilisp: seancorfield: thank you very much I will check it out right away

20:38 yoklov: ping ibdknox: how can I make jayq with advanced optimizations? (it worked with noir-cljs, doesn't work without)

20:38 ibdknox: :externs ["externs/jquery.js"] in compiler options

20:38 yoklov: ah

20:40 trilisp: I plan to extend the tutorial improving the html and adding clojurescript and cssgen

20:40 RickInGA: If I am writing instructions for general consumption, should I tell people to install lein 1.7 or 2.0?

20:41 technomancy: RickInGA: general consumption of your library?

20:41 RickInGA: technomancy: I am trying to put together some getting started stuff for clojurescript

20:41 but rule 1 for all clojure documentation should be install lein!

20:42 technomancy: hm; I don't know enough about cljs to say

20:42 but it's pretty fast-changing afaict, so lein2 is probably fine for that

20:43 you don't have lots of existing compatibility concerns that might keep newbies on lein1 for general JVM clojure stuff

20:43 RickInGA: ah, ok

20:44 technomancy: (this is coming from someone who hasn't used clojurescript)

20:44 RickInGA: so brand new = lein 2, using clj but not cljs will probably be on 1.7

20:45 I don't know much about it myself, but I am trying to leave a trail behind as I find my way

20:50 technomancy: consider contributing to official documentation where possible

20:50 so that mistakes and out-of-date info can be fixed in the future without your intervention

20:51 RickInGA: technomancy: will do. I am going to put some thoughts together in an organized fashion, and then see if the cljs people want it, or if I can just use it as a reference to suggest enhancements to what ever format they would prefer

20:52 austinh: So, as somebody starting out on Clojure today, should I install Leiningen 2?

20:53 technomancy: austinh: honestly I'm not sure in general. it's more internally consistent and powerful, but there are still plugins and documentation out there that haven't been updated yet

20:53 depends on what you're doing and how much patience you have for tracking down out-of-date info

20:53 austinh: technomancy: Ok, that makes sense.

20:53 RickInGA: the clojure community has some remarkable people doing amazing things, I am going to see what I can do to make theri work understandable to people closer to my level

20:54 technomancy: austinh: all the major plugins have been upgraded, but I don't have a good feel for how many fringe plugins are still incompatible

20:55 austinh: technomancy: I'll give it a go.

20:55 technomancy: austinh: if you do run into issues, I'm all ears

21:05 yoklov: RickInGA, awesome, theres nowhere near enough information on it

21:06 i've been figuring it out mostly with guessing and stealing from working examples haha

21:09 RickInGA: yoklov: yeah, I think a lof of us are in the same boat.

21:10 I figure if I can come up with a systematic way to learn for myself, it will be useful for others too

21:12 yoklov: I feel like I've gotten a pretty decent handle on how to do what I need to, but that basically amounts to creating new projects, compiling, opening repls, and upgrading to the next most bleeding-edge version of cljs

21:12 i don't do any client-server stuff

21:12 and what i know how to do is very ad-hoc

21:13 RickInGA: I have played around with the html5 canvas, drawing rectangles, showing text and showing images, noting meaningful, but good for documenting :)

21:14 yoklov: haha, I've been playing with the canvas too

21:14 lots of fun in cljs

21:15 RickInGA: yeah, if you can figure out when you are dealing with html, when with js and when with cljs. that is the hardest part

21:15 yoklov: hm, I don't know if I see a big distinction between javascript-world and html-world but that might just be because both are familiar

21:17 both are annoying right now, to be honest. i feel like clojure's interop idioms don't apply as cleanly to javascript where you need to build/mutate objects for various apis

21:18 RickInGA: have you done anythin with V8 or node from cljs?

21:19 yoklov: nope, considered using node via cljs to run the script I use to serve my dev. directory locally, but gave up and just used js when it seemed more difficult than it was worse

21:19 worth*

21:22 as far as I can tell you can't even really get a node repl yet

21:23 so I think that that's especially bleeding edge

21:26 * austinh heads to the PDX clojure meetup

22:18 xcv: Clojurescript question: has a best-practice consensus emerged about how to do the MVC (e.g. Backbone.js) pattern in a clojurescript-idiomatic way? I ask because my company is making a web app with a few 500+ line js MVC systems and am wondering how I would go about reimplementing them in clojurescript sometime in the future.

22:21 That is, the Backbone.js pattern is quite stateful and I expect that a more functional approach would be taken by clojurians, and was wondering whether there were some good examples of a thoughtfully-implemented non-trivial clojurescript system out there that you know of.

22:26 yoklov: afaik (though someone else might know of one) there's nothing really like that out there. clojurescript's pretty young

22:33 xcv: will be interesting to see how those large-scale patterns turn out

22:36 seancorfield: you might want to look at clojurescript one and see how it manages things (although it's a bit impenetrable if you ask me)

22:36 but then i might find backbone impenetrable too

22:36 cmajor7: is there an updated clojure read beyond "http://java.ociweb.com/mark/clojure/article.html" besides the paper books? thx

22:40 seancorfield: cmajor7: is there some specific area you're interested in?

22:41 cmajor7: seancorfield: I really enjoyed Mark's tutorial, but it is a bit outdated and wanted to have another resource to go over

22:43 clojure API docs are solid, but it is not very helpful just to go one by one.. without a supporting skeleton (e.g. such as Mark's tutorial)

22:46 yoklov: cmajor7, your best bet is probably a paper book

22:46 e.g. http://www.clojurebook.com/

22:47 it's a bummer that tutorial is out of date though

22:47 cemerick: cmajor7: It sounds like you might find this helpful: http://clojureatlas.com (disclaimer: I'm the creator)

22:48 FYI, a major refresh of that is going out tomorrow or Friday (to include Clojure 1.3 + 1.4, various other improvements, etc)

22:54 cmajor7: yoklov: thx for the link. I looked at http://stackoverflow.com/questions/2578837/comparing-clojure-books and am thinking on getting: http://pragprog.com/book/shcloj2/programming-clojure

22:55 cemerick: very cool, thx. is there a way to see some examples and "why would I use X", or is it coming?

22:56 dnolen: yoklov: thx for the PHM report

22:57 yoklov: out of curiosity, why was 200ms the goal?

22:57 cemerick: cmajor7: The "why would I use X" is generally answered by the concepts a fn is related to.

22:58 Examples are tough. There's clojuredocs.org, though that's a little spotty (and not particularly in line with the hand-curated thing I'm trying to go for).

22:58 yoklov: dnolen: yeah, it was

22:59 devn: clojurebook...like facebook, but for clojurians

22:59 yoklov: dnolen: it's pretty a pretty hopeless goal though, given that the code isn't really optimized at all

22:59 dnolen: yoklov: how long was it taking before PHM?

23:00 yoklov: dnolen: well over a second, i can give you a better number in a sec

23:00 gfredericks: has "clojerks" been suggested as a name for clojure people?

23:01 dnolen: yoklov: were the maps small, but lots of updates?

23:01 hiredman: gfredericks: the name is taken

23:01 gfredericks: by the portland user group?

23:02 yoklov: dnolen: over a few hundred elements

23:02 dnolen: yoklov: oh, ok pretty big actually.

23:02 hiredman: the usage I am thinking of predates the portland user group

23:02 gfredericks: then I am too young and/or naive

23:03 hiredman: oh no, it is not a generally known group, I don't think I should talk about it

23:03 yoklov: dnolen: yeah, they were sets of [xpos ypos]

23:05 cemerick: devn: that's creepy enough to be interesting :-P

23:05 dnolen: yoklov: gotcha.

23:07 yoklov: dnolen: as I said, its unoptimized code. before the change an iteration took about 1-2 seconds

23:07 now about 600ms

23:08 dnolen: yoklov: I'm not sure if hash maps in CLJS can ever reach plain js objects

23:08 yoklov: dnolen: yeah, I wouldn't expect them to

23:08 dnolen: yoklov: one big issue I think is lack of hashCode caching for strings.

23:09 yoklov: unfortunate since PHMs are so fast in CLJS

23:09 er I mean CLJ

23:09 yoklov: dnolen: interesting, hadn't considered the cost of the hash function

23:10 dnolen: yoklov: hashCode caching could speed up collection perf of CLJS objects quite a bit, but not native ones.

23:12 mmarczyk: do you think you could do some benchmarking of the various map implementations with a smaller set of keys? say 8 & 4?

23:13 it also makes me wonder if representing keywords and symbols as strings was such a hot idea ...

23:13 devn: cmajor7: i know this maybe isn't so helpful, but FWIW I own a copy of every single clojure book to date. i havent read all of programming clojure (prag) or clojure programming (oreilly) yet, but they all seem to sort of complement eachother nicely

23:15 yoklov: dnolen: yeah, and the sets in hex have around 400 elements

23:15 dnolen: yoklov: w/ PHM does profiling point out any hotspots?

23:18 yoklov: dnolen: hold on, i'll let you know. Gonna be tough to say for sure without doing advanced compilation

23:18 and if i did i wouldn't be able to tell what was being slow

23:19 dnolen: yoklov: true but should still be able to get a likely ballpark with simple optimizations.

23:19 yoklov: oh, make sure to set :static-fns true in your compilation options, I added that.

23:20 yoklov: oh

23:20 acheng: is it true that clojure.data.xml should not be used yet since build.clojure.org is still at JDK 1.5 ?

23:20 (hello by the way :-P)

23:20 cmajor7: devn: seems that programming clojure (prag => 2nd edition) is the "freshest" one, and I am sure Stuart and Aaron won't disappoint. I usually don't read tech books cover to cover, but since there is no real one place to turn, besides Mark's article, to get a deep clojure feel, I think this might be one of the few I would finish..

23:21 yoklov: dnolen: what does that do? something having to do with the closure compiler?

23:21 dnolen: yoklov: no, it enables the direct / direct arity invocations

23:21 acheng: (some context: I just used clojure.data.xml to read in something and lost two attributes: xmlns:i and xmlns ... but they seem important to some other system of mine)

23:22 yoklov: dnolen: oh, okay, that makes sense

23:22 dnolen: yoklov: I decided it was a bad thing to have those on by default - messes w/ interactive development.

23:22 devn: cmajor7: what's your background programming-wise?

23:23 dnolen: yoklov: btw, I showed of your Argh! at the NYC Clojure Meetup, people were impressed!

23:25 cmajor7: devn: usual suspects java, groovy, scala, c, erlang and friends

23:25 Lajla: dnolen, why do you hate me, my most prodigal son?

23:25 yoklov: dnolen: that's awesome!

23:25 dnolen: yoklov: well it's very cool demo - it's nice to see the CLJS produces good code for your render loop.

23:25 devn: cmajor7: i didnt read the link you posted above comparing books, but based on what you just told me, the joy of clojure is a fantastic companion to any of the books that are out there

23:26 drewr: dnolen: https://github.com/drewr/clojurescript/commit/c0ac588ca2245562acb11065128e0079b771ddfc

23:26 acheng: oh. found a patch to clojure.data.xml by Carlo Sciolla on March 27, 2012 for adding support for namespaces both ways (parse/emit).

23:27 devn: cmajor7: the joy of clojure is a really wonderful read and so much of it is generally applicable that you'll get a lot out of it I think

23:27 dnolen: drewr: cool, but I'm not sure what that error is about at all. master is stable.

23:28 yoklov: dnolen: i'm glad! though it's not particularly pretty code, too many variables to pass around, i end up having the choice between set!ing a bunch of vars at the beginning and having an enormous imperative-style 'render' function

23:28 but it's nice that performant code is totally within reach

23:28 cmajor7: devn: "The Joy of Clojure", noted, thx

23:29 devn: cmajor7: np

23:29 dnolen: yoklov: yes, it's very exciting - and certainly important to me.

23:30 yoklov: I think it's important that anything you would do in JS can be done in CLJS

23:30 yoklov: dnolen: obviously, otherwise it would be nearly impossible to attract anyone to cljs

23:30 dnolen: yoklov: plus it's eating your own dogfood, if we produce slow code - we can't implement better data structures w/o leaving the language.

23:30 yoklov: agreed.

23:37 yoklov: dnolen: nothing stands out at me regarding hot spots for phm, actually now that I look at it, it seems that the seqs are really what's slowing down this code more than anything else.

23:37 dnolen: yoklov: k good to know!

23:37 yoklov: chunked seqs not too far off I think.

23:39 yoklov: dnolen: that's awesome, it'll be nice when idiomatic clj code can be somewhat fast cljs code

23:41 dnolen: yoklov: I don't we'll ever really compete with loop/recur + arrays for raw perf - but we coudl definitely do a lot better.

23:43 yoklov: it's a space I find pretty interesting. How much can we contain the absolutely perf critical portions of our application.

23:43 yoklov: dnolen: it definitely has been something i've been thinking about more lately

23:44 where i can use maps/sets/seqs vs where i need arrays, haha

23:45 dnolen: yoklov: there's too little writing about this stuff - would be fun to read some posts about it.

23:45 yoklov: dnolen: and in my experience most web applications don't need that much speed

23:46 dnolen: yoklov: especially about languages that give you trap doors like CLJ/CLJS

23:47 yoklov: yeah irrelevant for most web apps - that why I enjoy reading about FP & Games. That's a hard problem.

23:47 yoklov: dnolen: right, not very many other languages give you that flexability. often you just have the implicit option of "interop with c"

23:47 dnolen: fp and games is quite hard, especially in terms of performance

23:48 technomancy: replaca: is it intentional that pprint doesn't honor *flush-on-newline*?

23:48 dnolen: yoklov: definitely - tho I've been curious about someone doing a very fast matrix math DSL for LISP

23:49 yoklov: macros, no function calls.

23:49 yoklov: dnolen: thats very interesting

23:50 dnolen: macros for performance always seemed sort of obvious, but then when it comes to actually doing it, much more difficult

23:50 dnolen: yoklov: I feel like this is what Jim Blinn was talking about with C++ template programming for graphics.

23:52 yoklov: dnolen: its definitely terrifying territory

23:53 dnolen: yoklov: haha

23:54 yoklov: could be very cool tho - only a hunch - but you could get fast code you just would never write in JS.

23:54 yoklov: dnolen: though, that actually gives me some good ideas of how i might be able to make argh's rendering code a bit cleaner

23:54 dnolen: and it could still be functional.

23:55 echo-area: Is it possible to write an iteration as fast as Java equivalent?

23:56 If possible, how?

23:56 dnolen: echo-area: loop/recur

23:56 yoklov: dnolen: hm, is definitely something worth thinking about, and would be interesting in terms of things cljs can do that js can't

23:56 dnolen: yoklov: if it could be demonstrated, even a simple version it would be a very neat blog post.

23:56 echo-area: dnolen: But that's almost 5 times as slow as Java counterpart

23:56 dnolen: echo-area: it is not.

23:57 echo-area: loop/recur generates the same bytecode as a for loop

23:59 echo-area: if you're seeing a perf hit, you may be operating on boxed numbers.

23:59 echo-area: dnolen: A moment, I'm preparing to show you what I did

Logging service provided by n01se.net