#clojure logs

2011-03-21

00:00brehautdevn: https://github.com/blog/99-popular-languages#comment-362
00:04devnit would be interesting to know then, why in the past when ive had a clojure project containing something like jquery-min-1-x-x.js
00:04devnit still shows my project as being javascript
00:05brehautcurious
00:05devnanyway, the language popularity on github is flawed from the start
00:06brehautit does seem like a very difficult thing to get a good measure on
00:06devnLoC is a bad measurement, so is file size, what is left?
00:07brehautgz the file, measure the file size then
00:07brehautits not perfect, but it will get rid of a lot of the noise
00:07devnIf I can write something in Clojure in 8 lines that'd take me 40 in Java, does that mean Java has more code?
00:07devnWhat about the reusability of the Java code?
00:07devnor the clojure code for that matter
00:08devnshould forks and watchers hold some weight?
00:08devnand so on...
00:09devnbrehaut: https://github.com/abedra look at 'bookjure', take a gander at the source files in there.
00:11brehauti think a better approach would be to give every project an equal weight; forks and watches lower weights respectively (and forks with no commits should count as watches), and then calculate ratio of each languages component of the project and multiple the project, forks and watchers by those ratios.
00:12brehautsomething does look very broken with their filtering if it is actually filtering
00:13brehauti dont think overall quantity of the language matters because once the project has started, the chosen language is fixed.
00:33devn*nod*
00:33devngood point
00:33devnbut then you have things which are libraries to interface with another language
00:33devnlike, is a python generation library written in clojure a clojure project, or is it a python project?
00:34devnyou could make the argument either way -- yes it is definitely a clojure project, but if im browsing python projects that might be something im interested in as well
00:35brehautyeah thats a good point
00:36devni guess i just find github intensely annoying when it comes to searching
00:37devnthe thing that would send github over the moon is a way to say: "show me all of the repositories where the project is based around clojure and databases"
00:37devnand it should show me a nice list of db-related clojure projects assuming people have tagged their repo accordingly
00:37brehautyeah
00:38brehautthats the hard part
00:38devni beg to differ -- we're talking about people who wrote something and probably spent some time on it
00:38devnthey're not going to be so lazy as to not setup the project correctly from the start
00:38brehautgetting them to tag it consistently is whats difficult though
00:39devnin the long run, though, what i imagine will happen is this: all projects are not tagged, but large projects are most certainly tagged
00:39brehautanyway its dinner time here
00:39brehautttyl
00:39devnso well-maintained projects are shown
00:39devnbrehaut: *nod* ciao
01:31joshua__Do any of you have a link to some code that shows an algorithm implemented without composition and an algorithm implemented with composition. I'm thinking of a particular article, but don't remember where I saw it.
01:31joshua__I think it had to do with run-length encoding.
01:32joshua__Nevermind, found it.
01:36joshua__,(doc comp)
01:36clojurebot"([f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."
01:38joshua__,(doc partial)
01:38clojurebot"([f arg1] [f arg1 arg2] [f arg1 arg2 arg3] [f arg1 arg2 arg3 & more]); Takes a function f and fewer than the normal arguments to f, and returns a fn that takes a variable number of additional args. When called, the returned function calls f with args + additional args."
03:52thorwillein appengine-prepare (provided by appengine-magic) fails with java.lang.Exception: No such var: appengine-magic.core/default-war-root (core.clj:64)
03:53thorwilmy core.clj:64: (ae/def-appengine-app tlog-app #'tlog-app-handler) is exactly like in the readme and another, functioning project called ackbar
03:57thorwilappengine-magic.core does not contain default-war-root directly, but has (if (in-appengine-interactive-mode?) (load "core_local") (load "core_google"))
03:59thorwilcore_local.clj defn's default-war-root, but core_google.clj doesn't
04:00thorwilso why does "lein appengine-prepare" result in the loading of core_google, not core_local? any ideas?
04:20raekthorwil: apparently, (in-appengine-interactive-mode?) returns false and only the (load "core_google") expression is evaluated
04:21raekthorwil: it looks like this is related to the problem we discovered the other time. (weird for it to happen with their own plugin, though...)
04:28thorwilraek: yes. have to be sure it's a bug, not a mistake on my side
04:30thorwilactually, it's true that this can't be called an interactive.mode. but where should the default-war-root come from, then?
04:38thorwiloh, i can get rid of that error by adding ":aot tlog.app_servlet" to my project file
04:42thorwilbut of course i get this, then: http://paste.pocoo.org/raw/357039/
04:44raekcould be something like (defn foo bar [] ...) instead of (defn foo [] ...)
04:45raekor a syntax error in some ns form
04:52thorwilhmm, but my stuff compiles fine
05:07Dranikhi all!
05:17AWizzArdMoin Dranik.
05:37ejacksonhey all
06:03DantasHi everyone !!! Good morning from GMT ( Lisbon ) :)
06:04Dantasim wondering with the clojure Agent could be something like other languages called Actors?
06:04ejacksonDantas: its similar
06:04Dantasejackson: thnax
06:04Dantasops, thanx
06:04ejackson:)
06:05Dantasejackson: message passing concurrency, right ?
06:05ejacksonno
06:06ejacksonhold on, let me bring get you a good link for this
06:06Dantasejackson: nice :)
06:07ejacksonhttp://www.dalnefre.com/wp/2010/06/actors-in-clojure-why-not/
06:08Dantasejackson: thanx, ! but look, agents are like actors, and actor use the message passing concurreny model , isn´t ?
06:09ejacksonactors do use that, but agents are not actors
06:09ejacksonthey don't hang around waiting for messages
06:10Dantasyeah yeah, its not fair call agents as actor, but a subset could be ?
06:10Dantasejackson: sorry for my english, :(
06:10ejacksonDantas: don't worry, my Portuguese is worse
06:11Dantas:)
06:11Dantasim from brazil but living here ( lisbon )
06:13ejacksonI'm not a compsci guy, but as I an agent is just a something that applies a thread to a reference type.
06:13ejacksonit can take any function, unlike actors, which only respond to a specific subset of messages
06:13ejacksonthe key, in Clojure land, is that its asynchronous (unlike refs or atoms)
06:14Dantasso, Agent could be translated as a Thread waiting for actions to execute.
06:14ejacksonagain, no.
06:14ejacksonthat sounds more like a future
06:15ejacksonthe agent, as I understand it, is just the 'wrapping' around the reference type that controls how it is updated
06:15Dantasexcelent
06:15ejacksonit can be backed by a threadpool that will give you a thread to perform the function you apply, or not, but it itself is not a thread
06:15ejacksonit is a reference data type
06:16Dantasyeahh
06:16Dantasreally nice
06:16ejacksonbut take all I say with lots of salt, I'm an eternal noob.
06:18Dantasejackson: :) really nice .. appreciate for ur time
06:18ejacksonno worries, hope I didn't lead you astray
06:20Dantasejackson: im sure not
06:21Dantasejackson: u are right
06:21ejacksoni'm happy to accept that - reference ?
06:25angermancan I somehow speed up the emacs swank interaction?
06:25angermanIt always goes: "fontifying"....
06:25TobiasRaederMorning everybody :)
06:25incandenzaangerman: (setq font-lock-verbose nil)
06:26ejacksonDantas: Here's a good discussion of the differences, look about halfway down: http://bc.tech.coop/blog/081201.html
06:27Dantasejackson: im reading the last u sent !
06:27Dantasejackson: thanx
06:27ejacksonk
07:09ejacksonDantas: you fixed up ?
07:09Dantasejackson: Yeah ! its clear
07:10ejacksonok, cool.
07:10Dantasreally enjoy the blog article
07:11ejacksonyeah, both were good as they are from opposite perspectives, and discuss the same statements by Rich
07:26thorwilanyone else experiencing hours of delay when posting to the google group?
07:27Raynesthorwil: Yup. Thus is the nature of a mailing list reader.
07:29thorwilmeanwhile, i solved my issue
07:40thorwil"java.lang.NoClassDefFoundError: Could not initialize class tlog.app_servlet" is likely a classpath issue?
08:01angermandoes anyone use appengine-magic?
08:02thorwilangerman: i'm trying to. so far it seems to be a horrible idea
08:03angermanHmm. well it works for me except I can't get the datastore to work.
08:04midsangerman: got it working, whats the problem?
08:04angermanNo API environment is registered for this thread.
08:05midsis that from the REPL?
08:05angermanyes
08:06angermanmids: do I need to enable anything special_
08:07midsyou need to call ae/serve before you can access the DS
08:07thorwili guess my problem could be due to trying to run with appengine-java-sdk-1.4.2, while 1.3.7 in my lib. is a specific version of appengine-magic tied to an sdk version?
08:08angermanmids: there's not ae/server.
08:08angerman"eer serve
08:08midsthorwil: try to 0.4.0 branch: https://github.com/gcv/appengine-magic/blob/v0.4.0/project.clj
08:10midsangerman: ah yeah, I am using the 0.4.0 branch which has. guess you can also use ae/start
08:10midsI have added a repl-init-script to my project.clj; where all the setup stuff takes place when I call 'lein repl'
08:10angermanmids: strange. It's already serving.
08:11angermanmids: hmm. Using swank, but that should be no issue, no?
08:13midsI wouldnt think so, although I dont use swank myself
08:13thorwilmids: i'd like to that project.clj. all my attempts to streamline the get going failed, except for using durendal-jackin
08:15Dranikjoin #lisp
08:15Draniksorry
08:16angermanmids: do I need anything else except (ds/query :kind Test)?
08:18midsangerman: you need to defentity Test first
08:18angermanahh, ok. I guess that the slime thread is just unbound.
08:19angermanThe app apperently can use the datastore. It's just not available from the repl.
08:28fliebel&(.nextInt (java.util.Random. 107038380838084))
08:28sexpbotjava.lang.Exception: EvalReader not allowed when *read-eval* is false.
08:28fliebel,(.nextInt (java.util.Random. 107038380838084))
08:28clojurebotjava.lang.ExceptionInInitializerError
08:28fliebelhuh...
08:30fliebelWhy does that give 2 different nonsensical errors, and work locally?
08:30opqdonutbecause the bots are sandboxed
08:31opqdonutand for some reason the sandboxing doesn't allow those, *shrug*
08:32fliebelopqdonut: Yea, weird… It's not doing anything dangerous (on the surface)
08:33tomoj,(long 107038380838084)
08:33clojurebotjava.lang.ExceptionInInitializerError
08:33fliebel&(long 107038380838084)
08:33sexpbotjava.lang.Exception: EvalReader not allowed when *read-eval* is false.
08:33tomojhaha
08:33tomojmagic number?
08:33opqdonut&(long 1)
08:33sexpbot⟹ 1
08:34opqdonutinteresting
08:34fliebelhuh? I'm not allowed to instantiate longs?
08:34opqdonutjust not that long :)
08:34opqdonut&(long 10703838)
08:34sexpbot⟹ 10703838
08:34opqdonut&(long 107038380838)
08:34sexpbotjava.lang.Exception: EvalReader not allowed when *read-eval* is false.
08:34opqdonut&(long 1070383808)
08:34sexpbot⟹ 1070383808
08:34opqdonut&(long 10703838083)
08:34sexpbotjava.lang.Exception: EvalReader not allowed when *read-eval* is false.
08:34opqdonut&(int 1070383808)
08:34sexpbot⟹ 1070383808
08:34opqdonut&(int 10703838083)
08:34sexpbotjava.lang.Exception: EvalReader not allowed when *read-eval* is false.
08:35tomojwtf?
08:35fliebelSo, anything that fits in an integer can be a long? usefull...
08:35opqdonutlongs that don't fit in an int
08:35opqdonutyeah
08:35opqdonutprobably the reader handles them somehow differently
08:35opqdonutand this trips up the EvalReader thing
08:35raek,(read-string "(int 10703838083)")
08:35clojurebot(int 10703838083)
08:36raek,(class (second (read-string "(int 10703838083)")))
08:36clojurebotjava.lang.Long
08:36raek,(class (second (read-string "(int 1070383808)")))
08:36clojurebotjava.lang.Integer
08:37tomojdoesn't seem like EvalReader should be involved
08:37fliebel&(long 107038380838084.)
08:37sexpbot⟹ 107038380838084
08:37tomojbaffling
08:38fliebel,(str "&" (long 107038380838084.))
08:38clojurebot"&107038380838084"
08:38tomojwonder if it's just a coincidence that both bots have the same symptom?
08:39fliebel&(.nextInt (java.util.Random. (long 107038380838084.)))
08:39sexpbot⟹ 0
08:39fliebelyay
08:39opqdonutha
08:40fliebelI found that on stackoverflow, but I was wondering if there is a way to tell if there are more numbers that generate 0, and what they are.
08:40opqdonutexhaustive search :)
08:40fliebelopqdonut: You mean the only way to find out is to try them all?
08:40opqdonutof course not
08:41opqdonuthave a look at the implementation, you might be able to work out an equation that narrows down the space considerably
08:44fliebelopqdonut: Hm, I'm not sure if my math is capable of that, but I'll try. My end goal is to find a string whose .hashCode produces 0 when used as a seed in a random number.
08:45tomojare string hashcodes predictable?
08:45tomoj&(.hashCode "foo")
08:45sexpbot⟹ 101574
08:45tomojguess so
08:45opqdonutyeah they are
08:45fliebeltomoj: it seems: http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#hashCode()
08:45opqdonut&[(.hashCode "f") (.hashCode "fo") (.hashCode "foo")]
08:45sexpbot⟹ [102 3273 101574]
08:46fliebeltomoj: How did you tell it was so from that single command?
08:46tomojI also ran it locally :)
08:46fliebelah
08:46tomojI'm using CRC-32 to get random seeds from strings now
08:47tomojwonder if I could've just used hashCode
08:49thorwilam i doing something wrong with "../appengine-java-sdk-1.4.2/bin/dev_appserver.sh resources/"?
08:50midsthorwil: did you run lein appengine-prepare before?
08:51thorwilmids: yes.
08:51midssounds good
08:52thorwilmids: all i can find for "java.lang.ClassNotFoundException: tlog.app_servlet" suggests a classpath issue, but i would hope that is taken care of?
08:52tomojlooks like hashcode has 494 collisions in wamerican-insane, crc32 42
08:53midsthorwil: does running from the repl work?
08:54thorwilmids: it did before i upgraded appengine-magic, and i had the same issue before
08:54midsupgraded to?
08:54thorwil4.0.0-SNAPSHOT
08:55midsv040 writes to war/ instead of resources/
08:56angermanmids: thanks. Does appengine-magic provide session/cookie support?
08:57midsit doesnt provide anything for that
08:57angermanmids: damn. Do you know of any support?
08:57midsbut you can use ring session middleware
08:57angermanahh ok. that comes with compojure, right?
08:58midsI believe it comes with ring
08:58angermanyea, but ring is pulled as a dependence of compojure I think.
08:58midsright
08:58angermanthat's what I ment.
08:59midsring.middleware.session.cookie
08:59midswhat do you need to store in sessions though?
08:59thorwilmids: should web.xml and appengine-web.xml be moved from resources/WEB-INF to war/WEB-INF, then? or copied?
09:00midsthorwil: moved; resources is no longer used
09:00angermansandbar looks nice.
09:01angermanmids: I need it for a stateful authentication of a user
09:01midsangerman: cant you get away using the google user service?
09:01angermanno.
09:01midsok :)
09:01angermanit's a custom throw away user management.
09:02angermangenerating random id/passwords. that are shortlived (14days)
09:06thorwilone issues down, next follows immediately: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)
09:07midsthorwil: are you starting a thread?
09:07mids(or using some library that does)
09:08thorwili don't even know how i would do that. it's just ring, moustache, enlive
09:10midsthe exception makes it sound like there is some threadgroup stuff going on; which GAE doesn't allow
09:11fliebelHow would javas >>> translate to clojure?
09:11fliebelIs that just bit-shift-right?
09:12thorwilmids: it was a :use ring.adapter.jetty, thank you!
09:17midsfliebel: no, bit-shift-right uses >>
09:17fliebelmids: I know, but what is the triple one then?
09:18midsthis thread suggests it isnt available: http://groups.google.com/group/clojure/browse_thread/thread/0260fe6f02a5f05d?fwc=1&pli=1
09:19fliebeluh,oh
09:27fliebelSo Is there any way I can mimic (seed >>> (48 - bits)) in clojure?
09:29midscan seed be negative?
09:30fliebelmids: yes
09:36midsfliebel: "Shifting right by n bits on an unsigned binary number has the effect of dividing it by 2n (rounding towards 0)."
09:38fliebelmids: So… 40 >>> 5 is like (/ 40 (* 2 5))?
09:38mids2^n
09:38midspasted from http://en.wikipedia.org/wiki/Logical_shift
09:39midsI would create some unit tests for this though :)
09:39Chousuke_doesn't clojure have bitshift operators?
09:39TimMcfliebel: Shifting negative 2's complement numbers can produce surprising results.
09:40fliebelouch
09:44TimMc,(bit-shift-right 10 2)
09:44clojurebot2
09:44TimMc,(bit-shift-right -10 2)
09:44clojurebot-3
09:44TimMc,(bit-shift-right -1 2)
09:45clojurebot-1
09:46midsjavascript: > -10 >>> 3
09:46mids536870910
09:47TimMcweird
09:47TimMcNo idea what's going on there.
09:48TimMcOh! -10 >> 2 in JS is -3
09:49TimMcmids was using the logical right shift, I was using arithmetic right shift.
09:49TimMcfliebel: Which one do you want, zero-extend or sign-extend?
09:49TimMcOr negate, shift, negate?
09:54fliebelTimMc: Logical
09:56midsfliebel: https://gist.github.com/879473
09:56fliebelmids: thanks
09:56TomsikHi, http://blog.japila.pl/2011/03/processing-in-clojure/ says to "Run the application with /Applications/Processing.app/Contents/Resources/Java/core.jar in Clojure’s CLASSPATH." What is this classpath and how do I use it?
10:05gfrloghaving lein installed implies that maven is somewhere on my system too, correct?
10:05angermanTomsik: it means when you run the app script, you need to have clojure as well as core.jar in your classpath.
10:05angermanTomsik: CLASSPATH is the environemnt variable …
10:06TomsikOkay, but it seems to be empty
10:09Tomsiklocate only gives something called lucene-core.jar, it's not that thing I guess?
10:10angermanno. it's not.
10:10angermanaccording to that blogpost it's somewhere in the Processing.app
10:11angermanbasically what you want to do is: $ java -cp clojure.jar:/Path/to/processing/core.jar clojure.main
10:11angermanand from the REPL you wan "(load "script.from.website.clj")
10:11pjstadiggfrlog: i believe it means some maven related jars for dependency resolution, but maybe not the actual `mvn` script
10:13gfrlogpjstadig: cause my next question was how to install maven given lein :)
10:13gfrlogpjstadig: I guess I'll try it the normal way
10:13TomsikThanks!
10:13pjstadiggfrlog: yeah that's probably what i'd suggest :)
10:14gfrlogpjstadig: thx
10:14TimMcgfrlog: THe other day you were joking about writing a language where data was code...
10:14TimMcI just realized that's the lambda calculus. :-)
10:15TomsikYeah, in System-F etc. you can encode datatype constructors
10:15Tomsikand destructors etc. etc.
10:15gfrlogTimMc: hmmm
10:15gfrlogTimMc: I could accept that
10:16gfrlogTimMc: every time I make a joke it turns out I was just talking about the lambda calculus.
10:17TomsikThink about this way, if universe is just Turing-complete then you are the lambda calculus
10:18jaspervdjAny Clojure adapt in Belgium/Ghent who would be willing to give a talk at a Ghent Functional Programming Group meeting?
10:19jaspervdj*adept
10:37Rayneshttp://raynes.me/hfiles/cat.jpg I and my cutest coder friend during our pair programming session a few minutes ago.
10:37pdkdoes she pair program when you write perl
10:38Raynespdk: Only when we write LOLCODE.
10:39RaynesAnd Clojure of course. She pronounces it Clopurr.
10:39RaynesWould Clojurrrrr had been cleverer?
10:49@rhickeyso, I have a version of Clojure here where _none_ of the Clojure interfaces are declared to throw checked exceptions, and all tests pass. A fn can call code that throws a checked exception and it will not be wrapped (i.e. the declarations are lies). Any interest?
10:51cemerickrhickey: that was fast :-P
10:52@rhickeycemerick: long on the agenda, and much more than you asked for
10:52@rhickeyit's a mother of a patch
10:52cemerickI'll bet.
10:53@rhickeyand a breaking change for Java derivees of Clojure interfaces that have declared throws Exception in order to match the old interfaces
10:53@rhickeyso, it's kind of now-or-never given this next (breaking) release
10:53cemerickrhickey: what happens when a checked exception floats up out of an unadorned IFn.invoke call? No negative repercussions at runtime?
10:53cemericki.e. java.lang.TheSkyIsFallingError?
10:54@rhickeyI'm comfortable with the lie, and no, checked exceptions are a fabrication of javac
10:54chouserthis would mean less deep-wrapping with Runtime exception?
10:56@rhickeychouser: also as part of this patch is rigorous use of a new Util.runtimeException which does once-only wrapping
10:56cemerickfancy
10:56@rhickeythere is still wrapping, as the Java code needs it in order to satisfy javac
10:56cemerickrhickey: This is just going to encourage me to suggest more and more outlandish-sounding things, in the hopes you've already implemented them.
10:56@rhickeybut none built into AFn/IFn or compiled fns
10:57@rhickeyno exceptions from map fns or any other interfaces either
10:58@rhickeypatch started with replace "throws Exception" with ""
10:58@rhickeyglobally
10:58choffsteinHey all -- what is the 'clojure' way of doing configuration files? Is it using XML? YAML?
10:58choffsteinPutting it in the code itself?
11:00cemerickchoffstein: yeah, a .clj file makes for a pretty good configuration file. :-)
11:00choffsteinfigured :)
11:01choffsteindoes anyone know of a library that can be used to poll a queue to run background jobs?
11:01choffsteinlike resque for Ruby?
11:06@rhickeyshall I take the lack of dissent as assent?
11:07fliebelrhickey: Go ahead :)
11:07ejacksonrhickey: above my paygrade :)
11:07@rhickeyI was sure someone would balk at the potential undeclared throwing of checked exceptions
11:08Raynesrhickey: Someone isn't awake yet. Someone will be sure to balk for you later.
11:09fliebelrhickey: I'm not sure what this means in Java land. Is it that you can declare some function without the throws keyword, and still have it throw stuff?
11:09@rhickeyone only need to look at the new lambda stuff in Java to see the trainwreck of checked exceptions and HOFs
11:09@rhickeyfliebel: yes, you could call IFn.invoke, which is not declared to throw anything, and it could throw a checked exception
11:10@rhickeyit could be documented as doing so
11:12@rhickeyas Brian Goetz and John Rose say in this talk, checked exceptions are among many Java language fictions superimposed on the JVM:
11:12@rhickeyhttp://cr.openjdk.java.net/~jrose/pres/201009-OneVMManyLanguages/pres_files/pres.029.jpg
11:12@rhickeyof course, for people living in that fiction, this still might be considered screwy
11:12cemerickrhickey: I think my java.lang.TheSkyIsFallingError thought was as close as you'll get to balking at this. :-)
11:13fliebelrhickey: What are the advantages and disadvantages of doing this? (btw, how did you do it? I remember getting "X throws Y but is not declared to be thrown" or something like that)
11:13@rhickeyfliebel: the disadvantages of checked exceptions are too numerous to get into here
11:14pjstadig`rhickey: you're saying it would throw a checked exception, or a checked exception wrapped in a runtime exception?
11:15@rhickeypjstadig`: whatever exceptions are throw will flow through Clojure fns, with no wrapping, so, IFn says no checked exceptions but they could come out of invoke anyway
11:15@rhickeywrapping is only required for the Clojure runtime code written in Java
11:16pjstadig`right, so checked exceptions are enforced by the compiler not the JVM is what you're saying
11:16pjstadig`sure
11:16fliebelrhickey: So does this make it harder to use Clojure form Java?
11:16pjstadig`so it would only matter if you are using Clojure from the Java side, and you just wouldn't know that those exceptions are thrown, even though technically they are "checked" which means the compiler should complain
11:17@rhickeyfliebel: fewer checked exceptions is usually easier, but if you rely on the declarations in order to write Java code, then this will seem deceptive
11:18pjstadig`rhickey: as a former java programmer...meh, i've got no balking
11:21@rhickeyhttps://github.com/clojure/clojure/commit/8fda34e4c77cac079b711da59d5fe49b74605553
11:28TimMcI assume .class integrity verification does not check for throws declarations.
11:31@rhickeyTimMc: as the slide I posted earlier states, they are a fiction of javac, so no, not involved in verification
11:40dnolenhmm, does type-hints on def make a difference ?
11:41fliebeldnolen: difference on what?
11:41dnolenfliebel: does it help avoid reflective calls.
11:42fliebeldnolen: depends… Did you try *warn-on-reflection*?
11:42dnolenfliebel: btw, disequality constraints are going to be pretty simple to implement- go metadata!
11:43fliebeldnolen: yay! love metadata!
11:43dnolenfliebel: of course, but I have to say I'm not convinced *warn-on-reflection* catches all cases...
11:44dnolenfliebel: I'll add all-different as well as a shortcut.
11:44dnolenfliebel: planning on an adding an N Queens example that shows it off.
11:44fliebeloh… idk, I don't know. I am under the impression that Clojure infers, or at least remembers types sometimes. So depending on what is def'd, I think it should help.
11:44fliebeldnolen: Yea, queens is great fr that
11:46dnolenfliebel: basic tabling is already done.
11:47fliebeldnolen: ooh! and is the pattern matching finished as well? and cond-a? *exited*
11:47jweisswill unquote-splicing consume a lazy seq (of forms)?
11:48fliebeljweiss: how would you tell it to do so?
11:49fliebeljweiss: oh, wait, splicing is not limited to a simple macro. hmmm...
11:49dnolenfliebel: pattern matching is done, cond-a/u fixed.
11:49chouser, `(do ~@(map inc [2 3 4]))
11:49clojurebot(do 3 4 5)
11:49chouserjweiss: like that?
11:49jweisschouser: ah nice example, thx
11:50jweissi guess my (doall (for ... )) i don't need the wrapped doall
11:50fliebeldnolen: cool, so only negation, and I can make my super terse and fast sudoku :)
11:51fliebeldnolen: You said that while the stack overflow is fixed for arithmetic, there are still duplicate results. Is that still the case?
11:53dnolenfliebel: adding a couple of type-hints brought zebra down to ~5ms w/o occurs-check. So now faster than SWI on that bench.
11:54fliebelyay
11:54dnolenfliebel: duplicate results as far as I can tell is a result of the miniKanren changes. I haven't seen any evidence otherwise, and it only seems to afflict the arithmetic stuff, not any other programs. Could be wrong, but I'm not going to investigate further at the moment.
11:55fliebeldnolen: I understand. So this stuff has to be rewritten?
11:57dnolenfliebel: what has to be rewritten?
11:57fliebeldnolen: the arithemtic stuff
11:59dnolenfliebel: I don't think so. arithmetic stuff is interesting as a fleshed out example of something that's easy to do in miniKanren that's harder in Prolog. I'm not going to spend anytime on making it better since it's not useful beyond a learning tool.
12:00fliebeldnolen: Why would it not be useful? Is it to slow to define useful numeric relations?
12:01dnolenfliebel: it's too slow to be generally useful. Oleg has said as much himself.
12:01fliebeldnolen: Prolog does have arithmetic implemented, is this at another level?
12:02dnolenfliebel: I believe Prolog has implicit projection. X is X+1, will project X and add 1 to it.
12:03fliebeldnolen: So the same can be done in Logos, but it's not a real relation.
12:03dnolenfliebel: for useful declarative programming with numbers, you'll have to wait for me work out constraint solving library - which is planned.
12:04dnolenit won't be miniKanren (though it might use it internally)
12:05fliebeldnolen: Okay, good luck with that then :)
12:13technomancyangerman: C-c C-l is force-reload in recent swank-clojure.
12:13angermantechnomancy: does that reload the classpath as well?
12:14angermane.g. adding a dependence to the project.clj, running lein deps, and then C-c C-l?
12:17technomancyangerman: no; that's more involved
12:18scottjtechnomancy: oh so if you don't want force reload just C-c C-k ?
12:19technomancyscottj: yeah, C-c C-k has always been "normal compile"
12:22scottjok I somehow missed that response on arohner's ticket
12:34choffsteinIf I have a library where I need the library user to set their API key, should I have the library read a config file or use a ref and create a setter method?
12:38tomojcertainly not the latter
12:46tomoj"Bindings created with binding can be assigned to, which provides a means for a nested context to communicate with code before it on the call stack." -- huh?
12:47tomojoh
12:48tomoj"nested context" doesn't mean "nested bindings" but just the regular old kind of nesting through functions, I guess?
12:49fliebeltomoj: I guess so to.
12:49fliebelThis kind of stuff could happen anywhere in the stack: (binding [a 1] (set! a 3))
12:49Lulu58e2
12:50tomojI thought for a bit it meant that the assignment could espace the innermost binding
12:59fliebeldnolen: Is it me, or do pattern matching and other features not go together? Tabling and cond-a, to name a few.
13:00dnolenfliebel: ? they should work together just fine.
13:00fliebeldnolen: Then why did you write path-o in the regular style?
13:02dnolenfliebel: what is there to pattern match in path-o?
13:02fliebeldnolen: x, y and z?
13:03dnolenfliebel: and what are we matching them against?
13:05fliebelokay… nothing, but I… assume there are cases where you want to use tabling in a defn-e?
13:05fliebelAnd there isn't defn-a, right? Okay, that is probably a macro away though.
13:06dnolenfliebel: oh I see what you're asking. Just haven't gotten that far. defn-a, defn-u, deftabled are on the list of todos.
13:07fliebeldnolen: But that way you keep going… what about deftabled-a? oh well, probably not useful in any way, since cond-a… or.. well, dunno.
13:09dnolenfliebel: yes, supporting a and u variants for tabled goals would be useful as well. will probably be more like (defn-e ^:tabled path-o [] ...) (defn-a ...) (defn-u ...).
13:12fliebeldnolen: great :) I assume tabling is optional because it comes at a memory cost?
13:13fliebel(couldn't this be all? https://github.com/swannodette/logos/blob/master/src/logos/tabled.clj#L152 )
13:15fliebel(similarly, (not (=)) could be (not=))
13:17dnolenfliebel: all just becomes exist so not much advantage. but yeah not= is better.
13:17fliebeldnolen: I thought it was the other way around, with exist containing an all.
13:20dnolenfliebel: that's true, tho not currently implemented that way. exist is just an all that introduces logic vars.
13:20fliebelI see
13:20Licenserhi people
13:21dnolenfliebel: always willing to take patches :) you can just run lein test now to make you didn't break anything.
13:21dnolenfliebel: 143 tests currently.
13:21LicenserI wonder is there some kind of clojure benchmark by now?
13:21fliebeldnolen: I'll keep that in mind.
13:43symboleRegarding Clojure's notions of identity, state, and values, is there any computer science literature that talks about it more in depth? Perhaps comparing these notions with respect to OOP and functional programming.
13:45symboleTo put it in another way, is there any reading material that would help in understanding the difference between what Clojure's attempt at concurrency, and other's.
13:51dnolensymbole: Concept Techniques Models of Computer Programming. Java Concurrency in Practice. Armstrong Erlang book.
14:51jolyHaving recently run into the problem of holding the head of a (long) lazy seq, is there a good way to name a subexpression (primarily for understanding/documentation) that doesn't hold onto the head in a local binding?
14:54jolySo I could have something like (let [2d-points (repeatedly #(vector (Math/random) (Math/random)))] (... (... (... 2d-points)))), not be holding the head, but not have to just substitute the subexpression?
14:59pjstadigjoly: i believe you can factor out a function that you can call, and have a handle to a lazy seq that will not hold the head
15:01pjstadigjoly: and for understanding/documentation that's probably best anyway :)
15:02jolypjstadig: Hmm, sounds obvious now that you mention it. :) Thanks!
15:05symbolednolen: Thanks. I'll check them out.
16:38CozeyGood day. what happened to clojure.contrib.duck-streams/file-str in 1.3.0? A lot of duck-streams moved to clojure.java.io but i can't find this one
16:39technomancyCozey: clojure.java.io/file should suffice
16:39Cozeyoh, mhm. thanks. will try this out
16:43CozeyDoes anyone know what's the status of ClojureScript? Is it usable to write a fairly simple site with jquery? or perhaps is using jquery with CS a bad idea? (or just missing the point)
16:55chouserCozey: It's just really old
16:55Cozey? abandoned
16:55Cozey?
16:55chouserCozey: ClojureScript works, but implementes a pre-1.0 version of Clojure
16:55Cozeymhmm
16:56Cozeyso now CoffeScript is all the rage?
16:56chouserCozey: Essentially abandoned until Clojure-in-Clojure is ready, which will make keeping it up to date much batter.
16:57chouserCozey: You might like Scriptjure too, but neither of those implement Clojure semantics, which was the point of ClojureScript.
16:58Cozeymhm
17:00Cozeyjust read about Clj-in-Clj. Sounds really cool :-) when it's going to happen?
17:01chouserI think the next step is to rewrite the Clojure compiler in Clojure. The language now has everything needed to do that, it just needs to be done.
17:02chouserSomeone already did it, actually, but without any communication with the core team, so I'm not sure what will become of that.
17:02chouserCozey: I guess it probably just needs a champion. Got some free time?
17:02fliebelchouser: Well, if someone did it already, that is a champion, right?
17:03chouserfliebel: He has made no effort I've noticed to have it adopted as the official Clojure compiler
17:03ataggartanyone know an easy way to fix a git "does not apply" issue? Rich took a machete to Exceptions in clojure.lang and now no patches will apply.
17:04fliebelataggart: Maybe you could apply them to the previous commit, and then apply his patch?
17:04Cozeychouser: Would need much more skill than i have
17:04cemerickfliebel: independent spikes don't make it very far in terms of being folded into core
17:04Cozeybut isn't this effort lead by RHickney?
17:04ataggartfliebel: yep tried that with rebase. doesn't work. Maybe I'm doing it wrong
17:05chouserCozey: He seems, so far, to have chosen not to lead this particular part.
17:05Cozeymhm
17:05cemerickI'll open a ticket for it tomorrow. Then a patch for it will appear ~3 hours later. :-P
17:06chouserPart of the work, perhaps the next part, is to choose the internal tree format to use, a format which should be attractive to IDEs, code generators (to produce JVM bytecode, CLR bytecode, JavaScript, etc.) as well as any other analysis or other tools.
17:06fliebelwhat is the name of that clojure in clojure implementation again?
17:07chouserThe thought of trying to get buy-in from all the people interested in those topics sounds very unattractive to me personally.
17:07chouserActually, it sounds like the kind of thing cemerick chooses to do, for reasons that must be altruistic rather than personal. :-)
17:07cemerickbikeshed city
17:07jweissI'm noticing that you can make keywords with the keyword fn that you can't use as a literal:
17:08jweiss,(keyword "can't")
17:08clojurebot:can't
17:08chouserjweiss: yes
17:08jweisshm. i guess that is ok. just weird
17:08chouserjweiss: either the printer and reader should be changed to allow such things to work, or the keyword function should prevent it.
17:08cemerickchouser: I want tools that don't suck. It spurs me on to do strange things.
17:08brehautchouser: is this mysterious unofficial cinc developer you?
17:09chouserbrehaut: not even close. :-)
17:09CozeyHow about real debugger support? (with breakpoints etc, and not macro trickery like break/trace)
17:09cemerickThat, and I actually enjoy politics.
17:09Cozeyis it happening anytime soon?
17:09fliebelchouser: So the main problem with it is that he designed it on its own?
17:09dnolenCozey: there's cdt
17:10chouserI had an plan and the beginnings of some code, but the whole thing got shot down quite definitively at Clojure Conj 2010, and I haven't tried to pick up the pieces yet.
17:10dnolenchouser: https://github.com/GeorgeJahad/cdt
17:10cemerickCozey: FWIW, I'm going to be bashing at proper debugging support in ccw sometime after the book is done.
17:10dnolenchouser: shot down by who?
17:10cemerickUnless Laurent and Christophe get to it first…
17:10Cozeywill give it a shot
17:11kotarakHasn't someone used jswat with clojure?
17:11dnolenoops, the cdt was for Cozey.
17:11fliebelWhere does this mystical cinc implementation live?
17:11ataggartcemerick: the breakpoint support in ccw is nice, the only pain point is not being able to see the let-bound values.
17:11chouserfliebel: that may not actually be a problem. If someone were to look at that code, maybe document it, and pitch it to Rich as the right solution, it might go somewhere.
17:12dnolenkotarak: I have used it before, it's OK.
17:12cemerickkotarak: yeah, all the java debuggers work just fine with Clojure. The trick is to get decent UI over locals and vars, clojure data structures, and in-place eval of code.
17:12cemerickataggart: they're there, just mangled beyond recognition in the default variables view.
17:12fliebelchouser: The guy who wrote it seems to be in a perfect situation to do so :)
17:12kotarakdnolen, cemerick Yeah. Just remembering something in the dark. (for Cozey) I use mainly prn and log. :P
17:12fliebel(but I still don;t know who he is and where it lives)
17:13chouserfliebel: I agree! He's even been in the channel here talking about the code, but I've seen no indication he intends to pitch it to anyone.
17:13Cozeywith Clojures immutable structures, it could be possible to write a reverse (go back in time) debugger. perhaps
17:14chouserdnolen: shot down by our BDFL
17:14cemerickCozey: there are general-purpose time-traveling debuggers for the JVM. Don't remember the name(s) at the moment.
17:14dnolenchouser: darn. As in, he didn't like the approach?
17:14fliebelchouser: Who is he? Where is the implementation? The tension is killing me!
17:14kotarakCozey: someone kind of did. He called it stepl or so
17:14chouserdnolen: right
17:14chouserfliebel: sorry, I'm looking for a link.
17:15kotarakdnolen: The crypticity of clojure's stack traces is overrated.
17:15dnolenkotarak: I actually don't have a problem with 1.3s cleaned up traces.
17:16ataggartcemerick: jumping back in the stack might be sufficient if we could somehow disable the nullifying of values immediately prior to a call.
17:18chouserfliebel: ah, here it is: https://github.com/jarpiain/cljc
17:18fliebelchouser: Ah, I knew his name started with a j! thanks
17:18chouserwhen all else fails, grep the log. :-/
17:20cemerickchouser: if only we all had the log ;-)
17:20chouserwget -R
17:20chouseror ... something
17:20cemerickI figured that would be impolite.
17:21cemerickYou could be running that thing on a wizard palmtop or something.
17:21chouserNah, I screwed myself with gmapez, so unless *everyone* starts pulling the whole log all the time, I should be fine.
17:21brehautyou can always use the google site: prefix
17:26cemerickchouser: a friend of mine is behind http://www.plugandplaymaps.com, if you're interested in easy-ish google map trickery.
17:45hiredmanclojurebot: ping?
17:45clojurebotPONG!
17:46danlarkincemerick and hiredman should get on the phone to talk about nrepl :)
17:48hiredmandanlarkin: I've decided not to bother with nrepl anymore, instead looking at a rewrite of swank-clojure to be less odd
17:49hiredmanor differently odd I guess
17:49hiredmanI mean, replacing the authors oddness with mine
17:51danlarkinthat seems like a shame
17:54hiredmandanlarkin: the protocol is bad, I have not interest in writing clients for it unless it's fixed
18:04TimMcclojurebot plays a mean game of table tennis
18:18angermansomethings I really feel retarded.
18:18brehautangerman: as long as you know its also identical to (inc 1) ;)
18:19angermanO_O
18:19angerman:D
18:19danlarkinthe's the ever popular ((comp inc) 1)
18:19brehautim quite fond of ((comp first (juxt inc)) 1)
18:22lancepantzi think this is how obfuscated code contests begin :)
18:22brehautlancepantz: that sounds like a challenge :P
18:24danlarkinbam ((comp first ((partial juxt inc))) 1)
18:25brehaut((comp first ((partial juxt (resolve (symbol (apply str (map char '(105 110 99)))))))) 1)
18:25danlarkinooooh that's good
18:25danlarkinreal good
18:25brehauti think we can do better though
18:25danlarkinthis is hiredman's specialty
18:25brehautarrows!
18:26technomancyclojurebot: arrows!
18:26clojurebotarrows is http://ro-che.info/ccc/12.html
18:26technomancy,botsnack
18:26clojurebotjava.lang.Exception: Unable to resolve symbol: botsnack in this context
18:26technomancy...
18:26brehautdire
18:27brehautbaha that comic is awesome
18:27danlarkinone does not simply evaluate botsnack
18:36cemerickhiredman: Is your only objection the wire protocol?
18:38hiredmancemerick: that was as far as I got implementing it, if there wire protocol stops being a blocker, I may find other things
18:39hiredmanbut given that the wire protocol opens the door to evaling things, seems like anything else could be worked around
18:40hiredmaninfact I worked around the wireprotocol by sticking bytebuffers in a blocking queue and extending IOFactory to lbq's and having a thread that just read from there, but I really wasn't happy with it
18:40cemerickhiredman: so you're doing this from Java or Clojure already?
18:41hiredmanclojure
18:41hiredmanwhy would I did this from java?
18:41cemerickwhy not use the nREPL client that's already there?
18:43hiredmanbecause I was trying to write a single threaded polling translator between nrepl and slime, and currently reading from nrepl requires blocking, complicated parsing, or a seperate thread
18:43hiredmanwhich if you are trying to forward stuff back and forth between sockets in a single thread is bad
18:44cemerickhiredman: OK. Help me fully understand your objection -- so this is not just a matter of protocol design hygiene?
18:45hiredmanyou cannot know how many bytes you need to read from the wire in order to have read the entire message
18:47cemerickI got that, I'm just being dense about why that matters. The number of lines (2 * entries) is known, so why isn't that effectively the same thing?
18:47hiredmanno!
18:47hiredmanbyte count and number of lines are not the same thing
18:47cemericksurely not
18:47cemerick*functionally* the same thing
18:47hiredmanwith line count in order to determinte the number of bytes to read you have to scan through the byte stream as you reading looking for newlines
18:48cemericksure
18:48cemerickwhy is byte count important?
18:48hiredmanyou mean my exact use case?
18:49cemericksure
18:49hiredmanwith nio you don't use io streams
18:49hiredmanyou hand a byte buffer to a channel and say "fill this up with bytes"
18:49cemerickoh, NIO!
18:49cemerickSee, I missed that in your message from earlier.
18:50cemerickOK, now I see your objection.
18:50hiredmannewline seperation and line count are only useful if you only plan on implementing on top of line reader type things
18:51cemerickwhich is what I was aiming for. *shrug*
18:51cemerickI've never had any use for NIO.
18:51cemerickhiredman: so you're working on a SLIME/swank <-> nREPL bridge?
18:52hiredmanI was, just fun, not something to release, standard disclaimers, etc
18:52cemerickOK; in that case, do you believe implementing such a thing would require a nonblocking implementation in any case?
18:54hiredmancemerick: doesn't require, but I was enjoying writing one until I ran into this issue with nrepl
18:59cemerickThe fact that there are no CharChannels is unfortunate
19:00cemerickI *really* don't want to start dropping byte counts into a stream that's just UTF-8 all the time, period.
19:02hiredmancemerick: a fixed number of utf-8 characters has a fixed byte count
19:02cemerickhiredman: not above \u0255
19:02hiredman(format "%06x" 10)
19:03hiredman,(format "%06x" 10)
19:03clojurebot"00000a"
19:03hiredmannumerals are not above that
19:03hiredmanthe entire thing doesn't need to be fixed, you just need a fixed header that gives you the byte count of the rest
19:04cemerickI'm not saying that the numerals are going to be outside the UTF-8 range or byte ordering, I'm saying I don't like mixed-mode representations.
19:04hiredmanmixed mode in what way?
19:05cemerickit's a stream of chars that has a byte-counts in the middle of it
19:06cemerickit's not a functional objection, only a hygenic one.
19:06cemerickreminds me of PDF in an unfortunate way, actually
19:06hiredmannot functional?
19:07cemerickI mean, what you're suggesting will work just fine, I would just consider it warty.
19:07hiredmanin what sense?
19:08cemerickit's no longer a pure text protocol
19:09cemerickanyway, the bigger problem is this would make reader-oriented clients impossible
19:09hiredmannot true
19:09hiredmanoh, maybe true
19:10cemerickyou'd have to go along counting bytes of each char or string you read
19:10cemerickyack
19:10cemerickI'll have to think about things a bit more.
19:11cemerickhiredman: thank you for the discussion.
20:48developernotesI've created a new project with lein and added compojure and ring as dependencies to my project file. Following the example given for compojure (https://github.com/weavejester/compojure), I placed that content in a clj file within the project src, what is the best way to run it?
20:49brehautdevelopernotes: first place to start is 'lein repl' to load an interactive shell
20:49developernotesI've also already run lein deps
20:49developernotesbrehaut: Okay, I've done that now, but it doesn't seem to have started jetty.
20:49brehautnope
20:49brehautits just a 'bare' repl
20:50brehautyou need to load your namespace
20:50brehautassuming you have src/hello_world.clj with hello-world defined as the ns as per the example
20:50brehaut(use 'hello-world)
20:50developernotesbrehaut: I didn't scope it to a specific namespace, does that default to user ns?
20:51brehautcan you put your file onto a gist or a paste site?
20:51developernotesbrehaut: http://pastie.org/1697996
20:54developernotesbrehaut: so there is no way to treat it like a script, where it would just execute upon loading the repl. Is there a prefered way of doing something like this?
20:55brehautdevelopernotes: you could (load-file "path") i guess
20:55technomancylein run would do what you want given the proper -main function
20:55brehauti think pastie.org hates me
20:57brehautdevelopernotes: clojure isnt well suited to being used as a scripting language
20:58developernotestechnomancy: ah, cool - I'll check that out.
20:58brehautdevelopernotes: in this instance load-file should work. you'll need to namespace it for a -main anyway
20:59brehautalternatively if you just want to run code interactively, you could paste it into you repl (though i would add :join? false to the run-jetty options map)
21:06TimMcNothing JVM-based is conducive to scripting. :-(
21:07brehautTimMc: depends how long running your scripts are :P
21:22developernotesbrehaut: thanks
21:22developernotestechnomancy:
21:22developernotestechnomancy: thanks
21:23brehautno worries
22:06d5dq#(for [i (range 0 2)] (print i))
22:12phenom_arghh! what's the plan for leiningen's support for polyglot projects ?
22:12phenom_i want to write a peice of my code in scala :S
22:18brehautphenom_: if its not built in, that sounds like something that belongs in the realm of a plugin
22:28brehautphenom_: a quick dig through the code seems to imply that javac tasks are farmed out to ant via lancet under the hood. presumably if scalac has ant tasks, you could fairly trivially do the same with a scalac pluggin
22:30brehautphenom_: and ant does have scala tasks
22:30brehautphenom_: http://www.scala-lang.org/node/98
22:45Null-A"WARNING: to avoid creating extra keys in aws-ec2, use templateOption overrideLoginCredentialWith(id_rsa)" what are extra keys?
23:02devnlein-search needs to be included by default in lein
23:56LuminousMonkeyDoes anyone know if it's possible to have a native library working with lein unberjar? I'm using the RxTx library, and I have native deps working fine with a repl/swank. But I have no idea on how to package it up into a single JAR file.
23:56LuminousMonkeyWhoops, uberjar I mean.
23:57technomancydevn: working on it
23:58technomancydevn: the current version only works with clojars though, which is lame. I'm working on a lucene version that can work with standard mvn lucene indices.