#clojure logs

2013-08-18

00:05`cbpcallen: adding dependencies seems straightforward, removing dependencies is the meat of the matter though
00:17callen`cbp: aye.
00:28dnolennew post http://swannodette.github.io/2013/08/17/comparative/
00:29dnolena doozy - ClojureScript + core.async is pure magic, I'm pleased that you can do such a sophisticated UI component cross browser with a stunningly small amount of code.
00:32bbloomdnolen: marketing fail man, gotta post these things on a weekday around lunch time :-)
00:32dnolenbbloom: heh, I'm not gonna push this yet :)
00:32dnolenbbloom: just putting it out there to get feedback, bug reports
00:33bbloomdnolen: you should use a particular git commit for all your links
00:34bbloomotherwise changes to master will break your blog
00:34dnolenbbloom: good point
00:35SegFaultAXdnolen: Awesome, reading.
00:35bblooms/non-deterministically select/multiplex/
00:35bbloomboth are technically correct tho, but i'd rather people actually use the word multiplex
00:35SegFaultAXdnolen: Have you played with RxJava?
00:36dnolenSegFaultAX: yeah I needed use a pretty large variety of techniques, so that's cool and hopefully people get something out of it.
00:36dnolenSegFaultAX: I have not
00:37bbloomdnolen: also where's all your usual syntax highlighting? :-)
00:37SegFaultAXdnolen: Check this out when you have some downtime, I'd be interested in getting your input on it: http://www.infoq.com/presentations/Netflix-API-rxjava-hystrix
00:37dnolenbbloom: I couldn't get RedCarpet to do highlighting correctly with the Inconsolata
00:38SegFaultAXInteresting FRP library based on Microsofts Rx.Net work.
00:38bbloomdnolen: there are like 978357835 static site generators & they *all* suck
00:38bbloomdnolen: i like that you stress that the auto completer process logic is totally isolated from the view
00:38dnolenSegFaultAX: yes, I've heard about it, sounds interesting, but I don't really believe in the Rx stuff in general. This post is about really pushing beyond that.
00:39bbloomdnolen: you have to pay a small amount to get that isolation, but the cost is a tiny percentage & the payoff comes later when you don't have to pay multiplied cost for interaction between many components
00:39dnolenSegFaultAX: subscribe and unsubscribe is a busted model in my opinion, and even in my post I sort of hand wave the cleanup required around DOM listening.
00:39bbloomhigher constant, linear scaling ::thumbs up::
00:39dnolenbbloom: yes, for me this is huge
00:39dnolenbbloom: so many dividends from separation
00:40dnolenbbloom: you can actually read the essential logic quickly, not true for most UI components
00:40bbloomdnolen: i'd be interested in a core.async-based implementation of the event system that's in react.js
00:40bbloomdnolen: i could really use such a nice event layer w/o any ties to a larger library
00:40bbloomdnolen: maybe we should get together sometime & hack on that
00:41dnolenbbloom: definitely!
00:41dnolenbbloom: I sure Tims would be happy to join in as well.
00:41bbloomdnolen: switching to /msg & we can plan something
00:55`cbpwhat's my best bet if i wanna make a webapp with realtime graphs? querying the server with json every few seconds or maybe a websocket? -- im not very good with clojurescript or javascript for that matter
01:08callen`cbp: streaming graphs?
01:09callen`cbp: probably a websocket or some fallback streaming impl. http-kit is one of the better ways to do websockets atm.
01:09callenthat's assuming this graph is streaming in realtime, if it's just paging historical data, http is fine.
01:11`cbpcallen: I basically have atm a clojure app that checks the connectivity of various computers on a network very frequently like every 1-5 seconds and wanna show that in graph form on a browser
01:13callenI guess it depends on how much effort you want to put into it versus how rapid you want updates to me.
01:13callenif batched updates are acceptable, just use http and walk the graph forward one batch update at a time
01:13callenif you truly want "broadcast changes in real-time as they come in", then websockets
01:13callenyou've gotta decide if it's worth the extra effort for the fanciness.
01:14`cbpfanciness is a big bonus :)
01:14technomancywhat about SSE?
01:14`cbpGotta convince people to use clojure because I'm selfish
01:15callenSSE is basically a fallback for websockets, in practical terms.
01:15callenread-only though.
01:15technomancycallen: seems like a better fit if you don't need duplex communications
01:15callenthere's not a lot of point in neutering the implementation prematurely.
01:15technomancythat is; more widely-compatible
01:15callenbut you're right that it more apparently fits.
01:15technomancyyagni?
01:15clojurebotyagni is You Aren't Going to Need It
01:16callenit sounds like an internal tool, cross browser compatibility didn't seem like a priority.
01:16callenif I'm making an internal tool and a coworker says it doesn't work in IE, I just tell them to use a browser that isn't third world.
01:17`cbpitll be fine if it runs on chrome only
01:17technomancyis it really just IE? I thought it also interfered with caches and stuff
01:18callentechnomancy: you mean websockets?
01:18technomancyand one of them was https://github-percentile.herokuapp.com
01:18technomancyyeah
01:18cgagwhat do you mean by "use http and walk the graph forward"
01:18callentechnomancy: you don't use websockets for things that should be cached. 4rlz.
01:19callen67% of Github employees have had an account longer than bitemyapp has. - god dammit.
01:19technomancyweak
01:19callen5% of Github employees have had an account longer than technomancy has. :|
01:20callentechnomancy: I don't think you're including the newer employees.
01:20callenI've definitely had a github account longer than half of them overall.
01:20technomancycallen: it's just using the public orgs API
01:20technomancyI think members can choose not to publicize their membership
01:20callengiven that, I feel worse :(
01:21technomancyanyway, yes, 50% of the web sites I've created in the past five years have been to show off
01:21`cbpcgag: like make an http request every few seconds get some json and update the graph I assume
01:21callentechnomancy: proper.
01:21technomancythough I guess amalloy wrote like half of that one
01:21callen`cbp: yep!
01:21callencgag: sorry for using hooman words :(
01:21amalloytechnomancy: like 25%
01:21amalloyusing, iirc, a suggestion/starting-point from you
01:21technomancyamalloy: 33% and we'll call it a deal
01:21cgagah i see, i didn't see how you could push updates using just http
01:21amalloysold
01:22callencgag: just a poll.
01:23amalloytechnomancy: only 50% of your websites were to show off? that puts you way below the norm
01:53`cbpanyone got a link to some crazy project.clj with extra maven repos on it?
01:54lynaghk`cbp: https://github.com/technomancy/leiningen/blob/master/sample.project.clj
01:55`cbpthanks
01:59amalloy`cbp: also, `lein help sample`
02:00`cbpoh very good
02:17piranhaclojure has nothing like pdb/gdb, right? Can I put some call in a middle of a code, call tests and get an interactive debugger prompt?
02:18dnolenpiranha: ritz
02:18piranhadnolen: thanks, will look
02:24piranhadnolen: it seems it doesn't want to set a breakpoint :( When I press C-c C-x C-b it says 'Set 0 breakpoints'... :\
02:24dnolenpiranha: I don't use ritz, but it sounded like what you were looking for
02:25piranhayeah, it sounds like what I want, it just do it... :( Thanks anyway!
02:42callenpiranha: ritz doesn't work super well and is really awkward to use. debug-repl, if all you need is locals, might be better.
02:42callenpiranha: Typically, 1% - 5% of the stuff has any commercial value. There might be jewellery, an antique or two. I can usually get $100 for a working fridge. Unfortunately we live in a disposable culture - we are geared to buy new rather than re-use old.
02:42callensorry
02:42callenmispaste :(
02:42callenpiranha: http://www.clojure-toolbox.com/
02:42callen^^ there.
02:43piranhaah nice
02:43callendnolen: don't recommend Ritz unless it's hardcore JVM debugging, if they ask for something like pdb debug-repl is probably a better first place to look.
02:43piranhacallen: so I can just put a call to debug-repl in a middle of a function and that's it? :)
02:43piranhaheh :)
02:43callenpiranha: yes, but it only captures locals
02:43callenon the bright side, it behaves like a ghetto pdb. you just evaluate code.
02:44piranhathat's manageable :)
02:44piranhayeah, that's what I need mostly
02:44callenwasn't for me when I needed to check something :P
02:44piranha:))
02:44callenbut yeah, debug-repl at least keeps me sane for now. Ritz I've managed to make work but there's a lot of fear and loathing involved.
02:44piranhaI just can't read java properly and doing a front-end for java is hard, it would be much easier if I could mess with things inside of a repl
02:44callena "best of both worlds" would be killer.
02:44callenpiranha: I'm the same way.
02:52callenpiranha: fair warning, jahad's debug repl doesn't work. prolly have to use mine.
02:53piranhacallen: you mean clojars.org/debug-repl is not working?
02:56callenpiranha: it didn't for me. https://clojars.org/debug-repl should work.
02:57callenthe "real" debug-repl is on Jahad's account.
02:57piranhaah ok
02:57callenI preempted him and took the flat namespace so people wouldn't keep accidentally running into his buggy version.
02:57callenI'll decorate it if/when he chooses to notice his shit is broken.
02:58callenif I get a nice bottle of scotch, I may even figure out a way to add globals.
02:58piranha:-)
02:59callenI am not a fan of stacktrace based debugging like Ritz, and its particular implementation of it is particularly painful to use.
02:59piranhaeh, java is hard :( everything's good except it's not working properly :\
02:59callenthese weren't problems in Common Lisp, but I still love Clojure enough that it's worth it.
02:59piranha:-)
03:00wolfesare there libraries for better debugging in clojure?
03:00callenRitz is the most "serious" but it's annoying to use
03:00callendebug-repl is the closest thing to ipdb/pdb/pry
03:03callenanother thing to be aware of is locals clearing.
03:04wolfesI've been exploring different templating options (me.shenfeng's mustache, enlive, and lazer), are there other options anyone would recommend exploring / things to be aware of about these libs?
03:04callenwolfes: Selmer.
03:05SeanCorfieldwolfes: have you looked at Fleet?
03:06wolfesSeanCorfield: not yet, looking now
03:06SeanCorfieldat World Singles we use Enlive so we can use plain HTML templates and have designers work on them too, but Fleet looked very interesting too...
03:06callenFleet is not maintained.
03:06callenand it's JSP style, turns into spaghetti quickly.
03:06callenwolfes: you seriously should look at Selmer.
03:07SeanCorfieldcallen: I've been tempted to help maintain Fleet. I don't think it provides enough "code" to enable spaghetti but YMMV.
03:07callenSeanCorfield: please try Selmer before doing so.
03:07callenSeanCorfield: I'm serious, it's got just the right balance of cleanliness, power, and it makes it easy to know where data came from.
03:09callenI should just write a blog post explaining this and be done with it.
03:11wolfescallen: looking at selmer, django templates were one of the few parts of django i never actually worked with (my server was entirely ajax based) — is there someplace i can read more about the design choices behind the templating approaches (add code to markup, eg django/selmer), (add vars to markup for code to replace), (create html entirely through functions ) and (transform markup with selector/functions: eg enlive/laser)
03:11callenwolfes: I've been using Django and Jinja based templates for years. Although Selmer isn't identical, virtually any Django/Jinja documentation would serve as a good introduction.
03:11callenhttp://jinja.pocoo.org/docs/ comes to mind.
03:12wolfescallen: thanks :)
03:12callenwolfes: I've used Enlive, Laser, Hiccup, etc. Selmer has made me happiest.
03:12callenand it's efficient, comparable to Stencil (mustache library by dsantiago)
03:13callenwolfes: if you have any problems with Selmer, make a github issue or bug yogthos or myself in here.
03:13wolfescallen: what were the sticking points / difficulties / things that could be better - that you encountered with the other libraries?
03:14SeanCorfieldcallen: been reading the Selmer docs... it does look quite nice... maybe I'll figure out how to make FW/1 work with Selmer as well as Enlive... :)
03:14callenwolfes: usually it's one of a few design priorities.
03:15callen1. You should know roughly what the final render is going to look like JUST from the template. You shouldn't have to check 7 different files to know what it'll look like
03:15SeanCorfieldFW/1: https://github.com/framework-one/fw1-clj
03:15callen2. You should know where all/most of the data in the template is coming from.
03:15callen3. A muggle should be able to read, if not also modify, the template and not have things blow in their face.
03:16callen4. The template semantics should be powerful enough that you don't need to shove common-case things like "turn this into a date" into backend code.
03:16callen5. You shouldn't have to know what a parser combinator is in order to use the library.
03:16wolfesSeanCorfield: how do you like enlive's selectors? ooc have you tried lazer (very similar to enlive, but has functions for selectors instead of vectors of selectors)
03:17callenEnlive violates 1, 2, sorta 3, 4, and 5. Laser is simpler than Enlive but violates the same principles. Hiccup violates 1 if you're not a Clojure programmer and forces you to look at backend code, also violates 2 and 3.
03:17SeanCorfieldwolfes: I live Enlive's approach insofar as it matches "regular" CSS operations in many JS frameworks
03:17callenMustache based libs violate 1, 2 if they're being clever, and 4.
03:18callenoh and here's another, 6. Backend code shouldn't be tightly bound up in the HTML structure or selectors of the frontend template.
03:18SeanCorfieldHiccup is definitely a problem if you want designers to be able to work on your web pages :)
03:18callenwhich enlive and laser code violates prolifically.
03:18wolfescallen: ahh, interesting :)
03:18callenrefactor a template class? boom goes your backend code that expected it to exist.
03:18callenshit will just disappear because your frontend guy wanted to clean house.
03:19callenThat's unacceptable and creates too many "fuck you" scenarios for templating. It should "just work" and not have unpleasant surprises via spooky action from a distance.
03:19wolfesyeah, what if you use a layer of abstraction over your template code so your backend code has no idea about them?
03:19callenwolfes: Selmer.
03:19callenjust use Selmer.
03:19callenseriously.
03:19SeanCorfieldcallen: I kinda like keeping the DOM injection logic in the web controller but I agree that FE designers might accidentally remove special CSS. What do you think of AngularJS using ng-* annotations?
03:20callenSeanCorfield: I have no problem with AngularJS, their HTML attrs shouldn't interfere with what anybody else is doing.
03:20callenSeanCorfield: also, the AngularJS stuff...is for frontend, and is *IN* the template unlike Enlive/Laser.
03:20callenthe person modifying the template can *see* it.
03:20callenthe backend code simply shouldn't have anything like an HTML class in the code. that's insane.
03:21callenplus, if you use Selmer, fundamentally all the backend controller is doing is returning an associative data structure (map)
03:21callenone of the nice properties about that this is that you get the frontend template *and* a JSON api for free.
03:21callenbecause you're just getting a map and choosing whether to pass it to a template or a JSON render.
03:21SeanCorfieldcallen: methinks you're a little too aggressive in evangelizing your preferences :)
03:22callenSeanCorfield: I'd be less aggressive if the rest of the Clojure community wasnt in the
03:22callentemplating third world
03:22piranhawell he's quite a bit right, since having html code and then what you put in there is a recipe for hard life
03:22callenI'm much more circumspect when the trade-offs are closer to being par.
03:22callenbut when it's this blindingly obvious and bad, I have no desire to accommodate barbarism.
03:23callenSeanCorfield: I'm pretty certain that if you used Selmer you'd be happy. :)
03:24SeanCorfieldlike i say, i'll look at integrating it with FW/1...
03:25callenSeanCorfield: what's FW/1 anyway?
03:25callenshould I be watching your github more closely or what?
03:25SeanCorfieldit took me quite a while to figure out how to integrate Enlive... Selmer looks easier...
03:25callenaha, framework-one
03:26SeanCorfieldFW/1 was first created for CFML and is the most popular MVC framework there, so I ported it to Clojure a while back
03:26callenSeanCorfield: it's not just easier though, it's still powerful through the use of custom tags and filters. It's also easier to maintain and scale up.
03:26callenalso, I'll be moving to SF soon. Are the Clojure meetups still a thing there?
03:26SeanCorfieldas World Singles moves from CFML to Clojure, I figured it would be good to move our preferred web framework from CFML to Clojure too :)
03:27SeanCorfieldcallen: we have a monthly Dojo, a monthly SF meetup and a monthly San Mateo meetup
03:27callenI'm still in Mountain View at the moment, but I'll be living la vida airbnb soon.
03:28SeanCorfieldMV is hardly far... you could easily attend the SM meetups :)
03:28SeanCorfieldor did we have this convo?
03:28SeanCorfieldI drive to meetups in MV from the East Bay :)
03:28callenprolly. I'm just saying that I'll be able to attend more regularly soon.
03:28callenSeanCorfield: where's the best place to see the meetup announcements? meetup.com?
03:29SeanCorfieldI'm out of the country for the October SF meetup so Amit will run that... he'll probably run the September meetup too
03:29SeanCorfieldsign up on the meetup.com site (that seems obvious)
03:29SeanCorfieldhttp://www.meetup.com/The-Bay-Area-Clojure-User-Group/
03:30SeanCorfieldthere's both a message board and a mailing list
03:30callensweet. When did you guys switch from Weatherbill to Thoughtworks for location?
03:31callenoh wait, there are two...oky.
03:31callenokay*
03:31callenderp.
03:32SeanCorfieldWeatherbill became Climate Corp who host the SF and Seattle meetups
03:32SeanCorfieldRuna host the SM meetups
03:32SeanCorfieldThoughtWorks host the Dojo
03:33callenThoughtWorks is the consultancy that does Rails and Clojure right?
03:33RaynesOla Bini works there.
03:33RaynesThat's all I know about them.
03:33RaynesOh, and they have that weird "here's the technologies you should adopt" thing every once in a while.
03:33RaynesWhich always makes me wonder how they became the authority on the merits of budding technologies.
03:34SeanCorfieldThoughtWorks turn out in force at Clojure conferences - and Strange Loop :)
03:34RaynesBut I do <3 me some Ola Bini.
03:34RaynesIoke was good fun -- too bad it was slow as balls. :(
03:34callenRaynes: if they're promoting Clojure, I'd say go with it until they find their next favorite freeze-pop flavor.
03:34SeanCorfieldRaynes: their "Technology Radar"... many people in the iT industry take them pretty seriously
03:34RaynesI'm aware, which is why I'm suddenly curious why they are taken seriously.
03:34RaynesDon't really know the history of it.
03:36RaynesI mean, I don't have any problem with it and generally agree with the things the radar thingy says. It's just curious.
03:36SeanCorfieldMartin Fowler is influential :)
03:37Raynes$google martin fowler
03:37lazybot[Martin Fowler] http://martinfowler.com/
03:37winkconfirmation bias
03:38SeanCorfieldFrom what I have seen, TW does pretty much every language their clients want, but they favored RoR for a good while and many of them favor Clojure now, although they don't get to do as many Clojure projects as many of them would like...
03:38winkI pretty much agreed with the last 2 radars as well :P
03:38SeanCorfieldIt's interesting sometimes what they think is worth "the enterprise" taking a look at...
03:39SeanCorfieldI was surprised they'd gotten RoR into the enterprise and use it so often :)
03:43callen"Promises for asynchronous programming" I like these people.
03:45callenOTOH, they also say to adopt MongoDB. lol.
03:46wolfesdoes them saying adopt neo4j make up for that at all?
03:48callenmeh. I know why people are keen on MongoDB, but they'd be better off with something like RethinkDB.
03:48SeanCorfieldSome of the TW radar stuff is blindingly obvious common sense, but some of it is a little bizarre.
03:49SeanCorfieldcallen: what don't you like about MongoDB?
03:49callenSeanCorfield: it's fine for data you don't care about very much. I've done multiple non-trivial commercial projects in it. It's usually not worth it.
03:50callenEither you end up needing transactions, a more powerful query language, aggregations that don't suck, or a document store that doesn't suck.
03:50callenRethinkDB -> document store that doesn't suck, the former three criteria fall to something like PostgreSQL
03:50callenanybody that actually needs a serious way to store sparse data shouldn't be using MongoDB *or* a SQL database. That's HBase/Cassandra.
03:51SeanCorfieldThere are lots of data stores. Use the appropriate one for your problem.
03:52callenoh sure, but that's the problem.
03:52callenby any criteria one could use to justify the use of MongoDB, there's usually a better alternate option.
03:52callenWhether that be schema-free, document store, ease of use, or anything else.
03:52callenThis comes from years spent using MongoDB, not technological snobbery.
03:52callen*years* of horror.
03:53SeanCorfieldMongoDB works very well for us - we have documents with nested subdocuments and the aggregation framework works well for us too...
03:53callenin that sort of use-case, I'd just use PostgreSQL and a normalized schema, but if it works it works.
03:53callenI'm not saying MongoDB can't possibly work, otherwise my aforementioned projects where I used it would've failed
03:53callenI'm just saying there's usually a better option.
03:53SeanCorfieldagain, you're being very aggressive about your preferences - it doesn't do your reputation any favors since you sound very biased
03:54callenI think you're misinterpreting, "you could probably do better" for "MongoDB sends your data to /dev/null"
03:54SeanCorfieldwe specifically do NOT want a normalized schema ... that's why we've been migrating away from MySQL
03:54wolfesfwiw i don't think callen is being overly aggressive here
03:55callenthe other thing about MongoDB, is that the more of its functionality you use, the more pain you're in for.
03:55callenIf you have a simple Master/slave setup, you're probably okay.
03:55callenif you start using sharding, you're in for some more pain, but it might work out.
03:55callenif you use replica sets, you'd better be ready to pay 10gen a lot of money to fix your database.
03:56SeanCorfieldThat's not the story I've gotten from a lot of people using MongoDB that I've spoken to at conferences over the last three years
03:56callenit's important to realize that most people for whom MongoDB works fine for, aren't demanding very much of it. Part of the point of thinking carefully about how you structure data and what database you use is knowing where you're likely to "push" it and what databases will handle that better than others.
03:56callenSeanCorfield: do you follow Aphyr at all?
03:56SeanCorfieldHow many MongoSV and MongoSF conferences have you attended?
03:57callenSeanCorfield: his jepsen series was pretty good and he covers the data loss scenarios of various data stores, including MongoDB.
03:57SeanCorfieldURL?
03:57callenPromises for asynchronous programming
03:57callensigh.
03:57callenmispaste...again.
03:57callenhttp://aphyr.com/tags/jepsen
03:57callenthere is something egregiously wrong with my clipboard, I wonder what's up with that.
03:57SeanCorfieldthanx ... will read ...
03:58callenas I said, if MongoDB works fine, okay, but if you reach an inflection point where you might need/want to reconsider your choice of database
03:58callen...give something (not :MongoDB) a real look.
04:00wolfeshttp://aphyr.com/posts/284-call-me-maybe-mongodb
04:03SeanCorfieldwe're open to various technologies... we're already running cfml + clojure + mysql + mongodb + netty/socket.io as well as apache / tomcat and a custom search engine and a ton of 3rd party web services :)
04:05wolfesare there other graph databases that play well with clojure besides (clojurewerks' neocons lib for neo4j)
04:05callenSeanCorfield: you should /nick DoktorFrankenstein
04:05callen ;)
04:05callenwolfes: I think there was an experiment with a graph-db *in* Clojure but don't hold me to that. Can't really remember it very well
04:05SeanCorfieldpolyglot ftw :)
04:06wolfesooc, do you guys use vim/emacs/sublime/light-table/other?
04:09shdwprincewolfes: using vim, used sublime-text in the past
04:10wolfesshdwprince: do you use any plugins to control your browser from vim?
04:12callenwolfes: Emacs
04:12SeanCorfieldwolfes: Emacs
04:12shdwprincewolfes: humm.. while developing? Currently i'm not involved in webdev, so I dont. Anyway, my primary browser have vim-like behavior
04:13SeanCorfieldwolfes: my team have also mostly switched to Emacs ... I have one hold out on Sublime Text 2 :)
04:15wolfesSeanCorfield: how do you go about the "change code" … "reload page in browser" cycle?
04:16wolfes(assuming you do some type of webdev)
04:17SeanCorfieldwolfes: that's CFML basic mode :)
04:17callenwolfes: auto-reload is a thing with Ring based web dev in Clojure.
04:17SeanCorfieldand integrating Clojure into CFML, we create a clojure.lang.RT instance and load everything when we load the app - and just have a URL parameter to force an app reload
04:18callenyou...don't need to resort to that if you're using vanilla Ring.
04:18callenapp-reload exists with lein-ring and http-kit, etc.
04:18callenit detects when files change and auto-reloads.
04:18SeanCorfieldwolfes: World Singles has a dating platform with 50+ sites in about a dozen languages
04:18shdwprincewolfes: few days back I read about emmet-livestyle, its a bridge from sublime to chrome, for autoreloading
04:18SeanCorfieldand 4M users :)
04:18wolfesim using ring's reload method, plus a few others i picked up looking at me.shenfeng mustache impl
04:18callenSelmer auto-reloads too.
04:19cgagi just switch windows and hit ctrl+r
04:19wolfesive been working on a vim plugin that lets me reload any chrome browser with my chrome extension setup to chat with my clojure server
04:19cgaglike a sucker apparently
04:19wolfeswas wondering what else i should add to it
04:20wolfesi can name tabs on the browser-side of things, and open/reload the named tabs from vim/bash/anything that sends http post reqs
04:22Rayneswolfes: Geni develops a graph database *in* Clojure: https://github.com/flatland/jiraph.
04:23Rayneswolfes: However, the documentation is almost completely worthless right now.
04:23RaynesJiraph has mostly been rewritten over the past two years, and we haven't gotten around to updated/good documentation yet.
04:23RaynesBut there she blows nonetheless.
04:24callenaha, that's what I was thinking of.
04:24callenRaynes: do you remember why that was done instead of Neo4j?
04:24wolfesRaynes: thanks! also, neat looking library! (Lazer) - i've been looking through templating libraries and like enlive/lazer the most so far, but callen presented some convincing arguments for Selmer-like templating
04:24Raynescallen: Yes, they needed revisions which neo4j does not do.
04:24Rayneslaser with an s.
04:24wolfesoops, right :)
04:24callenRaynes: that's interesting.
04:26SeanCorfieldcallen: https://github.com/framework-one/fw1-clj/issues/8
04:26SeanCorfield:)
04:26SeanCorfieldnow i'm off to bed
04:26SeanCorfieldsee you at a future bay area meetup i hope
04:26callenSeanCorfield: prolly the September dojo and meetup.
04:27callenI'll be Airbnb'ing it by then.
04:27wolfesRaynes: I've explored enlive enough to try it's clone-for transform, and was wondering how you approach templating to avoid needing to have followup selector/transforms affect previously cloned fragments
04:28RaynesYou're asking why laser doesn't have clone-for?
04:28SeanCorfieldcallen: looks like two dojos in september - the late august one has moved to early september
04:28callenI'm going to the SF one two days before the meetup.
04:28SeanCorfieldand i may not be at the september meetup proper (on the 6th) due to conflicts
04:28callenSeanCorfield: has learning to use Emacs come up again in the meetups/dojos at all?
04:28SeanCorfieldcan't be at the october meetup... due to being in england for a cat show :)
04:28callensorry, you meant to go to bed.
04:29wolfesraynes: not quite, more about why when a previous transform returns a seq of nodes, following transforms don't get to operate on the whole seq, but only start at the last node in the seq
04:29SeanCorfieldcallen: oh yeah, getting up to speed on emacs has been a past topic - but 70% of the meetup audience uses emacs now i think
04:30callenSeanCorfield: the meetup I went to two years ago was the one where we got people rolling with Emacs.
04:30Rayneswolfes: Because I've never actually seen code that had that requirement and doing it is pretty hard.
04:31RaynesLaser was aiming for simplicity.
04:31SeanCorfieldcallen: ok, yeah, i remember that in weatherbill's old location
04:31RaynesDoing that would make it far less simplistic
04:31wolfesMakes sense :)
04:31callenwolfes: what do you need clone-for for?
04:32SeanCorfieldwe use clone-for to inject profile data into our html email - each email can have 4 or 8 profiles embedded
04:32wolfesa simple example was cloning a button, and then in a follow up transform applying class="active" to the i'th button, but i suppose you could do that in the button cloning transform
04:33wolfesthis was a really simple example that i put 0 thought into just to see something work with enlive, and probably would be much better not relying on the index of the button when applying the class
04:34SeanCorfieldi'd probably do that via JS directly in the client...
04:35callenwolfes: that's a for loop in Selmer, but it sounds like something that would suit JS as well depending on the details of it.
04:35SeanCorfieldclone-for is probably the thing i like least about enlive
04:36SeanCorfieldpeace out zzz
05:55callenso I'm using Eclipse + CCW for the third time. This is deeply puzzling.
06:17clj_newb_2345I'm reading about coq dependent type checking. In particualr, google found https://sympa.inria.fr/sympa/arc/coq-club/2013-02/msg00041.html
06:18clj_newb_2345which leads to teh question: what is ssreflect, and how does it relate to dependent types?
06:19callenclj_newb_2345: this is #clojure
06:19clj_newb_2345I'm sorry
06:20callenjust making certain your question got the right place.
06:20clj_newb_2345callen: good call, otherwise I'd been waitin and wondering why no response
06:27noncomhi, i'm developing a lein plugin. as adviced in the writer's manual, i add the src path of the plugin project into the .lein-classpath file in the projects folder. however, when i start "lein" there, it says "Error: Could not find or load main class ;C:\Users\Admin\.lein\self-installs\leiningen-2.2.0-standalone.jar"
06:27noncomwhat's wrong?
06:31callennoncom: you should aim that query that someone or otherwise be more specific.
06:33noncomcallen: well, technomancy could probably propose something, but looks like he is not at here now.. otherwise this is as specific as it could be.. a simple plugin done by tutorial.. probably something generic.. looks like it somehow breaks classpaths so it cant find the lein exec itself..?
06:34callenoh, sorry
06:34callenI didn't see the same person raising the issue with the lein plugin was you asking what's wrong
06:34callenmisread, my fault.
06:35noncom:)
06:48noncomlooks like my lein version is a bit old, i'll try upgrading
06:48callennoncom: good call :)
06:56noncomso i tried that and now it simply ignores the .lein-classpath file, and if i "lein install" in the plugin project, then it goes to the local repo, but is not listed as a task
07:03nifffi hava a lazyseq how to force the production of each member?
07:03nifff(doall ) ?
07:04nifffi can do it with (into () lazy-seq) but its changes the type also
07:08IamDrowsynifff: depends. if you want to keep the hole seq you can use doall. if you don't care about the whole seq and just want it to be realized (e.g. for side-effects) you can use dorun.
07:12noncomhmm.. tried adding the plugin into .lein/profile.clj under user/plugins and it still does not show up in the list of available plugins although it is present in the .m2 folder
07:14callenHas anybody gotten this plugin to work? https://github.com/pyronicide/lein-autoreload
07:15callenit spits stuff out that looks plausible, but when I run run-tests or run-all-tests it's using whatever I loaded manually last.
07:16piranhado I understand correctly that 'slurp' should just read any stream and return everything this stream contained?
07:16callenpiranha: yes
07:16piranha:\
07:16callenpiranha: usually you're passing a file handler though
07:16callenpiranha: what's up?
07:16glosoliHello folks, I have some sort of dumb question, I got confused why defining function with def or defn doesn't seem to differ much ?
07:17piranhawell it's either I don't understand java or ... no idea
07:17callenpiranha: are you opening something in proc?
07:17piranhacallen: I'm trying to write an undertow (http://undertow.io/) adapter for ring, and it's not giving me body of request
07:17callenglosoli: defn is sugar, use it for top-level functions.
07:17piranhaand when I try to slurp input stream from there it's indeed empty
07:17piranhaso this is really strange
07:17callenpiranha: hold up
07:17callenpiranha: why are you writing an undertow adapter?
07:18piranhacallen: just for fun
07:18piranhais there one already?
07:18callenokay, but be aware that http-kit exists
07:18callenhttp-kit isn't undertow, but serves the same needs.
07:18piranhayeah, I know :)
07:18callenwebsocket, async, high performance, etc
07:18callenjust making certain.
07:18glosolicallen: so it's actually just a sugar with no sort of extra capabilities ?
07:18piranhaah, right, that was just for fun :) so that I could learn a bit of stuff
07:19piranhabut in the end I can't make it work properly - everything's ok except for this inputstream stuff, and by their tests it seems like everything should be ok
07:20piranhajava is so verbose that it's hard to track things :\
07:20callenglosoli: why not just look at how it's implemented?
07:20noncomglosoli: defn is more than def+fn, but it has nothing that you couldn't make yourself with clojure. just look at the source
07:21piranhacallen: I actually tried to run hello-world under both undertow (with this my unfinished) and http-kit and second is a bit faster, but I think that's because http-kit cheats and implements everything in java :-)
07:21glosoliok thanks, gonna do that, not used to doing that so kinda did not even think of it
07:22callenglosoli: in Clojure, the original source code of your libraries and even the language are generally pretty readable. You'll learn to get comfortable reading other peoples' code, even for non-trivial things.
07:22callenit's not like CPython, Ruby MRI, or anything like that where the language implementation is impenetrable magic that requires a background in C and VM implementation.
07:22callenlol *PyObject
07:27glosoliConsidering my lack of knowledge, I did read some other people code already, and it really felt like readable enough to understand implementation, so yes, so far I am enjoying Clojure
07:34supersymglosoli: I didn't know any functional programming or Lisp before I started clojure... you'll get the hang of it indeed
07:35supersympersonally, I like to use monads a lot for exactly the purpose of readability
07:35glosolisupersym: Emm I don't even know what monad is yet..
07:35supersymits like a pipeline for functions
07:38supersym,(first (take 2 (list 1 2 3 4)))
07:38clojurebot1
07:38supersymso stuff can get rather unreadable at times, so you could also write
07:38supersym,(->> (list 1 2 3 4) (take 2) (first))
07:38clojurebot1
07:39supersymand just position them vertically, instead of one line like I did here
07:39supersymthe value gets piped through those functions on the last argument
07:40glosoliHmm so that's monad ?
07:40callenglosoli: no.
07:40glosoliNah I should seriously read about it, sorry :)
07:42supersymcallen: not? threading macro, I thought was a monad... guess I dont know stuff either :P
07:42callenit's not a monad.
07:42callenit solves a similar'ish problem as you could potentially use a monad for
07:42callenbut it's not a monad.
07:43callena monad obeys the monad laws, and has bind and return.
07:43supersymok well the wikipedia definition is broad enough
07:43supersymright
07:43supersymanother thing learned.. :)
07:44callena monad, put as simply as I think I can muster, is a way to contextualize a series of operations. Bind and return are about entering and exiting that context.
07:45supersymah
07:45supersymI see
07:45callenor more accurately, passing data into, and receiving data out of that context.
07:45supersymno binding taking place here
07:45callendon't
07:45callendon't conflate words.
07:45callen"bind" in monads is not "bind" in Clojure.
07:45supersymok
07:46callenit's best to just read up on it.
07:46callenI'm not giving another monad tutorial.
07:46supersymhaha no worries... already on it
07:50supersymguess as good a time as any to learn the ropes of algo.monads
07:51callenI'm not sure that library is a good way to learn how monads work.
07:52supersymnah but to practice and learn probably, a lot of examples use haskell and although I get it a little, I don't feel like hashing through those since I plan to stick with Clojure anyway
07:53supersymwe'll see
07:53clojurebotExcuse me?
07:57shdwprincewe'll see
07:57shdwprincehumm
08:16piranhasupersym: if you care about monads you might be interested in looking at fluokitten
08:19supersympiranha: thanks for the tip
08:52jtoywhat does the pound at the end do? I know what they do in macros, but ive never seen them in a function like this: (map (fn [[date# list#]] [date# (count list#)]))
09:00callenjtoy: I could tell you, or you could learn by trying it in a repl.
09:00callenjtoy: is that from a macro?
09:08callenjtoy: generally trailing # is use to automatically gensym a name in a macro so as to keep the macro hygienic.
09:14jtoyit wasnt a macro though
09:32jcromartieWhen using Emacs Live and nREPL, how do I make C-c C-z open the REPL in the *other* window
09:32jcromartieit used to do this with plain vanilla Emacs + nREPL
09:39functional_lunatAnd do M-x nrepl jack-in
10:01crocketDoes ClojureScript have a working sourcemap?
10:01callencrocket: probably in seangrove's wheelhouse. I think it's out there.
10:54germanmushroomI'm trying to have some fun with clojure and overtone and got stuck at something probably really basic
10:55callengermanmushroom: don't ask to ask, just ask.
10:55germanmushroomWhy does (dotimes [i 10] (+ i 200) return nil? I'd like to somehow get it in some kind of list
10:56callengermanmushroom: don't use dotimes if you don't want it to return nil.
10:56callengermanmushroom: dotimes is for side effects.
10:56germanmushroomis there a better suited loop?
10:56callengermanmushroom: get in the habit of using (doc fn) on your functions to understand them better.
10:56callenthere's not really "one true loop, and in the darkness bind them" Clojure
10:57callenyou make a choice based on what makes sense for what you are doing.
10:57callenif you're applying an fn to each member of a collection, probably map is fine.
10:57callenthere's also things like for.
10:57germanmushroom(defn pitches [] (concat [500 1500]
10:57germanmushroom (dotimes [i 10]
10:57germanmushroom (+ 400 (* i 200)))))
10:57germanmushroomthat's what I'd like to do
10:58callengermanmushroom: where's your book?
10:58noncom,(mapv #(+ 400 (* % 200) (range 10))
10:58clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
10:58noncom,(mapv #(+ 400 (* % 200) (range 10)))
10:58clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$mapv>
10:58noncomahaha
10:58callennoncom: not your day mate.
10:58noncom,(mapv #(+ 400 (* % 200)) (range 10))
10:58clojurebot[400 600 800 1000 1200 ...]
10:58noncom:D
10:59germanmushroomI'm reading the joy of clojure, but figured I'd experiment some on my own
10:59noncomgermanmyshroom: callen is surely right - everytime you pick that type of collection-processing function that fits you needs
11:00noncomthey're all distinct and serve their very purposes. as they say, they are "orthogonal"
11:01callengermanmushroom: it might be worth realizing that some of Clojure's design was allergic to producing another Common Lisp LOOP macro.
11:01callenwhich was uh...formidable.
11:01callenI don't think anybody actually understood 100% of how it worked.
11:01callenyou could spend a whole weekend finding funny new ways to use it.
11:02germanmushroomI'm completely new to lisp and functional coding so I'm having a pretty hard time
11:02germanmushroomthanks for the help though, I'll look into map
11:02noncomafaik clojure strongly prefers Longs in its calculations, so why does that return Integer?:
11:02noncom,(count [1 2 3])
11:02clojurebot3
11:02noncom,(type (count [1 2 3]))
11:02clojurebotjava.lang.Integer
11:03noncomthat means another extra type-conversion if i base some my calculations on, say (count).. idk maybe some other funcs return Integer too
11:03noncomanyone has ideas on that?
11:04noncomgermanmushroom: just remember that it all is extremely logical and practical. there is as little esoterics as possible.
11:04callengermanmushroom: buuuut it helps to understand some of how the brick and mortar fits together just as a way to guide your thinking process
11:04callennot because there are any traps built into the design.
11:04noncom(although i'm saying that esoterics is illogic and impractical)
11:05noncomis there a type hint for atom?
11:08callen,(class (atom {}))
11:08clojurebotclojure.lang.Atom
11:08callennoncom: how exactly did you think type hints worked?
11:08callenthey're not magic, just the class of the instance.
11:08noncomwell, right :)
11:09noncom(defn ^int [] 4)
11:09noncomoh wrong window, lolcode
11:10pandeirohow can one build _just_ the cljs runtime into a js file, w/o any additional ns or files?
11:11noncom,(type nil)
11:11clojurebotnil
11:11noncomwtf?
11:11noncom,(type java.lang.Void)
11:11clojurebotjava.lang.Class
11:11noncom,(type null)
11:11clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: null in this context, compiling:(NO_SOURCE_PATH:0:0)>
11:12noncomwhy (type nil) is simply nil
11:12hyPiRionnil has no type
11:12noncom?
11:12noncomoh
11:13noncomhhyPiRion: do you know why does (count) return Integer?
11:13hyPiRionnil represents nothing.
11:13noncomand not Long
11:14noncomi always thought that null and void are types
11:15hyPiRionnoncom: count returns Integers because it's calling down to a java method, and that method returns Integers (because size limits on arrays etc. are Integer/MAX_VALUE)
11:16noncomvery unfortunate since that can imply loads of typecasting for some kinds of calculations...
11:17noncomwith clojure so leaning toward longs
11:22noncomcan i typehint generic types? like List<Node> ?
11:22pandeirowould it not be a useful thing for clojurescript to include a pre-compiled js file in the repo with every release?
11:22pandeirofor using with clojurescript-specific tools like lighttable?
11:23noncompandeiro: i think you have to ask dnolen when he is here or someone else from cljs team
11:23pandeirowell i didn't want to ping him on a sunday but...
11:23pandeiro:)
11:23noncomtry tomorrow? :)
11:23dnolennoncom: generic types are a fiction
11:23pandeirooh speak of the devil
11:23noncomoh..
11:24dnolenpandeiro: precompiled JS of what?
11:24pandeirodnolen: cljs.core etc
11:24pandeirono additional namespaces
11:24noncomso i typehint simply List then i guess
11:24dnolennoncom: yes
11:24noncomthanks!
11:24pandeiroie for integration with lighttable, which has builtin cljs support if you provide the built js file
11:25dnolenpandeiro: I don't think that really makes sense for CLJS, but perhaps for tools that use it like cljsbuild
11:25pandeiroi can't figure out how to make cljsc or lein-cljsbuild build a js file with no additional app ns
11:26pandeirobasically it would be the 'runtime', precompiled
11:28noncomdoes clojure compiler try to typehint automatically when possible?
11:29steveeq1I am learning clojure by writing my first web app in clojure. Sometimes I have to change the schema of my database, though. What is a well support database schema migration program to use in clojure?
11:29noncomfor example if i have something like (defn ^Texture2D texture-2d [width height format] (Texture2D. width height format)) - then is the ^Texture2D typehint necessary?
11:29noncomsteveeq1: personally i would use some db like mongo and avoid schema troubles at all
11:31squidzdoes anybody know of the easiest way to get a calendar select with cojurescript? For example a field which when clicked on displays a graphical calendar which can be used to select a day/month/year
11:31TEttingernoncom, turn on *warn-n-reflection* maybe?
11:31TEttinger*on
11:32noncomsquidz: i think that such things do not relate to clojuresctipt as they do not relate to javascript. just find some gui elements of framework.. idk if there is one for clojure, looks like not, so maybe you pick one for jsvascript?
11:33noncomTEttinger: yeah, could do..
11:33squidznoncom: I mean a library. It does relate to javascript. I am looking for a clojurescript alternative to jqueryUI
11:33steveeq1noncom: thank you. Will check out mongo
11:33pandeirosquidz: did you search the closure lib to see if it already has that type of widget?
11:33noncomsquidz: i don't think there is one. i have been looking and did not find any... the easiest is to use the javascript's one
11:34TEttingersquidz, I'm interested in JS bindings for clojure a bit too. will look
11:34noncomtell me if you find something though )
11:34squidzI tried seeing if closure has soemthing like it, and I found some stuff that looks like I might be able to use it, but I can't find an example anywhere
11:35squidzhttp://docs.closure-library.googlecode.com/git/class_goog_ui_DatePicker.html
11:35noncomsteeveq1: i have been using the "monger" mongodb driver for clojure. there is also congomongo, but i had no chance to test it yet, so I won't speak for it, but people say it is very good too. you can try them both and see what you like
11:35squidzSo i\ve found that, but dont know how to actually create it
11:37noncomsteeveq1: but somebody uses sql with clojure, surely.. the driver was korma until it was abandoned by the creator.. so idk what's up now. maybe there'll be more ppl on monday here who can speak of sql
11:38TEttingerhttp://closure-library.googlecode.com/svn-history/r1430/docs/class_goog_ui_DatePicker.html
11:38TEttingergah
11:38TEttingerbeat me to it
11:39squidzhaha yeah, I know of the closure calendar, but I dont know how how to write it in clojurescript as i've never worked with gclosure stuff
11:42squidzit's probably not hard. I only have to translate these lines of javascript. Not sure hwo to do it in clojurescript though https://www.refheap.com/17736
11:44TEttingersquidz, http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
11:47squidzokay nvm I found an example here: https://github.com/hhutch/cljs-closure-demos/blob/master/datepicker/src/datepicker/core.cljs
11:49TEttingersquidz, phew. that's not nearly as far from the original as I thought it might be.
11:50squidzyeah it's pretty 1-to-1
12:14ka_i have a question for "->>" macro. why isn't "([x] x)" implemented, although "->" macro implements it?
12:16ka_could anyone answer my question? thanks.
12:19hyPiRionka_: It was overlooked from what I know. Has been discussed on the mailinglist.
12:20callenMichael Klishin is a fucking hero.
12:20callenthat was the fastest PR merge I've ever had that wasn't prefaced with prior conversation.
12:23ka_hyPiRion: thanks for your response. where can i read the mailing list for that?
12:25hyPiRionka_: oh dear, that's ages ago. Anyway, they have been fixed for 1.6
12:25hyPiRion*that has
12:26hyPiRionI can see if I can dig it up, but "->>" is in general hard to search for
12:27ka_hyPiRion: okay, i see. thanks a lot for your kindness.
12:29dnolennew core.async blog post up - http://swannodette.github.io/2013/08/17/comparative/, some pretty interesting core.async techniques and lot of stuff about handling browser quirks - http://swannodette.github.io/2013/08/17/comparative/, feedback welcome
12:30hyPiRionahh, yeah, it's impossible to search for unfortunately
12:31hyPiRionor close to impossible, at least.
12:44`cbpdamn these project.cljs why make it so hard to parse =P https://github.com/nathanmarz/storm/blob/master/project.clj
12:47H4nsis there an efficient way to access a byte array (byte[]) from clojure?
12:47dnolenH4ns: same as any other primitive array, aget, the array just needs to be type hinted
12:48H4nsdnolen: ah, ok. thanks!
12:48dnolen(let [^bytes xs] (aget xs 0))
12:48matthavenerdnolen: i really love the literate style walkthrough of code
12:48dnolenmatthavener: thanks!
12:56noncomdnolen: the links are same ^^
12:56dnolennoncom: oops just pasted twice on accident
12:58`cbpeval'ing the sample defproject gives me UnsupportedOperationException nth not supported on this type: PersistentArrayMap clojure.lang.RT.nthFrom (RT.java:857) -__-
13:00callen`cbp: what are you trying to do man?
13:00callen`cbp: treat it like a native bit of code?
13:00callen`cbp: did you look at how Ritz does this?
13:01`cbpcallen: nope i did not look at ritz but defproject only defines a map where i can extract the deps and extra repos from
13:02callen`cbp: good thought. I think Ritz already does this. (processing project.clj)
13:05callen`cbp: when you tried to eval defproject, did you do it the same way Leiningen does?
13:07`cbpcallen: great question. It could also be window's evil carriage returns breaking everything in random ways.
13:07callengod help you.
13:14papachansomebody have done a clojure rest api with distributed processs?
13:14callenpapachan: need a little more detail
13:15papachanlike a classic rest api, but with distributed process for each services?
13:15papachaneach service url own its own process?
13:18callenpapachan: that's a somewhat nonsensical request.
13:18callenpapachan: SOA can be done in any language, are you concerned with concurrency...or something else?
13:19callenMost services running on the JVM run in a single JVM process, with threads for handling work concurrently.
13:19`cbpcallen: yeah I think there's something weird in the sample project because lein run on a project using it gives me the same error
13:20callen`cbp: well...stop doing that. :P
13:20`cbpcallen: I wanted a worst case scenario defproject :(
13:20callenyou've apparently got it.
13:21callen`cbp: just cut out the bit causing the error.
13:23seangrove`cbp: Why are you parsing project.cljs?
13:23seangrovenoncom: which links?
13:24callenseangrove: I told him he should.
13:24noncomseangrove: for that post : http://swannodette.github.io/2013/07/12/communicating-sequential-processes/
13:28`cbpseangrove: to inject/remove dependencies newly added/removed on project.clj onto the classpath without restarting the repl
13:29callenseangrove: he asked for something to do, among other things, I suggested upgrading pomegranate to be awesome.
13:30callendnolen: I really like the literate format of your blog posts. It's done better than most in that style.
13:31noncomwhat is the typehint for java enums? simply ^MyEnum?
13:32callennoncom: we've been over this, surely.
13:32callenit's whatever the class is.
13:32noncomyes, it show that
13:32noncomjust thought i'd ask
13:32fredyrdnolen: nice post, fwiw i'm trying some out some of your ideas w/ frp
13:33fredyrdnolen: but i'm having trouble keeping up, still on your first posts
13:33fredyr:)
13:35noncomand i'll read it tomorrow.. i really gonna try exploring these techniques in my apps
13:39dnolencallen: thx!
13:40dnolenfredyr: heh, yeah and this one is a bit on the "advanced" side - but my intention was to make it as real world as possible so folks can use it as a reference over time.
13:40callendnolen: were you involved in that NYT NYC construction visualization?
13:40`cbpcallen: oh theres a missing vector in the sample, in :repositories
13:40dnolencallen: was not, pretty cool tho
13:40callen`cbp: that's a pull request. and a paddlin'.
13:40`cbp:|
13:41callenbug in your sample documentation? that's a paddlin'.
13:41callenPR fails tests? that's a paddlin'.
13:41callenbikeshedding in PR about API refactors? that's a paddlin'.
14:09noncomi'm typehinting my code for speed. now it looks awful, see https://www.refheap.com/17737 . is that normal?
14:10callennoncom: 'ish. reformat as necessary. Why so much type-hinting? Did the compiler call those out?
14:10callendon't add any type hints the compiler doesn't call out.
14:10`cbpnoncom: does that work? I dont think you can hint primitive types
14:11noncomok, i will check upon reflection warnings in that region.. but the whole code is so big.. will have to pick them like berries i guess
14:11noncom`cbp i tried hinting primitives it worked..
14:11noncomalthough im not sure in anything right now
14:15noncomoh only long and double primitives are supported. such a luck. especially for java heavy-calculation float-based library
14:15callennoncom: normally you'd be using doubles for that.
14:15noncomsure, but the library is float-based and its not my will
14:30callennoncom: could change it.
14:30callennoncom: work looking into how similar libraries have solved this problem too.
14:32noncomcallen: no-no, it is a powerful game engine. and these mostly do not work with doubles because most graphics adapers work only with floats
14:32noncomthe 3d opengl one. that kind of stuff that is usually unparalleled
14:37noncomoh my, atom contents cannot be typehinted too, if they're initially nil.. how do i resolve it? do i have to have some mock class instance in them to be able to typehint? warn-on-reflection clearly indicates it cannot resolve method calls on the instance that will inhabit the atom later
14:37bbloomnoncom: assign the contents of the atom to a local & type hint the local
14:38noncomand that instance is the main application class instance. and crap me if i have to mock that since it starts up the whole opengl context initialization and all of the engine subsystems stuff...
14:39noncombbloom: uhhh.. i think i will have to do that..
14:39bbloomnoncom: you can also define a helper fn that is hinted
14:40noncomlike (defn ^Application the-app [] @app) ?
14:40bbloom(defn ^Thing deref-thing [x] @x)
14:40bbloomsure
14:40noncom:)
14:40noncomi guess that is more good
14:40noncomthanks
14:49mnemniondoes anyone have a link to a reasonably large .edn file? I have a parser I'd need to test for performance, ambiguity, and compliance.
14:50callenyou could just generate a large file. I'm sure the existing stuff on edn has acceptance testing.
14:51mnemnionI suppose I could. On an IRC channel full of Clojurians, it seemed possible someone had just the thing in a repo somewhere.
14:52mnemnionJSON is luxuriantly abundant. edn not so much.
14:53callenwell, I've done my OSS penance this weekend already
14:53callenso you're not going to Tom Sawyer me into something *that* boring.
14:54mnemnionI am, in *no*sense*, asking anyone to generate anything. At all, good sir.
14:56mnemnionhttps://github.com/edn-format/data.edn exists, I'll use it, all is well. If anyone happens to see this and can fetch a link in under ten seconds, I'd be grateful.
14:56callenmnemnion: sorry I couldn't be more helpful, just figured you'd know of edn-format/*
14:57mnemnioncomes a point, you want to feed your code data from the wild. I'm rapidly getting there. No problems.
15:00callenmnemnion: you could try being clever and just use the github search to scrape example edn data
15:01callenand just run all of it through your parser.
15:02callenmnemnion: what's this parser written in?
15:02mnemnionIt's written in Instaparse, hence, Clojure. I'll release it in a couple days.
15:02mnemnionFor anyone playing along at home I did eventually find this: https://github.com/shaunxcode/edn-tests
15:03mnemnionwhich looks, y'know, great.
15:06hyPiRionmnemnion: heh, Instaparse is fairly memory hungry
15:07mnemnionit's a beast!
15:08hyPiRionOn a 400k file I had, with ~400 rules, it used 19-25 GB
15:08hyPiRion*400kB file
15:08mnemnionGLL is tricky, and will blow up on you at the slightest provocation.
15:09hyPiRionyeah, I know. It's a scary thing to use if you don't know the internals or the "don't"s
15:09bbloomuse the "parses" function & see if you've got a wildly ambiguous grammar
15:09mnemnionI think Mark needs to weight the greedy and lazy branches of his exponential web of alts much more heavily. That gets the parser through the most common ambiguities.
15:10mnemnionI don't know that he weights them at all at the moment. Instaparse is new.
15:11mnemnionI had a likely looking parser that went O(n^2) on multiple whitespace. In practice, I torture regular expressions more than I'd like to. At least it's a refinement stage.
15:12bbloomthat's what i really like about generalized parsing: gets you to "working" fast
15:12bbloomeven if it's working slow :-)
15:12mnemnionhaving negative lookahead helps a lot.
15:13bbloomfeels the same as dynamic typing, lisps etc: two languages in one! a language for writing programs fast & a language for writing fast programs
15:13mischovmnemnion: You could look around for datomic examples. That's got some .edn files around but probably not "reasonably large"
15:13fredyrhmm, how can i create an js object literal in clojurescript_
15:14mischovmnemnion: https://github.com/Datomic/day-of-datomic/blob/master/samples/seattle/seattle-data0.edn for example
15:14bbloomfredyr: js-obj
15:14bbloomgrep for that, you'll see a usage example
15:14mnemnionmischov: thanks!
15:15fredyrbbloom: oh, thanks
15:15mischovmnemnion: no problem, hope it helps
15:17callenmischov: nice :)
15:17callenmnemnion: but seriously, just search for *.edn and sort by size.
15:19TEttingerwhat, 19-25 GB??? that's going to run on a recent server right? I don't think this windows laptop could have enough swap to run that
15:19hyPiRionTEttinger: yeah
15:20hyPiRionWell, "server" as in my desktop workstation.
15:21bbloomhyPiRion: have you tried the "parses" function? it's so memory hungry b/c you've probably got a large ambiguous search space & it's keeping all the unexplored branches in memory
15:21bbloomit's pretty easy to accidentally write an absurdly ambiguous grammar
15:21TEttingerhyPiRion, I, in all my usage of normal desktop apps, rarely need more than 7 GB. with hundreds of tabs open, a dozen spreadsheets and half a dozen PDFs
15:22TEttingerso it boggles my mind that one app can use 25
15:22hyPiRionbbloom: yes, I know :) It's not absurdly ambiguous, but there are a lot of rules and many of them match very few characters
15:35noncomif i have this kind of call (defn ^ReturnType wrapper-fn [^JavaObject java-object java-float] (.javaMethod java-object java-float))
15:35noncomis it benificial to typehint java-float with ^double?
15:36noncom^float does not exist in clojure, but what if i typehint with ^double?
15:37shiranaihitoi want to use the name "load" for a func in my own namespace, but i get a warning about overwriting core/load.. how can i avoid this but still use "load" as the name for my func?
15:37Apage43can't you do ^Float/TYPE ?
15:37shiranaihito(i'll call it like "yaml/load" anyway)
15:38hyPiRionshiranaihito: (:refer-clojure :exclude [load]) in the ns-declaration
15:39shiranaihitohyPiRion: and with that, everything will be alright? :)
15:39hyPiRion(you can still call it as clojure.core/load)
15:39hyPiRionyeah, you just won't be able to call clojure.core/load in that namespace by only writing "load"
15:39shiranaihitook, cool, thanks!
15:41noncomApage43: does not work.. strange, but in that usage it says it cannot resolve the classname
15:41Apage43ah
15:41noncombut
15:41Apage43guess that only works with actual classes
15:41noncom,(type java.lang.Float/TYPE)
15:41clojurebotjava.lang.Class
15:41Apage43you can at least make a float -array- that way
15:42Apage43yeah, boxedtype.TYPE is a pretend-class for the primitive
15:42Apage43http://docs.oracle.com/javase/6/docs/api/java/lang/Float.html#TYPE
15:42noncomApage43: maybe you know the mystery on why there are no ^int and ^float hints possible?
15:43TEttinger,(let [x ^float 2.4] x)
15:43clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Metadata can only be applied to IMetas>
15:44TEttinger,(let [ ^float x 2.4] x) ; you don't need to with primitive initializers
15:44clojurebot#<CompilerException java.lang.UnsupportedOperationException: Can't type hint a local with a primitive initializer, compiling:(NO_SOURCE_PATH:0:0)>
15:44Apage43I don't
15:44Apage43You can get a float array
15:45Apage43,(into-array Float/TYPE [1 2 3])
15:45clojurebot#<float[] [F@10f7074>
15:45Apage43but there isn't a way as far as I can tell to work with just plain unboxed floats
15:45hyPiRion^floats perhaps?
15:45TEttinger,(let [x (float 2.4)] x) ;
15:45clojurebot2.4
15:45TEttingerthere you go
15:46Apage43true, you can *get* a float that way, but that quickly becomes a Float
15:46Apage43actually I believe that just returns a Float
15:46TEttinger(defn ^ReturnType wrapper-fn [^JavaObject java-object java-float] (.javaMethod java-object (float java-float)))
15:46TEttingerhow about that?
15:47Apage43if javaMethod expects Float, rather than float, that would succeed (but still reflect.)
15:48noncomTEttinger: i'll try and hope that it will avoid reflection
15:52shiranaihitois there a way to find out if my "core.clj" is running inside leiningen? .. i'd like to only call (-main) if i'm running it from my IDE
15:54TEttingershiranaihito, your IDE isn't using leiningen?
15:55shiranaihitoTEttinger: no, it doesn't seem to be running the project through lein.. and i've wasted way too much time and effort fiddling with the integration.. so
15:55shiranaihitobesides, it's kind of sad that _everything_ has to happen through one specific tool
15:56TEttingerwhich IDE?
15:59shiranaihitoIDEA
16:03Raynesshiranaihito: Why is that sad?
16:03shiranaihitoRaynes: it shows that working without this specific library would be too cumbersome
16:03shiranaihitoerm.. tool, rather
16:04shiranaihitobut yeah.. Java's baggage is showing.. no one would want to deal with the mess of scrounging up whatever dozens and dozens of jars are needed for your project to run
16:04TEttingershiranaihito, IDEA really should be calling -main
16:04RaynesLeinignen is pretty amazing. You're going to be hard pressed to find people who fee the same as you.
16:04shiranaihitoTEttinger: that may well be, but it's not
16:04Raynesleiningen*
16:04Raynesfeel*
16:04shiranaihitoRaynes: i'm not saying lein is not great.. i'm saying it's sad that lein is _needed_
16:04TEttingerah I get ya
16:05zmansivwhenever i try to run a clj file in Intellij IDEA it says: Clojure Compiler: java.io.IOException: No such file or directory, compiling:(/Users/zmansiv/Dropbox/Code/Clojure/project-euler/src/1.clj:1)
16:05zmansivany one have any ideas? the file definitely exists and if i start a REPL and load the file it works fine
16:06arcatanwe don't use leiningen at work and i'm annoyed at some stuff like ritz-nrepl having no documentation on how it's used without lein :|
16:06TEttinger1.clj?
16:06zmansivyeah that's the name of the file
16:06TEttingermaybe there's some java restriction with numbers as the first char in a name?
16:06zmansivthat did occur to me so i tried changing it to one.clj and the same issue occured
16:07TEttingeroh ok
16:07shiranaihitoarcatan: yeah, that too.. roughly every single library out there starts its docs with: "so first you add this as a dependency in your project.clj"..
16:07shiranaihitoit's really kind of crazy that clojure is simply not used without lein
16:07TEttingerbecause it would be stupid for them to make two project configurations to test a really rare use case?
16:07zmansivi just changed it again and am getting "Clojure Compiler: java.io.IOException: No such file or directory, compiling:(/Users/zmansiv/Dropbox/Code/Clojure/project-euler/src/one.clj:1)" but entering "(load-file "/Users/zmansiv/Dropbox/Code/Clojure/project-euler/src/one.clj")" in REPL works fine
16:08TEttingerlein just builds on maven for dependencies
16:08RaynesWell, there is a very good reason for that: you should be using leiningen, your tools should be working with leiningen (the leiningen contributors work very hard on enabling IDE integration), and you can certainly use Clojure without leiningen and suffer the consequences if you don't want to.
16:08shiranaihitozmansiv: have you tried running "deps" from your IDE? is your IDE using lein 2.3.1?
16:09noncomshiranaishito: about lein: at first, i did not like being dependant on lein too. until at a certain moment of enlightment came. lein (as well as sbt for scala) is an evolutionary step further. it is far more open, simple, elegant and community-driven facilitation tool that ever was.
16:09shiranaihitoRaynes: again, you're missing the point.. "i'm not saying lein is not great.. i'm saying it's sad that lein is _needed_" .. it's sad that clojure development hinges on lein being used, pretty much
16:09noncomi encourage you to understand philosophy that stand behind that phenomenon
16:10RaynesI don't know what you'd want besides leiningen. If your IDE didn't work with Leiningen, it'd have its own project file very similar to how Visual Studio works, and it limits to the build to that IDE.
16:10Raynesshiranaihito: And I'm saying that's a silly thing to think.
16:10zmansivshiranaihito i do have lein installed but i don't know if my IDE uses it at all
16:10Raynes*shrug*
16:10zmansivi'm brand new to clojure so sorry if i'm missing something very obvious
16:10shiranaihitononcom: i expect i'll "accept" the way things are sooner or later
16:11noncombtw: 1) clojure can be used without lein, 2) java is a pain to use without, say, ant, too 3) most sane IDEs plugins for clojure include lein (i speak for CCW in particular)
16:11shiranaihitoRaynes: we're programming in Clojure, not "programming in Leiningen" :P
16:11TEttingerI think if there was an incompatible competitor to lein, it wouldn't be used
16:11RaynesYou're also programming in Clojure, not in IDEA.
16:11noncomi know at least one person (mikera) whom i consider to be good at clojure and who is not using lein
16:11shiranaihitononcom: IDEA does have some support for lein, but it's not complete yet
16:11TEttingerbecause having two things that don't work with each other and you need to choose one to do anything is bad for the ecosystem
16:12RaynesYou program in C#, not Visual Studio. C/C++, not Make. Ruby, not Rake and Rubygems.
16:12RaynesEtc.
16:12wolfesabstraction++
16:13noncomanyway, lein (as well as sbt) is the first so great attempt to integrate project management within the language itself. project management as a library. cool eh? btw, lein is self-aware AI..
16:13H4nswhat is the canonical "has more items" test for a seq?
16:13TEttingershiranaihito, it would be good for small projects to have an option to just clojure eval one file. but the second you need to use a second file, it gets tricky
16:13RaynesThe point is that you need a way to manage your dependencies and build your code.
16:13shiranaihitoRaynes: not using IDEA wouldn't prevent me from working with Clojure though
16:13RaynesWhat do you want besides lein for that?
16:13shiranaihitonot using lein effectively would
16:13shiranaihito?
16:14RaynesI don't get what you want. Do you want more tools that do the same thing as lein? Do you want your IDE to do a half assed job of what leiningen does so that it isn't required? What is it that you need?
16:14noncomshiranaihito: i know ppl who are very good at clojure and who do not use lein. they use, afaik, ant+maven
16:14shiranaihitowell, as i already acknowledged, lein is used _at least_ because no one would want to deal with the JAR mess
16:14RaynesThere is also maven, gradle, ivy, etc.
16:14noncomshiranaihito: have you programmed java before clojure?
16:14TEttingeryeah, java's classpath is a mess
16:15arcatanif you have multilanguage project and want an unified build system, then leiningen might fit your needs
16:15RaynesPeople use leiningen because it's better.
16:15arcatan(it's a trade-off)
16:15shiranaihitononcom: i see.. well, maybe i'll look into that later on
16:15shiranaihitoyep, i've used java before, for years
16:15noncomthen you know the classpath pain..
16:15shiranaihito(and i hated maven)
16:15callenshiranaihito: there are clojure integration plugins for IDEA and Eclipse, both support Leiningen.
16:15RaynesSo did most Clojure programmers, hence Leiningen.
16:15shiranaihitocallen: i'm already using one :)
16:15callenbelieve me, I don't care.
16:16callenI'm just saying the option exists.
16:16noncomwhy you hate maven? i heard that so many times... because of xml? :)
16:16shiranaihitocallen: well why bother talking to me if you don't want to hear me respond? :P
16:16callenI'm here to help you, not listen to talk to about your tools.
16:16callenI was mentioning what options exist.
16:17shiranaihitooh come on.. i'm not here to receive your passive-aggressive hostility
16:17shiranaihitoyou can't offer a helping hand and then lash out at someone for grabbing it
16:18callenI'm...it's okay.
16:18shiranaihitoyep
16:18callenI'm just explaining that I don't care, to save you the effort. There's no malice.
16:19shiranaihitodude, what you just did doesn't make sense.. except if you're unhappy about something and just want to take it out on someone
16:20RaynesOkay.
16:20RaynesYou never answered my question above. :(
16:20shiranaihitoit's weird to pretend to help someone just to lash out at him for then responding
16:20callenit's not...lashing out
16:20RaynesMeet callen. It's best to forget about it now and move on.
16:20RaynesThere's a whole world out there for the taking.
16:20callenyou were complaining about Leiningen, I mentioned two options for avoiding direct contact.
16:21RaynesWe can't focus on the past if we are to have a future!
16:21shiranaihitocallen: "believe me, I don't care." <-- this, was lashing out.. in case it was unclear to you.. which i seriously doubt
16:21shiranaihitobut yeah, if talking to people is _that_ taxing, then maybe you should reconsider doing it
16:21wolfesi read it as "i dont care which options people take, but here's several"
16:22RaynesI think you're really far too offended by this.
16:22RaynesPeople say shit on the internet.
16:22shiranaihitowolfes: come on.. the "believe me, I don't care." was a direct response to me saying i'm already using a plugin for integration
16:22callenguys
16:22RaynesOh my God, who cares.
16:22callenit doesn't merit this much meta discussion.
16:22RaynesMove onnnnnnn.
16:22Raynes:p
16:22shiranaihitoRaynes: i'm not exactly offended.. i'm annoyed at this whole mess
16:22callenREACH OUT AND TOUCH FAITH
16:22callenBUH DUH DUH DUNNNNN
16:22shiranaihitoannoyed at how people behave
16:22callen</Depeche Mode>
16:22RaynesThere is no *mess*.
16:23RaynesI asked you a direct question because I'm trying to understand your problem.
16:23shiranaihitoRaynes: but yeah.. you have a point in that lein is useful etc
16:23RaynesAnd instead you're complaining about callen.
16:23callenhe has more than a point
16:23RaynesI can't help you if you can't help me.
16:23callenLeiningen is the one true savior to us all.
16:23shiranaihitoRaynes: my original complaint was just that it's sad that clojure development hinges on one specific tool.. it feels like something is wrong.. and i guess that something is mostly Java's jar baggage rearing its ugly head
16:23RaynesWell, that is wrong, fwiw.
16:24RaynesYou can use maven, ivy, gradle, etc if you really want to.
16:24RaynesMost people don't because they pale in comparison to leiningen.
16:24callensome people with weird legacy deployments will do so.
16:24shiranaihitoRaynes: i complained about callen because he used me as an outlet for his bitterness about life, or whatever prompted him to lash out at me.. it's that simple.. but let's just move on, shall we?
16:24RaynesBut check out clojure-maven-plugin.
16:25RaynesAnyways, if IDEA is failing to handle something, it's very unlikely that leiningen is the problem.
16:25RaynesIt's probably somewhere between the IDE and the leiningen -- in the plugin itself. And problems should be reported as bug reports, if possible.
16:25noncomcallen is a nice guy actually
16:25RaynesI can attest to this. I've spent time with him in personal.
16:25Raynesperson*(
16:25RaynesKEYBOARD. Y U NO WORK FOR ME.
16:26callenRaynes: you no pay keyboard enough. Keyboard union start misinterpreting key press.
16:26shiranaihitoRaynes: true, there are problems with the integration
16:27callenshiranaihito: just so you're aware, IDEA does a very poor job of maintaining their plugin.
16:27shiranaihitobut .. are there any global variables that lein sets before running -main? .. i could check for one's existence
16:27RaynesUnfortunately.
16:27callenshiranaihito: most people end up using Eclipse + CCW if they want an IDE.
16:27RaynesGlobal variables!?!?!?! What is this!?!?!?!
16:27shiranaihitocallen: .. dare i respond? :P
16:27`cbpcallen: https://www.refheap.com/17741 Well it seems to work adding dependencies at least :P Time for the actual hard work of removing uneeded ones though
16:27callen`cbp: awesome. Thank you.
16:27callenshiranaihito: respond when it terminates in a ?
16:28RaynesUsually indicates a question!
16:28callen`cbp: let me know when classpath purging works :D
16:28noncomand just to complement the topic: i know the IDEA developers company personally. they're VERY opionated, excuse me.
16:28shiranaihitoRaynes: hm.. well yeah.. :p
16:28noncoms/opionated/opinionated
16:28shiranaihitoRaynes: something like *lein-whatever* .. but i guess not
16:28zmansivnoncom jetbrains doesn't like clojure?
16:29RaynesJetbrains never developed the plugin, iirc.
16:29RaynesJust random people.
16:29piranhacallen: I know you probably don't care, but I'm too excited and you're the only person I interacted with regarding to ring undertow adapter :)) anyway, I found a bug in tests of jetty ring adapter - it tries a get request with body, and jetty parses that, while undertow just drops body
16:29noncomthey don't like anything but java and their new Kotlin which is scalaish java. i live in the same city they're in and i've been to their company so i know
16:29piranhathis was hard to discover... I wonder if I should report it as a bug )
16:29RaynesAnd random people tend to have motivation to get things into a state in which it is useful to *them* and not everybody and then to bugger off never to be seen again.
16:29zmansivRaynes vendor on la clojure is listed as jetbrains
16:30shiranaihitozmansiv: true.. but was it originally made by someone else?
16:30noncomactually they're nice and intelligent, but you can expect various unexplained "unsupported" things from them
16:30zmansivnoncom i looked into kotlin and wasn't really impressed at all, very surprised because jetbrains usually makes awesome stuff
16:30callenRaynes: we ravaged the Jetbrains representative on Hacker News that showed up to talk about IDEA in a Clojure thread.
16:30callenRaynes: *ravaged* him for lying about their awesome plugin ecosystem.
16:30zmansivshiranaihito that could well be the case
16:30callenthere are github issues 3 years old, no response, no nothing on their repo.
16:30callenpiranha: whoa. hrm. well definitely lean towards reporting/documenting things :P
16:30piranha:-)
16:31zmansivcallen do you have a link to the thread
16:31noncomyes, they can make awesomness. i assume, they just want to take their peice of the market. and kotlin is a very marketologian thing. pure marketing. the way microsoft does.
16:33shiranaihitononcom: kotlin meant for marketing.. how?
16:33piranhacallen: I can complain to a guy working in Jetbrains :-)
16:33piranhadon't know if that will change anything though :)
16:33shiranaihitoit would be interesting to see the HN thread though
16:33callenzmansiv: https://news.ycombinator.com/item?id=6190610
16:33callenpiranha: ^^
16:33zmansivthanks
16:34callenLa Clojure (IDEA) is horrifically unmaintained and the PR person did a really shit job of making excusees.
16:34callenyou can't explain away multiple unresponded-to/unfixed Github issues from a *commercial* company.
16:34callen3 year old ones.
16:34noncomshiranaihito: there have been several attempts in language design by jetbrains. there were interesting ones like MPS. but none commercially successful. now i have been to that companies and to java days here in my city
16:34noncomand i saw their ppl
16:34callenI say this realizing IDEA is probably the best choice for Java, but their Clojure plugin needs a ton of love.
16:34noncomand what they do and what they say
16:35noncomi heard their arguments why kotlin is goos
16:35noncoms/goos/good
16:35shiranaihitohmm
16:35noncomas a programmer, i dissmiss them totally
16:35callenit's incredibly unlikely a commercial entry into the JVM language space would be successful, especially if it's so similar to Java.
16:35callenpeople that want a Java++ can use Scala, non-muggles can use Clojure.
16:35noncomthey try to get success by making something like Scala but as simple as java
16:36zmansivyeah there's no way kotlin is going anywhere
16:36callenif you want simple Scala, just have the company firewall block the download of any Scalaz or Shapeless jars.
16:36noncomon one of their slides they had Scala's map function signature in its full size, you know, with all that typization stuff and the girl leading the presentation said to ppl: "can you read and understand that.. me - no. thats why scala is bad. now see kotlin.."
16:37callenI'm sympathetic to the notion of improving Scala, but it's a waste of time and you aren't going to get people to switch.
16:37Raynescallen: I had a Scala programmer tell me a few days ago "If you ever Scala, Scalaz."
16:37callenNot when people have already dumped a bunch of effort into Akka.
16:37RaynesI was like *snerk*
16:37callenRaynes: I showed you what Scalaz looks like :P
16:38callenalso, idiot PR guy not understanding that it's not about 'free', but about being able to own your tools.
16:38noncomactually i used scala for more than a year. eventually i understood one thing: if a language has a right to live then it is either ASM, C or Lisp.
16:38ivaneh it's just some type classes http://stackoverflow.com/questions/1722726/is-the-scala-2-8-collections-library-a-case-of-the-longest-suicide-note-in-hist
16:38callenI'd happily pay for a copy of IDEA if it came with the source.
16:38noncommaybe that's too opinionated too.. but i felt that
16:40callenincidentally, there are Lisp dialects that live close to asm.
16:40callenmostly GOAL.
16:40noncomivan: it is very wrong to blame scala in anything because it is still even did not mature (in my personal opinion).
16:40noncomcallen: picolisp i was fascinated with but did not get into too much yet
16:40noncombut it is close to c
16:40noncomnot asm
16:41zmansivafter trying to use javafx for a commercial project my standards for maturity were drastically lowered
16:41hyPiRionpicolisp has a database embedded in it, so I'm not sure whether it can be called "close to c".
16:41callenWhat should I work on next? https://www.refheap.com/17742
16:42callenalso, for any who care: clj-time API refactor coming down the pipe
16:42callenmake certain you check your shit before upgrading past 0.5.9
16:42noncomhyPiRion: really.. depends on what you mean "close to c".. do you know what that database is in picolisp? it is a library. and the language itself is like assembly for lisp.. i think you know..
16:43callenRaynes: okay, do *you* have a vote on the list?
16:43hyPiRionhuh, database entities are first class objects
16:43Raynescallen: I have what?
16:43callenWhat should I work on next? https://www.refheap.com/17742
16:43callenRaynes: ^^
16:43callenvote.
16:43Raynescallen: What is this IRC bot/logger -> database thing?
16:44noncomi think that in picolisp everything is a 1st class object...
16:44noncomat least that what i understood from reading the book and working with the samples
16:45callenRaynes: it just sits in channels and streams log lines into a database which then has filtered hooks that trigger things like emails/IMs.
16:45callenRaynes: so that I can be notified when somebody mentions my name, Selmer, etc.
16:45callenbasically a bat-signal.
16:45hyPiRionnot types, afaik. Variables have no types, values do. That's a significant difference from c
16:45noncomthe 64bit version works on a special VM, and picolisp is a sugar for it, as C is a sugar for assembly.. and the VM is close to c..
16:45Raynescallen: That's called an IRC client.
16:45callenRaynes: I want programmatic hooks to send email.
16:45noncomhyPiRion: on types you're right..
16:46callenRaynes: it's not one of the priority projects.
16:46callenRaynes: vote?
16:46RaynesI think you can very likely write an IRC client plugin to do it, but *shrug*
16:46RaynesRewrite selmer with instaparse, I suppose.
16:46noncomwell, i'm so noob i think i just look from a different pov
16:46RaynesThat's totally useful.
16:47callenRaynes: yeah probably, but I've always wanted an IRC vacuum bot.
16:47hyPiRionnoncom: Well, I think I get you. It's very c in terms of performance (small memory footprint and very fast)
16:47hyPiRionsmall executables, etc.
16:47callenRaynes: Rewriting Selmer with Instaparse is useful? You're being sincere?
16:47Raynescallen: FWIW, you use lazybot for this.
16:47callenas the frontend? sure.
16:47Raynescallen: Strip it if all unnecessary plugins (probably all of them) and add a quick one for doing this.
16:47callenyeah.
16:48RaynesThat's like an hour project.
16:48callenI know. it's still on the list.
16:48noncomhyPiRion: yes, and is itself a very small c-written interpreter.. so you understand me :)
16:48callenthe mail server thing is basically "Lamson" for Clojure.
16:48Raynescallen: And no, I was being sarcastic.
16:48callenI actually have a TON of web library stuff in my queue too, but it's not in the to-do.
16:48RaynesBut I also don't want you to do quickcheck because for the love of God stop making testing libraries people please.
16:48callenmostly stuff from companies that use Rails and open source their libs.
16:48noncomi know that all is c-written, so no point in calling all close to c, but still... there is that feeling for picolisp
16:48callenRaynes: it's not a testing library :(
16:49RaynesI don't know what diffmerge is.
16:49callenRaynes: it'd be intended to be used with clojure.test
16:49callenRaynes: git diff/merging library but inside of Clojure, not an interface to a git repo.
16:49callenthere's a diffmatchpatch Java library I am considering adapting.
16:49Raynesclojurewiki is an idea, but a long term project and I'm not looking forward to the opinion editing wars in the future.
16:49zmansivcallen for the irc thing it might be a good idea to write it as a plugin for a bouncer like znc or something
16:49callenzmansiv: I'll probably use lazybot.
16:50callenRaynes: well the domain for clojurewiki is languishing.
16:50zmansivoh yeah that would make sense
16:50callenI'd like to have the diffmerge thing for clojurewiki if possible.
16:50Raynesdiffmerge then
16:50RaynesI vote diffmerge.
16:50callenany other votes?
16:50RaynesEverybody tell callen what to do.
16:51callenI want to try to cram out one last library this weekend.
16:51callenI have a surfeit of coffee.
16:51hyPiRionWrite a program which converts a Clojure program to an executable.
16:51callenI didn't actually sleep last night.
16:51RayneshyPiRion: https://github.com/Raynes/lein-bin
16:51RaynesDone.
16:51RaynesNext
16:51callenlol.
16:52hyPiRionlolwhat, does it embed a JVM in there too?
16:52RaynesThat's asking too much, hyPiRion.
16:52RaynesMaybe I should just embed the whole operating system in there just in case
16:52Apage43I had started a wrapper for https://code.google.com/p/subethasmtp/
16:53technomancycallen: lampson for clojure would be super
16:53jcsimsclojos
16:53Apage43but I wound up not needing it so it didn't get very far
16:53agumonkeyHello, any emacs/nrepl user here? (#emacs had noone to help me until tomorrow)
16:53hyPiRionRaynes: And all the files too
16:53hyPiRionRaynes: but that's probably called imaging, not "Clojure as an executable"
16:53Apage43https://github.com/apage43/offpost
16:53callenRaynes in this thread: http://stansellseverything.ytmnd.com/
16:53Raynes~anyone
16:53clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
16:54callentechnomancy: Lamson you mean?
16:54callentechnomancy: I wasn'
16:54callenwasn't aware you used Python.
16:54Raynescallen: Wtf. I had that playing on top of Ode To Sleep by Twenty One Pilots.
16:54RaynesIt sounded amazing.
16:54callenRaynes: :D
16:54technomancycallen: I don't, but I've read a bit about it
16:54callenITT: Raynes has it all.
16:55technomancyit's the kind of thing that would really benefit from better abstraction; the raw libs are just rotten
16:55callentechnomancy: hey, do you know any of the history behind lein-autoreload? It doesn't seem to actually replace the vars in the current ns when reloading.
16:55zmansivi started doing the project euler problems and decided i'd done enough ruby and java this summer so i'm looking at clojure for it
16:55callentechnomancy: yeah, I often find myself getting into the weeds whenever SMTP is involved.
16:55zmansivbut the learning curve seems like it's too steep to be worth the effort
16:55technomancycallen: all I know about lein-autoreload is it's a thing I keep saying should exist. its actual existence is news to me.
16:55callentechnomancy: uh, well it exists, but doesn't seem to work.
16:56technomancypeople keep using midje because it crams together auto-reload with a test framework =\
16:56callenit'll spit stuff out into the REPL about having reloaded something, but when I re-run (run-tests) it'll use the stale var.
16:56callenoh god fucking dammit, that explains a lot.
16:56callenI might need to add fixing lein-autoreload to the list.
16:56callen1 vote for diffmerge, 1 for Lamson-4-Clojure.
16:56Apage43ahahaa
16:57hyPiRionI was thinking about making a Clojure machine. Go do that with FPGAs callen.
16:57bbloomdnolen: it was tricky, but i got the hard part of first class effect instances & handlers working: https://github.com/brandonbloom/cleff/blob/handlers/src/cleff/core.clj#L240-L253
16:57callenhyPiRion: try to suggest things I at least faintly care about please :(
16:57callenI provided a list.
16:57hyPiRionOh, I didn't see that list, soz.
16:58bbloomdnolen: the syntax isn't done, but you can see that you can create & pass around both effects & handlers. if you look at the not-working examples right below the highlighted area, you can see how these work w/ stacks of handlers
16:58callennp - https://www.refheap.com/17742
16:58callenhyPiRion: ^^
16:58Apage43hyPiRion: just think of a scenario where if one didn't exist, someone would use midje for some reason
16:58hyPiRionoh, you can make midje2 then
16:58callenI...don't believe in midje.
16:59technomancycallen: FWIW the "searches against IRC streams" is something I would use too
16:59callenor complecting an otherwise potentially very useful autoreload with a testing framework.
16:59callentechnomancy: good to know I'm not totally crazy.
16:59technomancysome kind of mobile-accessible twitter-like mentions and searches
16:59callenyeah exactly.
16:59technomancy(since actually having an IRC client on my mobile is a lost clause)
16:59technomancycause
16:59technomancycallen: I believe we've discussed this in the past
16:59callenprobably.
17:00Apage43I have one. Most of the times I pull it out, I'm driving, which is no good.
17:00technomancyI even had a decent name picked out
17:01callentechnomancy: heh, what?
17:01callenalso, a reminder since more people are looking, clj-time API is getting refactored. Shit is being deprecated.
17:02technomancycallen: it was gonna be a subrosa plugin, so I picked "surfer-rosa"
17:02technomancycallen: I guess mine was a bit different; I was thinking of a bouncer proxy instead of a bot
17:02technomancyso I could do rudimentary replies from my mobile
17:02technomancythat's a lot more complicated though
17:02callentechnomancy: I was originally thinking of a bouncer proxy too.
17:03callentechnomancy: part of the point was to actually avoid using ZNC. I don't like ZNC.
17:03technomancyyep
17:03callenbut Raynes is right about lazybot being the path of least resistance.
17:03technomancyit's definitely the pragmatic way to do it
17:03technomancyunless you really are in the mood a meaty project you can sink your teeth into
17:03callenif I was to do meaty, it'd probably be Lamson or Wiki.
17:04callenI've got a long tail of random-ass Rails libs to port too.
17:04technomancywell the bulk of the work around the wiki is writing and editing, not coding
17:04technomancytotally different vibe
17:05callentechnomancy: I'm focused entirely on the benefit to the ecosystem. my only secondary priority is that I'd like to have a neatly wrapped up project by day's end.
17:06callena diffmerge library is likely to be the winner for today unless somebody else pipes up
17:06technomancy"neatly wrapped up" sounds like the opposite of a wiki?
17:06callenbut Lamson, IRC, and lein-autoreload are on my radar.
17:06callentechnomancy: yeah but I place high importance on it.
17:06callenI am seriously sick and tired of landing on clojuredocs.
17:06callenand everytime I'm working on a library and need to look something up, that's just an opportunity to expand the wiki.
17:07technomancythe non-hyphenated one?
17:07technomancyor both?
17:07callenthe old unmaintained one
17:07callenI have no problem with clojure-doc
17:07callen(dat fucking nomenclature)
17:07callenclojure-doc doesn't really do what I need either, but it's at least good at what it actually does.
17:07callenand is maintained, but quiet.
17:08`cbphmm i suck at naming, maybe i'll just use yet-another-library-named-after-food
17:09callenRaynes: to explain the mail/IRC thing, in general I just shove everything into databases.
17:09callen`cbp: whoa dude, it should just be a PR into Pomegranate.
17:09callen`cbp: what are you naming?
17:10callentechnomancy: also I saw that lein interactive got replaced in favor of...Jark? What?
17:10`cbpcallen: feels like its gonna grow somewhat :)
17:10callen`cbp: you worry me.
17:10callentechnomancy: I can't even figure out from the docs how to run lein tasks from Jark.
17:10technomancycallen: it got deprecated because no one used it
17:10callenI thought you did.
17:10technomancyno one who contributed, I mean
17:10technomancynah
17:10callenoh.
17:10technomancyjark has been vaporware for a while afaict
17:10callenI usually use drip, what do you do?
17:11callenI need a way to continually run my tests, I was hoping the autoreload thing would work, but...it doesn't. :\
17:11technomancyoh, I just use clojure-test-mode
17:11callenI don't realllyyyy want to run two nrepls.
17:12technomancyI was playing with lein.el, but I couldn't figure out how eshell's model of a command mapped to the underlying process
17:12callentechnomancy: I'd prefer it to just be a terminal off to the side that "watched" files and reran the tests.
17:12callenI mean, I could write a Guardfile, but I am desperately lazy.
17:12callenI don't want to write a Guardfile for every project.
17:12callen...I might just write a lein plugin that does this.
17:12callenyeah, going on the list.
17:13callenis there a Clojure library for watching for edits to a directory of files?
17:13callenhttp://clojuredocs.org/circumspec/circumspec.watch/watch
17:14callenoh god dammit
17:14callenof course it's part of an abandoned BDD testing library
17:14callenwhat the fuck
17:14technomancysounds like a lot of work just to keep IO separate
17:14technomancywhy not trigger it from clojure-test-mode and rebind *test-out* to a file you tail?
17:14callentechnomancy: I want it to just happen automatically over and over and over.
17:14callenseriously, 0 effort.
17:14callenI do not want to manually dispatch my test runner, ever.
17:14`cbpcallen: maybe you just need a wrapper on java.nio?
17:15callen`cbp: maybe? I'm hoping for something with a callback hook.
17:15`cbpit has a WatchService
17:15technomancycallen: after-save-hoo
17:15technomancyk
17:16callentechnomancy: I see what you're getting at. I really just want it to be a lein task.
17:16technomancyI do too, but you said zero effort
17:16callenand a task combinator called autorun would be cool.
17:16callenno, I'm willing to invest effort upfront
17:17technomancyoh, gotcha
17:17noncomhyPiRion: about clojure machine: is there point in clojure without java? i mean it has nice stuff, say, easy vectors, but all in all.. what is the difference between JVM and ClojureVM?
17:17callenI just don't want to have to invoke my tests again afterward.
17:17technomancywell, lots of ways to do it, and one of them is clojure-test-mode, which already exists, so I'm happy
17:17callennoncom: it's not even really specifically Java, just the nature of being hosted.
17:18callentechnomancy: I tried CCW again because it supposedly auto-reloaded stuff.
17:18callentechnomancy: that was a comical experience.
17:18noncomcallen: agreed, and i want ot add that java ecosystem is a BIG win too.
17:18callenRubyists have whole libraries that do this: @user.assign(params[:user], [:username, :email, :password, :password_confirmation])
17:19callenone the one hand, their willingness to embrace the micro-library ethos is awesome. OTOH, lol.
17:23ordnungswidriggosh, is there a sane flight search engine in this internet thing? the conj location plays tricks on me :)
17:24callenordnungswidrig: hipmunk?
17:24ordnungswidrigcallen: i'll give it a try
17:26hyPiRionnoncom: I was talking about a physical clojure machine, like lisp machines. There's no value in that as far as I can see, except it sounds like a fun thing to do
17:26hyPiRionRe VM vs. no VM: Startup time, for instance
17:27technomancyracket has a fast-starting, JITting bytecode VM
17:28hyPiRionLua too. More like arguments against the JVM for Clojure, specifically, I suppose.
17:28noncomhyPiRion: i would definitely like to see the physical clojure machine. For example, it could be made to overcome clojure/java bitch interop and still allow to work with all java libs.
17:29noncom*overcome interop costs
17:29noncomalthough little ppl would own it i guess.. unless a miracle happens
17:31hyPiRionyeah, that's something for people really into these things
17:32callenhttps://github.com/aphyr/prism
17:32callenBADA BING
17:32callenhope this works.
17:33callentechnomancy: also the sample project.clj is broken and you should remove/edit mention of Jark.
17:33technomancycallen: crap; where is jark mentioned?
17:34callentechnomancy: on a github issue or PR removing lein interactive I think.
17:34technomancygrep says ... nowhere?
17:34callenit's not in the repo
17:34technomancyoh, welp
17:34callenbecause github doesn't store issues in the repo.
17:34callen :(
17:34technomancylink?
17:34callenfack. h/o
17:35callenoh shit, it's an SO response you're not responsible for. Sorry!
17:35technomancyhah; no worries
17:35callenuhm. crap.
17:35callenmy SO account was a lavabit account.
17:35callenI'm pretty sure lavabit got rm -rf'd.
17:35technomancyin related news, someone get github on the phone and yell at them for not storing issues in repositories
17:36technomancycallen: badge of honor dude
17:36callenI'm a digital refugee.
17:36callenI got a 404 on SO when I tried to login with my lavabit account. WTF
17:37technomancyyou took one on the chin for snowden
17:44callenso lein prism solves my problem, but it doesn't have a generic lein task wrapper for auto-re-running an arbitrary task.
17:44callenwhich kinda sucks, but I can see why they did it that way.
17:44callentechnomancy: you should put lein prism on the leiningen plugins page under the testing section.
17:44callenhttps://github.com/aphyr/prism
17:49hyPiRioncallen: why don't you do it? :)
17:49hyPiRionIt's open for all to edit
17:50callenhyPiRion: I don't like tromping through other peoples' gardens, but I could.
17:51callenadding now.
17:52callenhyPiRion: done, good thought. :)
17:52hyPiRionyay
17:53hyPiRion(inc callen) ; for community service
17:53lazybot⇒ 7
17:55ryankaskhi everyone. I'd like to install java.jdbc 0.3.0-SNAPSHOT instead of the suggested alpha4. the snapshot isn't published anywhere. how do I install the lastest version from git?
17:57callenryankask: checkouts or
17:57callenryankask: git clone `tha-thang` && sed s/namespace/my-namespace/g && lein deploy clojars
17:57callen(I've been doing this a lot lately, seemingly)
17:57callentechnomancy: did you work with Jahad on the debug repl stuff?
17:58callenif so, any comments on what it would take to add globals to it?
17:59hyPiRionryankask: Well, you could `git clone` it, then do a `lein install`. That should solve it on your system, although it won't be a working solution globally.
17:59callenoh I guess that's the proper way.
18:00ryankaskhyPiRion: thanks! that worked.
18:00hyPiRionnp
18:06ToBeReplacedI'm pretty sure I'm about to lose this -- If anyone happens to agree with me, please speak up: https://github.com/bbatsov/clojure-style-guide/issues/64
18:15bbloomToBeReplaced: bike sheding at it's finest.
18:17ToBeReplacedbbloom: eh :). It's an open source style guide -- costs from decisions there will be paid over and over again, so I'm not sure I agree. For example, we're still paying costs from the pre-pep8 days in python 3
18:18bbloomToBeReplaced: you're paying that cost b/c declaring a new style creates a rift between existing code & people following an arbitrary style guide
18:19bbloomthe first bullet point under the "be consistent" bullet point in any style guide should say "prefer consistency with surrounding code than consistency with the guidelines"
18:19bbloomyou're too late, sorry
18:21ToBeReplacedbbloom: i still think it's early days tbh, so i still err on the side of change
18:21ToBeReplacedi've been really down on technology recently though... i find that i almost always have to drop clojure libraries on the floor in favor of java ones
18:22bbloomwell then it's a good thing that somebody was clever enough to create a hosted language w/ good interop!
18:22bbloomhurray technology :-P
18:24callenToBeReplaced: weird, I don't seem to do that. Ever.
18:24callenToBeReplaced: what sort of A/B (Clojure/Java) switches have you made?
18:24ToBeReplacedapache http over http-clj, i end up needing to hit joda-time directly a lot instead of just leaning on clj-http functions
18:24ToBeReplacedQuartz direct over quartzite
18:25ToBeReplacedjedis over carmine, though carmine's 2.0.0 has cleaned up what were the major issues for me so i gotta spin the wheels with that again
18:25callenToBeReplaced: I used carmine recently and adored it :)
18:25ToBeReplacedmostly, i've found too much "magic" in the clojure libraries, many have made it hard to test (dynamic bindings, etc)
18:25callenbut I probably wasn't stressing it the way you might've been.
18:26callenToBeReplaced: funny you mention that, I made the API to a lib I wrote recently have alternate global atom/return closure APIs for muggle/testing use.
18:26ToBeReplacedmy usage wasn't that heavy, i just needed to be able to control connections, and the pre-2.0.0 version didn't let me do that
18:26callenthe closure API supports disparate connections for each returned fn.
18:26ToBeReplacedwhat's the lib?
18:26callenit's a pretty cool pattern, just uses (or ...) and is otherwise transparent.
18:27callenhttps://github.com/bitemyapp/bulwark/ it's a mimic of Rack::attack
18:27callenjust blacklist, whitelist, and throttling atm. persistence is only needed for throttling, and that's redis only atm.
18:27callenI'll do an in-memory implementation for the younguns at some point.
18:28callenthe reason for the dual APIs is that there are use-cases, other than laziness, where you really want a global atom.
18:28ToBeReplacedi don't know enough about the problem domain to offer commentary
18:28callenand any attempts to accommodate those use-cases with a closure would involved reset!'ing atoms of an fn anyway.
18:28callenso I decided to ignore my inner-neckbeard and implement both. One for testing, one for production.
18:29callenrelevant cleverness -> [cm (or (first args) @config)
18:29callenthat's all. prioritizes the use of closed over local state.
18:30callenit's a really useful pattern though and one that I might start proliferating in libraries to promote easier testing.
18:30ToBeReplacedhm; i'd be worried that it makes it too easy to typo
18:30callenwat.
18:31ToBeReplacedlike accidentally leaving out the local config in a singular call
18:31callen...no.
18:31callenit's returning an fn closure.
18:32callenthat only happens in one place.
18:32callenit's not doing that in 10 different places.
18:32callenthat's bad code.
18:32ToBeReplacedoh, got it, and then you pass the closure everywhere
18:32callenI don't know that I'd use the terminology "everywhere"
18:32callenother fns depend on information that technically comes from the config map, but they aren't complected with the "place-ness" of the config map.
18:32callenthey just receive that data as arguments.
18:33callenso you can effect arbitrary behavior out of the constituent fns without depending on specific state.
18:33callenthis is pretty standard "not writing bad code" procedure.
18:46hugodarcatan: ritz-nrepl worked with the zi maven plugin; not sure if the latest runs with zi yet though.
18:47callenhugod: could something like debug-repl be done in Ritz?
18:48hugodwhat is "something like debug-repl"?
18:49callentake it that means you haven't used it.
18:50hugodI wrote the swank-clojure implementation of it
18:50callenyou drop in (debug-repl) anywhere in your code (presuming the namespace is loaded) and you get a typical clojure repl at that "breakpoint"
18:50callenRitz isn't working out for me sadly.
18:50hugodjust wondering what about debug-repl you like...
18:50callensimplicity, comparability to pdb/ipdb (Python), behaves just like a REPL
18:51callendoesn't turn into a bleeding mess when I have to call into code that regrettably uses exceptions as flow control
18:51callenlets me test and evaluate assumptions interactively with all the state in place surrounding the repl.
18:51hugodyou can filter those exceptions in ritz, but sure
18:52hugodand ritz should let you use the repl at a breakpoint (though I'm not sure it does still)
18:52callenI've seen it let me evaluate expressions in a one-off interface
18:52callenbut that is decidedly not a REPL
18:53callenit's just a messy and not very refined experience, as powerful as it sems.
18:53callenseems*
18:53hugodit should be possible to let you use the repl, if it isn't already
18:53callenbut the inaccessibility of globals in debug-repl is intolerable.
18:53callenalso, some sort of auto-magic for disabling locals clearing would be glorious.
18:53pizzasaucedoes anyone know if there is something similar to the slime-inspect in nrepl?
18:53callenhonestly, should be the default if I'm invoking lein ritz-nrepl.
18:54amalloypizzasauce: i think there's something that's halfway there, maybe by technomancy? don't remember the name
18:54hugodcallen: compiling with a prefix worked in swank for disabling locals clearing - haven't had the time to port it to nrepl yet
18:54amalloyjavert
18:55amalloy(googling for "nrepl inspect" really isn't hard, incidentally)
18:55hugodpizzasauce: https://github.com/vitalreactor/nrepl-inspect
18:56callenhugod: good to know it's possible, what could be done about a debug-repl-esque function?
18:56callenthat drops one into a repl, not the stacktrace buffer.
18:57hugodcallen: you could make it through a specific exception, and just break on that one exception
18:57hugod*throw*
18:57callenthe stacktrace thingy didn't have a repl.
18:57callenwhich is why I specified "drops me into a repl"
18:57hugodthe repl is still there
18:57hugodand should be within the context of the breakpoint
18:57callenWhere? C-h m didn't show anything.
18:58hugod*nrepl*
18:58callenthe default nrepl buffer in my emacs buffer is swapped to the stacktrace?
18:58callenwhy wasn't this documented :(
18:58callenin my emacs*
18:58hugodI'm not sure it works, tbh
18:58hugodif it doesn't raise an issue
18:59hugodin fact thinking about it, it doesn't
18:59callenhrm. all that remains then is locals clearing.
18:59callenhugod: what are the two repos I should be looking at for that? you said it existed for swank right?
19:00hugodlocals clearing, yes - in swank-ritz.el
19:01callenI'm surprised that wasn't ported already.
19:01callenis nrepl not a priority?
19:02hugoda priority for ritz? new development is mostly on nrepl
19:02hugodritz existed before nrepl
19:03callenI know, just wondering.
19:03callenhugod: thanks for taking my queries.
19:04pizzasaucethanks amalloy & hugod
19:04hugodcallen: I take pull requests too ;)
19:06callenhugod: I've been a streak lately, it's in my todo list.
19:06callenand it's something I want, so...
19:37SeanCorfieldcallen: thanx for all those clj-time PRs!
19:37SeanCorfieldRaynes: you got your API cleanup now :)
19:41callenSeanCorfield: thanks for your patience and for the prompt PR merge :)
19:42callenSeanCorfield: does 0.6.0 remove the deprecated bits though?
19:42callenI thought the idea was to remove the deprecation notices upon 0.6.0?
19:42callenor are we doing that for 0.7.0?
19:42callensorry if I misunderstood :(
19:45ToBeReplacedSeanCorfield: thanks for the cut and cleanup; i've been consistently impressed with how clojure.java.jdbc and clj-time have been improving over time
19:46holohi
19:47holo(do (defn s? []) ((-> :s name (str \?) symbol))) ; complains about arity. how can I call (s?) generating the symbol at runtime?
19:48SeanCorfield0.6.0 adds the deprecations, 0.7.0 will remove the old APIs
19:48SeanCorfieldgoing from 0.5.x to 0.6.x is heads up of a shift in the API
19:48SeanCorfieldsame as java.jdbc going from 0.2.x to 0.3.0
19:49callenSeanCorfield: makes perfect sense since we were already in the middle of 0.5.x, thanks for explaining. :)
19:49SeanCorfieldthe old APIs will stay in java.jdbc until at least 0.4.0, possibly longer
19:51noonianholo: (do (defn s? []) (eval '(s?)))
19:51SeanCorfieldToBeReplaced: thanx... java.jdbc is a WIP right now... was hoping to get to beta1 earlier but we'll have at least alpha5 before then
19:51callenreferring to c.j.j? I was surprised by the new API, what else is in store?
19:52holo(inc noonian) ; great!
19:52lazybot⇒ 2
19:57SeanCorfieldcallen: more DDL, more extensibility, improve transaction handling, improve documentation(!), make it easier/more obvious how to work with connections
20:02jkkramerseancorfield: I'll have some more feedback/suggestions about java.jdbc to give you soon. I've been working on a higher-level sql lib which is almost complete. Need to distill my thoughts into a coherent form…
20:02seangroveWasn't it possible to map datalog queries to a sql backend?
20:06amalloyholo, noonian: eval is unlikely to work well outside of the repl environment: i think it only "knows about" vars in clojure.core
20:07noonianhmm, thanks for the warning
20:07amalloybetter would be something like ns-resolve, explicitly specifying the namespace
20:07callenSeanCorfield: very cool stuff. :)
20:07callenSeanCorfield: the improvements in the API are converting Korma laggards.
20:14holo(inc amalloy) ; thank for the warning. will look into that
20:14lazybot⇒ 69
20:17ToBeReplacedSeanCorfield: are there downsides to quoting the entity names in the sql dsl? ex UPDATE "foo" SET "bar"= 1
20:18jkkramerToBeReplaced: different dbs use different quoting
20:18ToBeReplacedi had a bug where that I couldn't use update on a table b/c it had a column name that was a keyword
20:18ToBeReplacedjkkramer: right, seems like a challenge
20:18jkkrameri have a lib that handles that by sniffing the subprotocol and guessing, with a manual override
20:19ToBeReplacedyeah i just overrode the :entities flag to do the quoting for me
20:20ToBeReplacedmight be the best way to handle it, since no db spec needed for the dsl
20:26SeanCorfieldToBeReplaced: for MySQL I use (entities (quoted \`) (query my-db ...))
20:27SeanCorfieldsounds like you want to use (entities (quoted \") ...) ?
20:28SeanCorfieldentities is a macro that walks the expression and injects :entities into every (known) expression)
20:28SeanCorfieldor you can do it explicitly: (query my-db (select ... :entities (quoted \")))
20:29SeanCorfieldclearly a lot of work is needed on the documentation :)
20:29SeanCorfieldmaybe this will help? http://clojure-doc.org/articles/ecosystem/java_jdbc/name_mapping.html
20:33devnhowdy clojurians
20:35SeanCorfieldhey devn !
20:35holois there any some-> like form that returns the last truthy value instead?
20:35holohi
20:36ToBeReplacedSeanCorfield: thanks; yeah i use quoted \' as well... haven't used entities macro though i should take a look
20:39SeanCorfieldjust makes life easier...
20:40SeanCorfieldlike this: (entities (quoted \`)
20:40SeanCorfield (update! (ws/worldsingles-db) table record
20:40SeanCorfield (where {pk (pk record)})))
20:40SegFaultAXholo: Doesn't that sorta defeat the purpose of some->?
20:43SegFaultAXholo: I mean to say that the purpose of some-> and some-> is to thread a value through a series of forms as long as it's non-nil.
20:43callendevn: hi. I've been busy :)
20:45holoSegFaultAX, yes, i want that behaviour, but not return nil when it finds nil. i want the value just before nil
20:45SegFaultAX*and some->>
20:45ToBeReplacedholo: curious about use case?
20:49holoToBeReplaced, (last-truthy-> 4 nil? str) ; => 4 to replace (if (nil? 4) (str 4) 4)
20:51holoToBeReplaced, 4 is repeated 3 times. in my example only used 1 time
20:51hyPiRionWell, (if (nil? x) (str x) x) is the same as (or x "")
20:52SegFaultAXholo: Nothing exists in core AFAIK. One potential problem I could see with what you're describing is you wouldn't know where the process failed.
20:52SegFaultAXholo: Just that some unkown number of forms were applied to the initial value.
20:55SegFaultAXAlthough now that I think about it, what would be cool for debugging would be a some-> like macro that returned either just the value if it got all the way to the end, or the value before the failure + a continuation of the remaining forms.
20:58holohyPiRion, the example wasn't as aproximate to the case as should. i clarify: (or (fn-that-returns-argument-when-truthy v) v) should be replaced then with (last-truthy-> v fn-that-returns-argument-when-truthy) but I guess or is compact enough for the number of forms here
20:59SegFaultAX,(doc fnil)
20:59clojurebot"([f x] [f x y] [f x y z]); Takes a function f, and returns a function that calls f, replacing a nil first argument to f with the supplied value x. Higher arity versions can replace arguments in the second and third positions (y, z). Note that the function f can take any number of arguments, not just the one(s) being nil-patched."
20:59SegFaultAX,(let [f (fnil inc 1)] [(f 10) (f nil)])
20:59clojurebot[11 2]
21:05holoSegFaultAX, yes fnil should work for my case, which is as compact anyway as the or example. about not knowing where the process failed, the same issue exists with some-> but worse, cause nil usually tells less than a truthy value
21:11holoSegFaultAX, not saying some-> isn't useful. i use it alot to avoid exceptions for non nil tolerant fns, e.g., but i think my example with enough forms could be provided useful, and your example for dubuging too
21:15holoanyway, for my use case fnil uses less parentheses than or :)
21:18dnolenit's a bit funny how long PyPy has been working on STM now
21:20callenNot really sure why they would succeed when Microsoft Research failed either
21:22callenthey've not bothered to explain why their implementation is different
21:32bbloomdnolen: at this point, i can't imagine why anybody would ever want STM in an all mutable world. it blows my mind. haven't we proven that immutable is a good idea by now? :-)
21:34dnolenbbloom: can you explain a bit more about the cleff update, what exactly have you accomplished here :)
21:35bbloomdnolen: much more accomplished in a few mintues! :-)
21:35bbloomdnolen: i'll ping you in ~15m hopefully
21:35dnolenbbloom: might have to jet, but no worries, I'll ask about you again about it if I miss the update :)
21:36bbloomdnolen: so the full Eff model has first-class "effect instances". you can think of it as run-time creation of exception types. so you don't (catch ExceptionType e …) you (catch some-exception-instance …)
21:37bbloomdnolen: it also has first-class handlers, so you can install an "exception" handler dynamically too
21:37bbloomdnolen: so i've reified both of those things, where as before i didn't have that
21:38bbloomdnolen: locally, i've rewritten the interpreter to have proper delimited continuations against a stack tagged with handler prompts, so i can do the examples that have multiple different instances of the same effect & install a reusable handler :-)
21:38dnolenbbloom: very interesting - would like to see a post about
21:39dnolenbbloom: you actually have a use case for this stuff?
21:39bbloomdnolen: I have a use case for it if it works well :-P chances are that the lexical transform will be annoying to the point of uselessness, but i thought that about go/channels too & was proved that it's only mildly annoying
21:40dnolenbbloom: yeah, every now and then I get a scratch my head error with go channels, but as long as you keep the go blocks short and sweet it's not hard to find the source of the error.
21:40bbloomdnolen: but in theory, anything you've ever wanted to use call/cc for, this can do it w/o leaking memory & while being no more difficult to understand than exception handlers
21:41dnolenbbloom: hmm, do you have a simple use case in mind that you could explain?
21:41bbloomdnolen: generators (ie yield)
21:42bbloomyou can already build that w/ core.async, but this will let you build it in a few lines & it will interop w/ other things you build with this
21:42dnolenbbloom: huh, what would you do w/ yield that you can't do w/ core.async?
21:44bbloomdnolen: core.async is pretty general, but that's also a weakness if you really don't need the generality. consider if i wanted to write a function that returns a lazy sequence
21:45bbloomi could use lazy-seq
21:45bbloomor i could use something like yield, which is more pleasant
21:45bbloomand the return value is the iterator
21:45bbloomwhich is different than a lazy-seq, really
21:45bbloomthis lets you build new abstractions & they play nice together
21:45bbloomfor example, i could have non-determinism and yield working in the same piece of code
21:46bbloomcore.async takes over as the only abstraction you can use, this lets you install abstractions into the call stack
21:46dnolenbbloom: hum, I'd have to see an example I think. Most of the real uses cases for yield seems covered by lazy sequences and you don't have the stateful iterator which seems unidiomatic.
21:47bbloomdnolen: it's only unidiomatic b/c we don't have any tools for making it not painful to work with :-)
21:47bbloomthis is mostly an experiment
21:47dnolenbbloom: huh, so you're experiment will make stateful yield palatable?
21:47bbloomfor this to be truly useful, all of clojure's side effects, including memoization of lazy sequences, would need to be rewritten in terms of effect handlers
21:48bbloomthat's just the one simple use case you mentioned
21:48bbloomthat paper has lots more examples
21:49bbloomthey create a co-operative multithreading system w/ a round robin scheduler in like ~15 lines. that's fucking cool if you're gonna write a game & want each of your agents operate as if they had their own threads
21:49bbloomyeah, you can do that w/ core.async, but you need to write a giant bag of macros to hide the channels
21:49bbloomhowever, mostly, i'm just trying to understand this stuff. i genuinely believe that this is a real, usable alternative to monad transformer stacks
21:50dnolenbbloom: that's kind of cool, the scheduler.
21:50bbloomyeah, go check out the example. it's TINY & super clear
21:50dnolenbbloom: though I'm kinda lukewarm about schedulers on single threaded hosts like JS
21:51bbloomdnolen: their example is a dumb round robin co-operative scheduler
21:51bbloomthat's perfectly reasonable if you've got a few hundred game agents
21:51dnolenyou need to the yield the browser at some point and there's surprising complications around that
21:52bbloomyou can write a one-pump scheduler that walks all the active green threads, runs them until they yield, but all new activeness gets queued for the next frame
21:52dnolenbbloom: though you may be working on this for Clojure JVM and not CLJS so perhaps different story.
21:52bbloomshouldn't matter
21:53dnolenbbloom: what about dependent subtasks?
21:54bbloomdnolen: in a game? you just spawn entities that get added to the global entity collection. no hierarchy
21:54dnolenbbloom: ok, so shallow in this particular case
21:54bbloomyeah, that's the whole point: there are *LOTS* of different types of side & control effects you can think of
21:55bbloomthis lets them compose
21:56bbloomdnolen: ok! this works. pushing code now
21:56dnolenbbloom: interesting stuff. It's definitely the one place, game agents, where I'm not sure core.async can reasonably be applied
21:57dnolenor at least not w/o configurable dispatch ...
21:58dnolen(I'm thinking a decently large number of game agents)
21:58bbloomdnolen: https://github.com/brandonbloom/cleff/blob/handlers/src/cleff/core.clj#L114-L120
21:59bbloomdnolen: so what you'll see there is two "choice" effect instances & two handle-with clauses
21:59bbloomif you look at the definition of choose-all, you'll see i'm defining a reusable, (almost) first-class handler object
21:59dnolenbbloom: that is very interesting, if they are choice instances why do you need pas 'decide?
21:59dnolens/pas/pass
22:00bbloomdnolen: an effect instance is like a protocol, it can have multiple operations
22:00bbloomdnolen: for example state has lookup and update
22:00dnolenbbloom: k
22:00bbloomdnolen: i want to make it so you don't need to write "effect" and instead just say (decide c1) for example
22:00bbloomsyntax isn't finished
22:00dnolenbbloom: ok that's what I was wondering next - why effect vs. decide
22:01bbloomdnolen: just b/c the macros would need to have an extensible map of names to look for. haven't done that yet
22:01bbloomi need like a defeffect thing
22:01dnolenbbloom: gotcha, so effect is like >!, it has a special meaning
22:01bbloomyeah
22:02bbloomso look at line 103
22:02bbloomthe syntax for handler is that you give it neither, one, or both of (value [x] …) and (finally [x] ...)
22:03bbloomthen you give it extend-type style forms that have form "effect-instance (operation-name [args here] …) (another-op [...
22:04bbloomdnolen: then "continue" is a special IOC terminal that will execute a continuation
22:04bbloomthere is no reified continuation object in the user-facing API (at least in my implementation)
22:04bbloomthis way you can't capture the continuation, it can't escape the handler
22:19bbloomdnolen: i think i'll definitely need to give a talk on cleff at clojureNYC :-)
22:23bhaumandnolen: bloom: just opened an email from Paul Murphy from Weplaydots he's not digging it.
22:23bhaumanbbloom: ^^
22:24bbloombhauman: who's not digging what?
22:24brehautbhauman: dots game creator?
22:24bhaumanbrehaut: yep
22:24bhaumanbbloom: yeah the guy behind the dots game
22:25bhaumanbbloom: he's not digging my last post
22:25brehautthats nice for him i guess?
22:26bhaumanit's pretty freaking ridiculous
22:26bbloomyou do realize that none of us can read his email right? we're not really in a position to say what is or is not ridiculous :-P
22:26bbloomwhat's the blog link again?
22:27bhaumanbbloom: http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html
22:27bbloombhauman: OOOOH now it makes sense. you made a version of his game
22:27bbloomi hadn't seen this post
22:28bbloomhe's pissed you cloned his game?
22:28bhaumanbbloom: his wording is short and measured, but he'd like a take down or significant restructuring
22:28brehautlol
22:28bhauman"Lastly, I'm concerned that the sample code will encourage others to infringe our rights."
22:28brehautianal and all that, but wat
22:29bbloomhaven't never seen this dots game before, my initial reaction is lolsux4him
22:30brehautbbloom: its an iOS game that looks very similar. so uh, no shared assets, no shared code…
22:30bhaumanexactly
22:30brehautbhauman: just change the name
22:31sevvie"Specks."
22:31bbloombhauman: you even link to his game, he should thank you for the traffic
22:31bhaumanbrehaut: sounds good
22:31bhaumanbbloom: yeah I don't understand it
22:31bbloomi'd remove the reference to his game as well
22:31brehautyeah, clearly he doesnt appreciate the link
22:31bhaumanbbloom: I have 7000 uniques on it. it only can help him
22:32bbloom*shrug* you're not marketing this. the worst that can happen is that somebody takes your code, polishes it up, then markets that
22:32bbloomi promise you that, if his game is at all successful, he's already got 238905677835 clones
22:33jonhthis is almost exactly like a game i wrote in highschool in basic :P
22:33bbloomi'd tell him that you'd be happy to take it down if he serves you a formal takedown request, but warn him that you'll plaster the takedown request on hacker news :-P
22:34bhaumanbbloom: definitely occurred to me.
22:35bhaumanjonh: I wrote a very similar game in college
22:35brehautgiven dots is a variant on the
22:35brehaut'same' or 'stones' game
22:35brehautits hardly surprising
22:35bbloombhauman: nice post tho :-)
22:36bhaumanbbloom: thanks, took a while to write. Thats why I'm not keen on altering it
22:37bhaumanit definitely occurred to me to just make the game better with different graphics and animations
22:38bhaumanthanks for listening guys, I had a long weekend and this was just a surprise.
22:39brehautbhauman: i think if he was serious or could do anything, you probably would have got a call from his lawyer, not him?
22:39pizzasauceare there default key combinations that move the point to the top or bottom of the screen?
22:40bbloombrehaut: the life of an app/game developer is a depressing one
22:40brehautbbloom: no doubt
22:40bhaumanbrehaut: the tone is measured, hard to tell
22:40bbloombrehaut: 99% of your shit fails, and then when you have a hit, zinga or popcap or EA or somebody copies you & ruins it
22:41pizzasauceAlso, if I want to go to a specific line, is M-x goto-line the only option? Is there a a faster way to do it?
22:41brehautbhauman: i also dont have any comprehension of the us legal system other than its bananas
22:41bbloombrehaut: just remove the link to him, change the name. tell him you did so, then say "I now consider this matter resolved"
22:41bbloomer that was for bhauman ^^
22:41bhaumanbrehaut: you seem to understand it quite well
22:41bhaumanbbloom: gotcha
22:41brehautbhauman: too much time on hacker news, to my shame
22:42bbloombhauman: if he gets upity and sends you a formal takedown notice, you can deal with that then. however, he has no legal grounds to stand on really
22:42bhaumanbrehaut: no shame
22:42bbloommaybe trademark for the name? but i doubt it, considering how generic of a name it is
22:42brehautbhauman: you could also change the colors of your dots to be a noticably different pallette to his :P
22:43bhaumanbbloom: that's what I think.
22:43bbloombrehaut: i wouldn't even bother with that
22:43bbloomavoid the remote trademark infringement policy, stop doing him the favor of sending him traffic, and then ignore him
22:43brehautbbloom: im a hobby design nerd, so i'd consider it fun ;)
22:43bblooms/policy/possibility/
22:44bhaumanbrehaut: bbloom: I have a color blind friend who can't play the game, so I was planing on making some changes
22:44brehautbhauman: thats a great reason to change it up
22:44brehautbhauman: and probably a post in it on designs for the colorblind
22:45bhaumanbrehaut: skulls, runes, stars squares, the skies the limit.
22:45brehautbhauman: unicode pile of poo
22:45bhaumanbrehaut: if you have any ideas let me know
22:45bhaumanbrehaut: perfect!!
22:45bhaumanbrehaut: and irreverent
22:45bbloomi used to play hexic w/ color blind mode enabled
22:45bbloomwas much easier even tho i'm not color blind :-)
22:46brehauthaha
22:46bhaumanbbloom: what was color blind mode for hexic?
22:47bbloombhauman: http://i1.ytimg.com/vi/p-b0coskAfM/hqdefault.jpg
22:47bbloomjust put icons on everything
22:47bbloomwas more visually noisy, but easier to scan for patterns
22:47bhaumanbbloom: oh I like that
22:48bhaumani'm gonna copy it too
22:48bhaumanlet em all come after me ha ha ha ha
22:50ambrosebsTom Faulhaber is the man! Look, even type aliases have little headings :) http://clojure.github.io/core.typed/api-index.html
22:51bbloomneat
23:03bhaumanbbloom: brehaut: funny stuff, I think I will email him this http://weplaydots.com/dmca
23:03bbloomyup, that's pretty standard DMCA nonsense
23:04brehautbhauman: isnt betaworks the company that makes dots?
23:04bhaumanbrehaut: yep
23:05bbloomso i know i've seen people in here complaining about and/or praising midje. what's the consensus?
23:23brehautbbloom: i think the consensus is that some people love it and others hate it ;)
23:32amalloysounds about right. i don't know a lot of people who think midje is medium-good
23:33wolfes(inc "media lab") ; https://immersion.media.mit.edu:8080/viz#
23:33lazybot⇒ 1
23:35brehautamalloy, bbloom: midje is quite idiologic(?) about how testing and dev should be done right?