novakboskov 2017-02-10 05:45:16
What is cause of this: foldr (||) False [False ..]
novakboskov 2017-02-10 05:45:19
foldr (||) False [False ..]
phadej 2017-02-10 05:45:48
lambdamu: I mean, if your section generates abnormal amounts of garbage, it has to be collected
ClaudiusMaximus 2017-02-10 05:45:57
would be nice to have critical regions with no gc and no pre-emption from other haskell threads (to allow some FFI things with thread-local variables like errno), but i guess not possible without major changes to ghc
lambdamu 2017-02-10 05:45:57
phadej: Eq on STRef: Im looking to keep the stref in a hashtable so Eq alone isn't sufficient, question is, is the pointer equality check safe because it runs atomically not giving the gc a chance to strike or because gc doesn't move the ptrts?
novakboskov 2017-02-10 05:46:22
> foldr (||) False [False ..]
lambdabot 2017-02-10 05:46:24
True
ClaudiusMaximus 2017-02-10 05:46:52
@src or
lambdabot 2017-02-10 05:46:52
or = foldr (||) False
lambdamu 2017-02-10 05:47:02
phadej: Or are those questions misguided? Maybe I'm having the wrong operational model in mind
ClaudiusMaximus 2017-02-10 05:48:28
lambdamu: are you trying to have a hashtable of stref within a larger data structure, or 'bare'? maybe you could make the hash instance ignore the stref, or include a dummy counter when you create your (Int64, STRef a)
ClaudiusMaximus 2017-02-10 05:48:58
(and use the Int64 in the hash instead of the stref)
phadej 2017-02-10 05:49:18
lambdamu: I'm not 100% sure, but STRef is MutVar# which is a pointer to object on a heap
oisdk 2017-02-10 05:49:25
> [False ..]
lambdabot 2017-02-10 05:49:29
[False,True]
phadej 2017-02-10 05:49:49
but there are barriers, so if the object on the heap moves the MutVar#s should be updated
lambdamu 2017-02-10 05:51:06
phadej: Ah so things on the heap can move in general, if this happens to something that is pointed at it finds all occurences of the pointers and updates all the values, in the nominally pure data?
lambdamu 2017-02-10 05:51:33
ClaudiusMaximus: I'm not sure I understand let me think about it
lambdamu 2017-02-10 05:51:48
phadej: Effectively meaning the ptrs are not unaffected by the gc
lambdamu 2017-02-10 05:52:17
phadej: They are just corrected to point correctly to a new location
phadej 2017-02-10 05:52:56
lambdamu: I'm not sure, but yes, in the same way as (:) has pointers. With MutVar# you can *mutate* the pointers, so that's the difference
lambdamu 2017-02-10 05:53:47
phadej: No worries if your not certain anything helps
ClaudiusMaximus 2017-02-10 05:53:54
lambdamu: you'd write something like mkNewSTRef' :: ST s (a -> ST s (Int64, STRef s a)) where you use its result value in place of newSTRef
phadej 2017-02-10 05:54:27
lambdamu: but I wouldn't write overly long ST computations
lambdamu 2017-02-10 05:54:49
phadej: Sometimes there seems to be no choice
phadej 2017-02-10 05:55:09
lambdamu: I'm curious, what you are working on?
lambdamu 2017-02-10 05:55:37
phadej: I'm implementing Self-Adjusting Computation after the 2008 paper by Acar
lambdamu 2017-02-10 05:56:25
"An experimental analysis of Self-Adjusting Computation" is the title
phadej 2017-02-10 05:57:13
is it FRP without events?
phadej 2017-02-10 05:58:01
lambdamu: I remember skimming those, wondering would it work if build on top of STM
phadej 2017-02-10 05:58:12
effectively enough
lambdamu 2017-02-10 05:59:06
phadej: I'm not sure about implementations of FRP really, I've heard the comparison come up a few times but it never so it given any depth
phadej 2017-02-10 05:59:38
lambdamu: I see.
lambdamu 2017-02-10 06:00:24
phadej: I'm not sure about STM either, I thought utilizing it in some way but it doesn't strike me as obvious
lambdamu 2017-02-10 06:01:08
phadej: the is no concurrency ongoing
lambdamu 2017-02-10 06:01:59
phadej: But the internal implementation details of STM could maybe be reused for tighter integration with the compiler faclliating change propagation
lambdamu 2017-02-10 06:02:25
phadej: but thats currently far out of the scope
phadej 2017-02-10 06:02:42
lambdamu: from the application writer pov. I calculate once. Then the change comes (to random thread), I do stm transaction which updates the state
phadej 2017-02-10 06:02:55
-> profit
phadej 2017-02-10 06:03:30
lambdamu: https://www.youtube.com/watch?v=acZkF6Q2XKs might be interesting to you
lambdamu 2017-02-10 06:04:12
phadej: Yes I suppose, the dynamic depence graph has to be guarded with a lock, since the mutator can have multiple threads
Ferdirand 2017-02-10 06:04:26
p/win 5
lambdamu 2017-02-10 06:04:45
phadej: but thats really appears to be a minor detail and i guess i go with a mvar for efficieny
phadej 2017-02-10 06:05:13
lambdamu: that's why I'm interested in STM, so you don't need to have global lock
phadej 2017-02-10 06:05:27
global lock doesn't sound very sexy
lambdamu 2017-02-10 06:07:06
phadej: I would have to think about it, but I don't think it would gain much, since there is no fine grained concurrency possible, either the dependence graph is currently in propagation or it's not
lambdamu 2017-02-10 06:07:50
phadej: At least it's not obvious to me
phadej 2017-02-10 06:08:21
lambdamu: I'm not sure either. For static graph, where you can use topological sort to propagate stuff, only a part of graph have to be recalculated
phadej 2017-02-10 06:09:17
I'm not sure you can call that "SAC"
phadej 2017-02-10 06:10:28
lambdamu: I made https://github.com/phadej/menrva in JS for that, and it works well for everything (toy-sized though) I have thrown it upon
phadej 2017-02-10 06:10:38
haven't time / need to port it to haskell + stm
lambdamu 2017-02-10 06:11:12
phadej: I'll take a look
dhalgren_ 2017-02-10 06:12:01
I seem to have a bunch of fromIntegral.length around, because I divide it to get doubles. is it generally needed or am I missing something obvious
lambdamu 2017-02-10 06:12:06
lambdabot: Are you dealing with any kind of higher-order signal?
lambdamu 2017-02-10 06:12:30
phadej: meant you
phadej 2017-02-10 06:12:45
lambdamu: no, the dependency graph is static
phadej 2017-02-10 06:14:01
I use it to make buttons change colors :)
lambdamu 2017-02-10 06:14:33
phadej: ah you sent the propagator talk, I remeber seeing it, any having no clou what it is about despite having implemented a sat solver and reading about SAC
lambdamu 2017-02-10 06:14:56
phadej: Should have listen more carefully
lyxia 2017-02-10 06:16:02
dhalgren_: genericLength is a standard function that does the same.
dhalgren_ 2017-02-10 06:16:13
nice
lyxia 2017-02-10 06:17:41
dhalgren_: it's fine not to use it too.
phadej 2017-02-10 06:19:05
lambdamu: I don't remember the details, but perturbing inputs in cas is "adding more information" to the lattice
bollu 2017-02-10 06:34:06
omg omg, this is offtopic, but google code is down?!
bollu 2017-02-10 06:34:17
I had written a game as a kid that was hosted on google code. IS there ANY way I can get it back? :(
bollu 2017-02-10 06:34:23
it was called "herogame" IIRC
Jinixt 2017-02-10 06:36:31
may still be archived if you're lucky
bollu 2017-02-10 06:36:44
yes, I checked! looked like it is
bollu 2017-02-10 06:36:51
I'm downloading the archive now :')
bollu 2017-02-10 06:37:21
holy fuck I want to read the utterly byzantine horror show of C++ I had written as akid
bollu 2017-02-10 06:37:24
as a *
mmachenry 2017-02-10 06:40:38
bollu: One thing I like about Haskell is that my 15-year old Haskell code that I very recently had to revisit was actually fairly reasonable compared to my 15-year old code I've written in most other languages.
bollu 2017-02-10 06:41:46
mmachenry: xD I can believe that
bollu 2017-02-10 06:42:05
mmachenry: I went very overboard with this though, because IIRC I would up reading "design patterns" at that point in my life
bollu 2017-02-10 06:42:10
I was.. heavily influenced
Sonolin 2017-02-10 06:42:51
I haven't been working with haskell long enough to deal with "old code", but the thing I like most about haskell is code maintenance
yyyyy 2017-02-10 06:43:01
mmachenry: my impression is that in 15-years from now your 30-year old code will read fine, but maybe your current day code will be unreadable to anyone not super experienced in haskell.
Tuplanolla 2017-02-10 06:43:32
That happened to me already, yyyyy.
Sonolin 2017-02-10 06:43:41
even if code is riddled with bad code and/or "procedural-style" thinking, I can usually completely replace all of it with a handful of funtions
mmachenry 2017-02-10 06:43:51
yyyyy: Why is that? Too many new features in Haskell?
yyyyy 2017-02-10 06:43:53
Tuplanolla: the future is now!