2013-08-12
| 00:05 | xeqi | blr: you could use standard ring sessions, or perhaps stateful sessions from lib-noir |
| 00:08 | BufferUnderpants | Alright, so I have this multimethod in Clojurescript... |
| 00:09 | blr | xeqi: ok, any caveats with ring sessions - would that be appropriate for storing an 150-200k deserialised document? |
| 00:09 | BufferUnderpants | And I'm trying to dispatch on type |
| 00:10 | BufferUnderpants | How do I do it for a string? |
| 00:10 | BufferUnderpants | The compiler is ominously outputting "WARNING: Use of undeclared Var my.namespace/String" |
| 00:16 | xeqi | blr: heh, that wouldn't work for a cookie store. might work for a memory store, but I don't know when sessions are cleaned up |
| 00:16 | blr | so I will probably need to use something like ring-jdbc-session and h2 |
| 00:17 | xeqi | blr: or just save it in a db normally, and store an id to it in the session |
| 00:17 | blr | xeqi: I'm not legally allowed to persist this data |
| 00:18 | xeqi | :/ |
| 00:18 | brehaut | hi blr |
| 00:18 | blr | so effectively I only want it to live as long as the api client's session |
| 00:18 | blr | hey brehaut :) |
| 00:18 | brehaut | blr: i havent looked at the scroll back in detail, but memcached? |
| 00:19 | brehaut | or is that still to persisted |
| 00:19 | blr | sure that would work actually |
| 00:20 | brehaut | blr: are you using some clojure at your place of employment? |
| 00:21 | blr | thinking about it :) |
| 00:21 | brehaut | nice :) |
| 00:21 | blr | have you used spyglass brehaut? api looks nice enough |
| 00:21 | brehaut | i havent even heard of it |
| 00:21 | brehaut | link? |
| 00:21 | clojurebot | unlink: and constantly is just a function that takes any arguments and returns whatever argument is given |
| 00:21 | blr | http://clojurememcached.info/articles/getting_started.html |
| 00:22 | brehaut | huh |
| 00:24 | brehaut | blr: that looks pretty straight forward |
| 00:24 | blr | yeah, I think I'll give that a shot, thanks |
| 00:24 | brehaut | blr: nice that connections arent dynamically bound |
| 00:25 | brehaut | and the clojurewerkz guys seem to do decent librarys |
| 00:33 | callen | brehaut: more importantly, documentation |
| 00:34 | blr | yes, we like documentation |
| 00:43 | dnolen | BufferUnderpants: js/String |
| 00:44 | dnolen | BufferUnderpants: you can't refer to global things outside of CLJS without js/foo |
| 02:00 | xsyn | Hi all |
| 02:00 | xsyn | what's the best way to run a jetty app in production? |
| 02:00 | xsyn | behind nginx? |
| 02:55 | papyrus | hi |
| 02:56 | papyrus | www.clojure.org is dead. why ? |
| 02:56 | papyrus | i want to get information about clojure , but i can't. |
| 02:59 | katratxo | papyrus: try without the www |
| 02:59 | papyrus | no. it does not work. |
| 03:00 | Foxboron | works here. |
| 03:00 | jack_rabbit | papyrus, it's fine here. |
| 03:00 | katratxo | papyrus: it works for me |
| 03:00 | papyrus | i am in korea. |
| 03:00 | jack_rabbit | papyrus, try a different DNS server. |
| 03:00 | jack_rabbit | And clear your DNS cache. |
| 03:01 | callen | papyrus: 8.8.8.8 and 8.8.4.4 |
| 03:01 | papyrus | thanks. |
| 03:01 | papyrus | i will try. |
| 03:02 | supersym | or opendns if you care about security/privacy a bit more ;0 |
| 03:02 | supersym | screw up a smiley how typical monday morning |
| 03:03 | supersym | mornin' |
| 03:04 | jack_rabbit | supersym, looks like a monday morning smiley. |
| 03:04 | jack_rabbit | ;0 |
| 03:04 | jack_rabbit | ^What I look like on Monday morning. |
| 03:05 | morrifeldman | Is it possible to get 'lein test' to run in color? |
| 03:10 | supersym | lol |
| 03:11 | supersym | morrifeldman: I doubt its built in natively but you could use something like https://github.com/ams-clj/clansi |
| 03:17 | morrifeldman | supersym: Thanks! clansi looks pretty cool. |
| 03:48 | H4ns | another beginner question: having a map {:a {:x 1} :b {:x 2}}, what, is the canonical way to retrieve a sequence of all values of :x (=> [1 2] here)? |
| 03:50 | TEttinger | ,(map $(:x (val %)) {:a {:x 1} :b {:x 2}}) |
| 03:50 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: $ in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 03:50 | TEttinger | ,(map #(:x (val %)) {:a {:x 1} :b {:x 2}}) |
| 03:50 | clojurebot | (1 2) |
| 03:50 | TEttinger | that's a pretty terse example |
| 03:50 | H4ns | nice, thanks! |
| 03:51 | TEttinger | if you wanted more self-explanatory, H4ns, there's ##(map (fn [kv] (:x (val kv))) {:a {:x 1} :b {:x 2}}) |
| 03:51 | lazybot | ⇒ (1 2) |
| 03:52 | TEttinger | mapping over a hashmap has each call go over both the key and the value as one thing, a MapEntry (called kv here, for key-value) |
| 03:52 | H4ns | TEttinger: #(...) is "equivalent" to (fn [%] ...), is that right? |
| 03:52 | TEttinger | yes |
| 03:52 | H4ns | i like that, thanks! |
| 03:53 | TEttinger | and it works with ,(#(+ %1 %2 %3) 5 7 9) |
| 03:53 | TEttinger | ,(#(+ %1 %2 %3) 5 7 9) |
| 03:53 | clojurebot | 21 |
| 03:53 | H4ns | i like terse. when i want verbose, i can always return to common lisp :) |
| 03:53 | TEttinger | you can have a lot of arguments I think, not sure what the max is but you usually only need one or two |
| 03:54 | TEttinger | % is the same as %1 |
| 03:55 | H4ns | TEttinger: thanks again! i can go for here. i'll probably ask some more beginner level questions until someone gets annoyed and tells me. |
| 03:56 | TEttinger | haha |
| 03:56 | TEttinger | `google 4clojure |
| 03:56 | TEttinger | &google 4clojure |
| 03:56 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: google in this context |
| 03:56 | TEttinger | I don't know what the bots have for syntax |
| 03:56 | TEttinger | 4clojure is great |
| 03:57 | TEttinger | simple-seeming clojure problems for beginners, and as you get better they get harder |
| 03:58 | H4ns | TEttinger: nice. putting that onto my list of things to do. |
| 04:10 | supersym | H4ns: I've found using LightTable (instarepl) quite useful as well, to learn clojure/syntax, since it visually remains (intermediate) values next to the expressions. The eval-as-you-type may be a bit annoying though :P |
| 05:03 | callen | I didn't have fantastic luck with LightTable, although it's nifty and I get the appeal of it. |
| 05:03 | callen | I'm actually still looking for a good solution to debugging in Clojure. The only thing really saving me is that Clojure code doesn't really commend the use of a debugger quite like a language that relies heavily on stateful mutation does. |
| 05:04 | Foxboron | shoudl write a stacktrace parser |
| 05:04 | Foxboron | should* |
| 05:06 | talios | IntelliJ's LaClojure has a responably good(ish) debug story the last I looked at it |
| 05:06 | talios | depending on your code I guess :) |
| 05:07 | supersym | callen: I get that... and admittingly, it (lt) does also hide/obfuscate some reader stuff from plain sight |
| 05:07 | ro_st | have you guys tried ritz? |
| 05:08 | ro_st | hugod gave a comprehensive demo of it at ClojureWest |
| 05:08 | ro_st | not sure if the vid is up yet |
| 05:08 | supersym | also typos become costly in time so you need to ns-unmap stuff or restart the JVM because your typo'd variables are in memory too :D |
| 05:08 | supersym | ro_st: nop |
| 05:08 | clojurebot | Titim gan éirí ort. |
| 05:08 | supersym | lol wut? |
| 05:08 | supersym | silly bot |
| 05:09 | benedikt | How do i get the ip adress of the connecting client in clojure.contrib/socket-server? |
| 05:09 | callen | supersym: I'm an emacs user so I don't really *NEED* LightTable, I just recommend it to people who are a little green and just want to tinker with some Clojure. |
| 05:09 | callen | I really just want a nice debugger for Clojure. |
| 05:17 | benedikt | and what is is the backlog parameter? |
| 05:19 | mercwithamouth | is anyone using light table on serious projects yet? I'm still a green clojure developer but so far i like it, at the very least the instarepl tool |
| 05:19 | benedikt | nevermind, that was straight from java (saw when i looked at the source) |
| 05:20 | ro_st | mercwithamouth: you might want to look at nightcode.info too |
| 05:21 | mercwithamouth | ro_st: =P not bad |
| 05:21 | mercwithamouth | i was going to say...one of the things that made me attempt clojure was the repl in the android store. do they plan on making either of these tools available on tablets? Not necessarily important but it would be cool |
| 05:22 | ro_st | i'm sure there are folks hard at work making clojure wholly available on android |
| 05:23 | mercwithamouth | Nice... |
| 05:24 | paomian | who use compjure |
| 05:24 | ro_st | lots of us! |
| 05:24 | ro_st | compojure, anyway |
| 05:25 | paomian | I can not understand it |
| 05:26 | callen | mercwithamouth: I'm pretty sure ibdknox is using LightTable while making LightTable. |
| 05:26 | callen | that's probably how he knows what to improve. |
| 05:26 | mercwithamouth | callen: very true...i have to say so far the user experience isn't bad at all |
| 05:26 | callen | it could fairly be called a non-trivial project, but ultimately the IDE/editor you use...really isn't important. |
| 05:28 | callen | using Node webkit on his part was a pretty clever coup for solving the "cross-platform app" problem without making something ugly like a Swing app. |
| 05:29 | mercwithamouth | callen: now that i agree on. i talked to him briefly when i first peeked at clojure and this chatroom |
| 05:30 | Okasu | supersym: "You fall without rising." -- bot said. |
| 05:32 | Okasu | callen: What do you use now as debugger for clojure? Ritz? It becames annoying quickly once you enable break-on-exception thing, but breakpoints doesn't work without it. :/ |
| 05:34 | callen | yep, I tried nrepl-ritz and limit-break. |
| 05:34 | callen | both are broken in their special snowflake ways, making both essentially useless. |
| 05:34 | callen | I sincerely hope I never write code that truly *requires* a debugger in Clojure, because on that day, I will be fucked. |
| 05:35 | Okasu | callen: Ha-ha, true that. |
| 05:35 | ro_st | +1. write code that doesn't need debugging. |
| 05:35 | ro_st | not always possible, but doable a lot more than you'd otherwise think! |
| 05:35 | callen | er, yeah. |
| 05:36 | callen | I've definitely run into plenty of code that requires it and it's totally unavoidable. |
| 05:36 | callen | not but two weeks ago, I wrote a function that traversed the entire heap of its own process and used mem locations and type tags to track something down. |
| 05:36 | callen | in Python, that is. |
| 05:36 | ro_st | of course. i guess it depends entirely on what sort of thing you're doing |
| 05:36 | ro_st | if you're writing device drivers, you're going to need a debugger. a rest service, notosomuch :-) |
| 05:37 | callen | you'd think so, but when you're using hairy frameworks like Django... |
| 05:38 | callen | with LazyRefs and the like skulking about... |
| 05:38 | ro_st | ah, i'm talking about with Clojure |
| 05:39 | callen | oh sure. |
| 05:39 | ro_st | all bets are off when it comes to using sOOp |
| 05:40 | ro_st | sOOP |
| 05:45 | Apage43 | and.. yeah |
| 05:46 | Apage43 | my project now has a tiny embedded expression language |
| 05:48 | Apage43 | instaparse made that easier than I expected |
| 05:57 | ro_st | nice Apage43 |
| 06:07 | H4ns | is clojure.tools.trace the recommended way to trace? |
| 06:10 | noncom | if i want to have a record with mutable fields, do i simply make the fields atoms or agents? |
| 06:11 | Apage43 | if you *really* need to, why not just put the record in an atom? |
| 06:13 | noncom | Apage43: my task is to simulate a big particles system. While in Java it would do with simple class and its instances, in Clojure I am still looking for a solution. For the needs of simulation I need the fastest way with the least footprint.. |
| 06:13 | Apage43 | do your particles affect each other? |
| 06:13 | noncom | so i think that a whole record in the atom will have a bigger footprint (esp. when scaled up to 1000000 record instances) |
| 06:13 | H4ns | when i added a new depencency to my lein project, can i fetch and load it without restarting my jvm? |
| 06:14 | Apage43 | actually regardless of that |
| 06:14 | noncom | Apage43: yes, in general case particles must be able to interact with each other |
| 06:14 | ro_st | H4ns: look at github.com/cemerick/pomegranate |
| 06:14 | ro_st | noncom: this is probably one of the times it's probably best not to use immutable datastructures |
| 06:14 | Apage43 | i'd put the whole particle system in an atom |
| 06:15 | ro_st | for performance reasons. if you do want to, though, an atom which gets updated once per 'frame' of computation |
| 06:15 | H4ns | ro_st: thanks |
| 06:15 | Apage43 | right. So the renderer can (deref) the one atom that holds the whole system |
| 06:15 | ro_st | with the whole world in it. otherwise you're looking at the bazooka of mutation, STM with refs |
| 06:15 | Apage43 | and has a snapshot it can work off of to draw with |
| 06:15 | ro_st | yes |
| 06:16 | noncom | well, yes, i definitely not need immutability in this very place of the system |
| 06:16 | noncom | if only clojure would let to jump away into the mutable world for in-place computations... |
| 06:16 | noncom | sigh. |
| 06:16 | Apage43 | transient/persistent! |
| 06:16 | ro_st | noncom: nothing stopping you from doing that |
| 06:16 | Apage43 | or just use java types |
| 06:17 | noncom | yes, here goes java.. transients are great, but not for cases like this one. If i am to use transients, then why not to fall back to raw nio buffers.. |
| 06:17 | ro_st | there's nothing wrong with -local- mutation |
| 06:18 | noncom | i could store all the system i a couple of big nio buffers |
| 06:18 | Apage43 | transient/persistent! are still useful, for the reason I mentioned aboe |
| 06:18 | noncom | ro_st: nothing wrong, except for that it is rather cumbersome in comparison to java's i = i++ |
| 06:18 | noncom | omg i just wrote shit |
| 06:19 | noncom | but never the less, int a = 5; int b = a + 1; ... whats faster? |
| 06:19 | Apage43 | you use transient/persistent! in your updating, and then your renderer can still take a snapshot of the system it knows won't get mutated under it |
| 06:20 | noncom | so ok, should i store the records in transient structures? |
| 06:20 | noncom | or only coordinates? |
| 06:20 | noncom | what about boxing/unboxing for numbers? |
| 06:20 | Apage43 | no, you just write the update function you'd normally write if you weren't using transients |
| 06:20 | Apage43 | then .. hm |
| 06:20 | Apage43 | hard to explain transients |
| 06:21 | noncom | i know what they are.. |
| 06:21 | noncom | but i am not accustomed with patterns of their use |
| 06:21 | Apage43 | transients really shouldn't leave the function they're created in, typically |
| 06:22 | noncom | so a particle that has x, y and z coordinates |
| 06:22 | ro_st | noncom: i'd suggest solving your problem 'in the slow' with idiomatic clojure, and then bringing in defrecord / transients etc to improve the performance |
| 06:22 | noncom | i have the slow solution already, so it is the time |
| 06:22 | ro_st | and using a good old atom to store your world in from calc-step to calc-step |
| 06:23 | noncom | for me it came out that using a {} of atoms is faster than using an atom of {} |
| 06:23 | ro_st | ok. then you're in research land to find how defrecord, transients, or coding against java colls directly will help you |
| 06:23 | noncom | ro_st: yeah, that's what i was feeling like for the past couple of days... |
| 06:24 | noncom | still, tell me, would you work with all the records in a transient way or simpy work with a [] of x y z inside each record transiently |
| 06:24 | noncom | ? |
| 06:26 | ro_st | to be perfectly honest, i don't know. i've never used records or transients before |
| 06:27 | noncom | yeah, me too have no big experience with those... just used transients a couple-o-times... |
| 06:29 | noncom | i would make a donation to anyone who'd write a good article on transients and boxing in clojure. and records for the second part... |
| 06:33 | Apage43 | sketch of what I'm thinking https://www.refheap.com/17520 |
| 06:34 | clgv | noncom: what exactly is your question on transients? |
| 06:36 | Apage43 | derp derp |
| 06:36 | Apage43 | edited some things i just forgot to type in there |
| 06:51 | mercwithamouth | are there any major differences between 1.3 and 1.5? I'm debating on getting the pragmatic programmers book...or should i go with the manning meaps? Right now i'm going through the oreilly book |
| 06:52 | Ember- | mercwithamouth: new libraries etc, core language is pretty much the same |
| 06:52 | Ember- | at least I don't remember any differences out of the blue |
| 06:52 | Ember- | there might be some |
| 06:53 | cemerick | mercwithamouth: reducers and reader literals are the biggest changes...which is to say, not much. I don't think I'd include the latter in a book, even today. |
| 06:53 | clgv | mercwithamouth: you could also read the O'Reilly one |
| 06:54 | Ember- | reducers are cool but their use scenario is pretty limited |
| 06:54 | mercwithamouth | Ember-: ok, as long as there haven't been major syntax/fundamental changes ..which i suppose would never be the case |
| 06:54 | Ember- | when they are useful, they really are |
| 06:54 | mercwithamouth | clgv: yeah i'm using the oreilly one now. |
| 06:54 | Ember- | mercwithamouth: no syntax changes or anything like that |
| 06:54 | Ember- | or well, usage of :use is today preferred to be done via :require |
| 06:54 | Ember- | but :use is still there |
| 06:55 | mercwithamouth | too rich for my blood at the moment, reducers |
| 06:56 | clgv | mercwithamouth: you can learn the basics with older books but need to get the updates after that... |
| 06:58 | Apage43 | reducers basically fit where you're transforming a collection into a value (which may be another collection) |
| 06:58 | mercwithamouth | ->> is the same as 'reduce'? |
| 06:58 | Apage43 | emphasis on collection, not sequence |
| 06:58 | cemerick | Apage43: the tl;dr is that reducers superset transients |
| 06:58 | Ember- | mercwithamouth: no, that's used on function chaining |
| 06:59 | Apage43 | cemerick: that's a good way of putting it |
| 06:59 | Ember- | (->> foo (bar 1)) is same as (bar 1 foo) |
| 06:59 | Apage43 | I've got an app where I've done a bit of both, that I'm looking at, and the transient stuff could easily (and probably more cleanly) be changed to reducers |
| 06:59 | mercwithamouth | ahh i see |
| 07:00 | mercwithamouth | https://gist.github.com/jaycfields/3804058/raw/439d5f921d87764923ecc9f190006952a3594464/gistfile1.clj |
| 07:00 | Ember- | mercwithamouth: and you can pass as many function as you like after ->> |
| 07:00 | mercwithamouth | ^ ...i like o_O; |
| 07:00 | Ember- | (->> foo (bar 1) (blergh 3)) is same as (blergh 3 (bar 1 foo)) |
| 07:02 | Apage43 | its there basically to move stuff around to be nicer to read |
| 07:02 | mercwithamouth | hmm i'll touch on that later. i'm jumping around. i just saw it in a blog post |
| 07:03 | mercwithamouth | but after you said chaining the example made immediate sense |
| 07:06 | noncom | Apage43: sorry, been away for lunch, now examining the code... |
| 07:08 | noncom | clgv: my question on transients: how to combine them with unboxed arithmetics so as to attain the highest calculation speed, the lesser footprint and transgress as little as possible from idiomatic traditional clojure syntax. and for the second part - extend these techiques to describe the usage of records in them |
| 07:09 | noncom | ideally i would like to get the same speed as in plain java but inside clojure (let it be in special places, but at least something) |
| 07:09 | clgv | noncom: oh. unboxed values are only possible in `vector-of` afaik. |
| 07:10 | noncom | for example, what about (unboxed ... ) for that, just like (transient!) |
| 07:10 | noncom | i guess not possible for tech reasons.. |
| 07:10 | noncom | clgv: oh, sad.. |
| 07:12 | noncom | Apage43: ok, i see the example.. the collection itself is transient but not the particles or numbers... that's at least something, but hard i crave on unboxed numbers.. |
| 07:13 | Apage43 | well you could use (vector-of)s instead of records for the same thing |
| 07:16 | clgv | noncom: well, in defrecords you can also have primitive values in the predefined attributes - but I double you get an unboxed value through keyword access - you'll need to use interop access |
| 07:16 | clgv | s/double/doubt/ |
| 07:17 | Apage43 | https://www.refheap.com/17522 ; as vector-ofs |
| 07:17 | noncom | when i used to program in java, i had to write "public" many times and i often missed the "l" letter for some reason... |
| 07:19 | clgv | well ordinary reduce will box the values again |
| 07:20 | noncom | Apage43: i guess i'll have to collect mutable numbers separately from other data and use the (vector-of) approach.. or explore the nio approach for collections.. there was vertigo by zach tellman, which handles nio-mapped structs... |
| 07:21 | clgv | noncom: you'll need primitive functions as well to avoid boxing |
| 07:21 | noncom | clgv: ugh, right... |
| 07:22 | clgv | noncom: and a reduce like macro that expands to a loop-recur. since anonymous functions cant be defined as primitive functions atm |
| 07:22 | noncom | so i may as well go back to java for all that part of my program.. |
| 07:23 | clgv | noncom: depending on your current knowledge that might be the faster option. |
| 07:23 | noncom | and cleaner i think |
| 07:24 | noncom | clgv: do you mean that if my knowledge of clojure was better, i could avoid java fallback? |
| 07:24 | clgv | noncom: not encessarily. for example there is a lib to do fast computations on arrays which has the kind of macros I just mentioned |
| 07:25 | noncom | hiphip? |
| 07:25 | clgv | noncom: I just needed to google the name. might be the one. it was mentioned with core.matrix on the mailing list |
| 07:27 | clgv | noncom: yes, I think thats the one I meant |
| 07:27 | noncom | alright, i will do more explorations and measurements on this side, before going to java! |
| 07:27 | clgv | noncom: but arrays are mutable, so you have to be careful there in case you want to use immutable specific features of clojure |
| 07:28 | noncom | clgv: immutability is often of no need in complex calculation algos |
| 07:29 | noncom | but still concurrency... needs it.. |
| 07:29 | clgv | noncom: I know. usually you can convert the overall result to an immutable data structure for the analysis phase... |
| 07:34 | mercwithamouth | how would one go about adding two lists??? (+ (list 1 2 3) list (4 5 6)) ??? |
| 07:34 | lazybot | mercwithamouth: How could that be wrong? |
| 07:34 | mercwithamouth | ??? |
| 07:34 | lazybot | mercwithamouth: How could that be wrong? |
| 07:34 | mercwithamouth | thought so =P |
| 07:36 | clgv | ,(map + '(1 2 3 4) '(5 6 7 8)) |
| 07:36 | clojurebot | (6 8 10 12) |
| 07:36 | clgv | mercwithamouth: ^^ |
| 07:37 | noncom | mercwithamouth: clgv: probably better use vectors, not lists? |
| 07:41 | clgv | noncom: what do you mean? |
| 07:42 | noncom | i mean that is not it better to use vectors for working with collections of numbers? |
| 07:43 | clgv | noncom: he wanted to know how to add a list of numbers hence the example. |
| 07:44 | cemerick | if you're using apply, map, etc., lists and vectors are equivalent |
| 07:48 | benedikt | How cam i can do (.start (Thread. (fn [] (do-stuff)))) in a lein-repl without importing it from Java first? |
| 07:49 | benedikt | s/cam/come |
| 07:50 | clgv | benedikt: you can write out the full class name. but maybe you just want to use (future (do-stuff)) |
| 07:50 | benedikt | clgv: what? |
| 07:50 | benedikt | clgv: i'm asking why I did *not* have to import it from the java namespaces |
| 07:51 | clgv | benedikt: oops read it wrong. it is java.lang.Thread then. java.lang is imported automatically |
| 07:51 | benedikt | clgv: ah, that explains it. :) |
| 07:51 | benedikt | clgv: what did you think i was asking and what problem does using (future ..) solve? |
| 07:52 | noncom | future is same as Thread stuff you described. all clojure functions implement Runnable.. |
| 07:52 | clgv | clgv: I thought you ask the negation and it might be java.util.concurrent.Thread or something ;) |
| 07:52 | clgv | I read it to quickly |
| 07:53 | clgv | benedikt: `future` does almost the same. except that it uses a threadpool with a fixed maximum number of threads |
| 07:53 | clgv | benedikt: and you have easier access to the return value of the calculation |
| 07:54 | benedikt | clgv: so you can use `future` instead of interoping with java to start a new thread? |
| 07:54 | Ember- | you really should use futures with concurrent programming |
| 07:54 | Ember- | in java too |
| 07:55 | Ember- | http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html |
| 07:55 | clgv | benedikt: informally speaking yes. you should use future in clojure instead of creating a thread yourself |
| 07:56 | Ember- | and in Java you should use Executors... :) |
| 07:56 | Ember- | instead of firing of raw threads yourself |
| 07:56 | Ember- | of+f |
| 07:56 | benedikt | clgv: i'm sort of new to clojure yet and i learn stuff by hacking away with it informally, so informal explenations are fine. |
| 07:56 | clgv | benedikt: fine :) |
| 07:56 | Ember- | if you start your thread like that you lose all control of it from the outside world |
| 07:57 | benedikt | so instead of writing (.start (Thread. (stuff))) i should just do (future (stuff)) ? |
| 07:57 | Ember- | with futures you can do all kinds of stuff if you wish |
| 07:58 | Ember- | benedikt: (future (stuff)) will create a future, but does not launch it |
| 07:58 | clgv | benedikt: yes. you can do (let [f (future (do-stuff))] (println "wait for result - results =" @f)) |
| 07:58 | Ember- | benedikt: http://clojuredocs.org/clojure_core/clojure.core/future |
| 07:58 | clgv | Ember-: thats just plainly wrong! |
| 07:58 | Ember- | clgv: you are right |
| 07:59 | Ember- | I had to rethink, I was wrong with that statement |
| 07:59 | Ember- | it *is* launched |
| 07:59 | Ember- | had to actually launch REPL to check if what I just said was bullshit |
| 07:59 | Ember- | and it was |
| 07:59 | benedikt | I had skimmed through that documention. Ill spend more time on it tonight, when i'm not a my work and supposed to write corporate boring code. |
| 07:59 | Ember- | sorry :/ |
| 07:59 | benedikt | Ember-: :) happens |
| 07:59 | Ember- | anyway, you can deference the future to get the return value |
| 08:00 | Ember- | which blocks until the thread is ready |
| 08:02 | Ember- | #@(future "wat") |
| 08:02 | Ember- | ,@(future "wat") |
| 08:02 | clojurebot | #<SecurityException java.lang.SecurityException: no threads please> |
| 08:02 | Ember- | aww |
| 08:09 | Okasu | &,@(future "wat") |
| 08:09 | lazybot | java.lang.SecurityException: You tripped the alarm! future-call is bad! |
| 08:09 | jtoy_ | does rename-keys still exist in clojure? I cant seem to call it |
| 08:09 | benedikt | Ember-: and i cant deref a (Thread.) ? |
| 08:10 | Ember- | benedikt: no, Threads don't have a return value per se |
| 08:11 | Ember- | benedikt: see https://www.refheap.com/240eaef9a859ab1aae074a9a8 |
| 08:11 | benedikt | Ember-: but a future has? |
| 08:11 | kmicu | "The brighter the green is, the more often the code has been run. Hovering over any of the lines will give you a tooltip with the absolute number of times." |
| 08:11 | Ember- | first call without dereferencing returns a future |
| 08:11 | kmicu | http://dominik.honnef.co/posts/2013/08/writing_go_in_emacs__cont__/ |
| 08:11 | jtoy_ | ah, its for set, how can I rename a key in a map? |
| 08:11 | Ember- | second one with dereferencing waits until the calculation is done and returns that |
| 08:12 | benedikt | Ember-: makes sense |
| 08:13 | Ember- | so you can just save your future into a var and read from there when you need it |
| 08:13 | jtoy_ | nm |
| 08:13 | Ember- | and be certain that the thread has completed before you try to read from it |
| 08:14 | benedikt | Ember-: isn't this just consistent with derefing in clojure? the first example (refheap) just spins off the thread and lets it do it's thing, but when you derefed it waits (does it block?) until the thread is done to be able to retrieve the return value? |
| 08:14 | benedikt | so derefing "forces" it to return you the value, thus it makes (time) wait until it has completed it's task |
| 08:15 | clgv | benedikt: yes. you deref a future to get its value. your are free to choose when you want to deref it thoug |
| 08:15 | benedikt | clgv: so derefing *can* block, but if you deref at the appropriate time in code, it doesn't have to block |
| 08:16 | Ember- | yeah, kinda of :) |
| 08:16 | benedikt | i like clojure. |
| 08:16 | Ember- | if the thread has completed when you deref the future it will just return the value calculated |
| 08:16 | Ember- | if it is still pending then it blocks |
| 08:17 | benedikt | yeah, thats brilliant |
| 08:17 | Ember- | I guess most of the ppl on this channel like Clojure ;P |
| 08:17 | bosie | Ember-: i find it a shitty alternative to haskell really |
| 08:17 | Ember- | bosie: different languages, different purposes in many ways |
| 08:17 | Ember- | haskell embraces typing |
| 08:17 | benedikt | Ember-: you had to suspect that there were a few haskellers lurking around |
| 08:17 | bosie | Ember-: i am kidding |
| 08:18 | Ember- | bosie: aww, you trolled me! |
| 08:18 | benedikt | bosie: it's ok. i like haskellers too :) |
| 08:18 | bosie | benedikt: i wish i liked haskell but i never quite managed to wrap my head around it :/ |
| 08:18 | bosie | benedikt: though thats my fault and not haskell's |
| 08:18 | Ember- | haskell is still on my "to-be-learned" list |
| 08:19 | Ember- | haven't done anything even semi-serious with it |
| 08:19 | Ember- | just random twiddling around |
| 08:19 | benedikt | bosie: same here. i attempted learning it three times now, i always get a little further. i think it's one of those things that will just "click" one day |
| 08:19 | Ember- | like lisps |
| 08:19 | Ember- | :) |
| 08:19 | Ember- | I remember when I got my "lisp enlightment" |
| 08:19 | clgv | benedikt: you can even ask the future whether it is ready to be dereferenced without waiting time `future-done?` |
| 08:19 | bosie | benedikt: the fact its not used commercially is a wee bit of a problem as well |
| 08:20 | Ember- | after getting the "lisp enlightment" suddenly all other syntaxes seemed stupid and cumbersome |
| 08:20 | benedikt | bosie: i write c# for a living. companies never use the fun stuff! |
| 08:20 | benedikt | clgv: nice! |
| 08:20 | Ember- | before that all those friggin' parenthesis made me insane! |
| 08:20 | bosie | benedikt: beats me doing java ;) |
| 08:21 | Ember- | benedikt: I write java and clojure for living :) |
| 08:21 | Ember- | most likely the next project is in java if I don't manage to convince the customer that it should be done with clojure :/ |
| 08:21 | benedikt | Ember-: yeah. Im enlightened too. |
| 08:21 | bosie | Ember-: clj for whom? |
| 08:21 | Ember- | bosie: working at this company called Solita in Finland |
| 08:21 | benedikt | Ember-: are you finnish? |
| 08:21 | Ember- | yup |
| 08:23 | bosie | benedikt: "To ensure excellent service to all our customers, we expect our employees to be able to speak Finnish." guess that makes your question moot ;) |
| 08:23 | bosie | Ember-: that looks like a consultancy? |
| 08:23 | benedikt | bosie: i speak swedish and they speak swedish in finland |
| 08:24 | Ember- | bosie: yeah, kinda of. We do that stuff too |
| 08:24 | bosie | benedikt: how many non-finns speak finnish properly though? |
| 08:24 | sebastianb | not, perkele, one |
| 08:24 | Ember- | bosie: it's more like delivering projects to a customer and providing the all things needed for delivering a successful project |
| 08:24 | benedikt | bosie: one. Thats Linus Torvalds and he is already finnish. |
| 08:24 | sebastianb | (I'm sorry for that:P) |
| 08:25 | Ember- | like ux design, development, testing, IT infrastructure devops stuff and so on |
| 08:25 | hyPiRion | bosie: wrong question. How many Finnish speak English properly? :) I would be surprised if it's less than 95% |
| 08:25 | bosie | hyPiRion: if the company requires you to speak proper finnish... |
| 08:25 | bosie | Ember-: how is this not consultancy? |
| 08:25 | hyPiRion | oh, I didn't read that :( |
| 08:26 | opqdonut | there are a couple of finnish software companies that insist on using finnish |
| 08:26 | opqdonut | but most use english as their official language |
| 08:26 | hyPiRion | "Well, it's can't be harder than learning a new computer language" |
| 08:26 | bosie | hyPiRion: hah. i would bet good money i can learn haskell quicker and to a higher profeciency than finnish |
| 08:27 | opqdonut | a russian coworker of mine studied finnish for 3 years to pass the citizenship exam |
| 08:27 | Ember- | bosie: well yeah, I kinda see consultancy more of work where you send this one or several guys to tell how to do stuff, not actually *do* it |
| 08:27 | hyPiRion | bosie: me too. I bet I could learn D, OCaml, Haskell and APL before I would've learned Finnish properly. |
| 08:27 | bosie | Ember-: ok, not here i think. we do deliver ;) |
| 08:28 | Ember- | hehe, same here |
| 08:28 | Ember- | and we do that also with Clojure :) |
| 08:28 | Ember- | we've done two projects with clojure now, both successes |
| 08:28 | bosie | Ember-: in what area? |
| 08:28 | Ember- | was enough for our management, now we're going to do a lot more projects with Clojure |
| 08:28 | Ember- | bosie: web applications |
| 08:28 | bosie | Ember-: isn't a success in the consultancy business when you get follow up work cos your code was so buggy they had to get someone to fix all the bugs? ;) |
| 08:29 | Ember- | bosie: hehe, no. We don't do that kind of consultancy :) |
| 08:29 | Ember- | we believe that a well made project gives you new projects |
| 08:29 | hyPiRion | I think I do that, not intentionally though. |
| 08:29 | Ember- | and the better you do the project the less it will bother you later |
| 08:30 | bosie | hyPiRion: including bugs? |
| 08:30 | bosie | Ember-: if you get paid for the 'bother' though... |
| 08:30 | hyPiRion | bosie: https://twitter.com/hyPiRion/status/366344191166525442 |
| 08:30 | hyPiRion | yes. |
| 08:30 | hyPiRion | including fixing them |
| 08:30 | bosie | hyPiRion: cant read twitter. i activated GSD |
| 08:30 | Ember- | bosie: yeah, but if the company believes in *keeping* the good guys in, then that's pretty short sighted :) |
| 08:30 | bosie | which is pure irony, now i just waste time on irc ;) |
| 08:30 | Ember- | since the good guys deliver quality and with quality comes the customers |
| 08:30 | hyPiRion | bosie: yet here you are, on IRC. :) |
| 08:31 | hyPiRion | "I love it when I introduce a new bug by fixing an older one. Good to know I won't be out of work for the rest of my life, though." - quote me |
| 08:31 | hyPiRion | yesterday |
| 08:31 | bosie | hyPiRion: ah, sorry to hear |
| 08:31 | Ember- | and hyPiRion about the amount of finns who can speak english decently: unfortunately it's not 95%, it's wors |
| 08:32 | Ember- | but of people actually *using* the internet (not just using the bank's web site) I think 95% is pretty accurate |
| 08:32 | bosie | Ember-: what do you reckon is the # for the two proper citis? |
| 08:33 | Ember- | citis? |
| 08:33 | hyPiRion | Ember-: Ah, right. Sounds like the same ratio as in Norway, Sweden, Denmark, Iceland etc. |
| 08:33 | Ember- | ah, amount of people in cities? |
| 08:33 | bosie | Ember-: cities |
| 08:33 | Ember- | hyPiRion: indeed |
| 08:33 | bosie | Ember-: how many people speak english in helsinki (you can include espoo)/turku/tampere |
| 08:33 | Ember- | ah... |
| 08:34 | Ember- | well, I think there it is pretty close to that 95% |
| 08:34 | Ember- | it gets worse when you go to countryside |
| 08:34 | Ember- | but not THAT much |
| 08:34 | bosie | ye |
| 08:34 | bosie | not like they see foreigners in sodankyla |
| 08:34 | Ember- | they do |
| 08:35 | Ember- | and each and every person under 35 years has had to learn at least 6 years of english in school |
| 08:35 | Ember- | in Finland |
| 08:35 | bosie | Ember-: same here but that really doesnt mean much |
| 08:35 | Ember- | and all our tv shows are subtitled, not dubbed |
| 08:35 | Ember- | thank god |
| 08:35 | Ember- | :P |
| 08:35 | bosie | Ember-: they couldn't order a coke in english, let alone keep a conversation going ;) |
| 08:36 | bosie | Ember-: i bet that helps more than school |
| 08:36 | Ember- | one couldn't be without the other |
| 08:36 | Ember- | drop either one and the amount of english speakers drop dramatically |
| 08:37 | Ember- | but hell, I should do some work too |
| 08:37 | bosie | hehe cu |
| 08:37 | Ember- | not just chat in IRC |
| 08:37 | Ember- | -> |
| 08:49 | birdspider | hi, is there a equal/= function that produces false when comparing 'identical' vectors and lists ? i.e (=~ [] '()) false |
| 08:51 | llasram | birdspider: Not off the top of my head. Why do you want that? |
| 08:53 | noncom | birdspider: you can easily write one |
| 08:53 | birdspider | llasram, trying to solve http://www.4clojure.com/problem/65 with http://pastebin.com/es3i6k41 |
| 08:55 | hyPiRion | birdspider: list? vector? map? set? can be used |
| 08:55 | hyPiRion | although not pretty |
| 08:55 | hyPiRion | *elegang |
| 08:55 | birdspider | hyPiRion, not in the example I posted |
| 08:56 | birdspider | hyPiRion, see "Special Restrictions" |
| 08:56 | llasram | birdspider: I think the point of this is to empirically test how core abstraction functions act differently on the provided input |
| 08:56 | llasram | Remember that all the Clojure core structures are immutable (at least in public interfaces) |
| 08:56 | llasram | So you can "mutate" them however you want without being impolite about your imput |
| 08:56 | llasram | s,imput,input, |
| 08:57 | hyPiRion | birdspider: ah. Logged in, the way llasram explained it is how I solved it. |
| 08:58 | birdspider | hyPiRion, ah my bad, didn't think login was required to see the problems |
| 08:58 | hyPiRion | birdspider: it's not, but it's required if you want to see your own solution :) |
| 08:59 | hyPiRion | I just looked at the problem, not its constraints at first. |
| 08:59 | TimMc | Those restrictions miss some predicates. |
| 09:01 | llasram | TimMc: I don't think the problem is intended for people who already know enough Clojure to work out which predicates they can use to "cheat" :-) |
| 09:01 | TimMc | Fair, although sequential? was included in the list of restrictions. |
| 09:02 | hyPiRion | llasram: psh, 4clojure is a great way to learn how reify works. At least you could do that in the past. |
| 09:02 | IamDrowsy | and it's fun to look at the different "hacky approaches" |
| 09:03 | TimMc | Does this problem also fall to the shitty map literal solution? |
| 09:03 | TimMc | Ah, nope. |
| 09:30 | supersym | hmm... I wonder what fun things I could do with clj + e.g. http://www.webkb.org/bin/categSearch.cgi?categ=%23dog&recursLink=%3C |
| 09:45 | H4ns | clj-time or something else for date+time handling (printing and parsing)? |
| 09:47 | ambrosebs | Does a CLJS deftype have any meaning if it is referenced like a var? cljs.core.Subvec vs. cljs.core/Subvec? |
| 10:06 | mercwithamouth | so clojure people..if you could make up a checklist of things to go through to learn most languages...what would you write down? |
| 10:20 | rbxbx | mercwithamouth: ethos, syntax, semantics, tooling, testing |
| 10:20 | wakeup | hi all |
| 10:20 | Okasu | mercwithamouth: Learn Ada, C, Scheme, Haskell. Voilà you know most of the languages outthere without even touching them. |
| 10:20 | rbxbx | mercwithamouth: not sure what level of granularity you're looking for |
| 10:21 | wakeup | I am fighting with clojure.tools.logging and log4j. |
| 10:22 | wakeup | How do I make logging to print all levels to mx *nrepl* buffer? |
| 10:22 | wakeup | tried binding *force*, *tx-agent-levels*... |
| 10:22 | wakeup | guess nrepl ignores my log4j.properties, which is ok |
| 10:24 | mercwithamouth | rbxbx: i'm more so looking for a guide line to become functional in most languages...a blueprint to learn. |
| 10:25 | mercwithamouth | i use several languages but i'm just comparing my method of learning to other peoples |
| 10:25 | wakeup | mercwithamouth: learn common lisp, after that other languages tend |
| 10:25 | wakeup | to be easy |
| 10:25 | wakeup | haskell if you want to go deep into dunctional territory I guess. |
| 10:26 | wakeup | also is there a prefered configuration file library for clojure? |
| 10:27 | Okasu | wakeup: Wakeup, CL isn't functional at all. |
| 10:27 | mercwithamouth | preferred configuration file library.... was that question for me? |
| 10:27 | wakeup | no, not exclusively |
| 10:27 | mercwithamouth | oh ok |
| 10:28 | wakeup | Okasu: No, but people have implemented a lot of functional stuff using it |
| 10:28 | Okasu | wakeup: You can do the same using C, what was your argument again? |
| 10:29 | wakeup | when you do functional stuff in CL, you also get to know how its implemented |
| 10:29 | kmicu | detects Defending Preferred PL Syndrome. |
| 10:29 | wakeup | Okasu: It's a really good language noone should skip, and as far as I understood he was asking for interesting languages to learn. |
| 10:31 | hyPiRion | Well, Haskell is good if you want to constrict yourself to functional programming. |
| 10:31 | Okasu | It's a language one should skip if one wants to lean functional programming. Better stick to Scheme. CL -- standardtized mess of all lisp dialects around 90s. |
| 10:31 | kmicu | "It's not Lisp that sucks, it's Common Lisp that sucks." |
| 10:31 | Okasu | kmicu: Indeed. |
| 10:32 | wakeup | lol |
| 10:32 | kmicu | Okasu: Scheme indeed. |
| 10:34 | wakeup | Don't listen to the religious guys mercwithamouth, just look into what people use for real work and pick whatever you think is interesting. But don't buy into the "X sucks" attitudes, these guys have no idea. |
| 10:35 | wakeup | For instance, I am programming clojure not because I want to, but for a client. While I'd prefer other languages, clojure is a very good choice for this project. |
| 10:36 | kmicu | After I heard from Erik Meijer that PHP is interesting, I do not believe Paul Graham about CL suckiness. |
| 10:36 | kmicu | Just kiddin'. Only trolling ;] |
| 10:37 | Okasu | kmicu: Well, maybe PHP is interesting as fractal of bad design? :D |
| 10:38 | kmicu | "but if you look at it from a little bit of a distance most languages are more similar unless you go to say Prolog or Datalog or Haskell. But the rest, F#, Scala, C#, JavaScript, PHP, they are all languages that have objects, that have mutable state, that have closures, Clojure is maybe somewhere between Haskell and that" |
| 10:38 | kmicu | http://www.infoq.com/interviews/meijer-monads |
| 10:46 | wakeup | So how do I make clojure.tools.logging log to my *nrepl* buffer? |
| 10:49 | dnolen | ambrosebs: prefer the second one, there is no differences in meaning and there are fewer promises about the first one. |
| 10:51 | mdrogalis | wakeup: Been wondering that one for a long time. I think it has to do with the fact that tools.logging uses agents under the hood. |
| 10:51 | wakeup | And how do I direct clojure.tools.logging to a file? |
| 10:51 | mdrogalis | Agents stdout isn't on the main thread. |
| 10:51 | mdrogalis | wakeup: Use a log4j config file. |
| 10:52 | wakeup | okay |
| 10:52 | wakeup | I need to decide that at runtime though (if I want to log to stderr or a file) |
| 10:52 | wakeup | now don |
| 10:52 | mdrogalis | Uhh.. |
| 10:53 | mdrogalis | Once at start up time? Or does it change a lot? |
| 10:53 | wakeup | no once at startup |
| 10:53 | mdrogalis | wakeup: Use pre-hooks, put them in their own files. One batch of prehooks for stderr logging, another batch for file logging. https://github.com/MichaelDrogalis/dire |
| 10:54 | mdrogalis | Import whichever batch of prehooks based on the build, or whatever main file you pick. |
| 10:54 | wakeup | hmm no that won't do |
| 10:55 | mdrogalis | Can you explain a bit more, maybe? |
| 10:56 | wakeup | Well the specification says "a command line option to direct logging output to a given file." |
| 10:56 | mdrogalis | (if (file-logging? args) (require 'hooks)) |
| 10:56 | mdrogalis | In some ideal world. :) |
| 10:57 | gdev_ | Has the notion of logs as data still so new that even clojurists default to log files? |
| 10:58 | gdev_ | s/Has/is |
| 10:58 | wakeup | gdev_: sshhh! |
| 10:58 | gdev_ | Sorry =_= |
| 10:58 | wakeup | mdrogalis: what keeps me from getting and BINDING the logging output stream? |
| 10:59 | wakeup | gdev_: I wouldn't even bother with logging, but this is work for a client |
| 10:59 | wakeup | and I say that as someone running a webserver that doesn't log by design |
| 10:59 | mdrogalis | gdev_: It's clearly a school assignment. |
| 11:00 | mdrogalis | Ah, nevermind |
| 11:00 | mdrogalis | Didn't read up - sorry. |
| 11:00 | wakeup | no it's not ;) |
| 11:00 | wakeup | I don't really get why I need this dire thing to direct logging output. |
| 11:01 | gdev_ | When I tutor java students I still make them think about data and events instead of lines if text and files |
| 11:01 | mdrogalis | wakeup: It was just a suggestion. You don't have to use it to accomplish your goal. |
| 11:03 | wakeup | Just a second: (defn fooo [arg] "bar") <- "bar" is the docstring right? |
| 11:03 | Fer` | gdev_: do you log in edn or something? |
| 11:03 | wakeup | or does it have to be (defn foo "bar" [arg]) ? |
| 11:04 | mdrogalis | wakeup: 2nd way is correct |
| 11:04 | wakeup | fuuuuu |
| 11:04 | H4ns | "why not alienate the CL suckers if one can?" :D |
| 11:04 | krejzywafel | yes yes yes |
| 11:04 | wakeup | yeah right |
| 11:06 | gdev_ | It helps prevent narcissistic systems so yes edn is preferred. |
| 11:06 | wakeup | as if the weird braces and destructuring syntax wasn't butthead enough |
| 11:06 | wakeup | and then: WITH-OUT-STR |
| 11:06 | H4ns | wakeup: i'm not sure that this is the right place to bitch about clojure, though :) |
| 11:06 | wakeup | true |
| 11:06 | Fer` | gdev_: you don't run into any problems when the file is really big? |
| 11:06 | wakeup | tried that last week |
| 11:07 | krejzywafel | X is fuuuuu, cuz it is not like CL, true story... |
| 11:08 | wakeup | krejzywafel: there is a certain element of surprise when a "lisp" does every conceivable lispy thing a bit different |
| 11:08 | H4ns | i must say i find clojure pretty slick. today i used clojure.data/diff and it is teh rocks |
| 11:08 | nDuff | wakeup: haven't you had this exact same rant here earlier? |
| 11:08 | krejzywafel | wakeup: fuuuuuu |
| 11:08 | H4ns | wakeup: #lispcafe |
| 11:08 | nDuff | wakeup: it turned into a flamewar then too. No need for a rerun. |
| 11:08 | wakeup | I am gonna stop now |
| 11:09 | wakeup | but just for my defense: always keeping it civil, kust said it's surprising |
| 11:09 | noncom | if i'm making a Date related library for ClojureScript, is it fine to base it on the js/Date or is that class a bad thing, like the default Java DateTime is adviced to be replaced with JodaTime in usage? |
| 11:09 | H4ns | nDuff: when he's not ranting about clojure here, he's ranting about cl in #lisp :) |
| 11:09 | wakeup | H4ns: so not true |
| 11:10 | wakeup | I have given that up years ago |
| 11:10 | wakeup | but I did suggest porting CL in #cat-v.org |
| 11:10 | noncom | is there an advices substitution for javascript/clojurescript? |
| 11:10 | wakeup | fun times... |
| 11:10 | mdrogalis | H4ns: I was about to laugh if you said he alternates between ranting about Clojure & ClojureScript |
| 11:10 | wakeup | after all they did port python |
| 11:10 | krejzywafel | wakeup: just against your defense - you did not just said it's suprising, you just said it's "fuuuuuuu" |
| 11:11 | wakeup | krejzywafel: that was actually directed at me having noticed this very late |
| 11:14 | gdev_ | Fer I don't log to an edn file, it's just what I serialize the data in |
| 11:15 | gdev_ | Edn in action |
| 11:15 | noncom | my main concern in creating a clojurescript date library is to allow a good work with to/from string conversion and using formats |
| 11:16 | noncom | or maybe there is one existing? |
| 11:17 | mdrogalis | noncom: Does clj-time not port? |
| 11:31 | H4ns | say if i have a map {:a 1 :b 2 :c 3} and i want to convert that into {:x 1 :y 2} (i.e. create a new map with a few values from the old map, stored under new keys), is there a built-in operation for that? i.e. (remap {:a :x :b :y} {:a 1 :b 2 :c 3})? |
| 11:34 | hyPiRion | ,(-> {:a 1 :b 2 :c 3} (select-keys [:a :b]) (clojure.set/rename-keys {:a :x :b :y})) |
| 11:34 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set> |
| 11:34 | mdrogalis | H4ns: select-keys combo'ed with `rename`, I think it is |
| 11:34 | mdrogalis | hyPiRion: Nice :) |
| 11:34 | hyPiRion | ,(require 'clojure.set) |
| 11:34 | clojurebot | #<SecurityException java.lang.SecurityException: denied> |
| 11:34 | hyPiRion | Boo |
| 11:34 | mdrogalis | nope.jpg |
| 11:35 | H4ns | nice, thanks! |
| 11:35 | hyPiRion | ,(require '[clojure.set]) |
| 11:35 | clojurebot | nil |
| 11:35 | hyPiRion | ,(-> {:a 1 :b 2 :c 3} (select-keys [:a :b]) (clojure.set/rename-keys {:a :x :b :y})) |
| 11:35 | clojurebot | {:y 2, :x 1} |
| 11:35 | hyPiRion | there. |
| 11:35 | wakeup | Whats LET* in clojure? |
| 11:35 | hyPiRion | wakeup: let |
| 11:36 | wakeup | let evaluates/binds sequential? |
| 11:36 | hyPiRion | yes |
| 11:41 | wakeup | java.lang.IllegalStateException: replace already refers to: #'clojure.string/replace in namespace [...] |
| 11:41 | mdrogalis | refer-clojure |
| 11:41 | mdrogalis | Check it out |
| 11:41 | wakeup | What did I do? (tried to :use clojure.string) |
| 11:42 | justin_smith | wakeup: do you have a function called replace? |
| 11:42 | hyPiRion | wakeup: you should try to use namespaces, e.g. (:require [clojure.string :as s]), then do s/replace or similar. |
| 11:43 | hyPiRion | otherwise names from the :use'd namespaces clash with others if they have the same name. |
| 11:43 | mdrogalis | wakeup: Also, use :require. Avoid :use. |
| 11:44 | gvickers | why not destructure it. (def n {:a 1 :b 2 :c 3}) (def newmap (let [{x :a y :b}n] {:x x :y y})) |
| 11:46 | H4ns | gvickers: i want to avoid repeating the keys. it seems i need to write a select-rename function. |
| 11:51 | hyPiRion | H4ns: (defn select-rename [map keymap] (-> map (select-keys (keys keymap)) (clojure.set/rename-keys keymap))) ? |
| 11:51 | hyPiRion | I think that would do what you'd like |
| 11:51 | justin_smith | ,(let [m {:a 0 :b 1 :c 2}] (reduce (fn [m' [k k']] (assoc m' k' (k m))) {} [[:a :x] [:b :y] [:c :z]])) |
| 11:51 | clojurebot | {:z 2, :y 1, :x 0} |
| 11:52 | justin_smith | rename-keys, nice, I wasn't aware of that one |
| 11:55 | noncom | mdrogalis: afaik clj-time is based on JodaTime, and there is no equivolent for JavaScript |
| 11:55 | seangrove | Wow, people building inheritance systems on lein's profiles |
| 11:56 | krejzywafel | I'M COBOL PROGRAMMER, I DO NOT LIKE CLOJURE'S LOWER CASE STYLE. UPPERCASE IS BETTER IMHO. |
| 11:57 | hyPiRion | seangrove: I wouldn't be surprised if lein profiles are turing complete. |
| 11:57 | justin_smith | hyPiRion: ~(they are) |
| 11:57 | `fogus | and self-aware |
| 11:58 | noncom | krejzywafel: AND WHAT YOU USE IN COBOL INSTEAD OF HYPHEN-CASE? rEVERSEcAMELcASE OR PLAINOLDGOODONEWORDCASE? |
| 11:58 | justin_smith | (if that was too opaque, you can put arbitrary code inside a syntax-quote, and access the full clojure language) |
| 11:59 | seangrove | technomancy is going to have to answer for some of the sins his work has enabled |
| 11:59 | seancorfield | nearly all of my project.clj files have some ~(embedded code) in them |
| 12:00 | `fogus | seancorfield: You must have larger build reqs than me because I've never had the need. What kinds of things require that? |
| 12:01 | seancorfield | we determine heap size from an env var or default to 512MB, we also add/remove several JVM opts based on which platform we're on and/or which environment tier we're in |
| 12:02 | seancorfield | it's just easier to do that than to have separate profiles for each env |
| 12:02 | technomancy | seancorfield: for the platform stuff please take a look at https://github.com/technomancy/leiningen/pull/1228 |
| 12:02 | justin_smith | In my case it is for passing in env vars so that a lib can see credentials, without having to store the credentials in git. |
| 12:02 | `fogus | seancorfield: Oh so we do have similar requirements... but I do that in Bash scripts. ;-) |
| 12:02 | seancorfield | we try to have all our stuff auto-self-configure based on environment info |
| 12:02 | technomancy | would like to get feedback on that from someone who would actually use it |
| 12:05 | wink | .oO( skynet ) |
| 12:08 | mdrogalis | noncom: Ah, right right. |
| 12:12 | seancorfield | i'm at the courthouse right now for jury service so i'm kinda restricted on what i can work on :) |
| 12:21 | wakeup` | How do I check a reader for end of file? |
| 12:22 | mdrogalis | wakeup`: What kind of reader? |
| 12:22 | wakeup` | *IN* |
| 12:23 | mdrogalis | http://stackoverflow.com/questions/2034059/how-to-read-lines-from-stdin-in-in-clojure |
| 12:24 | wakeup` | I take that as a "not at all"? |
| 12:25 | tbaldridge | wakeup`: on many platforms (JVM included) the proper way to check for EOF is to read until read returns -1 |
| 12:25 | tbaldridge | wakeup`: what is consuming the stream? |
| 12:26 | wakeup` | tbaldridge: read |
| 12:26 | tbaldridge | wakeup`: http://docs.oracle.com/javase/7/docs/api/java/io/Reader.html#read() |
| 12:29 | tbaldridge | wakeup`: for example the clojure LispReader wraps all this and allows you an option to either return a user defined value on EOF or to throw an error. |
| 12:30 | mdrogalis | tbaldridge: I'm having a great time with core.async now that I understand it. Really, really well done man. |
| 12:32 | tbaldridge | mdrogalis: thanks! I can't take all the credit though. Rich, dnolen, alex miller, ghadi and many others did a ton of work too. |
| 12:33 | mdrogalis | tbaldridge: A good effort :) |
| 12:37 | konr` | Is there any already-existing function that given [:foo :foo :bar] returns something like {:foo 2 :bar 1}? |
| 12:38 | tbaldridge | ,(doc frequencies) |
| 12:38 | clojurebot | "([coll]); Returns a map from distinct items in coll to the number of times they appear." |
| 12:38 | konr` | thanks! |
| 12:38 | tbaldridge | ,(frequenceis [:foo :foo :bar]) |
| 12:38 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: frequenceis in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 12:38 | tbaldridge | and I can't spell |
| 12:38 | tbaldridge | ,(frequencies [:foo :foo :bar]) |
| 12:38 | clojurebot | {:foo 2, :bar 1} |
| 12:49 | seangrove | Is wolfes being flooded, or flooding? |
| 12:55 | rasmusto | wolfes is doing something (or maybe comcast is) |
| 13:18 | bhauman | wolfes must work at a lot of different coffee shops |
| 13:21 | technomancy | join/part hiding is a beautiful thing |
| 13:22 | bhauman | technomancy: currently looking for config setting in ui. or rather is it some esoteric irc command? |
| 13:23 | justin_smith | bhauman: with erc it is a config |
| 13:23 | technomancy | bhauman: varies by client |
| 13:23 | bhauman | justin_smith: technomancy: thanks guys |
| 13:35 | TimMc | technomancy: I use a ridiculously simple irssi script called "smartnoise" that hides joins/parts for people who (I think) haven't spoken recently. |
| 13:37 | kmicu | Same here http://dev.weechat.org/post/2008/10/25/Smart-IRC-join-part-quit-message-filter |
| 13:38 | bhauman | I have one more simple irc question that I''ve been meaning to ask. How do you do those cool status messages? |
| 13:38 | justin_smith | bhauman: /me ... |
| 13:39 | justin_smith | or is that not what you mean? |
| 13:39 | bhauman | justin_smith: thanks man |
| 13:39 | callen | I use /me everywhere, including outside of IRC. |
| 13:39 | bhauman | i bet |
| 13:40 | callen | bhauman: you should look things up more. |
| 13:40 | callen | satisfying one's curiosity is good :) |
| 13:40 | justin_smith | I first picked it up in a mud, and used it accidentally found out it worked in irc |
| 13:40 | bhauman | thanks for the tip |
| 13:40 | callen | ahhh MUDs. |
| 13:41 | callen | those taught a lot of people to program. |
| 13:41 | bhauman | callen: I use clojurescript, thus I have a tendency to look things up |
| 13:41 | callen | scripting the grinding phase of the game :) |
| 13:42 | justin_smith | yes, I started with that, then they saw how good my scripts were and elevated me to a builder, then saw the scripts I was putting on mobs and made me a developer for the mud engine |
| 13:49 | TimMc | justin_smith: Haha, nice. |
| 13:49 | scottj | bhauman: link to blog (not post) where that will appear? |
| 13:49 | gvickers | ditto^^ |
| 13:50 | bhauman | http://rigsomelight.com |
| 13:50 | scottj | bhauman: thanks |
| 13:50 | bhauman | scottj: gvickers: if you want to read it now I'd love some people to give me feedback |
| 13:54 | scottj | bhauman: no thanks |
| 13:54 | bhauman | scottj: no worries |
| 13:55 | benkay | lysis |
| 13:55 | benkay | (wrong term) |
| 13:58 | francis_wolke | Could someone please explain to me how exactly we are seeing a 4 in the return list in this form? (let [form '(/ 4 4)] |
| 13:58 | francis_wolke | [(eval form) |
| 13:58 | francis_wolke | (apply (first form) (rest form)) |
| 13:58 | francis_wolke | (apply / '(4 4 ))]) |
| 13:58 | francis_wolke | I |
| 13:58 | francis_wolke | I'm quite confused... :/ |
| 13:59 | dnolen | ,(apply '/ [4 4]) |
| 13:59 | clojurebot | 4 |
| 13:59 | francis_wolke | thanks. |
| 13:59 | hiredman | the symbol / is not the same as the function that the symbol / resolves/evals to |
| 14:00 | justin_smith | ,(apply 'anything [4 4]) |
| 14:00 | clojurebot | 4 |
| 14:00 | justin_smith | ,(apply '☃ [4 4]) |
| 14:00 | clojurebot | 4 |
| 14:01 | konr` | haha |
| 14:01 | justin_smith | ,(apply '☃ ['❄ '☕]) |
| 14:01 | clojurebot | ? |
| 14:02 | justin_smith | clojurebot appears not to be utf8 clean |
| 14:03 | TimMc | ,('+' 0 0) |
| 14:03 | clojurebot | 0 |
| 14:04 | tbaldridge | ,(get '+' 0 0) |
| 14:04 | clojurebot | 0 |
| 14:05 | tbaldridge | justin_smith: function calls to symbols get translated to get ^^ |
| 14:05 | justin_smith | ,('♟ '♞ '♛) |
| 14:05 | clojurebot | ? |
| 14:05 | justin_smith | just like keywords |
| 14:06 | kmicu | ,(apply (comp (partial (comp '+ '*' 'a''a) '+)) '(ha)) |
| 14:06 | clojurebot | nil |
| 14:06 | tbaldridge | I really really want to write a variant of clojure.core that uses unicode symbols for everything. APL meets Lisp or something like that |
| 14:06 | tbaldridge | maybe for april 1st next year |
| 14:06 | justin_smith | ,('a '{a 1 b 2}) |
| 14:06 | clojurebot | 1 |
| 14:06 | technomancy | tbaldridge: april 1 is less than 8 months away |
| 14:06 | justin_smith | nice |
| 14:07 | konr` | a chess game that uses chess unicode characters would be cool, too. (♞ :d3) |
| 14:08 | justin_smith | yes, that would be a nice little clojure based dsl |
| 14:08 | `fogus | tbaldridge: A unicode Clojure with ubiqiutous use of -> would be pretty frickin sweet. |
| 14:09 | tbaldridge | `fogus: that's kindof like bbloom's factjor |
| 14:10 | bbloom | i do not advocate unicode abuse :-) |
| 14:10 | justin_smith | basically you could just have a namespace with lots of lines that looks like (defmacro λ [bindings & body] `(fn ~bindings ~@body)) |
| 14:10 | bbloom | despite years of trying, i still don't know my greek letters |
| 14:10 | hiredman | tbaldridge: have you seen pl? |
| 14:10 | gvickers | you have to know that one.. |
| 14:10 | technomancy | justin_smith: nitpick: what is "domain-specific" about such a language? |
| 14:11 | justin_smith | chess? |
| 14:11 | justin_smith | that is a domain, no? |
| 14:11 | technomancy | oh, I thought you were talking to tbaldridge; nm |
| 14:11 | `fogus | bbloom: I don't know Greek letters either... but snowmen I know. |
| 14:11 | hiredman | feh, I don't think I have a way to load pl in to clojurebot's evaluator anymore |
| 14:11 | etehtsea | where lazy-seqs was moved from contrib? |
| 14:11 | justin_smith | if in emacs: c-x 8 <return> is your friend with unicode |
| 14:11 | bbloom | `fogus: clearly all the PL researchers should just perform all of their typing judgements with snowmen and bishops |
| 14:11 | justin_smith | also things like *lambda* tab-complete from beginning or end |
| 14:11 | tbaldridge | hiredman: I've seen it referenced, never used it |
| 14:11 | `fogus | The only problem is, what function does snowman get? I was thinking `persistent!` might be appropriate. |
| 14:12 | justin_smith | with 8 |
| 14:12 | justin_smith | err |
| 14:12 | justin_smith | ☃ as thaw, the inverse |
| 14:12 | hyPiRion | justin_smith: you don't need to define λ as a macro to show it as λ in Clojure files |
| 14:12 | justin_smith | sure |
| 14:12 | hiredman | https://github.com/hiredman/odds-and-ends/blob/master/functional.clj#L114-130 |
| 14:12 | justin_smith | that was a random example of uniclojure |
| 14:13 | justin_smith | though showing as unicode is probably more useful than requiring unicode input |
| 14:13 | TimMc | I'll just note here that Swearjure is uniclojure-compliant. |
| 14:14 | ro_st | loved that lightning talk :-) |
| 14:14 | ro_st | actually really impressive how far along that got! |
| 14:14 | TimMc | ro_st: gfredericks' talk? |
| 14:14 | ro_st | yes, at CW '13 |
| 14:14 | hyPiRion | TimMc: To some extent. λ isn't legal, although ☃ probably is. |
| 14:14 | TimMc | Hmm, true! |
| 14:15 | TimMc | I guess we can't allow letters from any language. |
| 14:16 | hyPiRion | Not that it would help us much to allow them though. |
| 14:17 | TimMc | Disallowing ' and ! as being "letters" in the romanization of Xhosa and other "click languages" would be unfair, however. |
| 14:17 | konr` | you could also allow only roman numerals |
| 14:18 | TimMc | Eh, we don't need no stinkin' numerals. |
| 14:18 | hyPiRion | + * - and / is enough for me |
| 14:19 | patchwork | Will we ever free ourselves of the chains of ascii? |
| 14:19 | patchwork | : ( |
| 14:20 | technomancy | according to vernor vinge, no |
| 14:21 | TimMc | For code? No. |
| 14:21 | patchwork | Ha! even in the quick, they speak ascii |
| 14:21 | technomancy | 27th century technicians will wonder why dates are measured from the moon landing, and then realize it's actually a few months later |
| 14:21 | TimMc | (Well, I probably won't live long enough to be proven wrong, at least.) |
| 14:22 | konr` | There was a russian keyboard with leds on the keys which would make using unicode symbols viable |
| 14:22 | wink | the optimus? |
| 14:22 | konr` | yeah, that one! |
| 14:23 | TimMc | Í ðóñ'þ ßéé åháþ'ß åëóñg åíþh þhíß µéþhóð. °¥Ö |
| 14:23 | wink | us mechanical keyboard freaks would probably pass on it for some decent feeling :P |
| 14:23 | gvickers | $1500 dollar keyboard |
| 14:23 | patchwork | Seriously, and their processors will just be mind-boggling wrappers around an x86 |
| 14:23 | callen | technomancy: hahahaha |
| 14:24 | hyPiRion | no wonder there won't be any singularity if this is true. |
| 14:24 | wink | technomancy: look, everytime I'm using the elevator in my building (it's been built in 1967) I have to think of Blaine the Mono from the dark tower lately. Like.. technology not touched for centuries or millenia that still works... |
| 14:24 | technomancy | callen: https://en.wikipedia.org/wiki/A_Deepness_in_the_Sky#Interstellar_culture |
| 14:25 | callen | technomancy: I read A Deepness in the Sky. Loved it. |
| 14:26 | bhauman | this all make me think of Bret victor's latest talk. |
| 14:26 | callen | I need a brain implant that filters out anything to do with Bret Victor. |
| 14:30 | dark_element | anybody here used this http://nakkaya.com/static.html |
| 14:31 | callen | dark_element: nah, I wrote my CMS mostly using the stack from Luminus. Looks neat though. |
| 14:31 | callen | I wonder how quickly it compiles compared to Jekyll? |
| 14:32 | dark_element | callen, I can't get it working it yet. |
| 14:32 | dark_element | callen, there is one more similar project https://github.com/liquidz/misaki |
| 14:33 | callen | I just use Varnish if it's truly static. |
| 14:33 | callen | then I can write my code in the same way as usual for the CMS, but it gets cached to death :) |
| 14:33 | callen | I might be weird though. |
| 14:33 | callen | dark_element: do you just want to make a blog? |
| 14:34 | justin_smith | callen: give the whole thing a name like carbonite and you could probably convince other people to do it that way |
| 14:34 | wink | there's also http://algernon.github.io/madness/ |
| 14:34 | callen | justin_smith: not_sure_if_serious.jpg |
| 14:34 | dark_element | callen, yup. |
| 14:35 | callen | dark_element: oh hum. Assuming the use of Clojure is a specific requirement, does it need to be an SSG? |
| 14:35 | callen | SSGs can be really awkward at times. |
| 14:36 | dark_element | SSG? |
| 14:36 | callen | static site generators. |
| 14:36 | ucb | what's the best way of depending on a jar that may not be available in clojars nor maven central? i.e. the code is in github |
| 14:37 | technomancy | ucb: why is it not on clojars? |
| 14:37 | ucb | technomancy: it's not mine; it's a Java/.NET lib I want to wrap |
| 14:37 | dark_element | callen, i started with octopress today and later on went on trying out SSGs built using clojure. |
| 14:37 | ucb | I suppose I can upload a version to clojars under my username namespace |
| 14:37 | technomancy | ucb: you should open a bug report if it's not in a repository |
| 14:37 | ucb | technomancy: good point |
| 14:38 | wink | maven ALL the jars! |
| 14:38 | hyPiRion | more like deploy |
| 14:38 | zphds | Hey guys, I am coming from the world of Python and new to Clojure. Can someone take a look into this piece of code and tell me why it's writing an empty zip archive? |
| 14:38 | zphds | http://cljbin.com/paste/520926a8e4b0b4dec3dca30b |
| 14:38 | amalloy | ~map |
| 14:38 | clojurebot | map and the other sequence functions used to be lazy, but with the advent of chunked sequences, may or may not be lazy, consult your local ouija board |
| 14:39 | amalloy | technomancy: good guess |
| 14:39 | hiredman | technomancy: we all did |
| 14:39 | technomancy | heh |
| 14:39 | amalloy | i actually guessed "for is lazy" |
| 14:39 | bbloom | zphds: what they are trying to say is that you're ignoring the return value of the functional "map" call, which, even if you weren't ignoring it, is problematic when wrapped up with side effects. |
| 14:39 | bbloom | (doc doseq) |
| 14:39 | clojurebot | "([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil." |
| 14:40 | bbloom | zphds: try that^^ |
| 14:40 | justin_smith | quickest fix for the code is mapv for map, after that there is doall wrapped around map, then there is refactoring to a deseq |
| 14:40 | justin_smith | *doseq |
| 14:40 | justin_smith | that being the best option imho |
| 14:40 | hiredman | amalloy: for use by someone new to the language seems unlikely |
| 14:40 | functionform | why are the array set functions typed but not the get? |
| 14:40 | zphds | bbloom: is it more of a code-smell issue or does it have any other adverse effects? |
| 14:41 | bbloom | zphds: laziness & side effects just don't mix. if you need side effects, use an eager operation, such as doseq |
| 14:41 | bbloom | it's an easy fix: (doseq [photo photos] …body of your map function here...) |
| 14:41 | zphds | bbloom: I am ashamed to admit that I didn't know that map was lazy |
| 14:41 | bbloom | zphds: never be ashamed while you're learning! |
| 14:42 | technomancy | everyone gets bitten by that early on =) |
| 14:42 | bbloom | yup |
| 14:42 | bhauman | hell yep |
| 14:42 | zphds | heh |
| 14:42 | zphds | :D |
| 14:42 | dnolen | zphds: and laziness burns even experienced Clojure users |
| 14:42 | bbloom | it's especially easy to get bitten by it since it's not fully lazy. it's actually "non-strict" meaning it's SOMETIMES lazy |
| 14:42 | bbloom | where sometimes == always except in 30-ish item chunks |
| 14:42 | zphds | whoa |
| 14:42 | TimMc | &(take 4 (map println (range 60))) |
| 14:42 | lazybot | ⇒ (012345678910111213141516171819202122232425262728293031nil nil nil nil) |
| 14:42 | bbloom | and so when it *sometimes* happens eagerly, you can't tell it sometimes happens lazilly |
| 14:43 | zphds | is it also bad if I have side effects as part of my 'let'? |
| 14:43 | zphds | like what I did with mkdirs inside a let? |
| 14:43 | dnolen | bbloom: "sometimes" being range and vector |
| 14:43 | bbloom | zphds: if your code needs side effects, then let and do are the best places to put them |
| 14:43 | bbloom | both of those forms let you explicitly sequence operations |
| 14:43 | technomancy | zphds: that's fine. it's best if you bind to _ for side-effects; makes it clear the return value isn't used. |
| 14:44 | zphds | bbloom: ah |
| 14:44 | bbloom | technomancy: unless your side effect has a return value :-P |
| 14:44 | technomancy | (assuming you mean the [] part of a let) |
| 14:44 | llasram | zphds: There's also `doto`, depending on what exactly you're doing |
| 14:44 | zphds | I kinda figured _ is for such things |
| 14:44 | ystael | related question: is there a tool I can use as a 'laziness monitor'? that is, to answer the question "I think this code might be less than maximally lazy somewhere, but where?" |
| 14:44 | bbloom | zphds: just by convention though. _ isn't special in any way |
| 14:45 | ystael | other than watching memory meters |
| 14:45 | zphds | llasram: yeah, I played around with doto initially, but that io/copy in the middle is ruining the sequence |
| 14:45 | zphds | bbloom: right, I kinda use that in my python code as well, to tell that this var is just there and won't be used anywhere else |
| 14:46 | ystael | I had trouble with OOM due to this during the ICFP contest this weekend until I remembered that mapcat is a little bit eager |
| 14:46 | dnolen | ystael: that's cool that you gave ICFP a shot, you didn't try integrating w/ external SMT solver? Sounds like Z3 was popular? |
| 14:47 | ystael | dnolen: no, i used the maximally stupid generate-and-test approach |
| 14:48 | ystael | which actually did surprisingly well |
| 14:48 | zphds | well doseq didn't help |
| 14:49 | zphds | it's something to with 'data' which is a byte array |
| 14:49 | dnolen | ystael: nice, yeah some folks tried core.logic, which is fun but I think a bad fit for the problem description out of the box - but writing a proper CLP(BV) extension to core.logic is probably a bit too much work given the time alloted :) |
| 14:53 | ystael | dnolen: wish i had learned how to use the reducers library ahead of time, i suffered most from lack of parallelism |
| 14:53 | ystael | (and poor time management, but that's to be expected with a baby in the house) |
| 14:53 | bbloom | dnolen: (acronym-expand-1 "BV") |
| 14:54 | dnolen | bbloom: BitVector |
| 15:01 | zphds | woohoo.. got it working |
| 15:01 | zphds | here is the working snippet |
| 15:01 | zphds | http://cljbin.com/paste/52092c79e4b0b4dec3dca30c |
| 15:01 | zphds | thanks guys! |
| 15:02 | bbloom | zphds: see also ##(doc with-open) |
| 15:02 | lazybot | ⇒ "Macro ([bindings & body]); bindings => [name init ...] Evaluates body in a try expression with names bound to the values of the inits, and a finally clause that calls (.close name) on each name in reverse order." |
| 15:03 | zphds | bbloom: I attempted with-open, but the [o (output-stream path)] has to be the first pair? |
| 15:03 | justin_smith | zphds: also, hanging close braces only make the code harder to read for anyone familiar with a lisp family language |
| 15:04 | bbloom | move the .mkdirs outside of the let. defn's body is in an implicit do |
| 15:04 | zphds | bbloom: so I couldn't set things up for the with-open block in the order I wanted |
| 15:04 | bbloom | then let photos & fullpath |
| 15:04 | bbloom | then with-open out and zout |
| 15:04 | bbloom | then doseq & doto |
| 15:04 | zphds | ah |
| 15:04 | callen | zphds: props for abusing let already. Took me ages to figure out you could do that. |
| 15:04 | zphds | that's a neater idea |
| 15:05 | zphds | callen: haha |
| 15:06 | technomancy | zphds: usually closing an "outer" stream will close the inner one too |
| 15:06 | callen | MFW: my coworkers are more excited about Datomic than Clojure. |
| 15:07 | zphds | technomancy: ah ok… that one flew right by me |
| 15:07 | wink | callen: #firstworldproblems :P |
| 15:07 | ro_st | good instinct. Datomic is -ing awesome. |
| 15:07 | callen | wink: we are in the tar pit of Python. It's awful. |
| 15:07 | wink | lol |
| 15:07 | callen | we can't even seem to reliably package our shit up for deployment. |
| 15:07 | ystael | callen: isn't that a snake pit |
| 15:07 | ToxicFrog | callen: could be worse. You could be in the tar pit of C++. |
| 15:07 | callen | ystael: python wasn't named after a snake. |
| 15:07 | ToxicFrog | Where the tar is actually made of razorblades. |
| 15:07 | wink | or C# |
| 15:07 | callen | ToxicFrog: I'd prefer that. |
| 15:07 | callen | ToxicFrog: because then at least I'd get some fucking respect. |
| 15:07 | zphds | are there any online resources that details the conventions and good practices? |
| 15:07 | ystael | callen: yes, yes, i am aware of that. it was a pun of admittedly mediocre quality. |
| 15:08 | callen | "oh you're a C++ programmer? Let me give way then..." |
| 15:08 | ToxicFrog | wink: IME C# is honestly not that bad. I'd take it over C++ and Java, at least. |
| 15:08 | wink | zphds: https://github.com/bbatsov/clojure-style-guide for example |
| 15:08 | zphds | wink: cool |
| 15:08 | callen | that guide isn't wholly accurate or credible. |
| 15:08 | ToxicFrog | callen: yes, but what does respect get you when you pay for every day with your sanity and/or liver? |
| 15:08 | callen | please do not recommend batsov's guide as if it were authoritative. |
| 15:08 | wink | ToxicFrog: it's not such a bad language. but I still have no good experiences :P |
| 15:08 | ToxicFrog | ...I feel like there's a version of the Chemical Worker's Song that applies to C++ programming kicking around in my head somewhere. |
| 15:09 | wink | callen: "for example". but ok |
| 15:09 | wink | zphds: see above. But I find it better than nothing at the start |
| 15:09 | ystael | ToxicFrog: isn't the best feature of C# called "F#" ? |
| 15:10 | TimMc | zphds: As far as indentation goes, just trust Emacs. |
| 15:10 | zphds | wink: cool… |
| 15:10 | wink | callen: well do you have better resources? :) |
| 15:10 | stuartsierra | zphds: http://dev.clojure.org/display/community/Library+Coding+Standards |
| 15:10 | zphds | TimMc: yep! with nrepl it just kicks ass |
| 15:10 | TimMc | nooooo |
| 15:10 | ToxicFrog | ystael: I haven't actually used F# |
| 15:10 | TimMc | stuartsierra: I hate that that page recommends map destructuring in args. ;_; |
| 15:10 | TimMc | *restargs |
| 15:10 | ToxicFrog | I have high hopes for clojure-clr, though |
| 15:11 | wink | .oO( how to incite a peaceful channel in 3 easy steps. style guide, languages, editors ) |
| 15:11 | zphds | wink: haha |
| 15:11 | zphds | and all it takes is a newbie to do that :) |
| 15:11 | TimMc | It's pretty hard to get this channel up in arms about editors, thankfully. |
| 15:11 | wink | zphds: your're just a catalyst :P |
| 15:12 | ro_st | wink: wait until you see what happens when someone mentions the CA |
| 15:12 | zphds | what's a CA :D |
| 15:12 | TimMc | haha |
| 15:12 | Fer` | yogthos: ping |
| 15:12 | wink | I'd say Certificate Authority, but apart from leiningen and clojars I can't imagine what he meant :P |
| 15:12 | yogthos | Fer`: howdy |
| 15:13 | wink | hint: ssl in java is painful |
| 15:13 | Fer` | yogthos: hello, in selmer is {% for x in foo.bar %} not supported? |
| 15:13 | TimMc | wink: Let's just pretend that's what CA refers to here. :-P |
| 15:13 | TimMc | Yes, very good. |
| 15:13 | yogthos | Fer`: uhm should be... |
| 15:13 | zphds | oh |
| 15:13 | zphds | and going by the naming convention |
| 15:13 | Fer` | yogthos: maybe I have an error in my code I'll run more tests |
| 15:14 | zphds | I should be renaming make-archive into make-archive! |
| 15:14 | cespare | is that the same C and A as in CLA? |
| 15:14 | zphds | since I have seen that '!' usually means that there is a side effect lurking beneath |
| 15:15 | cespare | haha do you seriously have to mail this thing? |
| 15:15 | ro_st | no! shush! |
| 15:16 | ro_st | don't say it! |
| 15:16 | yogthos | Fer`: so this definitely works (render " {% for x in foo.bar %} {{x}} {% endfor %}" {:foo {:bar (range 5)}}) |
| 15:17 | callen | Fer`: post code please? |
| 15:17 | callen | Fer`: Refheap.com |
| 15:17 | wink | as someone totally oblivious... was clabango too slow? or why selmer? (I take it it's newer?) |
| 15:18 | Fer` | yogthos: this doesnt seem to work (selmer.parser/render "{%for x in foo.0%} {{x.id}} {%endfor%}" {:foo [{:id "s"} {:id "a"}]}) |
| 15:18 | TimMc | wink: s/editors/templating libraries/, actually |
| 15:18 | callen | I've explained this before, but Clabango was too slow and the owner wasn't interested in maintaining it. |
| 15:18 | wink | callen: thanks |
| 15:18 | callen | TimMc: there's peace in the land. Selmer exists. |
| 15:21 | yogthos | Fer`: that wouldn't no :) |
| 15:21 | yogthos | Fer`: foo.0 is a map |
| 15:22 | yogthos | Fer`: this is fine (selmer.parser/render "{%for x in foo%} {{x.id}} {%endfor%}" {:foo [{:id "s"} {:id "a"}]}) |
| 15:22 | yogthos | Fer`: this is also fine (selmer.parser/render "{{foo.0.id}}" {:foo [{:id "s"} {:id "a"}]}) |
| 15:23 | wink | *sigh* wish I'd not used a now-nonmaintained static site generator |
| 15:23 | Fer` | oh im stupid i should have a nested vector |
| 15:23 | bhauman | publishing my next core.async post http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html |
| 15:24 | yogthos | Fer`: no worries :) |
| 15:25 | yogthos | bhauman: nice! |
| 15:25 | ro_st | 69 |
| 15:25 | ro_st | is that a high score, bhauman? |
| 15:25 | Fer` | yogthos: what about this: (render "{%for x in foo.0%} {{x.id}} {%endfor%}" {:foo [[{:id "s"} {:id "a"}]]}) |
| 15:25 | Fer` | i fear i'm being stupid again |
| 15:25 | ro_st | bhauman: i very quickly wanted diagonal matching :-) |
| 15:25 | bhauman | yogthos: thanks, |
| 15:25 | bhauman | ro_st: the original doesn't have it and it makes the game to easy |
| 15:26 | bhauman | the post is on HN now |
| 15:26 | ro_st | makes sense :-) |
| 15:26 | Jblaze | Hello, I am trying to dump a blob from a mssql to file I am able to query and get a resultset but cannot figure out how to right it to bytes any insight? |
| 15:27 | Jblaze | (write) |
| 15:27 | yogthos | Fer`: that might be a bug :) |
| 15:28 | Fer` | yogthos: aw :-( what do you recommend i should do. Flatten my vectors a bit? |
| 15:28 | ro_st | Jblaze: tried (spit "filename" (pr-str data)) ? |
| 15:29 | yogthos | you could do this (render "{%for x in foo%} {% for y in x %} {{y}} {%endfor%} {%endfor%}" {:foo [[{:id "s"} {:id "a"}]]}) |
| 15:29 | yogthos | it's a bit uglier :) |
| 15:29 | ro_st | bhauman: this looks great. i've added it to my CSP queue |
| 15:29 | bhauman | ro_st: thanks :) |
| 15:29 | ro_st | or is that to my CSP channel? |
| 15:30 | yogthos | Fer`: I'll take a look at supporting that though |
| 15:31 | Jblaze | yes it truncates |
| 15:31 | tbaldridge | bhauman: what is the reasoning behind using all the put! vs >! inside a go?. And why use only one channel for the render pipeline, instead of one between each step? |
| 15:31 | Jblaze | unfortunately |
| 15:31 | Fer` | yogthos: Looking forward to it ty |
| 15:34 | bhauman | tbaldridge: I am assuming you are talking about the get-drawing fund. I am just using go as a promise in this case |
| 15:34 | dnolen | bhauman: wow impressive post, no atoms! |
| 15:35 | bhauman | dnolen: thanks, i really appreciate that |
| 15:35 | bhauman | hn votes appreciated ;) |
| 15:35 | bbloom | dnolen: hehe. is that the new purity test? replace all your atoms w/ loop/recur? (inc erlang) |
| 15:36 | bbloom | (inc erlang) |
| 15:36 | lazybot | ⇒ 2 |
| 15:36 | tbaldridge | erlang: "we don't have state...or actually we do, we just hide it inside closures where you can't get at it..." |
| 15:37 | callen | pretty much ^^ |
| 15:37 | bbloom | so i've been thinking more about the "wither actors" thing |
| 15:37 | bhauman | tbaldridge: i am still trying to parse your render pipeline question. My answer is probably that I was just going for a straight forward implementation |
| 15:37 | bbloom | i agree that queues (and hence channels) are preferable |
| 15:37 | bbloom | however, i don't think channels are more primitive, at with respect to concurrency instead of distribution |
| 15:38 | bbloom | i feel like actors : lists :: channels : abstract data types |
| 15:38 | bbloom | +1 of indirection = /2 headaches |
| 15:39 | bbloom | at with => at least with |
| 15:40 | tbaldridge | bhauman: just a thought, you could keep the system almost exactly as you have it, but implement it as a dataflow graph, might be a bit easier to understand the code that way. |
| 15:42 | bhauman | tbaldridge: meaning use more channels to separate concerns? |
| 15:43 | bhauman | tbaldridge: actually not picking up what you are getting at |
| 15:44 | ToBeReplaced | so... how long does it take before i should be able to post issues on jira? |
| 15:45 | tbaldridge | bhauman: I haven't spent a ton of time in the code, but things like select-chan seem a bit odd to me. We're going to read a message from the chan, check it with pred, then throw it out? |
| 15:45 | bhauman | Yep that |
| 15:45 | tbaldridge | IMO, that sounds like someone is putting something into a chan that doesn't belong there. |
| 15:46 | bhauman | tbaldridge: Yep that was used to bleed off events |
| 15:47 | tbaldridge | I think you could get rid of that with a combination of sliding buffers and/or more channels. |
| 15:48 | bhauman | tbaldridge: there is a state problem when someone completes a circuit. And I need to wait until they let go of the screen to consume the draw end event. |
| 15:50 | bhauman | tbaldridge: I agree, I am going to revisit it, drawing is difficult and I used it to handle edge cases |
| 15:50 | dnolen | bhauman: typo, s/cheetsheet/cheatsheet |
| 15:50 | Cho0fool | callen is installing yesod(haskell web frame work) now http://www.qadate.com/images/haha-nelson.jpg |
| 15:51 | callen | I do that about once a month to check to see if cabal is still broken. |
| 15:51 | callen | still broken, for any wondering. |
| 15:51 | callen | Cho0fool: see you in a month! |
| 15:53 | Raynes | callen: They're working on it though. |
| 15:53 | Raynes | The sandbox stuff. |
| 15:53 | Raynes | The only problem with the sandbox stuff is that compiling Haskell takes forever. |
| 15:53 | callen | I was using cabal-dev and it still broke on the first build for a single package. |
| 15:53 | Raynes | Elixir compiles shit at the speed of sound cuz parallel. |
| 15:54 | ystael | Raynes: thank you for clojail! clojail.core/thunk-timeout was just what the doctor ordered yesterday |
| 15:54 | Raynes | You're welcome. |
| 15:55 | Raynes | I wonder if thunk-timeout will work forever. |
| 15:55 | bhauman | dnolen: fixed |
| 15:55 | Raynes | They deprecated .stop ages ago, but haven't actually removed it. Do they ever remove things? Ever? |
| 15:55 | ystael | Raynes: well, for my use case, it only needed to work until 8 PM yesterday :D |
| 15:56 | glosoli | Are there some very popular commercial products written in Clojure ? Just got curious, not that I am judging the language by the products it powers |
| 15:56 | callen | glosoli: Hotelicopter, before they got bought out. |
| 15:56 | callen | Weatherbill |
| 15:56 | dnolen | bhauman: really really fantastic post, read it more or less all the way through. Will give a more in depth review later. |
| 15:56 | callen | a rather large dating site network. a geneaology service. |
| 15:57 | bts- | flightcaster is clojure i think? |
| 15:57 | bhauman | dnolen: lookin |
| 15:57 | bhauman | dnolen: forward to it |
| 15:57 | glosoli | thanks ! :) |
| 15:58 | pmonks | Weathertron (though ClojureScript on mobile) |
| 16:02 | H4ns | sorry for another beginner q: how can i construct a map from an array so that the keys are the values from the array and the values are the results of calling some function with the key as argument? |
| 16:04 | patchwork | H4ns: (into {} (map (fn [k] [k (f k)]) array)) |
| 16:05 | patchwork | Where `f` is your function |
| 16:05 | H4ns | patchwork: ah, so simple! thanks a bunch! |
| 16:06 | patchwork | Yep! clojure is beautiful |
| 16:08 | Raynes | (into {} (map (juxt identity f) array)) |
| 16:08 | Raynes | patchwork: ^ |
| 16:08 | Raynes | : |
| 16:08 | Raynes | :3 |
| 16:08 | yogthos | Fer`: so yeah that was a bug in parsing the keys, I got it fixed and will push out a new version tonight |
| 16:08 | ystael | everything's better with juxt |
| 16:08 | llasram | (inc Raynes) |
| 16:08 | Raynes | ~just |
| 16:08 | lazybot | ⇒ 34 |
| 16:08 | clojurebot | excusez-moi |
| 16:08 | Raynes | ~juxt |
| 16:08 | clojurebot | juxt is the bestest option though if it doesn't weird you out |
| 16:09 | hyPiRion | (zipmap array (map f array)) ;; duh. |
| 16:09 | H4ns | it weirds me quite a bit |
| 16:09 | patchwork | juxt! I should have known if I wasn't using juxt there was something wrong |
| 16:09 | ToxicFrog | Yeah, zipmap was my first through |
| 16:09 | ToxicFrog | *thought |
| 16:09 | Raynes | hyPiRion: You're a bad person. |
| 16:10 | H4ns | woha, juxt. |
| 16:10 | H4ns | thanks. |
| 16:10 | zphds | maybe another topic that can incite some fights in this channel, :), but what is the 'flask microframework' in the clojure world? |
| 16:10 | zphds | lib-noir + compojure? |
| 16:11 | glosoli | what are some best resources around cljs ? |
| 16:11 | yogthos | zphds: http://www.luminusweb.net/ |
| 16:11 | piranha | what's fn*? :) Just saw it in (macroexpand '#(...)) |
| 16:11 | zphds | yogthos: cool, let me take a look... |
| 16:15 | ztellman | piranha: it's one of Clojure's fundamental forms |
| 16:15 | hyPiRion | Raynes: I know. |
| 16:15 | Fer` | yogthos: kk |
| 16:15 | tcrawley | dnolen: you should pressure bhauman to come to the conj |
| 16:15 | ztellman | try macroexpanding (fn [[x y]]) to see how it differs from the normal fn |
| 16:15 | piranha | ah ok |
| 16:16 | piranha | ztellman: thanks! I see now :) |
| 16:18 | gtrak | piranha: if you're really curious: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L46 |
| 16:19 | piranha | so it's actual function, unlike 'fn', which is a fancy wrapper around it |
| 16:19 | piranha | hehe, the same with other destructuring forms, like loop or let |
| 16:19 | cespare | ztellman: I don't get it. |
| 16:19 | cespare | (macroexpand '(fn [x] (+ x 1))) |
| 16:19 | cespare | (fn* ([x] (+ x 1))) |
| 16:19 | gtrak | it's the bottom level that the compiler deals with, after macroexpansion |
| 16:20 | piranha | cespare: (macroexpand '(fn [[x]] x)) |
| 16:20 | tbaldridge | ,(clojure.walk/macroexpand-all '(fn [[x y]] (+ x y)) |
| 16:20 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 16:20 | tbaldridge | ,(clojure.walk/macroexpand-all '(fn [[x y]] (+ x y))) |
| 16:20 | clojurebot | #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk> |
| 16:20 | piranha | gtrak: yes, I see. It was interesting to see (macroexpand '(let [[x] [1]] x)) |
| 16:21 | gtrak | macroexpand is also part of the compiler |
| 16:21 | gtrak | it's recursive, outer-first |
| 16:21 | piranha | sure :) |
| 16:22 | piranha | (fn* ([p__4116] (let* [vec__4117 p__4116 x (clojure.core/nth vec__4117 0 nil)] x))) - are there any optimizations performed further? I.e. dropping first part of let? |
| 16:23 | tbaldridge | there's no point, the JVM jit will remove the vec__4117 p__4116 part |
| 16:24 | piranha | I see |
| 16:24 | piranha | well this is fun stuff :) |
| 16:24 | bbloom | i really wish there was a symbolic representation of the jvm byte code & i could do the moral equiv of a macroexpand on it |
| 16:25 | piranha | too bad compiler is in java, it's a bit harder to read than clojure :-) |
| 16:25 | tbaldridge | bbloom: there is |
| 16:25 | bbloom | piranha: the clojurescript compiler is written in clojure. many important differences, but the structure is illuminating, none the less |
| 16:25 | hiredman | bbloom: well, you mean javap? |
| 16:25 | ztellman | bbloom: https://github.com/gtrak/no.disassemble |
| 16:26 | ztellman | it's really, really useful in certain situations |
| 16:26 | bbloom | oh awesome |
| 16:26 | hiredman | no.diassemble seems kind of meh |
| 16:26 | bbloom | i wish it was in an sexpr form, but i guess i can settle on this |
| 16:26 | gtrak | it's pretty trivial, I'll be the first to admit :-) |
| 16:26 | hiredman | way too much, you can capture the bytecode without all that |
| 16:26 | ztellman | hiredman: it only gives you a pretty-printed version |
| 16:26 | ztellman | which is all the Eclipse debugging library gives you, unfortunately |
| 16:27 | bbloom | still, cool stuff! |
| 16:27 | ztellman | I've toyed with trying to dig deeper, but it's been enough for every situation I've needed to know about the bytecode |
| 16:27 | hiredman | I have a replacement for eval somewhere that captures the bytes of any generated classes |
| 16:27 | piranha | bbloom: but there is a GSoC about doing actual clojure compiler in clojure, right? |
| 16:27 | hiredman | so you don't need an agent, etc |
| 16:27 | bbloom | piranha: yeah, i believe Bronsa is working on that. my understanding is that his plan is to 1-for-1 port the java & worry about making it more idiomatic later |
| 16:27 | bbloom | so it's likely to be some pretty ugly clojure |
| 16:28 | gtrak | hiredman: yea, this was in lieu of modifying clojure itself, or the classloader code. |
| 16:28 | bbloom | maybe even uglier than the original java! :-P |
| 16:28 | piranha | :)) |
| 16:28 | gtrak | it's really a brute-force approach |
| 16:28 | ztellman | I dunno, I just use it as a default plugin, and don't think about it |
| 16:28 | ztellman | I'm wasting literally megabytes of memory, I know, but somehow I survive |
| 16:28 | bbloom | i haven't needed to tune perf down to that level yet, thankfully |
| 16:28 | gtrak | ztellman: I was worried about this, I guess it's not a problem in practice? |
| 16:29 | dnolen | bhauman: HN is so weird, your post got ringed |
| 16:29 | bbloom | dnolen: vote ring detection is a serious issue |
| 16:29 | hiredman | https://gist.github.com/6214648 |
| 16:29 | futile | kill inheritance plz |
| 16:29 | bhauman | dnolen: yeah iot's down at 42 now |
| 16:29 | ztellman | bbloom: you discover some interesting things using it |
| 16:29 | futile | kill complexity plz |
| 16:29 | futile | kill over-engineering plz |
| 16:29 | dnolen | bbloom: as in it doesn't make any damn sense |
| 16:29 | ztellman | for instance, the emitted bytecode for (if (< x y) …) and (if-not (> x y) …) are completely different |
| 16:29 | bbloom | i worked in an office with ~30 startups coming and going. the "PLEASE VOTE UP MY STORY" emails from newbie startup founders were basically a biweekly occurrence |
| 16:29 | ztellman | the former is much, much more efficient |
| 16:30 | bbloom | so posting your story to the same small group, like here in #clojure, a few times in a row is a surefire way to get a story killed |
| 16:30 | futile | kill the prevalent attitude of late that highly encourages and praises all these things plz |
| 16:30 | futile | fin. |
| 16:30 | hiredman | ztellman: is the jitted asm any different? |
| 16:31 | bhauman | dnolen: are you sure it was ringed? |
| 16:31 | ztellman | hiredman: I'm pretty sure it would be, unless the JVM is much more clever than I realized |
| 16:31 | gtrak | hiredman: nice, only downside is you still have to eval stuff manually, that big a deal really. |
| 16:31 | dnolen | bhauman: I can't imagine it getting flagged, it was in the top 10 5 minutes ago. |
| 16:31 | gtrak | not that big a deal, really* |
| 16:31 | dnolen | bhauman: you rarely see drop offs like that w/o ringing |
| 16:32 | ztellman | hiredman: actually, no, I'm sure. The latter was way slower. |
| 16:32 | dnolen | bhauman: of course there could be secret group of Clojure hating flaggers? |
| 16:32 | ztellman | dnolen: or Clojure hating mods? |
| 16:32 | hiredman | ztellman: sure, and you are sure it was jitted in your tests? |
| 16:33 | ztellman | hiredman: I used criterium, I think that absolves me of those sorts of concerns |
| 16:33 | hiredman | I mean, I am not doubting, just curious |
| 16:33 | ztellman | but I wasn't looking at JIT debug prints or anything |
| 16:33 | hiredman | looking at the implementation of if-not it looks like it would be pretty bad |
| 16:33 | bhauman | dnolen: well it's still getting votes and climbing |
| 16:34 | bbloom | HN is a lost cause, i'm pretty sure pg has given up on it at this point |
| 16:34 | ztellman | hiredman: in the slow case, it was a function invocation and a boolean object comparison |
| 16:34 | hiredman | extra function call to not, not has it's own if, etc |
| 16:34 | ztellman | yes |
| 16:34 | bbloom | sshhh nobody tell the hacker community about ltu |
| 16:34 | piranha | bbloom: well it seems there is still nothing better at this point... |
| 16:34 | Bronsa | bbloom: i am actually making it clojure-ish as I write it :) |
| 16:34 | ztellman | and that's not something that would ever happen in Java, so they probably didn't optimize it |
| 16:35 | bhauman | dnolen: perhaps no comments in an hour is an valid algorithm |
| 16:35 | piranha | bbloom: ltu is less general |
| 16:35 | bbloom | piranha: of course. |
| 16:35 | ztellman | hiredman: though I think if-not could just invert the clauses, right? |
| 16:35 | ztellman | no need to actually call 'not' |
| 16:36 | tbaldridge | ztellman: whats this gonna do then? (if-not (mypred? 1 2)) |
| 16:36 | hiredman | ztellman: maybe, also as people don't depend on macro expansion ordering |
| 16:36 | hiredman | as long as |
| 16:36 | ztellman | tbaldridge: there are no clauses in that, I'm confused |
| 16:37 | hiredman | (if-not (foo? 1 2) :a :b) => (if (foo? 1 2) :b :a) |
| 16:37 | tbaldridge | oh, nvm, I understand, just re-order the if/then |
| 16:37 | ztellman | exactly |
| 16:37 | bts- | and if there's no else clause, insert nil for the missing clause |
| 16:38 | ztellman | that would fix the unpredictable performance in the (if-not (< x y) …) case |
| 16:38 | ztellman | but it's not clear if anyone but me cares |
| 16:38 | ztellman | and I can manually reorder, I guess |
| 16:40 | hyPiRion | ztellman: well, it's essentially just changing `(if (not ~test) ~then ~else) to `(if ~test ~else ~then), isn't it? |
| 16:41 | hyPiRion | (in the if-not macro) |
| 16:41 | ztellman | hyPiRion: sure, but I'm not hopeful w.r.t. the chances of a patch on if-not making it into Clojure proper |
| 16:42 | ztellman | maybe someone with more juice could give it a shot |
| 16:43 | bbloom | hyPiRion: that's a broken macro |
| 16:44 | bbloom | ugh wait no, nevermind |
| 16:44 | ztellman | haha, I was going to say, I don't see it |
| 16:44 | bbloom | sorry, javascript on the brain atm |
| 16:47 | TimMc | s/ on if-not// :-( |
| 16:49 | zerokarmaleft | bbloom: LtU is safely of such high caliber that I don't think scrubs would even bother commenting with pretense |
| 16:49 | TimMc | Although apparently the unsigned-bit-shift-right patch might be getting some love, since it is interfering with Clojure-in-Clojure data structures. |
| 16:49 | amalloy | ztellman: start by submitting a patch that turns 'not into an inlining macro that knows about how and, or, <, >=, and all those guys are related, so that it emits simplified forms. then the smaller patch to make if-not less silly will look more friendly |
| 16:50 | hiredman | start by turning if-not in to a macro that uses a SSA representation to examine the predicate... |
| 16:51 | bbloom | zerokarmaleft: i've been attempting to grok everything i see on LtU. it's taken me a few years, but i finally feel like anything that is over my head upon first glance is now at least approachable within an hour or two |
| 16:52 | ztellman | TimMc: https://github.com/ztellman/primitive-math problem solved |
| 16:53 | zerokarmaleft | bbloom: I have a bit more Benjamin Pierce to read on that score |
| 16:53 | ztellman | seriously though, the amount of grief I saved myself by just creating simple wrappers for static Java functions is immense |
| 16:53 | ystael | (inc ztellman) ;; starred, thank you! |
| 16:53 | lazybot | ⇒ 6 |
| 16:54 | hiredman | it would be really nice if the compiler's set of intrinsics was extendable |
| 16:55 | ztellman | hiredman: with the escape hatch of just using java, why does it need to be? |
| 16:55 | bbloom | maybe there needs to be a java* primitive :-) |
| 16:55 | hiredman | or if numbers.java wasn't so gross, or the inlining and intrinsic stuff was more consistent |
| 16:55 | ztellman | bbloom: you've seen alan dipert's javastar library, right? |
| 16:56 | bbloom | lol of course that exists. |
| 16:56 | hiredman | ztellman: because I don't want to write java |
| 16:56 | bbloom | so extensible compilers is a bit of a hobby interest of mine |
| 16:56 | ztellman | bbloom: I think it beats out my local mutable variable hack for sheer hilarity |
| 16:56 | hiredman | I want a core.logic rules and data driven generation of numbers.java and intrinsics.java |
| 16:57 | bbloom | hiredman: have you seen tbaldridge's ssa+datalog stuff? fun things coming :-) |
| 16:57 | ztellman | hiredman: totally understandable, but sometimes it's easier to cut the gordian knot with https://github.com/ztellman/primitive-math/blob/master/src/primitive_math/Primitives.java than by throwing more code and abstractions at the problem |
| 16:57 | hiredman | bbloom: I've not |
| 16:57 | bbloom | tbaldridge: chime in here w/ a link for hiredman |
| 16:57 | hiredman | ztellman: sure |
| 16:59 | hiredman | ztellman: and the end product of what I want would I think be similar, a bunch of static jvm methods, but machine generated ensuring consistency of what is inlined and what isn't, what has intrinsics and what doesn't etc |
| 16:59 | ztellman | hiredman: also a pony |
| 16:59 | hiredman | https://github.com/hiredman/Archimedes/blob/master/src/Archimedes/foo.clj |
| 17:00 | bbloom | ztellman: i don't think it's an impossible request |
| 17:00 | hiredman | actually, that is the old bad one |
| 17:00 | tbaldridge | hiredman: I haven't worked on it in some time (got sidetracked with core.async) but this is a simple type inferencer for SSA code https://github.com/halgari/mjolnir/blob/master/src/mjolnir/ssa_rules.clj |
| 17:00 | hiredman | https://github.com/hiredman/Archimedes/blob/master/src/Archimedes/bar.clj |
| 17:00 | ztellman | bbloom: definitely not impossible, but anything in that vein needs to either do an end run on the compiler, or we need to wait for CinC |
| 17:01 | hiredman | so it generates a bunch of method signatures right now |
| 17:01 | ztellman | either will take a while |
| 17:01 | tbaldridge | core.async trivia.... The SSA dispatch system is extensible. So you can do stupid crazy stuff like this with it: https://github.com/halgari/async-bench/blob/master/src/async_bench/core.clj#L108 |
| 17:01 | bbloom | ztellman: oh yeah, CinC is the gating factor for additional compiler cleverness. i'm sure Bronsa will accept some help :-) |
| 17:02 | hiredman | Mjöllnir is a great word, I have my irssi setup to replace h a m m e r with Mjöllnir every time I type it |
| 17:03 | ztellman | don't get me wrong, I would love to see all this stuff, and I think we've made some great progress towards an extensible compiler in the last year |
| 17:03 | technomancy | I named my guitar that in high school |
| 17:04 | bbloom | tbaldridge: can you elaborate on what's going on there? |
| 17:04 | ztellman | but CinC was discussed at the first Conj, and it has yet to emerge as anything other than "a thing we could do, sometime" |
| 17:04 | TimMc | ztellman: Hmm, nice! (primitive-math) |
| 17:04 | bbloom | tbaldridge: you extended the SSA with a generators/yield operation? |
| 17:05 | ztellman | I'm interested in approaches that aren't gated on CinC that give comparable results, albeit with less elegance |
| 17:05 | tbaldridge | bbloom: right, there's nothing hard-coded in the ioc_macros.clj file for core.async. Everything is handed to the processors at macro expansion time. This means you can define yield/<!/>! etc. |
| 17:05 | hiredman | ztellman: I don't the changes I am thinking of to numbers.java would require CinC |
| 17:05 | bbloom | tbaldridge: awesome. i was trying to make some sense of ioc_macros & see how extensible it was. i was curious if i could use it to implement non-determinism |
| 17:05 | ztellman | hiredman: oh, maybe I was misunderstanding, you want to modify numbers.java itself? |
| 17:06 | bbloom | tbaldridge: looks like i could |
| 17:06 | bbloom | tbaldridge: looks like this yield is as general as the one described in here: http://lambda-the-ultimate.org/node/4349 |
| 17:06 | tbaldridge | bbloom: this is a simpler example, but done with an "identity" function. That is, it does a state-machine translation, but with no change in the resulting semantics: https://github.com/clojure/core.async/blob/1aff841e2d1f5cd7b35b2ea232d10187ce268888/src/test/clojure/clojure/core/async/ioc_macros_test.clj#L14 |
| 17:07 | TimMc | ystael: Did you ever figure out why unchecked-add was giving you overflow exceptions? |
| 17:07 | tbaldridge | So most of the core.async code is tested against this "runner" macro. it really simplifies testing alot |
| 17:07 | TimMc | 'cause that was pretty freaky |
| 17:07 | bbloom | tbaldridge: that's awesome |
| 17:07 | ztellman | TimMc: yeah, I used it to make https://github.com/ztellman/immutable-bitset/blob/master/src/immutable_bitset.clj |
| 17:07 | hiredman | ztellman: generate a replacement numbers.java (and maybe intrinsics.java, and maybe generate jvm bytecode directly, no .java) using data describing numeric types, the operations on those types, and rules for what kind of operations are allowed on what types, and what return values are allowed for what types |
| 17:07 | bbloom | tbaldridge: i really like the idea of viewing computation effects as pausing a sub process & communicating with the parent process |
| 17:08 | TimMc | ztellman: Immutable bitset... a.k.a. BigInteger? :-D |
| 17:08 | bbloom | tbaldridge: fits my brain much better than the delimited continuations view of the world. shift/reset is just mind melting, even though i can generally understand them given enough time to work it out on paper |
| 17:08 | ztellman | TimMc: leaner in the sparse element case, and actually looks like a Clojure set |
| 17:09 | tbaldridge | bbloom: yeah, I'm interesting in exploring how this sort of thing could be used in more bizarre examples, for example, parsers. I wonder how many monads we can kill in the process :-P |
| 17:09 | TimMc | Hmm, cool. |
| 17:09 | ztellman | also has a transient variant, so you're not forced to clone the bit array each time |
| 17:09 | bbloom | tbaldridge: in theory, you can kill *all* the monads. i'm pretty sure that yield == delimited continuations == monads |
| 17:09 | ztellman | haha |
| 17:10 | tbaldridge | bbloom: that's my theory as well, but I have no proof. |
| 17:10 | bbloom | tbaldridge: luckily, the PL community has proven it for you! |
| 17:10 | bbloom | i just finished groking a pile of this stuff |
| 17:11 | ystael | bbloom: can you recommend a bibliography or reference list? or is it more "read LtU and chase links for a sufficiently long time" ? |
| 17:11 | ystael | TimMc: no, i think that was temporary repl gremlins, i never saw it again |
| 17:11 | bbloom | http://okmij.org/ftp/ is a great place to start |
| 17:11 | bbloom | over the past 6 months or so, i've been basically trying to understand everything that guy has ever touched :-) |
| 17:11 | ystael | bbloom: oh. "To begin, become as smart as Oleg." Got it. :D |
| 17:12 | bbloom | ystael: start reading :-) |
| 17:13 | ztellman | on a non-Clojure note, is anyone reading the Hyperloop pdf? |
| 17:13 | bbloom | tbaldridge: so yeah, oleg & shan and spj and a few other folks have written about how a generalized version of yield (with both input and output) actually macro expresses single-level delimited continuations |
| 17:13 | tbaldridge | bbloom: nice! I'm going to read that paper then |
| 17:13 | bbloom | tbaldridge: multi-level delimited continuations & full continuations are basically GOTO, so that's a bad plan |
| 17:14 | bbloom | tbaldridge: yeah, definitely read that. then there is one other one you need to read about "handlers"… let me find this for you |
| 17:15 | bbloom | tbaldridge: http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/ |
| 17:15 | bbloom | that's the one |
| 17:15 | bbloom | it's in an ocaml-like language, which is much more pleasant to read than haskell IMO ;-) |
| 17:16 | bbloom | anyway, the idea there is that instead of delimited continuations, you have "handlers" and then you run a piece of code inside a handled block |
| 17:16 | tbaldridge | (inc bbloom) |
| 17:16 | lazybot | ⇒ 12 |
| 17:16 | bbloom | just like spinning off a sub process |
| 17:16 | bbloom | the way you implement things like dynamic-wind (ie finally blocks) is you just run the sub process, then when the sub process is done, you do your cleanup code |
| 17:16 | bbloom | the way you do things like dynamic bindings is you yield with a message "hey, give me the binding of X" and the parent process either responds or forwards the request up the chain |
| 17:17 | bbloom | this pattern lets you create a process tree that can cleanly handle computational effects |
| 17:17 | bbloom | and there is a really clean algebraic treatment of this approach as well |
| 17:18 | callen | bbloom: thinking of giving a talk on monads at my company. Should I explain them in terms of meteorites or burritos? |
| 17:18 | bbloom | i just wish we had macros with dynamic-extent :-( it would be so nice to have non-local transforms into SSA |
| 17:19 | ztellman | callen: monads are like a Lovecraftian horror... |
| 17:19 | tbaldridge | callen: I prefer to look at them as red-headed step-children |
| 17:20 | bbloom | tbaldridge: let me know once you've battled your way through those two papers. would love to hear your thoughts |
| 17:20 | tbaldridge | will do |
| 17:20 | callen | bbloom: you want dynamic extent? |
| 17:25 | ystael | speaking of theoretical background, where is a good place to start for foundations behind core.async ? the CSP book ? |
| 17:25 | bbloom | tbaldridge: even without dynamic extent, it would be *bad ass* to build a pluggable effect system w/ the ioc macros. let me know how i can help if you decide to attempt that :-) |
| 17:28 | bbloom | ystael: the golang community is a great source for the *practical* background |
| 17:28 | bbloom | ystael: the theoretical background is yeah, the CSP stuff, plus SSA |
| 17:28 | cmatheson | ystael: i agree with bbloom, i've started going through the csp book but so far go code has been more helpful for writing core.async stuff |
| 17:29 | bbloom | there are also deep parallels to CPS (note the transposed P and S) and the various continuations work from the FP community |
| 17:29 | ystael | bbloom: (= (acronym-expand-1 "SSA") "static single assignment") ? |
| 17:29 | bbloom | true |
| 17:29 | bbloom | csp = communicating sequential process; cps == continuation passing style |
| 17:30 | bbloom | although i'm no longer a believer in unencapsulated, reified continuations |
| 17:30 | ystael | bbloom: in the sense of Scheme "full call/cc" ? |
| 17:31 | bbloom | yeah |
| 17:31 | bbloom | even in that second paper i linked, where they do reify delimited continuations as functions |
| 17:31 | bbloom | they don't allow the continuations to escape (i think) |
| 17:33 | bbloom | tbaldridge: you should totally open source a core.yield library too. i think people would totally dig that as well |
| 17:35 | ystael | bbloom: having trouble finding the precise reference for the "first paper" you mentioned above |
| 17:35 | ystael | (oleg, shan, spj) |
| 17:36 | bbloom | it's linked right on top of http://lambda-the-ultimate.org/node/4349 |
| 17:36 | bbloom | http://parametricity.net/dropbox/yield.subc.pdf |
| 17:36 | ystael | bbloom: cool, thank you! |
| 17:37 | bts- | bbloom: unencapsulated == undelimited? |
| 17:38 | bbloom | bts-: unencapsulated meaning you can edit or inspect them |
| 17:38 | bbloom | (outside of debugging, i mean) |
| 17:38 | bts- | i see. thanks |
| 18:17 | hiredman | I did a little yield macro for a restartable json encoder I was thinking about |
| 18:18 | hiredman | https://github.com/hiredman/json/blob/master/src/com/thelastcitadel/cps.clj |
| 18:29 | Fer``` | read-string and edn/read-string seem really buggy with windows files |
| 18:30 | hiredman | 1. read-string doesn't have anything to do with files 2. you have a bad default encoding |
| 18:31 | Fer` | I have a config file i wrote on linux that gets parsed fine but when i open it in readme on windows and make a change read-string doesnt even return nil o.o |
| 18:31 | Fer` | hiredman: sorry i do (read-string (slurp file)) |
| 18:32 | Fer` | well the file is originally encoded in utf-8 and then i open it with notepad |
| 18:32 | hiredman | 1. that is a gross way to files 2. have you checked the output of slurp? |
| 18:32 | hiredman | 3. what is returned? |
| 18:33 | Fer` | hiredman: the same file only with crlf. Also what would be better than that? |
| 18:33 | hiredman | slurp reads the entire thing in to memory as a string |
| 18:33 | Fer` | yeah it returns a string with crlf |
| 18:33 | Fer` | and read-string silently blows up or something it doesnt return anything |
| 18:34 | hiredman | reading the entire config file in as a string in order to turn and around and hand ti the clojure reader via read-string is silly |
| 18:34 | hiredman | Fer`: that isn't possible |
| 18:34 | hiredman | Fer`: your repl must be broken, how are you running the code? |
| 18:35 | hiredman | a bare clojure.repl? lein repl? slime? nrepl? counter clockwise? |
| 18:36 | Fer` | hiredman: nrepl: https://www.refheap.com/17541 |
| 18:36 | hiredman | what nrepl client? |
| 18:36 | Fer` | mm how do i know that |
| 18:36 | hiredman | how do you start it? |
| 18:37 | Fer` | i do nrepl-jack-in on emacs |
| 18:37 | hiredman | what version of nrepl.el? |
| 18:37 | hiredman | I guess it doesn't matter |
| 18:38 | hiredman | are you using something like the latest? |
| 18:38 | hiredman | where did you get your nrepl.el? |
| 18:38 | Fer` | it says 0.1.8 |
| 18:38 | Fer` | from emacs live |
| 18:39 | Fer` | well anyway it's broken if i uberjar my program and do java -jar anyway. the configuration values get turned to nil after i make any change |
| 18:39 | hiredman | Fer`: they can't get "turned to nil" |
| 18:40 | Fer` | hiredman: but that's what happenning :-( |
| 18:40 | hiredman | Fer`: most likely you are trying to read a file that doesn't exist, you should be using resources from the classpath (clojure.java.io/resource etc) |
| 18:40 | Fer` | no the file is outside the jar |
| 18:41 | hiredman | Fer`: what happens if you java -cp the-uber-jar clojure.main |
| 18:41 | hiredman | then try to slurp your file |
| 18:44 | Fer` | hiredman: it seems to slurp fine i guess, there are some weird characters where there should be accents (it's in spanish) but that's prolly because of the dumb windows console |
| 18:46 | Fer` | read-string still fails though and it returns a ? |
| 18:46 | Fer` | at least that's what the windows console tells me :'P |
| 18:47 | hiredman | Fer`: could be, or could be a dodgy windows encoding, which the jvm will use if you don't tell it to use something non-crazy |
| 18:47 | hiredman | ~encoding |
| 18:47 | clojurebot | Cool story bro. |
| 18:47 | hiredman | ~google jvm file encoding |
| 18:47 | clojurebot | First, out of 75300 results is: |
| 18:47 | clojurebot | utf 8 - Setting the default Java character encoding? - Stack Overflow |
| 18:47 | clojurebot | http://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding |
| 18:47 | upwardindex | I've read that parsing EDN on the client side is about 3 times slower than json, anyone has looked at how much faster EDN generation is on the server side compared to cheshire? |
| 18:56 | yogthos | Fer`: ok selmer 0.3.8 is up on clojars and should work as expected ;) |
| 18:57 | ztellman | upwardindex: I wouldn't assume it's faster |
| 18:57 | ztellman | jackson, the library that cheshire uses, is heavily optimized |
| 18:58 | Fer` | yogthos: nice |
| 19:01 | Fer` | well, making the file from scratch in notepad works but porting it from linux then modifying in notepad breaks everything. Why is programming so hard :-( |
| 19:02 | justin_smith | notepad bug? |
| 19:02 | Fer` | Uhm well i can't expect people to modify configuration files in windows with anything else |
| 19:03 | hiredman | notepad does ascii, so if you have weird characters in there editing the file in notepad will break it |
| 19:03 | Fer` | I guess i can try removing the non english characters |
| 19:05 | Fer` | hiredman: is this better? (with-open [in (PushbackReader. (FileReader. path))] (edn/read in)) The other way seemed more succint :') |
| 19:06 | hiredman | yes, but you can use clojure.java.io/reader and clojure.java.io/file instead of FileReader |
| 19:06 | Fer` | ty for your time |
| 19:13 | hiredman | http://pythonforbiologists.com/index.php/29-common-beginner-python-errors-on-one-page/ this is great |
| 19:14 | technomancy | hiredman: you gonna make a clojure one? |
| 19:15 | justin_smith | [does it work in the repl but not in -main] -> [does your code use map or for?] |
| 19:15 | hiredman | "did you get an exception?" - yes -> "did you read it?" - no -> "which public school system failed you?" |
| 19:15 | justin_smith | hah |
| 19:16 | justin_smith | reading clojure stacktraces is a special kind of literacy, thanks to laziness in particular |
| 19:16 | technomancy | "Maybe we can still find something to talk about. Like how you let your family down." |
| 19:16 | technomancy | http://achewood.com/index.php?date=09232002 |
| 19:21 | ToxicFrog | Man, that flowchart is way too optimistic |
| 19:22 | ToxicFrog | [Do you get an error when you run the code]--yes-->[What type of error do you get]--don't know, didn't read it-->[Ok, so read it]--I already closed the terminal-->[Run the program again, then]--how?-->[I'm leaving now to drink heavily] |
| 19:24 | justin_smith | imagine if people tried to work that way in the real world "I tried to buy bread at the store it didn't work" "how didn't it work?" "I asked the guy for the kind of bread I wanted and he said something but didn't give me bread" "what did he say?" "I dunno" |
| 19:25 | ToxicFrog | I know |
| 19:26 | bja | pretty sure people I know actually do that |
| 19:26 | ToxicFrog | And yet, a depressing number of people - and not just people attempting to program - react to error messages by closing them instantly, without reading them |
| 19:26 | ToxicFrog | As if reading them would somehow CRASH THEIR BRAIN or something |
| 19:26 | ToxicFrog | bja: yes? That wasn't hyperbole on my part, that was drawn from years of watching people taking first-year CS |
| 19:27 | ToxicFrog | Unless you mean the bread |
| 19:27 | ToxicFrog | In which case I have no idea |
| 19:27 | bja | yeah, I've seen the first year cs thing, but I was talking about the generic non-computer stuff. in particular, with cars. |
| 19:27 | ToxicFrog | welp now I'm even more sad |
| 19:29 | futile | bruh |
| 19:30 | ToxicFrog | How does it work with cars? |
| 19:36 | johnmn3 | hey, I'd like to use an nrepl with a file that I am accessing from the browser using a file:///... url, rather than served up from a server on localhost |
| 19:37 | johnmn3 | I'm getting: Uncaught Error: URI file:/robots.txt is invalid for field ppu |
| 19:37 | bja | Mostly the same but dealing with indicator lights. I spent a non-trivial amount of time doing ECM testing for vehicles. It was part of my job to triage reports from suits driving prototypes. Getting some to tell you which indicator light was on was a hassle. Extracting any sort of report on what happened leading up to the indicator light never actually happened unless the person who found it was formerly an engineer. |
| 19:41 | bja | Indicator lights are the world's easiest debug message. There are N different ones, and you should be able to communicate by asking them to point it out in a picture then finding out of it was solid or blinking. |
| 19:42 | johnmn3 | "cross origin requests are only supported for HTTP." |
| 19:43 | bja | johnmn3: python -m SimpleHTTPServer 8080 |
| 19:43 | bja | johnmn3: a lot of browsers will section off interesting things from file:/// |
| 19:44 | bja | running a simple http server from the directory of your static html will help |
| 19:45 | johnmn3 | bja: so how does one brepl to an app they are developing for the phone that is html5 based, but mostly offline? or even desktop-based web-apps? I guess I could fire up a server but it seems like a hastle |
| 19:46 | bja | johnmn3: I suppose that would depend a lot on how your phone's browser engine handles file:/// requests |
| 19:47 | bja | johnmn3: it might be that something like webkit as a widget for android/iphone/whatever has relaxed rules on hitting, file:/// |
| 19:47 | johnmn3 | aye |
| 19:50 | noprompt | the number of stars frak has received over the past 24hrs is bit disturbing. is the problem it attempts to solve really that big of an issue for programmers? |
| 19:51 | noprompt | nevertheless it's cool that people think it's interesting enought to star. :) |
| 19:52 | technomancy | more libraries should have a "Why?" section in the readme |
| 19:52 | hyPiRion | noprompt: hey, don't complain. My most starred project is a hello world program. |
| 19:53 | noprompt | technomancy: i included a "Why?" section. although the answer is both snarky and truthful. :) |
| 19:53 | bja | johnmn3: https://groups.google.com/forum/#!topic/phonegap/meQSrujEsTo seems to indicate that XHR requests to file:/// are kosher on android's webview atleast |
| 19:53 | technomancy | noprompt: yeah, that's what I mean; you're setting a good example =) |
| 19:53 | noprompt | hyPiRion: no complaints here! |
| 19:53 | johnmn3 | bja: you rock! |
| 19:53 | hyPiRion | good =) |
| 19:54 | bja | johnmn3: you might look at phonegap's java scaffolding for android to see how they initialize their webkit to be consistent |
| 19:54 | bja | might be able to consult their scaffolding for iOS/etc too (or just use phonegap...) |
| 19:55 | noprompt | technomancy: my only hope is that if anyone plans to use it seriously, they ask themselves the same question. |
| 19:55 | johnmn3 | bja: yea, using phonegap |
| 19:56 | bja | johnmn3: that makes me want to try to build a clang-based phonegap app now. thanks for killing my free time. |
| 19:56 | noprompt | i must say that guy guns deserves some credit. he's the one that actually verified whether the patterns frak was generating were really *that* much more efficient. |
| 19:57 | noprompt | hyPiRion: you could turn your hello world project in to a repository for how to say hello in X language. then you could get some PRs! |
| 19:57 | noprompt | :P |
| 19:59 | hyPiRion | noprompt: hah, no. I'm actually happy with it just the way it is, stars doesn't really matter =) |
| 19:59 | noprompt | hyPiRion: i tend to agree. :) |
| 20:00 | noprompt | if anything, i hope people get the battlestar reference. lol. |
| 20:05 | noprompt | i love it when i edit a conflicting diff and delete the part i actually wanna keep. love it. <3 |
| 20:07 | bja | noprompt: hope your editor has an undo tree |
| 20:09 | noprompt | bja: i did a git rebase -i (which i never do) had a conflict, editted, committed, then realized i fraked it up. |
| 20:10 | noprompt | bja: iow, i can't fix it. i'm gonna have to rewrite the code from memory. |
| 20:10 | bja | maybe it mirrored somewhere and you hadn't pushed yet? |
| 20:11 | noprompt | bja: no, i did a git push -f right after. ha! |
| 20:11 | awalters | noprompt: if you once committed it, it's in the reflog |
| 20:11 | noprompt | fortunately it wasn't to master! |
| 20:11 | awalters | it's only if you haven't committed/stashed that you can really lose stuff |
| 20:11 | noprompt | awalters: oh rly? |
| 20:12 | awalters | http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html |
| 20:12 | awalters | it's always been something i need to read about when i need it...which thankfully is less and less |
| 20:12 | awalters | but it has saved my ass |
| 20:12 | noprompt | awalters: well, this is good information. thanks! |
| 20:13 | awalters | np. good luck! |
| 20:15 | noprompt | awalters: that's pretty neat. wow, you saved me some trouble. |
| 20:15 | awalters | great thing to know about in these situations. hopefully they don't come up often :-) |
| 20:18 | noprompt | indeed. this is the first time i've had this problem. i try to avoid using git rebase -i because i like to keep my commit history. this is probably another good reason to avoid it. |
| 20:19 | noprompt | interesting. does this mean that git commit history is immutable? |
| 20:19 | tieTYT | i've taken this idea from stuart sierra I think in my JS code. Basically he says everything is a map. You pass in your world to a function and every function returns a world-type. This way a lot of your program can be written like this: (-> world a b c d e f) and you can rearrange everything without refactoring signatures |
| 20:19 | tieTYT | anyone know what I'm talking about? I'm hoping i didn't pervert the spirit of his suggestionm |
| 20:19 | bbloom | noprompt: modulo garbage collection |
| 20:19 | technomancy | noprompt: yes; basically only refs change in git |
| 20:19 | bbloom | git help gc |
| 20:20 | technomancy | which sounds awfully familiar |
| 20:20 | noprompt | bbloom: am i going to have to read a paper? :P |
| 20:20 | tieTYT | JS isn't purely functional and I basically use the same idea in my game. Most functions take a gameState object which is very similar to a Map |
| 20:20 | bbloom | technomancy: no idea what you're referring to. what could possibly be similar to immutabile+gc ? |
| 20:20 | noprompt | that's very cool. |
| 20:20 | bbloom | noprompt: nope :-) |
| 20:21 | technomancy | bbloom: if only programming languages had support for a kind of "references" which could point to different immutable things over time |
| 20:22 | bbloom | technomancy: yeah, and then just like we've got non tracking tags and tracking branches and various kinds of ways to talk about commits. what if we had different kinds of "references" that do different things when they point to different immutable things over time? |
| 20:23 | technomancy | it's so crazy it just might work |
| 20:23 | noprompt | bbloom: did you go to college? someone was suggesting i should skip it and just read papers. can't remember if that was you. |
| 20:23 | bbloom | i went to college, but skipping it and just reading papers is a whole lot cheaper |
| 20:23 | noprompt | * dreads returning to college in a week. |
| 20:23 | bbloom | i dunno if i recommended that |
| 20:24 | bbloom | my actual opinion is far more nuanced |
| 20:24 | bbloom | but if your choice is college+debt, i recommend not-college+not-debt |
| 20:24 | noprompt | bbloom: i have something like 13 classes to complete before completing my bs, which amounts to about 20K. i'm debating whether the ROI is really going to be worth it since it's gonna take me 3 more years at the current rate. |
| 20:25 | ztellman | noprompt: 4 classes a year? |
| 20:25 | noprompt | ztellman: i work full time and don't want to get C's. |
| 20:26 | noprompt | ztellman: but yeah, basically. maybe 5 if i can take a course during the summer. |
| 20:26 | cmatheson | noprompt: i was doing 1 class a semester by the end, you'll make it eventually |
| 20:26 | noprompt | i might be able to test out of something but i would still have to pay for the units i believe. |
| 20:29 | hiredman | noprompt: what do you think the return on the degree will be, if you are already working fulltime, do you expect a salary bump, or are you not working in your field already? |
| 20:29 | bbloom | i should also add that i studied comp sci for 4 years and learned more in 3 months at google than in 4 years at school |
| 20:30 | bbloom | most undergraduate CS curriculums are a fucking joke |
| 20:31 | noprompt | hiredman: i'm not sure. mostly i've continued to go out of the fear not having the degree would hurt me somehow later in life. |
| 20:32 | ztellman | bbloom: what did you work on at google? |
| 20:32 | bbloom | translate.google.com |
| 20:32 | ztellman | ah, that'd be a good one |
| 20:33 | bbloom | was certainly jumping in the deep end |
| 20:33 | noprompt | hiredman: i do work fulltime as a programmer, but i make peanuts. i figure if i have a degree and a good OS profile i'd be able to land a much better job with better pay. it seems however a good OS profile can get your pretty far though so i've been debating the degree. |
| 20:33 | ztellman | I got stuck doing GWT frontend development, got out pretty quickly |
| 20:33 | bbloom | ouch. |
| 20:33 | hiredman | noprompt: yeah, that is an understandable concern |
| 20:33 | noprompt | bbloom: you are right about the undergrad CS courses being a joke. |
| 20:33 | bbloom | mine was more like "oh, hey. you don't know *anything* about machine learning or distributed systems? you've got a < 4 month internship to make one of the world's largest NLP systems faster. GO." |
| 20:34 | bbloom | learned fast. |
| 20:34 | ztellman | ha, yeah |
| 20:34 | hiredman | not understandable in the sense that I've seen that happen or something, but understandable in the sense that it is something I worry about sometimes :) |
| 20:34 | ztellman | My paperwork got lost after I got an offer, basically I just got put in a team in the SF office that had a slot |
| 20:34 | ztellman | no allocations, no nothing |
| 20:35 | bbloom | ztellman: i dunno about now, but in 2007, google's HR department was a black hole |
| 20:35 | technomancy | the most important thing I learned in my CS classes was how to configure wifi and stuff on linux so I could actually use my laptop to learn things while in my classes |
| 20:35 | bbloom | technomancy: why was that always so difficult? |
| 20:35 | ztellman | bbloom: they actually let most of them go ~2008, and had an 18 month hiring freeze |
| 20:35 | bbloom | there was some insane mac address entry form thinggie that didn't take normally formatted mac addresses |
| 20:35 | ztellman | I came in right at the end of that, everyone was a new hire |
| 20:35 | noprompt | hiredman: one thing that i do have at my job which makes up for the pay is the creative freedom i have. it's given me the opportunity to spend most of the year programming in clojure. |
| 20:35 | bbloom | ztellman: yes, i know about that hiring freeze. it's why i wound up working on xbox |
| 20:35 | bbloom | that's when i graduated |
| 20:36 | ztellman | it was a total mess, my recruiter got fired right after my offer, which is how I got lost |
| 20:36 | ztellman | unbeknownst to me, since I was taking a month off between jobs |
| 20:36 | ztellman | not a great initial experience |
| 20:36 | technomancy | bbloom: this is back when hardware on Linux was actually hard |
| 20:36 | bbloom | i got this phone call telling me they wanted to make me an offer but couldn't make me an offer. i was like "yeah, ok, whatever" as i was holding the phone to my ear with my shoulder & signing the xbox offer |
| 20:36 | technomancy | c. 2003 |
| 20:36 | bja | intro to digital systems (logic gates, debugging, misc number systems) was an important class for me because it really forced me into a more structured way of debugging systems |
| 20:37 | cespare | for a different perspective, I feel that college was completely worth it for me. Although I worked really hard to get undergrad + masters in 4 years, to maximize my value. |
| 20:37 | cespare | I found it easy to land a really good job right out of school (with the help of a professor I worked with a lot) and paid off all debts in < 2 years. |
| 20:37 | bbloom | technomancy: that's probably the OTHER time i learned a lot about CS during my college years: we had this ipaq linux devices in the lab & the wifi was so damn flaky that we couldn't actually do any of the research the group normally did (which was shit) so i fixed the wifi kernel module |
| 20:37 | bbloom | technomancy: barely knew what a kernel was, much less how to write a kernel model when i started |
| 20:38 | technomancy | haha; nice |
| 20:38 | hyPiRion | "paid off all debts in < 2 years" -> Whoaa, where did you work you say? |
| 20:38 | bbloom | my coworkers loved me, but apparently i didn't get enough research done |
| 20:38 | bbloom | nevermind the 100X productivity boost to everybody else |
| 20:38 | bbloom | ultimately quit when i was sick of having to go fight for my late pay checks |
| 20:38 | cespare | hyPiRion: haha, i didn't |
| 20:38 | noprompt | what really pisses me off about the CS program at CSUF is they won't offer the compilers course, even with a signed petition because they are scared the students will all drop. |
| 20:38 | cespare | hyPiRion: also my parents paid half of my undergrad, so maybe it would've been four years without help. |
| 20:38 | bbloom | noprompt: that's what really upsets me. it's a fucking business |
| 20:39 | cespare | noprompt: wtf, i think your problem is a half-assed CS program. |
| 20:39 | callen | Intentional symbol capture in a small family of macros all conforming to a known contract (aforementioned symbol) - kosher/not-kosher great idea/best idea? |
| 20:40 | bbloom | the engineering program at my school had a 50% first year drop out rate. the next year, they reworked it, & it had a 95% first year success rate (estimating numbers) meanwhile, the following year, the professors were all like "THESE KIDS DO NOT KNOW SHIT" and practically striked |
| 20:40 | noprompt | cespare: well there's not much i can do about it but get through it, i guess. |
| 20:40 | bbloom | so the school expanded it's easier offerings and make it much simpler to change majors, then made the engineering program marginally harder again lol |
| 20:40 | noprompt | bbloom: was the strike successful? |
| 20:40 | technomancy | bbloom: sturgeon's law for undergrads |
| 20:41 | cespare | bbloom: at my school the intro CS was in scheme and had a super high dropout rate, and that was considered a feature not a bug |
| 20:41 | jcsims | there are some key things I get from my CS education, but also very important things from my own studying and several internships |
| 20:41 | bbloom | noprompt: only in the sense that the school expanded it's liberal arts offerings & pushed really hard to retain paying students who left the engineering program, such that the engineering program could recover |
| 20:41 | callen | cespare: excellent. :) |
| 20:41 | bbloom | tuition diversification, i call it |
| 20:42 | noprompt | * should have remained a math major. |
| 20:42 | bbloom | cespare: i think that high drop out rates are a feature iff the kids who pass come out dramatically better for it |
| 20:42 | cespare | bbloom: yeah there could be many reasons. |
| 20:42 | bbloom | cespare: failing kids for the sake of failing kids is bad. i don't care if those kids work hard and learn something and then ALSO fail |
| 20:43 | bja | bbloom: I've never really seen a place that fails people for the thrill of doing it |
| 20:43 | bbloom | bja: i've seen a few teachers do it |
| 20:43 | hyPiRion | bja: You've never been to Europe |
| 20:43 | noprompt | bja: have you heard of test first? lol. |
| 20:43 | hyPiRion | "Oh, the exam was too easy? We should apply a normal distribution on it" |
| 20:44 | bbloom | bja: i had a professor who basically graded everyone on an absurd curve, such that by week 3 of the course, most kids dropped the class expecting to fail. he did this simply so that he'd have less homework to grade so he could focus on grant-seeking nonsense |
| 20:44 | bja | hyPiRion: most of my profs decided to just make exams extremely difficult to score well on |
| 20:44 | hyPiRion | "Oh, the exam was too hard, and over 50% failed? *shrug*" |
| 20:44 | bbloom | bja: he admitted this publicly after the last day to drop passed |
| 20:44 | ztellman | bbloom: don't the TAs do the grading, typically? |
| 20:44 | bja | (and hten making those classes mandatory for any engineering undergrad) |
| 20:44 | bbloom | ztellman: not if you're such a dick that nobody wants to be your TA |
| 20:45 | ztellman | ha, well |
| 20:45 | hyPiRion | (dec shitty professor) |
| 20:45 | lazybot | ⇒ -1 |
| 20:45 | callen | (inc tenure) |
| 20:45 | lazybot | ⇒ 1 |
| 20:45 | hyPiRion | bbloom: that sounds like a nightmare |
| 20:45 | bja | ah, I guess I had mostly sane profs for the few years I went to university |
| 20:46 | bbloom | hyPiRion: the full version of this story can only be told over beer and off the record :-) |
| 20:47 | hyPiRion | heh |
| 20:48 | noprompt | colleges also seem very interested in investing in rediculously over the top gyms and dorms while at the same time neglecting to focus on education. |
| 20:48 | bbloom | i'm pretty down on the state of education |
| 20:48 | bbloom | don't depress me. |
| 20:48 | callen | noprompt: gyms can be shown to high school seniors and their parents. |
| 20:49 | noprompt | callen: this is true. a part of the marketing pitch for the resort they'll be sending their kids to. |
| 20:49 | bja | callen: so can dorm rooms. but spending money on a fancy gym was way more important than dry dorms |
| 20:51 | noprompt | bbloom: aparently cursive is eventually going to be a thing of the past, joining the ranks of the arts and physical activity. |
| 20:51 | noprompt | bbloom: because, you know, america needs an army of critical thinkers and art and physical activity, well, they play no role in that. |
| 20:53 | callen | physical activity is a good way to make your brain perform better. |
| 20:53 | callen | speaking of, time to coffee up for today's hoist. |
| 20:53 | bbloom | noprompt: dude, hate to break it to you, but cursive went away in the early 90s |
| 20:53 | noprompt | callen: that was part of the point i was making. |
| 20:54 | noprompt | bbloom: what? naw. i remember learning cursive in the early 90s. |
| 20:54 | bbloom | noprompt: cancelled it when i was in grade school |
| 20:55 | noprompt | bbloom: well it's news to me! |
| 20:55 | jodah | n00b Q: I'm hitting some "unable to resolve symbol: ", in two different situations, when attempting to load/reload a file. what causes this? |
| 20:56 | bbloom | yeah, fuck cursive :-) |
| 20:56 | patchwork | I don't remember the last time I wrote by hand at all |
| 20:57 | patchwork | I had to write a check the other day, I almost forgot how to do my signature |
| 20:57 | bbloom | patchwork: that was me for a while, but i find it is *sometimes* useful to draw shapes WITH A PENCIL and label things & what not |
| 20:57 | patchwork | it was strangely alien |
| 20:57 | bbloom | i'm more of a notes-in-vim sorta guy |
| 20:57 | bbloom | but it's just not the right tool for box and line diagrams |
| 20:57 | noprompt | patchwork: i find that solving problems on paper/whiteboard helps me find solutions to problems more efficiently than hacking on them. |
| 20:58 | bbloom | (inc whiteboard) |
| 20:58 | lazybot | ⇒ 1 |
| 20:58 | patchwork | bbloom: Right! I make boxes and arrows with a pencil |
| 20:58 | patchwork | just not words |
| 20:58 | callen | bbloom: I definitely had to learn cursive in the 90s. |
| 20:58 | callen | I need an at-home whiteboard. I need an at-work whiteboard too for that matter. |
| 20:58 | callen | Gerd dermmert. |
| 20:59 | technomancy | I've got a roll of butcher paper for my lap |
| 20:59 | technomancy | lab |
| 20:59 | noprompt | that's it. i'm officially starting a campaign to bring back cursive. lazy ass kids these days. we need to restore america's education system! starting with cursive! |
| 20:59 | callen | technomancy: do you just slap the roller on the wall or something? |
| 20:59 | noprompt | i just discovered there's this stuff called idea paint which you can use on your walls to effectively turn it in to a giant dry/erase board. |
| 21:00 | callen | noprompt: I'm sure my landlord would love that. |
| 21:00 | noprompt | http://www.ideapaint.com/ |
| 21:00 | ztellman | noprompt: it doesn't erase very well |
| 21:00 | jcsims | noprompt: I've seen blackboard paint as well |
| 21:00 | callen | most walls are probably too textured for it to erase well. |
| 21:00 | ztellman | I think it's more than that, ink adheres better than it does on an actual whiteboard |
| 21:00 | noprompt | callen: fuck your landlord. he'll change his mind once he's seen the added value. |
| 21:01 | ztellman | either way, lots of ghostly past ideas |
| 21:01 | noprompt | but i do have to admit ztellman is write, you really gotta wipe it down. |
| 21:01 | bbloom | ztellman: i actually found that the idea paint in my last office building was the *nicest* whiteboard in there |
| 21:01 | patchwork | ztellman: One half of basic I/O |
| 21:01 | bbloom | erased very well |
| 21:01 | bbloom | i think there are several grades of quality of the stuff |
| 21:02 | noprompt | "write" was on purpose. i sware. |
| 21:02 | ztellman | I'm a write-only sort of guy |
| 21:02 | ztellman | bbloom: very possible, I never procured the stuff, just used it where it was already up |
| 21:07 | noprompt | bbloom: that's good to know, i'll have to do some research before i use it at home. i've only used the stuff once and my experience was similar to ztellman's. |
| 21:10 | bbloom | could just be that the other whiteboards were double shitty |
| 21:10 | bbloom | :-) |
| 21:11 | callen | Clojure web discussion: https://www.refheap.com/17547 |
| 21:21 | technomancy | callen: I stick it up with thumbtacks |
| 21:22 | callen | technomancy: immutable whiteboard. I like it. |
| 21:22 | technomancy | callen: unfortunately no structural sharing =( |
| 21:23 | callen | butcher paper isn't a HAMT. Sorry. |
| 21:25 | callen | technomancy: any opinions on intentional symbol capture as part of a contract? |
| 21:47 | noprompt | bbloom: thanks for giving me the idea to use a trie. it made my dreams come true. now i have to fix this shitty algorithm. |
| 21:47 | bbloom | i don't recall giving you that idea either, apparently my memory is going. but rock on data structures! |
| 21:49 | noprompt | bbloom: yeah, i'm pretty sure it was your idea to use a some kind of a trie. i've been kicking around the idea of using DAWG but i'm still learing about how to implement them. |
| 21:49 | bbloom | what operations are you preforming on this data structure? |
| 21:50 | `cbp | callen: hi |
| 21:50 | noprompt | bbloom: the whole idea behind frak is you give it a vector of strings and it gives you a regular expression for matching those strings. |
| 21:51 | bbloom | gotcha |
| 21:52 | noprompt | bbloom: i'm using a word trie which keeps track of which branches are terminal, etc. so when the pattern is compiled it knows which parts of the pattern are optional ie bar(?:n(?:aby)) |
| 21:52 | noprompt | the input there being ["bar" "barn" "barnaby"] |
| 21:53 | noprompt | i was thinking that a DAWG might make it possible to keep the overall data structure thinner. |
| 21:53 | noprompt | but going from a DAWG to a regex is probably more complicated. wit the trie it's pretty damn easy. |
| 21:56 | noprompt | bbloom: have you used a DAWG before? |
| 21:56 | bbloom | nope |
| 21:59 | gfredericks | I add :profiles {:logic {:dependencies [[org.clojure/core.logic "0.8.3"]]}} to my project.clj |
| 21:59 | gfredericks | and then `lein with-profile logic repl` fails to start, not finding nrepl code |
| 22:00 | dnolen | ztellman: I finally understand your point about core.async and implementing take-while - I suppose take-while could return the "rest" of the input channel |
| 22:01 | ztellman | dnolen: yeah, but I don't know how useful that is |
| 22:01 | ztellman | without some sort of peek or pushback behavior, it's probably not something you'd want to expose |
| 22:03 | dnolen | ztellman: I think take-while is pretty useful, you can simulate push back by implementing something like concat |
| 22:04 | ztellman | dnolen: if I'm understanding what you're suggesting, that creates a cascade of channels that grows by one each time you call take-while |
| 22:04 | ztellman | unless you have some way to flatten it out when the prefixed message is consumed |
| 22:05 | dnolen | ztellman: that's a thought, but you are correct - I don't you want to use it all the time |
| 22:05 | dnolen | ztellman: however reading over this http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html |
| 22:05 | dnolen | made me see the possible utility, or maybe there's some other way to eliminate the redudancy |
| 22:06 | dnolen | in his blog post he has three cases where he want to consume up to a certain point - and the code is more or less the same |
| 22:08 | ztellman | yeah, I'm not sure what the right way to handle that is |
| 22:08 | dnolen | something to ponder ... |
| 22:08 | ztellman | there's probably still that issue that I opened way back when I was first looking through the code, but the conclusion at the end of that was that I didn't see an elegant way to add it in |
| 22:09 | ztellman | you can do it in Lamina pretty easily, but the interaction with the queues is a lot more involved as a result |
| 22:09 | ztellman | I'm not clear that's a good trade-off |
| 22:11 | dnolen | hmm I suppose it could be avoided with sentinel values |
| 22:11 | dnolen | like it is everywhere else |
| 22:12 | ztellman | right, in Lamina you have (read-channel* :predicate f :on-false ::false) |
| 22:12 | dnolen | k |
| 22:12 | dnolen | thanks |
| 22:13 | ztellman | but now that means that instead of returning a message from inside the thread-safe queue consumption, you're returning information about whether the message was consumed |
| 22:42 | mindbender1 | is there an idiomatic way of nesting aget calls in cljs? |
| 22:42 | mindbender1 | like get-in in clj |
| 22:43 | ambrosebs | mindbender1: isn't aget variadic? |
| 22:43 | technomancy | gfredericks: try `with-profile +logic` instead |
| 22:44 | technomancy | you're replacing the :base profile from whence the nrepl dep coms |
| 22:44 | mindbender1 | ambrosebs: I'm not sure about that |
| 22:45 | mindbender1 | I'm getting wrng number of args |
| 22:45 | mindbender1 | *wrong |
| 22:45 | ambrosebs | mindbender1: I think it should work. |
| 22:45 | ambrosebs | mindbender1: code? |
| 22:47 | mindbender1 | ambrosebs: yeah, it works. Thanks |
| 22:47 | gfredericks | technomancy: thanks |
| 22:47 | ambrosebs | ok |
| 23:01 | muhoo | that routing handler discussion is interesting. lol at whoemver wrote "g hold up" as a comment tho. and i like the idea of turnign refheap into pirate pad. but how do you contribute/edit it? |
| 23:01 | muhoo | i'm tryign to edit the doc, and it ain't lettin me |
| 23:07 | muhoo | oh well i forked it fwiw https://www.refheap.com/17551 |
| 23:14 | bbloom | for all the awesomeness of core.async & the ioc macros…. i'm really sad i can't use it with HOF |
| 23:18 | noprompt | apparently the pattern i generated to match every word in /usr/share/dict/words is hoax. so says the internet. |
| 23:21 | tbaldridge | bbloom: HOF? |
| 23:21 | bbloom | higher order functions |
| 23:21 | bbloom | sorry for the unnecessary acronym |
| 23:21 | Raynes | Don't ever apologize HOFmeister. |
| 23:21 | tbaldridge | bbloom: yeeeahhhh....I have some thoughts on those lines, nothing workable yet. |
| 23:22 | tbaldridge | bbloom: although we're in the same boat as C#/F#/Haskell, it's just with being a dynamic language and all we can't hide it like Haskell does |
| 23:23 | bbloom | tbaldridge: wouldn't you need to do full defunctionalization? |
| 23:23 | bbloom | tbaldridge: i've started attempting to implement the effect handlers idea in that second paper |
| 23:25 | noprompt | Raynes: HOFmeister. lol. |
| 23:25 | tbaldridge | bbloom: that'd be one way, like I said, nothing worth talking about yet. I just wish we could do stuff like (map <! chan-seq) |
| 23:25 | bbloom | tbaldridge: if you do that, then i'd need to (defmacro <3 [tbaldridge] ...) |
| 23:25 | tbaldridge | lol |
| 23:25 | bbloom | while i got you here |
| 23:25 | callen | `cbp: hi! |
| 23:25 | callen | `cbp: http://www.reddit.com/r/Clojure/comments/1k8v72/a_discussion_a_couple_of_colleagues_and_i_had/ |
| 23:26 | bbloom | tbaldridge: i'm curious if there is a way to hook non-terminal positions in the ioc macros |
| 23:27 | tbaldridge | bbloom: currently no. You'll notice that :Return is a special case. My plan was to allow for the override of any SSA instruction, but I can't figure out a way to justify it as a commit to core.async :-) |
| 23:27 | `cbp | callen: do we have any plans to support {% for x,y in foo %}? |
| 23:28 | `cbp | right now it turns that into :x,y :-P |
| 23:28 | callen | `cbp: that's...a really good point. |
| 23:28 | callen | yogthos: ahem ^^ |
| 23:28 | callen | yogthos: comma-based destructuring of for loop iterators? |
| 23:28 | tbaldridge | bbloom: the first incarnation of core.async had full blown generator support, but I yanked it out since it was considered "confusing" by the powers-that-be. So long-term I wonder if we couldn't yank the ioc stuff from core.async and put it into its own lib. |
| 23:29 | bbloom | tbaldridge: i'd be interested in that, but the further this thing gets pushed, the more it's gonna look like a full blown compiler :-P |
| 23:29 | bbloom | here's my use case for hooking things: |
| 23:33 | bbloom | ok so in that second paper, the one on algebraic effect handlers, they define a version of ocaml with two sub languages. one is the "expression" language and the other is the "computation" language. basically, expressions are inert and computations have operational semantics. in the concrete syntax, they inject "val" expressions into the computation language which wrap expressions and force evaluation. the "val" expression is treated as |
| 23:33 | bbloom | a computational effect, just the same as an exception handler's catch block for example |
| 23:33 | bbloom | the idea is that evaluation is a computational effect |
| 23:33 | bbloom | but you can "intercept" evaluation and modify the result via a "val" handler |
| 23:33 | bbloom | it's basically your hook into the monad (*cringe* that i said that) |
| 23:33 | bbloom | so you can define `val x = [x]` |
| 23:34 | tbaldridge | bbloom: so you want to intercept individual function calls? |
| 23:34 | clojurebot | function is <Chouser> there is one class per fn, one instance of it per closure |
| 23:34 | bbloom | tbaldridge: i'm not precisely sure what points i want to hook |
| 23:34 | Phil_D | I'm having a hell of a time trying to develop with the REPL. I'm using Cheshire to encode JSON — and Monger to interface with my MongoDB database. I'm doing something *very* simple, such as encoding a query from Mongo to JSON: |
| 23:34 | Phil_D | (generate-string model/find-all-models) |
| 23:34 | Phil_D | This works totally fine in production when I set a Compojure route to spit the data out as JSON, but when I try to do the exact same thing in nRepl (proper namespace and all), I get: |
| 23:34 | Phil_D | "JsonGenerationException Cannot JSON encode object of class: class org.bson.types.ObjectId: 52099f9a0364ddb5b182ffa5 cheshire.generate/generate (generate.clj:147)" |
| 23:34 | Phil_D | I cannot get my head around why one works and the other doesn't. It's incredibly inconvenient because now I have no way of productively parsing the response with functions on the fly. What do I do? |
| 23:34 | bbloom | i guess i want to hook any expression which would be evaluated, yielding a value |
| 23:34 | bbloom | so like (let [x (some thing here)] ...) |
| 23:34 | callen | `cbp: I'll email it. |
| 23:35 | callen | er...github issue it. |
| 23:35 | `cbp | callen: okk |
| 23:35 | bbloom | i want execution to pause at (some thing here) and trigger something like a terminal |
| 23:35 | bbloom | basically insert extra states for ever time an expression is evaluated |
| 23:36 | tbaldridge | bbloom: isn't that what pause does in the runner macro? |
| 23:36 | tbaldridge | in that case it simply continues to the next block, but wouldn't that do it |
| 23:36 | bbloom | yeah, but the pause is explicit |
| 23:36 | bbloom | i want to insert it explicitly at keep points |
| 23:37 | bbloom | and pause would also apply a function to the value before sticking it back in to the state map |
| 23:37 | dnolen | Phil_D: do you have a classes directory lying around in your project directory? |
| 23:37 | tbaldridge | bbloom: would the (some thing here) be known at compile time? |
| 23:38 | bbloom | yes. they happen at particular points in the syntax of the primitives. hold on, let me find the precise description in this paper |
| 23:39 | Phil_D | dnolen: I have a 'models' directory that holds functions to insert documents to the database as well as query collections. |
| 23:40 | callen | `cbp: it's up. Good find! |
| 23:41 | bbloom | tbaldridge: eh. it'd be easier if you just read that paper. i know you'd be excited by it anyway, so i'm just gonna assume you'll read it |
| 23:41 | bbloom | :-) |
| 23:41 | tbaldridge | bbloom: lol, yeah, I'll try to get to it soon |
| 23:41 | bbloom | tbaldridge no rush of course. i'm just dicking around |
| 23:42 | dnolen | Phil_D: I mean are you somehow loading the wrong classes? did you ever AOT? you may have a classes directory lying around then. |
| 23:42 | `cbp | callen: :-) I'm reading your chat |
| 23:42 | bbloom | tbaldridge: for now, i'm gonna do the explicit thing, like pause |
| 23:43 | dnolen | Phil_D: http://github.com/dakrone/cheshire/blob/master/src/cheshire/generate.clj#L147 |
| 23:43 | dnolen | Phil_D: it looks like you're passing in something cheshire cannot handle |
| 23:45 | Phil_D | dnolen: Yeah, it doesn't like the ObjectId. that Monger is adding to the map I'm trying to encode. The only thing is that Cheshire doesn't care about that in production. It just serializes the ObjectId. as a string. My application works fine, but the behavior somehow changes in the REPL that throws that error. |
| 23:46 | dnolen | Phil_D: I'd be wary about that conclusion "Chesire doesn't care" |
| 23:46 | dnolen | Phil_D: there's probably something else going on. |
| 23:46 | `cbp | "What if context-free grammars were as easy to use as regular expressions?" And here I'm thinking that regular expressions are anything but :-/ |
| 23:46 | dnolen | Phil_D: the fact that it works in production is likely a distraction, it should *never* work |
| 23:48 | Phil_D | dnolen: Hmmm. On the front-end I'm using ClojureScript with an AngularJS app that interfaces with the JSON — it's still "works". The calls are very straightforward. I can paste in a code bit to pastebin. |
| 23:49 | dnolen | Phil_D: I don't really have time to dig in, but based on the error you're passing in the wrong thing. Pass in the right thing at the REPL and it will work. |
| 23:50 | Phil_D | dnolen: Gotcha. It could be the way I'm interfacing with the REPL. I've had mixed results (I'm just beginning Clojure development). |
| 23:52 | callen | Phil_D: are you using Clang? |
| 23:52 | dnolen | Phil_D: As far as I can tell has nothing to do w/ your REPL setup at all :) your code that magically works in production is incorrect or you're doing something different and not realizing it. |
| 23:53 | callen | `cbp: the problem with regex is that they can be dense and the syntax isn't great. look at the markdown parser that was written with Instaparse. |
| 23:53 | callen | `cbp: look at this: https://github.com/chameco/Hitman/blob/master/src/hitman/core.clj |
| 23:53 | callen | ridiculously awesome. |
| 23:54 | dnolen | callen: damn |
| 23:54 | callen | dnolen: I'm considering writing an experimental validating lexer and parser for Selmer with Instaparse :) |
| 23:55 | `cbp | I considered instaparse for a split second for selmer before i did a simple state machine and then yogthos was all like nahhhh lets use mine |
| 23:55 | callen | I'm actually trying to make certain, in the meantime, that expressing the template lang in terms of a CFG is possible, if it isn't, I'll cut off the full parser part. |
| 23:55 | callen | `cbp: sadly yogthos' was further along and you weren't online to consult on something. Sorry about that :( |
| 23:56 | `cbp | it's ok his is prolly faster/better anyway |
| 23:56 | Phil_D | dnolan: even if I'm using nRepl with Emacs? Like, I'm throwing entire buffers into the REPL for evaluation. |
| 23:56 | Apage43 | I just got to use instaparse for a thing |
| 23:56 | Apage43 | was nice |
| 23:56 | callen | `cbp: proooobably. The current design of Selmer is essentially based on the actual DTL implementation, but 6x less code. |
| 23:56 | callen | Apage43: went well eh? |
| 23:56 | Apage43 | yep |
| 23:57 | Apage43 | thing works |
| 23:57 | callen | `cbp: Selmer is like ~1k LOC. DTL is ~6k |
| 23:57 | Apage43 | end users get (relatively) useful errors when they do something wrong |
| 23:58 | callen | Apage43: oh really? Could you show me an example? |
| 23:58 | callen | Apage43: error handling is actually our primary concern atm. |
| 23:58 | callen | now that performance has been conquered (haha, perverse priorities :) |
| 23:59 | brehaut | callen: that hitman code is awesome |