#clojure logs

2013-08-17

00:04TimMcI could just clone my own dotfiles for that matter.
00:04TimMcHowever, my own .emacs.d is not... reproducible.
00:04callen?_?
00:05callenI've got all kinds of shit in my .emacs.d and it still 'just works' when I git clone
00:05callenI just install 3 python libraries for my python config and then I'm done.
00:06`cbpMaybe its all absolute paths :D
00:07callen`cbp: don't say such hateful things. Also bulwark had its first release. I'm going to test it with somebody and move on to the next thing.
00:08callen`cbp: any ideas on the Pomegranate "sync with project.clj" dilly?
00:09technomancyTimMc: whaaaaat
00:09technomancyis marmalade down?
00:09technomancywfm: http://marmalade-repo.org/packages/clojure-mode
00:09callenisn't it an elisp backed web server?
00:10callen...jus' sayin'...
00:10technomancycallen: to our great shame, it's node
00:10callenTimMc: what did you originally need lein-otf for?
00:10callentechnomancy: THE FARK?!
00:10technomancycallen. I KNOW
00:10technomancycallen: there's a rewrite in progress though
00:10callenI am horrified.
00:10technomancyhttp://marmalade-repo.ferrier.me.uk/ <- the elisp version
00:10callentechnomancy: one of Ferrier's...yep.
00:11callenI fucking knew it.
00:11callenthat man is deranged.
00:11technomancytrue
00:11technomancycallen: the original author got everyone to use it and then absconded
00:11callenbetter him than node users though.
00:11callentechnomancy: lol, like clojuredocs.
00:11`cbpcallen: I'll look at it tomorrow :-)
00:11callentechnomancy: which I'm still grumpy.
00:11callen`cbp: I have a web project on the horizon if you want something less crunchy as well. Let me know how it goes!
00:12callenstill grumpy about*
00:14`cbpsure
00:15callen`cbp: how much do you like...wikis?
00:16technomancyjust like clojuredocs =(
00:17callenI still don't know why people are negative about wikis. The community can maintain them themselves
00:17callenunlike things like clojuredocs.
00:17`cbpcallen: i'm neutral i guess? never really used or made one
00:17adui wanna make a wiki
00:17adui'm an avid wikipedian
00:18aduI've deleted the word penis from wikipedia around 1000 times
00:19technomancydoes that include synonyms
00:19adutechnomancy: yes
00:19callenfair warning, I'm anti-deletionism and not really happy with the way Wikipedia is managed.
00:19aduit's almost always out-of-context
00:21callenanyway, Clojure needs a wiki.
00:21adulike "Hillary Clinton met with Netanyahu AND WHIPPED OUT HER PENIS to discuss diplomatic ties …"
00:21`cbpyeah I think so too
00:21callenThere are too many books coming out for Clojure that are basically collections of the sort of snippets/recipes/cookbooks you'd find on a wiki and they won't be kept up to date like a wiki would either.
00:21callenSomething like EmacsWiki would be glorious.
00:22aducallen: isn't EmacsWiki already glorious?
00:22technomancypeople will still make blog posts with glaring inaccuracies that never get updated
00:22technomancythis is the legacy of swank-clojure
00:23callenadu: that's my point, I want ClojureWiki to steal the same benefits :)
00:24adunow we just need a set of buffer manip libs to make Emaclo
00:25callennothx.
00:25callenEmacs and elisp is fine. I like them and what they do.
00:25callen(require 'cl) exists, just leave it alone.
00:26aduor I suppose one could theoretically make Eclipse extensions in clojure
00:26callenbut most of my work is services/server-side/web and Clojure fits the bill and I'd like the collective knowledge of the community not be scattered to the four winds of deleted tumblr blogs and abandoned portfolio sites.
00:27aduI really liked noir and joodo in how easy they made it
00:27adubut now I hear that people just cherry-pick their web libs
00:30aduboth (noir and joodo) depend on ring/compojure/hiccup, and most people I've talked to recommend learning just compojure, and not the rest
00:31callenadu: Luminus rolls up some nice defaults if you want that.
00:32callenadu: in addition to Luminus, my personal CMS is a test bed for libraries: https://github.com/bitemyapp/neubite/
00:32callenhttp://www.luminusweb.net/
04:02callenjust had a wonderful time making my library simultaneously muggle and neckbeard compatible.
04:12muhooheh neckbeard https://www.facebook.com/pages/The-Neckbeard-Boys/179687975453042
04:12callenmuhoo: what I'm referring to, is the fn returned by my middleware tries to use private closed over data, but falls back to a global atom.
04:13callenand the latter use-case isn't just for convenience/muggles, there's a fairly serious production-mode use-case for that.
04:13callenannnnnnnd I really need a debug-repl that actually works.
04:14callenonly locals work in the current version of Jahad's debug-repl
04:18supersymwhats a good, elegant/lean way of doing fulltext/keyword search in clojure? It doesn't have to be big data, at most about a few hundred records or so as part of a dictionary lookup
04:18supersymI was thinking just using maps at first, but its the full text-search I'm not too sure about, if there are easier/more viable solutions laying around :P
04:27callensupersym: so, the problem here is that usually when you need robust full text search, the presumption is that you wouldn't be using an embedded library.
04:28callensupersym: you *might* be able to extract just the analysis stuff from Lucene via Clucy
04:28callensupersym: desperately avoid implementing a full text search algo yourself if possible, but if you do write one, make it a micro-library and push it to github please.
04:30ucbsupersym: what sort of capabilities are you after? you want wildcards or full word matches?
04:31callenucb: hai o/
04:31ucbhai2u \o
04:32supersymcallen: yeah feared that I'd have to go full blown...
04:33callensupersym: clucy has a nice API, the only problem is that to avoid creating a Lucene index you're going to reach into the guts and wrap the analysis stuff.
04:33supersymwell,... tbh it can be just keyword wildcard matches
04:33callenI don't think it's a big deal to do so, myself.
04:33supersymyeah
04:33callensupersym: well that's not "true" full-text search
04:33supersymit doesnt have to be full-text per se
04:33callenfull-text search handles stemming, fuzzy search, etc
04:34ucbI'd say that's debatable
04:34ucbthe query language (fuzzy search, wildcards, etc.) is but one part of a search engine
04:35supersymits tempting...I had a go at Lucene earlier etc, but I might just wanna stick with familiar ground a bit (maps) and not get the extra lib in place
04:35ucbthe most basic search is ala grep with full word matching
04:35supersymit would be for a lein-plugin like dictionary lookup of terms...
04:35ucbit also depends on whether you want any relevance ranking
04:35ucbor whether you're happy with just binary yes|no type of answers
04:35callensupersym: if you can do it more simply than full-text search, go for it.
04:36callensupersym: if you need to perform some evil: https://github.com/noprompt/frak
04:36supersymlol .. thanks callen
04:36supersymucb ;)
04:36ucbfrak is neat
04:36callenevil is neat.
04:36ucbI was wondering if one could build the same type of lib that generated xpath selectors
04:36ucbor even css selectors
04:36supersymoh, frak is cute :)
04:37ucbI know one *could*, I was just pondering on the how
04:37supersymdon't we have css with garden?
04:38supersymI even found a css, half-decent, parser in clojure once
04:38supersymoh,...nvm
04:38supersymgenerate >< goodmorning
04:38supersymyeah I was having the same idea earlier
04:39callenucb: you mean like """<div id="blah"> <div class="woohoo"> <!-- PICK THIS --> </div></div>""" => ["div#blah div.woohoo" "#blah .woohoo"] ?
04:39ucbcallen: yeah
04:39callen...I wouldn't.
04:39supersymwith backtick definitly, I was playing with (Racket) 'formlet' like structures earlier after yogthos pointed me to those
04:39ucbcallen: have you seen open.dapper.net?
04:40supersymgensym can be used with backtick templates
04:40ucbthat's the use case I had in mind
04:40callenucb: I'm aware of it, but I don't really use tools like that.
04:40callenI prefer to write my own plumbing generally.
04:40callenI can see the appeal.
04:40callenespecially if it works consistently and lets you scrape/generate an assortment of data.
04:40ucbright, I was musing myself with building a dapper clone
04:41supersymcallen: sure but there are jobs I have/will have to take that may be lower paying... I don't feel like doing my magic every time
04:41supersyma lot of stuff can, and should for that pay, be templated/boilerplated output I fear
04:41callenif you say so
04:41supersymweb site building world changed quite a bit with companies offering off-shore india/china stuff :P
04:41callenI don't find myself doing repetitious work that often.
04:42callenOTOH, I don't churn out websites for a living anymore.
04:42supersym:)
04:43callenI do do a fair chunk of web stuff at home and work though.
04:46ucbthis is rather neat http://htwins.net/scale2/
04:48supersymucb: sweet, thanks... I've read many many books about that stuff from my 22-28 years :)
04:48ucb:)
04:51callenokay, I am tired. Enough hacking today.
04:52supersymcya callen
04:53ucbenjoy
04:58ucbsupersym: minimal search engine https://gist.github.com/ulises/6255940
04:58ucbsupersym: it produces yes
04:58ucberk
04:58ucbyes|no type matches for full tokens
04:58ucb(I'm sure it can be improved, etc.)
05:00ucbupdated with an example of how to use it
05:47supersymucb: thanks!
07:26mark__I there. I have a project I want to get back to. Unfortunately I can't access the uberjar my project creates. I now tried to make a new uberjar from a new project, but this fails too. What am I doing wrong? (Clojure 1.5.1, lein 2.3.1 on Java 1.6.0_51 mac ox x 10.8.4) The programm I run was: lein new app foobar; cd foobar; lein uberjar; java -jar target/foobar-0.1.0-SNAPSHOT-standalone.jar and the result I got was: Exception in thr
07:26mark__ead "main" java.lang.NoClassDefFoundError: foobar/core
07:49mark__with leiningen 2.2.0 everything works. I found an issue on gh (https://github.com/technomancy/leiningen/issues/1283) but this issue should be fixed in 2.3.1. can somebody reproduce what i encountered?
07:49TEttingermark__, still here?
07:50TEttingeroh hi
07:50mark__yes
07:50TEttingerdo you have any code in foobar?
07:50TEttingerto create an uberjar there are some requirements that may be different
07:50mark__i created a new leiningen project
07:51TEttingeryes
07:51TEttingerthat creates a very small core.clj in foobar
07:51TEttingerit won't have a (:gen-class) in the ns
07:51TEttingerthat might not be needed
07:51mark__it actually has (https://gist.github.com/mren/e1aaa05f4aabd113e6f1)
07:52TEttingerproject.clj has the :main foobar.core
07:52TEttingerright?
07:53mark__right: here is the full output of project.clj and core.clj: https://gist.github.com/mren/e1aaa05f4aabd113e6f1
07:54TEttingertry lein compile
07:55TEttingersee what that outputs
07:55TEttinger^ mark__
07:56mark__lein compile runs without problems, if i try to create a new uberjar after this, it wont find the class, though
07:56mark__what happens when you run lein new app foobar; cd foobar; lein uberjar; java -jar target/foobar-0.1.0-SNAPSHOT-standalone.jar on lein 2.3.1 ?
07:57TEttingerI'm reluctant to touch 2.3.1 after all the hassle people have been reporting
07:58mark__hehe
07:59TEttingeris there an easy way to install and uninstall 2.3.x?
07:59mark__i can switch versions with homebrew on a mac pretty easy
07:59TEttingeroh!
07:59TEttingerlein classpath
07:59TEttingerfind if the classpath contains the wrong folder
08:00TEttingerif it's searching a wrong but close by directory for foobar/core, that could be a clue
08:01mark__looks good to me (src, target included) https://gist.github.com/mren/e1aaa05f4aabd113e6f1#file-gistfile2-txt
08:02TEttingeryeah...
08:02TEttingergeez could this be a :main true thing?
08:03TEttingerin :gen-class
08:03TEttingerI thought that wasn't needed
08:03mark__there is no core.class in the created jar
08:03mark__just the core.clj
08:03TEttingerso it isn't aot ing it
08:04TEttingertry adding :aot :all
08:04TEttingerto project.clj
08:04callenWho controls the content on clojure.org?
08:04TEttingeralso, I'll bring this up in #leiningen
08:04TEttingercallen, aliens
08:04TEttingermade with alien technology
08:05mark__works! thanks
08:05TEttingerwoah
08:06TEttinger:aot is now separate from :main then
08:06TEttingercool, I remember hearing a discussion to do that in new lein
09:22papyrushello ! . i am sorry my poor english. but i have a question. i want to make game using clojure on iphone. is it possible ? i know common lisp can do it but common lisp is not functional. i hate it.
09:30kmicupapyrus: http://keminglabs.com/blog/angular-cljs-weather-app/
09:36papyrusthanks kmicu. but clojure script will be converted to java script . i think it will be very slow. i want to make game.
09:37chwalsanyone ever get a 'cannot open load file: dash-functional' when trying to nrepl-jack-in?
09:39TimMctechnomancy: Sorry for alarming you re: clojure-mode; my emacs is just not seeing it.
09:48pizzasauceis anybody here?
09:49kmicuno
09:51pizzasaucekmicu: thanks. could i ask for some help regarding setting up slime and nrepl
09:52kmicu~ask
09:52clojurebotThe Ask To Ask protocol wastes more bandwidth than any version of the Ask protocol, so just ask your question.
09:53pizzasauceI was able to get repl working with slime, but there is no slime-instructor. Is this normal?
09:58kmicua great alternative to the now deprecated combination of SLIME + swank-clojure.
09:59kmicunREPL is...
09:59pizzasauceand for nrepl, i could not 1) install the package using package.el even though it shows up on package-list. I get the same error all the time: error during dowload: not found. 2) install manually. I get this error: could not open load file, dash.
10:02kmicupizzasauce: Are you fresh emacs user?
10:02pizzasaucekmicu: yes i am. emacs newbie.
10:03kmicuYou should try https://github.com/overtone/emacs-live then.
10:03kmicuEverything works OOTB.
10:03chwalspizzasauce: I just got the error 'could not open load file: dash functional'. fixed it by installing dash
10:03chwalseven though nrepl was working for me yesterday :/
10:04pizzasaucechwals: oh, i need to install dash. thanks!
10:06pizzasaucekmicu: I only have access to emacs23. but thanks anyway.
10:07kmicupizzasauce: https://gist.github.com//robert-stuttaford/6255383 BTW
10:08pizzasaucestrangely, i can't install dash via package either. i go the same error: not found.
10:12kmicupizzasauce: http://melpa.milkbox.net/#installing
10:14pizzasaucekmicu: thanks. for some unknown reasons i am unable to use package to install both nrepl and dash. But cl-lib installed fine. fortunately, i was able to install nrepl and dash manually.
10:17kmicupizzasauce: nrepl and dash are not availabe in ELPA http://elpa.gnu.org/packages/
10:22pizzasaucekmicu: I have melpa and marmalade included in my .emacs file. and nrepl shows up when I list packages. just won't install. but that's ok. manualy install was successful, thanks to the tip from chwals
10:25pizzasaucekmicu: thanks for the link to robert stuttaford's page. very useful!
10:27kmicuMaybe this is related to the latest events https://twitter.com/melpa_emacs
10:29kmicuAnyway happy clojure hacking.
10:34pizzasaucekmicu: that's probably it. thanks!
12:16wolfesHas anyone used html transformation/templating raynes/Lazer ? I'm on a spree of exploring how different clojure templating libraries work and was wondering if anyone wanted to comment on diff between Lazer and Enlive in their use cases
12:57paulswilliamsesqHi - does anyone here use vim fireplace?
12:59ambrosebsya
13:10paulswilliamsesqambrosebs: are you familiar with this tutorial - http://clojure-doc.org/articles/tutorials/vim_fireplace.html ? Reason I ask is that I've followed it, and all works fine except for the cpR and ] Ctrl-D commands to reload-all and navigate to other functions.
13:12ambrosebspaulswilliamsesq: do you want to know something about fireplace?
13:13paulswilliamsesqambrosebs: Just submitted a question - about the tutorial http://clojure-doc.org/articles/tutorials/vim_fireplace.html
13:14ambrosebspaulswilliamsesq: ok cool
13:15paulswilliamsesqambrosebs: I understand that cpR is now deprecate, but I've tried alternatives to reloaded the file, and neit
13:16paulswilliamsesqambrosebs: er seem to work correctly
13:25lynaghkbbloom: have you had any more thoughts on which parts of your asyncx library have turned out to be good/bad ideas?
13:26lynaghkI'm using core.async channels with an application and I really want to attach transforming functions at the read/write points. E.g., to be able to put a Clojure object into a channel and have it automatically be serialized as JSON.
13:27bbloomlynaghk: i never made any sense out of "hot" sources that push things & drop messages if nobody is ready to receive them
13:27lynaghkAs far as I'm aware, the only way to do that right now is to spin up another goblock, but I can't imagine that's optimal w.r.t. perf (and it's definitely not optimal w.r.t. code clarity)
13:28bbloomlynaghk: push sequences, it seems to me, need some inherent buffering/memoization, which i didn't do
13:28bbloomlynaghk: i'm still uncomfortable w/ the "close propegation" idea & there isn't any sensible error handling strategy
13:29bbloomlynaghk: overall, it's pretty half baked & i'm not at all convinced that the Rx model from .NET makes sense for actual use cases
13:29lynaghkbbloom: yeah, error handling is the biggest issue with doing a mapping transformation via a separate goblock---I'd rather just have it throw where I call it.
13:30lynaghkbbloom: do you have any suggestions for my simple use case of making a channel that people can put Clojure objects onto that will be read from the channel as a JSON string?
13:30bbloomlynaghk: just make a loop that reads from one channel, translates to json, then writes to another channel
13:31sventondo you need to know java if you want to learn clojure?
13:31paulswilliamsesqLet's try another one ;) Does anyone use cucumber style tests for Clojure?
13:32sventonI have a ruby background
13:32lynaghkbbloom: ugh, that's what I've been doing but it feels gross.
13:32bbloomlynaghk: why?
13:32bbloomhow is that any different than `cat foo | translate | bar` ?
13:32bbloom:-)
13:32lynaghkbbloom: because now I have an extra channel and goblock to deal with
13:33bbloomlet the GC deal with the go block :-P
13:34shdwprincesventon: You can learn java when you learn clojure
13:34lynaghkbbloom: I'm not really that worried about the pref---mainly it's a semantic issue. I mean, just because we have go blocks now doesn't mean I want to use them everywhere I'd previously used functional composition
13:34bbloommy advice for people trying to develop sensibilities around CSP has been: use channels less frequently than you'd expect to need the, but use a few more actual channels than you'd expect to need per use
13:34shdwprincesventon: its not important where you'll understand java's threads, in java or in clojure, threads is one for both
13:35shdwprincesventon: sometime you'll have to learn some java to learn some parts of clojure
13:36sventonshdwprince: so what you are saying is that I only need to learn some parts of Java ?
13:37Foxboronsventon: You won't really need to learn any java to get into Clojure.
13:37Foxboronsventon: i have no java experience and i get along pretty well writing clojure
13:37lynaghkbbloom: the only alternative I can think of is a macro that expands (>json! c {:my object}) into (>! c (serialize... {:my object}))
13:37bbloomlynaghk: that would couple your serialization strategy to your call site :-P
13:37lynaghkbbloom: but that seems like a terrible idea, and doesn't actually hide it
13:37lynaghkyeah
13:38bbloomlynaghk: instead, let's get to the bottom of your fear of the extra go-loop & we can maybe recalibrate you & determine how to help calibrate others :-)
13:38lynaghkbbloom: alright, fine. I'll go crazy with the channels =P
13:39sventonFoxboron: I see
13:39sventonFoxboron: what languages did you work with before ?
13:39sventonruby ?
13:39shdwprincesventon: its not important, all the same
13:39lynaghkbbloom: I don't know if fear is the right word---mostly I need to know where to put the line between function composition vs. explicit channels/flow
13:39shdwprincesventon: functional experience might be useful here
13:40lynaghkbbloom: so you'd recommend I just use your asyncx's map fn?
13:40bbloomlynaghk: so that's the other thing that tbaldridge & dnolen taught me when i was doing asyncx: the go-as macro is a bad idea b/c composition is accomplished not by function composition, but by channel injection
13:40lynaghkbbloom: I'd rather standardize on one library than reinvent some wheels.
13:41sventonI have some problems getting started and a tutorial for ruby developers should be helpful
13:41sventonlike is a clojure symbol equal to symbols in ruby ?
13:41bbloomlynaghk: you compose two goroutines by giving them a shared channel
13:41Foxboronsventon: Python
13:41bbloomlynaghk: that's different than by function composition
13:42shdwprincesventon: shure its not
13:42bbloomlynaghk: i haven't quite figured out how to get the convenience of go-as without the overhead of manually creating extra arities with an extra channel slot
13:42Foxboronsventon: i'd recommend doing clojure-kaons, some stuff at 4clojure and buy a book
13:42shdwprincesventon: in general cases integer is integer and character is character, but data structures should be different
13:42lynaghkbbloom: what's the problem with go-as for my use case? Isn't that the only thing you can do?
13:42bbloomlynaghk: i think the answer might be to curry channel-processing functions & then have some kind of thread-a-new-channel-as-the-last-arg-to-each macro that does the typical thing
13:43bbloomlynaghk: i'm referring to this macro: https://github.com/brandonbloom/asyncx/blob/master/src/asyncx/core.clj#L59-L65
13:44lynaghkbbloom: yeah, I'm looking at it. Isn't your implementation of map what you're suggesting I do? Create a new channel that contains the json-serialized objects from my original channel?
13:44bbloom(defn map [f in] (go-as out …)) vs (defn map ([f in] (map f in (chan))) ([f in out] ...))))
13:44bbloomlynaghk: notice how the later has an arity w/o the out channel, so the user can supply their own, but there is a default arity for creating an unbuffered standard channel there
13:45lynaghkbbloom: ah, I see what you mean
13:45bbloomi think there needs to a sort of channel->> macro or something
13:45sventonI found an excellent video tutorial at codeschool but after that I don't know where to go
13:45sventonwill give 4clojure a try
13:45bbloomthe real issue is that all the asyncx functions return the output channel, but that doesn't really make sense
13:46bbloomfor one thing, it swallows the "process channel" which can be useful for monitoring to see when a process ends without fucking with other readers on the output channel
13:46lynaghkbbloom: I've been writing things like the second arity with a bang, because they're side effecting.
13:46sventonshould be excellent if I found some ruby / python examples "translated" to clojure
13:46bbloomfor another thing, it means that occasionally you have to do some extra copying b/c you want to get stuff on to a fan-in channel or something like that
13:46bbloomlynaghk: the bang isn't for effects, it's for "unsafe in a transaction" :-)
13:47sventondo you consider clojure to be difficult to learn?
13:47lynaghkanything side effecting is unsafe in a transaction
13:47bbloomlynaghk: not if the effects are idempotent, communicative, undoable, etc
13:48Foxboronsventon: clojure itself isnt hard. The functional way of thinking is harder when you come from a imperative/OO thinking
13:48lynaghkbbloom: good point.
13:48bbloomlynaghk: this is way off topic, but a good example is counting. you can increment an atom, or you can conj an ID into a set & then later take the cardinality of the set
13:48lynaghkbbloom: and in this case, the second arity wouldn't be unsafe because you'd just have multiple go blocks doing the same thing?
13:49sventonFoxboron: I see, have it taken you long time as a python dev to get into the functional thinking / clojure ?
13:49bbloomlynaghk: without thinking about it too deeply, yeah. if you spun off a bunch of processes & nobody every listened to them, then let go of your handle to the channels, then they would all get GCed and that would just be benign wasted work
13:51Foxboronsventon: well, hard to compare as python was my first lang, so it did take a lot of work in the start, and that did help me learn clojure faster in one way. But i takes me no effort to code something up in Python. where in clojure it takes more thinking and planning as it is not that easy to just hack together something that just works instead of a solution that works and is also good.
13:52lynaghkbbloom: https://gist.github.com/lynaghk/6257920
13:52lynaghkbbloom: see any problems with these guys? I tried putting a try/catch in the first one but couldn't get it working with the go block.
13:52shdwprincesventon: in the begining its hard to start thinking functional, but with time you'll get used to it. recursion, for example, almost everywhere will replace iterating, and recursion is more tricky
13:53bbloomlynaghk: seems reasonable.
13:53shdwprincesventon: even after months of active programming in clojure sometimes I finding out intresting solutions in functional style
13:54bbloomlynaghk: appears that the convention is to have the "out" channel be last though, which i see why you didn't do w/ the "into" name and all
13:54shdwprincesventon: its like another world instead of imperative
13:54shdwprincesventon: more logical and well structed
13:54bbloomlynaghk: also, i think in/out are better names, since send/recv are verbs :-)
13:55lynaghkbbloom: I always get tripped up with in/out, since I'm never sure whos perspective it's supposed to be written in
13:55bbloomlynaghk: always the local perspective
13:55lynaghkbbloom: then your signatures are confusing as hell
13:56bbloomlynaghk: how so? if you have signature (map f in out), you use the local perspective of map
13:57lynaghkbbloom: hmm. I'll give the in/out and local perspective a shot
13:57lynaghkmaybe update zmq-async and jetty7-websockets libraries too.
13:58bbloomread it as "map the function f over map's input channel and send the results to map's output channel"
13:58lynaghkbbloom: you have a blog, right? it'd be pretty rad if you wrote all of these conventions up so I could link to 'em
13:58bbloomthink in terms of the process operating on the channels
13:58lynaghkthere or in a gist. just sayin' =P
13:58bbloomi updated asyncx with a link to this irc chat lol
13:58bbloomjust now
13:58bbloom:-)
13:58bbloommainly as a reminder to myself to maybe update asyncx or otherwise document this stuff
14:00seangroveI feel lucky to have watched the conversation
14:00lynaghkbbloom: well, I might take a stab at it myself later today
14:00seangroveGood stuff
14:00lynaghkseangrove: I spend most of my time on the Internet chasing smart people and being confused as hell near them until they dispense wisdoms.
14:00lynaghkwell, in real life too.
14:01shokybbloom: the link points to the wrong place i believe ;p
14:01bbloomd'oh. thanks shoky
14:01bbloomused the wrong footnote number
14:03sventonthanks for your help!
14:03sventonwill take a look at http://clojurekoans.com/
14:21lynaghkbbloom: Updated https://github.com/lynaghk/zmq-async with your in/out naming recommendations.
14:22bbloom::thumbsup::
14:35eggheaddid you just core.async the network lynaghk
14:35eggheadlooks very neat
14:36lynaghkegghead: yeah, I've been kicking around some zeromq stuff and websocket stuff on core.async lately
14:36lynaghkegghead: we'll see how it turns out in practice---it's not a domain I have a ton of experience with (outside of clientside apps, anyway).
14:37eggheadya I built a little hacky websocket channel a while back over goog.websocket
14:38eggheadit wass really interesting to use but I'm not sure how much of an impedence mismatch there was between it and core.asyncs message passing model
14:40eggheadseparating the network layer and async layer looks way cleaner than what I was doing: https://gist.github.com/eggsby/6102537
14:40egghead:p
14:51lynaghkbbloom: why have output channel in the last position? It contradict's clojure's sequence fns
14:51lynaghk*contradicts
14:52bbloomlynaghk: i'm not the authority on this by any means, but it seems like that's the pattern b/c of the other arity leaving the last arg off as optional
14:53lynaghkbbloom: ah, right.
14:54lynaghkbbloom: having a lot of functions that create unbounded channels on your behalf sounds like a recipe for trouble.
14:54bbloomthey are unbuffered, not unbounded
14:54bbloomwhich is like the opposite of unbounded :-)
14:54bbloombut yeah, i'm not completely satisfied w/ that pattern either
14:54bbloomhence the proposal for something like a channel->>
14:56bbloomcould have a higher order fn to do the same as the macro too, something like (call-out map f in) => returns out
14:56bbloomthen the functions could either only have the full arity, or be curried like ((map f in) out)
14:56lynaghkhmm
14:57lynaghkbbloom: I'm wondering if there's a connection with reducers here
14:58bbloomreducers do this w/ the curried args
14:59bbloomit's sorta unfortuante that variable arity & currying don't really go well together, but more than that, function argument order is kinda inherently arbitrary
14:59lynaghkbbloom: yeah, the biggest change I made in zmq-async yesterday was dropping the 4-or-5ish arity for an opts map.
15:00bbloomlazy sequences are kinda like channels that always supply a single out themselves. reducers defer that out supply to the very end, when the expression is forced. channels can have multiple outs and multiple ins, so it makes less sense to force such an automatic supplied conduit through a pipeline
15:00bbloomthat's one of the few things i really miss from Python: * and **
15:01bbloomclojure's handling of kwargs is kinda awkward for non-syntax-level use
15:01bbloomwhat's that clojurebot prompt again?
15:02bbloom~mapply
15:02clojurebotYou have to do something like (defn mapply [f & args] (apply f (apply concat (butlast args) (last args)))), which just goes to show why unrolled keyword args are a bad idea
15:02bbloom:-)
15:02lynaghkbbloom: yeah. I stopped using kwargs for a one-arg map
15:04lynaghkwell, I'm going to try building some stuff with the pieces I have now and see where it hurts
15:04lynaghkand get back to you on nicer syntax idesa.
15:17_zachbbloom: I've been pairing with Kevin and doing some core.async stuff. I translated a few ideas from a recent post into core.async and came up with this: https://github.com/zachallaun/async-pipeline. Looking for someone to tear it apart (the idea, not the code).
15:18_zachThe basic idea is to create a relatively robust process pipeline with automatic restart
15:26bbloom_zach: so the idea is that if you encounter an error, you return that from your loop & that is observed from some parent-level manager of sorts?
15:26_zachbbloom: Yeah, I was hoping to be able to handle errors that the processes identify and actual exceptions in the same way
15:27_zach(the go-try helper returns [:thrown EXCEPTION] in the event of an exception)
15:27bbloomi don't have time at this moment to deeply think about this, but in general, the erlang people are the ones to talk to about error recovery and robustness :-) but i think the overall idea is reasonable, considering hierarchies of supervisors and mutually-dependent observers are basically the only two valid strategies for concurrent/distributed error handling
15:28_zachcool, thanks for your thoughts :)
15:28bbloomand even the mutually recursive thing requires some sort of lowest common anscestor to coordinate that arrangement in the first place
15:29tufflaxI did (eval (symbol "KeyInput/KEY_W")) in the repl and it worked, but then I tried the same thing in a function and I got: "No such namespace: KeyInput" even though I have imported the class. Why?
15:34_zachIt sounds like an issue with the import
15:34_zachthough you may want to question the need to eval
15:41amalloytufflax: eval always happens in a null lexical context, and usually in the clojure.core namespace rather than in the namespace you call it from
15:42amalloyyou really want to use reflection to look up the field, not eval (assuming nothing better is available)
15:42tufflax_zach: yeah now all of a sudden it works hm. The reason I'm doing eval is that a user might specify a key as only "W", but I need KeyInput/KEY_W in that case. Do you have any suggestions?
15:42tufflaxamalloy: ok, well it just started working now, all i did was add (println KeyInput) on the line above
15:43tufflaxamalloy: I tried `resolve` but it didn't work. I guess it doesn't work with Java classes, or at least not the way I tried
15:47tufflaxamalloy: I'm doing this: (eval (symbol (str "KeyInput/KEY_" (.toUpperCase s)))) What should I be doing in this case? I don't really understand how I can use reflection to accomplish the same thing.
15:50amalloytufflax: (-> (.getField KeyInput (str "KEY_" s)) (.get nil)), iirc
15:52amalloyi don't know where KeyInput is defined, so i can't demonstrate that convincingly
15:54tufflaxamalloy: ok thanks I'll try
15:58supersymnice, got a free book tip via prismatic: “Probably Approximately Correct: Nature’s Algorithms for Learning and Prospering in a Complex World ”http://goo.gl/5r9kT3 for any other AI enthousiasts
16:09cjfriszping dnolen
17:04nifffhello room :)
17:05nifffi want to make a parallel map,in a sequence containing 100-200 items,evaluate time differs greatly between them,and the whole time for the map is about 5 sec
17:06nifffhow parallize that kind of sequences?
17:07nifffi tried reduces,pmap doesnt work if i am doing them right....
17:11hyPiRionMight want to use ExecutorServices there
17:53regintonhi
17:53regintonI'm wondering if anyone has any idea what clojure.lang.RT is all about? I've been looking at clojure.core and it keeps showing up...
17:54pandeiroanybody know how to view docstrings in lighttable? is there anything built in?
17:55regintonpandeiro: is lighttable useable yet?
17:57regintonwell, I'll ask again later
17:57pandeiroreginton: that's the question
17:58pandeiroi am doing some complicated (for me) text parsing and decided to try to visualize things with lighttable
17:59pandeiroit has been useful but (with-out-str (clojure.repl/doc some-fn)) is killing me
17:59regintonoh
17:59regintonthat was my only suggestion
17:59reginton:\
17:59pandeiroi thought i remembered docstrings being built in somehow... must have been an old version
18:00regintonactually, I was asking out of curiosity; last time I tried it, a few months ago, it was pretty impossible to use
18:00pandeiroreginton: this is my fourth or fifth serious try
18:00pandeiroi think it's getting close
18:00pandeiroand i am also realizing what it might be good for
18:00pandeiroit doesn't replace emacs or anything
18:01pandeiroi wish it were implemented as a webapp: then it could possibly replace codepen
18:04nifffi want to make a parallel map,in a sequence containing 100-200 items,evaluate time differs greatly between them,and the whole time for the map is about 5 sec
18:05regintonnifff: can you be more clear about what you mean by "parallel" and "in a sequence" and "them" and "time for the map"?
18:05regintonor not
18:07nifffs
18:08pandeiroah ok so lighttable sends *out* to its console, 3 cheers for the faq
18:15seangroveThe clojure syntax thread was already tiresome, but it's completely gone off the deep end now
18:15seangroveI'm not even sure it's coherent anymore
18:15cespareseangrove: link?
18:18seangrovecespare: meh, I just muted the thread, but read through if you'd like https://groups.google.com/forum/#!msg/clojure/N0MKFKd1OXI/Pj_CsZyeQqUJ
18:27bbloomi did like the comment about a diabetic brain
19:06Raynesseangrove: Oh dear, more of that shit?
19:07seangroveRaynes: Way beyond previous levels
19:08Raynesalexbaranosky: You should look at Elixir's macros.
19:08bbloomor Julia's
19:09bbloomi prefer sexprs too, but it's never been true that you needed them for homoiconicity
19:10RaynesRight, he didn't say that.
19:10Raynes"IMO, macros without homoiconicity are unnecessarily complex"
19:10RaynesI'm not sure I agree with that, having worked with Elixir for a while.
19:11bbloomsimilarly, i always found it pretty easy to work w/ expressions in mathematica despite the large amounts of syntactical sugar
19:15lgs32awhere can I find Elixirs or Julias macros
19:15Raynes$google elixir macros
19:15lazybot[5 Macros - Elixir] http://elixir-lang.org/getting_started/5.html
19:15bbloomi'm sure that will work for julia too...
19:15bbloom$google julia macros
19:16lazybot[Metaprogramming — Julia Language 0.2-dev documentation] http://docs.julialang.org/en/latest/manual/metaprogramming/
19:16bbloom(inc lazybot)
19:16lazybot⇒ 19
19:16bbloom(inc google)
19:16lazybot⇒ 1
19:16Raynes(inc bbloom)
19:16lazybot⇒ 13
19:16antares_(inc Raynes)
19:16lazybot⇒ 35
19:16Raynes:D
19:16antares_I thought it would be positive infinity
19:17faust45hi guys
19:17faust45need your help
19:17lgs32ashoot
19:17faust45i want doing something like this:
19:18faust45i have 2 lists of functions A and B
19:18faust45i want make:
19:20faust45[(B1 A1) (B1 A2) ] [(B2 A1) (B2 A2)] [(B3 A1) (B3 A2)]
19:21amalloy(for [b bs] (for [a as] (b a)))?
19:21lgs32a(for [ax A bx B] ['(ax bx)]) ?
19:23lgs32athe last vector really spoils the logic
19:23lgs32awhy not [(B3 A2) (B3 A3)]
19:23TEttinger,(for [b [dec dec dec dec]a [inc dec inc dec]] [(b 5) (a 5)])
19:23clojurebot([4 6] [4 4] [4 6] [4 4] [4 6] ...)
19:24TEttingernot sure what I was hoping
19:24TEttinger##(for [b [dec dec dec dec]a [inc dec inc dec]] [(b 5) (a 5)])
19:24lazybot⇒ ([4 6] [4 4] [4 6] [4 4] [4 6] [4 4] [4 6] [4 4] [4 6] [4 4] [4 6] [4 4] [4 6] [4 4] [4 6] [4 4])
19:25faust45let me try
19:25Chousukeare you sure you know what you want? :P
19:25TEttingererr
19:25lgs32aha i got it
19:25TEttingerproblem with the for and 2 loops is it's flat
19:26`cbpwhat amalloy said was right
19:26faust45i try write dsl
19:26`cbpjust add a vec in that second for I guess
19:26faust45describe chess figure
19:26faust45like this
19:26faust45(deff p (d1 d2) (front back) (attack 1))
19:26`cbp,(for [b '(b1 b2 b3)] (vec (for [a '(a1 a2)] (list b a))))
19:26clojurebot([(b1 a1) (b1 a2)] [(b2 a1) (b2 a2)] [(b3 a1) (b3 a2)])
19:26faust45describe pown
19:26faust45(deff p (d1 d2) (front back) (attack 1))
19:27lgs32adescribe knight?
19:28faust45lgs32a: i, don't think about knight
19:28faust45lgs32a: any ideas ?
19:29lgs32ahonestly i don't understand how you desribe pawn in the first place
19:29faust45(deff p (d1 d2) (front) (attack 1))
19:29faust45(d1 d2) diagonals
19:30faust45only front
19:30faust45and attack only first cell
19:30faust45on each diagonal
19:31lgs32awhat data type is used for d1 d2
19:31faust45d1 is lazy seq
19:31lgs32aof what
19:31faust45of cells
19:32faust45(d1 [3 3]) ->
19:32faust45([2 4] [1 5])
19:32lgs32aah i see
19:32lgs32aand what is front and attack doing?
19:34faust45((attack 1) (d1 [3 3])) -> ('attack [2 4])
19:35faust45(d1 (front [3 3])) and you can (d1 (back [3 3]))
19:35faust45by default (d1 [3 3]) same as (d1 (front [3 3]))
19:36lgs32ahow can you apply a vector on a lazy-seq in (d1 [3 3])
19:36lgs32aah no its a function i understand
19:36faust45d1 is partial
19:37faust45its waiting to xy
19:37lgs32ayes it returns a lazy-seq of diagonal chess fields
19:37lgs32ain one direction to the bottom left
19:37faust45yes
19:37faust45lgs32a: you play chess?
19:38lgs32ayes, can you explain deff?
19:38john2xis there a library for diffing 2 files (same result as git diff)? or should I use something else?
19:38faust45lgs32a: deff its a macros
19:38faust45which i try to write
19:38lgs32atried clojure.data/diff on a line-seq?
19:39TEttingerfaust45, you need to be able to describe jumps (like the knight), fixed movement (like the pawn), and ranging movement (like the rook and bishop) for chess. define functions in your DSL for each of those, maybe just have a map to vectors, like {:ranging [:nw :ne :sw :se]} for the bishop, {:jumping [:knight]} for the knight, because its movement is hard to try to describe...
19:40TEttingeryou can totally do this with lazy seqs of cells, but that won't work for jumping as well, will it?
19:41TEttingerI'm thinking, with only 6 units in chess, it would be easier to code the movements in data rather than as a DSL
19:41faust45TEttinger: what you mean in data?
19:41TEttingerlike just a vector of vector of booleans even
19:42krlrhey, i'm using def-map-type in potemkin, and it seems the assoc method does not get evaluated correctly, instead assoc just associates on the record
19:42TEttingeroh that works. hang on let me find it
19:42krlrhow could i implement an object that responds specially to assoc?
19:43TEttingerfaust45, like this: http://en.wikipedia.org/wiki/Tenjiku_shogi#Individual_pieces
19:44TEttingertenjiku shogi actually needs a DSL-type thing to describe all the movement types
19:44lgs32ayou may want to watch this chess implementation in haskell: http://www.youtube.com/watch?v=ScS8Q32lMxA
19:44krlrTEttinger: I like representing grids like in a game of chess as maps, {[0 3] :rook [4 2] :pawn} for example
19:44TEttingerbut they describe it with just... a 2d vector of "ranging, jumping, fixed, no-move" pretty much for each cell
19:45TEttingerkrlr good idea
19:45krlrthen you get infinite board for free :)
19:47faust45i take a look at http://en.wikipedia.org/wiki/Tenjiku_shogi#Individual_pieces
19:47TEttingerfaust45, see how it can describe almost any kind of movement given a few basic terms?
19:47krlrTEttinger: in chess you could just have a function for each piece-type that returns the possible moves for a given position
19:47faust45TEttinger: no
19:48TEttingerfaust45, I am referring to the grids
19:48krlrdon't think you need dsls here
19:48TEttingerthe terms are the symbols in the grid, which are like what krlr is saying
19:48TEttingerpossible moves from the place you are
19:49faust45TEttinger: yes, but i need calc possible moves for diff places
19:49TEttingerso?
19:49TEttingerit's relative
19:49faust45so i need transfer relative coords to obsolute
19:49TEttingeryeah, that's super easy
19:51adammhhey, core.async question... I just started playing with it a bit and I was wondering if there's an easy way to map values between channels
19:52adammhright now I end up with something like... (go (while true (let [v1 (<! chan1)] (>! chan2 (something v1)))))
19:52adammhwhich seems a bit bizarre
19:59faust45TEttinger: you mean like this?
19:59faust45https://gist.github.com/faust45/6259183
20:00TEttingererr kinda
20:00dnolenadammh: write a channel map
20:01TEttingerfor chess you really only need a 5x5, and just center the grid on the moving piece.
20:01TEttingerlet me try to make an example
20:01adammhdnolen: totally - I just didn't want to write it if it already existed
20:01dnolenadammh: not a part of core.async
20:02adammhcool, thanks!
20:07TEttingerfaust45, you can do it like that, with numbers, and have the number mean how you get there (by jumping or sliding, for example) or have a :keyword that you check when you see what goes beyond that movement. https://gist.github.com/tommyettinger/6259191 there is a simpler way probably, and this type of thing has issues when you figure out what moves beyond the close squares, like from the corner to the other corner.
20:07TEttingerhm
20:08TEttingeryeah, honestly? it's simplest just to hard-code the unit movement for only 6 pieces.
20:08TEttingerknight is too hard to accomodate in a DSL
20:10faust45TEttinger: :range :range mean all possible in this direction on real board?
20:15faust45TEttinger: also need handle pown cases: when pown make first move it can move 2 cells if not first only 1 cell
20:17amalloydon't forget en passant!
20:17adammhTEttinger: also castling
20:20TEttingeryeah a DSL is not going to be able to describe all these special cases without having deep ties to all parts of the code, like has the rook moved yet, for castling
20:25lgs32aexit
20:26faust45TEttinger: and what kind of marks you think i can use :range what else?
20:27TEttingerfaust45, I'm doubting this approach. there's a lot of special cases in chess this can't cover
20:27TEttingerlike en passant and castling
20:29faust45TEttinger: doubting? but what you think can work better?
20:29amalloyfaust45: functions
20:30faust45maybe any one want try pair programming on chess?
20:30amalloy(fn legal-pawn-moves [board pawn-coords] (filter identity [(forward 1 pawn-coords) (when (not-moved? board pawn-coords) (forward 2 pawn-coords)) ...]))
20:30faust45i feel i need a partner on this
20:42faust45nobody want ?
20:42faust45)
20:46TEttingerfaust45, maybe take a look at that haskell video that lgs32a posted http://www.youtube.com/watch?v=ScS8Q32lMxA
21:21seangrovednolen: Where does '("me")' get translated into "me".call(null)?
21:21seangroveI'm specifically looking for how () => .call()
21:22dnolenseangrove: in the compiler that happens in the :invoke case, but it's the analyzer that generates :invoke AST nodes
21:25seangrovednolen: Yeah, just looking through that, wondering where the ".call" text is output. Looks like there's a few different ways, depending on the condition
21:25seangroveJust doing some really big hack-and-slash changes to see if I can get .call off of the String prototype and still have clojure run properly
21:25dnolenseangrove: it's the :invoke case in the compiler that generates .call
21:26seangroveLooks good, thanks
21:27dnolenseangrove: I would really love to get that off the String prototype, keywords as strings needs to die
21:29seangrovednolen: I wouldn't mind (post source-maps) taking a swing at 'proper keywords', if it's written out somewhere
21:30seangroveI'm looking at an email on the ml you wrote about it for people dealing with the same problem I am about the .call on the String prototype, but I'm doing it in a pretty hacky way
21:30dnolenseangrove: keywords, it's not written out somewhere but the idea is pretty simple, we just need to optimize constants (generate a lookup table), soon as we have that we can give .call on String the boot and clean up all the damn special cases around keywords & strings from the standard library
21:33seangrovednolen: Wouldn't that break if I add a string as a key in a map at runtime?
21:33seangrovee.g. (let [k (get-some-external-input) m {k 10}] ...)
21:34dnolenseangrove: break how? (we will probably need keyword-identical?)
21:37seangrovednolen: Could you describe the process of optimizing constants/generating a lookup table, and whatever else it would take to get proper keywords? I don't think I know enough to do anything useful just off of that right now
21:38dnolenseangrove: we need a keyword deftype that looks more less similar to the symbol deftype
21:38dnolenseangrove: then in the analyzer we want to keep a atom of all constants
21:39dnolenseangrove: the compiler can use this to emit references to the constant table
21:40dnolenseangrove: we already have logic for determining whether a literal is a constant or not, we just need record them somewhere
21:43seangroveLooking through the definitions now...
21:53seangroveWhere is -lookup defined? https://www.refheap.com/17725
21:56amalloyseangrove: in ILookup, surely?
21:56amalloyor the cljs equivalent
21:57seangroveamalloy: I'm a little fuzzy on definitely of protocols and their implementations, so likely to ask some silly questions
22:01seangroveSo in the case of this Symbol deftype, the IFn implementation calls out to the -lookup function on the collection. The collection type has to satisfy the ILookup protocol, which is where the actual -lookup implementation happens.
22:03amalloyseangrove: indeed, just like in clj-jvm
22:04seangroveamalloy: Sorry, making my way into the clojure innards by way of the clojurescript compiler, so I'll likely continue making a lot of silly realizations
22:05seangroveClojure on the jvm pretty much does everything I've ever asked of it, so I haven't needed to look inside
22:09amalloyit's a good read all the same
22:11holohi
22:15holoin https://www.refheap.com/17726 can someone paste that def into the repl and check if it's consumed properly? i can't consume it in the repl, but tests against it work fine, so i'm suspecting there is some issue related to the repl
22:18holoa test like this works just fine: (fact (first phonem-maps) => map?)
22:42clj_newb_2345one thing I find missing about Clojure compared to other lisps -- is getting a repl debugger when an exception happens. Now, I understand that this is unreasonable if the exception happens in Java code -- but is it possible to get thte repl debugger at "the top most Clojure function call" ?
22:42clj_newb_2345Actual question: is there any project working on providing the above?
22:44seangroveclj_newb_2345: Isn't that a bit like ritz?
22:45clj_newb_2345seangrove: reading ritz presentation now
22:50ysawej1hi all
22:50ysawej1I was wondering if there is named capture in clojure?
22:51ysawej1http://www.regular-expressions.info/named.html
22:51ysawej1for regex
22:51clj_newb_2345what parts of light table are NOT open source?
22:55ysawej1is named capture for regex available in clojure? http://www.regular-expressions.info/named.html
22:57ysawej1looks like I got it guys... its here : https://github.com/rufoa/named-re
22:58seangroveclj_newb_2345: Everything for the time being, I believe
23:02seangrove"Note well that mutable fields are extremely difficult to use correctly, and are present only to facilitate the building of higher level constructs, such as Clojure's reference types, in Clojure itself. They are for experts only - if the semantics and implications of :volatile-mutable or :unsynchronized-mutable are not immediately apparent to you, you should not be using them."
23:02seangroveThat's a lovely comment
23:05muhoo"reference types"?