Having a bit of fun re-implementing a normalisation-by-evaluation base elaborator using arena allocation for terms. Seems to work well, and doesn't result in much weirdness with lifetimes! Only end up needing to use reference counting in values.
Conversation
Still not sure how best to implement my environments as I need them to be persistent. I've used `im::Vector` lib.rs/crates/im in the past, but it seems a tad chonky (size wise) to store in values… maybe I should just go with linked lists?
2
You could try the Vector in rpds, it looks a little leaner in terms of memory: docs.rs/rpds/0.9.0/rpd
1
1
ah neat! seems to be behind a pointer which is nice.
2
Not sure about your workload, but I’m very tempted to think that cloning Vecs will be tough to beat!
1
Replying to
Yeah I'll need to measure it. The issue is in this file - the places I clone are marked with the 'FIXME: ValueEnv::clone' comments. The issue is that there's a bunch of them and it happens a lot. But yeah I dunno if that is outweighed by cache effects and index lookups.
Woops, forgot to link it:

