2013-02-22
| 00:06 | Raynes | callenbot: I don't think I actually have much unused css. |
| 00:16 | frozenlock | Is there a more idiomatic way to pretty print to a file? (spit "filename" (with-out-str (clojure.pprint/pprint some-data-to-export))) |
| 00:31 | Raynes | frozenlock: Well, pprint prints to *out*, so bind *out* to a writer on the file. |
| 00:32 | Raynes | frozenlock: http://docs.oracle.com/javase/1.4.2/docs/api/java/io/FileWriter.html |
| 00:34 | Raynes | frozenlock: (binding [*out* (java.io.FileWriter. (java.io.File. "foo"))] (clojure.pprint/pprint "{:foo \"bar\"}")) |
| 00:36 | amalloy | don't forget .close or with-open |
| 00:36 | Raynes | Well, yeah. |
| 00:36 | frozenlock | Raynes: Interesting. |
| 00:37 | frozenlock | Not really shorter, but helpful to understand the principle. :) |
| 00:37 | Raynes | I imagine it would be more efficient as well. |
| 00:37 | Raynes | With your version you're printing all of this to a string and then writing it to a file. With mine, you're just printing it to the file. |
| 00:38 | blankstare | hi, i'm trying to get my head around recursion and i've got a function that seems to be off by 1 (NullPointerException). Can anyone see where I'm screwing up? http://pastebin.com/9kMdz7Z3 |
| 00:38 | Raynes | If it's small data you're pretty printing it doesn't really matter though. |
| 00:38 | Raynes | println returns nil so you're calling nil. |
| 00:39 | frozenlock | Raynes: around 914 bytes :P |
| 00:43 | Raynes | (defn fire-x-times [x] (dotimes [n x] (println "fired" (inc n) "times"))) |
| 00:43 | blankstare | ah thx! |
| 00:47 | Raynes | (defn fire-x-times [x] (loop [x x n 1] (when (>= x n) (println "fired" n "times") (recur x (inc n))))) ; also works and would be preferable over a recursive solution. |
| 00:48 | Raynes | (defn fire-x-times ([x] (fire-x-times x 1)) ([x i] (when (>= x i) (println "fired" i "times") (recur x (inc i))))) ; and a recursive version. |
| 00:48 | Raynes | That'll be a dollar per version. |
| 00:59 | blankstare | nice! |
| 01:10 | amalloy | that solves blankstare's immediate problem, but i think Raynes missed the more important point. in lisp, parentheses are (with exceptions to learn about later) not a grouping construct at all, but the mechanism for calling functions. to "group" two expressions, you need to use some other tool. in clojure, that's (do a b) |
| 01:11 | Raynes | That's me, missing them points. |
| 01:13 | blankstare | Looks like good points. |
| 01:16 | amalloy | note, though, that since clojure is a functional language (and thus discourages side effects) you should need to use 'do pretty rarely |
| 01:16 | blankstare | @amalloy adding do to if's args solved my original function |
| 01:17 | blankstare | yeah. that might take a minute |
| 01:27 | Raynes | callenbot, bbloom: I ended up using helium css because it scans multiple pages and accumulates the data. |
| 01:27 | Raynes | Turns out there isn't a lot of cruft, but there was some that I've removed. |
| 01:49 | Raynes | callenbot: Changed the fault font to Menlo followed my Monaco followed by Deja Vu (and since I presume you use a mac, this doesn't effect you and keeps my Deja Vu loving Linux fans happy). |
| 01:49 | Raynes | Also went with 10pt instead of the 11 you recommended. It felt too big to me. This might change, but I doubt it. I have a much worse DPI at work and if it looked too big on this macbook, I'd have probably had a heart attack on my monitor at work. |
| 02:28 | ambrosebs | I've tracked down the root cause as to why `mvn test` fails in core.typed. Anyone got ideas/explanations? https://groups.google.com/forum/?fromgroups=#!topic/clojure/8xjq99PtZTU |
| 02:30 | MacCoaster | Hi. I'm familar with accumulator functions, such as one in C#'s LINQ. I'd like to do the same but instead of keeping state I just want it to generate something like (foo (foo (foo (foo seed arg1 arg2) arg3 arg4) ... and so on. What's the best approach to this in Clojure? |
| 02:31 | MacCoaster | so I can evaluate it later, that is. |
| 02:31 | MacCoaster | Perhaps recur? |
| 02:32 | ambrosebs | It looks like an `iterate`? |
| 02:32 | amalloy | no, it's really just reduce, which i assume is the same as a LINQ accumulator |
| 02:33 | amalloy | (reduce (fn [acc args] (apply foo acc args)) seed [[arg1 arg2] [arg3 arg4]]) is what you asked for |
| 02:36 | amalloy | &(let [foo (partial list 'foo)] (reduce (fn [acc args] (apply foo acc args)) 'seed '[[arg1 arg2] [arg3 arg4] [arg5 arg6]])) |
| 02:36 | lazybot | ⇒ (foo (foo (foo seed arg1 arg2) arg3 arg4) arg5 arg6) |
| 02:37 | MacCoaster | amalloy: aha, reduce, that's right :) thanks |
| 02:38 | MacCoaster | amalloy: though iterate does look like it may also solve that too? if x = seed, then f(seed), then that is fed as f(f(seed)), etc. no? |
| 02:39 | amalloy | mhm, and arg1, arg2, ... argN? |
| 02:40 | MacCoaster | amalloy: assuming I don't need arg1...N, but yeah, if I did, reduce looks better. |
| 02:43 | frozenlock | http://dev.clojure.org/jira/browse/CLJ-1009 "make print-table org mode compatible". What happened to this feature? |
| 02:46 | frozenlock | Oh wait... "Fix Version/s: Release 1.5" ... does that mean the next version? |
| 02:48 | alandipert | frozenlock: it will be in 1.5 i think |
| 02:49 | frozenlock | Well, now I have a really good reason to be eagerly waiting 1.5 :D |
| 02:50 | tomoj | just use the RC? |
| 02:50 | frozenlock | That, and also to not get #=ed |
| 02:50 | tomoj | looks like the patch is in https://www.refheap.com/paste/4ebd4be52cb8bcf2b4f382076 |
| 02:51 | tomoj | did the font at refheap change? I like it. |
| 02:53 | frozenlock | Are the release candidates also on clojars? |
| 02:53 | tomoj | no http://search.maven.org/#search%7Cga%7C1%7Cclojure |
| 03:01 | frozenlock | tomoj: Thanks, I'll try the last RC then. Living on the edge! |
| 03:03 | frozenlock | 'ClassNotFoundException clojure.pprint' |
| 03:03 | frozenlock | Well... that didn't take long. |
| 03:04 | frozenlock | Oh! you need to require it in 1.5! |
| 03:05 | frozenlock | My world crumbles. |
| 03:07 | ryanf | is there a simple way in the repl to see the methods callable on an object? (i.e., the things that you can do (.foobar my-record) with for a given my-record) |
| 03:07 | ryanf | please forgive my terminology being embarrassing since I don't know what I'm doing |
| 03:10 | ifesdjeen | ryanf: yes, sure |
| 03:11 | frozenlock | ryanf: just found https://github.com/flatland/useful/blob/develop/src/flatland/useful/bean.clj |
| 03:11 | ifesdjeen | ryanf: (:members (clojure.reflect/reflect object) |
| 03:12 | ifesdjeen | ryanf: (:members (clojure.reflect/reflect object)) |
| 03:12 | ifesdjeen | probably you want to pprint it's output though |
| 03:13 | ifesdjeen | ryanf: you could also use repl-utils |
| 03:13 | ryanf | ifesdjeen: cool, thanks |
| 04:34 | cacodaemon | &(defn t (t)) |
| 04:34 | lazybot | java.lang.IllegalArgumentException: Parameter declaration t should be a vector |
| 04:34 | cacodaemon | :) |
| 04:52 | jcidaho | Has anyone deployed datomic to EC2 using a free transactor - maybe writing to S3? There's some stuff on the web but just starting out - any words of wisdom would be appreciated |
| 04:53 | ambrosebs | Do we know how many GSoC slots we have for 2013? |
| 05:23 | nonuby | is there no any? |
| 05:25 | ucb | anybody using riemann here? |
| 06:10 | pepijndevos | I'm trying to do a proxy by siphoning a client into a server, but it dosn't like doing that. |
| 06:38 | Anderkent | How can I put fully namespaced symbols into (case ...) ? I.e. (case a-symbol `foobar :x `barfoo :y) - it throws a duplicate case constant error for 'quote' |
| 06:57 | Anderkent | Also, what the hell does #= do? Why doesnt #=1 work? Or #=(quote foo)? |
| 07:09 | antares_ | ,(= ::sym :other-ns/sym) |
| 07:09 | clojurebot | false |
| 07:09 | antares_ | ,::sym |
| 07:09 | clojurebot | :sandbox/sym |
| 07:10 | antares_ | :other-ns/sym |
| 07:10 | antares_ | ,:other-ns/sym |
| 07:10 | clojurebot | :other-ns/sym |
| 07:17 | meegofl | Hi, need a little help with for loop (not working) inside a function |
| 07:17 | meegofl | i have this function - http://pastebin.com/sFWEseKK |
| 07:18 | meegofl | if i comment out the for loop (and give static value to index) the body works |
| 07:18 | meegofl | if the loop is uncommented it just not getting to the body (even when in debug) with no error |
| 07:34 | aav | meegofl: in clojure most of things are evaluated lazily. in your example nothing triggers evaluation of (for …) |
| 07:35 | aav | meegofl: if you want to do be sure that all side effects will be applied, you can wrap your for loop with (doall …) |
| 07:36 | aav | meegofl: or, better, replace for with (doseq …). it is made specially for side effects |
| 07:37 | meegofl | aav: 10x! will try that now |
| 08:06 | clgv | &(defn f [x] (* x x)) |
| 08:06 | lazybot | java.lang.SecurityException: You tripped the alarm! def is bad! |
| 08:06 | clgv | oh the jail expands it completely until it finds def^^ |
| 09:08 | pandeiro | how could i get a sequence of every day of a certain year, preferably w/ just core & java? |
| 09:16 | Foxboron | So, i am testing some regex stuff in the repl, and it gives me the right results. But if i actually run the code with lein, the results of the RegEx is somehow inverted from what the repl does. |
| 09:32 | jeremyheiler | pandeiro, I imagine some combination of lazy-seq and Calendar would work. |
| 09:33 | pandeiro | jeremyheiler: that's what i'm working out now, using Calendar's getActualMaximum() |
| 09:33 | ljos | jeremyheiler, pandeiro: or perhaps just iterate? |
| 09:34 | pandeiro | ljos: how would the fn work? |
| 09:36 | antares_ | pandeiro: https://github.com/michaelklishin/quartzite/blob/master/src/clojure/clojurewerkz/quartzite/date_time.clj#L58 does what you need but it relies on JodaTime (which is always a good idea anyway) |
| 09:38 | pandeiro | antares_: you're right, looks good... think i'm gonna try to do it w/o for now though |
| 09:38 | ljos | pandeiro: I looked over Calendar api; I think it would be difficult with iterate because of how Calendar works. Use the date-time lib, prob better. |
| 09:39 | jeremyheiler | ljos, pandeiro, yeah Calendar is a side effecty object. |
| 09:39 | pandeiro | jeremyheiler: ljos: yeah i see that |
| 09:40 | pandeiro | what i am doing is so simple though i think i'd like to just KISS as much as possible |
| 09:40 | jeremyheiler | You could probably do it with iterate if you get a calendar on each iteration and reset the date to the day inputed, and return the next day |
| 09:41 | pandeiro | jeremyheiler: yup read my mind |
| 09:47 | TimMc | pandeiro: If you use lazy-seq and make sure the Calendar instance doesn't escape the scope, it's fine that it's side-effecting. |
| 09:50 | pandeiro | TimMc: right i would just create a new instance on every iteration, i was thinking |
| 09:54 | pepijndevos | How can I reconnect an Aleph client on error? |
| 09:57 | TimMc | pandeiro: No, I think you could just use the same instance. |
| 09:59 | pandeiro | TimMc: ah yeah sure, i am wanting to work with dates as [month date] vectors instead of java objects, so i was just passing each iterate the last vector, creating the instance, doing the math, and converting to my format |
| 10:00 | pandeiro | ljos: thanks for the idea by the way, i think it's the nicest way to do it |
| 10:01 | ljos | pandeiro: maybe (iterate #(let [cal (.clone %)] (.roll cal Calendar/DATE 1) cal) (Calendar/getInstance)) , that would be from now, but you could set the date. |
| 10:02 | pandeiro | ljos: more or less what i did, but yeah as a named fn that takes an initial date or defaults to now |
| 10:03 | pandeiro | i was using .add too, not .roll |
| 10:04 | TimMc | ,(take-while number? (let [mutable (atom 0)] (repeatedly #(let [r @mutable] (when (< r 5) (swap! mutable inc) r))))) ;; pandeiro |
| 10:04 | clojurebot | (0 1 2 3 4) |
| 10:06 | pandeiro | TimMc: that was to show me how to limit by year? or deal with the mutable state? or both? |
| 10:07 | TimMc | Dealing with mutable state. |
| 10:08 | TimMc | Converting back and forth between Calendar and month/day sounds error-prone or overcomplicated. |
| 10:08 | pandeiro | TimMc: you're right |
| 10:08 | TimMc | Nothing wrong with contained mutation. |
| 10:08 | thalassios_xelon | hello room :)) |
| 10:09 | pandeiro | TimMc: so in your example i wouldn't even use iterate or pass a calendar obj param |
| 10:09 | thalassios_xelon | (let [x 5] (symbol "x")) evaluates to x,not to 5,do you know why? |
| 10:11 | TimMc | thalassios_xelon: Yes, that's expected. |
| 10:12 | TimMc | I suppose you're confusing runtime values with compile-time values. |
| 10:12 | thalassios_xelon | i am... first time trying metaprogramming |
| 10:12 | thalassios_xelon | thx TimMc |
| 10:13 | TimMc | Trying to write a macro? |
| 10:13 | thalassios_xelon | not really a macro,just some dynamic code |
| 10:14 | thalassios_xelon | i will figure it out, thx |
| 10:14 | thalassios_xelon | bye room :) |
| 10:24 | TimMc | Anyone want to propose an over/under on when they'll be back asking about macros? :-P |
| 10:27 | clgv | sooooooon ;) |
| 10:30 | TimMc | I'd say more than 24 hours. |
| 10:30 | TimMc | but less than a week for sure |
| 10:31 | TimMc | Oh wait, maybe this is another boolean expressions thing. |
| 10:37 | andyfingerhut | TimMc: There is a Clojure patch on CLJ-1168 that seems like it should allow Leiningen to work with 1.5.0 and :jvm-opts ["-Dclojure.read.eval=unknown"] http://dev.clojure.org/jira/browse/CLJ-1168 |
| 10:37 | clojurebot | Alles klar |
| 10:38 | TimMc | andyfingerhut: I tested it, it works great! |
| 10:39 | TimMc | I wasn't sure whether to mention that in the Jira. |
| 10:39 | TimMc | *Jira comments |
| 10:39 | andyfingerhut | TimMc: Were you able to test it with a Leiningen project with that line in its project.clj file, by any chance? |
| 10:39 | andyfingerhut | I wasn't sure how to do that with my own custom-built version of Clojure |
| 10:40 | clgv | andyfingerhut: you should be able to install that custom build locally via maven |
| 10:41 | andyfingerhut | clgv: Sorry, maven noob here. Would that be "mvn install" in my local Clojure source tree? |
| 10:41 | TimMc | I believe so. |
| 10:41 | clgv | andyfingerhut: from my leiningen knowledge, I'd guess so as well. |
| 10:42 | andyfingerhut | OK, trying that out... |
| 10:42 | clgv | you can check by browsing the .m2 directory if your clojure build shows up there |
| 10:43 | pepijndevos | lamina is weird... |
| 10:45 | TimMc | andyfingerhut: Re-testing, I may be seeing something weird. |
| 10:47 | andyfingerhut | TimMc: Stu H has an updated version of the patch that he'd like feedback on, so better to test that one if you can grab it. |
| 10:48 | TimMc | andyfingerhut: Will do. The existing version is setting *read-eval* to true when I do lein run, I think. |
| 10:49 | andyfingerhut | Both the original and Stu's newer patches should set *read-eval* to true while reading for the REPL, and while reading -e command line args, if you use -Dclojure.read.eval=unknown on the JVM command line. It should be :unknown at all other times, I believe. |
| 10:50 | TimMc | andyfingerhut: THe older patch was allowing clojure.main and the REPL to work properly, and (read-string "foo") entered into the REPL failed (as expected), but my -main fn is seeing *read-eval* true. |
| 10:51 | TimMc | Having internet trouble, may be a few minutes. |
| 10:51 | andyfingerhut | TimMc: odd. Would be good to figure out why that is happening. |
| 10:51 | TimMc | I'm not testing in a clean project, and I should be. |
| 11:01 | andyfingerhut | TimMc: I've got a clean project, and I've verified it works as expected with Clojure 1.5.0-RC15, meaning it bombs out when you try to set -Dclojure.read.eval=unknown in project.clj. Soon will try out that same project with Stu's patch. |
| 11:01 | TimMc | andyfingerhut: The newer patch works. I'll also go back and see if I can reproduce the weird behavior of the old patch in a fresh project. |
| 11:02 | andyfingerhut | TimMc: :-) |
| 11:03 | goracio | hey ) ,(def a 1) ,(def a (+ a 2)) ,a |
| 11:03 | TimMc | I actually patched against master. Probably doesn't make a difference. |
| 11:03 | goracio | ,(def a 1) |
| 11:03 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 11:03 | goracio | what?? |
| 11:03 | lazybot | goracio: What are you, crazy? Of course not! |
| 11:03 | goracio | ,(def a 1) |
| 11:03 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 11:04 | goracio | ,(def num 1) |
| 11:04 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 11:04 | ravster | hello everyone |
| 11:04 | andyfingerhut | I'm patching against master, too, which is only 1 minor commit later than 1.5.0-RC15 |
| 11:04 | goracio | lazybot down ? |
| 11:05 | TimMc | goracio: That's clojurebot you're talking to, and the sandbox doesn't allow def. |
| 11:05 | goracio | ah ) |
| 11:05 | goracio | so |
| 11:05 | goracio | this is valid (def a 1) (def a (+ a 2)) |
| 11:06 | goracio | something like a = a+2 |
| 11:06 | goracio | i guess |
| 11:06 | goracio | a is 3 |
| 11:06 | goracio | i expected a is immutable |
| 11:07 | clgv | &(println "no, I am here") |
| 11:07 | lazybot | ⇒ no, I am here nil |
| 11:07 | clgv | clojurebot kicked the bucket though |
| 11:08 | clgv | ,(inc 1) |
| 11:08 | clojurebot | 2 |
| 11:08 | clgv | or not^^ |
| 11:08 | goracio | so how that can be ) |
| 11:08 | clgv | goracia: ah now I see. you tried something forbidden in clojurebots's sandbox |
| 11:09 | goracio | or persistent only vector and map ? |
| 11:09 | clgv | goracia: you cannot `def` anything in clojurebot's sandbox |
| 11:09 | clgv | `a` is var containing the result of its definition |
| 11:10 | clgv | when you implement functions you must not use `def` inside the function |
| 11:10 | goracio | so a is variable ? |
| 11:11 | clgv | instead you'd do something like that (defn f [x] (let [y (+ x 2)] (* x y)) |
| 11:11 | goracio | i know about let |
| 11:12 | andyfingerhut | TimMc: Patch on top of latest Clojure master looks good to me. I tried it with a brand new tiny Leiningen v2.0.0 project. "lein run" bombed out with -Dclojure.read.eval=unknown and 1.5.0-RC15. It worked and showed *read-eval* = :unknown with 1.5.0-master-SNAPSHOT that I built with the patch. |
| 11:12 | goracio | i thought we cann't a=a+2 in clojure but it appears we can ) |
| 11:12 | clgv | goracio: `a` is a symbol that is resolved to the variable you defined with the `(def a ...)` statement (provided you are in the samenamspace or imported the definition namespace in your current namespace) |
| 11:12 | andyfingerhut | clgv: Thanks for the help. Gotta go run to the day job now. |
| 11:13 | clgv | goracio: well, you redefine the variable `a` with the value of its previous definition altered by 2 |
| 11:13 | clgv | andyfingerhut: no problem. good day |
| 11:13 | goracio | clgv: a = a+2 also redefines a with previous a |
| 11:14 | clgv | goracio: so what is your question/problem? variables and namespaces in clojure are indeed mutable |
| 11:15 | goracio | clgv: take Erlang there Y= 1 we defined Y and we cann't redefine it Y=Y+1 is not valid |
| 11:16 | clgv | goracio: ok. but what is your clojure related problem? you want to forbid (def a 1) (def a (inc a)) ? which means forbidding variable redefinition? |
| 11:16 | goracio | clgv: problem how we can prove that a is immutable ) |
| 11:16 | clgv | goracio: you can't |
| 11:17 | clgv | goracio: you could use (def ^:const a 2) - but that does not work for all righthandside expressions |
| 11:17 | goracio | clgv: that's pretty strange |
| 11:18 | clgv | goracio: why? clojure does not promise that variables or namespace mappings are imutable |
| 11:18 | clgv | goracio: it promises that values of its standard datatypes are imutable (lists, vectors, sets, maps ...) |
| 11:19 | goracio | clgv: i see then |
| 11:19 | goracio | clgv: Erlang is more immutable then Clojure then )) |
| 11:20 | clgv | goracio: I dont know how Erlang manages namespaces so I cannot agree on that ;) |
| 11:20 | Wild_Cat | goracio: Clojure supports mutable datatypes anyway, so... |
| 11:20 | antares_ | goracio: in a way, yes. Erlang can do that because everything is built around message passing, though. Take a look at http://clojure-doc.org/articles/language/concurrency_and_parallelism.html |
| 11:21 | clgv | goracio: additionally, if you find yourself code that looks like "(def a 1) (def a (+ a 2)" your doing something pretty wrong. |
| 11:21 | clgv | *writing code |
| 11:21 | clgv | *you are^^ |
| 11:21 | matthavener | doesn't erlang only allow two copies of a module in memory at a given time? |
| 11:21 | goracio | clgv: that was just for example ) |
| 11:21 | clgv | where did my spellchecker go after launch? |
| 11:22 | matthavener | and jvm allows more than that afaik |
| 11:22 | clgv | goracioa: yeah, mine was an example as well. if you program in a similar way like the above. you are doing something wrong |
| 11:25 | TimMc | goracio: Why do you keep putting closing parens at the end of your sentences? |
| 11:27 | goracio | TimMc: habbit |
| 11:28 | goracio | TimMc: from chats |
| 11:28 | clgv | could be a lisp infection ;) |
| 11:33 | pepijndevos | What could be going on here? In aleph, I siphon stuff into other stuff, but the second time it doesn't work. Step one: find acurate problem description. |
| 11:37 | pbostrom | pepijndevos: maybe paste some code to refheap too |
| 11:38 | pepijndevos | pbostrom: step 2, don't hurry… :) |
| 11:38 | pepijndevos | having a ton of fun with the vis part of lamina. |
| 11:38 | pbostrom | pepijndevos: worth looking into as well, the visualization stuff built in to lamina, very useful in debugging |
| 11:39 | pbostrom | (view-graph ch) |
| 11:39 | pepijndevos | pbostrom: just what I said. very nice and a lot of fun |
| 11:39 | pepijndevos | but not very helpful so far |
| 11:39 | ravster | I'm trying to learn tools.logging. I'm using the example that they have in their readme. Where do I set the location for the logs? |
| 11:40 | clgv | ravster: e.g. in the log4j.properties file - sadly the have no built-in config-function |
| 11:41 | clgv | ravster; provided you use log4j with tools.logging - it supports other logging libs as well |
| 11:41 | ravster | when I do a (divide 2 0) I just get a nil and thats it. No other output. |
| 11:41 | ravster | yup, using log4j, clgv |
| 11:41 | pepijndevos | pbostrom: okay, here you go. |
| 11:41 | pepijndevos | https://www.refheap.com/paste/11662#L-40 |
| 11:41 | pandeiro | ,(let [c (atom (java.util.Calendar/getInstance))] (swap! c #(.add % java.util.Calendar/DATE 1)) @c) |
| 11:41 | clojurebot | nil |
| 11:41 | clgv | ,(divide 2 0) |
| 11:41 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: divide in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 11:42 | clgv | ravster: what is the definition of `divide`? |
| 11:42 | pandeiro | ah i see what i did wrong |
| 11:42 | pepijndevos | pbostrom: the problem seems to be that the second time around, the siphone a t line 40 doesn't work. If I trace a message from server-out, it only goes to println and keep-alive, not to client. |
| 11:43 | clgv | pepijndevos: hidden exceptions in other threads cause behavior like you described. I ran against this wall several times already |
| 11:43 | pandeiro | ,(let [c (atom (java.util.Calendar/getInstance))] (swap! c #(do (.add % java.util.Calendar/DATE 1) %)) @c) |
| 11:43 | clojurebot | #inst "2013-02-23T16:44:23.468+00:00" |
| 11:43 | ravster | the exact same as in the readme for tools.logging. Decided that I might as well do it with a working example. https://github.com/clojure/tools.logging#usage |
| 11:43 | pepijndevos | clgv: oh, what do you do about something like that? |
| 11:44 | clgv | pepijndevos: I was lucky that I had the thready in control, when using a threadpool I could wrap the submission into try-catch to find those exceptions |
| 11:44 | pepijndevos | clgv: I have just one thread, and the one aleph uses presumably. |
| 11:44 | clgv | *threads |
| 11:45 | ravster | clgv: oh, its supposed to print it out to the console, so its not showing in nrepl |
| 11:45 | clgv | pepijndevos: I dont know how things with aleph are |
| 11:46 | clgv | ravster: ah ok. yeah it logs it as error and returns nil |
| 11:47 | clgv | ravster: if you have no log4j.properties file, you'll get a warning on first logging attempt and thus nothing will be logged |
| 11:47 | clgv | ravster: the config given in the readme is a console appender. there is a fileappender as well. |
| 11:49 | clgv | ravster: try this configuration https://www.refheap.com/paste/11664 |
| 11:49 | ravster | clgv: should I be using log4j 2 instead? |
| 11:49 | ravster | their website seems to be 2.0 oriented. |
| 11:50 | clgv | ravster; I use those dependencies [org.clojure/tools.logging "0.2.4"] [org.slf4j/slf4j-api "1.6.1"] [org.slf4j/slf4j-log4j12 "1.6.1"] |
| 11:50 | clgv | seems I missed two minor releases |
| 11:51 | clgv | ah no, just one +2 |
| 11:55 | ravster | k, I'll install the slf4j stuff. I don't need to get the log4j package then? |
| 11:55 | pepijndevos | clgv, pbostrom: I can't find any exception. I can manually run the siphon command, and it'll just silently fail, it seems. |
| 11:56 | pepijndevos | (siphon server-out @cl) (view-graph server-out) -> no sign of @cl |
| 11:56 | seangrove | ibdknox: Is there some way to disable connection pooling in korma? |
| 11:56 | clgv | ravster: I do not have it as dependency |
| 11:56 | clgv | ravster: and loggign works. I used it to debug my remote applications a lot ;) |
| 11:56 | gfredericks | seangrove: I think if you create the db map yourself you can |
| 11:57 | gfredericks | check the return value from the connection info fn you're using |
| 11:57 | gfredericks | there's probably a :use-pool? key in there or something |
| 11:57 | seangrove | gfredericks: I'll check it now... |
| 12:00 | clgv | ravster: 1.7.2 seems to be the newes slf4j-* version |
| 12:02 | ravster | clgv: Have you tried clj-logging-config? |
| 12:03 | clgv | ravster: I did not know of that lib until now. I wrote my own function to configure log4j programmatically |
| 12:03 | ravster | okay |
| 12:04 | seangrove | Is there a way to find out what methods an object responds to? I'm trying to get the database connection that Korma uses to connect directly |
| 12:05 | clgv | ravster: the readme looks good though |
| 12:05 | ravster | I'm going to try your slf4j stuff first, and see if I get it. |
| 12:08 | seangrove | I'd like to automatically include all of the information from http://us5.api.mailchimp.com/1.3/ in my Mailchimp wrapper https://github.com/cloudfuji/chinpu |
| 12:08 | seangrove | Curious to know if there's an easy way to do this short of copy/pasting everything over |
| 12:11 | ravster | clgv: Hey, your system worked for me. Thanks. I found the log file in the root of the project. |
| 12:11 | ravster | clgv: thanks |
| 12:11 | ohpauleez | seangrove: Use a screen scraper? |
| 12:12 | clgv | ravster: no problem. but you could try to use clj-logging-config if you do not like the properties file. the lib's readme looks promising |
| 12:12 | pepijndevos | This is crazy! the output channel is fine. The input channel is fine. When I siphone the one to the other, nothing comes out of the output. |
| 12:12 | ravster | and the log4j.properties file should just be under the src dir, right? |
| 12:13 | clgv | ravster: you will need to include the properties file in any jar you build (e.g. put it in "resources" in a leiningen project) |
| 12:13 | frozenlock | Well.. I just realized how silly it was on my part to 'not' use print-table. This is amazing to analyse maps! |
| 12:13 | ravster | oh, okay. thats a good idea. I should make better use of the "resources/" dir. |
| 12:14 | clgv | pepijndevos: you should call a plumber ;) |
| 12:14 | pepijndevos | clgv: you know a good one? |
| 12:14 | clgv | pepijndevos: not in your area, I guess^^ |
| 12:14 | pepijndevos | too bad |
| 12:15 | pepijndevos | I guess the out channel just doesn't like being siphoned |
| 12:15 | pepijndevos | I made a new channel, and that didn;t work either |
| 12:16 | pepijndevos | there is a grey box in the graph as well that bothers me. |
| 12:17 | pepijndevos | maybe the client channel turns into a ghost and haunts me after I close the connection |
| 12:21 | pepijndevos | okay, that is indeed the closed channel. But since this is a permanent-channel, it shouldn't matter. |
| 12:22 | clgv | pepijndevos: do you use aleph for usual program communication or for browser-server-communication? |
| 12:23 | pepijndevos | clgv: no browser is involved. Not sure if it's usual. I'm writing an IRC bouncer. |
| 12:24 | pepijndevos | I thought I'd just siphone everything into everything and it'd work. |
| 12:24 | pepijndevos | It sortof does I guess, except the second time you connect the output from the server is not siphoned back to the client. |
| 12:31 | pbostrom | pepijndevos: sorry to leave you hanging, I'll try to look at this a little later |
| 12:32 | pepijndevos | pbostrom: ok, I'm trying to reproduce it with a minimal test case, and failing so far. |
| 12:35 | muhoo | got piggieback working!! {:dependencies [[com.cemerick/piggieback "0.0.3-SNAPSHOT" |
| 12:35 | muhoo | :exclusions [org.clojure/google-closure-library-third-party]] |
| 12:35 | muhoo | [cljsbuild "0.3.0"]] |
| 12:35 | muhoo | :repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]} |
| 12:35 | muhoo | gah |
| 12:35 | muhoo | https://www.refheap.com/paste/11667 was supposed to be this |
| 12:36 | muhoo | the essential part is: it was *required* to add cljsbuild as an explicit dependency, otherwise, no piggieback. whatever magick is in cljsbuild, piggieback must have it. and now i have a working cljs in nrepl.el! |
| 12:38 | dnolen | muhoo: nice! |
| 12:50 | muhoo | heh, that is one massive freakin hairball. but it works https://www.refheap.com/paste/11668 |
| 12:54 | pepijndevos | I can't reproduce the greyed out graph block. When I make myself a permanent channel, siphon some stuff and close that, I get no gray box in the permanent's graph, like in my real code. |
| 13:00 | pepijndevos | reproducified! |
| 13:03 | callenbot | Raynes: thank for the font changes. I'll take a look. Also I'll look into Helium. |
| 13:07 | Bodil | muhoo: Any special reason you're using the 0.0.3 snapshot version of Piggieback? |
| 13:07 | pepijndevos | If any lamina export cares to try this: https://www.refheap.com/paste/11669 |
| 13:08 | muhoo | Bodil: i ended up there as part of the thrash. can try it with 0.2.0, i suspect that'll work too. |
| 13:08 | Bodil | muhoo: Ah, OK, was just wondering if there were features I'm missing out on. :) |
| 13:09 | muhoo | according to git, some bugfixes, IIRC |
| 13:12 | pepijndevos | $mail pbostrom seems to have to do with fork. https://www.refheap.com/paste/11669 |
| 13:12 | lazybot | Message saved. |
| 13:17 | pepijndevos | lamina is too magic |
| 13:21 | Bodil | If I want to do unit testing in Clojurescript, do I have any options other than Prismatic's cljs-test and that weird stuff in Clojurescript One? |
| 13:21 | Bodil | Because if that's it, I'm about to write a test framework of my own... |
| 13:22 | kencausey | Will Midje just not work on cljs? |
| 13:22 | Bodil | Never tried - can't really imagine it'll cross compile. |
| 13:23 | kencausey | I would at least try |
| 13:23 | technomancy | I'd rather write my own |
| 13:23 | kencausey | Brian Marick seems to be active right now and I suspect would be happy to help if it doesn't work. |
| 13:24 | tomoj | Bodil: please write one :) |
| 13:24 | tomoj | I half-ported clojure.test to cljs |
| 13:24 | technomancy | clojure.test relies fairly heavily on vars IIRC |
| 13:24 | Bodil | It won't run on Cljs without somebody porting it. And I'm not a Midje fan, I'd prefer something more like clojure.test tbh... |
| 13:24 | tomoj | but not released |
| 13:25 | Bodil | tomoj: Any useful code I could borrow? |
| 13:25 | muhoo | there's some stuff in phantomjs for cljs testing, IIRC, but i don't remember th details |
| 13:25 | muhoo | maybe in cljsbuild docs, i saw this mentioned? fuzzy. |
| 13:26 | Bodil | muhoo: That's just for running tests on Phantom, not writing them. |
| 13:27 | tomoj | Bodil: https://github.com/tomjack/cljs-test |
| 13:27 | tomoj | I don't remember what state it's in |
| 13:27 | tomoj | sorry for the git-deps too :( |
| 13:28 | tomoj | you can at least see the changes I made to clojure.test in the history for inspiration :) |
| 13:28 | tomoj | ..or, at the very least, to see what not to do |
| 13:29 | Bodil | tomoj: Ah, so you were porting the test runner, not the assertion stuff? I was hoping you'd done the is macro. :) |
| 13:29 | Bodil | tomoj: I need something that supports async testing, so I can't reuse the test runner. |
| 13:30 | tomoj | yeah, that's where I stopped |
| 13:30 | tomoj | I pretty much just copied the is macro directly |
| 13:31 | Bodil | Oh, wait, that probably doesn't need much porting, does it? |
| 13:32 | tomoj | hmm |
| 13:33 | tomoj | it looks like I didn't give thrown? a try* version |
| 13:33 | tomoj | but I thought I remembered doing that |
| 13:38 | tomoj | oh, it looks like I didn't even excise the var problems, either? I'm guessing this was my second attempt and I hadn't gotten there yet |
| 13:41 | tomoj | and apparently my first attempt was so bad I deleted it |
| 13:41 | Bodil | tomoj: I get the feeling maybe clojure.test for Cljs isn't a great idea after all :) |
| 13:42 | tomoj | I'd still like something analogous, even if it needs to change too much to be just a port |
| 13:43 | tomoj | ..which means `is` I guess ? |
| 13:44 | Bodil | That's my favourite assertion ever, so I'm not giving up on it. :) |
| 13:50 | dnolen | Bodil: a real cljs.test would be awesome |
| 13:54 | Bodil | dnolen: Guess I'll see what I can do :) |
| 14:02 | dnolen | Bodil: I wouldn't be against the minor changes to the compiler to support running tests - the way ClojureScript tests are done leaves much to be desired. |
| 14:03 | dnolen | Bodil: it's really (run-tests ...) that needs help from the compiler. I'm also interested in enough support so that lein cljsbuild can easily hook into it. |
| 14:06 | pppppaul | i'm getting into clojure concurrency stuff now, and i was wondering if anyone could point me in the direction of how to do a good/idiomatic timeout loop in clojure |
| 14:06 | pppppaul | :D |
| 14:06 | antares_ | pppppaul: timeout loop? |
| 14:07 | Bodil | dnolen: I suspect that's all just implementation details. |
| 14:07 | pppppaul | hmmm... every few seconds i want to try to reconnect to a server |
| 14:07 | pppppaul | antagon, |
| 14:08 | pppppaul | antares_, |
| 14:08 | dnolen | Bodil: yes, I'm just saying if you're going to tackle cljs.test, I'd more than happy to get that into CLJS so everyone can benefit. |
| 14:10 | antares_ | pppppaul: I use scheduled executors in the JDK for that: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newSingleThreadScheduledExecutor(). You then can submit Clojure functions to them. |
| 14:10 | antares_ | they implement all the interfaces executors expect |
| 14:11 | antares_ | a very naive version can be impemented with an endless loop + sleeping in a thread, but you won't be able to cancel it gracefully |
| 14:12 | Bodil | dnolen: I'm going to tackle some kind of testing framework, at least... let's see how well that turns out before we go calling it cljs.test or anything. :) |
| 14:12 | pppppaul | i sorta want to stay away from threads... i have a single thread in my program right now and it's really taking more of my time to manage/debug that than i desire |
| 14:13 | mpenet | pppppaul: shameless plug: I wrote a lib that wraps that stuff https://github.com/mpenet/knit , I use it to do exactly what you describe in another lib |
| 14:13 | pppppaul | mpenet, going to check it out |
| 14:14 | pppppaul | also, if anyone here has experience working with rabbitmq + clojure i would be very interested in having a chat. i'm having a lot of trouble dealing with exception handling/recovery with langohr |
| 14:14 | alandipert | dnolen: is the compiler support needed for tests you envision enough of a dynamic ns system? |
| 14:15 | antares_ | pppppaul: yeah, exception handling in the Java client does not make it easy to recover. Langohr currently does not provide any solution. |
| 14:15 | antares_ | it took some time to design in a few other clients, too |
| 14:16 | pppppaul | i want to cry |
| 14:17 | TimMc | pppppaul: I think your nick has gained weight. |
| 14:17 | pppppaul | antares_, if you have any examples of simple error recovery (losing a connection to rabbitmq or anything) i would be greateful to take a look |
| 14:18 | pppppaul | TimMc, sometimes the 'p's grow... they are beyond my control |
| 14:18 | antares_ | pppppaul: if there was a good demonstrative example, I'd have put it to the langohr docs already |
| 14:18 | pppppaul | antares_, crap |
| 14:21 | pppppaul | i thought that agents or some other clojure concurrency construct would be a good fit for rabbit... do you think it would be easy or hard to implement a consumer with one? right now my main problem is that when an exception occurs my thread dies. |
| 14:22 | antares_ | pppppaul: you can send-off incoming messages to an agent |
| 14:22 | antares_ | pppppaul: but error handling has to happen in the consumer object langohr reifies for you |
| 14:23 | antares_ | pppppaul: because in Langohr queue names and such are strings and not objects, recovery will include recovering the connection, then channels and consumers |
| 14:23 | dnolen | alandipert: no not general enough for that, just hooking into the analyzers namespaces atom with holds all the defs |
| 14:24 | antares_ | and there is only so much we can do without wrapping key Java client classes or submitting changes to the Java client |
| 14:24 | dnolen | alandipert: I don't think dynamic namespaces will happen before the compiler can bootsrap itself. |
| 14:24 | dnolen | Bodil: gotcha :) |
| 14:24 | antares_ | maybe I'll sit down to try out a couple of ideas this weekend |
| 14:25 | pppppaul | antares_, currently i have channel and connection recover code (us atoms and reset!), i don't have consumer stuff ready... i think it may be a bit harder, going to have to make an atom or something for that as well |
| 14:25 | antares_ | pppppaul: feel free to post what you have in mind to the clojure-rabbitmq mailing list |
| 14:26 | antares_ | using an atom for channels should be fine |
| 14:26 | antares_ | I agree with you that consumer recovery is the hardest part |
| 14:26 | tomoj | oh, I found my attempt to remove var stuff from clojure.test |
| 14:26 | pppppaul | my situation is very easy to deal with, though. i have 1 channel, 1 connection, and 1 consumer... |
| 14:27 | pppppaul | i'm really leaning on moving to storm |
| 14:27 | alandipert | dnolen: sounds reasonable |
| 14:28 | tomoj | there are atoms in a macro ns holding a map of symbols to test functions |
| 14:28 | tomoj | but you can just use the analyzer instead? |
| 14:29 | antares_ | pppppaul: storm is a pretty different beast. You can try messaging in https://github.com/ptaoussanis/carmine if your needs are very small. |
| 14:30 | alandipert | dnolen: apropos nothing, and not having researched myself, would pluggable analyzer mean pluggable syntax fronts in cljsc? |
| 14:33 | pppppaul | antares_, i would like to be enlightened about the tradeoffs of storm. |
| 14:34 | antares_ | pppppaul: it's just a very different system. Not a messaging solution, even if it does messaging internally. |
| 14:34 | pppppaul | well... i'm actually using rabbit messages for job processing |
| 14:35 | pppppaul | so... that's actually why i'm interested in storm |
| 14:35 | pppppaul | i'm not really taking advantage of rabbitmq at all |
| 14:38 | jweiss | Raynes: amalloy_ any hints on getting lazybot to reconnect automatically? i run him on my corporate irc server, and he occasionally loses the connection. the log file shows him continuously pinging himself. maybe get him to give up after x failed pings and start a new connection? |
| 14:39 | Raynes | jweiss: There is not mechanism for that. It need to be added to the new Irclj and lazybot needs to actually use the new Irclj (and someone needs to finish the new Irclj). |
| 14:39 | Raynes | s/not/no* |
| 14:40 | TimMc | Raynes: Did that clojail bug I found get fixed yet? If not, need help? |
| 14:40 | jweiss | Raynes: ok thanks |
| 14:40 | Raynes | TimMc: I don't actually remember the bug. If you want to take a shot at fixing it, by all means be my guest. |
| 14:41 | Raynes | TimMc: I always need help. |
| 14:41 | TimMc | Raynes: Is github up to date enough to do meaningful work? |
| 14:41 | Raynes | Yep. |
| 14:45 | antares_ | Raynes: now that you are in LA, ever thought of directing a movie called Resident Eval with clojurebot as the main character? |
| 14:46 | Raynes | Heh. |
| 14:47 | ravster | hello all |
| 14:49 | antares_ | hi ravster |
| 14:50 | antares_ | pppppaul: by the way, by all means I and the rabbitmq team understand that ease of recovery is a problem. It just takes a while to design that, so far we are done with 2 clients out of… many. |
| 15:02 | ohpauleez | Bodil: ping |
| 15:03 | Bodil | ohpauleez: PONG |
| 15:04 | ohpauleez | Girl! what's going on?! - two things: are you going to be at ClojureWest, can you link me to your clojail file again? I can't seem to find it on github |
| 15:06 | Bodil | ohpauleez: One: I'm supposed to be presenting there, so it's either that or make Alex mad at me. Two: https://github.com/bodil/thefutureisclojure/blob/master/src/server.clj |
| 15:06 | ohpauleez | Bodil: One: excellent. Two: thanks! |
| 15:07 | ohpauleez | first thing in the morning? excellent |
| 15:07 | ohpauleez | haha |
| 15:10 | Bodil | ohpauleez: Protip: never tell Alex not to put you at the end of the day because you're going to be jetlagged. He takes things too literally. :P |
| 15:10 | ohpauleez | haha |
| 15:11 | ibdknox | Bodil: at least you'll get it done early and have the rest of the day to relax :) |
| 15:12 | Bodil | ibdknox: Good point. I guess you should know after the Conj too :) |
| 15:13 | pbostrom | ohpauleez: FYI, if you want to use def with your clojail, be sure to grab the very latest, 1.0.4, I patched an issue with that a couple days ago |
| 15:13 | technomancy | being the last presenter sucks |
| 15:13 | technomancy | unless you are samaaron |
| 15:13 | ibdknox | it really does |
| 15:14 | ohpauleez | pbostrom: Thanks for the heads! |
| 15:14 | ohpauleez | technomancy: truth |
| 15:14 | ibdknox | technomancy: I think that is still my favorite clojure presentation so far |
| 15:14 | muhoo | hmm https://www.refheap.com/paste/11677 Cannot call method 'setParameterValue' of undefined main-dev.js:27591 |
| 15:14 | Bodil | lol |
| 15:14 | ibdknox | such a fun guy |
| 15:15 | ohpauleez | I imagine the first time I commit a major crime, will come from an evening of drinking with Sam Aaron |
| 15:15 | TimMc | technomancy: 2nd time slot is best. |
| 15:15 | TimMc | Early enough that people are awake, but you're not the first to try out the A/V tech. |
| 15:15 | ohpauleez | one thing will lead to another, someone will startup overtone |
| 15:15 | ohpauleez | and then bam, we're robbing a bank |
| 15:15 | muhoo | musicians, we know how to party |
| 15:16 | ohpauleez | agreed |
| 15:16 | ibdknox | I tended to pick the first slot if I could |
| 15:16 | ohpauleez | because you're a baller |
| 15:16 | ohpauleez | we get it ibdknox :) |
| 15:16 | Bodil | First slot is keynote slot :) |
| 15:16 | bbloom | ibdknox: so that people aren't awake enough to know if what you're saying actually makes sense? :-) |
| 15:16 | ibdknox | bbloom: it's the best cover |
| 15:17 | ohpauleez | hahs |
| 15:17 | ibdknox | bbloom: make some hand motions, point at some fullscreen pictures |
| 15:17 | ibdknox | no one's the wiser |
| 15:17 | ibdknox | worst presentation I ever gave was in Poland |
| 15:17 | ibdknox | such a disaster |
| 15:18 | ibdknox | and it was entirely my fault lol |
| 15:18 | ohpauleez | mostly because you realized you didn't know polish |
| 15:18 | ibdknox | and I didn't know it was a keynote! |
| 15:18 | jweiss | anyone know how to get a full stack trace on "OutOfMemoryError: Java heap space"? the bottom line of mine is at clojure.core$fn__5290.invoke(core_print.clj:191). clearly that is not the lowest stack frame. |
| 15:18 | ohpauleez | damn |
| 15:18 | ibdknox | they told me on the plane ride over |
| 15:18 | ibdknox | I had 3 presentations in 1.5 days |
| 15:19 | jaen | Wow, I wasn't aware there were any Clojure presentations in the backward nation of Poland ; p |
| 15:19 | ibdknox | and like an idiot I didn't give myself enough time to arrive early and adjust |
| 15:19 | ibdknox | jaen: I was with Microsoft |
| 15:19 | muhoo | so why would peerUri be undefined? |
| 15:19 | cemerick | ibdknox: s/clojure presentation/presentation/ ftfy :-) |
| 15:19 | brainproxy | any good examples of using clojure to dynamically generate QR code PNGs with the zxing lib? |
| 15:19 | ibdknox | cemerick: haha :) |
| 15:20 | TimMc | ibdknox: Wow, Microsoft was using Clojure? :-P |
| 15:20 | ibdknox | lol |
| 15:20 | ibdknox | ass. |
| 15:20 | jaen | ibdknox: so it wasn't Clojure presentation then? |
| 15:20 | jaen | Oh well ; d |
| 15:20 | ibdknox | jaen: yeah, I was the PM for C# and VB |
| 15:20 | ibdknox | so no Clojure unfortunately |
| 15:20 | jaen | Noone talks about interesting languages here... |
| 15:20 | TimMc | jaen: I dunno, Polish is an interesting language. |
| 15:20 | jaen | ibdknox: oh, I see. |
| 15:21 | jaen | TimMc: I see what you did there... ; p |
| 15:21 | jaen | It's pretty okay as far as languages go |
| 15:21 | muhoo | too many consonants |
| 15:21 | ibdknox | I remember being astounded by how many beautiful people were in Warsaw |
| 15:21 | jaen | But still, I'd prefer if people didn't laugh at me when I go like Clojure, Scala or Haskell |
| 15:21 | TimMc | muhoo: *Tricky* consonants. |
| 15:22 | muhoo | though the czechs have the market cornered on consonants, IIRC |
| 15:22 | jaen | Because dude, C++ or Java is what real men use |
| 15:22 | jaen | Duh |
| 15:22 | TimMc | You think that's just an L with a stroke through it, but noooo... |
| 15:22 | ibdknox | jaen: yeah, when I was there it seemed like EVERYONE was C++ |
| 15:22 | ibdknox | managed was considered a joke |
| 15:23 | muhoo | in _, garbage collects you! |
| 15:23 | jaen | ibdknox: yeah, people in Poland tend to boast that we the nicest girls in quite a radius |
| 15:23 | jaen | Well |
| 15:23 | jaen | The CS curriculum where I study goes like 1 sem Pascal, 1 sem C, 2 sem C++, 1 sem Java |
| 15:23 | jaen | And that's it |
| 15:23 | muhoo | this madness must stop |
| 15:24 | muhoo | teach haskell for CS101 |
| 15:24 | Bodil | jaen: I kind of prefer that to Norway's 6 sem Java and that's it... |
| 15:24 | jaen | Bodil: ok, fair point |
| 15:24 | jasonbray | interoping with a javascript function that takes an array of maps (like a named argument constructor) - I assume you can't just pass in a cljs array of maps.. is there an idiomatic approach? |
| 15:24 | jaen | And I have this tendency to troll the teachers with uncommon languages |
| 15:24 | jaen | Though I was a bit bummed |
| 15:24 | jaen | When I wrote my algorithms article in Haskell |
| 15:25 | Bodil | jasonbray: (clj->js) |
| 15:25 | jaen | And after I asked if the professor noticed any interesting languages, he was like "oh, yeah, someone had examples in python" ; / |
| 15:25 | muhoo | ok, that's weird. cljs is not creating the browser repl iframe |
| 15:26 | jasonbray | bodil: thanks |
| 15:26 | muhoo | so when it tries to clojure.browser.repl/connect, there's no there there |
| 15:26 | jaen | muhoo: I dunno about Haskell, but I really liked how SICP approached it and thusly I'm of mindset that if you don't start CS education with C or LISP, you're probably doinf it wrong. |
| 15:26 | nuclearsandwich | jaen Majority California is Java and maybe some scheme. It's a bigger issue. :( |
| 15:26 | nuclearsandwich | Majority of California, even |
| 15:26 | pepijndevos | pbostrom: I filled a bug in lamina: https://github.com/ztellman/lamina/issues/58 |
| 15:27 | pendlepants | can someone explain to me what's going on in this gist? https://gist.github.com/zachpendleton/19eaa46bbeaed82913d0 |
| 15:27 | borkdude | Java is very dominant in education somehow |
| 15:27 | pendlepants | I'd expect each function to be called once, but it looks like `two` is being called twice. |
| 15:27 | ibdknox | The few classes I took were all in Java as well at UNC |
| 15:27 | drewc | jaen: Even better would be Lisp, which is past LISP 1.5 ;) (and not capitalized:)) |
| 15:27 | nuclearsandwich | borkdude $$$ |
| 15:28 | muhoo | i'm at a disadvantage having been self-taught C (linux), web stuff (js, php, sql) and lisp/scheme, and now clojure, and knowing very little java. and all the work out there seems to be java, and all the real-world things i want to do using clojure involve massive gobs of java library cruft |
| 15:28 | pbostrom | pepijndevos: cool, you can also hit up the aleph mailing list, zach is pretty responsive there too |
| 15:28 | borkdude | nuclearsandwich how did it come about that Java relates to $$$? |
| 15:28 | jaen | I don't understand why Java is so dominant in education |
| 15:29 | nuclearsandwich | muhoo I wouldn't consider being self taught a disadvantage. Especially if you're teaching yourself formal CS along with programming |
| 15:29 | jaen | About every other language |
| 15:29 | jaen | Give you more to learn about programming |
| 15:29 | jaen | *Gives |
| 15:29 | Bodil | jaen: It's because it's dominant in the job market. |
| 15:29 | pepijndevos | pbostrom: maybe I will do that if he doesn't respond to the issue |
| 15:29 | muhoo | nuclearsandwich: i agree. i really feel the pain now since learning clojure |
| 15:29 | Bodil | jaen: Which it is because it's dominant in education. And so on. |
| 15:29 | jaen | Bodil: Figures, but it's so, so sad |
| 15:29 | nuclearsandwich | borkdude: Sun put a lot of marketing money into making java seem like the perfect language for learning to program and cashed in on the OOP will change everything about CS fad |
| 15:29 | borkdude | Java takes the fun out of programming, but this is my personal opinion |
| 15:30 | drewc | muhoo: I consider that an advanatage, save for php being 'web stuff' when IMO is <not-so-good> stuff :P But I am a self taught software developer ... who works primarily in Lisp |
| 15:30 | pppppaul | muhoo, wrap that java |
| 15:30 | jaen | I worked for a year in Rails and then I was like, why not see how does Java fare, it can't be that dreadful I guess |
| 15:30 | nuclearsandwich | borkdude: my issue with java is that it 60%s everything. It's not fully committed to anything, efficiency, OOP, anything |
| 15:30 | jaen | So I got a Java job |
| 15:30 | ibdknox | muhoo: I'm self taught :) |
| 15:31 | jaen | And this whole week was wasted on trying to deploy a liferay project and repeatedly failing |
| 15:31 | jaen | So I don't get why Java is so popular in the job market |
| 15:31 | Bodil | jaen: Consultants usually bill by the hour. ;) |
| 15:31 | muhoo | ibdknox: well, but the IB in ibdknox may have given you a head start |
| 15:31 | pppppaul | java is popular because all universities teach it |
| 15:31 | drewr | jaen: it's all schools taught for years |
| 15:31 | nuclearsandwich | Bodil: hahah |
| 15:31 | jaen | Must be some sort of inertia I guess... ; / |
| 15:32 | borkdude | pppppaul the question is, why did universities start to teach it |
| 15:32 | ibdknox | muhoo: not in terms of programming, I didn't think there even was an IB CS course |
| 15:32 | pppppaul | java was once the new shit |
| 15:32 | pppppaul | now universities are doing nodejs and other crap |
| 15:32 | drewc | borkdude: because universities do not teach software development but programming, and that is a widely used programming language? |
| 15:32 | pppppaul | they once did smalltalk too |
| 15:33 | muhoo | sometime in the 90s it seems like universities got turned into trade schools |
| 15:33 | jaen | pppppaul: really? what universities do node? |
| 15:33 | muhoo | and corporations said "we want Java!" and uni's obliged |
| 15:33 | drewr | borkdude: because it was easier than C++, and the promise of write-once-run-anywhere |
| 15:33 | Wild_Cat | also, Java has a cleaner design than C++ |
| 15:33 | pppppaul | jean, i dono because i don't care about universities cept for MIT. i've heard at least one doing nodejs in the usa |
| 15:33 | Wild_Cat | (although not as clean as a teaching language should be) |
| 15:33 | nuclearsandwich | drewc universities claim to teach SE, whhen all they know is CS. So you get a crappy education in both CS and SE |
| 15:33 | ibdknox | Java is *much* easier to teach theory with than C++ is |
| 15:34 | borkdude | ibdknox I agree on that. |
| 15:34 | nuclearsandwich | instead of a thorough grounding in CS that lets you build your own SE career if you want |
| 15:34 | nuclearsandwich | at least that's my observation, as I enter my 7th year as a Math/CS undergrad |
| 15:34 | Wild_Cat | yeah. It's hard to teach beginners about algorithms when before doing anything you have to grasp pointers and manual memory management. |
| 15:34 | ibdknox | yep |
| 15:34 | borkdude | I think a first programming language should have a REPL nowadays |
| 15:34 | jaen | Well, maybe Java has a clean design, but by the virtue of not doing almost anythin at all ; / |
| 15:34 | Bodil | "At least it's better than C++" actually sold this? |
| 15:34 | Wild_Cat | they get bogged down in the unnecessary details. |
| 15:34 | drewr | drewc: how do you like Clojure compared to CL? I don't see very many converts. CL isn't lacking any power it seems. |
| 15:35 | nuclearsandwich | Wild_Cat: I dunno, I had a much easier time groking data structures in C than Java because I understood how it all translated to assembly. Whereas java requires you to know jvm semantics |
| 15:35 | Wild_Cat | jaen: that's the thing -- it tries very had to be foolproof. It does so by aiming for blandness and mediocrity, but it mostly succeeds. |
| 15:35 | drewc | nuclearsandwich: I have to agree with you there 100% ... I actually do want to go back to uni for CS, simply because I have been asked to and will be a proff as well as a student, but also do not want to take SE because I know more about the then the proffs do. |
| 15:35 | ibdknox | nuclearsandwich: that's only true because you had some grounding in assembly |
| 15:35 | ibdknox | most don't |
| 15:35 | muhoo | i remember java was sold back in the day as "C++ without memory allocation nightmares", and "write once, run everywhere!" and such hype |
| 15:36 | nuclearsandwich | ibdknox: that's fair. I learned assembly when I was a kid. All the actually programming didn't come until later. |
| 15:36 | Wild_Cat | muhoo: a lot of it is true. At the very least, Java brought automatic memory management into the mainstream, and for that it deserves praise. |
| 15:36 | nuclearsandwich | drewc choose your uni carefully |
| 15:36 | pbostrom | yeah "write once, run anywhere" was a big selling point in the beginning |
| 15:36 | nuclearsandwich | It matters a ton rightnow. |
| 15:36 | jaen | Wild_Cat: It's a point about algorithms being hard to teach when chasing pointers (that's for example why I used Haskell to write the article for the algorithms course), but a programmer has to at some point learn about how the computer really works. And going Java only hardly helps in that regard. |
| 15:37 | Wild_Cat | jaen: you can learn how the metal works once you grasp the basics of data structures and algorithms. |
| 15:37 | borkdude | I remember writing my first Java program. I thought it was very verbose and slow to start. I never looked at Java gain until uni |
| 15:37 | Wild_Cat | jaen: it's easier than being forced to learn both at once as a perfect noob |
| 15:37 | drewc | drewr: well, what comparison are you looking for? I 'like' some things, and there are many things that I do not like and will not use... and compared to CL, well, please show me mutiple implementations that follow that same standard :) |
| 15:37 | Wild_Cat | because frankly, they're orthogonal. |
| 15:37 | muhoo | in the case of java, it is so popular with corporations because it mirrors the structur of them |
| 15:37 | borkdude | my colleagues are very keen on keep using Java in education |
| 15:37 | jaen | That's why I would prefer a Scheme + C combo for CS introduction with them being taught one after other |
| 15:38 | borkdude | I don't know why - maybe they just hate learning other languages |
| 15:38 | jaen | Wild_Cat: it's a point, but I see a lot of people not caring about close to the metal |
| 15:38 | Wild_Cat | jaen: note that I agree with you that *at some point*, one has to learn C. |
| 15:38 | drewc | nuclearsandwich: well, one of my friends is a prof at the local University, and we agree on a number of things and I actually own his book ... so likely there :) |
| 15:38 | jaen | Once they learn about GCs and such |
| 15:38 | muhoo | it's bureaucratic, and heirarchal, just like a corporation. |
| 15:38 | nuclearsandwich | drewc cool, what school? |
| 15:39 | Wild_Cat | jaen: oh, sure. Heck, *I* don't care about being close to the metal. I like ultra-high-level stuff, because I believe that programmer time is more important than CPU time. |
| 15:39 | drewc | nuclearsandwich: this school, for this guy: http://www.cs.ubc.ca/~gregor/ |
| 15:39 | Wild_Cat | ...although it is important to have *some* people who enjoy writing OS kernels and device drivers. |
| 15:40 | muhoo | so i think it is cultural. it was funny, for example, watching linus try to sell git to google, they couldn't grapple with the decentralized approach. "but there's no central server!" heirarchy is deeply built into the enterprise mindset |
| 15:40 | muhoo | </philosophical digression> |
| 15:40 | Wild_Cat | in a perfect world, I'd use Haskell and Smalltalk as teaching languages. |
| 15:41 | Wild_Cat | in a non-perfect world, I believe Python is a great language for beginners -- not to mention it's excellent as a general-purpose lang. |
| 15:41 | jaen | And even if we disregard the ctm tangent, I really prefer a flexible language which Java, again, is not. I understand that it tries to target the center of the mean programmer, but I don't agree it's a good idea |
| 15:41 | pppppaul | mpenet, i am trying out knit |
| 15:41 | jaen | Mediocre programmer won't become great in mediocre language but it will impede good programmers, I think. |
| 15:41 | pppppaul | i would like to get it printing out stuff in the nrepl console... any suggestions? |
| 15:42 | Wild_Cat | jaen: Java, in many ways, addresses the sad truth of the job market, which is that most programmers are, at best, mediocre. |
| 15:42 | drewr | drewc: not sure; I'm always curious when I see a CL guy around :) |
| 15:42 | jaen | So I'm kind of sad that's most of the time CS introduction promotes mediocrity. |
| 15:42 | Wild_Cat | and those programmers, when given C++, will make things that haunt maintenance programmers for decades. |
| 15:42 | Wild_Cat | when given Java, they can only manage to haunt them for years. |
| 15:42 | drewr | drewc: especially one who rubs elbows with Gregor! |
| 15:42 | jaen | Wild_Cat: yeah, that's probably it, but that doesn't make me less sad. |
| 15:43 | Wild_Cat | on the plus side, the JVM is a cool idea. |
| 15:43 | jaen | Oh yes, I think it's a good platform, that's for sure |
| 15:43 | drewc | drewr: well, I am a little bit of a 'famous' CL guy, so what I say is not quite to relevant to other languages :P |
| 15:43 | drewc | drewr: great /nick btw! :D |
| 15:44 | Wild_Cat | although I really dislike what Oracle is doing with it these days. I mean, ask.com toolbar? On a 10-minute delayed install? *Really*, guys? |
| 15:44 | drewr | "drewr/c: causing more work for autocompletion since 2013" |
| 15:45 | TimMc | drewr, drewc: Whichever of you is looking at going to a university, where are you looking? |
| 15:45 | jaen | Wild_Cat: on an interesting note I find myself much more happier when I code C and chase pointers than when I write websited in RoR or struggle with liferay in Java. |
| 15:45 | drewc | drewr: and, fwiw, `whois common-lisp.net` <---- Drew Crampsie is me . |
| 15:45 | drewc | TimMc: likely http://www.cs.ubc.ca/~gregor/ |
| 15:45 | jaen | I find low-level stuff way easier to understand than having to understand all that code someone else wrote. |
| 15:46 | Wild_Cat | jaen: that's hard to compare. Chasing pointers in C is not a functional domain. Writing websites is ;) |
| 15:46 | muhoo | jaen: thank you. i've found for quite a while a parallel between c and clj, and couldn't figure out what it is |
| 15:46 | drewr | drewc: I remember you from #emacs 12 years ago :) |
| 15:47 | muhoo | the commonality may be simplicity |
| 15:47 | drewc | drewr: autocomplete? surely you type on a qwerty keyboard! drewr is even easier! |
| 15:47 | drewr | I didn't want to say it... |
| 15:48 | jaen | Wild_Cat: maybe that means I'm as un-functional as it gets. Because I do quite agree that doing real complicated systems in C would be a nightmare. |
| 15:48 | TimMc | drewc: *Most* of the classes in a standard CS curriculum would probably be useless to you. |
| 15:48 | drewc | drewr: that is entirely possible ... still in #emacs today for that matter ... just decided to move into 'common' lisp rather then "Commn Lisp" so clojure and scheme as well |
| 15:48 | drewc | TimMc: yup, hence why I do not have to take them ... |
| 15:48 | Wild_Cat | jaen: yeah, C is great for its intended purpose -- OS kernels and tiny bits of performance-critical code. |
| 15:49 | drewc | TimMc: I have been offered an internship with a lot of 'courses' that I will not need to take but will 'pass' |
| 15:49 | drewr | drewc: No Lisp Left Behind |
| 15:50 | drewc | TimMc: I probably will not go back, but Gregor on a sailboat ... well I live on a sailboat, and own AMOP, and talk to him... so simply having that 'education' is worth it... regardless of if its official or not ... I do not think I will fire myself if it turns out that I am not a CompSci Graduate |
| 15:51 | jaen | muhoo: that's an interesting angle. Both C and Clojure aim at being mostly simple with occasional weirdness here and there, at least as far as I can tell. |
| 15:51 | drewc | drewr: 2013 is going to be a big year for "common common" lisp itself imo ... already started! http://alpha.common-lisp.net/ |
| 15:53 | Wild_Cat | jaen: I don't really see that many common points between C and any of the Lisps, TBH |
| 15:54 | Wild_Cat | ...in fact, one of my main criticisms of C is that C programs are about as far from homoiconicity as you can go. C compilers spend so much time parsing and reparsing unnecessary text. |
| 15:54 | jaen | Wild_Cat: I'm not sure if that would be how I would have thought of it myself, but if you think about it |
| 15:55 | Wild_Cat | C macros and include files make me sad, especially since I learned Turbo Pascal before C. |
| 15:55 | borkdude | drewc why is CL going to be big again in 2013? |
| 15:55 | jaen | Both C and Scheme are about as basic implementations of the respective impertivey and functionaley paradigms as it gets |
| 15:55 | drewc | borkdude: I do not know, why? |
| 15:55 | drewr | drewc: ah yes; how is quicklisp doing btw? I haven't seen any cl-gardeners traffic in a while |
| 15:55 | ohpauleez | borkdude: I think it was on a Mayan calendar or something |
| 15:55 | drewc | was it ever big? |
| 15:55 | jaen | At least that's how I understood muhoo |
| 15:55 | borkdude | drewc why would 2013 be big for CL |
| 15:55 | TimMc | drewc: "2013 is going to be a big year for "common common" lisp itself" |
| 15:56 | Wild_Cat | jaen: you could go much, much simpler than C. |
| 15:56 | jaen | And as for homoiconicity I have a bit of a love-hate relationship with it - I love the idea of macros, I still can't get over parentheses, still somewhat unparsable to me ; / |
| 15:56 | drewc | drewr: quicklisp is going great .. in fact, I am planning on having a common-lisp.net quicklisp dist |
| 15:57 | drewc | borkdude: I do not know, why? |
| 15:57 | Wild_Cat | jaen: Clojure helps a lot with that -- it adds just enough syntax to make the whole thing readable. |
| 15:57 | drewc | TimMc: note the "common common" ;) |
| 15:57 | Wild_Cat | (vector/set/map syntax was Clojure's really good idea, and I wish CL or Scheme had it) |
| 15:57 | borkdude | drewc because you said it's going to be a big year for CL. my question: why? |
| 15:58 | drewc | borkdude: my question |
| 15:58 | drewc | : |
| 15:58 | TimMc | drewc: What is "common common" lisp? |
| 15:58 | jaen | Wild_Cat: regarding the simpler-than-C: probably, though I haven't seen anyone go there, at least practically; as for Clojure: yeah it's better than CL/Scheme, but it's still a bit hard on me, even with additional brace types; it maybe a fault of mine a bit, since most programs I wrote in Clojure were thing I hacked quickly together in one or two days |
| 15:59 | jaen | And some functions were left unbroken over several indentations level since that how the code flowed. |
| 15:59 | Raynes | cemerick: Asciidoc is pretty cool. |
| 15:59 | jaen | I need to get better at partitioning stuff in lisp, that probably will help a lot. |
| 15:59 | Raynes | I started writing a novel for giggles in it last night. |
| 15:59 | Wild_Cat | jaen: me too, tbh. I'm still a massive Clojure noob. |
| 15:59 | cemerick | Raynes: Yup. It is the local maxima. |
| 16:01 | Raynes | cemerick: Only thing that bothered me is that I didn't see a way to split a file up into logical units, like chapters. |
| 16:01 | ssmolau | What black magic must occur so that my repl see the environment variables exported by my bash.rc? |
| 16:01 | borkdude | Raynes what advantages does it have compared to org-mode? |
| 16:01 | cemerick | Raynes: and keep each section in a different file, you mean |
| 16:01 | cemerick | ? |
| 16:01 | drewc | TimMc: well, for some reason, Common Lisp was a standard, that was meant to unite things that Lisps did in Common, but is now used as the name of a programming language that meets the ANSI standard... I do not program in just that language ... I use threads, and continuations, and sockets, and iolib for 'proper' pathnames .... But the same code I use can be used on other implementations, though it is non standard. S |
| 16:01 | drewc | o what common lisps have in common. |
| 16:01 | mcohen3 | question about Clojure's answer to the static type fanatics... if i have a function that returns a map with several keys, and i consume this function from numerous other places in my app, if the structure of that returned map ever changes, client code calling that function may break. in java, i would be returning an object of some class, and if i changed the structure of that class in the same way, client code calling that fun |
| 16:01 | mcohen3 | ction would simply not compile. what is clojure's answer to that problem? tests? |
| 16:01 | Raynes | borkdude: The fact that it isn't org mode and thus it can be edited properly in more than one editor and has tooling I can actually use. |
| 16:03 | borkdude | Raynes tooling like? |
| 16:04 | Raynes | borkdude: I can basically do "a2x -fepub file" and get a readable epub file out of my book. |
| 16:04 | cemerick | or mobi or pdf or html... |
| 16:04 | Raynes | Yes. |
| 16:04 | dnolen | mcohen3: be careful, or contribute to core.typed |
| 16:05 | Raynes | I can also style my book with css if I want, apparently, and the documentation makes this easy. |
| 16:05 | technomancy | drewc: is there something specific you're looking for in multiple implementations, like escaping the JVM? |
| 16:05 | technomancy | or is it just a principled thing? |
| 16:05 | borkdude | Raynes I didn't try it but org-mode can export to docbook, which can export to epub etc - I searched for something like markdown, etc but I'm happy with org-mode for what I need now |
| 16:06 | drewc | technomancy: I am not a pro clojure dev, so no idea about JVMs at all. |
| 16:06 | borkdude | (which is html, pdf, etc) |
| 16:06 | mcohen3 | dnolen :) ok, i just wasn't sure if there was something i was missing |
| 16:07 | Raynes | borkdude: Yeah, and that's what a2x does. But it's there. I just type a2x and it's done. I don't have to learn Emacs commands and stuff. They have a whole page on writing books in asciidoc and it's just like 2 pages long. |
| 16:07 | technomancy | drewc: sure, I mean do you want an alternate implementation because there's something wrong with this one, or just because you don't like the idea of an implementation-defined language? |
| 16:07 | borkdude | Raynes ok, cool |
| 16:07 | seangrove | Oh god, I just figure out why korma wouldn't connect - somehow jdbc won't let me connect to postgres over localhost |
| 16:08 | drewc | Raynes: lol ... http://alpha.common-lisp.net/projects/cl-org-mode/index.html to https://github.com/drewc/smug/blob/master/smug.org to http://drewc.org/interface/monads.html#sec-5 ... now I can not use emacs and still use org-mode syntax! :P |
| 16:08 | seangrove | Whereas psql and rails are just fine with it. Aliasing any domain to 127.0.0.1 worked. Ugh. |
| 16:10 | borkdude | Raynes can you do this with asciidoc? http://stackoverflow.com/questions/15011355/org-mode-counter-for-items-visible-in-export/15012114#15012114 |
| 16:11 | drewc | technomancy: Mu ... there is no definition of Clojure beyond the implementations afaik... so not liking is not relevant, I would prefer an R1RClojure , but then again, I stopped using 'new' things for programming quite a while ago ... It turns out that there is more money involved (for me) doing things "My Way" :) |
| 16:11 | Raynes | I doubt it, but I don't want to. |
| 16:11 | borkdude | Raynes I don't mean to convert you, just exploring if it can do what I want right now |
| 16:11 | Raynes | Well, org-mode is just really for a different use case. |
| 16:11 | Raynes | It's pretty powerful. I don't really need powerful though, I need a simple plain text format that I can write my text in. |
| 16:12 | Raynes | Actually, I don't even need that since I'm not actually going to write a book right now. |
| 16:12 | Raynes | But I wanted to play with some stuff for when I actually do. |
| 16:12 | borkdude | Raynes what are you going to write your book in then? |
| 16:12 | borkdude | Raynes sorry, misread |
| 16:13 | Raynes | When I continue my Clojure book I'll probably do it in asciidoc. |
| 16:13 | Raynes | No Starch wants it done in openoffice, but I don't think I can do that. |
| 16:13 | Raynes | I don't have it in me to write a book like that. It's a terrible experience and I'm writing for fun and not profit. |
| 16:13 | borkdude | Raynes I was happily surprised by what org-mode can do, but also I'm beginning to see its limitations. Btw, org-mode can export to odt as well. |
| 16:13 | Raynes | Not good enough. |
| 16:14 | Raynes | They have this special template stuff that no plain text format can output to. |
| 16:14 | Raynes | I looked over every odt-outputting plain text format there is and none of them would work with their stuff. |
| 16:14 | devn | could you transform it and then give it to org? |
| 16:14 | technomancy | kernel is from the axis of eval guy? |
| 16:14 | borkdude | hmm |
| 16:14 | Raynes | devn: Huh? |
| 16:15 | drewc | technomancy: http://web.cs.wpi.edu/~jshutt/kernel.html |
| 16:15 | Raynes | devn: I could have written my own outputter for pandoc or something that would do what I want, but I was contracted as an author for No Starch and not an engineer. |
| 16:15 | devn | *nod* |
| 16:16 | drewc | technomancy: So, Manuel Simoni is involved, but it is John N. Shutt who wrote the docs that matter :) |
| 16:16 | technomancy | seems like having a publisher assume authors would be OK with a word processor is a bad sign |
| 16:16 | technomancy | IIRC manning used to assume word (!) until a few years ago |
| 16:17 | borkdude | The Joy of Clojure was compiled using this: https://github.com/fogus/trout |
| 16:19 | hiredman | dnolen: the impossiblity of efficient implementation means never having to justify yourself |
| 16:19 | technomancy | hiredman: I thought that was Ola |
| 16:19 | pandeiro | anyone know why the heroku lein template would compile with ring-devel <=1.1.8 but not 1.2.0-beta1, something involving ring.util.request ? |
| 16:19 | hiredman | technomancy: him too |
| 16:19 | weavejester | pandeiro: What's the exact error? |
| 16:20 | pandeiro | weavejester: Exception in thread "main" java.lang.ClassNotFoundException: myapp.web |
| 16:21 | TimMc | Raynes: Do it in LaTeX. |
| 16:21 | weavejester | pandeiro: What's the whole stack trace? Can you require the namespace in a REPL? |
| 16:21 | cemerick | technomancy: If you give a programmer a tool, odds are she'll implement something "better", regardless of the qualities of the original offering. |
| 16:22 | devn | Did I tell you guys about my awesome version of clojure without parens? |
| 16:22 | pjstadig | dnolen: what makes it hard to understand the appeal of Kernel? |
| 16:22 | Raynes | TimMc: Get out of my internet. |
| 16:22 | pandeiro | weavejester: when i try to load that namespace in the REPL, a message about ring.util.request not being on the classpath appears; but that is not anywhere in the stacktrace when i run `lein run -m myapp.web` |
| 16:23 | weavejester | pandeiro: Try a lein clean? Sometimes that works |
| 16:23 | dnolen | pjstadig: what hiredman said |
| 16:23 | TimMc | Raynes: What, are you allergic? |
| 16:23 | pandeiro | weavejester: had tried that already.. let me paste the stacktrace |
| 16:23 | TimMc | Try NiTrIlE. |
| 16:23 | Raynes | TimMc: Yeah, I break out in hives. |
| 16:23 | pjstadig | dnolen: so i guess you meant was "it doesn't appeal to me because it can't be made performant" |
| 16:24 | pjstadig | which is fine, but people could still find it appealing for other reasons |
| 16:24 | TimMc | (That should exist, dammit.) |
| 16:25 | pandeiro | weavejester: http://sprunge.us/jVfK |
| 16:26 | weavejester | pandeiro: Well, all that tells me is that myapp.web is not on the classpath... |
| 16:26 | drewc | pjstadig: heh ... the same thing was said about lexical scope .... it was 'slow' for interpreted code, but discovered because the compiled code 'accidently' did it... So was 'faster'. Imagine that, lexical scope can/cannot be made performant! :P |
| 16:26 | bbloom | dnolen: isn't kernel just an experiment in fexprs? |
| 16:26 | pandeiro | weavejester: yeah i know (?) ... and it is, of course ... it works fine with ring-devel 1.1.8 |
| 16:26 | dnolen | pjstadig: it's not just about performance - that's just falls out the difficulty (from what I can tell) in applying any kind of analysis. |
| 16:27 | borkdude | TimMc I wrote a large document in latex but I'm now converting to org-mode, because I want to change it's content a bit and latex just distracts me too much from the content .. |
| 16:27 | weavejester | pandeiro: What's the error you get in the REPL when you require the namespace? |
| 16:27 | dnolen | pjstadig: but sure, I guess some people find that fun. But people also find Brainfuck fun, so whatever. |
| 16:27 | antares_ | https://twitter.com/ClojureWerkz/status/305066453353246720 |
| 16:27 | pjstadig | there's a whole thesis on the vau calculus and making the theory of fexprs non-trivial |
| 16:27 | antares_ | woops, meant for #leiningen, sorry :) |
| 16:28 | pandeiro | weavejester: FileNotFoundException Could not locate ring/util/request__init.class or ring/util/request.clj on classpath: clojure.lang.RT.load (RT.java:443) |
| 16:28 | pjstadig | maybe it can't me made performant (which seems like an argument from silence?), but performance isn't the sum total of appeal for everyone |
| 16:28 | borkdude | TimMc and actually code blocks, inline code etc writing in org-mode and then generating .tex works better (for me) than writing in latex: no weird things happen when string literals are used in inline code etc |
| 16:29 | pjstadig | i don't particularly feel the need to crap on someone just because they're pursuing something different than what I would pursue |
| 16:29 | TimMc | antares_: You know what I'd like to see in ClojureWerkz? A push for detailed changelogs. |
| 16:29 | antares_ | TimMc: so are you saying that clojurewerkz.org projects changelogs are not useful? |
| 16:29 | weavejester | pandeiro: Ah, ring.util.request. So that indicates your dependency is still pulling in an old ring-core. |
| 16:29 | Raynes | antares_: You clojurewerkz guys should get me set up with a website for laser. |
| 16:29 | antares_ | TimMc: how much more detailed can be it? We don't want to jam a copy of the docs into the change log :/ |
| 16:29 | weavejester | pandeiro: Try "lein deps :tree" and see if anything is pulling in an old Ring dep |
| 16:29 | drewc | pjstadig: great read too, the $vau thesis ... and helped my increase performance for my first implementation by quite a bit. |
| 16:29 | antares_ | Raynes: when is your birthday? |
| 16:30 | Raynes | antares_: 20 days ago. |
| 16:30 | Raynes | lol |
| 16:30 | drewc | Raynes: happy belated! |
| 16:30 | Raynes | Thanks. |
| 16:30 | antares_ | Raynes: so, in ~345 days we will see if there's anything to reveal :) |
| 16:30 | TimMc | antares_: Oh, you know what? I thought timbre was a "member project", but it's not. |
| 16:30 | Raynes | Hehe |
| 16:30 | antares_ | TimMc: timbre is Peter's library. He usually does all the right things but yeah, not change logs. |
| 16:31 | pandeiro | weavejester: compojure 1.1.5 |
| 16:31 | TimMc | So never mind. :-D |
| 16:31 | pandeiro | so i use :exclude ? |
| 16:31 | Raynes | I was waiting to release 1.0.0 of laser. |
| 16:31 | weavejester | pandeiro: Or just have [ring/ring-core "1.2.0-beta1"] as an explicit dependency. |
| 16:31 | pjstadig | drewc: yeah i've read the thesis |
| 16:31 | Raynes | Which I'm totally gonna do tonight. |
| 16:31 | clojurebot | It's greek to me. |
| 16:31 | Raynes | Weeee. |
| 16:32 | pandeiro | weavejester: ah of course, better.. thanks |
| 16:32 | weavejester | pandeiro: Dependencies in your project.clj take precedence over second-degree dependencies |
| 16:32 | TimMc | antares_: You know what I don't see enough of, in general? Mentions in the changelog of what bugs were introduced in a given version. |
| 16:32 | TimMc | That's super-classy stuff, right there. |
| 16:32 | antares_ | TimMc: we started using issues more actively for what we find. I wish github had a nice way to link to issues :( |
| 16:32 | weavejester | pandeiro: I guess you've just added [ring "1.2.0-beta1"], which depends on [ring/ring-core "1.2.0-beta1"] |
| 16:32 | weavejester | p |
| 16:33 | TimMc | antares_: Beyond #42? |
| 16:33 | antares_ | right now we sometimes add GH issue: #20 or something like that to the change log |
| 16:33 | TimMc | yeah |
| 16:33 | pandeiro | weavejester: yeah that's it |
| 16:33 | antares_ | TimMc: #42 does not resolve from a markdown file in the repo |
| 16:33 | weavejester | pandeiro: But [compojure "1.1.5"] depends on [ring/ring-core "1.1.6"] so the two ring-core deps are of equal importance. I think when that happens the first one is picked. |
| 16:33 | antares_ | TimMc: but thanks for the suggestion, I agree that it is a good idea |
| 16:33 | antares_ | TimMc: what projects do you use, by the way? |
| 16:34 | pandeiro | weavejester: wow so if i reversed the order of the deps, it would work? trying that... |
| 16:35 | weavejester | pandeiro: Maybe. I can't remember exactly how it works. |
| 16:35 | patchwork | How do you guys feel about using `resolve` to break circular dependencies up across namespaces? |
| 16:35 | pandeiro | weavejester: sure enough, you are right |
| 16:35 | dnolen | pjstadig: I should read the thesis. But the idea that certain design choices might make basic kinds of static analysis intractable unappealing. So I haven't bothered. But that's me. |
| 16:36 | patchwork | So any forward references can just call (resolve qualified-name) to access a function yet to be defined? |
| 16:36 | pandeiro | i actually don't understand why the heroku template requires ring-devel and not core in the first place |
| 16:36 | pjstadig | dnolen: i get what you're saying, and i think i agree, but i've not seen any kind of formal analysis of the unanalyzability of Kernel |
| 16:37 | bbloom | i'm beginning to think, more and more, that it's preferable to have more sublanguages with well defined semantics and narrower applicability |
| 16:37 | pandeiro | oh, maybe stacktrace |
| 16:37 | bbloom | because you can express interesting ideas more susinctly and with more opportunities for static analysis |
| 16:37 | pandeiro | but wouldn't it be a best practice for the heroku template to make the ring-core dep explicit, since it uses ring.middleware.session.*, too? |
| 16:40 | finishingmove | what's Clojure used for, commonly? what kind of applications? (i'm new) |
| 16:41 | pjstadig | bbloom: that why i find macros appealing, you can extend syntax in a way that translates to well known, well analyzed, well optimized forms |
| 16:41 | pjstadig | which seems like an easier route |
| 16:41 | dnolen | pjstadig: http://en.wikipedia.org/wiki/Fexpr talks a bit about the issues |
| 16:41 | pjstadig | "In 2007, John N. Shutt proposed an extension of lambda calculus that would model fexprs without suppressing rewriting of operands, in an attempt to avoid Wand's result." |
| 16:41 | drewr | finishingmove: anything; it's as general purpose as Java |
| 16:42 | dnolen | pjstadig: I also don't find reassuring that nearly every academic Lisper I've encountered pretty much has told me Kernel is horrible idea. Not that academics have all the answers or anything. |
| 16:42 | pjstadig | the thing with fexprs is that everyone goes to Wand, but Stutt claims to have avoided the problems that Wand brings up |
| 16:42 | pjstadig | er.. Shutt |
| 16:42 | finishingmove | drewr, that's cool.. :) any trends though? |
| 16:43 | finishingmove | it's kind of a stupid question but u know what i mean i guess |
| 16:43 | pjstadig | dnolen: yeah, don't get me wrong, i have reservations about Kernel myself, but i still find it interesting in a way |
| 16:43 | pjstadig | it's and uphill battle to defend fexprs |
| 16:43 | pjstadig | so you gotta give the guy props |
| 16:43 | drewr | finishingmove: it's all over the map -- web, science, prog lang research, data, you name it |
| 16:43 | borkdude | finishingmove if you look at cemerick's survey, clojure is mostly used for web dev - but this doesn't mean it can't be used for other areas. web dev is probably just a popular field |
| 16:44 | pjstadig | Wand basically killed fexprs in the 80s |
| 16:44 | borkdude | finishingmove http://cemerick.com/2012/08/06/results-of-the-2012-state-of-clojure-survey/ |
| 16:45 | finishingmove | cool, thanks for the info |
| 16:46 | TimMc | antares_: I think timbre is the only one from that page. |
| 16:46 | TimMc | It's definitely a site I check when I need a lib. |
| 16:49 | frozenlock | Raynes: ping |
| 16:50 | frozenlock | Any reports of clojail misbehaving once uberjared? |
| 16:51 | borkdude | which languages allow shadowing of local variables in nested scopes? clojure, but not Java and C# |
| 16:51 | borkdude | some more examples? |
| 16:51 | borkdude | local variables / locals |
| 16:52 | dnolen | borkdude: seems like nearly every major functional programming language right? |
| 16:52 | borkdude | dnolen I'm trying to give an example to students who don't know functional languages |
| 16:52 | technomancy | borkdude: ruby does now, but it used to screw it up in 1.8 |
| 16:54 | bbloom | borkdude: SQL |
| 16:55 | antares_ | TimMc: file an issue about it ;) |
| 16:56 | Raynes | frozenlock: Define misbehaving. |
| 16:56 | TimMc | antares_: Yeah, good idea. |
| 16:56 | antares_ | TimMc: what clojurewerkz libraries do you use, by the way? |
| 16:58 | frozenlock | Raynes: That misbehaving---> "java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "createClassLoader")" |
| 16:58 | borkdude | I came up with this javascript example https://www.refheap.com/paste/11679 but this uses an anonymous function, is there an easier way to create a scope? |
| 16:58 | TimMc | antares_: None of the member projects, it turns out. |
| 16:58 | Raynes | frozenlock: And you're running this jar with `java -jar my.jar`? |
| 16:58 | antares_ | TimMc: hahahaha |
| 16:58 | frozenlock | Raynes: yup |
| 16:58 | antares_ | TimMc: it's ok. Some day. It's unavoidable ;) |
| 16:59 | TimMc | antares_: I was surprised to not see an Amazon S3 project in there. I'm in the market for one. |
| 16:59 | Raynes | frozenlock: Try java -Djava.security.policy=example.policy -jar your.jar |
| 17:02 | frozenlock | Raynes: It works. |
| 17:03 | pppppaul | is there an easy way for me to tell if my application is running via nrepl? |
| 17:03 | frozenlock | Raynes: would it be possible to just drop the policy in the resources? |
| 17:03 | Raynes | frozenlock: I don't know of a way. There probably is, but you'll have to google around. |
| 17:04 | frozenlock | Time to stretch my google-fu! |
| 17:04 | frozenlock | Thanks for the help :) |
| 17:15 | TimMc | pppppaul: Like, whether it was launched from the command line vs. calling (-main) in the REPL? |
| 17:16 | TimMc | pppppaul: If so: https://github.com/baznex/crosscram/blob/gui-demo/src/crosscram/demo.clj#L341 |
| 17:17 | Bodil | dnolen: Oh, I see what you meant about compiler support now... |
| 17:17 | dnolen | Bodil: heh :) |
| 17:18 | dnolen | Bodil: yes since we don't have vars, you must do var trickery through the analyzers namespace atom |
| 17:18 | dnolen | Bodil: but you can easily do that in your macro. |
| 17:19 | dnolen | deftest macro or whatever |
| 17:19 | Bodil | dnolen: That's what I'm doing now. Which makes me realise I don't much like the deftest/run-tests pattern. |
| 17:21 | bbloom | Bodil: core.test isn't my favorite bit of clojure either |
| 17:22 | hiredman | b |
| 17:22 | hiredman | b |
| 17:22 | TimMc | Looks like someone forgot to pay their / bill today and ran out. |
| 17:23 | TimMc | pppppaul: Basically, my approach is "Don't do that, then." |
| 17:44 | seangrove | In Korma, should the transform function be called whenever calling (select my-entity...)? |
| 17:44 | seangrove | It never seems to be applied |
| 17:53 | pppppaul | TimMc, ok |
| 17:53 | pppppaul | i just didn't want my repl running rabbitmq code |
| 17:53 | pppppaul | cus... that's just weird |
| 17:54 | TimMc | I figure that an explicit alternate entrance point is less trouble than some context-detecting magic. |
| 17:58 | devn | Is it possible to alias *1 to something else? |
| 17:58 | TimMc | devn: What behavior would you like to see? |
| 17:58 | pppppaul | but... i want to become a magician |
| 17:58 | devn | $1 does exactly what *1 does |
| 17:59 | devn | (def $1 *1) or somesuch |
| 17:59 | devn | im wondering if it's even possible |
| 17:59 | TimMc | devn: Set up a watcher to copy values over. :-) |
| 17:59 | devn | without wiring up an atom or something |
| 17:59 | devn | yeah TimMc -- just curious if there's a simpler way |
| 17:59 | TimMc | THat's pretty simple. |
| 18:01 | TimMc | devn: This is what you have to work with: https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj#L261 |
| 18:09 | ravster | in tools.logging, and when using log4j, does the log4j.logger.user=DEBUG property only use that logger when we are in the user namespace? |
| 18:09 | TimMc | devn: If you don't mind implementation details: (.refer *ns* '$1 #'*1) |
| 18:10 | ravster | thats what I'm getting from the readme, but how would that make sense in a project with numerous namespaces? |
| 18:16 | ravster | nvm, just found with-logs |
| 18:22 | seangrove | Ah, figured it out - later (defentity ...) calls were overriding previous ones |
| 18:23 | abp` | Hm, should as-> support :as? Currently it doesn't. |
| 18:26 | ravster | how does one set the logging level in tools.logging? |
| 18:29 | technomancy | ravster: by reading lots and lots of documentation |
| 18:31 | ravster | technomancy: apparently :) . I should add a bunch of stuff to the readme when I figure all this out. |
| 18:31 | technomancy | java logging is a quagmire |
| 18:39 | bbloom | technomancy: understatement of the year |
| 18:43 | abp` | More specifically: Should as-> support destructuring and restructuting? Currently it does/n't. (as-> (range 2) [one two :as numbers]) => [0 1 :as (0 1)] but (as-> (range 2) [one two]) => [0 1] It's just not checking for destructuring but using let under the hood. |
| 18:50 | patchwork | technomancy: We just implemented our own logging, way simpler |
| 18:51 | technomancy | patchwork: I've been meaning to try timbre |
| 18:51 | technomancy | but yeah, rolling your own is better than dealing with the nightmares of seven-layer logging cake |
| 18:51 | patchwork | Well, we tried that first |
| 18:51 | patchwork | I didn't realize beforehand what we were getting ourselves into |
| 18:51 | patchwork | I wish someone had warned us |
| 18:51 | technomancy | oh? |
| 18:52 | technomancy | leiningen just uses println plus a couple dynamic vars (*debug?* etc) |
| 18:52 | patchwork | we tried java logging first I mean |
| 18:52 | patchwork | I don't know how much time we dropped dealing with all the crazy |
| 18:52 | technomancy | oh, gotcha |
| 18:52 | technomancy | part of the problem is some level of logging config is unavoidable if you use certain java libs |
| 18:52 | technomancy | so you see reasonable people doing it, and you think to yourself "that must be a reasonable thing to do" |
| 18:53 | technomancy | but you don't realize they're not doing it out of choice |
| 18:53 | bbloom | i agree: printing some semi-standard syslog formatted plain text lines is by far the best way to go |
| 18:53 | dnolen | interesting subtle behavior of declare I never really thought about: (def x 1) (def x), x is still bound to one. |
| 18:53 | technomancy | bbloom: I'm surprised how effective k=v style logging is |
| 18:54 | patchwork | It's really all you need. We added some stuff in front to be able to redirect output to different hosts etc |
| 18:54 | patchwork | based on our own (simple) configuration |
| 18:54 | bbloom | dnolen: yeah, i was surprised when i saw the source of the `declare macro, but then i realized that it made sense: 'def is a primitive and `declare is not, so that *has to be* the behavior such that declare can be implemented in terms of def |
| 18:54 | patchwork | though I suppose that is already going down the road of damnation |
| 18:55 | bbloom | technomancy: i've seen XML loggers in production.. *cringe* |
| 18:55 | ravster | patchwork: yikes. that doesn't bode well for me. |
| 18:55 | patchwork | ravster: just getting into java logging? |
| 18:55 | ravster | patchwork: ya |
| 18:56 | patchwork | ravster: roll your own, it will save you hours of pain |
| 18:56 | ravster | I've spent the last 30 minutes trying to figure out how to set the log level for a program run |
| 18:56 | patchwork | unless like technomancy says you are forced to use it because of a dep |
| 18:56 | bbloom | technomancy: the best part of using syslog style logging is that you can trivially migrate from stderr to "real sys log" by checking *out* to be a dgram socket |
| 18:56 | patchwork | bbloom: That is exactly what we are doing! |
| 18:56 | bbloom | it's connectionless and unreliable, but on any sane modern unix, local dgram sockets are basically memcopy |
| 18:56 | patchwork | good old dgrams |
| 18:56 | dnolen | bbloom: yes cljs was doing the wrong thing, ran into a surprising bug |
| 18:57 | patchwork | now I am thinking I should release our setup as a lib |
| 18:57 | bbloom | dnolen: cljs' def behavior is strange in general... the top level should be clj not cljs |
| 18:57 | bbloom | (when false (def x 1)) |
| 19:01 | TimMc | dnolen: I believe defonce makes use of that def behavior. |
| 19:02 | technomancy | I like how tools.logging doesn't let you change log level at runtime because it's not supported across all backends |
| 19:06 | ravster | patchwork: is your logger opensource? |
| 19:06 | patchwork | It is part of a larger project |
| 19:06 | pppaul | i desire log |
| 19:06 | patchwork | I am thinking about releasing though |
| 19:06 | ravster | oh okay |
| 19:07 | patchwork | through popular demand |
| 19:07 | ravster | patchwork: :D |
| 19:09 | pppaul | i will fork it and rename it to b-log |
| 19:10 | pppaul | patchwork, our first goal with a logger is to reduce the performance penalty of (println\(pprint |
| 19:10 | pppaul | what do you think? |
| 19:12 | patchwork | That is certainly a worthy goal |
| 19:12 | patchwork | mine was just to make it simpler |
| 19:12 | patchwork | but I think in the process, it is faster as well |
| 19:13 | patchwork | (since it is just throwing packets at a dgram socket) |
| 19:13 | patchwork | I will have to test it though, and make a project for it |
| 19:15 | antares_ | ravster: use https://github.com/ptaoussanis/timbre instead |
| 19:16 | antares_ | unless you need to use SLF4J or log4j in a legacy codebase, there is absolutely no reason to use tools.logging. Timbre is better, easier to use and you can contribute to it without hassle. |
| 19:16 | patchwork | antares_: That looks pretty good! |
| 19:21 | ambrosebs | How can I tell clojure-maven-plugin not to `compile` files? I just want whatever lein does for releases/tests. |
| 19:30 | ravster | good stuff. |
| 19:42 | dnolen | yow |
| 19:43 | dnolen | solving Zebra under CLJS core.logic is now down to 13ms |
| 19:44 | ohpauleez | dnolen: That's insane. congrats |
| 19:44 | dnolen | ^not-native is pretty darn useful |
| 19:50 | dnolen | it takes about 8 seconds in latest Racket, we're doing pretty good! |
| 19:50 | bbloom | dnolen: heh :-) |
| 19:51 | ohpauleez | dnolen: Where is ^not-native documented |
| 19:51 | ohpauleez | ? |
| 19:51 | dnolen | ohpauleez: nowhere |
| 19:52 | dnolen | it's experimental and new |
| 19:52 | ohpauleez | ahh, cool |
| 19:54 | dnolen | ohpauleez: it just eliminates dispatch overhead on protocol invocations |
| 19:55 | ohpauleez | ahh, awesome |
| 20:04 | ivaraasen | dnolen: got any recommendations for CS books? currently on a shopping spree |
| 20:28 | dnolen | ivaraasen: concepts techniques & models of computer programming |
| 20:36 | frozenlock | Raynes: FYI https://www.refheap.com/paste/11688. |
| 20:39 | alandipert | Raynes: https://github.com/tailrecursion/hiprepl clojail ftw! |
| 23:24 | Raynes | alandipert: Go Alan, go Alan. |
| 23:26 | alandipert | Raynes: 8-) |
| 23:31 | Raynes | alandipert: You should come visit me in LA. |
| 23:31 | Raynes | It's only like 2.5k miles. |
| 23:38 | alandipert | Raynes: i just may dude, i got peoples in san diego and am out there periodically |
| 23:44 | sshack | What's the recommended way to do SSL in a ring/compojure app? let apache terminate the SSL for you (more moving parts), or will ring/jetty handle it for me? |
| 23:47 | frenchyp | sshack: I'd like to know too. For what it's worth http-kit says to handle it with a nginx front end |
| 23:48 | sshack | frenchyp: Fair enough. I'll consider nginx as a synonym for apache in that case. |
| 23:48 | frenchyp | yes, of course |
| 23:48 | xeqi | clojars uses a nginx frontend |
| 23:48 | xeqi | also helps for serving static files through it |
| 23:49 | sshack | xeqi: True. I'm just thinking from an operational perspective. there's also the static serving portion of ring. |
| 23:49 | sshack | The fewer moving parts I can have, the happier I am. "scaling" isn't an issue for me. |
| 23:58 | frozenlock | http://www.emacswiki.org/emacs/ThreadMacroFromClojure |