#clojure logs

2014-06-08

00:35allenj12has anyone tried this little tutorial out? http://zaiste.net/2014/02/web_applications_in_clojure_all_the_way_with_compojure_and_om/ and got it to work?
00:42caternallenj12: are you having trouble with it? looks interesting, I might do it
00:43allenj12catern: yea the widgets arent showing is all
00:43allenj12catern: i thought it looked interesting too :)
00:43caterncomment about it?
00:47ddellacostaallenj12: what version of Om are you using?
00:47allenj12ddellacosta: [om "0.6.4"] i updated all the dependencies
00:47caternis clojure useful for anything but web development?
00:48arrdemI write compilers and data analysis code in clojure...
00:48caternok
00:48caternjust checking
00:48ddellacostaallenj12: yeah, that'll break it. There were some changes in how stuff gets passed into root and whatnot post 0.4.x I think, or maybe it was 0.5.x, I'm forgetting
00:48arrdemI've got microarchitecture simulators in clojure...
00:48arrdemthere are IRC bots in clojure
00:48arrdemI'm writing a dogeon parser in clojure..
00:48arrdemit's a general purpose lang ffs
00:48ddellacostaallenj12: also, I really don't recommend calling transact! in init-state like that is, it's strange
00:49caternyes I know
00:49caternI just needed a reminder because I want to write a FUSE filesystem for something and I think it would be a bad idea to do it in Clojure
00:49allenj12ddellacosta: o really? yea i know really nothing of it. i was just hoping to get something running than figure out piece by piece by playing with it
00:49catern(because JVM)
00:50allenj12ddellacosta: do you know of any similar/more modern tutorials?
00:50ddellacostaallenj12: yeah, I would just hesitate to start with that one--go straight for David Nolen's tutorials in the Om docs (if you haven't yet)
00:51ddellacostaallenj12: https://github.com/swannodette/om#tutorial
00:51caternddellacosta: do you recommend Om? has it any viable competitors?
00:51catern(for someone not tied to react)
00:51ddellacostacatern: I haven't tried the alternative React wrappers in Clojure, if that's what you're asking about
00:51allenj12ddellacosta: kk its not om in paticular i need i was just using it as a clj/cljs tutorial
00:52ddellacostaallenj12: oh, then definitely don't start with that one...haha. You could try mimmo cosenza's tutorials, I think they're decent, although not sure how up to date they are
00:52ddellacostaallenj12: https://github.com/magomimmo/modern-cljs
00:53allenj12ddellacosta: kk cool, yea i just havent found one that did a backend and front end that acually did something. thank for the direction
00:53ddellacostaallenj12: but this may be best to start with: http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/
00:53allenj12ddellacosta: hmm kk
00:53ddellacostaallenj12: which you could follow with this: http://swannodette.github.io/2013/11/07/clojurescript-101/
00:54ddellacostaallenj12: in general, I recommend poking around David Nolen's blog (what I just linked you to). And yeah, I agree that there is a gap in the "hooking up the backend to Om" tutorial space. Unfortunately I can't really recommend the one you were looking at, it looks like it has some not-so-standard ways of writing Om code
00:55ddellacostaallenj12: of course, just pop back here if you have questions. :-)
00:55allenj12awsome thanks
00:55allenj12:)
00:56ddellacostacatern: sorry I didn't really answer your question directly: I do recommend Om, if you want to build a very dynamic one-page app kind of front-end.
01:00caternokay, thanks
01:45rpaulolobste.rs has a lot of clojure links
02:19allenj12ddellacosta: that last one was a good little tutorial :) where the other links good? i lost them since my computer crashed
02:20ddellacostaallenj12: which one did you just look at? I can give you the other links again
02:21ddellacostaallenj12: first I suggested looking at this one: http://swannodette.github.io/2013/10/27/the-essence-of-clojurescript/ Then, http://swannodette.github.io/2013/11/07/clojurescript-101/
02:21allenj12ddellacosta: looked at this one http://swannodette.github.io/2013/11/07/clojurescript-101/
02:21allenj12ahh kk
02:21ddellacostaallenj12: and for a more in depth guide: https://github.com/magomimmo/modern-cljs
02:21allenj12that was it
02:22ddellacostaallenj12: oh, ok. Yeah, also just poke around dnolen's blog, there is a lot of very good, authoritative info there: http://swannodette.github.io/
02:22ddellacostaallenj12: and if you are interested in Om, do check out the tutorials on the github page: https://github.com/swannodette/om#tutorial
02:22ddellacostaallenj12: but you may want to get comfortable with the other stuff first...or not. :-)
02:23Frozenlockallenj12: Also make sure to check Reagent, Om closest competition :-p
02:23ddellacostaFrozenlock: give him a tutorial link if you have one
02:23allenj12ddellacosta: yea like i said i dont acually care to much about om :) i will have to incorporate mysql tho (or some sql...)
02:24allenj12i guess i could use it later tho.. hmmm
02:24allenj12lol
02:24Frozenlockddellacosta: Cmon, I'm sure he can google.... http://holmsand.github.io/reagent/
02:24allenj12Frozenlock: nope please link :p
02:25john2xif I do `cider-jack-in`, and do something else while it's `Starting nREPL server...`, does it cancel starting the server?
02:25allenj12john2x: pretty sure not
02:26allenj12john2x: havent used emacs in a while tho
02:26Frozenlockjohn2x: Not in my experience
02:26john2xFrozenlock: how do I cancel the server startup
02:26john2xI think it's downloading a lot of dependencies, and with no feedback, it's hard to know what's happening
02:27Frozenlockjohn2x: I don't know... let it do its stuff and close it after :-p
02:27john2xor is there a buffer for cider-messages or some sort?
02:27ddellacostaallenj12: if you want to do back-end Clojure stuff, I would take a look at clojure.java.jdbc first: https://github.com/clojure/java.jdbc
02:27ddellacostaallenj12: er, rather, if you want to connect to a DB
02:28allenj12ddellacosta: that i acually already did :) hehe but not much further i basically just created a db a table and added some rows lol :)
02:29ddellacostaallenj12: ah, okay. Well, that's a start. :-)
02:30allenj12ddellacosta: when im done with this, i kinda wanna make a tutorial that goes over both front-end back-end together. start to finish on a little real world "seeable" website
02:32ddellacostaallenj12: do it! But throw it at folks in IRC/mailing list too so you can get some constructive criticism--for example, that first link you gave me had some weird stuff in it, and that can be really confusing to beginners. I want to help people avoid a similar fate.
02:33ddellacostaallenj12: but that's premature. First thing to do is just give it a shot. :-)
02:34allenj12ddellacosta: indeed ill definatly do it, might be a while in the future. gotta finish this project and then my masters project. maybe end of next semester
02:34ddellacostaallenj12: hey, no pressure from me...haha
02:36allenj12ddellacosta: :) ill probably do it just to spread more functional programming at my school. very few of us here who are willing to try it. i did convert some people tho talking about machine learning and how clojure makes things very simple
02:36ddellacostaallenj12: awesome.
02:37allenj12:)
02:39allenj12ooo reagent looks pretty nice
02:39MagBo[MURT]Hello people, a ranty question: can you please name one "atomic" things about clojure atoms? Anyone has a link about rationale behind picking such a term?
02:40MagBo[MURT]Why not "synchronous agents" or something less counter-intuitive?
02:41allenj12MagBo[MURT]: well not sure but heres my guess: atoms are a type that can be multiple things very much like a common lisp atom
02:41amalloychanges made to atoms are atomic
02:41MagBo[MURT]amalloy: touche
02:41amalloyallenj12: no, that's quite wrong. lisp's atoms were named so because they're the indivisible particles at the bottom of a lisp data structure
02:42MagBo[MURT]^
02:42tolstoySo was rhickey punning a bit because of that?
02:42allenj12amalloy: kk yea tbh i dont know why i ever thought that was right lol
02:44allenj12Frozenlock: is there any good reason to use reagent vs om? it seems cool but i have no knowledge comparing the two
02:45Frozenlockallenj12: I find it more clojure-y
02:46allenj12Frozenlock: hmmmm good enough for me lol
02:46Frozenlock:-p
02:50john2xhow do I add a jar file as a dependency in project.clj?
02:55ddellacostaallenj12, Frozenlock: saying something is "more clojure-y" is quite subjective--not really a strong reason to choose one library over the other.
02:56allenj12ddellacosta: lol yea :p im just looking at both of them
02:57Frozenlockddellacosta: Both are just wrappers to react....
02:57ddellacostaFrozenlock: it's not that simple, which David Nolen explains in detail in his posts about Om
02:58ddellacostaFrozenlock, allenj12: For one, Om takes advantage of ClojureScript's immutable data structures to make React's life cycle rendering more efficiently, but checking on referential equality by default in ShouldComponentUpdate
02:58ddellacosta*more efficient
02:59allenj12has anyone here used both?
02:59ddellacostaFrozenlock, allenj12: Om also takes advantage of protocols to allow for flexibly extending the base React lifecycle methods in a very "clojure-y" way.
03:00Frozenlockddellacosta: http://holmsand.github.io/reagent/news/reagent-is-async.html
03:01ddellacostaFrozenlock: your point? Om uses requestAnimationFrame...which is mentioned in that article, and seems to be in fact where he got the idea.
03:01FrozenlockYes, showing there's less difference than you implied
03:02FrozenlockBoth are using immutable data structure, because... well... clojurescript :-)
03:02ddellacostaFrozenlock: just because they are both CLJS doesn't mean they are both doing the same thing with them. Does reagent also do referential equality checks in ShouldComponentUpdate? I didn't know that if so.
03:03FrozenlockI honestly don't know.
03:06allenj12somone had to have compared the two sometime no?
03:06ddellacostaallenj12: well, in the end, I suggest you try them both, learn about their different strengths, and see which you prefer. My basic takeaway is that Om gives you more flexibility and extensibility at the cost of a higher learning curve than Reagent
03:08FrozenlockI'd honestly like to see an Om app that can't be done in Reagent. Perhaps one of the custom lifecyle methods?
03:08ddellacostaFrozenlock: it looks like reagent does have a similar strategy for updating: https://github.com/holmsand/reagent/blob/master/src/reagent/impl/template.cljs#L142-L146 Not sure how wrap-component is used though
03:09ddellacostaFrozenlock: I don't know, I can't speak to that. I can only say that I've found Om's protocols to be a very good way to extend React lifecycle methods, and I use them extensively.
03:10Frozenlocko_O
03:10FrozenlockBy lifecycle, you mean the component-did-update, component-will-update and all?
03:10ddellacostaFrozenlock: yes
03:11FrozenlockIntriguing... when were React methods not enough?
03:12ddellacostaFrozenlock: ...when was JS not enough? Not sure I understand what you're getting at
03:13Frozenlockwell, you already have component-will-mount, did-mount, will-receive-props, will-update, did-update, will-unmount... what's a possible 'other' lifecycle?
03:14ddellacostaFrozenlock: it's the same lifecycle. My point was that protocol semantics are a very nice way to provide implementations of those lifecycle functions when it is necessary to do so, nothing more.
03:15FrozenlockOh
03:15ddellacostaFrozenlock: yes, I see what the confusion was--I probably should have said "implementing" vs. "extending"
03:16arrdemping
03:16ddellacostaarrdem: pong
03:16arrdemjust testing a server side logging configuration.
03:16arrdemnothing to see here.
03:16ddellacostaah.
05:16john2xI"m getting "Error: (error "Can't find nREPL middleware providing op stacktrace. Please, install cider-nrepl and restart CIDER")" messages in my *Messages* buffer.. but there's no cider-nrepl package in marmalade?
05:21danielcomptonjohn2x I prefer melpa to marmalade, the packages seem to be more up to date there
05:24john2xohh it's refering to a lein plugin
05:24john2xforgot to backup my profiles.clj :(
05:39danielcomptonjohn2x Ah yes, there's a new cider-nrepl plugin
05:40danielcomptonjohn2x forgot about that, even though I just upgraded a week ago
05:47hariravulahello all
06:09mi6x3mhey clojure, is there a way to force the execution of a future without deref?
06:09mi6x3msomething like a hint to being immediately
06:19ddellacostami6x3m: I don't believe so, you explicitly cede control over execution when you use a future.
06:19ddellacostami6x3m: and deref isn't forcing execution as far as I know; it's just blocking until execution is complete
06:44john2xis there something similar to Python's `dir` function? to list public methods/properties of a Java object?
06:46pyrtsaNot directly but you can play with clojure.reflect to create your own. (No idea if the following works here:)
06:46pyrtsa,(->> Object clojure.reflect/reflect :members (filter (comp :public :flags)) (map :name))
06:46clojurebot#<CompilerException java.lang.ClassNotFoundException: clojure.reflect, compiling:(NO_SOURCE_PATH:0:0)>
06:47pyrtsajohn2x: Just replied to you while you were away. X-)
06:47pyrtsaNot directly but you can play with clojure.reflect to create your own.
06:47pyrtsa,(do (require 'clojure.reflect) (->> Object clojure.reflect/reflect :members (filter (comp :public :flags)) (map :name)))
06:47clojurebot(getClass wait java.lang.Object equals notifyAll ...)
07:01pwikiIs there a way to make instaparse more greedy to prevent it from making unnecessary output nodes, other than using regular expressions?
08:45expezWhy does (source app.foo.bar/baz) return nil? I have src/clj/app/foo/bar.clj with (ns app.foo.bar) and the fn baz in it and :source-paths in project.clj contains "src/clj".
08:45Jardahey all!
08:46Jardaanyone know something about lobos?
08:49JardaI can't even require lobos.connectivity
08:49Jardauser=> (use '(lobos connectivity core schema))
08:49JardaCompilerException java.lang.RuntimeException: Unable to resolve symbol: *db* in this context, compiling:(lobos/connectivity/jdbc_2.clj:14:1)
09:13no7hinghttps://www.refheap.com/86377 on line 6, is that expected behaviour in clojurescript?
09:14no7hingthe compiler complains on non-existing namespaces, but not non-existing vars
09:36john2xwhat does java.lang.IllegalArgumentException mean in this context https://www.refheap.com/86378?
09:39expezjohn2x: it's not expecting a String
09:40expezAs far as I can google it's expecting a List<String>
09:41john2xexpez: I tried (.setArguments chrome-options ["foo"]) as well
09:41Glenjaminexpez: source prints to console
09:41Glenjamin,(doc source)
09:41clojurebot"([n]); Prints the source code for the given symbol, if it can find it. This requires that the symbol resolve to a Var defined in a namespace for which the .clj is in the classpath. Example: (source filter)"
09:41john2xdoes it need to be a Java List?
09:42Glenjaminjohn2x: that error says that it can't find method on the ChromeOptions class
09:43john2xGlenjamin: oh ok. but it shows up in reflect?
09:43Glenjaminas expez said, it looks like it should take a List<String>
09:43Glenjaminhttp://javadox.com/org.seleniumhq.selenium/selenium-chrome-driver/2.40.0/org/openqa/selenium/chrome/ChromeOptions.html#addArguments%28java.util.List%29
09:44Glenjaminso (.addArguments chrome-options ["foo"]) should work
09:44Glenjamin,(implements? java.util.List clojure.lang.Vector)
09:44clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: implements? in this context, compiling:(NO_SOURCE_PATH:0:0)>
09:44Glenjaminerm
09:44Glenjamin(instance? java.util.List [])
09:44Glenjamin,(instance? java.util.List [])
09:44clojurebottrue
09:44Glenjaminyeah, vector should be fine
09:52john2xoh this is unfortunate.. so it throws the same IllegalArgumentException for both a non-existent instance member and bad arguments to an existing instance member..
09:57Glenjaminyeah, because of method overloading, methods with different typehints are different methods
09:57Bronsajohn2x: eh, error reporting on interop forms is not really consistent
09:58Bronsa,(Integer/parseInt :foo :bar)
09:58clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.String>
09:58Bronsa,(Integer/parseInt :foo :bar :baz)
09:58clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: parseInt, compiling:(NO_SOURCE_PATH:0:0)>
09:58john2xwat
09:58Bronsa,(.foo "bar")
09:58clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: foo for class java.lang.String>
09:58Bronsa,(.foo "bar" 1)
09:58clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: foo for class java.lang.String>
09:59Bronsa,(.toString "bar" 1)
09:59clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: toString for class java.lang.String>
09:59Bronsamh
09:59Bronsawell, whatever
10:23pandeiroanyone know what i can do to get rid of the message 'Java HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.' ?
10:30AWizzArdpandeiro: where do you see this message?
10:31pandeiroAWizzArd: running lein with Oracle JDK 1.8.0_05
10:31AWizzArdpandeiro: have you specified any options? Such as :jvm-opts ["-XX:+TieredCompilation"]
10:33pandeiroAWizzArd: no, let me try that - can it be done on a lein-wide basis in :jvm-opts in profiles.clj?
10:34AWizzArdpandeiro: should be possible, though I wouldn’t suggest that, for reasons of repeatability of your build.
10:35pandeiroAWizzArd: not fixed - from the error i am thinking i need to disable lein's use of tiered compilation, no?
10:36pandeiroi'm less concerned about build repeatability since i am mostly working with cljs - i just want this error to disappear from every lein invocation i do
10:36AWizzArdpandeiro: well, with the above option you want to activate tiered compilation.
10:37AWizzArdpandeiro: you could try to make the ‘+’ in front of ‘Tiered’ into a minus ‘-’.
10:38AWizzArdpandeiro: but I think your message is coming from the lein.bat or lein.sh script.
10:38AWizzArdSee: https://github.com/technomancy/leiningen/blob/master/bin/lein#L136
10:38pandeiroAWizzArd: yep, that doesn't work either... i also tried :jvm-opts ^:replace [] in profiles
10:38pandeiroi'll check that out, thanks
10:38AWizzArdLeiningen’s starter shell script itself issues this option.
10:39pandeirok so i go in and patch $HOME/bin/lein itself maybe
10:40AWizzArdpandeiro: I guess this should do the trick. You probably just have to comment out that part, or make that + into a -.
10:40pandeiroalso find it weird that googling for TieredCompilation being deprecated in Java 8 doesn't pull up anything...
10:40pandeiroi wonder if this is just something about this build i am using
10:43AWizzArdpandeiro: I am using Java 8 and can’t remember having seen this message.
10:43pandeiroAWizzArd: Oracle?
10:43AWizzArdBut most likely I am not using the newest Leiningen, and perhaps it is different in the lein.bat file, dunno.
10:44pandeiroalright, i guess i will live with this for now
10:44pandeiroAWizzArd: thanks for the help
10:54technomancypandeiro: you can set LEIN_JVM_OPTS iirc
10:55technomancypandeiro: also: I had no idea there was a client jvm for java 8. is this a 32-bit machine?
10:55pandeirotechnomancy: yes, 32-bit
10:57pandeirocan i set LEIN_JVM_OPTS somewhere within lein's config (eg profiles.clj)?
11:04technomancypandeiro: yeah, export it in ~/.lein/leinrc
11:04technomancypandeiro:
11:04technomancypandeiro: what happens if you edit bin/lein to remove -client near the bottom?
11:05pandeirotechnomancy: i haven't tried that; let me see
11:05technomancythat's basically a leftover attempt to get faster launch that only works on 32-bit; should probably get rid of it anyway
11:06pandeirotechnomancy: yes removing that flag removes the error
11:06technomancycool; will get rid of it
11:07technomancypandeiro: does it affect boot time at all?
11:07pandeirotechnomancy: from what i can tell with a few `lein new` commands, no
11:08technomancyhow about `time lein version`?
11:09pandeirotechnomancy: avg 0.1s different over five runs
11:09technomancyvery nice; thank you
11:10pandeirotechnomancy: thanks for the assistance
11:10technomancynp
11:10technomancyit'll be in 2.4.0, hopefully going out in the next two days
11:11technomancyis this a 32-bit arm or 32-bit intel, out of curiosity
11:11pandeirotechnomancy: intel
11:11pandeiro2011-era laptop
11:12AWizzArdEverybody knows this, but it still is worth a re-read: http://therobot.tumblr.com/post/26900072/emacs-outshines-all-other-editing-software-in
11:13pandeiroAWizzArd: yep, unfortunately true
11:13technomancypandeiro: cool; fun when you can make use of old machines
11:13pandeiroi say unfortunately b/c i have adolescent students who based on aesthetics alone will not touch emacs b/c it looks like crap next to modern IDE's
11:14TimMctechnomancy: "old"
11:14pandeirotechnomancy: i wish i were having less "fun" in this case but this is what i got!
11:14technomancyactually wayt
11:14technomancywait
11:14technomancythat's like three years newer than the laptop I'm using right now
11:15pandeirotechnomancy: i hope you aren't having to compile cljs :)
11:15technomancylucky me =)
11:18Glenjaminpeople actually avoid emacs because of looks?
11:18technomancybut I feel like the two laptops I had before this one were also 64-bit
11:18Glenjaminmy only reason to avoid it is the keybindings are foreign, and i can't bring myself to invest the time to learn them
11:18technomancyGlenjamin: people come up with all kinds of excuses not to learn new things
11:19technomancyit's a defense mechanism
11:19caternIDEs look like crap compared to emacs to me
11:19caterndo they even have themes? :D
11:19Glenjaminevery time i accidentally open emacs, i discover i've forgotten the keybinding for kill-emacs
11:20Glenjamini know there's a g in it
11:20GlenjaminC-c g?
11:22ToxicFrogGlenjamin: ctrl-alt-F1 pkill emacs >.>
11:24Glenjaminbah, there isn't even a g in it
11:24Glenjaminone day, i will learn this
11:24Glenjaminunless lighttable continues to improve, maybe it'll do
11:27technomancyone thing at a time
11:29TimMcGlenjamin: C-g is "shit shit shit get me out of this"
11:29TimMcmaybe that's what you're thinking of
11:29Glenjaminyeah, i think so
11:31caternGlenjamin: it's C-x C-c
11:31BronsaTimMc: ahah, I feel like that could be an accurate docstring for C-g
11:38mdeboardwell if anyone ever wanted the edges & vertices of the Ticket to Ride board game (original) as Clojure data, here you go https://gist.github.com/mattdeboard/08fbe157b029355dbc94
11:39mdeboardI just spent a half-hour of my life on this
11:46technomancyit sounds like the github releases feature requires you to omit the `git push --tags` step, as it creates a tag for you?
11:47Glenjaminon the releases pages it says " Choose an existing tag, or create a new tag on publish "
11:48arrdemmornin'
11:48Glenjamini think if you push tags, they appear on the releases page, then if you create a matching release is fleshes out the detail
11:48technomancyGlenjamin: oh, the dummy repo I'm testing with doesn't have any
11:48technomancythat would explain it
11:49technomancytrying to get off my own S3 bucket for lein downloads as the monthly bill keeps creeping up
11:49Glenjaminyeah, it offers tag autocomplete, then gives you a green "Existing tag" indicator
11:52mdeboardThis is frustrating. Is CIDER with cider-nrepl 0.7.0 misbehaving for anyone else?
11:52mdeboardmisses*
11:53arrdemmdeboard: define misbehaving
11:53mdeboardcider-jack-in results in a Class Not Found Error
11:53arrdem.... did you just upgrade to 0.7.0-SNAPSHOT?
11:54mdeboardUnhandled java.lang.ClassNotFoundException cider.nrepl
11:54mdeboardYes
11:54mdeboardBecause I was getting the same thing with 0.6.1
11:54arrdembecause if so this is expected. Cider 0.7.0 requires that you add a lein plugin to your default profile.
11:54mdeboardsheesh.
11:54mdeboardok
11:55arrdemlemme grab it for ya..
11:55arrdem{:user {:plugins [cider/cider-nrepl "0.7.0-SNAPSHOT"]}} should do for ya
11:55mdeboardOk, thanks
11:56mdeboardOh, I actually had it in my profiles.clj already (:dev instead of :user) but I hadn't upgraded there.
11:56mdeboardI was just adding clojure-nrepl to project.clj
12:18pepijndevosI suppose a record would serialize to json just as well as any map?
12:28mi6x3mhey clojure, how would you name a function argument which is a function which gets proxy'd into some kind of a handler?
12:28mi6x3m(defn default-...-handler [f] ....)
12:28mdeboardf
12:29mi6x3myeah, would call it 'f' as well
12:43Glenjamindoes anyone else get the same result as this: "lein repl :headless; ctrl+z; bg" -> says "Stopped"
12:49Glenjaminas in, i cant get lein repl :headless to run in the background via job control
12:50arrdemunless you know what your doing lein is not usually recommended for running deployment code...
13:07engblomI have decided to to try to give emacs a chance (with evil added). Could anyone point me to any up to date guide for how to configure emacs24 for editing clojure? All tutorials seem to be many years old and the git repositories often mentioned have not been seeing any changes in 4 years.
13:08dnolen_ClojureScript users, 1.6.0 branch is ready to be tested, feedback welcome https://github.com/clojure/clojurescript/tree/1.6.0
13:08engblomWhat should I use at this moment? Is slime still the tool?
13:09engblomEmacs24 apparently have a package manager. Is there anything useful directly from it?
13:09Shayanjmengblom: what do you use right now?
13:09Shayanjm(just a random q)
13:09engblomShayanjm: Just vim with rainbow parentheses added.
13:09Shayanjmgotcha
13:10arrdemengblom: fireplace.vim is supposed to be good
13:10gtrakI take back anything bad I said about Swift, knowing Lattner was the lead means it's gotta be hella fast :-).
13:10arrdemengblom: https://github.com/tpope/vim-fireplace
13:11engblomarrdem: Thanks
13:11arrdemengblom: baring that, yeah the instructions for getting running with emacs/cider/clojure are pretty bad I'll try and do a writeup later today
13:12arrdemor gtrak could cause you know he's actually a cider maintainer :P
13:12gtrakhehe, I've been wayyyy too busy.
13:12gtrakI hope in the next week or two to push on solidifying stuff for a release.
13:12arrdemdude I wrote a DSON parser. http://github.com/arrdem/dogeon #summervacation
13:13arrdemengblom: if you'd like it I can quickly share the relevant parts of my .emacs config, but sharing the whole thing is nontrivial.
13:14engblomSo (> cider slime)
13:14systemfaultarrdem: Awesome O_O
13:14engblomI will have to look up cider
13:14gtrakarrdem: that's speshal
13:15arrdemengblom: yeah. slime was succeeded by nrepl.el which got renamed to cider.
13:16gtrakengblom: we're targeting a 'stable' release in the next couple of weeks, it's had a ton of churn lately.
13:16gtrakfeatures: clojurescript support, java source navigation, stacktraces, to name a few.
13:17gtrakthe 'inspector'
13:17gtrakmuch more featureful completion.
13:18engblomIs this a good way for setting up cider? http://clojure-doc.org/articles/tutorials/emacs.html
13:19engblomIt will install it from marmalade
13:19arrdemyeah that's what you want to do.
13:19arrdemget cider and clojure-mode from marmalade and you should be good to go.
13:20arrdemsmartparens and ac-cider are both nice but optional.
13:21arrdemfor anyone interested https://github.com/arrdem/dot-emacs
13:23mdeboardAnyone used the "Neocons" lib for neo4j? I'm tryig to sort out how to just send a raw cypher query to the backend, but idk if the trouble i'm having is because of neocons ceremony or if I'm misunderstanding the neo4j cypher tutorial
13:26mdeboardLike is "START" a special thing for Neocons? I have not run across it in the docs yet
13:26mdeboardin the neo4j
13:36mdeboardarrdem: I think ac-cider was breaking up to 0.7.0, something with el-docs
13:37mdeboard(I haven't tried it since upping to 0.7.0)
13:37arrdemmdeboard: maybe, no idea.
13:37arrdemI think my ac-cider is still working but I haven't checked.
13:37arrdemnot a feature I leverage heavily.
13:39mdeboardIt was pretty nasty, made emacs freeze completely
13:39mdeboardbut it seems to be working now, that's good
13:46engblomWith cider, how do I get the form I have the cursor inside of to end up at repl?
13:47arrdemM-x cider-eval-last-sexp-to-repl?
13:47arrdemthere's probably a shortcut for that but I don't know it.
13:47engblom(foo (bar xy (baz z))) <--- to evaluate (bar...)
13:48engblomAnd not foo...
13:48arrdemdude I just answered that.
13:49engblomThanks
13:54mdeboardlol
14:03mdeboard(nn/
14:06engblomIt looks like clojure+emacs+evil is a bad combination. cw (change word) when you have [.... foo] and intending to replace foo, will take away ] also
14:07engblomSomehow it is not understanding [] are not words.
14:08caternthat works for me
14:08caternhave you changed the handling of words?
14:09caternwhen I do cw on with my cursor on foo, it eliminates just foo and not ]
14:10engblomNo. I was doing the koans I found somewhere and there you need to replace __ with what you think is right. If you have [foo __] it will replace the whole "__]" section.
14:10Jaoodthe marmalade website used to have a search feature :/
14:15caternengblom: ah, it's special handling for _
14:15catern_ is counted as not-a-word
14:17caternengblom: if you want to not count _ as pseudo-whitespace/not-a-word, find the setting for it in evil
14:18caternthis is a difference between vim and evil, _ is not counted as part of a word in evil (because it's using emacs's native word detection) and it is in vim, but you can change it to whatever you like
14:22allenj12hey for lighttable live programming with chrome after i add the script tag a just type Command-ENTER after the expression?
14:23engblomcatern: Thanks!
14:23allenj12it dosnt seem to be working
14:30RedOnionis there any way to read protocol-buffer file in Clojure?
14:31RedOnionlike the *pbf files
14:44arrdemcbp: ^ clojure protobufs go
14:50cbpRedOnion: you have to compile those
14:50cbpyou can use lein protobuf
14:50RedOnionI did compile them with 'lein protobuf'
14:50RedOnionbut I need to read from a .pbf file now
14:52cbpRedOnion: the .pbf file is just a spec that you compile into .java files
14:52cbpand possibly .class files afterwards
14:53RedOnionWell I've the .proto files with the description and they compiled to java files.
14:53cbplein protobuf should compile them to .class files and place them in /target
14:53RedOnionNow i've a sample.pbf file which is binary, and I need to read it and import it's data
14:56RedOnionMaybe I'm asking the wrong question. I need to read a binary file as Java InputStream
14:58gtrakRedOnion: clojure.java.io/input-stream
14:58RedOnionOk, let me check that
15:13iamjarvohi all, so i am trying to understand -> vs ->> and a failure i am getting http://pastie.org/private/psgvzpgwuarzyayfionww can anyone provide some clarity please
15:13iamjarvototal lisp / clojure noob
15:14gtrakcollection functions take colls in their last argument, so you probably want to use (->> for those)
15:14cbpiamjarvo: you are doing (drop x 3) when it should be (drop 3 x)
15:14iamjarvoahh so -> puts it in the vs positionw hereas ->> puts it in the last?
15:15iamjarvocbp: ^
15:15gtrak-> is pronounced thread-first.
15:15arrdemiamjarvo: correct.
15:15gtrak->> is thread-last.
15:15iamjarvothanks guys
15:15iamjarvoi read something like that but didnt fully grock it
15:21fifosineWhat do people recommend for a JSON library?
15:22gtrakfifosine: cheshire
15:22fifosinegtrak: Ok, thanks
16:43gfredericksare there cheshire v data.json perf tests results somewhere?
16:45MatthiasLis there a way to let core/async channels communicate over the network?
16:46seancorfieldgfredericks: dakrone's repo claims cheshire is 2x faster than data.json
16:48seancorfieldGoogling doesn't turn up any specific benchmarks that I find, however...
16:49gfredericksI should submit a ticket to data.json that just replaces it with cheshire
17:00gtrakMatthiasL: lots of ways
17:02MatthiasLgtrak: good to know ;)
17:02gtrakpick a transport, someone's probably done it :-)
17:05MatthiasLi'm pretty new to clojure and i'm trying to make a multiplayer game. so far all "clients" are running in the same jvm. now i need to figure out how to do the network communication. kinda clueless about that too. any recommendations on what to look at?
17:05justin_smithMatthiasL: consider making a "command" out of a clojure map, and converting that to json for communication with clients
17:05justin_smithhttp is probably the most generic choice
17:07technomancyMatthiasL: different games might need different communication styles, but if you can get away with modeling it as request/response, then json over http would be the easiest
17:07Glenjamindoes anyone know if there's a way in compojure to perform functions on matched parameters before the route function runs?
17:08Glenjaminlike casting to interger, turning :user into a User record etc
17:09MatthiasLjson seems like an odd choice for two clojure applications to talk to each other. :p why no edn?
17:09justin_smithGlenjamin: sounds like you would want to wrap "handler" in your function aop style before passing that to ring
17:11justin_smith(fn [handler] (fn [request] (update-in request ...))) - something along those lines
17:11justin_smithwhere you call handler inside ... of course
17:12Glenjaminmm, essentially middleware
17:12justin_smithright, but wrapping outside compojure's handler
17:13Glenjaminannoyingly, (context) does something similar, but only wraps with a route match, no extra behaviour
17:15justin_smithGlenjamin: it's been ages since I used compojure, but in caribou the default setup has a handler expression to describe stuff that should happen both before and after routing to the controller
17:16justin_smith(this is with caribou's polaris routing lib though, but compojure should not be much different)
17:16dbaschGlenjamin: it is normal to write custom middlewares to do stuff with requests in compojure (e.g. authentication)
17:17Glenjaminyeah, i think i need to just structure everything as middleware
17:18Glenjaminhttp://weavejester.github.io/compojure/compojure.core.html#var-context
17:18justin_smithwhat about (context "/" ...)
17:18Glenjamincontext looks like what i want, but i'd want to do something with the matched :id before the handlers
17:19Glenjaminunder the hood, context is implemented with a wrap-context middleware, but it's marked as private :(
17:25zandhey folks - anyone used "lein new heroku <app-name>" with success?
17:25zandI'm getting an error when trying to do 'lein repl' in that project:
17:25zandhttps://www.refheap.com/86382
17:27justin_smithzand: did you actually cd to the shredstir dir?
17:27zandyup - lein downloads the reqs but then hung on JsonFactory
17:28zandI added cheshire explicitly to the the deps and now it's hanging on the "SchemeLayeredSocketFactory"
17:28justin_smithwait, I see nothing about JsonFactory in your paste
17:28justin_smithoh, ok
17:29justin_smithtechnomancy may be able to help, he works for heroku iirc
17:29zandI'm just following the tutorial at :
17:29zandhttps://devcenter.heroku.com/articles/getting-started-with-clojure
17:29zandthx for the input justin
17:30technomancyzand: can you run `lein deps :tree`
17:31zandtechnomancy: https://www.refheap.com/86383
17:32zandAnd here's my ~/.lein/profiles.clj:
17:32zandhttps://www.refheap.com/86384
17:33technomancyoh, that's a lot of user dependencies
17:33zandI'll try with a clean profiles.clj
17:33technomancyI would try getting rid of leiningen and cd-client, if that doesn't fix it, try bisecting the list
17:34technomancyyeah, it works fine here with my user profile
17:34technomancyI will probably get rid of drawbridge from the heroku template though; it's just not worth the hassle
17:34zandok - I just mv'd my profiles.clj out of the way
17:35zanddid a lein clean && lein deps
17:35zandand it starts the repl fine
17:35zandso it must be something in my profiles.clj that's the problem
17:36zandseems so obvious now that I look at how much stuff I had in there :-)
17:36technomancyyeah, that's the danger with stuff like that
17:36technomancyI try to keep from adding anything with a nontrivial dependency tree to :user
17:36zandtechnomancy: BTW - thanks for all your great work on Leiningen!! :-)
17:37technomancyglad you like it =)
17:37zand'lein' is my answer for "what's the killer app for Clojure?" :-)
17:38zandthanks gents - BFN
17:41Hodappnbeloglazov: https://github.com/overtone/overtone/issues/293 - the issue I mentioned looks like it may be related to Quil, but not strictly a Quil issue, so I filed it there.
17:41allenj12any benefit of datomic over sql?
17:43benkayis there a SLIME "who-calls" equivalent in Cider?
17:43technomancybenkay: I keep trying to rope people into implementing that
17:43technomancyhasn't worked so far afaik
17:44benkaywouldn't even know where to start...
17:44Hodappwhat does who-calls do?
17:44technomancybenkay: tools.analyzer
17:45benkayHodapp: tells you who calls a function :)
17:46allenj12https://github.com/swannodette/om/wiki/Advanced-Tutorial best om tutorial?
17:46Hodappbenkay: a dynamic thing, or from static analysis of sorts?
17:48benkayHodapp: you'd have to ask someone who actually knows how SLIME and Lisps work.
17:48technomancyshould be static
17:49technomancyswank-clojure basically just does a grep =(
17:49benkayallenj12: try it and let us know
17:49benkaygrep is fast!
17:49allenj12benkay: its a empty page pretty much lol
17:49benkayrelated: a friend was doing a stripe ctf, one of the challenges was to index a directory of files, wrote this tidy, somewhat performant node thing, was blown out of the water by his buddy shelling out to grep.
17:50Hodapphah
17:50technomancyif we had a self-hosting compiler it would be a lot easier to mark every var reference in metadata at compile time
17:51bbloomtechnomancy: why do you need the whole compiler? isn't tools analyzer enough?
17:52technomancybbloom: well, I'd rather have a single tool to learn than two =)
17:52bbloomtechnomancy: you'd be interfacing with the analyzer part of any self hosting compiler anyway, since you don't care about the code generator
17:52technomancybut given that tools.analyzer is basically a prerequisite to self-hosting, yeah it doesn't make a difference
17:52andyftools.analyzer is becoming part of a self-hosting compiler, or at least I thought that is the plan. Not there yet
17:52bbloomtools.analyzer + tools.emitter essentially == self-hosting compiler
17:53technomancyit was more "I wish this stuff was already done"
17:53andyfunderstood :)
17:53bbloomtechnomancy: my understanding is that the jvm analyzer is pretty solid already
17:53bbloomtechnomancy: of course Bronsa can comment more intelligently about that
17:54andyfEastwood has a test suite that beats on it fairly heavily, which is where a lot of bugs were discovered back in Dec/Jan time frame. It is pretty stable these days for most code bases.
17:54technomancyit's not done till you can trivially implement who-calls, and no one has implemented who-calls yet, so it must not be done. =)
17:54andyfStill some bugs, I believe, but they are getting harder to find.
17:54technomancy</troll-mode>
17:55bbloomtechnomancy: so go implement it, it should be a pretty trivial tree walk and just swap! in to an atom in a dynamic var & return that value when you're done
17:55Bronsauhm well it's now used by eastwood, core.typed and core.async which are fairly big and projects and I haven't received any major bug report for the last months so yeah, I'd say it's pretty stable at this point
17:55technomancybbloom: I was trying to get benkay to do it for me
17:56andyfbbloom: Um, no offense intended here, but suggesting technomancy is a do-nothing complainer who doesn't implement stuff is something that could leave others with their jaws hanging on the floor.
17:56Bronsa(inc andyf) ;; for the crucible
17:56lazybot⇒ 3
17:57allenj12hey so i went through the om tutorial. i was wondering tho if there is a good open source example of a website both backend and frontend that i can play with?
17:57allenj12thats somwhat polished
17:57bbloomandyf: i'm certainly not accusing him of complaining
17:57benkay<technomancy> bbloom: I was trying to get benkay to do it for me // you don't want me hacking on clojure toolchain. trust me.
17:57justin_smithallenj12: maybe refheap or 4clojure?
17:58bbloomandyf: it seemed like he didn't realize how close to a reality an analyzer-backed who-calls is
17:58justin_smithallenj12: https://github.com/Raynes/refheap
17:58bbloomandyf: knowing that technomancy is in fact a doer of things, i thought he might just do it, given this new knowledge :-)
17:58andyfbbloom: I withdraw the comment. Misunderstood the thrust of your comment, then.
17:58cbp`justin_smith: i think he wants an Om example
17:59HodappOm?
17:59technomancybbloom: no, you're right. I definitely haven't been keeping up with the changes to tooling land in the past few months.
17:59justin_smithcbp`: ahh, reading comprehension fail
17:59Hodapplast time I heard Om in the context of software was some audio synthesis software drobilla created
17:59bbloomandyf: besides, technomancy even utilized troll mode ;-)
18:00justin_smithHodapp: hah, I made some ladspa plugins specifically designed to go with Om, I remember that well
18:00technomancyit's all fair game
18:00allenj12justin_smith: awsome thanks :) and dosnt have to be with om i just wanna see a project that has basically the full package, i just thought om was pretty much used everywhere
18:00andyfBronsa: Considering adding core.typed to the list of projects in the Eastwood crucible, if I can get the warnings down to a reasonable number. Too noisy right now, and it isn't core.typed's fault.
18:00justin_smithallenj12: om is fairly new
18:00Bronsatechnomancy: bbloom I believe arrdem might have already done or will do something like who-calls for his oxcart project, you might want to bug him for that :P
18:01justin_smithand is specifically on the client side, while most clojure stuff deployed is probably still server side
18:01arrdemtechnomancy/bbloom what's up?
18:01technomancyBronsa: oh cool.
18:01technomancyanother person I can't give a hard time about because he's literally in the middle of making contributions to parts of the toolchain. =)
18:03Bronsaandyf: yeah, I'm a bit busy this period with the GSoC and exams so I don't have time to do that myself but you're more than welcome to report all the bugs you can find :)
18:03Hodappjustin_smith: I'm poking around with Overtone right now...
18:03HodappOm was a neat project though
18:03allenj12justin_smith: o, am i blind, or is there no .cljs in refheap....
18:03Bronsaandyf: even though tbh core.typed did some funky stuff last time I looked w/ circular dependencies so it might not be all tools.analyzer's fault if it fails :P
18:04arrdemBronsa: oh who-calls yeah that's on the todo list. I already have calls-what, I just haven't built the mapping inversion.
18:04justin_smithallenj12: I had misenterpreted your question, it is not a cljs project, just clojure
18:04justin_smithsorry
18:04justin_smithHodapp: cool
18:05andyfBronsa: Your latest suggested change to Eastwood has, I *think*, gotten it to go through all of core.typed's code without throwing any more exceptions. Now it is a matter of going through the warnings and either fixing small things in core.typed, or figuring out a way to make Eastwood not complain about something that isn't a bug.
18:05Bronsaarrdem: make sure to tell technomancy once you have it working :P
18:05arrdemBronsa: he can bloody well open an issue if he wants updates :P
18:05arrdemtechnomancy: ^
18:05allenj12justin_smith: o ok i guess i should have been more clear. im still surprised tho there was no need for it?
18:05danielcomptonarrdem do you have a turns-down-for-what function planned?
18:05justin_smithallenj12: it's not a js heavy site, apart from some off the shelf libs
18:05arrdemdanielcompton: (constantly false), next!
18:06justin_smithhah
18:06danielcompton,(inc arrdem)
18:06clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: arrdem in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:06Bronsaandyf: oh cool
18:06danielcompton,(inc 'arrdem)
18:06clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number>
18:06justin_smith(inc arrdem)
18:06lazybot⇒ 29
18:06justin_smithit's a pseudo-syntax
18:06danielcomptonNo comma?
18:06arrdemdanielcompton: we aren't vars in clojurebot yo
18:06justin_smithit's not really clojure, just a bot command triggered by (inc
18:06arrdems/clojurebot/lazybot/g
18:07justin_smith(inc unbalanced
18:07justin_smithI guess I never tried that before
18:07metellus)
18:07danielcomptonahh, I thought everyone was a var too
18:07bbloomarrdem: not sure i understand where oxcart fits in. is a bag of extra passes gluing together tools analyzer & emitter into a proper compiler? does emitter not act as a compiler on its own?
18:08allenj12justin_smith: i guess im not even completely, how much .cljs i need lol so its still a good reference
18:08bbloomarrdem: oh, the caveats seems to make it a bit clearer... it's the *static* subset of clojure?
18:08arrdembbloom: okay so Oxcart is essentially a research project into what can be done to make clojure run fast
18:08bbloomarrdem: cool
18:09arrdembbloom: the language subsetting I'm doing is to enable specific performance transforms that are illegal or more difficult when I may need to be able to give you a real class reference for any var
18:09bbloomarrdem: ok, i get it now. very interesting
18:10arrdembbloom: now. all the infrastructure for the crazy var squashing emitter isn't built yet. Oxcart is, for now, just a bunch of passes that I hope I can build into a compiler server like technomancy described because I think that editor and tooling compiler introspection is a good thing.
18:10bbloomarrdem: i'm curious what you come up with. i haven't gotten a chance to work on eclj much lately, but my intention was to identify a comparable set of fast stuff, but add deoptimization guards to preserve the dynamic functionality where required
18:10bbloomarrdem: but i'm starting with an interpreter, not a compiler
18:11bbloom(so that i have something to deoptimize to!)
18:11arrdembbloom: I'll be writing a paper on what I find for my undergrad thesis :P also your interpreter is on my "to play with list" because I think it'd be hillarious to implement a dogescript to t.a.jvm frontend and then run it atop clojure with your interp.
18:12bbloomarrdem: godel would be proud
18:12Hodapps/godel/Gödel/
18:12arrdembbloom: I think the real answer is that Oxcart will turn into several optimization targeted t.a(.jvm)? passes that are pre-emission things, and probably two or three different either emitters or emitter modes that can play different tricks compared to the standard t.a.jvm or clojure core emitter.
18:13arrdemhow the core team winds up packaging all that I don't know, hence the monolithic oxcart for now.
18:13arrdem</wall>
18:14deathknightIs there a zero-hero guide for making API calls with clj-http or one of its alternatives?
18:14bbloomarrdem: sounds like fun. good luck! i'll keep an eye on it
18:14arrdembbloom: thanks! I'm just hoping that I manage not to hang myself with scope :P
18:14bbloompsha, naaaaah
18:15bbloomi mean, whole program scheme optimizers are well studied. you just add some fancy pants stuff for clojure-specific bits like pervasive usage of maps and what not, then badda bing badda boom graduate degree
18:16arrdem"bada bing bada boom"
18:16arrdemexcuse me I need more beer to appreciate that appropriately.
18:16Hodappstory of my life.
18:16arrdembbloom: the alternate title for my project is "stealing everything we can from GHC"
18:17bbloomarrdem: ha, nice.
18:17bbloomgoing to do stream fusion? :-)
18:17Hodapphey, I found that stream fusion paper interesting!
18:17arrdem0_0 ghc is magic shit
18:17danielcomptondeathknight the tutorial for http://http-kit.org is pretty good
18:17Bronsacallen is going to be proud
18:17bbloomghc's optimizer is pretty impressive
18:17deathknightdaniel, thanks a bunch. checking it out now
18:18arrdemBronsa: hehe he's still trying to convince me to just drop the project and join the dark side.
18:18augustlanyone got a favorite path matcher/router for building single page web apps with om or something else? :)
18:24nbeloglazovHodapp: I'll take a look
18:25Hodappnbeloglazov: I'd dig deeper myself but I don't even know where to start :-/
18:25arrdemI should amend my summer schedule to include two weeks to just read & evaluate GHC papers...
18:25Hodappnbeloglazov: but, like the issue says, I can load just Quil and not have the issue
18:26nbeloglazovHodapp: I've commented on the issue
18:27arrdemI think that the real answer is that when all is said and done Bronsa, tbc++, ambrosebs and I need to just sit down and figure out what could even be done to leverage types and to mitigate structural sharing so that the compiler can introduce transients.
18:27Hodappoh, I'd not realized Quil 2.0.0 was a thing
18:31andyfarrdem: Do you mean, so the compiler can introduce transients automatically, when it can prove it is safe, without the programmer having used transients?
18:32arrdemandyf: yep, that's something I'd like to do research on when the school year starts up again.
18:32arrdemwaaay out of scope for GSoC
18:33mdeboard7
18:33mdeboard )
18:33mdeboardgah sorry
18:35arrdemhum... looks like eastwood does a ton of what I'm doing already...
18:35arrdemwell. some.
18:36andyfI didn't realize
18:36arrdemandyf: like the def in def stuff, insanities which normal clojure supports that I have to detect as well.
18:37arrdemalthough I forget what I decided to do with def in def..
18:37andyfThe nice thing about implementing Eastwood is that we don't do anything fancy about it -- just detect and report it.
18:37Bronsaandyf: some recent additions to ta/taj could make some of the pattern matching code for eastwood way easier btw
18:37arrdemandyf: true that, but it'd be nice if the detection code could be shared.
18:38andyfBronsa: I'm open to suggestions.
18:38andyfBronsa: But by that statement, I do not mean to pressure you into implementing any of them :)
18:39Bronsaandyf: e.g. defonce-or-defmulti-macro-expansion? could be written as (some (fn [form] (and (seq? form) ('#{defonce defmulti} (first form)))) (:raw-forms node))
18:39arrdemhehe
18:39arrdemyeah I need to start using that...
18:40andyfBronsa: Thanks. I will leave myself an issue to remind me.
18:41andyfBronsa: Eventually Eastwood will be t.a(.jvm) plus about 30 lines of code :)
18:41arrdemandyf: this is a good thing.
18:41Bronsaandyf: http://sprunge.us/TgcI?clj
18:41arrdemOxcart will one day share this fate
18:43Bronsaandyf: well it means I must be doing something right then :P
18:44Bronsaarrdem: if you need :raw-forms be sure to use 0.2.1/2-SNAPSHOT btw 0.2.0 had some passes that discarded it
18:44arrdemBronsa: does t.e.jvm support definline?
18:45arrdemBronsa: thanks for the heads up I'll do new local installs tomorrow.
18:45Bronsaarrdem: it should
18:45arrdemBronsa: but by var as a value or by inlining?
18:45arrdem'cause if the former I need to build the latter.
18:46Bronsaarrdem: both last I checked, if not it's a bug
18:46arrdemkk. good to know.
18:46Bronsaarrdem: supporting :inline-fn is the only thing that makes t.a.j *require* using c.c/eval
18:46technomancydeleting code is the best thing ever
18:47Bronsawhich I don't like, but it's the only way to split the analyzer and the emitter
18:47Hodapphah
18:47Bronsain Compiler.java analysis and emission are intertwined
18:48Hodappdeleting code, though, would not have gone over well in many environments where I've developed, where money was involved...
18:49andyfBronsa: I see :raw-forms is a sequence of forms. In general, is it always 2 forms, or is it some varying number depending upon how many macroexpansions it takes to hit a fixed point?
18:49Bronsaandyf: the latter
18:50arrdemBronsa: hum. okay.
18:53allenj12is it weird after going through several tutorials, im still not completely sure how much of a website i should actually do in html and how much in clsj for front end
19:05allenj12also what is a good lein template for a website, i asked this before and liked the answer but totally forgot which one it was
19:05andyfYou can check the logs: http://logs.lazybot.org/irc.freenode.net/%23clojure
19:07allenj12o cool
19:07allenj12andyf: thanks
19:15gtrakallenj12: probably luminus
19:31JaniczekHi guys, where to put JARs for Leiningen to see them?
19:31clojurebotCool story bro.
19:32nDuffJaniczek, your local Maven repository -- which is where "mvn install" and "lein install" will put things by default
19:33nDuffJaniczek, ...if you aren't using something that speaks Maven, (1) you should, but (2) for the meantime, look at the lein-localrepo plugin.
19:34technomancynDuff: as of 2.3 or so you actually don't need localrepo
19:34nDuffAhh -- then I'm out-of-date.
19:35technomancyclojurebot: lein-localrepo is now unnecessary since lein deploy's second arity can deploy jars from disk directly.
19:35clojurebotIk begrijp
19:37JaniczekSo if I have a jar that isn't in any maven repo, what's the easiest way for my Clojure project to see it? Some lein command, or just right path?
19:39JaniczekI have a ~/.m2 if that's where it should be...
19:44JaniczekMaybe it was unneeded but I managed to do something with https://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/
19:56andyfBronsa: Looking at new with-env in t.a(.jvm) 0.2.1, including example atom called e1 in the test suite referred to in the namespace docs. Should Eastwood be using a similar thing, perhaps without any mappings for "foo" in that example?
19:57andyfHere in particular: https://github.com/clojure/tools.analyzer/blob/master/src/test/clojure/clojure/tools/analyzer/core_test.clj#L45
19:58Bronsaandyf: t.a.j has a global-env function, you might want to (env/with-env (taj/global-env) ALL-THE-ANALYSIS-HERE)
19:58Bronsaandyf: to be clear, tej will work even if you don't do that
19:59andyfthx. Reading...
19:59HodappOvertone is working wonders to remind me that I know little about Clojure and less about music theory.
19:59Bronsabut I'd rather if you did that, cljs will require it so it's more consistent to do it for taj too
20:01andyfALL-THE-ANALYSIS-HERE would be analyzing one form, or the loop for read/analyze/emit/eval ? Currently Eastwood creates a fresh empty env for each analyze call on each top level form.
20:02Bronsaandyf: http://sprunge.us/VjXg?clj it should look like this
20:03Bronsaandyf: analyze/analyze+eval take care of providing the analyze-env for you, there's no need to do that manually now
20:04Bronsaadd a recur there
20:04andyfAlso, Eastwood is currently using a custom run-passes modified from what is in taj, to avoid errors that occur in some of the passes. I am guessing I should continue doing that.
20:06Bronsaandyf: let me look at the code for a second
20:12andyfI've read taj/analyze+eval, and it looks a lot like eastwood.analyze-ns/analyze-file, except for all the extra debug printing in analyze-file. I think I can see how to update eastwood.analyze-ns/analyze-file to work like analyze+eval, leaving the extra debugs in.
20:13andyfIf I tried using taj/analyze+eval, I suspect I would end up copying it and adding in the extra debug printing, anyway.
20:13Bronsaandyf: yeah I thought about updating eastwood to analyze+eval, the only problem is that currently there's no way to retrieve the AST of e.g. (throw (Exception. "")) with analyze+eval
20:13BronsaI might change that in the next release though
20:14Bronsaandyf: anyway, you can replace eastwood's analyze with http://sprunge.us/NIIH now
20:15Bronsaandyf: wrap the loop of analyze-ns with (env/with-env (ana.jvm/global-env) ..) and you're ready to go with 0.2.1
20:16Bronsaandyf: but if you wait a couple of days for 0.2.2 you might get an analyze+eval that you can work with
20:17andyfShould your example http://sprunge.us/NIIH have #'ana.jvm/run-passes in place of ana.jvm/run-passes, or as you wrote it? If it is as you wrote it, I didn't realize clojure.core/binding could do that.
20:17andyfSure, I can wait :)
20:17Bronsaandyf: yeah binding works like that
20:17Bronsait's with-bindings that takes a map of Var -> value
20:20antonvhi
20:20Bronsaandyf: I'll probably go with http://sprunge.us/SLXh?diff but I'll sleep over it to see if there's a better approach
20:21antonvThe :arglists metadata of a funtion var holds the function signature (argument list)
20:21antonvCan I rely on the :arglist name?
20:21antonvOr it is a private Clojure metadata attribute, and I can't expect it will never change?
20:21antonvI have a macro, which expands into a function definition
20:22antonvI want the function defined by the marco to have proper argument list metadata
20:23antonvI don't see anywhere in Clojure docs, that :arglist is guaranteed to always work like this
20:24Bronsaantonv: :arglists is documented http://clojure.org/special_forms#def so it's not private
20:24Bronsaantonv: unfortunately nothing enforces :arglists to be in the correct format '([..]*)
20:24Bronsaand some libraries overwrite :arglists to something different, which really annoys me.
20:26technomancyBronsa: ouch, like what?
20:27antonvBronsa: I would call such libraries unfriendly
20:27Bronsatechnomancy: like, for single arity functions [args..] rather than ([args..])
20:27Bronsaantonv: agreed.
20:27technomancyoof
20:27technomancyactually I change :arglists, but only for partially-applied lein tasks
20:27technomancyI wish c.c/partial would do the same
20:28Bronsatechnomancy: java.jdbc was doing that and I believe seancorfield changed that after I/andyf asked him to do so
20:29andyfSeveral macros in core do it, for documentation purposes. No functions that I can recall
20:30andyfcore.typed has a fun thing where it chose to name the first arg &form, and clojure.core/defn removes the first two args when that happens, I guess because it assumes it must be the function "beneath" a macro that takes &form and &env as the first 2 args.
20:30Bronsatechnomancy: the thing that annoys me the most is that because it's not enforced, tools like eastwood cannot use :arglists to warn users about invoke wrong arities at compile time without the risk of warning about false positives
20:31andyfHiccup's defelem does it.
20:32andyfgot to go. Thanks for all the info, Bronsa.
20:32Bronsaandyf: np
20:33danielcomptonI'm working on a problem where I need to find if an array contains any point where the sum of the left parts of the array = the sum of the right parts of the array, excluding the element that you are on. I thought this would be a perfect use of a zipper and reduce
20:33Bronsatechnomancy: Andy made a ml post asking for introducing :doc-arglists or something like that so that :arglists could be enforced and one could use :doc-arglists for documentation purposed but we got no response from the core team :/
20:34danielcomptonA naive implementation of (= (reduce lhs) (reduce rhs)) works but gets very slow when the vector gets to 10000 elements
20:35danielcomptonI was thinking of building a binary tree with values at each node for the sum of the elements below it. Is there a clojure function/datastructure similar to this or do I need to build it myself?
20:39hyPiRiondanielcompton: You can do that even easier: The most efficient way is to just use an array storing cumulative sums, and calculate diffs based on that.
20:39Jachydanielcompton: I think my approach would be to make two prefix sum arrays, one from the left and one from the right.
20:40hyPiRiondanielcompton: If you need to do real time updates on the array, have a look at Fenwick trees/BIT
20:40danielcomptonhyPiRion what would the array look like then? I need to calculate it at each point in the list
20:40hyPiRiondanielcompton: if you have [1 2 3 4], the cumulative vector is [1 3 6 10]
20:40Jachyhttp://en.wikipedia.org/wiki/Prefix_sum
20:41danielcomptonhyPiRion And then do a reverse array?
20:41danielcompton[4 7 9 10]
20:41hyPiRiondanielcompton: there's no need for a reverse array
20:41danielcomptonhyPiRion yeah, just realised that
20:42hyPiRionso I'd guess the idiomatic clojure algorithm creates the cumulative vector with reductions
20:42danielcomptonSo a successful test case is [1 2 3 3]
20:42hyPiRion,(reductions + [1 2 3 4])
20:42clojurebot(1 3 6 10)
20:42danielcomptonWhere 1+2 = 3 seen from the third element in the vector
20:43danielcompton,(reduction + [1 2 3 3])
20:43clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: reduction in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:43danielcompton,(reductions + [1 2 3 3])
20:43clojurebot(1 3 6 9)
20:44danielcomptonI don't quite see how this helps, do I take 6-3 = 9-6?
20:44hyPiRiondanielcompton: the sum of the previous elements are simply the previous element (3). The sum of the remaining elements are the total sum (9) minus the cumulative sum so far (6)
20:45danielcomptonhyPiRion: it all becomes clear
20:45hyPiRionnice
20:45danielcomptonhyPiRion thanks
20:45hyPiRionnp
20:49augustlare clojurescript atoms available as a stand-alone js lib?
20:50augustlusing mori in a js app and noticing that I'm also missing atoms :)
20:51danielcomptonhyPiRion I just went from 90 seconds with 10k elements to 0.5 seconds
20:51hyPiRionheh, the power of algorithms
20:51danielcomptonwho knew 50+ years of computer science had something to offer
20:52hyPiRionstrange, eh
20:53augustlO(n) path matching is my pet peeve these days.. Almost every URL dispatcher I know about is O(n) over each defined route
20:53Hodappdanielcompton: the flip side is that, when you are a developer at a job that is using the State of the Art(tm), and you read a 50-year-old Comp Sci paper that is addressing a simple, practical solution to a problem that you realize is still basically unsolved within the company, it tends to be depressing.
20:53technomancyBronsa: is it really that bad if you have false positives around terrible code?
20:54technomancyI mean, for slamhound I made a point of saying "we can provide benefits X, Y, and Z, but only if you have well-formed code that doesn't do anything too crazy"
20:54danielcomptonHodapp there is that too. Are you thinking of any paper in particular?
20:54Hodappnope.
20:54technomancyso if you have a c.c/load call in your code, it's not going to be able to help you; you're on your own, but it doesn't seem like too much to ask. better than trying to be all things to all people.
20:56hyPiRionHodapp: I don't think it's depressing. There's just so much out there it's impossible to know everything. It's a bit sad that people don't attempt to check if the problem's already solved, though
20:56HodapphyPiRion: that latter part was what depressed me.
20:57hyPiRionHodapp: alright. Then I agree. Sad world =(
20:57HodapphyPiRion: It wasn't, "someone didn't just know out of the blue that they were dealing with a well-studied problem," but rather "someone lacked the humility to even think that maybe, maybe someone else had looked at this problem, even after being beaten over the head with the paper"
20:58HodappBut, on the bright side, there are certainly some gems in those early papers, and I find it very interesting to see the foresight the authors had.
20:58Bronsatechnomancy: I'd agree with you, but it's really annoying when you have to explain the users of a library you're trying to push that it's not your new library that's broken but the official-contrib-db-layer they've been using for 2 years that's doing something weird but not really illegal
20:59HodappI've been meaning to read, "Augmenting Human Intellect: A Conceptual Framework" from Doug Engelbart.
21:18technomancyBronsa: yeah. gotta draw the line somewhere, but I suspect it's probably harder in a new tool that people are still forming opinions about.
21:26kenrestivothe commercial world of software was for a long time very divorced from the academic world. the culture of the bill gates'es who dropped out of college to become millionaires, etc. it seems that the two worlds are starting to merge again, which is a good thing.
21:27Hodappkenrestivo: there was something of an anti-intellectual culture around the software development at the last job.
21:28kenrestivoindeed. it was once pervasive through much of the industry, as i recall it.
21:28kenrestivomaybe google and others are changing that culture. maybe it's just that the world is more complex, and the problems are harder to solve, and a solid academic background is not optional anymore?
21:28Hodappwe had a contractor - who was let go - who had a rather stubborn, vocal view that whatever I did in my spare time that pertained to software development was worthless, academic, and something that only a nerd would care about.
21:29kenrestivoHodapp: hopefully you've landed in a more friendly company since then.
21:30p_lkenrestivo: actually, Google is getting rid of bias towards degrees in new hires :>
21:30Hodappthey got rid of him, but yes, I've landed elsewhere too
21:30kenrestivo p_l: the pendulum swinging a bit in the other direction, eh?
21:31HodappI don't particularly care if I get to use Clojure at $job, but I do care if it's a job where people turn their noses up at the mere idea of Clojure and take a sort of "Oh, it's one of THOSE languages that only neckbeard academics understand" stance.
21:32p_lkenrestivo: they identified a too strong focus on university and grades as detrimental
21:34justin_smithHodapp: I take that kind of attitude as defensiveness / insecurity
21:34p_lkenrestivo: mind you, from my pov, software industry was full of "you must have degree or we won't even talk with you"
21:34p_l(at least in bigger places)
21:34justin_smithnot to say I haven't seen, for example, similar attitude about Haskell here.
21:35kenrestivop_l: i've noticed that in recent years. 20-30 years ago it was quite the opposite.
21:35p_ljustin_smith: TBH, a certain *group* (not everyone) of people who associate with haskell tend to propagate that view
21:35hellofunkHodapp just tell them "I want to use this Java library called Clojure."
21:39Hodapphellofunk: sneaky :P
21:39hyPiRion"It's a dsl for java very suitable for our needs"
21:42platz501 developers (http://thedevstop.wordpress.com/2012/04/19/reflections-on-the-501-developer-manifesto/) can be hostile to those that put in time outside of work hours, because it threatens their lifestyle
21:43platzif (b) codes all night, will I have to as well, to keep up?
21:43HodapphyPiRion: There was a huge inertia, not just in terms of attitudes but in terms of technical barriers, on most things there. As a result of using languages with crappy abstraction, and then trying to tack on Java support, we had 4 or 5 kind of half-assed ad-hoc minilanguages. These minilanguages were used, largely, as templates for automatic generation of code.
21:44HodappAnd in order to add basically anything, it had to go through all of these gigantic, inflexible layers where there simply was no abstraction.
21:44platzalso relevant, pretty much everything written by michaelochurch
21:45justin_smithhellofunk: we did that, and it worked out great, until the client tried to run a static analysis tool because another vendor had deployed an app with a security hole, and discovered that what we deployed was simply impossible for a java sa tool to analyze
21:45justin_smiththen the jig was up
21:45justin_smithand we also lost some trust from the client
21:45TimMcplatz: I have a contract with my employer that buys them 40 hours of my attention each week. Anything on top of that is at my pleasure. Other employees may do as they wish.
21:46TimMc(They can also sometimes borrow extra time per week, but only with interest...)
21:46Hodappjustin_smith: was that to me?
21:46justin_smithHodapp: it wasto hellofunk who was replying to you above
21:47justin_smithre: "java lib called Clojure"
21:48justin_smithregarding the proliferation of half-assed minilanguages, yeah that is the price people pay for lisp-phobia
21:48Hodappit wasn't even lisp-phobia, it was a phobia to all things not C++.
21:49Hodappone developer had created the "AutoCode Generator" and was really proud of it.
21:49justin_smithI am sure, since it was IH and all
21:49Hodappand I couldn't help but see it as nothing but a set of crutches that let us hobble along on a broken language for a little bit longer
21:49TimMcplatz: I do some work on my own time for an open source project that I also work on for my employer, but that's because it's important to me.
21:50platzcalling C++ a broken language? hrmm
21:50danielcompton,(partition 2 1 (reductions + [1 2 3 4 5 6 7 8 9 4]))
21:50clojurebot((1 3) (3 6) (6 10) (10 15) (15 21) ...)
21:51danielcomptonhow do I get ,(partition 2 1 (reductions + [1 2 3 4 5 6 7 8 9 4])) and also tack on the last value of reductions, 49 in this case
21:51Hodappplatz: completely broken for the sorts of burdens being put on it.
21:51danielcomptonIs it lazy-cat?
21:51Hodappbut with everyone having a strong emotional attachment to it.
21:52technomancyhard to believe there are strong emotions around C++ that aren't hatred and loathing
21:52justin_smithdanielcompton: maybe partition-all?
21:52danielcomptonjustin_smith, I'm wanting it to look like ((1 3 49) (3 6 49) (6 10 49))... I don't think partition-all would give me that?
21:53justin_smithoh, misunderstood your request
21:53hyPiRion,(let [sums (reductions + [1 2 3 4 5 6 7 8 9 4]) total (last sums)] (->> (partition 2 1 sums) (map (fn [[a b]] [a b total]))))
21:53danielcomptonjustin_smith It wasn't phrased particularly well, rereading it
21:53clojurebot([1 3 49] [3 6 49] [6 10 49] [10 15 49] [15 21 49] ...)
21:53hyPiRionnot sure if there's any better way
21:54danielcomptonhyPiRion thanks, I was hoping there was a single golden clojure function that would solve it all for me
21:54TimMctechnomancy: Except for wistfulness for the days when nobody did anything important enough on computers to have to worry about sploitz.
21:55TimMcAh, those were the days...
21:56hyPiRiondanielcompton: unfortunately that magic function is not always available, so better use what you got/know
21:56danielcomptonhyPiRion yeah, got to work with what I have
21:59fifosineCan anyone vouch for or against using pedestal for single page applications?
22:02justin_smithfifosine: pedastal is kind of experimental, from what I have seen
22:02justin_smithit has some cool stuff, but it is a little "weird"
22:02fifosinedo you have any recommendations for frameworks for building single page apps?
22:02justin_smithcompojure / cljs / om should work pretty nicely
22:03justin_smithwell, skip compojure if it is truly single page maybe, and just use httpkit+ring/ cljs / om
22:04fifosinejustin_smith: Since I'm new to web dev with clojure, where do I start with incorporating those libraries together? There seems to be a lack of literature
22:04justin_smithlein new om-starter should give you all of that
22:05justin_smithor something close enough
22:05justin_smithI mean lein new om-starter project-name
22:07justin_smithtrying that myself, the only thing missing is the http-kit ring backend, which is not hard to set up once you have the default template
22:11fifosinejustin-smith: http-kit deals with the server logic/
22:11fifosine?
22:11justin_smithit implements the http server
22:11justin_smithwhich you interact with in your code via the ring library
22:12justin_smith(ring means you can switch it out with other servers trivially)
22:12fifosinewould I need to incorporate these for a dev environment?
22:12justin_smithwell, http-kit implements web sockets (which are often useful for single page apps) and jetty does not
22:12justin_smithso maybe, if you need the feature
22:13justin_smithotherwise, http-kit is probably the best server for production for performance reasons
22:34danielcomptonfifosine I wouldn't recommend it unless you're working with Cognitect as well
22:42platzI wonder if it would be possible to use that crazy fast 'undertow' framework that keeps trouncing the techempower benchmarks with clojure
22:44justin_smithhttp://undertow.io/ this one?
22:45danielcomptonplatz why would it not be possible?
22:45ddellacostaplatz: https://github.com/piranha/ring-undertow-adapter
22:53platzwow cool
23:02technomancyI'm trying to see how the upcoming lein release will perform as far as startup time; could some folks run this on their own machine and report results? http://p.hagelb.org/bench-startup
23:10cbptechnomancy: https://www.refheap.com/86388
23:12benkayi'm sure there's a function similar to any which checks a predicate over a coll, but instead checking a set of predicates over a value
23:13benkayforgive me for blanking...
23:13cbp(doc every-pred)
23:13clojurebot"([p] [p1 p2] [p1 p2 p3] [p1 p2 p3 & ps]); Takes a set of predicates and returns a function f that returns true if all of its composing predicates return a logical true value against all of its arguments, else it returns false. Note that f is short-circuiting in that it will stop execution on the first argument that triggers a logical false result against the original predicates."
23:17benkaysweet! thanks, cbp
23:21FrozenlockIs there a way to manually login a user in friend? Changing the ring session and fiddling with :cemerick.friend/identity ?
23:21ddellacostaFrozenlock: do you need it for testing or as part of the real app flow?
23:21benkayFrozenlock: in the context of looking at your app in realtime?
23:22Frozenlockreal app
23:22FrozenlockI'm creating an account when the user pay with credit card. I'd be nice if he would be logged in automatically after that.
23:24benkaysomething like (assoc response :session {:logged-in true}) ?
23:25benkayFrozenlock: you may also want to dig in and learn about how sessions work in Ring.
23:25FrozenlockI know how it works, I'm asking because it feels a little primitive. :-/
23:26bepputechnomancy: https://gist.github.com/beppu/5cf0d636ca78359aefe6
23:26FrozenlockI was hoping to have missed a friend function "log-user" or something like that...
23:26technomancycbp, beppu: thanks
23:27benkayFrozenlock: have you read this? https://github.com/cemerick/friend-demo
23:27Frozenlockbenkay: Not recently, might be worth to look again. Thanks
23:28benkayreading the source for that will answer like 90% of your friend questions
23:28benkayand raise 50 more...
23:30Frozenlockyeah... while friend might be the best for clojure right now, it feels like walking on eggs.
23:30benkayconsider writing your own handler for logged-in-ed-ness
23:32hellofunkFrozenlock walking on eggs? do you mean fragile or unstable? Friend is used quite a bit in production.
23:32FrozenlockI think friend/merge-authentication is what I need. https://github.com/cemerick/friend/blob/master/src/cemerick/friend.clj#L65
23:33Frozenlockhellofunk: Yes, that's what I mean.
23:33FrozenlockNot that it is, but it *feels*
23:33benkayhellofunk: lol running in production is *not* a guarantor of quality in my experience.
23:33benkaylook at how much php there is in the wild for starters ;)
23:33hellofunkFrozenlock well Chas knows what he's doing and a lot of people have kicked around that library.
23:34FrozenlockI know. I wouldn't be using it otherwise.
23:38seanawaytechnomancy: re: Bronsa's comment about java.jdbc - it still has "bad" :arglists but it has a JIRA ticket to fix them so Eastwood can make sense of them
23:50danielcomptontechnomancy my bench results https://www.refheap.com/86389