Harmonica is a Python library for forward modeling, processing, and inversion of gravity and magnetic data, part of the Fatiando a Terra project. It provides high-performance, Numba-accelerated kernels for computing gravitational and magnetic fields of various geometric bodies (prisms, tesseroids, point masses, ellipsoids, dipoles) and supports equivalent source interpolation, frequency-domain grid transformations (upward continuation, reduction to pole, derivatives), spherical harmonic models (IGRF), and Euler deconvolution. The library is designed for geoscientists and educators, integrating tightly with the scientific Python ecosystem (xarray, scikit-learn, pygmt, verde). It features a scikit-learn-like API for its gridder classes, extensive documentation and testing, and is actively maintained as part of the Fatiando project. While its core functionality is domain-specific, the code exhibits strong software engineering practices: modular architecture, Numba JIT compilation, consistent interfaces, and comprehensive CI/CD.
Gravity is an embeddable, dynamically typed scripting language written in portable C99 with no external dependencies beyond the C standard library. The repository implements a full language toolchain: a multi-pass compiler (lexer, Pratt parser, AST, IR, optimizer, bytecode codegen) and a register-based virtual machine with mark-and-sweep garbage collection. It provides a CLI (`gravity` executable) for running scripts and a well-defined C embedding API. The architecture is modular, with clear separation between compiler (`src/compiler`), runtime (`src/runtime`), shared utilities (`src/shared`), and optional modules (Math, File, JSON, ENV). The codebase is extensively tested with unit tests (embedded `#unittest` blocks) and a large fuzzing corpus for crash resistance. Despite some monolithic files (`gravity_core.c` >4000 lines) and heavy macro usage, the implementation demonstrates strong software engineering craftsmanship, especially in the hash table, dynamic array macros, and Pratt parser. The project appears to be under active maintenance (last commit 2026-08-05, 34 open issues, 4.5k stars) but shows some technical drift such as outdated CI configurations, platform-specific ifdefs, and a fuzz corpus from 2017.