ldnclj

Find us on #clojure-uk
agile_geek 2015-12-19T08:46:04.000733Z

Haway & morning

agile_geek 2015-12-19T08:46:44.000734Z

Anyone know if iterator-seq is lazy? (Or at least releases the head)

agile_geek 2015-12-19T08:47:18.000735Z

I'm having OOM exceptions with a library & I'm trying to debug.

bronsa 2015-12-19T12:12:27.000736Z

@agile_geek: it returns a lazy chunked seq

bronsa 2015-12-19T12:13:14.000737Z

since 1.7 at least

agile_geek 2015-12-19T12:52:01.000738Z

So that's worrying. This exactly the situation that imperative programming wins hands down for me. I can't figure out where some resource is being held but in an imperative loop I would know categorically when that might happen. The sequence abstraction is bleeding implementation details!

agile_geek 2015-12-19T12:53:43.000739Z

I don't want to have to figure out why this is happening.

agile_geek 2015-12-19T12:53:50.000740Z

I just want to ship code

mccraigmccraig 2015-12-19T13:33:57.000741Z

@agile_geek: ooo i haven't had one o' them for ages... what ru doing ?

agile_geek 2015-12-19T13:53:56.000742Z

Working with a scan returning from hbase

agile_geek 2015-12-19T13:55:18.000743Z

I've rewritten it imperatively. I didn't have time to figure out what was wrong.

agile_geek 2015-12-19T13:55:38.000744Z

It's this stuff that makes me fall back on Java

agile_geek 2015-12-19T13:58:26.000745Z

I can rewrite 10 times faster than figure out the functional way!

agile_geek 2015-12-19T14:05:07.000746Z

Serious point tho. For a language that prides itself on simplicity you need to know an awful lot about how core fns r implemented too avoid this. I suspect the real issue was an into in the lib I was using around hbase

mccraigmccraig 2015-12-19T15:45:34.000747Z

altho to be fair - laziness is the thing obscuring the causes of your prob, and lazy vs eager isn't a functional thing - there are certainly eager functional languages (tho i'm not aware of lazy imperative langs)

agile_geek 2015-12-19T17:08:28.000748Z

True.

agile_geek 2015-12-19T17:08:58.000749Z

but you still need to understand the laziness to reason about the side effects.

agile_geek 2015-12-19T17:09:42.000750Z

or in this case the lack of laziness somewhere.

2015-12-19T17:38:12.000751Z

Though combining laziness and side effects I'd generally a bad idea

agile_geek 2015-12-19T18:07:04.000752Z

I meant the side effects of laziness itself or in this case the side effects of eagerness

agile_geek 2015-12-19T18:08:45.000753Z

Basically something in the lib I'm using is eager not lazy but I need to understand which fn's are eager and which lazy just to use them safely. With an imperative loop I would explicitly know all this

agile_geek 2015-12-19T18:09:39.000754Z

My point is you have to have detailed knowledge of the implementation details of the fn's to use them and I thought it was supposed to be simple.

minimal 2015-12-19T19:58:31.000755Z

Was it the same as http://danboykis.com/?tag=hbase

minimal 2015-12-19T19:58:42.000756Z

> At first I thought I could just wrap ResultScanner iterator-seq in a take. That seemed to work on small tables. However on a large table (defined here as anything over a few thousand rows), the scan would blow up. It turned out that in order to minimize the number of network calls, a scanner by default will try to get all the matching entries and shove them into a ResultScanner iterator. For this use case, there’s isn’t a limiting criteria on a scanner, so a scan will try to “fetch” the entire table into memory. That’s one large ResultScanner object! No good. What to do?

2015-12-19T20:08:22.000757Z

I think party of the issue will be interfacing with hbase and how jangling that resource all the way through the driver works so I think you left simple a while ago

2015-12-19T20:09:06.000758Z

Some drivers handle that better than others (which is a bit of a pain I'll admit)