1Clownfish(3pm) User Contributed Perl Documentation Clownfish(3pm)
2
3
4
6 Clownfish - Apache Clownfish symbiotic object system
7
9 The Apache Clownfish “symbiotic” object system pairs with “host”
10 programming language environments and facilitates the development of
11 high performance language extensions.
12
13 Features
14 • Support for multiple host languages.
15
16 • Support for stand-alone C libraries and executables.
17
18 • Subclassing and method overriding from the host language.
19
20 • Support for host language idioms like named parameters or default
21 argument values.
22
23 • Highly performant object system with lazy creation of host language
24 objects.
25
26 • Runtime with classes for commonly used data structures like
27 strings, dynamic arrays and hash tables.
28
29 • Guaranteed ABI stability when adding or reordering methods or
30 instance variables.
31
32 • Modularity.
33
34 • Introspection.
35
36 • Documentation generator.
37
38 Planned features
39 • Support for more host languages.
40
41 • Support for interfaces.
42
43 Overview
44 Clownfish consists of two parts, the Clownfish compiler “CFC” and the
45 Clownfish runtime. CFC is a code generator that creates C header files,
46 host language bindings, initialization code and documentation from a
47 set of Clownfish header files. The generated code is compiled with
48 other project code and linked with the Clownfish runtime.
49
50 Clownfish header files have a ".cfh" extension and define classes used
51 within the Clownfish object system. The object system is implemented in
52 C and supports single inheritance and virtual method dispatch. CFC
53 creates a C header file from each Clownfish header containing the C
54 interface to Clownfish objects. Functions and methods of objects are
55 implemented in normal C source files. Beyond the C level, CFC can
56 generate host language bindings to make Clownfish objects accessible
57 from other programming languages. The compiler also creates class
58 documentation in various formats from comments contained in Clownfish
59 header files and standalone Markdown files.
60
61 The Clownfish runtime provides:
62
63 • The Obj class which is the root of the class hierarchy.
64
65 • Core data types like strings, dynamic arrays, and hashes.
66
67 • The Class metaclass.
68
69 • Some helper classes.
70
71 Host language support
72 Bindings for the following hosts are under development:
73
74 • C (feature-complete)
75
76 • Go (experimental)
77
78 • Perl 5 (feature-complete)
79
80 • Python 3 / CPython (nascent)
81
82 • Ruby / MRI (nascent)
83
84 Help wanted
85 The target audience for the current release of Clownfish is developers.
86 Clownfish is developed by the Apache Lucy community, where it is used
87 to provide host language bindings for the Lucy search engine library;
88 we expect that as Clownfish matures it will eventually spin off as an
89 independent project. If you would like to contribute to Clownfish,
90 please join the Lucy developers mailing list
91 <http://lucy.apache.org/mailing_lists>.
92
93 Documentation
94 • Working with Clownfish classes
95
96 • Building Clownfish projects in C environments
97
98 • Writing Clownfish classes
99
100
101
102perl v5.38.0 2023-07-20 Clownfish(3pm)