#clojure logs

2014-01-08

00:00CaptainLexThe other way around, if I read you correctly
00:00CaptainLexLisp is powerful because the macro system exists even at the REPL
00:00andrew__oh, i gotcha now
00:00danneuit would be more Clojuresque to represent find-user-by-uid/find-topic-by-uid/find-forum-by-uid as (find-by :user/uid 42), right?
00:00danneui'm just looking at my db namespace and questioning my life
00:00CaptainLexdanneu: Sounds right, but goodness I know nothing about dispatch
00:00andrew__CaptainLex got it, it wasn't detailed in that way in the book, hence the apparent and obvious inconsistentcy
00:01danneuCaptainLex: if it's good enough for you, it's good enough for me capn
00:01CaptainLexandrew_ Glad I could help!
00:01andrew__I am also glad that you could help!
00:05CaptainLexWell, good night chaps. That it's for me tonight :P
00:34abaranoskybbloom: Transduce is a neat little library I saw when looking that the Fipp source code. It is nice becuase the implementation is so simple. Still trying to think of places I could use this kind of approach.
00:41sm0keshould a protocol be extended with defrecord of deftype?
00:43sm0keor*
00:47andrew__marco
00:48abaranoskysm0ke, depends :)
00:48abaranoskyif you want map-like behavior then defrecord, else deftype
00:48abaranoskyI mostly use deftype
00:50mysamdogpolo?
01:03bbloomabaranosky: i don't use transduce itself that often, but i use those sorts of techniques ALL THE TIME
01:04andrew__from the REPL how can I see my version of Java?
01:04bbloomandrew__: look up the System class' getProperty method
01:04bbloomandrew__: use (System/getProperty ...)
01:08andrew__Hm it reports an incomprehensible number that I cannot find any meaning for user> (System/getProperty "java.vm.version") "20.65-b04-462"
01:08bbloomandrew__: you can also figure it out with java -version
01:08bbloombut if you need the marketing version number at runtime... there should be a way to get that
01:09amalloyjava.version, right?
01:09bbloomandrew__: oh, you asked for java.vm.version
01:09bbloomit's just java.version
01:09andrew__ok i got this: java version "1.6.0_65" surely I am not running Java 1.xxx !!
01:10amalloythere is no java 2.xxx
01:10bbloomandrew__: that's java 6
01:10bbloomit's technically 1.6
01:10andrew__ah, ok
01:10bbloom2.0 would be backwards incompatible, but that never happened / probably never will :-P
01:10andrew__never say never
01:11andrew__just look at Python 3
01:11bbloomandrew__: and look how well that's turned out
01:11bbloomlol
01:11andrew__exactly, but an ugly monster is still a real monster
01:11bbloomi've said this before, and i'll say it again: they should have just made three times as many breaking changes and called it Boa or something else snake related & it would have done great :-)
01:12andrew__ah that would have been cool for sure
01:13andrew__I've heard that Clojure 2.0 will be called Denial
01:13sm0kepython is going towards clojure
01:13sm0kei gues somewhere down the lane python 6.0 will be actually lisp
01:13eggheadwut
01:14sm0ke:D
01:14sm0ketrue story!
01:15mormonHey, any ideas how could one wrap compure resources route, so that I could do some precech kon the args it gets like "path" and etc. The idea is to append something to some paths it gets
01:15Jardadoes someone know a library that wraps ZipOutputStream
01:16RaynesJarda: There is a bit of stuff in https://github.com/Raynes/fs. May not do exactly what you want, but it might serve as a useful example.
01:16bitemyappJarda: reading *and* writing code is the Royal path to getting good.
01:18andrew__if you use Lein to install Clojure itself, will lein keep Clojure up to date?
01:18eggheadya andrew__
01:18andrew__so everytime you start a repl with lein, it will make sure you have the most recent version of Clojure?
01:19bbloomandrew__: no
01:19sm0kenot true
01:19bbloomandrew__: clojure itself is just a jar. it's specified as a dependency in your project.clj file
01:19JardaRaynes: seems like it does just what need
01:20sm0kebbloom: well you could have lein launch without a project too?
01:20andrew__ok, so when Clojure is updated to fix bugs or whatever, it gets a new version number, and I change the version number in the project.clj and then Lein makes sure I have the latest?
01:20bbloomsm0ke: that'll use whatever version of clojure lein was installed against based on the lein version
01:20amalloyandrew__: that's about the shape of it, yeah
01:20andrew__i like shapes, amalloy
01:24andrew__so there is probably not much reason then to clone the clojure core repository as is suggested in a book i'm reading
01:24andrew__if lein can just update it for you
01:25sm0kehey guys did you know scala just had a sicp about macros
01:25sm0kesicp is scala improivement process or some shit like that
01:25sm0kei wonder how thats even possible
01:26amalloyandrew__: cloning the source is useful for looking things up, but i wouldn't recommend actually building the source
01:27seangrovesicp?
01:27clojurebotsicp is http://web.mit.edu/alexmv/6.001/sicp.pdf
01:27andrew__good to know mr. amalloy
01:27seangroveThey had a book about macros for Scala?
01:28sm0kehttp://docs.scala-lang.org/overviews/macros/overview.html
01:28sm0keugly stuff! user discresion is advised
01:29andyf_seangrove: I think sm0ke meant to say SIP (Scala Improvement Process), not SICP
01:29abaranoskybbloom: I've got to expand my repertoir to see good opportunities to use state monad-like solutions
01:29seangroveandyf_: Ahhh, ok. I was scanning through looking for a reference to sicp
01:29andyf_http://docs.scala-lang.org/sips/
01:29sm0keoh sorry, yeah sip*
01:29sm0kedo we have cip too?
01:30sm0kelol
01:30seangroveJIRA?
01:30sm0kehah
01:30sm0kefunny
01:30seangroveDrinks with Rich & co?
01:30andyf_sm0ke: We have JIRA tickets, some of which are enhancement requests, and there are design pages with ideas for possible enhancements.
01:30bbloomabaranosky: tinkering with factor really helped me understand where that sort of thing makes the most sense
01:30sm0keyea i get it, you know how scala has a bit of added complexity to everything
01:32bbloomabaranosky: i now think in terms of alternating operational and denotational solutions. i write functions that transform trees in to other trees, then i flatten those trees in to sequences of op code-like things and reduce over them. i do shit like that all the time now
01:32bbloomabaranosky: like this patch i made for cljs: https://github.com/clojure/clojurescript/commit/9feed772a6db1d2697de387f14c05e7e99c9d891
01:33bbloomabaranosky: realized that it was a regular grammar i was parsing, so i made a state machine :-)
01:33amalloyoh hey, i was reading that code recently, bbloom
01:33amalloyi don't remember why, though
01:33abaranoskybbloom: so cases where you want to make decisions using some past state you've built up
01:34bbloomamalloy: the try parser, or the fipp / transduce code?
01:34amalloytry
01:35ddellacostadoes HMap not exist currently in core.typed?
01:36bbloomabaranosky: "past" is constraining thinking. more like "context" of any kind, which may include past
01:41ddellacostanever mind...figured it out
01:43seangrovelist-style-type: hangul, or list-styl-stype: cjk-heavenly-stem?
01:43seangroveI can't believe how much stuff the browser vendors have had to build in, it's amazing
01:51bitemyappddellacosta: why boggle?
01:51ddellacostabitemyapp: oh, just think it's freaking cool
01:57numbertenis there a go-to introduction to clojure book? or at least a highly recommended one?
01:57ddellacostanumberten: many folks feel like Clojure Programming is good for beginners: http://www.clojurebook.com
01:57numbertenspecifically for someone with fp experience but that doesn't know any lisp dialects
01:57numbertenddellacosta: thanks
01:58bitemyappnumberten: that'd be clojurebook.com, yes.
01:59numbertenalright i'll take a look, thanks
02:01akhudeknumberten: Joy of Clojure might be better if you already have fp experience
02:03sm0keare clojure datatypes by default serializable?
02:03koreth__I'm reading Clojure Programming right now and I don't find it's spending too much time rehashing basic FP concepts, though there's a bit of that. I like it in general but it has an annoying tendency to use functions in examples and not tell you what they do, so keep a web browser handy to browse the documentation.
02:04koreth__But that problem only happens occasionally and it's generally one of the better intro language books I've read.
02:04akhudeksm0ke: yes
02:05bitemyappakhudek: not knowing any Lisp? dodgy.
02:05bitemyappnumberten: what FP language did you use that wasn't a Lisp?
02:05numbertenhaskell
02:05sm0keakhudek: also are records and types?
02:06sm0kewhoa!
02:06akhudeksm0ke: records yes, types no, I think
02:06bitemyappnumberten: how much Haskell? Were you spitting monad stacks like bullets or are you still calling >>= "fishtail"?
02:06sm0keakhudek: taking your words on that
02:06sm0kethanks
02:07numbertenbitemyapp: not sure where i would fall on your scale
02:07numbertenI don't call bind fishtail, and i'm comfortable with monads
02:07bitemyappnumberten: then it's fifty-fifty on clojurebook.com vs. Joy of Clojure, clojure programming will cover more of the stdlib if that's something you care about.
02:07sm0kebitemyapp: dude do you always have you head so deep up your ass?
02:07numbertenthough I'm no crazy haskell type-hacker
02:07bitemyappnumberten: but Joy of Clojure is more compact.
02:07bitemyappnumberten: so I think it may come down to how verbose you like your books.
02:07bitemyappJoC might hit nirvana for you faster.
02:08bitemyappclojurebook can bore certain kinds of people if they already know Lisp, FP, or both.
02:08numberteni'll take a look at both
02:08bitemyappsm0ke: acquire an ambien suppository. There's no malice here except from you.
02:08bitemyappakhudek: solid guess on your part.
02:12amalloyif you have to tell someone to "acquire an ambien suppository" as part of an allegation that you're not being unpleasant, it's unlikely to be correct
02:13sm0ke,(instance? java.io.Serializable [1 2 3 4])
02:13clojurebottrue
02:14sm0ke,(instance? java.io.Serializable (seq [1 2 3]))
02:14clojurebottrue
02:14akhudeksm0ke: if you want to serialize clojure, it's probably best to do pr-str
02:14sm0kei guess seq results in a record
02:14akhudeksm0ke: not sure if everything implements java.io.Serializable, but who knows
02:15akhudeksm0ke: usually I use nippy to serialize stuff
02:15abaranoskyakhudek: Kryo's faaaaaaast. It all depends on what you need
02:16sm0keakhudek: well i have slightly different circustance
02:17sm0keakhudek: i am writing a library which can be used in objects which in turn demand to be serializable
02:17akhudekah, I see
02:17sm0kealthough thing can be marked transient , but would break the usage
03:11rurumate,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t")
03:11clojurebot["a" "b"]
03:12rurumate,(+ 5 22)
03:12clojurebot27
03:12rurumatehuh
03:12rurumatehow to evaluate stuff again
03:13ddellacostain humor, timing is everything
03:14rurumateand, how to make clojure.string/split return the correct number of tokens? the example above should return ["a" "b" "" ""] but returns ]
03:14rurumate*returns ["a" "b"]
03:16andyf_rurumate: Try adding a negative 'limit' arg to split. See example mentioning word 'negative' here: http://clojuredocs.org/clojure_core/clojure.string/split
03:16andyf_,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t" -1)
03:16clojurebot["a" "b" "" ""]
03:16ddellacostarurumate: there is nothing to split after "b"
03:17andyf_rurumate: You barely missed my example. I'll send it once more.
03:17andyf_,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t" -1)
03:17clojurebot["a" "b" "" ""]
03:20rurumateandyf_: woah black magic
03:20rurumate,(clojure.string/split (str "a" \tab "b" \tab \tab) #"\t" -1)
03:20clojurebot["a" "b" "" ""]
03:20andyf_Not really, just a careful reading of the Java docs for the underlying Java split function
03:20rurumateit should be documented in http://clojuredocs.org/clojure_core/1.2.0/clojure.string/split too
03:21andyf_I don't think the 1.2.0-specific versions on ClojureDocs should be high on anyone's list of worries.
03:22andyf_rurumate: But wait, it is documented at that link, too.
03:22rurumateandyf_: I meant in string.clj
03:23rurumateis it?
03:23andyf_In the doc string for clojure.string/split?
03:23rurumateoh yes negative limit
03:24rurumateI think yes, the doc string should mention the -1 case
03:24andyf_One can wish for it to be in the official doc strings all you want, but that is unlikely to happen. Fortunately you can change the doc strings yourself, if you want.
03:25rurumateandyf_: in my own fork, yes
03:25rurumateis clojure accepting pull requests?
03:25andyf_Or even without changing the Clojure source code at all, by changing the metadata of #'clojure.string/split
03:25rurumateheh
03:26andyf_rurumate: Clojure does not accept pull requests, it uses JIRA tickets. And it is highly unlikely that a change in the doc string as you suggest would be accepted. I'm not saying I wouldn't like it, but I've been watching what goes into Clojure for a couple of years, and detailed voluminous doc strings are not wanted.
03:27andyf_Here is one way to edit your own doc strings: https://github.com/jafingerhut/thalia
03:52mindbender1dnolen: Hi! What's the status of http://swannodette.github.io/2013/03/25/stlc-redux---part-ii/ . Is there a place where there is ongoing discussions?
04:31derek_cHow do you update lein?
04:32frankgerhardt__Hi, I have a question. I cloned a project from github. Now I want to use it in Counterclockwise. How can I generate the required Eclipse files, especially the .project with lein?
04:41frankgerhardt__so, I found "lein eclipse". Lein says eclipse is not a task. I added a :dev-dependency. What am I doing wrong?
04:44katoxderek_c: lein upgrade
04:52supersymfrankgerhardt__: did you install the plugin, add: :plugins [[lein2-eclipse "2.0.0"]]
04:52supersymto the project or profiles.clj file and you should be able to run the task
04:57si14_argh. I think I've hit the wall with records. Is it such a bad idea to use records to represent "objects" in my system?
04:58si14_oops. sorry for that.
04:59ohcibihi i'm just folowing this tutorial: https://coderwall.com/p/4yjy1a I dont understand why he (defonce force-toolkit-init....) I understand that it somehow leaked the (.show) function into the namespace but I dont understand how... can someone explain that to me?
05:05si14_I've represented "objects" with records. There were some strange "class not found" exceptions, but then I've added AOT of that namespace and everything worked fine… until I've investigated why "c.t.n.repl/refresh" is broken. It turns out that it will not work with AOT, and this is a problem.
05:06si14_so now I'm facing a choice: either I should rewrite quite a lot of code to use plain maps, or somehow avoid AOT of that namespace with records (and I've forgot to mention that it's shared between CLJ and CLJS, therefore CLJX).
05:09si14_I'm also using protocols to dispatch particular handlers on WS message, so they should be rewritten, too (using multimethods and :type field, I assume).
05:14sm0keHello people
05:15sm0kei am writing a library, so i dont have a bootstrapping method like -main, but i want to still bootstrap some code , like spawnning a thread etc
05:15sm0keand dont want it to leave up to user of library
05:15sm0kehow do i go about it
05:16sm0kei am asking this like 5th time
05:16sm0keheh would keep asking, unless someone answers :P
05:17si14_sm0ke: you can use some local atom for this. check it on execution of your function.
05:17si14_*functions
05:18sm0kesi14_: exactly what i thought
05:18sm0kebut then id have to put a check on every method
05:18sm0kealthough i can put the executable form in my namespace directly..but i am not sure if thats a good idea
05:20steeriosm0ke: you can also use a delay
05:21sm0kewhats that
05:21si14_sm0ke: it's fine if you do it once on loading of your code, AFAIK
05:21sm0kesi14_: isnt it an anti pattern?
05:21steeriosm0ke: try (delay (+ 1 2)) in the repl, you'll see that it's "pending" until you deref it
05:21si14_sm0ke: I don't know :)
05:22sm0kesi14_: i mean i gets invoked during compilation right
05:22steeriosm0ke: it's calculated exactly once, but not until it's needed
05:22sm0kesi14_: thats not what youd like
05:22si14_sm0ke: during loading of namespace. it's different.
05:22si14_sm0ke: it's runtime.
05:22steeriosm0ke: what is it that has to be initialized even before someone requires your library?
05:22steeriosm0ke: normally a defonce would totally suffice
05:22sm0kesteerio: no not before that
05:22steeriowell, then defonce
05:23sm0kesteerio: how is defonce different from def
05:23steeriowill refuse to set any value if the var is already bound
05:24steerioyou can avoid accidental reinitialization with it
05:26steerionot saying it's good for your use case, because we don't know that :)
05:27sm0kewell i dont see how defonce is useful in runtime, unless i dont hotswap forms in my production system
05:27sm0kethough a embedded repl or something fancy
05:28sm0keand moreover in that case i *REALLY* would not like defonce
05:29sm0kewhen i do a (def a (somefun))
05:30sm0kedoes somefunc gets called as soon as namespace is loaded
05:30pyrtsaYes.
05:30sm0keno right?
05:30sm0kenp it does not
05:30sm0keno*
05:30pyrtsaReally?
05:30sm0ke:(
05:30sm0kenot sure
05:30sm0keit would just define a function right?
05:31pyrtsaTry (def a (println "Really?"))
05:31pyrtsadef defines a var, and if you pass a value the value is evaluated right there.
05:32pyrtsa...so as soon as `a` exists for you, its value has been evaluated as well.
05:33sm0keok
05:33sm0keso to bootstrap code i can do (def dummy (boot))
05:34pyrtsaI think a much better option than a hidden defonce or anything like that is to wrap the whole thing into, say, a defprotocol (an object, essentially) and make the user do the initialization.
05:34sm0keor i can just put (boot), and let lein bitch about it while compiling
05:34sm0kepyrtsa: does defrecord has a constructor?
05:35pyrtsasm0ke: Not really but you can define a function that does the initialization and returns a record.
05:35sm0kepyrtsa: well a factory methods you sugest?
05:35sm0kei feel like working with java again
05:35pyrtsai.e. (defrecord Something [args ...] ...) paired with (defn something [some-args ...] ... (Something. ...))
05:36sm0keugh
05:36steerioin fact you can stay away from records as long as necessary and just keep using maps. their interface is pretty much the same.
05:36steeriothat's the real fun part about them.
05:36pyrtsasteerio: Good point.
05:37Jardawhen do you need a record?
05:37pyrtsasm0ke: The thing is, you're already adding state to the game -- and in this case, you we're even creating global state (which is the thread). *That* is the complication.
05:38steeriopyrtsa: when you have to implement a protocol, i guess
05:38steeriook sorry that's for Jarda
05:38pyrtsaState means that you're not dealing with values (unless you use something like e.g. monads to make the state behave like a value).
05:38Jardasteerio: yeah true
05:38steerioalso, there might be super-performance-critical applications when the benefit of property lookup vs. map lookup counts
05:39pyrtsaThat said, I think it's okay to (defonce worker-thread ...) if your use case is simple enough.
05:39sm0kedafuq i need defonce then, i can just def
05:40sm0kewho is going to reload the jar in a running system
05:41pyrtsaRight. :)
05:41sm0kepyrtsa: what?
05:41pyrtsaJust remember that running threads may prevent your JVM from shutting down.
05:41steeriosm0ke: in that jar defonce makes no difference, but during development you might send the whole stuff to the VM from the editor again, etc
05:42sm0kesteerio: yea for dev it makes sense
05:42sm0kesurealy
05:42sm0kesurely*
05:42pyrtsasm0ke: What steerio said, i.e. defonce doesn't matter in that case. :)
05:42sm0keagain why didnt anyone suggest just putting (boot) in my namespace somewhere?
05:43sm0kepeople seem to be aweful quite about it
05:43steerionow aweful and awful are complete opposites
05:44pyrtsaNow that I think of it, I think both (def x (run-some-code)) and (run-some-code) at the namespace level are pretty ugly if (run-some-code) may take a random time to complete.
05:45sm0kepyrtsa: why is that? one can just put it at the bottom
05:45sm0ke:D
05:45sm0kei hope things are evaluated in sequence
05:46noidiI think that, as a user of your library, I would be very surprised if just requiring the library would have side effects (such as starting new threads)
05:46pyrtsaHeh. I mean I think it's better to try to make namespaces load quickly and to move the performance penalty of setting things up somewhere else.
05:46pyrtsanoidi: Exactly.
05:47sm0keumm well
05:47sm0keyeaa
05:47noidicemerick's austin uses a clever thing where it starts its server in a delay
05:47noidihttps://github.com/cemerick/austin/blob/master/src/clj/cemerick/austin.clj#L42
05:47steerioi mentioned delays previously
05:48frankgerhardt__supersym, thank it worked
05:48noidithe server is started the first time the library needs it
05:48steerioin fact i had a similar problem with a ns that uses nlp heavily, and has to load the language models
05:48sm0keso delay is like lazy var
05:48steeriosm0ke: lazy value. you don't need to put the delay in a var.
05:48noidisteerio, oh, I only skimmed the discussion :)
05:49sm0kei want exact opposite
05:49sm0kewhich is just a simple def
05:49steerio:)
05:50steeriowanna hear a really ugly idea?
05:50sm0kefucking novice i am
05:50sm0keyeah sure
05:50sm0kethings are already bad
05:51steerioput the resource-heavy initialization in another namespace (that's only loaded by you, not the user), and use (use 'that-ns) wherever you need the initialized stuff
05:51steerio^ but more like, don't do this.
05:51steerio:)
05:51steeriowhat kind of initialization is this btw? setting up of connections?
05:52sm0keyeah
05:52sm0kewell i can be made explicit
05:52steerioi'd definitely make that user-triggered
05:52sm0keyeah but users are lazy and stupid
05:52sm0kelike myself
05:52steeriotell me one library where you don't have to trigger connection
05:53steeriohow are credentials passed, if any?
05:53sm0kewell core.async has 0 boilerplate
05:53steeriodoes it connect somewhere?
05:53steerioif you deal with connections, you might look for examples at donno, cassaforte
05:53sm0kebut it does init threadpools right?
05:53pyrtsasteerio: It actually does create a thread pool.
05:54pyrtsa...Not sure when that happens, though.
05:54sm0keyea
05:54sm0kecore.async is awesome sauce
05:54steeriopyrtsa: my understanding is that sm0ke deals with connections which come with configuration, credentials, and the remote party might not even be ready at load time for some reason
05:54steeriopyrtsa: that's why i specifically asked this
05:55sm0kesteerio: ok this one time for connections
05:55sm0kebut i find this ocurring for non network based stuff too
05:55steerioget it, you also wanted to hear about how it should be done in the broader sense
05:55pyrtsasteerio: Yeah, definitely should be explicit initialization there.
05:56sm0kenah thats how apis should be
05:56sm0kedefaults to implicit initialization, explicit for advance usages
05:57sm0kei dont knwo wether their is initialization at all in core.async
05:57pyrtsasm0ke: IMO if initialization is needed, then initialization returns a value that you use to call the API with.
05:57steeriohttps://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L370 :)
05:57sm0kehah
05:57sm0kedefonce
05:58sm0keso core.async has side effect as soon as you require it!!
05:58pyrtsasm0ke: Are you making a parametric connection to some server or just creating a thread pool?
05:58steerioit creates an objects and puts it in a var.
05:59steeriodefining a function is the same thing, basically.
05:59steerios/objects/object/
05:59sm0kepyrtsa: well there could be serivce discovery in long run
06:00steeriopyrtsa has the point: opening a connection is a side effect, creating instances is not.
06:00sm0keso its best kept to library
06:00sm0kenot user
06:00sm0kewell i am going to put executable form right in my namespace
06:00sm0keright now!
06:01pyrtsasteerio: It's all relative. In the end, creating *anything* has the side effect of allocating memory. Yet, creating threads does consume system resources (max number of threads), which might matter in some cases, but more often won't.
06:02steeriopyrtsa: side effect is a term that's used very loosely here, i think.
06:03pyrtsaIndeed.
06:03steeriopyrtsa: you can reasonably expect that loading a namespace will allocate memory, but if it starts making outside connections right away is a "side effect"
06:03pyrtsaIts definition depends on your use case.
06:03pyrtsasteerio: I definitely agree on that.
06:04sm0kehttps://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async.clj#L28
06:04steerioi noticed that one too
06:04steeriolooks a bit rude to me :)
06:05sm0keit basically a bootstrap code right
06:06steerioin fact the same commit adds this set! to a couple of other files too
06:09noidiI don't like that either. just because it's in a clojure/core project doesn't mean it's a polite thing to do :)
06:12sm0kehttps://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/exec/threadpool.clj#L16
06:12sm0kehow about this for polite
06:12steerionoidi: I'd put it in src/user.clj (and maybe .gitignore it), so it only loads when I'm in the REPL (which was probably the intention anyway)
06:13steerioit has no :main in its project.clj, so it'd work
06:14steeriosm0ke: I love the + 42 part
06:14steeriothat looks like some random "let's see it under stress" code left in
06:15sm0keyep, definitiely can be configurable
06:15sm0kewith sensible default
06:17sm0keso core async works with 2*no-of-processors+42 threadpool size
06:18sm0ke,(-> Runtime/getRuntime .availableProcessors)
06:18clojurebot#<CompilerException java.lang.SecurityException: Reference To Runtime is not allowed, compiling:(NO_SOURCE_PATH:0:0)>
06:19sm0keso for hyperthreaded quadcore we have ## (-> 8 (* 2) (+ 42)) ; threads
06:19lazybot⇒ 58
06:19sm0kewhoa!
06:20sm0keand thats a fixedthreadpool
06:22pyrtsasm0ke: Does it matter?
06:23sm0keyeah i you have a personal grade laptop
06:23sm0kefor servermachines not so much
06:23pyrtsa58 is much?
06:24sm0kewell if a thread takes 4mb you have ##(* 4 58); mbs just by requiring
06:24lazybot⇒ 232
06:24sm0kethats a side effect id say
06:26pyrtsaI agree.
06:27pyrtsaOn the other hand, it seems to me from the documentation that Executors/newThreadFactory creates the threads lazily: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Executors.html#newFixedThreadPool(int, java.util.concurrent.ThreadFactory)
06:27pyrtsa(Sorry, broken link, unless properly copied.)
06:29clgvpyrtsa: you can force it to create the threads http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ThreadPoolExecutor.html#prestartAllCoreThreads%28%29
06:31pyrtsaclgv: The point was that this side effect shouldn't happen immediately with core.async and its 2 * N + 48 threads: "<sm0ke> well if a thread takes 4mb you have ##(* 4 58); mbs just by requiring"
06:31lazybot⇒ 232
06:31pyrtsas/48/42/
06:31clgvI joined after that ;)
06:31pyrtsaYep. That's why I quoted. :)
06:36clgvpyrtsa: oh is there any rational for the magic numbers 2 and 42 in the formula for the number of threads?
06:37pyrtsaNo there isn't.
06:37clgvgreat.
06:37pyrtsa42 was mentioned in the Clojure Conj 2013 talk as a nice number.
06:38clgvwow, great. if douglas adams is the reason at least the magnitude should have a reason
06:38pyrtsaIMO there could be much fewer threads, and all blocking should be done outside core.async. (Ideally, there could be a mechanism to warn when you do block. Not sure how that could be done, though.)
06:39pyrtsaOn the other hand, 42 threads won't be many in a few years. ;)
06:39sm0keI dont really create threadpools but wheni do i multiply cores by 2 and and add 42.
06:39clgvwell, maybe the alpha is removed from the versions string as soon as a reason for the formula pops up ;)
06:39pyrtsaYeah.
06:39pyrtsasm0ke: :D
06:41clgvI dont like magic numbers in software: either they are parameters or come frome the definition of the specific problem that is tackled.
06:43corecodehi
06:45ucbanybody here played/used Samza with clojure?
06:47sm0kewhat is it like storm?
06:50ucbsimilar, yes
06:51sm0keis it better in someways?
06:52ucbit guarantees ordering of messages, persistence, and a few other things
06:52ucbI wouldn't say better, just different
06:52sm0kei see major prjects from backtype are not much maintained now
06:52sm0kebe it storm or cascalog
06:53ucbmaybe they consider them mature enough. Didn't storm originate from twitter anyway?
06:53sm0kehopefully there are new projects which seems to be replacing them
06:53sm0kenever knew about samza
06:53sm0keyeah different places same guys
06:54sm0kei like parkour
06:54steeriomoving to open source... with limitations... hm
06:54sm0keand pigpen seems promising too
06:54steerioi'll wait and see how this plays out
06:54sm0kesteerio: what are you talking about?
06:54steeriosamza
06:55sm0keits not limitation as in crippled versio for open source community and diamond version for enterprise users
06:55sm0keits lmitation as in shit not implemented
06:58steeriosm0ke: it depends on non-production-ready code, that's quite some limitation. also, it doesn't state when the "some months" would end, no date to say when "now" is.
06:58sm0kewell yeah its a incubator project
06:58sm0kebut its under apache for some reasons
06:59sm0kehave some faith
07:00steeriocomes from linkedin. they probably used it to spam and harass people, telling them to "claim" their automatically created profiles.
07:00steeriotook me nearly 2 years to get them to remove mine. 1/10, never again.
07:00sm0kewell kafka is from linkedin too
07:01sm0keseems pretty popular
07:01steerionot saying that makes it bad, just wanted to rant for a couple of lines :)
07:01sm0kesteerio: funny reason not to use a framework
07:01steerioi didn't cite it as a reason for that
07:02sm0kethey probably used it to harass people, its a sin if i write my code using that
07:02sm0kehah
07:02sm0kewell is it?
07:02steeriochill out, at no point was that said
07:02sm0keyou surely got me thinking
07:03sm0kewell its true to some extend
07:03sm0keoracle has completely ruined jersey for instance
07:03sm0kelike java
07:03steerioi guess it's not the devs making the business choices
07:03sm0keyea its the management making the dev choice too
07:03sm0kelol
07:03steerio:DD
07:04sm0kei hope openjdk catched up sometime soon
07:05jcromartieit seems fine to me
07:05sm0keis there any work being done i openjdk for tail recursion?
07:05sm0kejcromartie: yeah well there is a lot of dev effort in openjdk
07:05sm0keso its like bleeding edge
07:05steeriosm0ke: you mean tco?
07:05sm0kesteerio: yes
07:06steerioit's not in java specs, so they don't need to implement it at all
07:06sm0kedefinitrly, tail recursion is already there
07:06steeriois it?
07:06sm0kei sad it is there, not that its optimized
07:06sm0kesaid*
07:06sm0kewait
07:07sm0kedoes tail recursion means, stack space for previous call is removed
07:07sm0keit just mean recursion from a tail position
07:07steeriothe proper term is tail call optimization
07:07sm0keyes yes!
07:07sm0kei agree
07:08steerioyou don't have to be calling the same function, it can be a tail call to anything
07:09steerioso recursion is not necessarily implied
07:09sm0ketrue :)
07:09steerio(i say function as this is not related to the jvm but in general)
07:12logic_progin clojure/lein, instead of doing "lein run main", is it possibl to have one codebase that supports both (1) server and (2) client, which then allows me to do "lein run server" and "lein run client" ?
07:13augustllogic_prog: the problem I think is that at the end of the day you compile one jar file, that you run with java -jar
07:14augustllogic_prog: you could always create a "main" that reads the first item in argv and dispatches accordingly
07:14alewlein can run any main file in any namespace
07:14alewso you could have
07:14alewlein run -m app.client
07:15alewlein run -m app.server
07:15logic_progalew: this is what I wanted. nice, thanks!
07:15alewmain function*
07:18steeriologic_prog: wrap those in bash scripts (with the exec command so lein will actually replace your bash process), commit them too, and it becomes really user friendly
07:22sm0keis it a common practice to redefine a symbol in a running program?
07:22sm0kelike (if fail
07:22sm0kesorru
07:23sm0kesorry* (if fail? (def a 1))
07:23sm0keeh
07:23ucbI don't think so.
07:23sm0kewhere a is already put like (def a 0) as a top form in namespace
07:24sm0kei know i can use atom, but there i no requirement of multiple threads accessing it
07:24ucbyeah, no.
07:24sm0keucb: yes or no?
07:24ucbI'd vote for no.
07:24sm0keno for atom or def?
07:25ucbdon't know about atom, definitely not for def
07:25ucbI don't know what you're trying to do.
07:26clgvsm0ke: no please dont
07:26sm0ke:D
07:26clgvatom is fine if it is really needed that way
07:26clgvbut you might get similar problems as with singletons in OOP
07:26sm0keclgv: but whats the point of atom is there is not concurrent access
07:26sm0keif*
07:27clgvoh I answered sequential. first to redefining then to the atom approach ;)
07:28clgvsm0ke: I think there are not that many reasonable scenarios where a value of your application needs or should eb tied to a variable in the namespace
07:28clgv"changing values"
07:29sm0keclgv: well i am talking about a connection pool or smething like that
07:30sm0kewhich has to be only single value in the jvm
07:31clgvsm0ke: that's valid then. all sorts of globale registries as well provided they are justified
07:33clgvsm0ke: but you should probably implement pure functions which get the value of the atom as parameter and convenience functions that use the atom and pass its value to the former functions
07:36sm0keyeah makes sense
07:37sm0keusing atoms is probably saner
07:44andrew__i'm reading about atoms and swap! and I just don't see how this is different than a mutable programming style. it seems fundamentally that you are still changing state
07:44CookedGryphonandrew__: yeah, but you *know* when you're changing state
07:44CookedGryphonand it isn't the default, you have to go out of your way to say "this is state, things can change it"
07:45andrew__in another language i also *know* I am changing state when I do myInstanceVariable=7
07:45sm0keandrew__: you want python? (def a 1) (def a 2), there you go!
07:46amalloyandrew__: if i hand you an object, say in java, and it has some fields in it; if you hang onto that object, will its fields change without you assigning to them?
07:47andrew__amalloy of course they can, but how that different than having a def of an atom out there that you can access any time, and knowing that its contents could change as well, due to other functions you have
07:47sm0kehah
07:47amalloyandrew__: the difference is that in clojure you have to opt into that "things can change anytime" scheme
07:47amalloyin java, you don't get much choice
07:48andrew__by "opt in" I assume you mean by specifically defining it as an atom, as opposed to just a set or something
07:48amalloymutable things in clojure have to be handled differently from the normal immutable values, and you always know when you're working with one
07:50andrew__in C++ (I don't know Java but it is probably similar), fields are private by default, other objects cannot change the state of this object's field. to "opt in" i can make that field public. not sure I see a big difference there.
07:51amalloyuh, private is immensely different from immutable
07:51sm0keandrew__: so when you change a data structure in c++ you actually cahnge the data structure, while in clojure you get a completely new data
07:51amalloymember functions mutate private member variables all the time
07:52sm0keif i am not wrong, thats what the fundamental idea of immutability is
07:52amalloyif i give you a std::set<int> or whatever, it has a private member somewhere that it uses to store its data, somehow
07:53amalloyand indeed, i cannot mutate that member because it's private
07:53andrew__ok, sure, perhaps a different analogy is marking things const in c++ though there you'd have to deliberately "opt out" of mutability, so I can see where the "encouragement towards a paradigm" comes in
07:53sm0keandrew__: similar ot builder pattern if you prefer
07:53sm0keto*
07:53amalloybut i can call set->add(5), and now the set i gave you has different members than it did
07:54andrew__i guess what I'm noticing is that if your habits are strictly based on mutability, working in clojure could very easily allow you to continue those habits, with little effort, since refs and atoms are so easy
07:54sm0keyeah sure
07:55sm0kedo whatever you want man, its a free world
07:55andrew__it is often said that clojure is more functional than common lisp, but it seems to me that really both allow for whatever programming style you want, functional or not, equally easily
07:56CookedGryphonandrew__: a fine example of this is the java Date class
07:56sm0keClojure doesnt do mutable but when it does it makes sure you work hard.
07:56CookedGryphonwhich is actually mutable internally
07:56sm0kedid it sound like the meme?
07:57andrew__sm0ke i see what you mean, but i'm not sure it seems like working hard to mutate a few atoms whenever you want.
07:57CookedGryphonso if you pass a date to two places , each of those places can modify it for the other
07:57sm0keandrew__: and did you know that atoms are actually stm?
07:58CookedGryphonandrew__: point is, there are very few places where you actually do want to mutate state. Usually what you actually want is a value
07:58CookedGryphonincrementing 1 gives you a *different* value 2, it doesn't change 1 into 2
07:58andrew__so via the stm the atoms are managing concurrent access when it happens?
07:59sm0keyes thats the idea
07:59sm0keso its not like obj.x=3
08:00andrew__it's all very interesting, i'm deliberately playing devil's advocate just so I can understand it better
08:00CookedGryphonhere is a far more eloquent summary than I could ever give http://www.infoq.com/presentations/Value-Values
08:01Bronsasm0ke: atoms have nothing to do with stm
08:02sm0keSynchronous Transport Module?
08:02Bronsaoh, I thought you were talking about Clojure's STM (software transactional memory)
08:03sm0kehah
08:03sm0keBronsa: whyd you say that
08:03CookedGryphonrefs are STM, atoms use compare and set
08:04sm0kewhats the definition of stm?
08:04CookedGryphonhttp://en.wikipedia.org/wiki/Software_transactional_memory
08:04sm0kecan you set alter ref deref an atom?
08:04sm0kehttp://clojure.org/concurrent_programming
08:04sm0keaccording to this they are
08:05CookedGryphonsm0ke: no they aren't, it lists the three different approaches, refs, agents and atoms
08:05sm0keok whateverman, ill bounce for now
08:06sm0keyou the experts
08:08andrew__so atom is thread safe, but not because of STM specifically, right?
08:09CookedGryphonright
08:09CookedGryphonso an atom sets off some work on the old value
08:09CookedGryphonand then when it has the new value it wants to set, it does a single-instruction compare-and-set
08:10CookedGryphonif the value is the same as when it started, the new value is set, if it's changed, it assumes its new value isn't valid, and sets off the work again based on the value that's there now
08:10CookedGryphonand repeats until it succeeds
08:10CookedGryphonwhich is why you don't put anything with side effects into a swap! function, because it might happen multiple times
08:15andrew__interestingly, in an Apress book, it says that the println function is a side effect in a function, yet in Stu Hollaway's book, he calls a function pure based strictly it being value-oriented, even if it has println calls in it
08:15jcromartieanybody here have experience building a real event sourcing type of system in Clojure?
08:16jcromartieI think it depends on your application
08:16jcromartieif stdout is important, then println is definitely a side effect
08:16jcromartiebut if stdout is basically logging, then it doesn't matter much, does it?
08:17corecodea bit confusing that clojuredocs.org lists clojure.core max at 1.3.0
08:18jcromartieoutdated documentation is the bane of the clojure ecosystem
08:20alewI'm surprised no one has gotten around to updating clojuredocs
08:20jcromartiesituation: there are 14 outdated and confusing sources for Clojure docs; "hey, I know, let's make a new unofficial Clojure doc site that encompasses everything!"; soon: there are 15 outdated and confusing sources for Clojure docs.
08:23clgvcorecode: http://clojure-doc.org has a different approach but most of it was written post 1.4/1.5
09:13corecodealew: there seems to be commit activity on the clojuredocs github repo
09:15alewcorecode: that's encouraging. not that much as changed from 1.3 to 1.5 (almost 1.6) so it shouldn't be too much to update
09:15corecodethat in any case
09:32oracle1123for the following code, why it doens't return 30?
09:32oracle1123(let [x (transient {})]
09:32oracle1123 (dotimes [n 30] (assoc! x n n))
09:32oracle1123 (count x))
09:34dnolenoracle1123: transients don't work that way you must work with them in a functional manner (side note use a paste service)
09:38andyf_oracle123: http://clojuredocs.org/clojure_core/clojure.core/assoc! may be helpful in understanding
09:38shep-werkandyf_: good reference
09:46oracle1123thx everyone, understood. the following ulr is helpful http://clojure.org/transients
11:22sl33k1hi guys
11:25sl33k1new to clojure, experienced java developer...currently largely on windows box
11:25sl33k1looking at clojure to learn fx programming and improve thought process
11:25gtrakfx?
11:26mdrogalisFP, maybe.
11:26gtrakjavafx?
11:26mdrogalisSup, sl33k1?
11:27gtraksound fx?
11:27Sorellaf(x)
11:27mdrogalisFoxes, perhaps.
11:27gtrakovertone can be used for sound effects :-)
11:27SorellaWhat do they say?
11:27Kallikrateswhat color is that shed
11:28mdrogalis~fox
11:28clojurebotI don't understand.
11:28tbaldridgeclojurebot: fox is "Ring-ding-ding-ding-dingeringeding!"
11:28clojurebotIk begrijp
11:29pjstadigno
11:29sl33k1fp programming. sorry
11:29tbaldridge~fox
11:29clojurebotfox is "Ring-ding-ding-ding-dingeringeding!"
11:29pjstadigremove that fact now
11:29tbaldridgelol
11:29sl33k1in maths i think fx = functional
11:29mdrogalistbaldridge: I'll enjoy eval'ing that 6 months from now.
11:30mdrogalistbaldridge: Why exactly is thread preferred over future?
11:30tbaldridgemdrogalis: future returns a promise, thread returns a channel.
11:31mdrogalisAhh, right.
11:31mdrogalisYeah, I need to be able to do something akin to future-cancel.
11:31tbaldridgemdrogalis: that's a bit tricky
11:31mdrogalisI never use the result of (thread ...) so I guess it doesn't matter much.
11:31mdrogalistbaldridge: Oh?
11:31tbaldridgeyou could use future, and then cancel it
11:32sl33k1well anyone able to setup an okay environment?
11:32tbaldridgebut I'm not sure what would happen if you cancel a future while it's waiting on a channel
11:32sl33k1on windows
11:32gtraksl33k1: I used to use it on windows, getting the emacs stuff working is a little tedious, maybe it's easier to use something like light table?
11:32mdrogalistbaldridge: InterruptedException
11:32gtraknow I'm full-time linux.
11:32mdrogalisWhich is a fine result.
11:32tbaldridgesl33k1: I learned with netbeans and intelij on windows, I'd be tempted to try out Cursive
11:33tbaldridgesl33k1: http://cursiveclojure.com/
11:33sl33k1tbaldridge: i have paid IntelliJ copy
11:33gtrakwe have devs at work that run it in a linux VM
11:33mdrogalisI'm looking at a constructor with 37 parameters. Ahhhhh >_>
11:33tbaldridgesl33k1: I'm not a fan of LightTable, but you may like it more than I did.
11:33sl33k1tbaldridge: once i grasp language, i do lot of web apps, and seeing it with clojure would make lot of sense
11:34tbaldridgesl33k1: Cursive is a Intelij plugin for Clojure, I've heard good things about it and like it. However, I use emacs, so I have a hard time switching to a different IDE. If I had to switch however, it'd be to Cursive.
11:36sl33k1any of you guys built or can show stuff end user can relate to, front end stuff with clojure eventually?
11:36sl33k1e.g web apps or desktop apps. mobile is cool too
11:36gtraksl33k1: clojurescript is fast making headway.
11:36gtrakthat's clojure->js
11:36Kallikratesyou can do anything you can do with javascript with clojurescript
11:37gfrederickssl33k1: http://gfredericks.com/sandbox/qc
11:37gtrakgfredericks: I remember this from portland :-).
11:37sl33k1like web frameworks
11:37sl33k1found webnoir
11:38sl33k1http://www.webnoir.org/
11:38Kallikrateshttp://pedestal.io/ might be worth a look
11:38gtraksl33k1: noir's been superceded imo, try luminous, pedestal
11:38mdrogalisNoir's kinda dead
11:38gtrakluminus*
11:39gtrakseems like some people like 'caribou', I haven't used it.
11:39gtrakhttp://let-caribou.in/
11:39gfredericksgtrak: gonna come to SF?
11:40gtrakI don't know if I can make it out there, but I'll try for conj and one other this year, maybe strange-loop.
11:40gtrakI'm sad I missed that
11:40teslanickgtrak: That's a call to action if I've ever seen it. But I don't want a caribou anywhere that might be labelled "in"
11:40gtrakteslanick: damn antlers
11:41sl33k1so i just need to install Cursive in my IntelliJ and get going then. early last year, i tried clojure and installed the repl environment. not sure if i would need that now
11:41gtraksl33k1: you'll probably need to install leiningen
11:41sl33k1i'm just telling myself this year first quarter, the ellipsis cannot stop me!
11:41gtrakhttp://leiningen.org/
11:41sl33k1In java, i install jdk and then i have java
11:41sl33k1is leinxxxx like the jdk?
11:42gtrakyou don't install clojure, leiningen is like maven.
11:42gtrakand it's the standard project/package-manager/build-tool
11:42gtrakso it downloads clojure to run itself, but then it'll depend on your project.
11:42sl33k1you never install clojure? it uses the jvm then i suppose? and leiningen is like the comple tool
11:43clojurebotAlles klar
11:43sl33k1compile*
11:43teslanicklein pulls in the clojure compiler, which makes clojure into something that runs on the JVM.
11:43TimMcsl33k1: Clojure is actually a library.
11:43teslanickOr something like that
11:43gtrakyes, that's right. clojure's a jar file.
11:44sl33k1and a language.
11:44sl33k1what happens to repl?
11:44gtrakthere is a repl implemented as a main class inside the clojure jar, there are other repls, lein ships with one of those.
11:45gtrak'lein repl' will give it to you, inside a project, it'll give it to you with the project's environment.
11:45sl33k1gtrak: i am downloading this: https://bitbucket.org/djpowell/leiningen-win-installer/downloads/leiningen-installer-beta1.exe
11:46gtraknot sure if the installer does anything special, in the end, lein is a batch file that downloads/updates/runs the lein jars.
11:48sl33k1gtrak: lol. smooth trick
11:49gtrakif cursive somehow avoids requiring you to have leiningen, it'll be because it embeds leiningen. I'm not sure if that's the case, anyway can't hurt to have it :-).
11:50gtraklooks like it has its own deps/project model that it keeps in sync with leiningens.
11:50gtrakreminds me of the m2eclipse plugin.. badly.
11:52sl33km2eclipse is main reason i switched from eclipse
11:52sl33knetbeans makes it so easy...paid for intelliJ but havent actually gotten it yet
11:52gtrakI remember it being a can of worms.
11:52gtrakI had workarounds that I didn't know why they worked.
11:53sl33kgtrak: http://cursiveclojure.com/ isnt free
11:54eggheadisn't free how?
11:54sl33k" It will be a commercial product, at a similar price point to PyCharm or RubyMine."
11:54eggheadcertainly is free to install and use
11:54gtraksl33k: free for now, I guess :-). tasty lockin.
11:55eggheadlol
11:55gtrakbut emacs will certainly frustrate you for at least a few days.
11:55eggheadcursive clojure was good but I don't think I'd pay for it...
11:56gtrakon a related note, light table just went open-source today
11:56sl33kegghead: you use cursive? i am here: http://cursiveclojure.com/ and i dont know what to do next. no download plug-in link.
11:56teslanickhttp://cursiveclojure.com/userguide/
11:57eggheadsl33k: basically just add the plugin source and install through the intellij ui
12:01sl33kegghead: seen. :)
12:03gfredericks,:/
12:03clojurebot:/
12:03gfredericks&:/
12:03lazybotjava.lang.RuntimeException: Invalid token: :/
12:03gfredericks,*clojure-version*
12:03clojurebot{:interim true, :major 1, :minor 6, :incremental 0, :qualifier "master"}
12:03gfredericksI must need 1.6
12:05Bronsa,:|
12:05clojurebot:|
12:13dnolenibdknox: congrats on the Light Tables release!
12:13steerioso what does clojurebut do if i type ,(range)?
12:13steerios/but/bot/
12:13justin_smith,(range)
12:14clojurebot(0 1 2 3 4 ...)
12:14dnolenibdknox: exciting times will be cool to see where people take it.
12:14justin_smithsteerio: it has a print limit, so it does not eagerly consume the range
12:14justin_smith&(range)
12:14lazybotjava.lang.OutOfMemoryError: Java heap space
12:14justin_smithas opposed to lazybot
12:14justin_smithsomewhat ironically given the names
12:15llasramheh
12:15steeriojustin_smith: :)
12:15lsdafjklsddnolen: you will be surprised to hear that I still can't get that simple example working >.<
12:15lsdafjklsddnolen: after a few hours of trying haha
12:15dnolenlsdafjklsd: what example?
12:16lsdafjklsddnolen: remember the example I sent to you, with the "i'm the active project"
12:16lsdafjklsddnolen: in the list of projects
12:16dnolenlsdafjklsd: oh the active thing
12:16lsdafjklsddnolen: dude I'm losing my mind, can you help me
12:16dnolenlsdafjklsd: did you try the simplest approach first? i.e. callbacks?
12:17dnolenlsdafjklsd: don't have time to at the moment, pass a callback from parent to child via :opts
12:17lsdafjklsddnolen: ok
12:17dnolenlsdafjklsd: the callback when triggered will should set the active state in the parent, and invoke the child callback if needed
12:17dnolenlsdafjklsd: I don't like this pattern but it's easy to understand
12:18dnolenlsdafjklsd: core.async is it's own learning hump
12:18lsdafjklsddnolen: right on, currently i'm implementing like the todos example
12:18lsdafjklsddnolen: i'll give the callback method a go
12:18dnolenlsdafjklsd: I would do something simpler than that for this
12:18tangrammerjustin_smith: HI Justin, sorry if i disturb you but @jcidaho asked me about about.clj and i remembered you and your intention to implemented in your project
12:19dnolenlsdafjklsd: just a ul of li where if you click only one item is selected
12:19tangrammerjusntin_smith: about.clj > avout.clj :)
12:20tangrammerjustin_smith: about.clj > avout.clj :)
12:22seangroveibdknox: Indeed, congrats on the release of LT. I'm excited to see you getting back to cutting-edge stuff now that you have a proper base to work with.
12:25frozenlockWhat what what "Light Table is open source"
12:26zerowidthwhoaaaa nice
12:27illsortedis Light Table written in clojure?
12:28tbaldridgeCLJS I think
12:28dnolenillsorted: all ClojureScript, Clojure is only required for compiling CLJS, hopefully we can eliminate the dead weight soon
12:29illsorteddnolen: awesome, thanks
12:29frozenlockWith the ability to do some plugins! Oh... this is bad for my productivity!
12:30seangroveHeh, https://twitter.com/pmarca/status/420968246544576512
12:34justin_smithtangrammer: hey, yeah, I have a project to put config in avout
12:34justin_smithit has not been put to serious use, and I have been warned not to use watches with avout
12:34justin_smithif that helps at all
12:34justin_smithif you have more specific questions feel free to ask
12:35tangrammerjustin_smith: thanks for answering , the problem with this user jcidaho seem to be this issue https://github.com/liebke/avout/issues/2
12:35justin_smithAs the developer of an automated resizer tool using the image libs that ship with the jvm, let me just say that CMYK and YCCK can FOAD TIA.
12:36tangrammerjustin_smith: i am not sure if this behavior is good or not,,,, maybe if the connection is broken the data must be unavailable to persist … what do you think about?
12:37justin_smithtangrammer: ahh, I don't know - I use sql for long term but mutible config, and the codebase for persistent immutible config
12:37justin_smithavout I only use to keep instances in sync
12:38tangrammerjustin_smith: ok, a lot of thanks justin you are very kind with your answers, have a good day!
12:58dnolenibdknox: you're probably way busy but I still can't get 0.6.0 to connect to anything
12:59TimMc&(#(apply + % #_ %2 %&) 1 100 1 1 1)
12:59lazybot⇒ 4
13:00rasmustowait, where does 100 go?
13:01andyf_wow, did a variant of that bite you in production code?
13:01TimMcNo, I was just seeing if I could come up with a plausible scenario where it would.
13:01TimMcrasmusto: Into the interaction between #_ and #(
13:02rasmusto#_ without anything should just be whitespace, yeah?
13:02bbloomTimMc: very interesting!
13:02rasmustobut I guess the reader is choking
13:02BronsaTimMc: that looks reasonable to me, what'd you expect?
13:02bbloomit's not choking, it's doing precisely what it should do
13:02Bronsayeah
13:02rasmustoignoring %2?
13:02pyrtsa,(map #(% 10 ()) [drop take drop-last take-last]) ;; Argh!
13:02clojurebot(() () () nil)
13:02bbloomrasmusto: that's the point of #_
13:03TimMc#_ says "drop the next form", but the #( reader is keepign track of the largest %n it has seen
13:03BronsaTimMc: oh, I see.
13:03rasmustook, I thought you had to do #_%2
13:03TimMcNah, the whitespace in between doesn't matter.
13:03rasmustobut ok, I see the issue is really with %2 and %&
13:03Bronsayou'd expect that to expand to (fn [a & b] ..) instead of (fn [a b & c] ..)
13:03TimMc&[1 2 #_#_#_ 3 4 5 6]
13:03lazybot⇒ [1 2 6]
13:04TimMcandyf_: It was also a public service announcement, I suppose.
13:04andyf_TimMc: Thanks for keeping me steadfast in my use of ; for commenting out code :-)
13:05justin_smithandyf_: also, proper emacs syntax rule creation to handle #_ highlighting is *hard*
13:05justin_smithat least at my levels of elisp skill it is
13:05TimMcbbloom: "Should" is an interesting word to use there. :-P
13:06bbloomTimMc: no, you're right, it could go either way
13:06TimMcIt definitely performs according to spec, where spec == the code as written.
13:06dnolenso has anybody tried Light Table + Austin?
13:07dnolenor something similar?
13:08BronsaTimMc: on the same note, #_ #=(println "foo") makes the println run
13:08TimMcNow *that* doesn't surprise or bother me.
13:09Cr8#= is strange
13:09gfredericksyeah considering how #_ works it's not too weird
13:09andyf_Bronsa: I don't see that in a 1.5.1 REPL, but maybe I'm doing it wrong
13:10Cr8also consider that with #=(...), that code executes *during reading*
13:10Bronsaandyf_: http://sprunge.us/GcFU
13:10TimMcBronsa: What version of Clojure?
13:10Bronsa1.6.0-SNAPSHOT
13:11TimMcAh, OK. It doesn't do it in 1.5.1.
13:11Bronsabut I don't think anything has changed on that side, should be the same in 1.5.1
13:11BronsaTimMc: maybe the output gets swallowes by nrepl? I'm running java -jar ..
13:12andyf_Bronsa: Yeah, different behavior between straight java repl and lein repl
13:12TimMchttps://www.refheap.com/22623
13:12TimMclein repl
13:13BronsaTimMc: #_ #=(spit "foo" "foo") 1
13:13Bronsayou can see it gets run
13:14andyf_Bronsa: I don't think it is in lein repl
13:15TimMcBronsa: negatory
13:16TimMcI'm not worried about someone tripping over this, but I am a little uneasy that it is unexplained.
13:16Bronsauh, you're right.
13:23andyf_Does anyone know off-hand whether Clojure Java interop has a special case for a Java method that takes an int, but you call it in Clojure with code like (for [i (range 10)] (.methodName obj ^Integer i)) ?
13:24andyf_With ^Integer i, ^int i, or (int i), no reflection warning. With just 'i', reflection warning. I haven't checked the generated code in these cases yet.
13:24stuartsierraandyf_: i is a Long there, not an Integer
13:26andyf_So why no reflection warning with an ^Integer type hint?
13:27Bronsaandyf_: it gets unboxed automatically
13:27justin_smithandyf_: there is a lib that forces reflection warnings for primitive types, but it is a different paradigm from normal reflection
13:28justin_smithor I should say "reflection warnings" it is really warning about unexpected types / unexpected boxing
13:28andyf_The source of my question is that I ran across this while running tests on next version of Eastwood Clojure lint tool, and there was a method call like this that Eastwood is currently complaining about, but it looks like it should not.
13:28justin_smithhttps://github.com/ztellman/primitive-math
13:29justin_smiththat does more than just warn about unexpected boxing / unboxing, but could be a start
13:29Bronsaandyf_: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Reflector.java#L454-L459 this is how it gets done
13:29hiredmanandyf_: well, analyzer.jvm may not exactly match up with the actually compiler at the edges
13:30gfrederickstools.logging (afaict), at least with log4j, calls .getLogger on every logging call; that is less than ideal, correct?
13:32hiredmanandyf_: best thing is compile, inspect the byte code for reflection, open issues where things don't match the reality of the bytecode
13:34andyf_sorry, had a phone call there. Thanks for the info, folks. Most likely what I need to do is consider adding some cases to Eastwood to permit things that the Clojure compiler does.
13:35andyf_I've only run across this case once in about 50 different projects, so it is not a common thing in actual usage, AFAICT
13:37hiredmanandyf_: I am sure Bronsa is interested in hearing about mismatches
13:39andyf_hiredman: This appears to be a case where it isn't tools.analyzer(.jvm) that is causing any problems, but Eastwood linting code itself is complaining.
13:41hiredmanhuh
13:41andyf_hiredman: Don't worry, I've been bugging Bronsa a lot for the last month :-)
13:42hiredman:)
13:44dnolenibdknox: ok doing Om development with Light Table ROCKS
13:44dnolenibdknox: I wonder if LT couldn't provide some way to actively watch an atom though
13:44dnolenibdknox: or an arbitrary expression really
13:44dnolenibdknox: currently I have to re-eval to see the expression change if I'm interacting via the browser REPL
13:51canweriotnowIs anyone successfully using speclj with Luminus?
13:51canweriotnowI'm getting very confusing errors when I run `leon spec`
13:51canweriotnow*lein
13:52canweriotnowIt seems related to the core.cache/through issue...
13:52canweriotnoweven though I've got the workaround w/ memoize in my project.clj
13:53davis there a strict version of get that throws an exception if the key is not present in the hashtable?
13:53tbaldridgedav: no, thankfully
13:54davtbaldridge: why thankfully. would you rather the program continues to run and crash later with an obscure error when the nil hits something that can't digest it?
13:56technomancydav: part of learning clojure is learning to embrace the NPE
13:56tbaldridgedav: clojure is designed to handle nil gracefully, nil has a meaning in most of Clojure code. With no throw on missing key I can do stuff like this:
13:56tbaldridge, (filter #{3 4} [1 2 3 4 5])
13:56clojurebot(3 4)
13:56technomancydav: it's kind of weird because there is such a thing for sequential collections, just not for associative
13:57technomancygo figure
14:00Morgawribdknox: been hyped as hell because of new lighttable plugin and source code available, thanks a lot for the great job! It also feels really faster now
14:03tbaldridgedav: but as a whole, I've found that when working with transformations over data (map, filter, merge, assoc, etc.) I very rarely hit NPE, and when I do it's pretty clear when were it's coming from. Or I just add a few :pre asserts to make sure required inputs are available. Couple that with small functions, and I don't see a need to have collections throw exceptions.
14:06dnolenOm brain explosion - specify + protocols are going to be amazing http://github.com/swannodette/om/issues/51
14:07dnolenyou can patch ILookup for a speicfy map to get data representation independence
14:07dnolens/speicfy/specific
14:09bitemyappholy shit LightTable is open source now.
14:10Morgawrbitemyapp: yep
14:10Morgawrthe plugin system looks great too
14:10bitemyappMorgawr: now to begin a Haskell plugin >:)
14:11davtbaldridge: 'part of learning clojure is learning to embrace the NPE' => doesn't seem like a good reason why there should not exist a strict version of get..
14:11bitemyapp"learning to embrace the NPE" is the most perverse thing I have ever heard.
14:11bitemyappnull errors are utterly unnecessary.
14:12tbaldridgedav: you'll find different points of view on the whole NPE thing. technomancy is on the pro strict side, I tend to be on a different side of the argument.
14:12tbaldridgedav: and you can feel free to write your own strict get:
14:12davtbaldridge: yep thanks
14:12bitemyappI'm on the, "this has wasted billions of dollars and possibly also killed lives and as an industry we should be ashamed we perpetuate this mistake" side.
14:12davtbaldridge: was just curious why it wasn't already out there.
14:13davkind of miss haskell's Maybe
14:13davwondering if there would be a way to elegantly integrate that feature without having to go for the whole strict typesystem.
14:13MorgawrI wonder how big of a feat it would be to add annotation to the whole LT source tree with typed clojure
14:13bitemyappdav: I'm a Haskell user and I've looked at core.typed, it can help but really if you like having a helpful type system you're not going to get very far.
14:14Morgawrproject seems pretty massive
14:14bitemyappMorgawr: considering it's CLJS, pretty hard?
14:14tbaldridgedav: something like this will do the trick https://gist.github.com/halgari/8322555
14:14Morgawrtyped clojure doesn't work on CLJS?
14:14bitemyappMorgawr: ambrose is working on it.
14:14Morgawrah
14:14Morgawrmy bad then, I thought it was already working
14:14Morgawrcool though
14:14bitemyappMorgawr: JS has a very different underlying type system than Java.
14:14jcromartiebitemyapp: absolutely agree
14:14Morgawryeah
14:15dnolenMorgawr: that basics do work in CLJS
14:15bitemyappdav: I like Clojure, but my fucking god is so much human labor and productivity being wasted on errors arising from using untyped languages.
14:15dnolenMorgawr: CLJS isn't really different enough for the core
14:15dnolenMorgawr: interop is another story
14:15Morgawryeah of course
14:15bitemyappthat's sorta the point.
14:15davtbaldridge: not sure why you need to deftype? find ought to do it..
14:16davbitemyapp: agreed.
14:16tbaldridgedav: find returns a map entry, this way doesn't require a allocation on every get.
14:16davtbaldridge: isn't the mapentry fully shared?
14:17tbaldridgedav: I like ML, but so much human labor and productivity is being wasted on errors arising from compiler type checking.
14:17tbaldridgedav: no
14:17stuartsierraYou don't need to define a new type. (Object.) would work too.
14:17tbaldridgestuartsierra: good point I wasn't sure there was a way to do that in Java.
14:17davstuartsierra: what if there's an Object. in your map ?
14:17bitemyapptbaldridge: what's to lose in that direction?
14:17tbaldridgedav: I updated the gist to use (identica?) instead of (instance?)
14:17stuartsierra`identical?` checks object identity
14:17tbaldridgedav: reload the gist
14:18davstuartsierra: I see.
14:18bitemyapptbaldridge: I have yet to get a cogent example from an untyped enthusiast as to what they'd be missing in something like Haskell.
14:18tbaldridgebitemyapp: well, go write me a compiler or a OS in Haskell, if it compiles it's bug free!
14:18tbaldridge:-P
14:18dnolenbitemyapp: or a user interface that isn't total shite
14:18Morgawrtbaldridge: either have an OS that runs with bugs or an OS that doesn't compile :P
14:19MorgawrI'll take the first one
14:19bitemyapptbaldridge: you're missing the point. You can be more productive and spend less time overall tracking down errors in something like Haskell than an untyped Brand X.
14:19dnolenbitemyapp: or generic software that doesn't require reading piles of papers
14:19bitemyappdnolen: have you written Haskell? you don't have to read papers, just a tutorial accompanied by silly cartoons.
14:19tbaldridgebitemyapp: but the end result is that you program in two languages, a type language, and a runtime language. I'd rather do all my coding in a single language, not a language and a DSL.
14:20bitemyappyou don't program in the type system
14:20dnolenbitemyapp: I have written enough to know which patterns I like in dynamic languages become painfully difficult in Haskell
14:20bitemyappyou don't even have to write the annotations out of the gate to frame out an idea.
14:20dnolenbitemyapp: and seen enough generic programming papers in Haskell to be afraid
14:20bitemyappyou can query the REPL as to what it thinks the type is.
14:20bitemyappdnolen: what can you do in Clojure that you think you can't do in Haskell?
14:20dnolenbitemyapp: and read enough threads on the utter fuckup that is Haskell records
14:20dnolenetc etc
14:20bitemyappdnolen: that's what I've been begging for.
14:20bitemyappdnolen: I want a concrete, cogent example of Clojure code that you think can't be done in Haskell.
14:21dnolenbitemyapp: there isn't any thing you can't do
14:21dnolenit's just a matter of what I want to spend my time on
14:21tbaldridgebitemyapp: core.logic?
14:21bitemyappdon't make vague references to papers about Haskell (which are likely addressing much higher concerns than you likely think they are)
14:21bitemyapptbaldridge: really? there are multiple libraries like that in Haskell.
14:21bitemyapptbaldridge: http://lambda-the-ultimate.org/node/112
14:21insamniac<gets popcorn>
14:21bitemyapptbaldridge: you need to try harder than that.
14:21Morgawrfunny enough I'm currently reading this paper http://ecs.victoria.ac.nz/foswiki/pub/Events/PLATEAU/2009Program/plateau09-hanenberg.pdf which seems to be related to this conversation and might interest somebody
14:22bitemyapptbaldridge: Haskell people are huge fans of declarative programming, embedding prolog/logic programming in Haskell is like the first thing they'd want to do.
14:22davdnolen: I think the Maybe pattern is useful. In fact we get some of the ADT benefits in core.match (which I believe you wrote?)..
14:22dnolenbitemyapp: I've yet to see anything that gets to close miniKanren in Haskell, it's hard problem, surprise
14:22bitemyappMorgawr: empirical studies on the practice of programming based on the efforts of undergrads/grad students are not good papers.
14:22davI don't know if there's a way to make it a more intimate part of the language
14:22davanyway I'm late for dinner. got to go..
14:23teslanickIt's my experience that loosely-typed languages are great for JFDI. But that's not always a good thing.
14:23zerowidthwhat is it you want, bitemyapp? validation that haskell is the one true way?
14:23Morgawrbitemyapp: don't shoot the ambassador ;) skim through it, it might be interesting (I just started so idk)
14:23bitemyappMorgawr: I'm going to read it, not shooting at you, just saying that I've read a lot of papers like this and they usually aren't very good.
14:23Morgawr(also I hate having to do this myself because I agree but I *have* to read this shit because to write a paper you need to read papers, duh)
14:23bitemyappempiricism in Comp Sci involving humans isn't great.
14:23gtrakI wonder how many programmers perpetually have 'learn haskell' on their todo lists? Not sure if that's data for or against haskell.
14:24bitemyappMorgawr: yep, I've even read this particular paper. I remember it now.
14:24Morgawrfunny thing, I started with haskell a few years back but I was struggling a bit undertaking a serious project with it (because it was complx) so I moved to Clojure because it looked interesting.. decided to stick with it lol
14:24bitemyappMorgawr: part of the problem is that to even compare the two, you'd have to include the cost of long tail bugs the untyped lang won't catch that the typed language would.
14:25Morgawrbitemyapp: true
14:25bitemyappMorgawr: you can't do that unless you scope it to an actual library/project lifecycle.
14:25tbaldridgewell, I have work to do, but I'll just say this...this talk perfectly captured my views on the typed/untyped thing: http://www.infoq.com/presentations/functional-pros-cons
14:25dnolendav: I'm not anti Haskell, or ML derived - but typed FP evangelism is goofy
14:25bitemyappMorgawr: another thing confounding a comparison is that if you compare a randomized sampling of Java programmers to Clojure programmers, the Clojurians are probably going to win simply because of sampling bias.
14:26gtrakthat guy's really funny-harsh.
14:26bitemyappMorgawr: but if you compared Haskell programmers to Java programmers, the Haskell programmers would win for the same reason. The sampling bias would massively outweigh any differences related to the languages themselves.
14:26bitemyappand would have mostly to do with what languages attract smarter people.
14:26dnolendav: as with most of these discussions, there are nuances and tradeoffs often ignored
14:27MorgawrI'm torn in two between dynamic and static typing to be honest, I think the typed clojure approach is a good way to go.. might be harder to implement but knowing I can have a type system at my disposal if I need to (but nobody enforcing me to use it) sounds great (in theory)
14:27bitemyappdnolen: I mostly am seeking a relatively constrained, not-a-whole-project-or-line-of-research example of code in an untyped language that somebody believes couldn't be done in Haskell.
14:27bitemyappMorgawr: I'm not encouraged by core.typed after talking to Amborse.
14:27bitemyappAmbrose*
14:27dnolenbitemyapp: just take your Haskell evangelism somewhere else man, it's sooooo tiresome
14:27tbaldridgebitemyapp: not even a good talking point. I can write a web browser in x86 assembler...doesn't mean I should
14:28Morgawra thing I like about typed over untyped is that even after months of writing shitty code, I can always go back to it and at least understand what some data is without having to undestand the program
14:28dnolenbitemyapp: none of us are sitting #haskell bugging people
14:28bitemyappdnolen: that's because you wouldn't have a leg to stand on anyway.
14:28bitemyapptbaldridge: the turing completeness nihilism can be applied anywhere in any conversation.
14:28dnolenbitemyapp: lol
14:28bitemyapptbaldridge: the point is productivity.
14:28mrhankyist it possible to use google closure compiler with externs.js and js files as additional lib?
14:28bbloombitemyapp: you've become more polite, but more troll like. seriously, go away
14:28gtrakI'd like some of the benefits of types, like wicked compiler optimizations, but V8 has proven it can be done to javascript.
14:28bitemyappbbloom: well that's not going to work.
14:29bitemyappbbloom: but if you contrive a small example of Clojure that you think can't work in Haskell, that'll keep me busy for awhile.
14:29bbloombitemyapp: you're a major negative influence on this channel, you make it an unpleasant place for many smart folks
14:29dnolenbitemyapp: sadly I'm putting you on ignore now, you've had your chance
14:29zerowidthbitemyapp: still curious what you're trying to accomplish here
14:30bitemyappzerowidth: raising awareness.
14:30Cr8and I'm just sitting here hammering out C
14:30mrhankythey see him trollin
14:30zerowidthconsider my awareness, uh, raised
14:30bitemyappmrhanky: they hatin'
14:30bbloombitemyapp: everybody in here is bloody fucking aware that haskell exists and is interesting. you're not doing anything productive by issuing stupid challenges
14:30bitemyappbbloom: being aware something exists and grokking it are two different stories.
14:31bitemyappbbloom: I'm not trying to "issue a challenge", I legitimately want to compare/contrast.
14:31zerowidthpretty sure no one's really interested in doing that
14:31bitemyappbbloom: I want to know what's missing as a pedagogical exercise.
14:31bitemyappbbloom: but nobody can come up with anything that isn't a huge project.
14:31bbloombitemyapp: i'm sorry we can't all be as smart as you and have seen the light. alternatively, i'm sorry you don't grok the fact that some/many of us DO grok it and genuinely prefer an alternative way of viewing the world
14:31hiredmanbbloom: /ignore
14:31MorgawrI remember reading an article some time ago about some guy trying to write some complex algorithms using "proper" monadic haskell code and even after asking 4 other PhD guys it took them several months to have proper code to implement the algorithm meanwhile everybody else had a fully working algorithm from the get go
14:31bitemyappbbloom: I'm trying to exercise a dialectic, not push a particular point.
14:31mrhankyhow do i prevent this js from getting munged by cljs compiler? $("#repl").jqconsole();
14:31Morgawrhowever this is probably just some satyrical article I read and I don't remember where so idk
14:32Morgawrthought it was funny though
14:32bitemyappMorgawr: you can shanghai yourself with yak-shaving in any language.
14:32bitemyappMorgawr: people do the same thing with macros all the time.
14:32bitemyappCr8: embedded?
14:32bitemyappCr8: or kernel hacker?
14:32Cr8nope
14:33Cr8and nope
14:33bitemyappCr8: okay, what then?
14:33mrhankyanybody? :/
14:33teslanickSome people just like writing C. :)
14:33bitemyappI'm curious.
14:33MorgawrCr8: bored? :P
14:33Cr8bitemyapp: my usual thing, work
14:33bitemyappteslanick: mmmmm function pointer typedefs
14:33mrhankyi'm confused by the $("#repl")
14:33bitemyappCr8: ah god dermert.
14:33shep-werkCr8: how similar do you feel clojure is to C?
14:33bitemyapplol.
14:34OlegYchdepressing to see a guy with decent contributions in lang being labeled as troll at #lang
14:34shep-werk(I also do it for my da job, sometimes)
14:34Cr8it's in C because folks (that aren't me) like C =P
14:34shep-werkObviously, there's a lot of difference
14:34MorgawrC used to be my main language until I switched to Clojure, way to completely change my development process (still love C)
14:34bitemyappOlegYch: do you use one of my libraries or do you mean somebody else?
14:34bbloomOlegYch: it's not enough to be smart, you need to be likable, otherwise nobody will listen to you. he's not even trying
14:34bitemyappMorgawr: that's a pretty big leap.
14:35shep-werkbut there's something so similar about clojure functions that take the "object" as the first param
14:35Cr8adding some small features to the disky b-tree file format lib
14:36nDuffOlegYch: ...a guy with decent contributions, and a long history of being at least moderately abrasive.
14:36Cr8shep-werk: very unlike =P
14:37Cr8everyone around me seems to gravitate toward languages with no capacity for abstraction
14:37OlegYchbitemyapp: i haven't been using clojure in a while
14:37danneuI have a compojure app running in production connected to a datomic db. what's the preferred way to make live changes to the code?
14:38danneuWell, "seamless" deploy rather
14:38bitemyappOlegYch: yeah my use of it has tapered but I still maintain some libraries and fix bugs.
14:38bitemyappOlegYch: most of my active use of it currently centers around Datomic.
14:38OlegYchyour libs look useful as well as your conversations in here
14:44bitemyappOlegYch: Some of it is that bloom and nolen have disliked me for a long time and if I do pretty much anything at all that brings my existence to their notice it draws their ire. The other is that a lot of people have a hard time exercising critical distance in the course of teasing out ideas, especially in a dialectic.
14:45bitemyappSome react to things as if noun X of dialectic X and Y is somehow internalized into their ego and identity.
14:45insamniacSomeone was being reactionary anyway..
14:45bitemyappWhich is unhealthy for reasons that have nothing to do with what they think copacetic (read: absent substance) conversation constitutes.
14:47tbaldridgeOlegYch: don't let him fool you, almost every day of the week he's on here talking about how Haskell or ML is better or whatever. It's just in poor taste to go to the forum of language X and talk about how one of its core features makes it worse than language Y.
14:48bitemyappHaskell happens to be a great Brand X for type systems.
14:48bitemyappThat's why so many PLT papers use it.
14:48tbaldridgeFor instance, I would expect people to react this same way if I went to #erlang and wouldn't stop talking about how we needed STM. It's not constructive, it doesn't help, it's a long ago decided design decision....enough said.
14:48bitemyapptbaldridge: I'm sorry types pissed in your wheaties :(
14:49MorgawrI smell a #haskellian conspiracy taking place, we should retaliate and send some covert agents lauding the feats and qualities of clojure in their channel!
14:49bitemyappMorgawr: We could go to #haskell and talk about how superior CLJS is to Fay!
14:49zerowidthtbaldridge: but you're just having a dialectic about, you know, STM
14:49bitemyappzerowidth: the problem is that you think you're being farcical but I think the merits and demerits of STM are worth discussing.
14:50bitemyappzerowidth: they're good to have but can fall apart fast.
14:50bitemyappabara
14:50bbloombitemyapp: i've given you a half dozen changes to not act like a troll. i've been very patent with you and for a while, thought you had turned around your attitude and behavior. we even had some private chats where you thanked me for helping you not piss of smart folks, yet here you are assuming telling folks that i have an ego problem b/c i don't like you. get over yourself
14:50bitemyappdamn, he's not here. Anyway, he knows what I'm talking about.
14:51tbaldridgeagreed, but it wouldn't help anyone to go to #erlang where the idea is "share nothing...ever" and start talking about sharing stuff.
14:51bitemyappbbloom: you troll me as much as anything else and I haven't asked to you to supplicate yourself in public.
14:51tbaldridgeAnd with that I shall quit.
14:52bbloombitemyapp: you've managed to piss off tbaldridge, dnolen, myself, stuartsierra, and how many other respected members of this channel and community? cut it out.
14:52zerowidthmrhanky: did you figure your thing out? that's a jquery call
14:52bitemyappbbloom: IRC is nothing special, I gave a lightning talk on some Haskell at the last SF Clojure meetup.
14:52TimMcwhoop-de-doo
14:52mrhankyi'm still working on it, but it seems i got it now
14:52bitemyappbbloom: the oligarchy is upset. why do I care?
14:52bbloombitemyapp: and hiredman, and TimMc it seems too
14:52zerowidthmrhanky: cool, i haven't tried doing that but i think you just need an externs file for jquery
14:53mrhankyyeah, i found some on googles site. just needed a definition "jQuery.fn"
14:53bitemyappI actually originally dipped into here today to discuss LT getting open sourced.
14:53bitemyappbbloom: it's offensive that you even put that much weight on such things.
14:54bitemyappin other, more positive news, the almighty powers that be decided to finally clean up the edn spec a bit.
14:55bitemyapphttps://github.com/edn-format/edn/commits/master
14:55bitemyappnot quite the EBNF I'd like, but it at least resolves some irregularities that meant any edn parser implemented to spec wouldn't actually work for talking to Datomic.
14:56bitemyappI'm hoping this at least means writing an edn parser that's useful can be done against the spec instead of the Clojure reader.
14:56arrdemHaskell EDN parser? what?
14:57bitemyapparrdem: hum?
14:57bitemyapparrdem: need Python support at work. There isn't a working Python one, we're limping along with one of the ghetto ones.
14:57bitemyapparrdem: I'd *like* a Haskell one but I haven't had the time to verify/check the existing one(s)
14:58arrdembitemyapp: ah. I looked for a python reader a while back and didn't find anything good.
14:58arrdem*either
14:58bitemyapparrdem: trust me, there isn't anything good.
14:58bitemyapparrdem: the closest thing to a decent one would be dreid/edn, and I'm still working on some issues there.
14:58bitemyappmostly involving Python's terrible collections.
15:00ToBeReplacedi've limped with pyclj... at least has the primitives working, but no tag registry iirc
15:01ToBeReplaceddreid/edn looks cool
15:01gfrederickstechnomancy: is there any public discussion or quick pithy opinions on bundler's approach to version ranges? (i.e., the lockfile)
15:02bitemyappgfredericks: it's bad.
15:02bitemyappgfredericks: there are better examples of how to handle version ranges based on a consistent versioning scheme but I'm afraid if I utter the word I'll raise the hackles of the oligarchy.
15:02gfredericksbitemyapp: what are the downsides?
15:02bitemyappgfredericks: it helps a lot if you have a versioning scheme where the relative importance of each digit is consistent across projects.
15:03gfredericksI'm not sure how that's relevant?
15:03ToxicFrogbitemyapp: wha?
15:04jgmizeI'm curious as to how hard it would be to port the clojure EDN reader over to Hy to use from python modules.
15:04bitemyappgfredericks: it's not designed to actually handle sensible version ranges and more often than not, it's more like Golang where you simply lock in a build that works and pray.
15:04bitemyappjgmize: don't think you'd win much.
15:04gfredericksbitemyapp: what's not designed to actually handle sensible version ranges?
15:05gfredericksI'm contrasting this with leiningen's approach, not some uninstantiated ideal
15:05zerowidthgfredericks: opinions about bundler's approach in what way?
15:05bbloomgfredericks: forgive my self promotion, but i've written about my thoughts on semver & version numbers: http://www.brandonbloom.name/blog/2013/06/19/semver/
15:05zerowidththe idea in theory is that gems use semver
15:05zerowidthand the ~> can be handy
15:06zerowidthbbloom: ahh, nice
15:06gfredericksI'm wondering about the idea of having a version range in one file and a locked version in another, generated file
15:06zerowidthahh, if you check in the generated file, you can at least ensure a consistent environment between dev/prod
15:06bbloomgfredericks: the idea of resolving a dynamic identity (ie a version specifier) to a static name (a sha1) is a good idea
15:07bbloomgfredericks: bundler gets that part right, imo
15:07zerowidthseems flexible enough to me, but i don't have any experience with lein's style
15:07bitemyappit'd be less tedious if Ruby were based around build artifacts.
15:08bitemyappthat's partly how Golang gets away with being terrible at this.
15:08TimMcgfredericks: Yeah, I generally approve of the idea that updates can be fetched and suggested automatically, and that the programmer can accept or reject updates.
15:09gfredericksso is there a reason leiningen doesn't have this option, and can it be done with a plugin?
15:09arrdembbloom: nice post.
15:09bbloomarrdem: thx
15:10hiredmanTimMc: working in a team larger than one or two, I don't think I would like that
15:13mrhankyis google closure able to minify the output when using advanced optimization?
15:13tos9/7/
15:14mrhankyminify = remove whitespaces, linebreaks etc
15:15hiredmanadvanced optimization is minified by definition, I believe
15:15teslanickYeah, it also renames values, inlines certain functions, etc.
15:16mrhankyi know, but it still uses line breaks an indentation
15:16hiredmanmrhanky: you must have the pretty-printing output turned on in project.clj
15:17dnolenmrhanky: it does not, lein-cljsbuild pretty prints output by default
15:17stuartsierralein-cljsbuild has :pretty-print true by default for some strange reason.
15:17hiredman:(
15:17dnolenmrhanky: which doesn't make sense for advanced
15:17finishingmovecan someone tell me how to install LightTable on Debian? I'm a linux noob...
15:17jergasondnolen: how does clojurescript handle immutable data structures?
15:18jergasonisn't that kinda wasteful in javascript?
15:18dnolenjergason: JS GCs have come a very, very long way
15:18Morgawrfinishingmove: http://www.lighttable.com/ go here, download the linux64 or linux32 archive (depends if you're on 64 or 32 bit)
15:18Morgawrthen extract it wherever you want
15:18radixfinishingmove: I just downloaded the Linux x64 version and ran the LightTable script inside.
15:18Morgawrand run the binary called "LightTable"
15:18finishingmoveHow would I run it without having to type in the full path everytime though?
15:19jergasonso the answer is "it is fast/efficient enough to copy the entire data structure"?
15:19nDufffinishingmove: putting it somewhere in your PATH.
15:19hiredmanwow, no one copies the whole thing
15:19clojurebotExcuse me?
15:19MorgawrI have this line in my .bashrc: export PATH=/opt/LightTable:$PATH
15:20Morgawrwhere /opt/LightTable is where I have extracted the archive
15:20nDufffinishingmove: personally, for instance, I have a $HOME/local/opt/LightTable-VERSION/, with symlinks from $HOME/local/opt/LightTable to the current -VERSION, and a $HOME/local/bin that symlinks to ../opt/LightTable/LightTable (or something like that).
15:20clojurebotCool story bro.
15:20MorgawrnDuff: does it make sense to have a -VERSION? because LT automatically updates itself
15:20nDuffMorgawr: only to a point.
15:21dnolenjergason: ClojureScript implements some of the most efficient persistent data structures known - they work by sharing structure
15:21jergasonhiredman: was that to me?
15:21nDuffMorgawr: it upgrades across point releases, but not minor releases.
15:21Morgawrwell yeah, with major releases that break backwards compatibility (like this one to 0.6) it doesn't work well
15:21hiredmanyeah
15:21gfredericksdo maven servers typically serve info on all versions available for an artifact?
15:21nDuffMorgawr: thus, I have a separate -VERSION per minor release.
15:21Morgawrmakes sense I guess, I just override everything
15:21Morgawras in, extract over the old one
15:21dnolenjergason: when ClojureScript was released it was copy on write - but those were soon replaced with ports of the Clojure data structures
15:21hiredmanimmutable datastructures are almost always implemented as trees using path copying
15:21jergasonoh for some reason I assumed that stuff would have a different implementation in cljs
15:21jergasonneato
15:22xeqigfredericks: the maven-metadata.xml contains that info
15:22gfredericksxeqi: cool, thanks
15:22nDuffgfredericks: Yes.
15:22teslanickdnolen: Where do those ports live? I'd like to look at them
15:22nDuffgfredericks: it's typical to cull old snapshots, but not old releases.
15:22dnolenjergason: we also have transients, last time I checked on Google V8 you can thaw an immutable vector and add 10,000,000 elements as fast you can push onto a mutable array.
15:23dnolenteslanick: look at the ClojureScript standard library
15:23dnolencljs/core.cljs
15:24jballancwow...I get up to go have dinner and LightTable gets released open source
15:24teslanickdnolen: Awesome, thanks
15:24Morgawrjballanc: should have more dinners throughout the day man
15:24jballancright?
15:25Morgawrthey must be magical
15:25jballancat least now the couple hours I spent customizing my key bindings in LT over the weekend seem like less of a waste
15:25gfredericksnDuff: I'm noodling the idea of a lein plugin for lockfiles
15:25hiredman:(
15:25gfredericksI'm not too familiar with maven's support for version ranges though
15:26hiredmangfredericks: it is really bad
15:26hiredmandon't use version ranges
15:26gfrederickshiredman: because version ranges are bad or maven is bad?
15:26hiredmanhttp://nelsonmorris.net/2012/07/31/do-not-use-version-ranges-in-project-clj.html
15:27xeqigfredericks: the combination of the maven default of what "1.0.0" and how version ranges interact is bad
15:28gfrederickshiredman: the repeatability issue is solved by the lockfile, presumably
15:28hiredmangfredericks: pick versions, and if consumers of libraries want something different lein provides ways to do that
15:28gfredericksand my guess is a plugin could apply its own range logic if necessary...
15:28llasramgfredericks: Oh, lockfile -> like Gemfile.lock ?
15:28gfredericksexactly
15:29xeqigfredericks: what advantages are yo uhoping to get out a lock file not provided currently?
15:29nDuffgfredericks: heh. I'm trying to sell the rest of the Ivy team on support repository-wide read locks right now.
15:29gfredericksxeqi: not having to overspecify what you want
15:30hiredmangfredericks: what is the use case?
15:31gfrederickshiredman: semantic specifications; I put "0.6.3" in my project.clj not because I'm attached to that version in particular but because lein requires an exact version
15:32gfredericksbut it's not clear that I'd be happy with 0.6.4 as well if it existed
15:32gfredericksi.e., my intent isn't obvious
15:32gfredericksand lein therefore can't do anything based on my intent
15:32llasramgfredericks: But if 0.6.4 doesn't exist yet, you don't know if your project will work with it or not
15:32gfredericksI'm not suggesting it upgrade without telling me
15:33gfredericksand it's true that I don't know if my project would work; that's why I would test with it after upgrading
15:33llasramgfredericks: Sure, but unless you actually have a cross-version matrix of tests, you don't actually know any given collection of versions from a set of ranges are actually compatible
15:33xeqigfredericks: are you familiar with maven's dependency resolution and what soft dependencies are?
15:33gfredericksxeqi: no
15:33llasramgfredericks: Ok -- but how is that different from today?
15:34hiredmangfredericks: it is better to explicitly say "I used this version and it works here" and let consumers override it, than to leave it open ended, and force consumers to figure out the end of an open range
15:34gfrederickshiredman: so that's a libs vs apps issue; this would be intended for apps, not libs
15:35hiredmanthen what is the point?
15:35gfredericks...people use lein with apps too?
15:35hiredmanleave it closed, write a plugin that just says "oh, there is a newer version of this dep in maven, maybe check it out?"
15:35gfredericksand people who write apps also have dependencies?
15:36hiredmanno reason to fiddle with depency logic, or have some kind of lockfile
15:36gfredericksokay
15:36gfredericksthanks
15:36hiredmanif you are writing an app that uses some library, and you want to override one the libraries dependencies, you can do that via :exclusions
15:37xeqiI hear lein-ancient handles the finding latest version part
15:37hiredman^-
15:38xeqihaving never used it
15:38hiredmanme neither, we have a guy on the team who will obsessively upgrade things
15:41bbloomhiredman: ugh. reminds me why i hate the "everybody just commits to master" model that so much of the world relies on
15:42bbloomi saw that thing about facebook's giant single mercurial instance and almost threw up in my mouth
15:42hiredmanspeaking of, the clojure with hand tools talk is up
15:42bbloomnice
15:42mrhankygnaaa
15:43rkneufeldhiredman: I actually started hand tool woodworking over the break. It's intense!
15:43hiredmanbbloom: I dunno I can definitely see some advantages to a single repo
15:43bbloomhiredman: there are definite advantages, but i'd argue that most of them are too to poor tooling, not inherent
15:43paulswilliamsesqsafa
15:43bbloomhiredman: we didn't have a good model for small repos until distributed version control, now we don't have a great model for coordinating many small repos
15:44hiredmanbbloom: sure
15:44bblooms/too/due
15:44hyPiRionwho are "we"?
15:44bbloomhyPiRion: the software engineering community :-P
15:44hiredmanand it doesn't help that so many people are running right out of git instead of building released artifacts
15:44hyPiRionhm
15:45hiredmanmanaging change :(
15:46hiredmanwhich, well upgrading depedencies is just another change to manage
15:46lsdafjklsddnolen: so the problem was that I was not passing the entire root app cursor to the ul build component, but a subset e.g. (:projects app), is that weird?
15:47dnolenlsdafjklsd: it's not weird, (:projects app) will just make a new cursor
15:48lsdafjklsddnolen: I pass the id to the ul component via opts, and with (:projects app) it won't update, even though it's changing
15:48dnolenlsdafjklsd: but what is id?
15:49dnolenlsdafjklsd: once you hit primitives you need to be careful
15:49lsdafjklsddnolen: sorry, the new selected item's id that changed. it's a property on the root cursor :selected-id and I pass that to the component through it's opts option
15:49dnolenlsdafjklsd: you only get a free ride on associative data structures
15:50dnolenlsdafjklsd: is id a string? a keyword?
15:50lsdafjklsddnolen: a number
15:50dnolenlsdafjklsd: if so you need to make sure that it can be converted into a cursor
15:50lsdafjklsddnolen: well the key is a keyword, the value is a number
15:52dnolenlsdafjklsd: can you make a gist?
15:52lsdafjklsddnolen: yea, super minimal
15:54lsdafjklsddnolen: https://gist.github.com/lsdafjklsd/8324062
15:56lsdafjklsddnolen: this is the version that won't work, https://gist.github.com/lsdafjklsd/8324478
15:57lsdafjklsddnolen: it gets the projects passed to it, instead of having to get them itself
16:07dnolenlsdafjklsd: so the problem here is something that you just have to get used to in Om
16:08dnolenlsdafjklsd: you're passing the project-list to the next component and it's never changing
16:08dnolenlsdafjklsd: so Om isn't going to re-render it
16:08dnolenlsdafjklsd: that is the argument to project-list never changes
16:08lsdafjklsddnolen: right ok
16:09lsdafjklsddnolen: it's not going to re-render when a specific option changes
16:09lsdafjklsddnolen: the main thing has to change
16:09dnolenlsdafjklsd: no
16:09dnolenlsdafjklsd: the arguments have to change or the state has to change
16:09dnolenlsdafjklsd: neither are changing for project-list
16:10dnolenlsdafjklsd: to illustrate what I mean, put :aid into a span in the root above project-list
16:10dnolenlsdafjklsd: you'll see it changes, but the list won't change
16:10dnolenbecause the list is never getting any new data
16:11lsdafjklsddnolen: ya, and this is why in my original example the correct project would display in the detail view, but the active class would not show up in the list
16:13lsdafjklsddnolen: thanks for taking the time to help me with this
16:14dnolenlsdafjklsd: the correct thing to do here would have been to set the state in project-list, not the app
16:14dnolenlsdafjklsd: let me fix it so you can see.
16:15dnolenlsdafjklsd: actually it just depends on whether you want to put that information in the app state or not
16:15dnolenlsdafjklsd: vs. component local state
16:15lsdafjklsddnolen: i'd rather have it in the local state of the ul
16:15mrhankywhere does lein cljsbuild place the goog/base.js?
16:16dnolenlsdafjklsd: ok changing it so you can see how to do this
16:16mrhankyi've setup a build-config to output the whole thing in several files, but it's missing goog.base now
16:16lsdafjklsdmrhanky: did you set an :output-dir?
16:16mrhankyyes
16:17lsdafjklsdmrhanky: try a lein cljsbuild clean
16:17lsdafjklsdmrhanky: and then build again
16:18mrhankystill no goog for me :(
16:18lsdafjklsdmrhanky: what's your optimization?
16:18mrhankywhitespace
16:19lsdafjklsdmrhanky: but there is a goog folder right?
16:19sshackSo does anyone have any advice for when dealing with two different libraries which fail in different ways when using different versions of clojure.java.jdbc? korma fails with 0.3 migrates fails with 0.3-beta1
16:19lsdafjklsdmrhanky: in your output-dir
16:19seangrovednolen: set/get-state is for component-local state?
16:20dnolenseangrove: yes
16:20seangrovePerfect, handles a case I was struggling with
16:20mrhankyno lsdafjklsd, no goog dir
16:21steeriosshack: try downgrading/upgrading one of the libs
16:22sshackpoint. I've filed a bug with migratus already.
16:22mrhankyah
16:22lsdafjklsdmrhanky: change omptimizations
16:22mrhankyyes
16:22mrhankynone did the trick :S
16:22lsdafjklsdmrhanky: to :none
16:22lsdafjklsdmrhanky: instead of :whitespace
16:23lsdafjklsdmrhanky: then do a lein cljsbuild clean
16:27dnolenlsdafjklsd: fixed, https://gist.github.com/swannodette/8324933
16:27dnolenlsdafjklsd: you cond-> expression also had a bug, the second clause always succeeded
16:27lsdafjklsddnolen: ok, and that was horrible anyway and needed refactoring :p
16:28lsdafjklsddnolen: just didn't immediately know the best way, thanks
16:33lsdafjklsddnolen: man, awesome
16:34lsdafjklsddnolen: not sure why I couldn't think of this after like, 3 days
16:35dnolenlsdafjklsd: I've struggled longer than that :)
16:35dnolenlsdafjklsd: it's a simple model but pretty much completely different from what I'm or I guess anyone else is used to
16:35lsdafjklsddnolen: that's encouraging, I watched you fly through the the sortable example
16:35dnolenlsdafjklsd: that one was particularly hard actually
16:36dnolenlsdafjklsd: missing features in Om and stuff, hopefully the example will save someone else some trouble
16:36lsdafjklsddnolen: yea that thing is dense, trying to focus on building more instead of reading
16:36lsdafjklsddnolen: this is the most fun i've had in a long time, reallly re-energized me
16:36dnolenlsdafjklsd: it's one of the hardest things you could build and I think not the type of thing most people need to do
16:37dnolenlsdafjklsd: and honestly it's a bit hacky, but the high level concepts there are more or less solid
16:38dnolenlsdafjklsd: passing view constructors around and channel communication, and handling lots of changing state
16:38bbloomdnolen: do you find that working with om, is more similar to working with the cljs compiler than with traditional UI approaches? :-)
16:38dnolenbbloom: writing the UIs? not really, working on Om itself kinda
16:39dnolenbbloom: the UIs feel remarkable like everything I like about OO except you can always see state transitions
16:39dnolenbbloom: no banging on fields
16:39bbloomyup
16:40ClomeCan someone explain why tail recursion is a problem on the JVM. Can`t the reader analize the definition of a function and if it detects that it has all the propreties of tail recursive fn, it transformas it into an iteration?
16:41bbloomClome: that would only work lexically
16:41technomancyClome: tail recursion is not impossible, but full TCO is
16:41justin_smithjava interop question: I want to get the headers for an imageio inputstream that may contain a format that java cannot read
16:41Clomewhats the difference, and why do we need to use recur?
16:41bbloomClome: clojure *could in theory* do that within a function for tail recursion, but not tail *calls* to other functions.
16:42bbloomClome: clojure needs to know where tail positions are anyway, in order to give you an error if you don't write recur in the right place
16:42justin_smithcurrently my predicate "can-read?" catches format exceptions and returns false, but I would prefer to just check for the known formats and only read the header
16:42justin_smithbecause otherwise I am loading an image and throwing away the object (in cases where the format is fine)
16:42bbloomClome: in theory, clojure could make all those things in to tail recursive calls, but doesn't b/c it takes the stance that explicit is better than implicit for whether or not your calls consume stack space
16:43jcromartieI keep running into this and then feeling afraid to ask: how can I check if a given value implements a protocol?
16:43bbloom(doc satisfies?)
16:43clojurebot"([protocol x]); Returns true if x satisfies the protocol"
16:44tbaldridgeClome: bbloom: but if it did, it would be super easy to shoot yourself in the foot. Consider a function with 2 arities, bouncing from one arity to the other would consume stack.
16:44jcromartiea ha
16:44bbloomtbaldridge: in theory, since multiple arities are statically defined together, you could do inlining too & that would work
16:45bbloomtbaldridge: but it's just not worth it :-)
16:45tbaldridgeyeah
16:45bbloomi view tail calls as an effect anyway ;-)
16:46tbaldridgeAlthough it's interesting to note that Erjang does all that and more. I wouldn't want to maintain that compiler, but sthat sort of stuff is possible.
16:46bbloomtbaldridge: well erlang's compilation unit is a module
16:46alewAh ok, should write up a short bit about hooks in the docs
16:47bbloomtbaldridge: it doesn't need things like vars for live programming b/c it isolates state from code entirely & uses message sends to achieve the added level of indirection for live redefinitions
16:47tbaldridgeyeah, it is a different problem. But from the point of view of the way core.async does things it was interesting to see how Erjang differs.
16:48bbloomtbaldridge: yeah, one major downside to channels is that they don't have names....
16:48seangrovednolen: Is there a way to clone a cursor in a render function to get its actual value, so I can refer to it in an onChange callback?
16:48tpopetechnomancy: let me know when you have some time to talk about nrepl-discover (lord knows I took my sweet time getting around to it)
16:48tbaldridgebbloom: sure they do, they're called pointers :-P
16:49seangrovednolen: Or should I restrict myself to om/read
16:49bbloomtbaldridge: true story :-)
16:49dnolenseangrove: there's the om/bind conveneince
16:49bbloomtbaldridge: let me rephrase: their unique names are not "source stable"
16:49dnolenseangrove: but you need to make sure to double check your assumptions in the handler
16:49tbaldridgebbloom: true. although someone could build that via weakrefs (or not) and a hashmap.
16:50dnolenseangrove: i.e. that data could very well be gone when the handler fires
16:50seangrovednolen: I suppose I should just do a om/read in the handler then
16:51dnolenseangrove: same difference really, that's what om/bind does
16:51mrhankyguys, is it possible that cljs.reader/read-string is not working as it should?
16:51dnolenmrhanky: definitely possible
16:51mrhankyoh great
16:51dnolenmrhanky: if you have a minimal case that should work that does not report in JIRA
16:52mrhankyi dont understand?
16:54mrhankyneed it for escape characters
16:54Clomebloom: why would you prefer explictily write recur, and why inlining it is noth worth it
16:55mrhankyare there any working libraries which can display thinks like \newline or \u0040 correctly?
16:56bbloomClome: inlining would add considerable complexity to the compiler & basically would only serve the purpose of local tail call recursion for multi-arity functions or letfn forms, not even generalized tail calls. it's just not worth the cost benefit
16:56technomancyClome: if your algorithm depends on not consuming stack, you want the compiler to enforce it. if you didn't use recur, it would be easy to accidentally move the recursion to a non-tail position without realizing it
16:56bbloomClome: i prefer to explicitly write recur b/c it's sometimes hard to eyeball if something is in tail position & i like to explicitly demand it
16:57technomancytpope: sure, what's up?
16:57tpopetechnomancy: I've gotten vim talking to it as a proof of concept. a lot of feedback and not sure where to start
16:58tpopetechnomancy: I was thinking I might just go to town on samples.clj and let you have a look
16:58technomancytpope: you mean writing your own ops?
16:59tpopetechnomancy: well for starters, tweaking yours
16:59Clomeoh, now I see the benefit of writing explicitly recur
16:59Clomethanks
16:59tpopetechnomancy: there are some things I don't understand. like some of your ops take a filename but don't use it
17:00dnolenmrhanky: if you have some string that you think you should be able to read that you can't open a ticket with the failing string
17:00tpopetechnomancy: I can't get your jump-to to work. it seems to try to read a classpath relative filename and fails
17:01technomancytpope: so the file arg is used in order to send a "clear overlays" command to the editor before running th etests
17:01technomancyman; I haven't worked on this since the conj; bit fuzzy on the details
17:02tpopetechnomancy: oh uh it's the "jpeg" op (and a couple of others I think) that ignore the file op
17:02tpopetechnomancy: probably just an oversight, which is fine. I can fix
17:03tpopetechnomancy: re: the overlay stuff, seems like you'd just want to use :file from the metadata, no?
17:03tpopetechnomancy: sorry, I'm all over the map here. like I said I'm not sure where to start
17:04technomancytpope: sorry, got a meeting; bbiab
17:04tpopetechnomancy: sure I'll be around
17:07logic_proghttp://lpaste.net/98203 <-- what am I doing wrong in this macro ?
17:07ClomeI still can`t understand why you can`t transform every recursive code without consuming stack. I mean, in mathematics you can do it, recursion is just another type of iteration. Are there no efficient algorithms that can transform recursive code into iterative or is the issue bigger then I am making it to be, and I should shut up:D
17:08bitemyapplogic_prog: why does that need to be a macro?
17:08logic_progbitemyapp: becuse capturing variable names
17:08bitemyappClome: it's a logistical problem related to the JVM
17:08logic_prog[:rect x y] <-- this binds x, y
17:08bitemyappClome: you can do TCO on the JVM, but it makes certain use-cases slower because of the JVM's limitations and makes it harder to make interop play nice.
17:09bbloomClome: http://stackoverflow.com/questions/3616483/why-does-the-jvm-still-not-support-tail-call-optimization
17:09meltingw1xcan anyone help me with this exception (trying to set up dbs in luminus) http://pastebin.com/mF42jins
17:09bitemyappClome: it would be more likely to happen if it was a native JVM faculty that played nice with Java.
17:10bitemyappClome: otherwise, you have to be okay with having code in your language be potentially difficult to call into without invoking runtime overhead.
17:10bitemyappbut if you're okay with slapping a $BRAND_X.lang.RT wrapper around everything, then yeah, you can totes do TCO.
17:11bitemyappClome: http://stackoverflow.com/questions/10008673/does-frege-perform-tail-call-optimization
17:12bitemyappClome: Frege is implemented on the JVM.
17:14Clomethanks for the links
17:16winkI am torn if I should be amused or bewildered by the fact that I know about Frege and also about TCO on the JVM
17:17winkbitemyapp: your randomness of interesting facts will not prevail!
17:19bitemyappwink: yes but now I must be crucified for using a typed language to teach something.
17:19bitemyappwink: get out the dogwood cross, nails, and hammer.
17:19technomancyClome: there are schemes that do TCO, but it means a function call is more than just a method call
17:20justin_smithmeltingw1x: your ns form is messed up
17:20bitemyappnDuff: martyrdom either way.
17:20justin_smithswitch use for :use and take the ' forms out
17:20bitemyappwink: Frege is an uncommonly good way to learn about how to implement functional languages on the JVM.
17:20justin_smithalso you want only one :use clause
17:20bitemyappwink: the various Schemes that technomancy alluded to are good for that as well.
17:20nDuff...publicly assume the worst and you make it tempting to fulfill that expectation. :)
17:21winkbitemyapp: that ups it a little on my "sorted languages by interest" list :P
17:21bitemyappnDuff: <3
17:21justin_smithmeltingw1x: you should put both namespaces you are using in a vector and specify :use as a keyword, like you did with :require
17:22technomancytpope: so yeah... I'm less interested in the actual implementations of the sample ops and more interested in how easy they are to interface with othe editors
17:22justin_smithmeltingw1x: and finally, :use is bad and you should :require :as or at most :require :refer (but this is a preference / design thing, not an error)
17:23justin_smithmeltingw1x: the bad ns form causes the totally useless error message you got
17:23justin_smithworse than useless, actually an incorrect error string
17:24tpopetechnomancy: oh for sure
17:25tpopetechnomancy: the "file" parameter in particular raises the question for me of if I'm supposed to prompt for it or just grab it from the current buffer or what
17:26technomancytpope: yeah... I'm starting to wonder if those shouldn't be two distinct argument types
17:26technomancycurrent-file vs prompt-file or something
17:26tpopetechnomancy: and thinking it through, I'm wondering if it's really necessary at all. I mean what happens if I send mismatched file/ns parameters
17:27tpopefeels like file/ns should be either/or
17:27technomancyyeah, ns is more high-fidelity in a way
17:28technomancybut if you had an op that took csv data or something, you'd still need to prompt for a file
17:28technomancybut maybe that means there's no need for a current-file arg
17:29tpopeyeah that sounds right
17:30tpopeif I get back a class path relative file (i.e., from the :file metadata), I can match it up to an actual buffer
17:31technomancyannoyingly enough namespaces don't have file metadata
17:31technomancyso you have to just grab their first var
17:32tpopein the case of the test runner, couldn't you just grab it on a per test basis?
17:32tpopeI guess that leaves the question of what to clear open
17:32technomancyyeah you should be able to grab the filename from the test var; not sure why I didn't do that
17:33tpopeI'm also thinking of namespaces split across multiple files. although hopefully nobody does that for test namespaces
17:33steeriois that a thing?
17:33technomancyI am 100% ok not supporting that
17:33tpopesteerio: clojure.core itself does, among others
17:34tpopeseems especially silly for a test
17:35hiredmanalso the opposite, a file with multiple namespaces
17:36hiredmanor vars not defined via def in a file
17:36tpopeare you just trying to troll technomancy
17:36hiredmanno
17:37tpopehey I hear SOME PEOPLE use top level forms that aren't a def!
17:37hiredmanI would link to an example but github has decided to 404
17:38tbaldridgetpope: doesn't every single defn do that?
17:38tpopeI mean def in general not the special form in particular
17:38tbaldridge, (macroexpand '(defn foo "hey" [] 42)
17:38clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
17:38meltingw1xjustin_smith: whats wrong with my ns now? still getting the same error: http://pastebin.com/QF4KyK6j
17:38tbaldridge, (macroexpand '(defn foo "hey" [] 42))
17:38clojurebot(def foo (clojure.core/fn ([] 42)))
17:38hiredmanI was just the other day looking at hiphip (array library) to replace the gross way they parameterize the code in namespaces on primitive types
17:38tbaldridgenah, it's something else, something does def in a do.
17:39Bronsatbaldridge: defrecord, deftype, defmacro
17:39justin_smithmeltingw1x: odd, that looks fine
17:39tbaldridgehiredman: there has to be a better way than the way they do that.
17:39hiredmanand my solution ended up with a macro that would generate each parameterized namespace from a single file
17:39hiredmantbaldridge: yes
17:39hiredmanit is so gross
17:40meltingw1xjustin_smith: even when the file is just the (ns ...), i still get the same error
17:40justin_smithand the directory tree there is in the runtime classpath?
17:40tpopetechnomancy: you saw my belated reply on the mailing list right? with the overlay and position commentary?
17:41justin_smithmeltingw1x: lein classpath helps verify that if you are using lein
17:41hiredmanjustin_smith: he has an extra directory
17:41justin_smithahh yeah he does
17:42technomancytpope: which list?
17:42justin_smithmeltingw1x: either move the contents of zonu up one level, or add src/zonu to the resource-paths in project.clj
17:42justin_smith*source-paths, sorry
17:43tpopetechnomancy: clojure-tools. the content negotiation thread
17:43hiredmanand why is he aot compiling anything anyway
17:43hiredmanetc etc
17:43technomancytpope: doesn't look like it went through
17:43tpopetechnomancy: oh, shit, no wonder you didn't reply
17:44tpopetechnomancy: sec, I'll resend
17:46hiredmanhey, it is working
17:47hiredmanhttps://github.com/hiredman/hiphip/blob/foo/src/hiphip/impl.clj is an example of a single file generating multiple namespaces
17:51tpopetechnomancy: okay, I *think* I posted it. (google groups, man.) my first point was that line/column is much easier for me to deal with than character offset
17:53meltingw1xjustin_smith: the namespace needed to be zonu.models.db, not just models.db
17:56justin_smithyeah, that's another way to do it
17:59mrhankyis it right, that closure compiler can use, lets say "lib/foo.js" als library - and will it get compiled into the files?
18:09technomancytpope: it's not getting delivered or showing up in the web ui, but the "N replies" count on the web UI is going up
18:09technomancyso I assume it's from google groups just sucking horribly
18:11tpopetechnomancy: I did another email attempt (with a different return address that I think was also wrong) and one via the web
18:12tpopetechnomancy: the latter mentioned something about approval
18:12technomancyI wish librelist were actually getting active attention so I could bug people to flee google for good
18:13tpopetechnomancy: ANYWHO other than the line/col thing, my other point was that a fail/error/pass semantic might be better than red/orange/green
18:13bitemyapptechnomancy: what about Mailan?
18:13bitemyapper, Mailman*
18:15tpopetechnomancy: and that in vim, you can do the line highlight thing, but a more conventional mechanism would be to load all the results up into the "quickfix" list: filename/line/col/type/etc data that vim provides mechanics for navigating
18:15technomancytpope: hm... the thing about the fail/error/pass semantic value is that it requires a lot more coordination. who defines the full list of valid values? what if someone comes up with something new?
18:16tpopetechnomancy: point taken, though that's true to a lesser extent about colors too (console vim doesn't know what orange is)
18:17technomancyhex colors should be pretty unambiguous though
18:17tpopeunambiguous but even harder to deal with in console vim
18:17tpopecould we send both? semantic and suggested color
18:18technomancyfor tests, sure. but that's not a general-purpose mechanism anymore; it's become something specific to tests.
18:18tpopeso maybe a separate test discussion is in order
18:19tpopebut putting that aside, what other use cases did you have in mind?
18:19tpopemaybe lein-kibit or something?
18:20technomancywell, on the totally-out-there axis I could see this becoming a sort of UI toolkit where people could write general-purpose software in an nrepl server and have clients provide UIs
18:21technomancyso you could have a mail client written in clojure that could easily have a vim, emacs, and eclipse UI
18:21technomancybut more practically, yeah dev tools like linters and core.typed could make use of it
18:22technomancyactually I would like to replace most of cider's commands with server-side eqivalents instead of having stuff hard-coded in elispu
18:22tpopelinters seem similar to test runners in that there's also a semantic, and even an error message/other annotation worth capturing
18:23tpopeyeah I like that idea for sure
18:23technomancyyeah, if you restrict it to dev tooling you could probably come up with a limited set of semantic tags
18:23technomancyI have a feeling it could be bigger than that, but I'm aware it's at least mildly quixotic
18:25tpopeyeah, I'm favoring separating the concerns then
18:25tpopeI'd rather test/linter/tooling stuff go in the quickfix, but I could still see providing overlay support for other operations
18:26tpopein particular, regardless of vim specifics, providing some sort of way to convey a collection of locations/annotations decoupled from ui representation seems useful
18:27tpopefor that matter, the same mechanic could pontentially be used for stack traces
18:29technomancyoh, neat idea
18:29technomancyyou could send a stack trace as a list of lines where each line could have its own tag
18:30technomancyso the editor gets the full-fidelity trace but only shows a subset till the rest are requested
18:30tpopehot
18:31TimMcWhere do I send my Bitcoins? :-P
18:31technomancyso yeah, given that the fail/error semantics are more broadly applicable than just tests I'm fine canonizing those in the spec
18:33tpopethere's also warning, maybe
18:34technomancyyeah, sure
18:36Clomecan I give ^:dynamic proprety to a function at run time?
18:37bitemyappClome: try it!
18:38Clomehow?
18:38clojurebotwith style and grace
18:39jarofghostsdoes anyone have recommendations for good beginner resources?
18:40mysamdogjarofghosts, Clojure Programming by Chas Emerick, Brian Carper, and Christophe Grand is a great book.
18:41jarofghosts!m mysamdog
18:41jarofghostserr
18:41jarofghostsi mean thanks
18:41jarofghosts!
18:41jarofghostswill check it out
18:43mysamdogAnd while not exactly a beginner resource, this channel is very helpful.
18:44Cr8Clome: you can def over it, but any fns that were compiled when it wasn't dyamic won't pick up the dynamicness
18:44Cr8https://www.refheap.com/22635
18:44jarofghostsnice, i want to build a good foundation and try things out before i bother anyone in here though
18:44justin_smithCr8: wouldn't alter-meta! work for that?
18:45jarofghostsbut i did take the shortcut of procuring a good resource!
18:45ClomeI am tringto use build in map with dotrace, but it needs to be dynamic.
18:45Cr8justin_smith: you can alter-meta! as well but it wouldn't change the behavior
18:45justin_smithoh, for some reason I thought the behavior was set by the metadata, but the metadata is just there as a convenience?
18:46Cr8justin_smith: the behavior *is* set by the metadata
18:46Cr8but
18:46Cr8if the :dynamic flag isn't true when a fn that refs the var is compiled
18:46Cr8that fn will only see the root binding
18:47justin_smithahh, ok
18:48Cr8that is, you can alter-var-root the foo var
18:48Cr8and the old getfoo will pick up the new root
18:48Cr8but it won't pick up any binding
18:48Cr8because it wasn't compiled to be binding-aware
18:51Cr8or: the :dynamic more affects compilation, and (binding) just yells at you when trying to bind over a var that isn't dynamic because it knows it won't do anything =P
18:51tpopetechnomancy: is there a reason you're sending back structured data as lists (file line color) rather than some sort of map? {:file file :line line :color color}
18:52tpopetechnomancy: i.e. a technical constraint of some sort
18:58technomancytpope: for a few things I was sending just a 2-tuple of file/position and a list seemed fine for that
18:58technomancybut once there's more than two elements a map is probably better
18:58tpopeyeah that's my thought too
18:58tpopeI'm gonna find some time to play and see what I can come up with
19:00technomancygreat
19:00VFeUsing a regex with re-find, http://regexr.com?37u3a Shows it as valid, but when I use re-find the output ends at fourth line, right after Mscorcfg. Anyone have any ideas why that's the case?
19:35LusciousPearHmmm... hello? Anyone I know in here? :p
19:38technomancyLusciousPear: what are the haps
19:38LusciousPear@technomancy Whatup! Haven't heard from you in forever.
19:38bitemyappLusciousPear: are you a PNW'er?
19:39LusciousPear@bitemyapp I was a Seattleite for 6 years, but moved to SF for 'startup stuff' last year
19:41bitemyappLusciousPear: I'm thinking of going in the opposite direction. I've been in SF for 3 years.
19:41bitemyappNYC for 2.5 years prior.
19:41LusciousPear@bitemyapp flee while you can. I miss the PNW
19:41bitemyappLusciousPear: yeah, that's what people who've migrated in both directions told me.
19:42bitemyappLusciousPear: I work at a startup but I've got the green light to go remote.
19:42sritchiebitemyapp: move to Boulder!
19:42LusciousPear@bitemyapp my first startup was a distributed DB company, and I wanted everyone to be under one roof in SF. but now I'm doing a mobile app, so I don't really care where anyone lives :p
19:42bitemyappsritchie: I like trees, water, and moisture. And the politics there are a bit incompatible to me.
19:43teslanickIs the west everything I've heard it could be? I live in the frozen northeast, and I'm a bitter yankee.
19:43bitemyappsritchie: part of the reason I am leaving the Yay is to "vote with my feet".
19:43sritchiegotcha
19:43bitemyappteslanick: I'm originally from Ohio and then NYC, I like the west coast. But it all depends on you and your personality.
19:43technomancymoisture is kind of important
19:43bitemyappit really is. I have trouble breathing as it is.
19:44teslanickWell, in the winter I do too, from the cold you see.
19:44LusciousPear@teslanick I've lived both coasts. the west has great food, perfect weather, and is laid back and nerdy. the east coast is more 'get shit done omg'. your mileage my vary.
19:45bitemyappthat was my experience as well, but the midwest offers something else entirely.
19:45bitemyappthe midwest is very chill and more sincere than the west coast.
19:45LusciousPear@bitemyapp I can believe that.
19:45bitemyappLusciousPear: it's insanely easy to make really good friends in Ohio, even in the cities.
19:45bitemyappMichigan too.
19:46bitemyapppeople in cities like Detroit are 1,000x nicer than NYC.
19:46arrdembitemyapp: 12.974
19:46LusciousPear@bitemyapp What is a 'friend'. Is that someone who introduces you to a VC? I don't understand ;p #sf
19:46bitemyapparrdem: do you have that on a macro?
19:46arrdembitemyapp: my hatred for humanity is at an all time high.
19:46bitemyapparrdem: one more game.
19:46bitemyapparrdem: ONE MORE
19:46teslanickI was going to ask a JS-y question. I'm reimplementing Bagwell's array-mapped hash trie, and I'm trying to decide if it's worth optimizing it for fast access in the ASCII range of characters for keys, or if that's terribly eurocentric of me.
19:46bitemyappLusciousPear: lack of friends is a big part of why I'm leaving the Yay. I had more friends in NYC by a huge margin.
19:46teslanickInsert "in javascript" at some point in that previous statement.
19:47bitemyappteslanick: I'd call it inadvisable rather than merely eurocentric.
19:47bitemyappI don't like speculative optimization.
19:47LusciousPear@bitemyapp I seem to have a lot more friends in NYC than SF, but I'm not sure if that's just because I'm always heads down here.
19:47bitemyappteslanick: https://github.com/jml/perfidy seen this?
19:47bitemyappLusciousPear: I worked equally as much in both places and I had more friends in NYC, if that counts for anything.
19:47arrdemLusciousPear: I think it's that everyone is heads down in the Bay but that's just my perception.
19:48bitemyappI don't it's that at all.
19:48bitemyappEven the people that have a leisurely work week are pretty isolated.
19:48bitemyapprelationships in the Bay Area scoped to some kind of static context and acquaintances rarely break out of that sandbox.
19:48teslanickThe reason I'm thinking about it is that I can count on zero hands the number of times I've seen non-ASCII-range keys for objects.
19:49bitemyappteslanick: I think it's weord that you even assume stringly keys.
19:49bitemyappteslanick: I key based on hashable objects rather than strings all the time.
19:49bitemyappthat's partly why Python makes me so fucking mad.
19:49teslanickIt's javascript. Hashable objects are a nonstarter.
19:50bitemyappwell, a lot of things are a nonstarter when you live in a ghetto environment like that.
19:50LusciousPearSo Clojure-wise,I'm new to the lang. I'm building typical api-driven mobile app. Is there a list of 'preferred libraries' everyone uses? So far I'm using Compojure and Clauth. I'm at that learning stage where if I can see all the pieces everyone uses, I can start to get a picture of the ecosystem in my head.
19:50bitemyappLusciousPear: the easiest way to become comfortable, is to simply grok Ring and the way functional middleware works.
19:50LusciousPearI've only done distributed db stuff for the past five years, so I literally have no idea what the 'state of the art' is.
19:50bitemyappLusciousPear: once that's in your head, then you can derive how everything else.
19:50LusciousPear@bitemyapp Yeah, I really like ring so far.
19:50bitemyappelse works.
19:51bitemyappLusciousPear: well, the main alternative to the Ring way of doing things is Pedestal, but I don't think that's necessarily a good fit for an API serving a mobile app.
19:52LusciousPearConsidering the eldritch horror that was APIapp dev in my Java and .NET days, this is like a revelation from the heavens
19:52bitemyappLusciousPear: it bears a strong resemblance to Flask in Python and WAI in Haskell.
19:52bitemyapp / WSGI
19:52noonian_LusciousPear: there are a lot of libraries that build on top of ring, for api's there is liberator, but you might try making a simple api on your own first just using functions and some middlewares for converting between edn and json
19:52teslanickbitemyapp: It's not a great environment, but it's ubiquitous. It's also the lingua franca of web UI developers everywhere.
19:53bitemyappteslanick: in my CLJS and Fay-using eyes, it's an output for my compiler.
19:53bitemyappteslanick: beneath the dignity of human programmers :)
19:53bitemyappteslanick: but I understand the constraints and why you're sometimes forced to grapple with it :)
19:54LusciousPear@noonian_ yeah, I started looking at liberator but I can't quite figure out where it is in my mental model, since it basically seems like decoration on what I'd do with compojure. but I haven't thought deeplyon it.
19:55bitemyappLusciousPear: I tried to make Liberator work, but customizing behavior on things like content negotiation and output was WAY harder than simply writing the "obvious" middleware.
19:55bitemyappLusciousPear: luckily, some of the work I do at my company, I open source! Have a look-see: https://github.com/bitemyapp/berossus/blob/master/src/berossus/rocks/your/data/middleware.clj
19:55teslanickbitemyapp: I don't totally disagree with the sentiment, but good luck finding someone who can scrape together a decent UI design that also can write CLJS, and will work for a company that writes enterprise software. I'm pretty sure that population is pretty close to zero.
19:55noonian_yeah, i'm just starting with liberator and have only used it for very simple things so far
19:56bitemyappteslanick: why are UI people writing code?
19:56teslanickBecause UIs are written in code?
19:56bitemyappteslanick: so they're coders but don't take coding seriously?
19:56bitemyappnoonian_: that fell apart for me pretty fast.
19:56bitemyappa relatively simple use-case turned into an absolute nightmare.
19:56bitemyappnoonian_: contrast with that simple middleware.clj file.
19:58noonian_bitemyapp: i was going to look at it for helping to enforce authorization rules for different endpoints, my attempts to do that using friend have been pretty messy so far
19:58akhudekteslanick: we had no trouble finding someone exactly like that.
19:58bitemyappnoonian_: I avoid Friend too...
19:59LusciousPearI tried to get into Friend, and it looks comprehensive, but also really complex
19:59bitemyappteslanick: supposition vs. data? :)
19:59teslanickakhudek: How about dozens of them?
19:59bitemyappteslanick: considering how many UI people you can replace with a single CLJS coder...
19:59akhudekteslanick: well, we had dozens of applications, many looked good.
19:59bitemyappteslanick: but seriously, you're getting silly now. Surely there are plenty of competent frontend people that want to learn better languages.
19:59bitemyappteslanick: I think I know the person he refers to, and he is an excellent and eager learner.
19:59teslanickAgreed, but there's a lot of moving parts to get that to hapepn.
20:00bitemyappteslanick: I've gotten that same person started on some Haskell recently, which only scarcely has any relevance to his day job. :)
20:00bitemyappteslanick: it's always easier to come up with reasons you shouldn't take the high road.
20:00bitemyappteslanick: I'd rather be one of the people trying things to see what can be made to work.
20:00teslanickHey, I'm a UI developer who's sitting somewhere in the kiddie pool side of Clojure. So I'm not saying they don't exist
20:00bitemyappincluding hiring people to learn new things.
20:01bitemyappteslanick: well, one of my pet projects right now is teaching people things like Haskell and Clojure, especially people you wouldn't conventionally expect to want to learn such things.
20:01bitemyappteslanick: my experiences so far make me skeptical of the pessimism you're exhibiting.
20:02noonian_it can't be THAT easy to get a job using Clojure that Clojure programmers would pass up a job just because it's with a company that ships enterprise software
20:03bitemyapphum. A job that got posted recently for a company in Singapore that needed to fill 6 Haskell positions got something like ~60 applicants based mostly on a Reddit post.
20:03bitemyappand that's for something in SEA.
20:03bitemyappand it was for relatively boring work.
20:03teslanickBut it's a chicken-egg thing. You gotta get a big organization willing to sign off on a cljs/clj stack for new development, which means a rolling rewrite of existing software or greenfield project, and get all the people who work on it into a new language. It's definitely not easy.
20:03bitemyappPorting a PHP app to Haskell.
20:03bitemyappthere's no chicken or egg here.
20:04bitemyappThey decided to port their PHP web app to Haskell, they posted an ad, and got a ton of applications.
20:04bitemyappit seems to me to be pretty easy to test the waters for interest in the project you have in mind by simply posting the project and tech involved.
20:04bitemyappStartups do it all the time for validating their entire business model/product.
20:05bitemyappteslanick: it's pretty hard to beat the averages if you're making the same decisions as the average company/
20:05bitemyappteslanick: I'd rather take risks and try to surround myself with more driven people that want to learn.
20:06bitemyappteslanick: Haskell and Clojure both have a pretty good track record of having been used happily at companies of a pretty good range of sizes.
20:06bitemyappso it's not even like you'd be using something unproven, you're just making excuses for Blub decision-making.
20:08akhudekbitemyapp: on a different topic, did you see our little database experiment? https://github.com/diligenceengine/edl
20:09bitemyappakhudek: not yet, but I'm looking now.
20:09bitemyappakhudek: this sounds really neat!
20:10akhudekbitemyapp: there is a lot I like about it, but I'm not yet sure where to go with it
20:10bitemyappakhudek: on the topic of optimization, one of the best ways to go there is to analyze cardinality and sequencing of indexes used.
20:11bitemyappakhudek: well if you can layer a sufficiently expressive (equal to SQL?) way of building queries on top of it, it could hypothetically be an alternative to Korma, no?
20:11akhudekbitemyapp: that's one possibility
20:12akhudekbitemyapp: the part I'm not sure about is, is the korma style really the best way to solve the problem?
20:12bitemyappakhudek: I think there are a multitude of ways to improve on Korma.
20:13bitemyappakhudek: but, you have to be careful about diverging from the semantics of the underlying query language. I've seen that fail too (Haskell Persistent, people ended up using Esqueleto which is like Korma and Squeryl)
20:13akhudekbitemyapp: yeah, that's the big problem. Proposing to replace sql would require *really* good reasons
20:14bitemyappakhudek: the best reason I've seen so far was Datalog, which is capable of being more expressive than SQL but that still introduces massive pain when you want to do something like an outer join.
20:15bitemyappakhudek: SQL semantics generally make practical projects the least painful, my interest is in type-safe, efficient, and *composable* SQL that lines up with the schema.
20:16akhudekbitemyapp: so there are two parts here, on the one hand, we could create a compile-time type safe honeysql or the like (probably just an add-on for honeysql), and on the other are macros like get-record which provide a more concise dsl for some queries
20:18akhudekbitemyapp: I think a type safe honeysql is all around good, but I'm unsure about the extra dsl aspects.
20:20bitemyappakhudek: there are aspects of SQL that are tedious.
20:21bitemyappakhudek: the part where libraries like this really bites you is when you need to specifically express some weird SQL syntax notation or suffix because you're talking to a really stupid SQL database like Oracle.
20:21bitemyappakhudek: that's why arbitrary-SQL DSLs are popular.
20:21bitemyappthey prevent you from becoming stuck because of something like that.
20:22akhudekbitemyapp: yep, I know we've used postgres specific extensions frequently
20:22bitemyappakhudek: it's 50/50 whether it's a PostgreSQL extension or an Oracle oddity that somebody complains about with Korma.
20:24bitemyappakhudek: maybe a meta-DSL that lets you integrate the generation of custom query-strings into the greater family of defaults?
20:25akhudekbitemyapp: honeysql does that, but it's not very concise considering it's exactly sql
20:25akhudekbitemyapp: I thought briefly about a dsl that used honeysql fragments or something, but didn't get very far
20:26bitemyappakhudek: I would encourage looking at what the Haskell community has tried here as a source of what might/might not work. Primarily Persistent, Esqueleto, and HaskellDB.
20:26bitemyappakhudek: http://blog.felipe.lessa.nom.br/?p=68
20:27bitemyappThe esqueleto would probably look ugly to a Clojurian's eyes, but you get the idea.
20:27bitemyappakhudek: you can see how it's programmable/composable SQL.
20:27bitemyappone difference is that it's a bit higher level than HoneySQL
20:27bitemyappbut not necessarily schema-aware.
20:27meltingw1xcan anyone explain to me why this for loop over a PersistentVector isn't working? http://pastebin.com/YFr5gDqD
20:27bitemyappyou could hypothetically unify those properties.
20:28bitemyappmeltingw1x: for is lazy yo.
20:28bitemyappmeltingw1x: if you want to do something for side effects, look for a function/macro with the word "do" in the name.
20:28akhudekbitemyapp: thanks, I'll take a look at these.
20:28bitemyappmeltingw1x: the code in the body of "for" never executes if I'm understanding correctly.
20:28meltingw1xbitemyapp: thank you very much
20:28meltingw1xyes
20:29bitemyappmeltingw1x: map and filter are lazy too.
20:42darthdeushow can i do this the right way? (let [xs '(1 2 3)] (+ xs))
20:42darthdeusi'm getting "Cannot cast clojure.lang.PersistentList to java.lang.Number"
20:44bbloomibdknox: please prefix your github project names!
20:44bbloomibdknox: before it's waaaayy too late to do so, add a "LightTable-" or "lt-" prefix or something like that
20:45bitemyappthis is why I choose weird names. Nobody's going to mistake berossus for anything but what it is.
20:45bitemyappbrownie points to whoever knew off the top of their heads who that was.
20:45bbloomibdknox: If I were to fork LightTable/Vim, I'd have BrandonBloom/Vim, which would be quite misleading
20:46amalloydarthdeus: (apply + xs)
20:46bitemyapp,(reduce + '(1 2 3))
20:46clojurebot6
20:46darthdeusjjthat gives me Attempting to call unbound fn: #'user/apply
20:46bbloomibdknox: you've got ~20 forks on stuff besides the main project now. the sooner you rename, the less painful it will be :-)
20:46bitemyapp,(+ '(1 2 3)) ;; :(
20:46clojurebot#<ClassCastException java.lang.ClassCastException: Cannot cast clojure.lang.PersistentList to java.lang.Number>
20:47darthdeusamalloy: hm weird, it seems to work in the lein repl, but not inside lighttable live mode
20:48bbloomibdknox: in fact, if i fork your Clojure project, github calls it BrandonBloom/Clojure-1
20:48bbloom*sigh*
20:49bitemyappClearly should've named the plugins after DC Comics superheroes.
20:49amalloydarthdeus: that surprises me a little, but there are a lot of things that break in lighttable's live thingy, apparently
20:50bitemyappoh, LT user. Right. Giving up now.
20:50muhoobbloom: transduce is interesting. i'd been doing stuff like it using reduce instead. https://www.refheap.com/22642 thanks for a new way of looking at it.
20:51bbloommuhoo: yeah, i generally use reduce when i don't want to suck in a dep or copy paste these little functions. the distinction is about the fact that reduce is eager & transducers can be chained together to execute interleaved
20:51darthdeusbitemyapp: huh?
20:51bitemyappFor any curious: http://hackage.haskell.org/package/fst https://github.com/brandonbloom/transduce http://www.cse.chalmers.se/alumni/markus/fstStudio/
20:52bitemyappParticularly for a high level overview of the "grammar": http://hackage.haskell.org/package/fst-0.10.0.0/docs/FST-FSTStudio.html
20:59arrdembitemyapp: I suppose that's one scheme for never running out of names...
21:08Squee-Dibdknox you rock man. Not just because I really like Light Table, but because your source is going to help me get started with clojure and node webkit
21:09bitemyapparrdem: what can I say, I solved one of the two hard problems in CS>
21:09bitemyapparrdem: now I just need to make a library for cache invalidation via dependency graphs.
21:10logic_progfor the semantics of alt!, is (alt! [chan1 chan2]) always nil when chan2 is a closed channel?
21:10logic_progi.e. does a closed channel = infinite stream of nil ?
21:17stcredzeroHowdy folks. (Particularly utexas folks) Does anyone here understand Ring sessions?
21:18arrdem_ /nick arrdem
21:18bitemyappstcredzero: I've hacked on many Ring sessions implementations, but that also means I'll need you to get more specific.
21:18bitemyappstcredzero: are you asking for a generic Ring approach to sessions? (In which case, you'll need to specify whether you mean kicking state across the request lifecycle or attaching user state to requests themselves)
21:19bitemyappstcredzero: or are you referring to something specific, like the libnoir stuff?
21:20stcredzerobitemyapp: Just how do I attach state to a session that I can get back at the next request? I've read almost a dozen blog posts and I'm still as confused as I was when I started.
21:20bitemyappstcredzero: that would the the latter of what I said. So you probably want signed/encrypted sessions. Simplest way to learn is to write your own Ring middleware. Super easy.
21:21bitemyapplet me try to dig up an example.
21:21stcredzerobitemyapp: I keep seeing stuff where people give an example where they define a handler. But I don't define a handler, I have the route produce one automagically. Instead of writing my own handler, could I just use sandbar?
21:21stcredzeroI mean middleware
21:22bitemyappstcredzero: https://github.com/bitemyapp/neubite/blob/master/src/neubite/handler.clj#L50
21:22bitemyappstcredzero: does that look applicable? If not, please do explain why.
21:22arrdemdibs!
21:22bitemyappstcredzero: [ring.middleware.session.cookie :refer [cookie-store]] is the origin package.
21:22bitemyapparrdem: seriously?
21:22arrdembitemyapp: yes
21:22bitemyapparrdem: 13
21:22bitemyapparrdem: ?
21:23arrdembitemyapp: probably. I haven't kept track :P
21:23bitemyapparrdem: I want to leave the office, but I don't want to until you're 13.
21:23bitemyapparrdem: plzchk
21:23arrdembitemyapp: oh. level. nah man I'm taking a break and working on some old posts.
21:24bitemyappfrick.
21:25bitemyappstcredzero: if you have some kind of opaque magic from you slapping middleware onto your top-level app handler then you need to unfuck your stack promptly and use vanilla Ring.
21:25stcredzeromitemyapp: this is as confusing as the rest. site is a reference to something magic. I recognize the {:session... stuff afterwards. Is this some noir thing?
21:25bitemyapppreventing you from*
21:25bitemyappstcredzero: it's just Ring middleware man. functions returning functions. [lib-noir "0.3.5"]
21:26bitemyappactually wait
21:26bitemyapplet me verify
21:26stcredzerobitemyapp: your last long comment basically sums up every blog post about ring sessions, ever. Doesn't help.
21:27bitemyappstcredzero: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session/cookie.clj
21:27bitemyappstcredzero: a Ring application is the composition of functions comprising both middleware and handlers.
21:27stcredzeroYes, I got that.
21:28bitemyappwell fine, but I'm reinforcing it because there's some subtler aspect of it you may not be grokking
21:28bitemyappit takes most people awhile to connect the dots on this.
21:28bitemyappRouting is just a handler function that dispatches based on a mapping of string to fn (modulo some regex)
21:29bitemyappMiddleware is a function that takes the app fn and decorates the behavior, whether that be before or after the invocation of the app fn against the request.
21:29bitemyappstcredzero: It might help if you articulated what part you don't understand or shared your code.
21:29bitemyappstcredzero: neubite is a mostly (except for MongoDB I think) freestanding micro-CMS example of how to put a Ring app together.
21:29bitemyappstcredzero: I'm pretty sure Luminus has other examples as well.
21:30stcredzerobitemyapp: your last comment starting "it takes most..." should be regarded by the community as a symptom. Okay, I get that part about decorations. What in the world do I write for the typical compojure thing? What I'm gathering is that I should use some library or basically write my own session store mechanism.
21:30bitemyapparrdem: can I bribe you into hitting 13?
21:30bitemyappstcredzero: it's a symptom of a poor education system that teaches according to corporate priorities rather than what actually makes people excellent programmers, but that's besides the point.
21:31bitemyappstcredzero: for the typical compojure thing? I personally use the default Ring middleware for cookie stores. I'm sure many others do.
21:32bitemyappstcredzero: the default Ring middleware for cookie stores is exactly what you're seeing in that neubite code.
21:32seangroveI have to run out to a meetup, but stcredzero I'd be happy to help bitemyapp help you out when I get back
21:33seangrovestcredzero: I would just suggest posting as much code as possible to make everything crystal clear
21:33bitemyappseangrove: wait, which meetup is tonight?
21:33seangroveAppium :P
21:33hiredmanstcredzero: have you seen https://github.com/mmcgrana/ring/wiki/Sessions ?
21:33stcredzerobitemyapp: re: symptom. I won't disagree. Okay, so where the heck does "site" come from? And what in all this do I need or don't need?
21:33seangroveNothing special
21:33seangroveMeeting a customer there, and some of my old work mates from Sauce
21:34stcredzeroHey, sean.
21:34bitemyappstcredzero: site is middleware, I often find it helps to "just read the code" when it comes to Clojure and Haskell: https://github.com/weavejester/compojure/blob/master/src/compojure/handler.clj
21:34bitemyappstcredzero: the intent behind it is to bundle up some common default middleware.
21:35dsrxin haskell you can often get away with reading the type signature
21:35hiredmanstcredzero: since you using compojure to define routes, the end points are still handlers, you still get a ring request map
21:35bitemyappstcredzero: if you don't want the rest of it, you can probably get away with using wrap-session plus cookie-store.
21:35logic_progwhat problem does https://github.com/halgari/fafnir solve ?
21:35bitemyappdsrx: damn straight. It's awesome.
21:35logic_progwhy is inserting a big object into datomic nono-trivial?
21:35bitemyapplogic_prog: the nested part is the important part.
21:36bitemyapplogic_prog: as someone that has had to (de/re)forest ugly hierarchies into Datomic, if your data model fits Fafnir, you probably want to use it.
21:36stcredzeroI keep seeing this "(defn handler..." example, but I don't have such a thing. I would like to just use wrap-session and cookie-store. Just doesn't make sense.
21:36hiredmanstcredzero: your compojure route is a handler
21:36logic_progbitemyapp: noted, thanks
21:37bitemyappstcredzero: what you're saying is symptomatic of some part of Ring or Compojure not "clicking" for you.
21:37hiredman(defroutes handler (GET whatever [req]))
21:37hiredmanis a handler and req is same request map that gets passed in to the (defn handler ...)
21:37bitemyappstcredzero: everything is a function. Compojure routes are the monoidic aggregation of matching rules and handlers into higher level functions that take ring requests and return ring responses.
21:37hiredmanand it returns the same thing, so you drop the body of the handler defn in
21:38bitemyappbbloom: dnolen http://www.infoq.com/presentations/molog miniKanren in Haskell, @acfoltzer's work.
21:38stcredzerohiredman: I get that. Let me see if I can make sense of "drop the body of the handler in..."
21:38hiredmanthe really annothing thing there is compojure's destructuring is slightly different from clojure's
21:38bitemyapphiredman: yeah that's a killer sometimes.
21:38hiredmanso the desructuring from the example may not just work
21:39stcredzerohiredman: Seems like there's 2 or 3 bits of additional magic I have to figure out for every additional thing I learn.
21:40hiredmanstcredzero: if you don't know clojure you are going to have to learn things to write clojure
21:40hiredmanstcredzero: if you don't know ring, etc etc etc
21:40stcredzeroThis is my second clojure personal project.
21:40hiredmanI mean, that is just the reality of doing new things
21:40stcredzeroThanks for the talking down to.
21:41bitemyappstcredzero: everybody has stuff they don't know. Don't worry about where you are on the ladder, just keep climbing!~
21:41bitemyappstcredzero: putting your ego aside will allow you to focus on the climb.
21:41bitemyappstcredzero: a month ago, I didn
21:41ddellacostastcredzero: don't take it personally. It's hard to read tone in IRC. These guys are definitely trying to help.
21:42bitemyappstcredzero: didn't really grok Scotty's routing monoids (kinda like Compojure), now I do!
21:42sritchiebitemyapp: routing monoids?
21:42stcredzeroThanks, I guess. Why are you alleging ego? And why does all of this have to be so cryptic?
21:43bitemyappsritchie: sure. You can model fizzbuzz as a monoid too.
21:44bitemyappsritchie: a rule can be a tuple (String, RingHandler) where Ring handler is a function (Request -> Response)
21:44bitemyappsritchie: routing is the Monoidic `mappending` of those tuples into a single "router"
21:45bitemyappsritchie: sorting/precedence rule aggregation in fizzbizz forms a Monoid too!
21:45sritchieokay, sure
21:45rafaelsfexit
21:45ddellacostastcredzero: what are you stuck on? Do you have a gist/refheap of your code, or is it some conceptual thing? I'm sorry, I missed the beginning of the conversation.
21:45bitemyappsritchie: I've been writing a little too much Haskell lately :(
21:45sritchiemonoids everywhere, baby!
21:45bitemyappsritchie: the things I've seen...
21:46stcredzerodellacosta: What would be great is just what to write so that I can shove some data in a session and get it back. Was on the phone, so was too awkward to post any code. Just a sec...
21:46ddellacostastcredzero: okay
21:47bitemyappddellacosta: wheeeee. I look forward to it!
21:47ddellacostabitemyapp: I haven't forgotten! ;-)
21:48ddellacostaalso, sritchie I owe you a response on friend-oauth2, apologies for completely flaking that one
21:48sritchieno worries
21:48arrdemthe day I get op in here, first thing I'm doing is kicking also and so.
21:49stcredzeroddellacosta: http://pastebin.com/bbhJWrtW -- that's my handler.clj The function that I'm trying to get sessions to work with is session-test (of course)
21:49akhudekarrdem: no decent person would choose those names!
21:49arrdemakhudek: I KNOW. THANK YOU.
21:50ddellacostahaha
21:50gfredericksoh no help now I have five libs named #"lib-\d{4}"
21:50bitemyapparrdem: I survive this hypothetical purge?
21:51arrdembitemyapp: maybe. take a tough check.
21:52arrdem1d6
21:52clojurebot2
21:52arrdembitemyapp: failed the tough check. you get canned too.
21:52arrdembitemyapp: <3
21:52bitemyappouch.
21:52ddellacostastcredzero: and, what do you want to return there?
21:52bitemyappmy D&D karma is not good.
21:52ddellacosta1d6
21:52clojurebot1
21:53ddellacostathat's hilarious, didn't know that existed
21:53bitemyapp1d12
21:53clojurebot4
21:53bitemyappman, this bot's RNG is not doling out the awesome tonight.
21:53vdmit11Hi folks. Does doseq forces evaluation of a given lazy sequence before evaluation of body or it evaluates one element from the sequence per iteration?
21:54ddellacostastcredzero: take a look at https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session.clj#L49 if you haven't
21:54stcredzeroddellacosta: It's a mess because I've just been trying stuff. I'd pretty much like to do what https://github.com/mmcgrana/ring/wiki/Sessions is doing in the 2nd gray box. I'm just about to do that in a new lein project
21:54arrdem2d6
21:54clojurebot8
21:54arrdem2d6
21:54clojurebot8
21:54arrdem2d6
21:54clojurebot9
21:54arrdemlittle high here...
21:55arrdemit's not blatantly returning 4 all the time :P
21:55Cr82701d1
21:55clojurebot2701
21:56arrdembitemyapp: we need lazybot and clojurebot pages on the wiki...
21:56arrdema package naming convention would be nice too...
21:57ddellacostastcredzero: ah, okay...so the thing to remember is that there is a session in the response args, with the key (in that example) of :session. So you have to update that in your response. Your example is not doing that--it's returning an "arbitrary" hash-map. Does that make sense? That's why I pointed you to the session-response function in my link above.
21:57bitemyapparrdem: we do need pages on the bots, I forget the commands too fucking much.
21:57ddellacosta...as that shows what is going on, if you read that code it may make more sense.
21:57bitemyapparrdem: you are welcome to add whatever content you like :)
21:57stcredzerodellacosta: thanks for trying. I hadn't seen that particular one, but it's just as bad as everything else. I'm going to try to play with the example at https://github.com/mmcgrana/ring/wiki/Sessions
21:58ddellacostastcredzero: ...what's bad about it? That's the library you are using to write this.
21:58hiredman /ignore stcredzero
21:59hiredmanpardon me
21:59ddellacostahaha
21:59ddellacostastcredzero: well, if you change your mind, I'm happy to try and help you understand the workings of ring a bit more. But I do recommend reading through the ring code to understand how it works, at some point. Otherwise, good luck.
22:01stcredzerodellacosta: It's confusing. If this is truly an earnest attempt at help, I dunno. Reminds me of the same stuff from Smalltalk years ago.
22:02ddellacostastcredzero: if you take the time to explain what is confusing, those of us here with experience with Clojure can better help you. But I assure you that the default attitude here from 99% of folks is helpful, sincerely.
22:03ddellacostadammit, burnt my toast
22:03stcredzeroddellacosta: appreciate it. I think I'm going to have to go on and play with stuff first. Then I'm going to come back and say something like, "well, why didn't you just tell me...!?"
22:03bitemyappddellacosta: "dammit, burnt my toast" - and then he was enlightened
22:03bitemyapptoo funny.
22:04ddellacostahaha
22:04ddellacostastcredzero: understood. Good luck! :-)
22:05ddellacostabitemyapp: now I have to figure out what to eat. I have not yet reached enlightenment.
22:05bitemyappddellacosta: whatever's available and appealing?
22:05ddellacostamaybe I'll go to the conbini and get some melon pan
22:06bitemyappalso I'm depressed. Prim (delivered laundry service startup) shut down. Now I have to do my own laundry.
22:06ddellacostabitemyapp: dude
22:06ddellacostabitemyapp: that is so San Francisco
22:06bitemyappddellacosta: living in SF is a lesson in the impermanence of existence.
22:06ddellacostahaha
22:06ddellacostavery Zen today. ;-)
22:07bitemyappddellacosta: I've been neck-deep in broken edn parsers for a couple of weeks. When sanity leaves, Zen remains
22:07ddellacostaheh
22:07bitemyappwhy? because Zen can't go anywhere
22:08bitemyappddellacosta: my latest amusement is some weirdo buddhist or soto person trolling ewk on reddit.com/r/zen
22:08bellkevDoes anybody know if there's anything loosely equivalent to :jar-exclusions for cljs? That is, is there a way to conditionally include/exclude files/namespaces from going into the compiled js based on a leiningen profile other than having multiple source directories?
22:08bitemyappddellacosta: I think somebody has an axe to grind with non-religious zennists.
22:08bitemyappor rinzai.
22:08ddellacostabitemyapp: well, I am going somewhere, to the conbini to get a bite. Be back. ;-)
22:09ddellacostabitemyapp: rinzai strikes me as more likely to troll. brb
22:09bitemyappddellacosta: you're actually right, ewk is usually the troll. So am I. (I'm rinzai, god only knows what he is). But somebody decided to put him on the defensive and it's hilarious. Cheers.
22:10bvecchiHey. Is there a way to know, given a function, if there's a var that is bound to it?
22:11bitemyapp,(= (fn [] (println "Hello!")) (fn [] (println "Hello!")))
22:11clojurebotfalse
22:12bitemyappsadface.jpg
22:14gf3bitemyapp: ahahahaha that last shit_hn_says was brilliant
22:14gf3https://twitter.com/shit_hn_says/status/421116237792284672
22:14b-otgf3: @shit_hn_says: Why don't they just host GitHub wherever the status site is hosted?
22:18danneuHow would you do a case-insensitive string search with datalog?
22:19hiredmandanneu: you'll need to specify a kind of datalog
22:19danneuNevermind, got it
22:19danneuhiredman: yeah, thanks. i've been able to use d/datoms so often that i forgot how to write datalog
22:20danneu[(clojure.str/lower-case ?name) ?lower-name] [(= "peter" ?lower-name)]
22:20hiredmandanneu: datalog is a family of query languages like lisp is a family of programming languages
22:21hiredmanI guess being #clojure assuming datomic's datalog might be an ok bet
22:22bellkevI think I answered my own question about cljs exclusions here: https://github.com/emezeske/lein-cljsbuild/issues/157
22:23bellkevIt looks like @magomimmo settled on a source-paths based solution. His use case of a browser-connected repl is identical to what I wanted the option for...
22:23bellkevSo I'll just assume that that solution is idiomatic for now...
22:30ddellacostait's a long shot, but, anyone here used the relatively new update/set/values helpers in HoneySQL?
22:43abishek;;message
22:43abishek;;message Hi
22:43bitemyappgf3: <3
22:43gf3:)
22:47bitemyapparrdem: doters?
22:48arrdembitemyapp: sure. let me finish ranting about pipeline hazards, grab a beer and I'll change machines.
22:54bitemyappgf3: FIGHT FIGHT FIGHT
22:54gf3hahaha
22:54gf3bitemyapp: lojikil is a good friend of mine
22:56bitemyappgf3: I don't care, I expect a blood sacrifice. Not using oxford commas is unforgivable.
22:56bitemyappthey have a very useful semantic purpose.
22:56gf3agree
22:56gf3fogus must pay
22:57gf3#sin
22:57bitemyappgf3: maybe 3 years of writing VB 6 is sufficient punishment?
22:57bitemyappgf3: ...writing Excel format parsers
22:57gf3bitemyapp: I heard VP.NET is worse
22:57gf3er
22:57gf3VB.NET
22:57bitemyappgf3: ...the old bytecode Excel format.
22:57bitemyappgf3: nah, VB 6 is worse.
22:57bitemyappgf3: I did .NET back in the day.
22:58bitemyappgf3: VB.NET is like the C++ of VB, but actually good.
22:58bitemyappwell, not good, better.
22:58gf3bitemyapp: I heard VB.NET is VB pretending it's a big boy, and VB6 is just unabashed VB
22:58bitemyappgf3: I guess it depends on your priorities.
22:58gf3bitemyapp: pizza
22:58bitemyappgf3: but that's like saying the robber baron capitalism of the 19th century was better than feudalism. It's true, but the orders of magnitude involved are mind boggling.
22:59bitemyappgf3: I was already following him, but after this conversation, I like him even more.
22:59gf3bitemyapp: smart as hell, too
23:02bitemyappgf3: probably why I originally followed them.
23:02stcredzeroOkay, I can write a handler to do stuff with the session. How in the world do I incorporate that into the functions I call from defroutes?
23:03arrdembitemyapp: okay. lets do this.
23:04bitemyappstcredzero: I can't help you right now, I'm agitating for marxist revolt against product managers.
23:04bitemyapparrdem: mumbulurs.
23:05stcredzerobitemyapp: your comment re: robber barons reminds me of my observation about almost all leaders prior to 1700
23:05bitemyappstcredzero: that being?
23:05bitemyapparrdem: gooby pls mmbl.
23:06stcredzerobitemyapp: which is that almost all leaders prior to 1700 have the same morality that supervillains do in todays fiction.
23:06bitemyappstcredzero: uh, yeah, but I don't think that stopped at 1700.
23:07bitemyappstcredzero: I'm listening to the history of rome podcast, about 80% done. One of the starkest impressions I'm getting is, "virtually everyone in power was a sociopath of some variety or another"
23:07stcredzeroLove History of Rome
23:07stcredzeroAlso, I didn't say that it stopped at 1700. It's just that you can categorically say that about the leaders before 1700
23:08bitemyappstcredzero: ah gotcha. Yeah I'd agree with that.
23:09stcredzeroHow come everyone always concocts an incorrect or illogical implication of something I say/write. then assumes I'm proulgating that silly idea?
23:10stcredzeroI made a comment on HN about how inheritance is overrated, factory is overused, and both happen to generics. This was interpreted as my claiming inheritance and factory are somehow associated with generics
23:12gf3stcredzero: that's what you get for commenting on HN
23:12mischovstcredzero: I think things would be overly generic if you inherited factory jobs from your parents.. :)
23:12bitemyappgf3: I think I can improve your friend.
23:13gf3bitemyapp: oh ya?
23:13bitemyappgf3: ya, get 'em started on 'Askell.
23:13bitemyappif I say the H word, the monsters come out of the woodwork :)
23:15stcredzerogf3: so now HN is a den of careless readers and breezy pseudo knowitalls?
23:15gf3bitemyapp: I'm sure he already has
23:15gf3stcredzero: WELL YOU POST THERE, SO...
23:16gf3bitemyapp: The guy blows my mind whenever he talks to me about what he's working on
23:16xuserstcredzero: if its everyone like you said, have you stop and think that maybe the way you write is the problem?
23:16xuser;)
23:16stcredzerogf3: I've been there awhile noting the decline in things like CS knowledge and reading comprehension.
23:18stcredzeroxuser: reading involves coming up with a number of possible interpretations, like hypotheses. It's a filtering observation: see if someone only ever produces one hypothesis then goes with it.
23:18gf3stcredzero: i'm just pushing your buttons, i don't care where you post on the internet
23:18stcredzerogf3: You *think* you are pushing your buttons, and I'm not defending HN.
23:19gf3you got me
23:32cerealklrHey folks. Sorry to bother you with such a simple question, but it's impossible to google the @ character. What does a variable name preceded by the @ sign imply?
23:34egghead@ is dereferencing
23:35eggheadlike a future or an atom
23:37cerealklrAh, I see. So does it block for a value synchronously?
23:38cerealklrActually, I can probably just google clojure concurrency constructs and figure it out. Thanks!
23:38justinjaffraycerealklr: I believe (but someone correct me if I'm wrong) @foo is equivalent to (deref foo)
23:38egghead^
23:38clojurebotGabh mo leithscéal?
23:39egghead,(let [a (atom :atom)] [a (deref a) @a])
23:39clojurebot[#<Atom@1c81588: :atom> :atom :atom]
23:40cerealklrLooks like you were right. :)
23:58dsrxreminds me that i used to use the nick Atom on IRC way back in the day.... good thing i stopped