Clownfish(3pm)
π Clownfish β the symbiotic object system (from the Clownfish(3pm) manual) π
okay bestie, sit DOWN, because this one is genuinely iconic β¨
πΈ NAME πΈ
Clownfish β the Clownfish symbiotic object system π
π¦ DESCRIPTION π¦
So the Clownfish βsymbioticβ object system is, like, literally symbiotic β it pairs up with βhostβ programming language environments and helps you build high performance language extensions. it's giving partnership. it's giving mutualism. it's giving slay π
β¨ Features β¨
here's what it actually does, no cap:
- Support for multiple host languages π£οΈ
- Support for stand-alone C libraries and executables π₯
- Subclassing and method overriding from the host language π
- Support for host language idioms like named parameters or default argument values π
- Highly performant object system with lazy creation of host language objects ①(the way it just⦠doesn't make the object until it has to? obsessed)
- Runtime with classes for commonly used data structures like strings, dynamic arrays and hash tables π
- Guaranteed ABI stability when adding or reordering methods or instance variables β bestie this is the good stuff, fr fr
- Modularity π§©
- Introspection π
- Documentation generator π
π Planned features π
things that are, like, coming, we're manifesting:
- Support for more host languages π
- Support for interfaces π«Ά
π Overview π
Clownfish is two parts, and you have to know both or you'll be lost:
- the Clownfish compiler, aka
CFC - the Clownfish runtime
CFC is a code generator. it takes a set of Clownfish header files and creates C header files, host language bindings, initialization code and documentation out of them. then that generated code gets compiled with your other project code and linked with the Clownfish runtime. periodt.
Clownfish header files have a .cfh extension and they define classes used within the Clownfish object system. the object system itself is implemented in C and supports single inheritance and virtual method dispatch. CFC creates a C header file from each Clownfish header, containing the C interface to Clownfish objects. functions and methods of objects are implemented in normal C source files β nothing weird, just C. and beyond the C level, CFC can generate host language bindings so your Clownfish objects are accessible from other programming languages π. the compiler also creates class documentation in various formats from comments contained in Clownfish header files and from standalone Markdown files. multi-talented.
and the Clownfish runtime provides:
- The
Objclass which is the root of the class hierarchy π - Core data types like strings, dynamic arrays, and hashes π
- The
Classmetaclass π - Some helper classes π§
π Host language support π
bindings for the following hosts are under development:
- C (feature-complete) β
- Go (experimental) π§ͺ
- Perl 5 (feature-complete) β
- Python 3 / CPython (nascent) π£
- Ruby / MRI (nascent) π£
π Help wanted π
ngl, the target audience for the current release of Clownfish is developers. it's developed by the Lucy community, where it's used to provide host language bindings for the Lucy search engine library. and the expectation is that as Clownfish matures it will eventually spin off as an independent project π± β main character growth arc, honestly.
if you would like to contribute to Clownfish, please participate via https://github.com/lucysearch/lucy-clownfish π
π Documentation π
- Working with Clownfish classes
- Building Clownfish projects in C environments
- Writing Clownfish classes
lowkey reminder: this page isClownfish(3pm), a Perl 5 module manual β that's what the3pmis doing there, iykyk π«Ά
and that's the whole vibe check, bestie. this page shipped with perl v5.42.3, dated 2026-09-02, and it's filed under the user-contributed Perl documentation. go build something gorgeous with it π
β¨π
π¦ where this page comes from
- fedora 43: perl-Clownfish 0.8.0-1.fc43 Β· Apache-2.0
- fedora 44: perl-Clownfish 0.8.0-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms