#clojure log - Aug 18 2013

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:05 `cbp: callen: adding dependencies seems straightforward, removing dependencies is the meat of the matter though

0:17 callen: `cbp: aye.

0:28 dnolen: new post http://swannodette.github.io/2013/08/17/comparative/

0:29 a 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.

0:32 bbloom: dnolen: marketing fail man, gotta post these things on a weekday around lunch time :-)

0:32 dnolen: bbloom: heh, I'm not gonna push this yet :)

0:32 bbloom: just putting it out there to get feedback, bug reports

0:33 bbloom: dnolen: you should use a particular git commit for all your links

0:34 otherwise changes to master will break your blog

0:34 dnolen: bbloom: good point

0:35 SegFaultAX: dnolen: Awesome, reading.

0:35 bbloom: s/non-deterministically select/multiplex/

0:35 both are technically correct tho, but i'd rather people actually use the word multiplex

0:35 SegFaultAX: dnolen: Have you played with RxJava?

0:36 dnolen: SegFaultAX: yeah I needed use a pretty large variety of techniques, so that's cool and hopefully people get something out of it.

0:36 SegFaultAX: I have not

0:37 bbloom: dnolen: also where's all your usual syntax highlighting? :-)

0:37 SegFaultAX: dnolen: 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

0:37 dnolen: bbloom: I couldn't get RedCarpet to do highlighting correctly with the Inconsolata

0:38 SegFaultAX: Interesting FRP library based on Microsofts Rx.Net work.

0:38 bbloom: dnolen: there are like 978357835 static site generators & they *all* suck

0:38 dnolen: i like that you stress that the auto completer process logic is totally isolated from the view

0:38 dnolen: SegFaultAX: 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.

0:39 bbloom: dnolen: 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

0:39 dnolen: SegFaultAX: 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.

0:39 bbloom: higher constant, linear scaling ::thumbs up::

0:39 dnolen: bbloom: yes, for me this is huge

0:39 bbloom: so many dividends from separation

0:40 bbloom: you can actually read the essential logic quickly, not true for most UI components

0:40 bbloom: dnolen: i'd be interested in a core.async-based implementation of the event system that's in react.js

0:40 dnolen: i could really use such a nice event layer w/o any ties to a larger library

0:40 dnolen: maybe we should get together sometime & hack on that

0:41 dnolen: bbloom: definitely!

0:41 bbloom: I sure Tims would be happy to join in as well.

0:41 bbloom: dnolen: switching to /msg & we can plan something

0:55 `cbp: what'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

1:08 callen: `cbp: streaming graphs?

1:09 `cbp: probably a websocket or some fallback streaming impl. http-kit is one of the better ways to do websockets atm.

1:09 that's assuming this graph is streaming in realtime, if it's just paging historical data, http is fine.

1:11 `cbp: callen: 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

1:13 callen: I guess it depends on how much effort you want to put into it versus how rapid you want updates to me.

1:13 if batched updates are acceptable, just use http and walk the graph forward one batch update at a time

1:13 if you truly want "broadcast changes in real-time as they come in", then websockets

1:13 you've gotta decide if it's worth the extra effort for the fanciness.

1:14 `cbp: fanciness is a big bonus :)

1:14 technomancy: what about SSE?

1:14 `cbp: Gotta convince people to use clojure because I'm selfish

1:15 callen: SSE is basically a fallback for websockets, in practical terms.

1:15 read-only though.

1:15 technomancy: callen: seems like a better fit if you don't need duplex communications

1:15 callen: there's not a lot of point in neutering the implementation prematurely.

1:15 technomancy: that is; more widely-compatible

1:15 callen: but you're right that it more apparently fits.

1:15 technomancy: yagni?

1:15 clojurebot: yagni is You Aren't Going to Need It

1:16 callen: it sounds like an internal tool, cross browser compatibility didn't seem like a priority.

1:16 if 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.

1:17 `cbp: itll be fine if it runs on chrome only

1:17 technomancy: is it really just IE? I thought it also interfered with caches and stuff

1:18 * technomancy <- a guy who has made a total of two web sites since 2009

1:18 callen: technomancy: you mean websockets?

1:18 technomancy: and one of them was https://github-percentile.herokuapp.com

1:18 yeah

1:18 cgag: what do you mean by "use http and walk the graph forward"

1:18 callen: technomancy: you don't use websockets for things that should be cached. 4rlz.

1:19 67% of Github employees have had an account longer than bitemyapp has. - god dammit.

1:19 technomancy: weak

1:19 callen: 5% of Github employees have had an account longer than technomancy has. :|

1:20 technomancy: I don't think you're including the newer employees.

1:20 I've definitely had a github account longer than half of them overall.

1:20 technomancy: callen: it's just using the public orgs API

1:20 I think members can choose not to publicize their membership

1:20 callen: given that, I feel worse :(

1:21 technomancy: anyway, yes, 50% of the web sites I've created in the past five years have been to show off

1:21 `cbp: cgag: like make an http request every few seconds get some json and update the graph I assume

1:21 callen: technomancy: proper.

1:21 technomancy: though I guess amalloy wrote like half of that one

1:21 callen: `cbp: yep!

1:21 cgag: sorry for using hooman words :(

1:21 amalloy: technomancy: like 25%

1:21 using, iirc, a suggestion/starting-point from you

1:21 technomancy: amalloy: 33% and we'll call it a deal

1:21 cgag: ah i see, i didn't see how you could push updates using just http

1:21 amalloy: sold

1:21 * technomancy shakes on it

1:22 callen: cgag: just a poll.

1:23 amalloy: technomancy: only 50% of your websites were to show off? that puts you way below the norm

1:53 `cbp: anyone got a link to some crazy project.clj with extra maven repos on it?

1:54 lynaghk: `cbp: https://github.com/technomancy/leiningen/blob/master/sample.project.clj

1:55 `cbp: thanks

1:59 amalloy: `cbp: also, `lein help sample`

2:00 `cbp: oh very good

2:17 piranha: clojure 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?

2:18 dnolen: piranha: ritz

2:18 piranha: dnolen: thanks, will look

2:24 dnolen: it seems it doesn't want to set a breakpoint :( When I press C-c C-x C-b it says 'Set 0 breakpoints'... :\

2:24 dnolen: piranha: I don't use ritz, but it sounded like what you were looking for

2:25 piranha: yeah, it sounds like what I want, it just do it... :( Thanks anyway!

2:42 callen: piranha: ritz doesn't work super well and is really awkward to use. debug-repl, if all you need is locals, might be better.

2:42 piranha: 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.

2:42 sorry

2:42 mispaste :(

2:42 piranha: http://www.clojure-toolbox.com/

2:42 ^^ there.

2:43 piranha: ah nice

2:43 callen: dnolen: 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.

2:43 piranha: callen: so I can just put a call to debug-repl in a middle of a function and that's it? :)

2:43 heh :)

2:43 callen: piranha: yes, but it only captures locals

2:43 on the bright side, it behaves like a ghetto pdb. you just evaluate code.

2:44 piranha: that's manageable :)

2:44 yeah, that's what I need mostly

2:44 callen: wasn't for me when I needed to check something :P

2:44 piranha: :))

2:44 callen: but 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.

2:44 piranha: I 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

2:44 callen: a "best of both worlds" would be killer.

2:44 piranha: I'm the same way.

2:52 piranha: fair warning, jahad's debug repl doesn't work. prolly have to use mine.

2:53 piranha: callen: you mean clojars.org/debug-repl is not working?

2:56 callen: piranha: it didn't for me. https://clojars.org/debug-repl should work.

2:57 the "real" debug-repl is on Jahad's account.

2:57 piranha: ah ok

2:57 callen: I preempted him and took the flat namespace so people wouldn't keep accidentally running into his buggy version.

2:57 I'll decorate it if/when he chooses to notice his shit is broken.

2:58 if I get a nice bottle of scotch, I may even figure out a way to add globals.

2:58 piranha: :-)

2:59 callen: I am not a fan of stacktrace based debugging like Ritz, and its particular implementation of it is particularly painful to use.

2:59 piranha: eh, java is hard :( everything's good except it's not working properly :\

2:59 callen: these weren't problems in Common Lisp, but I still love Clojure enough that it's worth it.

2:59 piranha: :-)

3:00 wolfes: are there libraries for better debugging in clojure?

3:00 callen: Ritz is the most "serious" but it's annoying to use

3:00 debug-repl is the closest thing to ipdb/pdb/pry

3:03 another thing to be aware of is locals clearing.

3:04 wolfes: I'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?

3:04 callen: wolfes: Selmer.

3:05 SeanCorfield: wolfes: have you looked at Fleet?

3:06 wolfes: SeanCorfield: not yet, looking now

3:06 SeanCorfield: at 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...

3:06 callen: Fleet is not maintained.

3:06 and it's JSP style, turns into spaghetti quickly.

3:06 wolfes: you seriously should look at Selmer.

3:07 SeanCorfield: callen: I've been tempted to help maintain Fleet. I don't think it provides enough "code" to enable spaghetti but YMMV.

3:07 callen: SeanCorfield: please try Selmer before doing so.

3:07 SeanCorfield: I'm serious, it's got just the right balance of cleanliness, power, and it makes it easy to know where data came from.

3:09 I should just write a blog post explaining this and be done with it.

3:11 wolfes: callen: 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)

3:11 callen: wolfes: 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.

3:11 http://jinja.pocoo.org/docs/ comes to mind.

3:12 wolfes: callen: thanks :)

3:12 callen: wolfes: I've used Enlive, Laser, Hiccup, etc. Selmer has made me happiest.

3:12 and it's efficient, comparable to Stencil (mustache library by dsantiago)

3:13 wolfes: if you have any problems with Selmer, make a github issue or bug yogthos or myself in here.

3:13 wolfes: callen: what were the sticking points / difficulties / things that could be better - that you encountered with the other libraries?

3:14 SeanCorfield: callen: 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... :)

3:14 callen: wolfes: usually it's one of a few design priorities.

3:15 1. 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

3:15 SeanCorfield: FW/1: https://github.com/framework-one/fw1-clj

3:15 callen: 2. You should know where all/most of the data in the template is coming from.

3:15 3. A muggle should be able to read, if not also modify, the template and not have things blow in their face.

3:16 4. 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.

3:16 5. You shouldn't have to know what a parser combinator is in order to use the library.

3:16 wolfes: SeanCorfield: 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)

3:17 callen: Enlive 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.

3:17 SeanCorfield: wolfes: I live Enlive's approach insofar as it matches "regular" CSS operations in many JS frameworks

3:17 callen: Mustache based libs violate 1, 2 if they're being clever, and 4.

3:18 oh and here's another, 6. Backend code shouldn't be tightly bound up in the HTML structure or selectors of the frontend template.

3:18 SeanCorfield: Hiccup is definitely a problem if you want designers to be able to work on your web pages :)

3:18 callen: which enlive and laser code violates prolifically.

3:18 wolfes: callen: ahh, interesting :)

3:18 callen: refactor a template class? boom goes your backend code that expected it to exist.

3:18 shit will just disappear because your frontend guy wanted to clean house.

3:19 That'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.

3:19 wolfes: yeah, what if you use a layer of abstraction over your template code so your backend code has no idea about them?

3:19 callen: wolfes: Selmer.

3:19 just use Selmer.

3:19 seriously.

3:19 SeanCorfield: callen: 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?

3:20 callen: SeanCorfield: I have no problem with AngularJS, their HTML attrs shouldn't interfere with what anybody else is doing.

3:20 SeanCorfield: also, the AngularJS stuff...is for frontend, and is *IN* the template unlike Enlive/Laser.

3:20 the person modifying the template can *see* it.

3:20 the backend code simply shouldn't have anything like an HTML class in the code. that's insane.

3:21 plus, if you use Selmer, fundamentally all the backend controller is doing is returning an associative data structure (map)

3:21 one of the nice properties about that this is that you get the frontend template *and* a JSON api for free.

3:21 because you're just getting a map and choosing whether to pass it to a template or a JSON render.

3:21 SeanCorfield: callen: methinks you're a little too aggressive in evangelizing your preferences :)

3:22 callen: SeanCorfield: I'd be less aggressive if the rest of the Clojure community wasnt in the

3:22 templating third world

3:22 piranha: well he's quite a bit right, since having html code and then what you put in there is a recipe for hard life

3:22 callen: I'm much more circumspect when the trade-offs are closer to being par.

3:22 but when it's this blindingly obvious and bad, I have no desire to accommodate barbarism.

3:23 SeanCorfield: I'm pretty certain that if you used Selmer you'd be happy. :)

3:24 SeanCorfield: like i say, i'll look at integrating it with FW/1...

3:25 callen: SeanCorfield: what's FW/1 anyway?

3:25 should I be watching your github more closely or what?

3:25 SeanCorfield: it took me quite a while to figure out how to integrate Enlive... Selmer looks easier...

3:25 callen: aha, framework-one

3:26 SeanCorfield: FW/1 was first created for CFML and is the most popular MVC framework there, so I ported it to Clojure a while back

3:26 callen: SeanCorfield: 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.

3:26 also, I'll be moving to SF soon. Are the Clojure meetups still a thing there?

3:26 SeanCorfield: as World Singles moves from CFML to Clojure, I figured it would be good to move our preferred web framework from CFML to Clojure too :)

3:27 callen: we have a monthly Dojo, a monthly SF meetup and a monthly San Mateo meetup

3:27 callen: I'm still in Mountain View at the moment, but I'll be living la vida airbnb soon.

3:28 SeanCorfield: MV is hardly far... you could easily attend the SM meetups :)

3:28 or did we have this convo?

3:28 I drive to meetups in MV from the East Bay :)

3:28 callen: prolly. I'm just saying that I'll be able to attend more regularly soon.

3:28 SeanCorfield: where's the best place to see the meetup announcements? meetup.com?

3:29 SeanCorfield: I'm out of the country for the October SF meetup so Amit will run that... he'll probably run the September meetup too

3:29 sign up on the meetup.com site (that seems obvious)

3:29 http://www.meetup.com/The-Bay-Area-Clojure-User-Group/

3:30 there's both a message board and a mailing list

3:30 callen: sweet. When did you guys switch from Weatherbill to Thoughtworks for location?

3:31 oh wait, there are two...oky.

3:31 okay*

3:31 derp.

3:32 SeanCorfield: Weatherbill became Climate Corp who host the SF and Seattle meetups

3:32 Runa host the SM meetups

3:32 ThoughtWorks host the Dojo

3:33 callen: ThoughtWorks is the consultancy that does Rails and Clojure right?

3:33 Raynes: Ola Bini works there.

3:33 That's all I know about them.

3:33 Oh, and they have that weird "here's the technologies you should adopt" thing every once in a while.

3:33 Which always makes me wonder how they became the authority on the merits of budding technologies.

3:34 SeanCorfield: ThoughtWorks turn out in force at Clojure conferences - and Strange Loop :)

3:34 Raynes: But I do <3 me some Ola Bini.

3:34 Ioke was good fun -- too bad it was slow as balls. :(

3:34 callen: Raynes: if they're promoting Clojure, I'd say go with it until they find their next favorite freeze-pop flavor.

3:34 SeanCorfield: Raynes: their "Technology Radar"... many people in the iT industry take them pretty seriously

3:34 Raynes: I'm aware, which is why I'm suddenly curious why they are taken seriously.

3:34 Don't really know the history of it.

3:36 I mean, I don't have any problem with it and generally agree with the things the radar thingy says. It's just curious.

3:36 SeanCorfield: Martin Fowler is influential :)

3:37 Raynes: $google martin fowler

3:37 lazybot: [Martin Fowler] http://martinfowler.com/

3:37 wink: confirmation bias

3:38 SeanCorfield: From 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...

3:38 wink: I pretty much agreed with the last 2 radars as well :P

3:38 SeanCorfield: It's interesting sometimes what they think is worth "the enterprise" taking a look at...

3:39 I was surprised they'd gotten RoR into the enterprise and use it so often :)

3:43 callen: "Promises for asynchronous programming" I like these people.

3:45 OTOH, they also say to adopt MongoDB. lol.

3:46 wolfes: does them saying adopt neo4j make up for that at all?

3:48 callen: meh. I know why people are keen on MongoDB, but they'd be better off with something like RethinkDB.

3:48 SeanCorfield: Some of the TW radar stuff is blindingly obvious common sense, but some of it is a little bizarre.

3:49 callen: what don't you like about MongoDB?

3:49 callen: SeanCorfield: 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.

3:50 Either you end up needing transactions, a more powerful query language, aggregations that don't suck, or a document store that doesn't suck.

3:50 RethinkDB -> document store that doesn't suck, the former three criteria fall to something like PostgreSQL

3:50 anybody that actually needs a serious way to store sparse data shouldn't be using MongoDB *or* a SQL database. That's HBase/Cassandra.

3:51 SeanCorfield: There are lots of data stores. Use the appropriate one for your problem.

3:52 callen: oh sure, but that's the problem.

3:52 by any criteria one could use to justify the use of MongoDB, there's usually a better alternate option.

3:52 Whether that be schema-free, document store, ease of use, or anything else.

3:52 This comes from years spent using MongoDB, not technological snobbery.

3:52 *years* of horror.

3:53 SeanCorfield: MongoDB works very well for us - we have documents with nested subdocuments and the aggregation framework works well for us too...

3:53 callen: in that sort of use-case, I'd just use PostgreSQL and a normalized schema, but if it works it works.

3:53 I'm not saying MongoDB can't possibly work, otherwise my aforementioned projects where I used it would've failed

3:53 I'm just saying there's usually a better option.

3:53 SeanCorfield: again, you're being very aggressive about your preferences - it doesn't do your reputation any favors since you sound very biased

3:54 callen: I think you're misinterpreting, "you could probably do better" for "MongoDB sends your data to /dev/null"

3:54 SeanCorfield: we specifically do NOT want a normalized schema ... that's why we've been migrating away from MySQL

3:54 wolfes: fwiw i don't think callen is being overly aggressive here

3:55 callen: the other thing about MongoDB, is that the more of its functionality you use, the more pain you're in for.

3:55 If you have a simple Master/slave setup, you're probably okay.

3:55 if you start using sharding, you're in for some more pain, but it might work out.

3:55 if you use replica sets, you'd better be ready to pay 10gen a lot of money to fix your database.

3:56 SeanCorfield: That'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

3:56 callen: it'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.

3:56 SeanCorfield: do you follow Aphyr at all?

3:56 SeanCorfield: How many MongoSV and MongoSF conferences have you attended?

3:57 callen: SeanCorfield: his jepsen series was pretty good and he covers the data loss scenarios of various data stores, including MongoDB.

3:57 SeanCorfield: URL?

3:57 callen: Promises for asynchronous programming

3:57 sigh.

3:57 mispaste...again.

3:57 http://aphyr.com/tags/jepsen

3:57 there is something egregiously wrong with my clipboard, I wonder what's up with that.

3:57 SeanCorfield: thanx ... will read ...

3:58 callen: as 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

3:58 ...give something (not :MongoDB) a real look.

4:00 wolfes: http://aphyr.com/posts/284-call-me-maybe-mongodb

4:03 SeanCorfield: we'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 :)

4:05 wolfes: are there other graph databases that play well with clojure besides (clojurewerks' neocons lib for neo4j)

4:05 callen: SeanCorfield: you should /nick DoktorFrankenstein

4:05 ;)

4:05 wolfes: 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

4:05 SeanCorfield: polyglot ftw :)

4:06 wolfes: ooc, do you guys use vim/emacs/sublime/light-table/other?

4:09 shdwprince: wolfes: using vim, used sublime-text in the past

4:10 wolfes: shdwprince: do you use any plugins to control your browser from vim?

4:12 callen: wolfes: Emacs

4:12 SeanCorfield: wolfes: Emacs

4:12 shdwprince: wolfes: humm.. while developing? Currently i'm not involved in webdev, so I dont. Anyway, my primary browser have vim-like behavior

4:13 SeanCorfield: wolfes: my team have also mostly switched to Emacs ... I have one hold out on Sublime Text 2 :)

4:15 wolfes: SeanCorfield: how do you go about the "change code" … "reload page in browser" cycle?

4:16 (assuming you do some type of webdev)

4:17 SeanCorfield: wolfes: that's CFML basic mode :)

4:17 callen: wolfes: auto-reload is a thing with Ring based web dev in Clojure.

4:17 SeanCorfield: and 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

4:18 callen: you...don't need to resort to that if you're using vanilla Ring.

4:18 app-reload exists with lein-ring and http-kit, etc.

4:18 it detects when files change and auto-reloads.

4:18 SeanCorfield: wolfes: World Singles has a dating platform with 50+ sites in about a dozen languages

4:18 shdwprince: wolfes: few days back I read about emmet-livestyle, its a bridge from sublime to chrome, for autoreloading

4:18 SeanCorfield: and 4M users :)

4:18 wolfes: im using ring's reload method, plus a few others i picked up looking at me.shenfeng mustache impl

4:18 callen: Selmer auto-reloads too.

4:19 cgag: i just switch windows and hit ctrl+r

4:19 wolfes: ive been working on a vim plugin that lets me reload any chrome browser with my chrome extension setup to chat with my clojure server

4:19 cgag: like a sucker apparently

4:19 wolfes: was wondering what else i should add to it

4:20 i can name tabs on the browser-side of things, and open/reload the named tabs from vim/bash/anything that sends http post reqs

4:22 Raynes: wolfes: Geni develops a graph database *in* Clojure: https://github.com/flatland/jiraph.

4:23 wolfes: However, the documentation is almost completely worthless right now.

4:23 Jiraph has mostly been rewritten over the past two years, and we haven't gotten around to updated/good documentation yet.

4:23 But there she blows nonetheless.

4:24 callen: aha, that's what I was thinking of.

4:24 Raynes: do you remember why that was done instead of Neo4j?

4:24 wolfes: Raynes: 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

4:24 Raynes: callen: Yes, they needed revisions which neo4j does not do.

4:24 laser with an s.

4:24 wolfes: oops, right :)

4:24 callen: Raynes: that's interesting.

4:26 SeanCorfield: callen: https://github.com/framework-one/fw1-clj/issues/8

4:26 :)

4:26 now i'm off to bed

4:26 see you at a future bay area meetup i hope

4:26 callen: SeanCorfield: prolly the September dojo and meetup.

4:27 I'll be Airbnb'ing it by then.

4:27 wolfes: Raynes: 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

4:28 Raynes: You're asking why laser doesn't have clone-for?

4:28 SeanCorfield: callen: looks like two dojos in september - the late august one has moved to early september

4:28 callen: I'm going to the SF one two days before the meetup.

4:28 SeanCorfield: and i may not be at the september meetup proper (on the 6th) due to conflicts

4:28 * callen nods

4:28 callen: SeanCorfield: has learning to use Emacs come up again in the meetups/dojos at all?

4:28 SeanCorfield: can't be at the october meetup... due to being in england for a cat show :)

4:28 callen: sorry, you meant to go to bed.

4:29 wolfes: raynes: 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

4:29 SeanCorfield: callen: oh yeah, getting up to speed on emacs has been a past topic - but 70% of the meetup audience uses emacs now i think

4:30 callen: SeanCorfield: the meetup I went to two years ago was the one where we got people rolling with Emacs.

4:30 Raynes: wolfes: Because I've never actually seen code that had that requirement and doing it is pretty hard.

4:31 Laser was aiming for simplicity.

4:31 SeanCorfield: callen: ok, yeah, i remember that in weatherbill's old location

4:31 Raynes: Doing that would make it far less simplistic

4:31 wolfes: Makes sense :)

4:31 callen: wolfes: what do you need clone-for for?

4:32 SeanCorfield: we use clone-for to inject profile data into our html email - each email can have 4 or 8 profiles embedded

4:32 wolfes: a 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

4:33 this 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

4:34 SeanCorfield: i'd probably do that via JS directly in the client...

4:35 callen: wolfes: that's a for loop in Selmer, but it sounds like something that would suit JS as well depending on the details of it.

4:35 SeanCorfield: clone-for is probably the thing i like least about enlive

4:36 peace out zzz

4:36 * callen laughs into his coffee and splashes it all over his face

5:55 callen: so I'm using Eclipse + CCW for the third time. This is deeply puzzling.

6:17 clj_newb_2345: I'm reading about coq dependent type checking. In particualr, google found https://sympa.inria.fr/sympa/arc/coq-club/2013-02/msg00041.html

6:18 which leads to teh question: what is ssreflect, and how does it relate to dependent types?

6:19 callen: clj_newb_2345: this is #clojure

6:19 clj_newb_2345: I'm sorry

6:20 callen: just making certain your question got the right place.

6:20 clj_newb_2345: callen: good call, otherwise I'd been waitin and wondering why no response

6:27 noncom: hi, 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"

6:27 what's wrong?

6:31 callen: noncom: you should aim that query that someone or otherwise be more specific.

6:33 noncom: callen: 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..?

6:34 callen: oh, sorry

6:34 I didn't see the same person raising the issue with the lein plugin was you asking what's wrong

6:34 misread, my fault.

6:35 noncom: :)

6:48 looks like my lein version is a bit old, i'll try upgrading

6:48 callen: noncom: good call :)

6:56 noncom: so 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

7:03 nifff: i hava a lazyseq how to force the production of each member?

7:03 (doall ) ?

7:04 i can do it with (into () lazy-seq) but its changes the type also

7:08 IamDrowsy: nifff: 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.

7:12 noncom: hmm.. 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

7:14 callen: Has anybody gotten this plugin to work? https://github.com/pyronicide/lein-autoreload

7:15 it spits stuff out that looks plausible, but when I run run-tests or run-all-tests it's using whatever I loaded manually last.

7:16 piranha: do I understand correctly that 'slurp' should just read any stream and return everything this stream contained?

7:16 callen: piranha: yes

7:16 piranha: :\

7:16 callen: piranha: usually you're passing a file handler though

7:16 piranha: what's up?

7:16 glosoli: Hello folks, I have some sort of dumb question, I got confused why defining function with def or defn doesn't seem to differ much ?

7:17 piranha: well it's either I don't understand java or ... no idea

7:17 callen: piranha: are you opening something in proc?

7:17 piranha: callen: I'm trying to write an undertow (http://undertow.io/) adapter for ring, and it's not giving me body of request

7:17 callen: glosoli: defn is sugar, use it for top-level functions.

7:17 piranha: and when I try to slurp input stream from there it's indeed empty

7:17 so this is really strange

7:17 callen: piranha: hold up

7:17 piranha: why are you writing an undertow adapter?

7:18 piranha: callen: just for fun

7:18 is there one already?

7:18 callen: okay, but be aware that http-kit exists

7:18 http-kit isn't undertow, but serves the same needs.

7:18 piranha: yeah, I know :)

7:18 callen: websocket, async, high performance, etc

7:18 just making certain.

7:18 glosoli: callen: so it's actually just a sugar with no sort of extra capabilities ?

7:18 piranha: ah, right, that was just for fun :) so that I could learn a bit of stuff

7:19 but 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

7:20 java is so verbose that it's hard to track things :\

7:20 callen: glosoli: why not just look at how it's implemented?

7:20 noncom: glosoli: defn is more than def+fn, but it has nothing that you couldn't make yourself with clojure. just look at the source

7:21 piranha: callen: 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 :-)

7:21 glosoli: ok thanks, gonna do that, not used to doing that so kinda did not even think of it

7:22 callen: glosoli: 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.

7:22 it'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.

7:22 lol *PyObject

7:27 glosoli: Considering 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

7:34 supersym: glosoli: I didn't know any functional programming or Lisp before I started clojure... you'll get the hang of it indeed

7:35 personally, I like to use monads a lot for exactly the purpose of readability

7:35 glosoli: supersym: Emm I don't even know what monad is yet..

7:35 supersym: its like a pipeline for functions

7:38 ,(first (take 2 (list 1 2 3 4)))

7:38 clojurebot: 1

7:38 supersym: so stuff can get rather unreadable at times, so you could also write

7:38 ,(->> (list 1 2 3 4) (take 2) (first))

7:38 clojurebot: 1

7:39 supersym: and just position them vertically, instead of one line like I did here

7:39 the value gets piped through those functions on the last argument

7:40 glosoli: Hmm so that's monad ?

7:40 callen: glosoli: no.

7:40 glosoli: Nah I should seriously read about it, sorry :)

7:42 supersym: callen: not? threading macro, I thought was a monad... guess I dont know stuff either :P

7:42 callen: it's not a monad.

7:42 it solves a similar'ish problem as you could potentially use a monad for

7:42 but it's not a monad.

7:43 a monad obeys the monad laws, and has bind and return.

7:43 supersym: ok well the wikipedia definition is broad enough

7:43 right

7:43 another thing learned.. :)

7:44 callen: a 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.

7:45 supersym: ah

7:45 I see

7:45 callen: or more accurately, passing data into, and receiving data out of that context.

7:45 supersym: no binding taking place here

7:45 callen: don't

7:45 don't conflate words.

7:45 "bind" in monads is not "bind" in Clojure.

7:45 supersym: ok

7:46 * supersym paying attention

7:46 callen: it's best to just read up on it.

7:46 I'm not giving another monad tutorial.

7:46 supersym: haha no worries... already on it

7:50 guess as good a time as any to learn the ropes of algo.monads

7:51 callen: I'm not sure that library is a good way to learn how monads work.

7:52 supersym: nah 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

7:53 we'll see

7:53 clojurebot: Excuse me?

7:57 shdwprince: we'll see

7:57 humm

8:16 piranha: supersym: if you care about monads you might be interested in looking at fluokitten

8:19 supersym: piranha: thanks for the tip

8:52 jtoy: what 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#)]))

9:00 callen: jtoy: I could tell you, or you could learn by trying it in a repl.

9:00 jtoy: is that from a macro?

9:08 jtoy: generally trailing # is use to automatically gensym a name in a macro so as to keep the macro hygienic.

9:14 jtoy: it wasnt a macro though

9:32 jcromartie: When using Emacs Live and nREPL, how do I make C-c C-z open the REPL in the *other* window

9:32 it used to do this with plain vanilla Emacs + nREPL

9:39 functional_lunat: And do M-x nrepl jack-in

10:01 crocket: Does ClojureScript have a working sourcemap?

10:01 callen: crocket: probably in seangrove's wheelhouse. I think it's out there.

10:54 germanmushroom: I'm trying to have some fun with clojure and overtone and got stuck at something probably really basic

10:55 callen: germanmushroom: don't ask to ask, just ask.

