Jun 3, 2025, 4:28 AM
Δ
Jun 3, 2025, 5:39 AM
Julia InterfaceDesign post ProgrammingLanguages EntityRelationship Relational

Chris Rackauckas throws out a slew of interface-related points in this Discourse thread that seem really relevant to this notion I have in my head of function/relation/predicate intersectionality.

For example, == being required to return a Boolean…unless a missing is involved in the comparison, in which case a missing is returned. Is that wrong? Bad punning? Maybe! It kind of depends on what we decide == means and whether that’s useful. Fortunately(?), if we decide that namespacing gives the final say of semantic meaning of a function/relationship/predicate, the worst-case scenario for competing names is that a package uses their own definition and articulates what they mean by it.

In the case of == and missing, I actually think “borrowing” the meaning of Base.== makes sense and that it shouldn’t be restricted to only Boolean outputs:

Maybe this leads into a larger question of “who primarily handles specialization: entities(/types) or relationships(/functions/predicates)?” My gut reaction was to pawn it off on entities, but maybe it should be handled by more nuanced/redefined relations?

Looking through some of the challenges with array interfaces and indexing and stuff might lead to some more insights here.

One additional metric for generalizing any patterns here is how they actually get used. One of the cool things that Julia seems geared towards is highly generic code, where you can define a function as a composition of other functions and that allows it to “just work” on new types. But that composability kind of breaks down if we start having to use different functions (instead of different types) to do the thing that we want, because Julia dispatches just one semantic function based on type—you can’t suddenly say “I want to use namespace X’s definition of foo if I see type Y.”