A Clojure library providing facades and workarounds for common pain points like namespace organization, custom map types, and REPL-friendly protocols.
Potemkin is a Clojure library that provides facades and workarounds for common pain points in the language, such as namespace organization, custom map types, and REPL-friendly protocols. It helps developers decouple code structure from API design and reduce boilerplate when creating custom data structures.
Clojure developers building libraries or applications who need to manage namespace complexity, create custom map-like types, or improve REPL workflows with protocols and interfaces.
Developers choose Potemkin because it simplifies complex tasks with minimal code, offers REPL-friendly protocol definitions, and provides performance optimizations through interface-based alternatives to protocols.
some ideas which are almost good
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
import-vars allows functions, macros, and values to be defined in one namespace and exposed in another, solving the conflation of code layout and API design as described in the README for larger libraries like Ring.
def-map-type reduces custom map implementation to just six core functions (get, assoc, dissoc, keys, meta, with-meta) instead of dozens of interfaces, as shown in the LazyMap example.
defprotocol+ only creates new protocol instances when the body changes, preventing No implementation method exceptions during REPL reloads, a common pain point in vanilla Clojure.
definterface+ uses the same convention as defprotocol but generates interfaces for better performance and primitive argument support, addressing overhead issues highlighted in linked benchmarks.
Features like def-derived-map and def-map-type add delegation layers that can obscure underlying data structures, making debugging and performance profiling more challenging.
Adopting Potemkin's extensions (e.g., defprotocol+, definterface+) ties code to library-specific syntax, reducing portability if the library is deprecated or removed.
As a specialized library for advanced Clojure issues, it has limited community adoption, fewer learning resources, and potential compatibility risks with future Clojure versions.