Clownfish(3pm)

πŸ“¦
version 0.8.0 Β· 3 versions
, in fedora 43, fedora 44

πŸ’– 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:

  1. the Clownfish compiler, aka CFC
  2. 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 Obj class which is the root of the class hierarchy πŸ‘‘
  • Core data types like strings, dynamic arrays, and hashes πŸ“
  • The Class metaclass πŸ’…
  • 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 is Clownfish(3pm), a Perl 5 module manual β€” that's what the 3pm is 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