2010-07-31
| 00:11 | cpfr | hey how could I extend a java class in clojure |
| 00:21 | technomancy | Drakeson: sure; go ahead and experiment in a branch |
| 00:21 | technomancy | Drakeson: how come though? what's the advantage? |
| 00:22 | technomancy | dsantiago: you can do it with leiningen checkout dependencies |
| 00:22 | technomancy | but it's awkward to do with swank by itself |
| 00:29 | dsantiago | I mean, does that let you maintain two separate repls in slime at the same time? |
| 00:31 | technomancy | oh, connecting to two separate swank servers at once? |
| 00:31 | technomancy | I haven't tried that. it may be possible. |
| 00:31 | dsantiago | When I try it gets rid of the first repl, as far as I can tell. |
| 00:32 | technomancy | I always just keep two separate Emacs instances up |
| 00:33 | dsantiago | Ah, I don't think I can do that on Mac. |
| 00:33 | dsantiago | Thanks. |
| 00:33 | slyrus | you can already do that on two seperate ports, no? |
| 00:33 | technomancy | you can, but OS X makes it hard. |
| 00:33 | technomancy | at least for GUI instances |
| 00:34 | dsantiago | Yeah, I gotta use Aquamacs to make it tolerable. |
| 00:34 | technomancy | eep. |
| 00:37 | leifw | has anyone gotten a successful emacs/slime/nailgun/clojure setup working? |
| 00:37 | leifw | assuming I figure out my regular emacs/slime/clojure problems, it would be nice to stick nailgun in there too |
| 00:37 | technomancy | leifw: what does nailgun get you? |
| 00:37 | leifw | not like I'm starting and stopping slime all the time, but it would be neat I guess |
| 00:37 | technomancy | you mean being able to use a single instance from either Emacs or the CLI? |
| 00:37 | leifw | pretty much |
| 00:38 | technomancy | I think a socket-repl would be an easier way to attain that |
| 00:38 | leifw | interesting |
| 00:38 | technomancy | there's a socket-repl in contrib that's easy to use; just start that and telnet to it |
| 00:38 | fualo | dsantiago: Aquamacs makes things hard... |
| 00:38 | leifw | :o |
| 00:39 | technomancy | leiningen 1.3 may allow you to enter multiple tasks at the command line with something like lein clean, jar, test leiningen.test-core, repl |
| 00:39 | technomancy | any objections to using commas as a task separator? |
| 00:40 | dsantiago | Yeah, but what're ya gonna do? |
| 00:41 | fualo | are there any folks that aim to make other implementations of clojure? |
| 00:43 | technomancy | fualo: there's clojureCLR; I think everyone else is waiting for Clojure to be closer t oself-hosting |
| 00:43 | Scriptor | fualo: what do you mean other implementations? As in other backends? |
| 00:44 | slyrus | clojure on CL would be nice :) |
| 00:44 | technomancy | slyrus: you can adapt my clojure-on-elisp compiler to output CL =) |
| 00:45 | technomancy | the one I haven't started |
| 00:45 | slyrus | I assumed the clojure-on-elisp things was a joke, right? |
| 00:45 | slyrus | ah, ok. |
| 00:45 | technomancy | well it would be foolish to start a new implementation right now with clojure-in-clojure "just around the corner" |
| 00:45 | Scriptor | I'm working on a kinda-like-clojure-not-really to php compiler |
| 00:46 | Scriptor | if anyone wants to lose their sanity and help :p |
| 00:46 | slyrus | technomancy: but I'm assuming clojure-in-clojure will still run on the jvm, no? |
| 00:46 | slyrus | it's just that the java bits of the source tree will move to clojure |
| 00:46 | technomancy | slyrus: right |
| 00:46 | slyrus | my hypothetical clojure-on-cl would not use the jvm |
| 00:47 | technomancy | sure, there's plenty of talk of porting to other runtimes |
| 00:47 | technomancy | llvm, JS, etc. |
| 00:48 | slyrus | stm, seqs, the new object model, etc... would all make for a nice lispy dialect on top of, say, SBCL's compiler infrastructure |
| 00:48 | technomancy | slyrus: there's also talk of porting qi to clojure |
| 00:48 | technomancy | no idea how serious that is |
| 00:50 | dsantiago | technomancy: Is that take all based on waiting for clojure-in-clojure, or going ahead without it? |
| 00:50 | technomancy | that "plenty of talk" you mean? yeah. |
| 00:52 | fualo | technomancy: seld hosting? |
| 00:52 | fualo | *self |
| 00:52 | fualo | as in not on jvm? |
| 00:53 | Scriptor | fualo: as in it's all written in clojure, I think |
| 00:53 | technomancy | fualo: no, as in not implemented in the Java Programming Language™ |
| 00:53 | fualo | ah, cool |
| 00:53 | slyrus | technomancy: what's wrong with spaces? lein clean jar "test leiningen.test-core" repl |
| 00:53 | fualo | I just wonder if people will split from the jvm... |
| 00:54 | technomancy | slyrus: well it's much more common to want to give an argument to a task than to want to chain tasks |
| 00:54 | dsantiago | If there was a version of Clojure that would let me write Cocoa apps, I'd totally use it. |
| 00:54 | technomancy | so spaces are used for that. |
| 00:55 | dsantiago | Something like Macruby. |
| 00:55 | technomancy | it's possible |
| 00:56 | dsantiago | If I was smart enough to understand all the things clojure does, I'd work on it. I need someone better, though. |
| 00:57 | technomancy | maybe by the time clojure is self-hosting you'll understand it better. =) |
| 00:57 | dsantiago | That's what I was hoping for. |
| 00:57 | dsantiago | If the STM stuff is rewritten in Clojure, it becomes a lot easier. |
| 00:58 | slyrus | technomancy: back to the here and now... any chance clojure-mode could do (def...) style processing for (foo/defmoose ...) instead of just (def...)? |
| 00:58 | slyrus | in particular it's the fnparse defrules that are killing my indenting |
| 00:59 | slyrus | but, besides that, did I say how awesome fnparse is? oh yeah, I think I did -- a couple of times even |
| 00:59 | technomancy | slyrus: it probably could. I'm not sure the specifics of how, but I'm sure it could be done with some elisp pokage. |
| 00:59 | slyrus | aren't you the clojure mode maintainer? :) |
| 01:00 | slyrus | d'oh |
| 01:00 | slyrus | jochu is, I guess |
| 01:00 | technomancy | I'm the ... steward. |
| 01:00 | technomancy | maintainer is kind of a strong word. |
| 01:00 | slyrus | heh |
| 01:01 | slyrus | the regent |
| 01:03 | daaku | i'm reading the docs, but i'm not getting why this wont work in the repl: (gen-class :name user.t1 :extends Exception) (new user.t1) |
| 01:04 | daaku | do i need to trigger some sort of explicit compile on it? or import it? |
| 01:04 | technomancy | daaku: there are less-awkward ways of signaling exceptions than subclassing; have you tried clojure.contrib.condition or error-kit? |
| 01:04 | technomancy | but yeah, you need to perform an explicit compilation step. kind of annoying; better to avoid it if you can. |
| 01:07 | daaku | i'm reading about conditions now, but i looked at error-kit and couldn't figure out how to make it "except" |
| 01:07 | daaku | seemed like it continue was the only option, or throwing an exception, which meant the higher level needed another fork |
| 01:07 | daaku | i guess i didn't quite get it |
| 01:08 | technomancy | error-kit is much more involved than c.c.condition |
| 01:09 | technomancy | c.c.condition is really slick. I could see it being part of Clojure itself some day. |
| 01:10 | daaku | technomancy: i'm having a hard time finding docs for this :( |
| 01:11 | brehaut | daaku have you seen clojuredocs ? |
| 01:11 | technomancy | basically you can raise a map with arbitrary fields and it's treated like an exception |
| 01:11 | technomancy | then you can use the handler-case macro like you'd use try except instead of exception classes you put a predicate there |
| 01:11 | daaku | brehaut: yeah, didn't have anything more |
| 01:12 | daaku | technomancy: thank you, that makes perfect sense now :) |
| 01:12 | brehaut | daaku aight sorry bout that then |
| 01:12 | technomancy | the first clause to match the raised condition acts as a catch clause |
| 01:12 | daaku | so destructring to match exceptions of sorts? |
| 01:12 | technomancy | kind of |
| 01:12 | daaku | reminds me of erlang's pattern matching |
| 01:13 | technomancy | anyway, it's under-appreciated. |
| 01:13 | daaku | technomancy: i'll give it a shot |
| 01:13 | tomoj | I wonder if this "Overriding previous definition of reference to.." stuff is nothing to worry about |
| 01:14 | technomancy | tomoj: some ns you're using hasn't been updated for Clojure 1.2 |
| 01:14 | tomoj | ah |
| 01:15 | technomancy | probably something like seq-utils |
| 01:18 | tomoj | strange that it happens during `lein deps` |
| 01:19 | tomoj | virgin project from `lein new`, add swank-clojure 1.3.0-SNAPSHOT to :dev-deps, then `lein deps` gives two of those warnings |
| 01:22 | technomancy | tomoj: can't repro here. which lein? |
| 01:23 | fualo | can closures in clojure maintain state with lexically-scoped variables in different invocations? |
| 01:23 | technomancy | fualo: sure, if you close over an atom |
| 01:23 | technomancy | or an agent, ref, etc. but usually an atom. |
| 01:23 | brehaut | fualo: have an example http://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session/memory.clj |
| 01:24 | tomoj | technomancy: 1.2.0 |
| 01:24 | brehaut | ;) |
| 01:24 | fualo | ah, interesting technomancy... |
| 01:24 | technomancy | tomoj: weird... if you can repro with the latest master on git please open a ticket |
| 01:24 | tomoj | will do |
| 01:24 | fualo | thanks brehaut |
| 01:25 | brehaut | fualo: it has the additional detail of faking an object with a map but you can happily ignore that |
| 01:25 | technomancy | g'night (UGT) |
| 01:28 | fualo | this is a weird question too, but how exactly to closures maintain the values of local variables across calls? |
| 01:28 | fualo | I thought these local variables in the stack were destroyed |
| 01:29 | brehaut | fualo thats what 'closure' means really |
| 01:29 | brehaut | a closure is not dissimilar to an object with a single method |
| 01:30 | fualo | but there is nothing in the function body that specifically says "keep this around" is there? |
| 01:30 | brehaut | the reference to the name |
| 01:30 | brehaut | the compiler is able to infer that the name comes from a scope outside the function |
| 01:30 | brehaut | based on what you do with that function the compiler can work out how to handle it |
| 01:31 | brehaut | i dont know how detailed clojure's compiler is with regard to those sorts of optimisations but there are a lot of options available to it. |
| 01:32 | brehaut | if you want to see some mind blowing stuff, have a read about what Steele's original scheme compiler did with lambdas |
| 01:33 | fualo | ha, I will |
| 01:33 | fualo | that would be interesting |
| 01:33 | brehaut | it is |
| 01:33 | dsantiago | Dumb question: When a closure is made around a local variable, does that variable stay the same every time the closure is invoked, or can it change between invocations? |
| 01:33 | brehaut | dsantiago: if its a clojure value (ie immutable) and not wrapped in a ref |
| 01:33 | brehaut | then yes, it stays the same |
| 01:34 | brehaut | if its a java object, then maybe not |
| 01:34 | brehaut | if its a ref type, you have some fairly clear semantics about how it might change |
| 01:34 | dsantiago | Right, I'm not talking about immutables in closure specifically, I was actually wondering about other lipss in general. |
| 01:34 | brehaut | i couldnt say about lisps in general |
| 01:34 | brehaut | i believe schemes variables are by default somewhat similar to clojure's 'var' reftypes |
| 01:35 | brehaut | which is to say dynamically bound variables |
| 01:35 | Chousuke | locals in other lisps tend to be mutable. |
| 01:35 | fualo | Oh, I get it |
| 01:36 | fualo | it's the nested functions in a closure that give it the ability to store state |
| 01:36 | fualo | right? |
| 01:38 | brehaut | its more about there being a function defined within a scope, eg (def counter (let [c (atom 0)] (fn [] (swap! c inc)))) |
| 01:38 | brehaut | in that example you have a fn inside a let |
| 01:39 | brehaut | (that form is sometimes known as let over lambda) |
| 01:39 | brehaut | the let is defining a scope that surrounds the fn, but the fn is passed back as the result of the let expression |
| 01:40 | brehaut | i dont think im helping am i? |
| 01:41 | fualo | brehaut: this is! |
| 01:41 | fualo | I am very close to understanding this |
| 01:41 | brehaut | excelent :) |
| 01:41 | brehaut | its one of those concepts that is actually quite simple, but seems way more confusing than it really is till you've got a handle on it |
| 01:41 | dsantiago | http://letoverlambda.com/index.cl/guest/chap2.html#sec_5 |
| 01:41 | fualo | brehaut: and I've been thinking currying was closures for ages |
| 01:41 | brehaut | fualo what languages are you coming from? |
| 01:42 | fualo | brehaut: R, Python, C, perl |
| 01:42 | fualo | some lisp |
| 01:42 | brehaut | fualo: i can only speak for Python and C. C has nothing like closure, python does although its scoping rules are a bit... curious (though you often dont get bitten by them) |
| 01:43 | brehaut | python doesnt have a construction that is like let, so you would have to use another function to define the scope |
| 01:43 | fualo | so the magic of closures comes from (1) returning functions from functions and (2) lexical scoping? |
| 01:43 | brehaut | yes |
| 01:44 | brehaut | although if you think about (let [a 1] (map #(+ a %) [1 2 3 4])) |
| 01:44 | brehaut | the #( ) fun there is also a closure |
| 01:44 | brehaut | so its more about the lexical scoping |
| 01:45 | brehaut | dsantiago: excellent link |
| 01:45 | fualo | brehaut: ah, I get it |
| 01:45 | dsantiago | Yeah, answered my question, I think it's a good explanation. |
| 01:45 | fualo | it is the lexical scoping |
| 01:45 | brehaut | dsantiago: yes |
| 01:45 | fualo | thanks so much brehaut |
| 01:45 | brehaut | no worries |
| 01:46 | fualo | that is a great link dsantiago |
| 01:46 | fualo | I may have to get that book |
| 01:46 | brehaut | just dont ask me to explain continations ;) |
| 01:46 | fualo | ha |
| 01:46 | fualo | I may have to get that book |
| 01:47 | fualo | I've learned quickly that I can't learn clojure to learn FP... I have to learn FP to learn clojure (well, at least) |
| 01:48 | brehaut | fualo: it's best to learn FP in tandem with a language |
| 01:48 | fualo | yea, I am doing that too |
| 01:48 | fualo | with clojure and emacs lisp |
| 01:48 | brehaut | (better yet, languages - a lisp and an ML is ideal in my opinion) |
| 01:48 | Chousuke | Rather you can learn Clojure without knowing FP, picking up the basics, and once you have learned enough FP, you get to relearn Clojure the right way :P |
| 01:49 | brehaut | fualo: you might find a more gentle introduction to FP than Let over lambda a less punishing introduction |
| 01:49 | brehaut | it gets pretty deep pretty fast |
| 01:49 | fualo | ah, good to note |
| 01:50 | fualo | I looked at The Little Schemer, but the format is... difficult |
| 01:50 | brehaut | the little schemer is a fantastic book |
| 01:50 | brehaut | but its unussual |
| 01:50 | brehaut | my recollection is that by the end of it you will know how to write a Y implementation |
| 01:50 | fualo | Y implementation? |
| 01:51 | slyrus | y combinator? |
| 01:51 | brehaut | The applicative order fixed point y combinator |
| 01:51 | brehaut | (or some permutation of those words) |
| 01:51 | absalom | I took Robinb Popplestone's famous class on scheme. |
| 01:52 | absalom | Good class. |
| 01:52 | brehaut | fualo: http://www.dreamsongs.com/NewFiles/WhyOfY.pdf |
| 01:52 | absalom | Devoted two sessions to the gamma combinator too. |
| 01:52 | absalom | No one understood it at the end though. |
| 01:52 | brehaut | heh |
| 01:52 | Chousuke | what helped me to understand FP was thinking of code as expressing a transformation, instead of a seriers of instruction |
| 01:52 | Chousuke | s |
| 01:53 | absalom | Write some programs in an applicative style. |
| 01:53 | brehaut | for me it was sitting down and learning the λ calc |
| 01:53 | brehaut | and writing a lazy interpreter for it |
| 01:53 | absalom | People are better at understanding things once they have a motivation for them. |
| 01:53 | brehaut | totally |
| 01:54 | callen-nyc | javascript is remarkably good at teaching people the value of closures and currying, in my experience. |
| 01:54 | callen-nyc | the only people whom I know personally that know what currying is are js hackers :P |
| 01:54 | fualo | R has been pretty good too |
| 01:54 | brehaut | callen-nyc: it was originally a scheme derivative wasnt it? |
| 01:54 | callen-nyc | R is a little domain specific for a lot of people to stretch their wings though. |
| 01:54 | callen-nyc | brehaut: it still is. |
| 01:54 | absalom | Hmm- maybe it is remarkably good at teaching that to a small percentage of javascript programmers. |
| 01:54 | callen-nyc | brehaut: it's just scheme + prototypes + weird types + DOM |
| 01:54 | brehaut | callen-nyc: what i meant to say is it didnt have the c family syntax |
| 01:54 | callen-nyc | absalom: I don't really care about the bottom 50% |
| 01:55 | callen-nyc | brehaut: I don't really focus on syntax. |
| 01:55 | absalom | OK, well I was talking abiout the bottom 90% ;) |
| 01:55 | callen-nyc | syntax doesn't change how I think about a problem, semantics do. |
| 01:55 | brehaut | sure, but JS syntax is a bit of a mine field |
| 01:55 | absalom | there are a lot of javascript programmers. |
| 01:55 | callen-nyc | brehaut: you can make a turing tarpit with no alphanumerics in js. |
| 01:55 | brehaut | i wrote nothing but javascript professionally for about 2 years |
| 01:56 | callen-nyc | absalom: there are a lot of ditch diggers. I bet most of 'em are mediocre. |
| 01:56 | absalom | Yeah, well js is a weird combination of genius and idiocy. |
| 01:56 | fualo | I'm not sure now if R has closures in the same way as clojure |
| 01:56 | brehaut | function cons(h,t) { return function p(acc) { return acc(h, t); }; }; |
| 01:56 | callen-nyc | absalom: luckily idiocy can be overcome but genius cannot be injected. |
| 01:57 | callen-nyc | this is what I get for reinstalling my clojure setup, lein's completely changed. |
| 01:57 | absalom | Hmm.. if you had had to work with some of the js code I have had to fix you would not be so sanguine aboiut the idiocy, I think. |
| 01:57 | callen-nyc | absalom: I can't speak to your woes, I work for a company that has some excellent js people |
| 01:57 | callen-nyc | I write my own, but either way. |
| 01:57 | brehaut | callen-nyc: i feel your pain |
| 01:58 | callen-nyc | brehaut: what happened to lein swank? |
| 01:58 | absalom | Javascript is basically a deeply flawed prefix Lisp. |
| 01:58 | callen-nyc | I'm bloody mad now. |
| 01:58 | brehaut | callen-nyc: no idea sorry, ive never used swank |
| 01:58 | callen-nyc | absalom: eh. no macros though. scarcely counts. |
| 01:58 | absalom | meh.. there were no macros in early lisps either. |
| 01:58 | callen-nyc | absalom: early lisps were 30 years ahead of their time |
| 01:59 | callen-nyc | although I've seen people run js through a cpp, that hardly counts. |
| 01:59 | callen-nyc | absalom: actually, if you really want a powerful expression of code-is-data, you want Io/Ioke/Seph |
| 01:59 | callen-nyc | absalom: ridiculous faculties for traversing the code and making arbitrary modifications. |
| 02:00 | brehaut | callen-nyc: you can do clever things with js eval and script language="my dsl" |
| 02:00 | callen-nyc | brehaut: I'm spoiled by Io, I'm afraid. |
| 02:00 | callen-nyc | you can monkeypatch a single operator or expression at will anywhere in your code. |
| 02:00 | callen-nyc | you traverse it like a native data structure. |
| 02:00 | callen-nyc | it's nuts. |
| 02:04 | absalom | sorry- my internet connection is flaky. |
| 02:04 | callen-nyc | absalom: welcome back. |
| 02:04 | callen-nyc | absalom: you missed me waxing rhapsodic about Io :P |
| 02:04 | absalom | www |
| 02:04 | absalom | funny |
| 02:05 | callen-nyc | ? |
| 02:05 | absalom | there are limits to nostalgia |
| 02:05 | callen-nyc | does anyone know what happened to lein swank? |
| 02:05 | callen-nyc | absalom: careful, you're in a lisp channel. |
| 02:06 | absalom | That said- never did Io. |
| 02:06 | absalom | heh ;) |
| 02:06 | callen-nyc | absalom: has the most powerful metaprogramming faculties I've ever seen. |
| 02:06 | absalom | Well, I am something of a CLer |
| 02:06 | callen-nyc | absalom: you can swap-out a single operation or expression out of any part of your code at will |
| 02:06 | callen-nyc | absalom: you traverse it like a native data structure. |
| 02:06 | callen-nyc | totally absurd. |
| 02:07 | absalom | And I am in fact experiencing some stage of Kuibler-Ross's formula with Cl as a parameter... |
| 02:07 | absalom | really? |
| 02:07 | brehaut | absalom: hah |
| 02:07 | absalom | Youi see that is my self-destructie nature manifesting itself... |
| 02:08 | absalom | The good lord knows that the last thing I should do is go investigate IO. |
| 02:08 | callen-nyc | uh, right then. |
| 02:09 | absalom | If I had just decided to do Java a few years ago.. but the ni suppose you must know that story. |
| 02:10 | absalom | I mean, I suppose most of the core clojure developers could have been core JBoss developers had they wanted to be so. |
| 02:11 | absalom | But I have been waiting for Lisp to win for a _long_ time. |
| 02:12 | tomoj | callen-nyc: what do you mean what happened to it? |
| 02:13 | callen-nyc | tomoj: "that's not a task" |
| 02:13 | absalom | But I am pretty much at the acceptance point with CL... |
| 02:13 | callen-nyc | absalom: "win" |
| 02:13 | callen-nyc | absalom: oi vey. winning is making money. |
| 02:13 | tomoj | callen-nyc: do you have swank-clojure in your dev-deps? |
| 02:13 | callen-nyc | absalom: if you're making money and using tools you enjoy, nobody can fault you. |
| 02:14 | callen-nyc | [swank-clojure "1.2.0"] |
| 02:14 | callen-nyc | [leiningen/lein-swank "1.1.0"] |
| 02:14 | tomoj | did you run `lein deps`? |
| 02:14 | absalom | It is basicalky dead as a serious implementation language and no amount of wizard coding will bring it back. |
| 02:14 | callen-nyc | :| yes. |
| 02:14 | tomoj | get rid of the lein-swank dep, no longer needed |
| 02:14 | tomoj | lein -v? |
| 02:14 | callen-nyc | tomoj: secondary desperate cargo cult measure |
| 02:14 | callen-nyc | tomoj: not my original attempt. |
| 02:14 | callen-nyc | Leiningen 1.2.0 on Java 1.6.0_21 Java HotSpot(TM) Client VM |
| 02:14 | tomoj | hmm |
| 02:14 | tomoj | and swank-clojure's jar is in lib/dev? |
| 02:14 | callen-nyc | still not working. |
| 02:15 | callen-nyc | swank-clojure-1.2.0.jar |
| 02:15 | absalom | Meh- ther is a limit to how much you can force an unpopular language in your subordinates before they rebel abd you get ousted. |
| 02:15 | tomoj | odd |
| 02:15 | callen-nyc | tomoj: believe it or not, I'm not incompetent, merely incredibly unlucky. |
| 02:15 | callen-nyc | tomoj: incredibly, incredibly unlucky. |
| 02:15 | absalom | I speak from experience ;) |
| 02:15 | callen-nyc | tomoj: I bump into everything like this. |
| 02:15 | callen-nyc | tomoj: rare apt bug? I'll trip right over. |
| 02:15 | tomoj | does `lein help` list the swank task? |
| 02:15 | callen-nyc | tomoj: unusual apache behavior? I'll be the one to drown. |
| 02:16 | callen-nyc | tomoj: nosir. |
| 02:16 | brehaut | callen-nyc: things like that are why i'm a non-tool using primate |
| 02:16 | tomoj | maybe try swank-clojure 1.3.0-SNAPSHOT instead |
| 02:16 | tomoj | you shouldn't have to.. but that's currently working for me |
| 02:16 | callen-nyc | brehaut: things like that are why I gave up on virtualenv in python-land. |
| 02:16 | callen-nyc | [org.clojure/clojure "1.2.0-beta1"] relevant? |
| 02:16 | tomoj | no, I have that too |
| 02:16 | callen-nyc | retrying. |
| 02:17 | brehaut | callen-nyc: yup. ive found the sanest i get is a text editor, a repl and a virtualbox image for each project |
| 02:17 | callen-nyc | brehaut: no dice grandma. |
| 02:17 | absalom | The thing is that people are sonditioned to hatre lisps enough that a lisp has to have a lot of cheese to win. |
| 02:17 | callen-nyc | er |
| 02:17 | callen-nyc | tomoj: no dice grandma. |
| 02:17 | absalom | err- conditioned to |
| 02:18 | absalom | I wonder if clojure has enough cheese. |
| 02:18 | callen-nyc | absalom: are you using cheese the way jwz did? |
| 02:18 | absalom | I mean it as the reward the mous gets if he crosses the barrier |
| 02:19 | absalom | the reward. |
| 02:19 | callen-nyc | (= your-usage jwz-style) returns true then. |
| 02:19 | absalom | C; clearly lacked cheese... |
| 02:19 | absalom | err- CL |
| 02:20 | callen-nyc | absalom: clj is attracting ruby people because of the concurrency, state containment, and speed. |
| 02:20 | absalom | For clojure to be accepted it will have to have a better pain to cheese ratio than CL... |
| 02:20 | callen-nyc | absalom: combined with relative power. |
| 02:20 | hiredman | clojurebot: bonnie is <reply>my bonnie lies over the ocean, my bonnie lies over the sea |
| 02:20 | clojurebot | c'est bon! |
| 02:20 | callen-nyc | absalom: so I'd say there's cheese for people who've been constrained by slow VMs and want a faster but still powerful lang. |
| 02:20 | tomoj | callen-nyc: your project.clj looks like this? https://gist.github.com/1d865ae756aa70d04889 |
| 02:20 | absalom | Yeah, but this all looks so simple if you aare a Lisper. |
| 02:20 | brehaut | callen-nyc: that applies to python folk to i think |
| 02:20 | callen-nyc | brehaut: *coughs* |
| 02:21 | brehaut | sorry? |
| 02:21 | callen-nyc | brehaut: I know low level langs, but yeah, clojure is the best overall compromise I can come up with for what I want to do. |
| 02:21 | callen-nyc | brehaut: I'm a professional py/django guy :P |
| 02:21 | brehaut | callen-nyc: ah right :) ive done that too |
| 02:21 | absalom | Anyway, as a professional Python programmer I can say, without fear of contradition, that Norvig is wrong. Python is not an acceptable Lisp. |
| 02:22 | brehaut | my current hobby project is rebuilding my django powered whole site in clj |
| 02:22 | callen-nyc | brehaut: on my second django/generalist job right now. |
| 02:22 | absalom | I can even tell you where he goes wrong. |
| 02:22 | callen-nyc | brehaut: I have a mini CMS that has gone from sinatra + mysql -> django + postgres -> flask + mongodb |
| 02:22 | brehaut | callen-nyc: cool :) my django/py job got crushed by the recession |
| 02:22 | callen-nyc | absalom: where? |
| 02:22 | callen-nyc | brehaut: :( |
| 02:22 | callen-nyc | brehaut: I work for a startup out in MV. |
| 02:22 | absalom | It is where he considers eval to be an important language feature. |
| 02:23 | brehaut | im in new zealand, its basicly a wasteland of .net shops |
| 02:23 | callen-nyc | tomoj: it wasn't dev-dependencies before, fixed that |
| 02:23 | absalom | and one that |
| 02:23 | brehaut | or (shudder) php |
| 02:23 | callen-nyc | tomoj: that still didn't fix it though. |
| 02:23 | absalom | akes python lisp=equivalent. |
| 02:23 | tomoj | so, do you have swank-clojure in lib/dev for real this time? |
| 02:23 | callen-nyc | absalom: in a very-very-very-very crude way, he's right |
| 02:23 | callen-nyc | absalom: but not meaningfully so, making you practically speaking, correct. |
| 02:24 | callen-nyc | brehaut: Columbus, OH is where I was before NYC / SF |
| 02:24 | callen-nyc | brehaut: .NET wasteland too |
| 02:24 | absalom | yes, but he didn;t say "tarpit-acceptable lisp" |
| 02:24 | callen-nyc | absalom: I know, that's why I qualified my statement. |
| 02:24 | callen-nyc | brehaut: I spent 3 years working in C# before django |
| 02:24 | absalom | yeah, zactly. |
| 02:24 | callen-nyc | brehaut: there are actually clojure shops in MV. |
| 02:24 | callen-nyc | brehaut: (mountain view, bay area) |
| 02:24 | brehaut | callen-nyc: i became a javascript programmer because i detest C#2 so much |
| 02:24 | brehaut | callen-nyc: thanks :) |
| 02:24 | absalom | I mean, I knew P Greenspun.. |
| 02:25 | callen-nyc | brehaut: I'm around startup people who know what MV means too much, sorry :P |
| 02:25 | callen-nyc | tomoj: yessir |
| 02:25 | absalom | And you, Mr Norvig, are no P Greenspun |
| 02:25 | callen-nyc | tomoj: and it's a snapshot version |
| 02:25 | callen-nyc | still no dice. |
| 02:25 | brehaut | callen-nyc: no problem :) i only know one bay area guy |
| 02:25 | callen-nyc | tomoj: wait |
| 02:25 | callen-nyc | tomoj: just got a java exception. |
| 02:26 | absalom | Anyway, the more I look at clojure the more I think that it might be acceptable... |
| 02:26 | callen-nyc | tomoj: NO_SOURCE_FILE:1 :P |
| 02:26 | callen-nyc | absalom: I showed it to a java guy recently |
| 02:26 | callen-nyc | absalom: middle-aged |
| 02:26 | callen-nyc | absalom: he screeched at the parentheses |
| 02:26 | tomoj | what's the actual exception? |
| 02:26 | callen-nyc | absalom: I literally couldn't get him to look past those. |
| 02:26 | callen-nyc | Caused by: java.lang.NumberFormatException: For input string: "[PORT=4005]" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) |
| 02:26 | callen-nyc | lein swank [PORT=4005] [HOST=localhost] |
| 02:27 | absalom | Well, if you come from CL land... |
| 02:27 | brehaut | callen-nyc: my coworkers reaction to F# code is the dual 'Wheres the braces?!' |
| 02:27 | absalom | clojure has some defects. |
| 02:27 | absalom | But.. |
| 02:27 | tomoj | callen-nyc: did you actually type "lein swank [PORT=4005] [HOST=localhost]" ? |
| 02:27 | callen-nyc | brehaut: I like F#, but I'm unwilling to work in Microsoft-land again. |
| 02:27 | callen-nyc | tomoj: cargo cult. yes. |
| 02:27 | absalom | a lot of them are basically unavoidable if you targert the JVM... |
| 02:27 | callen-nyc | tomoj: feel free to swat me if this was braindead |
| 02:27 | tomoj | one would type "lein swank 4005 localhost" |
| 02:27 | absalom | Unless you want to target it with an inerpreter. |
| 02:28 | tomoj | but those are the defaults, so just "lein swank" |
| 02:28 | brehaut | callen-nyc: i have little choice about .net land, and until clojure.clr is more ready, F# is the best ive got |
| 02:28 | callen-nyc | tomoj: brilliant. trying it now. |
| 02:28 | brehaut | callen-nyc: anyway, anything is better than VBScript |
| 02:28 | callen-nyc | tomoj: socket opened. your patience is that of a saint and you are more manly than an emu. Thank you. |
| 02:28 | absalom | Anyway, even for the hardcore Cler... |
| 02:28 | callen-nyc | brehaut: friend of mine back in Columbus works in VB6 full-time |
| 02:29 | callen-nyc | brehaut: that said, he spends very little of his week actually working. |
| 02:29 | absalom | Clojure is a lot closer than python is. |
| 02:29 | brehaut | callen-nyc: VB6 is terrible, but VBScript is actually worse |
| 02:29 | callen-nyc | brehaut: I remember. |
| 02:29 | callen-nyc | painfully. |
| 02:29 | absalom | The other thing is that.. |
| 02:29 | callen-nyc | brehaut: I'm glad most of my work was new C# dev |
| 02:29 | absalom | Cl can't change |
| 02:29 | callen-nyc | brehaut: I actually got to stay in .NET 3 most of the time. |
| 02:29 | callen-nyc | absalom: standards blah blah blah |
| 02:29 | brehaut | .net 3+ is managable |
| 02:29 | absalom | It;s probably the best fixed spec ever made, but... |
| 02:29 | callen-nyc | brehaut: expression treeeeeeees |
| 02:30 | brehaut | callen-nyc: a moderately useful type inferencer :) |
| 02:30 | brehaut | callen-nyc: also mona^H^H^H^HLinq |
| 02:30 | absalom | anyway, I have been more and more and more won over by clojure's rationale, but... |
| 02:31 | callen-nyc | brehaut: hahahaha. |
| 02:31 | callen-nyc | brehaut: I know some die-hard microsofties |
| 02:31 | callen-nyc | brehaut: I kept trying to explain to them that LINQ was monads expressed in ORM syntax |
| 02:31 | callen-nyc | brehaut: they didn't bloody believe me. |
| 02:31 | brehaut | hah |
| 02:31 | absalom | As a Cler I am used to doing as lot of imperatiove progtamming, mixed with a lot of functional stuff. |
| 02:31 | brehaut | i think the smartest thing microsoft ever did was put the C# team down the hall from the F# team, and the F# team down the hall from the haskell guys |
| 02:31 | callen-nyc | brehaut: they thought monads was some ridiculous http://arsenal.theoffside.com/files/2010/04/doc-brown-300x295.jpg thing. |
| 02:32 | callen-nyc | brehaut: yeah, MS has some good language design these days. |
| 02:32 | callen-nyc | brehaut: the guy heading C# is sensible. |
| 02:32 | absalom | Some stuff is better modeled with mutable state. |
| 02:32 | callen-nyc | brehaut: but. I refuse to be tied to an ecosystem I can't control |
| 02:32 | callen-nyc | brehaut: thusly, I stopped devving on my mac, and stopped working in .NET :P |
| 02:32 | callen-nyc | absalom: some, da. |
| 02:32 | callen-nyc | absalom: hence refs. :) |
| 02:32 | brehaut | i can imagine the haskell guys sitting there going 'wow, this is really amazing math. lets make it usable by programmers' and the F# guys going 'wow, this is really amazing haskell stuff, lets make it usable to real programmers' and the C# guys going 'wow, this is cool F# stuff, lets make it usable to real programmers' |
| 02:33 | brehaut | and the VBnet net guys are just drooling |
| 02:33 | callen-nyc | tomoj: working brilliantly. I'd send you beer if I could. |
| 02:33 | absalom | Yep.. But it's syntactic overhead, at least |
| 02:33 | callen-nyc | brehaut: lmfao. |
| 02:33 | callen-nyc | absalom: concurrency and |
| 02:33 | callen-nyc | absalom: immutability are the only sensible defaults in the coming future. |
| 02:33 | callen-nyc | absalom: you know this. |
| 02:34 | absalom | The problem with fuinctional programming is that in the end everything looks like a function to the fuintional programmer. |
| 02:34 | absalom | Yeah, I do.. |
| 02:34 | callen-nyc | absalom: I know core FreeBSD devs who are aware of this, and they've been in C-land for like, 20 years. |
| 02:34 | absalom | well, at least I do know that I am not smart enough to manually manage concurrency. |
| 02:34 | callen-nyc | absalom: as soon as I started explaining clojure in terms of true immutability she brightened right up. |
| 02:35 | absalom | Yeah- I am doing 3D animation stuff right now and.. |
| 02:35 | absalom | Hmm- actually bad example... |
| 02:36 | absalom | Bu it's a good question... |
| 02:36 | absalom | Theoretically speaking, which problems can be parallized? |
| 02:37 | absalom | err- parallelized... |
| 02:37 | brehaut | absalom: thats rather a broad question isnt it? |
| 02:37 | absalom | Clojure is a bet on "a lot" |
| 02:37 | callen-nyc | absalom: it's actually not |
| 02:37 | absalom | Indeed it is. |
| 02:37 | callen-nyc | absalom: a bigger bet on parallelism is more like haskell and map-reduce databases. |
| 02:38 | absalom | I mean if it turned out that no one cared much about parallelizing computations for consumer software... |
| 02:38 | callen-nyc | absalom: parallelism depends on the composition of the work, how much of it is computation versus data processing, and how independent the computations are. |
| 02:38 | callen-nyc | absalom: there is no 'consumer software' |
| 02:38 | absalom | Hmm- but the whole point of mapreduce is tht i requires no language support. |
| 02:38 | callen-nyc | absalom: people are using clojure to deploy services, not desktop software. |
| 02:38 | brehaut | absalom: there are things that cant be 'parallized' that can be 'concurrent' though right? |
| 02:38 | callen-nyc | brehaut: yes. |
| 02:39 | absalom | Sure- but where is the win there? |
| 02:39 | callen-nyc | absalom: scaling |
| 02:39 | brehaut | making concurrent code composable and reasonable makes for some rather clear solutions to otherwise hairy problems |
| 02:39 | callen-nyc | absalom: independent jobs can be worked on in parallel |
| 02:40 | absalom | I mean I am mainly playing devil's advocate here, but.. |
| 02:40 | callen-nyc | absalom: otherwise you'd have to work on them serially with a context switch |
| 02:40 | brehaut | absalom: figured :) |
| 02:40 | callen-nyc | absalom: which sucks. |
| 02:40 | absalom | Let me give you a great example of scaling an parallelism |
| 02:41 | absalom | I work for an animation studio right now, writing animation software... |
| 02:41 | absalom | Sometimes they need to render things |
| 02:41 | brehaut | absalom: that sounds like you are entering the embarrassingly parallel territory pretty easily |
| 02:41 | absalom | They achieve parallelism very easily: the software ios designed so that no frame depends on another. |
| 02:42 | absalom | Do they can use a process for each frame if they want. |
| 02:42 | absalom | *So |
| 02:42 | absalom | And they can break rendering up over, literally, hundreds of machines, with thousands of cores. |
| 02:43 | absalom | That is parallelism. |
| 02:43 | callen-nyc | that's because graphics are ridiculously parallel |
| 02:44 | absalom | The thing is.. we are talking about things that can be easily broken up into dicrete chunks. |
| 02:44 | callen-nyc | there's zero dependent computation frame to frame. |
| 02:44 | callen-nyc | absalom: thank god, otherwise 3d would be a ridiculously hard problem. |
| 02:44 | absalom | it gets more complicated if you have dependencies on other computations, but... |
| 02:44 | brehaut | i cant help but think that this is rapidly devolving into an Internet Argument here (ie, violently in agreement) |
| 02:45 | absalom | sure.. |
| 02:45 | absalom | I mean I just wonder to what degree this will be the case. |
| 02:45 | absalom | I think you are right that its the best ase for clojure. |
| 02:46 | brehaut | absalom: actually, clojure is turning into a pretty damn fine web back end tool too |
| 02:46 | absalom | Cause the only way I see for people to keep selling more powerful computers is more cores. |
| 02:46 | brehaut | even asside from the concurrency aspect |
| 02:46 | callen-nyc | absalom: people aren't going to use clojure for rendering, if at all, for a long time |
| 02:46 | callen-nyc | absalom: services mate. |
| 02:46 | absalom | sure, but is it beer than CL for that? |
| 02:46 | absalom | err- better |
| 02:46 | callen-nyc | absalom: yes and no. |
| 02:47 | callen-nyc | absalom: sbcl is pretty wicked if you annotate the types, but clojure has the potential to be faster. |
| 02:47 | absalom | I mean with hunchentoot and parenscript and JSON libs and etc... |
| 02:47 | callen-nyc | absalom: hunchentoot sucks compared to what clojure already has. |
| 02:47 | callen-nyc | absalom: I'm sorry but come on. |
| 02:47 | absalom | Cl was without a doubt the most capable web language three years ago... |
| 02:47 | callen-nyc | absalom: I'd rather work in raw aleph than hunchentoot. |
| 02:47 | callen-nyc | absalom: you been reading too much PG mah boy. |
| 02:47 | absalom | meh.. |
| 02:47 | callen-nyc | absalom: less kool-aid |
| 02:48 | absalom | I d=never took him too seriously. |
| 02:48 | absalom | except when I read his intro book back in the 90s in school. |
| 02:48 | absalom | ANSI common lisp is a good book |
| 02:49 | absalom | No Kool-AID there.. |
| 02:49 | callen-nyc | absalom: makin' me feel young. |
| 02:49 | absalom | I really believe that based on my own expereince... |
| 02:49 | callen-nyc | absalom: I was referring to essays that resuscitated CL for awhile. |
| 02:49 | absalom | working in CL-WHO and parenscript is an enlughtening esperience |
| 02:49 | absalom | And I say that as someon who ha managed some very successful sites |
| 02:50 | callen-nyc | did Norvig really say python = Lisp because of fucking eval()? |
| 02:50 | callen-nyc | did he think eval() was novel or something? |
| 02:50 | absalom | Yeah, well I found PG less and less convincing as he went on... |
| 02:50 | callen-nyc | I'm sorry, I just find that baffling. |
| 02:51 | callen-nyc | absalom: he's doing alright now that he's moved from programming advice to business advice. |
| 02:51 | absalom | the thing is that when I say that CL+hunchentoot +CL-WHO+parenscript was very comnpelling for me at that time it has nothing to do with Graham.. |
| 02:51 | absalom | None of those things existed when he wrote beating the averages. |
| 02:51 | callen-nyc | absalom: I grok. |
| 02:52 | callen-nyc | absalom: I figured when you started talking mid-90s |
| 02:52 | callen-nyc | not a lot of options back then. |
| 02:52 | absalom | I had just come from several years managing websites that got millions of hits a day and were written in Java and.. pain. |
| 02:52 | callen-nyc | absalom: I had my share of battling jboss. |
| 02:53 | callen-nyc | kinda disturbs me how hard RedHat pushes jboss. |
| 02:53 | callen-nyc | they shouldn't be so opinionated about app infrastructure. |
| 02:53 | absalom | The sad thing is that I was the one who decided to do Java.. no one else to blame. |
| 02:53 | absalom | well, except management. |
| 02:54 | brehaut | surely its not as bad as aspnet webforms |
| 02:54 | absalom | Hmm.. nor sure, but... |
| 02:55 | absalom | it got pretty bad as nepotism added more and more contractors to the mix... |
| 02:55 | absalom | Java works pretty well if you don;t change your mind, ever. |
| 02:55 | brehaut | haha |
| 02:55 | brehaut | bbl; giant (cyclopean?) pile of dishes to deal with |
| 02:56 | absalom | But actually you know John Foderaro once famously called CL a programmer amplifier... |
| 02:56 | absalom | Java was initially designed, explicitly I think, to be a programmer dampener. |
| 02:57 | brehaut | absalom: i thought the goal was to drag C++ programmers half way to lisp? |
| 02:57 | absalom | I mean you can;t look at Java 1.0 and think anything else. |
| 02:57 | absalom | Nah, that is just Guy Steele trying to verbalkly shower. |
| 02:58 | absalom | The oiujnt was that all programmers were heretofore going to be pretty equal. |
| 02:58 | absalom | err- point |
| 02:58 | absalom | No cleverness allowed. |
| 02:58 | callen-nyc | brehaut: nah. java is pretty weak in terms of power, especially early on. |
| 02:58 | callen-nyc | brehaut: what abs said. no cleverness allowed. |
| 02:58 | callen-nyc | brehaut: java was designed to commoditize programming/programmers |
| 02:58 | brehaut | callen-nyc: be that as it may, C++ was pretty weak in terms of sensible |
| 02:58 | absalom | exactly... |
| 02:59 | callen-nyc | brehaut: luckily? the complexity of massive java projects beat them. |
| 02:59 | brehaut | haha |
| 02:59 | kaiwren | brehaut: They got a quarter way there when IntelliJ first came out. Java is barely manageable only with an AST IDE. Ditto C#. |
| 02:59 | absalom | but at least you can be crazy productive in C++ if you are ohne of the ten guys in the world who actually understands it. |
| 02:59 | kaiwren | But any language benefits from an AST IDE. |
| 02:59 | callen-nyc | absalom: I know some competent C++ people |
| 02:59 | callen-nyc | absalom: they establish known patterns of working, and *STICK TO THAT* |
| 03:00 | absalom | Sure.. competent. |
| 03:00 | callen-nyc | absalom: I mean, they work fast. |
| 03:00 | absalom | I know some people qho can make C++ look like Lisp... |
| 03:00 | callen-nyc | absalom: as do I. |
| 03:00 | absalom | err- well maybe one, actually. |
| 03:00 | callen-nyc | absalom: guy I know works in signal processing and some other things |
| 03:00 | callen-nyc | absalom: dude's a master of qt and boost. |
| 03:01 | absalom | But template meta-programming is a rather bad analogue for macros. |
| 03:01 | absalom | Equivalent, but... |
| 03:01 | callen-nyc | absalom: everything in C++ has to be quite static. |
| 03:01 | absalom | So the point of Java 1.0 was to make all programmers the same. |
| 03:01 | callen-nyc | absalom: templates are a space/time trade-off |
| 03:02 | callen-nyc | absalom: guess which one they chose to axe? :P |
| 03:02 | absalom | Within a certain delta. |
| 03:02 | callen-nyc | absalom: that might explain why yegge emphasized typing speed so much |
| 03:02 | callen-nyc | absalom: within that certain delta, WAM matters :D P |
| 03:02 | callen-nyc | :P |
| 03:02 | absalom | meh- yegge was sort of right about that I think... |
| 03:03 | absalom | Not that you would know it fomr my typing, but.. |
| 03:03 | absalom | I hate laptop keyboards... |
| 03:03 | callen-nyc | absalom: I work at a dual-display + desktop mouse/keyboard hooked into a laptop |
| 03:04 | callen-nyc | absalom: honestly, I type quite fast on my laptop, but I do it rarely for programming. |
| 03:04 | absalom | Even if you only keep 60 lines a day you probably type thousands getting there.. not being able to type introduces pathilogies. |
| 03:04 | absalom | err- pathologies |
| 03:04 | absalom | as for spelling... |
| 03:04 | callen-nyc | absalom: I do spend a lot of time hacking in a repl |
| 03:04 | callen-nyc | absalom: typing speed helps, but history recall helps more. |
| 03:04 | absalom | But my point is that Java was meant to keep you from being clever.. |
| 03:04 | absalom | But that didn;t work... |
| 03:05 | absalom | People started leaving Java for clearly worse engineered things like Python... |
| 03:05 | callen-nyc | absalom: 'worse' |
| 03:05 | absalom | So they started adding cleverness to Java... |
| 03:05 | callen-nyc | absalom: at the VM level, sure. at the language level, Python is pretty tolerable. |
| 03:05 | nteon | absalom: what do you mean by worse engineered? |
| 03:05 | absalom | But since Java was initially designed to prohibit cleverness...4 |
| 03:06 | absalom | Can you write a compiler that will compile all legal Python code to something efficient? |
| 03:06 | absalom | No, of course not... |
| 03:06 | callen-nyc | absalom: PyPy ++ RPython |
| 03:06 | callen-nyc | absalom: the JIT is making a lot of progress |
| 03:06 | callen-nyc | absalom: Lisp/Clojure aren't perfectly static/able to be compiled down either |
| 03:07 | callen-nyc | absalom: it's the trade-off you choose to make up-front. |
| 03:07 | absalom | Does CPython have reasonable garbage collection? |
| 03:07 | absalom | Yeah, but why make an unnecessary tradeoff? |
| 03:08 | absalom | Python is ad-hoc. |
| 03:08 | brehaut | absalom: CPython has a fairly standard refcount system. releases memory early, slows stuff down a bit |
| 03:08 | callen-nyc | absalom: unnecessary? |
| 03:08 | callen-nyc | absalom: what do you think you're coding in with clojure exactly? |
| 03:08 | absalom | I men, if it weren't I wouldn't be in this channel. I would stick with Python. |
| 03:08 | callen-nyc | absalom: it's a dynamic type system |
| 03:08 | callen-nyc | absalom: it has similar performance limitations as python, but with some edges over it + running on the JVM |
| 03:08 | absalom | meh.. let's talk about a tale of two pythons... |
| 03:09 | callen-nyc | you sound drunk. |
| 03:09 | nteon | haha |
| 03:09 | callen-nyc | or sleep deprived. |
| 03:09 | absalom | the first python was a compiler developed at CMU... |
| 03:09 | nteon | \quit |
| 03:09 | nteon | bah |
| 03:09 | absalom | hmm- do you not sdee aht I am getting at cullen? |
| 03:10 | callen-nyc | absalom: you seem to be finding the liquor cabinet just fine |
| 03:10 | callen-nyc | :P |
| 03:10 | absalom | Python was developed in an ad-hoc manner that makes it almost impossible to compile it to efficient code. |
| 03:10 | callen-nyc | the ad-hoc nature isn't all that relevant to its performance limitations. |
| 03:10 | callen-nyc | it's a far more structured and disciplined language than ruby. |
| 03:10 | absalom | Perhaps.. |
| 03:11 | absalom | But I tend to put them in pretty much the same category. |
| 03:11 | callen-nyc | it's just a sequence of decisions that led to a whole language, upon which there is a determinable set of performance limitations given known runtime technologies. |
| 03:11 | absalom | Thouh of course Ruby's implementation is terrible... |
| 03:11 | callen-nyc | I repeat, Clojure is dynamically typed and is a JVM language, it can't be "compiled down" any more than python can. |
| 03:11 | callen-nyc | absalom: it's improved greatly, of late. |
| 03:12 | callen-nyc | absalom: ruby 1.9 put it on par with the best of python. |
| 03:12 | callen-nyc | it continues to improve in performance more quickly than python, in fact. |
| 03:12 | callen-nyc | CPython is a reference implementation. period. |
| 03:12 | callen-nyc | if you want fast, use pypy-jit |
| 03:12 | absalom | Clojure is derived fron a series of languages that were designed to be compiled to efficient machine code. |
| 03:13 | callen-nyc | absalom: if that were the case it wouldn't be dynamically typed and it wouldn't be on the JVM |
| 03:13 | callen-nyc | absalom: I think you're misconstruing something. |
| 03:13 | absalom | You really need to go back and look at the history of Lisp cullen. |
| 03:13 | absalom | CL, for instance, was never statically typed. |
| 03:14 | callen-nyc | absalom: you know nothing about me |
| 03:14 | callen-nyc | really, nothing. |
| 03:14 | absalom | But one of the explicit goals of the standardization process was to some up with a language that could be compiled to efficient native code. |
| 03:14 | callen-nyc | absalom: and it's rude for you to suggest I need to go read some eldritch material just because it satisfies your hipster obscurity ethic. |
| 03:14 | callen-nyc | absalom: I'm done with this conversation, please sober up. |
| 03:14 | absalom | meh... |
| 03:16 | absalom | It's rude of you to insist that people who correct your misonceoptions are being rude to you. |
| 03:17 | callen-nyc | absalom: you know nothing of what I know. Stop. |
| 03:18 | absalom | It is certaily true that it was an explicit goal of the designers of CL that CL be comilable to reasonably efficient machine code. That is just a statement of fact, and you can discover it if you go back and look at the documents. |
| 03:19 | absalom | Many of the design decisions made during the standardization process were made for that reason. |
| 03:20 | absalom | That CL is dynamically typed is not particularly material. |
| 03:53 | daaku | technomancy: thanks for building lein int! |
| 04:31 | callen-nyc | how would I go about expressing arity and slicing programmatically? |
| 04:31 | callen-nyc | like python's [] slicing syntax. |
| 04:37 | tomoj | is that two separate questions? |
| 04:37 | tomoj | or does python's [] slicing syntax express arity programmatically? |
| 04:38 | callen-nyc | tomoj: indirectly, in terms of how clojure seems to use arity. |
| 04:38 | callen-nyc | tomoj: you may consider it two different questions if it makes it easier for you to answer. |
| 04:39 | tomoj | I don't understand either question then :) |
| 04:39 | callen-nyc | tomoj: rephrase |
| 04:40 | callen-nyc | tomoj: [element0, element1, element2, element3][0] returns element0 |
| 04:40 | tomoj | does (fn [a b]) express arity, but not "programmatically"? |
| 04:40 | callen-nyc | tomoj: yes. |
| 04:41 | callen-nyc | tomoj: I'm sending something a list, I want to fetch an arbitrary selection from the list without expressing manual arity like |
| 04:41 | callen-nyc | [obj1 obj2 obj3] |
| 04:41 | tomoj | manual arity? |
| 04:41 | callen-nyc | [0, 1, 2, 3, 4, 5][:3] returns [0, 1, 2] in python |
| 04:41 | tomoj | you must speak a different language than I :( |
| 04:42 | callen-nyc | okay lets go ahead and pass on arity. |
| 04:42 | callen-nyc | and ignore the pattern matching. |
| 04:42 | callen-nyc | slicing. |
| 04:42 | callen-nyc | see the python slice above? |
| 04:42 | callen-nyc | howdoidothat? |
| 04:42 | tomoj | -> (subvec [0 1 2 3 4 5] 0 3) |
| 04:42 | sexpbot | => [0 1 2] |
| 04:43 | callen-nyc | subvector I take it that means? thank you. |
| 04:43 | callen-nyc | too bad I can't make that into a reader macro :P |
| 04:43 | callen-nyc | clojure.lang.ArraySeq cannot be cast to clojure.lang.IPersistentVector |
| 04:43 | brehaut | callen-nyc: nth is the equivalent of the index i believe |
| 04:44 | tomoj | subvec only works on vectors |
| 04:44 | callen-nyc | tomoj: re-split returns lists :( |
| 04:44 | brehaut | callen-nyc: or get if you have a vector |
| 04:44 | tomoj | -> (take 3 [0 1 2 3 4 5]) |
| 04:45 | sexpbot | => (0 1 2) |
| 04:45 | callen-nyc | take 3 works |
| 04:45 | callen-nyc | for a list without needing to cast, that is. |
| 04:46 | callen-nyc | thankee. :) |
| 04:51 | tomoj | -> (class (seq (into-array [1 2 3]))) |
| 04:51 | sexpbot | => clojure.lang.ArraySeq |
| 04:51 | tomoj | things that look like lists often aren't lists :( |
| 04:52 | callen-nyc | bwaha. |
| 04:52 | callen-nyc | I fixed ellipsize. |
| 04:52 | callen-nyc | bloodying annoying the way Halloway wrote the example |
| 04:52 | callen-nyc | had a space between the ellipsis and the final word. |
| 04:52 | callen-nyc | fixed :P |
| 04:53 | callen-nyc | (trivial I know) |
| 04:54 | defn | hey all |
| 04:55 | callen-nyc | defn: hahahaha. HN reader identified. |
| 04:56 | defn | callen-nyc: :X |
| 04:56 | callen-nyc | defn: nice name. |
| 04:56 | callen-nyc | defn: I work for a company that's in walking distance of Runa. |
| 04:58 | defn | callen-nyc: cool. My name IRL is Devin -- I actually had defn before I started messing with clojure |
| 04:58 | callen-nyc | defn: I'm sure a few educated guesses would suss my name out. |
| 04:58 | defn | :) |
| 04:58 | defn | nice use of the word suss |
| 04:58 | defn | i need to use that more often |
| 04:58 | callen-nyc | defn: nutty parents, loved words. |
| 04:59 | defn | callen-nyc: I'm almost definitely not qualified to work for Runa, but God would it be a great opportunity to dig in deep and cut off my friends and family for a year or so |
| 05:00 | callen-nyc | defn: where are you now? |
| 05:00 | defn | Wisconsin :\ |
| 05:00 | callen-nyc | defn: I have an ex-girlfriend I still talk to out there. |
| 05:00 | callen-nyc | defn: I did the cut-off thing about two years ago, NYC was a part of that. |
| 05:00 | somnium | defn: ever been to/driven through Beloit? |
| 05:00 | defn | hopefully she doesn't have the same name as my girlfriend |
| 05:00 | callen-nyc | defn: kinda don't miss them anymore, kinda wish I settle too. |
| 05:00 | defn | somnium: yes |
| 05:00 | callen-nyc | defn: I sincerely doubt you would be foolish enough to date this woman. |
| 05:01 | somnium | defn: cool, I went to school there |
| 05:01 | defn | Beloit College? |
| 05:01 | somnium | yeah |
| 05:01 | defn | Can you loan me a few grand? |
| 05:01 | somnium | heh |
| 05:01 | defn | :D |
| 05:01 | defn | I almost went to Beloit College, but the artsy emo kids made me want to stick my hand in a wood chipper |
| 05:02 | defn | that, and it was insanely expensive |
| 05:02 | somnium | its gone up I here |
| 05:02 | callen-nyc | lmao. |
| 05:02 | somnium | I graduated 2003 |
| 05:02 | defn | I think it's something like 34k or something per semester |
| 05:03 | somnium | they used to give away a lot of scholarships |
| 05:03 | callen-nyc | egads. |
| 05:03 | defn | yeah they still do actually -- i could have competed for one of them, but I would have been forced into an area of study |
| 05:03 | defn | they have a massive endowment |
| 05:04 | defn | Which admittedly may have been a better plan seeing as I dropped out of college |
| 05:04 | callen-nyc | ...did something change about the ^ reader macro? |
| 05:04 | callen-nyc | defn: I left after a single quarter ;) |
| 05:04 | defn | callen-nyc: yeah I think that's deprecated callen-nyc, or at least, it's going to be |
| 05:05 | callen-nyc | defn: I'm definitely raising a reader exception trying to use it. |
| 05:05 | callen-nyc | what's the bloody meta macro now? |
| 05:05 | defn | (meta) |
| 05:05 | defn | :) |
| 05:05 | callen-nyc | okay so there is none. |
| 05:05 | callen-nyc | frick. |
| 05:05 | defn | are you on 1.2.0-RC1 |
| 05:05 | callen-nyc | let's consult Mr. project.clj... |
| 05:05 | callen-nyc | -beta1 |
| 05:05 | somnium | there never was a meta macro |
| 05:06 | defn | what am i thinking of |
| 05:06 | callen-nyc | ^blah |
| 05:06 | defn | i thought ^ was once upon a time the meta macro |
| 05:06 | callen-nyc | ...yeah me too. |
| 05:06 | callen-nyc | it was in 1.0 I thought. |
| 05:07 | callen-nyc | has this been deleted from everyone's collective memory like a b horror movie? |
| 05:07 | somnium | that puts meta data on symbols at read time, not the same as (with-meta) |
| 05:07 | defn | yeah I'm sure of it because I got a lot of warnings throughout 1.1.0 as a result of ^ in libs I was using |
| 05:07 | defn | ahh somnium sure |
| 05:07 | defn | ,^{:a 1 :b 2} [1 2 3] |
| 05:07 | clojurebot | [1 2 3] |
| 05:08 | defn | ,(meta ^{:a 1 :b 2} [1 2 3]) |
| 05:08 | clojurebot | {:a 1, :b 2} |
| 05:08 | defn | ,(with-meta ^{:a 1 :b 2} [1 2 3]) |
| 05:08 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$with-meta |
| 05:08 | defn | oopsie-daisies |
| 05:09 | defn | ,(with-meta ^{:a 1 :b 2} [1 2 3] {:tags "vector"}) |
| 05:09 | clojurebot | [1 2 3] |
| 05:09 | defn | ,(meta (with-meta ^{:a 1 :b 2} [1 2 3] {:tags "vector"})) |
| 05:09 | clojurebot | {:tags "vector"} |
| 05:09 | callen-nyc | you've lost me. |
| 05:10 | defn | callen-nyc: http://clojure.org/metadata |
| 05:10 | callen-nyc | defn: that's all well and good, I knew that |
| 05:10 | somnium | its come up before, the disparity between ^ and (with-meta ...), Im sure there's more than one example in the logs |
| 05:11 | callen-nyc | defn: it's just that when I first learned Clojure, 1.0 prevailed and ^ worked as a reader macro for (meta ) |
| 05:11 | defn | somnium: indeed |
| 05:11 | defn | callen-nyc: yeah that's changed, now you use ^ like with-meta, and you use (meta) to return the metadata on the object |
| 05:12 | defn | somnium: correct that if it's spotty please -- it's 4:00 AM :) |
| 05:12 | callen-nyc | yeah I'm not following. I'll have to hash it out in my swank repl. |
| 05:12 | callen-nyc | I'm looking at the doc for with-meta and meta, I see nuhzink that would indicate ^ would be useful/necessarty |
| 05:13 | somnium | my understanding, which may be outdated, was that ^ is for type hints, and (with-meta ...) is for application-level metadata |
| 05:14 | Lajla | ->{:key (+ 1 2)} |
| 05:14 | sexpbot | => {:key 3} |
| 05:14 | defn | somnium: that is sounding closer to the truth, but I specifically remember refactoring some code to use (meta) instead of ^obj |
| 05:14 | Lajla | ->(eval {:key (list '+ 1 2 3)}) |
| 05:14 | sexpbot | java.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/eval) |
| 05:14 | somnium | although people still do (ns ^{:doc "blah blah" blah ...}) |
| 05:15 | somnium | for "constant metadata" I guess, though now Im inventing terms |
| 05:15 | Lajla | Lacous Somniorum |
| 05:15 | Lajla | Somnium, esne somians? |
| 05:15 | defn | bah humbug to ns metadata |
| 05:16 | callen-nyc | defn: sounds like global state vars to me. |
| 05:17 | defn | I think it's just being "fancy". No need for frills on an NS macro. |
| 05:18 | tomoj | clojure-mode doesn't like ns metadata |
| 05:18 | tomoj | therefore I don't like ns metadata |
| 05:19 | somnium | all hail clojure-mode |
| 05:19 | defn | Long live the Mode. |
| 05:19 | callen-nyc | hahahaha. major modes in emacs dictating programming practices. |
| 05:19 | callen-nyc | I'm guilty of the same in js :P |
| 05:20 | defn | http://clojure-log.n01se.net/date/2009-09-29.html#i43 |
| 05:20 | defn | rhickey: manic12: not necessarily, the point of deprecating ^ was so that it could replace #^ |
| 05:21 | callen-nyc | asdfsdf. I knew it. |
| 05:21 | callen-nyc | also, #^ isn't working either. |
| 05:23 | tomoj | -> (meta ^{} []) |
| 05:23 | sexpbot | => nil |
| 05:23 | tomoj | -> (meta ^{} ()) |
| 05:23 | sexpbot | => nil |
| 05:23 | tomoj | oh, hmm |
| 05:23 | tomoj | (meta ^{} ()) is {:line 1} for me |
| 05:24 | somnium | ,(meta ^String ()) |
| 05:24 | clojurebot | {:tag java.lang.String} |
| 05:24 | callen-nyc | , ^String |
| 05:24 | clojurebot | EOF while reading |
| 05:25 | callen-nyc | ,#^String |
| 05:25 | clojurebot | EOF while reading |
| 05:25 | callen-nyc | ,(meta String ()) |
| 05:25 | clojurebot | java.lang.IllegalArgumentException: Wrong number of args (2) passed to: core$meta |
| 05:25 | callen-nyc | ,(meta ^String ()) |
| 05:25 | clojurebot | {:tag java.lang.String} |
| 05:25 | callen-nyc | ,(meta #^String ()) |
| 05:25 | clojurebot | {:tag java.lang.String} |
| 05:25 | callen-nyc | ...okay? |
| 05:31 | defn | ,*clojure-version* |
| 05:31 | clojurebot | {:interim true, :major 1, :minor 2, :incremental 0, :qualifier "master"} |
| 05:32 | defn | callen-nyc: what are you looking to do |
| 05:34 | callen-nyc | sleep, in a moment. |
| 05:34 | defn | callen-nyc: heh |
| 05:35 | defn | callen-nyc: can you go tell Runa to hire me when you wake up? |
| 05:35 | callen-nyc | I'm still in NYC, haven't moved to Mountain View yet |
| 05:35 | callen-nyc | work from home. |
| 05:35 | defn | ah, can't say who you're working for? |
| 05:35 | callen-nyc | hahaha. not publicly in IRC ;) |
| 05:39 | defn | :) |
| 05:39 | callen-nyc | defn: I'm racking out. Later. |
| 05:39 | defn | callen-nyc: good talking to you, tell those Runa dudes I said hello :) |
| 08:55 | pdk | (doc iterate) |
| 08:55 | clojurebot | "([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects" |
| 08:58 | pdk | (doc char?) |
| 08:58 | clojurebot | "([x]); Return true if x is a Character" |
| 09:03 | serp_ | ,(take 5 (iterate inc 1)) |
| 09:03 | clojurebot | (1 2 3 4 5) |
| 09:09 | Lajla | ->(take 5 (iterate #(* % %) 2)) |
| 09:09 | sexpbot | => (2 4 16 256 65536) |
| 09:29 | raek | ,(derive :c :p) |
| 09:29 | clojurebot | java.lang.AssertionError: Assert failed: (namespace parent) |
| 09:30 | raek | ,(derive (make-hierarchy) :c :p) |
| 09:30 | clojurebot | {:parents {:c #{:p}}, :ancestors {:c #{:p}}, :descendants {:p #{:c}}} |
| 09:33 | pdk | (let [myfn (fn [x] (lazy-seq (cons x (myfn (inc x))))] (myfn 1)) |
| 09:33 | pdk | ,(let [myfn (fn [x] (lazy-seq (cons x (myfn (inc x))))] (take 5 (myfn 1))) |
| 09:33 | clojurebot | Unmatched delimiter: ] |
| 09:33 | pdk | ,(let [myfn (fn [x] (lazy-seq (cons x (myfn (inc x)))))] (take 5 (myfn 1))) |
| 09:33 | clojurebot | java.lang.Exception: Unable to resolve symbol: myfn in this context |
| 09:33 | pdk | bah |
| 09:34 | pdk | is there a way to define a function in a let block that's recursive but not tail recursive |
| 09:34 | pdk | aside from just making it its own helper function with an obscure name or something |
| 09:35 | raek | pdk: I know of two ways: (fn my-fn [x] ...) gives a name to the function itself, (letfn [(myfn [x] ...]) combines this with let |
| 09:36 | pdk | hmmm |
| 09:36 | raek | ,(fn foo [] foo) |
| 09:36 | clojurebot | #<sandbox$eval500994$foo__500995 sandbox$eval500994$foo__500995@12f9b2e> |
| 09:36 | pdk | the way with just fn my-fn might involve changing less code though is it considered bad practice in light of letfn |
| 09:36 | pdk | ,(let [myfn (fn myfn [x] (lazy-seq (cons x (myfn (inc x)))))] (take 5 (myfn 1))) |
| 09:36 | clojurebot | (1 2 3 4 5) |
| 09:36 | pdk | \o/ |
| 09:36 | pdk | cool beans |
| 09:37 | raek | either that or the letfn version is fine, I think |
| 09:38 | raek | ,(letfn [(myfn [x] (lazy-seq (cons x (myfn (inc x)))))] (take 5 (myfn 1))) |
| 09:38 | clojurebot | (1 2 3 4 5) |
| 09:38 | raek | not a very big difference |
| 10:19 | pdk | when you curry a function with partial are the provided arguments evaluated every time the curried function is called or just evaluated once and memorized in the function for each time you call it |
| 10:19 | pdk | say if i have (first x) or something like that as one of the provided arguments to the curried function and i don't want it to be the same value forever |
| 10:21 | pdk | (doc partial) |
| 10:21 | clojurebot | "([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args." |
| 10:26 | pdk | hmm |
| 10:26 | pdk | probably shouldn't count on %1 %2 etc working in partial forms |
| 10:33 | gerryxiao | slime git not work now? |
| 10:34 | gerryxiao | i got connection refused error |
| 10:35 | gerryxiao | git.boinkor.net[0: 2001:858:745:a0e4:200:1aff:fe19:d355]: errno=Connection refused |
| 10:35 | gerryxiao | fatal: The remote end hung up unexpectedly |
| 10:36 | gerryxiao | any ideas? |
| 11:20 | raek | I'm doing some Scheme now and I've started to miss Clojure's ability to do destructuring in let |
| 11:20 | raek | does Scheme have something similar? |
| 11:21 | gfrlog | doesn't clojure have a built-in queue data structure hiding somewhere? |
| 11:21 | raek | gfrlog: clojure.lang.PersistenQueue |
| 11:21 | qbg | raek: The implementation may have a version of DESTRUCTURING-BIND |
| 11:21 | gfrlog | thanks |
| 11:22 | raek | qbg: doesn't look like it in my case. (i'm using dr scheme) |
| 11:22 | qbg | ,(into clojure.lang.PersistentQueue/EMPTY [1 2 3]) |
| 11:22 | clojurebot | #<PersistentQueue clojure.lang.PersistentQueue@6b58d153> |
| 11:22 | gfrlog | so there aren't any clojure.core functions for it? |
| 11:22 | qbg | PLT Scheme/Racket is full of stuff, so there must be something somewhere |
| 11:22 | raek | yes, conj, peek and pop |
| 11:23 | gfrlog | this leads to a more general question regarding efficiency...if I use general seq functions a such a class, will it retain the efficiency characteristics of the original class, or might it end up morphing into a linked list or something? |
| 11:23 | raek | ,(let [q (into clojure.lang.PersistentQueue/EMPTY [1 2 3])] [(seq (conj q 4)) (peek q) (seq (pop q))]) |
| 11:23 | clojurebot | [(1 2 3 4) 1 (2 3)] |
| 11:24 | raek | the sequence functions return sequences, so yes, you cannot do e.g. append to the back on vectors after you have got a seq on it |
| 11:25 | raek | the functions that returns a data structure of the same kind are listed on the data structures page on clojure.org |
| 11:25 | raek | qbg: thanks anyway, will continue to look |
| 11:28 | gfrlog | raek: thanks |
| 11:53 | Bahman | Hi all! |
| 11:55 | gfrlog | hi |
| 11:56 | gfrlog | ,(let [tell-bahman-hi #(println "Hi Bahman!")] (tell-bahman-hi)) |
| 11:57 | clojurebot | Hi Bahman! |
| 11:57 | Bahman | gfrlog: Hello there! Weird way to say Hi however I liked it :-) |
| 11:57 | gfrlog | on second thought I would have had him use "Bahman: hi!" |
| 11:58 | bozhidar | gfrlog: you might have skipped the let part though ;-) |
| 11:58 | gfrlog | oh certainly, but I wanted to give the function a name |
| 11:58 | gfrlog | ideally I would use (defn tell-bahman-hi ...) but clojurebot would have glared |
| 12:00 | bozhidar | gfrlog: fair is fair |
| 12:02 | gfrlog | ,((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x))))) |
| 12:02 | clojurebot | ((fn [x] (list x (list (quote quote) x))) (quote (fn [x] (list x (list (quote quote) x))))) |
| 12:08 | qbg | ,(symbol (apply str (reverse "eval"))) |
| 12:08 | clojurebot | lave |
| 12:08 | qbg | ,(symbol "eval") |
| 12:08 | clojurebot | eval |
| 12:08 | qbg | ,(resolve (symbol |
| 12:08 | clojurebot | EOF while reading |
| 12:08 | qbg | ,(resolve (symbol "eval")) |
| 12:08 | clojurebot | #'clojure.core/eval |
| 12:09 | qbg | ,((resolve (symbol "eval")) '(+ 2 2)) |
| 12:09 | clojurebot | 4 |
| 12:09 | qbg | Uh oh... |
| 12:16 | gfrlog | ,((resolve (symbol "eval")) '(def gfrlog "glaven")) |
| 12:16 | clojurebot | DENIED |
| 12:16 | gfrlog | ,eval |
| 12:16 | clojurebot | #<core$eval clojure.core$eval@9524c6> |
| 13:19 | raek | ,((resolve (symbol "eval")) (list (symbol "def") 'raek-was-here "hello")) |
| 13:19 | clojurebot | #'sandbox/raek-was-here |
| 13:20 | raek | *evil grin* |
| 13:20 | raek | ,raek-was-here |
| 13:20 | clojurebot | "hello" |
| 13:21 | raek | ->((resolve (symbol "eval")) (list (symbol "def") 'raek-was-here "hello")) |
| 13:21 | sexpbot | java.lang.SecurityException: Code did not pass sandbox guidelines: (#'clojure.core/resolve) |
| 13:29 | jstirrell | /msg nickserv identify giovanni |
| 13:29 | jstirrell | as |
| 13:30 | jstirrell | damn i suck at irc |
| 13:46 | technomancy | oh snaaaap! |
| 13:47 | gfrlog | it's okay, to everyone else it looked like "********" |
| 13:48 | maravillas | heh |
| 15:25 | arohner | sigh. Why did Sun decide that Integer and String should be final? |
| 15:27 | qbg | String being final means you can't (without using reflection) violate invariants it imposes |
| 15:28 | arohner | yes, but there are nice things you can do with subclassing, without changing the behavior at all |
| 15:28 | qbg | The class library depends on String's behaviour, so that is enforced. |
| 15:29 | kotarak | Oh magic #clojure channel with thy infinite wisdom and knowledge! What might be the name and the author of the paper looking into the comparison operators, which clojure's = follows as far as I know? (Something with equal? equiv?) |
| 15:29 | qbg | egal |
| 15:29 | qbg | By Baker IIRC |
| 15:29 | kotarak | Ah. Thank thou, magic channel. |
| 15:33 | kotarak | Here the link FWIW: http://home.pipeline.com/~hbaker1/ObjectIdentity.html |
| 16:06 | tomoj | oh, I figured out why clojure-mode doesn't like ns metadata |
| 16:06 | tomoj | it's looking for #^ and not ^ |
| 16:06 | tomoj | if you add a ? after the # on line 703, it works fine |
| 16:08 | LauJensen | tomoj: technomancy is still maintaing that right? |
| 16:08 | tomoj | dunno |
| 17:06 | lozh | tomoj: raek put some fixes for that in his branch of clojure mode in the last couple of days |
| 17:13 | tomoj | cool, thanks |
| 17:26 | rubydiamond | anybody uses safari books online service |
| 17:34 | kencausey | rubydiamond: I used to, what do you want to know? |
| 17:34 | rubydiamond | kencausey: how is it |
| 17:35 | kencausey | It's pretty good, it all depends on whether they have books you value. |
| 17:35 | kencausey | I dropped it primarily to save money but also because in a way I've outgrown the library, I'm a little too far out on the bleeding edge for publishing now. |
| 17:37 | rubydiamond | hmm |
| 17:37 | kencausey | I suggest you browse the library and decide whether you can find at least 20-30 books you think you might want to reference in the next year |
| 17:37 | rubydiamond | kencausey: if i buy $10 month a plan, does it mean I can access all the books |
| 17:38 | rubydiamond | kencausey: okay.. |
| 17:38 | kencausey | Not really, you add a book to your library, it must stay there 30 days, taking up a slot |
| 17:38 | kencausey | and you have a limitted number of slots |
| 17:38 | kencausey | where do you see a $10 a month plan? |
| 17:39 | kencausey | I kept it as long as I did partially because I had a grandfathered 14.95 rate for what is now 22.99 |
| 17:39 | rubydiamond | kencausey: there is one with 5 slots $10 a month |
| 17:40 | kencausey | link? I know that used to have that but I don't see it on the site now |
| 17:40 | kencausey | s/that/they/ |
| 17:40 | sexpbot | link? I know they used to have they but I don't see it on the site now |
| 17:40 | kencausey | thanks but no thanks sexpbot |
| 17:41 | rubydiamond | Basic Starter - 5 slot Bookshelf |
| 17:41 | rubydiamond | it's $9.99 per month |
| 17:42 | kencausey | that sounds right, but I don't see it anywhere anymore |
| 17:42 | rubydiamond | hmm |
| 17:42 | rubydiamond | I can see it |
| 17:42 | kencausey | on https://ssl.safaribooksonline.com/subscribe ? |
| 17:43 | rubydiamond | kencausey: suppose I have 5 books in my slot |
| 17:43 | rubydiamond | can i change atleast one of them to other ones |
| 17:43 | kencausey | each one will have a 30 day countdown from the moment add it |
| 17:43 | kencausey | s/add it/you add it/ |
| 17:43 | sexpbot | each one will have a 30 day countdown from the moment you add it |
| 17:43 | kencausey | until that timer counts down, it can't be removed from the slot |
| 17:44 | rubydiamond | kencausey: that's bad |
| 17:44 | rubydiamond | there are folders too |
| 17:44 | kencausey | I rarely found it a problem in practice, but I had 10 slots |
| 17:44 | kencausey | I think the folder don't change anything, they are just organizational tools |
| 17:44 | kencausey | The really only relate to those users with more slots |
| 17:45 | kencausey | I suggest you go with the free trial though and decide for yourself |
| 17:45 | kencausey | I didn't fiddle with it much in the last year or so, it's possible something has changed and I did not realize it. |
| 17:45 | rubydiamond | hmm |
| 17:46 | rubydiamond | okay... slots concet is not that good |
| 17:47 | rubydiamond | concept* |
| 17:47 | kencausey | well, they can' |
| 17:47 | kencausey | t complete kill their print business yet ;) |
| 17:47 | kencausey | $43 a month for total free access doesn't seem unreasonable to me |
| 17:48 | kencausey | that's like 1.5 books a month, maybe |
| 17:48 | rubydiamond | kencausey: right |
| 17:48 | rubydiamond | thanks kencausey |
| 17:49 | kencausey | sure |
| 18:55 | fielcabral | Hello #clojure peeps. I'm a java programmer learning clojure. |
| 18:56 | brehaut | hi fielcabral |
| 18:56 | fielcabral | hi brehaut |
| 18:58 | danlarkin | hi fielcabral |
| 18:58 | fielcabral | hi dan larkin |
| 19:11 | tomoj | slyrus: so how do you use the json.clj parser? |
| 19:12 | defn | hello |
| 19:12 | fielcabral | hi defn |
| 19:12 | tomoj | oh, got it |
| 19:13 | raek | clojure.contrib.json? |
| 19:13 | clojurebot | clojureql is http://gitorious.org/clojureql |
| 19:14 | tomoj | (:product @(:result ((<document>) (h/make-state "{\"foo\":\"bar\"}")))) |
| 19:14 | tomoj | :/ |
| 19:22 | dash | ok so i just watched _Are We There Yet?_ and all I can say is "it's about time somebody said this stuff" |
| 19:24 | dash | what should I read next? :) |
| 19:36 | defn | dash: I think I've watched that lecture like 8-9 times :\ |
| 19:36 | dash | oh? |
| 19:37 | defn | dash: I have a mess of stuff for you to check out |
| 19:37 | defn | In fact (makes a todo) I'm going to post a huge backlog of all the links I have with some descriptions, but in the meantime: |
| 19:38 | defn | dash: http://delicious.com/thinkpaste/clojure |
| 19:38 | defn | that's all of my clojure stuff to-date |
| 19:38 | fielcabral | dash what is "are we there yet?" |
| 19:38 | defn | fielcabral: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey |
| 19:39 | fielcabral | thank you |
| 19:39 | defn | yw |
| 19:43 | flintf | dash: I've been watching the full disclojure series and finding them to be pretty good |
| 19:45 | dash | flintf: url? |
| 19:46 | flintf | dash: http://vimeo.com/channels/fulldisclojure |
| 19:46 | dash | ah, so just language tutorials. |
| 19:47 | dash | (disclaimer: I am a Python hacker looking for ideas to steal.) |
| 19:47 | flintf | ah, still you might find some good stuff in there |
| 19:51 | fielcabral | See you later guys. |
| 19:55 | ihodes | got a little typo to (?) report: on http://clojure.github.com/clojure/clojure.string-api.html under Overview, (ns your.namespace.here |
| 19:55 | ihodes | (:require '[clojure.string :as str])) is there; but there should be no apostrophe before the [clojure.string... |
| 19:59 | brehaut | dash, you would probably get a lot of mileage about of reading about clojure's sequence library and seeing how you could use similar ideas with itertools |
| 19:59 | dash | brehaut: Nah, that's hardly interesting |
| 19:59 | dash | it's the ideas about value, state, identity, and time that are interesting. |
| 19:59 | brehaut | dash: each to their own then :P |
| 20:00 | brehaut | but sequence is an important abstraction there! |
| 20:00 | dash | brehaut: oh? |
| 20:00 | brehaut | a sequence is not just a data structure |
| 20:00 | brehaut | you could concievably have (for example) a sequence of mouse possitions over time |
| 20:01 | dash | ok, so if it's not just a data structure, what else is it |
| 20:01 | brehaut | purely mechanically its basicly just an interface. similar to iter in python |
| 20:01 | ihodes | seq is an API in clojure |
| 20:02 | ihodes | a seq needs to implement 'rest' 'first' and 'cons' |
| 20:02 | dash | sure, what i've read about clojure's interfaces has been quite nice |
| 20:02 | ihodes | sorry–i'm probably stepping into a conversation that goes way back before i entered the room |
| 20:02 | brehaut | ihodes: not really |
| 20:03 | brehaut | dash, sequences allow you to take something that would be loopy or iterative and break it down into its fundamental computational parts |
| 20:03 | lancepantz_ | dnolen: you around? |
| 20:04 | brehaut | dash: the same as iterators do in oo langs. learning about how you can compose sequence manipulations is really powerful and applicable to a wide variety of languages |
| 20:08 | raek | actually, seqs don't implement cons... |
| 20:09 | raek | modulo some technicalities, first and rest is the whole interface |
| 20:10 | raek | sequences do what iterators do in other languages, but does not have the flaw that they mutate |
| 20:10 | dash | brehaut: sure. but like you said, python already has that |
| 20:10 | brehaut | dash yes im quite aware, but you were asking for ideas you could steal right? |
| 20:10 | dash | brehaut: and you're not missing much, i just got here myself :) |
| 20:11 | dash | brehaut: sure, but i want clojure's _good_ ideas |
| 20:11 | dash | like persistent data structures and concurrency and such-like. ) |
| 20:11 | dash | :) |
| 20:11 | raek | making iterators immutable is one of clojure's best ideas |
| 20:11 | dash | yep. |
| 20:12 | brehaut | raek: yes definately |
| 20:12 | dash | I think there are ways that the epochal time model can be combined with an object-oriented language. |
| 20:13 | raek | there's nothing that's in the way of implementing that model in a class-based system |
| 20:13 | dash | well. i'm not even talking about classes, particularly. |
| 20:13 | raek | it's just that the standard libraries are built with mutable objects in mind |
| 20:14 | raek | I was going to write object oriented, but when adhering to the epochal time model, I don't know if I would consider it object oriented anymore :) |
| 20:15 | dash | raek: well, there's a language called E |
| 20:15 | raek | maybe we will talk about Epochal Oriented Programming in the future.. |
| 20:15 | dash | it both has a principled model of time and concurrency _and_ is object oriented :) |
| 20:15 | dash | http://erights.org/ |
| 20:16 | jave | is there some triple-store with clojure bindings? |
| 20:16 | dash | and, not surprisingly, has a good set of persistent data structures |
| 20:17 | raek | a solid foundation for great ideas... |
| 20:17 | dash | so... basically i am contemplating a variant of python where the literals produce immutable lists/maps :) |
| 20:18 | raek | hrm, there is tuple-list, set-frozenset, dictionary-____ |
| 20:19 | raek | ok, maybe tuples aren't considered to be immutable lists |
| 20:20 | raek | python has gone some of the way by providing immutable data structures with value semantics |
| 20:20 | raek | it's great to be able to have, for example, sets as keys in dictionaries |
| 20:21 | raek | *frozensets |
| 20:21 | raek | I like your idea. python is my second favorite programming language... :) |
| 20:24 | dash | raek: yes, lack of immutable maps is the killer |
| 20:26 | raek | also, is there any way of "updating" python's tuples and frozensets (in a persistent manner)? |
| 20:27 | raek | I guess you can do splicing as with string... |
| 20:27 | raek | (also, +1 for immutable strings...) |
| 20:27 | raek | or should I say, "inc" |
| 20:29 | dash | raek: what's the difference between "updating" and making a new one? :) |
| 20:29 | raek | I was thinking about making a new one that shares structure with the old one |
| 20:30 | raek | i.e. don't copy everything |
| 20:30 | dash | oh |
| 20:30 | dash | implementation detail! ;) |
| 20:31 | raek | well, one of the neat things with persistent datastructures is constant time updating |
| 20:31 | dash | sure |
| 20:31 | dash | but you can go back and implement that whenever you like :) |
| 20:32 | raek | clojure's data structures are actually pretty simple |
| 20:32 | dash | sure |
| 20:33 | raek | I recommend reading http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/ and peeking into the source code |
| 20:35 | raek | anyway, it's amazing that persistent data structures practically can promise the same time complexity as mutable ones |
| 20:35 | dash | mostly my interest here is driven by working on a large scale python project and having to deal with the uncertainty promulgated by a big mess of mutable global state |
| 20:35 | dash | raek: yeah i'm mostly familar with older techniques like trailers and so forth |
| 20:36 | raek | I've heard about the Global Interpreter Lock |
| 20:37 | dash | yeah that's just an optimization introduced because they didn't want unsynchronized access to dicts |
| 20:38 | dash | and lists, etc |
| 20:38 | dash | Anyway that's not a concern for me, our app is single threade. |
| 20:38 | dash | d |
| 20:38 | brehaut | dash did you see the comments GvR made about CSP stuff and future pythons ? |
| 20:39 | dash | yes, it's rather depressing |
| 21:00 | dash | aah, and rich hickey's amazon bookshelf lists _Lisp in Small Pieces_ |
| 21:00 | dash | awesome. |
| 21:06 | defn | raek: nice reading material |
| 21:06 | defn | thanks for that link |
| 21:32 | raek | indentation and font-lock to the people |
| 21:32 | raek | http://github.com/raek/clojure-mode/commits/master |
| 21:33 | raek | good night |
| 21:33 | danielfm | nice! |
| 21:50 | defn | ooh ahh |
| 22:27 | technomancy | is test! a decent name for a lein task that cleans and fetches deps before running the tests? |
| 22:27 | technomancy | Antoine de Saint-Exupery would hate it, but I'm thinking about adding it to the next lein. |
| 22:34 | defn | Antoine de Saint-Exupery was a sap. |
| 22:35 | lancepantz_ | technomancy: i think it would make sense as an option to the test task |
| 22:43 | defn | http://feeds.feedburner.com/jobsrubynow?format=xml -- could someone tell me how to parse this? |
| 22:44 | duck1123 | Hey guys. Is Clojure still finicky about running with custom classloaders? I wrote an Openfire plugin using Clojure, but when I try to load it, I get an error that it can't find clojure/core.clj on the classpath |
| 22:44 | defn | im trying to do: (parse (slurp "http://feeds.feedburner.com/jobsrubynow?format=xml")) |
| 22:44 | defn | but it throws an exception |
| 22:48 | daaku | i'm at a point where i think some of my code could be split into a library. i want to basically create a new git repo for this library, but keep using it in it's source form since i'm actively developing both, rather than have to create a jar and install it to my local repo in a static fashion |
| 22:48 | daaku | anyone have suggestions on how best to go about this? |
| 22:49 | duck1123 | well, actually, I see clojure/core_init.class in the clojure jar. (1.2.0-master-SNAPSHOT) and since this error is coming from clojure.lang.RT I know it's loaded |
| 22:50 | rhudson | defn: leave out the slurp call -- xml/parse expects a string arg to be a URI |
| 22:51 | defn | rhudson: oh duh |
| 22:51 | defn | thanks rhudson |
| 22:52 | technomancy | lancepantz_: appending ! is like an option. =) |
| 22:52 | technomancy | the task definition is just (doto project clean deps task) |
| 22:52 | technomancy | which is why I would even consider adding it to begin with |
| 22:53 | defn | i sort of like being forced to throw another flag on there |
| 22:53 | defn | or at least that's the behavior id generally expect |
| 22:53 | defn | lein test --deps |
| 22:53 | technomancy | defn: the definition of the test task is _much_ cleaner if you assmue all its arguments are test namespaces to run. |
| 22:54 | defn | well then you've made up your mind! :) |
| 22:54 | technomancy | I do it right now with a shell alias lcdt = lein clean && lein deps && lein test |
| 22:54 | lancepantz_ | i don't think either is correct |
| 22:54 | technomancy | well, the question is whether to add this one-liner task or to just have people make a shell alias for it. |
| 22:54 | clojurebot | max people is 283 |
| 22:55 | lancepantz_ | i should say, i don't think either one is incorrect :) |
| 22:56 | lancepantz_ | the counter argument to the bang is that your doing something that is lispesque in bash |
| 22:56 | technomancy | we'll also add a method to chain tasks, but it seems like 90% of the usage of chaining tasks would just be for these three together. |
| 22:56 | lancepantz_ | "idiomatic bash" is a flag |
| 22:56 | lancepantz_ | but it is a clojure tool, so a bang make sense |
| 23:04 | mister_m | why should I learn clojure instead of python |
| 23:04 | rhudson | why not learn them both? |
| 23:05 | mister_m | if I thought I had the capacity to retain them both I probably would give that a try |
| 23:06 | rhudson | you might surprise yourself |
| 23:06 | rhudson | What languages do you know now? |
| 23:06 | mister_m | I suppose you might be right |
| 23:07 | mister_m | I wouldn't say that I really 'know' any, but I have some experience with java and C++ |
| 23:07 | lancepantz_ | mister_m: what are your goals? |
| 23:08 | lancepantz_ | to get a job? to learn? |
| 23:08 | lancepantz_ | enlightenment? :) |
| 23:08 | mister_m | lancepantz, I'd choose enlightenment and education |
| 23:09 | lancepantz_ | *cough* clojure *cough* |
| 23:09 | mister_m | :) |
| 23:09 | lancepantz_ | look over the first few chapters of the SICP |
| 23:09 | defn | forgive my ignorance: http://feeds.feedburner.com/jobsrubynow?format=xml --> How can I get a collection of titles from that XML? |
| 23:09 | lancepantz_ | it kinda touched me personally |
| 23:09 | rhudson | mister_m, then I'd say Clojure over Python, if you have to choose, in that Python is closer to the same kind/style/philosophy of language of C++ & Java |
| 23:10 | lancepantz_ | defn: have gist of what you have so far? |
| 23:10 | mister_m | what do you guys think of scheme? |
| 23:10 | defn | lancepantz_: yeah one sec |
| 23:10 | rhudson | I.e. you'll learn more learning Clojure than learning Python, I believe |
| 23:11 | defn | lancepantz_: http://gist.github.com/502905 |
| 23:11 | defn | practically nothing there :) |
| 23:11 | lancepantz_ | i like scheme, but sicp is my only experience with it |
| 23:11 | defn | i just havent worked with xml much, and the clojure.xml documentation is nil all the way around |
| 23:12 | rhudson | defn: it looks like that feed is RSS2, so you need to understand that schema |
| 23:12 | mister_m | I'm a little apprehensive wth scheme and other lisps, becuause the community is so fragmented |
| 23:14 | mister_m | between all the different implementations |
| 23:14 | defn | rhudson: how do you mean? I see: :rss, :item, :title |
| 23:15 | rhudson | defn: it means I *don't* know the RSS2 schema, so I couldn't have said offhand how to find a title. :) |
| 23:16 | defn | heh |
| 23:17 | Scriptor | mister_m: plt racket seems to be the major implementation rightn ow |
| 23:17 | Scriptor | *now |
| 23:17 | rhudson | But if tthere's a :title tag, you could use xml-seq to visit all the nodes in the doc, filter out the ones with tag=:title, and pull out the content |
| 23:18 | defn | there we go :) |
| 23:18 | defn | thanks rhudson |
| 23:18 | defn | wow that's slow... |
| 23:24 | defn | im thinking im doing something wrong :) |
| 23:25 | Bahman | Hi all! |
| 23:25 | rhudson | defn: I did like (->> url xml/parse xml-seq (filter #(= (:tag %) :title) (mapcat :content)) |
| 23:28 | notsonerdysunny | Hi all.. I am a newbie to both enclojure and netbeans. I am trying to build labrepl. The build seems successfull. However when I try to start the repl, it is telling me that the clojure-master-1.2.0-snapshot.jar and the corresponding clojure-contrib<..>.jar is not available.. when I try to rebuild .. I noticed that the maven build is unable to download those files due to non-availability of... |
| 23:28 | notsonerdysunny | ...the resource.. How can I fix this? |
| 23:36 | defn | rhudson: what's the diff between xml-seq and zip/xml-zip |
| 23:38 | lancepantz_ | heh, someone needs to make something that's like paste-bin, but an irc channel with a repl bot |
| 23:38 | rhudson | defn: xml-seq gives you a sequence of nodes, in depth-first order. |
| 23:38 | lancepantz_ | so we could all go to like #clj-8317313 and load an ns |
| 23:38 | lancepantz_ | and all share a repl |
| 23:38 | defn | that's an awesome idea |
| 23:38 | rhudson | zip/xml-zip gives you a "zipper" over the same tree, which lets you move around the tree and edit it |
| 23:39 | defn | lancepantz_: seriously. cool idea. |
| 23:39 | lancepantz_ | yeah, i realized i got your solution 10 minutes after rhudson had it |
| 23:39 | defn | then if you need to hop namespaces: /join #clj-ns2 |
| 23:39 | lancepantz_ | right |
| 23:40 | defn | (ns clj-ns2 (:use clj-8317313)) |
| 23:40 | defn | badda bing badda boom |
| 23:40 | lancepantz_ | yeah, that'd be cool |
| 23:40 | defn | i dont know how honest to god useful itd be |
| 23:40 | defn | but it could be fun for sure :) |
| 23:41 | rhudson | Maybe limit execution to some fraction of a second. |
| 23:42 | defn | or maybe just say: fuck it. let's get dirty. |
| 23:42 | defn | sandboxes are nice because you think: "this is great. ill be able to stop everything naughty from happening automagically" |
| 23:42 | rhudson | Whoever's paying for the cycles might not see it quite the same way... |
| 23:42 | defn | but then you realize it screws up all sorts of things you want to do |
| 23:43 | defn | rhudson: fair enough but I mean, I think as long as there was a nice layer that stopped you from reading/modifying files outside of the classpath or project-dir |
| 23:43 | defn | then id be obliged to trust people |
| 23:46 | rhudson | Well, I think most of the things we want to illustrate to each other don't take that long to run, and a time limit would prevent e.g. both deliberate and accidental infinite loops |
| 23:46 | defn | yeah but sometimes stuff takes time |
| 23:46 | rhudson | true |
| 23:46 | defn | like let's say we were working on a big xml document and we wanted to parse out XYZ and then do all sorts of computationally intensive things |
| 23:47 | lancepantz_ | maybe allow people to authenticate to it |
| 23:47 | defn | lancepantz_: not a bad idea |
| 23:47 | lancepantz_ | and if you're authed then you are allowed more cycles |
| 23:47 | defn | actually putting it on freenode might be a bad idea |
| 23:47 | lancepantz_ | it would have to be |
| 23:47 | defn | rate limiting would screw things up |
| 23:48 | defn | if i printed 300 lines to the REPL youd be scrolling while i was still typing |
| 23:48 | defn | perhaps spawning a little irc network where one person plays the host |
| 23:49 | lancepantz_ | there would be some limits with an irc interface |
| 23:49 | lancepantz_ | i think to solve what you're proposing you would want to make it a web app |
| 23:50 | lancepantz_ | how do they do those clojure sites, is that html5 stuff? |
| 23:50 | lancepantz_ | not java applets i assume |
| 23:50 | defn | simple JS |
| 23:50 | defn | and by "clojure sites" which do you mean? |
| 23:50 | defn | like "try clojure"? |
| 23:50 | lancepantz_ | like try clojure |
| 23:50 | defn | yeah that's just JS |
| 23:50 | rhudson | There's a Mac text editor (the name of which I'm forgetting at the moment) that allows multiple people to work on the same doc peer-to-peer. Something like that for programming would be cool |
| 23:50 | defn | you can get fancy with some HTML5 and CSS3 magic |
| 23:50 | defn | rhudson: subethaedit |
| 23:50 | rhudson | right |
| 23:50 | defn | are you guys emacs users? |
| 23:51 | defn | http://www.emacswiki.org/emacs/Rudel |
| 23:51 | rhudson | I swore off emacs years ago |
| 23:51 | defn | sharing a repl is hard... |
| 23:52 | defn | lancepantz_: if you wanna try out Rudel I've been curious to see if they've made any progress |
| 23:52 | lancepantz_ | looks interesting, i will sometime |
| 23:52 | defn | lancepantz_: with cake eval we might be able to do some of this stuff with a text editor |
| 23:53 | lancepantz_ | it'd be possible |