
Ask HN: Strategies for porting native code to another OS? - khushia
My company has a handful of C++ server applications which run on very old versions of SunOS.<p>The hardware they&#x27;re on is fairly ancient and we&#x27;re struggling to find replacement parts (having to look on eBay...).<p>Management have decided it&#x27;s time to get the apps onto modern h&#x2F;w, and Linux.<p>We&#x27;ve identified a few &quot;patterns&quot; which modern gcc doesn&#x27;t like, and we&#x27;ve got a few Perl scripts to run regexes over the codebase for those cases, but it seems like this is going to be a very manual process.<p>Are there any good methods&#x2F;techniques&#x2F;tools for porting C++ apps over to a new platform?<p>Would it be easier to re-write the applications in a higher-level language?
======
andreiw
Almost always no.

What you have today is a fairly incremental process that also guarantees the
changes being made are well-localized, and thus can be reviewed to ensure that
overall business logic is not affected. The other issue is that most likely,
you don't have anyone who really knows how these applications work (otherwise,
you probably wouldn't have been running them on "old versions of SunOS"). This
means that even if you had the luxury of a rewrite, it's an open-ended problem
with no set deadline.

So enjoy massaging the code into something modern. When you're done, you
should have a good understanding of both design and implementation issues, and
you can make the decision for a rewrite then (but most likely, the answer will
be a 'no' again...).

