2025/10/19

Newest at the top

2025-10-19 21:19:00 +0200 <Haskeller0x00> So, we can do the same for region, no? It can all be essentially just within the same "s"?
2025-10-19 21:18:50 +0200jreicher(~user@user/jreicher) jreicher
2025-10-19 21:18:31 +0200karenw(~karenw@user/karenw) (Ping timeout: 246 seconds)
2025-10-19 21:18:18 +0200jreicher(~user@user/jreicher) (Ping timeout: 248 seconds)
2025-10-19 21:18:08 +0200 <geekosaur> that part is correct, yes, as the "s" in "ST s a" is (effectively) a phantom tag with no data associated
2025-10-19 21:17:46 +0200flipflops(~cmo@2604:3d09:207f:8000::d1dc) (Ping timeout: 248 seconds)
2025-10-19 21:15:22 +0200inline(~inline@ip-178-202-059-161.um47.pools.vodafone-ip.de) Inline
2025-10-19 21:14:41 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-19 21:13:40 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Quit: Leaving)
2025-10-19 21:13:12 +0200peterbecich(~Thunderbi@172.222.148.214) peterbecich
2025-10-19 21:12:31 +0200inline(~inline@2a02:8071:57a1:1260:504d:3076:81f0:8f9d) (Ping timeout: 250 seconds)
2025-10-19 21:08:27 +0200 <Haskeller0x00> What my understanding has been so far about his response is, the "region" will only be defined in the type system and will not have an actual memory definition.
2025-10-19 21:07:21 +0200 <Haskeller0x00> I think that's what he meant by "phantom region parameter".
2025-10-19 21:06:54 +0200 <Haskeller0x00> *cannot
2025-10-19 21:06:49 +0200 <Haskeller0x00> but, that does not mean I can have different regions within the same state.
2025-10-19 21:06:22 +0200 <Haskeller0x00> So what he essentially explained was, if I were to have each region as a separate state, I'd be in trouble.
2025-10-19 21:05:51 +0200 <Haskeller0x00> yup, I think that's what he meant with the last sentence in his response.
2025-10-19 21:05:30 +0200 <geekosaur> (2) I'm not sure how that statement by one of the authors squares with the assertion in section 1 of the paper that ST isn't sufficient
2025-10-19 21:04:37 +0200 <geekosaur> a few other things: (1) even with eager evaluation, GC of values from runST won't necessarily happen immediately; only reference-counting GC implementations do that. so even strict values hang around (which regularly bites people relying on GC to free e.g. Handles and thereby close their associated files)
2025-10-19 21:04:10 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 256 seconds)
2025-10-19 21:02:09 +0200morj(~morj@user/morj) (Quit: Konversation terminated!)
2025-10-19 21:01:27 +0200 <Haskeller0x00> He (the author) explained that what he meant was regions will live within the same state meaning state won't itself be nested.
2025-10-19 21:00:43 +0200caconym7478798(~caconym@user/caconym) caconym
2025-10-19 21:00:02 +0200caconym7478798(~caconym@user/caconym) (Quit: bye)
2025-10-19 20:59:57 +0200 <Haskeller0x00> yup, it took me a couple hours, but. I understood how the "s" works.
2025-10-19 20:59:23 +0200 <geekosaur> note that runST and company do not require modifications to the type system! they just make everything polymorphic in an untouchable rank-2 value, which therefore can't escape runST
2025-10-19 20:59:09 +0200 <Haskeller0x00> because the ST computation may still be "running" as the runST result is lazily evaluated."
2025-10-19 20:59:09 +0200 <Haskeller0x00> memory management, but, AFAIK, even the ST monad doesn't actually eagerly delete STVar's at the end of runST; they are just "normal" heap allocated objects that will get garbage collected when unreachable. Although it seems as though they would necessarily be unreachable at the end of runST, it's a little more complicated with lazy evaluation,
2025-10-19 20:59:08 +0200 <Haskeller0x00> hmm... because when my advisor emailed one of the authors of the paper, their response was this: "There wasn't ever an implementation of RGN. You could certainly write RGN (with all the types) as a wrapper around ST; it would essentially just treat the region parameter as phantom. The meaningful implementation would really all be in terms of the
2025-10-19 20:58:53 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-10-19 20:58:13 +0200 <geekosaur> it's a starting point but it's one that demonstrates that soemthing else is needed; that something else not only modifies the compiler, it modifies System F (the type system)
2025-10-19 20:57:56 +0200trickard_(~trickard@cpe-57-98-47-163.wireline.com.au)
2025-10-19 20:57:32 +0200 <geekosaur> "Does this suffice to encode region-based languages, where runRGN corresponds to letregion? In short, it does not."
2025-10-19 20:57:22 +0200 <Haskeller0x00> Yes, I saw that but I thought that was at least a good starting point to understand what I need to do to encode this.
2025-10-19 20:56:25 +0200 <geekosaur> (I suspect you took it as saying how to encode RGN via ST, but in fact it does so and then demonstrates why the result doesn't work)
2025-10-19 20:56:07 +0200ss4(~wootehfoo@user/wootehfoot) (Ping timeout: 246 seconds)
2025-10-19 20:55:57 +0200 <geekosaur> see section 2 of the paper, they go into detail why encoding the RGN monad via ST won't work
2025-10-19 20:54:42 +0200wootehfoot(~wootehfoo@user/wootehfoot) wootehfoot
2025-10-19 20:53:52 +0200 <Haskeller0x00> Also, if that is not going to work, then how would I go about implementing this?
2025-10-19 20:53:17 +0200 <Haskeller0x00> Uh, even if I were to define RGN as newtype RGN s r a = RGN (ST s a)?
2025-10-19 20:52:15 +0200 <geekosaur> right at the bottom of page 3 of the paper you linked, it tells you why runST won't work
2025-10-19 20:51:05 +0200trickard_(~trickard@cpe-57-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-10-19 20:50:48 +0200 <geekosaur> wrapping runST isn't generally a good idea, because if you wrap individual functions you'll find you can't carry anything between invocations of runST (by design)
2025-10-19 20:49:02 +0200 <Haskeller0x00> Uh... can anyone help me with understanding what I'm doing wrong here?
2025-10-19 20:47:22 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 246 seconds)
2025-10-19 20:47:18 +0200trickard_(~trickard@cpe-57-98-47-163.wireline.com.au)
2025-10-19 20:46:56 +0200trickard_(~trickard@cpe-57-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-10-19 20:43:46 +0200 <Haskeller0x00> I have so far been able to define the basic functions, but haskell does not like it when I try to wrap runST
2025-10-19 20:42:37 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Ping timeout: 250 seconds)
2025-10-19 20:42:08 +0200target_i(~target_i@user/target-i/x-6023099) target_i