Ok there is a real example in the readme and the code is a lot closer to actually working, not that I have run any of it yet.
@TheCedarPrince if you want to read over the examples and give me some feedback here or on github about the general idea and syntax, that would be a huge help (anyone else too).
See also Invariants.jl (documentation), which could serve as a base package to build a package for interface definitions on, and has taken some inspiration from previous discussions with @Raf
I havenât used Invariants yet in the examples as Iâm trying to write it in the simplest possible way, but I think returning Invariants will be the recommended method, instead of building any of the messaging code into Interfaces.jl.
Have you thought about making invariants a functor (invariant::Invariant)(x) = satisfies(invariant, x)? then we could just return an invariant for each condition of the interface instead of an anonymous function, making nicer syntax than x -> satisfies(invariant(......), x), and without a dependency on Invariants.jl.
Just some thoughts⌠IMO A big part of the composability complaints come from the fact that currently there is a lot of composability that works perfectly, but in general is undiscoverable. The process of discovering what works and what doesnât results in a lot of these bugs and a feeling like itâs guesswork to determine what will work between packages and what wonât.
Is there any interest for a solution that attacks a similar problem but without trying to get an interface standardized? Perhaps with help from an interface/testing library.
Iâm thinking of a website or something that essentially curates common packages and simply rates their composability with other packages, user submitted comments/issues allowed.
Possibly between two packages, maintainers of both should be able to submit composability issue and the consent of both is required to resolve them. (and if they canât agree to resolveâŚ.weâll isnât that the definition of a composability issue? ;)) Trolling is not much of a concern as again this is a manually curated list.
So that even if itâs not enforced in code, Julia users can at least have some idea of which packages will work together and tie in to the core ecosystem and which wonât.
This currently exists as a âcuratedâ package list GitHub - svaksha/Julia.jl: Curated decibans of Julia programming language. . But itâs not actually very curated at all with many packages being no longer maintained, and again, no indication of what you can use with what. Simple requirements should be something like:
Project is maintained and of enough interest to the community that maintenance is unlikely to end
Sufficient documentation of package via Documenter.jl
Reasonable but not programmatically enforced tests showing correctness when composed within other curated packages that are reasonable for users to assume work together
Iâm not sure curating is worth the effort. Better to write a test suite that pits packages against each other and we get to really find out what works with what in practice.
So for example, test packages that accept arrays with every single type of array. So instead of some rating there is just a test that fails.
Having a test package that provides âevery single kind of arrayâ would be super useful. Then packages can run whatever function they want over them all.