FOL: Bridging Object-Oriented and Functional Programming via the Metaobject Protocol
Clojure [16] omits CLOS; Hickey [17] argues that mutable objectsare a complexity hazard incompatible with immutability ratherthan the power boost CLOS offers. In FOL (Functional Object Lisp),we use the Metaobject Protocol (MOP) to back instances with per-sistent structures, preserving CLOS’s open dispatch model whileenforcing immutable reference semantics. FOL contributes a per-sistent metaclass with hybrid storage and lazy migration, and aspecficity-ordered predicate dispatch model.FOL’s slot reads incur 1.4–2.2×overhead; slot updates cost 40–250×in isolation. At idiomatic workload scales, FOL is 5–44×slowerthan mutable CLOS; for direct translation of fine-grained mutablealgorithms (e.g., AST rewriting), overhead reaches 202×. However,at extreme scale, persistent state maps avoid memory fragmenta-tion that degrades the mutable baseline, yielding a 3.8×runtimeadvantage in our logic simulation benchmark (Section 5.4). Pred-icate dispatch uses a level-based ordering sorted at each method-definition in O(ND log N)(D = hierarchy depth), avoiding the pair-wise theorem-prover overhead of subsumption systems; the trade-off is an O(N)per-call linear scan (vs. O(1) cached dispatch), withclosed defn dispatch indistinguishable from hand-written condcascades (≈2.0×).
Authors
- Frank Adrian
Institutions
- Australian and New Zealand College of Anaesthetists (AU)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-05-11
- DOI
- https://doi.org/10.5281/zenodo.20110348
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00