jaq icon indicating copy to clipboard operation
jaq copied to clipboard

allow access to inner type of arena

Open slonkazoid opened this issue 4 months ago • 2 comments

this lets you allocate the code next to the AST so you can avoid lifetime hell

slonkazoid avatar Aug 05 '25 08:08 slonkazoid

Hi @slonkazoid! Before merging this, I would be interested in a concrete use case. Can you show me a code sample that profits from having this functionality?

01mf02 avatar Aug 05 '25 12:08 01mf02

i replied (twice) but email got blackholed i guess and github was 500ing

i replied:

cant exactly do that as github is currently 500ing for all PRs but i was parsing filters embedded in other strings, and keeping one arena which i can then pass into the filter parser made sense. issue was that the filter parser has to allocate a new String and it can't return the Modules type because the source String must live as long as it. giving it all the arena's lifetime made sense. however, i've moved onto doing the compilation in the filter parser so i no longer need this feature, but someone else might. looking at typed_arena's api, having a shared reference to Arena doesn't let you deallocate or modify existing entries, so, it should not cause any problems

slonkazoid avatar Aug 05 '25 17:08 slonkazoid

@slonkazoid, I just merged #372, so you can now access jaq's arenas. :)

01mf02 avatar Dec 15 '25 15:12 01mf02