#clojure logs

2012-12-24

00:16alex_baranoskymy internet connection's out of whack, so sorry if I appear to be ignoring any responses
00:16alex_baranoskyThis appears to be doing what I want, but investigating further: (filter (complement coll?)
00:16alex_baranosky (rest (tree-seq coll? seq x)))
00:20Raynesalex_baranosky: Do you want to get a sequence of anything that isn't a collection? If so, the first one is great.
00:21alex_baranoskyRaynes: I want to break the body of a namespace into all of its 'atoms' aka strings/symbols/keywords/numbers/etc
00:22RaynesWhy on earth would you do a thing like that?
00:22alex_baranoskythe version I posted works for that, or so it seems
00:22alex_baranoskymaking slam hound work
00:22RaynesRename it to something useful while you're at it.
00:22alex_baranoskyI'll call it 'useful' then :)
00:23Raynesamalloy already has that
00:35tomojalex_baranosky: you need to upgrade swank-clojure
00:36tomojI have {:user {:plugins [[lein-swank "1.4.4"]]} {:dependencies [[swank-clojure "1.4.3"]]}}
00:36alex_baranoskytomoj: you saw my mailing list post? Thanks :)
00:36tomojseems like there should be a new lein-swank release
02:28bbloomdnolen: you totally need to do a core.logic version of http://luckytoilet.wordpress.com/2012/12/23/2125/
02:32bbloomneeds optimization, however
02:40tomojI vaguely remember there once being a big prize for a good minesweeper ai
02:41tomojoh
02:41tomojthat's just the P=NP prize
02:41tomoj:)
02:42tomojmedia: "you can win $1 million for solving minesweeper!"
02:56bawrLein, why do you hate me so? Or at least my CPU. :<
03:31Raynesbawr: What is it doing?
03:33bawrRaynes: I think it's trying to fry an egg. Except there is no egg.
03:33RaynesOkay.
03:35bawrI guess that's what I get for being lazy and doing OpenJDK instead of Sun's JDK.
03:54wingyi have a map with keys/values and want to sort them based on their values into a vector (since maps are unordered).. how can i do that?
03:55tomoj&(sort-by val (zipmap (range) (take 10 (repeatedly #(rand-int 100)))))
03:55lazybot⇒ ([2 0] [0 13] [1 28] [4 29] [8 46] [6 47] [7 52] [9 70] [3 92] [5 92])
03:56Raynes(sort-by val ..)
03:56RaynesWithout all the zipmap stuff that might confuse you.
03:58tomojI suppose {:foo 3 :bar 2 :baz 1} would have been less confusing :)
03:59wingyyeah .. im reading up on sort-by
04:00bawrtomoj: oh, but isn't it fun when 90% of your answer is just boilerplate for data generation? ;)
04:01tomojmaybe lazybot could have a-map etc bound by default to generally useful values
04:01mehworkis there a way to make it so defn foo [& args] will reset args each time it's called? right now when i print args it shows all the values that were ever passed to that function from everything that called it
04:01tomojeh, that's probably more confusing than helpful
04:04tomojmehwork: I think you must be confused about what's happening - if you refheap'd an example of the problem you might be able to get an answer
04:07callendoes anyone use a frontend asset compiler with their Clojure project?
04:07callenI found one that works for ClojureScript, but I need to roll in other dependencies.
04:08mehworktomoj where can i read about what & args does?
04:15tomojI dunno
04:15tomoj&(let [f (fn [& args] (println args))] (f 1 2 3) (f 4 5 6))
04:15lazybot⇒ (1 2 3) (4 5 6) nil
04:18tomojanyway, it just does what you probably want, not what you think it does :)
04:23wingyclojure is the best lang ever!
04:23Raynesoh em gee
04:25mehworkyou must not have seen php
04:26mehworkthey have lambduz and interfaces. Anything goes, even goto
04:26mehworkphp 6 is probably going to have inline asm
04:27wingyreally
04:27mehworkno, but it wouldn't surprise me :p
04:27wingymight have to check that out .. php sounds hot
04:28mehworkthey have bitwise operations even though none of their users will ever know what that means
04:28wingyi like goto .. it's like having a back door to any place
04:30RaynesYeah, but all the places are hell.
04:31RaynesAll of the places end with you being fired and me hating you.
04:32Ember-haha, PHP. Now there's a language :)
04:33Ember-it's so hilarious it has it's place in the programming world solely for that
04:33Ember-but of course it's less hilarious if you're forced to do anything serious with it
04:33Ember-I've been lucky and I've done only two semi serious things with it
04:33Ember-enough to see it's insanity
04:34wingythe creator should be executed on the spot
04:34wingywithout a trial
04:35Ember-I just love the attitude of the PHP creators
04:36Ember-this is a wonderful article about why PHP sucks so badly :) http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
04:36Ember-longish but worth the read
04:37callenbwahahahaha
04:37anon_1337isn't clojure the PHP of functional programming?
04:37callentechnomancy: I just broke your employer's system.
04:38wingyill save that for a before sleep reading
04:38clojurebotTitim gan éirí ort.
04:38callentechnomancy: I necromancy'd an ancient account and logging in threw a 500
04:38callenborkdude: trying to commit suicide?
04:39borkdudecallen hehe
04:42callengod dammit
04:42callenI tried logging in via another newer account and it 500'd
04:42callenis Heroku's admin panel down for anybody else?
04:43wingycallen: nope
04:43callenI must be cursed then.
04:44callenI've got two different accounts 500'ing.
04:44callenand it's Christmas
04:44callenso this is unlikely to get fixed for like...a week or two.
04:44wingyyou shouldn't be coding on christmas!
04:45callenwingy: I'm single, male, no family, an inveterate nihilist, and I have an itch to scratch. Heroku being down is slowing down my itch-scratching and that makes me mad.
04:45wingycallen: if you live in SF give me a call and we'll go n party :)
04:45callenwingy: actually, this is doable, I'm in Mountain View.
04:46borkdudecallen no family? they all died or ?
04:47callenborkdude: nobody's died recently, AFAIK
04:50Ember-hmm, in my opinion Christmas is the best possible time to code your own little projects :)
04:51borkdudeyeah, xmas is a good time for hobby coding
04:52Ember-just had a blast while sitting for 7 hours in a train
04:52Ember-did some programming for my own little project
04:53callenEmber-: agreed.
04:53callenin my case I have an actual itch to scratch that's been irritating me for a long time.
04:54Ember-yeah, I know what you mean
04:54callenEmber-: the project is a searchable personal database, mostly for notes and links.
04:55callenEmber-: it may sound like something I could use an existing webapp for, but you'd be surprised. I haven't found anything that was particularly good and focused on links. Delicious is fairly awful for how I collect links.
04:55Ember-hehe
04:55Ember-my project is the old play by email game called Stars! as a HTML 5 version
04:56Ember-I love that game but it *is* a bit too outdated for my taste
04:56Ember-so I decided to create my own version with modern technologies
04:56callenEmber-: that actually reminds me of something. "Play by email" is one of those slow-web things, I think there's a lot of room for "slow-web" asynchronous type stuff to get updated and brought into the modern world.
04:56Ember-which don't force you to install a separate client or anything, everything is in the browser and in the clojure backend
04:57callenEmber-: cool project :)
04:57Ember-yeah, I agree :)
04:57Ember-turn based and it will stay that way but will take advantage of real time possibilities provided by the architecture
04:57Ember-for example, in the original game diplomacy was done through tedious messaging system
04:58Ember-you wrote a message and the recipient received your message when next turn was generated
04:58Ember-now with modern browsers it's easy to create a realtime chat for that
04:59Ember-and I have a lot of other ideas too, but will start with a nearly identical copy of the original game since I'm not a game developer and I might very easily break the balance
05:00callenEmber-: are you familiar with the game, "OGame"?
05:00Ember-no
05:00callenEmber-: it had a funky mix of time-delay-based asynchronous gameplay
05:01callenEmber-: it wasn't "turn based", as in, you could repeatedly take actions before your opponent could
05:01Ember-this one? http://www.ogame.org/
05:01tomojwow, 0 and O look identical in the font I use in emacs. wtf and how have I not noticed this before?!
05:01callenEmber-: but the time-scale was very different, it'd take 2, 10, 20 hours to send a fleet to attack a planet dpeending on how far away it was
05:01callenEmber-: yes that.
05:01callentomoj: that's pretty egregious.
05:02callentomoj: OTOH, when your programming language doesn't consider a boolean false and 0 to be identical, you don't see as many of them...
05:02callenEmber-: anyway, just thought I'd mention a game that has some similar design priorities.
05:02Ember-yeah, nice to know about that
05:02Ember-thanks
05:03Ember-I'm happy to have inspiration from all kinds of games for my little project
05:03Ember-"little"
05:03Ember-:D
05:03callenEmber-: I'm kinda obsessed with game mechanics as a general subject and hobby.
05:03Ember-let's see if this finishes
05:03callenEmber-: like for example, I've spent a fair bit of time just thinking about how different games and systems model "time".
05:03Ember-:)
05:03callenthere's more variety than one might suspect, but not as much as it merits.
05:04callenand I don't mean some kitschy gimmick like being to reverse time.
05:04Ember-I kinda like the idea of linear time progress instead of turns
05:04Ember-but it makes a lot of things harder
05:04callenEmber-: aye. So the way you could linear time progression ala OGame is to allow user actions to create scheduled triggers (events)
05:04Ember-yeah, I understand
05:04Ember-it's in many ways similar to the way Stars! works
05:05callenEmber-: the reason for a linear time progression model is that it allows for many people to act in concert
05:05Ember-you tell your ships etc that "when you encounter x do y"
05:05callenEmber-: the reason is to allow an MMO scale of galaxy.
05:05callenmany people cooperating, etc.
05:05Ember-yeah, well that is achieved also in turn based game via diplomacy
05:05Ember-but that *is* an interesting idea
05:05callenwell the issue with a turn-based game, especially as the number of players increases, is that everybody blocks on whoever hasn't taken their turn.
05:06acron^how can I turn a string (":a") into a map key (:a
05:06acron^(:a)*
05:06Ember-it might be a good idea to build my game in such a way that you could start the game later as linear time based
05:06callenacron^: don't use :a
05:06Ember-first the turn based version, later the linear time
05:06Ember-if I find it feasible
05:06callenanother reason OGame was built that way, was to allow for a flexible amount of "investment" into their actions.
05:06callenwhereas turn-based games by definition have a limited amount of action you can take per turn
05:06acron^callen: i kinda need to
05:06callenacron^: it's straight forward to convert "a" -> :a
05:07Ember-callen: yeah, that is indeed a problem with turn based games
05:07Ember-the time it takes for ppl to wait for that one micro manager to finish his turn
05:07callenOGame allows some people to invest more in expanding their economy by spending more time tweaking and scaling up
05:07callenit also eliminates the blocking problem as you just mentioned
05:07Ember-needs careful design though to work
05:07callenThere were a lot of issues with OGame's game mechanics though
05:07acron^callen: that's the question i'm asking..
05:07callenone is that people with absolutely no lives had HUGE economic advantages
05:08acron^callen: if it's easy, how is it done?
05:08Ember-for example if you spend most of your time just waiting for your ships to move to their destination it's not fun
05:08callen,(keyword "a")
05:08clojurebot:a
05:08callenacron^: ^^
05:08acron^thank you
05:08Ember-and in the start of the game your technology is so lame that everything will take time
05:08callenEmber-: another issue is that one of the nice things about a turn-based game is that they tend to be a lot more fair
05:09callenEmber-: the economic advantage of spending more time playing OGame gave it the grindy feel of an MMO. Unpleasant and unsustainable long term.
05:09Ember-yeah, I can see why
05:09callenthe build-up to better technology did take quite some time, but once you leveled off at the top-tier, *everything* became about economics
05:09Ember-I'm considering of adding a game mode where there is a time limit for the game turn
05:09callenbecause once you're at the top tier, it's purely about who has the bigger fleet
05:09Ember-one which could be increased on fly via galactic election :)
05:10callenEmber-: you could call it galactic hot potato.
05:11acron^callen: that's erroneous
05:11acron^callen I asked for ":a", not "a"
05:11Ember-,(str ":" "a")
05:11clojurebot":a"
05:11Ember-:P
05:11acron^but then (keyword ":a") doesn't work
05:12acron^i need to remove the ":" before keywording it
05:12borkdude"For two millenia, the idea of mimicking the real world has actually imprisoned geometry." (isn't this also true for OO programming? ;-))
05:12callenacron^: that's what I was saying.
05:12callenborkdude: meh. I blame Simula.
05:12acron^(second (string/split ":a£" ":")) <- ?
05:12callenborkdude: funny part is, CES ends up being better than OO/inheritance for doing actual simulations.
05:13borkdudecallen CES?
05:13callenacron^: probably good enough.
05:13acron^callen there isn't a nicer way?
05:13callenacron^: I'm cringing a bit at the possibility of more than one colon.
05:13callenacron^: you could stop generating keywords from strings, for a start.
05:13callenborkdude: component entity systems
05:13callenborkdude: composition, separation of state and logic, etc
05:14acron^callen: don't really have a choice, it's from url params
05:14callenborkdude: not quite "functional", but has similar design priorities. it's popular for game development and simulation systems these days.
05:14borkdudecallen ah
05:14callenacron^: you always have a choice. Are you using maps?
05:14callen,(get {"a" "b"} "a")
05:14clojurebot"b"
05:15callenacron^: ^^
05:15callenacron^: stop generating keywords.
05:15callenacron^: refheap your problem.
05:15acron^ok
05:15acron^2 secs
05:17Ember-well, time to spend Christmas away from computer :)
05:18tomojOO fails to mimic the real world
05:19callentomoj: you're being verbose, let me help you. "OO fails"
05:19tomojI suppose they have an idea that they're mimicking the real world
05:19tomoj:)
05:19SiphonblastCouldn't you technically develop a game in clojure if you used the java OpenGL bindings?
05:19bawrStars! on a Clojure channel. Ecellent. :)
05:20acron^callen: https://www.refheap.com/paste/7836
05:20borkdudebawr stars? wadda you mean?
05:20callenborkdude: Stars!
05:21ziltiI wouldn't say OO fails per se. e.g. when working with GUI stuff you always end up using objects.
05:21callenacron^: okay. well I answered the original question, what's the current problem?
05:21acron^callen: when you asked for refheap I assumed you wre going to pass comme ton my structure
05:22acron^comment*
05:22acron^is there a better way I should be doing this?
05:23borkdudecallen bawr I'm clearly missing smth =)
05:23callenacron^: I assumed you were a lost cause when I saw you were using MangoDB
05:24acron^why? :\
05:24callenacron^: more seriously, in the context of that refheap what you're doing has an internal...sense to it, but that doesn't mean I don't suspect it could be done better. You've created the need for some mildly 'meta' programming, you may just have to do it like this.
05:25callenacron^: could describe at a high level what you're doing?
05:25callenacron^: are you enabling users to query something?
05:25callenacron^: MangoDB is the data store of choice of scoundrels, nihilists, and people that don't care about their data.
05:26callensince I am all of those things, I too use MangoDB.
05:26acron^callen: yes ^ as a proof of concept for a web app I'm attempting to map url params to queries in mongo directly
05:26acron^however i want to support both OR and AND operations
05:26callenacron^: pretty dangerous. God help you.
05:27acron^well, it is and it isn't
05:27acron^i put my faith into the monger library :p
05:27callenprobably don't want to be injecting user-entered strings into your db queries. Just uh, gonna put that out there.
05:28acron^but it's not strings, it's all broken down to clojure types before then getting converted back again
05:28acron^anyway
05:28acron^this isn't about the shoulds or shouldn'ts
05:30borkdudeMangoDB is smth new? or is it MongoDB? things are moving so fast these days ;)
05:31acron^He means MongoDB :p
05:31callenborkdude: MangoDB is web scale rockstar ninja tech
05:31acron^(second (clojure.string/split ":a" #":")) just feels so ugly
05:31callenacron^: it is. for one thing, use a friggin' regex
05:31callenthat code breaks on ":a:something_important"
05:32acron^i know
05:32callenacron^: you make me feel like I'm begging a crazy person not to stab themselves.
05:32ziltiacron^: What if you'd just drop-while?
05:33acron^zilti: if it's not obvious i'm a clojure noob. what's drop-while ?
05:33borkdude,(name :a)
05:33acron^callen: there comes a time in every coder's life when he has to bleed a little
05:33clojurebot"a"
05:33ziltiacron^: It drops stuff from a collection as long as the helper function returns true
05:34acron^zilti: sounds good
05:34zilti&(drop-while #(= % \:) ":a:b")
05:34lazybot⇒ (\a \: \b)
05:34bawrborkdude: there was a discussion about a Stars! (an oldie but goodie game) clone as a holiday project.
05:34ziltiOops
05:34ziltiWell you'd have to turn it into a string again afterwards
05:35acron^zilti: that's fine, i can do this begfore it's a string anyway - thank you
05:35borkdudebawr ah
05:35callen,(drop-while (fn [blah] (= blah \:)) ":a:something_important")
05:35clojurebot(\a \: \s \o \m ...)
05:35ziltiacron^: #(= % \:) is short for (fn [char] (= char \:)
05:36acron^callen: how does the second colon make it through?!
05:36tomojand long for #{\:}, sort of :)
05:36callen,(apply str (drop-while (fn [blah] (= blah \:)) ":a:something_important"))
05:36clojurebot"a:something_important"
05:36callenacron^: that's...the point.
05:36callentomoj: I'm trying to write code, not obfuscated Russian emoticons.
05:37ziltiacron^: That's why it's called "drop-while". http://clojuredocs.org/clojure_core/clojure.core/drop-while
05:37acron^zilti: sorry, the semantic fail is mine
05:37ziltiacron^: No reason to say sorry for that :)
05:37acron^it still serves me better than my existing solution
05:38tomojto me, #{\:} is idiomatic, not obfuscated
05:38callentomoj: I was kidding.
05:38tomojI suppose sometimes "idiomatic" is just a euphemism for "obfuscated" :(
05:38ziltiHmm I wonder why that happens:
05:38zilti&(= (apply str (concat (drop-while #(= % \:) "::abc:de"))) (str (concat (drop-while #(= % \:) "::abc:de"))))
05:38zilti
05:38lazybot⇒ false
05:39callentomoj: no, it's fine. Your code was good.
05:39callentomoj: you really shouldn't take me seriously.
05:39ziltiWhat's the point of #{\:} ?
05:40callen,(#{\:} \:)
05:40clojurebot\:
05:40tomojbut really, many things called "idiom" are not very clear. (if (seq x)) being more idiomatic than (if (not (empty? x))) for example
05:40callen,(#{\:} \b)
05:40clojurebotnil
05:40callenzilti: ^^
05:41tomojeven though the latter is more clear to those who don't speak the idiom..
05:41acron^i need to learn the basics before i think about idioms. coming from C++ this is a real challenge for me.
05:41callenare you serious?
05:41zilticallen: Thanks. I guess. ^^
05:41bawrI wouldn't say (if (seq)) is terribly idiomatic, one of the first things you learn is that seq gives nil on empyty sequences, and that nil is false.
05:42callenC++ (for me) is like having my limbs ripped off and the wounds salted.
05:42acron^nice image
05:42ziltiDoes anyone btw know what happened to clojuredocs.org?
05:42callenzilti: ...it's still there?
05:42acron^C++ can be pretty eloquent if it's done well, you know
05:42zilticallen: Yes, but it's still at 1.3
05:43acron^Especially now we have C++11
05:43callenacron^: I am a fan of C++11, but yeah, not really a general purpose lang for me.
05:43ziltiWhat I always hated about C++ is that you need not one, but two files (damn header files!) for one class.
05:43acron^zilti: technically you don't need a .cpp ;p
05:44acron^still not sure where clojure will fit in my toolbox but i am enjoying the purity of it so far
05:45ziltiAnd that let's-manage-our-memory-by-hand stuff. It was fun for the little one-threaded simple game I wrote, but I imagine it can be the hell for larger stuff.
05:45acron^zilti: well, yes. for larger stuff you write a memory manager
05:45callentomoj: but on a more serious note, while what you did was idiomatic, abusing set membership for what was fundamentally a filter was a little cutesy.
05:45callentomoj: apparently it scares the younglings too.
05:45acron^^ it does
05:45callenshould show them some APL, let them know some real horror.
05:46acron^:E
05:46tomojI almost always write #{x} for #(= % x). that's abuse?
05:47ziltiAPL... has that been invented by a greek?
05:48tomojhmm, wasn't there something about how literal set notation is not really meant to be used with non-literal values?
05:48callentomoj: it's not abuse, it's just cutesy.
05:48bawrAPL is all fun and games until someone pokes their eye out.
05:48callentomoj: it's an obvious byproduct of familiarity and brevity overtaking obviousness of expression
05:49tomojoh I guess the problem case was #{x y} when (= x y)
05:49callentomoj: I don't think it's a bad idiom. I'm just saying that a newbcake is going to *_* when they see it.
05:49callentomoj: pardon me for caring about the computing third world.
05:50ziltiI've seen that for the first time today, but when you know that "kewords" are functions taking collections as arguments and the other way around, #{x} is pretty obvious.
05:51tomoj&(let [x nil] (remove #{x} [nil nil nil]))
05:51lazybot⇒ (nil nil nil)
05:53ziltiThe difficult thing at functional programming is that you just have that huge pile of functions laying in front of you without a real organisation behind it compared to OO. That made it a bit difficult for me to start with it.
05:54tomoj&(read-string "#{x x}")
05:54lazybotjava.lang.IllegalArgumentException: Duplicate key: x
05:54tomojof course..
05:55ziltiArgh why doesn't korma support many-to-many?
05:57callenzilti: it doesn't officially but it certainly works.
05:57acron^my god, lein is frustrating
05:57callenacron^: try sbt or cabal sometime, then report back.
05:57ziltiacron^: Then you better never try Scala's "Simple Build Tool". THATs hell.
05:58callenzilti: https://github.com/korma/korma.incubator
05:58Rayneszilti: That isn't true at all.
05:58zilticallen: There's an implementation in korma.incubator
05:58callenlol @ zilti quoting the same awfulness as me.
05:58Rayneszilti: That's what namespaces are for.
05:58ziltikik
05:58callenand then mentioning the same lib as me
05:58zilti*lol
05:58callenRaynes: hey. you. Laser.
05:59acron^are you infact a single consiousness in two bodies?
05:59callenRaynes: so it looks promising but the Enlive people want their CSS selectors and other niceties. Whatcha gonna do to keep it from getting complectified?
05:59callenacron^: I am large and contain multitudes.
05:59Raynescallen: I've got plans to write a real implementation of CSS selectors separate from everything else and provide it as a function call and such.
05:59ziltiWell lol, the korma.incubator implementation seems to be broken, or can someone here confirm it's working?
06:00callenRaynes: I guess what I'm wondering is, what parts of enlive are you going to refuse to implement to keep it simpler?
06:00callenbecause there has to be something.
06:00Raynescallen: I haven't found anything yet.
06:00ziltiRaynes: Did you write the wrong person with "That isn't true at all"?
06:00Rayneszilti: No.
06:00ziltiArgh. I'm always trying to use autocomplete in IRC
06:01Raynes"The difficult thing at functional programming is that you just have that huge pile of functions laying in front of you without a real organisation behind it compared to OO."
06:01RaynesI was responding to that.
06:01callenzilti: Raynes is a hyper-dimensional being that transcends space and time. Your mortal conceptions of "ancient history" are but a blink of the eye for him.
06:01callenzilti: also, /lastlog
06:02ziltiRaynes: Oh I see. Well, look at clojure.core and tell me it's well-ordered compared to OO core-libs, I'd say it's not. After some time you just know what that stuff is for and that it makes sense not to order it more.
06:02callenI'm sorry, what's wrong with it?
06:02Raynescallen: I'm sure there are things missing from laser that are in Enlive, I just haven't seen anything important yet, and I figure people will let me know if there are useful things missing..
06:03Rayneszilti: clojure.core is a collection of functions that are meant to be available all the time. Is is a totally different thing.
06:03callenRaynes: I guess what I'm wondering is whether scope-creep will simply inflate it to where Enlive is now.
06:03RaynesYou want to look at libraries. Not bootstrapped Clojure libraries.
06:03Raynescallen: No.
06:03ziltiRaynes: Yes, of course, but that doesn't make it less overwhelming for newbies. I don't want to have this changed, don't misunderstand me.
06:03Raynescallen: If I thought that was a possibility, I wouldn't have bothered.
06:03bawrzilti: Compare it to Python's builtins or something, it's really not much different.
06:04bawrzilti: Well, Clojure is supposed to be simple, not easy. ;)
06:04Rayneszilti: I'm not disagreeing that it can be annoyingly cobbled together.
06:04borkdudewould it be awkward if +,- etc would be moved to a namespace called clojure.math instead of clojure.core?
06:04callenRaynes: fair enough, I just don't know how to differentiate the purpose of the two beyond the fact that laser is newer and possibly less inclined to require the user to understand astrology.
06:04callenborkdude: yes.
06:04ziltiborkdude: yes
06:05callen,(prn "borkdude: yes")
06:05clojurebot"borkdude: yes"
06:05borkdudeif yes, then you've got your answer.
06:06ziltiAbout that korma.incubator many-to-many implementation - has anyone used that and it worked?
06:06callenibdknox: many-to-many in korma.incubator. Is good?
06:07acron^does Ring produce error logs? somewhere? anywhere?
06:07Raynescallen: To answer someone's question of "Why laser instead of enlive?", my answer would be something like "Laser is smaller and takes a combinator based approach over a faux-css selector approach. It has (or will have) better, clearer documentation, the code will be cleaner and make more sense, and it should always be well maintained."
06:07callenacron^: Ring never has errors and therefore has no error logs.
06:08callencombinator based approach. ogod.
06:08acron^Oh right. That's fine then.
06:08callenRaynes: have you been smoking the Haskell again?
06:08Raynescallen: Get out of my internet.
06:08acron^callen: So...what happens...when it crashes?
06:09RaynesIt doesn't.
06:09RaynesObviously.
06:09acron^Well, something is
06:09ziltiIt's your code
06:09callenacron^: http://mmcgrana.github.com/2010/07/develop-deploy-clojure-web-applications.html
06:10acron^https://www.refheap.com/paste/7838
06:10callenI cringe at linking the apostate's website, but it's a good place to start.
06:10callenacron^: just...go work through the tutorial I linked.
06:10acron^:(
06:10callenacron^: if you still can't figure it out by the time you get to the bottom of the page, check back.
06:10acron^dont be angry with me callen..
06:10callenacron^: I'm not trying to be an asshole, it's just...logging is something you do
06:10acron^look at my refheap
06:10callenacron^: I'm not angry, I'm just trying to be maximally helpful.
06:11Raynescallen: Anyways, like I said, there will be real css selectors eventually. I'm clearing out the last bugs before I bother with it.
06:11callenacron^: whoa, cool error.
06:11acron^I know, right?
06:11Raynescallen: Hah, Mark is an apostate? :p
06:11callenRaynes: yes?
06:11callenacron^: add logging
06:11callenacron^: read the tutorial I linked
06:11Raynescallen: Because he started using Go?
06:11callenI'm super srs.
06:12callenRaynes: yes.
06:12acron^reading
06:12callenRaynes: gophery apostate.
06:12ziltiWhy does he do (-> #'handler instead of (-> handler ?
06:12RaynesHah
06:12Rayneszilti: Because if you refer to #'handler, if the thing the var refers to changes (in place, ew, mutable, ew) the changes will be seen.
06:13borkdudemutable… aaaaaaaah, it burns…
06:13callenI can't decide if this is for code-reloading or bizarre satanic rituals.
06:14ziltiWell ok, so I probably won't ever need it.
06:14RaynesThe forme.r
06:14borkdudecallen both
06:14Raynesformer*
06:14callenthen I'm keeping it.
06:14Raynescallen: It's particularly useful for REPL development.
06:15ziltiSo it's a "recalculate the surrounding expression if this variable changes" thing?
06:15callenzilti: I think it's more along the lines of "don't use the persistent result of this reference, just keep dereferencing the var"
06:16callenif the underlying var changes, the result changes
06:16Rayneszilti: #'handler = the handler var. You're referring to the var and not the thing inside of it, so if the thing inside of it changes...
06:16RaynesBang, you has new thing.
06:16ziltiRaynes: Like pointers.
06:17RaynesUh, well, like anything mutable ever.
06:17Raynes'fraid I can't comment on pointers, never used C.
06:17callenRaynes: pointers in C point to fully mutable memory locations
06:17ziltiEverybody kept telling how difficult they are to understand, but I found it to be damn easy. It's just by-reference instead of by-value.
06:18callenRaynes: the ground falls out from underneath you quickly
06:18callenbtw, I produced a demonstration of what I was talking about
06:18callenzilti: https://www.refheap.com/paste/7839
06:18callenpedagogy via repl. woohoo.
06:18ziltiI found clojure atoms to be kinda like pointers in some way
06:18callenvars and java references are all pointers.
06:19callenthe semantics of Java are reference-semantics weakly imitated by by-value passing of pointers to objects.
06:19callenPython is the same way, references don't live longer than their by-value pointers.
06:20callendereferencing a re-instantiated object will go somewhere other than the last time you dereferenced the object, it will not overwrite the original.
06:20callenRaynes: does my paste explain the matter well, do you think?
06:20ziltiCallen: You made a mistake. You called woot before you defined it, I guess it's supposed to be (blah "blah") on line 3?
06:21callenzilti: that's not a mistake, ignore that line.
06:21callenzilti: I was building up to the experiment, invoked woot to test an assumption.
06:22ziltiWell by now I really, really prefer by-value.
06:22callenzilti: the persistent and immutable nature of Clojure data structures by default give you what amount to by-value semantics.
06:23callenzilti: it's just that deep down, references underlie how it works in the JVM
06:23callenand incidentally, vars are really just mutable references anyway.
06:23callenfor convenience's sake more than anything else.
06:23bawrzilti: pointers are one of those things you either get immediately, or never fully get
06:23callenbawr: I always saw them as index cards with a number on it. If you looked at that number's location in a series of cardboard boxes, you might find your data.
06:24callenthat or SEGMENTATION FAULT^D
06:24bawrI never needed a visualisation, they just made sense.
06:25callenbawr: I didn't need one, but the analogy is more to explain my internal mental model than anything else
06:25borkdudepointers, aren't they like cofunctorial invariants under the mutability monad? I'm just guessing
06:25bawrYeah, that's a number at an address in memory that points to another address in memory.
06:25callenborkdude: somebody's been smoking the Haskell.
06:25borkdudecallen not really, just bullshit ;)
06:25acron^How is this my code that's the problem?? https://www.refheap.com/paste/7840
06:25bawrcallen: heh, fair enough. I don't see how a different mental model can be made. ;)
06:26callenacron^: becaus --- Subprocess failed
06:26acron^the server didnt even start!
06:26callenacron^: your code is bad and you should feel bad.
06:26acron^argh
06:26callenacron^: it's Christmas, don't be frustrated.
06:27callenacron^: this is the universe telling you to go drink some eggnog and wrestle with a cousin.
06:27acron^:\
06:27acron^I'd rather not
06:27callenacron^: okay okay, fine. So you're a misanthrope like me.
06:27acron^Absolutely
06:28acron^I'll be here tomorrow, flagellating myself some more
06:28borkdudewhy are you a human hater if you don't drink egg nog?
06:28callenacron^: sexy. See you then Friar Tuck.
06:30acron^I wonder if it's a memory issue...
06:31callenacron^: how much do you got?
06:31acron^Well
06:31acron^i'm running this on an ec2 micro
06:32callenacron^: ಥ_ಥ
06:32acron^~100mb
06:32clojurebotHuh?
06:32acron^(lol)
06:32callen,(lol)
06:32clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: lol in this context, compiling:(NO_SOURCE_PATH:0)>
06:32callenthat is a travesty.
06:32callenwe need a lol function.
06:33acron^(lol [1 4 7]) => "LOL"
06:33callenyes.
06:34acron^fuck
06:34acron^it's memory
06:34Ember-callen: (defn lol [& _] "LOL")
06:34Ember-you're welcome
06:34acron^7800k free
06:34callenacron^: derp.
06:34bawrhurr
06:34callenEmber-: thanks, but I want it in clojure.core
06:34Ember-I don't :)
06:34Ember-this ain't PHP
06:34Ember-:P
06:35callenEmber-: fair.
06:35bawrcallen: the whole point of clojure is being able to fill in the missing functionality, now stop belly-aching. ;P
06:35borkdudecallen lucky for you namespaces are not sealed, so you can put it in whenever you want, in your own program
06:35ziltihttps://www.refheap.com/paste/7841 <- Could anyone take a quick look at my error message? I'm not even trying to drop anything named like that in a schema like that
06:36Ember-:D
06:36callenSchema "KORMA" nicht gefunden I take this means, "does not exist"?
06:36callenor not found?
06:36zilticallen: Yes, it's "not found"
06:36bawrNot found.
06:36zilticallen: But that's pretty much the same for h2
06:37zilti*is the same.
06:37callenzilti: can you get the generated SQL?
06:38zilticallen: I'll try.
06:38zilticallen: Just I have no Idea where that SQL string comes from. It's a drop table which korma doesn't support, so it's a hand-crafted SQL string
06:39bawrWhy do you get errors in German, anyway?
06:39borkdudehmm &_ is a valid symbol name in clojure for a var, how nice
06:39ziltibawr: I live in Switzerland and the computer locale is swiss-german and h2 supports german, so I suppose that's why.
06:40callenborkdude: &_ is a clear indication to the user that, "this function cares not for your silly data!"
06:40bawrzilti: I live in Poland and make it a point to tweak my locale to use English. Precisely because of that error-translation bullshit.
06:40borkdudecallen I forgot a space between & and _, then it actually expects always 1 arg ;)
06:40bawrEnglish arrors are so much more googlable.
06:40callenzilti: Schweizerdeustch. ugh.
06:41ziltibawr: Luckily h2 gives the message in both languages
06:41bawrOoh.
06:41bawrWell, that's saner.
06:41ivaraasencallen: it's the best German, man
06:41callenivaraasen: no.
06:42ziltiArgh. I looked at that code a dozen times and didn't see it. Now it makes sense: (str "DROP TABLE IF EXISTS " clojure.core.table) is bullshit
06:43zilti(I only wrote table, not korma.core.table, but I didn't define a "table" anywhere)
06:43ivaraasenI once had to debug a codebase with Norwegian variable and fn names. ugh...
06:43ziltinice
06:44ivaraasenit was Matlab code as well, so not exactly clean
06:44ziltiI always write my code and documentation in english. And be it just because of the special characters.
06:48repsacAnyone know the best way to crawl a clojure jar and grab metadata (docs, src etc) for each namespace in the jar?
06:52repsacfor all publics in all namespaces in the jar i mean
07:24Raynesreplaca: Well, codox does stuff like that.
07:24RaynesEr, not replaca.
07:24Raynesrepsac, but he has disappeared.
09:05jcromartieis noir abandoned?
09:05jcromartieah I see
09:07Anderkent,(macroexpand '(no.such.Class/doThing 1 2 3))
09:07clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: no.such.Class>
09:08Anderkentany way around this? :(
09:09ziltiAround what?
09:09Anderkentmacroexpand crashing when there's a non-existing class reference
09:10Anderkenti.e. macroexpand tries to run (part of the) code
09:10ziltiNo, it isn't. The problem is that you're trying to macroexpand a static method of a java class, which of course doesn't work
09:10ziltiOr you could try macroexpand-1
09:11Anderkentno, the problem is that the class does not exist at time of macroexpansion.
09:11ziltiYou can't and are not supposed to macroexpand classes.
09:12Anderkent,(macroexpand '(java.lang.System/currentTimeMillis))
09:12clojurebot(. java.lang.System currentTimeMillis)
09:13Anderkentis that sufficient as an example?
09:13ziltiThat's not expanding the method
09:13ziltiIt's just saying that it didn't expand anything at all
09:13zilti(macroexpand '(1 2 3))
09:13AnderkentIt transformed the Object/method syntax
09:13zilti,(macroexpand '(1 2 3))
09:13clojurebot(1 2 3)
09:13Anderkentinto the dot syntax
09:13Anderkentwhich is what I want to do
09:14Anderkentbut it does not work when the class is not available on the classpath
09:14Anderkentwhich is disappointing
09:14ziltiThen do it with other methods than macroexpand, because macroexpand is meant to expand macros
09:16Anderkent'They all expand into calls to the dot operator (described below) at macroexpansion time.', says clojure.org/java_interop
09:17ziltiBut they are special forms and not macros.
09:17ziltiWhy would you want to transform this anyway?
09:17AnderkentI'm also pretty sure you should be able to call macroexpand on any list at all, even if the first node is not a macro
09:18AnderkentI'm writing a code coverage tool and for that I need to fully macro expand a given source file
09:30degDoes Clojure offer a way to safely evaluate tainted user-input strings? Ideally, I'd like to eval the string in an environment that includes a small set of dynamic variables and functions that I've allowed, but no access to anything else (random functions, reader macros, etc.).
09:31luciandeg: there are some sandboxes around (4clojure and the bots in this channel use them)
09:31jcromartiedeg: at the minimum, you can define your own set of allowed symbols
09:32degjcromartie: Once I define my own set of allowed symbols, can I create an isolated namespace and pass it to the reader?
09:32jcromartiedeg: I don't think so
09:32jcromartiedeg: I'm not an expert, and sandboxes are hard
09:33jcromartiedeg: but I'd definitely say a whitelist is better than a blacklist
09:33luciandeg: there's https://github.com/Licenser/clj-sandbox for example
09:34jcromartiewhat's that one form (reader macro) that's immediately evaluated at read time?
09:34degI need binding of specified dynamic vars, arithmetic, and maybe some of the standard special forms (if, and, or; maybe a few more). So, a whitelist is definitely the path I want. But, I don't want to write an entire sandboxed evaluator myself.
09:34jcromartieha
09:34degLucian: thanks, looking at that now.
09:34jcromartiehttp://clojuredocs.org/clojure_core/clojure.core/*read-eval*
09:35degjcromartie: Yup, I'd definitely need to turn off #=. But, that feels like a blacklist approach, which I don't really trust as much as whitelist.
09:44deglucian, jcromartie: Thanks. Looks like licenser sandbox will do what I need. (It'd definitely overkill -- it would have been cleaner if the standard reader took a set of available defs, bindings, and reader macros -- but I'm not pedantic enough to refuse a working tool. :-) )
09:55yedidoes anyone have suggestions for good articles/talks to consume? stuff like prismatics article introducing graph, hickeys talk/article on reeducers, articles describing strucjure and clojure's matching library, etc
09:57xeqideg: the other well used one is https://github.com/flatland/clojail but its a blacklist approach
09:58xeqialso, some use of something like classlojure to make an isolated enviornment incase they escape the sandbox, and a good java.policy file to restrict messing up the box is recommended
09:59xeqiits extremely hard to make a public eval, even clojail has a couple of esoteric ways to escape
09:59xeqi* a secure public eval
11:07Bronsaibdknox: you should merge the last blind, i just fixed a bug that prevented numbers in the form 1e2 to be read
11:51ziltiI wrote a macro that writes several declare statements. Now unfortunately it packs them in a list, and this happens:
11:51zilti&((declare something))
11:51lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
11:51zilti,((declare something))
11:51clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
11:52ziltiIllegalStateException Attempting to call unbound fn: #'lopia-server.database/something clojure.lang.Var$Unbound.throwArity (Var.java:43)
11:54dnolenzilti: wrap them in a do. but also you know that declare can take multiple symbols right?
11:55ziltiNo, I didn't know that. Thanks for the hint!
12:00ziltiHm, my macro doesn't work the way I want it to... Isn't a macro supposed to write the stuff that's backquoted into the namespace?
12:03jkkramerzilti: backquote namespace-qualifies symbols, but not necessarily with the current namespace
12:03jkkramer&`(map foo bar)
12:03lazybot⇒ (clojure.core/map clojure.core/foo clojure.core/bar)
12:03jkkramer,`(map foo bar)
12:03clojurebot(clojure.core/map sandbox/foo sandbox/bar)
12:03seangroveOut of curiosity (thinking about putting this together in my cljs app), has anyone tried completely modelling an app's UI as via FSMs?
12:04ziltiWhat's FSMs?
12:04seangrovefinite state machines
12:05matthavenerseangrove: lots of UI elements are modeled using FSMs
12:05seangroveTrying to get my UI's as declarative as possible
12:05matthavenerseangrove: but you're saying an entire UI as a single FSM?
12:05seangroveYeah
12:05dnolenseangrove: you should talk to ibdknox, that's what waltz is all about http://github.com/ibdknox/waltz
12:05matthavenerinteresting idea
12:06seangroveMaybe that's too high-level
12:06seangrovednolen: Ah, thanks :)
12:08seangroveSadly waltz and domina are both pretty quiet
12:31yedidoes anyone have suggestions for good articles/talks to consume? stuff like prismatics article introducing graph, hickeys talk/article on reeducers, articles describing strucjure and clojure's matching library, etc
12:32seangroveyedi: Worth watching "the refined clojurian"
12:32seangroves/clojurian/clojurist
12:32seangrovehttp://skillsmatter.com/podcast/scala/the-refined-clojurist
12:33seangroveNo idea why it's under a scala url though
12:33yedioh cool
12:34seangroveLnaugage of the system, and some others here too http://skillsmatter.com/event/scala/clojure-exchange-2012
12:39dnolenyedi: seangrove: http://www.youtube.com/user/ClojureTV, and Planet Clojure RSS feed
13:07ziltiIs it possible to do what (intern ns name val) does, but for macros?
13:07gfredericksinterning a var whose value is a macro?
13:08ziltigfredericks: More like "redirecting" the macros output to that namespace, or better: "executing it in the other namespace"
13:10gfrederickswhat's the use case?
13:11ziltiI have a macro that writes korma defentity statements based on data stored in a map. And they're supposed to end up in the macro's namespace.
13:12bawr>Clojurist
13:12bawrurrgh, sounds almost as bad as "Pythonista"
13:13AimHereClojurissimo
13:13AimHereClodjer
13:13borkdudezilti http://clojuredocs.org/clojure_contrib/clojure.contrib.with-ns/with-ns
13:13gfrederickszilti: so you're calling this defentity-writing macro from outside your foo.entities namespace. Where do you intend to use the defined vars? Also from other namespaces?
13:14gfredericksI think a macro that defs something in another namespace is pretty unusual; you can definitely use intern to do what you're talking about though.
13:15ziltigfredericks: I'll call them from outside, but not only from one namespace, so they should end up in "their" namespace.
13:15gfrederickslooks like with-ns would work too
13:15gfredericksfor intern you have to add the {:macro true} metadata to the symbol
13:15gfredericksas in (intern 'foos.entities (quote #^{:macro true} the-var-name) a-macro-function)
13:17gfrederickswow that's weird that with-ns uses map
13:18gfredericksthat sounds like an obvious laziness bug
13:19gfredericksoh nevermind
13:19gfredericksit gets spliced in
13:19borkdudelast time I used something like this I just did (binding [*ns* x] …) and passed *ns* as the argument for x from the other namespace
13:20borkdudebut since I didn't know how to "get" a namespace object from a symbol, I found with-ns on clojuredocs =)
13:20borkdudeah, the-ns is something in clojure.core
13:21borkdudeweird name though
13:22borkdudeit felt wrong though - someone was trying to make a standard list of requires and uses and defined a functino for this in a util namespace
13:23borkdudeso you'd only have to call the util function and it would require everything in your namespace
13:23ziltiGreat, the macro still works
13:24ziltiIt took me hours to figure out that error was caused by this.
13:27borkdudegfredericks the map also surprises me, why not just ~@body
13:27gfredericksborkdude: it has to use eval
13:28ziltiI sometimes think my browser is leaking bookmarks
13:28gfrederickscompare (binding [*ns* (find-ns 'clojure.walk)] postwalk) to (binding [*ns* (find-ns 'clojure.walk)] (eval 'postwalk))
13:31gfredericksborkdude: binding changes the namespace at runtime, not compile-time
13:33borkdudegfredericks right
13:33gfrederickseval: for when you need compile-time at runtime
13:34borkdudegfredericks I'm trying to figure out why the thing worked when I did it without eval
13:34borkdudegfredericks probably because it was a function, not a macro
13:35gfredericksI can imagine some subleties wherein it depends on what you're doing and whether or not it's top-level
13:35borkdudegfredericks we required and used some stuff in a namespace that was passed along as an argument
13:36gfredericksand just did (binding [*ns* symbol-arg] (require 'thing) ...)?
13:36borkdudegfredericks yes
13:36borkdudegfredericks no
13:36borkdudegfredericks the symbol-arg was an actualy namespace object
13:36gfrederickswell symbol-arg would be a namespace object
13:36gfredericksyeah it'd have to be
13:37gfredericksyep works for me too
13:37gfredericksnow to try it inside a function
13:38gfredericksyeah inside a function it works the other way
13:38gfredericksoh wait
13:38gfredericksscratch that
13:39gfredericksokay works the way you'd want in a function too
13:39gfredericksoh I know why
13:39gfredericksrequire/use just care about the value of *ns* at runtime
13:39gfredericksit's compiling within your namespace, but defining things in the other
13:40gfredericksyou could tease apart the difference if e.g. you didn't refer-clojure in the other namespace
13:40gfredericksrequire and use would still compile because they're compiling in the namespace the code appears in
13:40gfredericksbut if you want the symbols resolved in the other namespace, you need eval
13:41borkdudegfredericks this is getting complex
13:43gfredericksthe meaning of the symbols is determined at compile-time, and so depends on the compile-time value of *ns*. The effect of require/use happens at runtime, and so depends on the runtime value of *ns*.
13:44gfredericksif you're trying to effect stuff in other namespaces dynamically I think you're already doing complex stuff :P
13:44borkdudegfredericks yes, I tried to discourage it first ;)
13:46ziltiYou did not really ;) It's working great now, though. I need it because I need/want to be able to modify the database at runtime and want to dynamically regenerate the defentity statements with the new table relations.
13:51gfredericksare you modifying the code that uses the entities as well?
13:51ziltigfredericks: no, just the entities
13:52gfredericksweeerds
13:53borkdudezilti I tried to discourage someone else, but doesn't matter
13:54borkdudethis is actually a nice threading operator, maybe they can sneak it in clojure 1.5 just in time? ;) https://github.com/krisajenkins/hashthread
13:55gfredericksis that like let->?
13:55gfredericks&(doc let->)
13:55lazybot⇒ nil
13:55gfredericks,(doc let->)
13:55clojurebotCool story bro.
13:55gfredericksargle bargle
13:56borkdudegfredericks I don't know what let-> does, but the nice thing about this one is that you can control where the threaded thing should go in the next expression
13:56gfredericksyeah I believe so. Only difference is you get to pick the local name instead of defaulting to %
13:57gfredericksso the example in the README becomes (let-> 5 x (range x 10) (map inc %))
13:57gfrederickser (map inc x)
13:57borkdudegfredericks ah ok, even more useful then
13:57gfredericksnestable!
13:57borkdudegfredericks yeah
13:58gfredericksalways nest your let->'s so your coworkers will think you're smart
13:59tpopeit's as-> not let->
14:00tpope,(doc as->)
14:00clojurebotTitim gan éirí ort.
14:00tpope&(doc as->)
14:00lazybot⇒ nil
14:00tpopewell it is!
14:00borkdudeclojure.core/as->
14:00borkdude([expr name & forms])
14:00borkdudeMacro
14:00borkdude Binds name to expr, evaluates the first form in the lexical context
14:00borkdude of that binding, then binds name to that result, repeating for each
14:00borkdude successive form, returning the result of the last form.
14:00gfredericksit's let-> in my 1.5.0-beta1 repl
14:00borkdudegfredericks I'm on RC1 her
14:00tpopeit's as-> in my 1.5.0-rc1 repl
14:00gfredericksI think I remember rich renaming it
14:00tpopebut neat, guess there was a last minute name change
14:01gfrederickstime to upgrade my repls
14:01borkdudegfredericks there was a discussion on the ML about renaming it
14:01borkdudegfredericks but I never got the intention from the documentation. examples speak louder than words for me
14:01gfredericksI think let-> got rejected because it makes you want a vector of bindings
15:59saolsenanybody know a good parser library? There seem to be a bunch but I can't tell which is the most mature/stable/widely used
16:01technomancysaolsen: none of them are still maintained IIRC
16:02arrdemam I right in remembering that nREPL is supposed to succeed SLIME?
16:02arrdemtechnomancy: I found a good new one a few days back lemme dig for a minute
16:02technomancyarrdem: that's right; nrepl.el is the way forward
16:02arrdemsaolsen: this is something I found a few days back, it was surprisingly easy to work with https://github.com/richard-lyman/amotoen
16:04arrdemsaolsen: it may not be exactly what you want... I admit I was very frustrated by the lack of a "require one or more" token, you have to compose a "require one" and a "require 0 or more"
16:05saolsenarrdem: yeah I'll have to look into it. Looks like it could work.
16:06saolsenarrdem: I was hoping there would be a port of parsec to clojure, though I guess that could be aukward / tricky to port
16:06technomancyI think there are a couple half-finished ports
16:06arrdemyeah...
16:06arrdemI don't remember any full ports
16:06bawrI know those are very different beasts, but someone pressed me for an answer - is there a sensible Clojure / OCaml or F# comparison somewhere out there?
16:06saolseni found fnparse
16:07saolsenbut it looks unmaintained
16:07arrdemsaolsen: oooh yea
16:07technomancyfnparse is old as the hills
16:07bawrAnd yeah, I do realise how odd and wrong the question is. >_>
16:07arrdemfnparse is a very nice system and I enjoyed working with it but it has been abandoned for years
16:08arrdemthere exists an update for 1.3.0 at least tho so no need to use the old contrib "official" one.
16:09technomancybawr: I've done a little bit of ocaml. the main disadvantage of ocaml is that the libraries and tooling are really weak compared to what's on the JVM. it also felt a bit dated in a few other ways like the regex engine. but if you need to write close-to-the-metal code it's much better than Clojure at being lightweight.
16:09arrdemtechnomancy: is there a compelling reason for me to migrate from vim/vimclojure to emacs/slime?
16:09arrdemdarp darp nrepl
16:10technomancyarrdem: if you are going to use emacs just for editing clojure, it might not be worth it. but if you're going to use Emacs like it's supposed to be used (IRC, email, note-taking, shells, version control, etc) then definitely.
16:10bawrtechnomancy: how's does OCaml fare with immutable / persistent data structures, though? Can it sensibly do immutable by default / etc?
16:11technomancybawr: yeah, OCaml does a good job of encouraging immutability but being pragmatic about falling back to imperative code when you absolutely need to get the last bit of perf.
16:11bawrI see.
16:12ivaraasentechnomancy: OCaml seems pretty nice, really. I'm trying out ocaml-batteries-included later this evening
16:12technomancyarrdem: your enjoyment of Emacs is going to be proportional to how much you hate using programs that aren't written in lisp.
16:12technomancypersonally it drives me absolutely batty when I try to use a program and it won't let me rewrite core functionality on the fly.
16:13arrdemtechnomancy: hahaha we shall see. I have a vim/tmux/lein/irssi work environmen that has served me well... debating uninstalling vim and making myself switch while its the holidays and I can
16:13bawrPerformance aside, is there anything that Clojure does very well that OCaml doesn't? Mostly regarding concurrency / multiprocessing, but other insights are welcome, too.
16:13technomancyarrdem: just don't think of it as a replacement for vim; that's just the tip of the iceberg
16:13azkeszhey guys, what would you recommend me do if I wanted to search for a pattern of bytes with holes in a file? something like 0x77 0x12 (anycharhere) 0x88 . Could you tell me how you'd do it?
16:14arrdemazkesz: so a regex on bytes?
16:14arrdemherm...
16:14technomancybawr: oh yeah, OCaml's GC is kind of lame; doesn't allow for true concurrency. but the most noticeable difference is definitely the access to Java libraries and tools.
16:14arrdemazkesz: I think that the standard regex library could work...
16:15arrdemdepending. lemme try something and brb.
16:15technomancyivaraasen: I used OCaml to write a replacement for dmenu, but then the latest version of dmenu has added the features I wanted, so I don't have anything to use it for.
16:15azkeszarrdem, interesting... I haven't thought of that...
16:15saolsenfnparse has lots of docs, and a bunch of talk about verion 2 and version 3
16:15saolsenand then just no updates after 2012 :(
16:15technomancysaolsen: fnparse requires Clojure 1.2
16:15technomancyyou don't want that =\
16:15arrdemsaolsen: version 2 is what's live. v3 was never written
16:15saolsener, after 2010
16:15dnolenbawr: meta programming in a Lisp is pretty nice - a large subset of Clojure compiles to optimizable JS
16:15arrdemtechnomancy: hey there man, there are about three update forks.
16:16wingyso if you wanna do iOS, Android and Windows apps you are forced to OOP?
16:16technomancyarrdem: heh; fair enough
16:16eggheadarrdem: I switched from vim to emacs, it's been enjoyable
16:16technomancyarrdem: I just remember clojurebot was stuck on 1.2 for a long time because of fnparse
16:16wingybut the backend can still be in clj right?
16:16azkeszarrdem, how would you read the file? and the apply some regex on it
16:16technomancybawr: yeah, homoiconicity is a nice-to-have too but IMO not nearly as important as access to a large set of libraries
16:18arrdemazkesz: you would just slurp it as a string and apply a regex appropriate to the bytes
16:18arrdemthere may be a better way to do that tho
16:18azkeszcool
16:18azkeszI kinda just needed the basic idea, thanks arrdem
16:19arrdemazkesz: no problem. Java has (and therefore Clojure has) a way to encode a byte literal in a string, you probably want to use that.
16:19technomancybawr: F# probably doesn't have the concurrency problems OCaml does
16:19technomancyand it probably has better library support, though still not nearly as good as Clojure
16:20borkdudetechnomancy what do you mean with library support?
16:20arrdem,(= (str 0x77) "\0x77")
16:20clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Invalid digit: x>
16:20technomancyborkdude: being able to pull in lucene and stuff
16:20technomancyborkdude: for my simple OCaml library I tried to pull in xlib in order to change the WM properties of my program and it was an absolute nightmare
16:21azkeszarrdem, btw is there a lib that maybe already does all this? like for applying binary patches
16:21borkdudeif you're into .NET F# is a great choice - that makes me wonder, how is clojureclr these days?
16:21technomancyhalf the libraries used makefiles; the rest were split among 2 or 3 competing ocaml build tools
16:21arrdemazkesz: I have no idea... I would hope so tho.
16:21borkdudeazkesz do you need to find this pattern once or multiple times?
16:21technomancyand they actually expect you to install some 3rd-party libraries using apt-get which is foolish
16:22arrdemtechnomancy: because we all roll Debian...
16:22azkeszborkdude: probably multiple times, as in to make sure it only occurs once
16:22technomancyarrdem: I <3 Debian, but apt-get is not appropriate for distributing development libraries.
16:22technomancyit's designed for end-user applications, and that's the only thing it's good at
16:23azkeszborkdude: but sometimes it occurs more than once and it's ok too (since the context for it is the same for two different locations that need a change to happen)
16:23eggheadisn't scala closer to the OCaml heritage? It's highly influenced by ML
16:23winkthat would at least explain why I found it so weird :P
16:23technomancyegghead: F# is much closer from what I gather
16:24borkdudeegghead technomancy I also think F# is closer
16:24technomancyscala cribs more from Haskell
16:24ziltiThat Prismatics Graph, is this a freely available library and I just haven't found it yet, or do I have to use something else, similar?
16:24technomancybut even then, interop with Java forces it to give up on HM inference, which is a huge drag
16:24saolsenzilti: they never released it but there are 2 alternatives
16:24technomancyzilti: Prismatic deleted all their OSS repos from GitHub =(
16:25ibdknoxF# basically is OCaml
16:25technomancyyou can still find some of them around but I would not trust them
16:25ziltisaolsen technomancy Oh... That's a disappointment. Then I'll take a look at these alternatives (someone posted the links yesterday)
16:25azkeszborkdude, were you thinking that I should use some caching? maybe clojure.core.cache?(no idea)
16:25winkibdknox: oh, thanks for the warning :P
16:25arrdemazkesz: I did some digging and it looks like the regex library doesn't behave nicely for arbitrary bytes because of string encoding nonsense
16:26azkeszarrdem, oh i see... thanks for this
16:26eggheadtechnomancy: I didn't know that :(
16:26ibdknoxI wonder if that means they're trying to sell
16:27azkeszarrdem, when you slurp the file is it converted into something like UTF-8? if that makes any sense
16:27technomancyibdknox: I can't imagine any other reason
16:27ibdknoxtechnomancy: me neither
16:27azkeszarrdem, for example can I read the UTF-8 bom at the beginning of a file ?
16:27technomancythen again, I can't imagine any competent buyers who would actually consider deleting GitHub repos (with a promise of "they'll be back some day, honest") a good thing
16:28ibdknoxit's a baggage thing
16:28ibdknoxI could easily see that being written into someone's terms
16:28ibdknoxespecially if they EOL'ing the product
16:28ibdknoxthey're*
16:28arrdemazkesz: not sure.
16:28azkeszhey guys can anyone suggest me a lib or something to handle raw bytes from ie. an exe file?
16:28gfredericksjust because leaving them up but not maintained looks somehow worse than taking them down?
16:29gfredericks(trying to understand what the baggage consists of)
16:29ibdknoxgfredericks: them being there requires some amount of attention. Acquisitions for parts are very slash and burn in style
16:30ibdknoxyou don't want any loose ends even if they may not be something that will actually cause trouble
16:30gfredericksah
16:31ibdknoxyou never know what might be hiding there
16:31ibdknoxlol
16:31ibdknoxM&A is a weird business
16:31azkeszI'll take a look at gloss, but I don't want to define any structures though
16:31ibdknoxit's kind of like a chop-shop :(
16:32gfredericksI interviewed at a mountain-view company once after having only worked for a state govt and a university. it was very foreign.
16:33arrdemazkesz: gotcha http://code.google.com/p/byteseek/
16:33technomancyazkesz: java.io.DataInputStream maybe
16:33ibdknoxgfredericks: haha, yeah those are very different worlds
16:34azkeszarrdem, thank you, this seems to be the thing, looking into it; technomancy I'll take a look at that if this fails
16:35arrdemazkesz: do us all a favor and if you use this throw a Clojure wrapper up on GH. If you don't then I will XP
16:35azkeszarrdem, ok; what's XP?
16:35borkdudeXterminate you Personally
16:35azkeszarrdem, btw, I don't think I'm good enough to do that, but I'll try :D
16:36arrdemazkesz: it's a smiley face intended to indicate a tougue in cheek comment
16:36azkeszlol
16:36bawrtechnomancy: dnolen: Thanks, that gives me a starting point.
16:36eggheadmy copy of the reasoned schemer finally arrived :)
16:36azkeszborkdude, way to hype up the drama :D
16:41azkeszarrdem, I think you should do it (wrapper) cause if I try I will mess it up
16:41azkesz(still reading for now)
16:41arrdemazkesz: feh ok. it'll be an exuse for me to do my first serious clj library.
16:41azkeszawesome
16:42arrdemtechnomancy: emacs just took the back seat, there is work to be done X-P
16:45joevandyki can use a Groovy library in clojure, right?
16:45bawrYup.
16:45joevandyksay i want to use http://freeside.co/betamax/ ?
16:45devnhappy holidays folks
16:45joevandyki use the standard ways of calling java code from clojure?
16:46technomancyjoevandyk: if it exposes a java class, then sure.
16:46technomancymight be trickier if it's designed to be used from groovy only
16:46devnit's times like these, when i'm sitting with family, head buried in my laptop reading the codeq schema
16:46devnwhen i think of you, fair clojurians
16:46azkeszgot no chrismas tree in my cave :)
16:46arrdemhehe I built a cave when I came home for christmas
16:46bawrdevn: I can relate ^^
16:46ziltiWhat the heck is christmas anyway?
16:47zilti^^
16:47bawrdevn: I borrowed a laptop from my sister to just play some games... and I've installed LightTable already. xD
16:47gfredericksany short answer to that will upset somebody
16:47arrdem(inc gfredericks)
16:47lazybot⇒ 13
16:48gfredericksooh lucky
16:48ibdknox"a holiday" seems safe ;)
16:48borkdudeibdknox holy day? ;)
16:48arrdemazkesz: yeah so I'm digging into this and it's one srs buisness library
16:48ibdknoxlol
16:48bawrLet's not get PC-crazy. xD
16:48gfredericksibdknox is always in here pushing his religion on us
16:49bawrI mean, if I wanted to push my religion, I'd... Hm.
16:49arrdemINTERNET FIGHT
16:49bawrI don't even know what the Discordian equivalent of Christmas is. xD
16:49azkeszarrdem, yeah it looks great and it's like exactly what I want
16:49arrdemazkesz: haha yeah I'm just looking at this and realizing that a wrapper is gonna be huge
16:51bawribdknox: is lighttable looking for some leisurely devs, or should I just look at making CodeMirror better? ;)
16:55ibdknoxbawr: for right now, CodeMirror is the best avenue. In the not too distant future, though, there will be a plugin system that would love some attention ;)
16:55bawrThat works.
16:56bawrOne small feature I'd love is getting some feedback from Leiningen shown when creating a project, for a while I thought it hanged on me.
16:56ibdknoxhm
16:56ibdknoxwhat version of LT are you using?
16:57ibdknoxwe don't have project creation in there anymore (for now)
16:57bawrUh, I downloaded the newest from the site.
16:57ibdknoxbawr: the one from here? http://www.lighttable.com/
16:57bawrYeah, Linux32.
16:58ibdknoxah, you mean when it's connecting? :)
16:58bawrAye, well it prompted me to create a project. ;)
16:58ibdknoxunfortunately most of that time is spent spinning up a JVM
16:59bawrHmm. Any way of letting me use drip or some of the persistend JVM wrappers if I so desired?
16:59ibdknoxif it's fetching deps, it's at least nice enough to tell you that
16:59ibdknoxbawr you can use lein-light
16:59bawrYeah, though it'd be nice to see what it's fetching, took surprisingly long here, given that I have a good connection.
16:59bawrMaybe it's just a leiningen thing.
17:00ibdknoxthe thing it does is essentially run a leiningen plugin manually
17:00ibdknoxlein-light is that plugin. With that you can just use lein to connect
17:00bawrOh, I see.
17:00ibdknoxin not too long I'll be moving over to nrepl too, so we'll have those options as well
17:01bawrheh, I guess development is going well behind the scenes ;)
17:03ibdknoxwell it's still just me building it right now, but I'm hoping to announce at least one if not maybe two hires pretty soon :)
17:05bawrheh, I missed the kickstarter, but I'm glad it worked ;)
17:06bawrAny plans of open-sourcing the core while it's being developed, or will that be considered later?
17:07ibdknoxit *will* be open sourced, exactly when is still an open question
17:07seangroveHrm, what's a convenient way to interpose a function return value into the sequence, so that the function is called for each interposed value
17:07gfredericksthree days before closed-sourcing it for M&A
17:08bawrM&A?
17:08ibdknoxat the very latest it'll be by v1 (summer 2013), though there's a good chance it'll be when the beta goes public
17:08gfredericksbawr: that's what I thought 30 minutes ago
17:08seangrove,(interpose #(rand-int 100) [1 1 1 1 1])
17:08clojurebot(1 #<sandbox$eval27$fn__28 sandbox$eval27$fn__28@35a99473> 1 #<sandbox$eval27$fn__28 sandbox$eval27$fn__28@35a99473> 1 ...)
17:08ibdknoxMergers and Acquisitions
17:08bawrah
17:08ibdknoxgfredericks: fortunately in our case, that'll be impossible
17:08seangrovehrm, why's that?
17:09Bronsa, (interleave (repeatedly #(rand-int 100)) [1 1 1 1])
17:09clojurebot(40 1 4 1 29 ...)
17:09Bronsaseangrove: ^
17:10seangroveAh, nice, thanks Bronsa, was just getting to interleave
17:10arrdem,(doc interleave)
17:10clojurebot"([c1 c2] [c1 c2 & colls]); Returns a lazy seq of the first item in each coll, then the second etc."
17:10bbloomi'm blanking on the name of the lib that is like hiccup, but is xml-style maps of tag, attrs, and content rather than vectors... what was it again?
17:10gfredericksenlive?
17:10clojurebotenlive is for generating HTML from pure-markup templates: http://wiki.github.com/cgrand/enlive/getting-started
17:11bbloomgfredericks: i don't need transformation at all, just html printing
17:11gfredericksbbloom: it was my only guess
17:11weavejesterDoes anyone happen to know how to resolve the symbols in a quoted form?
17:12bawribdknox: well, can't wait until we're at least able to write plugins. it's about damn time someone started rethinking the IDE.
17:12seangrovegfredericks: was it inspired by a haskell lib?
17:12weavejesteri.e. turn '(+ 1 1) into '(clojure.core/+ 1 1)
17:12bbloomweavejester: ##(doc resolve) ?
17:12lazybotjava.lang.SecurityException: You tripped the alarm! resolve is bad!
17:12bbloomheh.
17:12bbloom(doc resolve)
17:12clojurebot"([sym] [env sym]); same as (ns-resolve *ns* symbol) or (ns-resolve *ns* &env symbol)"
17:12xeqibbloom: data.xml?
17:12weavejesterbbloom: resolve just works for symbols though
17:12weavejesterI was hoping to avoid walking the tree and resolving all the symbols
17:12weavejesterI'm not completely sure it would work, either
17:12weavejesterEspecially for macros
17:13bbloomwhat do you mean by quoted?
17:13bbloom,''foo
17:13clojurebot(quote foo)
17:13seangrovemacroexpand...?
17:13clojurebothttp://groups.google.com/group/clojure/browse_thread/thread/bba604cee3b232d9/28837d55525306d8?lnk=gst&amp;q=recursive+macroexpand#28837d55525306d8
17:13bbloomlike that?
17:13seangrove,(macroexpand '(+ 1 1))
17:13clojurebot(+ 1 1)
17:13bbloomxeqi: i think that's what i wanted, thanks
17:13seangroveAh, no
17:13seangrovehah
17:14bawr,(macroexpand '(or 1 2))
17:14clojurebot(let* [or__2243__auto__ 1] (if or__2243__auto__ or__2243__auto__ (clojure.core/or 2)))
17:14weavejesterI mean given a form with symbols that are not resolved, how to resolve them in a way that accounts for macros and other forms
17:14ibdknox,(macroexpand '(when true :true))
17:14clojurebot(if true (do :true))
17:14bawrSeems legit.
17:14weavejestere.g. '(+ 1 (* 2 2)) => '(cloure.core/+ 1 (clojure.core* 2 2))
17:14bbloomibdknox: not a great example, since all the special forms are un-namespaced
17:14weavejesterI guess I could macroexpand and then walk the tree and resolve
17:14joevandykis http://www.clojure-toolbox.com/ up to date?
17:15weavejesterBut it seems like there should be something to do that
17:15ibdknoxweavejester: yeah that's what you have to do
17:15bawrHmm.
17:15weavejesterjoevandyk: No...
17:15bawr,(macroexpand '(or 1 2 3))
17:15clojurebot(let* [or__2243__auto__ 1] (if or__2243__auto__ or__2243__auto__ (clojure.core/or 2 3)))
17:15joevandykweavejester: there a better source for recommend libraries?
17:15weavejesterI've been meaning on updating clojure toolbox with some sort of auto scraper
17:15bbloombawr: that's a better example
17:15technomancyjoevandyk: http://clojuresphere.herokuapp.com is better
17:15borkdude,(second `'(+ 1 1))
17:15clojurebot(clojure.core/+ 1 1)
17:15technomancythough still a bit behind the times
17:15jkkramerthe url is http://www.clojuresphere.com/ now - should probably make a redirect
17:16bawrbbloom: Yeah, at first I expected macroexpand to be recursive.
17:16joevandykis there a rule of thumb for picking a clojure library vs one in a different language?
17:16weavejester,(let [x '(+ 1 1)] `~x)
17:16clojurebot(+ 1 1)
17:16technomancyjoevandyk: nothing beats asking on IRC =)
17:16bbloombawr: there is macroexpand-all in walk
17:16technomancyjkkramer: cool
17:16bbloom,(clojure.walk/macroexpand-all '(or 1 2 3))
17:16bawrbbloom: ooh.
17:16clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.walk>
17:16bbloom,(walk/macroexpand-all '(or 1 2 3))
17:16clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: walk, compiling:(NO_SOURCE_PATH:0)>
17:16bbloom*shrug*
17:16bbloom&(walk/macroexpand-all '(or 1 2 3))
17:16lazybotjava.lang.RuntimeException: No such namespace: walk
17:16Bronsa,(require 'clojure.walk)
17:16clojurebotnil
17:16bbloom&(clojure.walk/macroexpand-all '(or 1 2 3))
17:16lazybot⇒ (let* [or__3824__auto__ 1] (if or__3824__auto__ or__3824__auto__ (let* [or__3824__auto__ 2] (if or__3824__auto__ or__3824__auto__ 3))))
17:16bbloomthere
17:17bbloompick a bot and a namespace
17:17Bronsa,(walk/macroexpand-all '(or 1 2 3))
17:17clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: walk, compiling:(NO_SOURCE_PATH:0)>
17:17Bronsaderp.
17:17bbloomof course there are 4 permutations, and i try all 4 of them before getting it right
17:17Bronsa,(clojure.walk/macroexpand-all '(or 1 2 3))
17:17clojurebot(let* [or__2243__auto__ 1] (if or__2243__auto__ or__2243__auto__ (let* [or__2243__auto__ 2] (if or__2243__auto__ or__2243__auto__ 3))))
17:17bawrWhy do we have such an ungodly number od bots, anyway.
17:17Bronsa2 is ungodly?
17:17weavejester,(read-string (pr-str '(+1 1)))
17:17clojurebot(1 1)
17:17technomancyBronsa: well it's not three
17:18arrdembawr: 2 isn't really that bad..
17:18Bronsashould we make it be three then?
17:18weavejester,(read-string (pr-str '(+ 1 1)))
17:18clojurebot(+ 1 1)
17:18arrdemlets do it!
17:18Bronsayou start
17:18bawrI thought there *was* 3. My triple bad. ;)
17:18arrdemthat was sarcasm
17:18Bronsamine too
17:18bawr*were
17:19bawrClearly, all spare blood went to my stomach.
17:19arrdem(inc technomancy)
17:19lazybot⇒ 44
17:19borkdudetechnomancy binitarianism is more common among geeks
17:19arrdem,(bool 'bawr)
17:19bawrtechnomancy: There's only one Eris, even if she also goes by Discordia.
17:19clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: bool in this context, compiling:(NO_SOURCE_PATH:0)>
17:20weavejester,(eval (read-string (str "`" (pr-str '(+ 1 1)))))
17:20clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
17:20bawrtechnomancy: But I refuse to do reference counting. ;)
17:21weavejester(fn [form] (eval (read-string (str \` (pr-str form)))))
17:22weavejesterThat works, but it… bleh
17:22joevandykbest way to do interactive web app tests? (like https://github.com/jnicklas/capybara)
17:23joevandykmaybe interactive's the wrong word. i mean being able to simulate clicks, filling in forms, checking boxes, etc
17:23technomancyjoevandyk: peridot and kerodon both look great
17:23technomancykerodon probably for that
17:23xeqijoevandyk: I've got something similar in nature (though incomplete) at https://github.com/xeqi/kerodon ; or you can go full stack with https://github.com/semperos/clj-webdriver
17:23phaerjoevandyk: You could use selenium trough java
17:24joevandykthere's a headless selenium thing, right?
17:24joevandykthat can do basic javascript?
17:25xeqisupposedly you can use htmlunit for that
17:25xeqihaven't done it myself
17:25bbloomjoevandyk: if you like capybara, just use it
17:25bbloomno need to limit yourself just to clojure
17:25phaerjoevandyk: Depends what you define as "headless".
17:25bbloomintegration tests can be completely isolated anyway
17:26joevandykphaer: being able to run in an environment without a graphical x server
17:26xeqiI usually just run my selenium test in an xvfb session
17:26phaerjoevandyk: You can use firefox + xvfb for a complete browser or htmlunit.
17:26joevandykhm
17:26joevandyki should look into that
17:29arrdemw00t live in nrepl! I have no idea how to emacs..
17:30arrdemtechnomancy: do tell
17:30technomancyevery time there's a multiline value I always feel like I should separate the pred/value pairs with newlines
17:31technomancybut I hate that cond is the only place where non-toplevel newlines
17:31arrdemah. this pain I have felt.
17:32Bronsagomai
17:32Bronsaops.
17:33arrdemI have a zsh nested in emacs. what is going on here.
17:39bbloomtechnomancy: i hate that. finally decided just to indent values 2 spaces
17:39technomancyclojure-1.4-compatible slamhound 1.3.0-SNAPSHOT release is on clojars
17:39bbloomit looks weird, but it offends me least
17:40technomancymy solution is normally to just quit using cond
17:40technomancyI wonder if core.match has that problem too
17:40bbloomthat also works
17:40bbloomone other choice: short predicate and transformation names
17:40technomancyheh; yeah
17:41bbloomeither def or let some nicely named functions and make a nice neat table out of those w/ cond
17:43BaughnI'm attempting to write plugins for a system that uses a significant number of custom annotations. Is this something I can use clojure to do?
17:43bbloomBaughn: java annotations?
17:43BaughnYes
17:48Baughnbbloom: There's nothing in the documentation, so I guess not?
17:50weavejesterI think I might have written the worst function I ever have in Clojure...
17:51weavejester(defn resolve-form [form]
17:51weavejester (eval (read-string (str \` (pr-str form)))))
17:51weavejesterIt works, though...
17:51BaughnIf you can call invoking the compiler at runtime "works"..
17:51BaughnI do hope you aren't expecting performance from that. :P :P
17:51weavejesterOh, it's being called by a macro
17:51BaughnAh
17:52Baughn..I expect ` also exists as a symbol that you could wrap the form in
17:52BaughnWell, special form
17:52weavejesterYeah, there should be a better way
17:52weavejesterAlthough...
17:53callenweavejester: dare I ask what project necessitated that?
17:53weavejesterI'm trying to send a form to be remotely evaluated
17:54weavejesterIt kinda seemed a good idea to resolve the form first
17:54bbloomweavejester: my backquote library allows pluggable resolvers, you could port the relevant bits from compiler.java, it's only 15 or 20 lines or so
17:54bbloomi'd accept that pull request :-)
17:54weavejesterbbloom: What's your library called?
17:54bbloomweavejester: github.com/brandonbloom/backtick
17:55weavejesterAh, I see
17:55Baughn<weavejester> I'm going to call eval on data I got from a remote source
17:55BaughnPlease excuse me while I panic
17:55weavejesterBaughn: It's for a distributed calculation
17:56weavejesterSo I have N worker processes consuming a queue
17:56Baughnweavejester: Throwing around live code is still.. worrying
17:56bbloomweavejester: my library is basically a port of https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L756 & there are some resolution bits in there that could be ported too
17:56Baughnweavejester: A network like that could be hilariously easy to break into. Make sure you at least use SSL.
17:57bbloomin particular https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L777-817
17:57weavejesterBaughn: Well, that's the part that's bugging me, too. Not the security so much, but the fact that it's a leaky abstraction.
18:01BaughnSo apparently, clojure /does/ support annotations, it's just not documented?
18:01BaughnEr.. well, why not.
18:03weavejesterMaybe I'm looking at this problem in the wrong way...
18:03bbloomBaughn: https://github.com/richhickey/clojure/commit/fa899d22dceb531d9f5af833ac6af0d956e6bdc7
18:03Baughnbbloom: Yeah, I found that.
18:03callendoes anybody here know Yogthos?
18:03callenhe made that Luminus web dev template.
18:04bbloomBaughn: maybe open a bug on jira to improve that documentation?}
18:04BaughnI'm not sure that counts as documentation, but to be fair, it /does/ include.. ..okay, no comments.
18:04bbloomclojure's web site is starting to be in need of a big overhaul
18:04Baughnbbloom: Hehe, I'd rather open a bug to expand all of the documentation
18:05callenbbloom: ooh ooh, pick me pick me
18:05bbloomBaughn: more targeted feedback is likely to be more actionable
18:05BaughnGranted.
18:05Baughnbbloom: I'm going to start by learning to use clojure. We'll see later.
18:05BaughnI literally ran hello, world half an hour ago.
18:06bbloomBaughn: take some notes of what you struggle with and what's poorly documented, so you can help us help others later :-)
18:06BaughnSounds like a plan
18:06callenBaughn: btw, http://clojure-doc.org/
18:06bbloomBaughn: that said, i may avoid java interop while you're learning clojure
18:06callenBaughn: hang with the Clojurewerkz guys, they'll take care of you.
18:06Baughnbbloom: The only thing I want it for is java interop, though. :P
18:06BaughnI'll manage.
18:06bbloomstart with the pure, functional subset of clojure and slowly expand your skill set to include the more complex bits
18:07bbloomif you're doing 100% java interop, you might just be better off writing java :-P
18:07callenIf Java is the only thing you're interested in, then use Java. You're here because there's something else you're interested in.
18:07BaughnI'm writing a minecraft mod. There's going to be a bit of interop first, and then I can wander off into pure clojure-land.
18:07pipelineother jvm languages exist for 100% java interop
18:07pipelinescala and groovy are both much more practical for that
18:07callenBaughn: that's a sweet idea for a project.
18:07Baughncallen: I didn't even tell you what the project /is/. ^^;
18:08callenBaughn: I don't care, I want a Clojure wrapper/framework for making Minecraft mods.
18:08Baughncallen: ..I can work with that.
18:08callenit could end up being so quick and easy to produce Minecraft mods if there's a nice Clojure library...
18:08BaughnGetting clojure to work with MCP might be fun, yurk
18:08arrdemminecraft?
18:08callenarrdem: Minecraft.
18:09arrdemyay I'm not alone here!
18:09callenBaughn: MCP is kinda pissy about their tools. They may get upset if you wrap it in Clojure.
18:09Baughncallen: ..my eyes doth bleed tears of sorrow for their loss
18:10callenBaughn: I'm just saying, they outline pretty strictly what you can and cannot do with their stuff
18:10callenBaughn: you need written permission to respin their tools IIRC
18:10Baughncallen: Hopefully there's no need to do that
18:10callenBaughn: Iuno. I'm just a derpy web dev.
18:11pipelinei wouldn't worry too much about mcp
18:11pipelinei'm sure they mostly want to prevent forking
18:12Baughncallen: I already got kickbanned from #redpower from asking if it was okay to try interoperating with blutricity, so yeah.
18:12BaughnMost of their claims are utterly unenforcable anyway
18:13Raynesho ho ho
18:13arrdemhaha I spend time in #computercraft threatening to replace LUA with clojure
18:13callenBaughn: so much of the Minecraft community are utter children
18:14callenbbloom: how'd you sucker him into joining the dark side?
18:14bbloomcallen: who what?
18:14callenbbloom: oh it just seemed like he was a convert you'd brought in or something.
18:14bbloomi don't convert, i educate
18:14BaughnNah, I've always liked lisp.
18:15callenfine fine, kill the joke.
18:15arrdemcallen: it was dead on arrival mate.
18:15BaughnHaven't /used/ it much, but the choices for decent JRE languages are pretty sparse
18:15bbloomwhat arrdem said
18:16callenarrdem: thanks
18:16Raynescallen: Doesn't that apply to gaming in general?
18:16RaynesAny given Halo game is full of lolnoobheadshotomg
18:17callenRaynes: nah, I participate in some cool game communities.
18:17callenRaynes: it's commonly true though.
18:17RaynesLike?
18:17bbloomRaynes: there are plenty of adults playing halo, but they've just got the tv on mute b/c their kids are sleeping and don't have a microphone b/c they've sat on three of them already and keep snapping the cheap plastic
18:17RaynesI mean, I haven't come across a game that had an idiot free community.
18:18the-kennyFifa 2013 </irony>
18:18callenbbloom: I hear someone speaking from experience.
18:18Raynesbbloom: Halo is great online as long as you avoid audio.
18:18callenyogthos: hey, it's Mob_of_One here.
18:18bbloomcallen: no kids, but my gf works/sleeps odd hours :-P
18:18callenbbloom: that'll do it.
18:18callenbbloom: suffering has a way of providing perspective :)
18:19Raynesbbloom: I played Dead Island and didn't have a way to turn off the other player's mic audio, so I had to listen to this 11 year old yell "KICK ME. KICK ME DUDE. KICK ME" for God knows why for half an hour until he got tired.
18:19RaynesFunfact: you can't kick the other player
18:20callenRaynes: I got tired of that game quickly.
18:20yogthoshey
18:20callenRaynes: single or multiplayer
18:20callenyogthos: hi, so Luminus.
18:20yogthosyeah :)
18:20yogthosso far so good lol
18:20callenyogthos: so a few thoughts. Yes, good so far. The advantage of a template as opposed to a framework is that interested parties can rip out the irrelevant parts quickly.
18:20bbloomheh. oh the pain of being an 18 year old programming prodigy with a quick wit surrounded by reverse-prodigies
18:20callenyogthos: it's worth keeping in mind that you're making a specificity/friction trade-off.
18:21Raynescallen: I found it way too repetitive. The worst part was that the character's movement made me want to toss my lunch and I got dizzy if I played it for very long. They went *way* overboard.
18:21bbloomanyway, this is absurdly off topic
18:21callenRaynes: I didn't get dizzy, but I found very much like performing chores.
18:21bbloomhow about that clojure stuff guys?
18:21arrdembbloom: buzkill
18:21RaynesI've been playing Far Cry 2 which makes a similar attempt at emulating human movements, but it does it much better.
18:21callenyogthos: so if you provide a sqlite thingy in the models, somebody gunna have to rip it out
18:21yogthosyup
18:21callenyogthos: also, providing a prebaked database config presumes you know the best way to manage prod/dev configs
18:21Raynesbbloom: I don't think anyone cares at this exact moment in time.
18:21yogthosso one option is just to have some modules
18:22callenyogthos: so there's an interdependency that will cause a cascading series of rip-outs if you're not careful.
18:22arrdemit's christmas for christsake
18:22yogthosit's sort of how it's assembled already
18:22Raynesbbloom: callen and I can come over to your house and talk about this though, if it'd make you happier.
18:22bbloomi was kidding :-P
18:22callenyogthos: modularization is a great idea, I don't know how to do combinatoric lein plugins though.
18:22RaynesRight. In. Your. Ear.
18:22callenRaynes: I like video games anyway. I dun mind.
18:22bbloomRaynes: doors open. bring some beer
18:22callenyogthos: maybe do defaults with the ability to pass overrides on an as needed basis?
18:22arrdembbloom: is that an open invite I hear? beer's cheap...
18:22Raynesbbloom: All I have is hard lemonade.
18:23callenyogthos: that seems plausible, but the config stack is probably going to have be fixed/invariant.
18:23callenyogthos: you might even want to base the template on a dynamic templating system with overrides or something.
18:23callenyogthos: but lets rollback a bit to reality
18:24Baughncallen: Ideally, I can get a Clojure loader into MCP as a 'mod'. The only real problem is that mods have to be, well, obfuscated - which doesn't play very nice with dynamic languages.
18:24Baughncallen: But I'll give it a go.
18:25Raynescemerick: Happy Christmas eve.
18:26cemerickRaynes: Merry Winter Solstice (ish)
18:26callenBaughn: wait, why are mods obfuscated?
18:26callenHAPPY YULE
18:26arrdemokay. this emacs thing is proving a bit of a pain and I'm done with working. blergh
18:26Baughncallen: Because minecraft is
18:26Raynescallen: gtfo wiccan
18:26arrdem^ yeah. that.
18:26arrdemer... not what I meant at all..
18:27BaughnOh, right. Happy newtonmas!
18:27callenRaynes: I'm not wiccan, I merely honor my ancestors by getting drunk and fat over the holidays. :)
18:27callenBaughn: newtonmas, nice!
18:27RaynesBut do you dance in a circle?
18:28callenRaynes: when I get drunk enough, yes.
18:28RaynesOnly Wiccans dance in a circle.
18:28callenI'm preparing Mongolian BBQ for dinner tonight >:D
18:28callenRaynes: this reminds me of the witch test in Monty Python
18:28Baughn'twas a silly test. Everyone knows wood doesn't float.
18:28Baughn<- Aquarist
18:28callenI'm a cancer.
18:29callenif you ask the right people, they'll abbreviate to, "he's cancer"
18:29RaynesStop spreading.
18:29cemerickChristians have done more for pagan rituals than the pagans could have ever hoped.
18:29Baughncallen: Like that cancer-based suppervillain?
18:30Raynescemerick: We were talking about video games before you joined, bro.
18:30RaynesYou don't even know what OT is.
18:30cemerickfair
18:30cemerickI miss gaming.
18:30RaynesSo, what do you mean?
18:30cemericksometimes, anyway
18:30callencemerick: btw, loving the book.
18:30Raynesre: pagan rituals
18:31callencemerick: it's been a great read a few pages, hack for awhile, go back and read more companion.
18:31callencemerick: the section on delay/futures/promises/deliver was choice.
18:31cemerickcallen: \m/ Feel free to leave a review eventually if you think it's warranted.
18:31cemericksweet
18:31RaynesI found that cemerick's book made excellent tinder for the fire this year.
18:31callencemerick: I'm actually going to use that section to teach my frontend guy how promises/futures work.
18:31calleneven though he doesn't know Clojure (lol)
18:32RaynesFutures and promises make more sense in Clojure than they do in most.
18:32twem27
18:32Raynes6
18:32callenRaynes: the for comprehension deref equivalence thing in Scala was loony.
18:32callenRaynes: there's like zero symmetry in Scala.
18:32cemerickRaynes: Worshipping nature idols (Christmas tree), celebrating natural rebirth by lionizing the Easter Bunny, eggs, etc.
18:33yogthosscala is like a cauldron lol :P
18:33Raynescemerick: Interesting observation.
18:33bbloomcallen: Scala's for syntax is basically haskell's do syntax
18:33yogthosit's the C++ approach of just adding every feature known to man into one language
18:33callenbbloom: I don't like Haskell either. COINCIDENCE?!
18:33bbloommap and flatMap are scala's list monad names, but they generalize to the monadic laws
18:34callenyogthos: yeah, that's why I always snort whenever people tell me Scala is "simpler than Java"
18:34bbloomcallen: http://blog.tmorris.net/controlling-effects-with-flatmap/
18:34Raynescemerick: Wicca in particular is interesting because it gets called out as an 'invented' religion simply because it was invented in recent memory.
18:34bbloomscala is like java++
18:35yogthoslol
18:35cemerickRaynes: Indeed.
18:35bbloomif you prefer C++ over C, you'd prefer Scala over Java
18:35bbloomit's that simple
18:35RaynesSo simple a callen could do it.
18:35bbloomindeed.
18:36callencemerick: you just got a 5-star review on Amazon. Merry Christmas :)
18:36callenRaynes: do ho ho.
18:37callen"so simple a callen could do it", this should be the litmus test for library usability.
18:37cemerickcallen: dude, you're a mensch :-)
18:37bbloomcemerick: how was the book authoring experience?
18:37cemerickbbloom: do you have four hours to talk? ;-)
18:38cemerickI'm going to publish a retrospective on the whole thing sometime Q1
18:38bbloomcemerick: heh, actually yeah. i've been considering forcing myself to write a blog post a week and eventually compile it into a book
18:38callenbbloom: leanpub is popular for that sort of thing
18:38cemerickDefinitely a smart approach.
18:38callenbbloom: if you do your blog posts in Markdown, you can directly port it.
18:38cemerickf'n Markdown.
18:38yogthoshehe
18:38callenI'm not a fan myself (prefer org mode), but it's popular.
18:38yogthosno two flavors are alike :P
18:38yogthosno love for latex?
18:38callenyogthos: mostly because the fool that created it declared himself BDFL and then sat on it.
18:39the-kennyorg-mode -> LaTeX ftw.
18:39callenyogthos: what the-kenny said.
18:39callenLaTeX is a compile targer
18:39callentarget
18:39callennot an end-user lang.
18:39yogthosit's not that bad :)
18:39bbloomcallen: i do my posts in blogger's stupid editor thinggie, which royally sucks for code, but i just haven't gotten around to configuring a static page generator in a non-useless fashion
18:39the-kenny(Like Java </duck>)
18:39cemerickbbloom: if you'll be at clojurewest, we can chat about publishing/authorship at length
18:39callenI did all of our due-diligence documentation via org-mode -> LaTeX -> PDF generated documents.
18:39callenbbloom: plenty of SSGs in Clojure yo.
18:40callencemerick: I take it you're not one of those people who think it's a total waste of time?
18:41bbloomcemerick: *might* make it there, otherwise i'll be in NY, so (just github stalked you) i may find an excuse to road trip up to boston/ma/whatever
18:41callenpatio11 has been rather loud about his dismissal of writing books. He's gotten rather obsessed with economic extraction.
18:41bbloomi'm much more interested in the clout for hiring for my next company
18:42callenbbloom: next? you going to do a startup?
18:42cemerickcallen: No, writing is never a *total* waste of time
18:43bbloomcallen: did one, going to do another
18:43callenwtf amazon. I searched for "laptop stand" and got "Fifty Shades of Grey"
18:43cemerickbbloom: are you in NYC now?
18:43bbloomcemerick: moving jan 29
18:43callencemerick: I agree with you and see the value on several fronts, but some people are hellbent on reducing everything to direct and immediate compensatory value.
18:43cemerickcallen: that's called "anticipating future purchasing intent"
18:44callenfrom laptop stand? sigh.
18:44callencemerick: I think it did this because I bought Christmas gifts for women.
18:44cemerickbbloom: ping me and we'll catch lunch or something. I'll be making my way to NYC semi-regularly next year.
18:44bbloomcemerick: definitely going to take you up on that
18:45cemerickI'll bug you about business/startup stuff in exchange. :-P
18:45bbloomcemerick: my pleasure. 2 years and a small exit yields lots of good stories :-)
18:45cemerickcallen: yeah, the consulting biz optimization stuff that landed on his podcast recently was *weird*
18:46callencemerick: tbqh, ever since he stopped caring about bingo card and appointment reminder, he seems like he's gone off the deep end
18:46cemerickoh, I think he'll end up scaling AR quite a way
18:47callencemerick: he's not really about optimizing revenue in the context of doing your own thing anymore, it seems mostly like "quickest maximum economic extraction, damn all other things" now.
18:47callenI mean, I keep hearing that, but AR is so neglected that I've considered running a competitor to it just to spur him on.
18:47callenAFAIK, he's been doing consulting full-time for years now.
18:48cemerick*shrug*
18:48cemerickhe's clearly got quite a profitable shtick.
18:49callenno doubt, but the original reason I was interested in him is that he inspired me to try bootstrapping again
18:49callenhe's since departed from that quite a bit, so I'm a bit alienated from his current priorities, even if I value his knowledge.
18:51callenyogthos: well, at least you're finally here now. You're the most active person on r/clojure, I was really surprised you weren't on here.
18:52ivanpatio11: you were cool before you started raking in the big bucks
18:54callenivan: it's not about wearing the hair shirt, it's about freedom.
18:55yogthosso uh hi all :P
18:57callenyogthos has been shepherding the Reddit Clojure community, he made a template/pico-framework for Ring designed to enable people to get started more quickly as well.
18:57callenI'm fiddling with it as we speak, although I'm about to go buying ingredients for dinner.
18:57weavejesterHo yogthos
18:57weavejesterOr Hi even
18:57yogthoshowdy
18:58callenyogthos: what part of the world are you in? I'm in the bay area.
18:58RaynesLife would be better if people would just use weavejester libraries.
18:58callenRaynes: it does.
18:58callenRaynes: it uses Compojure
18:58callenor I thought it did, wait a tick
18:58callenyes it does.
18:58yogthosyeah, I'm taking the approach of a nice default template with a lib and helpers
18:58callenyogthos: the lib-luminus includes compojure doesn't it?
18:59yogthosyup
18:59callenthat was confusing.
18:59callenhaha
18:59RaynesI entirely disagree with the reason luminus needs to exist.
18:59RaynesIT'S SO NOT HARD
18:59yogthosfor us
18:59yogthosI'm introducing clojure at work
18:59yogthospeople have trouble with the stupidest things
19:00Raynes:p
19:00yogthosit's kind of hard to look back once you learn something and remember what it's like on the other side :)
19:00callenRaynes: we're the revolutionary vanguard, we know what the noobies need. Do not spite the educators!
19:00Raynesyogthos: Why do you have lib-luminus?
19:00callenI'm musing on that too.
19:00yogthoshelper utils mainly
19:00RaynesYeah, lib-noir. :p
19:00yogthosI could merge with that
19:00yogthoswould make sense
19:00RaynesYou've added another library to the mix when you could have just added this stuff to lib noir. You're not helping!
19:00Raynes:p
19:00yogthoslol
19:00callenRaynes: don't be mean! It's Christmas.
19:01callenor it will be, tomorrow.
19:01yogthosI'm totally cool to add the stuff to lib-noir makes it easier :)
19:01yogthosI wouldn't mind taking it over either if you get bored with it :P
19:01callenjust let him go further down the rabbit-hole with Laser
19:01RaynesYou just want to add that weird redirect macro.
19:01yogthosbut for now I just wanted to get something out of the door
19:02yogthoswell right now context is borked on app servers :)
19:02callenyogthos: you should fix the FIXME in the description for lib-luminus.
19:02callenaha, that's where compojure and hiccup are coming from.
19:03Raynesyogthos: Yeah, pretty much all of this stuff would be fine in lib-noir if you sent me a pull request. Leave out the markdown-clj stuff. I'd rather use pegdown for that. You can add it, just do it like refheap does it.
19:03yogthosyeah sure thing, I can move it to the template
19:03Raynesyogthos: Also, I'm really just kidding with the mean stuff. I think the template is a good idea. I would definitely rather move this utility stuff into lib-noir though.
19:04yogthoshaha no prob dude :)
19:04ibdknoxRaynes is mean
19:04ibdknoxHe berates me constantly
19:04ibdknoxand I cry.
19:04yogthoslol
19:04RaynesAnd I'll play with the redirect stuff too, because I now feel bad about not paying much attention to your pull request.
19:04yogthoshi Chris :)
19:04callenI agree, merging the utility/middleware code into lib-noir and then anything objectionable into the template makes a lot of sense to me.
19:04ibdknoxI end up taking it out on cemerick
19:04the-kennyEveryone here is totally mean!
19:04the-kenny(especially Raynes)
19:04yogthoswahh
19:04callenthe-kenny: I'm mean too, just ask me about generating HTML.
19:04ibdknoxIT'S A TRAP
19:04the-kennycallen: How would you generate html?
19:04yogthosthat's one of those shed painting questions :P
19:05the-kennyI'd use some XML stuff for it
19:05Raynesyogthos: If you get around to sending me a pull request to merge lib-luminus, I'll get it done quickly. I promise this time. :)
19:05ibdknoxyogthos: hi :)
19:05yogthosok I'll get on that
19:06callenyogthos: I'll re-critique/re-build the app under lib-noir + template when you give me the heads up that the merge is done.
19:07Raynesibdknox: http://www.reddit.com/r/Clojure/comments/15cspw/luminus_my_attempt_at_a_clojure_web_framework/c7lhuf8
19:07ibdknoxhuh
19:07ibdknoxI think people are looking at the Noir thing wrong
19:08ibdknoxdisregarding that, I've been very upfront with korma
19:08bbloomi'm starting to have a thing that looks like AngularJS, Clojure, and WPF had a weird 3 headed baby.... i kinda like it... hopefully i can get it to a production quality before i need to go back to doing real work again :-)
19:08ibdknoxit's not my fault that no one seems to care enough to keep it moving forward
19:08callenibdknox: what *is* the status with Korma anyway?
19:08callenare people just using the Clojure JDBC wrappers?
19:08yogthosyeah with 700 stars I was surprised nobody picked it up
19:08ibdknoxtons of people are using Korma
19:09Raynesibdknox: People are thinking we just abandoned it. I think I was fairly clear in stating that I just didn't see the point in keeping it going when Compojure and lib-noir became such a good solution.
19:09callenibdknox: so you're waiting for a maintainer?
19:09ibdknoxcallen: yep, called for one several times now, have had about 4 people step up, but no one actually did
19:09ibdknoxRaynes: yeah - that's the thing. I don't think Noir is the best solution anymore
19:09callenthat is unfortunate.
19:10yogthosyeah I think compojure+lib-noir is pretty smooth sailing, all that's really missing is a nice template, hence luminus
19:10ibdknoxKorma needs work, but it would ridiculous to expect me to do it at this point - not even because of LT, but because I'm not doing *any* SQL work at all
19:10yogthosmake some sane defaults that run out of the box, and then people can rip out change what they need
19:10callenI've had too much yak-shaving occur because of the absence of a quick-start template, hence Luminus.
19:10ibdknoxI can only stretch my charity so far :/
19:11callenfunny part is, I was talking in this channel about making a template right before Yogthos announced Luminus.
19:11Raynesibdknox: My highly edited response: http://www.reddit.com/r/Clojure/comments/15cspw/luminus_my_attempt_at_a_clojure_web_framework/c7lou6q
19:11callenibdknox: I take it LightTable is eating you alive?
19:11yogthosbtw nice work on that ;)
19:11yogthosI'm really enjoying seeing how the releases are progressing
19:12ibdknoxcallen: one guy building an IDE is a bit of a challenge ;)
19:12weavejesterHm, Stuart Sierra's data.dependency library doesn't seem to be on Maven or Clojars
19:12Raynesibdknox: People always get that entitlement feeling when they start using things in production. I really don't believe in using anything free that I wouldn't be willing to replace or maintain myself if I had to.
19:12ibdknoxVS has 2000 people in total lol
19:12callenibdknox: aye, I don't doubt it @ IDE
19:12ibdknoxyogthos: some really neat stuff coming soon I think :)
19:12callenVisual Studio has a distinct lack of focus.
19:12ibdknoxyes it does
19:13bbloomibdknox: i'm sure it's fun to say "i'm doing the work of 2000 people" but you damn well know that 1500 of those people are doing negative work :-)
19:13callenibdknox: just wondering, how much thought will you be giving to web dev workflows in LightTable? So far it's great for testing groups of functions (for me).
19:13weavejesterOh, looks like it's part of tools.namespace - it was never released separately
19:13ibdknoxbbloom: haha, it's more a matter of creating a sense of scale
19:14ibdknoxbbloom: one of my favorite questions was always to ask how big in LoC VS is
19:14bbloomibdknox: did you ever plot a histogram of responses to that? :-)
19:14ibdknoxcallen: I think that's one of the places it can shine
19:14ibdknoxbbloom: hah, I should've. The answers were hilarious
19:15bbloomibdknox: probably would have needed to be a logorithmic scale
19:15ibdknoxbbloom: maybe 100kloc? no, probably like 500k
19:15bbloomlol.
19:15ibdknoxit's funny how little we know about our own industry
19:15ibdknox100kloc is quite a bit for a website
19:15ibdknoxbut that doesn't even given you the VS editor
19:16bbloomdo be fair, like 92% of those lines are QueryInterface :-P
19:16ziltibbloom: Let me know the result
19:16ibdknoxbbloom: COM is evil
19:16ibdknoxthe editor was entirely managed though
19:16bbloomzilti: 1,410,764 ignoring blanks and comments
19:16ibdknoxand it was still something on the order of half a million
19:17ibdknoxit's an interesting exercising forcing LT to remain small such that I can still continue to work on it
19:17ziltibbloom: For Emacs? Wow. Is that the "raw" version, or the one including things like org-mode?
19:17ibdknoxexercise*
19:17bbloomzilti: git://git.savannah.gnu.org/emacs.git
19:18bbloomibdknox: what size is LT now?
19:18ibdknox< 5k
19:18bbloomibdknox: nice.
19:18ibdknoxwith the refactor I'm doing right now, it'll get smaller actually
19:18bbloom`cloc textmate` yields: 142,405
19:19bbloomprobably would be most fair to compare single-language support tho
19:19ziltiThat's a damn lot for a "simple text editor"with extension interfaec
19:19bbloomsimple != smal
19:19bblooml
19:19ibdknoxthere is no such thing as a simple text edtiro
19:19ibdknoxeditor*
19:19bbloomzilti: sometimes, simple is bigger, since you're not packing complex multi-purpose semantics into single lines
19:20ziltiibdknox: Notepad
19:20yogthosspeaking of text editing, is there any plans for paredit style stuff? :)
19:20bbloomi consider redis to be simple, but cloc says 90,214
19:20bbloomzilti: notepad is a lot more complex than you'd think
19:20callenNotepad isn't as simple as you think
19:20bbloomnotepad cheats a bit by leveraging window's textbox control
19:20ibdknoxnotepad is actually pretty impressive
19:20bbloomyou ever try to create a text box control? heh.
19:21ibdknoxthe amount of work that went into virtualizing large files was crazy
19:21bbloomibdknox: in notepad or lighttable?
19:21ziltiI never did Windows programming. But I've some experience with plain Swing programming.
19:21ibdknoxnotepad
19:21bbloomibdknox: when did it get that feature? vista? lol
19:21ibdknoxI think so
19:22ibdknoxI'm punting on the stupidly large files thing for now
19:22bbloomhow's LT's large file support? ;-)
19:22bbloomheh
19:22ibdknoxlol
19:22bbloompoorly. got it!
19:22ibdknoxnot worth it
19:22ibdknoxwant to open a 1gb file?
19:22ibdknoxdo it somewhere else :p
19:22bbloomvim is this way --->
19:22bbloomreasonable decision
19:22ibdknoxthe only thing that are actually that large are logs anyways
19:23bbloomibdknox: generated sources too
19:23ibdknoxand there are likely better solutions there
19:23ibdknoxthey get up to > 10mb?
19:23yogthoswell if you have large files with clojure it's already gone off the rails :P
19:23bbloom(spit "myapp.edn" output-of-cljs-analyzer)
19:23ibdknoxah
19:23bbloomibdknox: just be careful that you don't offer any plugin apis that let people write stupidly slow whole-file processing
19:24bbloom"pit of success" and all that: the APIs should encourage line-scan relative processing
19:24bbloomi know you're already service-izing and async-ifying everything
19:24bbloom++ for that
19:24ibdknoxand asynchrony
19:24ibdknoxyeah
19:24bbloomit's one of the major disadvantages of clj forms vs something like a line oriented protocol
19:24Rich_MorinI don't see a way to step to the next problem in 4clojure; am I missing something?
19:25ibdknoxI haven't gotten to the point where I'm ready to craft those APIs yet
19:25bblooma line oriented protocol is kinda inherently scan friendly
19:25bbloomaim for something reducer-esque :-)
19:25Rich_Morinnm
19:26bbloomRich_Morin: we all assumed you'd find it :-P
19:26dnolencore.logic constraint stuff just got considerably more reliable
19:26dnolengfredericks: your issue should be fixed now along with many, many others
19:26callendnolen: as opposed to what?
19:27ibdknoxcallen: dnolen just recreated the universe as a logic problem, no big deal
19:27dnolencallen: not really being reliable - particularly when mixing together the various contrainst available to you.
19:27dnolenconstraints
19:27bbloomibdknox: i mean, doesn't E=MC^2 imply that that it's a finite domain? dnolen should have *zero* trouble with that
19:28ibdknoxhaha
19:28dnolenhehe
19:28ibdknoxdnolen: you rock.
19:36dnolenand it seems faster too - tho I didn't really work that much on that.
19:55SiphonblastThis is relatively off-topic, and I realize the ubiquity of such a question, but the dearth of Clojure docs puts it in a specific position: (of the few) what are some great Clojure books and/or comprehensive resources for learning Clojure? I am not the kind of person to glean deep understanding from documentation. ATM I am doing SICP, and while Scheme is much different, at least it introduces me to similar philosophies. Clojur
19:55Siphonblaste on the other hand is a bit more ambiguous with how to get to the level of solving very difficult 4clojure problems.
19:56dnolenSiphonblast: O'Reilly book is good
19:57bbloomi think rich's talks are also great insight into the clojure mindset
19:57bbloom~infoq
19:57clojurebotinfoq is http://www.infoq.com/author/Rich-Hickey
20:01BaughnUm, how do I inject some arbitrary .jar in the leiningen classpath?
20:02ziltiBaughn: Leiningen does not want you to do that at all, unfortunately.
20:02BaughnI need to do so anyway. :/
20:02ziltiBaughn: You might want to use this plugin: https://github.com/kumarshantanu/lein-localrepo
20:06Baughnzilti: Gives me mostly nullpointerexceptions.
20:08ziltiBaughn: It works fine here. The only downside is that lein searches all online repos for the jar you put in your localrepo before using it, which takes a few seconds.
20:10Baughnzilti: What version are you using?
20:11ziltiBaughn: [lein-localrepo "0.4.1"]
20:11BaughnRight. Maybe 0.3.0 is too old..
20:11BaughnIt's the one there was installation instructions for, though. :X
20:11bbloomdnolen: is that a good example of using core.logic to linearize a dependency graph?
20:11bblooms/that/there
20:12dnolenbbloom: not that I'm aware of
20:13bbloomdnolen: should just be a simple matter of unifying a vector where (relative-order left right) ?
20:13Baughnzilti: I mean, https://github.com/kumarshantanu/lein-localrepo just says to add a line to profiles.clj
20:13Baughnzilti: But that doesn't seem to /do/ anything
20:13BaughnDo I need to manually install it, as well? How?
20:13ziltiBaughn: Did you add it to the correct profiles.clj?
20:13bbloomi'll git it a crack
20:13bbloomgive* man i can't type today
20:13ziltiNo need for a manual install
20:14Baughnzilti: ~/.lein/profiles.clj, sure
20:14ziltiBaughn: So it looks like that at you:
20:14zilti{:user {:plugins [[lein-localrepo "0.4.1"]]}}
20:15BaughnYes. I copied and pasted from the readme.
20:15ziltiThen do a "lein deps"
20:15ziltiAnd then you should be able to use "lein localrepo"
20:15BaughnNope
20:15Baughn$ lein localrepo
20:15BaughnThat's not a task. Use "lein help" to list all tasks.
20:16ziltiAnd you are using leiningen 2, right?
20:17BaughnLooks like 1.7.1
20:17Baughn..yeah, that'd do it.
20:17ziltiBaughn: Then you'd have to "lein plugin install lein-localrepo "0.3""
20:18BaughnThat's what I tried first, actually. That's the one that gives me nullpointerexceptions.
20:18ziltiStrange.
20:18ziltiBut you should consider upgrading to leiningen 2
20:19BaughnDoing that now. Too bad the package manager's version is so old.
20:20bbloomdnolen: it occurs to me that i can do this trivially for a particular graph, but i have no idea how to generate a core.logic program from an input graph
20:22Baughnzilti: Did that, localrepo install now works, :dependencies on the .jar does /not/
20:23ziltiBaughn: No, you are doing it wrong. You have to do a
20:23ziltilein localrepo install <filename> <[groupId/]artifactId> <version>
20:23BaughnYup, did that.
20:23ziltiAnd then add [groupId/artifactId "version"] to your project.clj
20:23BaughnDid that, too
20:23dnolenbbloom: it's tricky business I'll say that much :)
20:23ziltiAnd then lein deps
20:24BaughnDid that. No good
20:24bbloomdnolen: the obvious answer is a macro, but that just feels dirty :-P
20:24ziltiBaughn: What does it say now?
20:24dnolenbbloom: I keep telling people I usually cheat. I read a Prolog answer and port it.
20:24Baughnzilti: ould not find artifact net.minecraft:minecraft:pom:1.4.6 in central (http://repo1.maven.org/maven2)
20:24Baughn+C
20:24BaughnAnd another one for clojars
20:25bbloomdnolen: heh. ok well i basically just want to take a graph and generate a bunch of beforeo forms
20:25ziltiBaughn: It says that because it can't find them online, but it has it locally, so that should work fine now. You get those "could not find" messages for every dependency you add.
20:26bbloomdnolen: kinda wish there was some and/or tree i could return and pass to the solver :-)
20:26Baughnzilti: Oh, right.. this .jar is the obfuscated one. >_>
20:28dnolenbbloom: pro-tip, Ask a Prolog question on StackOverflow and hope that noone thinks it's a homework question.
20:28bbloomdnolen: lol
20:28dnolenProlog answers on SO are always really good.
20:28ziltiI try using deftest in a midje test file, but it keeps telling me that deftest doesn't exist. Is that in another namespace than midje.sweet, or is the documentation outdated?
20:29dnolenbbloom: seriously, if you find a Prolog solution - porting it usually is trivial.
20:29dnolenat least in my experience.
20:32bbloomdnolen: i think my real question is: how do i treat logic predicates as data? ie how can i generate predicates and then how do i run the generated program?
20:33dnolenbbloom: I gotta run, I need to more concrete description of what you'd like to do
20:33xeqiBahman_: localrepo adds the jar, but not a pom; those messages are lein checking for the pom on a server;
20:33xeqibah
20:33xeqiBaughn: ^
20:34xeqiyou can add a fake .pom based on http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Minimal_POM to your ~/.m2 to get rid of them
20:39clj-newb-234is there a builtin for (fn [v k v] (set! v (assoc v k v))) ?
20:39clj-newb-234is there a builtin for (fn [v k va] (set! v (assoc v k va))) ?
20:39clj-newb-234where v = a var, k = a key, va = a value
20:40ziltihttp://clojuredocs.org/clojure_core/clojure.core/assoc
20:41clj-newb-234??
20:41lazybotclj-newb-234: What are you, crazy? Of course not!
20:41clj-newb-234how does the doc to assoc solve the above?
20:41clj-newb-234I want to update a var ...
20:44zilticlj-newb-234: You wrote if there's a built-in for collection/key/value.
20:45clj-newb-234assoc is not equiv to the fn defined above
20:46ziltiThink over it twice if you really need a var.
20:48clj-newb-234well, i've gone ahead and thought it over 3 times
20:48clj-newb-234it's technically not a var, but a dynamic binding, i.e. (binding [*blah* ...])
20:48clj-newb-234I should have been clearer
20:49ziltiDefinitely, and your fn up there doesn't compile.
20:51clj-newb-234intresting
20:51clj-newb-234so basically, this would have to be amcro
20:51clj-newb-234oh boy, i'm using binding, set!, and macros
20:51clj-newb-234perhapss I should rethink this through
20:52xeqiclj-newb-234: you don't need a macro for that
20:52clj-newb-234I need a way to also involve transients and jni
20:52clj-newb-234xeqi: enlighten me:
20:52clj-newb-234(defn update-binding! [b k v] (set! b (assoc b k v))
20:52clj-newb-234is not allowed as a func, ... thus my next idea is a macro
20:52clj-newb-234how can I do that without using a macro?
20:53bawrIs it just me, or is readline broken for lein repl under cygwin?
20:54clj-newb-234this christmas, I'm thankful I no longer have been cygwin free for half a decade
20:55xeqiblah, I was thinking atom, not var, sorry
21:02azkeszhey guys, is there a way to write asm win32 code from clojure ?
21:04azkeszmaybe I didn't phrase that right, I'm wondring if there's some kind of asm compiler that uses clojure code inside the asm for macros for example
21:04yogthosI don't think such an animal exists ;)
21:05azkeszI'm currently checking this http://blog.danieljanus.pl/blog/2012/05/14/lithium/
21:05yogthosnifty
21:06yogthosgithub hasn't been updated for a while
21:07azkesz7-8 months
21:07azkeszyeah but that's seems to be what I was looking for, seeing the example
21:07yogthosah
21:08yogthosheh would probably be a lot easier to implement for arm :)
21:08azkeszyou know like something like that: https://github.com/nathell/lithium/blob/master/examples/stripes.li.clj
21:08yogthosthe intel instruction set is massive
21:08azkeszto write asm in clojure like way
21:09yogthoslooks pretty similar to the regular way :)
21:09azkeszyeah lol but I kinda need the power to use macros
21:10yogthosyeah I can see fun assembly hacking with macros ;)
21:14azkesznow I'm thinking maybe I just needed some way to write assembler in clojure such that when ran it will generate a "real" (masm) .asm file, so it would just act like a neat macro machine.
21:15azkeszwonder if that's what you'd ccall a preprocessor
21:30yogthosheh maybe you can grab a list of opcodes and generate the preprocessor that way
21:32azkesznaah without that, I meant simply convert what i write into masm .asm format, and let masm do the asm to bytecode; but you're right lithium does asm to bytecode directly; but I'm having second thoughts about doing any asm anymore, I initially wanted a small .exe file to apply a patch
21:32bawrtechnomancy: I have a small patch to lein.sh that makes repl work under Cygwin. How do I go about sending it somewhere? :)
21:32azkeszpull request on github
21:33azkeszhttps://github.com/technomancy/leiningen
21:41bawrWelp, I was hoping for a simple patch. But erh, was going to dig up my github, anyway.
21:52clj-newb-234_what are good examples of code bases < 10K LOC worth reading (in clojure)
21:52clj-newb-234_I actually don't care what it does, as long as it's idiomatic clojure code and does something cool
21:52clj-newb-234_bonus points if it relates to Databases and distributed ystems
22:17bbloomclj-newb-234: not sure how idiomatic they are, but nathanmarz has some cool distributed systems and database projects
22:18bbloomclj-newb-234: https://github.com/nathanmarz/storm & https://github.com/nathanmarz/elephantdb for example
22:18bbloompeeking at the code, it seems relatively sane
22:18bbloomalthough he's pretty aggressive about supporting java clients too, which can add complexity
22:19bbloomalso, a bit messy, but extremely enlightening: https://github.com/clojure/clojurescript
22:21xeqiI like the https://github.com/weavejester/compojure source, decent intro to the ideas at http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html
22:27arrdemtechnomancy: yeah I'm now lost in emacs... live via erc
22:55muhootrying to download slides for this, and it's hanging on chrome CM9 http://www.infoq.com/presentations/Clojure-Reducers . i am logged in.
22:55muhoois it just me?
22:57muhoowell, i don't expect anyone here to FIX it, but it'd be nice if someone could confirm "it works for me"
22:58muhoobecause, if it doesn't work for others besides me, then i will contact infoq. but in the meantime, my setup is odd enough that it could be pilot error on my part.
23:01gfredericksis it normal for `lein repl` to involve 20 or 30 OS processes?
23:17theatticlight`lein repl` should only involve 2 OS processes.
23:26Raynestechnomancy: Me no can contact Heroku? And refheap is down?
23:27RaynesLooks like the ssl endpoint is broken.
23:27RaynesJust FYI to everyone, refheap is down, do not panic.
23:30alex_baranoskyI'm trying to think of a nice way to do this: I want to drop the ns form from a file, and keep the rest of the file contents (unmolested/unreformatted) and then put a new ns-form in place of the old … The way I was trying was to use `read` with a PushbackReader, read the first form, and then read the rest of the file. The problem with this approach is that the namespace ends up getting reformatted, which I'd like to avoi
23:30alex_baranoskyI mean to say the body of the namespace gets reformatted.
23:32alex_baranoskyRaynes: I've been using ref heap a lot for sharing code snippets between machines/devs at work
23:32Raynesalex_baranosky: Yey! Sorry for downtime. :(
23:32alex_baranoskyRaynes: it is a lot nicer than having Skype mangle it
23:32RaynesLuckily the only time refheap has ever went down is when Heroku goes down.
23:32RaynesAnd the only time Heroku has issues is usually when AWS is having issues.
23:33RaynesSo all bad things in the universe can be directly linked back to Amazon.
23:33muhooQED
23:35muhooall the ops are probably drinking egg nogg or whatever.
23:35alex_baranoskymuhoo, what a great idea
23:36muhootho i'd bet technomancy is probably putting presents under tree for his kids, right about now, etc.
23:38muhoomaybe amazon downage is why i can't get infoq to hand me pdfs of rich's slides
23:48alex_baranoskyno one has any ideas on a good way to replace just the ns form of a namespace?
23:53SgeoCan Heroku be used to run web stuff from arbitrary languages?
23:54arrdemSgeo: in theory...
23:55arrdemif you wanted to do some non-standard server I suppose you could include it in your repo and change their run command to launch it so long as it conforms to their $PORT var