I guess the common API should be function-based, like Chris said, not type-based.
But not every user will want to define their own output types - if I just write a likelihood function quickly, returning a NamedTuple
or a standard centrally defined return type would be convenient.
So if we can agree on some “recipes for target functions” package, maybe it’s “get-log-value” and “get-log-value-and-gradient” functions (I’ll leave the function names up for discussion) could support (logval = ..., grad_logval = [...])
out-of-the-box. And possibly some other standard return value types that we’d define in that package.