#clojure logs

2013-08-12

00:05xeqiblr: you could use standard ring sessions, or perhaps stateful sessions from lib-noir
00:08BufferUnderpantsAlright, so I have this multimethod in Clojurescript...
00:09blrxeqi: ok, any caveats with ring sessions - would that be appropriate for storing an 150-200k deserialised document?
00:09BufferUnderpantsAnd I'm trying to dispatch on type
00:10BufferUnderpantsHow do I do it for a string?
00:10BufferUnderpantsThe compiler is ominously outputting "WARNING: Use of undeclared Var my.namespace/String"
00:16xeqiblr: 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:16blrso I will probably need to use something like ring-jdbc-session and h2
00:17xeqiblr: or just save it in a db normally, and store an id to it in the session
00:17blrxeqi: I'm not legally allowed to persist this data
00:18xeqi:/
00:18brehauthi blr
00:18blrso effectively I only want it to live as long as the api client's session
00:18blrhey brehaut :)
00:18brehautblr: i havent looked at the scroll back in detail, but memcached?
00:19brehautor is that still to persisted
00:19blrsure that would work actually
00:20brehautblr: are you using some clojure at your place of employment?
00:21blrthinking about it :)
00:21brehautnice :)
00:21blrhave you used spyglass brehaut? api looks nice enough
00:21brehauti havent even heard of it
00:21brehautlink?
00:21clojurebotunlink: and constantly is just a function that takes any arguments and returns whatever argument is given
00:21blrhttp://clojurememcached.info/articles/getting_started.html
00:22brehauthuh
00:24brehautblr: that looks pretty straight forward
00:24blryeah, I think I'll give that a shot, thanks
00:24brehautblr: nice that connections arent dynamically bound
00:25brehautand the clojurewerkz guys seem to do decent librarys
00:33callenbrehaut: more importantly, documentation
00:34blryes, we like documentation
00:43dnolenBufferUnderpants: js/String
00:44dnolenBufferUnderpants: you can't refer to global things outside of CLJS without js/foo
02:00xsynHi all
02:00xsynwhat's the best way to run a jetty app in production?
02:00xsynbehind nginx?
02:55papyrushi
02:56papyruswww.clojure.org is dead. why ?
02:56papyrusi want to get information about clojure , but i can't.
02:59katratxopapyrus: try without the www
02:59papyrusno. it does not work.
03:00Foxboronworks here.
03:00jack_rabbitpapyrus, it's fine here.
03:00katratxopapyrus: it works for me
03:00papyrusi am in korea.
03:00jack_rabbitpapyrus, try a different DNS server.
03:00jack_rabbitAnd clear your DNS cache.
03:01callenpapyrus: 8.8.8.8 and 8.8.4.4
03:01papyrusthanks.
03:01papyrusi will try.
03:02supersymor opendns if you care about security/privacy a bit more ;0
03:02supersymscrew up a smiley how typical monday morning
03:03supersymmornin'
03:04jack_rabbitsupersym, looks like a monday morning smiley.
03:04jack_rabbit;0
03:04jack_rabbit^What I look like on Monday morning.
03:05morrifeldmanIs it possible to get 'lein test' to run in color?
03:10supersymlol
03:11supersymmorrifeldman: I doubt its built in natively but you could use something like https://github.com/ams-clj/clansi
03:17morrifeldmansupersym: Thanks! clansi looks pretty cool.
03:48H4nsanother 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:50TEttinger,(map $(:x (val %)) {:a {:x 1} :b {:x 2}})
03:50clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: $ in this context, compiling:(NO_SOURCE_PATH:0:0)>
03:50TEttinger,(map #(:x (val %)) {:a {:x 1} :b {:x 2}})
03:50clojurebot(1 2)
03:50TEttingerthat's a pretty terse example
03:50H4nsnice, thanks!
03:51TEttingerif you wanted more self-explanatory, H4ns, there's ##(map (fn [kv] (:x (val kv))) {:a {:x 1} :b {:x 2}})
03:51lazybot⇒ (1 2)
03:52TEttingermapping 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:52H4nsTEttinger: #(...) is "equivalent" to (fn [%] ...), is that right?
03:52TEttingeryes
03:52H4nsi like that, thanks!
03:53TEttingerand it works with ,(#(+ %1 %2 %3) 5 7 9)
03:53TEttinger,(#(+ %1 %2 %3) 5 7 9)
03:53clojurebot21
03:53H4nsi like terse. when i want verbose, i can always return to common lisp :)
03:53TEttingeryou can have a lot of arguments I think, not sure what the max is but you usually only need one or two
03:54TEttinger% is the same as %1
03:55H4nsTEttinger: thanks again! i can go for here. i'll probably ask some more beginner level questions until someone gets annoyed and tells me.
03:56TEttingerhaha
03:56TEttinger`google 4clojure
03:56TEttinger&google 4clojure
03:56lazybotjava.lang.RuntimeException: Unable to resolve symbol: google in this context
03:56TEttingerI don't know what the bots have for syntax
03:56TEttinger4clojure is great
03:57TEttingersimple-seeming clojure problems for beginners, and as you get better they get harder
03:58H4nsTEttinger: nice. putting that onto my list of things to do.
04:10supersymH4ns: 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:03callenI didn't have fantastic luck with LightTable, although it's nifty and I get the appeal of it.
05:03callenI'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:04Foxboronshoudl write a stacktrace parser
05:04Foxboronshould*
05:06taliosIntelliJ's LaClojure has a responably good(ish) debug story the last I looked at it
05:06taliosdepending on your code I guess :)
05:07supersymcallen: I get that... and admittingly, it (lt) does also hide/obfuscate some reader stuff from plain sight
05:07ro_sthave you guys tried ritz?
05:08ro_sthugod gave a comprehensive demo of it at ClojureWest
05:08ro_stnot sure if the vid is up yet
05:08supersymalso 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:08supersymro_st: nop
05:08clojurebotTitim gan éirí ort.
05:08supersymlol wut?
05:08supersymsilly bot
05:09benediktHow do i get the ip adress of the connecting client in clojure.contrib/socket-server?
05:09callensupersym: 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:09callenI really just want a nice debugger for Clojure.
05:17benediktand what is is the backlog parameter?
05:19mercwithamouthis 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:19benediktnevermind, that was straight from java (saw when i looked at the source)
05:20ro_stmercwithamouth: you might want to look at nightcode.info too
05:21mercwithamouthro_st: =P not bad
05:21mercwithamouthi 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:22ro_sti'm sure there are folks hard at work making clojure wholly available on android
05:23mercwithamouthNice...
05:24paomianwho use compjure
05:24ro_stlots of us!
05:24ro_stcompojure, anyway
05:25paomianI can not understand it
05:26callenmercwithamouth: I'm pretty sure ibdknox is using LightTable while making LightTable.
05:26callenthat's probably how he knows what to improve.
05:26mercwithamouthcallen: very true...i have to say so far the user experience isn't bad at all
05:26callenit could fairly be called a non-trivial project, but ultimately the IDE/editor you use...really isn't important.
05:28callenusing 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:29mercwithamouthcallen: now that i agree on. i talked to him briefly when i first peeked at clojure and this chatroom
05:30Okasusupersym: "You fall without rising." -- bot said.
05:32Okasucallen: 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:34callenyep, I tried nrepl-ritz and limit-break.
05:34callenboth are broken in their special snowflake ways, making both essentially useless.
05:34callenI sincerely hope I never write code that truly *requires* a debugger in Clojure, because on that day, I will be fucked.
05:35Okasucallen: Ha-ha, true that.
05:35ro_st+1. write code that doesn't need debugging.
05:35ro_stnot always possible, but doable a lot more than you'd otherwise think!
05:35callener, yeah.
05:36callenI've definitely run into plenty of code that requires it and it's totally unavoidable.
05:36callennot 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:36callenin Python, that is.
05:36ro_stof course. i guess it depends entirely on what sort of thing you're doing
05:36ro_stif you're writing device drivers, you're going to need a debugger. a rest service, notosomuch :-)
05:37callenyou'd think so, but when you're using hairy frameworks like Django...
05:38callenwith LazyRefs and the like skulking about...
05:38ro_stah, i'm talking about with Clojure
05:39callenoh sure.
05:39ro_stall bets are off when it comes to using sOOp
05:40ro_stsOOP
05:45Apage43and.. yeah
05:46Apage43my project now has a tiny embedded expression language
05:48Apage43instaparse made that easier than I expected
05:57ro_stnice Apage43
06:07H4nsis clojure.tools.trace the recommended way to trace?
06:10noncomif i want to have a record with mutable fields, do i simply make the fields atoms or agents?
06:11Apage43if you *really* need to, why not just put the record in an atom?
06:13noncomApage43: 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:13Apage43do your particles affect each other?
06:13noncomso i think that a whole record in the atom will have a bigger footprint (esp. when scaled up to 1000000 record instances)
06:13H4nswhen i added a new depencency to my lein project, can i fetch and load it without restarting my jvm?
06:14Apage43actually regardless of that
06:14noncomApage43: yes, in general case particles must be able to interact with each other
06:14ro_stH4ns: look at github.com/cemerick/pomegranate
06:14ro_stnoncom: this is probably one of the times it's probably best not to use immutable datastructures
06:14Apage43i'd put the whole particle system in an atom
06:15ro_stfor performance reasons. if you do want to, though, an atom which gets updated once per 'frame' of computation
06:15H4nsro_st: thanks
06:15Apage43right. So the renderer can (deref) the one atom that holds the whole system
06:15ro_stwith the whole world in it. otherwise you're looking at the bazooka of mutation, STM with refs
06:15Apage43and has a snapshot it can work off of to draw with
06:15ro_styes
06:16noncomwell, yes, i definitely not need immutability in this very place of the system
06:16noncomif only clojure would let to jump away into the mutable world for in-place computations...
06:16noncomsigh.
06:16Apage43transient/persistent!
06:16ro_stnoncom: nothing stopping you from doing that
06:16Apage43or just use java types
06:17noncomyes, 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:17ro_stthere's nothing wrong with -local- mutation
06:18noncomi could store all the system i a couple of big nio buffers
06:18Apage43transient/persistent! are still useful, for the reason I mentioned aboe
06:18noncomro_st: nothing wrong, except for that it is rather cumbersome in comparison to java's i = i++
06:18noncomomg i just wrote shit
06:19noncombut never the less, int a = 5; int b = a + 1; ... whats faster?
06:19Apage43you 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:20noncomso ok, should i store the records in transient structures?
06:20noncomor only coordinates?
06:20noncomwhat about boxing/unboxing for numbers?
06:20Apage43no, you just write the update function you'd normally write if you weren't using transients
06:20Apage43then .. hm
06:20Apage43hard to explain transients
06:21noncomi know what they are..
06:21noncombut i am not accustomed with patterns of their use
06:21Apage43transients really shouldn't leave the function they're created in, typically
06:22noncomso a particle that has x, y and z coordinates
06:22ro_stnoncom: i'd suggest solving your problem 'in the slow' with idiomatic clojure, and then bringing in defrecord / transients etc to improve the performance
06:22noncomi have the slow solution already, so it is the time
06:22ro_stand using a good old atom to store your world in from calc-step to calc-step
06:23noncomfor me it came out that using a {} of atoms is faster than using an atom of {}
06:23ro_stok. then you're in research land to find how defrecord, transients, or coding against java colls directly will help you
06:23noncomro_st: yeah, that's what i was feeling like for the past couple of days...
06:24noncomstill, 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:24noncom?
06:26ro_stto be perfectly honest, i don't know. i've never used records or transients before
06:27noncomyeah, me too have no big experience with those... just used transients a couple-o-times...
06:29noncomi 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:33Apage43sketch of what I'm thinking https://www.refheap.com/17520
06:34clgvnoncom: what exactly is your question on transients?
06:36Apage43derp derp
06:36Apage43edited some things i just forgot to type in there
06:51mercwithamouthare 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:52Ember-mercwithamouth: new libraries etc, core language is pretty much the same
06:52Ember-at least I don't remember any differences out of the blue
06:52Ember-there might be some
06:53cemerickmercwithamouth: 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:53clgvmercwithamouth: you could also read the O'Reilly one
06:54Ember-reducers are cool but their use scenario is pretty limited
06:54mercwithamouthEmber-: ok, as long as there haven't been major syntax/fundamental changes ..which i suppose would never be the case
06:54Ember-when they are useful, they really are
06:54mercwithamouthclgv: yeah i'm using the oreilly one now.
06:54Ember-mercwithamouth: no syntax changes or anything like that
06:54Ember-or well, usage of :use is today preferred to be done via :require
06:54Ember-but :use is still there
06:55mercwithamouthtoo rich for my blood at the moment, reducers
06:56clgvmercwithamouth: you can learn the basics with older books but need to get the updates after that...
06:58Apage43reducers basically fit where you're transforming a collection into a value (which may be another collection)
06:58mercwithamouth->> is the same as 'reduce'?
06:58Apage43emphasis on collection, not sequence
06:58cemerickApage43: the tl;dr is that reducers superset transients
06:58Ember-mercwithamouth: no, that's used on function chaining
06:59Apage43cemerick: that's a good way of putting it
06:59Ember-(->> foo (bar 1)) is same as (bar 1 foo)
06:59Apage43I'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:59mercwithamouthahh i see
07:00mercwithamouthhttps://gist.github.com/jaycfields/3804058/raw/439d5f921d87764923ecc9f190006952a3594464/gistfile1.clj
07:00Ember-mercwithamouth: and you can pass as many function as you like after ->>
07:00mercwithamouth^ ...i like o_O;
07:00Ember-(->> foo (bar 1) (blergh 3)) is same as (blergh 3 (bar 1 foo))
07:02Apage43its there basically to move stuff around to be nicer to read
07:02mercwithamouthhmm i'll touch on that later. i'm jumping around. i just saw it in a blog post
07:03mercwithamouthbut after you said chaining the example made immediate sense
07:06noncomApage43: sorry, been away for lunch, now examining the code...
07:08noncomclgv: 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:09noncomideally 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:09clgvnoncom: oh. unboxed values are only possible in `vector-of` afaik.
07:10noncomfor example, what about (unboxed ... ) for that, just like (transient!)
07:10noncomi guess not possible for tech reasons..
07:10noncomclgv: oh, sad..
07:12noncomApage43: 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:13Apage43well you could use (vector-of)s instead of records for the same thing
07:16clgvnoncom: 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:16clgvs/double/doubt/
07:17Apage43https://www.refheap.com/17522 ; as vector-ofs
07:17noncomwhen i used to program in java, i had to write "public" many times and i often missed the "l" letter for some reason...
07:19clgvwell ordinary reduce will box the values again
07:20noncomApage43: 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:21clgvnoncom: you'll need primitive functions as well to avoid boxing
07:21noncomclgv: ugh, right...
07:22clgvnoncom: and a reduce like macro that expands to a loop-recur. since anonymous functions cant be defined as primitive functions atm
07:22noncomso i may as well go back to java for all that part of my program..
07:23clgvnoncom: depending on your current knowledge that might be the faster option.
07:23noncomand cleaner i think
07:24noncomclgv: do you mean that if my knowledge of clojure was better, i could avoid java fallback?
07:24clgvnoncom: not encessarily. for example there is a lib to do fast computations on arrays which has the kind of macros I just mentioned
07:25noncomhiphip?
07:25clgvnoncom: I just needed to google the name. might be the one. it was mentioned with core.matrix on the mailing list
07:27clgvnoncom: yes, I think thats the one I meant
07:27noncomalright, i will do more explorations and measurements on this side, before going to java!
07:27clgvnoncom: but arrays are mutable, so you have to be careful there in case you want to use immutable specific features of clojure
07:28noncomclgv: immutability is often of no need in complex calculation algos
07:29noncombut still concurrency... needs it..
07:29clgvnoncom: I know. usually you can convert the overall result to an immutable data structure for the analysis phase...
07:34mercwithamouthhow would one go about adding two lists??? (+ (list 1 2 3) list (4 5 6)) ???
07:34lazybotmercwithamouth: How could that be wrong?
07:34mercwithamouth???
07:34lazybotmercwithamouth: How could that be wrong?
07:34mercwithamouththought so =P
07:36clgv,(map + '(1 2 3 4) '(5 6 7 8))
07:36clojurebot(6 8 10 12)
07:36clgvmercwithamouth: ^^
07:37noncommercwithamouth: clgv: probably better use vectors, not lists?
07:41clgvnoncom: what do you mean?
07:42noncomi mean that is not it better to use vectors for working with collections of numbers?
07:43clgvnoncom: he wanted to know how to add a list of numbers hence the example.
07:44cemerickif you're using apply, map, etc., lists and vectors are equivalent
07:48benediktHow cam i can do (.start (Thread. (fn [] (do-stuff)))) in a lein-repl without importing it from Java first?
07:49benedikts/cam/come
07:50clgvbenedikt: you can write out the full class name. but maybe you just want to use (future (do-stuff))
07:50benediktclgv: what?
07:50benediktclgv: i'm asking why I did *not* have to import it from the java namespaces
07:51clgvbenedikt: oops read it wrong. it is java.lang.Thread then. java.lang is imported automatically
07:51benediktclgv: ah, that explains it. :)
07:51benediktclgv: what did you think i was asking and what problem does using (future ..) solve?
07:52noncomfuture is same as Thread stuff you described. all clojure functions implement Runnable..
07:52clgvclgv: I thought you ask the negation and it might be java.util.concurrent.Thread or something ;)
07:52clgvI read it to quickly
07:53clgvbenedikt: `future` does almost the same. except that it uses a threadpool with a fixed maximum number of threads
07:53clgvbenedikt: and you have easier access to the return value of the calculation
07:54benediktclgv: so you can use `future` instead of interoping with java to start a new thread?
07:54Ember-you really should use futures with concurrent programming
07:54Ember-in java too
07:55Ember-http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html
07:55clgvbenedikt: informally speaking yes. you should use future in clojure instead of creating a thread yourself
07:56Ember-and in Java you should use Executors... :)
07:56Ember-instead of firing of raw threads yourself
07:56Ember-of+f
07:56benediktclgv: i'm sort of new to clojure yet and i learn stuff by hacking away with it informally, so informal explenations are fine.
07:56clgvbenedikt: fine :)
07:56Ember-if you start your thread like that you lose all control of it from the outside world
07:57benediktso instead of writing (.start (Thread. (stuff))) i should just do (future (stuff)) ?
07:57Ember-with futures you can do all kinds of stuff if you wish
07:58Ember-benedikt: (future (stuff)) will create a future, but does not launch it
07:58clgvbenedikt: yes. you can do (let [f (future (do-stuff))] (println "wait for result - results =" @f))
07:58Ember-benedikt: http://clojuredocs.org/clojure_core/clojure.core/future
07:58clgvEmber-: thats just plainly wrong!
07:58Ember-clgv: you are right
07:59Ember-I had to rethink, I was wrong with that statement
07:59Ember-it *is* launched
07:59Ember-had to actually launch REPL to check if what I just said was bullshit
07:59Ember-and it was
07:59benediktI 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:59Ember-sorry :/
07:59benediktEmber-: :) happens
07:59Ember-anyway, you can deference the future to get the return value
08:00Ember-which blocks until the thread is ready
08:02Ember-#@(future "wat")
08:02Ember-,@(future "wat")
08:02clojurebot#<SecurityException java.lang.SecurityException: no threads please>
08:02Ember-aww
08:09Okasu&,@(future "wat")
08:09lazybotjava.lang.SecurityException: You tripped the alarm! future-call is bad!
08:09jtoy_does rename-keys still exist in clojure? I cant seem to call it
08:09benediktEmber-: and i cant deref a (Thread.) ?
08:10Ember-benedikt: no, Threads don't have a return value per se
08:11Ember-benedikt: see https://www.refheap.com/240eaef9a859ab1aae074a9a8
08:11benediktEmber-: but a future has?
08:11kmicu"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:11Ember-first call without dereferencing returns a future
08:11kmicuhttp://dominik.honnef.co/posts/2013/08/writing_go_in_emacs__cont__/
08:11jtoy_ah, its for set, how can I rename a key in a map?
08:11Ember-second one with dereferencing waits until the calculation is done and returns that
08:12benediktEmber-: makes sense
08:13Ember-so you can just save your future into a var and read from there when you need it
08:13jtoy_nm
08:13Ember-and be certain that the thread has completed before you try to read from it
08:14benediktEmber-: 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:14benediktso derefing "forces" it to return you the value, thus it makes (time) wait until it has completed it's task
08:15clgvbenedikt: yes. you deref a future to get its value. your are free to choose when you want to deref it thoug
08:15benediktclgv: so derefing *can* block, but if you deref at the appropriate time in code, it doesn't have to block
08:16Ember-yeah, kinda of :)
08:16benedikti like clojure.
08:16Ember-if the thread has completed when you deref the future it will just return the value calculated
08:16Ember-if it is still pending then it blocks
08:17benediktyeah, thats brilliant
08:17Ember-I guess most of the ppl on this channel like Clojure ;P
08:17bosieEmber-: i find it a shitty alternative to haskell really
08:17Ember-bosie: different languages, different purposes in many ways
08:17Ember-haskell embraces typing
08:17benediktEmber-: you had to suspect that there were a few haskellers lurking around
08:17bosieEmber-: i am kidding
08:18Ember-bosie: aww, you trolled me!
08:18benediktbosie: it's ok. i like haskellers too :)
08:18bosiebenedikt: i wish i liked haskell but i never quite managed to wrap my head around it :/
08:18bosiebenedikt: though thats my fault and not haskell's
08:18Ember-haskell is still on my "to-be-learned" list
08:19Ember-haven't done anything even semi-serious with it
08:19Ember-just random twiddling around
08:19benediktbosie: 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:19Ember-like lisps
08:19Ember-:)
08:19Ember-I remember when I got my "lisp enlightment"
08:19clgvbenedikt: you can even ask the future whether it is ready to be dereferenced without waiting time `future-done?`
08:19bosiebenedikt: the fact its not used commercially is a wee bit of a problem as well
08:20Ember-after getting the "lisp enlightment" suddenly all other syntaxes seemed stupid and cumbersome
08:20benediktbosie: i write c# for a living. companies never use the fun stuff!
08:20benediktclgv: nice!
08:20Ember-before that all those friggin' parenthesis made me insane!
08:20bosiebenedikt: beats me doing java ;)
08:21Ember-benedikt: I write java and clojure for living :)
08:21Ember-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:21benediktEmber-: yeah. Im enlightened too.
08:21bosieEmber-: clj for whom?
08:21Ember-bosie: working at this company called Solita in Finland
08:21benediktEmber-: are you finnish?
08:21Ember-yup
08:23bosiebenedikt: "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:23bosieEmber-: that looks like a consultancy?
08:23benediktbosie: i speak swedish and they speak swedish in finland
08:24Ember-bosie: yeah, kinda of. We do that stuff too
08:24bosiebenedikt: how many non-finns speak finnish properly though?
08:24sebastianbnot, perkele, one
08:24Ember-bosie: it's more like delivering projects to a customer and providing the all things needed for delivering a successful project
08:24benediktbosie: one. Thats Linus Torvalds and he is already finnish.
08:24sebastianb(I'm sorry for that:P)
08:25Ember-like ux design, development, testing, IT infrastructure devops stuff and so on
08:25hyPiRionbosie: wrong question. How many Finnish speak English properly? :) I would be surprised if it's less than 95%
08:25bosiehyPiRion: if the company requires you to speak proper finnish...
08:25bosieEmber-: how is this not consultancy?
08:25hyPiRionoh, I didn't read that :(
08:26opqdonutthere are a couple of finnish software companies that insist on using finnish
08:26opqdonutbut most use english as their official language
08:26hyPiRion"Well, it's can't be harder than learning a new computer language"
08:26bosiehyPiRion: hah. i would bet good money i can learn haskell quicker and to a higher profeciency than finnish
08:27opqdonuta russian coworker of mine studied finnish for 3 years to pass the citizenship exam
08:27Ember-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:27hyPiRionbosie: me too. I bet I could learn D, OCaml, Haskell and APL before I would've learned Finnish properly.
08:27bosieEmber-: ok, not here i think. we do deliver ;)
08:28Ember-hehe, same here
08:28Ember-and we do that also with Clojure :)
08:28Ember-we've done two projects with clojure now, both successes
08:28bosieEmber-: in what area?
08:28Ember-was enough for our management, now we're going to do a lot more projects with Clojure
08:28Ember-bosie: web applications
08:28bosieEmber-: 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:29Ember-bosie: hehe, no. We don't do that kind of consultancy :)
08:29Ember-we believe that a well made project gives you new projects
08:29hyPiRionI think I do that, not intentionally though.
08:29Ember-and the better you do the project the less it will bother you later
08:30bosiehyPiRion: including bugs?
08:30bosieEmber-: if you get paid for the 'bother' though...
08:30hyPiRionbosie: https://twitter.com/hyPiRion/status/366344191166525442
08:30hyPiRionyes.
08:30hyPiRionincluding fixing them
08:30bosiehyPiRion: cant read twitter. i activated GSD
08:30Ember-bosie: yeah, but if the company believes in *keeping* the good guys in, then that's pretty short sighted :)
08:30bosiewhich is pure irony, now i just waste time on irc ;)
08:30Ember-since the good guys deliver quality and with quality comes the customers
08:30hyPiRionbosie: yet here you are, on IRC. :)
08:31hyPiRion"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:31hyPiRionyesterday
08:31bosiehyPiRion: ah, sorry to hear
08:31Ember-and hyPiRion about the amount of finns who can speak english decently: unfortunately it's not 95%, it's wors
08:32Ember-but of people actually *using* the internet (not just using the bank's web site) I think 95% is pretty accurate
08:32bosieEmber-: what do you reckon is the # for the two proper citis?
08:33Ember-citis?
08:33hyPiRionEmber-: Ah, right. Sounds like the same ratio as in Norway, Sweden, Denmark, Iceland etc.
08:33Ember-ah, amount of people in cities?
08:33bosieEmber-: cities
08:33Ember-hyPiRion: indeed
08:33bosieEmber-: how many people speak english in helsinki (you can include espoo)/turku/tampere
08:33Ember-ah...
08:34Ember-well, I think there it is pretty close to that 95%
08:34Ember-it gets worse when you go to countryside
08:34Ember-but not THAT much
08:34bosieye
08:34bosienot like they see foreigners in sodankyla
08:34Ember-they do
08:35Ember-and each and every person under 35 years has had to learn at least 6 years of english in school
08:35Ember-in Finland
08:35bosieEmber-: same here but that really doesnt mean much
08:35Ember-and all our tv shows are subtitled, not dubbed
08:35Ember-thank god
08:35Ember-:P
08:35bosieEmber-: they couldn't order a coke in english, let alone keep a conversation going ;)
08:36bosieEmber-: i bet that helps more than school
08:36Ember-one couldn't be without the other
08:36Ember-drop either one and the amount of english speakers drop dramatically
08:37Ember-but hell, I should do some work too
08:37bosiehehe cu
08:37Ember-not just chat in IRC
08:37Ember-->
08:49birdspiderhi, is there a equal/= function that produces false when comparing 'identical' vectors and lists ? i.e (=~ [] '()) false
08:51llasrambirdspider: Not off the top of my head. Why do you want that?
08:53noncombirdspider: you can easily write one
08:53birdspiderllasram, trying to solve http://www.4clojure.com/problem/65 with http://pastebin.com/es3i6k41
08:55hyPiRionbirdspider: list? vector? map? set? can be used
08:55hyPiRionalthough not pretty
08:55hyPiRion*elegang
08:55birdspiderhyPiRion, not in the example I posted
08:56birdspiderhyPiRion, see "Special Restrictions"
08:56llasrambirdspider: I think the point of this is to empirically test how core abstraction functions act differently on the provided input
08:56llasramRemember that all the Clojure core structures are immutable (at least in public interfaces)
08:56llasramSo you can "mutate" them however you want without being impolite about your imput
08:56llasrams,imput,input,
08:57hyPiRionbirdspider: ah. Logged in, the way llasram explained it is how I solved it.
08:58birdspiderhyPiRion, ah my bad, didn't think login was required to see the problems
08:58hyPiRionbirdspider: it's not, but it's required if you want to see your own solution :)
08:59hyPiRionI just looked at the problem, not its constraints at first.
08:59TimMcThose restrictions miss some predicates.
09:01llasramTimMc: 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:01TimMcFair, although sequential? was included in the list of restrictions.
09:02hyPiRionllasram: psh, 4clojure is a great way to learn how reify works. At least you could do that in the past.
09:02IamDrowsyand it's fun to look at the different "hacky approaches"
09:03TimMcDoes this problem also fall to the shitty map literal solution?
09:03TimMcAh, nope.
09:30supersymhmm... I wonder what fun things I could do with clj + e.g. http://www.webkb.org/bin/categSearch.cgi?categ=%23dog&amp;recursLink=%3C
09:45H4nsclj-time or something else for date+time handling (printing and parsing)?
09:47ambrosebsDoes a CLJS deftype have any meaning if it is referenced like a var? cljs.core.Subvec vs. cljs.core/Subvec?
10:06mercwithamouthso clojure people..if you could make up a checklist of things to go through to learn most languages...what would you write down?
10:20rbxbxmercwithamouth: ethos, syntax, semantics, tooling, testing
10:20wakeuphi all
10:20Okasumercwithamouth: Learn Ada, C, Scheme, Haskell. Voilà you know most of the languages outthere without even touching them.
10:20rbxbxmercwithamouth: not sure what level of granularity you're looking for
10:21wakeupI am fighting with clojure.tools.logging and log4j.
10:22wakeupHow do I make logging to print all levels to mx *nrepl* buffer?
10:22wakeuptried binding *force*, *tx-agent-levels*...
10:22wakeupguess nrepl ignores my log4j.properties, which is ok
10:24mercwithamouthrbxbx: i'm more so looking for a guide line to become functional in most languages...a blueprint to learn.
10:25mercwithamouthi use several languages but i'm just comparing my method of learning to other peoples
10:25wakeupmercwithamouth: learn common lisp, after that other languages tend
10:25wakeupto be easy
10:25wakeuphaskell if you want to go deep into dunctional territory I guess.
10:26wakeupalso is there a prefered configuration file library for clojure?
10:27Okasuwakeup: Wakeup, CL isn't functional at all.
10:27mercwithamouthpreferred configuration file library.... was that question for me?
10:27wakeupno, not exclusively
10:27mercwithamouthoh ok
10:28wakeupOkasu: No, but people have implemented a lot of functional stuff using it
10:28Okasuwakeup: You can do the same using C, what was your argument again?
10:29wakeupwhen you do functional stuff in CL, you also get to know how its implemented
10:29kmicudetects Defending Preferred PL Syndrome.
10:29wakeupOkasu: It's a really good language noone should skip, and as far as I understood he was asking for interesting languages to learn.
10:31hyPiRionWell, Haskell is good if you want to constrict yourself to functional programming.
10:31OkasuIt'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:31kmicu"It's not Lisp that sucks, it's Common Lisp that sucks."
10:31Okasukmicu: Indeed.
10:32wakeuplol
10:32kmicuOkasu: Scheme indeed.
10:34wakeupDon'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:35wakeupFor 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:36kmicuAfter I heard from Erik Meijer that PHP is interesting, I do not believe Paul Graham about CL suckiness.
10:36kmicuJust kiddin'. Only trolling ;]
10:37Okasukmicu: Well, maybe PHP is interesting as fractal of bad design? :D
10:38kmicu"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:38kmicuhttp://www.infoq.com/interviews/meijer-monads
10:46wakeupSo how do I make clojure.tools.logging log to my *nrepl* buffer?
10:49dnolenambrosebs: prefer the second one, there is no differences in meaning and there are fewer promises about the first one.
10:51mdrogaliswakeup: 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:51wakeupAnd how do I direct clojure.tools.logging to a file?
10:51mdrogalisAgents stdout isn't on the main thread.
10:51mdrogaliswakeup: Use a log4j config file.
10:52wakeupokay
10:52wakeupI need to decide that at runtime though (if I want to log to stderr or a file)
10:52wakeupnow don
10:52mdrogalisUhh..
10:53mdrogalisOnce at start up time? Or does it change a lot?
10:53wakeupno once at startup
10:53mdrogaliswakeup: 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:54mdrogalisImport whichever batch of prehooks based on the build, or whatever main file you pick.
10:54wakeuphmm no that won't do
10:55mdrogalisCan you explain a bit more, maybe?
10:56wakeupWell the specification says "a command line option to direct logging output to a given file."
10:56mdrogalis(if (file-logging? args) (require 'hooks))
10:56mdrogalisIn some ideal world. :)
10:57gdev_Has the notion of logs as data still so new that even clojurists default to log files?
10:58gdev_ s/Has/is
10:58wakeupgdev_: sshhh!
10:58gdev_Sorry =_=
10:58wakeupmdrogalis: what keeps me from getting and BINDING the logging output stream?
10:59wakeupgdev_: I wouldn't even bother with logging, but this is work for a client
10:59wakeupand I say that as someone running a webserver that doesn't log by design
10:59mdrogalisgdev_: It's clearly a school assignment.
11:00mdrogalisAh, nevermind
11:00mdrogalisDidn't read up - sorry.
11:00wakeupno it's not ;)
11:00wakeupI don't really get why I need this dire thing to direct logging output.
11:01gdev_When I tutor java students I still make them think about data and events instead of lines if text and files
11:01mdrogaliswakeup: It was just a suggestion. You don't have to use it to accomplish your goal.
11:03wakeupJust a second: (defn fooo [arg] "bar") <- "bar" is the docstring right?
11:03Fer`gdev_: do you log in edn or something?
11:03wakeupor does it have to be (defn foo "bar" [arg]) ?
11:04mdrogaliswakeup: 2nd way is correct
11:04wakeupfuuuuu
11:04H4ns"why not alienate the CL suckers if one can?" :D
11:04krejzywafelyes yes yes
11:04wakeupyeah right
11:06gdev_It helps prevent narcissistic systems so yes edn is preferred.
11:06wakeupas if the weird braces and destructuring syntax wasn't butthead enough
11:06wakeupand then: WITH-OUT-STR
11:06H4nswakeup: i'm not sure that this is the right place to bitch about clojure, though :)
11:06wakeuptrue
11:06Fer`gdev_: you don't run into any problems when the file is really big?
11:06wakeuptried that last week
11:07krejzywafelX is fuuuuu, cuz it is not like CL, true story...
11:08wakeupkrejzywafel: there is a certain element of surprise when a "lisp" does every conceivable lispy thing a bit different
11:08H4nsi must say i find clojure pretty slick. today i used clojure.data/diff and it is teh rocks
11:08nDuffwakeup: haven't you had this exact same rant here earlier?
11:08krejzywafelwakeup: fuuuuuu
11:08H4nswakeup: #lispcafe
11:08nDuffwakeup: it turned into a flamewar then too. No need for a rerun.
11:08wakeupI am gonna stop now
11:09wakeupbut just for my defense: always keeping it civil, kust said it's surprising
11:09noncomif 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:09H4nsnDuff: when he's not ranting about clojure here, he's ranting about cl in #lisp :)
11:09wakeupH4ns: so not true
11:10wakeupI have given that up years ago
11:10wakeupbut I did suggest porting CL in #cat-v.org
11:10noncomis there an advices substitution for javascript/clojurescript?
11:10wakeupfun times...
11:10mdrogalisH4ns: I was about to laugh if you said he alternates between ranting about Clojure & ClojureScript
11:10wakeupafter all they did port python
11:10krejzywafelwakeup: just against your defense - you did not just said it's suprising, you just said it's "fuuuuuuu"
11:11wakeupkrejzywafel: that was actually directed at me having noticed this very late
11:14gdev_Fer I don't log to an edn file, it's just what I serialize the data in
11:15gdev_Edn in action
11:15noncommy main concern in creating a clojurescript date library is to allow a good work with to/from string conversion and using formats
11:16noncomor maybe there is one existing?
11:17mdrogalisnoncom: Does clj-time not port?
11:31H4nssay 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:34hyPiRion,(-> {:a 1 :b 2 :c 3} (select-keys [:a :b]) (clojure.set/rename-keys {:a :x :b :y}))
11:34clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.set>
11:34mdrogalisH4ns: select-keys combo'ed with `rename`, I think it is
11:34mdrogalishyPiRion: Nice :)
11:34hyPiRion,(require 'clojure.set)
11:34clojurebot#<SecurityException java.lang.SecurityException: denied>
11:34hyPiRionBoo
11:34mdrogalisnope.jpg
11:35H4nsnice, thanks!
11:35hyPiRion,(require '[clojure.set])
11:35clojurebotnil
11:35hyPiRion,(-> {:a 1 :b 2 :c 3} (select-keys [:a :b]) (clojure.set/rename-keys {:a :x :b :y}))
11:35clojurebot{:y 2, :x 1}
11:35hyPiRionthere.
11:35wakeupWhats LET* in clojure?
11:35hyPiRionwakeup: let
11:36wakeuplet evaluates/binds sequential?
11:36hyPiRionyes
11:41wakeupjava.lang.IllegalStateException: replace already refers to: #'clojure.string/replace in namespace [...]
11:41mdrogalisrefer-clojure
11:41mdrogalisCheck it out
11:41wakeupWhat did I do? (tried to :use clojure.string)
11:42justin_smithwakeup: do you have a function called replace?
11:42hyPiRionwakeup: you should try to use namespaces, e.g. (:require [clojure.string :as s]), then do s/replace or similar.
11:43hyPiRionotherwise names from the :use'd namespaces clash with others if they have the same name.
11:43mdrogaliswakeup: Also, use :require. Avoid :use.
11:44gvickerswhy not destructure it. (def n {:a 1 :b 2 :c 3}) (def newmap (let [{x :a y :b}n] {:x x :y y}))
11:46H4nsgvickers: i want to avoid repeating the keys. it seems i need to write a select-rename function.
11:51hyPiRionH4ns: (defn select-rename [map keymap] (-> map (select-keys (keys keymap)) (clojure.set/rename-keys keymap))) ?
11:51hyPiRionI think that would do what you'd like
11:51justin_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:51clojurebot{:z 2, :y 1, :x 0}
11:52justin_smithrename-keys, nice, I wasn't aware of that one
11:55noncommdrogalis: afaik clj-time is based on JodaTime, and there is no equivolent for JavaScript
11:55seangroveWow, people building inheritance systems on lein's profiles
11:56krejzywafelI'M COBOL PROGRAMMER, I DO NOT LIKE CLOJURE'S LOWER CASE STYLE. UPPERCASE IS BETTER IMHO.
11:57hyPiRionseangrove: I wouldn't be surprised if lein profiles are turing complete.
11:57justin_smithhyPiRion: ~(they are)
11:57`fogusand self-aware
11:58noncomkrejzywafel: AND WHAT YOU USE IN COBOL INSTEAD OF HYPHEN-CASE? rEVERSEcAMELcASE OR PLAINOLDGOODONEWORDCASE?
11:58justin_smith(if that was too opaque, you can put arbitrary code inside a syntax-quote, and access the full clojure language)
11:59seangrovetechnomancy is going to have to answer for some of the sins his work has enabled
11:59seancorfieldnearly all of my project.clj files have some ~(embedded code) in them
12:00`fogusseancorfield: You must have larger build reqs than me because I've never had the need. What kinds of things require that?
12:01seancorfieldwe 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:02seancorfieldit's just easier to do that than to have separate profiles for each env
12:02technomancyseancorfield: for the platform stuff please take a look at https://github.com/technomancy/leiningen/pull/1228
12:02justin_smithIn 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`fogusseancorfield: Oh so we do have similar requirements... but I do that in Bash scripts. ;-)
12:02seancorfieldwe try to have all our stuff auto-self-configure based on environment info
12:02technomancywould like to get feedback on that from someone who would actually use it
12:05wink.oO( skynet )
12:08mdrogalisnoncom: Ah, right right.
12:12seancorfieldi'm at the courthouse right now for jury service so i'm kinda restricted on what i can work on :)
12:21wakeup`How do I check a reader for end of file?
12:22mdrogaliswakeup`: What kind of reader?
12:22wakeup`*IN*
12:23mdrogalishttp://stackoverflow.com/questions/2034059/how-to-read-lines-from-stdin-in-in-clojure
12:24wakeup`I take that as a "not at all"?
12:25tbaldridgewakeup`: on many platforms (JVM included) the proper way to check for EOF is to read until read returns -1
12:25tbaldridgewakeup`: what is consuming the stream?
12:26wakeup`tbaldridge: read
12:26tbaldridgewakeup`: http://docs.oracle.com/javase/7/docs/api/java/io/Reader.html#read()
12:29tbaldridgewakeup`: 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:30mdrogalistbaldridge: I'm having a great time with core.async now that I understand it. Really, really well done man.
12:32tbaldridgemdrogalis: thanks! I can't take all the credit though. Rich, dnolen, alex miller, ghadi and many others did a ton of work too.
12:33mdrogalistbaldridge: A good effort :)
12:37konr`Is there any already-existing function that given [:foo :foo :bar] returns something like {:foo 2 :bar 1}?
12:38tbaldridge,(doc frequencies)
12:38clojurebot"([coll]); Returns a map from distinct items in coll to the number of times they appear."
12:38konr`thanks!
12:38tbaldridge,(frequenceis [:foo :foo :bar])
12:38clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: frequenceis in this context, compiling:(NO_SOURCE_PATH:0:0)>
12:38tbaldridgeand I can't spell
12:38tbaldridge,(frequencies [:foo :foo :bar])
12:38clojurebot{:foo 2, :bar 1}
12:49seangroveIs wolfes being flooded, or flooding?
12:55rasmustowolfes is doing something (or maybe comcast is)
13:18bhaumanwolfes must work at a lot of different coffee shops
13:21technomancyjoin/part hiding is a beautiful thing
13:22bhaumantechnomancy: currently looking for config setting in ui. or rather is it some esoteric irc command?
13:23justin_smithbhauman: with erc it is a config
13:23technomancybhauman: varies by client
13:23bhaumanjustin_smith: technomancy: thanks guys
13:35TimMctechnomancy: I use a ridiculously simple irssi script called "smartnoise" that hides joins/parts for people who (I think) haven't spoken recently.
13:37kmicuSame here http://dev.weechat.org/post/2008/10/25/Smart-IRC-join-part-quit-message-filter
13:38bhaumanI have one more simple irc question that I''ve been meaning to ask. How do you do those cool status messages?
13:38justin_smithbhauman: /me ...
13:39justin_smithor is that not what you mean?
13:39bhaumanjustin_smith: thanks man
13:39callenI use /me everywhere, including outside of IRC.
13:39bhaumani bet
13:40callenbhauman: you should look things up more.
13:40callensatisfying one's curiosity is good :)
13:40justin_smithI first picked it up in a mud, and used it accidentally found out it worked in irc
13:40bhaumanthanks for the tip
13:40callenahhh MUDs.
13:41callenthose taught a lot of people to program.
13:41bhaumancallen: I use clojurescript, thus I have a tendency to look things up
13:41callenscripting the grinding phase of the game :)
13:42justin_smithyes, 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:49TimMcjustin_smith: Haha, nice.
13:49scottjbhauman: link to blog (not post) where that will appear?
13:49gvickersditto^^
13:50bhaumanhttp://rigsomelight.com
13:50scottjbhauman: thanks
13:50bhaumanscottj: gvickers: if you want to read it now I'd love some people to give me feedback
13:54scottjbhauman: no thanks
13:54bhaumanscottj: no worries
13:55benkaylysis
13:55benkay(wrong term)
13:58francis_wolkeCould someone please explain to me how exactly we are seeing a 4 in the return list in this form? (let [form '(/ 4 4)]
13:58francis_wolke [(eval form)
13:58francis_wolke (apply (first form) (rest form))
13:58francis_wolke (apply / '(4 4 ))])
13:58francis_wolkeI
13:58francis_wolkeI'm quite confused... :/
13:59dnolen,(apply '/ [4 4])
13:59clojurebot4
13:59francis_wolkethanks.
13:59hiredmanthe symbol / is not the same as the function that the symbol / resolves/evals to
14:00justin_smith,(apply 'anything [4 4])
14:00clojurebot4
14:00justin_smith,(apply '☃ [4 4])
14:00clojurebot4
14:01konr`haha
14:01justin_smith,(apply '☃ ['❄ '☕])
14:01clojurebot?
14:02justin_smithclojurebot appears not to be utf8 clean
14:03TimMc,('+' 0 0)
14:03clojurebot0
14:04tbaldridge,(get '+' 0 0)
14:04clojurebot0
14:05tbaldridgejustin_smith: function calls to symbols get translated to get ^^
14:05justin_smith,('♟ '♞ '♛)
14:05clojurebot?
14:05justin_smithjust like keywords
14:06kmicu,(apply (comp (partial (comp '+ '*' 'a''a) '+)) '(ha))
14:06clojurebotnil
14:06tbaldridgeI really really want to write a variant of clojure.core that uses unicode symbols for everything. APL meets Lisp or something like that
14:06tbaldridgemaybe for april 1st next year
14:06justin_smith,('a '{a 1 b 2})
14:06clojurebot1
14:06technomancytbaldridge: april 1 is less than 8 months away
14:06justin_smithnice
14:07konr`a chess game that uses chess unicode characters would be cool, too. (♞ :d3)
14:08justin_smithyes, that would be a nice little clojure based dsl
14:08`fogustbaldridge: A unicode Clojure with ubiqiutous use of -> would be pretty frickin sweet.
14:09tbaldridge`fogus: that's kindof like bbloom's factjor
14:10bbloomi do not advocate unicode abuse :-)
14:10justin_smithbasically you could just have a namespace with lots of lines that looks like (defmacro λ [bindings & body] `(fn ~bindings ~@body))
14:10bbloomdespite years of trying, i still don't know my greek letters
14:10hiredmantbaldridge: have you seen pl?
14:10gvickersyou have to know that one..
14:10technomancyjustin_smith: nitpick: what is "domain-specific" about such a language?
14:11justin_smithchess?
14:11justin_smiththat is a domain, no?
14:11technomancyoh, I thought you were talking to tbaldridge; nm
14:11`fogusbbloom: I don't know Greek letters either... but snowmen I know.
14:11hiredmanfeh, I don't think I have a way to load pl in to clojurebot's evaluator anymore
14:11etehtseawhere lazy-seqs was moved from contrib?
14:11justin_smithif in emacs: c-x 8 <return> is your friend with unicode
14:11bbloom`fogus: clearly all the PL researchers should just perform all of their typing judgements with snowmen and bishops
14:11justin_smithalso things like *lambda* tab-complete from beginning or end
14:11tbaldridgehiredman: I've seen it referenced, never used it
14:11`fogusThe only problem is, what function does snowman get? I was thinking `persistent!` might be appropriate.
14:12justin_smithwith 8
14:12justin_smitherr
14:12justin_smith☃ as thaw, the inverse
14:12hyPiRionjustin_smith: you don't need to define λ as a macro to show it as λ in Clojure files
14:12justin_smithsure
14:12hiredmanhttps://github.com/hiredman/odds-and-ends/blob/master/functional.clj#L114-130
14:12justin_smiththat was a random example of uniclojure
14:13justin_smiththough showing as unicode is probably more useful than requiring unicode input
14:13TimMcI'll just note here that Swearjure is uniclojure-compliant.
14:14ro_stloved that lightning talk :-)
14:14ro_stactually really impressive how far along that got!
14:14TimMcro_st: gfredericks' talk?
14:14ro_styes, at CW '13
14:14hyPiRionTimMc: To some extent. λ isn't legal, although ☃ probably is.
14:14TimMcHmm, true!
14:15TimMcI guess we can't allow letters from any language.
14:16hyPiRionNot that it would help us much to allow them though.
14:17TimMcDisallowing ' and ! as being "letters" in the romanization of Xhosa and other "click languages" would be unfair, however.
14:17konr`you could also allow only roman numerals
14:18TimMcEh, we don't need no stinkin' numerals.
14:18hyPiRion+ * - and / is enough for me
14:19patchworkWill we ever free ourselves of the chains of ascii?
14:19patchwork: (
14:20technomancyaccording to vernor vinge, no
14:21TimMcFor code? No.
14:21patchworkHa! even in the quick, they speak ascii
14:21technomancy27th century technicians will wonder why dates are measured from the moon landing, and then realize it's actually a few months later
14:21TimMc(Well, I probably won't live long enough to be proven wrong, at least.)
14:22konr`There was a russian keyboard with leds on the keys which would make using unicode symbols viable
14:22winkthe optimus?
14:22konr`yeah, that one!
14:23TimMcÍ ðóñ'þ ßéé åháþ'ß åëóñg åíþh þhíß µéþhóð. °¥Ö
14:23winkus mechanical keyboard freaks would probably pass on it for some decent feeling :P
14:23gvickers$1500 dollar keyboard
14:23patchworkSeriously, and their processors will just be mind-boggling wrappers around an x86
14:23callentechnomancy: hahahaha
14:24hyPiRionno wonder there won't be any singularity if this is true.
14:24winktechnomancy: 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:24technomancycallen: https://en.wikipedia.org/wiki/A_Deepness_in_the_Sky#Interstellar_culture
14:25callentechnomancy: I read A Deepness in the Sky. Loved it.
14:26bhaumanthis all make me think of Bret victor's latest talk.
14:26callenI need a brain implant that filters out anything to do with Bret Victor.
14:30dark_elementanybody here used this http://nakkaya.com/static.html
14:31callendark_element: nah, I wrote my CMS mostly using the stack from Luminus. Looks neat though.
14:31callenI wonder how quickly it compiles compared to Jekyll?
14:32dark_elementcallen, I can't get it working it yet.
14:32dark_elementcallen, there is one more similar project https://github.com/liquidz/misaki
14:33callenI just use Varnish if it's truly static.
14:33callenthen I can write my code in the same way as usual for the CMS, but it gets cached to death :)
14:33callenI might be weird though.
14:33callendark_element: do you just want to make a blog?
14:34justin_smithcallen: give the whole thing a name like carbonite and you could probably convince other people to do it that way
14:34winkthere's also http://algernon.github.io/madness/
14:34callenjustin_smith: not_sure_if_serious.jpg
14:34dark_elementcallen, yup.
14:35callendark_element: oh hum. Assuming the use of Clojure is a specific requirement, does it need to be an SSG?
14:35callenSSGs can be really awkward at times.
14:36dark_elementSSG?
14:36callenstatic site generators.
14:36ucbwhat'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:37technomancyucb: why is it not on clojars?
14:37ucbtechnomancy: it's not mine; it's a Java/.NET lib I want to wrap
14:37dark_elementcallen, i started with octopress today and later on went on trying out SSGs built using clojure.
14:37ucbI suppose I can upload a version to clojars under my username namespace
14:37technomancyucb: you should open a bug report if it's not in a repository
14:37ucbtechnomancy: good point
14:38winkmaven ALL the jars!
14:38hyPiRionmore like deploy
14:38zphdsHey 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:38zphdshttp://cljbin.com/paste/520926a8e4b0b4dec3dca30b
14:38amalloy~map
14:38clojurebotmap 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:39amalloytechnomancy: good guess
14:39hiredmantechnomancy: we all did
14:39technomancyheh
14:39amalloyi actually guessed "for is lazy"
14:39bbloomzphds: 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:39bbloom(doc doseq)
14:39clojurebot"([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:40bbloomzphds: try that^^
14:40justin_smithquickest fix for the code is mapv for map, after that there is doall wrapped around map, then there is refactoring to a deseq
14:40justin_smith*doseq
14:40justin_smiththat being the best option imho
14:40hiredmanamalloy: for use by someone new to the language seems unlikely
14:40functionformwhy are the array set functions typed but not the get?
14:40zphdsbbloom: is it more of a code-smell issue or does it have any other adverse effects?
14:41bbloomzphds: laziness & side effects just don't mix. if you need side effects, use an eager operation, such as doseq
14:41bbloomit's an easy fix: (doseq [photo photos] …body of your map function here...)
14:41zphdsbbloom: I am ashamed to admit that I didn't know that map was lazy
14:41bbloomzphds: never be ashamed while you're learning!
14:42technomancyeveryone gets bitten by that early on =)
14:42bbloomyup
14:42bhaumanhell yep
14:42zphdsheh
14:42zphds:D
14:42dnolenzphds: and laziness burns even experienced Clojure users
14:42bbloomit'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:42bbloomwhere sometimes == always except in 30-ish item chunks
14:42zphdswhoa
14:42TimMc&(take 4 (map println (range 60)))
14:42lazybot⇒ (012345678910111213141516171819202122232425262728293031nil nil nil nil)
14:42bbloomand so when it *sometimes* happens eagerly, you can't tell it sometimes happens lazilly
14:43zphdsis it also bad if I have side effects as part of my 'let'?
14:43zphdslike what I did with mkdirs inside a let?
14:43dnolenbbloom: "sometimes" being range and vector
14:43bbloomzphds: if your code needs side effects, then let and do are the best places to put them
14:43bbloomboth of those forms let you explicitly sequence operations
14:43technomancyzphds: that's fine. it's best if you bind to _ for side-effects; makes it clear the return value isn't used.
14:44zphdsbbloom: ah
14:44bbloomtechnomancy: unless your side effect has a return value :-P
14:44technomancy(assuming you mean the [] part of a let)
14:44llasramzphds: There's also `doto`, depending on what exactly you're doing
14:44zphdsI kinda figured _ is for such things
14:44ystaelrelated 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:44bbloomzphds: just by convention though. _ isn't special in any way
14:45ystaelother than watching memory meters
14:45zphdsllasram: yeah, I played around with doto initially, but that io/copy in the middle is ruining the sequence
14:45zphdsbbloom: 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:46ystaelI had trouble with OOM due to this during the ICFP contest this weekend until I remembered that mapcat is a little bit eager
14:46dnolenystael: that's cool that you gave ICFP a shot, you didn't try integrating w/ external SMT solver? Sounds like Z3 was popular?
14:47ystaeldnolen: no, i used the maximally stupid generate-and-test approach
14:48ystaelwhich actually did surprisingly well
14:48zphdswell doseq didn't help
14:49zphdsit's something to with 'data' which is a byte array
14:49dnolenystael: 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:53ystaeldnolen: wish i had learned how to use the reducers library ahead of time, i suffered most from lack of parallelism
14:53ystael(and poor time management, but that's to be expected with a baby in the house)
14:53bbloomdnolen: (acronym-expand-1 "BV")
14:54dnolenbbloom: BitVector
15:01zphdswoohoo.. got it working
15:01zphdshere is the working snippet
15:01zphdshttp://cljbin.com/paste/52092c79e4b0b4dec3dca30c
15:01zphdsthanks guys!
15:02bbloomzphds: see also ##(doc with-open)
15:02lazybot⇒ "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:03zphdsbbloom: I attempted with-open, but the [o (output-stream path)] has to be the first pair?
15:03justin_smithzphds: also, hanging close braces only make the code harder to read for anyone familiar with a lisp family language
15:04bbloommove the .mkdirs outside of the let. defn's body is in an implicit do
15:04zphdsbbloom: so I couldn't set things up for the with-open block in the order I wanted
15:04bbloomthen let photos & fullpath
15:04bbloomthen with-open out and zout
15:04bbloomthen doseq & doto
15:04zphdsah
15:04callenzphds: props for abusing let already. Took me ages to figure out you could do that.
15:04zphdsthat's a neater idea
15:05zphdscallen: haha
15:06technomancyzphds: usually closing an "outer" stream will close the inner one too
15:06callenMFW: my coworkers are more excited about Datomic than Clojure.
15:07zphdstechnomancy: ah ok… that one flew right by me
15:07winkcallen: #firstworldproblems :P
15:07ro_stgood instinct. Datomic is -ing awesome.
15:07callenwink: we are in the tar pit of Python. It's awful.
15:07winklol
15:07callenwe can't even seem to reliably package our shit up for deployment.
15:07ystaelcallen: isn't that a snake pit
15:07ToxicFrogcallen: could be worse. You could be in the tar pit of C++.
15:07callenystael: python wasn't named after a snake.
15:07ToxicFrogWhere the tar is actually made of razorblades.
15:07winkor C#
15:07callenToxicFrog: I'd prefer that.
15:07callenToxicFrog: because then at least I'd get some fucking respect.
15:07zphdsare there any online resources that details the conventions and good practices?
15:07ystaelcallen: yes, yes, i am aware of that. it was a pun of admittedly mediocre quality.
15:08callen"oh you're a C++ programmer? Let me give way then..."
15:08ToxicFrogwink: IME C# is honestly not that bad. I'd take it over C++ and Java, at least.
15:08winkzphds: https://github.com/bbatsov/clojure-style-guide for example
15:08zphdswink: cool
15:08callenthat guide isn't wholly accurate or credible.
15:08ToxicFrogcallen: yes, but what does respect get you when you pay for every day with your sanity and/or liver?
15:08callenplease do not recommend batsov's guide as if it were authoritative.
15:08winkToxicFrog: it's not such a bad language. but I still have no good experiences :P
15:08ToxicFrog...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:09winkcallen: "for example". but ok
15:09winkzphds: see above. But I find it better than nothing at the start
15:09ystaelToxicFrog: isn't the best feature of C# called "F#" ?
15:10TimMczphds: As far as indentation goes, just trust Emacs.
15:10zphdswink: cool…
15:10winkcallen: well do you have better resources? :)
15:10stuartsierrazphds: http://dev.clojure.org/display/community/Library+Coding+Standards
15:10zphdsTimMc: yep! with nrepl it just kicks ass
15:10TimMcnooooo
15:10ToxicFrogystael: I haven't actually used F#
15:10TimMcstuartsierra: I hate that that page recommends map destructuring in args. ;_;
15:10TimMc*restargs
15:10ToxicFrogI have high hopes for clojure-clr, though
15:11wink.oO( how to incite a peaceful channel in 3 easy steps. style guide, languages, editors )
15:11zphdswink: haha
15:11zphdsand all it takes is a newbie to do that :)
15:11TimMcIt's pretty hard to get this channel up in arms about editors, thankfully.
15:11winkzphds: your're just a catalyst :P
15:12ro_stwink: wait until you see what happens when someone mentions the CA
15:12zphdswhat's a CA :D
15:12TimMchaha
15:12Fer`yogthos: ping
15:12winkI'd say Certificate Authority, but apart from leiningen and clojars I can't imagine what he meant :P
15:12yogthosFer`: howdy
15:13winkhint: ssl in java is painful
15:13Fer`yogthos: hello, in selmer is {% for x in foo.bar %} not supported?
15:13TimMcwink: Let's just pretend that's what CA refers to here. :-P
15:13TimMcYes, very good.
15:13yogthosFer`: uhm should be...
15:13zphdsoh
15:13zphdsand going by the naming convention
15:13Fer`yogthos: maybe I have an error in my code I'll run more tests
15:14zphdsI should be renaming make-archive into make-archive!
15:14cespareis that the same C and A as in CLA?
15:14zphdssince I have seen that '!' usually means that there is a side effect lurking beneath
15:15cesparehaha do you seriously have to mail this thing?
15:15ro_stno! shush!
15:16ro_stdon't say it!
15:16yogthosFer`: so this definitely works (render " {% for x in foo.bar %} {{x}} {% endfor %}" {:foo {:bar (range 5)}})
15:17callenFer`: post code please?
15:17callenFer`: Refheap.com
15:17winkas someone totally oblivious... was clabango too slow? or why selmer? (I take it it's newer?)
15:18Fer`yogthos: this doesnt seem to work (selmer.parser/render "{%for x in foo.0%} {{x.id}} {%endfor%}" {:foo [{:id "s"} {:id "a"}]})
15:18TimMcwink: s/editors/templating libraries/, actually
15:18callenI've explained this before, but Clabango was too slow and the owner wasn't interested in maintaining it.
15:18winkcallen: thanks
15:18callenTimMc: there's peace in the land. Selmer exists.
15:21yogthosFer`: that wouldn't no :)
15:21yogthosFer`: foo.0 is a map
15:22yogthosFer`: this is fine (selmer.parser/render "{%for x in foo%} {{x.id}} {%endfor%}" {:foo [{:id "s"} {:id "a"}]})
15:22yogthosFer`: this is also fine (selmer.parser/render "{{foo.0.id}}" {:foo [{:id "s"} {:id "a"}]})
15:23wink*sigh* wish I'd not used a now-nonmaintained static site generator
15:23Fer`oh im stupid i should have a nested vector
15:23bhaumanpublishing my next core.async post http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html
15:24yogthosFer`: no worries :)
15:25yogthosbhauman: nice!
15:25ro_st69
15:25ro_stis that a high score, bhauman?
15:25Fer`yogthos: what about this: (render "{%for x in foo.0%} {{x.id}} {%endfor%}" {:foo [[{:id "s"} {:id "a"}]]})
15:25Fer`i fear i'm being stupid again
15:25ro_stbhauman: i very quickly wanted diagonal matching :-)
15:25bhaumanyogthos: thanks,
15:25bhaumanro_st: the original doesn't have it and it makes the game to easy
15:26bhaumanthe post is on HN now
15:26ro_stmakes sense :-)
15:26JblazeHello, 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:27Jblaze(write)
15:27yogthosFer`: that might be a bug :)
15:28Fer`yogthos: aw :-( what do you recommend i should do. Flatten my vectors a bit?
15:28ro_stJblaze: tried (spit "filename" (pr-str data)) ?
15:29yogthosyou could do this (render "{%for x in foo%} {% for y in x %} {{y}} {%endfor%} {%endfor%}" {:foo [[{:id "s"} {:id "a"}]]})
15:29yogthosit's a bit uglier :)
15:29ro_stbhauman: this looks great. i've added it to my CSP queue
15:29bhaumanro_st: thanks :)
15:29ro_stor is that to my CSP channel?
15:30yogthosFer`: I'll take a look at supporting that though
15:31Jblazeyes it truncates
15:31tbaldridgebhauman: 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:31Jblazeunfortunately
15:31Fer`yogthos: Looking forward to it ty
15:34bhaumantbaldridge: I am assuming you are talking about the get-drawing fund. I am just using go as a promise in this case
15:34dnolenbhauman: wow impressive post, no atoms!
15:35bhaumandnolen: thanks, i really appreciate that
15:35bhaumanhn votes appreciated ;)
15:35bbloomdnolen: hehe. is that the new purity test? replace all your atoms w/ loop/recur? (inc erlang)
15:36bbloom(inc erlang)
15:36lazybot⇒ 2
15:36tbaldridgeerlang: "we don't have state...or actually we do, we just hide it inside closures where you can't get at it..."
15:37callenpretty much ^^
15:37bbloomso i've been thinking more about the "wither actors" thing
15:37bhaumantbaldridge: 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:37bbloomi agree that queues (and hence channels) are preferable
15:37bbloomhowever, i don't think channels are more primitive, at with respect to concurrency instead of distribution
15:38bbloomi feel like actors : lists :: channels : abstract data types
15:38bbloom+1 of indirection = /2 headaches
15:39bbloomat with => at least with
15:40tbaldridgebhauman: 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:42bhaumantbaldridge: meaning use more channels to separate concerns?
15:43bhaumantbaldridge: actually not picking up what you are getting at
15:44ToBeReplacedso... how long does it take before i should be able to post issues on jira?
15:45tbaldridgebhauman: 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:45bhaumanYep that
15:45tbaldridgeIMO, that sounds like someone is putting something into a chan that doesn't belong there.
15:46bhaumantbaldridge: Yep that was used to bleed off events
15:47tbaldridgeI think you could get rid of that with a combination of sliding buffers and/or more channels.
15:48bhaumantbaldridge: 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:50bhaumantbaldridge: I agree, I am going to revisit it, drawing is difficult and I used it to handle edge cases
15:50dnolenbhauman: typo, s/cheetsheet/cheatsheet
15:50Cho0foolcallen is installing yesod(haskell web frame work) now http://www.qadate.com/images/haha-nelson.jpg
15:51callenI do that about once a month to check to see if cabal is still broken.
15:51callenstill broken, for any wondering.
15:51callenCho0fool: see you in a month!
15:53Raynescallen: They're working on it though.
15:53RaynesThe sandbox stuff.
15:53RaynesThe only problem with the sandbox stuff is that compiling Haskell takes forever.
15:53callenI was using cabal-dev and it still broke on the first build for a single package.
15:53RaynesElixir compiles shit at the speed of sound cuz parallel.
15:54ystaelRaynes: thank you for clojail! clojail.core/thunk-timeout was just what the doctor ordered yesterday
15:54RaynesYou're welcome.
15:55RaynesI wonder if thunk-timeout will work forever.
15:55bhaumandnolen: fixed
15:55RaynesThey deprecated .stop ages ago, but haven't actually removed it. Do they ever remove things? Ever?
15:55ystaelRaynes: well, for my use case, it only needed to work until 8 PM yesterday :D
15:56glosoliAre 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:56callenglosoli: Hotelicopter, before they got bought out.
15:56callenWeatherbill
15:56dnolenbhauman: really really fantastic post, read it more or less all the way through. Will give a more in depth review later.
15:56callena rather large dating site network. a geneaology service.
15:57bts-flightcaster is clojure i think?
15:57bhaumandnolen: lookin
15:57bhaumandnolen: forward to it
15:57glosolithanks ! :)
15:58pmonksWeathertron (though ClojureScript on mobile)
16:02H4nssorry 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:04patchworkH4ns: (into {} (map (fn [k] [k (f k)]) array))
16:05patchworkWhere `f` is your function
16:05H4nspatchwork: ah, so simple! thanks a bunch!
16:06patchworkYep! clojure is beautiful
16:08Raynes(into {} (map (juxt identity f) array))
16:08Raynespatchwork: ^
16:08Raynes:
16:08Raynes:3
16:08yogthosFer`: so yeah that was a bug in parsing the keys, I got it fixed and will push out a new version tonight
16:08ystaeleverything's better with juxt
16:08llasram(inc Raynes)
16:08Raynes~just
16:08lazybot⇒ 34
16:08clojurebotexcusez-moi
16:08Raynes~juxt
16:08clojurebotjuxt is the bestest option though if it doesn't weird you out
16:09hyPiRion(zipmap array (map f array)) ;; duh.
16:09H4nsit weirds me quite a bit
16:09patchworkjuxt! I should have known if I wasn't using juxt there was something wrong
16:09ToxicFrogYeah, zipmap was my first through
16:09ToxicFrog*thought
16:09RayneshyPiRion: You're a bad person.
16:10H4nswoha, juxt.
16:10H4nsthanks.
16:10zphdsmaybe another topic that can incite some fights in this channel, :), but what is the 'flask microframework' in the clojure world?
16:10zphdslib-noir + compojure?
16:11glosoliwhat are some best resources around cljs ?
16:11yogthoszphds: http://www.luminusweb.net/
16:11piranhawhat's fn*? :) Just saw it in (macroexpand '#(...))
16:11zphdsyogthos: cool, let me take a look...
16:15ztellmanpiranha: it's one of Clojure's fundamental forms
16:15hyPiRionRaynes: I know.
16:15Fer`yogthos: kk
16:15tcrawleydnolen: you should pressure bhauman to come to the conj
16:15ztellmantry macroexpanding (fn [[x y]]) to see how it differs from the normal fn
16:15piranhaah ok
16:16piranhaztellman: thanks! I see now :)
16:18gtrakpiranha: if you're really curious: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L46
16:19piranhaso it's actual function, unlike 'fn', which is a fancy wrapper around it
16:19piranhahehe, the same with other destructuring forms, like loop or let
16:19cespareztellman: I don't get it.
16:19cespare(macroexpand '(fn [x] (+ x 1)))
16:19cespare(fn* ([x] (+ x 1)))
16:19gtrakit's the bottom level that the compiler deals with, after macroexpansion
16:20piranhacespare: (macroexpand '(fn [[x]] x))
16:20tbaldridge,(clojure.walk/macroexpand-all '(fn [[x y]] (+ x y))
16:20clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
16:20tbaldridge,(clojure.walk/macroexpand-all '(fn [[x y]] (+ x y)))
16:20clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk>
16:20piranhagtrak: yes, I see. It was interesting to see (macroexpand '(let [[x] [1]] x))
16:21gtrakmacroexpand is also part of the compiler
16:21gtrakit's recursive, outer-first
16:21piranhasure :)
16:22piranha(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:23tbaldridgethere's no point, the JVM jit will remove the vec__4117 p__4116 part
16:24piranhaI see
16:24piranhawell this is fun stuff :)
16:24bbloomi really wish there was a symbolic representation of the jvm byte code & i could do the moral equiv of a macroexpand on it
16:25piranhatoo bad compiler is in java, it's a bit harder to read than clojure :-)
16:25tbaldridgebbloom: there is
16:25bbloompiranha: the clojurescript compiler is written in clojure. many important differences, but the structure is illuminating, none the less
16:25hiredmanbbloom: well, you mean javap?
16:25ztellmanbbloom: https://github.com/gtrak/no.disassemble
16:26ztellmanit's really, really useful in certain situations
16:26bbloomoh awesome
16:26hiredmanno.diassemble seems kind of meh
16:26bbloomi wish it was in an sexpr form, but i guess i can settle on this
16:26gtrakit's pretty trivial, I'll be the first to admit :-)
16:26hiredmanway too much, you can capture the bytecode without all that
16:26ztellmanhiredman: it only gives you a pretty-printed version
16:26ztellmanwhich is all the Eclipse debugging library gives you, unfortunately
16:27bbloomstill, cool stuff!
16:27ztellmanI've toyed with trying to dig deeper, but it's been enough for every situation I've needed to know about the bytecode
16:27hiredmanI have a replacement for eval somewhere that captures the bytes of any generated classes
16:27piranhabbloom: but there is a GSoC about doing actual clojure compiler in clojure, right?
16:27hiredmanso you don't need an agent, etc
16:27bbloompiranha: 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:27bbloomso it's likely to be some pretty ugly clojure
16:28gtrakhiredman: yea, this was in lieu of modifying clojure itself, or the classloader code.
16:28bbloommaybe even uglier than the original java! :-P
16:28piranha:))
16:28gtrakit's really a brute-force approach
16:28ztellmanI dunno, I just use it as a default plugin, and don't think about it
16:28ztellmanI'm wasting literally megabytes of memory, I know, but somehow I survive
16:28bbloomi haven't needed to tune perf down to that level yet, thankfully
16:28gtrakztellman: I was worried about this, I guess it's not a problem in practice?
16:29dnolenbhauman: HN is so weird, your post got ringed
16:29bbloomdnolen: vote ring detection is a serious issue
16:29hiredmanhttps://gist.github.com/6214648
16:29futilekill inheritance plz
16:29bhaumandnolen: yeah iot's down at 42 now
16:29ztellmanbbloom: you discover some interesting things using it
16:29futilekill complexity plz
16:29futilekill over-engineering plz
16:29dnolenbbloom: as in it doesn't make any damn sense
16:29ztellmanfor instance, the emitted bytecode for (if (< x y) …) and (if-not (> x y) …) are completely different
16:29bbloomi 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:29ztellmanthe former is much, much more efficient
16:30bbloomso 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:30futilekill the prevalent attitude of late that highly encourages and praises all these things plz
16:30futilefin.
16:30hiredmanztellman: is the jitted asm any different?
16:31bhaumandnolen: are you sure it was ringed?
16:31ztellmanhiredman: I'm pretty sure it would be, unless the JVM is much more clever than I realized
16:31gtrakhiredman: nice, only downside is you still have to eval stuff manually, that big a deal really.
16:31dnolenbhauman: I can't imagine it getting flagged, it was in the top 10 5 minutes ago.
16:31gtraknot that big a deal, really*
16:31dnolenbhauman: you rarely see drop offs like that w/o ringing
16:32ztellmanhiredman: actually, no, I'm sure. The latter was way slower.
16:32dnolenbhauman: of course there could be secret group of Clojure hating flaggers?
16:32ztellmandnolen: or Clojure hating mods?
16:32hiredmanztellman: sure, and you are sure it was jitted in your tests?
16:33ztellmanhiredman: I used criterium, I think that absolves me of those sorts of concerns
16:33hiredmanI mean, I am not doubting, just curious
16:33ztellmanbut I wasn't looking at JIT debug prints or anything
16:33hiredmanlooking at the implementation of if-not it looks like it would be pretty bad
16:33bhaumandnolen: well it's still getting votes and climbing
16:34bbloomHN is a lost cause, i'm pretty sure pg has given up on it at this point
16:34ztellmanhiredman: in the slow case, it was a function invocation and a boolean object comparison
16:34hiredmanextra function call to not, not has it's own if, etc
16:34ztellmanyes
16:34bbloomsshhh nobody tell the hacker community about ltu
16:34piranhabbloom: well it seems there is still nothing better at this point...
16:34Bronsabbloom: i am actually making it clojure-ish as I write it :)
16:34ztellmanand that's not something that would ever happen in Java, so they probably didn't optimize it
16:35bhaumandnolen: perhaps no comments in an hour is an valid algorithm
16:35piranhabbloom: ltu is less general
16:35bbloompiranha: of course.
16:35ztellmanhiredman: though I think if-not could just invert the clauses, right?
16:35ztellmanno need to actually call 'not'
16:36tbaldridgeztellman: whats this gonna do then? (if-not (mypred? 1 2))
16:36hiredmanztellman: maybe, also as people don't depend on macro expansion ordering
16:36hiredmanas long as
16:36ztellmantbaldridge: there are no clauses in that, I'm confused
16:37hiredman(if-not (foo? 1 2) :a :b) => (if (foo? 1 2) :b :a)
16:37tbaldridgeoh, nvm, I understand, just re-order the if/then
16:37ztellmanexactly
16:37bts-and if there's no else clause, insert nil for the missing clause
16:38ztellmanthat would fix the unpredictable performance in the (if-not (< x y) …) case
16:38ztellmanbut it's not clear if anyone but me cares
16:38ztellmanand I can manually reorder, I guess
16:40hyPiRionztellman: well, it's essentially just changing `(if (not ~test) ~then ~else) to `(if ~test ~else ~then), isn't it?
16:41hyPiRion(in the if-not macro)
16:41ztellmanhyPiRion: sure, but I'm not hopeful w.r.t. the chances of a patch on if-not making it into Clojure proper
16:42ztellmanmaybe someone with more juice could give it a shot
16:43bbloomhyPiRion: that's a broken macro
16:44bbloomugh wait no, nevermind
16:44ztellmanhaha, I was going to say, I don't see it
16:44bbloomsorry, javascript on the brain atm
16:47TimMcs/ on if-not// :-(
16:49zerokarmaleftbbloom: LtU is safely of such high caliber that I don't think scrubs would even bother commenting with pretense
16:49TimMcAlthough apparently the unsigned-bit-shift-right patch might be getting some love, since it is interfering with Clojure-in-Clojure data structures.
16:49amalloyztellman: 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:50hiredmanstart by turning if-not in to a macro that uses a SSA representation to examine the predicate...
16:51bbloomzerokarmaleft: 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:52ztellmanTimMc: https://github.com/ztellman/primitive-math problem solved
16:53zerokarmaleftbbloom: I have a bit more Benjamin Pierce to read on that score
16:53ztellmanseriously though, the amount of grief I saved myself by just creating simple wrappers for static Java functions is immense
16:53ystael(inc ztellman) ;; starred, thank you!
16:53lazybot⇒ 6
16:54hiredmanit would be really nice if the compiler's set of intrinsics was extendable
16:55ztellmanhiredman: with the escape hatch of just using java, why does it need to be?
16:55bbloommaybe there needs to be a java* primitive :-)
16:55hiredmanor if numbers.java wasn't so gross, or the inlining and intrinsic stuff was more consistent
16:55ztellmanbbloom: you've seen alan dipert's javastar library, right?
16:56bbloomlol of course that exists.
16:56hiredmanztellman: because I don't want to write java
16:56bbloomso extensible compilers is a bit of a hobby interest of mine
16:56ztellmanbbloom: I think it beats out my local mutable variable hack for sheer hilarity
16:56hiredmanI want a core.logic rules and data driven generation of numbers.java and intrinsics.java
16:57bbloomhiredman: have you seen tbaldridge's ssa+datalog stuff? fun things coming :-)
16:57ztellmanhiredman: 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:57hiredmanbbloom: I've not
16:57bbloomtbaldridge: chime in here w/ a link for hiredman
16:57hiredmanztellman: sure
16:59hiredmanztellman: 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:59ztellmanhiredman: also a pony
16:59hiredmanhttps://github.com/hiredman/Archimedes/blob/master/src/Archimedes/foo.clj
17:00bbloomztellman: i don't think it's an impossible request
17:00hiredmanactually, that is the old bad one
17:00tbaldridgehiredman: 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:00hiredmanhttps://github.com/hiredman/Archimedes/blob/master/src/Archimedes/bar.clj
17:00ztellmanbbloom: 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:01hiredmanso it generates a bunch of method signatures right now
17:01ztellmaneither will take a while
17:01tbaldridgecore.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:01bbloomztellman: oh yeah, CinC is the gating factor for additional compiler cleverness. i'm sure Bronsa will accept some help :-)
17:02hiredmanMjö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:03ztellmandon'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:03technomancyI named my guitar that in high school
17:04bbloomtbaldridge: can you elaborate on what's going on there?
17:04ztellmanbut CinC was discussed at the first Conj, and it has yet to emerge as anything other than "a thing we could do, sometime"
17:04TimMcztellman: Hmm, nice! (primitive-math)
17:04bbloomtbaldridge: you extended the SSA with a generators/yield operation?
17:05ztellmanI'm interested in approaches that aren't gated on CinC that give comparable results, albeit with less elegance
17:05tbaldridgebbloom: 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:05hiredmanztellman: I don't the changes I am thinking of to numbers.java would require CinC
17:05bbloomtbaldridge: 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:05ztellmanhiredman: oh, maybe I was misunderstanding, you want to modify numbers.java itself?
17:06bbloomtbaldridge: looks like i could
17:06bbloomtbaldridge: looks like this yield is as general as the one described in here: http://lambda-the-ultimate.org/node/4349
17:06tbaldridgebbloom: 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:07TimMcystael: Did you ever figure out why unchecked-add was giving you overflow exceptions?
17:07tbaldridgeSo most of the core.async code is tested against this "runner" macro. it really simplifies testing alot
17:07TimMc'cause that was pretty freaky
17:07bbloomtbaldridge: that's awesome
17:07ztellmanTimMc: yeah, I used it to make https://github.com/ztellman/immutable-bitset/blob/master/src/immutable_bitset.clj
17:07hiredmanztellman: 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:07bbloomtbaldridge: i really like the idea of viewing computation effects as pausing a sub process & communicating with the parent process
17:08TimMcztellman: Immutable bitset... a.k.a. BigInteger? :-D
17:08bbloomtbaldridge: 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:08ztellmanTimMc: leaner in the sparse element case, and actually looks like a Clojure set
17:09tbaldridgebbloom: 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:09TimMcHmm, cool.
17:09ztellmanalso has a transient variant, so you're not forced to clone the bit array each time
17:09bbloomtbaldridge: in theory, you can kill *all* the monads. i'm pretty sure that yield == delimited continuations == monads
17:09ztellmanhaha
17:10tbaldridgebbloom: that's my theory as well, but I have no proof.
17:10bbloomtbaldridge: luckily, the PL community has proven it for you!
17:10bbloomi just finished groking a pile of this stuff
17:11ystaelbbloom: can you recommend a bibliography or reference list? or is it more "read LtU and chase links for a sufficiently long time" ?
17:11ystaelTimMc: no, i think that was temporary repl gremlins, i never saw it again
17:11bbloomhttp://okmij.org/ftp/ is a great place to start
17:11bbloomover the past 6 months or so, i've been basically trying to understand everything that guy has ever touched :-)
17:11ystaelbbloom: oh. "To begin, become as smart as Oleg." Got it. :D
17:12bbloomystael: start reading :-)
17:13ztellmanon a non-Clojure note, is anyone reading the Hyperloop pdf?
17:13bbloomtbaldridge: 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:13tbaldridgebbloom: nice! I'm going to read that paper then
17:13bbloomtbaldridge: multi-level delimited continuations & full continuations are basically GOTO, so that's a bad plan
17:14bbloomtbaldridge: yeah, definitely read that. then there is one other one you need to read about "handlers"… let me find this for you
17:15bbloomtbaldridge: http://math.andrej.com/2012/03/08/programming-with-algebraic-effects-and-handlers/
17:15bbloomthat's the one
17:15bbloomit's in an ocaml-like language, which is much more pleasant to read than haskell IMO ;-)
17:16bbloomanyway, 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:16tbaldridge(inc bbloom)
17:16lazybot⇒ 12
17:16bbloomjust like spinning off a sub process
17:16bbloomthe 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:16bbloomthe 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:17bbloomthis pattern lets you create a process tree that can cleanly handle computational effects
17:17bbloomand there is a really clean algebraic treatment of this approach as well
17:18callenbbloom: thinking of giving a talk on monads at my company. Should I explain them in terms of meteorites or burritos?
17:18bbloomi just wish we had macros with dynamic-extent :-( it would be so nice to have non-local transforms into SSA
17:19ztellmancallen: monads are like a Lovecraftian horror...
17:19tbaldridgecallen: I prefer to look at them as red-headed step-children
17:20bbloomtbaldridge: let me know once you've battled your way through those two papers. would love to hear your thoughts
17:20tbaldridgewill do
17:20callenbbloom: you want dynamic extent?
17:25ystaelspeaking of theoretical background, where is a good place to start for foundations behind core.async ? the CSP book ?
17:25bbloomtbaldridge: 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:28bbloomystael: the golang community is a great source for the *practical* background
17:28bbloomystael: the theoretical background is yeah, the CSP stuff, plus SSA
17:28cmathesonystael: 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:29bbloomthere are also deep parallels to CPS (note the transposed P and S) and the various continuations work from the FP community
17:29ystaelbbloom: (= (acronym-expand-1 "SSA") "static single assignment") ?
17:29bbloomtrue
17:29bbloomcsp = communicating sequential process; cps == continuation passing style
17:30bbloomalthough i'm no longer a believer in unencapsulated, reified continuations
17:30ystaelbbloom: in the sense of Scheme "full call/cc" ?
17:31bbloomyeah
17:31bbloomeven in that second paper i linked, where they do reify delimited continuations as functions
17:31bbloomthey don't allow the continuations to escape (i think)
17:33bbloomtbaldridge: you should totally open source a core.yield library too. i think people would totally dig that as well
17:35ystaelbbloom: having trouble finding the precise reference for the "first paper" you mentioned above
17:35ystael(oleg, shan, spj)
17:36bbloomit's linked right on top of http://lambda-the-ultimate.org/node/4349
17:36bbloomhttp://parametricity.net/dropbox/yield.subc.pdf
17:36ystaelbbloom: cool, thank you!
17:37bts-bbloom: unencapsulated == undelimited?
17:38bbloombts-: unencapsulated meaning you can edit or inspect them
17:38bbloom(outside of debugging, i mean)
17:38bts-i see. thanks
18:17hiredmanI did a little yield macro for a restartable json encoder I was thinking about
18:18hiredmanhttps://github.com/hiredman/json/blob/master/src/com/thelastcitadel/cps.clj
18:29Fer```read-string and edn/read-string seem really buggy with windows files
18:30hiredman1. read-string doesn't have anything to do with files 2. you have a bad default encoding
18:31Fer`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:31Fer`hiredman: sorry i do (read-string (slurp file))
18:32Fer`well the file is originally encoded in utf-8 and then i open it with notepad
18:32hiredman1. that is a gross way to files 2. have you checked the output of slurp?
18:32hiredman3. what is returned?
18:33Fer`hiredman: the same file only with crlf. Also what would be better than that?
18:33hiredmanslurp reads the entire thing in to memory as a string
18:33Fer`yeah it returns a string with crlf
18:33Fer`and read-string silently blows up or something it doesnt return anything
18:34hiredmanreading 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:34hiredmanFer`: that isn't possible
18:34hiredmanFer`: your repl must be broken, how are you running the code?
18:35hiredmana bare clojure.repl? lein repl? slime? nrepl? counter clockwise?
18:36Fer`hiredman: nrepl: https://www.refheap.com/17541
18:36hiredmanwhat nrepl client?
18:36Fer`mm how do i know that
18:36hiredmanhow do you start it?
18:37Fer`i do nrepl-jack-in on emacs
18:37hiredmanwhat version of nrepl.el?
18:37hiredmanI guess it doesn't matter
18:38hiredmanare you using something like the latest?
18:38hiredmanwhere did you get your nrepl.el?
18:38Fer`it says 0.1.8
18:38Fer`from emacs live
18:39Fer`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:39hiredmanFer`: they can't get "turned to nil"
18:40Fer`hiredman: but that's what happenning :-(
18:40hiredmanFer`: 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:40Fer`no the file is outside the jar
18:41hiredmanFer`: what happens if you java -cp the-uber-jar clojure.main
18:41hiredmanthen try to slurp your file
18:44Fer`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:46Fer`read-string still fails though and it returns a ?
18:46Fer`at least that's what the windows console tells me :'P
18:47hiredmanFer`: 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:47hiredman~encoding
18:47clojurebotCool story bro.
18:47hiredman~google jvm file encoding
18:47clojurebotFirst, out of 75300 results is:
18:47clojurebotutf 8 - Setting the default Java character encoding? - Stack Overflow
18:47clojurebothttp://stackoverflow.com/questions/361975/setting-the-default-java-character-encoding
18:47upwardindexI'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:56yogthosFer`: ok selmer 0.3.8 is up on clojars and should work as expected ;)
18:57ztellmanupwardindex: I wouldn't assume it's faster
18:57ztellmanjackson, the library that cheshire uses, is heavily optimized
18:58Fer`yogthos: nice
19:01Fer`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:02justin_smithnotepad bug?
19:02Fer`Uhm well i can't expect people to modify configuration files in windows with anything else
19:03hiredmannotepad does ascii, so if you have weird characters in there editing the file in notepad will break it
19:03Fer`I guess i can try removing the non english characters
19:05Fer`hiredman: is this better? (with-open [in (PushbackReader. (FileReader. path))] (edn/read in)) The other way seemed more succint :')
19:06hiredmanyes, but you can use clojure.java.io/reader and clojure.java.io/file instead of FileReader
19:06Fer`ty for your time
19:13hiredmanhttp://pythonforbiologists.com/index.php/29-common-beginner-python-errors-on-one-page/ this is great
19:14technomancyhiredman: you gonna make a clojure one?
19:15justin_smith[does it work in the repl but not in -main] -> [does your code use map or for?]
19:15hiredman"did you get an exception?" - yes -> "did you read it?" - no -> "which public school system failed you?"
19:15justin_smithhah
19:16justin_smithreading clojure stacktraces is a special kind of literacy, thanks to laziness in particular
19:16technomancy"Maybe we can still find something to talk about. Like how you let your family down."
19:16technomancyhttp://achewood.com/index.php?date=09232002
19:21ToxicFrogMan, that flowchart is way too optimistic
19:22ToxicFrog[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:24justin_smithimagine 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:25ToxicFrogI know
19:26bjapretty sure people I know actually do that
19:26ToxicFrogAnd 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:26ToxicFrogAs if reading them would somehow CRASH THEIR BRAIN or something
19:26ToxicFrogbja: yes? That wasn't hyperbole on my part, that was drawn from years of watching people taking first-year CS
19:27ToxicFrogUnless you mean the bread
19:27ToxicFrogIn which case I have no idea
19:27bjayeah, I've seen the first year cs thing, but I was talking about the generic non-computer stuff. in particular, with cars.
19:27ToxicFrogwelp now I'm even more sad
19:29futilebruh
19:30ToxicFrogHow does it work with cars?
19:36johnmn3hey, 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:37johnmn3I'm getting: Uncaught Error: URI file:/robots.txt is invalid for field ppu
19:37bjaMostly 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:41bjaIndicator 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:42johnmn3"cross origin requests are only supported for HTTP."
19:43bjajohnmn3: python -m SimpleHTTPServer 8080
19:43bjajohnmn3: a lot of browsers will section off interesting things from file:///
19:44bjarunning a simple http server from the directory of your static html will help
19:45johnmn3bja: 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:46bjajohnmn3: I suppose that would depend a lot on how your phone's browser engine handles file:/// requests
19:47bjajohnmn3: it might be that something like webkit as a widget for android/iphone/whatever has relaxed rules on hitting, file:///
19:47johnmn3aye
19:50nopromptthe 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:51nopromptnevertheless it's cool that people think it's interesting enought to star. :)
19:52technomancymore libraries should have a "Why?" section in the readme
19:52hyPiRionnoprompt: hey, don't complain. My most starred project is a hello world program.
19:53noprompttechnomancy: i included a "Why?" section. although the answer is both snarky and truthful. :)
19:53bjajohnmn3: https://groups.google.com/forum/#!topic/phonegap/meQSrujEsTo seems to indicate that XHR requests to file:/// are kosher on android's webview atleast
19:53technomancynoprompt: yeah, that's what I mean; you're setting a good example =)
19:53noprompthyPiRion: no complaints here!
19:53johnmn3bja: you rock!
19:53hyPiRiongood =)
19:54bjajohnmn3: you might look at phonegap's java scaffolding for android to see how they initialize their webkit to be consistent
19:54bjamight be able to consult their scaffolding for iOS/etc too (or just use phonegap...)
19:55noprompttechnomancy: my only hope is that if anyone plans to use it seriously, they ask themselves the same question.
19:55johnmn3bja: yea, using phonegap
19:56bjajohnmn3: that makes me want to try to build a clang-based phonegap app now. thanks for killing my free time.
19:56noprompti 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:57noprompthyPiRion: 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:57noprompt:P
19:59hyPiRionnoprompt: hah, no. I'm actually happy with it just the way it is, stars doesn't really matter =)
19:59noprompthyPiRion: i tend to agree. :)
20:00nopromptif anything, i hope people get the battlestar reference. lol.
20:05noprompti love it when i edit a conflicting diff and delete the part i actually wanna keep. love it. <3
20:07bjanoprompt: hope your editor has an undo tree
20:09nopromptbja: i did a git rebase -i (which i never do) had a conflict, editted, committed, then realized i fraked it up.
20:10nopromptbja: iow, i can't fix it. i'm gonna have to rewrite the code from memory.
20:10bjamaybe it mirrored somewhere and you hadn't pushed yet?
20:11nopromptbja: no, i did a git push -f right after. ha!
20:11awaltersnoprompt: if you once committed it, it's in the reflog
20:11nopromptfortunately it wasn't to master!
20:11awaltersit's only if you haven't committed/stashed that you can really lose stuff
20:11nopromptawalters: oh rly?
20:12awaltershttp://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html
20:12awaltersit's always been something i need to read about when i need it...which thankfully is less and less
20:12awaltersbut it has saved my ass
20:12nopromptawalters: well, this is good information. thanks!
20:13awaltersnp. good luck!
20:15nopromptawalters: that's pretty neat. wow, you saved me some trouble.
20:15awaltersgreat thing to know about in these situations. hopefully they don't come up often :-)
20:18nopromptindeed. 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:19nopromptinteresting. does this mean that git commit history is immutable?
20:19tieTYTi'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:19tieTYTanyone know what I'm talking about? I'm hoping i didn't pervert the spirit of his suggestionm
20:19bbloomnoprompt: modulo garbage collection
20:19technomancynoprompt: yes; basically only refs change in git
20:19bbloomgit help gc
20:20technomancywhich sounds awfully familiar
20:20nopromptbbloom: am i going to have to read a paper? :P
20:20tieTYTJS 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:20bbloomtechnomancy: no idea what you're referring to. what could possibly be similar to immutabile+gc ?
20:20nopromptthat's very cool.
20:20bbloomnoprompt: nope :-)
20:21technomancybbloom: if only programming languages had support for a kind of "references" which could point to different immutable things over time
20:22bbloomtechnomancy: 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:23technomancyit's so crazy it just might work
20:23nopromptbbloom: did you go to college? someone was suggesting i should skip it and just read papers. can't remember if that was you.
20:23bbloomi went to college, but skipping it and just reading papers is a whole lot cheaper
20:23noprompt* dreads returning to college in a week.
20:23bbloomi dunno if i recommended that
20:24bbloommy actual opinion is far more nuanced
20:24bbloombut if your choice is college+debt, i recommend not-college+not-debt
20:24nopromptbbloom: 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:25ztellmannoprompt: 4 classes a year?
20:25nopromptztellman: i work full time and don't want to get C's.
20:26nopromptztellman: but yeah, basically. maybe 5 if i can take a course during the summer.
20:26cmathesonnoprompt: i was doing 1 class a semester by the end, you'll make it eventually
20:26noprompti might be able to test out of something but i would still have to pay for the units i believe.
20:29hiredmannoprompt: 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:29bbloomi 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:30bbloommost undergraduate CS curriculums are a fucking joke
20:31noprompthiredman: 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:32ztellmanbbloom: what did you work on at google?
20:32bbloomtranslate.google.com
20:32ztellmanah, that'd be a good one
20:33bbloomwas certainly jumping in the deep end
20:33noprompthiredman: 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:33ztellmanI got stuck doing GWT frontend development, got out pretty quickly
20:33bbloomouch.
20:33hiredmannoprompt: yeah, that is an understandable concern
20:33nopromptbbloom: you are right about the undergrad CS courses being a joke.
20:33bbloommine 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:34bbloomlearned fast.
20:34ztellmanha, yeah
20:34hiredmannot 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:34ztellmanMy 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:34ztellmanno allocations, no nothing
20:35bbloomztellman: i dunno about now, but in 2007, google's HR department was a black hole
20:35technomancythe 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:35bbloomtechnomancy: why was that always so difficult?
20:35ztellmanbbloom: they actually let most of them go ~2008, and had an 18 month hiring freeze
20:35bbloomthere was some insane mac address entry form thinggie that didn't take normally formatted mac addresses
20:35ztellmanI came in right at the end of that, everyone was a new hire
20:35noprompthiredman: 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:35bbloomztellman: yes, i know about that hiring freeze. it's why i wound up working on xbox
20:35bbloomthat's when i graduated
20:36ztellmanit was a total mess, my recruiter got fired right after my offer, which is how I got lost
20:36ztellmanunbeknownst to me, since I was taking a month off between jobs
20:36ztellmannot a great initial experience
20:36technomancybbloom: this is back when hardware on Linux was actually hard
20:36bbloomi 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:36technomancyc. 2003
20:36bjaintro 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:37cesparefor 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:37cespareI 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:37bbloomtechnomancy: 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:37bbloomtechnomancy: barely knew what a kernel was, much less how to write a kernel model when i started
20:38technomancyhaha; nice
20:38hyPiRion"paid off all debts in < 2 years" -> Whoaa, where did you work you say?
20:38bbloommy coworkers loved me, but apparently i didn't get enough research done
20:38bbloomnevermind the 100X productivity boost to everybody else
20:38bbloomultimately quit when i was sick of having to go fight for my late pay checks
20:38cesparehyPiRion: haha, i didn't
20:38nopromptwhat 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:38cesparehyPiRion: also my parents paid half of my undergrad, so maybe it would've been four years without help.
20:38bbloomnoprompt: that's what really upsets me. it's a fucking business
20:39cesparenoprompt: wtf, i think your problem is a half-assed CS program.
20:39callenIntentional symbol capture in a small family of macros all conforming to a known contract (aforementioned symbol) - kosher/not-kosher great idea/best idea?
20:40bbloomthe 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:40nopromptcespare: well there's not much i can do about it but get through it, i guess.
20:40bbloomso 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:40nopromptbbloom: was the strike successful?
20:40technomancybbloom: sturgeon's law for undergrads
20:41cesparebbloom: 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:41jcsimsthere are some key things I get from my CS education, but also very important things from my own studying and several internships
20:41bbloomnoprompt: 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:41callencespare: excellent. :)
20:41bbloomtuition diversification, i call it
20:42noprompt* should have remained a math major.
20:42bbloomcespare: i think that high drop out rates are a feature iff the kids who pass come out dramatically better for it
20:42cesparebbloom: yeah there could be many reasons.
20:42bbloomcespare: 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:43bjabbloom: I've never really seen a place that fails people for the thrill of doing it
20:43bbloombja: i've seen a few teachers do it
20:43hyPiRionbja: You've never been to Europe
20:43nopromptbja: have you heard of test first? lol.
20:43hyPiRion"Oh, the exam was too easy? We should apply a normal distribution on it"
20:44bbloombja: 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:44bjahyPiRion: most of my profs decided to just make exams extremely difficult to score well on
20:44hyPiRion"Oh, the exam was too hard, and over 50% failed? *shrug*"
20:44bbloombja: he admitted this publicly after the last day to drop passed
20:44ztellmanbbloom: don't the TAs do the grading, typically?
20:44bja(and hten making those classes mandatory for any engineering undergrad)
20:44bbloomztellman: not if you're such a dick that nobody wants to be your TA
20:45ztellmanha, well
20:45hyPiRion(dec shitty professor)
20:45lazybot⇒ -1
20:45callen(inc tenure)
20:45lazybot⇒ 1
20:45hyPiRionbbloom: that sounds like a nightmare
20:45bjaah, I guess I had mostly sane profs for the few years I went to university
20:46bbloomhyPiRion: the full version of this story can only be told over beer and off the record :-)
20:47hyPiRionheh
20:48nopromptcolleges 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:48bbloomi'm pretty down on the state of education
20:48bbloomdon't depress me.
20:48callennoprompt: gyms can be shown to high school seniors and their parents.
20:49nopromptcallen: this is true. a part of the marketing pitch for the resort they'll be sending their kids to.
20:49bjacallen: so can dorm rooms. but spending money on a fancy gym was way more important than dry dorms
20:51nopromptbbloom: aparently cursive is eventually going to be a thing of the past, joining the ranks of the arts and physical activity.
20:51nopromptbbloom: because, you know, america needs an army of critical thinkers and art and physical activity, well, they play no role in that.
20:53callenphysical activity is a good way to make your brain perform better.
20:53callenspeaking of, time to coffee up for today's hoist.
20:53bbloomnoprompt: dude, hate to break it to you, but cursive went away in the early 90s
20:53nopromptcallen: that was part of the point i was making.
20:54nopromptbbloom: what? naw. i remember learning cursive in the early 90s.
20:54bbloomnoprompt: cancelled it when i was in grade school
20:55nopromptbbloom: well it's news to me!
20:55jodahn00b Q: I'm hitting some "unable to resolve symbol: ", in two different situations, when attempting to load/reload a file. what causes this?
20:56bbloomyeah, fuck cursive :-)
20:56patchworkI don't remember the last time I wrote by hand at all
20:57patchworkI had to write a check the other day, I almost forgot how to do my signature
20:57bbloompatchwork: 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:57patchworkit was strangely alien
20:57bbloomi'm more of a notes-in-vim sorta guy
20:57bbloombut it's just not the right tool for box and line diagrams
20:57nopromptpatchwork: i find that solving problems on paper/whiteboard helps me find solutions to problems more efficiently than hacking on them.
20:58bbloom(inc whiteboard)
20:58lazybot⇒ 1
20:58patchworkbbloom: Right! I make boxes and arrows with a pencil
20:58patchworkjust not words
20:58callenbbloom: I definitely had to learn cursive in the 90s.
20:58callenI need an at-home whiteboard. I need an at-work whiteboard too for that matter.
20:58callenGerd dermmert.
20:59technomancyI've got a roll of butcher paper for my lap
20:59technomancylab
20:59nopromptthat'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:59callentechnomancy: do you just slap the roller on the wall or something?
20:59noprompti 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:00callennoprompt: I'm sure my landlord would love that.
21:00noprompthttp://www.ideapaint.com/
21:00ztellmannoprompt: it doesn't erase very well
21:00jcsimsnoprompt: I've seen blackboard paint as well
21:00callenmost walls are probably too textured for it to erase well.
21:00ztellmanI think it's more than that, ink adheres better than it does on an actual whiteboard
21:00nopromptcallen: fuck your landlord. he'll change his mind once he's seen the added value.
21:01ztellmaneither way, lots of ghostly past ideas
21:01nopromptbut i do have to admit ztellman is write, you really gotta wipe it down.
21:01bbloomztellman: i actually found that the idea paint in my last office building was the *nicest* whiteboard in there
21:01patchworkztellman: One half of basic I/O
21:01bbloomerased very well
21:01bbloomi think there are several grades of quality of the stuff
21:02noprompt"write" was on purpose. i sware.
21:02ztellmanI'm a write-only sort of guy
21:02ztellmanbbloom: very possible, I never procured the stuff, just used it where it was already up
21:07nopromptbbloom: 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:10bbloomcould just be that the other whiteboards were double shitty
21:10bbloom:-)
21:11callenClojure web discussion: https://www.refheap.com/17547
21:21technomancycallen: I stick it up with thumbtacks
21:22callentechnomancy: immutable whiteboard. I like it.
21:22technomancycallen: unfortunately no structural sharing =(
21:23callenbutcher paper isn't a HAMT. Sorry.
21:25callentechnomancy: any opinions on intentional symbol capture as part of a contract?
21:47nopromptbbloom: 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:47bbloomi don't recall giving you that idea either, apparently my memory is going. but rock on data structures!
21:49nopromptbbloom: 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:49bbloomwhat operations are you preforming on this data structure?
21:50`cbpcallen: hi
21:50nopromptbbloom: 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:51bbloomgotcha
21:52nopromptbbloom: 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:52nopromptthe input there being ["bar" "barn" "barnaby"]
21:53noprompti was thinking that a DAWG might make it possible to keep the overall data structure thinner.
21:53nopromptbut going from a DAWG to a regex is probably more complicated. wit the trie it's pretty damn easy.
21:56nopromptbbloom: have you used a DAWG before?
21:56bbloomnope
21:59gfredericksI add :profiles {:logic {:dependencies [[org.clojure/core.logic "0.8.3"]]}} to my project.clj
21:59gfredericksand then `lein with-profile logic repl` fails to start, not finding nrepl code
22:00dnolenztellman: 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:01ztellmandnolen: yeah, but I don't know how useful that is
22:01ztellmanwithout some sort of peek or pushback behavior, it's probably not something you'd want to expose
22:03dnolenztellman: I think take-while is pretty useful, you can simulate push back by implementing something like concat
22:04ztellmandnolen: 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:04ztellmanunless you have some way to flatten it out when the prefixed message is consumed
22:05dnolenztellman: that's a thought, but you are correct - I don't you want to use it all the time
22:05dnolenztellman: however reading over this http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html
22:05dnolenmade me see the possible utility, or maybe there's some other way to eliminate the redudancy
22:06dnolenin 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:08ztellmanyeah, I'm not sure what the right way to handle that is
22:08dnolensomething to ponder ...
22:08ztellmanthere'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:09ztellmanyou can do it in Lamina pretty easily, but the interaction with the queues is a lot more involved as a result
22:09ztellmanI'm not clear that's a good trade-off
22:11dnolenhmm I suppose it could be avoided with sentinel values
22:11dnolenlike it is everywhere else
22:12ztellmanright, in Lamina you have (read-channel* :predicate f :on-false ::false)
22:12dnolenk
22:12dnolenthanks
22:13ztellmanbut 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:42mindbender1is there an idiomatic way of nesting aget calls in cljs?
22:42mindbender1like get-in in clj
22:43ambrosebsmindbender1: isn't aget variadic?
22:43technomancygfredericks: try `with-profile +logic` instead
22:44technomancyyou're replacing the :base profile from whence the nrepl dep coms
22:44mindbender1ambrosebs: I'm not sure about that
22:45mindbender1I'm getting wrng number of args
22:45mindbender1*wrong
22:45ambrosebsmindbender1: I think it should work.
22:45ambrosebsmindbender1: code?
22:47mindbender1ambrosebs: yeah, it works. Thanks
22:47gfrederickstechnomancy: thanks
22:47ambrosebsok
23:01muhoothat 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:01muhooi'm tryign to edit the doc, and it ain't lettin me
23:07muhoooh well i forked it fwiw https://www.refheap.com/17551
23:14bbloomfor all the awesomeness of core.async & the ioc macros…. i'm really sad i can't use it with HOF
23:18nopromptapparently the pattern i generated to match every word in /usr/share/dict/words is hoax. so says the internet.
23:21tbaldridgebbloom: HOF?
23:21bbloomhigher order functions
23:21bbloomsorry for the unnecessary acronym
23:21RaynesDon't ever apologize HOFmeister.
23:21tbaldridgebbloom: yeeeahhhh....I have some thoughts on those lines, nothing workable yet.
23:22tbaldridgebbloom: 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:23bbloomtbaldridge: wouldn't you need to do full defunctionalization?
23:23bbloomtbaldridge: i've started attempting to implement the effect handlers idea in that second paper
23:25nopromptRaynes: HOFmeister. lol.
23:25tbaldridgebbloom: 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:25bbloomtbaldridge: if you do that, then i'd need to (defmacro <3 [tbaldridge] ...)
23:25tbaldridgelol
23:25bbloomwhile i got you here
23:25callen`cbp: hi!
23:25callen`cbp: http://www.reddit.com/r/Clojure/comments/1k8v72/a_discussion_a_couple_of_colleagues_and_i_had/
23:26bbloomtbaldridge: i'm curious if there is a way to hook non-terminal positions in the ioc macros
23:27tbaldridgebbloom: 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`cbpcallen: do we have any plans to support {% for x,y in foo %}?
23:28`cbpright now it turns that into :x,y :-P
23:28callen`cbp: that's...a really good point.
23:28callenyogthos: ahem ^^
23:28callenyogthos: comma-based destructuring of for loop iterators?
23:28tbaldridgebbloom: 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:29bbloomtbaldridge: 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:29bbloomhere's my use case for hooking things:
23:33bbloomok 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:33bbloom a computational effect, just the same as an exception handler's catch block for example
23:33bbloomthe idea is that evaluation is a computational effect
23:33bbloombut you can "intercept" evaluation and modify the result via a "val" handler
23:33bbloomit's basically your hook into the monad (*cringe* that i said that)
23:33bbloomso you can define `val x = [x]`
23:34tbaldridgebbloom: so you want to intercept individual function calls?
23:34clojurebotfunction is <Chouser> there is one class per fn, one instance of it per closure
23:34bbloomtbaldridge: i'm not precisely sure what points i want to hook
23:34Phil_DI'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:34Phil_D(generate-string model/find-all-models)
23:34Phil_DThis 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:34Phil_D"JsonGenerationException Cannot JSON encode object of class: class org.bson.types.ObjectId: 52099f9a0364ddb5b182ffa5 cheshire.generate/generate (generate.clj:147)"
23:34Phil_DI 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:34bbloomi guess i want to hook any expression which would be evaluated, yielding a value
23:34bbloomso like (let [x (some thing here)] ...)
23:34callen`cbp: I'll email it.
23:35callener...github issue it.
23:35`cbpcallen: okk
23:35bbloomi want execution to pause at (some thing here) and trigger something like a terminal
23:35bbloombasically insert extra states for ever time an expression is evaluated
23:36tbaldridgebbloom: isn't that what pause does in the runner macro?
23:36tbaldridgein that case it simply continues to the next block, but wouldn't that do it
23:36bbloomyeah, but the pause is explicit
23:36bbloomi want to insert it explicitly at keep points
23:37bbloomand pause would also apply a function to the value before sticking it back in to the state map
23:37dnolenPhil_D: do you have a classes directory lying around in your project directory?
23:37tbaldridgebbloom: would the (some thing here) be known at compile time?
23:38bbloomyes. they happen at particular points in the syntax of the primitives. hold on, let me find the precise description in this paper
23:39Phil_Ddnolen: I have a 'models' directory that holds functions to insert documents to the database as well as query collections.
23:40callen`cbp: it's up. Good find!
23:41bbloomtbaldridge: 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:41bbloom:-)
23:41tbaldridgebbloom: lol, yeah, I'll try to get to it soon
23:41bbloom tbaldridge no rush of course. i'm just dicking around
23:42dnolenPhil_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`cbpcallen: :-) I'm reading your chat
23:42bbloomtbaldridge: for now, i'm gonna do the explicit thing, like pause
23:43dnolenPhil_D: http://github.com/dakrone/cheshire/blob/master/src/cheshire/generate.clj#L147
23:43dnolenPhil_D: it looks like you're passing in something cheshire cannot handle
23:45Phil_Ddnolen: 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:46dnolenPhil_D: I'd be wary about that conclusion "Chesire doesn't care"
23:46dnolenPhil_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:46dnolenPhil_D: the fact that it works in production is likely a distraction, it should *never* work
23:48Phil_Ddnolen: 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:49dnolenPhil_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:50Phil_Ddnolen: Gotcha. It could be the way I'm interfacing with the REPL. I've had mixed results (I'm just beginning Clojure development).
23:52callenPhil_D: are you using Clang?
23:52dnolenPhil_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:53callen`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:53callen`cbp: look at this: https://github.com/chameco/Hitman/blob/master/src/hitman/core.clj
23:53callenridiculously awesome.
23:54dnolencallen: damn
23:54callendnolen: I'm considering writing an experimental validating lexer and parser for Selmer with Instaparse :)
23:55`cbpI 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:55callenI'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:55callen`cbp: sadly yogthos' was further along and you weren't online to consult on something. Sorry about that :(
23:56`cbpit's ok his is prolly faster/better anyway
23:56Phil_Ddnolan: even if I'm using nRepl with Emacs? Like, I'm throwing entire buffers into the REPL for evaluation.
23:56Apage43I just got to use instaparse for a thing
23:56Apage43was nice
23:56callen`cbp: proooobably. The current design of Selmer is essentially based on the actual DTL implementation, but 6x less code.
23:56callenApage43: went well eh?
23:56Apage43yep
23:57Apage43thing works
23:57callen`cbp: Selmer is like ~1k LOC. DTL is ~6k
23:57Apage43end users get (relatively) useful errors when they do something wrong
23:58callenApage43: oh really? Could you show me an example?
23:58callenApage43: error handling is actually our primary concern atm.
23:58callennow that performance has been conquered (haha, perverse priorities :)
23:59brehautcallen: that hitman code is awesome