Sender | Message | Time |
---|---|---|
30 Mar 2024 | ||
jimb | But if Arena were published as a "general purpose" crate, I can imagine some energetic person showing up with a tagging scheme or something something branded lifetimes something something invariant subtyping | 22:11:08 |
jimb | and that's just a distraction. There's no need for that in our context. | 22:11:24 |
jimb | So I think if we pull it out, there needs to be some messaging around what its scope is. It supports wgpu, period. | 22:11:57 |
jimb | * So I think if we pull it out of Naga, there needs to be some messaging around what its scope is. It supports wgpu, period. | 22:12:07 |
jimb | It's so simple, if it doesn't suit your needs, write your own. | 22:12:25 |
jimb | * "It's so simple, if it doesn't suit your needs, write your own." would be our message to outside users. | 22:12:39 |
jimb | I guess the crate should be named wgpu_arena or something, so that we don't appear to be offering a competitive alternative to other arena-ish things on crates.io. | 22:13:08 |
jimb | The other wrinkle: Naga's Arena s store source location spans, too. | 22:15:14 |
jimb | No, we don't really need the details tracked. We know that Naga's current analysis is conservative and non-standards-compliant, and we have it on our roadmap to be entirely replaced. | 22:30:06 |
jimb | In reply to @eddyb:matrix.orgI have no attachment to the name. | 22:31:02 |
crowlkats | https://github.com/gfx-rs/wgpu/pull/5459 | 23:04:52 |
31 Mar 2024 | ||
lylythechosenone | good point | 01:23:10 |
imbris changed their profile picture. | 15:27:44 | |
2 Apr 2024 | ||
ErichDonGubler | In reply to @jimb:mozilla.orgHot take: use a newtype. | 16:50:26 |
jimb | It doesn't work out quite the way you'd hope. | 16:51:03 |
jimb | So you've got your function arenas, Function::expressions , and your global arena, Module::global_expressions . | 16:51:38 |
jimb | Both of them are indexed by Handle<Expression> | 16:51:50 |
jimb | You can say, okay, struct GlobalExpression(Expression); and then have Module::global_expressions be an Arena<GlobalExpression> . | 16:52:42 |
jimb | But the Expression variants inside that GlobalExpression still hold Handle<Expression> handles for their subexpressions. | 16:53:19 |
jimb | So as soon as you get any data out of the arena, it's not just that you've lost typing information - it's incorrectly typed, because Handle<Expression> is what you were using for Function::expressions . | 16:54:00 |
jimb | Okay, so, make Expression generic over a type H for subexpression handles. But now the type of Function::expressions is Arena<FunctionExpression> , where struct FunctionExpression(Expression<FunctionExpression>); . | 16:55:52 |
jimb | and at this point you say, I have taken a wrong turn somewher | 16:56:24 |
jimb | * and at this point you say, I have taken a wrong turn somewhere | 16:56:27 |
jimb | or at least I do | 16:56:31 |
jimb | * So as soon as you get any data out of the arena, you've lost typing information. | 16:57:28 |
jimb | * So as soon as you get any data out of the arena, you've lost the newtype. | 16:57:40 |
jimb | Also:
| 17:00:21 |
jimb | I suppose I could fix this, but again, it feels like I made a wrong turn:
| 17:00:53 |
jimb | You can feel your Haskell muscles warming up and it's a bad sign | 17:01:14 |
ErichDonGubler | * Hot take: use a newtype? | 17:51:25 |