I learned to escape the imperative programming languages, which in turn got me interested into and . Turns out, most of the real-world compilers are written in C and C++, so here I am back at square one.

After years of avoiding it for decades, I taught myself in the last couple of weeks. So anyway, does anyone want me to write a series of posts about making a (github.com/kanaka/mal) in C++?

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.

0

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