10:55 germanmushroom: Why does (dotimes [i 10] (+ i 200) return nil? I'd like to somehow get it in some kind of list

10:56 callen: germanmushroom: don't use dotimes if you don't want it to return nil.

10:56 germanmushroom: dotimes is for side effects.

10:56 germanmushroom: is there a better suited loop?

10:56 callen: germanmushroom: get in the habit of using (doc fn) on your functions to understand them better.

10:56 there's not really "one true loop, and in the darkness bind them" Clojure

10:57 you make a choice based on what makes sense for what you are doing.

10:57 if you're applying an fn to each member of a collection, probably map is fine.

10:57 there's also things like for.

10:57 germanmushroom: (defn pitches [] (concat [500 1500]

10:57 (dotimes [i 10]

10:57 (+ 400 (* i 200)))))

10:57 that's what I'd like to do

10:58 callen: germanmushroom: where's your book?

10:58 noncom: ,(mapv #(+ 400 (* % 200) (range 10))

10:58 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

10:58 noncom: ,(mapv #(+ 400 (* % 200) (range 10)))

10:58 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$mapv>

10:58 noncom: ahaha

10:58 callen: noncom: not your day mate.

10:58 noncom: ,(mapv #(+ 400 (* % 200)) (range 10))

10:58 clojurebot: [400 600 800 1000 1200 ...]

10:58 noncom: :D

10:59 germanmushroom: I'm reading the joy of clojure, but figured I'd experiment some on my own

10:59 noncom: germanmyshroom: callen is surely right - everytime you pick that type of collection-processing function that fits you needs

11:00 they're all distinct and serve their very purposes. as they say, they are "orthogonal"

11:01 callen: germanmushroom: it might be worth realizing that some of Clojure's design was allergic to producing another Common Lisp LOOP macro.

11:01 which was uh...formidable.

11:01 I don't think anybody actually understood 100% of how it worked.

11:01 you could spend a whole weekend finding funny new ways to use it.

11:02 germanmushroom: I'm completely new to lisp and functional coding so I'm having a pretty hard time

11:02 thanks for the help though, I'll look into map

11:02 noncom: afaik clojure strongly prefers Longs in its calculations, so why does that return Integer?:

11:02 ,(count [1 2 3])

11:02 clojurebot: 3

11:02 noncom: ,(type (count [1 2 3]))

11:02 clojurebot: java.lang.Integer

11:03 noncom: that means another extra type-conversion if i base some my calculations on, say (count).. idk maybe some other funcs return Integer too

11:03 anyone has ideas on that?

11:04 germanmushroom: just remember that it all is extremely logical and practical. there is as little esoterics as possible.

11:04 callen: germanmushroom: buuuut it helps to understand some of how the brick and mortar fits together just as a way to guide your thinking process

11:04 not because there are any traps built into the design.

11:04 noncom: (although i'm saying that esoterics is illogic and impractical)

11:05 is there a type hint for atom?

11:08 callen: ,(class (atom {}))

11:08 clojurebot: clojure.lang.Atom

11:08 callen: noncom: how exactly did you think type hints worked?

11:08 they're not magic, just the class of the instance.

11:08 noncom: well, right :)

11:09 (defn ^int [] 4)

11:09 oh wrong window, lolcode

11:10 pandeiro: how can one build _just_ the cljs runtime into a js file, w/o any additional ns or files?

11:11 noncom: ,(type nil)

11:11 clojurebot: nil

11:11 noncom: wtf?

11:11 ,(type java.lang.Void)

11:11 clojurebot: java.lang.Class

11:11 noncom: ,(type null)

11:11 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: null in this context, compiling:(NO_SOURCE_PATH:0:0)>

11:12 noncom: why (type nil) is simply nil

11:12 hyPiRion: nil has no type

11:12 noncom: ?

11:12 oh

11:13 hhyPiRion: do you know why does (count) return Integer?

11:13 hyPiRion: nil represents nothing.

11:13 noncom: and not Long

11:14 i always thought that null and void are types

11:15 hyPiRion: noncom: 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:16 noncom: very unfortunate since that can imply loads of typecasting for some kinds of calculations...

11:17 with clojure so leaning toward longs

11:22 can i typehint generic types? like List<Node> ?

11:22 pandeiro: would it not be a useful thing for clojurescript to include a pre-compiled js file in the repo with every release?

11:22 for using with clojurescript-specific tools like lighttable?

11:23 noncom: pandeiro: i think you have to ask dnolen when he is here or someone else from cljs team

11:23 pandeiro: well i didn't want to ping him on a sunday but...

11:23 :)

11:23 noncom: try tomorrow? :)

11:23 dnolen: noncom: generic types are a fiction

11:23 pandeiro: oh speak of the devil

11:23 noncom: oh..

11:24 dnolen: pandeiro: precompiled JS of what?

11:24 pandeiro: dnolen: cljs.core etc

11:24 no additional namespaces

11:24 noncom: so i typehint simply List then i guess

11:24 dnolen: noncom: yes

11:24 noncom: thanks!

11:24 pandeiro: ie for integration with lighttable, which has builtin cljs support if you provide the built js file

11:25 dnolen: pandeiro: I don't think that really makes sense for CLJS, but perhaps for tools that use it like cljsbuild

11:25 pandeiro: i can't figure out how to make cljsc or lein-cljsbuild build a js file with no additional app ns

11:26 basically it would be the 'runtime', precompiled

11:28 noncom: does clojure compiler try to typehint automatically when possible?

11:29 steveeq1: I 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:29 noncom: for example if i have something like (defn ^Texture2D texture-2d [width height format] (Texture2D. width height format)) - then is the ^Texture2D typehint necessary?

11:29 steveeq1: personally i would use some db like mongo and avoid schema troubles at all

11:31 squidz: does 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:31 TEttinger: noncom, turn on *warn-n-reflection* maybe?

11:31 *on

11:32 noncom: squidz: 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:33 TEttinger: yeah, could do..

11:33 squidz: noncom: I mean a library. It does relate to javascript. I am looking for a clojurescript alternative to jqueryUI

11:33 steveeq1: noncom: thank you. Will check out mongo

11:33 pandeiro: squidz: did you search the closure lib to see if it already has that type of widget?

11:33 noncom: squidz: 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:34 TEttinger: squidz, I'm interested in JS bindings for clojure a bit too. will look

11:34 noncom: tell me if you find something though )

11:34 squidz: I 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:35 http://docs.closure-library.googlecode.com/git/class_goog_ui_DatePicker.html

11:35 noncom: steeveq1: 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:35 squidz: So i\ve found that, but dont know how to actually create it

11:37 noncom: steeveq1: 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:38 TEttinger: http://closure-library.googlecode.com/svn-history/r1430/docs/class_goog_ui_DatePicker.html

11:38 gah

11:38 beat me to it

11:39 squidz: haha 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:42 it'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:44 TEttinger: squidz, http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html

11:47 squidz: okay nvm I found an example here: https://github.com/hhutch/cljs-closure-demos/blob/master/datepicker/src/datepicker/core.cljs

11:49 TEttinger: squidz, phew. that's not nearly as far from the original as I thought it might be.

11:50 squidz: yeah it's pretty 1-to-1

12:14 ka_: i have a question for "->>" macro. why isn't "([x] x)" implemented, although "->" macro implements it?

12:16 could anyone answer my question? thanks.

12:19 hyPiRion: ka_: It was overlooked from what I know. Has been discussed on the mailinglist.

12:20 callen: Michael Klishin is a fucking hero.

12:20 that was the fastest PR merge I've ever had that wasn't prefaced with prior conversation.

12:23 ka_: hyPiRion: thanks for your response. where can i read the mailing list for that?

12:25 hyPiRion: ka_: oh dear, that's ages ago. Anyway, they have been fixed for 1.6

12:25 *that has

12:26 I can see if I can dig it up, but "->>" is in general hard to search for

12:27 ka_: hyPiRion: okay, i see. thanks a lot for your kindness.

12:29 dnolen: new 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:30 hyPiRion: ahh, yeah, it's impossible to search for unfortunately

12:31 or close to impossible, at least.

12:44 `cbp: damn these project.cljs why make it so hard to parse =P https://github.com/nathanmarz/storm/blob/master/project.clj

12:47 H4ns: is there an efficient way to access a byte array (byte[]) from clojure?

12:47 dnolen: H4ns: same as any other primitive array, aget, the array just needs to be type hinted

12:48 H4ns: dnolen: ah, ok. thanks!

12:48 dnolen: (let [^bytes xs] (aget xs 0))

12:48 matthavener: dnolen: i really love the literate style walkthrough of code

12:48 dnolen: matthavener: thanks!

12:56 noncom: dnolen: the links are same ^^

12:56 dnolen: noncom: oops just pasted twice on accident

12:58 `cbp: eval'ing the sample defproject gives me UnsupportedOperationException nth not supported on this type: PersistentArrayMap clojure.lang.RT.nthFrom (RT.java:857) -__-

13:00 callen: `cbp: what are you trying to do man?

13:00 `cbp: treat it like a native bit of code?

13:00 `cbp: did you look at how Ritz does this?

13:01 `cbp: callen: nope i did not look at ritz but defproject only defines a map where i can extract the deps and extra repos from

13:02 callen: `cbp: good thought. I think Ritz already does this. (processing project.clj)

13:05 `cbp: when you tried to eval defproject, did you do it the same way Leiningen does?

13:07 `cbp: callen: great question. It could also be window's evil carriage returns breaking everything in random ways.

13:07 callen: god help you.

13:14 papachan: somebody have done a clojure rest api with distributed processs?

13:14 callen: papachan: need a little more detail

13:15 papachan: like a classic rest api, but with distributed process for each services?

13:15 each service url own its own process?

13:18 callen: papachan: that's a somewhat nonsensical request.

13:18 papachan: SOA can be done in any language, are you concerned with concurrency...or something else?

13:19 Most services running on the JVM run in a single JVM process, with threads for handling work concurrently.

13:19 `cbp: callen: 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:20 callen: `cbp: well...stop doing that. :P

13:20 `cbp: callen: I wanted a worst case scenario defproject :(

13:20 callen: you've apparently got it.

13:21 `cbp: just cut out the bit causing the error.

13:23 seangrove: `cbp: Why are you parsing project.cljs?

13:23 noncom: which links?

13:24 callen: seangrove: I told him he should.

13:24 noncom: seangrove: for that post : http://swannodette.github.io/2013/07/12/communicating-sequential-processes/

13:28 `cbp: seangrove: to inject/remove dependencies newly added/removed on project.clj onto the classpath without restarting the repl

13:29 callen: seangrove: he asked for something to do, among other things, I suggested upgrading pomegranate to be awesome.

13:30 dnolen: I really like the literate format of your blog posts. It's done better than most in that style.

13:31 noncom: what is the typehint for java enums? simply ^MyEnum?

13:32 callen: noncom: we've been over this, surely.

13:32 it's whatever the class is.

13:32 noncom: yes, it show that

13:32 just thought i'd ask

13:32 fredyr: dnolen: nice post, fwiw i'm trying some out some of your ideas w/ frp

13:33 dnolen: but i'm having trouble keeping up, still on your first posts

13:33 :)

13:35 noncom: and i'll read it tomorrow.. i really gonna try exploring these techniques in my apps

13:39 dnolen: callen: thx!

13:40 fredyr: 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:40 callen: dnolen: were you involved in that NYT NYC construction visualization?

13:40 `cbp: callen: oh theres a missing vector in the sample, in :repositories

13:40 dnolen: callen: was not, pretty cool tho

13:40 callen: `cbp: that's a pull request. and a paddlin'.

13:40 `cbp: :|

13:41 callen: bug in your sample documentation? that's a paddlin'.

13:41 PR fails tests? that's a paddlin'.

13:41 bikeshedding in PR about API refactors? that's a paddlin'.

14:09 noncom: i'm typehinting my code for speed. now it looks awful, see https://www.refheap.com/17737 . is that normal?

14:10 callen: noncom: 'ish. reformat as necessary. Why so much type-hinting? Did the compiler call those out?

14:10 don't add any type hints the compiler doesn't call out.

14:10 `cbp: noncom: does that work? I dont think you can hint primitive types

14:11 noncom: ok, 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:11 `cbp i tried hinting primitives it worked..

14:11 although im not sure in anything right now

14:15 oh only long and double primitives are supported. such a luck. especially for java heavy-calculation float-based library

14:15 callen: noncom: normally you'd be using doubles for that.

14:15 noncom: sure, but the library is float-based and its not my will

14:30 callen: noncom: could change it.

14:30 noncom: work looking into how similar libraries have solved this problem too.

14:32 noncom: callen: 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:32 the 3d opengl one. that kind of stuff that is usually unparalleled

14:37 oh 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:37 bbloom: noncom: assign the contents of the atom to a local & type hint the local

14:38 noncom: and 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:39 bbloom: uhhh.. i think i will have to do that..

14:39 bbloom: noncom: you can also define a helper fn that is hinted

14:40 noncom: like (defn ^Application the-app [] @app) ?

14:40 bbloom: (defn ^Thing deref-thing [x] @x)

14:40 sure

14:40 noncom: :)

14:40 i guess that is more good

14:40 thanks

14:49 mnemnion: does 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:50 callen: you could just generate a large file. I'm sure the existing stuff on edn has acceptance testing.

14:51 mnemnion: I suppose I could. On an IRC channel full of Clojurians, it seemed possible someone had just the thing in a repo somewhere.

14:52 JSON is luxuriantly abundant. edn not so much.

14:53 callen: well, I've done my OSS penance this weekend already

14:53 so you're not going to Tom Sawyer me into something *that* boring.

14:54 mnemnion: I am, in *no*sense*, asking anyone to generate anything. At all, good sir.

14:56 https://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:56 callen: mnemnion: sorry I couldn't be more helpful, just figured you'd know of edn-format/*

14:57 mnemnion: comes a point, you want to feed your code data from the wild. I'm rapidly getting there. No problems.

15:00 callen: mnemnion: you could try being clever and just use the github search to scrape example edn data

15:01 and just run all of it through your parser.

15:02 mnemnion: what's this parser written in?

15:02 mnemnion: It's written in Instaparse, hence, Clojure. I'll release it in a couple days.

15:02 For anyone playing along at home I did eventually find this: https://github.com/shaunxcode/edn-tests

15:03 which looks, y'know, great.

15:06 hyPiRion: mnemnion: heh, Instaparse is fairly memory hungry

15:07 mnemnion: it's a beast!

15:08 hyPiRion: On a 400k file I had, with ~400 rules, it used 19-25 GB

15:08 *400kB file

15:08 mnemnion: GLL is tricky, and will blow up on you at the slightest provocation.

15:09 hyPiRion: yeah, I know. It's a scary thing to use if you don't know the internals or the "don't"s

15:09 bbloom: use the "parses" function & see if you've got a wildly ambiguous grammar

15:09 mnemnion: I 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:10 I don't know that he weights them at all at the moment. Instaparse is new.

15:11 I 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:12 bbloom: that's what i really like about generalized parsing: gets you to "working" fast

15:12 even if it's working slow :-)

15:12 mnemnion: having negative lookahead helps a lot.

15:13 bbloom: feels the same as dynamic typing, lisps etc: two languages in one! a language for writing programs fast & a language for writing fast programs

15:13 mischov: mnemnion: You could look around for datomic examples. That's got some .edn files around but probably not "reasonably large"

15:13 fredyr: hmm, how can i create an js object literal in clojurescript_

15:14 mischov: mnemnion: https://github.com/Datomic/day-of-datomic/blob/master/samples/seattle/seattle-data0.edn for example

15:14 bbloom: fredyr: js-obj

15:14 grep for that, you'll see a usage example

15:14 mnemnion: mischov: thanks!

15:15 fredyr: bbloom: oh, thanks

15:15 mischov: mnemnion: no problem, hope it helps

15:17 callen: mischov: nice :)

15:17 mnemnion: but seriously, just search for *.edn and sort by size.

15:19 TEttinger: what, 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:19 hyPiRion: TEttinger: yeah

15:20 Well, "server" as in my desktop workstation.

15:21 bbloom: hyPiRion: 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:21 it's pretty easy to accidentally write an absurdly ambiguous grammar

15:21 TEttinger: hyPiRion, 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:22 so it boggles my mind that one app can use 25

15:22 hyPiRion: bbloom: yes, I know :) It's not absurdly ambiguous, but there are a lot of rules and many of them match very few characters

15:35 noncom: if i have this kind of call (defn ^ReturnType wrapper-fn [^JavaObject java-object java-float] (.javaMethod java-object java-float))

15:35 is it benificial to typehint java-float with ^double?

15:36 ^float does not exist in clojure, but what if i typehint with ^double?

15:37 shiranaihito: i 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:37 Apage43: can't you do ^Float/TYPE ?

15:37 shiranaihito: (i'll call it like "yaml/load" anyway)

15:38 hyPiRion: shiranaihito: (:refer-clojure :exclude [load]) in the ns-declaration

15:39 shiranaihito: hyPiRion: and with that, everything will be alright? :)

15:39 hyPiRion: (you can still call it as clojure.core/load)

15:39 yeah, you just won't be able to call clojure.core/load in that namespace by only writing "load"

15:39 shiranaihito: ok, cool, thanks!

15:41 noncom: Apage43: does not work.. strange, but in that usage it says it cannot resolve the classname

15:41 Apage43: ah

15:41 noncom: but

15:41 Apage43: guess that only works with actual classes

15:41 noncom: ,(type java.lang.Float/TYPE)

15:41 clojurebot: java.lang.Class

15:41 Apage43: you can at least make a float -array- that way

15:42 yeah, boxedtype.TYPE is a pretend-class for the primitive

15:42 http://docs.oracle.com/javase/6/docs/api/java/lang/Float.html#TYPE

15:42 noncom: Apage43: maybe you know the mystery on why there are no ^int and ^float hints possible?

15:43 TEttinger: ,(let [x ^float 2.4] x)

15:43 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Metadata can only be applied to IMetas>

15:44 TEttinger: ,(let [ ^float x 2.4] x) ; you don't need to with primitive initializers

15:44 clojurebot: #<CompilerException java.lang.UnsupportedOperationException: Can't type hint a local with a primitive initializer, compiling:(NO_SOURCE_PATH:0:0)>

15:44 Apage43: I don't

15:44 You can get a float array

15:45 ,(into-array Float/TYPE [1 2 3])

15:45 clojurebot: #<float[] [F@10f7074>

15:45 Apage43: but there isn't a way as far as I can tell to work with just plain unboxed floats

15:45 hyPiRion: ^floats perhaps?

15:45 TEttinger: ,(let [x (float 2.4)] x) ;

15:45 clojurebot: 2.4

15:45 TEttinger: there you go

15:46 Apage43: true, you can *get* a float that way, but that quickly becomes a Float

15:46 actually I believe that just returns a Float

15:46 TEttinger: (defn ^ReturnType wrapper-fn [^JavaObject java-object java-float] (.javaMethod java-object (float java-float)))

15:46 how about that?

15:47 Apage43: if javaMethod expects Float, rather than float, that would succeed (but still reflect.)

15:48 noncom: TEttinger: i'll try and hope that it will avoid reflection

15:52 shiranaihito: is 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:54 TEttinger: shiranaihito, your IDE isn't using leiningen?

15:55 shiranaihito: TEttinger: 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:55 besides, it's kind of sad that _everything_ has to happen through one specific tool

15:56 TEttinger: which IDE?

15:59 shiranaihito: IDEA

16:03 Raynes: shiranaihito: Why is that sad?

16:03 shiranaihito: Raynes: it shows that working without this specific library would be too cumbersome

16:03 erm.. tool, rather

16:04 but 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:04 TEttinger: shiranaihito, IDEA really should be calling -main

16:04 Raynes: Leinignen is pretty amazing. You're going to be hard pressed to find people who fee the same as you.

16:04 shiranaihito: TEttinger: that may well be, but it's not

16:04 Raynes: leiningen*

16:04 feel*

16:04 * Raynes slaps himself awake.

16:04 shiranaihito: Raynes: i'm not saying lein is not great.. i'm saying it's sad that lein is _needed_

16:04 TEttinger: ah I get ya

16:05 zmansiv: whenever 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:05 any one have any ideas? the file definitely exists and if i start a REPL and load the file it works fine

