$ account gnustep
The GNUstep Base Library is a portable, open-source reimplementation of Apple's Foundation framework, providing the core non-graphical Objective-C classes for strings, collections, networking, serialization, date/time handling, and more. It serves as the foundational library for the GNUstep ecosystem, enabling cross-platform development on Unix, Windows, and Android. The library is monolithic in structure, with a public API mirroring Apple's Foundation headers and internal implementation modules for platform-specific concerns (e.g., threading, sockets, dynamic loading). Key entry points include the umbrella header Foundation.h and root classes like NSObject, NSString, and NSArray. External dependencies include libobjc2 (Objective-C runtime), ICU (Unicode), libxml2 (XML), libcurl (URL loading), and GnuTLS (TLS). The codebase is extensive and well-tested, but contains many stub implementations for newer macOS APIs and legacy compatibility layers, reflecting its long history and broad platform support.
This repository is the GNUstep Objective-C runtime library (libobjc2), a drop-in replacement for the GCC Objective-C runtime that implements the modern Objective-C runtime API for non-Apple platforms. It provides the core runtime services: message dispatch (via architecture-specific assembly fast paths and a C fallback), memory management (ARC retain/release, autorelease pools, weak references), block support, property access, exception handling (with C++ interop), and type-dependent dispatch. The architecture is a shared library with a modular design: loader.c handles module loading, selector_table.cc manages selector uniquing, class_table.c manages class loading and +load, sendmsg2.c implements message lookup, and arc.mm implements the ARC contract. It supports three ABIs (GCC legacy, GNUstep v1 non-fragile, GNUstep v2 modern) and runs on Linux, Windows, FreeBSD, Android, and WebAssembly. The codebase is well-structured with several reusable data structures (hopscotch hash tables, sparse arrays, platform-abstracted locks) and demonstrates strong engineering practices in performance-critical paths (cache-line alignment, atomic operations, copy-on-write dispatch tables). However, it carries significant complexity from legacy ABI compatibility and platform-specific ifdefs, and some components (C++ exception interop) rely on fragile runtime structure discovery.