<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31
00:00 eacameron joined
00:02 sigmundv_ joined
00:02 louispan joined
00:22 acarrico joined
00:47 acarrico joined
01:02 juanpaucar joined
01:09 vaibhavsagar joined
01:09 Youmu joined
01:12 eacameron joined
01:14 peterbecich joined
01:15 cschneid_ joined
01:28 vmeson joined
01:41 louispan joined
01:42 NoCreativity joined
01:44 Zialus joined
02:02 takle joined
02:15 louispan joined
02:16 juanpaucar joined
02:17 malaclyps joined
02:20 takle joined
02:24 kritzcreek joined
02:24 exferenceBot joined
02:29 hexagoxel joined
02:30 Computist joined
02:32 Computist joined
02:34 zero_byte joined
02:34 Computist joined
02:35 Computist joined
02:37 Computist joined
02:39 Computist joined
02:42 Durbley joined
03:00 takle joined
03:09 m1dnight1 joined
03:12 louispan joined
03:15 juanpaucar joined
03:28 parsnip0 joined
03:35 carlomagno joined
03:41 erisco joined
03:51 harfangk joined
03:57 takle joined
04:05 uglyfigurine joined
04:05 nullcone joined
04:10 uglyfigurine joined
04:11 Durbley joined
04:16 takle joined
04:19 juanpaucar joined
04:41 takle joined
04:54 louispan joined
05:00 takle joined
05:19 uglyfigurine joined
05:23 bumpkin joined
05:25 meandi_2 joined
05:25 bumpkin left
05:29 juanpaucar joined
05:43 vito_swiss joined
05:46 shayan_ joined
05:48 ThomasLocke joined
05:48 ThomasLocke joined
05:56 takle joined
06:00 juanpaucar joined
06:07 bvad joined
06:10 eatman joined
06:23 takle joined
06:25 dmi3y joined
06:29 conal joined
06:32 haskelleksah joined
06:38 alqatari joined
06:42 takle joined
06:43 mattyw joined
06:49 zero_byte joined
06:49 Cale joined
06:54 dmi3y joined
06:58 ThomasLocke_ joined
06:59 takle joined
07:04 juanpaucar joined
07:06 louispan joined
07:07 takle joined
07:14 takle joined
07:14 bvad joined
07:19 merijn joined
07:22 Pupnik joined
07:34 takle joined
07:50 moei joined
07:52 takle joined
07:52 madjestic joined
08:01 Denthir joined
08:06 thc202 joined
08:07 nickolay_ joined
08:07 ThomasLocke joined
08:08 romank joined
08:09 takle joined
08:16 Iceland_jack joined
08:18 juanpaucar joined
08:20 Gloomy joined
08:31 harfangk joined
08:35 grdryn joined
08:36 harfangk joined
08:37 im0nde joined
08:59 madjestic joined
09:00 nickager joined
09:03 takle joined
09:04 nacon joined
09:04 nacon joined
09:18 pie_ joined
09:22 yellowj joined
09:24 Gurkenglas joined
09:31 juanpaucar joined
09:38 mstruebing joined
09:41 nohTo joined
09:42 romank joined
09:42 fotonzade joined
09:45 Bhootrk_ joined
09:45 juanpaucar joined
09:52 haskelleksah joined
10:00 Denthir joined
10:02 Kuros` joined
10:03 takle joined
10:03 nohTo left
10:03 nohTo joined
10:08 sigmundv joined
10:09 sigmundv_ joined
10:10 cschneid_ joined
10:15 galderz joined
10:18 MolluskEmpire joined
10:25 Bhootrk_ joined
10:25 romank joined
10:28 grdryn joined
10:32 Kuros` joined
10:49 juanpaucar joined
10:57 Denthir joined
10:58 takle_ joined
10:58 netheranthem joined
11:18 mengu joined
11:19 pbrant joined
11:27 louispan joined
11:34 im0nde joined
11:35 kritzcreek joined
11:44 takle joined
11:53 juanpaucar joined
11:59 Gloomy joined
12:08 nohTo joined
12:08 vmeson joined
12:09 Levex joined
12:10 cschneid_ joined
12:18 nohTo joined
12:32 mattyw joined
12:43 fotonzade joined
12:45 guampa joined
12:57 juanpaucar joined
13:03 gspia joined
13:16 chlong joined
13:17 jathan joined
13:17 iAmerikan joined
13:18 mengu joined
13:19 fbergmann joined
13:26 ebw joined
13:28 <ebw> Hi! I read a bit about GC in GHC and Go. Would it be difficult to add concurrent GC to GHC? Maybe selectable via some RTS options? (Disclaimer: I don't have a background in these things, so don't be to harsh, if it is a silly idea.)
13:28 <sbrg> ebw: It's definitely not a "silly idea", but it would be difficult, yes
13:29 <sbrg> there's been a lot of talk regarding ghc's gc, and how it is better geared towards some types of workloads than others. and if I'm not mistaken, work is being done on improving it
13:29 <merijn> ebw: I'm guessing you read a specific blogpost about GHC vs Go GC, but that is a rather extremely specific scenario which doesn't happen a lot
13:30 <merijn> tbh, GHC's GC is pretty damn good
13:31 <ebw> I didn't want to suggest that GHC's GC isn't good.
13:31 <merijn> ebw: I'm guessing this is related to the blogpost(s) by Pusher?
13:32 <merijn> I remember an excellent rebuttal to that, but I can't find it right now
13:32 uglyfigurine joined
13:32 <ebw> I thought it might be worth to have other options to select. And bounded stop-the-world pauses sounds good. I think it would also be a really easy marketing selling point.
13:33 <ebw> I read the paper the go team published, how they are doing it and thought, that the algorithm itself didn't sound that complicated, but I have no clue into which beast it would turn in a real world implementation.
13:34 <merijn> ebw: The problem with the Go GC, which they carefully don't mention in most of the talks is that it sacrifices basically *every* metric to the god of low latency
13:34 <merijn> ebw: Here's the post I was thinking off: https://blog.plan99.net/modern-garbage-collection-911ef4f8bd8e
13:40 <ebw> Hmm. If it runs concurrently (and parallel) most of the time, isn't it kind of moot, if it take some more CPU? (I need to read the post more thoroughly, yes.)
13:41 <merijn> ebw: Only if your actual workload isn't CPU bound
13:41 <merijn> ebw: If your workload *is* CPU bound you're wasting valuable time that could be spend doing more work
13:41 <ebw> Yeah, that's why I thought it should be an option, you can select, if you want to :)
13:41 <merijn> ebw: There's also issues like: how cheap is allocation?
13:42 im0nde joined
13:43 <merijn> ebw: Anyway, it's not impossible to write a different GC for GHC, but it will be a lot of work as it might impact the way code is generated in many ways
13:43 <merijn> It'd also impact how the scheduler works
13:43 <merijn> Overall it's a lot of tricky work
13:46 <ebw> Hmm, doesn't sound like it would be worth it. I just asked myself, why the Go team gets such a good reception with that.
13:46 <ebw> Is there an article, how haskell employs the stack? Like which values it places on the stack, if a function is called?
13:47 <merijn> ebw: A lot of the very loud and vocal people on the internet are not that well informed, tbh
13:47 <merijn> I wouldn't even call the Go implementors to be very competent at language design, let alone the people championing it
13:47 <merijn> ebw: Trick question: Haskell function calls don't use a call stack :)
13:49 <ebw> But certainly not every piece of memory needed in a haskell program will be allocated by malloc/brk or something like that?
13:49 <merijn> ebw: GHC maintains it's heap using mmap and then does allocation itself
13:50 <merijn> Allocating memory in GHC is *really* cheap. It's literally incrementing an int and doing a comparison
13:51 <ebw> I imagine, that is thank to compacting gc?
13:52 <merijn> ebw: So, the way it roughly works is: Every capability (read OS thread) has a private heap. If you want to allocate, you basically take the end of the current heap, increment by your allocation and that's what you use. The comparison is due to check whether your heap is too large, if it is, it triggers a local GC
13:52 <merijn> ebw: Yeah, the compacting GC lets you just keep everything in a dense region, so you can just allocate at the end without worrying about fragmentation
13:54 zero_byte joined
13:55 <ebw> I feel silly now. I always thought, that you compact, to reduce fragmentation, but I never made the conclusion to how easy it would be to allocate new memory then. lol.
13:55 <merijn> ebw: And if most of your allocations are garbage (see, generational hypothesis, most young values die fast) you only need to copy/compact a small amount
13:56 <merijn> The downside is, if you have a large live-set you need to copy a lot every time
13:57 <merijn> It's a bit more high tech, since there's multiple generations and the older, the less frequently they get GCed (since the older something is, the less likely it suddenly becomes garbage)
13:57 justinfokes joined
13:58 <ebw> Hmm, so if you want to have long life large objects, you should place them on a heap which is gced by a different algorithm? Are that, what those compacts (I don't recall the correct term atm, but I thought it was called compact.) are for?
13:58 <merijn> compact regions
13:58 <merijn> Yes
13:58 <Geekingfrog> Using cryptonite, is there a way to compare a (Digest MD5) to a text or a bytestring? I want to compare md5 for file integrity.
13:59 <merijn> Normally if you have, e.g. a large Map, if the map is alive you have to copy the entire Map every GC
13:59 nickager joined
13:59 <merijn> ebw: The idea behind compact regions is: Copy something to a special heap once, and then never touch it again, until it gets GCed
14:00 <merijn> ebw: So you copy your huge map to a compact region and you never have to copy/check the map until you lose all references to the region at which point you GC the entire thing in one go
14:02 <ebw> hmm nice, I think you managed to dispel my concerns.
14:02 juanpaucar joined
14:03 <merijn> The pusher blog post was written by people who wanted to keep a several GB set of live data AND maintain microsecond latency. If you only have either a small live set OR care about throughput (instead of latency), GHC does just fine
14:05 juanpaucar joined
14:06 saussure joined
14:10 eacameron joined
14:10 NoCreativity_ joined
14:12 guest3783 joined
14:12 aarvar joined
14:13 zero_byte joined
14:15 Rodya_ joined
14:17 <ebw> Couldn't have the pusher guys justs used those compact regions?
14:18 <merijn> ebw: Well they didn't exist when they wrote it, I think?
14:18 <merijn> Additionally compact regions are for read-only data, I think they updated their data a lot
14:21 <Geekingfrog> merijn: correct, they moved to go about a year ago, and at that time, compact region didn't exist (I'm just learning they are usable now, I thought it was for later)
14:22 <Cale> The version of GHC which has support for compact regions hasn't even been properly released yet. :P
14:23 <Cale> (but it's on rc2, so should be soon :)
14:23 nickager joined
14:24 fotonzade joined
14:26 mengu joined
14:27 uglyfigurine joined
14:30 Gloomy joined
14:36 saussure joined
14:39 seangrove joined
15:01 iAmerikan joined
15:02 Rodya_ joined
15:03 fotonzade joined
15:05 Gloomy joined
15:07 Gloomy joined
15:08 cschneid_ joined
15:10 ebw joined
15:13 dni- joined
15:14 fotonzade joined
15:16 dunecat joined
15:16 takle joined
15:17 mengu joined
15:18 <WarmCookie> I learned recently that any stable pointer slows down garbage collection because they're managed in a seperated list that needs to be traversed on every collection to be marked and not sweeped.
15:18 <WarmCookie> I reworked an application that was using a ton of IORef for every entity to one IORef and a Hashmap; huge difference.
15:19 Gloomy joined
15:20 Gurkenglas joined
15:20 <WarmCookie> Apparently you're expected to have a handful of IORefs only, not thousands :P
15:23 <geekosaur> generally yes
15:23 <geekosaur> but I don;t think this has anything to do with StablePtr
15:25 bumpkin joined
15:31 Boarders joined
15:36 <Boarders> as an exercise I wrote a program that does a high-low guessing game where the user keeps inputting a number and it tells you if it is high or low
15:37 <Boarders> if the user inputs something that is not a integer then I want it to re-ask for a guess
15:37 <Boarders> I am a bit unsure how to do that
15:38 <WarmCookie> Boarders: all isDigit xs
15:38 <Iceland_jack> Boarders: Do you know how to test if something is an integer?
15:38 <Iceland_jack> :t readMaybe
15:38 <lambdabot> error: Variable not in scope: readMaybe
15:38 <Iceland_jack> It's in Text.Read.readMaybe
15:38 <WarmCookie> > all isDigit "1234"
15:38 <lambdabot> True
15:38 <WarmCookie> > all isDigit "12n34"
15:38 <lambdabot> False
15:39 <Iceland_jack> :t Text.Read.readMaybe "123" :: Maybe Int
15:39 <lambdabot> Maybe Int
15:39 <Boarders> ah ok
15:39 <Iceland_jack> > Text.Read.readMaybe "123" :: Maybe Int
15:39 <lambdabot> error:
15:39 <lambdabot> Not in scope: ‘Text.Read.readMaybe’
15:39 <lambdabot> No module named ‘Text.Read’ is imported.
15:39 <Boarders> thank you
15:39 <Iceland_jack> ugh that worked in PM
15:39 <WarmCookie> It doesn't handle the empty string case, but you probably want to handle that case independently anyway.
15:39 <Iceland_jack> no nvm, only :t works — odd
15:40 <WarmCookie> Iceland_jack: Correct :)
15:42 <Iceland_jack> readMaybe @Int "" ==> Nothing
15:42 <Iceland_jack> readMaybe @Int "242" ==> Just 242
15:44 bumpkin left
15:45 conal joined
15:45 bumpkin joined
15:46 <WarmCookie> Boarders: Iceland_jack I just realised the readMaybe is more correct. Consider negative numbers.
15:53 mengu joined
15:59 argent0 joined
16:00 bumpkin joined
16:03 Rodya_ joined
16:03 takle_ joined
16:04 mtg joined
16:07 uglyfigurine joined
16:07 Computist joined
16:11 galderz joined
16:14 takle joined
16:20 condy joined
16:26 bumpkin left
16:30 takle joined
16:31 takle joined
16:39 takle joined
16:41 takle joined
16:44 takle joined
16:44 fotonzade joined
16:46 takle_ joined
16:47 haskelleksah joined
16:48 takle joined
16:51 takle joined
16:53 iAmerikan joined
17:01 carlomagno joined
17:13 seagreen joined
17:19 juanpaucar joined
17:20 juanpaucar joined
17:30 cschneid_ joined
17:32 kradnl joined
17:35 ebw joined
17:40 pilne joined
17:47 kradnl joined
17:47 Rodya_ joined
17:49 mengu joined
17:51 Levex joined
17:53 carlomagno joined
18:03 uglyfigurine joined
18:07 Rodya_ joined
18:07 bumpkin joined
18:18 Rodya_ joined
18:19 takle joined
18:22 Levex joined
18:24 Gloomy joined
18:24 cschneid_ joined
18:26 takle joined
18:29 iAmerikan joined
18:31 Uniaika joined
18:32 takle joined
18:55 zdfsd joined
19:01 Gurkenglas joined
19:07 iAmerikan joined
19:08 Gloomy joined
19:09 albertus1 joined
19:12 argent0 joined
19:13 juanpaucar joined
19:17 juanpaucar joined
19:22 yellowj joined
19:24 Kuros` joined
19:25 conal joined
19:32 bvad joined
19:35 mtg joined
19:41 TCZ joined
19:47 Tomatosoup- joined
19:47 mengu joined
19:49 MotherFlojo joined
19:53 mengu joined
19:53 ski joined
19:53 pie_ joined
20:01 juanpaucar joined
20:07 Kuros` joined
20:09 fotonzade joined
20:10 drift joined
20:11 drift left
20:14 sync_ joined
20:15 m` joined
20:16 juanpauc_ joined
20:18 nullcone joined
20:33 pie_ joined
20:33 malaclyps joined
20:37 Boarders joined
20:38 pie_ joined
20:40 nickager joined
20:40 pie_ joined
20:43 sync__ joined
20:49 <Squarism> say i have : "filterOpt :: Maybe Int" and "aList:[Int]" - is there a nice way of writing the operation "Filter aList if filterOpt is Just otherwise just return list" - wo using "case .."?
20:50 <Squarism> ok.. its "maybe" i guess
20:53 puddl3glum joined
20:58 MolluskEmpire joined
21:01 iAmerikan joined
21:04 juanpaucar joined
21:06 juanpaucar joined
21:07 juanpaucar joined
21:07 unsymbol joined
21:11 Rodya_ joined
21:12 louispan joined
21:17 MolluskEmpire joined
21:28 grdryn joined
21:29 kadoban joined
21:29 <jle`> Squarism: note that 'maybe' is more or less just a first-class case statement/branch
21:30 <jle`> the only thing you're really avoiding is the syntactical case construct
21:32 <Squarism> jle`, i guess its more clear with case.. but getting tired of writing : Nothing ->
21:32 <Squarism> =D
21:32 <jle`> Squarism: i guess my point is that there might be a clearer way, in a big picture kind of way
21:32 <jle`> do you use the Int inside the Maybe Int at all?
21:33 jmiven joined
21:33 <Squarism> let lstFiltered = maybe lst (\toAndIncluding -> filter (\(id, _) -> id <= toAndIncluding) lst) toAndIncludingOpt
21:33 <jle`> ah
21:33 <Squarism> (dunno if that compiles yet though)
21:33 <jle`> well, assuming it does, another common thing people do is 'maybe id'
21:34 <Squarism> ah ok
21:34 <Squarism> nice
21:34 <jle`> lstFiltered = maybe id (\t -> filter ((< t) . fst)) lst
21:36 <jle`> er, instead of (< t) (t <=)
21:36 <Squarism> that is arguably alot nicer
21:36 <Squarism> or atleast alot shorter
21:36 <Squarism> =D
21:37 uglyfigurine joined
21:38 <Squarism> jle`, id love to learn more such useful tricks. Are there any listing somewhere?
21:38 <jle`> i'm not sure if there's a list, these are just kind of small random things that you see from reading a lot of code heh
21:40 fotonzade joined
21:40 saussure joined
21:42 kadoban joined
21:50 pie_ joined
21:53 hiratara joined
21:58 TCZ joined
21:59 mstruebing joined
22:00 <Gurkenglas> Squarism, "filter $ (< fromMaybe maxBound lst) . fst"? It's less efficient but you may not care
22:06 zero_byte joined
22:12 juanpauc_ joined
22:13 kadoban joined
22:15 louispan joined
22:24 uglyfigurine joined
22:30 saussure joined
22:31 hiratara joined
22:39 <Squarism> Gurkenglas, oh - thats even shorter.
22:39 <Squarism> imperative brainwash stops one from thinking of functions as values
22:41 Rodya_ joined
22:42 <Squarism> I have yet another question - i wanna pass a "generic" function to a function - but stumbles into problems. http://lpaste.net/355632
22:46 <geekosaur> you can make it work with an explicit forall inside the parens --- but you had better not ever need to know what "a" is outside that function
22:47 <glguy> Squarism: The simple solution is to fix the type signature to take the actual type you needed
22:47 <glguy> the complicated solution is to enable RankNTypes
22:48 sigmundv__ joined
22:49 <Squarism> the function is supposed to be generic - independent of "a"
22:49 <Squarism> geekosaur, glguy - ok - so "forall a " do require RankNTypes right?
22:50 <geekosaur> yes, what I said is the same as glguy's "complicated solution". (problem being, I can't tell if the simpler one is possible here)
22:51 <geekosaur> (at leats not at a quick glance and a mildly addled head because who ordered this damn weather anyway...)
22:52 Levex joined
22:55 <Squarism> geekosaur, where you at?
22:55 <Squarism> Here its like the first mild summer evening
22:57 stef204 joined
22:59 <geekosaur> Ohio. we just flipped from an unusually cool May to weather we'd normally (past 2 decades) start to get only at the end of the month. (and we're going to spend the next week flip-flopping between them)
22:59 <geekosaur> (there seems to be a general rule around here that memorial day weekend is an early taste of midsummer, then back to normal)
23:01 <Squarism> Fair to say, we had an abnormally cool may too - in Sweden
23:08 cschneid_ joined
23:14 NoCreativity joined
23:20 louispan joined
23:24 juanpaucar joined
23:24 yellowj joined
23:32 <Squarism> So what is the trick to hide anything type parameterized behind some plain interface that doesnt need to deal with these parameters? Say i have function loadThing :: Int -> (Thing -> b ) -> b ; loadThing id workWithThing = ...
23:32 exferenceBot joined
23:33 <Squarism> how do i pack my type parameterized stuff in "Thing"
23:33 louispan joined
23:34 cschneid_ joined
23:38 NoCreativity joined
23:40 saussure joined
23:42 Rodya_ joined
23:46 malaclyps joined
23:52 <Squarism> ok.. i can just wrapp it in some type that does that