16:06 arcatan: we 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:06 TEttinger: 1.clj?

16:06 zmansiv: yeah that's the name of the file

16:06 TEttinger: maybe there's some java restriction with numbers as the first char in a name?

16:06 zmansiv: that did occur to me so i tried changing it to one.clj and the same issue occured

16:07 TEttinger: oh ok

16:07 shiranaihito: arcatan: 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:07 it's really kind of crazy that clojure is simply not used without lein

16:07 TEttinger: because it would be stupid for them to make two project configurations to test a really rare use case?

16:07 zmansiv: i 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:08 TEttinger: lein just builds on maven for dependencies

16:08 Raynes: Well, 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:08 shiranaihito: zmansiv: have you tried running "deps" from your IDE? is your IDE using lein 2.3.1?

16:09 noncom: shiranaishito: 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:09 shiranaihito: Raynes: 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:09 noncom: i encourage you to understand philosophy that stand behind that phenomenon

16:10 Raynes: I 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:10 shiranaihito: And I'm saying that's a silly thing to think.

16:10 zmansiv: shiranaihito i do have lein installed but i don't know if my IDE uses it at all

16:10 Raynes: *shrug*

16:10 zmansiv: i'm brand new to clojure so sorry if i'm missing something very obvious

16:10 shiranaihito: noncom: i expect i'll "accept" the way things are sooner or later

16:11 noncom: btw: 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:11 shiranaihito: Raynes: we're programming in Clojure, not "programming in Leiningen" :P

16:11 TEttinger: I think if there was an incompatible competitor to lein, it wouldn't be used

16:11 Raynes: You're also programming in Clojure, not in IDEA.

16:11 noncom: i know at least one person (mikera) whom i consider to be good at clojure and who is not using lein

16:11 shiranaihito: noncom: IDEA does have some support for lein, but it's not complete yet

16:11 TEttinger: because 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:12 Raynes: You program in C#, not Visual Studio. C/C++, not Make. Ruby, not Rake and Rubygems.

16:12 Etc.

16:12 wolfes: abstraction++

16:13 noncom: anyway, 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:13 H4ns: what is the canonical "has more items" test for a seq?

16:13 TEttinger: shiranaihito, 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:13 Raynes: The point is that you need a way to manage your dependencies and build your code.

16:13 shiranaihito: Raynes: not using IDEA wouldn't prevent me from working with Clojure though

16:13 Raynes: What do you want besides lein for that?

16:13 shiranaihito: not using lein effectively would

16:13 ?

16:14 Raynes: I 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:14 noncom: shiranaihito: i know ppl who are very good at clojure and who do not use lein. they use, afaik, ant+maven

16:14 shiranaihito: well, as i already acknowledged, lein is used _at least_ because no one would want to deal with the JAR mess

16:14 Raynes: There is also maven, gradle, ivy, etc.

16:14 noncom: shiranaihito: have you programmed java before clojure?

16:14 TEttinger: yeah, java's classpath is a mess

16:15 arcatan: if you have multilanguage project and want an unified build system, then leiningen might fit your needs

16:15 Raynes: People use leiningen because it's better.

16:15 arcatan: (it's a trade-off)

16:15 shiranaihito: noncom: i see.. well, maybe i'll look into that later on

16:15 yep, i've used java before, for years

16:15 noncom: then you know the classpath pain..

16:15 shiranaihito: (and i hated maven)

16:15 callen: shiranaihito: there are clojure integration plugins for IDEA and Eclipse, both support Leiningen.

16:15 Raynes: So did most Clojure programmers, hence Leiningen.

16:15 shiranaihito: callen: i'm already using one :)

16:15 callen: believe me, I don't care.

16:16 I'm just saying the option exists.

16:16 noncom: why you hate maven? i heard that so many times... because of xml? :)

16:16 shiranaihito: callen: well why bother talking to me if you don't want to hear me respond? :P

16:16 callen: I'm here to help you, not listen to talk to about your tools.

16:16 I was mentioning what options exist.

16:17 shiranaihito: oh come on.. i'm not here to receive your passive-aggressive hostility

16:17 you can't offer a helping hand and then lash out at someone for grabbing it

16:18 callen: I'm...it's okay.

16:18 shiranaihito: yep

16:18 callen: I'm just explaining that I don't care, to save you the effort. There's no malice.

16:19 shiranaihito: dude, 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:20 Raynes: Okay.

