Hacker News new | ask | show | jobs
by bluGill 559 days ago
In C++ I have learned the patterns and so I rarely need to worry about lifetime - everything is either on the stack or a unique_ptr. Even when I need to take a pointer I know I don't own it but my project has clear lifetime rules and so I normally won't run into issues.

The above is not perfect. I do sometimes mess up, but it is rare, and that is C++ so I don't get tools/the language helping me.

1 comments

Ok, but wouldn’t it be nice to have a language that checks all that automatically? (And is much nicer than C++ in most other ways too.)
I've long been intrigued by rust for their claims on those lines. But I can't justify a billion dollars and many years to rewrite our current c++. that means anything would need to understand c++ types so I can call existing functions that need a vector or implement a virtual function on an existing interface.

We are actually looking at a different option: break up our processes and use IPC. There are architecture reasons to do this, but that means the IPC is something we can define and so some of those processes would be all new code that could then be written in rust. Others of them would be small enough that it is feasable to rewrite in rust without blowing the schedule/budget. However that still leave the vast majority of our code as C++ for the foreseeable future.