Resources

Estimated reading time: 6 minutes

The core of our software is written in C++ (and may interface with C and Objective-C), relies on the CMake build system, and targets macOS, Windows, and GNU/Linux. If you are looking to contribute, you might find the following resources handy.

CMake

(Book) Professional CMake. The best book to learn CMake in-depth, including following best practices. It directly inspired many of the CMake utilities we ship with Noa.

(Website) CMake Reference Documentation. The official authoritative CMake documentation. Pro Tip: If you are a macOS user, you can download the CMake Reference Documentation for offline consumption through the Homebrew cmake-docs formula and create a browser bookmark to .file:///opt/homebrew/share/doc/cmake/html/genindex.html for easy searching

C++

(Book) The C++ Programming Language (4th Edition). While there is no single book that covers the entirery of C++ (mainly when it comes to more modern versions), this one gets close. Its written by the original author of C++ and considered by many the bible of modern C++.

(Website) C++ Reference. The most complete reference documentation for C++. Signing up allows to tweak site settings to your liking. Pro Tip: You can download the documentation for offline consumption here.

(Standard) ISO C++. While its mostly for implementors, it is the source of truth for what is compliant across compilers and can be handy for areas of C++ that documentation sites fail to properly describe. Pro Tip: You can access the work-in-progress drafts for free on GitHub.

(Specification) Itanium C++ ABI and its Exception Handling companion. Defines foundational guidance for increased C++ interoperability across compilers. It is what libunwind (_Unwind_* functions), and libcxxabi (__cxa_* functions) on LLVM implement to support the C++ language (other major compilers like GCC do as well). You rarely need to worry about this, but it can be useful to understand what happens under the hood to make more sense of stack traces and help with reverse engineering of C++ binaries.

(Website) Compiler Explorer. A convenient web application to understand the assembly that various compilers would generate on different configurations. Pro Tip: Hovering over the assembly instructions shows human-readable explanations.

(Website) C++ Insights. A convenient web application that reveals how compilers convert higher-level C++ language abstractions into lower-level constructs during the compilation process. It helps a lot with understanding how C++ works.

(Code) LLVM C++ Standard Library. The LLVM implementation of the std namespace, which you can use to understand how built-in containers, algorithms, and utilities are implemented. Pro Tip: you can compile a program against a custom build of the standard library, allowing you to better step through and profile non-template-related standard library usage. Also see Debugging the C++ standard library on macOS, a post discussing how to do it on macOS.

C

(Code) XNU C Standard Library. To consult Darwin’s C standard library and POSIX implementation (originally derived from FreeBSD), which powers every Apple platform. However, keep in mind that Apple only releases snapshots of XNU at certain intervals, so don’t expect the code to match what’s on modern devices.

(Standard) IEEE POSIX C Standard. This is the standard that defines the C interfaces that POSIX systems must adhere too. A must have if you expect to do any lower-level systems engineering on POSIX based platforms like macOS and GNU/Linux.

Objective-C

(Application) RuntimeBrowser. An unmaintained, but still working, native macOS and iOS application to browser public and private Objective-C frameworks that ship with macOS and iOS. Can be useful if you need to understand and potentially use private APIs that Apple doesn’t publicly document. Also see Exploring macOS private frameworks, a post that teaches techniques for exploring private macOS Objective-C frameworks using the RuntimeBrowser application and other tools.

macOS

(Application) Xcode Instruments. The de-facto profiling and performance analysis tool for Apple platforms (largely a frontend to DTrace), which comes as a standalone desktop application shipped as part of the Xcode package. See Using Xcode Instruments for C++ CPU profiling and Emitting Signposts to Instruments on macOS using C++ for more detailed information on using Instruments for C++ performance analysis.

(Specification) Mach-O File Format Reference. The original Apple reference documentation for the Mach-O binary format, to understand how executable binaries and shared libraries work on macOS. You might be also interested in A deep dive on macOS universal binaries, a post that discusses Mach-O universal binaries in more depth.

(Application) MachOView. An abandoned, but still working, native desktop application to explore Mach-O files in a more user-friendly manner. Homebrew continues to offer it as a cask called machoview.

(Website) Apple Developer macOS Performance Tools. A guide to the various utilities included in macOS for system and performance analysis, such as vm_stat(1), leaks(1), malloc_history(1), and heap(1). While these tools can be useful, for C++ development we recommend learning DTrace and Instruments instead. If you are looking for general information about the CPU and caches available on your system, try sysctl -a hw machdep.cpu and lstopo(1) from hwloc.

(Book) DTrace: Dynamic Tracing in Oracle Solaris, Mac OS X and FreeBSD. The best resource to learn how to use the DTrace tool that ships with macOS for advanced kernel and user dynamic tracing. While its non-trivial to learn and use, it is considered to be the ultimate tool for performance analysis on macOS. Pro Tip: macOS ships with DTraceToolkit, a collection of premade DTrace scripts for a variety of use cases.

(Book) Advanced Apple Debugging & Reverse Engineering, 3rd Edition. An in-depth guide to reverse engineering in Apple platforms with a strong focus on LLDB. Even if reverse engineering is not your focus, this book teaches valuable general-purpose debugging skills and LLDB tricks that apply to software engineering.

(Application) Hopper Disassembler. A great disassembler desktop application for macOS with deep understanding of Apple frameworks and Mach-O. While Hopper offers a license, the time-boxed free version is enough for most cases. The paid version unlocks an LLDB frontend that can be particularly useful for stepping through assembly code. Also see Exploring macOS private frameworks, a post that teaches techniques for exploring private macOS Objective-C frameworks using the Hopper application and other tools._

(Specification) Arm Instruction Set Reference Guide Version 1.0. A freely-available and searchable reference document for the ARM instruction set that Apple Silicon adopts. Also see HelloSilicon, an adaptation of the Programming with 64-Bit ARM Assembly Language popular book to Apple Silicon.

(Book) MacOS and iOS Internals, Volume I: User Mode, MacOS and iOS Internals, Volume II: Kernel Mode, and MacOS and iOS Internals, Volume III: Security & Insecurity. The industry standard book trilogy describing the internals of Apple operating systems.

(Standard) DWARF Debugging Information Format v4. The underlying format used by *.dSYM debugging symbols on Apple platforms. It can help understanding the human-readable output of dwarfdump(1).

GNU/Linux

(Application) Intel VTune Profiler. A great commercial profiler for high-performace computing profiler for Intel and AMD x86-based processors with advanced analysis tools. It is available for free and supports various popular distributions. However, it can be tricky to setup. See Running the Intel VTune Profiler on Fedora for Fedora-specific instructions.