Search Haskell Channel Logs

Thursday, January 26, 2017

#haskell channel featuring glguy, askhask, uiop, fragamus, EvanR, hpc, and 12 others.

hpc 2017-01-26 11:45:17
tomorrow the DMR will be right back to scheming with hot-lips ;)
sm 2017-01-26 11:45:24
heh
orzo 2017-01-26 11:46:42
glguy, does ghci turn the monomorphism restriction off by default?
uiop 2017-01-26 11:46:49
hpc: i believe the term is "frenemy"
glguy 2017-01-26 11:46:52
Yeah
EvanR 2017-01-26 11:56:01
I guess I should post this here too... my haskell meetup has a new website: http://haskellcats.net/
EvanR 2017-01-26 11:56:22
i havent gone back and recovered all the topics we covered over the last year, but i will
dolio 2017-01-26 11:57:38
Did you take over the website where people posted Haskell cat image macros?
johnw 2017-01-26 11:57:59
lambdacats?
orzo 2017-01-26 11:58:02
i've been debuging memory leaks, and I find some things surprising. My 15.5 hours, but the hp2ps graph shows only to 2400 seconds. It also shows two strange unexpected phase shifts.
orzo 2017-01-26 11:58:25
sorry, I mean to say I ran the test for 15.5 hours, but the graph i got out is only to 2400 seconds
EvanR 2017-01-26 11:59:18
oh yeah, lambdacats
EvanR 2017-01-26 11:59:32
i figured there was somebody with a similar name somewhere
Tuplanolla 2017-01-26 12:03:58
How did you find attendees, EvanR?
EvanR 2017-01-26 12:04:41
i posted a hilarious flyer around town
EvanR 2017-01-26 12:04:58
involving bottom-ra: the never terminating, picture there on the page
Tuplanolla 2017-01-26 12:05:14
Did you even offer snacks?
sm 2017-01-26 12:05:16
EvanR++
EvanR 2017-01-26 12:05:27
at zotz cafe you cant bring outside food
Tuplanolla 2017-01-26 12:06:28
I consider arranging something similar every now and then, but then I stop.
EvanR 2017-01-26 12:06:43
wherever turing completeness exists... bottom ra lives!
orzo 2017-01-26 12:08:59
here's my heap profile, http://oi63.tinypic.com/119c5xl.jpg
fragamus 2017-01-26 12:09:35
ok I have figured out a good question to ask
orzo 2017-01-26 12:09:39
without knowing much about my code, is there any typical intuitive guess you could make about either of the two phase shifts?
orzo 2017-01-26 12:10:17
does the gc change algorithm at some threshold?
fragamus 2017-01-26 12:10:44
I am working with Turtle and I want to list the files in a directory like this s <- (ls "some/dir") but I want to reduce the stream such that I only get the first element
hpc 2017-01-26 12:11:33
orzo: does your algorithm change at some threshold?
fragamus 2017-01-26 12:12:33
I just want one Turtle.FilePath from (ls "some/dir")
fragamus 2017-01-26 12:12:38
any ideas
Tuplanolla 2017-01-26 12:12:57
What's the type of `ls`, fragamus?
fragamus 2017-01-26 12:13:27
ls :: Turtle.FilePath -> Shell Turtle.FilePath
Cale 2017-01-26 12:13:33
orzo: Nope, what does your program do?
orzo 2017-01-26 12:13:49
it has a bootstrapping phase, and I discounted that because it is too breif to last for half the duration of the test. But that was before I noticed that I'm not seeing the full duration. The time stamps at the bottom show it happened at 1100 seconds, which is makes it a reasonable explanation
orzo 2017-01-26 12:14:06
why does my graph not show the full 15.5 hours that i ran the program?
Cale 2017-01-26 12:14:26
It only shows the time spent in the mutator
Cale 2017-01-26 12:14:44
(I think -- in any case, it's not wall clock time)
orzo 2017-01-26 12:14:52
those aren't wall clock seconds?
Cale 2017-01-26 12:15:02
right
orzo 2017-01-26 12:15:14
well that would be consistent with what the gc stats told me before i quit
orzo 2017-01-26 12:15:24
my mutator time was far far less than my wall clock time
orzo 2017-01-26 12:15:53
but then, the bootstraping phase, which would be arodn 2 minutes wall-clock wouldn't account for the phase shift
Cale 2017-01-26 12:16:22
can you post it as an svg?
orzo 2017-01-26 12:16:42
the program participates in the ML-DHT network associated with bittorrent
dfeuer 2017-01-26 12:16:42
@pl \f -> Identity (fix (runIdentity . f))
lambdabot 2017-01-26 12:16:42
Identity . fix . (runIdentity .)
orzo 2017-01-26 12:17:02
to answer somebody's question
Cale 2017-01-26 12:17:05
ah
Cale 2017-01-26 12:17:25
So I'm guessing the quadratic behaviour doesn't really bode well
hpc 2017-01-26 12:17:35
dfeuer: mfix?
orzo 2017-01-26 12:17:40
no it's a leak
ocharles 2017-01-26 12:17:57
Does anyone know why :info in GHCI is only showing me one constructor from a data type, and then just `| ...`?
ocharles 2017-01-26 12:18:04
How do I get it to show all constructors?
glguy 2017-01-26 12:18:27
ocharles: Use :i on the type name
hpc 2017-01-26 12:18:30
ocharles: what data type?
ocharles 2017-01-26 12:18:33
oh, right
ocharles 2017-01-26 12:18:38
Yea, I'm using it on the constructor
ocharles 2017-01-26 12:18:39
duh
hpc 2017-01-26 12:18:45
heh
dfeuer 2017-01-26 12:19:18
hpc: yeah.
askhask 2017-01-26 12:24:55
so is there a language more "modern" than haskell in its design constraints?
orzo 2017-01-26 12:25:13
they should put wall-clock marks on the graph in addition even if it's not a consitent linear scale
Tuplanolla 2017-01-26 12:25:24
Well, there's Idris, askhask...
hpc 2017-01-26 12:25:30
and agda
Cale 2017-01-26 12:25:41
askhask: I suppose the dependently typed languages, like Agda, Idris, and Coq could be thought of that way
askhask 2017-01-26 12:25:50
is that it?
hpc 2017-01-26 12:25:56
just about
hpc 2017-01-26 12:26:09
haskell has a combination of design decisions that keeps it very fresh
Cale 2017-01-26 12:26:25
Haskell is still *somewhat* evolving too.
hpc 2017-01-26 12:26:29
and it's the target of a lot of CS research
Tuplanolla 2017-01-26 12:26:31
Coq (or Gallina) is, like Haskell, a bit older.
hpc 2017-01-26 12:26:59
language extensions and a conservative standard that leaves implementation details open are the big things
glguy 2017-01-26 12:27:12
askhask: That question is rather too vague to have a real answer. Is there an aspect in particular you're interested in?
Cale 2017-01-26 12:27:15
Yeah, it's hard to say that Coq is entirely more modern than Haskell -- in some ways, it's more old-fashioned
MarcelineVQ 2017-01-26 12:27:20
how old is mercury ?
Cale 2017-01-26 12:27:29
Pretty old
MarcelineVQ 2017-01-26 12:27:38
how about the lang?
Cale 2017-01-26 12:27:56
Mercury has been around since 1995 apparently
Tuplanolla 2017-01-26 12:28:03
I think Coq might even predate Haskell, but I don't remember the details.
askhask 2017-01-26 12:28:10
i've been programming for 20 years but am a programming lagnuage noob
Cale 2017-01-26 12:28:18
Tuplanolla: yeah, by a little bit, it does
Cale 2017-01-26 12:28:33
May 1, 1989 was the first release (but version 4.10 somehow)
askhask 2017-01-26 12:28:44
so i am kind of curious what the "most advanced" language is
askhask 2017-01-26 12:28:48
as languages go
Tuplanolla 2017-01-26 12:28:49
It's difficult to say though since these things first emerge from language-like fuzz.
Cale 2017-01-26 12:29:14
Haskell is basically open-source Miranda though
Cale 2017-01-26 12:29:17
at least, it was
Cale 2017-01-26 12:29:28
back in 1999 or so
askhask 2017-01-26 12:30:49
and what's this i hear about "some algorithms don't have non-imperative implementations" or that haskell is a great imperative language?
Cale 2017-01-26 12:31:11
askhask: Well, I think you could do worse than to pick up Haskell as a start, as most of the other languages that are actually making progress in various ways are similar to Haskell.
askhask 2017-01-26 12:31:14
do the promises of functional programming and implementation end up breaking down when you actually go to write stuff?
Cale 2017-01-26 12:31:22
(But Haskell is actually practical for real work now)
Cale 2017-01-26 12:31:34
No, they're even more apparent, I'd say
Cale 2017-01-26 12:31:47
You don't really understand how beneficial Haskell's type system is until you're working on a team
hpc 2017-01-26 12:32:08
askhask: imo it's one of the best imperative languages around
hpc 2017-01-26 12:32:18
askhask: because of purity (which factors out IO to its own type)
hpc 2017-01-26 12:32:41
askhask: and then being able to consider (IO ()) and simlar types of values in a first-class way
orzo 2017-01-26 12:32:45
i agree with everything you're saying Cale, except in my present circumnstances with a memory leak... I think Haskell is uniquely bad at helping the coder with this
hpc 2017-01-26 12:32:45
:t forkIO
lambdabot 2017-01-26 12:32:47
error: Variable not in scope: forkIO
askhask 2017-01-26 12:32:59
hpc: so you're saying that when you actually go to implement, you end up writing C equivalent?
Cale 2017-01-26 12:33:01
orzo: Well, hey, you have a pretty heap profile graph to help ;)
hpc 2017-01-26 12:33:03
forkIO :: IO () -> IO ()
Cale 2017-01-26 12:33:15
orzo: But I agree, heap profiling could be a lot better
hpc 2017-01-26 12:33:23
askhask: not quite
Cale 2017-01-26 12:34:27
I think memory leaks are hard in almost any language -- I can't actually think of a language whose tools makes them much easier to deal with.
orzo 2017-01-26 12:34:33
Cale, here's a leak i fixed earlier with the help of a heap profile graph. I still don't understand why the fix is a fix: http://lpaste.net/351645
Tuplanolla 2017-01-26 12:35:06
I take it you haven't used Valgrind, Cale.
Cale 2017-01-26 12:35:25
Tuplanolla: Not a whole lot, I have to admit
hpc 2017-01-26 12:35:37
askhask: C isn't that great of an imperative language imo, because it has that syntactic manipulation aspect of CPP and a lot of leaky abstractions over machine details
geekosaur 2017-01-26 12:35:43
valgrind can tell you what leaked and where but not necessarily how to avoid the leak
hpc 2017-01-26 12:36:01
it comes out more as a procedural language with a string replacement metalanguage on top of it
Tuplanolla 2017-01-26 12:36:01
I couldn't write C without it anymore. I'm spoiled.
hpc 2017-01-26 12:36:32
where you run a state machine over a particular configuration of memory
Cale 2017-01-26 12:36:52
Tuplanolla: With the amount of effort you spend dealing with memory management issues in C, I don't think it could possibly add up to being easier to deal with overall than in Haskell, even with valgrind ;)
Tuplanolla 2017-01-26 12:37:41
Well, these days I pretty much only write C when I don't need `malloc`, Cale.
Cale 2017-01-26 12:37:55
orzo: That one is interesting...
geekosaur 2017-01-26 12:37:57
it's only "easier" if you an avoid it entirely (rare) or are dealing with special memory management environments (think kernel) (where C is as evil as anything else but slightly less noisy)
askhask 2017-01-26 12:38:35
is garbage collection necessary/inevitable?
Cale 2017-01-26 12:38:57
askhask: It's desirable.
Cale 2017-01-26 12:39:10
askhask: Or you mean in Haskell?
Cale 2017-01-26 12:39:22
It would ruin Haskell to not have a garbage collector.
orzo 2017-01-26 12:39:41
Cale: the most straight forward trivial examples of 'forever' versus 'fix' did not reproduce the leak behavior
Cale 2017-01-26 12:39:47
Though there are possibly approaches you could take with region-based memory management
askhask 2017-01-26 12:40:21
garbage collection in a general context--is it necessary?
orzo 2017-01-26 12:40:29
i'd say no
askhask 2017-01-26 12:40:33
within haskell or not within haskell
Cale 2017-01-26 12:40:39
askhask: Well, no, obviously you can manage memory by hand if you really want to.
orzo 2017-01-26 12:40:42
with haskell, probably
askhask 2017-01-26 12:40:55
like, it's 2017, why are we still talking about memory management
Cale 2017-01-26 12:40:59
askhask: It's just tedious and error prone and usually you end up doing a worse job than a machine would in the end anyway
askhask 2017-01-26 12:41:03
i thought this problem would have been taken care of a long time ago
askhask 2017-01-26 12:41:12
right
Cale 2017-01-26 12:41:12
Well, it's not an easy problem
hpc 2017-01-26 12:41:13
askhask: because it's not a solved problem
askhask 2017-01-26 12:41:16
humans shouldn't do things that machines can
askhask 2017-01-26 12:41:31
so either machines can figure out when to allocate/dealloc
uiop 2017-01-26 12:41:37
in haskell you basically can't even loop without leaving garbage in the heap, so without a gc it would basically be ruined
askhask 2017-01-26 12:41:38
at compile time, or we need GC?
hpc 2017-01-26 12:41:40
it's a mostly mitigated problem, but as long as you can write programs that consume all your memory it still matters
orzo 2017-01-26 12:41:43
hm
Cale 2017-01-26 12:41:46
Well, the thing is, it's equivalent to the halting problem
Cale 2017-01-26 12:41:57
So you're never going to do it perfectly
Cale 2017-01-26 12:42:04
and a machine is never going to either
glguy 2017-01-26 12:42:08
orzo: What version of GHC was the forever leak on?
orzo 2017-01-26 12:42:16
8.0.1
taktoa 2017-01-26 12:42:17
Cale: only if your programming language is turing complete ;)
glguy 2017-01-26 12:42:25
orzo: You're not the first person I've heard experience that
hpc 2017-01-26 12:42:25
non-turing-complete languages are starting to gain significance though
hpc 2017-01-26 12:42:42
so there might be some super-damn-fascinating rust derivative in our future
uiop 2017-01-26 12:43:08
i havent looked at rust since it was in its vwery beginning stages
taktoa 2017-01-26 12:43:29
hpc: yes, that was what I was getting at. Idris has uniqueness types, so it's not far off from that (well, surface syntax is very different, but type-system-wise)
uiop 2017-01-26 12:43:30
so what's the technical no-nonsense executive summary of rust's memory management?
askhask 2017-01-26 12:43:39
basically every language has tragic flaws
askhask 2017-01-26 12:44:20
so do people know whether allocation/deallocation can be planned in advance of runtime?
askhask 2017-01-26 12:44:30
whether or not a human does it,... preferablly not
askhask 2017-01-26 12:44:33
*preferably
Tuplanolla 2017-01-26 12:45:00
It can be solved for some cases, but not all, askhask.
taktoa 2017-01-26 12:45:01
uiop: "automatic compile-time GC with (mostly) inferred lifetimes, represented by affine types"