Ask HN: Strategies for porting native code to another OS?

2 points by khushia ↗ HN
My company has a handful of C++ server applications which run on very old versions of SunOS.

The hardware they're on is fairly ancient and we're struggling to find replacement parts (having to look on eBay...).

Management have decided it's time to get the apps onto modern h/w, and Linux.

We've identified a few "patterns" which modern gcc doesn't like, and we'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.

Are there any good methods/techniques/tools for porting C++ apps over to a new platform?

Would it be easier to re-write the applications in a higher-level language?

1 comment

[ 4.9 ms ] story [ 10.1 ms ] thread
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...).