Closed drewrip closed 5 months ago
@THE-COB This might be of interest. Since I haven't fleshed out the design of the compiler or even the source language it is slightly difficult to define issues clearly, but this is one I thought had a clear direction. Moving from reference counting to Box
seems like it might have interesting implications.
Finished with #7
When I first started writing the grammar and the AST for Rascal I found it easiest to wrap lots of the AST nodes in an
Arc
. To make things easiest to get going I wanted to use the most permissive structure possible and I had this idea in my head that I would parallelize part of the frontend (so I wanted the atomic part ofArc
). I'd like to move off ofArc
and useBox
instead (the more restrictive option).I haven't looked too far into how much the code base would have to be restructured to accomadate this, but I don't think it should be too bad. If nothing else we should be able to do a one-to-one swap
Arc
->Rc
, but I'd like to go fromRc
->Box
. I'm hoping to get around to this at some point, as I didn't put too much thought intoArc
originally.Most of the work should be in src/ast.rs, however the
Arc
usage propagates across many other files because of its use in the AST. The only one that might be particularly confusing since rust-analyzer won't pick it up is in src/rascal_grammar.lalrpop. This is the parser generator that I use, and it creates the nodes in the AST usingArc
's.