I've been writing for about a month now, and even though I have to lookup the docs very very often, the hardest thing I find is to keep track of lifetimes of objects, references and (smart) pointers. Using references and smart pointers gives an illusion of almost having automatic garbage collection. But one mistake of not tracking the lifetime correctly, and the object disappears, causing null pointers and segmentation faults.

I don't know if I'm running into these issues because I'm a noob or because that's how C++ programming goes. Hopefully it will become more intuitive with time.

The second biggest problem that I have faced with writing a PL implementation in is the lack of immutable data structures. I keep modifying the AST by mistake while walking over it. This is made much worse by the fact that I'm trying to implement a with immutable data structures (much like ).

When I copy container data to preserve the old versions, I feel bad because of the performance implications. There is no easy way to share internal data between different versions of same data structures (AKA persistent data structures). Maybe there is a library that can help me all this.

0

If you have a fediverse account, you can quote this note from your own instance. Search https://fantastic.earth/users/abnv/statuses/112097786698881257 on your instance and quote it. (Note that quoting is not supported in Mastodon.)