16:20 You never answered my question above. :(

16:20 shiranaihito: it's weird to pretend to help someone just to lash out at him for then responding

16:20 callen: it's not...lashing out

16:20 Raynes: Meet callen. It's best to forget about it now and move on.

16:20 There's a whole world out there for the taking.

16:20 callen: you were complaining about Leiningen, I mentioned two options for avoiding direct contact.

16:21 Raynes: We can't focus on the past if we are to have a future!

16:21 shiranaihito: callen: "believe me, I don't care." <-- this, was lashing out.. in case it was unclear to you.. which i seriously doubt

16:21 but yeah, if talking to people is _that_ taxing, then maybe you should reconsider doing it

16:21 wolfes: i read it as "i dont care which options people take, but here's several"

16:22 Raynes: I think you're really far too offended by this.

16:22 People say shit on the internet.

16:22 shiranaihito: wolfes: 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:22 callen: guys

16:22 Raynes: Oh my God, who cares.

16:22 callen: it doesn't merit this much meta discussion.

16:22 Raynes: Move onnnnnnn.

16:22 :p

16:22 shiranaihito: Raynes: i'm not exactly offended.. i'm annoyed at this whole mess



16:22 shiranaihito: annoyed at how people behave

16:22 callen: </Depeche Mode>

16:22 Raynes: There is no *mess*.

16:23 I asked you a direct question because I'm trying to understand your problem.

16:23 shiranaihito: Raynes: but yeah.. you have a point in that lein is useful etc

16:23 Raynes: And instead you're complaining about callen.

16:23 callen: he has more than a point

16:23 Raynes: I can't help you if you can't help me.

16:23 callen: Leiningen is the one true savior to us all.

16:23 shiranaihito: Raynes: 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:23 Raynes: Well, that is wrong, fwiw.

16:24 You can use maven, ivy, gradle, etc if you really want to.

16:24 Most people don't because they pale in comparison to leiningen.

16:24 callen: some people with weird legacy deployments will do so.

16:24 shiranaihito: Raynes: 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:24 Raynes: But check out clojure-maven-plugin.

16:25 Anyways, if IDEA is failing to handle something, it's very unlikely that leiningen is the problem.

16:25 It's probably somewhere between the IDE and the leiningen -- in the plugin itself. And problems should be reported as bug reports, if possible.

16:25 noncom: callen is a nice guy actually

16:25 Raynes: I can attest to this. I've spent time with him in personal.

16:25 person*(


16:26 callen: Raynes: you no pay keyboard enough. Keyboard union start misinterpreting key press.

16:26 shiranaihito: Raynes: true, there are problems with the integration

16:27 callen: shiranaihito: just so you're aware, IDEA does a very poor job of maintaining their plugin.

16:27 shiranaihito: but .. are there any global variables that lein sets before running -main? .. i could check for one's existence

16:27 Raynes: Unfortunately.

16:27 callen: shiranaihito: most people end up using Eclipse + CCW if they want an IDE.

16:27 Raynes: Global variables!?!?!?! What is this!?!?!?!

16:27 shiranaihito: callen: .. dare i respond? :P

16:27 `cbp: callen: 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:27 * Raynes explodes into flames

16:27 callen: `cbp: awesome. Thank you.

16:27 shiranaihito: respond when it terminates in a ?

16:28 Raynes: Usually indicates a question!

16:28 callen: `cbp: let me know when classpath purging works :D

16:28 noncom: and just to complement the topic: i know the IDEA developers company personally. they're VERY opionated, excuse me.

16:28 shiranaihito: Raynes: hm.. well yeah.. :p

16:28 noncom: s/opionated/opinionated

16:28 shiranaihito: Raynes: something like *lein-whatever* .. but i guess not

16:28 zmansiv: noncom jetbrains doesn't like clojure?

16:29 Raynes: Jetbrains never developed the plugin, iirc.

16:29 Just random people.

16:29 piranha: callen: 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:29 noncom: they 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:29 piranha: this was hard to discover... I wonder if I should report it as a bug )

16:29 Raynes: And 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:29 zmansiv: Raynes vendor on la clojure is listed as jetbrains

16:30 shiranaihito: zmansiv: true.. but was it originally made by someone else?

16:30 noncom: actually they're nice and intelligent, but you can expect various unexplained "unsupported" things from them

16:30 zmansiv: noncom i looked into kotlin and wasn't really impressed at all, very surprised because jetbrains usually makes awesome stuff

16:30 callen: Raynes: we ravaged the Jetbrains representative on Hacker News that showed up to talk about IDEA in a Clojure thread.

16:30 Raynes: *ravaged* him for lying about their awesome plugin ecosystem.

16:30 zmansiv: shiranaihito that could well be the case

16:30 callen: there are github issues 3 years old, no response, no nothing on their repo.

16:30 piranha: whoa. hrm. well definitely lean towards reporting/documenting things :P

16:30 piranha: :-)

16:31 zmansiv: callen do you have a link to the thread

16:31 noncom: yes, 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:33 shiranaihito: noncom: kotlin meant for marketing.. how?

16:33 piranha: callen: I can complain to a guy working in Jetbrains :-)

16:33 don't know if that will change anything though :)

16:33 shiranaihito: it would be interesting to see the HN thread though

16:33 callen: zmansiv: https://news.ycombinator.com/item?id=6190610

16:33 piranha: ^^

16:33 zmansiv: thanks

16:34 callen: La Clojure (IDEA) is horrifically unmaintained and the PR person did a really shit job of making excusees.

16:34 you can't explain away multiple unresponded-to/unfixed Github issues from a *commercial* company.

16:34 3 year old ones.

16:34 noncom: shiranaihito: 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:34 and i saw their ppl

16:34 callen: I say this realizing IDEA is probably the best choice for Java, but their Clojure plugin needs a ton of love.

16:34 noncom: and what they do and what they say

16:35 i heard their arguments why kotlin is goos

16:35 s/goos/good

16:35 shiranaihito: hmm

16:35 noncom: as a programmer, i dissmiss them totally

16:35 callen: it's incredibly unlikely a commercial entry into the JVM language space would be successful, especially if it's so similar to Java.

16:35 people that want a Java++ can use Scala, non-muggles can use Clojure.

16:35 noncom: they try to get success by making something like Scala but as simple as java

16:36 zmansiv: yeah there's no way kotlin is going anywhere

16:36 callen: if you want simple Scala, just have the company firewall block the download of any Scalaz or Shapeless jars.

16:36 noncom: on 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:37 callen: I'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:37 Raynes: callen: I had a Scala programmer tell me a few days ago "If you ever Scala, Scalaz."

16:37 callen: Not when people have already dumped a bunch of effort into Akka.

16:37 Raynes: I was like *snerk*

16:37 callen: Raynes: I showed you what Scalaz looks like :P

16:38 also, idiot PR guy not understanding that it's not about 'free', but about being able to own your tools.

16:38 noncom: actually 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:38 ivan: eh 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:38 callen: I'd happily pay for a copy of IDEA if it came with the source.

16:38 noncom: maybe that's too opinionated too.. but i felt that

16:40 callen: incidentally, there are Lisp dialects that live close to asm.

16:40 mostly GOAL.

16:40 noncom: ivan: it is very wrong to blame scala in anything because it is still even did not mature (in my personal opinion).

16:40 callen: picolisp i was fascinated with but did not get into too much yet

16:40 but it is close to c

16:40 not asm

16:41 zmansiv: after trying to use javafx for a commercial project my standards for maturity were drastically lowered

16:41 hyPiRion: picolisp has a database embedded in it, so I'm not sure whether it can be called "close to c".

16:41 callen: What should I work on next? https://www.refheap.com/17742

16:42 also, for any who care: clj-time API refactor coming down the pipe

16:42 make certain you check your shit before upgrading past 0.5.9

16:42 noncom: hyPiRion: 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:43 callen: Raynes: okay, do *you* have a vote on the list?

16:43 hyPiRion: huh, database entities are first class objects

16:43 Raynes: callen: I have what?

16:43 callen: What should I work on next? https://www.refheap.com/17742

16:43 Raynes: ^^

16:43 vote.

16:43 Raynes: callen: What is this IRC bot/logger -> database thing?

16:44 noncom: i think that in picolisp everything is a 1st class object...

16:44 at least that what i understood from reading the book and working with the samples

16:45 callen: Raynes: it just sits in channels and streams log lines into a database which then has filtered hooks that trigger things like emails/IMs.

16:45 Raynes: so that I can be notified when somebody mentions my name, Selmer, etc.

16:45 basically a bat-signal.

16:45 hyPiRion: not types, afaik. Variables have no types, values do. That's a significant difference from c

16:45 noncom: the 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:45 Raynes: callen: That's called an IRC client.

16:45 callen: Raynes: I want programmatic hooks to send email.

16:45 noncom: hyPiRion: on types you're right..

16:46 callen: Raynes: it's not one of the priority projects.

16:46 Raynes: vote?

16:46 Raynes: I think you can very likely write an IRC client plugin to do it, but *shrug*

16:46 Rewrite selmer with instaparse, I suppose.

16:46 noncom: well, i'm so noob i think i just look from a different pov

16:46 Raynes: That's totally useful.

16:47 callen: Raynes: yeah probably, but I've always wanted an IRC vacuum bot.

16:47 hyPiRion: noncom: Well, I think I get you. It's very c in terms of performance (small memory footprint and very fast)

16:47 small executables, etc.

16:47 callen: Raynes: Rewriting Selmer with Instaparse is useful? You're being sincere?

16:47 Raynes: callen: FWIW, you use lazybot for this.

16:47 callen: as the frontend? sure.

16:47 Raynes: callen: Strip it if all unnecessary plugins (probably all of them) and add a quick one for doing this.

16:47 callen: yeah.

16:48 Raynes: That's like an hour project.

16:48 callen: I know. it's still on the list.

16:48 noncom: hyPiRion: yes, and is itself a very small c-written interpreter.. so you understand me :)

16:48 callen: the mail server thing is basically "Lamson" for Clojure.

16:48 Raynes: callen: And no, I was being sarcastic.

16:48 callen: I actually have a TON of web library stuff in my queue too, but it's not in the to-do.

16:48 Raynes: But I also don't want you to do quickcheck because for the love of God stop making testing libraries people please.

16:48 callen: mostly stuff from companies that use Rails and open source their libs.

16:48 noncom: i know that all is c-written, so no point in calling all close to c, but still... there is that feeling for picolisp

16:48 callen: Raynes: it's not a testing library :(

16:49 Raynes: I don't know what diffmerge is.

16:49 callen: Raynes: it'd be intended to be used with clojure.test

16:49 Raynes: git diff/merging library but inside of Clojure, not an interface to a git repo.

16:49 there's a diffmatchpatch Java library I am considering adapting.

16:49 Raynes: clojurewiki is an idea, but a long term project and I'm not looking forward to the opinion editing wars in the future.

16:49 zmansiv: callen for the irc thing it might be a good idea to write it as a plugin for a bouncer like znc or something

16:49 callen: zmansiv: I'll probably use lazybot.

16:50 Raynes: well the domain for clojurewiki is languishing.

16:50 zmansiv: oh yeah that would make sense

16:50 callen: I'd like to have the diffmerge thing for clojurewiki if possible.

16:50 Raynes: diffmerge then

16:50 I vote diffmerge.

16:50 callen: any other votes?

16:50 Raynes: Everybody tell callen what to do.

16:51 callen: I want to try to cram out one last library this weekend.

16:51 I have a surfeit of coffee.

16:51 hyPiRion: Write a program which converts a Clojure program to an executable.

16:51 callen: I didn't actually sleep last night.

16:51 Raynes: hyPiRion: https://github.com/Raynes/lein-bin

16:51 Done.

16:51 Next

16:51 callen: lol.

16:52 hyPiRion: lolwhat, does it embed a JVM in there too?

16:52 Raynes: That's asking too much, hyPiRion.

16:52 Maybe I should just embed the whole operating system in there just in case

16:52 Apage43: I had started a wrapper for https://code.google.com/p/subethasmtp/

16:53 technomancy: callen: lampson for clojure would be super

16:53 jcsims: clojos

16:53 Apage43: but I wound up not needing it so it didn't get very far

16:53 agumonkey: Hello, any emacs/nrepl user here? (#emacs had noone to help me until tomorrow)

16:53 hyPiRion: Raynes: And all the files too

16:53 Raynes: but that's probably called imaging, not "Clojure as an executable"

16:53 Apage43: https://github.com/apage43/offpost

16:53 callen: Raynes in this thread: http://stansellseverything.ytmnd.com/

16:53 Raynes: ~anyone

16:53 clojurebot: Just 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:54 callen: technomancy: Lamson you mean?

16:54 technomancy: I wasn'

16:54 wasn't aware you used Python.

16:54 Raynes: callen: Wtf. I had that playing on top of Ode To Sleep by Twenty One Pilots.

16:54 It sounded amazing.

16:54 callen: Raynes: :D

16:54 technomancy: callen: I don't, but I've read a bit about it

16:54 callen: ITT: Raynes has it all.

16:55 technomancy: it's the kind of thing that would really benefit from better abstraction; the raw libs are just rotten

16:55 callen: technomancy: 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:55 zmansiv: i 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:55 callen: technomancy: yeah, I often find myself getting into the weeds whenever SMTP is involved.

16:55 zmansiv: but the learning curve seems like it's too steep to be worth the effort

16:55 technomancy: callen: all I know about lein-autoreload is it's a thing I keep saying should exist. its actual existence is news to me.

16:55 callen: technomancy: uh, well it exists, but doesn't seem to work.

16:56 technomancy: people keep using midje because it crams together auto-reload with a test framework =\

16:56 callen: it'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:56 oh god fucking dammit, that explains a lot.

16:56 I might need to add fixing lein-autoreload to the list.

16:56 1 vote for diffmerge, 1 for Lamson-4-Clojure.

16:56 Apage43: ahahaa

16:57 * callen grumbles inaudible imprecations about midje

16:57 hyPiRion: I was thinking about making a Clojure machine. Go do that with FPGAs callen.

16:57 bbloom: dnolen: 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:57 callen: hyPiRion: try to suggest things I at least faintly care about please :(

16:57 I provided a list.

16:57 hyPiRion: Oh, I didn't see that list, soz.

16:58 bbloom: dnolen: 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:58 callen: np - https://www.refheap.com/17742

16:58 hyPiRion: ^^

16:58 Apage43: hyPiRion: just think of a scenario where if one didn't exist, someone would use midje for some reason

16:58 hyPiRion: oh, you can make midje2 then

16:58 callen: I...don't believe in midje.

16:59 technomancy: callen: FWIW the "searches against IRC streams" is something I would use too

16:59 callen: or complecting an otherwise potentially very useful autoreload with a testing framework.

16:59 technomancy: good to know I'm not totally crazy.

16:59 technomancy: some kind of mobile-accessible twitter-like mentions and searches

16:59 callen: yeah exactly.

16:59 technomancy: (since actually having an IRC client on my mobile is a lost clause)

16:59 cause

16:59 callen: I believe we've discussed this in the past

16:59 callen: probably.

17:00 Apage43: I have one. Most of the times I pull it out, I'm driving, which is no good.

17:00 technomancy: I even had a decent name picked out

17:01 callen: technomancy: heh, what?

17:01 also, a reminder since more people are looking, clj-time API is getting refactored. Shit is being deprecated.

17:02 technomancy: callen: it was gonna be a subrosa plugin, so I picked "surfer-rosa"

17:02 callen: I guess mine was a bit different; I was thinking of a bouncer proxy instead of a bot

17:02 so I could do rudimentary replies from my mobile

17:02 that's a lot more complicated though

17:02 callen: technomancy: I was originally thinking of a bouncer proxy too.

17:03 technomancy: part of the point was to actually avoid using ZNC. I don't like ZNC.

17:03 technomancy: yep

17:03 callen: but Raynes is right about lazybot being the path of least resistance.

17:03 technomancy: it's definitely the pragmatic way to do it

17:03 unless you really are in the mood a meaty project you can sink your teeth into

17:03 callen: if I was to do meaty, it'd probably be Lamson or Wiki.

17:04 I've got a long tail of random-ass Rails libs to port too.

17:04 technomancy: well the bulk of the work around the wiki is writing and editing, not coding

17:04 totally different vibe

17:05 callen: technomancy: 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:06 a diffmerge library is likely to be the winner for today unless somebody else pipes up

17:06 technomancy: "neatly wrapped up" sounds like the opposite of a wiki?

17:06 callen: but Lamson, IRC, and lein-autoreload are on my radar.

17:06 technomancy: yeah but I place high importance on it.

17:06 I am seriously sick and tired of landing on clojuredocs.

17:06 and everytime I'm working on a library and need to look something up, that's just an opportunity to expand the wiki.

17:07 technomancy: the non-hyphenated one?

17:07 or both?

17:07 callen: the old unmaintained one

17:07 I have no problem with clojure-doc

17:07 (dat fucking nomenclature)

17:07 clojure-doc doesn't really do what I need either, but it's at least good at what it actually does.

17:07 and is maintained, but quiet.

17:08 `cbp: hmm i suck at naming, maybe i'll just use yet-another-library-named-after-food

17:09 callen: Raynes: to explain the mail/IRC thing, in general I just shove everything into databases.

17:09 `cbp: whoa dude, it should just be a PR into Pomegranate.

17:09 `cbp: what are you naming?

17:10 technomancy: also I saw that lein interactive got replaced in favor of...Jark? What?

17:10 `cbp: callen: feels like its gonna grow somewhat :)

17:10 callen: `cbp: you worry me.

17:10 technomancy: I can't even figure out from the docs how to run lein tasks from Jark.

17:10 technomancy: callen: it got deprecated because no one used it

17:10 callen: I thought you did.

17:10 technomancy: no one who contributed, I mean

17:10 nah

17:10 callen: oh.

17:10 technomancy: jark has been vaporware for a while afaict

17:10 callen: I usually use drip, what do you do?

17:11 I need a way to continually run my tests, I was hoping the autoreload thing would work, but...it doesn't. :\

17:11 technomancy: oh, I just use clojure-test-mode

17:11 callen: I don't realllyyyy want to run two nrepls.

17:12 technomancy: I was playing with lein.el, but I couldn't figure out how eshell's model of a command mapped to the underlying process

17:12 callen: technomancy: I'd prefer it to just be a terminal off to the side that "watched" files and reran the tests.

17:12 I mean, I could write a Guardfile, but I am desperately lazy.

17:12 I don't want to write a Guardfile for every project.

17:12 ...I might just write a lein plugin that does this.

17:12 yeah, going on the list.

17:13 is there a Clojure library for watching for edits to a directory of files?

17:13 http://clojuredocs.org/circumspec/circumspec.watch/watch

17:14 oh god dammit

17:14 of course it's part of an abandoned BDD testing library

17:14 what the fuck

17:14 technomancy: sounds like a lot of work just to keep IO separate

17:14 why not trigger it from clojure-test-mode and rebind *test-out* to a file you tail?

17:14 callen: technomancy: I want it to just happen automatically over and over and over.

17:14 seriously, 0 effort.

17:14 I do not want to manually dispatch my test runner, ever.

17:14 `cbp: callen: maybe you just need a wrapper on java.nio?

17:15 callen: `cbp: maybe? I'm hoping for something with a callback hook.

17:15 `cbp: it has a WatchService

17:15 technomancy: callen: after-save-hoo

17:15 k

17:16 callen: technomancy: I see what you're getting at. I really just want it to be a lein task.

17:16 technomancy: I do too, but you said zero effort

17:16 callen: and a task combinator called autorun would be cool.

17:16 no, I'm willing to invest effort upfront

17:17 technomancy: oh, gotcha

17:17 noncom: hyPiRion: 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:17 callen: I just don't want to have to invoke my tests again afterward.

17:17 technomancy: well, lots of ways to do it, and one of them is clojure-test-mode, which already exists, so I'm happy

17:17 callen: noncom: it's not even really specifically Java, just the nature of being hosted.

17:18 technomancy: I tried CCW again because it supposedly auto-reloaded stuff.

17:18 technomancy: that was a comical experience.

17:18 noncom: callen: agreed, and i want ot add that java ecosystem is a BIG win too.

17:18 callen: Rubyists have whole libraries that do this: @user.assign(params[:user], [:username, :email, :password, :password_confirmation])

17:19 one the one hand, their willingness to embrace the micro-library ethos is awesome. OTOH, lol.

17:23 ordnungswidrig: gosh, is there a sane flight search engine in this internet thing? the conj location plays tricks on me :)

17:24 callen: ordnungswidrig: hipmunk?

17:24 ordnungswidrig: callen: i'll give it a try

17:26 hyPiRion: noncom: 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:26 Re VM vs. no VM: Startup time, for instance

17:27 technomancy: racket has a fast-starting, JITting bytecode VM

17:28 hyPiRion: Lua too. More like arguments against the JVM for Clojure, specifically, I suppose.

17:28 noncom: hyPiRion: 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:29 *overcome interop costs

17:29 although little ppl would own it i guess.. unless a miracle happens

17:31 hyPiRion: yeah, that's something for people really into these things

17:32 callen: https://github.com/aphyr/prism


17:32 hope this works.

17:33 technomancy: also the sample project.clj is broken and you should remove/edit mention of Jark.

17:33 technomancy: callen: crap; where is jark mentioned?

17:34 callen: technomancy: on a github issue or PR removing lein interactive I think.

17:34 technomancy: grep says ... nowhere?

17:34 callen: it's not in the repo

17:34 technomancy: oh, welp

17:34 callen: because github doesn't store issues in the repo.

17:34 :(

17:34 technomancy: link?

17:34 callen: fack. h/o

17:35 oh shit, it's an SO response you're not responsible for. Sorry!

17:35 technomancy: hah; no worries

17:35 callen: uhm. crap.

17:35 my SO account was a lavabit account.

17:35 I'm pretty sure lavabit got rm -rf'd.

17:35 technomancy: in related news, someone get github on the phone and yell at them for not storing issues in repositories

17:36 callen: badge of honor dude

17:36 callen: I'm a digital refugee.

17:36 I got a 404 on SO when I tried to login with my lavabit account. WTF

17:37 technomancy: you took one on the chin for snowden

17:44 callen: so lein prism solves my problem, but it doesn't have a generic lein task wrapper for auto-re-running an arbitrary task.

17:44 which kinda sucks, but I can see why they did it that way.

17:44 technomancy: you should put lein prism on the leiningen plugins page under the testing section.

17:44 https://github.com/aphyr/prism

17:49 hyPiRion: callen: why don't you do it? :)

17:49 It's open for all to edit

17:50 callen: hyPiRion: I don't like tromping through other peoples' gardens, but I could.

17:51 adding now.

17:52 hyPiRion: done, good thought. :)

17:52 hyPiRion: yay

17:53 (inc callen) ; for community service

17:53 lazybot: ⇒ 7

17:55 ryankask: hi 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:57 callen: ryankask: checkouts or

17:57 ryankask: git clone `tha-thang` && sed s/namespace/my-namespace/g && lein deploy clojars

17:57 (I've been doing this a lot lately, seemingly)

17:57 technomancy: did you work with Jahad on the debug repl stuff?

17:58 if so, any comments on what it would take to add globals to it?

17:59 hyPiRion: ryankask: 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:59 callen: oh I guess that's the proper way.

18:00 ryankask: hyPiRion: thanks! that worked.

18:00 hyPiRion: np

18:06 ToBeReplaced: I'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:15 bbloom: ToBeReplaced: bike sheding at it's finest.

18:17 ToBeReplaced: bbloom: 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:18 bbloom: ToBeReplaced: you're paying that cost b/c declaring a new style creates a rift between existing code & people following an arbitrary style guide

18:19 the 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:19 you're too late, sorry

18:21 ToBeReplaced: bbloom: i still think it's early days tbh, so i still err on the side of change

18:21 i'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:22 bbloom: well then it's a good thing that somebody was clever enough to create a hosted language w/ good interop!

18:22 hurray technology :-P

18:24 callen: ToBeReplaced: weird, I don't seem to do that. Ever.

18:24 ToBeReplaced: what sort of A/B (Clojure/Java) switches have you made?

18:24 ToBeReplaced: apache http over http-clj, i end up needing to hit joda-time directly a lot instead of just leaning on clj-http functions

18:24 Quartz direct over quartzite

18:25 jedis 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:25 callen: ToBeReplaced: I used carmine recently and adored it :)

18:25 ToBeReplaced: mostly, i've found too much "magic" in the clojure libraries, many have made it hard to test (dynamic bindings, etc)

18:25 callen: but I probably wasn't stressing it the way you might've been.

18:26 ToBeReplaced: 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:26 ToBeReplaced: my 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:26 callen: the closure API supports disparate connections for each returned fn.

18:26 ToBeReplaced: what's the lib?

18:26 callen: it's a pretty cool pattern, just uses (or ...) and is otherwise transparent.

18:27 https://github.com/bitemyapp/bulwark/ it's a mimic of Rack::attack

18:27 just blacklist, whitelist, and throttling atm. persistence is only needed for throttling, and that's redis only atm.

18:27 I'll do an in-memory implementation for the younguns at some point.

18:28 the reason for the dual APIs is that there are use-cases, other than laziness, where you really want a global atom.

18:28 ToBeReplaced: i don't know enough about the problem domain to offer commentary

18:28 callen: and any attempts to accommodate those use-cases with a closure would involved reset!'ing atoms of an fn anyway.

18:28 so I decided to ignore my inner-neckbeard and implement both. One for testing, one for production.

18:29 relevant cleverness -> [cm (or (first args) @config)

18:29 that's all. prioritizes the use of closed over local state.

18:30 it's a really useful pattern though and one that I might start proliferating in libraries to promote easier testing.

18:30 ToBeReplaced: hm; i'd be worried that it makes it too easy to typo

18:30 callen: wat.

18:31 ToBeReplaced: like accidentally leaving out the local config in a singular call

18:31 callen: ...no.

18:31 it's returning an fn closure.

18:32 that only happens in one place.

18:32 it's not doing that in 10 different places.

18:32 that's bad code.

18:32 ToBeReplaced: oh, got it, and then you pass the closure everywhere

18:32 callen: I don't know that I'd use the terminology "everywhere"

18:32 other 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:32 they just receive that data as arguments.

18:33 so you can effect arbitrary behavior out of the constituent fns without depending on specific state.

18:33 this is pretty standard "not writing bad code" procedure.

18:46 hugod: arcatan: ritz-nrepl worked with the zi maven plugin; not sure if the latest runs with zi yet though.

18:47 callen: hugod: could something like debug-repl be done in Ritz?

18:48 hugod: what is "something like debug-repl"?

18:49 callen: take it that means you haven't used it.

18:50 hugod: I wrote the swank-clojure implementation of it

18:50 callen: you drop in (debug-repl) anywhere in your code (presuming the namespace is loaded) and you get a typical clojure repl at that "breakpoint"

18:50 Ritz isn't working out for me sadly.

18:50 hugod: just wondering what about debug-repl you like...

18:50 callen: simplicity, comparability to pdb/ipdb (Python), behaves just like a REPL

18:51 doesn't turn into a bleeding mess when I have to call into code that regrettably uses exceptions as flow control

18:51 lets me test and evaluate assumptions interactively with all the state in place surrounding the repl.

18:51 hugod: you can filter those exceptions in ritz, but sure

18:52 and ritz should let you use the repl at a breakpoint (though I'm not sure it does still)

18:52 callen: I've seen it let me evaluate expressions in a one-off interface

18:52 but that is decidedly not a REPL

18:53 it's just a messy and not very refined experience, as powerful as it sems.

18:53 seems*

18:53 hugod: it should be possible to let you use the repl, if it isn't already

18:53 callen: but the inaccessibility of globals in debug-repl is intolerable.

18:53 also, some sort of auto-magic for disabling locals clearing would be glorious.

18:53 pizzasauce: does anyone know if there is something similar to the slime-inspect in nrepl?

18:53 callen: honestly, should be the default if I'm invoking lein ritz-nrepl.

18:54 amalloy: pizzasauce: i think there's something that's halfway there, maybe by technomancy? don't remember the name

18:54 hugod: callen: compiling with a prefix worked in swank for disabling locals clearing - haven't had the time to port it to nrepl yet

18:54 amalloy: javert

18:55 (googling for "nrepl inspect" really isn't hard, incidentally)

18:55 hugod: pizzasauce: https://github.com/vitalreactor/nrepl-inspect

18:56 callen: hugod: good to know it's possible, what could be done about a debug-repl-esque function?

18:56 that drops one into a repl, not the stacktrace buffer.

18:57 hugod: callen: you could make it through a specific exception, and just break on that one exception

18:57 *throw*

18:57 callen: the stacktrace thingy didn't have a repl.

18:57 which is why I specified "drops me into a repl"

18:57 hugod: the repl is still there

18:57 and should be within the context of the breakpoint

18:57 callen: Where? C-h m didn't show anything.

18:58 hugod: *nrepl*

18:58 callen: the default nrepl buffer in my emacs buffer is swapped to the stacktrace?

18:58 why wasn't this documented :(

18:58 in my emacs*

18:58 hugod: I'm not sure it works, tbh

18:58 if it doesn't raise an issue

18:59 in fact thinking about it, it doesn't

18:59 callen: hrm. all that remains then is locals clearing.

18:59 hugod: what are the two repos I should be looking at for that? you said it existed for swank right?

19:00 hugod: locals clearing, yes - in swank-ritz.el

19:01 callen: I'm surprised that wasn't ported already.

19:01 is nrepl not a priority?

19:02 hugod: a priority for ritz? new development is mostly on nrepl

19:02 ritz existed before nrepl

19:03 callen: I know, just wondering.

19:03 hugod: thanks for taking my queries.

19:04 pizzasauce: thanks amalloy & hugod

19:04 hugod: callen: I take pull requests too ;)

19:06 callen: hugod: I've been a streak lately, it's in my todo list.

19:06 and it's something I want, so...

19:37 SeanCorfield: callen: thanx for all those clj-time PRs!

19:37 Raynes: you got your API cleanup now :)

19:41 callen: SeanCorfield: thanks for your patience and for the prompt PR merge :)

19:42 SeanCorfield: does 0.6.0 remove the deprecated bits though?

19:42 I thought the idea was to remove the deprecation notices upon 0.6.0?

19:42 or are we doing that for 0.7.0?

19:42 sorry if I misunderstood :(

19:45 ToBeReplaced: SeanCorfield: 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:46 holo: hi

19:47 (do (defn s? []) ((-> :s name (str \?) symbol))) ; complains about arity. how can I call (s?) generating the symbol at runtime?

19:48 SeanCorfield: 0.6.0 adds the deprecations, 0.7.0 will remove the old APIs

19:48 going from 0.5.x to 0.6.x is heads up of a shift in the API

19:48 same as java.jdbc going from 0.2.x to 0.3.0

19:49 callen: SeanCorfield: makes perfect sense since we were already in the middle of 0.5.x, thanks for explaining. :)

19:49 SeanCorfield: the old APIs will stay in java.jdbc until at least 0.4.0, possibly longer

19:51 noonian: holo: (do (defn s? []) (eval '(s?)))

19:51 SeanCorfield: ToBeReplaced: 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:51 callen: referring to c.j.j? I was surprised by the new API, what else is in store?

19:52 holo: (inc noonian) ; great!

19:52 lazybot: ⇒ 2

19:57 SeanCorfield: callen: more DDL, more extensibility, improve transaction handling, improve documentation(!), make it easier/more obvious how to work with connections

20:02 jkkramer: seancorfield: 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:02 seangrove: Wasn't it possible to map datalog queries to a sql backend?

20:06 amalloy: holo, noonian: eval is unlikely to work well outside of the repl environment: i think it only "knows about" vars in clojure.core

20:07 noonian: hmm, thanks for the warning

20:07 amalloy: better would be something like ns-resolve, explicitly specifying the namespace

20:07 callen: SeanCorfield: very cool stuff. :)

20:07 SeanCorfield: the improvements in the API are converting Korma laggards.

20:14 holo: (inc amalloy) ; thank for the warning. will look into that

20:14 lazybot: ⇒ 69

20:17 ToBeReplaced: SeanCorfield: are there downsides to quoting the entity names in the sql dsl? ex UPDATE "foo" SET "bar"= 1

20:18 jkkramer: ToBeReplaced: different dbs use different quoting

20:18 ToBeReplaced: i 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:18 jkkramer: right, seems like a challenge

20:18 jkkramer: i have a lib that handles that by sniffing the subprotocol and guessing, with a manual override

20:19 ToBeReplaced: yeah i just overrode the :entities flag to do the quoting for me

20:20 might be the best way to handle it, since no db spec needed for the dsl

20:26 SeanCorfield: ToBeReplaced: for MySQL I use (entities (quoted \`) (query my-db ...))

20:27 sounds like you want to use (entities (quoted \") ...) ?

20:28 entities is a macro that walks the expression and injects :entities into every (known) expression)

20:28 or you can do it explicitly: (query my-db (select ... :entities (quoted \")))

20:29 clearly a lot of work is needed on the documentation :)

20:29 maybe this will help? http://clojure-doc.org/articles/ecosystem/java_jdbc/name_mapping.html

20:33 devn: howdy clojurians

20:35 SeanCorfield: hey devn !

20:35 holo: is there any some-> like form that returns the last truthy value instead?

20:35 hi

20:36 ToBeReplaced: SeanCorfield: thanks; yeah i use quoted \' as well... haven't used entities macro though i should take a look

20:39 SeanCorfield: just makes life easier...

20:40 like this: (entities (quoted \`)

20:40 (update! (ws/worldsingles-db) table record

20:40 (where {pk (pk record)})))

20:40 SegFaultAX: holo: Doesn't that sorta defeat the purpose of some->?

20:43 holo: 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:43 callen: devn: hi. I've been busy :)

20:45 holo: SegFaultAX, yes, i want that behaviour, but not return nil when it finds nil. i want the value just before nil

20:45 SegFaultAX: *and some->>

20:45 ToBeReplaced: holo: curious about use case?

20:49 holo: ToBeReplaced, (last-truthy-> 4 nil? str) ; => 4 to replace (if (nil? 4) (str 4) 4)

20:51 ToBeReplaced, 4 is repeated 3 times. in my example only used 1 time

20:51 hyPiRion: Well, (if (nil? x) (str x) x) is the same as (or x "")

20:52 SegFaultAX: holo: 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:52 holo: Just that some unkown number of forms were applied to the initial value.

20:55 Although 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:58 holo: hyPiRion, 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:59 SegFaultAX: ,(doc fnil)

20:59 clojurebot: "([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:59 SegFaultAX: ,(let [f (fnil inc 1)] [(f 10) (f nil)])

20:59 clojurebot: [11 2]

21:05 holo: SegFaultAX, 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:11 SegFaultAX, 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:15 anyway, for my use case fnil uses less parentheses than or :)

21:18 dnolen: it's a bit funny how long PyPy has been working on STM now

21:20 callen: Not really sure why they would succeed when Microsoft Research failed either

21:22 they've not bothered to explain why their implementation is different

21:32 bbloom: dnolen: 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:34 dnolen: bbloom: can you explain a bit more about the cleff update, what exactly have you accomplished here :)

21:35 bbloom: dnolen: much more accomplished in a few mintues! :-)

21:35 dnolen: i'll ping you in ~15m hopefully

21:35 dnolen: bbloom: might have to jet, but no worries, I'll ask about you again about it if I miss the update :)

21:36 bbloom: dnolen: 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:37 dnolen: it also has first-class handlers, so you can install an "exception" handler dynamically too

21:37 dnolen: so i've reified both of those things, where as before i didn't have that

21:38 dnolen: 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:38 dnolen: bbloom: very interesting - would like to see a post about

21:39 bbloom: you actually have a use case for this stuff?

21:39 bbloom: dnolen: 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:40 dnolen: bbloom: 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:40 bbloom: dnolen: 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:41 dnolen: bbloom: hmm, do you have a simple use case in mind that you could explain?

21:41 bbloom: dnolen: generators (ie yield)

21:42 you 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:42 dnolen: bbloom: huh, what would you do w/ yield that you can't do w/ core.async?

21:44 bbloom: dnolen: 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:45 i could use lazy-seq

21:45 or i could use something like yield, which is more pleasant

21:45 and the return value is the iterator

21:45 which is different than a lazy-seq, really

21:45 this lets you build new abstractions & they play nice together

21:45 for example, i could have non-determinism and yield working in the same piece of code

21:46 core.async takes over as the only abstraction you can use, this lets you install abstractions into the call stack

21:46 dnolen: bbloom: 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:47 bbloom: dnolen: it's only unidiomatic b/c we don't have any tools for making it not painful to work with :-)

21:47 this is mostly an experiment

21:47 dnolen: bbloom: huh, so you're experiment will make stateful yield palatable?

21:47 bbloom: for 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:48 that's just the one simple use case you mentioned

21:48 that paper has lots more examples

21:49 they 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:49 yeah, you can do that w/ core.async, but you need to write a giant bag of macros to hide the channels

21:49 however, mostly, i'm just trying to understand this stuff. i genuinely believe that this is a real, usable alternative to monad transformer stacks

21:50 dnolen: bbloom: that's kind of cool, the scheduler.

21:50 bbloom: yeah, go check out the example. it's TINY & super clear

21:50 dnolen: bbloom: though I'm kinda lukewarm about schedulers on single threaded hosts like JS

21:51 bbloom: dnolen: their example is a dumb round robin co-operative scheduler

21:51 that's perfectly reasonable if you've got a few hundred game agents

21:51 dnolen: you need to the yield the browser at some point and there's surprising complications around that

21:52 bbloom: you 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:52 dnolen: bbloom: though you may be working on this for Clojure JVM and not CLJS so perhaps different story.

21:52 bbloom: shouldn't matter

21:53 dnolen: bbloom: what about dependent subtasks?

21:54 bbloom: dnolen: in a game? you just spawn entities that get added to the global entity collection. no hierarchy

21:54 dnolen: bbloom: ok, so shallow in this particular case

21:54 bbloom: yeah, that's the whole point: there are *LOTS* of different types of side & control effects you can think of

21:55 this lets them compose

21:56 dnolen: ok! this works. pushing code now

21:56 dnolen: bbloom: interesting stuff. It's definitely the one place, game agents, where I'm not sure core.async can reasonably be applied

21:57 or at least not w/o configurable dispatch ...

21:58 (I'm thinking a decently large number of game agents)

21:58 bbloom: dnolen: https://github.com/brandonbloom/cleff/blob/handlers/src/cleff/core.clj#L114-L120

21:59 dnolen: so what you'll see there is two "choice" effect instances & two handle-with clauses

21:59 if you look at the definition of choose-all, you'll see i'm defining a reusable, (almost) first-class handler object

21:59 dnolen: bbloom: that is very interesting, if they are choice instances why do you need pas 'decide?

21:59 s/pas/pass

22:00 bbloom: dnolen: an effect instance is like a protocol, it can have multiple operations

22:00 dnolen: for example state has lookup and update

22:00 dnolen: bbloom: k

22:00 bbloom: dnolen: i want to make it so you don't need to write "effect" and instead just say (decide c1) for example

22:00 syntax isn't finished

22:00 dnolen: bbloom: ok that's what I was wondering next - why effect vs. decide

22:01 bbloom: dnolen: just b/c the macros would need to have an extensible map of names to look for. haven't done that yet

22:01 i need like a defeffect thing

22:01 dnolen: bbloom: gotcha, so effect is like >!, it has a special meaning

22:01 bbloom: yeah

22:02 so look at line 103

22:02 the syntax for handler is that you give it neither, one, or both of (value [x] …) and (finally [x] ...)

22:03 then you give it extend-type style forms that have form "effect-instance (operation-name [args here] …) (another-op [...

22:04 dnolen: then "continue" is a special IOC terminal that will execute a continuation

22:04 there is no reified continuation object in the user-facing API (at least in my implementation)

22:04 this way you can't capture the continuation, it can't escape the handler

22:19 dnolen: i think i'll definitely need to give a talk on cleff at clojureNYC :-)

22:23 bhauman: dnolen: bloom: just opened an email from Paul Murphy from Weplaydots he's not digging it.

22:23 bbloom: ^^

22:24 bbloom: bhauman: who's not digging what?

22:24 brehaut: bhauman: dots game creator?

22:24 bhauman: brehaut: yep

22:24 bbloom: yeah the guy behind the dots game

22:25 bbloom: he's not digging my last post

22:25 brehaut: thats nice for him i guess?

22:26 bhauman: it's pretty freaking ridiculous

22:26 bbloom: you 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:26 what's the blog link again?

22:27 bhauman: bbloom: http://rigsomelight.com/2013/08/12/clojurescript-core-async-dots-game.html

22:27 bbloom: bhauman: OOOOH now it makes sense. you made a version of his game

22:27 i hadn't seen this post

22:28 he's pissed you cloned his game?

22:28 bhauman: bbloom: his wording is short and measured, but he'd like a take down or significant restructuring

22:28 brehaut: lol

22:28 bhauman: "Lastly, I'm concerned that the sample code will encourage others to infringe our rights."

22:28 brehaut: ianal and all that, but wat

22:29 bbloom: haven't never seen this dots game before, my initial reaction is lolsux4him

22:30 brehaut: bbloom: its an iOS game that looks very similar. so uh, no shared assets, no shared code…

22:30 bhauman: exactly

22:30 brehaut: bhauman: just change the name

22:31 sevvie: "Specks."

22:31 bbloom: bhauman: you even link to his game, he should thank you for the traffic

22:31 bhauman: brehaut: sounds good

22:31 bbloom: yeah I don't understand it

22:31 bbloom: i'd remove the reference to his game as well

22:31 brehaut: yeah, clearly he doesnt appreciate the link

22:31 bhauman: bbloom: I have 7000 uniques on it. it only can help him

22:32 bbloom: *shrug* you're not marketing this. the worst that can happen is that somebody takes your code, polishes it up, then markets that

22:32 i promise you that, if his game is at all successful, he's already got 238905677835 clones

22:33 jonh: this is almost exactly like a game i wrote in highschool in basic :P

22:33 bbloom: i'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:34 bhauman: bbloom: definitely occurred to me.

22:35 jonh: I wrote a very similar game in college

22:35 brehaut: given dots is a variant on the

22:35 'same' or 'stones' game

22:35 its hardly surprising

22:35 bbloom: bhauman: nice post tho :-)

22:36 bhauman: bbloom: thanks, took a while to write. Thats why I'm not keen on altering it

22:37 it definitely occurred to me to just make the game better with different graphics and animations

22:38 thanks for listening guys, I had a long weekend and this was just a surprise.

22:39 brehaut: bhauman: i think if he was serious or could do anything, you probably would have got a call from his lawyer, not him?

22:39 pizzasauce: are there default key combinations that move the point to the top or bottom of the screen?

22:40 bbloom: brehaut: the life of an app/game developer is a depressing one

22:40 brehaut: bbloom: no doubt

22:40 bhauman: brehaut: the tone is measured, hard to tell

22:40 bbloom: brehaut: 99% of your shit fails, and then when you have a hit, zinga or popcap or EA or somebody copies you & ruins it

22:41 pizzasauce: Also, 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:41 brehaut: bhauman: i also dont have any comprehension of the us legal system other than its bananas

22:41 bbloom: brehaut: just remove the link to him, change the name. tell him you did so, then say "I now consider this matter resolved"

22:41 er that was for bhauman ^^

22:41 bhauman: brehaut: you seem to understand it quite well

22:41 bbloom: gotcha

22:41 brehaut: bhauman: too much time on hacker news, to my shame

22:42 bbloom: bhauman: 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:42 bhauman: brehaut: no shame

22:42 bbloom: maybe trademark for the name? but i doubt it, considering how generic of a name it is

22:42 brehaut: bhauman: you could also change the colors of your dots to be a noticably different pallette to his :P

22:43 bhauman: bbloom: that's what I think.

22:43 bbloom: brehaut: i wouldn't even bother with that

22:43 avoid the remote trademark infringement policy, stop doing him the favor of sending him traffic, and then ignore him

22:43 brehaut: bbloom: im a hobby design nerd, so i'd consider it fun ;)

22:43 bbloom: s/policy/possibility/

22:44 bhauman: brehaut: bbloom: I have a color blind friend who can't play the game, so I was planing on making some changes

22:44 brehaut: bhauman: thats a great reason to change it up

22:44 bhauman: and probably a post in it on designs for the colorblind

22:45 bhauman: brehaut: skulls, runes, stars squares, the skies the limit.

22:45 brehaut: bhauman: unicode pile of poo

22:45 bhauman: brehaut: if you have any ideas let me know

22:45 brehaut: perfect!!

22:45 brehaut: and irreverent

22:45 bbloom: i used to play hexic w/ color blind mode enabled

22:45 was much easier even tho i'm not color blind :-)

22:46 brehaut: haha

22:46 bhauman: bbloom: what was color blind mode for hexic?

22:47 bbloom: bhauman: http://i1.ytimg.com/vi/p-b0coskAfM/hqdefault.jpg

22:47 just put icons on everything

22:47 was more visually noisy, but easier to scan for patterns

22:47 bhauman: bbloom: oh I like that

22:48 i'm gonna copy it too

22:48 let em all come after me ha ha ha ha

22:50 ambrosebs: Tom Faulhaber is the man! Look, even type aliases have little headings :) http://clojure.github.io/core.typed/api-index.html

22:51 bbloom: neat

23:03 bhauman: bbloom: brehaut: funny stuff, I think I will email him this http://weplaydots.com/dmca

23:03 bbloom: yup, that's pretty standard DMCA nonsense

23:04 brehaut: bhauman: isnt betaworks the company that makes dots?

23:04 bhauman: brehaut: yep

23:05 bbloom: so i know i've seen people in here complaining about and/or praising midje. what's the consensus?

23:23 brehaut: bbloom: i think the consensus is that some people love it and others hate it ;)

23:32 amalloy: sounds about right. i don't know a lot of people who think midje is medium-good

23:33 wolfes: (inc "media lab") ; https://immersion.media.mit.edu:8080/viz#

23:33 lazybot: ⇒ 1

23:35 brehaut: amalloy, bbloom: midje is quite idiologic(?) about how testing and dev should be done right?

Logging service provided by n01se.net