Ask HN: Resources for developing multi-platform native code libraries?
For context, I work in the mobile game industry developing for iOS and Android phones in a multi-platform (Mac, Window, Linux) development environment. You can do a lot without having to worry about writing low level code, but every once in a while, it becomes necessary. I have a basic working knowledge of these things, and of course, there are many case-by-case considerations when dealing with a device’s specific architecture, but much of my knowledge around this stuff is cobbled together from all sorts of different sources over the years. Anything more formal?
It seems like CMake and its reference guide is actually the closest and most informative thing that I have found in this ballpark. Any other recommendations or go-to sources for this kind software development?
3 comments
[ 3.2 ms ] story [ 16.0 ms ] threadThe goal of standardisation for C was in part to aid portability. That worked out to some degree. So thats the best place to start. The goal of POSIX was to standardize UNIX system interfaces across the various flavors. That worked out to some degree also. You also need to to get the interfaces for Windows, Linux and so forth because they all have various 'innovations' that have been created which are not adherent to any standard or portable.
At a minimum you should become familiar with the fallowing material.
* ISO/IEC 9899:1999 - ISO/IEC 9899:2011 http://www.open-std.org/jtc1/sc22/wg14/
* POSIX.1-2008 / IEEE Std 1003.1 http://pubs.opengroup.org/onlinepubs/9699919799/
* Linux system interfaces http://man7.org/linux/man-pages/
* Win API/Win32 API https://msdn.microsoft.com/en-us/library/windows/desktop/ff8...
Thats a lot of reading. A good starting point for a project is to code to the C standard and one abstract interface that wraps your main target OS. Then port portions of the implamentation for your interface to the various systems you need to run on. In reality there are a lot of specific factors that you need to take into account to design your portability strategy.
More importantly, where you say "A good starting point for a project..." is exactly the kind of know-how and practical advice that I have found hard to come by in this area of software engineering. Any idea on where to find more of it (blogs, articles) would be always welcome.